@oiz/stzh-components 4.14.0-beta1 → 4.14.0-beta2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-BjyL8NcL.js → index-8pIS_zqo.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stzh-accordion_3.cjs.entry.js +2 -2
- package/dist/cjs/stzh-actions_6.cjs.entry.js +1 -1
- package/dist/cjs/stzh-actionset.cjs.entry.js +1 -1
- package/dist/cjs/stzh-amount.cjs.entry.js +1 -1
- package/dist/cjs/stzh-anchornav.cjs.entry.js +1 -1
- package/dist/cjs/stzh-app-nav.cjs.entry.js +1 -1
- package/dist/cjs/stzh-appointments.cjs.entry.js +1 -1
- package/dist/cjs/stzh-archivelist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-audio.cjs.entry.js +1 -1
- package/dist/cjs/stzh-badge_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-banner.cjs.entry.js +1 -1
- package/dist/cjs/stzh-breadcrumb_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-buttongroup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-calendar.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card-navigation.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card-searchresult.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card-superteaser.cjs.entry.js +1 -1
- package/dist/cjs/stzh-card_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-carousel.cjs.entry.js +1 -1
- package/dist/cjs/stzh-chart.cjs.entry.js +1 -1
- package/dist/cjs/stzh-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/stzh-checkboxgroup.cjs.entry.js +2 -2
- package/dist/cjs/stzh-chip_2.cjs.entry.js +2 -2
- package/dist/cjs/stzh-chipgroup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-clamp.cjs.entry.js +1 -1
- package/dist/cjs/stzh-company-logo.cjs.entry.js +1 -1
- package/dist/cjs/stzh-components.cjs.js +1 -1
- package/dist/cjs/stzh-contact-cv.cjs.entry.js +1 -1
- package/dist/cjs/stzh-contact.cjs.entry.js +1 -1
- package/dist/cjs/stzh-container_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-content.cjs.entry.js +1 -1
- package/dist/cjs/stzh-cta.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datalist_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datamessagelist-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datamessagelist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datatable.cjs.entry.js +1 -1
- package/dist/cjs/stzh-datepicker_3.cjs.entry.js +2 -2
- package/dist/cjs/stzh-daterange.cjs.entry.js +1 -1
- package/dist/cjs/stzh-details.cjs.entry.js +1 -1
- package/dist/cjs/stzh-dialog.cjs.entry.js +1 -1
- package/dist/cjs/stzh-disturber.cjs.entry.js +1 -1
- package/dist/cjs/stzh-dropdown.cjs.entry.js +2 -2
- package/dist/cjs/stzh-editor.cjs.entry.js +1 -1
- package/dist/cjs/stzh-eventdata.cjs.entry.js +1 -1
- package/dist/cjs/stzh-eventinfo.cjs.entry.js +1 -1
- package/dist/cjs/stzh-feedreader-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-feedreader.cjs.entry.js +1 -1
- package/dist/cjs/stzh-figure.cjs.entry.js +1 -1
- package/dist/cjs/stzh-flyingfocus.cjs.entry.js +1 -1
- package/dist/cjs/stzh-footer.cjs.entry.js +1 -1
- package/dist/cjs/stzh-gallery.cjs.entry.js +1 -1
- package/dist/cjs/stzh-geo-ref-data.cjs.entry.js +1 -1
- package/dist/cjs/stzh-ghettobox.cjs.entry.js +1 -1
- package/dist/cjs/stzh-header_3.cjs.entry.js +1 -1
- package/dist/cjs/stzh-heading.cjs.entry.js +1 -1
- package/dist/cjs/stzh-homepage-search.cjs.entry.js +1 -1
- package/dist/cjs/stzh-homepage-service-highlights.cjs.entry.js +1 -1
- package/dist/cjs/stzh-hr.cjs.entry.js +1 -1
- package/dist/cjs/stzh-hspace.cjs.entry.js +1 -1
- package/dist/cjs/stzh-http-error.cjs.entry.js +1 -1
- package/dist/cjs/stzh-iframe.cjs.entry.js +1 -1
- package/dist/cjs/stzh-imagecomparison.cjs.entry.js +1 -1
- package/dist/cjs/{stzh-input-description-CAYSgH8K.js → stzh-input-description-DWYIX4rj.js} +1 -1
- package/dist/cjs/stzh-input.cjs.entry.js +2 -2
- package/dist/cjs/stzh-invert.cjs.entry.js +1 -1
- package/dist/cjs/stzh-link.cjs.entry.js +1 -1
- package/dist/cjs/stzh-linklist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-list_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-loader.cjs.entry.js +1 -1
- package/dist/cjs/stzh-loadingbar.cjs.entry.js +1 -1
- package/dist/cjs/stzh-menu_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-message.cjs.entry.js +1 -1
- package/dist/cjs/stzh-microsite-teaserlist.cjs.entry.js +1 -1
- package/dist/cjs/stzh-monthyearpicker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-offline-indicator.cjs.entry.js +1 -1
- package/dist/cjs/stzh-page-skiplinks.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagebottom.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagecontent.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle-hero.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle-home.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pagetitle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-panorama.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-content-navigation.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-menu.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-pagetitle.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-quote.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser-layout-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser-layout.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pi-teaser.cjs.entry.js +1 -1
- package/dist/cjs/stzh-pkzh-qr.cjs.entry.js +1 -1
- package/dist/cjs/stzh-popover.cjs.entry.js +1 -1
- package/dist/cjs/stzh-print_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-quote.cjs.entry.js +1 -1
- package/dist/cjs/stzh-rating.cjs.entry.js +2 -2
- package/dist/cjs/stzh-ratio.cjs.entry.js +1 -1
- package/dist/cjs/stzh-readspeaker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-richtext.cjs.entry.js +1 -1
- package/dist/cjs/stzh-saptcha.cjs.entry.js +1 -1
- package/dist/cjs/stzh-scrollup.cjs.entry.js +1 -1
- package/dist/cjs/stzh-search.cjs.entry.js +1 -1
- package/dist/cjs/stzh-section.cjs.entry.js +1 -1
- package/dist/cjs/stzh-show.cjs.entry.js +1 -1
- package/dist/cjs/stzh-sitemap.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-portal-mitwirken.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skin-storybook-preview.cjs.entry.js +1 -1
- package/dist/cjs/stzh-skiplink.cjs.entry.js +1 -1
- package/dist/cjs/stzh-socialmediastream-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-socialmediastream.cjs.entry.js +1 -1
- package/dist/cjs/stzh-stepper-item.cjs.entry.js +1 -1
- package/dist/cjs/stzh-stepper.cjs.entry.js +1 -1
- package/dist/cjs/stzh-sticky-actions.cjs.entry.js +1 -1
- package/dist/cjs/stzh-sticky.cjs.entry.js +1 -1
- package/dist/cjs/stzh-table.cjs.entry.js +1 -1
- package/dist/cjs/stzh-text.cjs.entry.js +1 -1
- package/dist/cjs/stzh-textandimage.cjs.entry.js +1 -1
- package/dist/cjs/stzh-timeline-item.cjs.entry.js +2 -2
- package/dist/cjs/stzh-timeline.cjs.entry.js +1 -1
- package/dist/cjs/stzh-timepicker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-toast_2.cjs.entry.js +1 -1
- package/dist/cjs/stzh-toggle.cjs.entry.js +2 -2
- package/dist/cjs/stzh-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/stzh-twocolumns.cjs.entry.js +1 -1
- package/dist/cjs/stzh-upload.cjs.entry.js +2 -2
- package/dist/cjs/stzh-vbz-carousel.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-connection-finder.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-intro.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-linechip.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-majorticker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vbz-ticker.cjs.entry.js +1 -1
- package/dist/cjs/stzh-visuallyhidden.cjs.entry.js +1 -1
- package/dist/cjs/stzh-vspace.cjs.entry.js +1 -1
- package/dist/cjs/stzh-youtube.cjs.entry.js +1 -1
- package/dist/collection/components/stzh-accordion-item/stzh-accordion-item.css +0 -4
- package/dist/collection/components/stzh-timeline-item/stzh-timeline-item.css +1 -9
- package/dist/components/index.js +2 -2
- package/dist/components/{p-UOXX4td7.js → p-2IanoK6f.js} +10 -10
- package/dist/components/{p-i0cZMmrd.js → p-2eHByO1P.js} +2 -2
- package/dist/components/{p-D3sOQDxz.js → p-3Ua0UDJJ.js} +6 -6
- package/dist/components/{p-Bt9uiQ1v.js → p-4kJS088Z.js} +1 -1
- package/dist/components/{p-CBOJCWB7.js → p-5gaDXIxD.js} +5 -5
- package/dist/components/{p-wIymabO8.js → p-6yo1sg5m.js} +1 -1
- package/dist/components/{p-CHyYIJpm.js → p-8EMsIQw7.js} +5 -5
- package/dist/components/{p-DsgUX28Z.js → p-B6GMY7LV.js} +2 -2
- package/dist/components/{p-CvBWG31G.js → p-BH9Bs6qn.js} +2 -2
- package/dist/components/{p-BMv7sSvH.js → p-BHbEjc4x.js} +4 -4
- package/dist/components/{p-DnvMN_b9.js → p-BMqbzRUD.js} +2 -2
- package/dist/components/{p-BjqyYqFW.js → p-BOQpiUeo.js} +3 -3
- package/dist/components/{p-Cp02ugtk.js → p-BOr0_MQa.js} +4 -4
- package/dist/components/{p-Dfd_RRRl.js → p-BQHGXh_b.js} +1 -1
- package/dist/components/{p-HNkHGJ14.js → p-BQbRJRFi.js} +1 -1
- package/dist/components/{p-DjpPphjj.js → p-BRBZLS7B.js} +5 -5
- package/dist/components/{p-DnqIc6zY.js → p-BTjiX1Y0.js} +3 -3
- package/dist/components/{p-DKd1JxAL.js → p-BZ34QLgO.js} +1 -1
- package/dist/components/{p-8gU3RSt8.js → p-BbFfhoBL.js} +1 -1
- package/dist/components/{p-Dw4bMcwB.js → p-Behwp7NV.js} +1 -1
- package/dist/components/{p-DCT5VT3M.js → p-BloYT0LY.js} +7 -7
- package/dist/components/{p-Bj_U__pI.js → p-Bq5Q3kWn.js} +1 -1
- package/dist/components/{p-DIqSS9ry.js → p-BrZnz58u.js} +1 -1
- package/dist/components/{p-DHJ8KZwl.js → p-BrrVCt_R.js} +8 -8
- package/dist/components/{p-DKqV_9uA.js → p-BssCZb6Z.js} +4 -4
- package/dist/components/{p-B26HCQs-.js → p-BzQSGrtD.js} +1 -1
- package/dist/components/{p-DYEZYm_O.js → p-C8WzRCnK.js} +5 -5
- package/dist/components/{p-h9fKsq5B.js → p-CChlc2sd.js} +1 -1
- package/dist/components/{p-CeAUcqgd.js → p-CHgu01jm.js} +1 -1
- package/dist/components/{p-BkhRIMVJ.js → p-CJTxKmUX.js} +2 -2
- package/dist/components/{p-yN9c1DyI.js → p-CQnZmf9r.js} +1 -1
- package/dist/components/{p-Dor0XEly.js → p-CVGku1o-.js} +7 -7
- package/dist/components/{p-B7NezdKD.js → p-CVLlD_E2.js} +1 -1
- package/dist/components/{p-Do-CiF9w.js → p-CZplQgZu.js} +1 -1
- package/dist/components/{p--u95wToN.js → p-CbDFy9Fo.js} +3 -3
- package/dist/components/{p-D9eLTQd-.js → p-Cjs7Jcse.js} +1 -1
- package/dist/components/{p-RMGZWVav.js → p-ClfdOAMy.js} +1 -1
- package/dist/components/{p-Cid4uNNv.js → p-Cm1c1N2x.js} +1 -1
- package/dist/components/{p-DjCjEAVQ.js → p-CmFWMe-3.js} +5 -5
- package/dist/components/{p-DeBWkSxo.js → p-CpzHBI6X.js} +1 -1
- package/dist/components/{p-D6E6F4aF.js → p-CtBT-VCd.js} +5 -5
- package/dist/components/{p-8q4PHJXa.js → p-CtzFNHLa.js} +2 -2
- package/dist/components/{p-C_PfpEL0.js → p-Cx2JWcaO.js} +4 -4
- package/dist/components/{p-DkNgNpXb.js → p-D-4Jhh4z.js} +1 -1
- package/dist/components/{p-Br07rhm8.js → p-D-jcH-4I.js} +3 -3
- package/dist/components/{p-Bhtzoqfa.js → p-DMX6uiZb.js} +1 -1
- package/dist/components/{p-DCsBYLeO.js → p-DOqosYZr.js} +9 -9
- package/dist/components/{p-DwFJ-Wxd.js → p-DRrB9gB5.js} +2 -2
- package/dist/components/{p-m8afbhwM.js → p-DVO_TIwx.js} +1 -1
- package/dist/components/{p-r4YxGjy1.js → p-DVf2uZyT.js} +4 -4
- package/dist/components/{p-B1BwDtqN.js → p-Dc6uF5_x.js} +5 -5
- package/dist/components/{p-BCEgoUas.js → p-DeMs1oiH.js} +5 -5
- package/dist/components/{p-wxRxj6hm.js → p-Dfl1Nkmr.js} +6 -6
- package/dist/components/{p-Bf1Q575A.js → p-Dnc0DTZ5.js} +9 -9
- package/dist/components/{p-S7fOqfOp.js → p-DoUnSYSA.js} +5 -5
- package/dist/components/{p-ufvUzT-J.js → p-DtptXwIF.js} +9 -9
- package/dist/components/{p-Bg977459.js → p-Du-frgAm.js} +7 -7
- package/dist/components/{p-D585JdEP.js → p-DwcMcEkY.js} +1 -1
- package/dist/components/{p-DYUAT-g1.js → p-Dwn3qUNg.js} +1 -1
- package/dist/components/{p-DX5Q3fDQ.js → p-Dzj_-yk5.js} +1 -1
- package/dist/components/{p-DdmoIwC5.js → p-EAo1u3f4.js} +1 -1
- package/dist/components/{p-LfpauPL4.js → p-ED51q73M.js} +10 -10
- package/dist/components/{p-hpTi-ftL.js → p-PLkCSgMP.js} +7 -7
- package/dist/components/{p-BSHphqyH.js → p-UXlY8dSP.js} +1 -1
- package/dist/components/{p-CSrWsVkq.js → p-Z7XNPwIt.js} +4 -4
- package/dist/components/{p-DkHLvEs_.js → p-apzDzwmA.js} +1 -1
- package/dist/components/{p-ar7AR0d8.js → p-dLOXXDZv.js} +1 -1
- package/dist/components/{p-k67lKTGz.js → p-l2VklTZX.js} +1 -1
- package/dist/components/stzh-accordion-item.js +1 -1
- package/dist/components/stzh-accordion.js +1 -1
- package/dist/components/stzh-actions.js +1 -1
- package/dist/components/stzh-actionset.js +1 -1
- package/dist/components/stzh-amount.js +9 -9
- package/dist/components/stzh-anchornav.js +5 -5
- package/dist/components/stzh-app-nav.js +1 -1
- package/dist/components/stzh-appointments.js +13 -13
- package/dist/components/stzh-archivelist.js +7 -7
- package/dist/components/stzh-audio.js +5 -5
- package/dist/components/stzh-badge.js +1 -1
- package/dist/components/stzh-banner.js +4 -4
- package/dist/components/stzh-breadcrumb.js +1 -1
- package/dist/components/stzh-button.js +1 -1
- package/dist/components/stzh-buttongroup.js +1 -1
- package/dist/components/stzh-calendar.js +1 -1
- package/dist/components/stzh-card-navigation.js +2 -2
- package/dist/components/stzh-card-searchresult.js +14 -14
- package/dist/components/stzh-card-superteaser.js +14 -14
- package/dist/components/stzh-card.js +1 -1
- package/dist/components/stzh-cardlist.js +1 -1
- package/dist/components/stzh-carousel.js +1 -1
- package/dist/components/stzh-cell.js +1 -1
- package/dist/components/stzh-chart.js +1 -1
- package/dist/components/stzh-checkbox.js +1 -1
- package/dist/components/stzh-checkboxgroup.js +5 -5
- package/dist/components/stzh-chip.js +1 -1
- package/dist/components/stzh-chipgroup.js +1 -1
- package/dist/components/stzh-chipselect.js +1 -1
- package/dist/components/stzh-clamp.js +1 -1
- package/dist/components/stzh-company-logo.js +1 -1
- package/dist/components/stzh-contact-cv.js +4 -4
- package/dist/components/stzh-contact.js +10 -10
- package/dist/components/stzh-container.js +1 -1
- package/dist/components/stzh-content.js +1 -1
- package/dist/components/stzh-cspace.js +1 -1
- package/dist/components/stzh-cta.js +3 -3
- package/dist/components/stzh-datalist-item.js +1 -1
- package/dist/components/stzh-datalist.js +1 -1
- package/dist/components/stzh-datamessagelist-item.js +11 -11
- package/dist/components/stzh-datamessagelist.js +1 -1
- package/dist/components/stzh-datatable.js +16 -16
- package/dist/components/stzh-datepicker.js +1 -1
- package/dist/components/stzh-daterange.js +4 -4
- package/dist/components/stzh-details.js +1 -1
- package/dist/components/stzh-dialog.js +1 -1
- package/dist/components/stzh-disturber.js +4 -4
- package/dist/components/stzh-dropdown.js +1 -1
- package/dist/components/stzh-editor.js +4 -4
- package/dist/components/stzh-eventdata.js +1 -1
- package/dist/components/stzh-eventinfo.js +5 -5
- package/dist/components/stzh-feedreader-item.js +2 -2
- package/dist/components/stzh-feedreader.js +8 -8
- package/dist/components/stzh-fieldset.js +1 -1
- package/dist/components/stzh-figure.js +1 -1
- package/dist/components/stzh-flyingfocus.js +1 -1
- package/dist/components/stzh-footer.js +4 -4
- package/dist/components/stzh-gallery.js +8 -8
- package/dist/components/stzh-geo-ref-data.js +24 -24
- package/dist/components/stzh-ghettobox.js +4 -4
- package/dist/components/stzh-header.js +1 -1
- package/dist/components/stzh-heading.js +1 -1
- package/dist/components/stzh-homepage-search.js +2 -2
- package/dist/components/stzh-homepage-service-highlights.js +6 -6
- package/dist/components/stzh-hr.js +1 -1
- package/dist/components/stzh-hspace.js +1 -1
- package/dist/components/stzh-http-error.js +6 -6
- package/dist/components/stzh-icon.js +1 -1
- package/dist/components/stzh-iframe.js +1 -1
- package/dist/components/stzh-imagecomparison.js +2 -2
- package/dist/components/stzh-input.js +1 -1
- package/dist/components/stzh-invert.js +1 -1
- package/dist/components/stzh-link.js +1 -1
- package/dist/components/stzh-linklist.js +10 -10
- package/dist/components/stzh-list-item.js +1 -1
- package/dist/components/stzh-list.js +1 -1
- package/dist/components/stzh-loader.js +1 -1
- package/dist/components/stzh-loadingbar.js +1 -1
- package/dist/components/stzh-menu-item.js +1 -1
- package/dist/components/stzh-menu.js +1 -1
- package/dist/components/stzh-message.js +1 -1
- package/dist/components/stzh-microsite-teaserlist.js +20 -20
- package/dist/components/stzh-monthyearpicker.js +5 -5
- package/dist/components/stzh-offline-indicator.js +6 -6
- package/dist/components/stzh-olmap.js +1 -1
- package/dist/components/stzh-overlay.js +1 -1
- package/dist/components/stzh-page-skiplinks.js +1 -1
- package/dist/components/stzh-pagebottom.js +8 -8
- package/dist/components/stzh-pagecontent.js +1 -1
- package/dist/components/stzh-pagetitle-hero.js +1 -1
- package/dist/components/stzh-pagetitle-home.js +2 -2
- package/dist/components/stzh-pagetitle.js +2 -2
- package/dist/components/stzh-pagination.js +1 -1
- package/dist/components/stzh-panorama.js +11 -11
- package/dist/components/stzh-pi-content-navigation.js +3 -3
- package/dist/components/stzh-pi-menu.js +3 -3
- package/dist/components/stzh-pi-pagetitle.js +2 -2
- package/dist/components/stzh-pi-quote.js +1 -1
- package/dist/components/stzh-pi-teaser-layout-item.js +1 -1
- package/dist/components/stzh-pi-teaser-layout.js +2 -2
- package/dist/components/stzh-pi-teaser.js +2 -2
- package/dist/components/stzh-pkzh-qr.js +20 -20
- package/dist/components/stzh-popover.js +1 -1
- package/dist/components/stzh-print.js +1 -1
- package/dist/components/stzh-quote.js +1 -1
- package/dist/components/stzh-radio.js +1 -1
- package/dist/components/stzh-radiogroup.js +1 -1
- package/dist/components/stzh-rating.js +5 -5
- package/dist/components/stzh-ratio.js +1 -1
- package/dist/components/stzh-readspeaker.js +4 -4
- package/dist/components/stzh-richtext.js +2 -2
- package/dist/components/stzh-row.js +1 -1
- package/dist/components/stzh-saptcha.js +7 -7
- package/dist/components/stzh-scrollup.js +1 -1
- package/dist/components/stzh-search.js +16 -16
- package/dist/components/stzh-section.js +1 -1
- package/dist/components/stzh-share.js +1 -1
- package/dist/components/stzh-show.js +1 -1
- package/dist/components/stzh-sitemap.js +9 -9
- package/dist/components/stzh-skin-portal-mitwirken.js +1 -1
- package/dist/components/stzh-skin-storybook-preview.js +1 -1
- package/dist/components/stzh-skiplink.js +1 -1
- package/dist/components/stzh-socialmediastream-item.js +1 -1
- package/dist/components/stzh-socialmediastream.js +6 -6
- package/dist/components/stzh-sortable.js +1 -1
- package/dist/components/stzh-space.js +1 -1
- package/dist/components/stzh-status.js +1 -1
- package/dist/components/stzh-stepper-item.js +1 -1
- package/dist/components/stzh-stepper.js +3 -3
- package/dist/components/stzh-sticky-actions.js +2 -2
- package/dist/components/stzh-sticky.js +1 -1
- package/dist/components/stzh-table.js +1 -1
- package/dist/components/stzh-tag.js +1 -1
- package/dist/components/stzh-text.js +1 -1
- package/dist/components/stzh-textandimage.js +1 -1
- package/dist/components/stzh-timeline-item.js +4 -4
- package/dist/components/stzh-timeline.js +1 -1
- package/dist/components/stzh-timepicker.js +5 -5
- package/dist/components/stzh-toast.js +1 -1
- package/dist/components/stzh-toastbar.js +1 -1
- package/dist/components/stzh-toggle.js +5 -5
- package/dist/components/stzh-tooltip.js +1 -1
- package/dist/components/stzh-twocolumns.js +1 -1
- package/dist/components/stzh-upload.js +13 -13
- package/dist/components/stzh-vbz-carousel.js +2 -2
- package/dist/components/stzh-vbz-connection-finder.js +1 -1
- package/dist/components/stzh-vbz-intro.js +5 -5
- package/dist/components/stzh-vbz-linechip.js +1 -1
- package/dist/components/stzh-vbz-majorticker.js +7 -7
- package/dist/components/stzh-vbz-ticker.js +7 -7
- package/dist/components/stzh-visuallyhidden.js +1 -1
- package/dist/components/stzh-vspace.js +1 -1
- package/dist/components/stzh-youtube.js +6 -6
- package/dist/esm/{index-vaw5DHDC.js → index-rujKGmCS.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/stzh-accordion_3.entry.js +2 -2
- package/dist/esm/stzh-actions_6.entry.js +1 -1
- package/dist/esm/stzh-actionset.entry.js +1 -1
- package/dist/esm/stzh-amount.entry.js +1 -1
- package/dist/esm/stzh-anchornav.entry.js +1 -1
- package/dist/esm/stzh-app-nav.entry.js +1 -1
- package/dist/esm/stzh-appointments.entry.js +1 -1
- package/dist/esm/stzh-archivelist.entry.js +1 -1
- package/dist/esm/stzh-audio.entry.js +1 -1
- package/dist/esm/stzh-badge_3.entry.js +1 -1
- package/dist/esm/stzh-banner.entry.js +1 -1
- package/dist/esm/stzh-breadcrumb_2.entry.js +1 -1
- package/dist/esm/stzh-buttongroup.entry.js +1 -1
- package/dist/esm/stzh-calendar.entry.js +1 -1
- package/dist/esm/stzh-card-navigation.entry.js +1 -1
- package/dist/esm/stzh-card-searchresult.entry.js +1 -1
- package/dist/esm/stzh-card-superteaser.entry.js +1 -1
- package/dist/esm/stzh-card_2.entry.js +1 -1
- package/dist/esm/stzh-carousel.entry.js +1 -1
- package/dist/esm/stzh-chart.entry.js +1 -1
- package/dist/esm/stzh-checkbox.entry.js +2 -2
- package/dist/esm/stzh-checkboxgroup.entry.js +2 -2
- package/dist/esm/stzh-chip_2.entry.js +2 -2
- package/dist/esm/stzh-chipgroup.entry.js +1 -1
- package/dist/esm/stzh-clamp.entry.js +1 -1
- package/dist/esm/stzh-company-logo.entry.js +1 -1
- package/dist/esm/stzh-components.js +2 -2
- package/dist/esm/stzh-contact-cv.entry.js +1 -1
- package/dist/esm/stzh-contact.entry.js +1 -1
- package/dist/esm/stzh-container_2.entry.js +1 -1
- package/dist/esm/stzh-content.entry.js +1 -1
- package/dist/esm/stzh-cta.entry.js +1 -1
- package/dist/esm/stzh-datalist_3.entry.js +1 -1
- package/dist/esm/stzh-datamessagelist-item.entry.js +1 -1
- package/dist/esm/stzh-datamessagelist.entry.js +1 -1
- package/dist/esm/stzh-datatable.entry.js +1 -1
- package/dist/esm/stzh-datepicker_3.entry.js +2 -2
- package/dist/esm/stzh-daterange.entry.js +1 -1
- package/dist/esm/stzh-details.entry.js +1 -1
- package/dist/esm/stzh-dialog.entry.js +1 -1
- package/dist/esm/stzh-disturber.entry.js +1 -1
- package/dist/esm/stzh-dropdown.entry.js +2 -2
- package/dist/esm/stzh-editor.entry.js +1 -1
- package/dist/esm/stzh-eventdata.entry.js +1 -1
- package/dist/esm/stzh-eventinfo.entry.js +1 -1
- package/dist/esm/stzh-feedreader-item.entry.js +1 -1
- package/dist/esm/stzh-feedreader.entry.js +1 -1
- package/dist/esm/stzh-figure.entry.js +1 -1
- package/dist/esm/stzh-flyingfocus.entry.js +1 -1
- package/dist/esm/stzh-footer.entry.js +1 -1
- package/dist/esm/stzh-gallery.entry.js +1 -1
- package/dist/esm/stzh-geo-ref-data.entry.js +1 -1
- package/dist/esm/stzh-ghettobox.entry.js +1 -1
- package/dist/esm/stzh-header_3.entry.js +1 -1
- package/dist/esm/stzh-heading.entry.js +1 -1
- package/dist/esm/stzh-homepage-search.entry.js +1 -1
- package/dist/esm/stzh-homepage-service-highlights.entry.js +1 -1
- package/dist/esm/stzh-hr.entry.js +1 -1
- package/dist/esm/stzh-hspace.entry.js +1 -1
- package/dist/esm/stzh-http-error.entry.js +1 -1
- package/dist/esm/stzh-iframe.entry.js +1 -1
- package/dist/esm/stzh-imagecomparison.entry.js +1 -1
- package/dist/esm/{stzh-input-description-CxS5xIHN.js → stzh-input-description-Bsy8H9JX.js} +1 -1
- package/dist/esm/stzh-input.entry.js +2 -2
- package/dist/esm/stzh-invert.entry.js +1 -1
- package/dist/esm/stzh-link.entry.js +1 -1
- package/dist/esm/stzh-linklist.entry.js +1 -1
- package/dist/esm/stzh-list_2.entry.js +1 -1
- package/dist/esm/stzh-loader.entry.js +1 -1
- package/dist/esm/stzh-loadingbar.entry.js +1 -1
- package/dist/esm/stzh-menu_2.entry.js +1 -1
- package/dist/esm/stzh-message.entry.js +1 -1
- package/dist/esm/stzh-microsite-teaserlist.entry.js +1 -1
- package/dist/esm/stzh-monthyearpicker.entry.js +1 -1
- package/dist/esm/stzh-offline-indicator.entry.js +1 -1
- package/dist/esm/stzh-page-skiplinks.entry.js +1 -1
- package/dist/esm/stzh-pagebottom.entry.js +1 -1
- package/dist/esm/stzh-pagecontent.entry.js +1 -1
- package/dist/esm/stzh-pagetitle-hero.entry.js +1 -1
- package/dist/esm/stzh-pagetitle-home.entry.js +1 -1
- package/dist/esm/stzh-pagetitle.entry.js +1 -1
- package/dist/esm/stzh-panorama.entry.js +1 -1
- package/dist/esm/stzh-pi-content-navigation.entry.js +1 -1
- package/dist/esm/stzh-pi-menu.entry.js +1 -1
- package/dist/esm/stzh-pi-pagetitle.entry.js +1 -1
- package/dist/esm/stzh-pi-quote.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser-layout-item.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser-layout.entry.js +1 -1
- package/dist/esm/stzh-pi-teaser.entry.js +1 -1
- package/dist/esm/stzh-pkzh-qr.entry.js +1 -1
- package/dist/esm/stzh-popover.entry.js +1 -1
- package/dist/esm/stzh-print_2.entry.js +1 -1
- package/dist/esm/stzh-quote.entry.js +1 -1
- package/dist/esm/stzh-rating.entry.js +2 -2
- package/dist/esm/stzh-ratio.entry.js +1 -1
- package/dist/esm/stzh-readspeaker.entry.js +1 -1
- package/dist/esm/stzh-richtext.entry.js +1 -1
- package/dist/esm/stzh-saptcha.entry.js +1 -1
- package/dist/esm/stzh-scrollup.entry.js +1 -1
- package/dist/esm/stzh-search.entry.js +1 -1
- package/dist/esm/stzh-section.entry.js +1 -1
- package/dist/esm/stzh-show.entry.js +1 -1
- package/dist/esm/stzh-sitemap.entry.js +1 -1
- package/dist/esm/stzh-skin-portal-mitwirken.entry.js +1 -1
- package/dist/esm/stzh-skin-storybook-preview.entry.js +1 -1
- package/dist/esm/stzh-skiplink.entry.js +1 -1
- package/dist/esm/stzh-socialmediastream-item.entry.js +1 -1
- package/dist/esm/stzh-socialmediastream.entry.js +1 -1
- package/dist/esm/stzh-stepper-item.entry.js +1 -1
- package/dist/esm/stzh-stepper.entry.js +1 -1
- package/dist/esm/stzh-sticky-actions.entry.js +1 -1
- package/dist/esm/stzh-sticky.entry.js +1 -1
- package/dist/esm/stzh-table.entry.js +1 -1
- package/dist/esm/stzh-text.entry.js +1 -1
- package/dist/esm/stzh-textandimage.entry.js +1 -1
- package/dist/esm/stzh-timeline-item.entry.js +2 -2
- package/dist/esm/stzh-timeline.entry.js +1 -1
- package/dist/esm/stzh-timepicker.entry.js +1 -1
- package/dist/esm/stzh-toast_2.entry.js +1 -1
- package/dist/esm/stzh-toggle.entry.js +2 -2
- package/dist/esm/stzh-tooltip.entry.js +1 -1
- package/dist/esm/stzh-twocolumns.entry.js +1 -1
- package/dist/esm/stzh-upload.entry.js +2 -2
- package/dist/esm/stzh-vbz-carousel.entry.js +1 -1
- package/dist/esm/stzh-vbz-connection-finder.entry.js +1 -1
- package/dist/esm/stzh-vbz-intro.entry.js +1 -1
- package/dist/esm/stzh-vbz-linechip.entry.js +1 -1
- package/dist/esm/stzh-vbz-majorticker.entry.js +1 -1
- package/dist/esm/stzh-vbz-ticker.entry.js +1 -1
- package/dist/esm/stzh-visuallyhidden.entry.js +1 -1
- package/dist/esm/stzh-vspace.entry.js +1 -1
- package/dist/esm/stzh-youtube.entry.js +1 -1
- package/dist/stzh-components/{p-ee85bbe5.entry.js → p-01e0939c.entry.js} +1 -1
- package/dist/stzh-components/{p-67695366.entry.js → p-047f1518.entry.js} +1 -1
- package/dist/stzh-components/{p-839bc37f.entry.js → p-059685c4.entry.js} +1 -1
- package/dist/stzh-components/{p-adc88b73.entry.js → p-0774cbf6.entry.js} +1 -1
- package/dist/stzh-components/{p-5b6fac92.entry.js → p-07a9613e.entry.js} +1 -1
- package/dist/stzh-components/{p-1c15b27c.entry.js → p-07be7dbd.entry.js} +1 -1
- package/dist/stzh-components/{p-b83652b4.entry.js → p-08537c2d.entry.js} +1 -1
- package/dist/stzh-components/{p-62666899.entry.js → p-0b98858f.entry.js} +1 -1
- package/dist/stzh-components/{p-37d89e58.entry.js → p-0bb65921.entry.js} +1 -1
- package/dist/stzh-components/{p-885a1508.entry.js → p-0c156e68.entry.js} +2 -2
- package/dist/stzh-components/{p-217b2534.entry.js → p-0e604008.entry.js} +1 -1
- package/dist/stzh-components/{p-3f0a62d5.entry.js → p-10f70012.entry.js} +1 -1
- package/dist/stzh-components/{p-a992f8d3.entry.js → p-11a7e43f.entry.js} +1 -1
- package/dist/stzh-components/{p-fe8b4c50.entry.js → p-124bb877.entry.js} +1 -1
- package/dist/stzh-components/{p-26855911.entry.js → p-1253a2cb.entry.js} +1 -1
- package/dist/stzh-components/{p-42bad0ae.entry.js → p-12597dcf.entry.js} +1 -1
- package/dist/stzh-components/{p-5b06fe27.entry.js → p-13cdfd2c.entry.js} +1 -1
- package/dist/stzh-components/{p-33250e04.entry.js → p-154da193.entry.js} +1 -1
- package/dist/stzh-components/{p-48fc7701.entry.js → p-1797c1fb.entry.js} +1 -1
- package/dist/stzh-components/{p-83068896.entry.js → p-18993354.entry.js} +2 -2
- package/dist/stzh-components/{p-6b864908.entry.js → p-1b1b45f3.entry.js} +1 -1
- package/dist/stzh-components/{p-4c851ccd.entry.js → p-1e0b66d9.entry.js} +1 -1
- package/dist/stzh-components/{p-26a0dba3.entry.js → p-23e6c077.entry.js} +1 -1
- package/dist/stzh-components/{p-626e8a09.entry.js → p-25d498e2.entry.js} +1 -1
- package/dist/stzh-components/{p-e8a7f73b.entry.js → p-25ed6414.entry.js} +3 -3
- package/dist/stzh-components/{p-031cce13.entry.js → p-2645c534.entry.js} +1 -1
- package/dist/stzh-components/{p-0b8c15fd.entry.js → p-28985f79.entry.js} +1 -1
- package/dist/stzh-components/{p-0c918333.entry.js → p-2c1f18da.entry.js} +1 -1
- package/dist/stzh-components/{p-ac731b57.entry.js → p-2cb9bf11.entry.js} +1 -1
- package/dist/stzh-components/{p-fe18f691.entry.js → p-2d25d6b5.entry.js} +1 -1
- package/dist/stzh-components/{p-2936725d.entry.js → p-2d6904f5.entry.js} +1 -1
- package/dist/stzh-components/{p-a428f563.entry.js → p-2e6e2139.entry.js} +1 -1
- package/dist/stzh-components/{p-a092e651.entry.js → p-314bc213.entry.js} +1 -1
- package/dist/stzh-components/{p-ad6ea33a.entry.js → p-34a83688.entry.js} +1 -1
- package/dist/stzh-components/{p-079b9c1b.entry.js → p-35521912.entry.js} +1 -1
- package/dist/stzh-components/{p-78953138.entry.js → p-362760a5.entry.js} +1 -1
- package/dist/stzh-components/{p-d591b8fb.entry.js → p-368a8190.entry.js} +1 -1
- package/dist/stzh-components/{p-7e492d4a.entry.js → p-372f2a83.entry.js} +1 -1
- package/dist/stzh-components/{p-e12cb068.entry.js → p-394b2965.entry.js} +1 -1
- package/dist/stzh-components/{p-7d329aa3.entry.js → p-398f4b13.entry.js} +1 -1
- package/dist/stzh-components/{p-471ea331.entry.js → p-3bd75f83.entry.js} +1 -1
- package/dist/stzh-components/{p-40436af3.entry.js → p-3bf1b2ea.entry.js} +1 -1
- package/dist/stzh-components/{p-b005769e.entry.js → p-3d3b5c7f.entry.js} +1 -1
- package/dist/stzh-components/{p-a9910a1d.entry.js → p-3e65aeea.entry.js} +1 -1
- package/dist/stzh-components/{p-729ff982.entry.js → p-3e8a5bfc.entry.js} +1 -1
- package/dist/stzh-components/{p-a29d99cd.entry.js → p-3ebad4a4.entry.js} +1 -1
- package/dist/stzh-components/{p-b9f7f0b4.entry.js → p-4186b088.entry.js} +1 -1
- package/dist/stzh-components/{p-8f5e2b97.entry.js → p-4c018ace.entry.js} +1 -1
- package/dist/stzh-components/{p-883d8884.entry.js → p-4cf82c8a.entry.js} +1 -1
- package/dist/stzh-components/{p-f8fdb699.entry.js → p-4d60e362.entry.js} +1 -1
- package/dist/stzh-components/{p-66a45b90.entry.js → p-4da549c3.entry.js} +1 -1
- package/dist/stzh-components/{p-5b250280.entry.js → p-4e15c0db.entry.js} +1 -1
- package/dist/stzh-components/{p-fb9db20a.entry.js → p-4fc34877.entry.js} +1 -1
- package/dist/stzh-components/{p-58bad9ed.entry.js → p-50397c15.entry.js} +1 -1
- package/dist/stzh-components/{p-7382f1c7.entry.js → p-54088bc2.entry.js} +1 -1
- package/dist/stzh-components/{p-5cd34d8c.entry.js → p-56b48a58.entry.js} +1 -1
- package/dist/stzh-components/{p-35dc89ce.entry.js → p-59e19f3c.entry.js} +1 -1
- package/dist/stzh-components/{p-2f153ff4.entry.js → p-5c3aa879.entry.js} +1 -1
- package/dist/stzh-components/{p-f8507949.entry.js → p-60ffcf44.entry.js} +1 -1
- package/dist/stzh-components/{p-40324acc.entry.js → p-64dba9aa.entry.js} +1 -1
- package/dist/stzh-components/{p-e2fca3d7.entry.js → p-67b0d92a.entry.js} +1 -1
- package/dist/stzh-components/{p-c53a51bc.entry.js → p-68411970.entry.js} +1 -1
- package/dist/stzh-components/{p-990c1275.entry.js → p-68d98588.entry.js} +1 -1
- package/dist/stzh-components/{p-cef1c8fb.entry.js → p-6bbb0faf.entry.js} +1 -1
- package/dist/stzh-components/{p-1948fc02.entry.js → p-6efe279c.entry.js} +1 -1
- package/dist/stzh-components/{p-dd22dd47.entry.js → p-7522786b.entry.js} +1 -1
- package/dist/stzh-components/{p-7e2ee96f.entry.js → p-793f2e6c.entry.js} +1 -1
- package/dist/stzh-components/{p-b281e83d.entry.js → p-796b2747.entry.js} +1 -1
- package/dist/stzh-components/{p-10a375fb.entry.js → p-7a3cd4d7.entry.js} +1 -1
- package/dist/stzh-components/{p-7c4f8d0c.entry.js → p-7b99a8d1.entry.js} +1 -1
- package/dist/stzh-components/{p-f4bc518e.entry.js → p-7d649a98.entry.js} +1 -1
- package/dist/stzh-components/{p-adcc3f8b.entry.js → p-80609cb6.entry.js} +2 -2
- package/dist/stzh-components/{p-2ae5255d.entry.js → p-80f76737.entry.js} +1 -1
- package/dist/stzh-components/{p-4e02b98d.entry.js → p-81aafe14.entry.js} +1 -1
- package/dist/stzh-components/{p-08a01416.entry.js → p-82ae6bd3.entry.js} +1 -1
- package/dist/stzh-components/{p-582bf2f8.entry.js → p-84935b91.entry.js} +1 -1
- package/dist/stzh-components/{p-8135cb30.entry.js → p-856d00c1.entry.js} +1 -1
- package/dist/stzh-components/{p-90ba18a3.entry.js → p-875ed12c.entry.js} +1 -1
- package/dist/stzh-components/{p-f8492b4a.entry.js → p-88657ea1.entry.js} +1 -1
- package/dist/stzh-components/{p-11a13fa2.entry.js → p-8b89f8ad.entry.js} +1 -1
- package/dist/stzh-components/{p-5afe7ac0.entry.js → p-8eda7909.entry.js} +1 -1
- package/dist/stzh-components/{p-e40b3463.entry.js → p-8f111abc.entry.js} +1 -1
- package/dist/stzh-components/{p-1f250fd2.entry.js → p-90109626.entry.js} +1 -1
- package/dist/stzh-components/{p-37e2fe17.entry.js → p-929cfd30.entry.js} +1 -1
- package/dist/stzh-components/{p-41494aab.entry.js → p-93d1fdd8.entry.js} +2 -2
- package/dist/stzh-components/{p-51b83f74.entry.js → p-95304149.entry.js} +1 -1
- package/dist/stzh-components/{p-8d22b955.entry.js → p-9a8dbc6b.entry.js} +1 -1
- package/dist/stzh-components/{p-0e4d10d3.entry.js → p-9b58ff08.entry.js} +1 -1
- package/dist/stzh-components/{p-d6cf94dd.entry.js → p-9b84bfb5.entry.js} +1 -1
- package/dist/stzh-components/{p-3791bf96.entry.js → p-9e1f7405.entry.js} +1 -1
- package/dist/stzh-components/{p-Y4KllhSj.js → p-DT3qkqDR.js} +1 -1
- package/dist/stzh-components/{p-f77cfa2a.entry.js → p-a3dcbe8b.entry.js} +1 -1
- package/dist/stzh-components/{p-f2c6cdde.entry.js → p-a44a094f.entry.js} +1 -1
- package/dist/stzh-components/{p-9edf375c.entry.js → p-a5b8489d.entry.js} +1 -1
- package/dist/stzh-components/{p-694a9726.entry.js → p-a74299ad.entry.js} +1 -1
- package/dist/stzh-components/{p-ae2f9084.entry.js → p-aaba1ec9.entry.js} +1 -1
- package/dist/stzh-components/{p-20545fdb.entry.js → p-ab3d16a0.entry.js} +1 -1
- package/dist/stzh-components/{p-79885f85.entry.js → p-abc50e36.entry.js} +1 -1
- package/dist/stzh-components/{p-a3f8128d.entry.js → p-ac8e22dd.entry.js} +1 -1
- package/dist/stzh-components/{p-12f1d9c4.entry.js → p-ad656e2b.entry.js} +1 -1
- package/dist/stzh-components/{p-950b3d22.entry.js → p-af0e4d4a.entry.js} +1 -1
- package/dist/stzh-components/{p-1fdc46c8.entry.js → p-b0851b31.entry.js} +1 -1
- package/dist/stzh-components/{p-1149308b.entry.js → p-b16d40e3.entry.js} +1 -1
- package/dist/stzh-components/p-b4b11070.entry.js +1 -0
- package/dist/stzh-components/{p-ed20c3ae.entry.js → p-b50ea8c5.entry.js} +1 -1
- package/dist/stzh-components/{p-9cb30e8e.entry.js → p-b543151f.entry.js} +1 -1
- package/dist/stzh-components/{p-7521adc5.entry.js → p-b5e9613e.entry.js} +1 -1
- package/dist/stzh-components/{p-bc3955eb.entry.js → p-b7094eb9.entry.js} +1 -1
- package/dist/stzh-components/{p-c0c243fb.entry.js → p-b7a81ffc.entry.js} +1 -1
- package/dist/stzh-components/{p-e83af57c.entry.js → p-bb36a7ef.entry.js} +1 -1
- package/dist/stzh-components/{p-ac273600.entry.js → p-be05d891.entry.js} +1 -1
- package/dist/stzh-components/{p-ec5ee193.entry.js → p-bf9261bf.entry.js} +1 -1
- package/dist/stzh-components/{p-e88593d4.entry.js → p-c2981027.entry.js} +1 -1
- package/dist/stzh-components/{p-c13d9d91.entry.js → p-c62e3c25.entry.js} +1 -1
- package/dist/stzh-components/{p-513f8a2c.entry.js → p-c6a1db6d.entry.js} +1 -1
- package/dist/stzh-components/{p-f7e95f22.entry.js → p-cd1a4971.entry.js} +1 -1
- package/dist/stzh-components/{p-ed6acd4c.entry.js → p-d1f7a4cc.entry.js} +1 -1
- package/dist/stzh-components/{p-fc9ab869.entry.js → p-d5044021.entry.js} +1 -1
- package/dist/stzh-components/{p-aae0d246.entry.js → p-d527095b.entry.js} +1 -1
- package/dist/stzh-components/{p-138acf47.entry.js → p-da15a687.entry.js} +1 -1
- package/dist/stzh-components/{p-ae6677bb.entry.js → p-dd09820e.entry.js} +1 -1
- package/dist/stzh-components/{p-e31e1d68.entry.js → p-deda4956.entry.js} +1 -1
- package/dist/stzh-components/{p-704f2459.entry.js → p-df80bda2.entry.js} +1 -1
- package/dist/stzh-components/{p-651445ea.entry.js → p-e03c85ef.entry.js} +1 -1
- package/dist/stzh-components/{p-9f7eabc0.entry.js → p-e3c944bc.entry.js} +1 -1
- package/dist/stzh-components/{p-1d96fb7d.entry.js → p-e48373cc.entry.js} +1 -1
- package/dist/stzh-components/{p-0e1e7514.entry.js → p-ec58716a.entry.js} +1 -1
- package/dist/stzh-components/{p-96ed46e7.entry.js → p-f1f35a30.entry.js} +1 -1
- package/dist/stzh-components/{p-393b570a.entry.js → p-f62e5e8d.entry.js} +1 -1
- package/dist/stzh-components/{p-018c5cc8.entry.js → p-fbfa5461.entry.js} +1 -1
- package/dist/stzh-components/{p-ae80343f.entry.js → p-fea993dc.entry.js} +1 -1
- package/dist/stzh-components/{p-vaw5DHDC.js → p-rujKGmCS.js} +1 -1
- package/dist/stzh-components/stzh-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/stzh-components/p-2cae7201.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{r as t,c as i,e as s,i as h,h as n,F as e,a as r,d as a}from"./p-vaw5DHDC.js";import{h as o}from"./p-CBLSoWgI.js";import{m as u}from"./p-CUGRmgip.js";import{t as c,c as l}from"./p-CBUfcdIy.js";import{c as f}from"./p-BzugsqyR.js";import{g as d}from"./p-E-ZsRS8r.js";import"./p-BubviQku.js";const v="stzh-header-open",m=class{constructor(n){t(this,n),this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick"),this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick"),this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick"),this.stzhMenuItemClick=i(this,"stzhMenuItemClick"),this.stzhLanguageChange=i(this,"stzhLanguageChange"),this.stzhSearchChange=i(this,"stzhSearchChange"),this.stzhSearchChanged=i(this,"stzhSearchChanged"),this.variant="default",this.href="https://www.stadt-zuerich.ch",this.menuId="anchorNavMain",this.appNavId="anchorNavAppNav",this.searchId="anchorSearch",this.metanavId="anchorNavMeta",this.languageId="anchorNavLang",this.logoType="default",this.menuItems=[],this.metanavItems=[],this.userSpecificMetanavItemsNotLoggedIn=[],this._userSpecificMetanavItemsNotLoggedIn=[],this.appNavItems=[],this.languages=[],this.languagePreventUrlchange=!1,this.languageStay=!1,this.hideMetabar=!1,this.searchFieldName="q",this.searchValue="",this.sticky="default",this.loginErrorMessage="",this.hideLogo=!1,this.stickyActive=!1,this.flyoutOpen=!1,this.flyoutSearchOpen=!1,this.fixed=!1,this.fixedTransition=!1,this.currentOpenMenuItem=null,this.currentOpenMetanavItem=null,this.currentOpenLanguage=!1,this.userSpecificMetanavItemsLoggedIn=[],this.combinedMetanavItems=[],this.lastOpener=null,this.flyoutOpenedByMetanavItem=null,this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);this.isMedium&&i&&this.closeMenuItem(!1)},this.handleBurgerClick=async()=>{this.flyoutOpenedByMetanavItem?(this.flyoutOpenedByMetanavItem=!1,this.closeMetanavItem()):(this.flyoutSearchOpen=!1,this.flyoutOpen=!this.flyoutOpen);const t=this.element.querySelector(".stzh-header__menu-item");t&&window.setTimeout((()=>{t.focus()}),100),this.updatePosition()},this.handleSearchButtonClick=async()=>{this.flyoutOpen=!1,this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");t&&window.setTimeout((()=>{t.focus()}),100),this.updatePosition()},this.handleBackdropClick=async()=>{this.flyoutOpen=!1,this.updatePosition()},this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=!1,this.updatePosition()},this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})},this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})},this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})},this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=!1,this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})},this.handleSearchInput=t=>{this.searchValue=this.searchInput.value,this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})},this.handleSearchChange=t=>{this.searchValue=this.searchInput.value,this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})},this.handleLanguageClick=(t,i)=>{this.languagePreventUrlchange&&t.preventDefault(),this.languageActive=String(i.value),this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})},this.handleFlyoutResize=()=>{this.resizeMenunavElement()},this.handleResize=()=>{this.debounceResize&&window.cancelAnimationFrame(this.debounceResize),this.debounceResize=requestAnimationFrame((()=>{s((()=>{var t,i,s,h;this.isMedium=u("medium").matches,this.isSmallOrMicro=!this.isMedium,this.mainHeight=(null===(t=this.mainElement)||void 0===t?void 0:t.offsetHeight)||0,this.metabarHeight=(null===(i=this.metabarElement)||void 0===i?void 0:i.offsetHeight)||0,this.logobarHeight=(null===(s=this.logobarElement)||void 0===s?void 0:s.offsetHeight)||0,this.headerTop=this.element.offsetTop,this.headerHeight=this.mainHeight,(null===(h=this._appNavItems)||void 0===h?void 0:h.length)>0&&(this.hideLogo=!1)})),h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`),document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`),document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`),document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`),"disabled"!==this.sticky&&requestAnimationFrame((()=>this.scrollListener()))}))}))}}handleKeydown(t){"Escape"===t.key&&(this.flyoutOpen=!1,this.flyoutSearchOpen=!1)}flyoutCloseClicked(){this.flyoutSearchOpen=!1,this.updatePosition()}async flyoutOpenWatcher(t){t?(document.body.classList.add(v),this.disableSiblings(),this.trap&&this.trap.activate()):(this.currentOpenMenuItem=null,this.currentOpenMetanavItem=null,this.currentOpenLanguage=null,this.flyoutOpenedByMetanavItem=!1,document.body.classList.remove(v),this.enableSiblings(),this.trap&&this.trap.deactivate())}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0,await this.waitForNextRender(),this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen)return;const t=()=>{this.stickyActive=!0,document.documentElement.style.setProperty("--stzh-header-is-stuck","1"),document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")},i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0"),document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1"),this.stickyActive=!1};"disabled"===this.sticky?i():"always-full"===this.sticky?t():"always"===this.sticky?this.belowStayStickyPoint?t():i():this.scrollingUp&&this.belowStayStickyPoint?!this.stickyActive&&this.belowStartStickyPoint&&t():i()}windowResizeListener(){this.handleResize()}scrollListener(){"disabled"!==this.sticky&&(s((()=>{this.currentScrollY=window.scrollY,this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY,this.lastScrollY=this.currentScrollY,this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight,this.belowStartStickyPoint=this.currentScrollY>this.headerHeight,this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||"always"===this.sticky&&this.belowStayStickyPoint||"always-full"===this.sticky,this.headerOverlap=(this.headerTop-this.currentScrollY)/-1,this.hideLogo=0===this._appNavItems.length&&"always-full"!==this.sticky&&this.isMedium&&this.headerOverlap>1})),h((()=>{this.updatePosition()})))}searchValueWatcher(t){this.searchFilled=""!==t}menuItemsWatcher(t){this._menuItems="string"==typeof t?JSON.parse(t):t,this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){this._metanavItems="string"==typeof t?JSON.parse(t):t,this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t))),this.combineMetanavItems()}appNavItemsWatcher(t){this._appNavItems="string"==typeof t?JSON.parse(t):t}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t,this.combineMetanavItems()}languagesWatcher(t){this._languages="string"==typeof t?JSON.parse(t):t}getSiblings(){return this._parentElement?Array.from(this._parentElement.children).filter((t=>t!==this.element)):[]}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}renderAppName(t){return this.appName?n("div",{class:{"stzh-header__app-name":!0,"stzh-header__app-name--brand":"brand"===t,"stzh-header__app-name--nav":"nav"===t}},this.appName):null}renderBrand(){return"intranet"===this.variant&&this.appName?n("div",{class:"stzh-header__logobar-app-name"},this.renderAppName("brand")):n("div",{class:"stzh-header__logobar-logo"},n("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},n("slot",{name:"logo"})))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement)Object.assign(this.menunavElement.style,{height:null});else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=!0,this.lastOpener=t.currentTarget,this.openSubmenuElement=this.element.querySelector(`#${i.id}`),this.currentOpenMenuItem=i,await this.waitForNextRender(),requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&c(this.openSubmenuElement)[0];null==t||t.focus(),this.resizeMenunavElement()}))}async closeMenuItem(t=!0){this.openSubmenuElement=null,this.currentOpenMenuItem=null,await this.waitForNextRender(),t&&requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null,this.resizeMenunavElement()}))}async openMetanavItem(t,i){this.flyoutOpen||(this.flyoutOpenedByMetanavItem=!0,this.flyoutOpen=!0),this.lastOpener=t.currentTarget,this.currentOpenMetanavItem=i,await this.waitForNextRender(),requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`),s=t&&c(t)[0];null==s||s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null,this.flyoutOpenedByMetanavItem&&(this.flyoutOpen=!1),await this.waitForNextRender(),requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null}))}async openLanguage(t){this.flyoutOpen||(this.flyoutOpenedByMetanavItem=!0,this.flyoutOpen=!0),this.lastOpener=t.currentTarget,this.currentOpenLanguage=!0,await this.waitForNextRender(),requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages"),i=t&&c(t)[0];null==i||i.focus()}))}async closeLanguage(){this.currentOpenLanguage=!1,this.flyoutOpenedByMetanavItem&&(this.flyoutOpen=!1),await this.waitForNextRender(),requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(this.userSpecificMetanavItemsEndpoint)try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json(),this.combineMetanavItems()}catch(t){this.combineMetanavItems(!0),console.error("Error fetching data:",t),this.loginErrorMessage&&document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}combineMetanavItems(t=!1){this.combinedMetanavItems=!this.userSpecificMetanavItemsEndpoint||t?[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn]:[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}async componentWillLoad(){this.menuItemsWatcher(this.menuItems),this.metanavItemsWatcher(this.metanavItems),this.appNavItemsWatcher(this.appNavItems),this.languagesWatcher(this.languages),this.searchValueWatcher(this.searchValue),this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn),this.requestUserSpecificMetanavItems(),this.localization||(this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header"))}componentDidRender(){this.renderPromiseResolve&&this.renderPromiseResolve(),this.flyoutElement&&this.flyoutResizeObserver&&this.flyoutResizeObserver.observe(this.flyoutElement),this.flyoutSearchElement&&this.flyoutResizeObserver&&this.flyoutResizeObserver.observe(this.flyoutSearchElement)}componentDidLoad(){this.trap=l(this.element,Object.assign(Object.assign({},f()),{initialFocus:!1})),this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize),this.flyoutElement&&this.flyoutResizeObserver.observe(this.flyoutElement)}connectedCallback(){this._parentElement=this.element.parentElement,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(!1),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.flyoutResizeObserver)||void 0===i||i.disconnect()}render(){var t,i,s,h,a,u,c;const l=o(this.element,"metanav-before"),f=o(this.element,"metanav-after"),d=this._appNavItems.length>0,v="intranet"!==this.variant&&!!this.appName,m={"stzh-header":!0,"stzh-header--variant-default":"default"===this.variant,"stzh-header--variant-intranet":"intranet"===this.variant,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo&&!d,"stzh-header--has-app-nav":d,"stzh-header--has-empty-metabar-mobile":!(d||v||l||f||0!==this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length||0!==this._menuItems.length||!(0===this._languages.length||this._languages.length>0&&!this.languageStay)||this.searchAction),"stzh-header--has-empty-metabar":!(d||v||l||f||0!==this._metanavItems.length||0!==this._menuItems.length||0!==this._languages.length||this.searchAction),[`stzh-header--sticky-${this.sticky}`]:!!this.sticky},p=this.languageActive||window.stzhComponents.utils.getLocale(this.element),_=(null===(t=this._languages)||void 0===t?void 0:t.find((({value:t})=>t===p)))||(null===(i=this._languages)||void 0===i?void 0:i[0])||null,g=(t,i,s)=>{var h;const e=(null===(h=t.items)||void 0===h?void 0:h.length)>0||t.itemButton||!t.href?"button":"a";return n(e,Object.assign({},s,{id:t.id+"-button",href:"a"===e&&t.href,target:"a"===e&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":!0,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),n("span",{class:{"stzh-header__metanav-item-text":!0,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},n("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),n("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&n("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&n("stzh-icon",{class:"stzh-header__metanav-icon "+(t.iconOpen?"is-close":""),name:t.icon}),t.iconOpen&&n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&n("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:void 0===t.badgeType?"error":t.badgeType})))};return n(r,null,n("header",{class:m},n("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this._appNavItems.length>0&&!v&&n("div",{class:"stzh-header__app-nav-bottom"},n("stzh-app-nav",{items:this._appNavItems,"app-nav-id":`${this.appNavId}-mobile`})),n("div",{class:"stzh-header__inner"},n("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},n("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},n("div",{class:"stzh-header__logobar-inner"},this.renderBrand(),n("div",{class:"stzh-header__logobar-decoration"}))),!this.hideMetabar&&n("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},n("div",{class:"stzh-header__metabar-inner"},n("slot",{name:"menu-before"}),this._menuItems.length>0&&!v&&n("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},n("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),n("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),n("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&n("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},n("label",{class:"stzh-header__search"},n("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),n("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),n("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&n("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},n("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),n("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),n("slot",{name:"menu-after"}),v?n("div",{class:"stzh-header__app-nav has-app-name"},this.renderAppName("nav")):d?n("div",{class:"stzh-header__app-nav"},n("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})):null,n("nav",{class:"stzh-header__metabar-nav",id:this.metanavId,tabindex:"-1"},n("slot",{name:"metanav-before"}),n("ul",{class:"stzh-header__metabar-nav-list"},this.combinedMetanavItems.map((t=>{var i,s;return n("li",{class:"stzh-header__metabar-nav-entry"},(null===(i=t.items)||void 0===i?void 0:i.length)>0||t.itemButton?n(e,null,g(t,{"is-popover-mobile":!0},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{t===this.currentOpenMetanavItem?this.closeMetanavItem():this.openMetanavItem(i,t),this.handleMetanavItemClick(i,t)}}),n("stzh-popover",{class:{"stzh-header__metanav-popover":!0},placement:"bottom-end",distance:20,variant:t.variant,size:void 0===t.size?"large":t.size},g(t,{"is-popover-desktop":!0},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),n("div",{slot:"content"},(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("stzh-menu",null,t.items.map((i=>n("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":!0,"is-heavy":void 0===t.importantSubmenu||t.importantSubmenu},size:void 0===t.size?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&n("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label),t.itemButtonExtra&&n("stzh-button",{class:{"stzh-header__metanav-menu-item--extra":!0},slot:"action",size:t.itemButtonExtra.size,href:t.itemButtonExtra.href,target:t.itemButtonExtra.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButtonExtra)}},t.itemButtonExtra.label))):g(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}}))})),(null===(s=this._languages)||void 0===s?void 0:s.length)>0&&n("li",{class:"stzh-header__metabar-nav-entry"},n("h2",{class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&n("button",{id:this.isSmallOrMicro?this.languageId:null,class:{"stzh-header__metanav-item":!0,"is-popover-mobile":!0,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{this.currentOpenLanguage?this.closeLanguage():this.openLanguage(t)}},n("span",{class:"stzh-header__metanav-item-text"},null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),n("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},n("button",{id:this.isSmallOrMicro?null:this.languageId,class:{"stzh-header__metanav-item":!0,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},n("span",{class:"stzh-header__metanav-item-text"},null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),n("div",{slot:"content"},n("stzh-menu",null,this._languages.map((t=>n("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(null==_?void 0:_.value)===t.value,href:String(t.value),onClick:i=>this.handleLanguageClick(i,t)},t.text)))))))),n("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||(null===(h=this.combinedMetanavItems)||void 0===h?void 0:h.length)>0)&&n("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},n("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),n("div",{class:"stzh-header__flyout-scrollbar"}),n("div",{class:"stzh-header__menu"},n("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},n("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,s;return n("li",{class:{"stzh-header__menu-list-item":!0,"is-open":t===this.currentOpenMenuItem}},(null===(i=t.items)||void 0===i?void 0:i.length)>0?n("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},n("li",{class:"stzh-header__menu-list-item is-backlink"},n("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},n("stzh-icon",{name:"angle-left"}),n("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),n("li",{class:"stzh-header__menu-list-item"},n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>n("li",{class:"stzh-header__menu-list-item"},n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),((null===(a=this.combinedMetanavItems)||void 0===a?void 0:a.length)>0||(null===(u=this._languages)||void 0===u?void 0:u.length)>0)&&n("div",{class:"stzh-header__menu-metanav"},n("nav",{class:"stzh-header__menu-metanav-nav"},n("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,s,h;return n("li",{class:{"stzh-header__menu-metanav-list-item":!0,"is-open":t===this.currentOpenMetanavItem}},(null===(i=t.items)||void 0===i?void 0:i.length)>0?n("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":!0,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{t===this.currentOpenMetanavItem?this.closeMetanavItem():this.openMetanavItem(i,t),this.handleMetanavItemClick(i,t)}},n("span",{class:{"stzh-header__menu-metanav-item-text":!0,"is-vhidden":t.labelHidden}},t.label),t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):n("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":!0,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},n("span",{class:{"stzh-header__menu-metanav-item-text":!0,"is-vhidden":t.labelHidden}},t.label),t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},n("span",null,t.label),n("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:!0,label:null===(h=this.localization.closeMetanavMenuLabel)||void 0===h?void 0:h.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>n("li",{class:"stzh-header__menu-metanav-list-item"},n("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),n("span",{class:"stzh-header__menu-metanav-item-text"},n("span",null,t.label),void 0!==t.counter&&t.counter>0&&n("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},n("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label))),t.itemButtonExtra&&n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action is-action--extra"},n("stzh-button",{href:t.itemButtonExtra.href,target:t.itemButtonExtra.target},t.itemButtonExtra.label)))))})),(null===(c=this._languages)||void 0===c?void 0:c.length)>0&&n("li",{class:{"stzh-header__menu-metanav-list-item":!0,"is-open":this.currentOpenLanguage}},n("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},n("span",null,null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),n("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},n("span",null,this.localization.dialogLanguageTitle),n("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:!0,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>n("li",{class:"stzh-header__menu-metanav-list-item"},n("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:String(t.value),onClick:i=>this.handleLanguageClick(i,t)},n("span",null,t.text),(null==_?void 0:_.value)===t.value&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&n("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},n("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),n("div",{class:"stzh-header__flyout-scrollbar"}),n("div",{class:"stzh-header__flyout-search-main"},n("slot",{name:"search"})))))}get element(){return a(this)}static get watchers(){return{flyoutOpen:[{flyoutOpenWatcher:0},{fixedWatcher:0}],flyoutSearchOpen:[{flyoutOpenWatcher:0},{fixedWatcher:0}],fixed:[{fixedWatcher:0}],headerHeight:[{fixedWatcher:0}],sticky:[{stickyWatcher:0}],searchValue:[{searchValueWatcher:0}],menuItems:[{menuItemsWatcher:0}],metanavItems:[{metanavItemsWatcher:0}],appNavItems:[{appNavItemsWatcher:0}],userSpecificMetanavItemsNotLoggedIn:[{userSpecificMetanavItemsNotLoggedInWatcher:0}],languages:[{languagesWatcher:0}]}}};m.style=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h,[stzh-hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--total-height:calc( var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height) );--logo-width:var(--stzh-header-logo-width, auto);--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color);--metabar-background-color:var( --stzh-header-metabar-background-color, var(--stzh-color-coolgrey10) );--menu-background-color:var( --stzh-header-menu-background-color, var(--stzh-color-secondary30) );--menu-list-item-background-hover:var( --stzh-header-menu-list-item-background-hover, var(--stzh-color-secondary40) );--menu-list-item-background-level2:var( --stzh-header-menu-list-item-background-level2, var(--stzh-color-secondary20) );--menu-list-item-background-level2-hover:var( --stzh-header-menu-list-item-background-level2-hover, var(--stzh-color-secondary10) );--menu-item-color:var(--stzh-header-menu-item-color, var(--stzh-color-primary70));--metanav-item-color:var(--stzh-header-metanav-item-color, var(--stzh-color-grey90));--intranet-app-name-background-color:var( --stzh-header-intranet-app-name-background-color, var(--stzh-color-primary70) )}@media print{.sc-stzh-header-h{display:none}}[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz].sc-stzh-header-s>[slot=logo],.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h.sc-stzh-header-s>[slot=logo],.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--metabar-background-color)}@media (forced-colors: active){.stzh-header__metabar.sc-stzh-header{border-bottom:0.125rem solid CanvasText}}.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin, 20px);margin-right:var(--stzh-container-margin, 20px)}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-small, 32px);margin-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-medium, 40px);margin-right:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-large, 64px);margin-right:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}.stzh-header__metabar-inner.sc-stzh-header{display:flex;align-items:center;height:4rem}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--metanav-item-color);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}@media (forced-colors: active){.stzh-header__burger.sc-stzh-header:where(button),.stzh-header__search.sc-stzh-header:where(button),.stzh-header__metanav-item.sc-stzh-header:where(button){transition:none;color:ButtonText}.stzh-header__burger.sc-stzh-header:where(button):hover,.stzh-header__search.sc-stzh-header:where(button):hover,.stzh-header__metanav-item.sc-stzh-header:where(button):hover{color:Highlight}}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium, 16px);gap:var(--stzh-space-medium, 16px);color:var(--menu-item-color)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge, 48px)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}@media screen and (max-width: 599px){.stzh-header__burger-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium, 16px);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge, 48px)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{--padding-left-base:calc(var(--stzh-icon-size) + var(--stzh-space-medium, 16px));--padding-left-focus:calc(var(--padding-left-base) + var(--stzh-space-medium, 16px));width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall, 8px);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:var(--padding-left-base)}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:var(--padding-left-focus);padding-right:var(--stzh-space-xlarge, 24px)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus{padding-left:var(--padding-left-base)}}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium, 16px), -50%)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(0, -50%)}}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{display:none}}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header{color:Highlight}}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}@media (forced-colors: active){.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{color:ButtonText}}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium, 16px))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge, 32px)}}.stzh-header__metabar-nav-list.sc-stzh-header,.stzh-header__metabar-nav-entry.sc-stzh-header{display:contents}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem;--background-color:var(--stzh-color-coolgrey10)}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small, 12px);align-items:center;justify-content:center;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}.stzh-header__metanav-item.sc-stzh-header:where(button:hover){color:Highlight}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-menu-item--extra.sc-stzh-header{margin-top:var(--stzh-space-medium)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex;flex-flow:column nowrap}@media (forced-colors: active){.stzh-header__logobar.sc-stzh-header{border-bottom:0.125rem solid CanvasText}}.stzh-header__logobar-inner.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc(100% - 34.5625rem + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2);margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge, 32px)}}.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge, 32px)}}.stzh-header__logo-link.sc-stzh-header{padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:var(--stzh-container-margin, 20px);display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--menu-background-color);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc(27.4375rem - var(--stzh-container-margin-large, 64px) + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:auto}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{position:static}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-nav.sc-stzh-header{border-right:0.125rem solid CanvasText}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xxsmall, 4px)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall, 8px)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small, 12px)}}.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-large, 20px)}@media screen and (min-width: 600px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge, 40px)}}.stzh-header__menu-metanav.sc-stzh-header{background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge, 40px));padding-bottom:var(--stzh-space-xxxlarge, 40px)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge, 80px))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--menu-list-item-background-level2);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;clip-path:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{border-right:0.125rem solid CanvasText}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item:hover>.stzh-header__menu-list)>.stzh-header__menu-list-item>.stzh-header__menu-list),.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open>.stzh-header__menu-list)>.stzh-header__menu-list-item>.stzh-header__menu-list){transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--menu-list-item-background-hover)}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header:where(button),.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header:where(button){forced-color-adjust:none;color:SelectedItemText;background-color:SelectedItem}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--menu-list-item-background-level2-hover)}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header:where(button),.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header:where(button){color:HighlightText;background-color:Highlight}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall, 8px);appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--menu-item-color);padding-left:var(--stzh-space-xxxlarge, 40px);padding-top:var(--stzh-space-small, 12px);padding-bottom:var(--stzh-space-small, 12px);padding-right:var(--stzh-space-large, 20px);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}@media (forced-colors: active){.stzh-header__menu-item.sc-stzh-header:where(button),.stzh-header__menu-metanav-item.sc-stzh-header:where(button){transition:none;color:ButtonText}}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-small, 12px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium, 16px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge, 24px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{min-height:auto;padding-left:var(--stzh-container-margin, 20px);padding-right:var(--stzh-container-margin, 20px);gap:var(--stzh-space-xxsmall, 4px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:var(--stzh-container-margin-small, 32px);padding-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}@media (forced-colors: active){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header:hover{color:Highlight}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge, 24px)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall, 8px);padding-bottom:var(--stzh-space-xsmall, 8px)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium, 16px);padding-right:var(--stzh-space-xxlarge, 32px)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium, 16px);margin-bottom:var(--stzh-space-xlarge, 24px);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge, 40px);margin-top:var(--stzh-space-xlarge, 24px)}.stzh-header__menu-metanav-item.is-action--extra.sc-stzh-header{margin-top:var(--stzh-space-xxsmall, 4px)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall, 8px)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav.has-app-name.sc-stzh-header{display:flex;align-items:center}.stzh-header__app-name.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;height:2.5rem;color:var(--stzh-color-coolgrey70);white-space:nowrap}.stzh-header__app-name--brand.sc-stzh-header{color:var(--stzh-color-white)}.stzh-header__app-name--nav.sc-stzh-header{color:var(--stzh-color-coolgrey70)}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) * -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--has-app-nav.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}[variant=intranet].sc-stzh-header-h .stzh-header__main.sc-stzh-header{min-height:auto}[variant=intranet].sc-stzh-header-h .stzh-header__logobar.sc-stzh-header{height:2.5rem;margin-left:0;margin-right:0;width:100%;background-color:var(--logobar-background-color)}[variant=intranet].sc-stzh-header-h .stzh-header__metabar.sc-stzh-header,[variant=intranet].sc-stzh-header-h .stzh-header__metabar-inner.sc-stzh-header{height:2.5rem}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav.sc-stzh-header{display:flex;align-items:center;height:2.5rem}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav.sc-stzh-header stzh-app-nav.sc-stzh-header{display:flex;align-items:center;height:100%}[variant=intranet].sc-stzh-header-h .stzh-header__logobar-decoration.sc-stzh-header{display:none}[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);display:flex;align-items:center;justify-content:flex-start;height:2.5rem;white-space:nowrap;flex:1 1 auto;background-color:var(--intranet-app-name-background-color);padding-left:var(--stzh-container-margin, 20px);padding-right:var(--stzh-container-margin, 20px)}@media screen and (min-width: 600px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-small, 32px);padding-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-medium, 40px);padding-right:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-large, 64px);padding-right:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:0;padding-right:0}}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav-bottom.sc-stzh-header{min-height:2.5rem}@media screen and (max-width: 899px){[variant=intranet].sc-stzh-header-h .stzh-header__metabar.sc-stzh-header{display:none}}";var p=6378137,_=.0066943799901413165,g=484813681109536e-20,z=Math.PI/2,M=1e-10,w=.017453292519943295,b=57.29577951308232,x=Math.PI/4,y=2*Math.PI,E=3.14159265359,S={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},P={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}},G=/[\s_\-\/\(\)]/g;function k(t,i){if(t[i])return t[i];for(var s,h=Object.keys(t),n=i.toLowerCase().replace(G,""),e=-1;++e<h.length;)if((s=h[e]).toLowerCase().replace(G,"")===n)return t[s]}function N(t){var i,s,h,n={},e=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),r={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*w},lat_1:function(t){n.lat1=t*w},lat_2:function(t){n.lat2=t*w},lat_ts:function(t){n.lat_ts=t*w},lon_0:function(t){n.long0=t*w},lon_1:function(t){n.long1=t*w},lon_2:function(t){n.long2=t*w},alpha:function(t){n.alpha=parseFloat(t)*w},gamma:function(t){n.rectified_grid_angle=parseFloat(t)*w},lonc:function(t){n.longc=t*w},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r:function(t){n.a=n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var i=k(P,t);i&&(n.to_meter=i.to_meter)},from_greenwich:function(t){n.from_greenwich=t*w},pm:function(t){var i=k(S,t);n.from_greenwich=(i||parseFloat(t))*w},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(n.axis=t)},approx:function(){n.approx=!0},over:function(){n.over=!0}};for(i in e)s=e[i],i in r?"function"==typeof(h=r[i])?h(s):n[h]=s:n[i]=s;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n.projStr=t,n}class C{static getId(t){const i=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(t,i="unit"){if(!t||t.length<3)return{type:i,name:"unknown",conversion_factor:null};const s=t[1],h=parseFloat(t[2])||null,n=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return{type:i,name:s,conversion_factor:h,id:n?{authority:n[1],code:parseInt(n[2],10)}:null}}static convertAxis(t){const i=t[1]||"Unknown";let s;const h=i.match(/^\((.)\)$/);if(h){const t=h[1].toUpperCase();if("E"===t)s="east";else if("N"===t)s="north";else{if("U"!==t)throw new Error(`Unknown axis abbreviation: ${t}`);s="up"}}else s=t[2]?t[2].toLowerCase():"unknown";const n=t.find((t=>Array.isArray(t)&&"ORDER"===t[0])),e=n?parseInt(n[1],10):null,r=t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])));return{name:i,direction:s,unit:this.convertUnit(r),order:e}}static extractAxes(t){return t.filter((t=>Array.isArray(t)&&"AXIS"===t[0])).map((t=>this.convertAxis(t))).sort(((t,i)=>(t.order||0)-(i.order||0)))}static convert(t,i={}){switch(t[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=t[1],i.base_crs=t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))):null,i.conversion=t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))):null;const s=t.find((t=>Array.isArray(t)&&"CS"===t[0]));s&&(i.coordinate_system={type:s[1],axis:this.extractAxes(t)});const h=t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]));if(h){const t=this.convertUnit(h);i.coordinate_system.unit=t}i.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":i.type="GeographicCRS",i.name=t[1];const n=t.find((t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0])));if(n){const s=this.convert(n);"ENSEMBLE"===n[0]?i.datum_ensemble=s:i.datum=s;const h=t.find((t=>Array.isArray(t)&&"PRIMEM"===t[0]));h&&"Greenwich"!==h[1]&&(s.prime_meridian={name:h[1],longitude:parseFloat(h[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},i.id=this.getId(t);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=t[1],i.ellipsoid=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))):null;break;case"ENSEMBLE":i.type="DatumEnsemble",i.name=t[1],i.members=t.filter((t=>Array.isArray(t)&&"MEMBER"===t[0])).map((t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)})));const e=t.find((t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]));e&&(i.accuracy=parseFloat(e[1]));const r=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]));r&&(i.ellipsoid=this.convert(r)),i.id=this.getId(t);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=t[1],i.semi_major_axis=parseFloat(t[2]),i.inverse_flattening=parseFloat(t[3]),t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]))&&this.convert(t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])),i);break;case"CONVERSION":i.type="Conversion",i.name=t[1],i.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,i.parameters=t.filter((t=>Array.isArray(t)&&"PARAMETER"===t[0])).map((t=>this.convert(t)));break;case"METHOD":i.type="Method",i.name=t[1],i.id=this.getId(t);break;case"PARAMETER":i.type="Parameter",i.name=t[1],i.value=parseFloat(t[2]),i.unit=this.convertUnit(t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])))),i.id=this.getId(t);break;case"BOUNDCRS":i.type="BoundCRS";const a=t.find((t=>Array.isArray(t)&&"SOURCECRS"===t[0]));if(a){const t=a.find((t=>Array.isArray(t)));i.source_crs=t?this.convert(t):null}const o=t.find((t=>Array.isArray(t)&&"TARGETCRS"===t[0]));if(o){const t=o.find((t=>Array.isArray(t)));i.target_crs=t?this.convert(t):null}const u=t.find((t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]));i.transformation=u?this.convert(u):null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=t[1],i.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,i.parameters=t.filter((t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0]))).map((t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0)),7===i.parameters.length){const t=i.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}i.id=this.getId(t);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const c=this.convertUnit(t,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach((t=>{t.unit||(t.unit=c)})),c.conversion_factor&&1!==c.conversion_factor&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:c});break;default:i.keyword=t[0]}return i}}class A extends C{static convert(t,i={}){return super.convert(t,i),i.coordinate_system&&"Cartesian"===i.coordinate_system.subtype&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class R extends C{static convert(t,i={}){super.convert(t,i);const s=t.find((t=>Array.isArray(t)&&"CS"===t[0]));s&&(i.coordinate_system={subtype:s[1],axis:this.extractAxes(t)});const h=t.find((t=>Array.isArray(t)&&"USAGE"===t[0]));if(h){const t=h.find((t=>Array.isArray(t)&&"SCOPE"===t[0])),s=h.find((t=>Array.isArray(t)&&"AREA"===t[0])),n=h.find((t=>Array.isArray(t)&&"BBOX"===t[0]));i.usage={},t&&(i.usage.scope=t[1]),s&&(i.usage.area=s[1]),n&&(i.usage.bbox=n.slice(1))}return i}}var I=/\s/,T=/[A-Za-z]/,O=/[A-Za-z84_]/,F=/[,\]]/,L=/[\d\.E\-\+]/;function D(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function W(t,i,s){Array.isArray(i)&&(s.unshift(i),i=null);var h=s.reduce((function(t,i){return j(i,t),t}),i?{}:t);i&&(t[i]=h)}function j(t,i){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(i[s]={},void j(t[0],i[s])):void(i[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in i||(i[s]=[]),void i[s].push(t);var h;switch(Array.isArray(s)||(i[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&j(t[2],i[s]));case"SPHEROID":case"ELLIPSOID":return i[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&j(t[3],i[s]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void W(i,s,t);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return t[0]=["name",t[0]],W(i,s,t),void(i[s].type=s);default:for(h=-1;++h<t.length;)if(!Array.isArray(t[h]))return j(t,i[s]);return W(i,s,t)}}else i[s]=t;else i[s]=!0}else i[t]=!0}function U(t){return.017453292519943295*t}function V(t){const i=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0||!t.longc||"albers conic equal area"!==i&&"lambert azimuthal equal area"!==i||(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==i&&"polar stereographic (variant b)"!==i?t.lat_ts||!t.lat0||"polar stereographic"!==i&&"polar stereographic (variant a)"!==i||(t.lat_ts=t.lat0,t.lat0=U(t.lat0>0?90:-90),delete t.lat1):(t.lat0=U(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function q(t){let i={units:null,to_meter:void 0};return"string"==typeof t?(i.units=t.toLowerCase(),"metre"===i.units&&(i.units="meter"),"meter"===i.units&&(i.to_meter=1)):t&&t.name&&(i.units=t.name.toLowerCase(),"metre"===i.units&&(i.units="meter"),i.to_meter=t.conversion_factor),i}function B(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function X(t,i){t.ellipsoid.radius?(i.a=t.ellipsoid.radius,i.rf=0):(i.a=B(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?i.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(i.rf=i.a/(i.a-B(t.ellipsoid.semi_minor_axis))))}function H(t,i={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(H(t.source_crs,i),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?i.nadgrids=t.transformation.parameters[0].value:i.datum_params=t.transformation.parameters.map((t=>t.value))),i):(Object.keys(t).forEach((s=>{const h=t[s];if(null!==h)switch(s){case"name":if(i.srsCode)break;i.name=h,i.srsCode=h;break;case"type":"GeographicCRS"===h?i.projName="longlat":"ProjectedCRS"===h&&t.conversion&&t.conversion.method&&(i.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":h.ellipsoid&&(i.ellps=h.ellipsoid.name,X(h,i)),h.prime_meridian&&(i.from_greenwich=h.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":i.ellps=h.name,X(h,i);break;case"prime_meridian":i.long0=(h.longitude||0)*Math.PI/180;break;case"coordinate_system":if(h.axis)if(i.axis=h.axis.map((t=>{const i=t.direction;if("east"===i)return"e";if("north"===i)return"n";if("west"===i)return"w";if("south"===i)return"s";throw new Error(`Unknown axis direction: ${i}`)})).join("")+"u",h.unit){const{units:t,to_meter:s}=q(h.unit);i.units=t,i.to_meter=s}else if(h.axis[0]&&h.axis[0].unit){const{units:t,to_meter:s}=q(h.axis[0].unit);i.units=t,i.to_meter=s}break;case"id":h.authority&&h.code&&(i.title=h.authority+":"+h.code);break;case"conversion":h.method&&h.method.name&&(i.projName=h.method.name),h.parameters&&h.parameters.forEach((t=>{const s=t.name.toLowerCase().replace(/\s+/g,"_"),h=t.value;i[s]=t.unit&&t.unit.conversion_factor?h*t.unit.conversion_factor:"degree"===t.unit?h*Math.PI/180:h}));break;case"unit":h.name&&(i.units=h.name.toLowerCase(),"metre"===i.units&&(i.units="meter")),h.conversion_factor&&(i.to_meter=h.conversion_factor);break;case"base_crs":H(h,i),i.datumCode=h.id?h.id.authority+"_"+h.id.code:h.name}})),void 0!==i.latitude_of_false_origin&&(i.lat0=i.latitude_of_false_origin),void 0!==i.longitude_of_false_origin&&(i.long0=i.longitude_of_false_origin),void 0!==i.latitude_of_standard_parallel&&(i.lat0=i.latitude_of_standard_parallel,i.lat1=i.latitude_of_standard_parallel),void 0!==i.latitude_of_1st_standard_parallel&&(i.lat1=i.latitude_of_1st_standard_parallel),void 0!==i.latitude_of_2nd_standard_parallel&&(i.lat2=i.latitude_of_2nd_standard_parallel),void 0!==i.latitude_of_projection_centre&&(i.lat0=i.latitude_of_projection_centre),void 0!==i.longitude_of_projection_centre&&(i.longc=i.longitude_of_projection_centre),void 0!==i.easting_at_false_origin&&(i.x0=i.easting_at_false_origin),void 0!==i.northing_at_false_origin&&(i.y0=i.northing_at_false_origin),void 0!==i.latitude_of_natural_origin&&(i.lat0=i.latitude_of_natural_origin),void 0!==i.longitude_of_natural_origin&&(i.long0=i.longitude_of_natural_origin),void 0!==i.longitude_of_origin&&(i.long0=i.longitude_of_origin),void 0!==i.false_easting&&(i.x0=i.false_easting),i.easting_at_projection_centre&&(i.x0=i.easting_at_projection_centre),void 0!==i.false_northing&&(i.y0=i.false_northing),i.northing_at_projection_centre&&(i.y0=i.northing_at_projection_centre),void 0!==i.standard_parallel_1&&(i.lat1=i.standard_parallel_1),void 0!==i.standard_parallel_2&&(i.lat2=i.standard_parallel_2),void 0!==i.scale_factor_at_natural_origin&&(i.k0=i.scale_factor_at_natural_origin),void 0!==i.scale_factor_at_projection_centre&&(i.k0=i.scale_factor_at_projection_centre),void 0!==i.scale_factor_on_pseudo_standard_parallel&&(i.k0=i.scale_factor_on_pseudo_standard_parallel),void 0!==i.azimuth&&(i.alpha=i.azimuth),void 0!==i.azimuth_at_projection_centre&&(i.alpha=i.azimuth_at_projection_centre),i.angle_from_rectified_to_skew_grid&&(i.rectified_grid_angle=i.angle_from_rectified_to_skew_grid),V(i),i):t}D.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;I.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},D.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(F.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},D.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},D.prototype.number=function(t){if(!L.test(t)){if(F.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},D.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},D.prototype.keyword=function(t){if(O.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!F.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},D.prototype.neutral=function(t){if(T.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(L.test(t))return this.word=t,void(this.state=3);if(!F.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},D.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Y=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function J(t){for(var i=Object.keys(t),s=0,h=i.length;s<h;++s){var n=i[s];-1!==Y.indexOf(n)&&Z(t[n]),"object"==typeof t[n]&&J(t[n])}}function Z(t){if(t.AUTHORITY){var i=Object.keys(t.AUTHORITY)[0];i&&i in t.AUTHORITY&&(t.title=i+":"+t.AUTHORITY[i])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var s="",h=0,n=t.AXIS.length;h<n;++h){var e=[t.AXIS[h][0].toLowerCase(),t.AXIS[h][1].toLowerCase()];-1!==e[0].indexOf("north")||("y"===e[0]||"lat"===e[0])&&"north"===e[1]?s+="n":-1!==e[0].indexOf("south")||("y"===e[0]||"lat"===e[0])&&"south"===e[1]?s+="s":-1!==e[0].indexOf("east")||("x"===e[0]||"lon"===e[0])&&"east"===e[1]?s+="e":-1===e[0].indexOf("west")&&("x"!==e[0]&&"lon"!==e[0]||"west"!==e[1])||(s+="w")}2===s.length&&(s+="u"),3===s.length&&(t.axis=s)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function a(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(t.datumCode=r.DATUM?r.DATUM.name.toLowerCase():r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=U(t.rectified_grid_angle)),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",U],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",U],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",U],["lat0","latitude_of_origin",U],["lat0","standard_parallel_1",U],["lat1","standard_parallel_1",U],["lat2","standard_parallel_2",U],["azimuth","Azimuth"],["alpha","azimuth",U],["srsCode","name"]].forEach((function(i){return function(t,i){var s=i[0],h=i[1];!(s in t)&&h in t&&(t[s]=t[h],3===i.length&&(t[s]=i[2](t[s])))}(t,i)})),V(t)}function K(t){if("object"==typeof t)return H(t);const i=function(t){const i=t.toUpperCase();return i.includes("PROJCRS")||i.includes("GEOGCRS")||i.includes("BOUNDCRS")||i.includes("VERTCRS")||i.includes("LENGTHUNIT")||i.includes("ANGLEUNIT")||i.includes("SCALEUNIT")?"WKT2":(i.includes("PROJCS")||i.includes("GEOGCS")||i.includes("LOCAL_CS")||i.includes("VERT_CS")||i.includes("UNIT"),"WKT1")}(t);var s=new D(t).output();if("WKT2"===i)return H(function(t){const i=function(t){return t.find((t=>Array.isArray(t)&&"USAGE"===t[0]))?"2019":(t.find((t=>Array.isArray(t)&&"CS"===t[0])),"2015")}(t);return("2019"===i?R:A).convert(t)}(s));var h=s[0],n={};return j(s,n),J(n),n[h]}function $(t){var i=this;if(2===arguments.length){var s=arguments[1];"string"==typeof s?$[t]="+"===s.charAt(0)?N(arguments[1]):K(arguments[1]):s&&"object"==typeof s&&!("projName"in s)?$[t]=K(arguments[1]):($[t]=s,s||delete $[t])}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){return Array.isArray(t)?$.apply(i,t):$(t)}));if("string"==typeof t){if(t in $)return $[t]}else"EPSG"in t?$["EPSG:"+t.EPSG]=t:"ESRI"in t?$["ESRI:"+t.ESRI]=t:"IAU2000"in t?$["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var i=1;i<=60;++i)t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}($);var Q=["3857","900913","3785","102113"];function tt(t,i){var s,h;if(t=t||{},!i)return t;for(h in i)void 0!==(s=i[h])&&(t[h]=s);return t}function it(t,i,s){var h=t*i;return s/Math.sqrt(1-h*h)}function st(t){return t<0?-1:1}function ht(t,i){return i||Math.abs(t)<=E?t:t-st(t)*y}function nt(t,i,s){var h=t*s;return h=Math.pow((1-h)/(1+h),.5*t),Math.tan(.5*(z-i))/h}function et(t,i){for(var s,h,n=.5*t,e=z-2*Math.atan(i),r=0;r<=15;r++)if(s=t*Math.sin(e),e+=h=z-2*Math.atan(i*Math.pow((1-s)/(1+s),n))-e,Math.abs(h)<=1e-10)return e;return-9999}function rt(t){return t}var at=["longlat","identity"],ot=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},forward:function(t){var i,s,h=t.x,n=t.y;if(n*b>90&&n*b<-90&&h*b>180&&h*b<-180)return null;if(Math.abs(Math.abs(n)-z)<=M)return null;if(this.sphere)i=this.x0+this.a*this.k0*ht(h-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(x+.5*n));else{var e=Math.sin(n),r=nt(this.e,n,e);i=this.x0+this.a*this.k0*ht(h-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h=t.x-this.x0,n=t.y-this.y0;if(this.sphere)s=z-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var e=Math.exp(-n/(this.a*this.k0));if(-9999===(s=et(this.e,e)))return null}return i=ht(this.long0+h/(this.a*this.k0),this.over),t.x=i,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]},{init:function(){},forward:rt,inverse:rt,names:at}],ut={},ct=[];function lt(t,i){var s=ct.length;return t.names?(ct[s]=t,t.names.forEach((function(t){ut[t.toLowerCase()]=s})),this):(console.log(i),!0)}function ft(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}var dt={start:function(){ot.forEach(lt)},add:lt,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==ut[i]&&ct[ut[i]]||(i=ft(i))in ut&&ct[ut[i]]?ct[ut[i]]:void 0}},vt={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const mt=vt.WGS84;var pt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var _t in pt){var gt=pt[_t];gt.datumName&&(pt[gt.datumName]=gt)}var zt={};async function Mt(t,i){for(var s=[],h=await i.getImageCount(),n=h-1;n>=0;n--){var e=await i.getImage(n),r=await e.readRasters(),a=[e.getWidth(),e.getHeight()],o=e.getBoundingBox().map(bt),u=[e.fileDirectory.ModelPixelScale[0],e.fileDirectory.ModelPixelScale[1]].map(bt),c=o[0]+(a[0]-1)*u[0],l=o[3]-(a[1]-1)*u[1],f=r[0],d=r[1],v=[];for(let t=a[1]-1;t>=0;t--)for(let i=a[0]-1;i>=0;i--){var m=t*a[0]+i;v.push([-xt(d[m]),xt(f[m])])}s.push({del:u,lim:a,ll:[-c,l],cvs:v})}var p={header:{nSubgrids:h},subgrids:s};return zt[t]=p,p}function wt(t){if(0===t.length)return null;var i="@"===t[0];return i&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:zt[t]||null,isNull:!1}}function bt(t){return t*Math.PI/180}function xt(t){return t/3600*Math.PI/180}function yt(t,i,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,s)))}function Et(t){return t.map((function(t){return[xt(t.longitudeShift),xt(t.latitudeShift)]}))}function St(t,i,s){return{name:yt(t,i+8,i+16).trim(),parent:yt(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,s),upperLatitude:t.getFloat64(i+88,s),lowerLongitude:t.getFloat64(i+104,s),upperLongitude:t.getFloat64(i+120,s),latitudeInterval:t.getFloat64(i+136,s),longitudeInterval:t.getFloat64(i+152,s),gridNodeCount:t.getInt32(i+168,s)}}function Pt(t,i,s,h,n){var e=i+176,r=16;!1===n&&(r=8);for(var a=[],o=0;o<s.gridNodeCount;o++){var u={latitudeShift:t.getFloat32(e+o*r,h),longitudeShift:t.getFloat32(e+o*r+4,h)};!1!==n&&(u.latitudeAccuracy=t.getFloat32(e+o*r+8,h),u.longitudeAccuracy=t.getFloat32(e+o*r+12,h)),a.push(u)}return a}function Gt(t,i){if(!(this instanceof Gt))return new Gt(t);this.forward=null,this.inverse=null,this.init=null,this.names=null,i=i||function(t){if(t)throw t};var s=function(t){if(!function(t){return"string"==typeof t}(t))return"projName"in t?t:K(t);if(function(t){return t in $}(t))return $[t];if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){var i=K(t);if(function(t){var i=k(t,"authority");if(i){var s=k(i,"epsg");return s&&Q.indexOf(s)>-1}}(i))return $["EPSG:3857"];var s=function(t){var i=k(t,"extension");if(i)return k(i,"proj4")}(i);return s?N(s):i}return function(t){return"+"===t[0]}(t)?N(t):void 0}(t);if("object"==typeof s){var h=Gt.projections.get(s.projName);if(h){if(s.datumCode&&"none"!==s.datumCode){var n=k(pt,s.datumCode);n&&(s.datum_params=s.datum_params||(n.towgs84?n.towgs84.split(","):null),s.ellps=n.ellipse,s.datumName=n.datumName?n.datumName:s.datumCode)}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var e,r,a,o,u,c,l=function(t,i,s,h,n){if(!t){var e=k(vt,h);e||(e=mt),t=e.a,i=e.b,s=e.rf}return s&&!i&&(i=(1-1/s)*t),(0===s||Math.abs(t-i)<M)&&(n=!0,i=t),{a:t,b:i,rf:s,sphere:n}}(s.a,s.b,s.rf,s.ellps,s.sphere),f=(u=((a=(e=l.a)*e)-(o=(r=l.b)*r))/a,c=0,s.R_A?(a=(e*=1-u*(.16666666666666666+u*(.04722222222222222+.022156084656084655*u)))*e,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(a-o)/o}),d=function(t){return void 0===t?null:t.split(",").map(wt)}(s.nadgrids),v=s.datum||function(t,i,s,h,n,e,r){var a={};return a.datum_type=void 0===t||"none"===t?5:4,i&&(a.datum_params=i.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=1),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=2,a.datum_params[3]*=g,a.datum_params[4]*=g,a.datum_params[5]*=g,a.datum_params[6]=a.datum_params[6]/1e6+1))),r&&(a.datum_type=3,a.grids=r),a.a=s,a.b=h,a.es=n,a.ep2=e,a}(s.datumCode,s.datum_params,l.a,l.b,f.es,f.ep2,d);tt(this,s),tt(this,h),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=v,"init"in this&&"function"==typeof this.init&&this.init(),i(null,this)}else i("Could not get projection name from: "+t)}else i("Could not parse to valid json: "+t)}function kt(t,i,s){var h,n,e,r=t.x,a=t.y,o=t.z?t.z:0;if(a<-z&&a>-1.001*z)a=-z;else if(a>z&&a<1.001*z)a=z;else{if(a<-z)return{x:-1/0,y:-1/0,z:t.z};if(a>z)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),n=Math.sin(a),e=Math.cos(a),{x:((h=s/Math.sqrt(1-i*(n*n)))+o)*e*Math.cos(r),y:(h+o)*e*Math.sin(r),z:(h*(1-i)+o)*n}}function Nt(t,i,s,h){var n,e,r,a,o,u,c,l,f,d,v,m,p,_,g,z=t.x,M=t.y,w=t.z?t.z:0;if(n=Math.sqrt(z*z+M*M),e=Math.sqrt(z*z+M*M+w*w),n/s<1e-12){if(_=0,e/s<1e-12)return g=-h,{x:t.x,y:t.y,z:t.z}}else _=Math.atan2(M,z);r=w/e,l=(a=n/e)*(1-i)*(o=1/Math.sqrt(1-i*(2-i)*a*a)),f=r*o,p=0;do{p++,u=i*(c=s/Math.sqrt(1-i*f*f))/(c+(g=n*l+w*f-c*(1-i*f*f))),m=(v=r*(o=1/Math.sqrt(1-u*(2-u)*a*a)))*l-(d=a*(1-u)*o)*f,l=d,f=v}while(m*m>1e-24&&p<30);return{x:_,y:Math.atan(v/Math.abs(d)),z:g}}function Ct(t){return 1===t||2===t}function At(t,i,s){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var h={x:-s.x,y:s.y},n={x:Number.NaN,y:Number.NaN},e=[];t:for(var r=0;r<t.grids.length;r++){var a=t.grids[r];if(e.push(a.name),a.isNull){n=h;break}if(null!==a.grid)for(var o=a.grid.subgrids,u=0,c=o.length;u<c;u++){var l=o[u],f=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4;if(!(l.ll[1]-f>h.y||l.ll[0]-f>h.x||l.ll[1]+(l.lim[1]-1)*l.del[1]+f<h.y||l.ll[0]+(l.lim[0]-1)*l.del[0]+f<h.x||(n=Rt(h,i,l),isNaN(n.x))))break t}else if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-h.x*b+" "+h.y*b+" tried: '"+e+"'"),-1):(s.x=-n.x,s.y=n.y,0)}function Rt(t,i,s){var h={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return h;var n={x:t.x,y:t.y};n.x-=s.ll[0],n.y-=s.ll[1],n.x=ht(n.x-Math.PI)+Math.PI;var e=It(n,s);if(i){if(isNaN(e.x))return h;e.x=n.x-e.x,e.y=n.y-e.y;var r,a,o=9;do{if(a=It(e,s),isNaN(a.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}e.x+=(r={x:n.x-(a.x+e.x),y:n.y-(a.y+e.y)}).x,e.y+=r.y}while(o--&&Math.abs(r.x)>1e-12&&Math.abs(r.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),h;h.x=ht(e.x+s.ll[0]),h.y=e.y+s.ll[1]}else isNaN(e.x)||(h.x=t.x+e.x,h.y=t.y+e.y);return h}function It(t,i){var s,h={x:t.x/i.del[0],y:t.y/i.del[1]},n=Math.floor(h.x),e=Math.floor(h.y),r=h.x-1*n,a=h.y-1*e,o={x:Number.NaN,y:Number.NaN};if(n<0||n>=i.lim[0])return o;if(e<0||e>=i.lim[1])return o;var u=i.cvs[s=e*i.lim[0]+n][0],c=i.cvs[s][1];s++;var l=i.cvs[s][0],f=i.cvs[s][1],d=i.cvs[s+=i.lim[0]][0],v=i.cvs[s][1];s--;var m=i.cvs[s][1],p=r*a,_=r*(1-a),g=(1-r)*(1-a),z=(1-r)*a;return o.x=g*u+_*l+z*i.cvs[s][0]+p*d,o.y=g*c+_*f+z*m+p*v,o}function Tt(t,i,s){var h,n,e,r=s.x,a=s.y,o=s.z||0,u={};for(e=0;e<3;e++)if(!i||2!==e||void 0!==s.z)switch(0===e?(h=r,n=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(h=a,n=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(h=o,n="z"),t.axis[e]){case"e":case"n":u[n]=h;break;case"w":case"s":u[n]=-h;break;case"u":void 0!==s[n]&&(u.z=h);break;case"d":void 0!==s[n]&&(u.z=-h);break;default:return null}return u}function Ot(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Ft(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Lt(t,i,s,h){var n,e=void 0!==(s=Array.isArray(s)?Ot(s):{x:s.x,y:s.y,z:s.z,m:s.m}).z;if(function(t){Ft(t.x),Ft(t.y)}(s),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type||3===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(s=Lt(t,n=new Gt("WGS84"),s,h),t=n),h&&"enu"!==t.axis&&(s=Tt(t,!1,s)),"longlat"===t.projName)s={x:s.x*w,y:s.y*w,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),!(s=t.inverse(s)))return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,i,s){if(function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i))return s;if(5===t.datum_type||5===i.datum_type)return s;var h=t.a,n=t.es;if(3===t.datum_type){if(0!==At(t,!1,s))return;h=p,n=_}var e=i.a,r=i.b,a=i.es;return 3===i.datum_type&&(e=p,r=6356752.314,a=_),n!==a||h!==e||Ct(t.datum_type)||Ct(i.datum_type)?(s=kt(s,n,h),Ct(t.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===i){var h=s[3],n=s[4],e=s[5],r=s[6];return{x:r*(t.x-e*t.y+n*t.z)+s[0],y:r*(e*t.x+t.y-h*t.z)+s[1],z:r*(-n*t.x+h*t.y+t.z)+s[2]}}}(s,t.datum_type,t.datum_params)),Ct(i.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===i){var h=s[3],n=s[4],e=s[5],r=s[6],a=(t.x-s[0])/r,o=(t.y-s[1])/r,u=(t.z-s[2])/r;return{x:a+e*o-n*u,y:-e*a+o+h*u,z:n*a-h*o+u}}}(s,i.datum_type,i.datum_params)),s=Nt(s,a,e,r),3!==i.datum_type||0===At(i,!0,s)?s:void 0):s}(t.datum,i.datum,s))return i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}),"longlat"===i.projName?s={x:s.x*b,y:s.y*b,z:s.z||0}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0})),h&&"enu"!==i.axis?Tt(i,!0,s):(s&&!e&&delete s.z,s)}(Gt.projections=dt).start();var Dt=Gt("WGS84");function Wt(t,i,s,h){var n,e,r;return Array.isArray(s)?(n=Lt(t,i,s,h)||{x:NaN,y:NaN},s.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(s.slice(3)):[n.x,n.y,s[2]].concat(s.slice(3)):[n.x,n.y].concat(s.slice(2)):[n.x,n.y]):(e=Lt(t,i,s,h),2===(r=Object.keys(s)).length||r.forEach((function(h){if(void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name){if("x"===h||"y"===h||"z"===h)return}else if("x"===h||"y"===h)return;e[h]=s[h]})),e)}function jt(t){return t instanceof Gt?t:"object"==typeof t&&"oProj"in t?t.oProj:Gt(t)}var Ut="AJSAJS",Vt="AFAFAF",qt=65,Bt=73,Xt=79,Ht={forward:Yt,inverse:function(t){var i=$t(ti(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]},toPoint:Jt};function Yt(t,i){return i=i||5,function(t,i){var s,h,n,e,r,a,o,u,c,l,f,d="00000"+t.easting,v="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,l=t.northing,f=Qt(t.zoneNumber),s=Math.floor(c/1e5),h=Math.floor(l/1e5)%20,e=Ut.charCodeAt(n=f-1),r=Vt.charCodeAt(n),u=!1,(a=e+s-1)>90&&(a=a-90+qt-1,u=!0),(a===Bt||e<Bt&&a>Bt||(a>Bt||e<Bt)&&u)&&a++,(a===Xt||e<Xt&&a>Xt||(a>Xt||e<Xt)&&u)&&++a===Bt&&a++,a>90&&(a=a-90+qt-1),(o=r+h)>86?(o=o-86+qt-1,u=!0):u=!1,(o===Bt||r<Bt&&o>Bt||(o>Bt||r<Bt)&&u)&&o++,(o===Xt||r<Xt&&o>Xt||(o>Xt||r<Xt)&&u)&&++o===Bt&&o++,o>86&&(o=o-86+qt-1),String.fromCharCode(a)+String.fromCharCode(o))+d.substr(d.length-5,i)+v.substr(v.length-5,i)}(function(t){var i,s,h,n,e,r,a,o=t.lat,u=t.lon,c=6378137,l=.00669438,f=.9996,d=Zt(o),v=Zt(u);a=Math.floor((u+180)/6)+1,180===u&&(a=60),o>=56&&o<64&&u>=3&&u<12&&(a=32),o>=72&&o<84&&(u>=0&&u<9?a=31:u>=9&&u<21?a=33:u>=21&&u<33?a=35:u>=33&&u<42&&(a=37)),r=Zt(6*(a-1)-180+3),i=.006739496752268451,s=c/Math.sqrt(1-l*Math.sin(d)*Math.sin(d)),h=Math.tan(d)*Math.tan(d),n=i*Math.cos(d)*Math.cos(d);var m,p,_=f*s*((e=Math.cos(d)*(v-r))+(1-h+n)*e*e*e/6+(5-18*h+h*h+72*n-58*i)*e*e*e*e*e/120)+5e5,g=f*(c*(.9983242984503243*d-.002514607064228144*Math.sin(2*d)+2639046602129982e-21*Math.sin(4*d)-3.418046101696858e-9*Math.sin(6*d))+s*Math.tan(d)*(e*e/2+(5-h+9*n+4*n*n)*e*e*e*e/24+(61-58*h+h*h+600*n-2.2240339282485886)*e*e*e*e*e*e/720));return o<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(_),zoneNumber:a,zoneLetter:(m=o,p="Z",84>=m&&m>=72?p="X":72>m&&m>=64?p="W":64>m&&m>=56?p="V":56>m&&m>=48?p="U":48>m&&m>=40?p="T":40>m&&m>=32?p="S":32>m&&m>=24?p="R":24>m&&m>=16?p="Q":16>m&&m>=8?p="P":8>m&&m>=0?p="N":0>m&&m>=-8?p="M":-8>m&&m>=-16?p="L":-16>m&&m>=-24?p="K":-24>m&&m>=-32?p="J":-32>m&&m>=-40?p="H":-40>m&&m>=-48?p="G":-48>m&&m>=-56?p="F":-56>m&&m>=-64?p="E":-64>m&&m>=-72?p="D":-72>m&&m>=-80&&(p="C"),p)}}({lat:t[1],lon:t[0]}),i)}function Jt(t){var i=$t(ti(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Zt(t){return t*(Math.PI/180)}function Kt(t){return t/Math.PI*180}function $t(t){var i=t.northing,s=t.easting,h=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var e,r,a,o,u,c,l,f,d,v=.9996,m=6378137,p=.00669438,_=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=s-5e5,z=i;h<"N"&&(z-=1e7),l=6*(n-1)-180+3,e=.006739496752268451,d=(f=z/v/6367449.145945056)+(3*_/2-27*_*_*_/32)*Math.sin(2*f)+(21*_*_/16-55*_*_*_*_/32)*Math.sin(4*f)+151*_*_*_/96*Math.sin(6*f),r=m/Math.sqrt(1-p*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=e*Math.cos(d)*Math.cos(d),u=.99330562*m/Math.pow(1-p*Math.sin(d)*Math.sin(d),1.5),c=g/(r*v);var M=d-r*Math.tan(d)/u*(c*c/2-(5+3*a+10*o-4*o*o-9*e)*c*c*c*c/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*c*c*c*c*c*c/720);M=Kt(M);var w,b=(c-(1+2*a+o)*c*c*c/6+(5-2*o+28*a-3*o*o+8*e+24*a*a)*c*c*c*c*c/120)/Math.cos(d);if(b=l+Kt(b),t.accuracy){var x=$t({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:x.lat,right:x.lon,bottom:M,left:b}}else w={lat:M,lon:b};return w}function Qt(t){var i=t%6;return 0===i&&(i=6),i}function ti(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,s=t.length,h=null,n="",e=0;!/[A-Z]/.test(i=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;n+=i,e++}var r=parseInt(n,10);if(0===e||e+3>s)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(e++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;h=t.substring(e,e+=2);for(var o=Qt(r),u=function(t,i){for(var s=Ut.charCodeAt(i-1),h=1e5,n=!1;s!==t.charCodeAt(0);){if(++s===Bt&&s++,s===Xt&&s++,s>90){if(n)throw"Bad character: "+t;s=qt,n=!0}h+=1e5}return h}(h.charAt(0),o),c=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=Vt.charCodeAt(i-1),h=0,n=!1;s!==t.charCodeAt(0);){if(++s===Bt&&s++,s===Xt&&s++,s>86){if(n)throw"Bad character: "+t;s=qt,n=!0}h+=1e5}return h}(h.charAt(1),o);c<ii(a);)c+=2e6;var l=s-e;if(l%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,d,v,m=l/2,p=0,_=0;return m>0&&(f=1e5/Math.pow(10,m),d=t.substring(e,e+m),p=parseFloat(d)*f,v=t.substring(e+m),_=parseFloat(v)*f),{easting:p+u,northing:_+c,zoneLetter:a,zoneNumber:r,accuracy:f}}function ii(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function si(t,i,s){if(!(this instanceof si))return new si(t,i,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var h=t.split(",");this.x=parseFloat(h[0]),this.y=parseFloat(h[1]),this.z=parseFloat(h[2])||0}else this.x=t,this.y=i,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}si.fromMGRS=function(t){return new si(Jt(t))},si.prototype.toMGRS=function(t){return Yt([this.x,this.y],t)};var hi=.046875,ni=.01953125,ei=.01068115234375;function ri(t){var i=[];i[0]=1-t*(.25+t*(hi+t*(ni+t*ei))),i[1]=t*(.75-t*(hi+t*(ni+t*ei)));var s=t*t;return i[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),i[3]=(s*=t)*(.3645833333333333-.005696614583333333*t),i[4]=s*t*.3076171875,i}function ai(t,i,s,h){return h[0]*t-(s*=i)*(h[1]+(i*=i)*(h[2]+i*(h[3]+i*h[4])))}function oi(t,i,s){for(var h=1/(1-i),n=t,e=20;e;--e){var r=Math.sin(n),a=1-i*r*r;if(n-=a=(ai(n,r,Math.cos(n),s)-t)*(a*Math.sqrt(a))*h,Math.abs(a)<M)return n}return n}var ui={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ri(this.es),this.ml0=ai(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,s,h,n=t.y,e=ht(t.x-this.long0,this.over),r=Math.sin(n),a=Math.cos(n);if(this.es){var o=a*e,u=Math.pow(o,2),c=this.ep2*Math.pow(a,2),l=Math.pow(c,2),f=Math.abs(a)>M?Math.tan(n):0,d=Math.pow(f,2),v=Math.pow(d,2);i=1-this.es*Math.pow(r,2),o/=Math.sqrt(i);var m=ai(n,r,a,this.en);s=this.a*(this.k0*o*(1+u/6*(1-d+c+u/20*(5-18*d+v+14*c-58*d*c+u/42*(61+179*v-v*d-479*d)))))+this.x0,h=this.a*(this.k0*(m-this.ml0+r*e*o/2*(1+u/12*(5-d+9*c+4*l+u/30*(61+v-58*d+270*c-330*d*c+u/56*(1385+543*v-v*d-3111*d))))))+this.y0}else{var p=a*Math.sin(e);if(Math.abs(Math.abs(p)-1)<M)return 93;if(s=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,h=a*Math.cos(e)/Math.sqrt(1-Math.pow(p,2)),(p=Math.abs(h))>=1){if(p-1>M)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=s,t.y=h,t},inverse:function(t){var i,s,h,n,e=1/this.a*(t.x-this.x0),r=1/this.a*(t.y-this.y0);if(this.es)if(s=oi(i=this.ml0+r/this.k0,this.es,this.en),Math.abs(s)<z){var a=Math.sin(s),o=Math.cos(s),u=Math.abs(o)>M?Math.tan(s):0,c=this.ep2*Math.pow(o,2),l=Math.pow(c,2),f=Math.pow(u,2),d=Math.pow(f,2);i=1-this.es*Math.pow(a,2);var v=e*Math.sqrt(i)/this.k0,m=Math.pow(v,2);h=s-(i*=u)*m/(1-this.es)*.5*(1-m/12*(5+3*f-9*c*f+c-4*l-m/30*(61+90*f-252*c*f+45*d+46*c-m/56*(1385+3633*f+4095*d+1574*d*f)))),n=ht(this.long0+v*(1-m/6*(1+2*f+c-m/20*(5+28*f+24*d+8*c*f+6*c-m/42*(61+662*f+1320*d+720*d*f))))/o,this.over)}else h=z*st(r),n=0;else{var p=Math.exp(e/this.k0),_=.5*(p-1/p),g=Math.cos(this.lat0+r/this.k0);i=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(_,2))),h=Math.asin(i),r<0&&(h=-h),n=0===_&&0===g?0:ht(Math.atan2(_,g)+this.long0,this.over)}return t.x=n,t.y=h,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ci(t){var i=Math.exp(t);return(i-1/i)/2}function li(t,i){t=Math.abs(t),i=Math.abs(i);var s=Math.max(t,i),h=Math.min(t,i)/(s||1);return s*Math.sqrt(1+Math.pow(h,2))}function fi(t,i){for(var s,h=2*Math.cos(2*i),n=t.length-1,e=t[n],r=0;--n>=0;)s=h*e-r+t[n],r=e,e=s;return i+s*Math.sin(2*i)}function di(t,i,s){for(var h,n,e=Math.sin(i),r=Math.cos(i),a=ci(s),o=function(t){var i=Math.exp(t);return(i+1/i)/2}(s),u=2*r*o,c=-2*e*a,l=t.length-1,f=t[l],d=0,v=0,m=0;--l>=0;)h=v,n=d,f=u*(v=f)-h-c*(d=m)+t[l],m=c*v-n+u*d;return[(u=e*o)*f-(c=r*a)*m,u*m+c*f]}var vi={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ui.init.apply(this),this.forward=ui.forward,this.inverse=ui.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),s=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),this.cgb[1]=(s*=i)*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),this.cgb[2]=(s*=i)*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=s*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),this.cgb[3]=(s*=i)*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=s*(1237/630+i*(i*(-24832/14175)-2.4)),this.cgb[4]=(s*=i)*(4174/315+i*(-144838/6237)),this.cbg[4]=s*(-734/315+i*(109598/31185)),this.cgb[5]=(s*=i)*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=s*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),this.utg[2]=(s*=i)*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),this.utg[3]=(s*=i)*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600))),this.utg[4]=(s*=i)*(-4583/161280+i*(108847/3991680)),this.gtu[4]=s*(34729/80640+i*(-3418889/1995840)),this.utg[5]=(s*=i)*(-20648693/638668800),this.gtu[5]=.6650675310896665*s;var h=fi(this.cbg,this.lat0);this.Zb=-this.Qn*(h+function(t,i){for(var s,h=2*Math.cos(i),n=t.length-1,e=t[n],r=0;--n>=0;)s=h*e-r+t[n],r=e,e=s;return Math.sin(i)*s}(this.gtu,2*h))},forward:function(t){var i=ht(t.x-this.long0,this.over),s=t.y;s=fi(this.cbg,s);var h=Math.sin(s),n=Math.cos(s),e=Math.sin(i),r=Math.cos(i);s=Math.atan2(h,r*n),i=Math.atan2(e*n,li(h,n*r)),i=function(t){var i=Math.abs(t);return i=function(t){var i=1+t,s=i-1;return 0===s?t:t*Math.log(i)/s}(i*(1+i/(li(1,i)+1))),t<0?-i:i}(Math.tan(i));var a,o,u=di(this.gtu,2*s,2*i);return s+=u[0],i+=u[1],Math.abs(i)<=2.623395162778?(a=this.a*(this.Qn*i)+this.x0,o=this.a*(this.Qn*s+this.Zb)+this.y0):(a=1/0,o=1/0),t.x=a,t.y=o,t},inverse:function(t){var i,s,h=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,h/=this.Qn,Math.abs(h)<=2.623395162778){var e=di(this.utg,2*n,2*h);n+=e[0],h+=e[1],h=Math.atan(ci(h));var r=Math.sin(n),a=Math.cos(n),o=Math.sin(h),u=Math.cos(h);n=Math.atan2(r*u,li(o,u*a)),i=ht((h=Math.atan2(o,u*a))+this.long0,this.over),s=fi(this.cgb,n)}else i=1/0,s=1/0;return t.x=i,t.y=s,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},mi={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(ht(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*w,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,vi.init.apply(this),this.forward=vi.forward,this.inverse=vi.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function pi(t,i){return Math.pow((1-t)/(1+t),i)}var _i={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+x)/(Math.pow(Math.tan(.5*this.lat0+x),this.C)*pi(this.e*t,this.ratexp))},forward:function(t){var i=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+x),this.C)*pi(this.e*Math.sin(s),this.ratexp))-z,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,s=t.y,h=Math.pow(Math.tan(.5*s+x)/this.K,1/this.C),n=20;n>0&&(s=2*Math.atan(h*pi(this.e*Math.sin(t.y),-.5*this.e))-z,!(Math.abs(s-t.y)<1e-14));--n)t.y=s;return n?(t.x=i,t.y=s,t):null}},gi={init:function(){_i.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,s,h,n;return t.x=ht(t.x-this.long0,this.over),_i.forward.apply(this,[t]),i=Math.sin(t.y),s=Math.cos(t.y),h=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*h))*s*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*s*h),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,s,h,n,e;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,e=li(t.x,t.y)){var r=2*Math.atan2(e,this.R2);i=Math.sin(r),s=Math.cos(r),n=Math.asin(s*this.sinc0+t.y*i*this.cosc0/e),h=Math.atan2(t.x*i,e*this.cosc0*s-t.y*this.sinc0*i)}else n=this.phic0,h=0;return t.x=h,t.y=n,_i.inverse.apply(this,[t]),t.x=ht(t.x+this.long0,this.over),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function zi(t,i,s){return i*=s,Math.tan(.5*(z+t))*Math.pow((1-i)/(1+i),.5*s)}var Mi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=M&&(this.k0=.5*(1+st(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=M&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=M&&Math.abs(Math.cos(this.lat_ts))>M&&(this.k0=.5*this.cons*it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/nt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=it(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(zi(this.lat0,this.sinlat0,this.e))-z,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,s,h,n,e,r,a=t.x,o=t.y,u=Math.sin(o),c=Math.cos(o),l=ht(a-this.long0,this.over);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=M&&Math.abs(o+this.lat0)<=M?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*u+this.coslat0*c*Math.cos(l)),t.x=this.a*i*c*Math.sin(l)+this.x0,t.y=this.a*i*(this.coslat0*u-this.sinlat0*c*Math.cos(l))+this.y0,t):(s=2*Math.atan(zi(o,u,this.e))-z,n=Math.cos(s),h=Math.sin(s),Math.abs(this.coslat0)<=M?(e=nt(this.e,o*this.con,this.con*u),t.x=this.x0+(r=2*this.a*this.k0*e/this.cons)*Math.sin(a-this.long0),t.y=this.y0-this.con*r*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<M?(i=2*this.a*this.k0/(1+n*Math.cos(l)),t.y=i*h):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*n*Math.cos(l))),t.y=i*(this.cosX0*h-this.sinX0*n*Math.cos(l))+this.y0),t.x=i*n*Math.sin(l)+this.x0,t))},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y-=this.y0;var e=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(e/(2*this.a*this.k0));return i=this.long0,s=this.lat0,e<=M?(t.x=i,t.y=s,t):(s=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/e),i=Math.abs(this.coslat0)<M?ht(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y),this.over):ht(this.long0+Math.atan2(t.x*Math.sin(r),e*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r)),this.over),t.x=i,t.y=s,t)}if(Math.abs(this.coslat0)<=M){if(e<=M)return s=this.lat0,t.x=i=this.long0,t.y=s,t;t.x*=this.con,t.y*=this.con,s=this.con*et(this.e,e*this.cons/(2*this.a*this.k0)),i=this.con*ht(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else h=2*Math.atan(e*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,e<=M?n=this.X0:(n=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/e),i=ht(this.long0+Math.atan2(t.x*Math.sin(h),e*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)),this.over)),s=-1*et(this.e,Math.tan(.5*(z+n)));return t.x=i,t.y=s,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:zi},wi={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),s=this.a,h=1/this.rf,n=2*h-Math.pow(h,2),e=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var r=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*i)/(1-e*i));this.K=r-this.alpha*a+this.alpha*e/2*o},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),h=2*(Math.atan(Math.exp(-this.alpha*(i+s)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),e=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(n))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*e+this.x0,t},inverse:function(t){for(var i=(t.x-this.x0)/this.R,s=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),h=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),n=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),e=this.lambda0+n/this.alpha,r=0,a=h,o=-1e3,u=0;Math.abs(a-o)>1e-7;){if(++u>20)return;r=1/this.alpha*(Math.log(Math.tan(Math.PI/4+h/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(a))/2)),o=a,a=2*Math.atan(Math.exp(r))-Math.PI/2}return t.x=e,t.y=a,t},names:["somerc"]},bi=1e-7,xi={init:function(){var t,i,s,h,n,e,r,a,o,u,c,l,f,d,v=0,m=0,p=0,_=0,g=0,w=0,b=0;this.no_off=(f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],d="object"==typeof(l=this).projName?Object.keys(l.projName)[0]:l.projName,"no_uoff"in l||"no_off"in l||-1!==f.indexOf(d)||-1!==f.indexOf(ft(d))),this.no_rot="no_rot"in this;var E=!1;"alpha"in this&&(E=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),E&&(b=this.alpha),S&&(v=this.rectified_grid_angle),E||S)m=this.longc;else if(p=this.long1,g=this.lat1,_=this.long2,w=this.lat2,Math.abs(g-w)<=bi||(t=Math.abs(g))<=bi||Math.abs(t-z)<=bi||Math.abs(Math.abs(this.lat0)-z)<=bi||Math.abs(Math.abs(w)-z)<=bi)throw new Error;var P=1-this.es;i=Math.sqrt(P),Math.abs(this.lat0)>M?(a=Math.sin(this.lat0),s=Math.cos(this.lat0),t=1-this.es*a*a,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*i/t,(n=(h=this.B*i/(s*Math.sqrt(t)))*h-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=h,this.E*=Math.pow(nt(this.e,this.lat0,a),this.B)):(this.B=1/i,this.A=this.k0,this.E=h=n=1),E||S?(E?(c=Math.asin(Math.sin(b)/h),S||(v=b)):(c=v,b=Math.asin(h*Math.sin(c))),this.lam0=m-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(e=Math.pow(nt(this.e,g,Math.sin(g)),this.B),r=Math.pow(nt(this.e,w,Math.sin(w)),this.B),n=this.E/e,o=(r-e)/(r+e),u=((u=this.E*this.E)-r*e)/(u+r*e),(t=p-_)<-Math.PI?_-=y:t>Math.PI&&(_+=y),this.lam0=ht(.5*(p+_)-Math.atan(u*Math.tan(.5*this.B*(p-_))/o)/this.B,this.over),c=Math.atan(2*Math.sin(this.B*ht(p-this.lam0,this.over))/(n-1/n)),v=b=Math.asin(h*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(h*h-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(x-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(x+n))},forward:function(t){var i,s,h,n,e,r,a,o,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-z)>M){if(i=.5*((e=this.E/Math.pow(nt(this.e,t.y,Math.sin(t.y)),this.B))-(r=1/e)),s=.5*(e+r),n=Math.sin(this.B*t.x),h=(i*this.singam-n*this.cosgam)/s,Math.abs(Math.abs(h)-1)<M)throw new Error;o=.5*this.ArB*Math.log((1-h)/(1+h)),r=Math.cos(this.B*t.x),a=Math.abs(r)<bi?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+n*this.singam,r)}else o=t.y>0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(u.x=a,u.y=o):(u.x=o*this.cosrot+(a-=this.u_0)*this.sinrot,u.y=a*this.cosrot-o*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var i,s,h,n,e,r,a,o={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(s=t.y,i=t.x):(s=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((h=Math.exp(-this.BrA*s))-1/h),e=.5*(h+1/h),a=((r=Math.sin(this.BrA*i))*this.cosgam+n*this.singam)/e,Math.abs(Math.abs(a)-1)<M)o.x=0,o.y=a<0?-z:z;else{if(o.y=this.E/Math.sqrt((1+a)/(1-a)),o.y=et(this.e,Math.pow(o.y,1/this.B)),o.y===1/0)throw new Error;o.x=-this.rB*Math.atan2(n*this.cosgam-r*this.singam,Math.cos(this.BrA*i))}return o.x+=this.lam0,o},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},yi={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<M)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),s=Math.cos(this.lat1),h=it(this.e,i,s),n=nt(this.e,this.lat1,i),e=Math.sin(this.lat2),r=Math.cos(this.lat2),a=it(this.e,e,r),o=nt(this.e,this.lat2,e),u=Math.abs(Math.abs(this.lat0)-z)<M?0:nt(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>M?Math.log(h/a)/Math.log(n/o):i,isNaN(this.ns)&&(this.ns=i),this.f0=h/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=M&&(s=st(s)*(z-2e-10));var h,n,e=Math.abs(Math.abs(s)-z);if(e>M)h=nt(this.e,s,Math.sin(s)),n=this.a*this.f0*Math.pow(h,this.ns);else{if((e=s*this.ns)<=0)return null;n=0}var r=this.ns*ht(i-this.long0,this.over);return t.x=this.k0*(n*Math.sin(r))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(r))+this.y0,t},inverse:function(t){var i,s,h,n,e,r=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(r*r+a*a),s=1):(i=-Math.sqrt(r*r+a*a),s=-1);var o=0;if(0!==i&&(o=Math.atan2(s*r,s*a)),0!==i||this.ns>0){if(s=1/this.ns,h=Math.pow(i/(this.a*this.f0),s),-9999===(n=et(this.e,h)))return null}else n=-z;return e=ht(o/this.ns+this.long0,this.over),t.x=e,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Ei={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,s,h,n,e,r,a,o=t.y,u=ht(t.x-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(o/2+this.s45),this.alfa)/i)-this.s45),h=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(h)),e=Math.asin(Math.cos(s)*Math.sin(h)/Math.cos(n)),r=this.n*e,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(r)/1,t.x=a*Math.sin(r)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,s,h,n,e,r,a,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),h=2*(Math.atan(Math.pow(this.ro0/e,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(h)-Math.sin(this.ad)*Math.cos(h)*Math.cos(n)),s=Math.asin(Math.cos(h)*Math.sin(n)/Math.cos(i)),t.x=this.long0-s/this.alfa,r=i,a=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(r))/(1-this.e*Math.sin(r)),this.e/2))-this.s45),Math.abs(r-t.y)<1e-10&&(a=1),r=t.y,u+=1}while(0===a&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function Si(t,i,s,h,n){return t*n-i*Math.sin(2*n)+s*Math.sin(4*n)-h*Math.sin(6*n)}function Pi(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Gi(t){return.375*t*(1+.25*t*(1+.46875*t))}function ki(t){return.05859375*t*t*(1+.75*t)}function Ni(t){return t*t*t*(35/3072)}function Ci(t,i,s){var h=i*s;return t/Math.sqrt(1-h*h)}function Ai(t){return Math.abs(t)<z?t:t-st(t)*Math.PI}function Ri(t,i,s,h,n){var e,r;e=t/i;for(var a=0;a<15;a++)if(e+=r=(t-(i*e-s*Math.sin(2*e)+h*Math.sin(4*e)-n*Math.sin(6*e)))/(i-2*s*Math.cos(2*e)+4*h*Math.cos(4*e)-6*n*Math.cos(6*e)),Math.abs(r)<=1e-10)return e;return NaN}var Ii={init:function(){this.sphere||(this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.ml0=this.a*Si(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,s,h=t.x,n=t.y;if(h=ht(h-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(h)),s=this.a*(Math.atan2(Math.tan(n),Math.cos(h))-this.lat0);else{var e=Math.sin(n),r=Math.cos(n),a=Ci(this.a,this.e,e),o=Math.tan(n)*Math.tan(n),u=h*Math.cos(n),c=u*u,l=this.es*r*r/(1-this.es);i=a*u*(1-c*o*(1/6-(8-o+8*l)*c/120)),s=this.a*Si(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+a*e/r*c*(.5+(5-o+6*l)*c/24)}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h=t.x/this.a,n=t.y/this.a;if(this.sphere){var e=n+this.lat0;i=Math.asin(Math.sin(e)*Math.cos(h)),s=Math.atan2(Math.tan(h),Math.cos(e))}else{var r=Ri(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-z)<=M)return t.x=this.long0,t.y=z,n<0&&(t.y*=-1),t;var a=Ci(this.a,this.e,Math.sin(r)),o=a*a*a/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(r),2),c=h*this.a/a,l=c*c;i=r-a*Math.tan(r)/o*c*c*(.5-(1+3*u)*c*c/24),s=c*(1-l*(u/3+(1+3*u)*u*l/15))/Math.cos(r)}return t.x=ht(s+this.long0,this.over),t.y=Ai(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Ti(t,i){var s;return t>1e-7?(1-t*t)*(i/(1-(s=t*i)*s)-.5/t*Math.log((1-s)/(1+s))):2*i}var Oi={init:function(){var t,i=Math.abs(this.lat0);if(this.mode=Math.abs(i-z)<M?this.lat0<0?1:2:Math.abs(i)<M?3:4,this.es>0)switch(this.qp=Ti(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,s=[];return s[0]=.3333333333333333*t,s[0]+=.17222222222222222*(i=t*t),s[1]=.06388888888888888*i,s[0]+=.10257936507936508*(i*=t),s[1]+=.0664021164021164*i,s[2]=.016415012942191543*i,s}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ti(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,s,h,n,e,r,a,o,u,c,l=t.x,f=t.y;if(l=ht(l-this.long0,this.over),this.sphere){if(e=Math.sin(f),c=Math.cos(f),h=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((s=this.mode===this.EQUIT?1+c*h:1+this.sinph0*e+this.cosph0*c*h)<=M)return null;i=(s=Math.sqrt(2/s))*c*Math.sin(l),s*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*c*h}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),Math.abs(f+this.lat0)<M)return null;s=x-.5*f,i=(s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)))*Math.sin(l),s*=h}}else{switch(a=0,o=0,u=0,h=Math.cos(l),n=Math.sin(l),e=Math.sin(f),r=Ti(this.e,e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=r/this.qp,o=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:u=1+this.sinb1*a+this.cosb1*o*h;break;case this.EQUIT:u=1+o*h;break;case this.N_POLE:u=z+f,r=this.qp-r;break;case this.S_POLE:u=f-z,r=this.qp+r}if(Math.abs(u)<M)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),s=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*a-this.sinb1*o*h):(u=Math.sqrt(2/(1+o*h)))*a*this.ymf,i=this.xmf*u*o*n;break;case this.N_POLE:case this.S_POLE:r>=0?(i=(u=Math.sqrt(r))*n,s=h*(this.mode===this.S_POLE?u:-u)):i=s=0}}return t.x=this.a*i+this.x0,t.y=this.a*s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h,n,e,r,a,o,u,c,l=t.x/this.a,f=t.y/this.a;if(this.sphere){var d,v=0,m=0;if((s=.5*(d=Math.sqrt(l*l+f*f)))>1)return null;switch(s=2*Math.asin(s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(s),v=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(d)<=M?0:Math.asin(f*m/d),l*=m,f=v*d;break;case this.OBLIQ:s=Math.abs(d)<=M?this.lat0:Math.asin(v*this.sinph0+f*m*this.cosph0/d),l*=m*this.cosph0,f=(v-Math.sin(s)*this.sinph0)*d;break;case this.N_POLE:f=-f,s=z-s;break;case this.S_POLE:s-=z}i=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,f*=this.dd,(r=Math.sqrt(l*l+f*f))<M)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*r/this.rq),h=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(e=this.qp*(a=h*this.sinb1+f*n*this.cosb1/r),f=r*this.cosb1*h-f*this.sinb1*n):(e=this.qp*(a=f*n/r),f=r*h)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(e=l*l+f*f))return t.x=this.long0,t.y=this.lat0,t;a=1-e/this.qp,this.mode===this.S_POLE&&(a=-a)}i=Math.atan2(l,f),c=(o=Math.asin(a))+o,s=o+(u=this.apa)[0]*Math.sin(c)+u[1]*Math.sin(c+c)+u[2]*Math.sin(c+c+c)}return t.x=ht(this.long0+i,this.over),t.y=s,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Fi(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Li={init:function(){Math.abs(this.lat1+this.lat2)<M||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=it(this.e3,this.sin_po,this.cos_po),this.qs1=Ti(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=it(this.e3,this.sin_po,this.cos_po),this.qs2=Ti(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ti(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>M?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var h=Ti(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*h)/this.ns0,e=this.ns0*ht(i-this.long0,this.over),r=n*Math.sin(e)+this.x0,a=this.rh-n*Math.cos(e)+this.y0;return t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),h=0,0!==i&&(h=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,e=this.sphere?Math.asin((this.c-s*s)/(2*this.ns0)):this.phi1z(this.e3,(this.c-s*s)/this.ns0),n=ht(h/this.ns0+this.long0,this.over),t.x=n,t.y=e,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,i){var s,h,n,e,r=Fi(.5*i);if(t<M)return r;for(var a=t*t,o=1;o<=25;o++)if(r+=e=.5*(n=1-(h=t*(s=Math.sin(r)))*h)*n/Math.cos(r)*(i/(1-a)-s/n+.5/t*Math.log((1-h)/(1+h))),Math.abs(e)<=1e-7)return r;return null}},Di={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,s,h,n,e,r,a,o=t.y;return h=ht(t.x-this.long0,this.over),i=Math.sin(o),s=Math.cos(o),n=Math.cos(h),(e=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(e)<=M?(r=this.x0+1*this.a*s*Math.sin(h)/e,a=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)/e):(r=this.x0+this.infinity_dist*s*Math.sin(h),a=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*n)),t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e,r;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),s=Math.sin(n),r=Fi((h=Math.cos(n))*this.sin_p14+t.y*s*this.cos_p14/i),e=Math.atan2(t.x*s,i*this.cos_p14*h-t.y*this.sin_p14*s),e=ht(this.long0+e,this.over)):(r=this.phic0,e=0),t.x=e,t.y=r,t},names:["gnom"]},Wi={init:function(){this.sphere||(this.k0=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,s,h=t.y,n=ht(t.x-this.long0,this.over);if(this.sphere)i=this.x0+this.a*n*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var e=Ti(this.e,Math.sin(h));i=this.x0+this.a*this.k0*n,s=this.y0+this.a*e*.5/this.k0}return t.x=i,t.y=s,t},inverse:function(t){var i,s;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=ht(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=function(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6)return i<0?-1*z:z;for(var h,n,e,r,a=Math.asin(.5*i),o=0;o<30;o++)if(n=Math.sin(a),e=Math.cos(a),r=t*n,a+=h=Math.pow(1-r*r,2)/(2*e)*(i/(1-t*t)-n/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),Math.abs(h)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),i=ht(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=s,t},names:["cea"]},ji={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.y,s=ht(t.x-this.long0,this.over),h=Ai(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var i=t.y;return t.x=ht(this.long0+(t.x-this.x0)/(this.a*this.rc),this.over),t.y=Ai(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]},Ui={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.ml0=this.a*Si(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,s,h,n=t.y,e=ht(t.x-this.long0,this.over);if(h=e*Math.sin(n),this.sphere)Math.abs(n)<=M?(i=this.a*e,s=-1*this.a*this.lat0):(i=this.a*Math.sin(h)/Math.tan(n),s=this.a*(Ai(n-this.lat0)+(1-Math.cos(h))/Math.tan(n)));else if(Math.abs(n)<=M)i=this.a*e,s=-1*this.ml0;else{var r=Ci(this.a,this.e,Math.sin(n))/Math.tan(n);i=r*Math.sin(h),s=this.a*Si(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+r*(1-Math.cos(h))}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){var i,s,h,n,e,r,a,o,u;if(h=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=M)i=ht(h/this.a+this.long0,this.over),s=0;else{var c;for(a=h*h/this.a/this.a+(r=this.lat0+n/this.a)*r,o=r,e=20;e;--e)if(o+=u=-1*(r*(o*(c=Math.tan(o))+1)-o-.5*(o*o+a)*c)/((o-r)/c-1),Math.abs(u)<=M){s=o;break}i=ht(this.long0+Math.asin(h*Math.tan(o)/this.a)/Math.sin(s),this.over)}else if(Math.abs(n+this.ml0)<=M)s=0,i=ht(this.long0+h/this.a,this.over);else{var l,f,d,v,m;for(a=h*h/this.a/this.a+(r=(this.ml0+n)/this.a)*r,o=r,e=20;e;--e)if(m=this.e*Math.sin(o),l=Math.sqrt(1-m*m)*Math.tan(o),f=this.a*Si(this.e0,this.e1,this.e2,this.e3,o),d=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=u=(r*(l*(v=f/this.a)+1)-v-.5*l*(v*v+a))/(this.es*Math.sin(2*o)*(v*v+a-2*r*v)/(4*l)+(r-v)*(l*d-2/Math.sin(2*o))-d),Math.abs(u)<=M){s=o;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),i=ht(this.long0+Math.asin(h*l/this.a)/Math.sin(s),this.over)}return t.x=i,t.y=s,t},names:["Polyconic","American_Polyconic","poly"]},Vi={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,s=(t.y-this.lat0)/g*1e-5,h=t.x-this.long0,n=1,e=0;for(i=1;i<=10;i++)e+=this.A[i]*(n*=s);var r,a=e,o=h,u=1,c=0,l=0,f=0;for(i=1;i<=6;i++)r=c*a+u*o,l=l+this.B_re[i]*(u=u*a-c*o)-this.B_im[i]*(c=r),f=f+this.B_im[i]*u+this.B_re[i]*c;return t.x=f*this.a+this.x0,t.y=l*this.a+this.y0,t},inverse:function(t){var i,s,h=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,e=1,r=0,a=0,o=0;for(i=1;i<=6;i++)s=r*h+e*n,a=a+this.C_re[i]*(e=e*h-r*n)-this.C_im[i]*(r=s),o=o+this.C_im[i]*e+this.C_re[i]*r;for(var u=0;u<this.iterations;u++){var c,l=a,f=o,d=h,v=n;for(i=2;i<=6;i++)c=f*a+l*o,d+=(i-1)*(this.B_re[i]*(l=l*a-f*o)-this.B_im[i]*(f=c)),v+=(i-1)*(this.B_im[i]*l+this.B_re[i]*f);l=1,f=0;var m=this.B_re[1],p=this.B_im[1];for(i=2;i<=6;i++)c=f*a+l*o,m+=i*(this.B_re[i]*(l=l*a-f*o)-this.B_im[i]*(f=c)),p+=i*(this.B_im[i]*l+this.B_re[i]*f);var _=m*m+p*p;a=(d*m+v*p)/_,o=(v*m-d*p)/_}var z=a,M=o,w=1,b=0;for(i=1;i<=9;i++)b+=this.D[i]*(w*=z);var x=this.lat0+b*g*1e5;return t.x=this.long0+M,t.y=x,t},names:["New_Zealand_Map_Grid","nzmg"]},qi={init:function(){},forward:function(t){var i=t.y,s=ht(t.x-this.long0,this.over),h=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=ht(this.long0+t.x/this.a,this.over),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=s,t},names:["Miller_Cylindrical","mill"]},Bi={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=ri(this.es)},forward:function(t){var i,s,h=t.x,n=t.y;if(h=ht(h-this.long0,this.over),this.sphere){if(this.m)for(var e=this.n*Math.sin(n),r=20;r;--r){var a=(this.m*n+Math.sin(n)-e)/(this.m+Math.cos(n));if(n-=a,Math.abs(a)<M)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;i=this.a*this.C_x*h*(this.m+Math.cos(n)),s=this.a*this.C_y*n}else{var o=Math.sin(n),u=Math.cos(n);s=this.a*ai(n,o,u,this.en),i=this.a*h*u/Math.sqrt(1-this.es*o*o)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s/=this.C_x*(this.m+Math.cos(i)),this.m?i=Fi((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=Fi(Math.sin(i)/this.n)),s=ht(s+this.long0,this.over),i=Ai(i)):(i=oi(t.y/this.a,this.es,this.en),(h=Math.abs(i))<z?(h=Math.sin(i),s=ht(this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(i)),this.over)):h-M<z&&(s=this.long0)),t.x=s,t.y=i,t},names:["Sinusoidal","sinu"]},Xi={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){for(var i=t.y,s=ht(t.x-this.long0,this.over),h=i,n=Math.PI*Math.sin(i);;){var e=-(h+Math.sin(h)-n)/(1+Math.cos(h));if(h+=e,Math.abs(e)<M)break}h/=2,Math.PI/2-Math.abs(i)<M&&(s=0);var r=.900316316158*this.a*s*Math.cos(h)+this.x0,a=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=r,t.y=a,t},inverse:function(t){var i,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),i=Math.asin(s);var h=ht(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);h<-Math.PI&&(h=-Math.PI),h>Math.PI&&(h=Math.PI),s=(2*i+Math.sin(2*i))/Math.PI,Math.abs(s)>1&&(s=1);var n=Math.asin(s);return t.x=h,t.y=n,t},names:["Mollweide","moll"]},Hi={init:function(){Math.abs(this.lat1+this.lat2)<M||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=it(this.e,this.sin_phi,this.cos_phi),this.ml1=Si(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<M?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=it(this.e,this.sin_phi,this.cos_phi),this.ml2=Si(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Si(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,s=t.x,h=t.y;if(this.sphere)i=this.a*(this.g-h);else{var n=Si(this.e0,this.e1,this.e2,this.e3,h);i=this.a*(this.g-n)}var e=this.ns*ht(s-this.long0,this.over),r=this.x0+i*Math.sin(e),a=this.y0+this.rh-i*Math.cos(e);return t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var e=0;return 0!==s&&(e=Math.atan2(i*t.x,i*t.y)),this.sphere?(n=ht(this.long0+e/this.ns,this.over),h=Ai(this.g-s/this.a),t.x=n,t.y=h,t):(h=Ri(this.g-s/this.a,this.e0,this.e1,this.e2,this.e3),n=ht(this.long0+e/this.ns,this.over),t.x=n,t.y=h,t)},names:["Equidistant_Conic","eqdc"]},Yi={init:function(){this.R=this.a},forward:function(t){var i,s,h=t.y,n=ht(t.x-this.long0,this.over);Math.abs(h)<=M&&(i=this.x0+this.R*n,s=this.y0);var e=Fi(2*Math.abs(h/Math.PI));(Math.abs(n)<=M||Math.abs(Math.abs(h)-z)<=M)&&(i=this.x0,s=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*e):this.y0+Math.PI*this.R*-Math.tan(.5*e));var r=.5*Math.abs(Math.PI/n-n/Math.PI),a=r*r,o=Math.sin(e),u=Math.cos(e),c=u/(o+u-1),l=c*(2/o-1),f=l*l,d=Math.PI*this.R*(r*(c-f)+Math.sqrt(a*(c-f)*(c-f)-(f+a)*(c*c-f)))/(f+a);n<0&&(d=-d),i=this.x0+d;var v=a+c;return d=Math.PI*this.R*(l*v-r*Math.sqrt((f+a)*(a+1)-v*v))/(f+a),s=h>=0?this.y0+d:this.y0-d,t.x=i,t.y=s,t},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,e=(h=t.x/l)*h+(n=t.y/l)*n,l=3*(n*n/(o=-2*(r=-Math.abs(n)*(1+e))+1+2*n*n+e*e)+(2*(a=r-2*n*n+h*h)*a*a/o/o/o-9*r*a/o/o)/27)/(u=(r-a*a/3/o)/o)/(c=2*Math.sqrt(-u/3)),Math.abs(l)>1&&(l=l>=0?1:-1),f=Math.acos(l)/3,s=t.y>=0?(-c*Math.cos(f+Math.PI/3)-a/3/o)*Math.PI:-(-c*Math.cos(f+Math.PI/3)-a/3/o)*Math.PI,i=Math.abs(h)<M?this.long0:ht(this.long0+Math.PI*(e-1+Math.sqrt(1+2*(h*h-n*n)+e*e))/2/h,this.over),t.x=i,t.y=s,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]},Ji={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function(t){var i,s,h,n,e,r,a,o,u,c,l,f=t.x,d=t.y,v=Math.sin(t.y),m=Math.cos(t.y),p=ht(f-this.long0,this.over);return this.sphere?Math.abs(this.sin_p12-1)<=M?(t.x=this.x0+this.a*(z-d)*Math.sin(p),t.y=this.y0-this.a*(z-d)*Math.cos(p),t):Math.abs(this.sin_p12+1)<=M?(t.x=this.x0+this.a*(z+d)*Math.sin(p),t.y=this.y0+this.a*(z+d)*Math.cos(p),t):(u=this.sin_p12*v+this.cos_p12*m*Math.cos(p),o=(a=Math.acos(u))?a/Math.sin(a):1,t.x=this.x0+this.a*o*m*Math.sin(p),t.y=this.y0+this.a*o*(this.cos_p12*v-this.sin_p12*m*Math.cos(p)),t):(i=Pi(this.es),s=Gi(this.es),h=ki(this.es),n=Ni(this.es),Math.abs(this.sin_p12-1)<=M?(e=this.a*Si(i,s,h,n,z),r=this.a*Si(i,s,h,n,d),t.x=this.x0+(e-r)*Math.sin(p),t.y=this.y0-(e-r)*Math.cos(p),t):Math.abs(this.sin_p12+1)<=M?(e=this.a*Si(i,s,h,n,z),r=this.a*Si(i,s,h,n,d),t.x=this.x0+(e+r)*Math.sin(p),t.y=this.y0+(e+r)*Math.cos(p),t):Math.abs(f)<M&&Math.abs(d-this.lat0)<M?(t.x=t.y=0,t):(c=function(t,i,s,h,n,e){const r=h-i,a=Math.atan((1-e)*Math.tan(t)),o=Math.atan((1-e)*Math.tan(s)),u=Math.sin(a),c=Math.cos(a),l=Math.sin(o),f=Math.cos(o);let d,v,m,p,_,g,z,M,w,b,x,y,E,S,P,G=r,k=100;do{if(v=Math.sin(G),m=Math.cos(G),p=Math.sqrt(f*v*(f*v)+(c*l-u*f*m)*(c*l-u*f*m)),0===p)return{azi1:0,s12:0};_=u*l+c*f*m,g=Math.atan2(p,_),z=c*f*v/p,M=1-z*z,w=0!==M?_-2*u*l/M:0,b=e/16*M*(4+e*(4-3*M)),d=G,G=r+(1-b)*e*z*(g+b*p*(w+b*_*(2*w*w-1)))}while(Math.abs(G-d)>1e-12&&--k>0);return 0===k?{azi1:NaN,s12:NaN}:(x=M*(n*n-n*(1-e)*(n*(1-e)))/(n*(1-e)*(n*(1-e))),y=1+x/16384*(4096+x*(x*(320-175*x)-768)),E=x/1024*(256+x*(x*(74-47*x)-128)),S=E*p*(w+E/4*(_*(2*w*w-1)-E/6*w*(4*p*p-3)*(4*w*w-3))),P=n*(1-e)*y*(g-S),{azi1:Math.atan2(f*v,c*l-u*f*m),s12:P})}(this.lat0,this.long0,d,f,this.a,this.f),l=c.azi1,t.x=c.s12*Math.sin(l),t.y=c.s12*Math.cos(l),t))},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f,d,v,m;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*z*this.a)return;return s=i/this.a,h=Math.sin(s),n=Math.cos(s),e=this.long0,Math.abs(i)<=M?r=this.lat0:(r=Fi(n*this.sin_p12+t.y*h*this.cos_p12/i),a=Math.abs(this.lat0)-z,e=Math.abs(a)<=M?ht(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y),this.over):ht(this.long0+Math.atan2(t.x*h,i*this.cos_p12*n-t.y*this.sin_p12*h),this.over)),t.x=e,t.y=r,t}return o=Pi(this.es),u=Gi(this.es),c=ki(this.es),l=Ni(this.es),Math.abs(this.sin_p12-1)<=M?(r=Ri(((f=this.a*Si(o,u,c,l,z))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,o,u,c,l),e=ht(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=e,t.y=r,t):Math.abs(this.sin_p12+1)<=M?(f=this.a*Si(o,u,c,l,z),r=Ri(((i=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,o,u,c,l),e=ht(this.long0+Math.atan2(t.x,t.y),this.over),t.x=e,t.y=r,t):(d=Math.atan2(t.x,t.y),v=Math.sqrt(t.x*t.x+t.y*t.y),m=function(t,i,s,h,n,e){const r=Math.atan((1-e)*Math.tan(t)),a=Math.sin(r),o=Math.cos(r),u=Math.sin(s),c=Math.cos(s),l=Math.atan2(a,o*c),f=o*u,d=1-f*f,v=d*(n*n-n*(1-e)*(n*(1-e)))/(n*(1-e)*(n*(1-e))),m=1+v/16384*(4096+v*(v*(320-175*v)-768)),p=v/1024*(256+v*(v*(74-47*v)-128));let _,g,z,M,w,b=h/(n*(1-e)*m),x=100;do{g=Math.cos(2*l+b),z=Math.sin(b),M=Math.cos(b),w=p*z*(g+p/4*(M*(2*g*g-1)-p/6*g*(4*z*z-3)*(4*g*g-3))),_=b,b=h/(n*(1-e)*m)+w}while(Math.abs(b-_)>1e-12&&--x>0);if(0===x)return{lat2:NaN,lon2:NaN};const y=a*z-o*M*c,E=e/16*d*(4+e*(4-3*d));return{lat2:Math.atan2(a*M+o*z*c,(1-e)*Math.sqrt(f*f+y*y)),lon2:i+(Math.atan2(z*u,o*M-a*z*c)-(1-E)*e*f*(b+E*z*(g+E*M*(2*g*g-1))))}}(this.lat0,this.long0,d,v,this.a,this.f),t.x=m.lon2,t.y=m.lat2,t)},names:["Azimuthal_Equidistant","aeqd"]},Zi={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,e,r,a,o=t.y;return h=ht(t.x-this.long0,this.over),i=Math.sin(o),s=Math.cos(o),n=Math.cos(h),((e=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(e)<=M)&&(r=1*this.a*s*Math.sin(h),a=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)),t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e,r,a;return t.x-=this.x0,t.y-=this.y0,s=Fi((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),h=Math.sin(s),n=Math.cos(s),r=this.long0,Math.abs(i)<=M?(a=this.lat0,t.x=r,t.y=a,t):(a=Fi(n*this.sin_p14+t.y*h*this.cos_p14/i),e=Math.abs(this.lat0)-z,Math.abs(e)<=M?(r=ht(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y),this.over),t.x=r,t.y=a,t):(r=ht(this.long0+Math.atan2(t.x*h,i*this.cos_p14*n-t.y*this.sin_p14*h),this.over),t.x=r,t.y=a,t))},names:["ortho"]};function Ki(t,i,s,h){var n;return t<M?(h.value=1,n=0):(n=Math.atan2(i,s),Math.abs(n)<=x?h.value=1:n>x&&n<=z+x?(h.value=2,n-=z):n>z+x||n<=-(z+x)?(h.value=3,n=n>=0?n-E:n+E):(h.value=4,n+=z)),n}function $i(t,i){var s=t+i;return s<-E?s+=y:s>+E&&(s-=y),s}var Qi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=z-x/2?5:this.lat0<=-(z-x/2)?6:Math.abs(this.long0)<=x?1:Math.abs(this.long0)<=z+x?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,s,h,n,e,r,a={x:0,y:0},o={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,s=t.x,5===this.face)n=z-i,s>=x&&s<=z+x?(o.value=1,h=s-z):s>z+x||s<=-(z+x)?(o.value=2,h=s>0?s-E:s+E):s>-(z+x)&&s<=-x?(o.value=3,h=s+z):(o.value=4,h=s);else if(6===this.face)n=z+i,s>=x&&s<=z+x?(o.value=1,h=-s+z):s<x&&s>=-x?(o.value=2,h=-s):s<-x&&s>=-(z+x)?(o.value=3,h=-s-z):(o.value=4,h=s>0?-s+E:-s-E);else{var u,c,l,f,d,v;2===this.face?s=$i(s,+z):3===this.face?s=$i(s,+E):4===this.face&&(s=$i(s,-z)),f=Math.sin(i),d=Math.cos(i),v=Math.sin(s),u=d*Math.cos(s),c=d*v,l=f,1===this.face?h=Ki(n=Math.acos(u),l,c,o):2===this.face?h=Ki(n=Math.acos(c),l,-u,o):3===this.face?h=Ki(n=Math.acos(-u),l,-c,o):4===this.face?h=Ki(n=Math.acos(-c),l,u,o):(n=h=0,o.value=1)}return r=Math.atan(12/E*(h+Math.acos(Math.sin(h)*Math.cos(x))-z)),e=Math.sqrt((1-Math.cos(n))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(h))))),2===o.value?r+=z:3===o.value?r+=E:4===o.value&&(r+=1.5*E),a.x=e*Math.cos(r),a.y=e*Math.sin(r),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f,d={lam:0,phi:0},v={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?v.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(v.value=2,i-=z):t.x<0&&-t.x>=Math.abs(t.y)?(v.value=3,i=i<0?i+E:i-E):(v.value=4,i+=z),u=E/12*Math.tan(i),e=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),r=Math.atan(e),(a=1-(h=Math.cos(i))*h*(n=Math.tan(s))*n*(1-Math.cos(Math.atan(1/Math.cos(r)))))<-1?a=-1:a>1&&(a=1),5===this.face)o=Math.acos(a),d.phi=z-o,d.lam=1===v.value?r+z:2===v.value?r<0?r+E:r-E:3===v.value?r-z:r;else if(6===this.face)o=Math.acos(a),d.phi=o-z,d.lam=1===v.value?-r+z:2===v.value?-r:3===v.value?-r-z:r<0?-r-E:-r+E;else{var m,p,_;u=(m=a)*m,p=(u+=(_=u>=1?0:Math.sqrt(1-u)*Math.sin(r))*_)>=1?0:Math.sqrt(1-u),2===v.value?(u=p,p=-_,_=u):3===v.value?(p=-p,_=-_):4===v.value&&(u=p,p=_,_=-u),2===this.face?(u=m,m=-p,p=u):3===this.face?(m=-m,p=-p):4===this.face&&(u=m,m=p,p=-u),d.phi=Math.acos(-_)-z,d.lam=Math.atan2(p,m),2===this.face?d.lam=$i(d.lam,-z):3===this.face?d.lam=$i(d.lam,-E):4===this.face&&(d.lam=$i(d.lam,+z))}return 0!==this.es&&(c=d.phi<0?1:0,l=Math.tan(d.phi),f=this.b/Math.sqrt(l*l+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),c&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ts=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],is=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ss=.8487,hs=1.3523,ns=b/5,es=1/ns,rs=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},as={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var i=ht(t.x-this.long0,this.over),s=Math.abs(t.y),h=Math.floor(s*ns);h<0?h=0:h>=18&&(h=17);var n={x:rs(ts[h],s=b*(s-es*h))*i,y:rs(is[h],s)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*ss+this.x0,n.y=n.y*this.a*hs+this.y0,n},inverse:function(t){var i={x:(t.x-this.x0)/(this.a*ss),y:Math.abs(t.y-this.y0)/(this.a*hs)};if(i.y>=1)i.x/=ts[18][0],i.y=t.y<0?-z:z;else{var s=Math.floor(18*i.y);for(s<0?s=0:s>=18&&(s=17);;)if(is[s][0]>i.y)--s;else{if(!(is[s+1][0]<=i.y))break;++s}var h=is[s],n=5*(i.y-h[0])/(is[s+1][0]-h[0]);n=function(t,i,s,h){for(var n=i;h;--h){var e=t(n);if(n-=e,Math.abs(e)<1e-10)break}return n}((function(t){return(rs(h,t)-i.y)/function(t,i){return t[1]+i*(2*t[2]+3*i*t[3])}(h,t)}),n,0,100),i.x/=rs(ts[s],n),i.y=(5*s+n)*w,t.y<0&&(i.y=-i.y)}return i.x=ht(i.x+this.long0,this.over),i},names:["Robinson","robin"]},os={init:function(){this.name="geocent"},forward:function(t){return kt(t,this.es,this.a)},inverse:function(t){return Nt(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},us={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},cs={init:function(){if(Object.keys(us).forEach(function(t){if(void 0===this[t])this[t]=us[t].def;else{if(us[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);us[t].num&&(this[t]=parseFloat(this[t]))}us[t].degrees&&(this[t]=this[t]*w)}.bind(this)),Math.abs(Math.abs(this.lat0)-z)<M?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<M?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var i,s,h,n,e=Math.sin(t.y),r=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:s=this.sinph0*e+this.cosph0*r*a;break;case 2:s=r*a;break;case 1:s=-e;break;case 0:s=e}switch(i=(s=this.pn1/(this.p-s))*r*Math.sin(t.x),this.mode){case 3:s*=this.cosph0*e-this.sinph0*r*a;break;case 2:s*=e;break;case 0:s*=-r*a;break;case 1:s*=r*a}return i=(i*this.cg-s*this.sg)*this.cw*(n=1/((h=s*this.cg+i*this.sg)*this.sw*this.h1+this.cw)),s=h*n,t.x=i*this.a,t.y=s*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var i,s,h,n={x:t.x,y:t.y};t.x=(i=this.pn1*t.x*(h=1/(this.pn1-t.y*this.sw)))*this.cg+(s=this.pn1*t.y*this.cw*h)*this.sg,t.y=s*this.cg-i*this.sg;var e=li(t.x,t.y);if(Math.abs(e)<M)n.x=0,n.y=t.y;else{var r,a;switch(a=1-e*e*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/e+e/this.pn1),r=Math.sqrt(1-a*a),this.mode){case 3:n.y=Math.asin(r*this.sinph0+t.y*a*this.cosph0/e),t.y=(r-this.sinph0*Math.sin(n.y))*e,t.x*=a*this.cosph0;break;case 2:n.y=Math.asin(t.y*a/e),t.y=r*e,t.x*=a;break;case 0:n.y=Math.asin(r),t.y=-t.y;break;case 1:n.y=-Math.asin(r)}n.x=Math.atan2(t.x,t.y)}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},ls={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var i,s,h,n,e=t.x,r=t.y;if(e-=this.long0,"ellipse"===this.shape){r=Math.atan(this.radius_p2*Math.tan(r));var a=this.radius_p/li(this.radius_p*Math.cos(r),Math.sin(r));if(s=a*Math.cos(e)*Math.cos(r),h=a*Math.sin(e)*Math.cos(r),n=a*Math.sin(r),(this.radius_g-s)*s-h*h-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(h/li(n,i)),t.y=this.radius_g_1*Math.atan(n/i)):(t.x=this.radius_g_1*Math.atan(h/i),t.y=this.radius_g_1*Math.atan(n/li(h,i)))}else"sphere"===this.shape&&(i=Math.cos(r),s=Math.cos(e)*i,h=Math.sin(e)*i,n=Math.sin(r),i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(h/li(n,i)),t.y=this.radius_g_1*Math.atan(n/i)):(t.x=this.radius_g_1*Math.atan(h/i),t.y=this.radius_g_1*Math.atan(n/li(h,i))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var i,s,h,n,e=-1,r=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*li(1,a)):(r=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*li(1,r));var o=a/this.radius_p;if((h=(s=2*this.radius_g*e)*s-4*(i=r*r+o*o+e*e)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*i),e=this.radius_g+n*e,r*=n,a*=n,t.x=Math.atan2(r,e),t.y=Math.atan(a*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(r=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+r*r)),(h=(s=2*this.radius_g*e)*s-4*(i=r*r+a*a+e*e)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*i),e=this.radius_g+n*e,r*=n,a*=n,t.x=Math.atan2(r,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},fs=1.340264,ds=-.081106,vs=893e-6,ms=.003796,ps=Math.sqrt(3)/2,_s={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0,this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0},forward:function(t){var i=ht(t.x-this.long0,this.over),s=Math.asin(ps*Math.sin(t.y)),h=s*s,n=h*h*h;return t.x=i*Math.cos(s)/(ps*(fs+3*ds*h+n*(7*vs+9*ms*h))),t.y=s*(fs+ds*h+n*(vs+ms*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i,s,h,n,e=t.y;for(n=0;n<12&&(e-=h=(e*(fs+ds*(i=e*e)+(s=i*i*i)*(vs+ms*i))-t.y)/(fs+3*ds*i+s*(7*vs+9*ms*i)),!(Math.abs(h)<1e-9));++n);return t.x=ps*t.x*(fs+3*ds*(i=e*e)+(s=i*i*i)*(7*vs+9*ms*i))/Math.cos(e),t.y=Math.asin(Math.sin(e)/ps),t.x=ht(t.x+this.long0,this.over),t},names:["eqearth","Equal Earth","Equal_Earth"]},gs=1e-10;function zs(t){var i,s,h,n=ht(t.x-(this.long0||0),this.over),e=t.y;return i=this.am1+this.m1-ai(e,s=Math.sin(e),h=Math.cos(e),this.en),s=h*n/(i*Math.sqrt(1-this.es*s*s)),t.x=i*Math.sin(s),t.y=this.am1-i*Math.cos(s),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Ms(t){var i,s,h,n;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,s=li(t.x,t.y=this.am1-t.y),n=oi(this.am1+this.m1-s,this.es,this.en),(i=Math.abs(n))<z)i=Math.sin(n),h=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(n);else{if(!(Math.abs(i-z)<=gs))throw new Error;h=0}return t.x=ht(h+(this.long0||0),this.over),t.y=Ai(n),t}function ws(t){var i,s,h=ht(t.x-(this.long0||0),this.over),n=t.y;return s=this.cphi1+this.phi1-n,Math.abs(s)>gs?(t.x=s*Math.sin(i=h*Math.cos(n)/s),t.y=this.cphi1-s*Math.cos(i)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function bs(t){var i,s;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var h=li(t.x,t.y=this.cphi1-t.y);if(s=this.cphi1+this.phi1-h,Math.abs(s)>z)throw new Error;return i=Math.abs(Math.abs(s)-z)<=gs?0:h*Math.atan2(t.x,t.y)/Math.cos(s),t.x=ht(i+(this.long0||0),this.over),t.y=Ai(s),t}var xs={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<gs)throw new Error;this.es?(this.en=ri(this.es),this.m1=ai(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Ms,this.forward=zs):(this.cphi1=Math.abs(this.phi1)+gs>=z?0:1/Math.tan(this.phi1),this.inverse=bs,this.forward=ws)},names:["bonne","Bonne (Werner lat_1=90)"]};const ys={OBLIQUE:{forward:function(t,i){let{x:s,y:h}=i;s+=t.long0;const n=Math.cos(s),e=Math.sin(h),r=Math.cos(h);i.x=ht(Math.atan2(r*Math.sin(s),t.sphip*r*n+t.cphip*e)+t.lamp),i.y=Math.asin(t.sphip*e-t.cphip*r*n);const a=t.obliqueProjection.forward(i);return t.isIdentity&&(a.x*=b,a.y*=b),a},inverse:function(t,i){t.isIdentity&&(i.x*=w,i.y*=w);const s=t.obliqueProjection.inverse(i);let{x:h,y:n}=s;if(h<Number.MAX_VALUE){h-=t.lamp;const s=Math.cos(h),e=Math.sin(n),r=Math.cos(n);i.x=Math.atan2(r*Math.sin(h),t.sphip*r*s-t.cphip*e),i.y=Math.asin(t.sphip*e+t.cphip*r*s)}return i.x=ht(i.x+t.long0),i}},TRANSVERSE:{forward:function(t,i){let{x:s,y:h}=i;s+=t.long0;const n=Math.cos(h),e=Math.cos(s);i.x=ht(Math.atan2(n*Math.sin(s),Math.sin(h))+t.lamp),i.y=Math.asin(-1*n*e);const r=t.obliqueProjection.forward(i);return t.isIdentity&&(r.x*=b,r.y*=b),r},inverse:function(t,i){t.isIdentity&&(i.x*=w,i.y*=w);const s=t.obliqueProjection.inverse(i);let{x:h,y:n}=s;if(h<Number.MAX_VALUE){const s=Math.cos(n);h-=t.lamp,i.x=Math.atan2(s*Math.sin(h),-1*Math.sin(n)),i.y=Math.asin(s*Math.cos(h))}return i.x=ht(i.x+t.long0),i}}},Es={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};var Ss={init:function(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=at.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if("ob_tran"===this.o_proj)throw new Error("Invalid value for o_proj: "+this.o_proj);const t=Gt(this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim());if(!t)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);let i;t.long0=0,this.obliqueProjection=t;const s=Object.keys(Es),h=t=>{if(void 0===this[t])return;const i=parseFloat(this[t])*w;if(isNaN(i))throw new Error("Invalid value for "+t+": "+this[t]);return i};for(let t=0;t<s.length;t++){const n=Es[s[t]],e=Object.entries(n);if(e.some((([t])=>void 0!==this[t]))){i=n;for(let t=0;t<e.length;t++){const[i,s]=e[t],n=h(i);if(void 0===n)throw new Error("Missing parameter: "+i+".");this[s]=n}break}}if(!i)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:n,phip:e}=function(t,i){let s,h;if(i===Es.ROTATE){let i=t.oLongC,n=t.oLatC,e=t.oAlpha;if(Math.abs(Math.abs(n)-z)<=M)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");h=i+Math.atan2(-1*Math.cos(e),-1*Math.sin(e)*Math.sin(n)),s=Math.asin(Math.cos(n)*Math.sin(e))}else if(i===Es.NEW_POLE)h=t.oLongP,s=t.oLatP;else{let i=t.oLong1,n=t.oLat1,e=t.oLong2,r=t.oLat2,a=Math.abs(n);if(Math.abs(n)>z-M)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(r)>z-M)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(n-r)<M)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(a<M)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");h=Math.atan2(Math.cos(n)*Math.sin(r)*Math.cos(i)-Math.sin(n)*Math.cos(r)*Math.cos(e),Math.sin(n)*Math.cos(r)*Math.sin(e)-Math.cos(n)*Math.sin(r)*Math.sin(i)),s=Math.atan(-1*Math.cos(h-i)/Math.tan(n))}return{lamp:h,phip:s}}(this,i);this.lamp=n,Math.abs(e)>M?(this.cphip=Math.cos(e),this.sphip=Math.sin(e),this.projectionType=ys.OBLIQUE):this.projectionType=ys.TRANSVERSE},forward:function(t){return this.projectionType.forward(this,t)},inverse:function(t){return this.projectionType.inverse(this,t)},names:["General Oblique Transformation","General_Oblique_Transformation","ob_tran"]};const Ps=Object.assign((function(t,i,s){var h,n,e,r=!1;return void 0===i?(n=jt(t),h=Dt,r=!0):(void 0!==i.x||Array.isArray(i))&&(s=i,n=jt(t),h=Dt,r=!0),h||(h=jt(t)),n||(n=jt(i)),s?Wt(h,n,s):(e={forward:function(t,i){return Wt(h,n,t,i)},inverse:function(t,i){return Wt(n,h,t,i)}},r&&(e.oProj=n),e)}),{defaultDatum:"WGS84",Proj:Gt,WGS84:new Gt("WGS84"),Point:si,toPoint:Ot,defs:$,nadgrid:function(t,i,s){return i instanceof ArrayBuffer?function(t,i,s){var h=!0;void 0!==s&&!1===s.includeErrorFields&&(h=!1);var n=new DataView(i),e=function(t){var i=t.getInt32(8,!1);return 11!==i&&(11!==(i=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),r=function(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:yt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}(n,e),a=function(t,i,s,h){for(var n=176,e=[],r=0;r<i.nSubgrids;r++){var a=St(t,n,s),o=Pt(t,n,a,s,h),u=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),c=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);e.push({ll:[xt(a.lowerLongitude),xt(a.lowerLatitude)],del:[xt(a.longitudeInterval),xt(a.latitudeInterval)],lim:[u,c],count:a.gridNodeCount,cvs:Et(o)});var l=16;!1===h&&(l=8),n+=176+a.gridNodeCount*l}return e}(n,r,e,h),o={header:r,subgrids:a};return zt[t]=o,o}(t,i,s):{ready:Mt(t,i)}},transform:Lt,mgrs:Ht,version:"__VERSION__"});!function(t){t.Proj.projections.add(ui),t.Proj.projections.add(vi),t.Proj.projections.add(mi),t.Proj.projections.add(gi),t.Proj.projections.add(Mi),t.Proj.projections.add(wi),t.Proj.projections.add(xi),t.Proj.projections.add(yi),t.Proj.projections.add(Ei),t.Proj.projections.add(Ii),t.Proj.projections.add(Oi),t.Proj.projections.add(Li),t.Proj.projections.add(Di),t.Proj.projections.add(Wi),t.Proj.projections.add(ji),t.Proj.projections.add(Ui),t.Proj.projections.add(Vi),t.Proj.projections.add(qi),t.Proj.projections.add(Bi),t.Proj.projections.add(Xi),t.Proj.projections.add(Hi),t.Proj.projections.add(Yi),t.Proj.projections.add(Ji),t.Proj.projections.add(Zi),t.Proj.projections.add(Qi),t.Proj.projections.add(as),t.Proj.projections.add(os),t.Proj.projections.add(cs),t.Proj.projections.add(ls),t.Proj.projections.add(_s),t.Proj.projections.add(xs),t.Proj.projections.add(Ss)}(Ps);var Gs={ASSUME_TOUCH:!1,DEFAULT_MAX_ZOOM:42,DEFAULT_MIN_ZOOM:0,DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD:.5,DEFAULT_TILE_SIZE:256,DEFAULT_WMS_VERSION:"1.3.0",ENABLE_CANVAS:!0,ENABLE_PROJ4JS:!0,ENABLE_RASTER_REPROJECTION:!0,ENABLE_WEBGL:!0,DEBUG_WEBGL:!0,INITIAL_ATLAS_SIZE:256,MAX_ATLAS_SIZE:-1,MOUSEWHEELZOOM_MAXDELTA:1,OVERVIEWMAP_MAX_RATIO:.75,OVERVIEWMAP_MIN_RATIO:.1,RASTER_REPROJECTION_MAX_SOURCE_TILES:100,RASTER_REPROJECTION_MAX_SUBDIVISION:10,RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH:.25,SIMPLIFY_TOLERANCE:.5,WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK:1024,VERSION:"v4.6.5",inherits:function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},nullFunction:function(){},getUid:function(t){return t.ol_uid||(t.ol_uid=++Gs.uidCounter_)},uidCounter_:0},ks="accuracy",Ns="accuracyGeometry",Cs="altitude",As="altitudeAccuracy",Rs="heading",Is="position",Ts="projection",Os="speed",Fs="tracking",Ls="trackingOptions",Ds="propertychange",Ws={};Ws.assign="function"==typeof Object.assign?Object.assign:function(t,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),h=1,n=arguments.length;h<n;++h){var e=arguments[h];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&(s[r]=e[r])}return s},Ws.clear=function(t){for(var i in t)delete t[i]},Ws.getValues=function(t){var i=[];for(var s in t)i.push(t[s]);return i},Ws.isEmpty=function(t){var i;for(i in t)return!1;return!i};var js={bindListener_:function(t){var i=function(i){var s=t.listener,h=t.bindTo||t.target;return t.callOnce&&js.unlistenByKey(t),s.call(h,i)};return t.boundListener=i,i},findListener_:function(t,i,s,h){for(var n,e=0,r=t.length;e<r;++e)if((n=t[e]).listener===i&&n.bindTo===s)return h&&(n.deleteIndex=e),n},getListeners:function(t,i){var s=t.ol_lm;return s?s[i]:void 0},getListenerMap_:function(t){var i=t.ol_lm;return i||(i=t.ol_lm={}),i},removeListeners_:function(t,i){var s=js.getListeners(t,i);if(s){for(var h=0,n=s.length;h<n;++h)t.removeEventListener(i,s[h].boundListener),Ws.clear(s[h]);s.length=0;var e=t.ol_lm;e&&(delete e[i],0===Object.keys(e).length&&delete t.ol_lm)}},listen:function(t,i,s,h,n){var e=js.getListenerMap_(t),r=e[i];r||(r=e[i]=[]);var a=js.findListener_(r,s,h,!1);return a?n||(a.callOnce=!1):(t.addEventListener(i,js.bindListener_(a={bindTo:h,callOnce:!!n,listener:s,target:t,type:i})),r.push(a)),a},listenOnce:function(t,i,s,h){return js.listen(t,i,s,h,!0)},unlisten:function(t,i,s,h){var n=js.getListeners(t,i);if(n){var e=js.findListener_(n,s,h,!0);e&&js.unlistenByKey(e)}},unlistenByKey:function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=js.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);-1!==s&&i.splice(s,1),0===i.length&&js.removeListeners_(t.target,t.type)}Ws.clear(t)}},unlistenAll:function(t){var i=js.getListenerMap_(t);for(var s in i)js.removeListeners_(t,s)}},Us=function(){};Us.prototype.disposed_=!1,Us.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Us.prototype.disposeInternal=Gs.nullFunction;var Vs=function(t){this.type=t,this.target=null};Vs.prototype.preventDefault=Vs.prototype.stopPropagation=function(){this.propagationStopped=!0},Vs.stopPropagation=function(t){t.stopPropagation()},Vs.preventDefault=function(t){t.preventDefault()};var qs=function(){Us.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}};Gs.inherits(qs,Us),qs.prototype.addEventListener=function(t,i){var s=this.listeners_[t];s||(s=this.listeners_[t]=[]),-1===s.indexOf(i)&&s.push(i)},qs.prototype.dispatchEvent=function(t){var i="string"==typeof t?new Vs(t):t,s=i.type;i.target=this;var h,n=this.listeners_[s];if(n){s in this.dispatching_||(this.dispatching_[s]=0,this.pendingRemovals_[s]=0),++this.dispatching_[s];for(var e=0,r=n.length;e<r;++e)if(!1===n[e].call(this,i)||i.propagationStopped){h=!1;break}if(--this.dispatching_[s],0===this.dispatching_[s]){var a=this.pendingRemovals_[s];for(delete this.pendingRemovals_[s];a--;)this.removeEventListener(s,Gs.nullFunction);delete this.dispatching_[s]}return h}},qs.prototype.disposeInternal=function(){js.unlistenAll(this)},qs.prototype.getListeners=function(t){return this.listeners_[t]},qs.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},qs.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var h=s.indexOf(i);t in this.pendingRemovals_?(s[h]=Gs.nullFunction,++this.pendingRemovals_[t]):(s.splice(h,1),0===s.length&&delete this.listeners_[t])}};var Bs="change",Xs="clear",Hs="click",Ys="dblclick",Js="error",Zs="keydown",Ks="keypress",$s="load",Qs="mousewheel",th="resize",ih="wheel",sh=function(){qs.call(this),this.revision_=0};Gs.inherits(sh,qs),sh.unByKey=function(t){if(Array.isArray(t))for(var i=0,s=t.length;i<s;++i)js.unlistenByKey(t[i]);else js.unlistenByKey(t)},sh.prototype.changed=function(){++this.revision_,this.dispatchEvent(Bs)},sh.prototype.getRevision=function(){return this.revision_},sh.prototype.on=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),e=0;e<h;++e)n[e]=js.listen(this,t[e],i,s);return n}return js.listen(this,t,i,s)},sh.prototype.once=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),e=0;e<h;++e)n[e]=js.listenOnce(this,t[e],i,s);return n}return js.listenOnce(this,t,i,s)},sh.prototype.un=function(t,i,s){if(Array.isArray(t))for(var h=0,n=t.length;h<n;++h)js.unlisten(this,t[h],i,s);else js.unlisten(this,t,i,s)};var hh=function(t){sh.call(this),Gs.getUid(this),this.values_={},void 0!==t&&this.setProperties(t)};Gs.inherits(hh,sh),hh.changeEventTypeCache_={},hh.getChangeEventType=function(t){return hh.changeEventTypeCache_.hasOwnProperty(t)?hh.changeEventTypeCache_[t]:hh.changeEventTypeCache_[t]="change:"+t},hh.prototype.get=function(t){var i;return this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i},hh.prototype.getKeys=function(){return Object.keys(this.values_)},hh.prototype.getProperties=function(){return Ws.assign({},this.values_)},hh.prototype.notify=function(t,i){var s;s=hh.getChangeEventType(t),this.dispatchEvent(new hh.Event(s,t,i)),this.dispatchEvent(new hh.Event(s=Ds,t,i))},hh.prototype.set=function(t,i,s){if(s)this.values_[t]=i;else{var h=this.values_[t];this.values_[t]=i,h!==i&&this.notify(t,h)}},hh.prototype.setProperties=function(t,i){var s;for(s in t)this.set(s,t[s],i)},hh.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t],i||this.notify(t,s)}},hh.Event=function(t,i,s){Vs.call(this,t),this.key=i,this.oldValue=s},Gs.inherits(hh.Event,Vs);var nh=function(t){var i=Gs.VERSION?Gs.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"};Gs.inherits(nh,Error);var eh=function(t,i){if(!t)throw new nh(i)},rh={clamp:function(t,i,s){return Math.min(Math.max(t,i),s)}};rh.cosh="cosh"in Math?Math.cosh:function(t){var i=Math.exp(t);return(i+1/i)/2},rh.roundUpToPowerOfTwo=function(t){return eh(0<t,29),Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},rh.squaredSegmentDistance=function(t,i,s,h,n,e){var r=n-s,a=e-h;if(0!==r||0!==a){var o=((t-s)*r+(i-h)*a)/(r*r+a*a);o>1?(s=n,h=e):o>0&&(s+=r*o,h+=a*o)}return rh.squaredDistance(t,i,s,h)},rh.squaredDistance=function(t,i,s,h){var n=s-t,e=h-i;return n*n+e*e},rh.solveLinearSystem=function(t){for(var i=t.length,s=0;s<i;s++){for(var h=s,n=Math.abs(t[s][s]),e=s+1;e<i;e++){var r=Math.abs(t[e][s]);r>n&&(n=r,h=e)}if(0===n)return null;var a=t[h];t[h]=t[s],t[s]=a;for(var o=s+1;o<i;o++)for(var u=-t[o][s]/t[s][s],c=s;c<i+1;c++)s==c?t[o][c]=0:t[o][c]+=u*t[s][c]}for(var l=new Array(i),f=i-1;f>=0;f--){l[f]=t[f][i]/t[f][f];for(var d=f-1;d>=0;d--)t[d][i]-=t[d][f]*l[f]}return l},rh.toDegrees=function(t){return 180*t/Math.PI},rh.toRadians=function(t){return t*Math.PI/180},rh.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s},rh.lerp=function(t,i,s){return t+s*(i-t)};var ah="Point",oh="LineString",uh="LinearRing",ch="Polygon",lh="MultiPoint",fh="MultiLineString",dh="MultiPolygon",vh="GeometryCollection",mh="Circle",ph=function(t){this.radius=t};
|
|
1
|
+
import{r as t,c as i,e as s,i as h,h as n,F as e,a as r,d as a}from"./p-rujKGmCS.js";import{h as o}from"./p-CBLSoWgI.js";import{m as u}from"./p-CUGRmgip.js";import{t as c,c as l}from"./p-CBUfcdIy.js";import{c as f}from"./p-BzugsqyR.js";import{g as d}from"./p-E-ZsRS8r.js";import"./p-BubviQku.js";const v="stzh-header-open",m=class{constructor(n){t(this,n),this.stzhMetanavItemClick=i(this,"stzhMetanavItemClick"),this.stzhMetanavItemChildClick=i(this,"stzhMetanavItemChildClick"),this.stzhMetanavItemButtonClick=i(this,"stzhMetanavItemButtonClick"),this.stzhMenuItemClick=i(this,"stzhMenuItemClick"),this.stzhLanguageChange=i(this,"stzhLanguageChange"),this.stzhSearchChange=i(this,"stzhSearchChange"),this.stzhSearchChanged=i(this,"stzhSearchChanged"),this.variant="default",this.href="https://www.stadt-zuerich.ch",this.menuId="anchorNavMain",this.appNavId="anchorNavAppNav",this.searchId="anchorSearch",this.metanavId="anchorNavMeta",this.languageId="anchorNavLang",this.logoType="default",this.menuItems=[],this.metanavItems=[],this.userSpecificMetanavItemsNotLoggedIn=[],this._userSpecificMetanavItemsNotLoggedIn=[],this.appNavItems=[],this.languages=[],this.languagePreventUrlchange=!1,this.languageStay=!1,this.hideMetabar=!1,this.searchFieldName="q",this.searchValue="",this.sticky="default",this.loginErrorMessage="",this.hideLogo=!1,this.stickyActive=!1,this.flyoutOpen=!1,this.flyoutSearchOpen=!1,this.fixed=!1,this.fixedTransition=!1,this.currentOpenMenuItem=null,this.currentOpenMetanavItem=null,this.currentOpenLanguage=!1,this.userSpecificMetanavItemsLoggedIn=[],this.combinedMetanavItems=[],this.lastOpener=null,this.flyoutOpenedByMetanavItem=null,this.handleMenuListFocusout=t=>{const i=!t.currentTarget.contains(t.relatedTarget);this.isMedium&&i&&this.closeMenuItem(!1)},this.handleBurgerClick=async()=>{this.flyoutOpenedByMetanavItem?(this.flyoutOpenedByMetanavItem=!1,this.closeMetanavItem()):(this.flyoutSearchOpen=!1,this.flyoutOpen=!this.flyoutOpen);const t=this.element.querySelector(".stzh-header__menu-item");t&&window.setTimeout((()=>{t.focus()}),100),this.updatePosition()},this.handleSearchButtonClick=async()=>{this.flyoutOpen=!1,this.flyoutSearchOpen=!this.flyoutSearchOpen;const t=this.element.querySelector(".stzh-search input[type='search']");t&&window.setTimeout((()=>{t.focus()}),100),this.updatePosition()},this.handleBackdropClick=async()=>{this.flyoutOpen=!1,this.updatePosition()},this.handleBackdropSearchClick=async()=>{this.flyoutSearchOpen=!1,this.updatePosition()},this.handleMetanavItemClick=(t,i)=>{this.stzhMetanavItemClick.emit({component:"stzh-header",item:i,originalEvent:t})},this.handleMetanavItemChildClick=(t,i)=>{this.stzhMetanavItemChildClick.emit({component:"stzh-header",itemChild:i,originalEvent:t})},this.handleMetanavItemButtonClick=(t,i)=>{this.stzhMetanavItemButtonClick.emit({component:"stzh-header",itemButton:i,originalEvent:t})},this.handleMenuItemClick=(t,i)=>{this.flyoutOpen=!1,this.stzhMenuItemClick.emit({component:"stzh-header",item:i,originalEvent:t})},this.handleSearchInput=t=>{this.searchValue=this.searchInput.value,this.stzhSearchChange.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})},this.handleSearchChange=t=>{this.searchValue=this.searchInput.value,this.stzhSearchChanged.emit({component:"stzh-header",originalEvent:t,value:this.searchValue})},this.handleLanguageClick=(t,i)=>{this.languagePreventUrlchange&&t.preventDefault(),this.languageActive=String(i.value),this.stzhLanguageChange.emit({component:"stzh-header",value:this.languageActive})},this.handleFlyoutResize=()=>{this.resizeMenunavElement()},this.handleResize=()=>{this.debounceResize&&window.cancelAnimationFrame(this.debounceResize),this.debounceResize=requestAnimationFrame((()=>{s((()=>{var t,i,s,h;this.isMedium=u("medium").matches,this.isSmallOrMicro=!this.isMedium,this.mainHeight=(null===(t=this.mainElement)||void 0===t?void 0:t.offsetHeight)||0,this.metabarHeight=(null===(i=this.metabarElement)||void 0===i?void 0:i.offsetHeight)||0,this.logobarHeight=(null===(s=this.logobarElement)||void 0===s?void 0:s.offsetHeight)||0,this.headerTop=this.element.offsetTop,this.headerHeight=this.mainHeight,(null===(h=this._appNavItems)||void 0===h?void 0:h.length)>0&&(this.hideLogo=!1)})),h((()=>{document.documentElement.style.setProperty("--stzh-header-height",`${this.headerHeight}px`),document.documentElement.style.setProperty("--stzh-header-main-height",`${this.mainHeight}px`),document.documentElement.style.setProperty("--stzh-header-metabar-height",`${this.metabarHeight}px`),document.documentElement.style.setProperty("--stzh-header-logobar-height",`${this.logobarHeight}px`),"disabled"!==this.sticky&&requestAnimationFrame((()=>this.scrollListener()))}))}))}}handleKeydown(t){"Escape"===t.key&&(this.flyoutOpen=!1,this.flyoutSearchOpen=!1)}flyoutCloseClicked(){this.flyoutSearchOpen=!1,this.updatePosition()}async flyoutOpenWatcher(t){t?(document.body.classList.add(v),this.disableSiblings(),this.trap&&this.trap.activate()):(this.currentOpenMenuItem=null,this.currentOpenMetanavItem=null,this.currentOpenLanguage=null,this.flyoutOpenedByMetanavItem=!1,document.body.classList.remove(v),this.enableSiblings(),this.trap&&this.trap.deactivate())}async fixedWatcher(){this.paddingTop=this.fixed||this.flyoutOpen||this.flyoutSearchOpen?this.headerHeight:0,await this.waitForNextRender(),this.fixedTransition=this.fixed||this.flyoutOpen||this.flyoutSearchOpen}stickyWatcher(){this.updatePosition()}async updatePosition(){if(this.flyoutOpen||this.flyoutSearchOpen)return;const t=()=>{this.stickyActive=!0,document.documentElement.style.setProperty("--stzh-header-is-stuck","1"),document.documentElement.style.setProperty("--stzh-header-is-not-stuck","0")},i=()=>{document.documentElement.style.setProperty("--stzh-header-is-stuck","0"),document.documentElement.style.setProperty("--stzh-header-is-not-stuck","1"),this.stickyActive=!1};"disabled"===this.sticky?i():"always-full"===this.sticky?t():"always"===this.sticky?this.belowStayStickyPoint?t():i():this.scrollingUp&&this.belowStayStickyPoint?!this.stickyActive&&this.belowStartStickyPoint&&t():i()}windowResizeListener(){this.handleResize()}scrollListener(){"disabled"!==this.sticky&&(s((()=>{this.currentScrollY=window.scrollY,this.scrollingUp=this.lastScrollY&&this.lastScrollY>this.currentScrollY,this.lastScrollY=this.currentScrollY,this.belowStayStickyPoint=this.currentScrollY>this.logobarHeight,this.belowStartStickyPoint=this.currentScrollY>this.headerHeight,this.fixed=this.belowStartStickyPoint||this.scrollingUp&&this.belowStayStickyPoint&&this.stickyActive||"always"===this.sticky&&this.belowStayStickyPoint||"always-full"===this.sticky,this.headerOverlap=(this.headerTop-this.currentScrollY)/-1,this.hideLogo=0===this._appNavItems.length&&"always-full"!==this.sticky&&this.isMedium&&this.headerOverlap>1})),h((()=>{this.updatePosition()})))}searchValueWatcher(t){this.searchFilled=""!==t}menuItemsWatcher(t){this._menuItems="string"==typeof t?JSON.parse(t):t,this._menuItems=this._menuItems.map(((t,i)=>Object.assign({id:`submenu-${i}`},t)))}metanavItemsWatcher(t){this._metanavItems="string"==typeof t?JSON.parse(t):t,this._metanavItems=this._metanavItems.map(((t,i)=>Object.assign({id:`metanav-submenu-${i}`},t))),this.combineMetanavItems()}appNavItemsWatcher(t){this._appNavItems="string"==typeof t?JSON.parse(t):t}userSpecificMetanavItemsNotLoggedInWatcher(t){this._userSpecificMetanavItemsNotLoggedIn=t,this.combineMetanavItems()}languagesWatcher(t){this._languages="string"==typeof t?JSON.parse(t):t}getSiblings(){return this._parentElement?Array.from(this._parentElement.children).filter((t=>t!==this.element)):[]}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}renderAppName(t){return this.appName?n("div",{class:{"stzh-header__app-name":!0,"stzh-header__app-name--brand":"brand"===t,"stzh-header__app-name--nav":"nav"===t}},this.appName):null}renderBrand(){return"intranet"===this.variant&&this.appName?n("div",{class:"stzh-header__logobar-app-name"},this.renderAppName("brand")):n("div",{class:"stzh-header__logobar-logo"},n("a",{href:this.href,class:"stzh-header__logo-link","s-object-id":this.logoAnalyticsId||"Header Logo"},n("slot",{name:"logo"})))}waitForNextRender(){return new Promise((t=>this.renderPromiseResolve=t))}resizeMenunavElement(){if(u("headerMetanavSticky").matches||u("medium").matches||!this.openSubmenuElement)Object.assign(this.menunavElement.style,{height:null});else{const{height:t}=this.openSubmenuElement.getBoundingClientRect();Object.assign(this.menunavElement.style,{height:`${t}px`})}}async openMenuItem(t,i){this.flyoutOpen=!0,this.lastOpener=t.currentTarget,this.openSubmenuElement=this.element.querySelector(`#${i.id}`),this.currentOpenMenuItem=i,await this.waitForNextRender(),requestAnimationFrame((()=>{this.menunavElement.scrollTop=0;const t=this.openSubmenuElement&&c(this.openSubmenuElement)[0];null==t||t.focus(),this.resizeMenunavElement()}))}async closeMenuItem(t=!0){this.openSubmenuElement=null,this.currentOpenMenuItem=null,await this.waitForNextRender(),t&&requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null,this.resizeMenunavElement()}))}async openMetanavItem(t,i){this.flyoutOpen||(this.flyoutOpenedByMetanavItem=!0,this.flyoutOpen=!0),this.lastOpener=t.currentTarget,this.currentOpenMetanavItem=i,await this.waitForNextRender(),requestAnimationFrame((()=>{const t=this.element.querySelector(`#${i.id}`),s=t&&c(t)[0];null==s||s.focus()}))}async closeMetanavItem(){this.currentOpenMetanavItem=null,this.flyoutOpenedByMetanavItem&&(this.flyoutOpen=!1),await this.waitForNextRender(),requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null}))}async openLanguage(t){this.flyoutOpen||(this.flyoutOpenedByMetanavItem=!0,this.flyoutOpen=!0),this.lastOpener=t.currentTarget,this.currentOpenLanguage=!0,await this.waitForNextRender(),requestAnimationFrame((()=>{const t=this.element.querySelector("#submenu-languages"),i=t&&c(t)[0];null==i||i.focus()}))}async closeLanguage(){this.currentOpenLanguage=!1,this.flyoutOpenedByMetanavItem&&(this.flyoutOpen=!1),await this.waitForNextRender(),requestAnimationFrame((()=>{this.lastOpener.focus(),this.lastOpener=null}))}async requestUserSpecificMetanavItems(){if(this.userSpecificMetanavItemsEndpoint)try{const t=await fetch(this.userSpecificMetanavItemsEndpoint);this.userSpecificMetanavItemsLoggedIn=await t.json(),this.combineMetanavItems()}catch(t){this.combineMetanavItems(!0),console.error("Error fetching data:",t),this.loginErrorMessage&&document.querySelector("stzh-toastbar").toast(this.loginErrorMessage,{type:"error"})}}combineMetanavItems(t=!1){this.combinedMetanavItems=!this.userSpecificMetanavItemsEndpoint||t?[...this._metanavItems,...this._userSpecificMetanavItemsNotLoggedIn]:[...this._metanavItems,...this.userSpecificMetanavItemsLoggedIn]}async componentWillLoad(){this.menuItemsWatcher(this.menuItems),this.metanavItemsWatcher(this.metanavItems),this.appNavItemsWatcher(this.appNavItems),this.languagesWatcher(this.languages),this.searchValueWatcher(this.searchValue),this.userSpecificMetanavItemsNotLoggedInWatcher(this.userSpecificMetanavItemsNotLoggedIn),this.requestUserSpecificMetanavItems(),this.localization||(this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"header"))}componentDidRender(){this.renderPromiseResolve&&this.renderPromiseResolve(),this.flyoutElement&&this.flyoutResizeObserver&&this.flyoutResizeObserver.observe(this.flyoutElement),this.flyoutSearchElement&&this.flyoutResizeObserver&&this.flyoutResizeObserver.observe(this.flyoutSearchElement)}componentDidLoad(){this.trap=l(this.element,Object.assign(Object.assign({},f()),{initialFocus:!1})),this.flyoutResizeObserver=new ResizeObserver(this.handleFlyoutResize),this.flyoutElement&&this.flyoutResizeObserver.observe(this.flyoutElement)}connectedCallback(){this._parentElement=this.element.parentElement,this.resizeObserver=new ResizeObserver(this.handleResize),this.resizeObserver.observe(this.element)}disconnectedCallback(){var t,i;this.flyoutOpenWatcher(!1),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),null===(i=this.flyoutResizeObserver)||void 0===i||i.disconnect()}render(){var t,i,s,h,a,u,c;const l=o(this.element,"metanav-before"),f=o(this.element,"metanav-after"),d=this._appNavItems.length>0,v="intranet"!==this.variant&&!!this.appName,m={"stzh-header":!0,"stzh-header--variant-default":"default"===this.variant,"stzh-header--variant-intranet":"intranet"===this.variant,"stzh-header--is-flyout-open":this.flyoutOpen,"stzh-header--is-flyout-search-open":this.flyoutSearchOpen,"stzh-header--is-search-filled":this.searchFilled,"stzh-header--is-fixed":this.fixed,"stzh-header--is-fixed-transition":this.fixedTransition,"stzh-header--is-sticky":this.stickyActive,"stzh-header--is-sticky-transition":this.stickyActive&&this.fixedTransition,"stzh-header--hide-logo":this.hideLogo&&!d,"stzh-header--has-app-nav":d,"stzh-header--has-empty-metabar-mobile":!(d||v||l||f||0!==this._metanavItems.filter((t=>t.stay||t.stayAndShowInMobileMenu)).length||0!==this._menuItems.length||!(0===this._languages.length||this._languages.length>0&&!this.languageStay)||this.searchAction),"stzh-header--has-empty-metabar":!(d||v||l||f||0!==this._metanavItems.length||0!==this._menuItems.length||0!==this._languages.length||this.searchAction),[`stzh-header--sticky-${this.sticky}`]:!!this.sticky},p=this.languageActive||window.stzhComponents.utils.getLocale(this.element),_=(null===(t=this._languages)||void 0===t?void 0:t.find((({value:t})=>t===p)))||(null===(i=this._languages)||void 0===i?void 0:i[0])||null,g=(t,i,s)=>{var h;const e=(null===(h=t.items)||void 0===h?void 0:h.length)>0||t.itemButton||!t.href?"button":"a";return n(e,Object.assign({},s,{id:t.id+"-button",href:"a"===e&&t.href,target:"a"===e&&t.target,style:{order:t.cssOrder},class:Object.assign({"stzh-header__metanav-item":!0,"is-heavy":t.important,"is-stay":t.stay||t.stayAndShowInMobileMenu},i||{})}),n("span",{class:{"stzh-header__metanav-item-text":!0,"is-vhidden":t.labelHidden,"has-no-short-label":!t.labelShort}},n("span",{class:"stzh-header__metanav-item-text-label-long"},t.label),n("span",{class:"stzh-header__metanav-item-text-label-short","aria-hidden":"true"},t.labelShort)),t.icon&&n("span",{class:"stzh-header__metanav-icon-wrapper"},t.icon&&n("stzh-icon",{class:"stzh-header__metanav-icon "+(t.iconOpen?"is-close":""),name:t.icon}),t.iconOpen&&n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:t.iconOpen}),(t.badge||t.badgeEmpty)&&n("stzh-badge",{class:"stzh-header__metanav-icon-badge",label:t.badge,type:void 0===t.badgeType?"error":t.badgeType})))};return n(r,null,n("header",{class:m},n("div",{class:"stzh-header__header",style:{paddingTop:`${this.paddingTop}px`}},this._appNavItems.length>0&&!v&&n("div",{class:"stzh-header__app-nav-bottom"},n("stzh-app-nav",{items:this._appNavItems,"app-nav-id":`${this.appNavId}-mobile`})),n("div",{class:"stzh-header__inner"},n("div",{class:"stzh-header__main",ref:t=>this.mainElement=t},n("div",{class:"stzh-header__logobar",ref:t=>this.logobarElement=t},n("div",{class:"stzh-header__logobar-inner"},this.renderBrand(),n("div",{class:"stzh-header__logobar-decoration"}))),!this.hideMetabar&&n("div",{class:"stzh-header__metabar",ref:t=>this.metabarElement=t},n("div",{class:"stzh-header__metabar-inner"},n("slot",{name:"menu-before"}),this._menuItems.length>0&&!v&&n("button",{id:this.menuId,class:`stzh-header__burger ${this.flyoutOpen&&!this.flyoutOpenedByMetanavItem&&"is-open"}`,onClick:this.handleBurgerClick},n("stzh-icon",{class:"stzh-header__burger-icon is-close",name:"menu"}),n("stzh-icon",{class:"stzh-header__burger-icon is-open",name:"close"}),n("div",{class:"stzh-header__burger-text"},this.localization.menuLabel)),this.searchAction&&!o(this.element,"search")&&n("form",{class:"stzh-header__metabar-search",action:this.searchAction,role:"search"},n("label",{class:"stzh-header__search"},n("input",{id:this.searchId,ref:t=>this.searchInput=t,class:"stzh-header__search-input",type:"search",name:this.searchFieldName,onChange:this.handleSearchChange,onInput:this.handleSearchInput}),n("stzh-icon",{class:"stzh-header__search-icon",name:"search"}),n("div",{class:"stzh-header__search-text"},this.localization.searchLabel))),o(this.element,"search")&&n("stzh-button",{iconPosition:"left",onClick:this.handleSearchButtonClick,variant:"tertiary-plain",size:"small"},n("stzh-icon",{slot:"icon",name:"search",class:this.flyoutSearchOpen?"stzh-header__search-button--is-hidden":""}),n("stzh-icon",{slot:"icon",name:"close",class:this.flyoutSearchOpen?"":"stzh-header__search-button--is-hidden"}),this.localization.searchLabel),n("slot",{name:"menu-after"}),v?n("div",{class:"stzh-header__app-nav has-app-name"},this.renderAppName("nav")):d?n("div",{class:"stzh-header__app-nav"},n("stzh-app-nav",{items:this._appNavItems,"app-nav-id":this.appNavId})):null,n("nav",{class:"stzh-header__metabar-nav",id:this.metanavId,tabindex:"-1"},n("slot",{name:"metanav-before"}),n("ul",{class:"stzh-header__metabar-nav-list"},this.combinedMetanavItems.map((t=>{var i,s;return n("li",{class:"stzh-header__metabar-nav-entry"},(null===(i=t.items)||void 0===i?void 0:i.length)>0||t.itemButton?n(e,null,g(t,{"is-popover-mobile":!0},{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,onClick:i=>{t===this.currentOpenMetanavItem?this.closeMetanavItem():this.openMetanavItem(i,t),this.handleMetanavItemClick(i,t)}}),n("stzh-popover",{class:{"stzh-header__metanav-popover":!0},placement:"bottom-end",distance:20,variant:t.variant,size:void 0===t.size?"large":t.size},g(t,{"is-popover-desktop":!0},{onClick:i=>{this.handleMetanavItemClick(i,t)}}),n("div",{slot:"content"},(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("stzh-menu",null,t.items.map((i=>n("stzh-menu-item",{class:{"stzh-header__metanav-menu-item":!0,"is-heavy":void 0===t.importantSubmenu||t.importantSubmenu},size:void 0===t.size?"large":t.size,variant:t.variant,href:i.href,target:i.target,icon:i.icon,counter:i.counter,badge:i.badge,badgeType:i.badgeType,onClick:t=>{this.handleMetanavItemChildClick(t,i)}},i.label))))),t.itemButton&&n("stzh-button",{slot:"action",size:t.itemButton.size,href:t.itemButton.href,target:t.itemButton.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButton)}},t.itemButton.label),t.itemButtonExtra&&n("stzh-button",{class:{"stzh-header__metanav-menu-item--extra":!0},slot:"action",size:t.itemButtonExtra.size,href:t.itemButtonExtra.href,target:t.itemButtonExtra.target,onClick:i=>{this.handleMetanavItemButtonClick(i,t.itemButtonExtra)}},t.itemButtonExtra.label))):g(t,{},{onClick:i=>{this.handleMetanavItemClick(i,t)}}))})),(null===(s=this._languages)||void 0===s?void 0:s.length)>0&&n("li",{class:"stzh-header__metabar-nav-entry"},n("h2",{class:"stzh-header__vhidden"},this.localization.languageLabel),this._menuItems.length>0&&this.languageStay&&n("button",{id:this.isSmallOrMicro?this.languageId:null,class:{"stzh-header__metanav-item":!0,"is-popover-mobile":!0,"is-stay":this.languageStay},"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",onClick:t=>{this.currentOpenLanguage?this.closeLanguage():this.openLanguage(t)}},n("span",{class:"stzh-header__metanav-item-text"},null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),n("stzh-popover",{class:"stzh-header__metanav-popover is-langnav",placement:"bottom-end",distance:20},n("button",{id:this.isSmallOrMicro?null:this.languageId,class:{"stzh-header__metanav-item":!0,"is-popover-desktop":this._menuItems.length>0,"is-stay":this.languageStay}},n("span",{class:"stzh-header__metanav-item-text"},null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__metanav-icon is-close",name:"angle-down"}),n("stzh-icon",{class:"stzh-header__metanav-icon is-open",name:"angle-up"})),n("div",{slot:"content"},n("stzh-menu",null,this._languages.map((t=>n("stzh-menu-item",{class:"stzh-header__metanav-menu-item",active:(null==_?void 0:_.value)===t.value,href:String(t.value),onClick:i=>this.handleLanguageClick(i,t)},t.text)))))))),n("slot",{name:"metanav-after"}))))))),(this._menuItems.length>0||(null===(h=this.combinedMetanavItems)||void 0===h?void 0:h.length)>0)&&n("div",{ref:t=>this.flyoutElement=t,class:"stzh-header__flyout"},n("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropClick}),n("div",{class:"stzh-header__flyout-scrollbar"}),n("div",{class:"stzh-header__menu"},n("nav",{class:"stzh-header__menu-nav",ref:t=>this.menunavElement=t,"aria-label":this.localization.navigationLabel},n("ul",{class:"stzh-header__menu-list is-level-1"},this._menuItems.map((t=>{var i,s;return n("li",{class:{"stzh-header__menu-list-item":!0,"is-open":t===this.currentOpenMenuItem}},(null===(i=t.items)||void 0===i?void 0:i.length)>0?n("button",{"aria-expanded":t===this.currentOpenMenuItem?"true":"false","aria-controls":t.id,class:"stzh-header__menu-item is-level-1 has-items",onClick:t===this.currentOpenMenuItem?()=>this.closeMenuItem():i=>this.openMenuItem(i,t)},t.label):n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-1"},t.label),(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("ul",{id:t.id,class:"stzh-header__menu-list is-level-2",onFocusout:this.handleMenuListFocusout},n("li",{class:"stzh-header__menu-list-item is-backlink"},n("button",{class:"stzh-header__menu-item is-level-2 is-backlink",onClick:()=>this.closeMenuItem()},n("stzh-icon",{name:"angle-left"}),n("span",null,this.menuBackLabel?this.menuBackLabel:this.localization.menuBackLabel))),n("li",{class:"stzh-header__menu-list-item"},n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2 is-main"},t.label)),t.items.map((t=>n("li",{class:"stzh-header__menu-list-item"},n("a",{href:t.href,onClick:i=>this.handleMenuItemClick(i,t),class:"stzh-header__menu-item is-level-2"},t.label))))))})))),((null===(a=this.combinedMetanavItems)||void 0===a?void 0:a.length)>0||(null===(u=this._languages)||void 0===u?void 0:u.length)>0)&&n("div",{class:"stzh-header__menu-metanav"},n("nav",{class:"stzh-header__menu-metanav-nav"},n("ul",{class:"stzh-header__menu-metanav-list is-level-1"},this.combinedMetanavItems.map((t=>{var i,s,h;return n("li",{class:{"stzh-header__menu-metanav-list-item":!0,"is-open":t===this.currentOpenMetanavItem}},(null===(i=t.items)||void 0===i?void 0:i.length)>0?n("button",{"aria-expanded":t===this.currentOpenMetanavItem?"true":"false","aria-controls":t.id,class:{"stzh-header__menu-metanav-item is-level-1":!0,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{t===this.currentOpenMetanavItem?this.closeMetanavItem():this.openMetanavItem(i,t),this.handleMetanavItemClick(i,t)}},n("span",{class:{"stzh-header__menu-metanav-item-text":!0,"is-vhidden":t.labelHidden}},t.label),t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})):n("a",{href:t.href,class:{"stzh-header__menu-metanav-item is-level-1":!0,"is-hidden":t.stay&&!t.stayAndShowInMobileMenu},onClick:i=>{this.handleMetanavItemClick(i,t)}},n("span",{class:{"stzh-header__menu-metanav-item-text":!0,"is-vhidden":t.labelHidden}},t.label),t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon})),(null===(s=t.items)||void 0===s?void 0:s.length)>0&&n("ul",{id:t.id,class:"stzh-header__menu-metanav-list is-level-2"},n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},n("span",null,t.label),n("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:!0,label:null===(h=this.localization.closeMetanavMenuLabel)||void 0===h?void 0:h.replace(/\{itemLabel\}/gi,t.label),onClick:()=>this.closeMetanavItem()}))),t.items.map((t=>n("li",{class:"stzh-header__menu-metanav-list-item"},n("a",{href:t.href,class:"stzh-header__menu-metanav-item is-level-2"},t.icon&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:t.icon}),n("span",{class:"stzh-header__menu-metanav-item-text"},n("span",null,t.label),void 0!==t.counter&&t.counter>0&&n("span",{class:"stzh-header__menu-metanav-item-counter"},"(",t.counter,")")))))),t.itemButton&&n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action"},n("stzh-button",{href:t.itemButton.href,target:t.itemButton.target},t.itemButton.label))),t.itemButtonExtra&&n("li",{class:"stzh-header__menu-metanav-list-item"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-action is-action--extra"},n("stzh-button",{href:t.itemButtonExtra.href,target:t.itemButtonExtra.target},t.itemButtonExtra.label)))))})),(null===(c=this._languages)||void 0===c?void 0:c.length)>0&&n("li",{class:{"stzh-header__menu-metanav-list-item":!0,"is-open":this.currentOpenLanguage}},n("button",{"aria-expanded":this.currentOpenLanguage?"true":"false","aria-controls":"submenu-languages",class:"stzh-header__menu-metanav-item is-level-1",onClick:t=>this.openLanguage(t)},n("span",null,null==_?void 0:_.text),n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"angle-down"})),n("ul",{id:"submenu-languages",class:"stzh-header__menu-metanav-list is-level-2"},n("div",{class:"stzh-header__menu-metanav-item is-level-2 is-title"},n("span",null,this.localization.dialogLanguageTitle),n("stzh-button",{class:"stzh-header__menu-metanav-item-icon",variant:"tertiary",icon:"close",iconOnly:!0,label:"Sprach-Dialog schliessen",onClick:()=>this.closeLanguage()})),this._languages.map((t=>n("li",{class:"stzh-header__menu-metanav-list-item"},n("a",{class:"stzh-header__menu-metanav-item is-level-2 is-language",href:String(t.value),onClick:i=>this.handleLanguageClick(i,t)},n("span",null,t.text),(null==_?void 0:_.value)===t.value&&n("stzh-icon",{class:"stzh-header__menu-metanav-item-icon",name:"checkmark"})))))))))))),o(this.element,"search")&&n("div",{ref:t=>this.flyoutSearchElement=t,class:"stzh-header__flyout-search"},n("div",{class:"stzh-header__flyout-backdrop",onClick:this.handleBackdropSearchClick}),n("div",{class:"stzh-header__flyout-scrollbar"}),n("div",{class:"stzh-header__flyout-search-main"},n("slot",{name:"search"})))))}get element(){return a(this)}static get watchers(){return{flyoutOpen:[{flyoutOpenWatcher:0},{fixedWatcher:0}],flyoutSearchOpen:[{flyoutOpenWatcher:0},{fixedWatcher:0}],fixed:[{fixedWatcher:0}],headerHeight:[{fixedWatcher:0}],sticky:[{stickyWatcher:0}],searchValue:[{searchValueWatcher:0}],menuItems:[{menuItemsWatcher:0}],metanavItems:[{metanavItemsWatcher:0}],appNavItems:[{appNavItemsWatcher:0}],userSpecificMetanavItemsNotLoggedIn:[{userSpecificMetanavItemsNotLoggedInWatcher:0}],languages:[{languagesWatcher:0}]}}};m.style=".sc-stzh-header-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-header-h,[stzh-hidden].sc-stzh-header-h{display:none}.sc-stzh-header-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-header-h *.sc-stzh-header,.sc-stzh-header-h *.sc-stzh-header::before,.sc-stzh-header-h *.sc-stzh-header::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-header-h .has-focus.sc-stzh-header{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header{outline-style:none !important}.sc-stzh-header-h .stzh-fylingfocus-focused.sc-stzh-header::-moz-focus-inner{border:0 !important}.sc-stzh-header-h{--total-height:calc( var(--stzh-header-logobar-height) + var(--stzh-header-metabar-height) );--logo-width:var(--stzh-header-logo-width, auto);--logo-height:100%;--logobar-background-color:var(--stzh-header-logobar-background-color);--metabar-background-color:var( --stzh-header-metabar-background-color, var(--stzh-color-coolgrey10) );--menu-background-color:var( --stzh-header-menu-background-color, var(--stzh-color-secondary30) );--menu-list-item-background-hover:var( --stzh-header-menu-list-item-background-hover, var(--stzh-color-secondary40) );--menu-list-item-background-level2:var( --stzh-header-menu-list-item-background-level2, var(--stzh-color-secondary20) );--menu-list-item-background-level2-hover:var( --stzh-header-menu-list-item-background-level2-hover, var(--stzh-color-secondary10) );--menu-item-color:var(--stzh-header-menu-item-color, var(--stzh-color-primary70));--metanav-item-color:var(--stzh-header-metanav-item-color, var(--stzh-color-grey90));--intranet-app-name-background-color:var( --stzh-header-intranet-app-name-background-color, var(--stzh-color-primary70) )}@media print{.sc-stzh-header-h{display:none}}[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:1.9375rem}@media screen and (min-width: 900px){[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:2.1875rem}}@media screen and (min-width: 1600px){[logo-type=pkzh].sc-stzh-header-h,[logo-type=uvz].sc-stzh-header-h,[logo-type=mkz].sc-stzh-header-h{--logo-height:3.3125rem}}[logo-type=vbz].sc-stzh-header-h{--logo-height:1.8125rem}@media screen and (min-width: 900px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.3125rem}}@media screen and (min-width: 1600px){[logo-type=vbz].sc-stzh-header-h{--logo-height:3.75rem}}.sc-stzh-header-h[logo-type=vbz].sc-stzh-header-s>[slot=logo],.sc-stzh-header-h[logo-type=vbz] .sc-stzh-header-s>[slot=logo]{align-self:center}.sc-stzh-header-h.sc-stzh-header-s>[slot=logo],.sc-stzh-header-h .sc-stzh-header-s>[slot=logo]{width:var(--logo-width);height:var(--logo-height)}.stzh-header.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);color:var(--stzh-color-grey90)}.stzh-header__inner.sc-stzh-header,.stzh-header__main.sc-stzh-header{max-width:calc(100vw - var(--stzh-scrollbar-width))}@media screen and (min-width: 600px){.stzh-header__inner.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__main.sc-stzh-header{display:flex;flex-direction:column;background-color:var(--stzh-color-white)}@media screen and (max-width: 599px){.stzh-header__main.sc-stzh-header{position:relative;z-index:var(--stzh-z-index-header)}}.stzh-header__metabar.sc-stzh-header{background-color:var(--metabar-background-color)}@media (forced-colors: active){.stzh-header__metabar.sc-stzh-header{border-bottom:0.125rem solid CanvasText}}.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin, 20px);margin-right:var(--stzh-container-margin, 20px)}@media screen and (min-width: 600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-small, 32px);margin-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-medium, 40px);margin-right:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:var(--stzh-container-margin-large, 64px);margin-right:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__metabar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;max-width:84.25rem}}.stzh-header__metabar-inner.sc-stzh-header{display:flex;align-items:center;height:4rem}@media screen and (min-width: 900px){.stzh-header__metabar-inner.sc-stzh-header{height:4rem}}.stzh-header__burger.sc-stzh-header,.stzh-header__search.sc-stzh-header,.stzh-header__metanav-item.sc-stzh-header{color:var(--metanav-item-color);transition:color var(--stzh-base-transition-animation-speed);cursor:pointer}.stzh-header__burger.sc-stzh-header:hover,.stzh-header__search.sc-stzh-header:hover,.stzh-header__metanav-item.sc-stzh-header:hover{color:var(--stzh-color-black)}@media (forced-colors: active){.stzh-header__burger.sc-stzh-header:where(button),.stzh-header__search.sc-stzh-header:where(button),.stzh-header__metanav-item.sc-stzh-header:where(button){transition:none;color:ButtonText}.stzh-header__burger.sc-stzh-header:where(button):hover,.stzh-header__search.sc-stzh-header:where(button):hover,.stzh-header__metanav-item.sc-stzh-header:where(button):hover{color:Highlight}}.stzh-header__burger.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;appearance:none;background-color:transparent;border:none;padding:0;margin-right:var(--stzh-space-medium, 16px);gap:var(--stzh-space-medium, 16px);color:var(--menu-item-color)}@media screen and (min-width: 600px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 900px){.stzh-header__burger.sc-stzh-header{margin-right:var(--stzh-space-xxxxlarge, 48px)}}.stzh-header__burger-icon.is-open.sc-stzh-header{display:none}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__burger.is-open.sc-stzh-header .stzh-header__burger-icon.is-close.sc-stzh-header{display:none}@media screen and (max-width: 599px){.stzh-header__burger-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-search.sc-stzh-header{overflow:hidden;margin-right:var(--stzh-space-medium, 16px);transition-property:width;transition-duration:var(--stzh-base-transition-animation-speed);width:2.5rem;max-width:21.5625rem}.stzh-header__metabar-search.sc-stzh-header:focus-within{width:100%}@media screen and (min-width: 600px){.stzh-header__metabar-search.sc-stzh-header{width:6rem;margin-right:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 900px){.stzh-header__metabar-search.sc-stzh-header{width:10rem;margin-left:0;margin-right:var(--stzh-space-xxxxlarge, 48px)}}.stzh-header__search.sc-stzh-header{position:relative;display:block;width:100%}.stzh-header__search-input.sc-stzh-header{--padding-left-base:calc(var(--stzh-icon-size) + var(--stzh-space-medium, 16px));--padding-left-focus:calc(var(--padding-left-base) + var(--stzh-space-medium, 16px));width:100%;max-width:100%;background-color:transparent;color:transparent;font-family:inherit;font-size:inherit;border:none;padding:var(--stzh-space-xsmall, 8px);padding-left:0;padding-right:0;height:var(--stzh-form-input-small-height);transition-property:padding-left, padding-right, background-color, color;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__search-input.sc-stzh-header{color:var(--stzh-color-secondary60);padding-left:var(--padding-left-base)}}.stzh-header__search-input.sc-stzh-header:focus{color:var(--stzh-color-secondary60);background-color:var(--stzh-color-white);padding-left:var(--padding-left-focus);padding-right:var(--stzh-space-xlarge, 24px)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus{padding-left:var(--padding-left-base)}}.stzh-header__search-input.sc-stzh-header:-webkit-autofill{background-clip:text}.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-decoration,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-cancel-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-button,.stzh-header__search-input[type=search].sc-stzh-header::-webkit-search-results-decoration{-webkit-appearance:none}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(var(--stzh-space-medium, 16px), -50%)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header,.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{transform:translate(0, -50%)}}.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{color:var(--stzh-color-grey70)}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-text.sc-stzh-header{display:none}}@media (forced-colors: active){.stzh-header__search-input.sc-stzh-header:focus~.stzh-header__search-icon.sc-stzh-header{color:Highlight}}.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{position:absolute;top:50%;transform:translate(0, -50%);transition:transform var(--stzh-base-transition-animation-speed)}@media (forced-colors: active){.stzh-header__search-text.sc-stzh-header,.stzh-header__search-icon.sc-stzh-header{color:ButtonText}}.stzh-header__search-icon.sc-stzh-header{left:0px}@media screen and (max-width: 599px){.stzh-header__search-icon.sc-stzh-header{transform:translate(0.5rem, -50%)}}.stzh-header__search-text.sc-stzh-header{pointer-events:none;left:calc(var(--stzh-icon-size) + var(--stzh-space-medium, 16px))}@media screen and (max-width: 599px){.stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metabar-nav.sc-stzh-header{display:flex;align-items:center;margin-left:auto;gap:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 900px){.stzh-header__metabar-nav.sc-stzh-header{gap:var(--stzh-space-xxlarge, 32px)}}.stzh-header__metabar-nav-list.sc-stzh-header,.stzh-header__metabar-nav-entry.sc-stzh-header{display:contents}.stzh-header__metanav-popover.sc-stzh-header{--width:auto;--min-width:15.875rem;--background-color:var(--stzh-color-coolgrey10)}.stzh-header__metanav-popover.is-langnav.sc-stzh-header{--min-width:8.75rem}.stzh-header__metanav-item.sc-stzh-header{display:none;gap:var(--stzh-space-small, 12px);align-items:center;justify-content:center;appearance:none;background-color:transparent;padding:0;border:none;text-decoration:none;font-size:100%;font-family:inherit;white-space:nowrap;min-width:2.5rem}.stzh-header__metanav-item.sc-stzh-header:where(button:hover){color:Highlight}@media screen and (min-width: 900px){.stzh-header__metanav-item.sc-stzh-header{display:flex}}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header{color:var(--stzh-color-primary70)}.stzh-header__metanav-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-item.is-stay.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-mobile.sc-stzh-header{display:none}}.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__metanav-item.is-popover-desktop.sc-stzh-header{display:flex}}.stzh-header__metanav-menu-item.is-heavy.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy)}.stzh-header__metanav-menu-item--extra.sc-stzh-header{margin-top:var(--stzh-space-medium)}.stzh-header__metanav-item-text.sc-stzh-header{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.stzh-header__metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}@media screen and (max-width: 899px){.stzh-header__metanav-item-text.has-no-short-label.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}@media screen and (max-width: 899px){.stzh-header__metanav-item-text-label-long.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}}.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:flex}@media screen and (min-width: 900px){.stzh-header__metanav-item-text-label-short.sc-stzh-header{display:none}}.stzh-header__metanav-icon-wrapper.sc-stzh-header{position:relative;display:flex;align-items:center;justify-content:center}.stzh-header__metanav-icon-badge.sc-stzh-header{position:absolute;top:-0.25rem;right:-0.25rem}.stzh-header__metanav-icon.is-open.sc-stzh-header{display:none}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-open.sc-stzh-header{display:inline-flex}.stzh-header__metanav-item[aria-expanded=true].sc-stzh-header .stzh-header__metanav-icon.is-close.sc-stzh-header{display:none}.stzh-header__logobar.sc-stzh-header{display:flex;flex-flow:column nowrap}@media (forced-colors: active){.stzh-header__logobar.sc-stzh-header{border-bottom:0.125rem solid CanvasText}}.stzh-header__logobar-inner.sc-stzh-header{display:flex}@media screen and (min-width: 1600px){.stzh-header__logobar-inner.sc-stzh-header{margin-left:auto;margin-right:auto;width:84.25rem}}.stzh-header__logobar-logo.sc-stzh-header{box-sizing:content-box;display:flex;overflow:hidden;flex-shrink:0}.stzh-header__logobar-decoration.sc-stzh-header{background-color:var(--logobar-background-color);flex-grow:1}@media screen and (min-width: 1600px){.stzh-header__logobar-decoration.sc-stzh-header{width:calc(100% - 34.5625rem + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2);margin-right:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / -2)}}.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-left:var(--stzh-space-xxlarge, 32px)}}.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{padding-right:var(--stzh-space-xxlarge, 32px)}}.stzh-header__logo-link.sc-stzh-header{padding-top:0.875rem;padding-bottom:0.6875rem;padding-left:var(--stzh-container-margin, 20px);display:inline-flex;width:18rem;height:4.125rem;transition:opacity var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header__logo-link.sc-stzh-header{width:18.75rem;padding-left:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__logo-link.sc-stzh-header{width:24.9375rem;height:5.5rem;padding-top:1.125rem;padding-bottom:1.125rem;padding-left:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__logo-link.sc-stzh-header{width:38.5625rem;height:8.4375rem;padding-top:1.75rem;padding-bottom:1.5rem;padding-left:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__logo-link.sc-stzh-header{width:34.5625rem;padding-left:0}}.stzh-header__flyout.sc-stzh-header,.stzh-header__flyout-search.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);z-index:calc(var(--stzh-z-index-header) - 1);position:fixed;visibility:hidden;top:0;left:0;right:0;bottom:0;width:100dvw;height:100dvh;overflow:auto;transition:visibility var(--stzh-base-transition-animation-speed)}@media (min-height: 580px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}@media screen and (min-width: 900px){.stzh-header__flyout.sc-stzh-header{overflow:hidden}}.stzh-header__flyout-backdrop.sc-stzh-header{position:absolute;width:100%;height:100%;background-color:var(--stzh-color-black40op);opacity:0;transition:opacity var(--stzh-base-transition-animation-speed)}.stzh-header__menu.sc-stzh-header{position:absolute;width:100%;height:auto;background-color:var(--menu-background-color);display:grid;grid-template-rows:auto auto;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateX(-100%);opacity:0}@media (min-height: 580px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{height:100%;grid-template-rows:minmax(0, 1fr) auto}}@media screen and (min-width: 900px){.stzh-header__menu.sc-stzh-header{width:20.9375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:23.375rem}}@media screen and (min-width: 1260px){.stzh-header__menu.sc-stzh-header{width:27.4375rem}}@media screen and (min-width: 1600px){.stzh-header__menu.sc-stzh-header{width:calc(27.4375rem - var(--stzh-container-margin-large, 64px) + (100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}.stzh-header__menu-nav.sc-stzh-header{position:relative;overflow-x:hidden;overflow-y:auto}@media screen and (min-width: 900px){.stzh-header__menu-nav.sc-stzh-header{position:static}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-nav.sc-stzh-header{border-right:0.125rem solid CanvasText}}.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xxsmall, 4px)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-xsmall, 8px)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-top:var(--stzh-space-small, 12px)}}.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-large, 20px)}@media screen and (min-width: 600px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxlarge, 32px)}}@media screen and (min-width: 1260px){.stzh-header__menu-metanav.sc-stzh-header{padding-bottom:var(--stzh-space-xxxlarge, 40px)}}.stzh-header__menu-metanav.sc-stzh-header{background-color:var(--stzh-color-secondary20)}@media screen and (min-width: 900px){.stzh-header__menu-metanav.sc-stzh-header{display:none}}.stzh-header__menu-metanav-nav.sc-stzh-header{max-width:23.4375rem}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.sc-stzh-header{display:block;list-style:none;padding:0;margin:0}.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-xxxlarge, 40px));padding-bottom:var(--stzh-space-xxxlarge, 40px)}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{padding-top:calc(var(--stzh-header-main-height) + var(--stzh-space-huge, 80px))}}.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{overflow:auto;background-color:var(--menu-list-item-background-level2);visibility:hidden;opacity:0;transform:translateX(100%);position:absolute;z-index:200;top:0;left:0;width:100%;height:100%;transition-property:opacity, visibility, transform;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{z-index:initial;width:19.6875rem;transform:none;clip-path:none;left:100%;transition-property:opacity, visibility}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{border-right:0.125rem solid CanvasText}}@media screen and (min-width: 1260px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:20.875rem}}@media screen and (min-width: 1600px){.stzh-header__menu-list.is-level-2.sc-stzh-header,.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{width:21.5625rem}}.stzh-header__menu-list.is-level-2.sc-stzh-header{height:max-content}@media (min-height: 580px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}@media screen and (min-width: 900px){.stzh-header__menu-list.is-level-2.sc-stzh-header{height:100%}}.stzh-header__menu-metanav-list.is-level-2.sc-stzh-header{background-color:var(--stzh-color-secondary30);transform:none;transition-property:opacity, visibility}@media screen and (min-width: 900px){.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item:hover>.stzh-header__menu-list)>.stzh-header__menu-list-item>.stzh-header__menu-list),.stzh-header__menu-list.sc-stzh-header:where(:has(>.stzh-header__menu-list-item.is-open>.stzh-header__menu-list)>.stzh-header__menu-list-item>.stzh-header__menu-list){transition-delay:var(--stzh-base-transition-animation-speed)}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-list.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-list.sc-stzh-header{z-index:200;transition-delay:0ms;visibility:visible;opacity:1}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header{background-color:var(--menu-list-item-background-hover)}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.sc-stzh-header:where(button),.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.sc-stzh-header:where(button){forced-color-adjust:none;color:SelectedItemText;background-color:SelectedItem}}@media screen and (min-width: 900px){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header,.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header{background-color:var(--menu-list-item-background-level2-hover)}}@media screen and (min-width: 900px) and (forced-colors: active){.stzh-header__menu-list-item.sc-stzh-header:hover>.stzh-header__menu-item.is-level-2.sc-stzh-header:where(button),.stzh-header__menu-list-item.is-open.sc-stzh-header>.stzh-header__menu-item.is-level-2.sc-stzh-header:where(button){color:HighlightText;background-color:Highlight}}@media screen and (max-width: 899px){.stzh-header__menu-nav.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open) .stzh-header__menu-nav.sc-stzh-header,.stzh-header__menu-list.sc-stzh-header:has(.stzh-header__menu-list-item.is-open),.stzh-header__menu-metanav-list.sc-stzh-header:has(.stzh-header__menu-metanav-list-item.is-open){transition-property:visibility;transition-duration:0ms;transition-delay:var(--stzh-base-transition-animation-speed);visibility:hidden}}@media screen and (max-width: 899px){.stzh-header__menu-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-list),.stzh-header__menu-metanav-list-item.is-open.sc-stzh-header>.sc-stzh-header:where(.stzh-header__menu-metanav-list){transform:translateX(0);opacity:1;visibility:visible}}.stzh-header__menu-list-item.sc-stzh-header,.stzh-header__menu-metanav-list-item.sc-stzh-header{display:grid}.stzh-header__menu-list-item.is-backlink.sc-stzh-header{display:block}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);text-align:left;display:flex;align-items:center;gap:var(--stzh-space-xsmall, 8px);appearance:none;border:none;text-decoration:none;background-color:transparent;color:var(--menu-item-color);padding-left:var(--stzh-space-xxxlarge, 40px);padding-top:var(--stzh-space-small, 12px);padding-bottom:var(--stzh-space-small, 12px);padding-right:var(--stzh-space-large, 20px);transition-property:color, background-color;transition-duration:var(--stzh-base-transition-animation-speed);cursor:pointer}@media (forced-colors: active){.stzh-header__menu-item.sc-stzh-header:where(button),.stzh-header__menu-metanav-item.sc-stzh-header:where(button){transition:none;color:ButtonText}}.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-size:var(--stzh-font-deci-font-size);line-height:var(--stzh-font-deci-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3.5rem}@media screen and (min-width: 900px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.sc-stzh-header,.stzh-header__menu-metanav-item.is-title.sc-stzh-header{padding-left:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-1.sc-stzh-header{padding-left:calc((100vw - 84.25rem - var(--stzh-scrollbar-width, 0px)) / 2)}}@media screen and (min-width: 900px){.stzh-header__menu-item.has-items.sc-stzh-header{cursor:default}}.stzh-header__menu-item.is-level-2.sc-stzh-header{font-size:var(--stzh-font-milli-font-size);line-height:var(--stzh-font-milli-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);min-height:3rem}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1600px){.stzh-header__menu-item.is-level-2.sc-stzh-header{padding-left:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);font-size:var(--stzh-font-micro-font-size);line-height:var(--stzh-font-micro-text-line-height);margin-bottom:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{margin-bottom:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-medium, 16px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-large, 20px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xlarge, 24px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-top:var(--stzh-space-xxlarge, 32px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-small, 12px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-medium, 16px)}}@media screen and (min-width: 1260px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-bottom:var(--stzh-space-xlarge, 24px)}}.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{min-height:auto;padding-left:var(--stzh-container-margin, 20px);padding-right:var(--stzh-container-margin, 20px);gap:var(--stzh-space-xxsmall, 4px)}@media screen and (min-width: 600px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{padding-left:var(--stzh-container-margin-small, 32px);padding-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header{display:none}}@media (forced-colors: active){.stzh-header__menu-item.is-level-2.is-backlink.sc-stzh-header:hover{color:Highlight}}.stzh-header__menu-item.is-level-2.is-main.sc-stzh-header{font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);margin-bottom:var(--stzh-space-xlarge, 24px)}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header{min-height:2.75rem;padding-top:var(--stzh-space-xsmall, 8px);padding-bottom:var(--stzh-space-xsmall, 8px)}.stzh-header__menu-metanav-item.is-level-2.sc-stzh-header{min-height:3.5rem;gap:var(--stzh-space-medium, 16px);padding-right:var(--stzh-space-xxlarge, 32px)}.stzh-header__menu-metanav-item.is-title.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);justify-content:space-between;padding-top:0;padding-bottom:0;padding-right:var(--stzh-space-medium, 16px);margin-bottom:var(--stzh-space-xlarge, 24px);cursor:default}.stzh-header__menu-metanav-item.is-language.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);justify-content:space-between}.stzh-header__menu-metanav-item.is-action.sc-stzh-header{display:grid;padding-right:var(--stzh-space-xxxlarge, 40px);margin-top:var(--stzh-space-xlarge, 24px)}.stzh-header__menu-metanav-item.is-action--extra.sc-stzh-header{margin-top:var(--stzh-space-xxsmall, 4px)}.stzh-header__menu-metanav-item.is-hidden.sc-stzh-header{display:none}.stzh-header__menu-metanav-item.is-level-1.sc-stzh-header .stzh-header__menu-metanav-item-icon.sc-stzh-header{--size:var(--stzh-icon-size-small)}.stzh-header__menu-metanav-item-text.sc-stzh-header{display:flex;gap:var(--stzh-space-xsmall, 8px)}.stzh-header__menu-metanav-item-text.is-vhidden.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header__menu-metanav-item-counter.sc-stzh-header{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium)}.stzh-header__app-nav.sc-stzh-header{display:none}@media screen and (min-width: 900px){.stzh-header__app-nav.sc-stzh-header{display:block}}.stzh-header__app-nav.has-app-name.sc-stzh-header{display:flex;align-items:center}.stzh-header__app-name.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);font-size:var(--stzh-font-centi-font-size);line-height:var(--stzh-font-centi-text-line-height);letter-spacing:var(--stzh-font-curve---text-letter-spacing);display:flex;align-items:center;height:2.5rem;color:var(--stzh-color-coolgrey70);white-space:nowrap}.stzh-header__app-name--brand.sc-stzh-header{color:var(--stzh-color-white)}.stzh-header__app-name--nav.sc-stzh-header{color:var(--stzh-color-coolgrey70)}.stzh-header__app-nav-bottom.sc-stzh-header{position:fixed;bottom:0;left:0;width:calc(100vw - var(--stzh-scrollbar-width));z-index:calc(var(--stzh-z-index-header) - 1)}@media screen and (min-width: 900px){.stzh-header__app-nav-bottom.sc-stzh-header{display:none}}.stzh-header--is-search-filled.sc-stzh-header .stzh-header__search-text.sc-stzh-header{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-header--hide-logo.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:0}@media screen and (min-width: 600px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-fixed.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(-100%);position:fixed;top:0;left:0;right:0;margin-top:calc(var(--stzh-header-logobar-height) * -1)}}@media screen and (min-width: 600px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}@media screen and (max-width: 599px){.stzh-header--is-fixed-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform;transition-duration:var(--stzh-base-transition-animation-speed)}}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__logobar.sc-stzh-header{transition-property:opacity, visibility;transition-duration:var(--stzh-base-transition-animation-speed)}.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-sticky-transition.sc-stzh-header .stzh-header__main.sc-stzh-header{transition-property:transform, margin-top;transition-duration:var(--stzh-base-transition-animation-speed)}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__inner.sc-stzh-header{transform:translateY(0)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header .stzh-header__main.sc-stzh-header{transform:translateY(0)}}@media screen and (min-width: 600px) and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__inner.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__main.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 899px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar-mobile) .stzh-header__metabar.sc-stzh-header{visibility:hidden}}@media screen and (min-width: 600px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__inner.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}@media screen and (max-width: 599px){.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__main.sc-stzh-header{margin-top:calc(var(--total-height) * -1)}}.stzh-header--is-sticky.sc-stzh-header:where(.stzh-header--has-empty-metabar) .stzh-header__metabar.sc-stzh-header{visibility:hidden}.stzh-header--is-sticky.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:hidden;opacity:0}.stzh-header--has-app-nav.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__main.sc-stzh-header{margin-top:0px}.stzh-header--sticky-always-full.sc-stzh-header .stzh-header__logobar.sc-stzh-header{visibility:visible;opacity:1}.stzh-header__flyout-search-main.sc-stzh-header{position:absolute;width:100%;transition-property:opacity, transform;transition-duration:var(--stzh-base-transition-animation-speed);transform:translateY(-6.25rem);opacity:0;margin-top:var(--stzh-header-main-height);overflow:auto}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-backdrop.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:none;z-index:999;position:absolute;top:0;right:0;bottom:0;width:var(--stzh-scrollbar-width);background-color:var(--stzh-color-grey10);border-left:calc(0.5px * var(--stzh-scrollbar-active)) solid var(--stzh-color-grey30)}@media (min-height: 580px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}@media screen and (min-width: 900px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-scrollbar.sc-stzh-header{display:block}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__menu.sc-stzh-header{opacity:1;transform:translateX(0)}.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__flyout-search-main.sc-stzh-header{opacity:1;transform:translateX(0)}@media screen and (min-width: 600px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__inner.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__inner.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}@media screen and (max-width: 599px){.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__main.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__main.sc-stzh-header{z-index:var(--stzh-z-index-header);transform:translateY(0);position:fixed;top:0;left:0;right:var(--stzh-scrollbar-width);margin-top:0}}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header{opacity:1}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logobar.sc-stzh-header,.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__metabar.sc-stzh-header{visibility:visible}.stzh-header--is-flyout-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header,.stzh-header--is-flyout-search-open.sc-stzh-header .stzh-header__logo-link.sc-stzh-header{opacity:1;transition:none}.stzh-header__search-button--is-hidden.sc-stzh-header{display:none}[variant=intranet].sc-stzh-header-h .stzh-header__main.sc-stzh-header{min-height:auto}[variant=intranet].sc-stzh-header-h .stzh-header__logobar.sc-stzh-header{height:2.5rem;margin-left:0;margin-right:0;width:100%;background-color:var(--logobar-background-color)}[variant=intranet].sc-stzh-header-h .stzh-header__metabar.sc-stzh-header,[variant=intranet].sc-stzh-header-h .stzh-header__metabar-inner.sc-stzh-header{height:2.5rem}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav.sc-stzh-header{display:flex;align-items:center;height:2.5rem}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav.sc-stzh-header stzh-app-nav.sc-stzh-header{display:flex;align-items:center;height:100%}[variant=intranet].sc-stzh-header-h .stzh-header__logobar-decoration.sc-stzh-header{display:none}[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{font-family:var(--stzh-font-family-heavy);font-weight:var(--stzh-font-weight-heavy);font-style:var(--stzh-font-style-heavy);display:flex;align-items:center;justify-content:flex-start;height:2.5rem;white-space:nowrap;flex:1 1 auto;background-color:var(--intranet-app-name-background-color);padding-left:var(--stzh-container-margin, 20px);padding-right:var(--stzh-container-margin, 20px)}@media screen and (min-width: 600px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-small, 32px);padding-right:var(--stzh-container-margin-small, 32px)}}@media screen and (min-width: 900px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-medium, 40px);padding-right:var(--stzh-container-margin-medium, 40px)}}@media screen and (min-width: 1260px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:var(--stzh-container-margin-large, 64px);padding-right:var(--stzh-container-margin-large, 64px)}}@media screen and (min-width: 1600px){[variant=intranet].sc-stzh-header-h .stzh-header__logobar-app-name.sc-stzh-header{padding-left:0;padding-right:0}}[variant=intranet].sc-stzh-header-h .stzh-header__app-nav-bottom.sc-stzh-header{min-height:2.5rem}@media screen and (max-width: 899px){[variant=intranet].sc-stzh-header-h .stzh-header__metabar.sc-stzh-header{display:none}}";var p=6378137,_=.0066943799901413165,g=484813681109536e-20,z=Math.PI/2,M=1e-10,w=.017453292519943295,b=57.29577951308232,x=Math.PI/4,y=2*Math.PI,E=3.14159265359,S={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},P={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}},G=/[\s_\-\/\(\)]/g;function k(t,i){if(t[i])return t[i];for(var s,h=Object.keys(t),n=i.toLowerCase().replace(G,""),e=-1;++e<h.length;)if((s=h[e]).toLowerCase().replace(G,"")===n)return t[s]}function N(t){var i,s,h,n={},e=t.split("+").map((function(t){return t.trim()})).filter((function(t){return t})).reduce((function(t,i){var s=i.split("=");return s.push(!0),t[s[0].toLowerCase()]=s[1],t}),{}),r={proj:"projName",datum:"datumCode",rf:function(t){n.rf=parseFloat(t)},lat_0:function(t){n.lat0=t*w},lat_1:function(t){n.lat1=t*w},lat_2:function(t){n.lat2=t*w},lat_ts:function(t){n.lat_ts=t*w},lon_0:function(t){n.long0=t*w},lon_1:function(t){n.long1=t*w},lon_2:function(t){n.long2=t*w},alpha:function(t){n.alpha=parseFloat(t)*w},gamma:function(t){n.rectified_grid_angle=parseFloat(t)*w},lonc:function(t){n.longc=t*w},x_0:function(t){n.x0=parseFloat(t)},y_0:function(t){n.y0=parseFloat(t)},k_0:function(t){n.k0=parseFloat(t)},k:function(t){n.k0=parseFloat(t)},a:function(t){n.a=parseFloat(t)},b:function(t){n.b=parseFloat(t)},r:function(t){n.a=n.b=parseFloat(t)},r_a:function(){n.R_A=!0},zone:function(t){n.zone=parseInt(t,10)},south:function(){n.utmSouth=!0},towgs84:function(t){n.datum_params=t.split(",").map((function(t){return parseFloat(t)}))},to_meter:function(t){n.to_meter=parseFloat(t)},units:function(t){n.units=t;var i=k(P,t);i&&(n.to_meter=i.to_meter)},from_greenwich:function(t){n.from_greenwich=t*w},pm:function(t){var i=k(S,t);n.from_greenwich=(i||parseFloat(t))*w},nadgrids:function(t){"@null"===t?n.datumCode="none":n.nadgrids=t},axis:function(t){var i="ewnsud";3===t.length&&-1!==i.indexOf(t.substr(0,1))&&-1!==i.indexOf(t.substr(1,1))&&-1!==i.indexOf(t.substr(2,1))&&(n.axis=t)},approx:function(){n.approx=!0},over:function(){n.over=!0}};for(i in e)s=e[i],i in r?"function"==typeof(h=r[i])?h(s):n[h]=s:n[i]=s;return"string"==typeof n.datumCode&&"WGS84"!==n.datumCode&&(n.datumCode=n.datumCode.toLowerCase()),n.projStr=t,n}class C{static getId(t){const i=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(t,i="unit"){if(!t||t.length<3)return{type:i,name:"unknown",conversion_factor:null};const s=t[1],h=parseFloat(t[2])||null,n=t.find((t=>Array.isArray(t)&&"ID"===t[0]));return{type:i,name:s,conversion_factor:h,id:n?{authority:n[1],code:parseInt(n[2],10)}:null}}static convertAxis(t){const i=t[1]||"Unknown";let s;const h=i.match(/^\((.)\)$/);if(h){const t=h[1].toUpperCase();if("E"===t)s="east";else if("N"===t)s="north";else{if("U"!==t)throw new Error(`Unknown axis abbreviation: ${t}`);s="up"}}else s=t[2]?t[2].toLowerCase():"unknown";const n=t.find((t=>Array.isArray(t)&&"ORDER"===t[0])),e=n?parseInt(n[1],10):null,r=t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])));return{name:i,direction:s,unit:this.convertUnit(r),order:e}}static extractAxes(t){return t.filter((t=>Array.isArray(t)&&"AXIS"===t[0])).map((t=>this.convertAxis(t))).sort(((t,i)=>(t.order||0)-(i.order||0)))}static convert(t,i={}){switch(t[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=t[1],i.base_crs=t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"BASEGEOGCRS"===t[0]))):null,i.conversion=t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"CONVERSION"===t[0]))):null;const s=t.find((t=>Array.isArray(t)&&"CS"===t[0]));s&&(i.coordinate_system={type:s[1],axis:this.extractAxes(t)});const h=t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]));if(h){const t=this.convertUnit(h);i.coordinate_system.unit=t}i.id=this.getId(t);break;case"BASEGEOGCRS":case"GEOGCRS":i.type="GeographicCRS",i.name=t[1];const n=t.find((t=>Array.isArray(t)&&("DATUM"===t[0]||"ENSEMBLE"===t[0])));if(n){const s=this.convert(n);"ENSEMBLE"===n[0]?i.datum_ensemble=s:i.datum=s;const h=t.find((t=>Array.isArray(t)&&"PRIMEM"===t[0]));h&&"Greenwich"!==h[1]&&(s.prime_meridian={name:h[1],longitude:parseFloat(h[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(t)},i.id=this.getId(t);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=t[1],i.ellipsoid=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]))):null;break;case"ENSEMBLE":i.type="DatumEnsemble",i.name=t[1],i.members=t.filter((t=>Array.isArray(t)&&"MEMBER"===t[0])).map((t=>({type:"DatumEnsembleMember",name:t[1],id:this.getId(t)})));const e=t.find((t=>Array.isArray(t)&&"ENSEMBLEACCURACY"===t[0]));e&&(i.accuracy=parseFloat(e[1]));const r=t.find((t=>Array.isArray(t)&&"ELLIPSOID"===t[0]));r&&(i.ellipsoid=this.convert(r)),i.id=this.getId(t);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=t[1],i.semi_major_axis=parseFloat(t[2]),i.inverse_flattening=parseFloat(t[3]),t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0]))&&this.convert(t.find((t=>Array.isArray(t)&&"LENGTHUNIT"===t[0])),i);break;case"CONVERSION":i.type="Conversion",i.name=t[1],i.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,i.parameters=t.filter((t=>Array.isArray(t)&&"PARAMETER"===t[0])).map((t=>this.convert(t)));break;case"METHOD":i.type="Method",i.name=t[1],i.id=this.getId(t);break;case"PARAMETER":i.type="Parameter",i.name=t[1],i.value=parseFloat(t[2]),i.unit=this.convertUnit(t.find((t=>Array.isArray(t)&&("LENGTHUNIT"===t[0]||"ANGLEUNIT"===t[0]||"SCALEUNIT"===t[0])))),i.id=this.getId(t);break;case"BOUNDCRS":i.type="BoundCRS";const a=t.find((t=>Array.isArray(t)&&"SOURCECRS"===t[0]));if(a){const t=a.find((t=>Array.isArray(t)));i.source_crs=t?this.convert(t):null}const o=t.find((t=>Array.isArray(t)&&"TARGETCRS"===t[0]));if(o){const t=o.find((t=>Array.isArray(t)));i.target_crs=t?this.convert(t):null}const u=t.find((t=>Array.isArray(t)&&"ABRIDGEDTRANSFORMATION"===t[0]));i.transformation=u?this.convert(u):null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=t[1],i.method=t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))?this.convert(t.find((t=>Array.isArray(t)&&"METHOD"===t[0]))):null,i.parameters=t.filter((t=>Array.isArray(t)&&("PARAMETER"===t[0]||"PARAMETERFILE"===t[0]))).map((t=>"PARAMETER"===t[0]?this.convert(t):"PARAMETERFILE"===t[0]?{name:t[1],value:t[2],id:{authority:"EPSG",code:8656}}:void 0)),7===i.parameters.length){const t=i.parameters[6];"Scale difference"===t.name&&(t.value=Math.round(1e12*(t.value-1))/1e6)}i.id=this.getId(t);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(t));break;case"LENGTHUNIT":const c=this.convertUnit(t,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach((t=>{t.unit||(t.unit=c)})),c.conversion_factor&&1!==c.conversion_factor&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:c});break;default:i.keyword=t[0]}return i}}class A extends C{static convert(t,i={}){return super.convert(t,i),i.coordinate_system&&"Cartesian"===i.coordinate_system.subtype&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class R extends C{static convert(t,i={}){super.convert(t,i);const s=t.find((t=>Array.isArray(t)&&"CS"===t[0]));s&&(i.coordinate_system={subtype:s[1],axis:this.extractAxes(t)});const h=t.find((t=>Array.isArray(t)&&"USAGE"===t[0]));if(h){const t=h.find((t=>Array.isArray(t)&&"SCOPE"===t[0])),s=h.find((t=>Array.isArray(t)&&"AREA"===t[0])),n=h.find((t=>Array.isArray(t)&&"BBOX"===t[0]));i.usage={},t&&(i.usage.scope=t[1]),s&&(i.usage.area=s[1]),n&&(i.usage.bbox=n.slice(1))}return i}}var I=/\s/,T=/[A-Za-z]/,O=/[A-Za-z84_]/,F=/[,\]]/,L=/[\d\.E\-\+]/;function D(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=1}function j(t,i,s){Array.isArray(i)&&(s.unshift(i),i=null);var h=s.reduce((function(t,i){return W(i,t),t}),i?{}:t);i&&(t[i]=h)}function W(t,i){if(Array.isArray(t)){var s=t.shift();if("PARAMETER"===s&&(s=t.shift()),1===t.length)return Array.isArray(t[0])?(i[s]={},void W(t[0],i[s])):void(i[s]=t[0]);if(t.length)if("TOWGS84"!==s){if("AXIS"===s)return s in i||(i[s]=[]),void i[s].push(t);var h;switch(Array.isArray(s)||(i[s]={}),s){case"UNIT":case"PRIMEM":case"VERT_DATUM":return i[s]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&W(t[2],i[s]));case"SPHEROID":case"ELLIPSOID":return i[s]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&W(t[3],i[s]));case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":return t[0]=["name",t[0]],void j(i,s,t);case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":return t[0]=["name",t[0]],j(i,s,t),void(i[s].type=s);default:for(h=-1;++h<t.length;)if(!Array.isArray(t[h]))return W(t,i[s]);return j(i,s,t)}}else i[s]=t;else i[s]=!0}else i[t]=!0}function U(t){return.017453292519943295*t}function V(t){const i=(t.projName||"").toLowerCase().replace(/_/g," ");t.long0||!t.longc||"albers conic equal area"!==i&&"lambert azimuthal equal area"!==i||(t.long0=t.longc),t.lat_ts||!t.lat1||"stereographic south pole"!==i&&"polar stereographic (variant b)"!==i?t.lat_ts||!t.lat0||"polar stereographic"!==i&&"polar stereographic (variant a)"!==i||(t.lat_ts=t.lat0,t.lat0=U(t.lat0>0?90:-90),delete t.lat1):(t.lat0=U(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1)}function q(t){let i={units:null,to_meter:void 0};return"string"==typeof t?(i.units=t.toLowerCase(),"metre"===i.units&&(i.units="meter"),"meter"===i.units&&(i.to_meter=1)):t&&t.name&&(i.units=t.name.toLowerCase(),"metre"===i.units&&(i.units="meter"),i.to_meter=t.conversion_factor),i}function B(t){return"object"==typeof t?t.value*t.unit.conversion_factor:t}function X(t,i){t.ellipsoid.radius?(i.a=t.ellipsoid.radius,i.rf=0):(i.a=B(t.ellipsoid.semi_major_axis),void 0!==t.ellipsoid.inverse_flattening?i.rf=t.ellipsoid.inverse_flattening:void 0!==t.ellipsoid.semi_major_axis&&void 0!==t.ellipsoid.semi_minor_axis&&(i.rf=i.a/(i.a-B(t.ellipsoid.semi_minor_axis))))}function H(t,i={}){return t&&"object"==typeof t?"BoundCRS"===t.type?(H(t.source_crs,i),t.transformation&&(t.transformation.method&&"NTv2"===t.transformation.method.name?i.nadgrids=t.transformation.parameters[0].value:i.datum_params=t.transformation.parameters.map((t=>t.value))),i):(Object.keys(t).forEach((s=>{const h=t[s];if(null!==h)switch(s){case"name":if(i.srsCode)break;i.name=h,i.srsCode=h;break;case"type":"GeographicCRS"===h?i.projName="longlat":"ProjectedCRS"===h&&t.conversion&&t.conversion.method&&(i.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":h.ellipsoid&&(i.ellps=h.ellipsoid.name,X(h,i)),h.prime_meridian&&(i.from_greenwich=h.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":i.ellps=h.name,X(h,i);break;case"prime_meridian":i.long0=(h.longitude||0)*Math.PI/180;break;case"coordinate_system":if(h.axis)if(i.axis=h.axis.map((t=>{const i=t.direction;if("east"===i)return"e";if("north"===i)return"n";if("west"===i)return"w";if("south"===i)return"s";throw new Error(`Unknown axis direction: ${i}`)})).join("")+"u",h.unit){const{units:t,to_meter:s}=q(h.unit);i.units=t,i.to_meter=s}else if(h.axis[0]&&h.axis[0].unit){const{units:t,to_meter:s}=q(h.axis[0].unit);i.units=t,i.to_meter=s}break;case"id":h.authority&&h.code&&(i.title=h.authority+":"+h.code);break;case"conversion":h.method&&h.method.name&&(i.projName=h.method.name),h.parameters&&h.parameters.forEach((t=>{const s=t.name.toLowerCase().replace(/\s+/g,"_"),h=t.value;i[s]=t.unit&&t.unit.conversion_factor?h*t.unit.conversion_factor:"degree"===t.unit?h*Math.PI/180:h}));break;case"unit":h.name&&(i.units=h.name.toLowerCase(),"metre"===i.units&&(i.units="meter")),h.conversion_factor&&(i.to_meter=h.conversion_factor);break;case"base_crs":H(h,i),i.datumCode=h.id?h.id.authority+"_"+h.id.code:h.name}})),void 0!==i.latitude_of_false_origin&&(i.lat0=i.latitude_of_false_origin),void 0!==i.longitude_of_false_origin&&(i.long0=i.longitude_of_false_origin),void 0!==i.latitude_of_standard_parallel&&(i.lat0=i.latitude_of_standard_parallel,i.lat1=i.latitude_of_standard_parallel),void 0!==i.latitude_of_1st_standard_parallel&&(i.lat1=i.latitude_of_1st_standard_parallel),void 0!==i.latitude_of_2nd_standard_parallel&&(i.lat2=i.latitude_of_2nd_standard_parallel),void 0!==i.latitude_of_projection_centre&&(i.lat0=i.latitude_of_projection_centre),void 0!==i.longitude_of_projection_centre&&(i.longc=i.longitude_of_projection_centre),void 0!==i.easting_at_false_origin&&(i.x0=i.easting_at_false_origin),void 0!==i.northing_at_false_origin&&(i.y0=i.northing_at_false_origin),void 0!==i.latitude_of_natural_origin&&(i.lat0=i.latitude_of_natural_origin),void 0!==i.longitude_of_natural_origin&&(i.long0=i.longitude_of_natural_origin),void 0!==i.longitude_of_origin&&(i.long0=i.longitude_of_origin),void 0!==i.false_easting&&(i.x0=i.false_easting),i.easting_at_projection_centre&&(i.x0=i.easting_at_projection_centre),void 0!==i.false_northing&&(i.y0=i.false_northing),i.northing_at_projection_centre&&(i.y0=i.northing_at_projection_centre),void 0!==i.standard_parallel_1&&(i.lat1=i.standard_parallel_1),void 0!==i.standard_parallel_2&&(i.lat2=i.standard_parallel_2),void 0!==i.scale_factor_at_natural_origin&&(i.k0=i.scale_factor_at_natural_origin),void 0!==i.scale_factor_at_projection_centre&&(i.k0=i.scale_factor_at_projection_centre),void 0!==i.scale_factor_on_pseudo_standard_parallel&&(i.k0=i.scale_factor_on_pseudo_standard_parallel),void 0!==i.azimuth&&(i.alpha=i.azimuth),void 0!==i.azimuth_at_projection_centre&&(i.alpha=i.azimuth_at_projection_centre),i.angle_from_rectified_to_skew_grid&&(i.rectified_grid_angle=i.angle_from_rectified_to_skew_grid),V(i),i):t}D.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;I.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},D.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(F.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},D.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},D.prototype.number=function(t){if(!L.test(t)){if(F.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},D.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},D.prototype.keyword=function(t){if(O.test(t))this.word+=t;else{if("["===t){var i=[];return i.push(this.word),this.level++,null===this.root?this.root=i:this.currentObject.push(i),this.stack.push(this.currentObject),this.currentObject=i,void(this.state=1)}if(!F.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},D.prototype.neutral=function(t){if(T.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(L.test(t))return this.word=t,void(this.state=3);if(!F.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},D.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var Y=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function J(t){for(var i=Object.keys(t),s=0,h=i.length;s<h;++s){var n=i[s];-1!==Y.indexOf(n)&&Z(t[n]),"object"==typeof t[n]&&J(t[n])}}function Z(t){if(t.AUTHORITY){var i=Object.keys(t.AUTHORITY)[0];i&&i in t.AUTHORITY&&(t.title=i+":"+t.AUTHORITY[i])}if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):t.projName="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION,t.AXIS){for(var s="",h=0,n=t.AXIS.length;h<n;++h){var e=[t.AXIS[h][0].toLowerCase(),t.AXIS[h][1].toLowerCase()];-1!==e[0].indexOf("north")||("y"===e[0]||"lat"===e[0])&&"north"===e[1]?s+="n":-1!==e[0].indexOf("south")||("y"===e[0]||"lat"===e[0])&&"south"===e[1]?s+="s":-1!==e[0].indexOf("east")||("x"===e[0]||"lon"===e[0])&&"east"===e[1]?s+="e":-1===e[0].indexOf("west")&&("x"!==e[0]&&"lon"!==e[0]||"west"!==e[1])||(s+="w")}2===s.length&&(s+="u"),3===s.length&&(t.axis=s)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var r=t.GEOGCS;function a(i){return i*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(t.datumCode=r.DATUM?r.DATUM.name.toLowerCase():r.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_1949"===t.datumCode&&(t.datumCode="nzgd49"),"wgs_1984"!==t.datumCode&&"world_geodetic_system_1984"!==t.datumCode||("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"belge_1972"===t.datumCode&&(t.datumCode="rnb72"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=U(t.rectified_grid_angle)),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",U],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",U],["x0","false_easting",a],["y0","false_northing",a],["long0","central_meridian",U],["lat0","latitude_of_origin",U],["lat0","standard_parallel_1",U],["lat1","standard_parallel_1",U],["lat2","standard_parallel_2",U],["azimuth","Azimuth"],["alpha","azimuth",U],["srsCode","name"]].forEach((function(i){return function(t,i){var s=i[0],h=i[1];!(s in t)&&h in t&&(t[s]=t[h],3===i.length&&(t[s]=i[2](t[s])))}(t,i)})),V(t)}function K(t){if("object"==typeof t)return H(t);const i=function(t){const i=t.toUpperCase();return i.includes("PROJCRS")||i.includes("GEOGCRS")||i.includes("BOUNDCRS")||i.includes("VERTCRS")||i.includes("LENGTHUNIT")||i.includes("ANGLEUNIT")||i.includes("SCALEUNIT")?"WKT2":(i.includes("PROJCS")||i.includes("GEOGCS")||i.includes("LOCAL_CS")||i.includes("VERT_CS")||i.includes("UNIT"),"WKT1")}(t);var s=new D(t).output();if("WKT2"===i)return H(function(t){const i=function(t){return t.find((t=>Array.isArray(t)&&"USAGE"===t[0]))?"2019":(t.find((t=>Array.isArray(t)&&"CS"===t[0])),"2015")}(t);return("2019"===i?R:A).convert(t)}(s));var h=s[0],n={};return W(s,n),J(n),n[h]}function $(t){var i=this;if(2===arguments.length){var s=arguments[1];"string"==typeof s?$[t]="+"===s.charAt(0)?N(arguments[1]):K(arguments[1]):s&&"object"==typeof s&&!("projName"in s)?$[t]=K(arguments[1]):($[t]=s,s||delete $[t])}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){return Array.isArray(t)?$.apply(i,t):$(t)}));if("string"==typeof t){if(t in $)return $[t]}else"EPSG"in t?$["EPSG:"+t.EPSG]=t:"ESRI"in t?$["ESRI:"+t.ESRI]=t:"IAU2000"in t?$["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs");for(var i=1;i<=60;++i)t("EPSG:"+(32600+i),"+proj=utm +zone="+i+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+i),"+proj=utm +zone="+i+" +south +datum=WGS84 +units=m");t("EPSG:5041","+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t("EPSG:5042","+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}($);var Q=["3857","900913","3785","102113"];function tt(t,i){var s,h;if(t=t||{},!i)return t;for(h in i)void 0!==(s=i[h])&&(t[h]=s);return t}function it(t,i,s){var h=t*i;return s/Math.sqrt(1-h*h)}function st(t){return t<0?-1:1}function ht(t,i){return i||Math.abs(t)<=E?t:t-st(t)*y}function nt(t,i,s){var h=t*s;return h=Math.pow((1-h)/(1+h),.5*t),Math.tan(.5*(z-i))/h}function et(t,i){for(var s,h,n=.5*t,e=z-2*Math.atan(i),r=0;r<=15;r++)if(s=t*Math.sin(e),e+=h=z-2*Math.atan(i*Math.pow((1-s)/(1+s),n))-e,Math.abs(h)<=1e-10)return e;return-9999}function rt(t){return t}var at=["longlat","identity"],ot=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.k0=this.sphere?Math.cos(this.lat_ts):it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k0=this.k?this.k:1)},forward:function(t){var i,s,h=t.x,n=t.y;if(n*b>90&&n*b<-90&&h*b>180&&h*b<-180)return null;if(Math.abs(Math.abs(n)-z)<=M)return null;if(this.sphere)i=this.x0+this.a*this.k0*ht(h-this.long0,this.over),s=this.y0+this.a*this.k0*Math.log(Math.tan(x+.5*n));else{var e=Math.sin(n),r=nt(this.e,n,e);i=this.x0+this.a*this.k0*ht(h-this.long0,this.over),s=this.y0-this.a*this.k0*Math.log(r)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h=t.x-this.x0,n=t.y-this.y0;if(this.sphere)s=z-2*Math.atan(Math.exp(-n/(this.a*this.k0)));else{var e=Math.exp(-n/(this.a*this.k0));if(-9999===(s=et(this.e,e)))return null}return i=ht(this.long0+h/(this.a*this.k0),this.over),t.x=i,t.y=s,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"]},{init:function(){},forward:rt,inverse:rt,names:at}],ut={},ct=[];function lt(t,i){var s=ct.length;return t.names?(ct[s]=t,t.names.forEach((function(t){ut[t.toLowerCase()]=s})),this):(console.log(i),!0)}function ft(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}var dt={start:function(){ot.forEach(lt)},add:lt,get:function(t){if(!t)return!1;var i=t.toLowerCase();return void 0!==ut[i]&&ct[ut[i]]||(i=ft(i))in ut&&ct[ut[i]]?ct[ut[i]]:void 0}},vt={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:6378249.2,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const mt=vt.WGS84;var pt={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Ordnance Survey of Great Britain 1936"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var _t in pt){var gt=pt[_t];gt.datumName&&(pt[gt.datumName]=gt)}var zt={};async function Mt(t,i){for(var s=[],h=await i.getImageCount(),n=h-1;n>=0;n--){var e=await i.getImage(n),r=await e.readRasters(),a=[e.getWidth(),e.getHeight()],o=e.getBoundingBox().map(bt),u=[e.fileDirectory.ModelPixelScale[0],e.fileDirectory.ModelPixelScale[1]].map(bt),c=o[0]+(a[0]-1)*u[0],l=o[3]-(a[1]-1)*u[1],f=r[0],d=r[1],v=[];for(let t=a[1]-1;t>=0;t--)for(let i=a[0]-1;i>=0;i--){var m=t*a[0]+i;v.push([-xt(d[m]),xt(f[m])])}s.push({del:u,lim:a,ll:[-c,l],cvs:v})}var p={header:{nSubgrids:h},subgrids:s};return zt[t]=p,p}function wt(t){if(0===t.length)return null;var i="@"===t[0];return i&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!i,grid:null,isNull:!0}:{name:t,mandatory:!i,grid:zt[t]||null,isNull:!1}}function bt(t){return t*Math.PI/180}function xt(t){return t/3600*Math.PI/180}function yt(t,i,s){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(i,s)))}function Et(t){return t.map((function(t){return[xt(t.longitudeShift),xt(t.latitudeShift)]}))}function St(t,i,s){return{name:yt(t,i+8,i+16).trim(),parent:yt(t,i+24,i+24+8).trim(),lowerLatitude:t.getFloat64(i+72,s),upperLatitude:t.getFloat64(i+88,s),lowerLongitude:t.getFloat64(i+104,s),upperLongitude:t.getFloat64(i+120,s),latitudeInterval:t.getFloat64(i+136,s),longitudeInterval:t.getFloat64(i+152,s),gridNodeCount:t.getInt32(i+168,s)}}function Pt(t,i,s,h,n){var e=i+176,r=16;!1===n&&(r=8);for(var a=[],o=0;o<s.gridNodeCount;o++){var u={latitudeShift:t.getFloat32(e+o*r,h),longitudeShift:t.getFloat32(e+o*r+4,h)};!1!==n&&(u.latitudeAccuracy=t.getFloat32(e+o*r+8,h),u.longitudeAccuracy=t.getFloat32(e+o*r+12,h)),a.push(u)}return a}function Gt(t,i){if(!(this instanceof Gt))return new Gt(t);this.forward=null,this.inverse=null,this.init=null,this.names=null,i=i||function(t){if(t)throw t};var s=function(t){if(!function(t){return"string"==typeof t}(t))return"projName"in t?t:K(t);if(function(t){return t in $}(t))return $[t];if(function(t){return 0!==t.indexOf("+")&&-1!==t.indexOf("[")||"object"==typeof t&&!("srsCode"in t)}(t)){var i=K(t);if(function(t){var i=k(t,"authority");if(i){var s=k(i,"epsg");return s&&Q.indexOf(s)>-1}}(i))return $["EPSG:3857"];var s=function(t){var i=k(t,"extension");if(i)return k(i,"proj4")}(i);return s?N(s):i}return function(t){return"+"===t[0]}(t)?N(t):void 0}(t);if("object"==typeof s){var h=Gt.projections.get(s.projName);if(h){if(s.datumCode&&"none"!==s.datumCode){var n=k(pt,s.datumCode);n&&(s.datum_params=s.datum_params||(n.towgs84?n.towgs84.split(","):null),s.ellps=n.ellipse,s.datumName=n.datumName?n.datumName:s.datumCode)}s.k0=s.k0||1,s.axis=s.axis||"enu",s.ellps=s.ellps||"wgs84",s.lat1=s.lat1||s.lat0;var e,r,a,o,u,c,l=function(t,i,s,h,n){if(!t){var e=k(vt,h);e||(e=mt),t=e.a,i=e.b,s=e.rf}return s&&!i&&(i=(1-1/s)*t),(0===s||Math.abs(t-i)<M)&&(n=!0,i=t),{a:t,b:i,rf:s,sphere:n}}(s.a,s.b,s.rf,s.ellps,s.sphere),f=(u=((a=(e=l.a)*e)-(o=(r=l.b)*r))/a,c=0,s.R_A?(a=(e*=1-u*(.16666666666666666+u*(.04722222222222222+.022156084656084655*u)))*e,u=0):c=Math.sqrt(u),{es:u,e:c,ep2:(a-o)/o}),d=function(t){return void 0===t?null:t.split(",").map(wt)}(s.nadgrids),v=s.datum||function(t,i,s,h,n,e,r){var a={};return a.datum_type=void 0===t||"none"===t?5:4,i&&(a.datum_params=i.map(parseFloat),0===a.datum_params[0]&&0===a.datum_params[1]&&0===a.datum_params[2]||(a.datum_type=1),a.datum_params.length>3&&(0===a.datum_params[3]&&0===a.datum_params[4]&&0===a.datum_params[5]&&0===a.datum_params[6]||(a.datum_type=2,a.datum_params[3]*=g,a.datum_params[4]*=g,a.datum_params[5]*=g,a.datum_params[6]=a.datum_params[6]/1e6+1))),r&&(a.datum_type=3,a.grids=r),a.a=s,a.b=h,a.es=n,a.ep2=e,a}(s.datumCode,s.datum_params,l.a,l.b,f.es,f.ep2,d);tt(this,s),tt(this,h),this.a=l.a,this.b=l.b,this.rf=l.rf,this.sphere=l.sphere,this.es=f.es,this.e=f.e,this.ep2=f.ep2,this.datum=v,"init"in this&&"function"==typeof this.init&&this.init(),i(null,this)}else i("Could not get projection name from: "+t)}else i("Could not parse to valid json: "+t)}function kt(t,i,s){var h,n,e,r=t.x,a=t.y,o=t.z?t.z:0;if(a<-z&&a>-1.001*z)a=-z;else if(a>z&&a<1.001*z)a=z;else{if(a<-z)return{x:-1/0,y:-1/0,z:t.z};if(a>z)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),n=Math.sin(a),e=Math.cos(a),{x:((h=s/Math.sqrt(1-i*(n*n)))+o)*e*Math.cos(r),y:(h+o)*e*Math.sin(r),z:(h*(1-i)+o)*n}}function Nt(t,i,s,h){var n,e,r,a,o,u,c,l,f,d,v,m,p,_,g,z=t.x,M=t.y,w=t.z?t.z:0;if(n=Math.sqrt(z*z+M*M),e=Math.sqrt(z*z+M*M+w*w),n/s<1e-12){if(_=0,e/s<1e-12)return g=-h,{x:t.x,y:t.y,z:t.z}}else _=Math.atan2(M,z);r=w/e,l=(a=n/e)*(1-i)*(o=1/Math.sqrt(1-i*(2-i)*a*a)),f=r*o,p=0;do{p++,u=i*(c=s/Math.sqrt(1-i*f*f))/(c+(g=n*l+w*f-c*(1-i*f*f))),m=(v=r*(o=1/Math.sqrt(1-u*(2-u)*a*a)))*l-(d=a*(1-u)*o)*f,l=d,f=v}while(m*m>1e-24&&p<30);return{x:_,y:Math.atan(v/Math.abs(d)),z:g}}function Ct(t){return 1===t||2===t}function At(t,i,s){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;var h={x:-s.x,y:s.y},n={x:Number.NaN,y:Number.NaN},e=[];t:for(var r=0;r<t.grids.length;r++){var a=t.grids[r];if(e.push(a.name),a.isNull){n=h;break}if(null!==a.grid)for(var o=a.grid.subgrids,u=0,c=o.length;u<c;u++){var l=o[u],f=(Math.abs(l.del[1])+Math.abs(l.del[0]))/1e4;if(!(l.ll[1]-f>h.y||l.ll[0]-f>h.x||l.ll[1]+(l.lim[1]-1)*l.del[1]+f<h.y||l.ll[0]+(l.lim[0]-1)*l.del[0]+f<h.x||(n=Rt(h,i,l),isNaN(n.x))))break t}else if(a.mandatory)return console.log("Unable to find mandatory grid '"+a.name+"'"),-1}return isNaN(n.x)?(console.log("Failed to find a grid shift table for location '"+-h.x*b+" "+h.y*b+" tried: '"+e+"'"),-1):(s.x=-n.x,s.y=n.y,0)}function Rt(t,i,s){var h={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return h;var n={x:t.x,y:t.y};n.x-=s.ll[0],n.y-=s.ll[1],n.x=ht(n.x-Math.PI)+Math.PI;var e=It(n,s);if(i){if(isNaN(e.x))return h;e.x=n.x-e.x,e.y=n.y-e.y;var r,a,o=9;do{if(a=It(e,s),isNaN(a.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}e.x+=(r={x:n.x-(a.x+e.x),y:n.y-(a.y+e.y)}).x,e.y+=r.y}while(o--&&Math.abs(r.x)>1e-12&&Math.abs(r.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),h;h.x=ht(e.x+s.ll[0]),h.y=e.y+s.ll[1]}else isNaN(e.x)||(h.x=t.x+e.x,h.y=t.y+e.y);return h}function It(t,i){var s,h={x:t.x/i.del[0],y:t.y/i.del[1]},n=Math.floor(h.x),e=Math.floor(h.y),r=h.x-1*n,a=h.y-1*e,o={x:Number.NaN,y:Number.NaN};if(n<0||n>=i.lim[0])return o;if(e<0||e>=i.lim[1])return o;var u=i.cvs[s=e*i.lim[0]+n][0],c=i.cvs[s][1];s++;var l=i.cvs[s][0],f=i.cvs[s][1],d=i.cvs[s+=i.lim[0]][0],v=i.cvs[s][1];s--;var m=i.cvs[s][1],p=r*a,_=r*(1-a),g=(1-r)*(1-a),z=(1-r)*a;return o.x=g*u+_*l+z*i.cvs[s][0]+p*d,o.y=g*c+_*f+z*m+p*v,o}function Tt(t,i,s){var h,n,e,r=s.x,a=s.y,o=s.z||0,u={};for(e=0;e<3;e++)if(!i||2!==e||void 0!==s.z)switch(0===e?(h=r,n=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(h=a,n=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(h=o,n="z"),t.axis[e]){case"e":case"n":u[n]=h;break;case"w":case"s":u[n]=-h;break;case"u":void 0!==s[n]&&(u.z=h);break;case"d":void 0!==s[n]&&(u.z=-h);break;default:return null}return u}function Ot(t){var i={x:t[0],y:t[1]};return t.length>2&&(i.z=t[2]),t.length>3&&(i.m=t[3]),i}function Ft(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function Lt(t,i,s,h){var n,e=void 0!==(s=Array.isArray(s)?Ot(s):{x:s.x,y:s.y,z:s.z,m:s.m}).z;if(function(t){Ft(t.x),Ft(t.y)}(s),t.datum&&i.datum&&function(t,i){return(1===t.datum.datum_type||2===t.datum.datum_type||3===t.datum.datum_type)&&"WGS84"!==i.datumCode||(1===i.datum.datum_type||2===i.datum.datum_type||3===i.datum.datum_type)&&"WGS84"!==t.datumCode}(t,i)&&(s=Lt(t,n=new Gt("WGS84"),s,h),t=n),h&&"enu"!==t.axis&&(s=Tt(t,!1,s)),"longlat"===t.projName)s={x:s.x*w,y:s.y*w,z:s.z||0};else if(t.to_meter&&(s={x:s.x*t.to_meter,y:s.y*t.to_meter,z:s.z||0}),!(s=t.inverse(s)))return;if(t.from_greenwich&&(s.x+=t.from_greenwich),s=function(t,i,s){if(function(t,i){return t.datum_type===i.datum_type&&!(t.a!==i.a||Math.abs(t.es-i.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]:2!==t.datum_type||t.datum_params[0]===i.datum_params[0]&&t.datum_params[1]===i.datum_params[1]&&t.datum_params[2]===i.datum_params[2]&&t.datum_params[3]===i.datum_params[3]&&t.datum_params[4]===i.datum_params[4]&&t.datum_params[5]===i.datum_params[5]&&t.datum_params[6]===i.datum_params[6])}(t,i))return s;if(5===t.datum_type||5===i.datum_type)return s;var h=t.a,n=t.es;if(3===t.datum_type){if(0!==At(t,!1,s))return;h=p,n=_}var e=i.a,r=i.b,a=i.es;return 3===i.datum_type&&(e=p,r=6356752.314,a=_),n!==a||h!==e||Ct(t.datum_type)||Ct(i.datum_type)?(s=kt(s,n,h),Ct(t.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x+s[0],y:t.y+s[1],z:t.z+s[2]};if(2===i){var h=s[3],n=s[4],e=s[5],r=s[6];return{x:r*(t.x-e*t.y+n*t.z)+s[0],y:r*(e*t.x+t.y-h*t.z)+s[1],z:r*(-n*t.x+h*t.y+t.z)+s[2]}}}(s,t.datum_type,t.datum_params)),Ct(i.datum_type)&&(s=function(t,i,s){if(1===i)return{x:t.x-s[0],y:t.y-s[1],z:t.z-s[2]};if(2===i){var h=s[3],n=s[4],e=s[5],r=s[6],a=(t.x-s[0])/r,o=(t.y-s[1])/r,u=(t.z-s[2])/r;return{x:a+e*o-n*u,y:-e*a+o+h*u,z:n*a-h*o+u}}}(s,i.datum_type,i.datum_params)),s=Nt(s,a,e,r),3!==i.datum_type||0===At(i,!0,s)?s:void 0):s}(t.datum,i.datum,s))return i.from_greenwich&&(s={x:s.x-i.from_greenwich,y:s.y,z:s.z||0}),"longlat"===i.projName?s={x:s.x*b,y:s.y*b,z:s.z||0}:(s=i.forward(s),i.to_meter&&(s={x:s.x/i.to_meter,y:s.y/i.to_meter,z:s.z||0})),h&&"enu"!==i.axis?Tt(i,!0,s):(s&&!e&&delete s.z,s)}(Gt.projections=dt).start();var Dt=Gt("WGS84");function jt(t,i,s,h){var n,e,r;return Array.isArray(s)?(n=Lt(t,i,s,h)||{x:NaN,y:NaN},s.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof n.z?[n.x,n.y,n.z].concat(s.slice(3)):[n.x,n.y,s[2]].concat(s.slice(3)):[n.x,n.y].concat(s.slice(2)):[n.x,n.y]):(e=Lt(t,i,s,h),2===(r=Object.keys(s)).length||r.forEach((function(h){if(void 0!==t.name&&"geocent"===t.name||void 0!==i.name&&"geocent"===i.name){if("x"===h||"y"===h||"z"===h)return}else if("x"===h||"y"===h)return;e[h]=s[h]})),e)}function Wt(t){return t instanceof Gt?t:"object"==typeof t&&"oProj"in t?t.oProj:Gt(t)}var Ut="AJSAJS",Vt="AFAFAF",qt=65,Bt=73,Xt=79,Ht={forward:Yt,inverse:function(t){var i=$t(ti(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat,i.lon,i.lat]:[i.left,i.bottom,i.right,i.top]},toPoint:Jt};function Yt(t,i){return i=i||5,function(t,i){var s,h,n,e,r,a,o,u,c,l,f,d="00000"+t.easting,v="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(c=t.easting,l=t.northing,f=Qt(t.zoneNumber),s=Math.floor(c/1e5),h=Math.floor(l/1e5)%20,e=Ut.charCodeAt(n=f-1),r=Vt.charCodeAt(n),u=!1,(a=e+s-1)>90&&(a=a-90+qt-1,u=!0),(a===Bt||e<Bt&&a>Bt||(a>Bt||e<Bt)&&u)&&a++,(a===Xt||e<Xt&&a>Xt||(a>Xt||e<Xt)&&u)&&++a===Bt&&a++,a>90&&(a=a-90+qt-1),(o=r+h)>86?(o=o-86+qt-1,u=!0):u=!1,(o===Bt||r<Bt&&o>Bt||(o>Bt||r<Bt)&&u)&&o++,(o===Xt||r<Xt&&o>Xt||(o>Xt||r<Xt)&&u)&&++o===Bt&&o++,o>86&&(o=o-86+qt-1),String.fromCharCode(a)+String.fromCharCode(o))+d.substr(d.length-5,i)+v.substr(v.length-5,i)}(function(t){var i,s,h,n,e,r,a,o=t.lat,u=t.lon,c=6378137,l=.00669438,f=.9996,d=Zt(o),v=Zt(u);a=Math.floor((u+180)/6)+1,180===u&&(a=60),o>=56&&o<64&&u>=3&&u<12&&(a=32),o>=72&&o<84&&(u>=0&&u<9?a=31:u>=9&&u<21?a=33:u>=21&&u<33?a=35:u>=33&&u<42&&(a=37)),r=Zt(6*(a-1)-180+3),i=.006739496752268451,s=c/Math.sqrt(1-l*Math.sin(d)*Math.sin(d)),h=Math.tan(d)*Math.tan(d),n=i*Math.cos(d)*Math.cos(d);var m,p,_=f*s*((e=Math.cos(d)*(v-r))+(1-h+n)*e*e*e/6+(5-18*h+h*h+72*n-58*i)*e*e*e*e*e/120)+5e5,g=f*(c*(.9983242984503243*d-.002514607064228144*Math.sin(2*d)+2639046602129982e-21*Math.sin(4*d)-3.418046101696858e-9*Math.sin(6*d))+s*Math.tan(d)*(e*e/2+(5-h+9*n+4*n*n)*e*e*e*e/24+(61-58*h+h*h+600*n-2.2240339282485886)*e*e*e*e*e*e/720));return o<0&&(g+=1e7),{northing:Math.round(g),easting:Math.round(_),zoneNumber:a,zoneLetter:(m=o,p="Z",84>=m&&m>=72?p="X":72>m&&m>=64?p="W":64>m&&m>=56?p="V":56>m&&m>=48?p="U":48>m&&m>=40?p="T":40>m&&m>=32?p="S":32>m&&m>=24?p="R":24>m&&m>=16?p="Q":16>m&&m>=8?p="P":8>m&&m>=0?p="N":0>m&&m>=-8?p="M":-8>m&&m>=-16?p="L":-16>m&&m>=-24?p="K":-24>m&&m>=-32?p="J":-32>m&&m>=-40?p="H":-40>m&&m>=-48?p="G":-48>m&&m>=-56?p="F":-56>m&&m>=-64?p="E":-64>m&&m>=-72?p="D":-72>m&&m>=-80&&(p="C"),p)}}({lat:t[1],lon:t[0]}),i)}function Jt(t){var i=$t(ti(t.toUpperCase()));return i.lat&&i.lon?[i.lon,i.lat]:[(i.left+i.right)/2,(i.top+i.bottom)/2]}function Zt(t){return t*(Math.PI/180)}function Kt(t){return t/Math.PI*180}function $t(t){var i=t.northing,s=t.easting,h=t.zoneLetter,n=t.zoneNumber;if(n<0||n>60)return null;var e,r,a,o,u,c,l,f,d,v=.9996,m=6378137,p=.00669438,_=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),g=s-5e5,z=i;h<"N"&&(z-=1e7),l=6*(n-1)-180+3,e=.006739496752268451,d=(f=z/v/6367449.145945056)+(3*_/2-27*_*_*_/32)*Math.sin(2*f)+(21*_*_/16-55*_*_*_*_/32)*Math.sin(4*f)+151*_*_*_/96*Math.sin(6*f),r=m/Math.sqrt(1-p*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),o=e*Math.cos(d)*Math.cos(d),u=.99330562*m/Math.pow(1-p*Math.sin(d)*Math.sin(d),1.5),c=g/(r*v);var M=d-r*Math.tan(d)/u*(c*c/2-(5+3*a+10*o-4*o*o-9*e)*c*c*c*c/24+(61+90*a+298*o+45*a*a-1.6983531815716497-3*o*o)*c*c*c*c*c*c/720);M=Kt(M);var w,b=(c-(1+2*a+o)*c*c*c/6+(5-2*o+28*a-3*o*o+8*e+24*a*a)*c*c*c*c*c/120)/Math.cos(d);if(b=l+Kt(b),t.accuracy){var x=$t({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});w={top:x.lat,right:x.lon,bottom:M,left:b}}else w={lat:M,lon:b};return w}function Qt(t){var i=t%6;return 0===i&&(i=6),i}function ti(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var i,s=t.length,h=null,n="",e=0;!/[A-Z]/.test(i=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;n+=i,e++}var r=parseInt(n,10);if(0===e||e+3>s)throw"MGRSPoint bad conversion from: "+t;var a=t.charAt(e++);if(a<="A"||"B"===a||"Y"===a||a>="Z"||"I"===a||"O"===a)throw"MGRSPoint zone letter "+a+" not handled: "+t;h=t.substring(e,e+=2);for(var o=Qt(r),u=function(t,i){for(var s=Ut.charCodeAt(i-1),h=1e5,n=!1;s!==t.charCodeAt(0);){if(++s===Bt&&s++,s===Xt&&s++,s>90){if(n)throw"Bad character: "+t;s=qt,n=!0}h+=1e5}return h}(h.charAt(0),o),c=function(t,i){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var s=Vt.charCodeAt(i-1),h=0,n=!1;s!==t.charCodeAt(0);){if(++s===Bt&&s++,s===Xt&&s++,s>86){if(n)throw"Bad character: "+t;s=qt,n=!0}h+=1e5}return h}(h.charAt(1),o);c<ii(a);)c+=2e6;var l=s-e;if(l%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var f,d,v,m=l/2,p=0,_=0;return m>0&&(f=1e5/Math.pow(10,m),d=t.substring(e,e+m),p=parseFloat(d)*f,v=t.substring(e+m),_=parseFloat(v)*f),{easting:p+u,northing:_+c,zoneLetter:a,zoneNumber:r,accuracy:f}}function ii(t){var i;switch(t){case"C":i=11e5;break;case"D":i=2e6;break;case"E":i=28e5;break;case"F":i=37e5;break;case"G":i=46e5;break;case"H":i=55e5;break;case"J":i=64e5;break;case"K":i=73e5;break;case"L":i=82e5;break;case"M":i=91e5;break;case"N":i=0;break;case"P":i=8e5;break;case"Q":i=17e5;break;case"R":i=26e5;break;case"S":i=35e5;break;case"T":i=44e5;break;case"U":i=53e5;break;case"V":i=62e5;break;case"W":i=7e6;break;case"X":i=79e5;break;default:i=-1}if(i>=0)return i;throw"Invalid zone letter: "+t}function si(t,i,s){if(!(this instanceof si))return new si(t,i,s);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===i){var h=t.split(",");this.x=parseFloat(h[0]),this.y=parseFloat(h[1]),this.z=parseFloat(h[2])||0}else this.x=t,this.y=i,this.z=s||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}si.fromMGRS=function(t){return new si(Jt(t))},si.prototype.toMGRS=function(t){return Yt([this.x,this.y],t)};var hi=.046875,ni=.01953125,ei=.01068115234375;function ri(t){var i=[];i[0]=1-t*(.25+t*(hi+t*(ni+t*ei))),i[1]=t*(.75-t*(hi+t*(ni+t*ei)));var s=t*t;return i[2]=s*(.46875-t*(.013020833333333334+.007120768229166667*t)),i[3]=(s*=t)*(.3645833333333333-.005696614583333333*t),i[4]=s*t*.3076171875,i}function ai(t,i,s,h){return h[0]*t-(s*=i)*(h[1]+(i*=i)*(h[2]+i*(h[3]+i*h[4])))}function oi(t,i,s){for(var h=1/(1-i),n=t,e=20;e;--e){var r=Math.sin(n),a=1-i*r*r;if(n-=a=(ai(n,r,Math.cos(n),s)-t)*(a*Math.sqrt(a))*h,Math.abs(a)<M)return n}return n}var ui={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=ri(this.es),this.ml0=ai(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var i,s,h,n=t.y,e=ht(t.x-this.long0,this.over),r=Math.sin(n),a=Math.cos(n);if(this.es){var o=a*e,u=Math.pow(o,2),c=this.ep2*Math.pow(a,2),l=Math.pow(c,2),f=Math.abs(a)>M?Math.tan(n):0,d=Math.pow(f,2),v=Math.pow(d,2);i=1-this.es*Math.pow(r,2),o/=Math.sqrt(i);var m=ai(n,r,a,this.en);s=this.a*(this.k0*o*(1+u/6*(1-d+c+u/20*(5-18*d+v+14*c-58*d*c+u/42*(61+179*v-v*d-479*d)))))+this.x0,h=this.a*(this.k0*(m-this.ml0+r*e*o/2*(1+u/12*(5-d+9*c+4*l+u/30*(61+v-58*d+270*c-330*d*c+u/56*(1385+543*v-v*d-3111*d))))))+this.y0}else{var p=a*Math.sin(e);if(Math.abs(Math.abs(p)-1)<M)return 93;if(s=.5*this.a*this.k0*Math.log((1+p)/(1-p))+this.x0,h=a*Math.cos(e)/Math.sqrt(1-Math.pow(p,2)),(p=Math.abs(h))>=1){if(p-1>M)return 93;h=0}else h=Math.acos(h);n<0&&(h=-h),h=this.a*this.k0*(h-this.lat0)+this.y0}return t.x=s,t.y=h,t},inverse:function(t){var i,s,h,n,e=1/this.a*(t.x-this.x0),r=1/this.a*(t.y-this.y0);if(this.es)if(s=oi(i=this.ml0+r/this.k0,this.es,this.en),Math.abs(s)<z){var a=Math.sin(s),o=Math.cos(s),u=Math.abs(o)>M?Math.tan(s):0,c=this.ep2*Math.pow(o,2),l=Math.pow(c,2),f=Math.pow(u,2),d=Math.pow(f,2);i=1-this.es*Math.pow(a,2);var v=e*Math.sqrt(i)/this.k0,m=Math.pow(v,2);h=s-(i*=u)*m/(1-this.es)*.5*(1-m/12*(5+3*f-9*c*f+c-4*l-m/30*(61+90*f-252*c*f+45*d+46*c-m/56*(1385+3633*f+4095*d+1574*d*f)))),n=ht(this.long0+v*(1-m/6*(1+2*f+c-m/20*(5+28*f+24*d+8*c*f+6*c-m/42*(61+662*f+1320*d+720*d*f))))/o,this.over)}else h=z*st(r),n=0;else{var p=Math.exp(e/this.k0),_=.5*(p-1/p),g=Math.cos(this.lat0+r/this.k0);i=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(_,2))),h=Math.asin(i),r<0&&(h=-h),n=0===_&&0===g?0:ht(Math.atan2(_,g)+this.long0,this.over)}return t.x=n,t.y=h,t},names:["Fast_Transverse_Mercator","Fast Transverse Mercator"]};function ci(t){var i=Math.exp(t);return(i-1/i)/2}function li(t,i){t=Math.abs(t),i=Math.abs(i);var s=Math.max(t,i),h=Math.min(t,i)/(s||1);return s*Math.sqrt(1+Math.pow(h,2))}function fi(t,i){for(var s,h=2*Math.cos(2*i),n=t.length-1,e=t[n],r=0;--n>=0;)s=h*e-r+t[n],r=e,e=s;return i+s*Math.sin(2*i)}function di(t,i,s){for(var h,n,e=Math.sin(i),r=Math.cos(i),a=ci(s),o=function(t){var i=Math.exp(t);return(i+1/i)/2}(s),u=2*r*o,c=-2*e*a,l=t.length-1,f=t[l],d=0,v=0,m=0;--l>=0;)h=v,n=d,f=u*(v=f)-h-c*(d=m)+t[l],m=c*v-n+u*d;return[(u=e*o)*f-(c=r*a)*m,u*m+c*f]}var vi={init:function(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(ui.init.apply(this),this.forward=ui.forward,this.inverse=ui.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),i=t/(2-t),s=i;this.cgb[0]=i*(2+i*(-2/3+i*(i*(116/45+i*(26/45+i*(-2854/675)))-2))),this.cbg[0]=i*(i*(2/3+i*(4/3+i*(-82/45+i*(32/45+i*(4642/4725)))))-2),this.cgb[1]=(s*=i)*(7/3+i*(i*(-227/45+i*(2704/315+i*(2323/945)))-1.6)),this.cbg[1]=s*(5/3+i*(-16/15+i*(-13/9+i*(904/315+i*(-1522/945))))),this.cgb[2]=(s*=i)*(56/15+i*(-136/35+i*(-1262/105+i*(73814/2835)))),this.cbg[2]=s*(-26/15+i*(34/21+i*(1.6+i*(-12686/2835)))),this.cgb[3]=(s*=i)*(4279/630+i*(-332/35+i*(-399572/14175))),this.cbg[3]=s*(1237/630+i*(i*(-24832/14175)-2.4)),this.cgb[4]=(s*=i)*(4174/315+i*(-144838/6237)),this.cbg[4]=s*(-734/315+i*(109598/31185)),this.cgb[5]=(s*=i)*(601676/22275),this.cbg[5]=s*(444337/155925),s=Math.pow(i,2),this.Qn=this.k0/(1+i)*(1+s*(1/4+s*(1/64+s/256))),this.utg[0]=i*(i*(2/3+i*(-37/96+i*(1/360+i*(81/512+i*(-96199/604800)))))-.5),this.gtu[0]=i*(.5+i*(-2/3+i*(5/16+i*(41/180+i*(-127/288+i*(7891/37800)))))),this.utg[1]=s*(-1/48+i*(-1/15+i*(437/1440+i*(-46/105+i*(1118711/3870720))))),this.gtu[1]=s*(13/48+i*(i*(557/1440+i*(281/630+i*(-1983433/1935360)))-.6)),this.utg[2]=(s*=i)*(-17/480+i*(37/840+i*(209/4480+i*(-5569/90720)))),this.gtu[2]=s*(61/240+i*(-103/140+i*(15061/26880+i*(167603/181440)))),this.utg[3]=(s*=i)*(-4397/161280+i*(11/504+i*(830251/7257600))),this.gtu[3]=s*(49561/161280+i*(-179/168+i*(6601661/7257600))),this.utg[4]=(s*=i)*(-4583/161280+i*(108847/3991680)),this.gtu[4]=s*(34729/80640+i*(-3418889/1995840)),this.utg[5]=(s*=i)*(-20648693/638668800),this.gtu[5]=.6650675310896665*s;var h=fi(this.cbg,this.lat0);this.Zb=-this.Qn*(h+function(t,i){for(var s,h=2*Math.cos(i),n=t.length-1,e=t[n],r=0;--n>=0;)s=h*e-r+t[n],r=e,e=s;return Math.sin(i)*s}(this.gtu,2*h))},forward:function(t){var i=ht(t.x-this.long0,this.over),s=t.y;s=fi(this.cbg,s);var h=Math.sin(s),n=Math.cos(s),e=Math.sin(i),r=Math.cos(i);s=Math.atan2(h,r*n),i=Math.atan2(e*n,li(h,n*r)),i=function(t){var i=Math.abs(t);return i=function(t){var i=1+t,s=i-1;return 0===s?t:t*Math.log(i)/s}(i*(1+i/(li(1,i)+1))),t<0?-i:i}(Math.tan(i));var a,o,u=di(this.gtu,2*s,2*i);return s+=u[0],i+=u[1],Math.abs(i)<=2.623395162778?(a=this.a*(this.Qn*i)+this.x0,o=this.a*(this.Qn*s+this.Zb)+this.y0):(a=1/0,o=1/0),t.x=a,t.y=o,t},inverse:function(t){var i,s,h=1/this.a*(t.x-this.x0),n=1/this.a*(t.y-this.y0);if(n=(n-this.Zb)/this.Qn,h/=this.Qn,Math.abs(h)<=2.623395162778){var e=di(this.utg,2*n,2*h);n+=e[0],h+=e[1],h=Math.atan(ci(h));var r=Math.sin(n),a=Math.cos(n),o=Math.sin(h),u=Math.cos(h);n=Math.atan2(r*u,li(o,u*a)),i=ht((h=Math.atan2(o,u*a))+this.long0,this.over),s=fi(this.cgb,n)}else i=1/0,s=1/0;return t.x=i,t.y=s,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"]},mi={init:function(){var t=function(t,i){if(void 0===t){if((t=Math.floor(30*(ht(i)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*w,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,vi.init.apply(this),this.forward=vi.forward,this.inverse=vi.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function pi(t,i){return Math.pow((1-t)/(1+t),i)}var _i={init:function(){var t=Math.sin(this.lat0),i=Math.cos(this.lat0);i*=i,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*i*i/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+x)/(Math.pow(Math.tan(.5*this.lat0+x),this.C)*pi(this.e*t,this.ratexp))},forward:function(t){var i=t.x,s=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*s+x),this.C)*pi(this.e*Math.sin(s),this.ratexp))-z,t.x=this.C*i,t},inverse:function(t){for(var i=t.x/this.C,s=t.y,h=Math.pow(Math.tan(.5*s+x)/this.K,1/this.C),n=20;n>0&&(s=2*Math.atan(h*pi(this.e*Math.sin(t.y),-.5*this.e))-z,!(Math.abs(s-t.y)<1e-14));--n)t.y=s;return n?(t.x=i,t.y=s,t):null}},gi={init:function(){_i.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var i,s,h,n;return t.x=ht(t.x-this.long0,this.over),_i.forward.apply(this,[t]),i=Math.sin(t.y),s=Math.cos(t.y),h=Math.cos(t.x),t.x=(n=this.k0*this.R2/(1+this.sinc0*i+this.cosc0*s*h))*s*Math.sin(t.x),t.y=n*(this.cosc0*i-this.sinc0*s*h),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var i,s,h,n,e;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,e=li(t.x,t.y)){var r=2*Math.atan2(e,this.R2);i=Math.sin(r),s=Math.cos(r),n=Math.asin(s*this.sinc0+t.y*i*this.cosc0/e),h=Math.atan2(t.x*i,e*this.cosc0*s-t.y*this.sinc0*i)}else n=this.phic0,h=0;return t.x=h,t.y=n,_i.inverse.apply(this,[t]),t.x=ht(t.x+this.long0,this.over),t},names:["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};function zi(t,i,s){return i*=s,Math.tan(.5*(z+t))*Math.pow((1-i)/(1+i),.5*s)}var Mi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=M&&(this.k0=.5*(1+st(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=M&&(this.con=this.lat0>0?1:-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=M&&Math.abs(Math.cos(this.lat_ts))>M&&(this.k0=.5*this.cons*it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/nt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=it(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(zi(this.lat0,this.sinlat0,this.e))-z,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var i,s,h,n,e,r,a=t.x,o=t.y,u=Math.sin(o),c=Math.cos(o),l=ht(a-this.long0,this.over);return Math.abs(Math.abs(a-this.long0)-Math.PI)<=M&&Math.abs(o+this.lat0)<=M?(t.x=NaN,t.y=NaN,t):this.sphere?(i=2*this.k0/(1+this.sinlat0*u+this.coslat0*c*Math.cos(l)),t.x=this.a*i*c*Math.sin(l)+this.x0,t.y=this.a*i*(this.coslat0*u-this.sinlat0*c*Math.cos(l))+this.y0,t):(s=2*Math.atan(zi(o,u,this.e))-z,n=Math.cos(s),h=Math.sin(s),Math.abs(this.coslat0)<=M?(e=nt(this.e,o*this.con,this.con*u),t.x=this.x0+(r=2*this.a*this.k0*e/this.cons)*Math.sin(a-this.long0),t.y=this.y0-this.con*r*Math.cos(a-this.long0),t):(Math.abs(this.sinlat0)<M?(i=2*this.a*this.k0/(1+n*Math.cos(l)),t.y=i*h):(i=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*h+this.cosX0*n*Math.cos(l))),t.y=i*(this.cosX0*h-this.sinX0*n*Math.cos(l))+this.y0),t.x=i*n*Math.sin(l)+this.x0,t))},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y-=this.y0;var e=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(e/(2*this.a*this.k0));return i=this.long0,s=this.lat0,e<=M?(t.x=i,t.y=s,t):(s=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/e),i=Math.abs(this.coslat0)<M?ht(this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y),this.over):ht(this.long0+Math.atan2(t.x*Math.sin(r),e*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r)),this.over),t.x=i,t.y=s,t)}if(Math.abs(this.coslat0)<=M){if(e<=M)return s=this.lat0,t.x=i=this.long0,t.y=s,t;t.x*=this.con,t.y*=this.con,s=this.con*et(this.e,e*this.cons/(2*this.a*this.k0)),i=this.con*ht(this.con*this.long0+Math.atan2(t.x,-1*t.y),this.over)}else h=2*Math.atan(e*this.cosX0/(2*this.a*this.k0*this.ms1)),i=this.long0,e<=M?n=this.X0:(n=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/e),i=ht(this.long0+Math.atan2(t.x*Math.sin(h),e*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)),this.over)),s=-1*et(this.e,Math.tan(.5*(z+n)));return t.x=i,t.y=s,t},names:["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"],ssfn_:zi},wi={init:function(){var t=this.lat0;this.lambda0=this.long0;var i=Math.sin(t),s=this.a,h=1/this.rf,n=2*h-Math.pow(h,2),e=this.e=Math.sqrt(n);this.R=this.k0*s*Math.sqrt(1-n)/(1-n*Math.pow(i,2)),this.alpha=Math.sqrt(1+n/(1-n)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(i/this.alpha);var r=Math.log(Math.tan(Math.PI/4+this.b0/2)),a=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*i)/(1-e*i));this.K=r-this.alpha*a+this.alpha*e/2*o},forward:function(t){var i=Math.log(Math.tan(Math.PI/4-t.y/2)),s=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),h=2*(Math.atan(Math.exp(-this.alpha*(i+s)+this.K))-Math.PI/4),n=this.alpha*(t.x-this.lambda0),e=Math.atan(Math.sin(n)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(n))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(n));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*e+this.x0,t},inverse:function(t){for(var i=(t.x-this.x0)/this.R,s=2*(Math.atan(Math.exp((t.y-this.y0)/this.R))-Math.PI/4),h=Math.asin(Math.cos(this.b0)*Math.sin(s)+Math.sin(this.b0)*Math.cos(s)*Math.cos(i)),n=Math.atan(Math.sin(i)/(Math.cos(this.b0)*Math.cos(i)-Math.sin(this.b0)*Math.tan(s))),e=this.lambda0+n/this.alpha,r=0,a=h,o=-1e3,u=0;Math.abs(a-o)>1e-7;){if(++u>20)return;r=1/this.alpha*(Math.log(Math.tan(Math.PI/4+h/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(a))/2)),o=a,a=2*Math.atan(Math.exp(r))-Math.PI/2}return t.x=e,t.y=a,t},names:["somerc"]},bi=1e-7,xi={init:function(){var t,i,s,h,n,e,r,a,o,u,c,l,f,d,v=0,m=0,p=0,_=0,g=0,w=0,b=0;this.no_off=(f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],d="object"==typeof(l=this).projName?Object.keys(l.projName)[0]:l.projName,"no_uoff"in l||"no_off"in l||-1!==f.indexOf(d)||-1!==f.indexOf(ft(d))),this.no_rot="no_rot"in this;var E=!1;"alpha"in this&&(E=!0);var S=!1;if("rectified_grid_angle"in this&&(S=!0),E&&(b=this.alpha),S&&(v=this.rectified_grid_angle),E||S)m=this.longc;else if(p=this.long1,g=this.lat1,_=this.long2,w=this.lat2,Math.abs(g-w)<=bi||(t=Math.abs(g))<=bi||Math.abs(t-z)<=bi||Math.abs(Math.abs(this.lat0)-z)<=bi||Math.abs(Math.abs(w)-z)<=bi)throw new Error;var P=1-this.es;i=Math.sqrt(P),Math.abs(this.lat0)>M?(a=Math.sin(this.lat0),s=Math.cos(this.lat0),t=1-this.es*a*a,this.B=s*s,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*i/t,(n=(h=this.B*i/(s*Math.sqrt(t)))*h-1)<=0?n=0:(n=Math.sqrt(n),this.lat0<0&&(n=-n)),this.E=n+=h,this.E*=Math.pow(nt(this.e,this.lat0,a),this.B)):(this.B=1/i,this.A=this.k0,this.E=h=n=1),E||S?(E?(c=Math.asin(Math.sin(b)/h),S||(v=b)):(c=v,b=Math.asin(h*Math.sin(c))),this.lam0=m-Math.asin(.5*(n-1/n)*Math.tan(c))/this.B):(e=Math.pow(nt(this.e,g,Math.sin(g)),this.B),r=Math.pow(nt(this.e,w,Math.sin(w)),this.B),n=this.E/e,o=(r-e)/(r+e),u=((u=this.E*this.E)-r*e)/(u+r*e),(t=p-_)<-Math.PI?_-=y:t>Math.PI&&(_+=y),this.lam0=ht(.5*(p+_)-Math.atan(u*Math.tan(.5*this.B*(p-_))/o)/this.B,this.over),c=Math.atan(2*Math.sin(this.B*ht(p-this.lam0,this.over))/(n-1/n)),v=b=Math.asin(h*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(v),this.cosrot=Math.cos(v),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(h*h-1)/Math.cos(b))),this.lat0<0&&(this.u_0=-this.u_0)),n=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(x-n)),this.v_pole_s=this.ArB*Math.log(Math.tan(x+n))},forward:function(t){var i,s,h,n,e,r,a,o,u={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-z)>M){if(i=.5*((e=this.E/Math.pow(nt(this.e,t.y,Math.sin(t.y)),this.B))-(r=1/e)),s=.5*(e+r),n=Math.sin(this.B*t.x),h=(i*this.singam-n*this.cosgam)/s,Math.abs(Math.abs(h)-1)<M)throw new Error;o=.5*this.ArB*Math.log((1-h)/(1+h)),r=Math.cos(this.B*t.x),a=Math.abs(r)<bi?this.A*t.x:this.ArB*Math.atan2(i*this.cosgam+n*this.singam,r)}else o=t.y>0?this.v_pole_n:this.v_pole_s,a=this.ArB*t.y;return this.no_rot?(u.x=a,u.y=o):(u.x=o*this.cosrot+(a-=this.u_0)*this.sinrot,u.y=a*this.cosrot-o*this.sinrot),u.x=this.a*u.x+this.x0,u.y=this.a*u.y+this.y0,u},inverse:function(t){var i,s,h,n,e,r,a,o={};if(t.x=1/this.a*(t.x-this.x0),t.y=1/this.a*(t.y-this.y0),this.no_rot?(s=t.y,i=t.x):(s=t.x*this.cosrot-t.y*this.sinrot,i=t.y*this.cosrot+t.x*this.sinrot+this.u_0),n=.5*((h=Math.exp(-this.BrA*s))-1/h),e=.5*(h+1/h),a=((r=Math.sin(this.BrA*i))*this.cosgam+n*this.singam)/e,Math.abs(Math.abs(a)-1)<M)o.x=0,o.y=a<0?-z:z;else{if(o.y=this.E/Math.sqrt((1+a)/(1-a)),o.y=et(this.e,Math.pow(o.y,1/this.B)),o.y===1/0)throw new Error;o.x=-this.rB*Math.atan2(n*this.cosgam-r*this.singam,Math.cos(this.BrA*i))}return o.x+=this.lam0,o},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"]},yi={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<M)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var i=Math.sin(this.lat1),s=Math.cos(this.lat1),h=it(this.e,i,s),n=nt(this.e,this.lat1,i),e=Math.sin(this.lat2),r=Math.cos(this.lat2),a=it(this.e,e,r),o=nt(this.e,this.lat2,e),u=Math.abs(Math.abs(this.lat0)-z)<M?0:nt(this.e,this.lat0,Math.sin(this.lat0));this.ns=Math.abs(this.lat1-this.lat2)>M?Math.log(h/a)/Math.log(n/o):i,isNaN(this.ns)&&(this.ns=i),this.f0=h/(this.ns*Math.pow(n,this.ns)),this.rh=this.a*this.f0*Math.pow(u,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var i=t.x,s=t.y;Math.abs(2*Math.abs(s)-Math.PI)<=M&&(s=st(s)*(z-2e-10));var h,n,e=Math.abs(Math.abs(s)-z);if(e>M)h=nt(this.e,s,Math.sin(s)),n=this.a*this.f0*Math.pow(h,this.ns);else{if((e=s*this.ns)<=0)return null;n=0}var r=this.ns*ht(i-this.long0,this.over);return t.x=this.k0*(n*Math.sin(r))+this.x0,t.y=this.k0*(this.rh-n*Math.cos(r))+this.y0,t},inverse:function(t){var i,s,h,n,e,r=(t.x-this.x0)/this.k0,a=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(i=Math.sqrt(r*r+a*a),s=1):(i=-Math.sqrt(r*r+a*a),s=-1);var o=0;if(0!==i&&(o=Math.atan2(s*r,s*a)),0!==i||this.ns>0){if(s=1/this.ns,h=Math.pow(i/(this.a*this.f0),s),-9999===(n=et(this.e,h)))return null}else n=-z;return e=ht(o/this.ns+this.long0,this.over),t.x=e,t.y=n,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"]},Ei={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var i,s,h,n,e,r,a,o=t.y,u=ht(t.x-this.long0,this.over);return i=Math.pow((1+this.e*Math.sin(o))/(1-this.e*Math.sin(o)),this.alfa*this.e/2),s=2*(Math.atan(this.k*Math.pow(Math.tan(o/2+this.s45),this.alfa)/i)-this.s45),h=-u*this.alfa,n=Math.asin(Math.cos(this.ad)*Math.sin(s)+Math.sin(this.ad)*Math.cos(s)*Math.cos(h)),e=Math.asin(Math.cos(s)*Math.sin(h)/Math.cos(n)),r=this.n*e,a=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(n/2+this.s45),this.n),t.y=a*Math.cos(r)/1,t.x=a*Math.sin(r)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var i,s,h,n,e,r,a,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),n=Math.atan2(t.y,t.x)/Math.sin(this.s0),h=2*(Math.atan(Math.pow(this.ro0/e,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),i=Math.asin(Math.cos(this.ad)*Math.sin(h)-Math.sin(this.ad)*Math.cos(h)*Math.cos(n)),s=Math.asin(Math.cos(h)*Math.sin(n)/Math.cos(i)),t.x=this.long0-s/this.alfa,r=i,a=0;var u=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(i/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(r))/(1-this.e*Math.sin(r)),this.e/2))-this.s45),Math.abs(r-t.y)<1e-10&&(a=1),r=t.y,u+=1}while(0===a&&u<15);return u>=15?null:t},names:["Krovak","krovak"]};function Si(t,i,s,h,n){return t*n-i*Math.sin(2*n)+s*Math.sin(4*n)-h*Math.sin(6*n)}function Pi(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Gi(t){return.375*t*(1+.25*t*(1+.46875*t))}function ki(t){return.05859375*t*t*(1+.75*t)}function Ni(t){return t*t*t*(35/3072)}function Ci(t,i,s){var h=i*s;return t/Math.sqrt(1-h*h)}function Ai(t){return Math.abs(t)<z?t:t-st(t)*Math.PI}function Ri(t,i,s,h,n){var e,r;e=t/i;for(var a=0;a<15;a++)if(e+=r=(t-(i*e-s*Math.sin(2*e)+h*Math.sin(4*e)-n*Math.sin(6*e)))/(i-2*s*Math.cos(2*e)+4*h*Math.cos(4*e)-6*n*Math.cos(6*e)),Math.abs(r)<=1e-10)return e;return NaN}var Ii={init:function(){this.sphere||(this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.ml0=this.a*Si(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var i,s,h=t.x,n=t.y;if(h=ht(h-this.long0,this.over),this.sphere)i=this.a*Math.asin(Math.cos(n)*Math.sin(h)),s=this.a*(Math.atan2(Math.tan(n),Math.cos(h))-this.lat0);else{var e=Math.sin(n),r=Math.cos(n),a=Ci(this.a,this.e,e),o=Math.tan(n)*Math.tan(n),u=h*Math.cos(n),c=u*u,l=this.es*r*r/(1-this.es);i=a*u*(1-c*o*(1/6-(8-o+8*l)*c/120)),s=this.a*Si(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+a*e/r*c*(.5+(5-o+6*l)*c/24)}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h=t.x/this.a,n=t.y/this.a;if(this.sphere){var e=n+this.lat0;i=Math.asin(Math.sin(e)*Math.cos(h)),s=Math.atan2(Math.tan(h),Math.cos(e))}else{var r=Ri(this.ml0/this.a+n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-z)<=M)return t.x=this.long0,t.y=z,n<0&&(t.y*=-1),t;var a=Ci(this.a,this.e,Math.sin(r)),o=a*a*a/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(r),2),c=h*this.a/a,l=c*c;i=r-a*Math.tan(r)/o*c*c*(.5-(1+3*u)*c*c/24),s=c*(1-l*(u/3+(1+3*u)*u*l/15))/Math.cos(r)}return t.x=ht(s+this.long0,this.over),t.y=Ai(i),t},names:["Cassini","Cassini_Soldner","cass"]};function Ti(t,i){var s;return t>1e-7?(1-t*t)*(i/(1-(s=t*i)*s)-.5/t*Math.log((1-s)/(1+s))):2*i}var Oi={init:function(){var t,i=Math.abs(this.lat0);if(this.mode=Math.abs(i-z)<M?this.lat0<0?1:2:Math.abs(i)<M?3:4,this.es>0)switch(this.qp=Ti(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var i,s=[];return s[0]=.3333333333333333*t,s[0]+=.17222222222222222*(i=t*t),s[1]=.06388888888888888*i,s[0]+=.10257936507936508*(i*=t),s[1]+=.0664021164021164*i,s[2]=.016415012942191543*i,s}(this.es),this.mode){case 2:case 1:this.dd=1;break;case 3:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case 4:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=Ti(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else 4===this.mode&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var i,s,h,n,e,r,a,o,u,c,l=t.x,f=t.y;if(l=ht(l-this.long0,this.over),this.sphere){if(e=Math.sin(f),c=Math.cos(f),h=Math.cos(l),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((s=this.mode===this.EQUIT?1+c*h:1+this.sinph0*e+this.cosph0*c*h)<=M)return null;i=(s=Math.sqrt(2/s))*c*Math.sin(l),s*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*c*h}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(h=-h),Math.abs(f+this.lat0)<M)return null;s=x-.5*f,i=(s=2*(this.mode===this.S_POLE?Math.cos(s):Math.sin(s)))*Math.sin(l),s*=h}}else{switch(a=0,o=0,u=0,h=Math.cos(l),n=Math.sin(l),e=Math.sin(f),r=Ti(this.e,e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(a=r/this.qp,o=Math.sqrt(1-a*a)),this.mode){case this.OBLIQ:u=1+this.sinb1*a+this.cosb1*o*h;break;case this.EQUIT:u=1+o*h;break;case this.N_POLE:u=z+f,r=this.qp-r;break;case this.S_POLE:u=f-z,r=this.qp+r}if(Math.abs(u)<M)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:u=Math.sqrt(2/u),s=this.mode===this.OBLIQ?this.ymf*u*(this.cosb1*a-this.sinb1*o*h):(u=Math.sqrt(2/(1+o*h)))*a*this.ymf,i=this.xmf*u*o*n;break;case this.N_POLE:case this.S_POLE:r>=0?(i=(u=Math.sqrt(r))*n,s=h*(this.mode===this.S_POLE?u:-u)):i=s=0}}return t.x=this.a*i+this.x0,t.y=this.a*s+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i,s,h,n,e,r,a,o,u,c,l=t.x/this.a,f=t.y/this.a;if(this.sphere){var d,v=0,m=0;if((s=.5*(d=Math.sqrt(l*l+f*f)))>1)return null;switch(s=2*Math.asin(s),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(s),v=Math.cos(s)),this.mode){case this.EQUIT:s=Math.abs(d)<=M?0:Math.asin(f*m/d),l*=m,f=v*d;break;case this.OBLIQ:s=Math.abs(d)<=M?this.lat0:Math.asin(v*this.sinph0+f*m*this.cosph0/d),l*=m*this.cosph0,f=(v-Math.sin(s)*this.sinph0)*d;break;case this.N_POLE:f=-f,s=z-s;break;case this.S_POLE:s-=z}i=0!==f||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(l,f):0}else{if(a=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(l/=this.dd,f*=this.dd,(r=Math.sqrt(l*l+f*f))<M)return t.x=this.long0,t.y=this.lat0,t;n=2*Math.asin(.5*r/this.rq),h=Math.cos(n),l*=n=Math.sin(n),this.mode===this.OBLIQ?(e=this.qp*(a=h*this.sinb1+f*n*this.cosb1/r),f=r*this.cosb1*h-f*this.sinb1*n):(e=this.qp*(a=f*n/r),f=r*h)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(f=-f),!(e=l*l+f*f))return t.x=this.long0,t.y=this.lat0,t;a=1-e/this.qp,this.mode===this.S_POLE&&(a=-a)}i=Math.atan2(l,f),c=(o=Math.asin(a))+o,s=o+(u=this.apa)[0]*Math.sin(c)+u[1]*Math.sin(c+c)+u[2]*Math.sin(c+c+c)}return t.x=ht(this.long0+i,this.over),t.y=s,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4};function Fi(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}var Li={init:function(){Math.abs(this.lat1+this.lat2)<M||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=it(this.e3,this.sin_po,this.cos_po),this.qs1=Ti(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=it(this.e3,this.sin_po,this.cos_po),this.qs2=Ti(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Ti(this.e3,this.sin_po),this.ns0=Math.abs(this.lat1-this.lat2)>M?(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var i=t.x,s=t.y;this.sin_phi=Math.sin(s),this.cos_phi=Math.cos(s);var h=Ti(this.e3,this.sin_phi),n=this.a*Math.sqrt(this.c-this.ns0*h)/this.ns0,e=this.ns0*ht(i-this.long0,this.over),r=n*Math.sin(e)+this.x0,a=this.rh-n*Math.cos(e)+this.y0;return t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),h=0,0!==i&&(h=Math.atan2(s*t.x,s*t.y)),s=i*this.ns0/this.a,e=this.sphere?Math.asin((this.c-s*s)/(2*this.ns0)):this.phi1z(this.e3,(this.c-s*s)/this.ns0),n=ht(h/this.ns0+this.long0,this.over),t.x=n,t.y=e,t},names:["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"],phi1z:function(t,i){var s,h,n,e,r=Fi(.5*i);if(t<M)return r;for(var a=t*t,o=1;o<=25;o++)if(r+=e=.5*(n=1-(h=t*(s=Math.sin(r)))*h)*n/Math.cos(r)*(i/(1-a)-s/n+.5/t*Math.log((1-h)/(1+h))),Math.abs(e)<=1e-7)return r;return null}},Di={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var i,s,h,n,e,r,a,o=t.y;return h=ht(t.x-this.long0,this.over),i=Math.sin(o),s=Math.cos(o),n=Math.cos(h),(e=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(e)<=M?(r=this.x0+1*this.a*s*Math.sin(h)/e,a=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)/e):(r=this.x0+this.infinity_dist*s*Math.sin(h),a=this.y0+this.infinity_dist*(this.cos_p14*i-this.sin_p14*s*n)),t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e,r;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(i=Math.sqrt(t.x*t.x+t.y*t.y))?(n=Math.atan2(i,this.rc),s=Math.sin(n),r=Fi((h=Math.cos(n))*this.sin_p14+t.y*s*this.cos_p14/i),e=Math.atan2(t.x*s,i*this.cos_p14*h-t.y*this.sin_p14*s),e=ht(this.long0+e,this.over)):(r=this.phic0,e=0),t.x=e,t.y=r,t},names:["gnom"]},ji={init:function(){this.sphere||(this.k0=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var i,s,h=t.y,n=ht(t.x-this.long0,this.over);if(this.sphere)i=this.x0+this.a*n*Math.cos(this.lat_ts),s=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var e=Ti(this.e,Math.sin(h));i=this.x0+this.a*this.k0*n,s=this.y0+this.a*e*.5/this.k0}return t.x=i,t.y=s,t},inverse:function(t){var i,s;return t.x-=this.x0,t.y-=this.y0,this.sphere?(i=ht(this.long0+t.x/this.a/Math.cos(this.lat_ts),this.over),s=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(s=function(t,i){var s=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(i)-s)<1e-6)return i<0?-1*z:z;for(var h,n,e,r,a=Math.asin(.5*i),o=0;o<30;o++)if(n=Math.sin(a),e=Math.cos(a),r=t*n,a+=h=Math.pow(1-r*r,2)/(2*e)*(i/(1-t*t)-n/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),Math.abs(h)<=1e-10)return a;return NaN}(this.e,2*t.y*this.k0/this.a),i=ht(this.long0+t.x/(this.a*this.k0),this.over)),t.x=i,t.y=s,t},names:["cea"]},Wi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var i=t.y,s=ht(t.x-this.long0,this.over),h=Ai(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var i=t.y;return t.x=ht(this.long0+(t.x-this.x0)/(this.a*this.rc),this.over),t.y=Ai(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"]},Ui={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.ml0=this.a*Si(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var i,s,h,n=t.y,e=ht(t.x-this.long0,this.over);if(h=e*Math.sin(n),this.sphere)Math.abs(n)<=M?(i=this.a*e,s=-1*this.a*this.lat0):(i=this.a*Math.sin(h)/Math.tan(n),s=this.a*(Ai(n-this.lat0)+(1-Math.cos(h))/Math.tan(n)));else if(Math.abs(n)<=M)i=this.a*e,s=-1*this.ml0;else{var r=Ci(this.a,this.e,Math.sin(n))/Math.tan(n);i=r*Math.sin(h),s=this.a*Si(this.e0,this.e1,this.e2,this.e3,n)-this.ml0+r*(1-Math.cos(h))}return t.x=i+this.x0,t.y=s+this.y0,t},inverse:function(t){var i,s,h,n,e,r,a,o,u;if(h=t.x-this.x0,n=t.y-this.y0,this.sphere)if(Math.abs(n+this.a*this.lat0)<=M)i=ht(h/this.a+this.long0,this.over),s=0;else{var c;for(a=h*h/this.a/this.a+(r=this.lat0+n/this.a)*r,o=r,e=20;e;--e)if(o+=u=-1*(r*(o*(c=Math.tan(o))+1)-o-.5*(o*o+a)*c)/((o-r)/c-1),Math.abs(u)<=M){s=o;break}i=ht(this.long0+Math.asin(h*Math.tan(o)/this.a)/Math.sin(s),this.over)}else if(Math.abs(n+this.ml0)<=M)s=0,i=ht(this.long0+h/this.a,this.over);else{var l,f,d,v,m;for(a=h*h/this.a/this.a+(r=(this.ml0+n)/this.a)*r,o=r,e=20;e;--e)if(m=this.e*Math.sin(o),l=Math.sqrt(1-m*m)*Math.tan(o),f=this.a*Si(this.e0,this.e1,this.e2,this.e3,o),d=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=u=(r*(l*(v=f/this.a)+1)-v-.5*l*(v*v+a))/(this.es*Math.sin(2*o)*(v*v+a-2*r*v)/(4*l)+(r-v)*(l*d-2/Math.sin(2*o))-d),Math.abs(u)<=M){s=o;break}l=Math.sqrt(1-this.es*Math.pow(Math.sin(s),2))*Math.tan(s),i=ht(this.long0+Math.asin(h*l/this.a)/Math.sin(s),this.over)}return t.x=i,t.y=s,t},names:["Polyconic","American_Polyconic","poly"]},Vi={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var i,s=(t.y-this.lat0)/g*1e-5,h=t.x-this.long0,n=1,e=0;for(i=1;i<=10;i++)e+=this.A[i]*(n*=s);var r,a=e,o=h,u=1,c=0,l=0,f=0;for(i=1;i<=6;i++)r=c*a+u*o,l=l+this.B_re[i]*(u=u*a-c*o)-this.B_im[i]*(c=r),f=f+this.B_im[i]*u+this.B_re[i]*c;return t.x=f*this.a+this.x0,t.y=l*this.a+this.y0,t},inverse:function(t){var i,s,h=(t.y-this.y0)/this.a,n=(t.x-this.x0)/this.a,e=1,r=0,a=0,o=0;for(i=1;i<=6;i++)s=r*h+e*n,a=a+this.C_re[i]*(e=e*h-r*n)-this.C_im[i]*(r=s),o=o+this.C_im[i]*e+this.C_re[i]*r;for(var u=0;u<this.iterations;u++){var c,l=a,f=o,d=h,v=n;for(i=2;i<=6;i++)c=f*a+l*o,d+=(i-1)*(this.B_re[i]*(l=l*a-f*o)-this.B_im[i]*(f=c)),v+=(i-1)*(this.B_im[i]*l+this.B_re[i]*f);l=1,f=0;var m=this.B_re[1],p=this.B_im[1];for(i=2;i<=6;i++)c=f*a+l*o,m+=i*(this.B_re[i]*(l=l*a-f*o)-this.B_im[i]*(f=c)),p+=i*(this.B_im[i]*l+this.B_re[i]*f);var _=m*m+p*p;a=(d*m+v*p)/_,o=(v*m-d*p)/_}var z=a,M=o,w=1,b=0;for(i=1;i<=9;i++)b+=this.D[i]*(w*=z);var x=this.lat0+b*g*1e5;return t.x=this.long0+M,t.y=x,t},names:["New_Zealand_Map_Grid","nzmg"]},qi={init:function(){},forward:function(t){var i=t.y,s=ht(t.x-this.long0,this.over),h=this.x0+this.a*s,n=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=n,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var i=ht(this.long0+t.x/this.a,this.over),s=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=i,t.y=s,t},names:["Miller_Cylindrical","mill"]},Bi={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=ri(this.es)},forward:function(t){var i,s,h=t.x,n=t.y;if(h=ht(h-this.long0,this.over),this.sphere){if(this.m)for(var e=this.n*Math.sin(n),r=20;r;--r){var a=(this.m*n+Math.sin(n)-e)/(this.m+Math.cos(n));if(n-=a,Math.abs(a)<M)break}else n=1!==this.n?Math.asin(this.n*Math.sin(n)):n;i=this.a*this.C_x*h*(this.m+Math.cos(n)),s=this.a*this.C_y*n}else{var o=Math.sin(n),u=Math.cos(n);s=this.a*ai(n,o,u,this.en),i=this.a*h*u/Math.sqrt(1-this.es*o*o)}return t.x=i,t.y=s,t},inverse:function(t){var i,s,h;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,i=t.y/this.a,this.sphere?(i/=this.C_y,s/=this.C_x*(this.m+Math.cos(i)),this.m?i=Fi((this.m*i+Math.sin(i))/this.n):1!==this.n&&(i=Fi(Math.sin(i)/this.n)),s=ht(s+this.long0,this.over),i=Ai(i)):(i=oi(t.y/this.a,this.es,this.en),(h=Math.abs(i))<z?(h=Math.sin(i),s=ht(this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(i)),this.over)):h-M<z&&(s=this.long0)),t.x=s,t.y=i,t},names:["Sinusoidal","sinu"]},Xi={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0},forward:function(t){for(var i=t.y,s=ht(t.x-this.long0,this.over),h=i,n=Math.PI*Math.sin(i);;){var e=-(h+Math.sin(h)-n)/(1+Math.cos(h));if(h+=e,Math.abs(e)<M)break}h/=2,Math.PI/2-Math.abs(i)<M&&(s=0);var r=.900316316158*this.a*s*Math.cos(h)+this.x0,a=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=r,t.y=a,t},inverse:function(t){var i,s;t.x-=this.x0,t.y-=this.y0,s=t.y/(1.4142135623731*this.a),Math.abs(s)>.999999999999&&(s=.999999999999),i=Math.asin(s);var h=ht(this.long0+t.x/(.900316316158*this.a*Math.cos(i)),this.over);h<-Math.PI&&(h=-Math.PI),h>Math.PI&&(h=Math.PI),s=(2*i+Math.sin(2*i))/Math.PI,Math.abs(s)>1&&(s=1);var n=Math.asin(s);return t.x=h,t.y=n,t},names:["Mollweide","moll"]},Hi={init:function(){Math.abs(this.lat1+this.lat2)<M||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Pi(this.es),this.e1=Gi(this.es),this.e2=ki(this.es),this.e3=Ni(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=it(this.e,this.sin_phi,this.cos_phi),this.ml1=Si(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<M?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=it(this.e,this.sin_phi,this.cos_phi),this.ml2=Si(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Si(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var i,s=t.x,h=t.y;if(this.sphere)i=this.a*(this.g-h);else{var n=Si(this.e0,this.e1,this.e2,this.e3,h);i=this.a*(this.g-n)}var e=this.ns*ht(s-this.long0,this.over),r=this.x0+i*Math.sin(e),a=this.y0+this.rh-i*Math.cos(e);return t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),i=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),i=-1);var e=0;return 0!==s&&(e=Math.atan2(i*t.x,i*t.y)),this.sphere?(n=ht(this.long0+e/this.ns,this.over),h=Ai(this.g-s/this.a),t.x=n,t.y=h,t):(h=Ri(this.g-s/this.a,this.e0,this.e1,this.e2,this.e3),n=ht(this.long0+e/this.ns,this.over),t.x=n,t.y=h,t)},names:["Equidistant_Conic","eqdc"]},Yi={init:function(){this.R=this.a},forward:function(t){var i,s,h=t.y,n=ht(t.x-this.long0,this.over);Math.abs(h)<=M&&(i=this.x0+this.R*n,s=this.y0);var e=Fi(2*Math.abs(h/Math.PI));(Math.abs(n)<=M||Math.abs(Math.abs(h)-z)<=M)&&(i=this.x0,s=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*e):this.y0+Math.PI*this.R*-Math.tan(.5*e));var r=.5*Math.abs(Math.PI/n-n/Math.PI),a=r*r,o=Math.sin(e),u=Math.cos(e),c=u/(o+u-1),l=c*(2/o-1),f=l*l,d=Math.PI*this.R*(r*(c-f)+Math.sqrt(a*(c-f)*(c-f)-(f+a)*(c*c-f)))/(f+a);n<0&&(d=-d),i=this.x0+d;var v=a+c;return d=Math.PI*this.R*(l*v-r*Math.sqrt((f+a)*(a+1)-v*v))/(f+a),s=h>=0?this.y0+d:this.y0-d,t.x=i,t.y=s,t},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f;return t.x-=this.x0,t.y-=this.y0,l=Math.PI*this.R,e=(h=t.x/l)*h+(n=t.y/l)*n,l=3*(n*n/(o=-2*(r=-Math.abs(n)*(1+e))+1+2*n*n+e*e)+(2*(a=r-2*n*n+h*h)*a*a/o/o/o-9*r*a/o/o)/27)/(u=(r-a*a/3/o)/o)/(c=2*Math.sqrt(-u/3)),Math.abs(l)>1&&(l=l>=0?1:-1),f=Math.acos(l)/3,s=t.y>=0?(-c*Math.cos(f+Math.PI/3)-a/3/o)*Math.PI:-(-c*Math.cos(f+Math.PI/3)-a/3/o)*Math.PI,i=Math.abs(h)<M?this.long0:ht(this.long0+Math.PI*(e-1+Math.sqrt(1+2*(h*h-n*n)+e*e))/2/h,this.over),t.x=i,t.y=s,t},names:["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"]},Ji={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))},forward:function(t){var i,s,h,n,e,r,a,o,u,c,l,f=t.x,d=t.y,v=Math.sin(t.y),m=Math.cos(t.y),p=ht(f-this.long0,this.over);return this.sphere?Math.abs(this.sin_p12-1)<=M?(t.x=this.x0+this.a*(z-d)*Math.sin(p),t.y=this.y0-this.a*(z-d)*Math.cos(p),t):Math.abs(this.sin_p12+1)<=M?(t.x=this.x0+this.a*(z+d)*Math.sin(p),t.y=this.y0+this.a*(z+d)*Math.cos(p),t):(u=this.sin_p12*v+this.cos_p12*m*Math.cos(p),o=(a=Math.acos(u))?a/Math.sin(a):1,t.x=this.x0+this.a*o*m*Math.sin(p),t.y=this.y0+this.a*o*(this.cos_p12*v-this.sin_p12*m*Math.cos(p)),t):(i=Pi(this.es),s=Gi(this.es),h=ki(this.es),n=Ni(this.es),Math.abs(this.sin_p12-1)<=M?(e=this.a*Si(i,s,h,n,z),r=this.a*Si(i,s,h,n,d),t.x=this.x0+(e-r)*Math.sin(p),t.y=this.y0-(e-r)*Math.cos(p),t):Math.abs(this.sin_p12+1)<=M?(e=this.a*Si(i,s,h,n,z),r=this.a*Si(i,s,h,n,d),t.x=this.x0+(e+r)*Math.sin(p),t.y=this.y0+(e+r)*Math.cos(p),t):Math.abs(f)<M&&Math.abs(d-this.lat0)<M?(t.x=t.y=0,t):(c=function(t,i,s,h,n,e){const r=h-i,a=Math.atan((1-e)*Math.tan(t)),o=Math.atan((1-e)*Math.tan(s)),u=Math.sin(a),c=Math.cos(a),l=Math.sin(o),f=Math.cos(o);let d,v,m,p,_,g,z,M,w,b,x,y,E,S,P,G=r,k=100;do{if(v=Math.sin(G),m=Math.cos(G),p=Math.sqrt(f*v*(f*v)+(c*l-u*f*m)*(c*l-u*f*m)),0===p)return{azi1:0,s12:0};_=u*l+c*f*m,g=Math.atan2(p,_),z=c*f*v/p,M=1-z*z,w=0!==M?_-2*u*l/M:0,b=e/16*M*(4+e*(4-3*M)),d=G,G=r+(1-b)*e*z*(g+b*p*(w+b*_*(2*w*w-1)))}while(Math.abs(G-d)>1e-12&&--k>0);return 0===k?{azi1:NaN,s12:NaN}:(x=M*(n*n-n*(1-e)*(n*(1-e)))/(n*(1-e)*(n*(1-e))),y=1+x/16384*(4096+x*(x*(320-175*x)-768)),E=x/1024*(256+x*(x*(74-47*x)-128)),S=E*p*(w+E/4*(_*(2*w*w-1)-E/6*w*(4*p*p-3)*(4*w*w-3))),P=n*(1-e)*y*(g-S),{azi1:Math.atan2(f*v,c*l-u*f*m),s12:P})}(this.lat0,this.long0,d,f,this.a,this.f),l=c.azi1,t.x=c.s12*Math.sin(l),t.y=c.s12*Math.cos(l),t))},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f,d,v,m;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((i=Math.sqrt(t.x*t.x+t.y*t.y))>2*z*this.a)return;return s=i/this.a,h=Math.sin(s),n=Math.cos(s),e=this.long0,Math.abs(i)<=M?r=this.lat0:(r=Fi(n*this.sin_p12+t.y*h*this.cos_p12/i),a=Math.abs(this.lat0)-z,e=Math.abs(a)<=M?ht(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y),this.over):ht(this.long0+Math.atan2(t.x*h,i*this.cos_p12*n-t.y*this.sin_p12*h),this.over)),t.x=e,t.y=r,t}return o=Pi(this.es),u=Gi(this.es),c=ki(this.es),l=Ni(this.es),Math.abs(this.sin_p12-1)<=M?(r=Ri(((f=this.a*Si(o,u,c,l,z))-(i=Math.sqrt(t.x*t.x+t.y*t.y)))/this.a,o,u,c,l),e=ht(this.long0+Math.atan2(t.x,-1*t.y),this.over),t.x=e,t.y=r,t):Math.abs(this.sin_p12+1)<=M?(f=this.a*Si(o,u,c,l,z),r=Ri(((i=Math.sqrt(t.x*t.x+t.y*t.y))-f)/this.a,o,u,c,l),e=ht(this.long0+Math.atan2(t.x,t.y),this.over),t.x=e,t.y=r,t):(d=Math.atan2(t.x,t.y),v=Math.sqrt(t.x*t.x+t.y*t.y),m=function(t,i,s,h,n,e){const r=Math.atan((1-e)*Math.tan(t)),a=Math.sin(r),o=Math.cos(r),u=Math.sin(s),c=Math.cos(s),l=Math.atan2(a,o*c),f=o*u,d=1-f*f,v=d*(n*n-n*(1-e)*(n*(1-e)))/(n*(1-e)*(n*(1-e))),m=1+v/16384*(4096+v*(v*(320-175*v)-768)),p=v/1024*(256+v*(v*(74-47*v)-128));let _,g,z,M,w,b=h/(n*(1-e)*m),x=100;do{g=Math.cos(2*l+b),z=Math.sin(b),M=Math.cos(b),w=p*z*(g+p/4*(M*(2*g*g-1)-p/6*g*(4*z*z-3)*(4*g*g-3))),_=b,b=h/(n*(1-e)*m)+w}while(Math.abs(b-_)>1e-12&&--x>0);if(0===x)return{lat2:NaN,lon2:NaN};const y=a*z-o*M*c,E=e/16*d*(4+e*(4-3*d));return{lat2:Math.atan2(a*M+o*z*c,(1-e)*Math.sqrt(f*f+y*y)),lon2:i+(Math.atan2(z*u,o*M-a*z*c)-(1-E)*e*f*(b+E*z*(g+E*M*(2*g*g-1))))}}(this.lat0,this.long0,d,v,this.a,this.f),t.x=m.lon2,t.y=m.lat2,t)},names:["Azimuthal_Equidistant","aeqd"]},Zi={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var i,s,h,n,e,r,a,o=t.y;return h=ht(t.x-this.long0,this.over),i=Math.sin(o),s=Math.cos(o),n=Math.cos(h),((e=this.sin_p14*i+this.cos_p14*s*n)>0||Math.abs(e)<=M)&&(r=1*this.a*s*Math.sin(h),a=this.y0+1*this.a*(this.cos_p14*i-this.sin_p14*s*n)),t.x=r,t.y=a,t},inverse:function(t){var i,s,h,n,e,r,a;return t.x-=this.x0,t.y-=this.y0,s=Fi((i=Math.sqrt(t.x*t.x+t.y*t.y))/this.a),h=Math.sin(s),n=Math.cos(s),r=this.long0,Math.abs(i)<=M?(a=this.lat0,t.x=r,t.y=a,t):(a=Fi(n*this.sin_p14+t.y*h*this.cos_p14/i),e=Math.abs(this.lat0)-z,Math.abs(e)<=M?(r=ht(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y),this.over),t.x=r,t.y=a,t):(r=ht(this.long0+Math.atan2(t.x*h,i*this.cos_p14*n-t.y*this.sin_p14*h),this.over),t.x=r,t.y=a,t))},names:["ortho"]};function Ki(t,i,s,h){var n;return t<M?(h.value=1,n=0):(n=Math.atan2(i,s),Math.abs(n)<=x?h.value=1:n>x&&n<=z+x?(h.value=2,n-=z):n>z+x||n<=-(z+x)?(h.value=3,n=n>=0?n-E:n+E):(h.value=4,n+=z)),n}function $i(t,i){var s=t+i;return s<-E?s+=y:s>+E&&(s-=y),s}var Qi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.face=this.lat0>=z-x/2?5:this.lat0<=-(z-x/2)?6:Math.abs(this.long0)<=x?1:Math.abs(this.long0)<=z+x?this.long0>0?2:4:3,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var i,s,h,n,e,r,a={x:0,y:0},o={value:0};if(t.x-=this.long0,i=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,s=t.x,5===this.face)n=z-i,s>=x&&s<=z+x?(o.value=1,h=s-z):s>z+x||s<=-(z+x)?(o.value=2,h=s>0?s-E:s+E):s>-(z+x)&&s<=-x?(o.value=3,h=s+z):(o.value=4,h=s);else if(6===this.face)n=z+i,s>=x&&s<=z+x?(o.value=1,h=-s+z):s<x&&s>=-x?(o.value=2,h=-s):s<-x&&s>=-(z+x)?(o.value=3,h=-s-z):(o.value=4,h=s>0?-s+E:-s-E);else{var u,c,l,f,d,v;2===this.face?s=$i(s,+z):3===this.face?s=$i(s,+E):4===this.face&&(s=$i(s,-z)),f=Math.sin(i),d=Math.cos(i),v=Math.sin(s),u=d*Math.cos(s),c=d*v,l=f,1===this.face?h=Ki(n=Math.acos(u),l,c,o):2===this.face?h=Ki(n=Math.acos(c),l,-u,o):3===this.face?h=Ki(n=Math.acos(-u),l,-c,o):4===this.face?h=Ki(n=Math.acos(-c),l,u,o):(n=h=0,o.value=1)}return r=Math.atan(12/E*(h+Math.acos(Math.sin(h)*Math.cos(x))-z)),e=Math.sqrt((1-Math.cos(n))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(h))))),2===o.value?r+=z:3===o.value?r+=E:4===o.value&&(r+=1.5*E),a.x=e*Math.cos(r),a.y=e*Math.sin(r),a.x=a.x*this.a+this.x0,a.y=a.y*this.a+this.y0,t.x=a.x,t.y=a.y,t},inverse:function(t){var i,s,h,n,e,r,a,o,u,c,l,f,d={lam:0,phi:0},v={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?v.value=1:t.y>=0&&t.y>=Math.abs(t.x)?(v.value=2,i-=z):t.x<0&&-t.x>=Math.abs(t.y)?(v.value=3,i=i<0?i+E:i-E):(v.value=4,i+=z),u=E/12*Math.tan(i),e=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),r=Math.atan(e),(a=1-(h=Math.cos(i))*h*(n=Math.tan(s))*n*(1-Math.cos(Math.atan(1/Math.cos(r)))))<-1?a=-1:a>1&&(a=1),5===this.face)o=Math.acos(a),d.phi=z-o,d.lam=1===v.value?r+z:2===v.value?r<0?r+E:r-E:3===v.value?r-z:r;else if(6===this.face)o=Math.acos(a),d.phi=o-z,d.lam=1===v.value?-r+z:2===v.value?-r:3===v.value?-r-z:r<0?-r-E:-r+E;else{var m,p,_;u=(m=a)*m,p=(u+=(_=u>=1?0:Math.sqrt(1-u)*Math.sin(r))*_)>=1?0:Math.sqrt(1-u),2===v.value?(u=p,p=-_,_=u):3===v.value?(p=-p,_=-_):4===v.value&&(u=p,p=_,_=-u),2===this.face?(u=m,m=-p,p=u):3===this.face?(m=-m,p=-p):4===this.face&&(u=m,m=p,p=-u),d.phi=Math.acos(-_)-z,d.lam=Math.atan2(p,m),2===this.face?d.lam=$i(d.lam,-z):3===this.face?d.lam=$i(d.lam,-E):4===this.face&&(d.lam=$i(d.lam,+z))}return 0!==this.es&&(c=d.phi<0?1:0,l=Math.tan(d.phi),f=this.b/Math.sqrt(l*l+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),c&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},ts=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],is=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ss=.8487,hs=1.3523,ns=b/5,es=1/ns,rs=function(t,i){return t[0]+i*(t[1]+i*(t[2]+i*t[3]))},as={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var i=ht(t.x-this.long0,this.over),s=Math.abs(t.y),h=Math.floor(s*ns);h<0?h=0:h>=18&&(h=17);var n={x:rs(ts[h],s=b*(s-es*h))*i,y:rs(is[h],s)};return t.y<0&&(n.y=-n.y),n.x=n.x*this.a*ss+this.x0,n.y=n.y*this.a*hs+this.y0,n},inverse:function(t){var i={x:(t.x-this.x0)/(this.a*ss),y:Math.abs(t.y-this.y0)/(this.a*hs)};if(i.y>=1)i.x/=ts[18][0],i.y=t.y<0?-z:z;else{var s=Math.floor(18*i.y);for(s<0?s=0:s>=18&&(s=17);;)if(is[s][0]>i.y)--s;else{if(!(is[s+1][0]<=i.y))break;++s}var h=is[s],n=5*(i.y-h[0])/(is[s+1][0]-h[0]);n=function(t,i,s,h){for(var n=i;h;--h){var e=t(n);if(n-=e,Math.abs(e)<1e-10)break}return n}((function(t){return(rs(h,t)-i.y)/function(t,i){return t[1]+i*(2*t[2]+3*i*t[3])}(h,t)}),n,0,100),i.x/=rs(ts[s],n),i.y=(5*s+n)*w,t.y<0&&(i.y=-i.y)}return i.x=ht(i.x+this.long0,this.over),i},names:["Robinson","robin"]},os={init:function(){this.name="geocent"},forward:function(t){return kt(t,this.es,this.a)},inverse:function(t){return Nt(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]},us={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}},cs={init:function(){if(Object.keys(us).forEach(function(t){if(void 0===this[t])this[t]=us[t].def;else{if(us[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);us[t].num&&(this[t]=parseFloat(this[t]))}us[t].degrees&&(this[t]=this[t]*w)}.bind(this)),Math.abs(Math.abs(this.lat0)-z)<M?this.mode=this.lat0<0?1:0:Math.abs(this.lat0)<M?this.mode=2:(this.mode=3,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,i=this.azi;this.cg=Math.cos(i),this.sg=Math.sin(i),this.cw=Math.cos(t),this.sw=Math.sin(t)},forward:function(t){t.x-=this.long0;var i,s,h,n,e=Math.sin(t.y),r=Math.cos(t.y),a=Math.cos(t.x);switch(this.mode){case 3:s=this.sinph0*e+this.cosph0*r*a;break;case 2:s=r*a;break;case 1:s=-e;break;case 0:s=e}switch(i=(s=this.pn1/(this.p-s))*r*Math.sin(t.x),this.mode){case 3:s*=this.cosph0*e-this.sinph0*r*a;break;case 2:s*=e;break;case 0:s*=-r*a;break;case 1:s*=r*a}return i=(i*this.cg-s*this.sg)*this.cw*(n=1/((h=s*this.cg+i*this.sg)*this.sw*this.h1+this.cw)),s=h*n,t.x=i*this.a,t.y=s*this.a,t},inverse:function(t){t.x/=this.a,t.y/=this.a;var i,s,h,n={x:t.x,y:t.y};t.x=(i=this.pn1*t.x*(h=1/(this.pn1-t.y*this.sw)))*this.cg+(s=this.pn1*t.y*this.cw*h)*this.sg,t.y=s*this.cg-i*this.sg;var e=li(t.x,t.y);if(Math.abs(e)<M)n.x=0,n.y=t.y;else{var r,a;switch(a=1-e*e*this.pfact,a=(this.p-Math.sqrt(a))/(this.pn1/e+e/this.pn1),r=Math.sqrt(1-a*a),this.mode){case 3:n.y=Math.asin(r*this.sinph0+t.y*a*this.cosph0/e),t.y=(r-this.sinph0*Math.sin(n.y))*e,t.x*=a*this.cosph0;break;case 2:n.y=Math.asin(t.y*a/e),t.y=r*e,t.x*=a;break;case 0:n.y=Math.asin(r),t.y=-t.y;break;case 1:n.y=-Math.asin(r)}n.x=Math.atan2(t.x,t.y)}return t.x=n.x+this.long0,t.y=n.y,t},names:["Tilted_Perspective","tpers"]},ls={init:function(){if(this.flip_axis="x"===this.sweep?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,0!==this.es){var t=1-this.es,i=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=i,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")},forward:function(t){var i,s,h,n,e=t.x,r=t.y;if(e-=this.long0,"ellipse"===this.shape){r=Math.atan(this.radius_p2*Math.tan(r));var a=this.radius_p/li(this.radius_p*Math.cos(r),Math.sin(r));if(s=a*Math.cos(e)*Math.cos(r),h=a*Math.sin(e)*Math.cos(r),n=a*Math.sin(r),(this.radius_g-s)*s-h*h-n*n*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(h/li(n,i)),t.y=this.radius_g_1*Math.atan(n/i)):(t.x=this.radius_g_1*Math.atan(h/i),t.y=this.radius_g_1*Math.atan(n/li(h,i)))}else"sphere"===this.shape&&(i=Math.cos(r),s=Math.cos(e)*i,h=Math.sin(e)*i,n=Math.sin(r),i=this.radius_g-s,this.flip_axis?(t.x=this.radius_g_1*Math.atan(h/li(n,i)),t.y=this.radius_g_1*Math.atan(n/i)):(t.x=this.radius_g_1*Math.atan(h/i),t.y=this.radius_g_1*Math.atan(n/li(h,i))));return t.x=t.x*this.a,t.y=t.y*this.a,t},inverse:function(t){var i,s,h,n,e=-1,r=0,a=0;if(t.x=t.x/this.a,t.y=t.y/this.a,"ellipse"===this.shape){this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*li(1,a)):(r=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*li(1,r));var o=a/this.radius_p;if((h=(s=2*this.radius_g*e)*s-4*(i=r*r+o*o+e*e)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*i),e=this.radius_g+n*e,r*=n,a*=n,t.x=Math.atan2(r,e),t.y=Math.atan(a*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if("sphere"===this.shape){if(this.flip_axis?(a=Math.tan(t.y/this.radius_g_1),r=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+a*a)):(r=Math.tan(t.x/this.radius_g_1),a=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+r*r)),(h=(s=2*this.radius_g*e)*s-4*(i=r*r+a*a+e*e)*this.C)<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-s-Math.sqrt(h))/(2*i),e=this.radius_g+n*e,r*=n,a*=n,t.x=Math.atan2(r,e),t.y=Math.atan(a*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t},names:["Geostationary Satellite View","Geostationary_Satellite","geos"]},fs=1.340264,ds=-.081106,vs=893e-6,ms=.003796,ps=Math.sqrt(3)/2,_s={init:function(){this.es=0,this.long0=void 0!==this.long0?this.long0:0,this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0},forward:function(t){var i=ht(t.x-this.long0,this.over),s=Math.asin(ps*Math.sin(t.y)),h=s*s,n=h*h*h;return t.x=i*Math.cos(s)/(ps*(fs+3*ds*h+n*(7*vs+9*ms*h))),t.y=s*(fs+ds*h+n*(vs+ms*h)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var i,s,h,n,e=t.y;for(n=0;n<12&&(e-=h=(e*(fs+ds*(i=e*e)+(s=i*i*i)*(vs+ms*i))-t.y)/(fs+3*ds*i+s*(7*vs+9*ms*i)),!(Math.abs(h)<1e-9));++n);return t.x=ps*t.x*(fs+3*ds*(i=e*e)+(s=i*i*i)*(7*vs+9*ms*i))/Math.cos(e),t.y=Math.asin(Math.sin(e)/ps),t.x=ht(t.x+this.long0,this.over),t},names:["eqearth","Equal Earth","Equal_Earth"]},gs=1e-10;function zs(t){var i,s,h,n=ht(t.x-(this.long0||0),this.over),e=t.y;return i=this.am1+this.m1-ai(e,s=Math.sin(e),h=Math.cos(e),this.en),s=h*n/(i*Math.sqrt(1-this.es*s*s)),t.x=i*Math.sin(s),t.y=this.am1-i*Math.cos(s),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Ms(t){var i,s,h,n;if(t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a,s=li(t.x,t.y=this.am1-t.y),n=oi(this.am1+this.m1-s,this.es,this.en),(i=Math.abs(n))<z)i=Math.sin(n),h=s*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*i*i)/Math.cos(n);else{if(!(Math.abs(i-z)<=gs))throw new Error;h=0}return t.x=ht(h+(this.long0||0),this.over),t.y=Ai(n),t}function ws(t){var i,s,h=ht(t.x-(this.long0||0),this.over),n=t.y;return s=this.cphi1+this.phi1-n,Math.abs(s)>gs?(t.x=s*Math.sin(i=h*Math.cos(n)/s),t.y=this.cphi1-s*Math.cos(i)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function bs(t){var i,s;t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var h=li(t.x,t.y=this.cphi1-t.y);if(s=this.cphi1+this.phi1-h,Math.abs(s)>z)throw new Error;return i=Math.abs(Math.abs(s)-z)<=gs?0:h*Math.atan2(t.x,t.y)/Math.cos(s),t.x=ht(i+(this.long0||0),this.over),t.y=Ai(s),t}var xs={init:function(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<gs)throw new Error;this.es?(this.en=ri(this.es),this.m1=ai(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Ms,this.forward=zs):(this.cphi1=Math.abs(this.phi1)+gs>=z?0:1/Math.tan(this.phi1),this.inverse=bs,this.forward=ws)},names:["bonne","Bonne (Werner lat_1=90)"]};const ys={OBLIQUE:{forward:function(t,i){let{x:s,y:h}=i;s+=t.long0;const n=Math.cos(s),e=Math.sin(h),r=Math.cos(h);i.x=ht(Math.atan2(r*Math.sin(s),t.sphip*r*n+t.cphip*e)+t.lamp),i.y=Math.asin(t.sphip*e-t.cphip*r*n);const a=t.obliqueProjection.forward(i);return t.isIdentity&&(a.x*=b,a.y*=b),a},inverse:function(t,i){t.isIdentity&&(i.x*=w,i.y*=w);const s=t.obliqueProjection.inverse(i);let{x:h,y:n}=s;if(h<Number.MAX_VALUE){h-=t.lamp;const s=Math.cos(h),e=Math.sin(n),r=Math.cos(n);i.x=Math.atan2(r*Math.sin(h),t.sphip*r*s-t.cphip*e),i.y=Math.asin(t.sphip*e+t.cphip*r*s)}return i.x=ht(i.x+t.long0),i}},TRANSVERSE:{forward:function(t,i){let{x:s,y:h}=i;s+=t.long0;const n=Math.cos(h),e=Math.cos(s);i.x=ht(Math.atan2(n*Math.sin(s),Math.sin(h))+t.lamp),i.y=Math.asin(-1*n*e);const r=t.obliqueProjection.forward(i);return t.isIdentity&&(r.x*=b,r.y*=b),r},inverse:function(t,i){t.isIdentity&&(i.x*=w,i.y*=w);const s=t.obliqueProjection.inverse(i);let{x:h,y:n}=s;if(h<Number.MAX_VALUE){const s=Math.cos(n);h-=t.lamp,i.x=Math.atan2(s*Math.sin(h),-1*Math.sin(n)),i.y=Math.asin(s*Math.cos(h))}return i.x=ht(i.x+t.long0),i}}},Es={ROTATE:{o_alpha:"oAlpha",o_lon_c:"oLongC",o_lat_c:"oLatC"},NEW_POLE:{o_lat_p:"oLatP",o_lon_p:"oLongP"},NEW_EQUATOR:{o_lon_1:"oLong1",o_lat_1:"oLat1",o_lon_2:"oLong2",o_lat_2:"oLat2"}};var Ss={init:function(){if(this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.title=this.title||"General Oblique Transformation",this.isIdentity=at.includes(this.o_proj),!this.o_proj)throw new Error("Missing parameter: o_proj");if("ob_tran"===this.o_proj)throw new Error("Invalid value for o_proj: "+this.o_proj);const t=Gt(this.projStr.replace("+proj=ob_tran","").replace("+o_proj=","+proj=").trim());if(!t)throw new Error("Invalid parameter: o_proj. Unknown projection "+this.o_proj);let i;t.long0=0,this.obliqueProjection=t;const s=Object.keys(Es),h=t=>{if(void 0===this[t])return;const i=parseFloat(this[t])*w;if(isNaN(i))throw new Error("Invalid value for "+t+": "+this[t]);return i};for(let t=0;t<s.length;t++){const n=Es[s[t]],e=Object.entries(n);if(e.some((([t])=>void 0!==this[t]))){i=n;for(let t=0;t<e.length;t++){const[i,s]=e[t],n=h(i);if(void 0===n)throw new Error("Missing parameter: "+i+".");this[s]=n}break}}if(!i)throw new Error("No valid parameters provided for ob_tran projection.");const{lamp:n,phip:e}=function(t,i){let s,h;if(i===Es.ROTATE){let i=t.oLongC,n=t.oLatC,e=t.oAlpha;if(Math.abs(Math.abs(n)-z)<=M)throw new Error("Invalid value for o_lat_c: "+t.o_lat_c+" should be < 90°");h=i+Math.atan2(-1*Math.cos(e),-1*Math.sin(e)*Math.sin(n)),s=Math.asin(Math.cos(n)*Math.sin(e))}else if(i===Es.NEW_POLE)h=t.oLongP,s=t.oLatP;else{let i=t.oLong1,n=t.oLat1,e=t.oLong2,r=t.oLat2,a=Math.abs(n);if(Math.abs(n)>z-M)throw new Error("Invalid value for o_lat_1: "+t.o_lat_1+" should be < 90°");if(Math.abs(r)>z-M)throw new Error("Invalid value for o_lat_2: "+t.o_lat_2+" should be < 90°");if(Math.abs(n-r)<M)throw new Error("Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2");if(a<M)throw new Error("Invalid value for o_lat_1: o_lat_1 should be different from zero");h=Math.atan2(Math.cos(n)*Math.sin(r)*Math.cos(i)-Math.sin(n)*Math.cos(r)*Math.cos(e),Math.sin(n)*Math.cos(r)*Math.sin(e)-Math.cos(n)*Math.sin(r)*Math.sin(i)),s=Math.atan(-1*Math.cos(h-i)/Math.tan(n))}return{lamp:h,phip:s}}(this,i);this.lamp=n,Math.abs(e)>M?(this.cphip=Math.cos(e),this.sphip=Math.sin(e),this.projectionType=ys.OBLIQUE):this.projectionType=ys.TRANSVERSE},forward:function(t){return this.projectionType.forward(this,t)},inverse:function(t){return this.projectionType.inverse(this,t)},names:["General Oblique Transformation","General_Oblique_Transformation","ob_tran"]};const Ps=Object.assign((function(t,i,s){var h,n,e,r=!1;return void 0===i?(n=Wt(t),h=Dt,r=!0):(void 0!==i.x||Array.isArray(i))&&(s=i,n=Wt(t),h=Dt,r=!0),h||(h=Wt(t)),n||(n=Wt(i)),s?jt(h,n,s):(e={forward:function(t,i){return jt(h,n,t,i)},inverse:function(t,i){return jt(n,h,t,i)}},r&&(e.oProj=n),e)}),{defaultDatum:"WGS84",Proj:Gt,WGS84:new Gt("WGS84"),Point:si,toPoint:Ot,defs:$,nadgrid:function(t,i,s){return i instanceof ArrayBuffer?function(t,i,s){var h=!0;void 0!==s&&!1===s.includeErrorFields&&(h=!1);var n=new DataView(i),e=function(t){var i=t.getInt32(8,!1);return 11!==i&&(11!==(i=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}(n),r=function(t,i){return{nFields:t.getInt32(8,i),nSubgridFields:t.getInt32(24,i),nSubgrids:t.getInt32(40,i),shiftType:yt(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,i),fromSemiMinorAxis:t.getFloat64(136,i),toSemiMajorAxis:t.getFloat64(152,i),toSemiMinorAxis:t.getFloat64(168,i)}}(n,e),a=function(t,i,s,h){for(var n=176,e=[],r=0;r<i.nSubgrids;r++){var a=St(t,n,s),o=Pt(t,n,a,s,h),u=Math.round(1+(a.upperLongitude-a.lowerLongitude)/a.longitudeInterval),c=Math.round(1+(a.upperLatitude-a.lowerLatitude)/a.latitudeInterval);e.push({ll:[xt(a.lowerLongitude),xt(a.lowerLatitude)],del:[xt(a.longitudeInterval),xt(a.latitudeInterval)],lim:[u,c],count:a.gridNodeCount,cvs:Et(o)});var l=16;!1===h&&(l=8),n+=176+a.gridNodeCount*l}return e}(n,r,e,h),o={header:r,subgrids:a};return zt[t]=o,o}(t,i,s):{ready:Mt(t,i)}},transform:Lt,mgrs:Ht,version:"__VERSION__"});!function(t){t.Proj.projections.add(ui),t.Proj.projections.add(vi),t.Proj.projections.add(mi),t.Proj.projections.add(gi),t.Proj.projections.add(Mi),t.Proj.projections.add(wi),t.Proj.projections.add(xi),t.Proj.projections.add(yi),t.Proj.projections.add(Ei),t.Proj.projections.add(Ii),t.Proj.projections.add(Oi),t.Proj.projections.add(Li),t.Proj.projections.add(Di),t.Proj.projections.add(ji),t.Proj.projections.add(Wi),t.Proj.projections.add(Ui),t.Proj.projections.add(Vi),t.Proj.projections.add(qi),t.Proj.projections.add(Bi),t.Proj.projections.add(Xi),t.Proj.projections.add(Hi),t.Proj.projections.add(Yi),t.Proj.projections.add(Ji),t.Proj.projections.add(Zi),t.Proj.projections.add(Qi),t.Proj.projections.add(as),t.Proj.projections.add(os),t.Proj.projections.add(cs),t.Proj.projections.add(ls),t.Proj.projections.add(_s),t.Proj.projections.add(xs),t.Proj.projections.add(Ss)}(Ps);var Gs={ASSUME_TOUCH:!1,DEFAULT_MAX_ZOOM:42,DEFAULT_MIN_ZOOM:0,DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD:.5,DEFAULT_TILE_SIZE:256,DEFAULT_WMS_VERSION:"1.3.0",ENABLE_CANVAS:!0,ENABLE_PROJ4JS:!0,ENABLE_RASTER_REPROJECTION:!0,ENABLE_WEBGL:!0,DEBUG_WEBGL:!0,INITIAL_ATLAS_SIZE:256,MAX_ATLAS_SIZE:-1,MOUSEWHEELZOOM_MAXDELTA:1,OVERVIEWMAP_MAX_RATIO:.75,OVERVIEWMAP_MIN_RATIO:.1,RASTER_REPROJECTION_MAX_SOURCE_TILES:100,RASTER_REPROJECTION_MAX_SUBDIVISION:10,RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH:.25,SIMPLIFY_TOLERANCE:.5,WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK:1024,VERSION:"v4.6.5",inherits:function(t,i){t.prototype=Object.create(i.prototype),t.prototype.constructor=t},nullFunction:function(){},getUid:function(t){return t.ol_uid||(t.ol_uid=++Gs.uidCounter_)},uidCounter_:0},ks="accuracy",Ns="accuracyGeometry",Cs="altitude",As="altitudeAccuracy",Rs="heading",Is="position",Ts="projection",Os="speed",Fs="tracking",Ls="trackingOptions",Ds="propertychange",js={};js.assign="function"==typeof Object.assign?Object.assign:function(t,i){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),h=1,n=arguments.length;h<n;++h){var e=arguments[h];if(null!=e)for(var r in e)e.hasOwnProperty(r)&&(s[r]=e[r])}return s},js.clear=function(t){for(var i in t)delete t[i]},js.getValues=function(t){var i=[];for(var s in t)i.push(t[s]);return i},js.isEmpty=function(t){var i;for(i in t)return!1;return!i};var Ws={bindListener_:function(t){var i=function(i){var s=t.listener,h=t.bindTo||t.target;return t.callOnce&&Ws.unlistenByKey(t),s.call(h,i)};return t.boundListener=i,i},findListener_:function(t,i,s,h){for(var n,e=0,r=t.length;e<r;++e)if((n=t[e]).listener===i&&n.bindTo===s)return h&&(n.deleteIndex=e),n},getListeners:function(t,i){var s=t.ol_lm;return s?s[i]:void 0},getListenerMap_:function(t){var i=t.ol_lm;return i||(i=t.ol_lm={}),i},removeListeners_:function(t,i){var s=Ws.getListeners(t,i);if(s){for(var h=0,n=s.length;h<n;++h)t.removeEventListener(i,s[h].boundListener),js.clear(s[h]);s.length=0;var e=t.ol_lm;e&&(delete e[i],0===Object.keys(e).length&&delete t.ol_lm)}},listen:function(t,i,s,h,n){var e=Ws.getListenerMap_(t),r=e[i];r||(r=e[i]=[]);var a=Ws.findListener_(r,s,h,!1);return a?n||(a.callOnce=!1):(t.addEventListener(i,Ws.bindListener_(a={bindTo:h,callOnce:!!n,listener:s,target:t,type:i})),r.push(a)),a},listenOnce:function(t,i,s,h){return Ws.listen(t,i,s,h,!0)},unlisten:function(t,i,s,h){var n=Ws.getListeners(t,i);if(n){var e=Ws.findListener_(n,s,h,!0);e&&Ws.unlistenByKey(e)}},unlistenByKey:function(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var i=Ws.getListeners(t.target,t.type);if(i){var s="deleteIndex"in t?t.deleteIndex:i.indexOf(t);-1!==s&&i.splice(s,1),0===i.length&&Ws.removeListeners_(t.target,t.type)}js.clear(t)}},unlistenAll:function(t){var i=Ws.getListenerMap_(t);for(var s in i)Ws.removeListeners_(t,s)}},Us=function(){};Us.prototype.disposed_=!1,Us.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},Us.prototype.disposeInternal=Gs.nullFunction;var Vs=function(t){this.type=t,this.target=null};Vs.prototype.preventDefault=Vs.prototype.stopPropagation=function(){this.propagationStopped=!0},Vs.stopPropagation=function(t){t.stopPropagation()},Vs.preventDefault=function(t){t.preventDefault()};var qs=function(){Us.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}};Gs.inherits(qs,Us),qs.prototype.addEventListener=function(t,i){var s=this.listeners_[t];s||(s=this.listeners_[t]=[]),-1===s.indexOf(i)&&s.push(i)},qs.prototype.dispatchEvent=function(t){var i="string"==typeof t?new Vs(t):t,s=i.type;i.target=this;var h,n=this.listeners_[s];if(n){s in this.dispatching_||(this.dispatching_[s]=0,this.pendingRemovals_[s]=0),++this.dispatching_[s];for(var e=0,r=n.length;e<r;++e)if(!1===n[e].call(this,i)||i.propagationStopped){h=!1;break}if(--this.dispatching_[s],0===this.dispatching_[s]){var a=this.pendingRemovals_[s];for(delete this.pendingRemovals_[s];a--;)this.removeEventListener(s,Gs.nullFunction);delete this.dispatching_[s]}return h}},qs.prototype.disposeInternal=function(){Ws.unlistenAll(this)},qs.prototype.getListeners=function(t){return this.listeners_[t]},qs.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},qs.prototype.removeEventListener=function(t,i){var s=this.listeners_[t];if(s){var h=s.indexOf(i);t in this.pendingRemovals_?(s[h]=Gs.nullFunction,++this.pendingRemovals_[t]):(s.splice(h,1),0===s.length&&delete this.listeners_[t])}};var Bs="change",Xs="clear",Hs="click",Ys="dblclick",Js="error",Zs="keydown",Ks="keypress",$s="load",Qs="mousewheel",th="resize",ih="wheel",sh=function(){qs.call(this),this.revision_=0};Gs.inherits(sh,qs),sh.unByKey=function(t){if(Array.isArray(t))for(var i=0,s=t.length;i<s;++i)Ws.unlistenByKey(t[i]);else Ws.unlistenByKey(t)},sh.prototype.changed=function(){++this.revision_,this.dispatchEvent(Bs)},sh.prototype.getRevision=function(){return this.revision_},sh.prototype.on=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),e=0;e<h;++e)n[e]=Ws.listen(this,t[e],i,s);return n}return Ws.listen(this,t,i,s)},sh.prototype.once=function(t,i,s){if(Array.isArray(t)){for(var h=t.length,n=new Array(h),e=0;e<h;++e)n[e]=Ws.listenOnce(this,t[e],i,s);return n}return Ws.listenOnce(this,t,i,s)},sh.prototype.un=function(t,i,s){if(Array.isArray(t))for(var h=0,n=t.length;h<n;++h)Ws.unlisten(this,t[h],i,s);else Ws.unlisten(this,t,i,s)};var hh=function(t){sh.call(this),Gs.getUid(this),this.values_={},void 0!==t&&this.setProperties(t)};Gs.inherits(hh,sh),hh.changeEventTypeCache_={},hh.getChangeEventType=function(t){return hh.changeEventTypeCache_.hasOwnProperty(t)?hh.changeEventTypeCache_[t]:hh.changeEventTypeCache_[t]="change:"+t},hh.prototype.get=function(t){var i;return this.values_.hasOwnProperty(t)&&(i=this.values_[t]),i},hh.prototype.getKeys=function(){return Object.keys(this.values_)},hh.prototype.getProperties=function(){return js.assign({},this.values_)},hh.prototype.notify=function(t,i){var s;s=hh.getChangeEventType(t),this.dispatchEvent(new hh.Event(s,t,i)),this.dispatchEvent(new hh.Event(s=Ds,t,i))},hh.prototype.set=function(t,i,s){if(s)this.values_[t]=i;else{var h=this.values_[t];this.values_[t]=i,h!==i&&this.notify(t,h)}},hh.prototype.setProperties=function(t,i){var s;for(s in t)this.set(s,t[s],i)},hh.prototype.unset=function(t,i){if(t in this.values_){var s=this.values_[t];delete this.values_[t],i||this.notify(t,s)}},hh.Event=function(t,i,s){Vs.call(this,t),this.key=i,this.oldValue=s},Gs.inherits(hh.Event,Vs);var nh=function(t){var i=Gs.VERSION?Gs.VERSION.split("-")[0]:"latest";this.message="Assertion failed. See https://openlayers.org/en/"+i+"/doc/errors/#"+t+" for details.",this.code=t,this.name="AssertionError"};Gs.inherits(nh,Error);var eh=function(t,i){if(!t)throw new nh(i)},rh={clamp:function(t,i,s){return Math.min(Math.max(t,i),s)}};rh.cosh="cosh"in Math?Math.cosh:function(t){var i=Math.exp(t);return(i+1/i)/2},rh.roundUpToPowerOfTwo=function(t){return eh(0<t,29),Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},rh.squaredSegmentDistance=function(t,i,s,h,n,e){var r=n-s,a=e-h;if(0!==r||0!==a){var o=((t-s)*r+(i-h)*a)/(r*r+a*a);o>1?(s=n,h=e):o>0&&(s+=r*o,h+=a*o)}return rh.squaredDistance(t,i,s,h)},rh.squaredDistance=function(t,i,s,h){var n=s-t,e=h-i;return n*n+e*e},rh.solveLinearSystem=function(t){for(var i=t.length,s=0;s<i;s++){for(var h=s,n=Math.abs(t[s][s]),e=s+1;e<i;e++){var r=Math.abs(t[e][s]);r>n&&(n=r,h=e)}if(0===n)return null;var a=t[h];t[h]=t[s],t[s]=a;for(var o=s+1;o<i;o++)for(var u=-t[o][s]/t[s][s],c=s;c<i+1;c++)s==c?t[o][c]=0:t[o][c]+=u*t[s][c]}for(var l=new Array(i),f=i-1;f>=0;f--){l[f]=t[f][i]/t[f][f];for(var d=f-1;d>=0;d--)t[d][i]-=t[d][f]*l[f]}return l},rh.toDegrees=function(t){return 180*t/Math.PI},rh.toRadians=function(t){return t*Math.PI/180},rh.modulo=function(t,i){var s=t%i;return s*i<0?s+i:s},rh.lerp=function(t,i,s){return t+s*(i-t)};var ah="Point",oh="LineString",uh="LinearRing",ch="Polygon",lh="MultiPoint",fh="MultiLineString",dh="MultiPolygon",vh="GeometryCollection",mh="Circle",ph=function(t){this.radius=t};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Latitude/longitude spherical geodesy formulae taken from
|
|
5
5
|
* http://www.movable-type.co.uk/scripts/latlong.html
|
|
6
6
|
* Licensed under CC-BY-3.0.
|
|
7
|
-
*/ph.prototype.geodesicArea=function(t){return ph.getArea_(t,this.radius)},ph.prototype.haversineDistance=function(t,i){return ph.getDistance_(t,i,this.radius)},ph.prototype.offset=function(t,i,s){var h=rh.toRadians(t[1]),n=rh.toRadians(t[0]),e=i/this.radius,r=Math.asin(Math.sin(h)*Math.cos(e)+Math.cos(h)*Math.sin(e)*Math.cos(s)),a=n+Math.atan2(Math.sin(s)*Math.sin(e)*Math.cos(h),Math.cos(e)-Math.sin(h)*Math.sin(r));return[rh.toDegrees(a),rh.toDegrees(r)]},ph.DEFAULT_RADIUS=6371008.8,ph.getLength=function(t,i){var s,h,n,e,r,a,o=i||{},u=o.radius||ph.DEFAULT_RADIUS,c=o.projection||"EPSG:3857",l=(t=t.clone().transform(c,"EPSG:4326")).getType(),f=0;switch(l){case ah:case lh:break;case oh:case uh:s=t.getCoordinates(),f=ph.getLength_(s,u);break;case fh:case ch:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)f+=ph.getLength_(s[n],u);break;case dh:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)for(r=0,a=(h=s[n]).length;r<a;++r)f+=ph.getLength_(h[r],u);break;case vh:var d=t.getGeometries();for(n=0,e=d.length;n<e;++n)f+=ph.getLength(d[n],i);break;default:throw new Error("Unsupported geometry type: "+l)}return f},ph.getLength_=function(t,i){for(var s=0,h=0,n=t.length;h<n-1;++h)s+=ph.getDistance_(t[h],t[h+1],i);return s},ph.getDistance_=function(t,i,s){var h=rh.toRadians(t[1]),n=rh.toRadians(i[1]),e=(n-h)/2,r=rh.toRadians(i[0]-t[0])/2,a=Math.sin(e)*Math.sin(e)+Math.sin(r)*Math.sin(r)*Math.cos(h)*Math.cos(n);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))},ph.getArea=function(t,i){var s,h,n,e,r,a,o=i||{},u=o.radius||ph.DEFAULT_RADIUS,c=o.projection||"EPSG:3857",l=(t=t.clone().transform(c,"EPSG:4326")).getType(),f=0;switch(l){case ah:case lh:case oh:case fh:case uh:break;case ch:for(s=t.getCoordinates(),f=Math.abs(ph.getArea_(s[0],u)),n=1,e=s.length;n<e;++n)f-=Math.abs(ph.getArea_(s[n],u));break;case dh:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)for(h=s[n],f+=Math.abs(ph.getArea_(h[0],u)),r=1,a=h.length;r<a;++r)f-=Math.abs(ph.getArea_(h[r],u));break;case vh:var d=t.getGeometries();for(n=0,e=d.length;n<e;++n)f+=ph.getArea(d[n],i);break;default:throw new Error("Unsupported geometry type: "+l)}return f},ph.getArea_=function(t,i){for(var s=0,h=t.length,n=t[h-1][0],e=t[h-1][1],r=0;r<h;r++){var a=t[r][0],o=t[r][1];s+=rh.toRadians(a-n)*(2+Math.sin(rh.toRadians(e))+Math.sin(rh.toRadians(o))),n=a,e=o}return s*i*i/2};var _h={binarySearch:function(t,i,s){for(var h,n,e=s||_h.numberSafeCompareFunction,r=0,a=t.length,o=!1;r<a;)(n=+e(t[h=r+(a-r>>1)],i))<0?r=h+1:(a=h,o=!n);return o?r:~r},numberSafeCompareFunction:function(t,i){return t>i?1:t<i?-1:0},includes:function(t,i){return t.indexOf(i)>=0},linearFindNearest:function(t,i,s){var h,n=t.length;if(t[0]<=i)return 0;if(i<=t[n-1])return n-1;if(s>0){for(h=1;h<n;++h)if(t[h]<i)return h-1}else if(s<0){for(h=1;h<n;++h)if(t[h]<=i)return h}else for(h=1;h<n;++h){if(t[h]==i)return h;if(t[h]<i)return t[h-1]-i<i-t[h]?h-1:h}return n-1},reverseSubArray:function(t,i,s){for(;i<s;){var h=t[i];t[i]=t[s],t[s]=h,++i,--s}},extend:function(t,i){var s,h=Array.isArray(i)?i:[i],n=h.length;for(s=0;s<n;s++)t[t.length]=h[s]},remove:function(t,i){var s=t.indexOf(i),h=s>-1;return h&&t.splice(s,1),h},find:function(t,i){for(var s,h=t.length>>>0,n=0;n<h;n++)if(i(s=t[n],n,t))return s;return null},equals:function(t,i){var s=t.length;if(s!==i.length)return!1;for(var h=0;h<s;h++)if(t[h]!==i[h])return!1;return!0},stableSort:function(t,i){var s,h=t.length,n=Array(t.length);for(s=0;s<h;s++)n[s]={index:s,value:t[s]};for(n.sort((function(t,s){return i(t.value,s.value)||t.index-s.index})),s=0;s<t.length;s++)t[s]=n[s].value},findIndex:function(t,i){var s;return t.every((function(h,n){return s=n,!i(h,n,t)}))?-1:s},isSorted:function(t,i,s){var h=i||_h.numberSafeCompareFunction;return t.every((function(i,n){if(0===n)return!0;var e=h(t[n-1],i);return!(e>0||s&&0===e)}))}},gh="top-left",zh={boundingExtent:function(t){for(var i=zh.createEmpty(),s=0,h=t.length;s<h;++s)zh.extendCoordinate(i,t[s]);return i},boundingExtentXYs_:function(t,i,s){var h=Math.min.apply(null,t),n=Math.min.apply(null,i),e=Math.max.apply(null,t),r=Math.max.apply(null,i);return zh.createOrUpdate(h,n,e,r,s)},buffer:function(t,i,s){return s?(s[0]=t[0]-i,s[1]=t[1]-i,s[2]=t[2]+i,s[3]=t[3]+i,s):[t[0]-i,t[1]-i,t[2]+i,t[3]+i]},clone:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t.slice()},closestSquaredDistanceXY:function(t,i,s){var h,n;return(h=i<t[0]?t[0]-i:t[2]<i?i-t[2]:0)*h+(n=s<t[1]?t[1]-s:t[3]<s?s-t[3]:0)*n},containsCoordinate:function(t,i){return zh.containsXY(t,i[0],i[1])},containsExtent:function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]},containsXY:function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]},coordinateRelationship:function(t,i){var s=i[0],h=i[1],n=0;return s<t[0]?n|=16:s>t[2]&&(n|=4),h<t[1]?n|=8:h>t[3]&&(n|=2),0===n&&(n=1),n},createEmpty:function(){return[1/0,1/0,-1/0,-1/0]},createOrUpdate:function(t,i,s,h,n){return n?(n[0]=t,n[1]=i,n[2]=s,n[3]=h,n):[t,i,s,h]},createOrUpdateEmpty:function(t){return zh.createOrUpdate(1/0,1/0,-1/0,-1/0,t)},createOrUpdateFromCoordinate:function(t,i){var s=t[0],h=t[1];return zh.createOrUpdate(s,h,s,h,i)},createOrUpdateFromCoordinates:function(t,i){var s=zh.createOrUpdateEmpty(i);return zh.extendCoordinates(s,t)},createOrUpdateFromFlatCoordinates:function(t,i,s,h,n){var e=zh.createOrUpdateEmpty(n);return zh.extendFlatCoordinates(e,t,i,s,h)},createOrUpdateFromRings:function(t,i){var s=zh.createOrUpdateEmpty(i);return zh.extendRings(s,t)},equals:function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]},extend:function(t,i){return i[0]<t[0]&&(t[0]=i[0]),i[2]>t[2]&&(t[2]=i[2]),i[1]<t[1]&&(t[1]=i[1]),i[3]>t[3]&&(t[3]=i[3]),t},extendCoordinate:function(t,i){i[0]<t[0]&&(t[0]=i[0]),i[0]>t[2]&&(t[2]=i[0]),i[1]<t[1]&&(t[1]=i[1]),i[1]>t[3]&&(t[3]=i[1])},extendCoordinates:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)zh.extendCoordinate(t,i[s]);return t},extendFlatCoordinates:function(t,i,s,h,n){for(;s<h;s+=n)zh.extendXY(t,i[s],i[s+1]);return t},extendRings:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)zh.extendCoordinates(t,i[s]);return t},extendXY:function(t,i,s){t[0]=Math.min(t[0],i),t[1]=Math.min(t[1],s),t[2]=Math.max(t[2],i),t[3]=Math.max(t[3],s)},forEachCorner:function(t,i,s){var h;return(h=i.call(s,zh.getBottomLeft(t)))||(h=i.call(s,zh.getBottomRight(t)))||(h=i.call(s,zh.getTopRight(t)))?h:(h=i.call(s,zh.getTopLeft(t)))||!1},getArea:function(t){var i=0;return zh.isEmpty(t)||(i=zh.getWidth(t)*zh.getHeight(t)),i},getBottomLeft:function(t){return[t[0],t[1]]},getBottomRight:function(t){return[t[2],t[1]]},getCenter:function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]},getCorner:function(t,i){var s;return"bottom-left"===i?s=zh.getBottomLeft(t):"bottom-right"===i?s=zh.getBottomRight(t):i===gh?s=zh.getTopLeft(t):"top-right"===i?s=zh.getTopRight(t):eh(!1,13),s},getEnlargedArea:function(t,i){var s=Math.min(t[0],i[0]),h=Math.min(t[1],i[1]);return(Math.max(t[2],i[2])-s)*(Math.max(t[3],i[3])-h)},getForViewAndSize:function(t,i,s,h,n){var e=i*h[0]/2,r=i*h[1]/2,a=Math.cos(s),o=Math.sin(s),u=e*a,c=e*o,l=r*a,f=r*o,d=t[0],v=t[1],m=d-u+f,p=d-u-f,_=d+u-f,g=d+u+f,z=v-c-l,M=v-c+l,w=v+c+l,b=v+c-l;return zh.createOrUpdate(Math.min(m,p,_,g),Math.min(z,M,w,b),Math.max(m,p,_,g),Math.max(z,M,w,b),n)},getHeight:function(t){return t[3]-t[1]},getIntersectionArea:function(t,i){var s=zh.getIntersection(t,i);return zh.getArea(s)},getIntersection:function(t,i,s){var h=s||zh.createEmpty();return zh.intersects(t,i)&&(h[0]=t[0]>i[0]?t[0]:i[0],h[1]=t[1]>i[1]?t[1]:i[1],h[2]=t[2]<i[2]?t[2]:i[2],h[3]=t[3]<i[3]?t[3]:i[3]),h},getMargin:function(t){return zh.getWidth(t)+zh.getHeight(t)},getSize:function(t){return[t[2]-t[0],t[3]-t[1]]},getTopLeft:function(t){return[t[0],t[3]]},getTopRight:function(t){return[t[2],t[3]]},getWidth:function(t){return t[2]-t[0]},intersects:function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]},isEmpty:function(t){return t[2]<t[0]||t[3]<t[1]},returnOrUpdate:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t},scaleFromCenter:function(t,i){var s=(t[2]-t[0])/2*(i-1),h=(t[3]-t[1])/2*(i-1);t[0]-=s,t[2]+=s,t[1]-=h,t[3]+=h},intersectsSegment:function(t,i,s){var h=!1,n=zh.coordinateRelationship(t,i),e=zh.coordinateRelationship(t,s);if(1===n||1===e)h=!0;else{var r,a,o=t[0],u=t[1],c=t[2],l=t[3],f=s[0],d=s[1],v=(d-i[1])/(f-i[0]);2&e&&!(2&n)&&(h=(r=f-(d-l)/v)>=o&&r<=c),h||!(4&e)||4&n||(h=(a=d-(f-c)*v)>=u&&a<=l),h||!(8&e)||8&n||(h=(r=f-(d-u)/v)>=o&&r<=c),h||!(16&e)||16&n||(h=(a=d-(f-o)*v)>=u&&a<=l)}return h},applyTransform:function(t,i,s){var h=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return i(h,h,2),zh.boundingExtentXYs_([h[0],h[2],h[4],h[6]],[h[1],h[3],h[5],h[7]],s)}},Mh="XY",wh="XYM",bh="XYZM",xh={TRUE:function(){return!0},FALSE:function(){return!1}},yh=function(t,i,s,h,n,e){var r,a=e||[],o=0;for(r=i;r<s;r+=h){var u=t[r],c=t[r+1];a[o++]=n[0]*u+n[2]*c+n[4],a[o++]=n[1]*u+n[3]*c+n[5]}return e&&a.length!=o&&(a.length=o),a},Eh=function(t,i,s,h,n,e,r){for(var a=r||[],o=Math.cos(n),u=Math.sin(n),c=e[0],l=e[1],f=0,d=i;d<s;d+=h){var v=t[d]-c,m=t[d+1]-l;a[f++]=c+v*o-m*u,a[f++]=l+v*u+m*o;for(var p=d+2;p<d+h;++p)a[f++]=t[p]}return r&&a.length!=f&&(a.length=f),a},Sh=function(t,i,s,h,n,e,r,a){for(var o=a||[],u=r[0],c=r[1],l=0,f=i;f<s;f+=h){var d=t[f+1]-c;o[l++]=u+n*(t[f]-u),o[l++]=c+e*d;for(var v=f+2;v<f+h;++v)o[l++]=t[v]}return a&&o.length!=l&&(o.length=l),o},Ph=function(t,i,s,h,n,e,r){var a,o,u=r||[],c=0;for(a=i;a<s;a+=h)for(u[c++]=t[a]+n,u[c++]=t[a+1]+e,o=a+2;o<a+h;++o)u[c++]=t[o];return r&&u.length!=c&&(u.length=c),u},Gh={DEGREES:"degrees",FEET:"ft",METERS:"m",TILE_PIXELS:"tile-pixels",USFEET:"us-ft",METERS_PER_UNIT:{}};Gh.METERS_PER_UNIT[Gh.DEGREES]=2*Math.PI*6370997/360,Gh.METERS_PER_UNIT[Gh.FEET]=.3048,Gh.METERS_PER_UNIT[Gh.METERS]=1,Gh.METERS_PER_UNIT[Gh.USFEET]=1200/3937;var kh={cache_:null,set:function(t){kh.cache_=t},get:function(){return kh.cache_||window.proj4}},Nh=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(Gs.ENABLE_PROJ4JS){var s=kh.get();if("function"==typeof s){var h=s.defs(i);void 0!==h&&(void 0!==h.axis&&void 0===t.axisOrientation&&(this.axisOrientation_=h.axis),void 0===t.metersPerUnit&&(this.metersPerUnit_=h.to_meter),void 0===t.units&&(this.units_=h.units))}}};Nh.prototype.canWrapX=function(){return this.canWrapX_},Nh.prototype.getCode=function(){return this.code_},Nh.prototype.getExtent=function(){return this.extent_},Nh.prototype.getUnits=function(){return this.units_},Nh.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Gh.METERS_PER_UNIT[this.units_]},Nh.prototype.getWorldExtent=function(){return this.worldExtent_},Nh.prototype.getAxisOrientation=function(){return this.axisOrientation_},Nh.prototype.isGlobal=function(){return this.global_},Nh.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Nh.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Nh.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Nh.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Nh.prototype.setWorldExtent=function(t){this.worldExtent_=t},Nh.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Nh.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Ch={Projection_:function(t){Nh.call(this,{code:t,units:Gh.METERS,extent:Ch.EXTENT,global:!0,worldExtent:Ch.WORLD_EXTENT,getPointResolution:function(t,i){return t/rh.cosh(i[1]/Ch.RADIUS)}})}};Gs.inherits(Ch.Projection_,Nh),Ch.RADIUS=6378137,Ch.HALF_SIZE=Math.PI*Ch.RADIUS,Ch.EXTENT=[-Ch.HALF_SIZE,-Ch.HALF_SIZE,Ch.HALF_SIZE,Ch.HALF_SIZE],Ch.WORLD_EXTENT=[-180,-85,180,85],Ch.PROJECTIONS=[new Ch.Projection_("EPSG:3857"),new Ch.Projection_("EPSG:102100"),new Ch.Projection_("EPSG:102113"),new Ch.Projection_("EPSG:900913"),new Ch.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ch.Projection_("urn:ogc:def:crs:EPSG::3857"),new Ch.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")],Ch.fromEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,e=i;void 0===e&&(e=n>2?t.slice():new Array(h));for(var r=Ch.HALF_SIZE,a=0;a<h;a+=n){e[a]=r*t[a]/180;var o=Ch.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));o>r?o=r:o<-r&&(o=-r),e[a+1]=o}return e},Ch.toEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,e=i;void 0===e&&(e=n>2?t.slice():new Array(h));for(var r=0;r<h;r+=n)e[r]=180*t[r]/Ch.HALF_SIZE,e[r+1]=360*Math.atan(Math.exp(t[r+1]/Ch.RADIUS))/Math.PI-90;return e};var Ah={Projection_:function(t,i){Nh.call(this,{code:t,units:Gh.DEGREES,extent:Ah.EXTENT,axisOrientation:i,global:!0,metersPerUnit:Ah.METERS_PER_UNIT,worldExtent:Ah.EXTENT})}};Gs.inherits(Ah.Projection_,Nh),Ah.RADIUS=6378137,Ah.EXTENT=[-180,-90,180,90],Ah.METERS_PER_UNIT=Math.PI*Ah.RADIUS/180,Ah.PROJECTIONS=[new Ah.Projection_("CRS:84"),new Ah.Projection_("EPSG:4326","neu"),new Ah.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new Ah.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Ah.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ah.Projection_("urn:ogc:def:crs:OGC:2:84"),new Ah.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ah.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Rh={cache_:{},clear:function(){Rh.cache_={}},get:function(t){return Rh.cache_[t]||null},add:function(t,i){Rh.cache_[t]=i}},Ih={cache_:{},clear:function(){Ih.cache_={}},add:function(t,i,s){var h=t.getCode(),n=i.getCode(),e=Ih.cache_;h in e||(e[h]={}),e[h][n]=s},remove:function(t,i){var s=t.getCode(),h=i.getCode(),n=Ih.cache_,e=n[s][h];return delete n[s][h],Ws.isEmpty(n[s])&&delete n[s],e},get:function(t,i){var s,h=Ih.cache_;return t in h&&i in h[t]&&(s=h[t][i]),s}},Th={};Th.METERS_PER_UNIT=Gh.METERS_PER_UNIT,Th.SPHERE_=new ph(ph.DEFAULT_RADIUS),Gs.ENABLE_PROJ4JS&&(Th.setProj4=function(t){kh.set(t)}),Th.getPointResolution=function(t,i,s,h){var n,e=(t=Th.get(t)).getPointResolutionFunc();if(e)n=e(i,s);else if(t.getUnits()==Gh.DEGREES&&!h||h==Gh.DEGREES)n=i;else{var r=Th.getTransformFromProjections(t,Th.get("EPSG:4326")),a=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];a=r(a,a,2),n=(Th.SPHERE_.haversineDistance(a.slice(0,2),a.slice(2,4))+Th.SPHERE_.haversineDistance(a.slice(4,6),a.slice(6,8)))/2;var o=h?Gh.METERS_PER_UNIT[h]:t.getMetersPerUnit();void 0!==o&&(n/=o)}return n},Th.addEquivalentProjections=function(t){Th.addProjections(t),t.forEach((function(i){t.forEach((function(t){i!==t&&Ih.add(i,t,Th.cloneTransform)}))}))},Th.addEquivalentTransforms=function(t,i,s,h){t.forEach((function(t){i.forEach((function(i){Ih.add(t,i,s),Ih.add(i,t,h)}))}))},Th.addProjection=function(t){Rh.add(t.getCode(),t),Ih.add(t,t,Th.cloneTransform)},Th.addProjections=function(t){t.forEach(Th.addProjection)},Th.clearAllProjections=function(){Rh.clear(),Ih.clear()},Th.createProjection=function(t,i){return t?"string"==typeof t?Th.get(t):t:Th.get(i)},Th.addCoordinateTransforms=function(t,i,s,h){var n=Th.get(t),e=Th.get(i);Ih.add(n,e,Th.createTransformFromCoordinateTransform(s)),Ih.add(e,n,Th.createTransformFromCoordinateTransform(h))},Th.createTransformFromCoordinateTransform=function(t){return function(i,s,h){var n,e,r,a=i.length,o=void 0!==h?h:2,u=void 0!==s?s:new Array(a);for(e=0;e<a;e+=o)for(n=t([i[e],i[e+1]]),u[e]=n[0],u[e+1]=n[1],r=o-1;r>=2;--r)u[e+r]=i[e+r];return u}},Th.fromLonLat=function(t,i){return Th.transform(t,"EPSG:4326",void 0!==i?i:"EPSG:3857")},Th.toLonLat=function(t,i){var s=Th.transform(t,void 0!==i?i:"EPSG:3857","EPSG:4326"),h=s[0];return(h<-180||h>180)&&(s[0]=rh.modulo(h+180,360)-180),s},Th.get=function(t){var i=null;if(t instanceof Nh)i=t;else if("string"==typeof t){var s=t;if(i=Rh.get(s),Gs.ENABLE_PROJ4JS&&!i){var h=kh.get();"function"==typeof h&&void 0!==h.defs(s)&&(i=new Nh({code:s}),Th.addProjection(i))}}return i},Th.equivalent=function(t,i){if(t===i)return!0;var s=t.getUnits()===i.getUnits();return(t.getCode()===i.getCode()||Th.getTransformFromProjections(t,i)===Th.cloneTransform)&&s},Th.getTransform=function(t,i){var s=Th.get(t),h=Th.get(i);return Th.getTransformFromProjections(s,h)},Th.getTransformFromProjections=function(t,i){var s=t.getCode(),h=i.getCode(),n=Ih.get(s,h);if(Gs.ENABLE_PROJ4JS&&!n){var e=kh.get();if("function"==typeof e){var r=e.defs(s),a=e.defs(h);if(void 0!==r&&void 0!==a){if(r===a)Th.addEquivalentProjections([i,t]);else{var o=e(h,s);Th.addCoordinateTransforms(i,t,o.forward,o.inverse)}n=Ih.get(s,h)}}}return n||(n=Th.identityTransform),n},Th.identityTransform=function(t,i){if(void 0!==i&&t!==i){for(var s=0,h=t.length;s<h;++s)i[s]=t[s];t=i}return t},Th.cloneTransform=function(t,i){var s;if(void 0!==i){for(var h=0,n=t.length;h<n;++h)i[h]=t[h];s=i}else s=t.slice();return s},Th.transform=function(t,i,s){return Th.getTransform(i,s)(t,void 0,t.length)},Th.transformExtent=function(t,i,s){var h=Th.getTransform(i,s);return zh.applyTransform(t,h)},Th.transformWithProjections=function(t,i,s){return Th.getTransformFromProjections(i,s)(t)},Th.addCommon=function(){Th.addEquivalentProjections(Ch.PROJECTIONS),Th.addEquivalentProjections(Ah.PROJECTIONS),Th.addEquivalentTransforms(Ah.PROJECTIONS,Ch.PROJECTIONS,Ch.fromEPSG4326,Ch.toEPSG4326)},Th.addCommon();var Oh={};Oh.tmp_=new Array(6),Oh.create=function(){return[1,0,0,1,0,0]},Oh.reset=function(t){return Oh.set(t,1,0,0,1,0,0)},Oh.multiply=function(t,i){var s=t[0],h=t[1],n=t[2],e=t[3],r=t[4],a=t[5],o=i[0],u=i[1],c=i[2],l=i[3],f=i[4],d=i[5];return t[0]=s*o+n*u,t[1]=h*o+e*u,t[2]=s*c+n*l,t[3]=h*c+e*l,t[4]=s*f+n*d+r,t[5]=h*f+e*d+a,t},Oh.set=function(t,i,s,h,n,e,r){return t[0]=i,t[1]=s,t[2]=h,t[3]=n,t[4]=e,t[5]=r,t},Oh.setFromArray=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t},Oh.apply=function(t,i){var s=i[0],h=i[1];return i[0]=t[0]*s+t[2]*h+t[4],i[1]=t[1]*s+t[3]*h+t[5],i},Oh.rotate=function(t,i){var s=Math.cos(i),h=Math.sin(i);return Oh.multiply(t,Oh.set(Oh.tmp_,s,h,-h,s,0,0))},Oh.scale=function(t,i,s){return Oh.multiply(t,Oh.set(Oh.tmp_,i,0,0,s,0,0))},Oh.translate=function(t,i,s){return Oh.multiply(t,Oh.set(Oh.tmp_,1,0,0,1,i,s))},Oh.compose=function(t,i,s,h,n,e,r,a){var o=Math.sin(e),u=Math.cos(e);return t[0]=h*u,t[1]=n*o,t[2]=-h*o,t[3]=n*u,t[4]=r*h*u-a*h*o+i,t[5]=r*n*o+a*n*u+s,t},Oh.invert=function(t){var i=Oh.determinant(t);eh(0!==i,32);var s=t[0],h=t[1],n=t[2],e=t[3],r=t[4],a=t[5];return t[0]=e/i,t[1]=-h/i,t[2]=-n/i,t[3]=s/i,t[4]=(n*a-e*r)/i,t[5]=-(s*a-h*r)/i,t},Oh.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var Fh=function(){hh.call(this),this.extent_=zh.createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.tmpTransform_=Oh.create()};Gs.inherits(Fh,hh),Fh.prototype.clone=function(){},Fh.prototype.closestPointXY=function(){},Fh.prototype.getClosestPoint=function(t,i){var s=i||[NaN,NaN];return this.closestPointXY(t[0],t[1],s,1/0),s},Fh.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},Fh.prototype.computeExtent=function(){},Fh.prototype.containsXY=xh.FALSE,Fh.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),zh.returnOrUpdate(this.extent_,t)},Fh.prototype.rotate=function(){},Fh.prototype.scale=function(){},Fh.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},Fh.prototype.getSimplifiedGeometry=function(){},Fh.prototype.getType=function(){},Fh.prototype.applyTransform=function(){},Fh.prototype.intersectsExtent=function(){},Fh.prototype.translate=function(){},Fh.prototype.transform=function(t,i){var s=this.tmpTransform_,h=(t=Th.get(t)).getUnits()==Gh.TILE_PIXELS?function(h,n,e){var r=t.getExtent(),a=t.getWorldExtent(),o=zh.getHeight(a)/zh.getHeight(r);return Oh.compose(s,a[0],a[3],o,-o,0,0,0),yh(h,0,h.length,e,s,n),Th.getTransform(t,i)(h,n,e)}:Th.getTransform(t,i);return this.applyTransform(h),this};var Lh=function(){Fh.call(this),this.layout=Mh,this.stride=2,this.flatCoordinates=null};Gs.inherits(Lh,Fh),Lh.getLayoutForStride_=function(t){var i;return 2==t?i=Mh:3==t?i="XYZ":4==t&&(i=bh),i},Lh.getStrideForLayout=function(t){var i;return t==Mh?i=2:"XYZ"==t||t==wh?i=3:t==bh&&(i=4),i},Lh.prototype.containsXY=xh.FALSE,Lh.prototype.computeExtent=function(t){return zh.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},Lh.prototype.getCoordinates=function(){},Lh.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},Lh.prototype.getFlatCoordinates=function(){return this.flatCoordinates},Lh.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},Lh.prototype.getLayout=function(){return this.layout},Lh.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(Ws.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];var s=this.getSimplifiedGeometryInternal(t);return s.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[i]=s,s):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},Lh.prototype.getSimplifiedGeometryInternal=function(){return this},Lh.prototype.getStride=function(){return this.stride},Lh.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=Lh.getStrideForLayout(t),this.layout=t,this.flatCoordinates=i},Lh.prototype.setCoordinates=function(){},Lh.prototype.setLayout=function(t,i,s){var h;if(t)h=Lh.getStrideForLayout(t);else{var n;for(n=0;n<s;++n){if(0===i.length)return this.layout=Mh,void(this.stride=2);i=i[0]}t=Lh.getLayoutForStride_(h=i.length)}this.layout=t,this.stride=h},Lh.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},Lh.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();Eh(s,0,s.length,h,t,i,s),this.changed()}},Lh.prototype.scale=function(t,i,s){var h=i;void 0===h&&(h=t);var n=s;n||(n=zh.getCenter(this.getExtent()));var e=this.getFlatCoordinates();if(e){var r=this.getStride();Sh(e,0,e.length,r,t,h,n,e),this.changed()}},Lh.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();Ph(s,0,s.length,h,t,i,s),this.changed()}},Lh.transform2D=function(t,i,s){var h=t.getFlatCoordinates();if(h){var n=t.getStride();return yh(h,0,h.length,n,i,s)}return null};var Dh={linearRing:function(t,i,s,h){for(var n=0,e=t[s-h],r=t[s-h+1];i<s;i+=h){var a=t[i],o=t[i+1];n+=r*a-e*o,e=a,r=o}return n/2},linearRings:function(t,i,s,h){var n,e,r=0;for(n=0,e=s.length;n<e;++n){var a=s[n];r+=Dh.linearRing(t,i,a,h),i=a}return r},linearRingss:function(t,i,s,h){var n,e,r=0;for(n=0,e=s.length;n<e;++n){var a=s[n];r+=Dh.linearRings(t,i,a,h),i=a[a.length-1]}return r}},Wh={point:function(t,i,s,h,n,e,r){var a,o,u=t[i],c=t[i+1],l=t[s]-u,f=t[s+1]-c;if(0===l&&0===f)o=i;else{var d=((n-u)*l+(e-c)*f)/(l*l+f*f);if(d>1)o=s;else{if(d>0){for(a=0;a<h;++a)r[a]=rh.lerp(t[i+a],t[s+a],d);return void(r.length=h)}o=i}}for(a=0;a<h;++a)r[a]=t[o+a];r.length=h},getMaxSquaredDelta:function(t,i,s,h,n){var e=t[i],r=t[i+1];for(i+=h;i<s;i+=h){var a=t[i],o=t[i+1],u=rh.squaredDistance(e,r,a,o);u>n&&(n=u),e=a,r=o}return n},getsMaxSquaredDelta:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];n=Wh.getMaxSquaredDelta(t,i,a,h,n),i=a}return n},getssMaxSquaredDelta:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];n=Wh.getsMaxSquaredDelta(t,i,a,h,n),i=a[a.length-1]}return n},getClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){if(i==s)return u;var l,f;if(0===n){if((f=rh.squaredDistance(r,a,t[i],t[i+1]))<u){for(l=0;l<h;++l)o[l]=t[i+l];return o.length=h,f}return u}for(var d=c||[NaN,NaN],v=i+h;v<s;)if(Wh.point(t,v-h,v,h,r,a,d),(f=rh.squaredDistance(r,a,d[0],d[1]))<u){for(u=f,l=0;l<h;++l)o[l]=d[l];o.length=h,v+=h}else v+=h*Math.max((Math.sqrt(f)-Math.sqrt(u))/n|0,1);if(e&&(Wh.point(t,s-h,i,h,r,a,d),(f=rh.squaredDistance(r,a,d[0],d[1]))<u)){for(u=f,l=0;l<h;++l)o[l]=d[l];o.length=h}return u},getsClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d=c||[NaN,NaN];for(l=0,f=s.length;l<f;++l){var v=s[l];u=Wh.getClosestPoint(t,i,v,h,n,e,r,a,o,u,d),i=v}return u},getssClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d=c||[NaN,NaN];for(l=0,f=s.length;l<f;++l){var v=s[l];u=Wh.getsClosestPoint(t,i,v,h,n,e,r,a,o,u,d),i=v[v.length-1]}return u}},jh={coordinate:function(t,i,s){var h,n;for(h=0,n=s.length;h<n;++h)t[i++]=s[h];return i},coordinates:function(t,i,s,h){var n,e;for(n=0,e=s.length;n<e;++n){var r,a=s[n];for(r=0;r<h;++r)t[i++]=a[r]}return i},coordinatess:function(t,i,s,h,n){var e,r,a=n||[],o=0;for(e=0,r=s.length;e<r;++e){var u=jh.coordinates(t,i,s[e],h);a[o++]=u,i=u}return a.length=o,a},coordinatesss:function(t,i,s,h,n){var e,r,a=n||[],o=0;for(e=0,r=s.length;e<r;++e){var u=jh.coordinatess(t,i,s[e],h,a[o]);a[o++]=u,i=u[u.length-1]}return a.length=o,a}},Uh={coordinates:function(t,i,s,h,n){var e,r=void 0!==n?n:[],a=0;for(e=i;e<s;e+=h)r[a++]=t.slice(e,e+h);return r.length=a,r},coordinatess:function(t,i,s,h,n){var e,r,a=void 0!==n?n:[],o=0;for(e=0,r=s.length;e<r;++e){var u=s[e];a[o++]=Uh.coordinates(t,i,u,h,a[o]),i=u}return a.length=o,a},coordinatesss:function(t,i,s,h,n){var e,r,a=void 0!==n?n:[],o=0;for(e=0,r=s.length;e<r;++e){var u=s[e];a[o++]=Uh.coordinatess(t,i,u,h,a[o]),i=u[u.length-1]}return a.length=o,a}},Vh={lineString:function(t,i,s,h,n,e,r){var a=void 0!==r?r:[];return e||(s=Vh.radialDistance(t,i,s,h,n,a,0),t=a,i=0,h=2),a.length=Vh.douglasPeucker(t,i,s,h,n,a,0),a},douglasPeucker:function(t,i,s,h,n,e,r){var a=(s-i)/h;if(a<3){for(;i<s;i+=h)e[r++]=t[i],e[r++]=t[i+1];return r}var o=new Array(a);o[0]=1,o[a-1]=1;for(var u,c=[i,s-h],l=0;c.length>0;){var f=c.pop(),d=c.pop(),v=0,m=t[d],p=t[d+1],_=t[f],g=t[f+1];for(u=d+h;u<f;u+=h){var z=rh.squaredSegmentDistance(t[u],t[u+1],m,p,_,g);z>v&&(l=u,v=z)}v>n&&(o[(l-i)/h]=1,d+h<l&&c.push(d,l),l+h<f&&c.push(l,f))}for(u=0;u<a;++u)o[u]&&(e[r++]=t[i+u*h],e[r++]=t[i+u*h+1]);return r},douglasPeuckers:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o];r=Vh.douglasPeucker(t,i,c,h,n,e,r),a.push(r),i=c}return r},douglasPeuckerss:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o],l=[];r=Vh.douglasPeuckers(t,i,c,h,n,e,r,l),a.push(l),i=c[c.length-1]}return r},radialDistance:function(t,i,s,h,n,e,r){if(s<=i+h){for(;i<s;i+=h)e[r++]=t[i],e[r++]=t[i+1];return r}var a=t[i],o=t[i+1];e[r++]=a,e[r++]=o;var u=a,c=o;for(i+=h;i<s;i+=h)rh.squaredDistance(a,o,u=t[i],c=t[i+1])>n&&(e[r++]=u,e[r++]=c,a=u,o=c);return u==a&&c==o||(e[r++]=u,e[r++]=c),r},snap:function(t,i){return i*Math.round(t/i)},quantize:function(t,i,s,h,n,e,r){if(i==s)return r;var a,o,u=Vh.snap(t[i],n),c=Vh.snap(t[i+1],n);i+=h,e[r++]=u,e[r++]=c;do{if(a=Vh.snap(t[i],n),o=Vh.snap(t[i+1],n),(i+=h)==s)return e[r++]=a,e[r++]=o,r}while(a==u&&o==c);for(;i<s;){var l,f;if(l=Vh.snap(t[i],n),f=Vh.snap(t[i+1],n),i+=h,l!=a||f!=o){var d=a-u,v=o-c,m=l-u,p=f-c;d*p==v*m&&(d<0&&m<d||d==m||d>0&&m>d)&&(v<0&&p<v||v==p||v>0&&p>v)?(a=l,o=f):(e[r++]=a,e[r++]=o,u=a,c=o,a=l,o=f)}}return e[r++]=a,e[r++]=o,r},quantizes:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o];r=Vh.quantize(t,i,c,h,n,e,r),a.push(r),i=c}return r},quantizess:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o],l=[];r=Vh.quantizes(t,i,c,h,n,e,r,l),a.push(l),i=c[c.length-1]}return r}},qh=function(t,i){Lh.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};Gs.inherits(qh,Lh),qh.prototype.clone=function(){var t=new qh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},qh.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wh.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wh.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,s,h))},qh.prototype.getArea=function(){return Dh.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},qh.prototype.getCoordinates=function(){return Uh.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},qh.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Vh.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new qh(null);return s.setFlatCoordinates(Mh,i),s},qh.prototype.getType=function(){return uh},qh.prototype.intersectsExtent=function(){},qh.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jh.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},qh.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Bh=function(t,i){Lh.call(this),this.setCoordinates(t,i)};Gs.inherits(Bh,Lh),Bh.prototype.clone=function(){var t=new Bh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},Bh.prototype.closestPointXY=function(t,i,s,h){var n=this.flatCoordinates,e=rh.squaredDistance(t,i,n[0],n[1]);if(e<h){var r,a=this.stride;for(r=0;r<a;++r)s[r]=n[r];return s.length=a,e}return h},Bh.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},Bh.prototype.computeExtent=function(t){return zh.createOrUpdateFromCoordinate(this.flatCoordinates,t)},Bh.prototype.getType=function(){return ah},Bh.prototype.intersectsExtent=function(t){return zh.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])},Bh.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jh.coordinate(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},Bh.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Xh={linearRingContainsExtent:function(t,i,s,h,n){return!zh.forEachCorner(n,(function(n){return!Xh.linearRingContainsXY(t,i,s,h,n[0],n[1])}))},linearRingContainsXY:function(t,i,s,h,n,e){for(var r=0,a=t[s-h],o=t[s-h+1];i<s;i+=h){var u=t[i],c=t[i+1];o<=e?c>e&&(u-a)*(e-o)-(n-a)*(c-o)>0&&r++:c<=e&&(u-a)*(e-o)-(n-a)*(c-o)<0&&r--,a=u,o=c}return 0!==r},linearRingsContainsXY:function(t,i,s,h,n,e){if(0===s.length)return!1;if(!Xh.linearRingContainsXY(t,i,s[0],h,n,e))return!1;var r,a;for(r=1,a=s.length;r<a;++r)if(Xh.linearRingContainsXY(t,s[r-1],s[r],h,n,e))return!1;return!0},linearRingssContainsXY:function(t,i,s,h,n,e){if(0===s.length)return!1;var r,a;for(r=0,a=s.length;r<a;++r){var o=s[r];if(Xh.linearRingsContainsXY(t,i,o,h,n,e))return!0;i=o[o.length-1]}return!1}},Hh={linearRings:function(t,i,s,h,n,e,r){for(var a,o,u,c,l,f,d,v=n[e+1],m=[],p=0,_=s.length;p<_;++p){var g=s[p];for(c=t[g-h],f=t[g-h+1],a=i;a<g;a+=h)l=t[a],d=t[a+1],(v<=f&&d<=v||f<=v&&v<=d)&&m.push(u=(v-f)/(d-f)*(l-c)+c),c=l,f=d}var z=NaN,M=-1/0;for(m.sort(_h.numberSafeCompareFunction),c=m[0],a=1,o=m.length;a<o;++a){l=m[a];var w=Math.abs(l-c);w>M&&Xh.linearRingsContainsXY(t,i,s,h,u=(c+l)/2,v)&&(z=u,M=w),c=l}return isNaN(z)&&(z=n[e]),r?(r.push(z,v,M),r):[z,v,M]},linearRingss:function(t,i,s,h,n){var e,r,a=[];for(e=0,r=s.length;e<r;++e){var o=s[e];a=Hh.linearRings(t,i,o,h,n,2*e,a),i=o[o.length-1]}return a}},Yh=function(t,i,s,h,n,e){for(var r,a=[t[i],t[i+1]],o=[];i+h<s;i+=h){if(o[0]=t[i+h],o[1]=t[i+h+1],r=n.call(e,a,o))return r;a[0]=o[0],a[1]=o[1]}return!1},Jh={lineString:function(t,i,s,h,n){var e=zh.extendFlatCoordinates(zh.createEmpty(),t,i,s,h);return!!zh.intersects(n,e)&&(!!zh.containsExtent(n,e)||e[0]>=n[0]&&e[2]<=n[2]||e[1]>=n[1]&&e[3]<=n[3]||Yh(t,i,s,h,(function(t,i){return zh.intersectsSegment(n,t,i)})))},lineStrings:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){if(Jh.lineString(t,i,s[e],h,n))return!0;i=s[e]}return!1},linearRing:function(t,i,s,h,n){return!!(Jh.lineString(t,i,s,h,n)||Xh.linearRingContainsXY(t,i,s,h,n[0],n[1])||Xh.linearRingContainsXY(t,i,s,h,n[0],n[3])||Xh.linearRingContainsXY(t,i,s,h,n[2],n[1])||Xh.linearRingContainsXY(t,i,s,h,n[2],n[3]))},linearRings:function(t,i,s,h,n){if(!Jh.linearRing(t,i,s[0],h,n))return!1;if(1===s.length)return!0;var e,r;for(e=1,r=s.length;e<r;++e)if(Xh.linearRingContainsExtent(t,s[e-1],s[e],h,n))return!1;return!0},linearRingss:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];if(Jh.linearRings(t,i,a,h,n))return!0;i=a[a.length-1]}return!1}},Zh=function(t,i,s,h){for(;i<s-h;){var n;for(n=0;n<h;++n){var e=t[i+n];t[i+n]=t[s-h+n],t[s-h+n]=e}i+=h,s-=h}},Kh={linearRingIsClockwise:function(t,i,s,h){for(var n=0,e=t[s-h],r=t[s-h+1];i<s;i+=h){var a=t[i],o=t[i+1];n+=(a-e)*(o+r),e=a,r=o}return n>0},linearRingsAreOriented:function(t,i,s,h,n){var e,r,a=void 0!==n&&n;for(e=0,r=s.length;e<r;++e){var o=s[e],u=Kh.linearRingIsClockwise(t,i,o,h);if(0===e){if(a&&u||!a&&!u)return!1}else if(a&&!u||!a&&u)return!1;i=o}return!0},linearRingssAreOriented:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e)if(!Kh.linearRingsAreOriented(t,i,s[e],h,n))return!1;return!0},orientLinearRings:function(t,i,s,h,n){var e,r,a=void 0!==n&&n;for(e=0,r=s.length;e<r;++e){var o=s[e],u=Kh.linearRingIsClockwise(t,i,o,h);(0===e?a&&u||!a&&!u:a&&!u||!a&&u)&&Zh(t,i,o,h),i=o}return i},orientLinearRingss:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e)i=Kh.orientLinearRings(t,i,s[e],h,n);return i}},$h=function(t,i){Lh.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,i)};Gs.inherits($h,Lh),$h.prototype.appendLinearRing=function(t){this.flatCoordinates?_h.extend(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},$h.prototype.clone=function(){var t=new $h(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},$h.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wh.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wh.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,s,h))},$h.prototype.containsXY=function(t,i){return Xh.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)},$h.prototype.getArea=function(){return Dh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},$h.prototype.getCoordinates=function(t){var i;return void 0!==t?(i=this.getOrientedFlatCoordinates().slice(),Kh.orientLinearRings(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,Uh.coordinatess(i,0,this.ends_,this.stride)},$h.prototype.getEnds=function(){return this.ends_},$h.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=zh.getCenter(this.getExtent());this.flatInteriorPoint_=Hh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},$h.prototype.getInteriorPoint=function(){return new Bh(this.getFlatInteriorPoint(),wh)},$h.prototype.getLinearRingCount=function(){return this.ends_.length},$h.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t)return null;var i=new qh(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),i},$h.prototype.getLinearRings=function(){var t,i,s=this.layout,h=this.flatCoordinates,n=this.ends_,e=[],r=0;for(t=0,i=n.length;t<i;++t){var a=n[t],o=new qh(null);o.setFlatCoordinates(s,h.slice(r,a)),e.push(o),r=a}return e},$h.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Kh.linearRingsAreOriented(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Kh.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},$h.prototype.getSimplifiedGeometryInternal=function(t){var i=[],s=[];i.length=Vh.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var h=new $h(null);return h.setFlatCoordinates(Mh,i,s),h},$h.prototype.getType=function(){return ch},$h.prototype.intersectsExtent=function(t){return Jh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},$h.prototype.setCoordinates=function(t,i){if(t){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var s=jh.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===s.length?0:s[s.length-1],this.changed()}else this.setFlatCoordinates(Mh,null,this.ends_)},$h.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i),this.ends_=s,this.changed()},$h.circular=function(t,i,s,h){var n,e=h||32,r=[];for(n=0;n<e;++n)_h.extend(r,t.offset(i,s,2*Math.PI*n/e));r.push(r[0],r[1]);var a=new $h(null);return a.setFlatCoordinates(Mh,r,[r.length]),a},$h.fromExtent=function(t){var i=t[0],s=t[1],h=t[2],n=t[3],e=[i,s,i,n,h,n,h,s,i,s],r=new $h(null);return r.setFlatCoordinates(Mh,e,[e.length]),r},$h.fromCircle=function(t,i,s){for(var h=i||32,n=t.getStride(),e=t.getLayout(),r=new $h(null,e),a=n*(h+1),o=new Array(a),u=0;u<a;u++)o[u]=0;return r.setFlatCoordinates(e,o,[o.length]),$h.makeRegular(r,t.getCenter(),t.getRadius(),s),r},$h.makeRegular=function(t,i,s,h){for(var n,e,r=t.getFlatCoordinates(),a=t.getLayout(),o=t.getStride(),u=t.getEnds(),c=r.length/o-1,l=h||0,f=0;f<=c;++f)e=f*o,n=l+2*rh.modulo(f,c)*Math.PI/c,r[e]=i[0]+s*Math.cos(n),r[e+1]=i[1]+s*Math.sin(n);t.setFlatCoordinates(a,r,u)};var Qh={ONE:1,SRC_ALPHA:770,COLOR_ATTACHMENT0:36064,COLOR_BUFFER_BIT:16384,TRIANGLES:4,TRIANGLE_STRIP:5,ONE_MINUS_SRC_ALPHA:771,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,CULL_FACE:2884,BLEND:3042,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,RGBA:6408,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,LINK_STATUS:35714,LINEAR:9729,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE0:33984,CLAMP_TO_EDGE:33071,COMPILE_STATUS:35713,FRAMEBUFFER:36160,CONTEXT_IDS_:["experimental-webgl","webgl","webkit-3d","moz-webgl"],getContext:function(t,i){var s,h,n=Qh.CONTEXT_IDS_.length;for(h=0;h<n;++h)try{if(s=t.getContext(Qh.CONTEXT_IDS_[h],i))return s}catch(t){}return null}},tn={},sn="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";tn.FIREFOX=-1!==sn.indexOf("firefox"),tn.SAFARI=-1!==sn.indexOf("safari")&&-1==sn.indexOf("chrom"),tn.WEBKIT=-1!==sn.indexOf("webkit")&&-1==sn.indexOf("edge"),tn.MAC=-1!==sn.indexOf("macintosh"),tn.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1,tn.CANVAS_LINE_DASH=!1,tn.CANVAS=Gs.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(tn.CANVAS_LINE_DASH=!0),!0)}catch(t){return!1}}(),tn.DEVICE_ORIENTATION="DeviceOrientationEvent"in window,tn.GEOLOCATION="geolocation"in navigator,tn.TOUCH=Gs.ASSUME_TOUCH||"ontouchstart"in window,tn.POINTER="PointerEvent"in window,tn.MSPOINTER=!!navigator.msPointerEnabled,function(){if(Gs.ENABLE_WEBGL){var t,i=!1,s=[];if("WebGLRenderingContext"in window)try{var h=document.createElement("CANVAS"),n=Qh.getContext(h,{failIfMajorPerformanceCaveat:!0});n&&(i=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE),s=n.getSupportedExtensions())}catch(t){}tn.WEBGL=i,Gs.WEBGL_EXTENSIONS=s,Gs.WEBGL_MAX_TEXTURE_SIZE=t}}();var hn=function(t){hh.call(this);var i=t||{};this.position_=null,this.transform_=Th.identityTransform,this.sphere_=new ph(Ah.RADIUS),this.watchId_=void 0,js.listen(this,hh.getChangeEventType(Ts),this.handleProjectionChanged_,this),js.listen(this,hh.getChangeEventType(Fs),this.handleTrackingChanged_,this),void 0!==i.projection&&this.setProjection(i.projection),void 0!==i.trackingOptions&&this.setTrackingOptions(i.trackingOptions),this.setTracking(void 0!==i.tracking&&i.tracking)};Gs.inherits(hn,hh),hn.prototype.disposeInternal=function(){this.setTracking(!1),hh.prototype.disposeInternal.call(this)},hn.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=Th.getTransformFromProjections(Th.get("EPSG:4326"),t),this.position_&&this.set(Is,this.transform_(this.position_)))},hn.prototype.handleTrackingChanged_=function(){if(tn.GEOLOCATION){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},hn.prototype.positionChange_=function(t){var i=t.coords;this.set(ks,i.accuracy),this.set(Cs,null===i.altitude?void 0:i.altitude),this.set(As,null===i.altitudeAccuracy?void 0:i.altitudeAccuracy),this.set(Rs,null===i.heading?void 0:rh.toRadians(i.heading)),this.position_?(this.position_[0]=i.longitude,this.position_[1]=i.latitude):this.position_=[i.longitude,i.latitude];var s=this.transform_(this.position_);this.set(Is,s),this.set(Os,null===i.speed?void 0:i.speed);var h=$h.circular(this.sphere_,this.position_,i.accuracy);h.applyTransform(this.transform_),this.set(Ns,h),this.changed()},hn.prototype.positionError_=function(t){t.type=Js,this.setTracking(!1),this.dispatchEvent(t)},hn.prototype.getAccuracy=function(){return this.get(ks)},hn.prototype.getAccuracyGeometry=function(){return this.get(Ns)||null},hn.prototype.getAltitude=function(){return this.get(Cs)},hn.prototype.getAltitudeAccuracy=function(){return this.get(As)},hn.prototype.getHeading=function(){return this.get(Rs)},hn.prototype.getPosition=function(){return this.get(Is)},hn.prototype.getProjection=function(){return this.get(Ts)},hn.prototype.getSpeed=function(){return this.get(Os)},hn.prototype.getTracking=function(){return this.get(Fs)},hn.prototype.getTrackingOptions=function(){return this.get(Ls)},hn.prototype.setProjection=function(t){this.set(Ts,Th.get(t))},hn.prototype.setTracking=function(t){this.set(Fs,t)},hn.prototype.setTrackingOptions=function(t){this.set(Ls,t)};var nn="add",en="remove",rn=function(t,i){if(hh.call(this),this.unique_=!!(i||{}).unique,this.array_=t||[],this.unique_)for(var s=0,h=this.array_.length;s<h;++s)this.assertUnique_(this.array_[s],s);this.updateLength_()};Gs.inherits(rn,hh),rn.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},rn.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i)this.push(t[i]);return this},rn.prototype.forEach=function(t,i){for(var s=i?t.bind(i):t,h=this.array_,n=0,e=h.length;n<e;++n)s(h[n],n,h)},rn.prototype.getArray=function(){return this.array_},rn.prototype.item=function(t){return this.array_[t]},rn.prototype.getLength=function(){return this.get(rn.Property_.LENGTH)},rn.prototype.insertAt=function(t,i){this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new rn.Event(nn,i))},rn.prototype.pop=function(){return this.removeAt(this.getLength()-1)},rn.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var i=this.getLength();return this.insertAt(i,t),this.getLength()},rn.prototype.remove=function(t){var i,s,h=this.array_;for(i=0,s=h.length;i<s;++i)if(h[i]===t)return this.removeAt(i)},rn.prototype.removeAt=function(t){var i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new rn.Event(en,i)),i},rn.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){this.unique_&&this.assertUnique_(i,t);var h=this.array_[t];this.array_[t]=i,this.dispatchEvent(new rn.Event(en,h)),this.dispatchEvent(new rn.Event(nn,i))}else{var n;for(n=s;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,i)}},rn.prototype.updateLength_=function(){this.set(rn.Property_.LENGTH,this.array_.length)},rn.prototype.assertUnique_=function(t,i){for(var s=0,h=this.array_.length;s<h;++s)if(this.array_[s]===t&&s!==i)throw new nh(58)},rn.Property_={LENGTH:"length"},Gs.inherits(rn.Event=function(t,i){Vs.call(this,t),this.element=i},Vs);var an=function(t,i,s){Vs.call(this,t),this.map=i,this.frameState=void 0!==s?s:null};Gs.inherits(an,Vs);var on=function(t,i,s,h,n){an.call(this,t,i,n),this.originalEvent=s,this.pixel=i.getEventPixel(s),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==h&&h};Gs.inherits(on,an),on.prototype.preventDefault=function(){an.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},on.prototype.stopPropagation=function(){an.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var un={SINGLECLICK:"singleclick",CLICK:Hs,DBLCLICK:Ys,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},cn=function(t,i,s,h,n){on.call(this,t,i,s.originalEvent,h,n),this.pointerEvent=s};Gs.inherits(cn,on);var ln="pointermove",fn="pointerdown",dn=function(t,i){this.dispatcher=t,this.mapping_=i};dn.prototype.getEvents=function(){return Object.keys(this.mapping_)},dn.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var vn=function(t){dn.call(this,t,{mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout}),this.pointerMap=t.pointerMap,this.lastTouches=[]};Gs.inherits(vn,dn),vn.POINTER_ID=1,vn.POINTER_TYPE="mouse",vn.DEDUP_DIST=25,vn.prototype.isEventSimulatedFromTouch_=function(t){for(var i,s=this.lastTouches,h=t.clientX,n=t.clientY,e=0,r=s.length;e<r&&(i=s[e]);e++){var a=Math.abs(h-i[0]),o=Math.abs(n-i[1]);if(a<=vn.DEDUP_DIST&&o<=vn.DEDUP_DIST)return!0}return!1},vn.prepareEvent=function(t,i){var s=i.cloneEvent(t,t),h=s.preventDefault;return s.preventDefault=function(){t.preventDefault(),h()},s.pointerId=vn.POINTER_ID,s.isPrimary=!0,s.pointerType=vn.POINTER_TYPE,s},vn.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){vn.POINTER_ID.toString()in this.pointerMap&&this.cancel(t);var i=vn.prepareEvent(t,this.dispatcher);this.pointerMap[vn.POINTER_ID.toString()]=t,this.dispatcher.down(i,t)}},vn.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}},vn.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[vn.POINTER_ID.toString()];if(i&&i.button===t.button){var s=vn.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t),this.cleanupMouse()}}},vn.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}},vn.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}},vn.prototype.cancel=function(t){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t),this.cleanupMouse()},vn.prototype.cleanupMouse=function(){delete this.pointerMap[vn.POINTER_ID.toString()]};var mn=function(t){dn.call(this,t,{MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture}),this.pointerMap=t.pointerMap,this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};Gs.inherits(mn,dn),mn.prototype.prepareEvent_=function(t){var i=t;return"number"==typeof t.pointerType&&((i=this.dispatcher.cloneEvent(t,t)).pointerType=this.POINTER_TYPES[t.pointerType]),i},mn.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},mn.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)},mn.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)},mn.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t),this.cleanup(t.pointerId)},mn.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)},mn.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)},mn.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t),this.cleanup(t.pointerId)},mn.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)},mn.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var pn=function(t){dn.call(this,t,{pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture})};Gs.inherits(pn,dn),pn.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var _n=function(t,i,s){Vs.call(this,t),this.originalEvent=i;var h=s||{};this.buttons=this.getButtons_(h),this.pressure=this.getPressure_(h,this.buttons),this.bubbles="bubbles"in h&&h.bubbles,this.cancelable="cancelable"in h&&h.cancelable,this.view="view"in h?h.view:null,this.detail="detail"in h?h.detail:null,this.screenX="screenX"in h?h.screenX:0,this.screenY="screenY"in h?h.screenY:0,this.clientX="clientX"in h?h.clientX:0,this.clientY="clientY"in h?h.clientY:0,this.ctrlKey="ctrlKey"in h&&h.ctrlKey,this.altKey="altKey"in h&&h.altKey,this.shiftKey="shiftKey"in h&&h.shiftKey,this.metaKey="metaKey"in h&&h.metaKey,this.button="button"in h?h.button:0,this.relatedTarget="relatedTarget"in h?h.relatedTarget:null,this.pointerId="pointerId"in h?h.pointerId:0,this.width="width"in h?h.width:0,this.height="height"in h?h.height:0,this.tiltX="tiltX"in h?h.tiltX:0,this.tiltY="tiltY"in h?h.tiltY:0,this.pointerType="pointerType"in h?h.pointerType:"",this.hwTimestamp="hwTimestamp"in h?h.hwTimestamp:0,this.isPrimary="isPrimary"in h&&h.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})};Gs.inherits(_n,Vs),_n.prototype.getButtons_=function(t){var i;if(t.buttons||_n.HAS_BUTTONS)i=t.buttons;else switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}return i},_n.prototype.getPressure_=function(t,i){return t.pressure?t.pressure:i?.5:0},_n.HAS_BUTTONS=!1,function(){try{var t=new MouseEvent("click",{buttons:1});_n.HAS_BUTTONS=1===t.buttons}catch(t){}}();var gn=function(t,i){dn.call(this,t,{touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel}),this.pointerMap=t.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0};Gs.inherits(gn,dn),gn.DEDUP_TIMEOUT=2500,gn.CLICK_COUNT_TIMEOUT=200,gn.POINTER_TYPE="touch",gn.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},gn.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;(0===i||1===i&&vn.POINTER_ID.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},gn.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},gn.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),gn.CLICK_COUNT_TIMEOUT)},gn.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},gn.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},gn.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);return s.pointerId=i.identifier+2,s.bubbles=!0,s.cancelable=!0,s.detail=this.clickCount_,s.button=0,s.buttons=1,s.width=i.webkitRadiusX||i.radiusX||0,s.height=i.webkitRadiusY||i.radiusY||0,s.pressure=i.webkitForce||i.force||.5,s.isPrimary=this.isPrimaryTouch_(i),s.pointerType=gn.POINTER_TYPE,s.clientX=i.clientX,s.clientY=i.clientY,s.screenX=i.screenX,s.screenY=i.screenY,s},gn.prototype.processTouches_=function(t,i){var s,h,n=Array.prototype.slice.call(t.changedTouches),e=n.length;function r(){t.preventDefault()}for(s=0;s<e;++s)(h=this.touchToPointer_(t,n[s])).preventDefault=r,i.call(this,t,h)},gn.prototype.findTouch_=function(t,i){for(var s=t.length,h=0;h<s;h++)if(t[h].identifier===i)return!0;return!1},gn.prototype.vacuumTouches_=function(t){var i=t.touches,s=Object.keys(this.pointerMap),h=s.length;if(h>=i.length){var n,e,r,a=[];for(n=0;n<h;++n)r=this.pointerMap[e=s[n]],e==vn.POINTER_ID||this.findTouch_(i,e-2)||a.push(r.out);for(n=0;n<a.length;++n)this.cancelOut_(t,a[n])}},gn.prototype.touchstart=function(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)},gn.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target},this.dispatcher.over(i,t),this.dispatcher.enter(i,t),this.dispatcher.down(i,t)},gn.prototype.touchmove=function(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)},gn.prototype.moveOverOut_=function(t,i){var s=i,h=this.pointerMap[s.pointerId];if(h){var n=h.out,e=h.outTarget;this.dispatcher.move(s,t),n&&e!==s.target&&(n.relatedTarget=s.target,s.relatedTarget=e,n.target=e,s.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(s,t)):(s.target=e,s.relatedTarget=null,this.cancelOut_(t,s))),h.out=s,h.outTarget=s.target}},gn.prototype.touchend=function(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)},gn.prototype.upOut_=function(t,i){this.dispatcher.up(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},gn.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)},gn.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},gn.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},gn.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches,s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var h=[s.clientX,s.clientY];i.push(h),setTimeout((function(){_h.remove(i,h)}),gn.DEDUP_TIMEOUT)}};var zn=function(t){qs.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()};Gs.inherits(zn,qs),zn.prototype.registerSources=function(){if(tn.POINTER)this.registerSource("native",new pn(this));else if(tn.MSPOINTER)this.registerSource("ms",new mn(this));else{var t=new vn(this);this.registerSource("mouse",t),tn.TOUCH&&this.registerSource("touch",new gn(this,t))}this.register_()},zn.prototype.registerSource=function(t,i){var s=i,h=s.getEvents();h&&(h.forEach((function(t){var i=s.getHandlerForEvent(t);i&&(this.eventMap_[t]=i.bind(s))}),this),this.eventSourceList_.push(s))},zn.prototype.register_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.addEvents_(this.eventSourceList_[i].getEvents())},zn.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.removeEvents_(this.eventSourceList_[i].getEvents())},zn.prototype.eventHandler_=function(t){var i=this.eventMap_[t.type];i&&i(t)},zn.prototype.addEvents_=function(t){t.forEach((function(t){js.listen(this.element_,t,this.eventHandler_,this)}),this)},zn.prototype.removeEvents_=function(t){t.forEach((function(t){js.unlisten(this.element_,t,this.eventHandler_,this)}),this)},zn.prototype.cloneEvent=function(t,i){for(var s,h={},n=0,e=zn.CLONE_PROPS.length;n<e;n++)h[s=zn.CLONE_PROPS[n][0]]=t[s]||i[s]||zn.CLONE_PROPS[n][1];return h},zn.prototype.down=function(t,i){this.fireEvent(fn,t,i)},zn.prototype.move=function(t,i){this.fireEvent(ln,t,i)},zn.prototype.up=function(t,i){this.fireEvent("pointerup",t,i)},zn.prototype.enter=function(t,i){t.bubbles=!1,this.fireEvent("pointerenter",t,i)},zn.prototype.leave=function(t,i){t.bubbles=!1,this.fireEvent("pointerleave",t,i)},zn.prototype.over=function(t,i){t.bubbles=!0,this.fireEvent("pointerover",t,i)},zn.prototype.out=function(t,i){t.bubbles=!0,this.fireEvent("pointerout",t,i)},zn.prototype.cancel=function(t,i){this.fireEvent("pointercancel",t,i)},zn.prototype.leaveOut=function(t,i){this.out(t,i),this.contains_(t.target,t.relatedTarget)||this.leave(t,i)},zn.prototype.enterOver=function(t,i){this.over(t,i),this.contains_(t.target,t.relatedTarget)||this.enter(t,i)},zn.prototype.contains_=function(t,i){return!(!t||!i)&&t.contains(i)},zn.prototype.makeEvent=function(t,i,s){return new _n(t,s,i)},zn.prototype.fireEvent=function(t,i,s){var h=this.makeEvent(t,i,s);this.dispatchEvent(h)},zn.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)},zn.prototype.wrapMouseEvent=function(t,i){return this.makeEvent(t,vn.prepareEvent(i,this),i)},zn.prototype.disposeInternal=function(){this.unregister_(),qs.prototype.disposeInternal.call(this)},zn.CLONE_PROPS=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];var Mn=function(t,i){qs.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*tn.DEVICE_PIXEL_RATIO:tn.DEVICE_PIXEL_RATIO,this.down_=null;var s=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new zn(s),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=js.listen(this.pointerEventHandler_,fn,this.handlePointerDown_,this),this.relayedListenerKey_=js.listen(this.pointerEventHandler_,ln,this.relayEvent_,this)};Gs.inherits(Mn,qs),Mn.prototype.emulateClick_=function(t){var i=new cn(un.CLICK,this.map_,t);this.dispatchEvent(i),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,i=new cn(un.DBLCLICK,this.map_,t),this.dispatchEvent(i)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new cn(un.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},Mn.prototype.updateActivePointers_=function(t){var i=t;i.type==un.POINTERUP||i.type==un.POINTERCANCEL?delete this.trackedTouches_[i.pointerId]:i.type==un.POINTERDOWN&&(this.trackedTouches_[i.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},Mn.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new cn(un.POINTERUP,this.map_,t);this.dispatchEvent(i),i.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(js.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},Mn.prototype.isMouseActionButton_=function(t){return 0===t.button},Mn.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new cn(un.POINTERDOWN,this.map_,t);this.dispatchEvent(i),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new zn(document),this.dragListenerKeys_.push(js.listen(this.documentPointerEventHandler_,un.POINTERMOVE,this.handlePointerMove_,this),js.listen(this.documentPointerEventHandler_,un.POINTERUP,this.handlePointerUp_,this),js.listen(this.pointerEventHandler_,un.POINTERCANCEL,this.handlePointerUp_,this)))},Mn.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var i=new cn(un.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()},Mn.prototype.relayEvent_=function(t){var i=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new cn(t.type,this.map_,t,i))},Mn.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},Mn.prototype.disposeInternal=function(){this.relayedListenerKey_&&(js.unlistenByKey(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(js.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(js.unlistenByKey),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),qs.prototype.disposeInternal.call(this)};var wn="postrender",bn="layergroup",xn="size",yn="target",En="view",Sn=function(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Sn.DROP=1/0,Sn.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,Ws.clear(this.queuedElements_)},Sn.prototype.dequeue=function(){var t=this.elements_,i=this.priorities_,s=t[0];1==t.length?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));var h=this.keyFunction_(s);return delete this.queuedElements_[h],s},Sn.prototype.enqueue=function(t){eh(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);return i!=Sn.DROP&&(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Sn.prototype.getCount=function(){return this.elements_.length},Sn.prototype.getLeftChildIndex_=function(t){return 2*t+1},Sn.prototype.getRightChildIndex_=function(t){return 2*t+2},Sn.prototype.getParentIndex_=function(t){return t-1>>1},Sn.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Sn.prototype.isEmpty=function(){return 0===this.elements_.length},Sn.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Sn.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Sn.prototype.siftUp_=function(t){for(var i=this.elements_,s=this.priorities_,h=i.length,n=i[t],e=s[t],r=t;t<h>>1;){var a=this.getLeftChildIndex_(t),o=this.getRightChildIndex_(t),u=o<h&&s[o]<s[a]?o:a;i[t]=i[u],s[t]=s[u],t=u}i[t]=n,s[t]=e,this.siftDown_(r,t)},Sn.prototype.siftDown_=function(t,i){for(var s=this.elements_,h=this.priorities_,n=s[i],e=h[i];i>t;){var r=this.getParentIndex_(i);if(!(h[r]>e))break;s[i]=s[r],h[i]=h[r],i=r}s[i]=n,h[i]=e},Sn.prototype.reprioritize=function(){var t,i,s,h=this.priorityFunction_,n=this.elements_,e=this.priorities_,r=0,a=n.length;for(i=0;i<a;++i)(s=h(t=n[i]))==Sn.DROP?delete this.queuedElements_[this.keyFunction_(t)]:(e[r]=s,n[r++]=t);n.length=r,e.length=r,this.heapify_()};var Pn=function(t,i){Sn.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}};Gs.inherits(Pn,Sn),Pn.prototype.enqueue=function(t){var i=Sn.prototype.enqueue.call(this,t);return i&&js.listen(t[0],Bs,this.handleTileChange,this),i},Pn.prototype.getTilesLoading=function(){return this.tilesLoading_},Pn.prototype.handleTileChange=function(t){var i=t.target,s=i.getState();if(2===s||3===s||4===s||5===s){js.unlisten(i,Bs,this.handleTileChange,this);var h=i.getKey();h in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[h],--this.tilesLoading_),this.tileChangeCallback_()}},Pn.prototype.loadMoreTiles=function(t,i){for(var s,h,n,e=0,r=!1;this.tilesLoading_<t&&e<i&&this.getCount()>0;)n=(h=this.dequeue()[0]).getKey(),5===(s=h.getState())?r=!0:0!==s||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++e,h.load());0===e&&r&&this.tileChangeCallback_()};var Gn={createExtent:function(t){return function(i){return i?[rh.clamp(i[0],t[0],t[2]),rh.clamp(i[1],t[1],t[3])]:void 0}},none:function(t){return t}},kn=function(t){return function(i,s,h){if(void 0!==i){var n=_h.linearFindNearest(t,i,h);n=rh.clamp(n+s,0,t.length-1);var e=Math.floor(n);return n!=e&&e<t.length-1?t[e]/Math.pow(t[e]/t[e+1],n-e):t[e]}}},Nn=function(t,i,s){return function(h,n,e){if(void 0!==h){var r=-e/2+.5,a=Math.floor(Math.log(i/h)/Math.log(t)+r),o=Math.max(a+n,0);return void 0!==s&&(o=Math.min(o,s)),i/Math.pow(t,o)}}},Cn={disable:function(t){return void 0!==t?0:void 0},none:function(t,i){return void 0!==t?t+i:void 0},createSnapToN:function(t){var i=2*Math.PI/t;return function(t,s){return void 0!==t?t=Math.floor((t+s)/i+.5)*i:void 0}},createSnapToZero:function(t){var i=t||rh.toRadians(5);return function(t,s){return void 0!==t?Math.abs(t+s)<=i?0:t+s:void 0}}},An="center",Rn="resolution",In="rotation",Tn=function(t,i,s){var h=void 0!==s?t.toFixed(s):""+t,n=h.indexOf(".");return(n=-1===n?h.length:n)>i?h:new Array(1+i-n).join("0")+h},On={add:function(t,i){return t[0]+=i[0],t[1]+=i[1],t},closestOnCircle:function(t,i){var s=i.getRadius(),h=i.getCenter(),n=h[0],e=h[1],r=t[0]-n,a=t[1]-e;0===r&&0===a&&(r=1);var o=Math.sqrt(r*r+a*a);return[n+s*r/o,e+s*a/o]},closestOnSegment:function(t,i){var s,h,n=i[0],e=i[1],r=n[0],a=n[1],o=e[0],u=e[1],c=o-r,l=u-a,f=0===c&&0===l?0:(c*(t[0]-r)+l*(t[1]-a))/(c*c+l*l||0);return f<=0?(s=r,h=a):f>=1?(s=o,h=u):(s=r+f*c,h=a+f*l),[s,h]},createStringXY:function(t){return function(i){return On.toStringXY(i,t)}},degreesToStringHDMS:function(t,i,s){var h=rh.modulo(i+180,360)-180,n=Math.abs(3600*h),e=s||0,r=Math.pow(10,e),a=Math.floor(n/3600),o=Math.floor((n-3600*a)/60),u=n-3600*a-60*o;return(u=Math.ceil(u*r)/r)>=60&&(u=0,o+=1),o>=60&&(o=0,a+=1),a+"° "+Tn(o,2)+"′ "+Tn(u,2,e)+"″"+(0==h?"":" "+t.charAt(h<0?1:0))},format:function(t,i,s){return t?i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s)):""},equals:function(t,i){for(var s=!0,h=t.length-1;h>=0;--h)if(t[h]!=i[h]){s=!1;break}return s},rotate:function(t,i){var s=Math.cos(i),h=Math.sin(i),n=t[1]*s+t[0]*h;return t[0]=t[0]*s-t[1]*h,t[1]=n,t},scale:function(t,i){return t[0]*=i,t[1]*=i,t},sub:function(t,i){return t[0]-=i[0],t[1]-=i[1],t},squaredDistance:function(t,i){var s=t[0]-i[0],h=t[1]-i[1];return s*s+h*h},distance:function(t,i){return Math.sqrt(On.squaredDistance(t,i))},squaredDistanceToSegment:function(t,i){return On.squaredDistance(t,On.closestOnSegment(t,i))},toStringHDMS:function(t,i){return t?On.degreesToStringHDMS("NS",t[1],i)+" "+On.degreesToStringHDMS("EW",t[0],i):""},toStringXY:function(t,i){return On.format(t,"{x}, {y}",i)}},Fn={easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return 1-Fn.easeIn(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?Fn.inAndOut(2*t):1-Fn.inAndOut(2*(t-.5))}},Ln=function(t){hh.call(this);var i=Ws.assign({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=Th.createProjection(i.projection,"EPSG:3857"),this.applyOptions_(i)};Gs.inherits(Ln,hh),Ln.prototype.applyOptions_=function(t){var i={};i[An]=void 0!==t.center?t.center:null;var s=Ln.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution,this.minResolution_=s.minResolution,this.zoomFactor_=s.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=s.minZoom;var h=Ln.createCenterConstraint_(t),n=s.constraint,e=Ln.createRotationConstraint_(t);this.constraints_={center:h,resolution:n,rotation:e},void 0!==t.resolution?i[Rn]=t.resolution:void 0!==t.zoom&&(i[Rn]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(i[Rn]=rh.clamp(Number(this.getResolution()||i[Rn]),this.minResolution_,this.maxResolution_))),i[In]=void 0!==t.rotation?t.rotation:0,this.setProperties(i),this.options_=t},Ln.prototype.getUpdatedOptions_=function(t){var i=Ws.assign({},this.options_);return void 0!==i.resolution?i.resolution=this.getResolution():i.zoom=this.getZoom(),i.center=this.getCenter(),i.rotation=this.getRotation(),Ws.assign({},i,t)},Ln.prototype.animate=function(t){var i,s=arguments.length;if(s>1&&"function"==typeof arguments[s-1]&&(i=arguments[s-1],--s),!this.isDef()){var h=arguments[s-1];return h.center&&this.setCenter(h.center),void 0!==h.zoom&&this.setZoom(h.zoom),void 0!==h.rotation&&this.setRotation(h.rotation),void(i&&i(!0))}for(var n=Date.now(),e=this.getCenter().slice(),r=this.getResolution(),a=this.getRotation(),o=[],u=0;u<s;++u){var c=arguments[u],l={start:n,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||Fn.inAndOut};if(c.center&&(l.sourceCenter=e,l.targetCenter=c.center,e=l.targetCenter),void 0!==c.zoom?(l.sourceResolution=r,l.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),r=l.targetResolution):c.resolution&&(l.sourceResolution=r,l.targetResolution=c.resolution,r=l.targetResolution),void 0!==c.rotation){l.sourceRotation=a;var f=rh.modulo(c.rotation-a+Math.PI,2*Math.PI)-Math.PI;l.targetRotation=a+f,a=l.targetRotation}l.callback=i,Ln.isNoopAnimation(l)?l.complete=!0:n+=l.duration,o.push(l)}this.animations_.push(o),this.setHint(0,1),this.updateAnimations_()},Ln.prototype.getAnimating=function(){return this.hints_[0]>0},Ln.prototype.getInteracting=function(){return this.hints_[1]>0},Ln.prototype.cancelAnimations=function(){this.setHint(0,-this.hints_[0]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];s[0].callback&&s[0].callback(!1)}this.animations_.length=0},Ln.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),i=!1,s=this.animations_.length-1;s>=0;--s){for(var h=this.animations_[s],n=!0,e=0,r=h.length;e<r;++e){var a=h[e];if(!a.complete){var o=a.duration>0?(t-a.start)/a.duration:1;o>=1?(a.complete=!0,o=1):n=!1;var u=a.easing(o);if(a.sourceCenter){var c=a.sourceCenter[0],l=a.sourceCenter[1];this.set(An,[c+u*(a.targetCenter[0]-c),l+u*(a.targetCenter[1]-l)])}if(a.sourceResolution&&a.targetResolution){var f=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(An,this.calculateCenterZoom(f,a.anchor)),this.set(Rn,f)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var d=1===u?rh.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(An,this.calculateCenterRotate(d,a.anchor)),this.set(In,d)}if(i=!0,!a.complete)break}}if(n){this.animations_[s]=null,this.setHint(0,-1);var v=h[0].callback;v&&v(!0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},Ln.prototype.calculateCenterRotate=function(t,i){var s,h=this.getCenter();return void 0!==h&&(On.rotate(s=[h[0]-i[0],h[1]-i[1]],t-this.getRotation()),On.add(s,i)),s},Ln.prototype.calculateCenterZoom=function(t,i){var s,h=this.getCenter(),n=this.getResolution();return void 0!==h&&void 0!==n&&(s=[i[0]-t*(i[0]-h[0])/n,i[1]-t*(i[1]-h[1])/n]),s},Ln.prototype.getSizeFromViewport_=function(){var t=[100,100],i='.ol-viewport[data-view="'+Gs.getUid(this)+'"]',s=document.querySelector(i);if(s){var h=getComputedStyle(s);t[0]=parseInt(h.width,10),t[1]=parseInt(h.height,10)}return t},Ln.prototype.constrainCenter=function(t){return this.constraints_.center(t)},Ln.prototype.constrainResolution=function(t,i,s){return this.constraints_.resolution(t,i||0,s||0)},Ln.prototype.constrainRotation=function(t,i){return this.constraints_.rotation(t,i||0)},Ln.prototype.getCenter=function(){return this.get(An)},Ln.prototype.getConstraints=function(){return this.constraints_},Ln.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},Ln.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_(),s=this.getCenter();eh(s,1);var h=this.getResolution();eh(void 0!==h,2);var n=this.getRotation();return eh(void 0!==n,3),zh.getForViewAndSize(s,h,n,i)},Ln.prototype.getMaxResolution=function(){return this.maxResolution_},Ln.prototype.getMinResolution=function(){return this.minResolution_},Ln.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},Ln.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},Ln.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},Ln.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},Ln.prototype.getProjection=function(){return this.projection_},Ln.prototype.getResolution=function(){return this.get(Rn)},Ln.prototype.getResolutions=function(){return this.resolutions_},Ln.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_(),h=zh.getWidth(t)/s[0],n=zh.getHeight(t)/s[1];return Math.max(h,n)},Ln.prototype.getResolutionForValueFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return s/Math.pow(i,t*h)}},Ln.prototype.getRotation=function(){return this.get(In)},Ln.prototype.getValueForResolutionFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return Math.log(s/t)/Math.log(i)/h}},Ln.prototype.getState=function(){var t=this.getCenter(),i=this.getProjection(),s=this.getResolution(),h=this.getRotation();return{center:t.slice(),projection:void 0!==i?i:null,resolution:s,rotation:h,zoom:this.getZoom()}},Ln.prototype.getZoom=function(){var t,i=this.getResolution();return void 0!==i&&(t=this.getZoomForResolution(i)),t},Ln.prototype.getZoomForResolution=function(t){var i,s,h=this.minZoom_||0;if(this.resolutions_){var n=_h.linearFindNearest(this.resolutions_,t,1);h=n,i=this.resolutions_[n],s=n==this.resolutions_.length-1?2:i/this.resolutions_[n+1]}else i=this.maxResolution_,s=this.zoomFactor_;return h+Math.log(i/t)/Math.log(s)},Ln.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},Ln.prototype.fit=function(t,i){var s,h=i||{},n=h.size;n||(n=this.getSizeFromViewport_()),t instanceof Lh?t.getType()===mh?(t=t.getExtent(),(s=$h.fromExtent(t)).rotate(this.getRotation(),zh.getCenter(t))):s=t:(eh(Array.isArray(t),24),eh(!zh.isEmpty(t),25),s=$h.fromExtent(t));var e,r=void 0!==h.padding?h.padding:[0,0,0,0],a=void 0===h.constrainResolution||h.constrainResolution,o=void 0!==h.nearest&&h.nearest;e=void 0!==h.minResolution?h.minResolution:void 0!==h.maxZoom?this.constrainResolution(this.maxResolution_,h.maxZoom-this.minZoom_,0):0;for(var u=s.getFlatCoordinates(),c=this.getRotation(),l=Math.cos(-c),f=Math.sin(-c),d=1/0,v=1/0,m=-1/0,p=-1/0,_=s.getStride(),g=0,z=u.length;g<z;g+=_){var M=u[g]*l-u[g+1]*f,w=u[g]*f+u[g+1]*l;d=Math.min(d,M),v=Math.min(v,w),m=Math.max(m,M),p=Math.max(p,w)}var b=this.getResolutionForExtent([d,v,m,p],[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);if(b=isNaN(b)?e:Math.max(b,e),a){var x=this.constrainResolution(b,0,0);!o&&x<b&&(x=this.constrainResolution(x,-1,0)),b=x}var y=(d+m)/2,E=(v+p)/2,S=[(y+=(r[1]-r[3])/2*b)*l-(E+=(r[0]-r[2])/2*b)*(f=-f),E*l+y*f],P=h.callback?h.callback:Gs.nullFunction;void 0!==h.duration?this.animate({resolution:b,center:S,duration:h.duration,easing:h.easing},P):(this.setResolution(b),this.setCenter(S),setTimeout(P.bind(void 0,!0),0))},Ln.prototype.centerOn=function(t,i,s){var h=this.getRotation(),n=Math.cos(-h),e=Math.sin(-h),r=t[0]*n-t[1]*e,a=t[1]*n+t[0]*e,o=this.getResolution();this.setCenter([(r+=(i[0]/2-s[0])*o)*n-(a+=(s[1]-i[1]/2)*o)*(e=-e),a*n+r*e])},Ln.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},Ln.prototype.rotate=function(t,i){if(void 0!==i){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)},Ln.prototype.setCenter=function(t){this.set(An,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setHint=function(t,i){return this.hints_[t]+=i,this.changed(),this.hints_[t]},Ln.prototype.setResolution=function(t){this.set(Rn,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setRotation=function(t){this.set(In,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},Ln.createCenterConstraint_=function(t){return void 0!==t.extent?Gn.createExtent(t.extent):Gn.none},Ln.createResolutionConstraint_=function(t){var i,s,h,n=void 0!==t.minZoom?t.minZoom:Gs.DEFAULT_MIN_ZOOM,e=void 0!==t.maxZoom?t.maxZoom:28,r=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;s=a[n],h=void 0!==a[e]?a[e]:a[a.length-1],i=kn(a)}else{var o=Th.createProjection(t.projection,"EPSG:3857"),u=o.getExtent(),c=(u?Math.max(zh.getWidth(u),zh.getHeight(u)):360*Th.METERS_PER_UNIT[Gh.DEGREES]/o.getMetersPerUnit())/Gs.DEFAULT_TILE_SIZE/Math.pow(2,Gs.DEFAULT_MIN_ZOOM),l=c/Math.pow(2,28-Gs.DEFAULT_MIN_ZOOM);void 0!==(s=t.maxResolution)?n=0:s=c/Math.pow(r,n),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?s/Math.pow(r,e):c/Math.pow(r,e):l),e=n+Math.floor(Math.log(s/h)/Math.log(r)),h=s/Math.pow(r,e-n),i=Nn(r,s,e-n)}return{constraint:i,maxResolution:s,minResolution:h,minZoom:n,zoomFactor:r}},Ln.createRotationConstraint_=function(t){if(void 0===t.enableRotation||t.enableRotation){var i=t.constrainRotation;return void 0===i||!0===i?Cn.createSnapToZero():!1===i?Cn.none:"number"==typeof i?Cn.createSnapToN(i):Cn.none}return Cn.disable},Ln.isNoopAnimation=function(t){return!(t.sourceCenter&&t.targetCenter&&!On.equals(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation};var Dn=function(t,i){var s=document.createElement("CANVAS");return t&&(s.width=t),i&&(s.height=i),s.getContext("2d")},Wn=function(t){var i=t.offsetWidth,s=getComputedStyle(t);return i+(parseInt(s.marginLeft,10)+parseInt(s.marginRight,10))},jn=function(t){var i=t.offsetHeight,s=getComputedStyle(t);return i+(parseInt(s.marginTop,10)+parseInt(s.marginBottom,10))},Un=function(t,i){var s=i.parentNode;s&&s.replaceChild(t,i)},Vn=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},qn=function(t){for(;t.lastChild;)t.removeChild(t.lastChild)},Bn="opacity",Xn="visible",Hn="extent",Yn="zIndex",Jn="maxResolution",Zn="minResolution",Kn="source",$n=function(t){hh.call(this);var i=Ws.assign({},t);i[Bn]=void 0!==t.opacity?t.opacity:1,i[Xn]=void 0===t.visible||t.visible,i[Yn]=void 0!==t.zIndex?t.zIndex:0,i[Jn]=void 0!==t.maxResolution?t.maxResolution:1/0,i[Zn]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(i),this.state_={layer:this,managed:!0}};Gs.inherits($n,hh),$n.prototype.getType=function(){return this.type},$n.prototype.getLayerState=function(){return this.state_.opacity=rh.clamp(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},$n.prototype.getLayersArray=function(){},$n.prototype.getLayerStatesArray=function(){},$n.prototype.getExtent=function(){return this.get(Hn)},$n.prototype.getMaxResolution=function(){return this.get(Jn)},$n.prototype.getMinResolution=function(){return this.get(Zn)},$n.prototype.getOpacity=function(){return this.get(Bn)},$n.prototype.getSourceState=function(){},$n.prototype.getVisible=function(){return this.get(Xn)},$n.prototype.getZIndex=function(){return this.get(Yn)},$n.prototype.setExtent=function(t){this.set(Hn,t)},$n.prototype.setMaxResolution=function(t){this.set(Jn,t)},$n.prototype.setMinResolution=function(t){this.set(Zn,t)},$n.prototype.setOpacity=function(t){this.set(Bn,t)},$n.prototype.setVisible=function(t){this.set(Xn,t)},$n.prototype.setZIndex=function(t){this.set(Yn,t)};var Qn="ready",te=function(t){var i=t||{},s=Ws.assign({},i);delete s.layers;var h=i.layers;$n.call(this,s),this.layersListenerKeys_=[],this.listenerKeys_={},js.listen(this,hh.getChangeEventType(te.Property_.LAYERS),this.handleLayersChanged_,this),h?Array.isArray(h)?h=new rn(h.slice(),{unique:!0}):eh(h instanceof rn,43):h=new rn(void 0,{unique:!0}),this.setLayers(h)};Gs.inherits(te,$n),te.prototype.handleLayerChange_=function(){this.changed()},te.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(js.unlistenByKey),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var i in this.layersListenerKeys_.push(js.listen(t,nn,this.handleLayersAdd_,this),js.listen(t,en,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[i].forEach(js.unlistenByKey);Ws.clear(this.listenerKeys_);var s,h,n,e=t.getArray();for(s=0,h=e.length;s<h;s++)this.listenerKeys_[Gs.getUid(n=e[s]).toString()]=[js.listen(n,Ds,this.handleLayerChange_,this),js.listen(n,Bs,this.handleLayerChange_,this)];this.changed()},te.prototype.handleLayersAdd_=function(t){var i=t.element,s=Gs.getUid(i).toString();this.listenerKeys_[s]=[js.listen(i,Ds,this.handleLayerChange_,this),js.listen(i,Bs,this.handleLayerChange_,this)],this.changed()},te.prototype.handleLayersRemove_=function(t){var i=Gs.getUid(t.element).toString();this.listenerKeys_[i].forEach(js.unlistenByKey),delete this.listenerKeys_[i],this.changed()},te.prototype.getLayers=function(){return this.get(te.Property_.LAYERS)},te.prototype.setLayers=function(t){this.set(te.Property_.LAYERS,t)},te.prototype.getLayersArray=function(t){var i=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(i)})),i},te.prototype.getLayerStatesArray=function(t){var i=void 0!==t?t:[],s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var h,n,e,r=this.getLayerState();for(h=s,n=i.length;h<n;h++)(e=i[h]).opacity*=r.opacity,e.visible=e.visible&&r.visible,e.maxResolution=Math.min(e.maxResolution,r.maxResolution),e.minResolution=Math.max(e.minResolution,r.minResolution),void 0!==r.extent&&(e.extent=void 0!==e.extent?zh.getIntersection(e.extent,r.extent):r.extent);return i},te.prototype.getSourceState=function(){return Qn},te.Property_={LAYERS:"layers"};var ie="MAP_RENDERER",se="LAYER_RENDERER",he={mapRendererPlugins_:[],getMapRendererPlugins:function(){return he.mapRendererPlugins_},layerRendererPlugins_:[],getLayerRendererPlugins:function(){return he.layerRendererPlugins_},register:function(t,i){switch(t){case ie:he.mapRendererPlugins_.push(i);break;case se:he.layerRendererPlugins_.push(i);break;default:throw new Error("Unsupported plugin type: "+t)}},registerMultiple:function(t,i){for(var s=0,h=i.length;s<h;++s)he.register(t,i[s])}},ne="canvas",ee="webgl",re=function(t){return t[0]>0&&t[1]>0},ae=function(t,i,s){return void 0===s&&(s=[0,0]),s[0]=t[0]*i+.5|0,s[1]=t[1]*i+.5|0,s},oe=function(t,i){return Array.isArray(t)?t:(void 0===i?i=[t,t]:i[0]=i[1]=t,i)},ue=function(t){hh.call(this);var i=ue.createOptionsInternal(t);this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:tn.DEVICE_PIXEL_RATIO,this.logos_=i.logos,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=Oh.create(),this.pixelToCoordinateTransform_=Oh.create(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(tn.TOUCH?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var s=[Hs,Ys,"mousedown","touchstart","MSPointerDown",un.POINTERDOWN,Qs,ih],h=0,n=s.length;h<n;++h)js.listen(this.overlayContainerStopEvent_,s[h],Vs.stopPropagation);for(var e in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new Mn(this,t.moveTolerance),un)js.listen(this.mapBrowserEventHandler_,un[e],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,js.listen(this.viewport_,ih,this.handleBrowserEvent,this),js.listen(this.viewport_,Qs,this.handleBrowserEvent,this),this.controls=i.controls||new rn,this.interactions=i.interactions||new rn,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=i.mapRendererPlugin.create(this.viewport_,this),this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new Pn(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},js.listen(this,hh.getChangeEventType(bn),this.handleLayerGroupChanged_,this),js.listen(this,hh.getChangeEventType(En),this.handleViewChanged_,this),js.listen(this,hh.getChangeEventType(xn),this.handleSizeChanged_,this),js.listen(this,hh.getChangeEventType(yn),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach((function(t){t.setMap(this)}),this),js.listen(this.controls,nn,(function(t){t.element.setMap(this)}),this),js.listen(this.controls,en,(function(t){t.element.setMap(null)}),this),this.interactions.forEach((function(t){t.setMap(this)}),this),js.listen(this.interactions,nn,(function(t){t.element.setMap(this)}),this),js.listen(this.interactions,en,(function(t){t.element.setMap(null)}),this),this.overlays_.forEach(this.addOverlayInternal_,this),js.listen(this.overlays_,nn,(function(t){this.addOverlayInternal_(t.element)}),this),js.listen(this.overlays_,en,(function(t){var i=t.element.getId();void 0!==i&&delete this.overlayIdIndex_[i.toString()],t.element.setMap(null)}),this)};Gs.inherits(ue,hh),ue.prototype.addControl=function(t){this.getControls().push(t)},ue.prototype.addInteraction=function(t){this.getInteractions().push(t)},ue.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},ue.prototype.addOverlay=function(t){this.getOverlays().push(t)},ue.prototype.addOverlayInternal_=function(t){var i=t.getId();void 0!==i&&(this.overlayIdIndex_[i.toString()]=t),t.setMap(this)},ue.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),js.unlisten(this.viewport_,ih,this.handleBrowserEvent,this),js.unlisten(this.viewport_,Qs,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(window.removeEventListener(th,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),hh.prototype.disposeInternal.call(this)},ue.prototype.forEachFeatureAtPixel=function(t,i,s){if(this.frameState_){var h=this.getCoordinateFromPixel(t);return this.renderer_.forEachFeatureAtCoordinate(h,this.frameState_,void 0!==(s=void 0!==s?s:{}).hitTolerance?s.hitTolerance*this.frameState_.pixelRatio:0,i,null,void 0!==s.layerFilter?s.layerFilter:xh.TRUE,null)}},ue.prototype.getFeaturesAtPixel=function(t,i){var s=null;return this.forEachFeatureAtPixel(t,(function(t){s||(s=[]),s.push(t)}),i),s},ue.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.frameState_)return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,void 0!==s?s:null,void 0!==h?h:xh.TRUE,void 0!==n?n:null)},ue.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_)return!1;var s=this.getCoordinateFromPixel(t);return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,void 0!==i.layerFilter?i.layerFilter:xh.TRUE,null)},ue.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},ue.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect(),s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]},ue.prototype.getTarget=function(){return this.get(yn)},ue.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},ue.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;return i?Oh.apply(i.pixelToCoordinateTransform,t.slice()):null},ue.prototype.getControls=function(){return this.controls},ue.prototype.getOverlays=function(){return this.overlays_},ue.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return void 0!==i?i:null},ue.prototype.getInteractions=function(){return this.interactions},ue.prototype.getLayerGroup=function(){return this.get(bn)},ue.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},ue.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;return i?Oh.apply(i.coordinateToPixelTransform,t.slice(0,2)):null},ue.prototype.getRenderer=function(){return this.renderer_},ue.prototype.getSize=function(){return this.get(xn)},ue.prototype.getView=function(){return this.get(En)},ue.prototype.getViewport=function(){return this.viewport_},ue.prototype.getOverlayContainer=function(){return this.overlayContainer_},ue.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},ue.prototype.getTilePriority=function(t,i,s,h){var n=this.frameState_;if(!n||!(i in n.wantedTiles))return Sn.DROP;if(!n.wantedTiles[i][t.getKey()])return Sn.DROP;var e=s[0]-n.focus[0],r=s[1]-n.focus[1];return 65536*Math.log(h)+Math.sqrt(e*e+r*r)/h},ue.prototype.handleBrowserEvent=function(t,i){var s=new on(i||t.type,this,t);this.handleMapBrowserEvent(s)},ue.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var i,s=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(i=s.length-1;i>=0;i--){var h=s[i];if(h.getActive()&&!h.handleEvent(t))break}}},ue.prototype.handlePostRender=function(){var t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){var s=16,h=s;if(t){var n=t.viewHints;n[0]&&(s=this.loadTilesWhileAnimating_?8:0,h=2),n[1]&&(s=this.loadTilesWhileInteracting_?8:0,h=2)}i.getTilesLoading()<s&&(i.reprioritize(),i.loadMoreTiles(s,h))}var e,r,a=this.postRenderFunctions_;for(e=0,r=a.length;e<r;++e)a[e](this,t);a.length=0},ue.prototype.handleSizeChanged_=function(){this.render()},ue.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i)js.unlistenByKey(this.keyHandlerKeys_[i]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var h=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[js.listen(h,Zs,this.handleBrowserEvent,this),js.listen(h,Ks,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(th,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Vn(this.viewport_),void 0!==this.handleResize_&&(window.removeEventListener(th,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},ue.prototype.handleTileChange_=function(){this.render()},ue.prototype.handleViewPropertyChanged_=function(){this.render()},ue.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(js.unlistenByKey(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(js.unlistenByKey(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",Gs.getUid(t)),this.viewPropertyListenerKey_=js.listen(t,Ds,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=js.listen(t,Bs,this.handleViewPropertyChanged_,this)),this.render()},ue.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(js.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[js.listen(t,Ds,this.render,this),js.listen(t,Bs,this.render,this)]),this.render()},ue.prototype.isRendered=function(){return!!this.frameState_},ue.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},ue.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},ue.prototype.removeControl=function(t){return this.getControls().remove(t)},ue.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},ue.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},ue.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},ue.prototype.renderFrame_=function(t){var i,s,h,n=this.getSize(),e=this.getView(),r=zh.createEmpty(),a=this.frameState_,o=null;if(void 0!==n&&re(n)&&e&&e.isDef()){var u=e.getHints(this.frameState_?this.frameState_.viewHints:void 0),c=this.getLayerGroup().getLayerStatesArray(),l={};for(i=0,s=c.length;i<s;++i)l[Gs.getUid(c[i].layer)]=c[i];var f=(h=e.getState()).center,d=h.resolution/this.pixelRatio_;f[0]=Math.round(f[0]/d)*d,f[1]=Math.round(f[1]/d)*d,o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:r,focus:this.focus_?this.focus_:f,index:this.frameIndex_++,layerStates:l,layerStatesArray:c,logos:Ws.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:u,wantedTiles:{}}}o&&(o.extent=zh.getForViewAndSize(h.center,h.resolution,h.rotation,o.size,r)),this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),a&&(!this.previousExtent_||!zh.isEmpty(this.previousExtent_)&&!zh.equals(o.extent,this.previousExtent_))&&(this.dispatchEvent(new an("movestart",this,a)),this.previousExtent_=zh.createOrUpdateEmpty(this.previousExtent_)),this.previousExtent_&&!o.viewHints[0]&&!o.viewHints[1]&&!zh.equals(o.extent,this.previousExtent_)&&(this.dispatchEvent(new an("moveend",this,o)),zh.clone(o.extent,this.previousExtent_))),this.dispatchEvent(new an(wn,this,o)),setTimeout(this.handlePostRender.bind(this),0)},ue.prototype.setLayerGroup=function(t){this.set(bn,t)},ue.prototype.setSize=function(t){this.set(xn,t)},ue.prototype.setTarget=function(t){this.set(yn,t)},ue.prototype.setView=function(t){this.set(En,t)},ue.prototype.skipFeature=function(t){var i=Gs.getUid(t).toString();this.skippedFeatureUids_[i]=!0,this.render()},ue.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth)])}else this.setSize(void 0)},ue.prototype.unskipFeature=function(t){var i=Gs.getUid(t).toString();delete this.skippedFeatureUids_[i],this.render()},ue.DEFAULT_RENDERER_TYPES=[ne,ee],ue.LOGO_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC",ue.createOptionsInternal=function(t){var i=null;void 0!==t.keyboardEventTarget&&(i="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var s={},h={};if(void 0===t.logo||"boolean"==typeof t.logo&&t.logo)h[ue.LOGO_URL]="https://openlayers.org/";else{var n=t.logo;"string"==typeof n?h[n]="":n instanceof HTMLElement?h[Gs.getUid(n).toString()]=n:n&&(eh("string"==typeof n.href,44),eh("string"==typeof n.src,45),h[n.src]=n.href)}var e,r,a=t.layers instanceof te?t.layers:new te({layers:t.layers});s[bn]=a,s[yn]=t.target,s[En]=void 0!==t.view?t.view:new Ln,void 0!==t.renderer?(Array.isArray(t.renderer)?e=t.renderer:"string"==typeof t.renderer?e=[t.renderer]:eh(!1,46),e.indexOf("dom")>=0&&(e=e.concat(ue.DEFAULT_RENDERER_TYPES))):e=ue.DEFAULT_RENDERER_TYPES;var o,u,c,l=he.getMapRendererPlugins();t:for(var f=0,d=e.length;f<d;++f)for(var v=e[f],m=0,p=l.length;m<p;++m){var _=l[m];if(_.handles(v)){r=_;break t}}if(!r)throw new Error("Unable to create a map renderer for types: "+e.join(", "));return void 0!==t.controls&&(Array.isArray(t.controls)?o=new rn(t.controls.slice()):(eh(t.controls instanceof rn,47),o=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?u=new rn(t.interactions.slice()):(eh(t.interactions instanceof rn,48),u=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?c=new rn(t.overlays.slice()):(eh(t.overlays instanceof rn,49),c=t.overlays):c=new rn,{controls:o,interactions:u,keyboardEventTarget:i,logos:h,overlays:c,mapRendererPlugin:r,values:s}};var ce=function(t){hh.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:Gs.nullFunction,t.target&&this.setTarget(t.target)};Gs.inherits(ce,hh),ce.prototype.disposeInternal=function(){Vn(this.element),hh.prototype.disposeInternal.call(this)},ce.prototype.getMap=function(){return this.map_},ce.prototype.setMap=function(t){this.map_&&Vn(this.element);for(var i=0,s=this.listenerKeys.length;i<s;++i)js.unlistenByKey(this.listenerKeys[i]);this.listenerKeys.length=0,this.map_=t,this.map_&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Gs.nullFunction&&this.listenerKeys.push(js.listen(t,wn,this.render,this)),t.render())},ce.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t};var le,fe,de={CLASS_HIDDEN:"ol-hidden",CLASS_SELECTABLE:"ol-selectable",CLASS_UNSELECTABLE:"ol-unselectable",CLASS_UNSUPPORTED:"ol-unsupported",CLASS_CONTROL:"ol-control"};de.getFontFamilies=(fe={},function(t){if(le||(le=document.createElement("div").style),!(t in fe)){le.font=t;var i=le.fontFamily;if(le.font="",!i)return null;fe[t]=i.split(/,\s?/)}return fe[t]});var ve="postcompose",me="precompose",pe="render",_e=function(t){var i=Ws.assign({},t);delete i.source,$n.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),js.listen(this,hh.getChangeEventType(Kn),this.handleSourcePropertyChange_,this),this.setSource(t.source?t.source:null)};Gs.inherits(_e,$n),_e.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution},_e.prototype.getLayersArray=function(t){var i=t||[];return i.push(this),i},_e.prototype.getLayerStatesArray=function(t){var i=t||[];return i.push(this.getLayerState()),i},_e.prototype.getSource=function(){return this.get(Kn)||null},_e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},_e.prototype.handleSourceChange_=function(){this.changed()},_e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(js.unlistenByKey(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=js.listen(t,Bs,this.handleSourceChange_,this)),this.changed()},_e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(js.unlistenByKey(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(js.unlistenByKey(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=js.listen(t,me,(function(t){var i=this.getLayerState();i.managed=!1,i.zIndex=1/0,t.frameState.layerStatesArray.push(i),t.frameState.layerStates[Gs.getUid(this)]=i}),this),this.mapRenderKey_=js.listen(this,Bs,t.render,t),this.changed())},_e.prototype.setSource=function(t){this.set(Kn,t)};var ge=function(t){var i=t||{};this.ulElement_=document.createElement("UL"),this.logoLi_=document.createElement("LI"),this.ulElement_.appendChild(this.logoLi_),this.logoLi_.style.display="none",this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var s=void 0!==i.className?i.className:"ol-attribution",h=void 0!==i.tipLabel?i.tipLabel:"Attributions",n=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var e=void 0!==i.label?i.label:"i";"string"==typeof e?(this.label_=document.createElement("span"),this.label_.textContent=e):this.label_=e;var r=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=h,a.appendChild(r),js.listen(a,Hs,this.handleClick_,this);var o=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),u=document.createElement("div");u.className=o,u.appendChild(this.ulElement_),u.appendChild(a),ce.call(this,{element:u,render:i.render?i.render:ge.render,target:i.target}),this.renderedAttributions_=[],this.renderedVisible_=!0,this.logoElements_={}};Gs.inherits(ge,ce),ge.prototype.getSourceAttributions_=function(t){for(var i={},s=[],h=t.layerStatesArray,n=t.viewState.resolution,e=0,r=h.length;e<r;++e){var a=h[e];if(_e.visibleAtResolution(a,n)){var o=a.layer.getSource();if(o){var u=o.getAttributions2();if(u){var c=u(t);if(c)if(Array.isArray(c))for(var l=0,f=c.length;l<f;++l)c[l]in i||(s.push(c[l]),i[c[l]]=!0);else c in i||(s.push(c),i[c]=!0)}}}}return s},ge.render=function(t){this.updateElement_(t.frameState)},ge.prototype.updateElement_=function(t){if(t){var i=this.getSourceAttributions_(t);if(!_h.equals(i,this.renderedAttributions_)){for(;this.ulElement_.lastChild!==this.logoLi_;)this.ulElement_.removeChild(this.ulElement_.lastChild);for(var s=0,h=i.length;s<h;++s){var n=document.createElement("LI");n.innerHTML=i[s],this.ulElement_.appendChild(n)}0===i.length&&this.renderedAttributions_.length>0?this.element.classList.add("ol-logo-only"):0===this.renderedAttributions_.length&&i.length>0&&this.element.classList.remove("ol-logo-only");var e=i.length>0||!Ws.isEmpty(t.logos);this.renderedVisible_!=e&&(this.element.style.display=e?"":"none",this.renderedVisible_=e),this.renderedAttributions_=i,this.insertLogos_(t)}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},ge.prototype.insertLogos_=function(t){var i,s,h,n,e=t.logos,r=this.logoElements_;for(i in r)i in e||(Vn(r[i]),delete r[i]);for(n in e){var a=e[n];a instanceof HTMLElement&&(this.logoLi_.appendChild(a),r[n]=a),n in r||((s=new Image).src=n,""===a?h=s:((h=document.createElement("a")).href=a,h.appendChild(s)),this.logoLi_.appendChild(h),r[n]=h)}this.logoLi_.style.display=Ws.isEmpty(e)?"none":""},ge.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},ge.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Un(this.collapseLabel_,this.label_):Un(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},ge.prototype.getCollapsible=function(){return this.collapsible_},ge.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},ge.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},ge.prototype.getCollapsed=function(){return this.collapsed_};var ze=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-rotate",h=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof h?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=h):(this.label_=h,this.label_.classList.add("ol-compass"));var n=i.tipLabel?i.tipLabel:"Reset rotation",e=document.createElement("button");e.className=s+"-reset",e.setAttribute("type","button"),e.title=n,e.appendChild(this.label_),js.listen(e,Hs,ze.prototype.handleClick_,this);var r=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL,a=document.createElement("div");a.className=r,a.appendChild(e);var o=i.render?i.render:ze.render;this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,ce.call(this,{element:a,render:o,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(de.CLASS_HIDDEN)};Gs.inherits(ze,ce),ze.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},ze.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:Fn.easeOut}):t.setRotation(0))},ze.render=function(t){var i=t.frameState;if(i){var s=i.viewState.rotation;if(s!=this.rotation_){var h="rotate("+s+"rad)";if(this.autoHide_){var n=this.element.classList.contains(de.CLASS_HIDDEN);n||0!==s?n&&0!==s&&this.element.classList.remove(de.CLASS_HIDDEN):this.element.classList.add(de.CLASS_HIDDEN)}this.label_.style.msTransform=h,this.label_.style.webkitTransform=h,this.label_.style.transform=h}this.rotation_=s}};var Me=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-zoom",h=void 0!==i.delta?i.delta:1,n=void 0!==i.zoomInLabel?i.zoomInLabel:"+",e=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",r=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",a=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",o=document.createElement("button");o.className=s+"-in",o.setAttribute("type","button"),o.title=r,o.appendChild("string"==typeof n?document.createTextNode(n):n),js.listen(o,Hs,Me.prototype.handleClick_.bind(this,h));var u=document.createElement("button");u.className=s+"-out",u.setAttribute("type","button"),u.title=a,u.appendChild("string"==typeof e?document.createTextNode(e):e),js.listen(u,Hs,Me.prototype.handleClick_.bind(this,-h));var c=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL,l=document.createElement("div");l.className=c,l.appendChild(o),l.appendChild(u),ce.call(this,{element:l,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Me,ce),Me.prototype.handleClick_=function(t,i){i.preventDefault(),this.zoomByDelta_(t)},Me.prototype.zoomByDelta_=function(t){var i=this.getMap().getView();if(i){var s=i.getResolution();if(s){var h=i.constrainResolution(s,t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:h,duration:this.duration_,easing:Fn.easeOut})):i.setResolution(h)}}};var we=function(t){var i=t||{},s=new rn;return(void 0===i.zoom||i.zoom)&&s.push(new Me(i.zoomOptions)),(void 0===i.rotate||i.rotate)&&s.push(new ze(i.rotateOptions)),(void 0===i.attribution||i.attribution)&&s.push(new ge(i.attributionOptions)),s},be=function(t,i,s){this.decay_=t,this.minVelocity_=i,this.delay_=s,this.points_=[],this.angle_=0,this.initialVelocity_=0};be.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},be.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},be.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var s=i-3;s>0&&this.points_[s+2]>t;)s-=3;var h=this.points_[i+2]-this.points_[s+2];if(h<1e3/60)return!1;var n=this.points_[i]-this.points_[s],e=this.points_[i+1]-this.points_[s+1];return this.angle_=Math.atan2(e,n),this.initialVelocity_=Math.sqrt(n*n+e*e)/h,this.initialVelocity_>this.minVelocity_},be.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},be.prototype.getAngle=function(){return this.angle_};var xe="active",ye=function(t){hh.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent};Gs.inherits(ye,hh),ye.prototype.getActive=function(){return this.get(xe)},ye.prototype.getMap=function(){return this.map_},ye.prototype.setActive=function(t){this.set(xe,t)},ye.prototype.setMap=function(t){this.map_=t},ye.pan=function(t,i,s){var h=t.getCenter();if(h){var n=t.constrainCenter([h[0]+i[0],h[1]+i[1]]);s?t.animate({duration:s,easing:Fn.linear,center:n}):t.setCenter(n)}},ye.rotate=function(t,i,s,h){i=t.constrainRotation(i,0),ye.rotateWithoutConstraints(t,i,s,h)},ye.rotateWithoutConstraints=function(t,i,s,h){if(void 0!==i){var n=t.getRotation(),e=t.getCenter();void 0!==n&&e&&h>0?t.animate({rotation:i,anchor:s,duration:h,easing:Fn.easeOut}):t.rotate(i,s)}},ye.zoom=function(t,i,s,h,n){i=t.constrainResolution(i,0,n),ye.zoomWithoutConstraints(t,i,s,h)},ye.zoomByDelta=function(t,i,s,h){var n=t.getResolution(),e=t.constrainResolution(n,i,0);if(void 0!==e){var r=t.getResolutions();e=rh.clamp(e,t.getMinResolution()||r[r.length-1],t.getMaxResolution()||r[0])}if(s&&void 0!==e&&e!==n){var a=t.getCenter(),o=t.calculateCenterZoom(e,s);o=t.constrainCenter(o),s=[(e*a[0]-n*o[0])/(e-n),(e*a[1]-n*o[1])/(e-n)]}ye.zoomWithoutConstraints(t,e,s,h)},ye.zoomWithoutConstraints=function(t,i,s,h){if(i){var n=t.getResolution(),e=t.getCenter();if(void 0!==n&&e&&i!==n&&h)t.animate({resolution:i,anchor:s,duration:h,easing:Fn.easeOut});else{if(s){var r=t.calculateCenterZoom(i,s);t.setCenter(r)}t.setResolution(i)}}};var Ee=function(t){var i=t||{};this.delta_=i.delta?i.delta:1,ye.call(this,{handleEvent:Ee.handleEvent}),this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Ee,ye),Ee.handleEvent=function(t){var i=!1;if(t.type==un.DBLCLICK){var s=t.coordinate,h=t.originalEvent.shiftKey?-this.delta_:this.delta_,n=t.map.getView();ye.zoomByDelta(n,h,s,this.duration_),t.preventDefault(),i=!0}return!i};var Se={altKeyOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},altShiftKeysOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey}};Se.always=xh.TRUE,Se.click=function(t){return t.type==un.CLICK},Se.mouseActionButton=function(t){var i=t.originalEvent;return 0==i.button&&!(tn.WEBKIT&&tn.MAC&&i.ctrlKey)},Se.never=xh.FALSE,Se.pointerMove=function(t){return"pointermove"==t.type},Se.singleClick=function(t){return t.type==un.SINGLECLICK},Se.doubleClick=function(t){return t.type==un.DBLCLICK},Se.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},Se.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(tn.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey},Se.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey},Se.targetNotEditable=function(t){var i=t.originalEvent.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i},Se.mouseOnly=function(t){return eh(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},Se.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&0===i.button};var Pe=function(t){var i=t||{};ye.call(this,{handleEvent:i.handleEvent?i.handleEvent:Pe.handleEvent}),this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:Pe.handleDownEvent,this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:Pe.handleDragEvent,this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:Pe.handleMoveEvent,this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:Pe.handleUpEvent,this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]};Gs.inherits(Pe,ye),Pe.centroid=function(t){for(var i=t.length,s=0,h=0,n=0;n<i;n++)s+=t[n].clientX,h+=t[n].clientY;return[s/i,h/i]},Pe.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===un.POINTERDOWN||i===un.POINTERDRAG||i===un.POINTERUP},Pe.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent,s=i.pointerId.toString();t.type==un.POINTERUP?delete this.trackedPointers_[s]:(t.type==un.POINTERDOWN||s in this.trackedPointers_)&&(this.trackedPointers_[s]=i),this.targetPointers=Ws.getValues(this.trackedPointers_)}},Pe.handleDragEvent=Gs.nullFunction,Pe.handleUpEvent=xh.FALSE,Pe.handleDownEvent=xh.FALSE,Pe.handleMoveEvent=Gs.nullFunction,Pe.handleEvent=function(t){if(!(t instanceof cn))return!0;var i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==un.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==un.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else if(t.type==un.POINTERDOWN){var h=this.handleDownEvent_(t);this.handlingDownUpSequence=h,i=this.shouldStopEvent(h)}else t.type==un.POINTERMOVE&&this.handleMoveEvent_(t);return!i},Pe.prototype.shouldStopEvent=function(t){return t};var Ge=function(t){Pe.call(this,{handleDownEvent:Ge.handleDownEvent_,handleDragEvent:Ge.handleDragEvent_,handleUpEvent:Ge.handleUpEvent_});var i=t||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.condition_=i.condition?i.condition:Se.noModifierKeys,this.noKinetic_=!1};Gs.inherits(Ge,Pe),Ge.handleDragEvent_=function(t){var i=this.targetPointers,s=Pe.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){var h=this.lastCentroid[0]-s[0],n=s[1]-this.lastCentroid[1],e=t.map.getView(),r=e.getState(),a=[h,n];On.scale(a,r.resolution),On.rotate(a,r.rotation),On.add(a,r.center),a=e.constrainCenter(a),e.setCenter(a)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length},Ge.handleUpEvent_=function(t){var i=t.map,s=i.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var h=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),e=s.getCenter(),r=i.getPixelFromCoordinate(e),a=i.getCoordinateFromPixel([r[0]-h*Math.cos(n),r[1]-h*Math.sin(n)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Fn.easeOut})}return s.setHint(1,-1),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},Ge.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||i.setHint(1,1),i.getAnimating()&&i.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},Ge.prototype.shouldStopEvent=xh.FALSE;var ke=function(t){var i=t||{};Pe.call(this,{handleDownEvent:ke.handleDownEvent_,handleDragEvent:ke.handleDragEvent_,handleUpEvent:ke.handleUpEvent_}),this.condition_=i.condition?i.condition:Se.altShiftKeysOnly,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(ke,Pe),ke.handleDragEvent_=function(t){if(Se.mouseOnly(t)){var i=t.map,s=i.getView();if(s.getConstraints().rotation!==Cn.disable){var h=i.getSize(),n=t.pixel,e=Math.atan2(h[1]/2-n[1],n[0]-h[0]/2);if(void 0!==this.lastAngle_){var r=e-this.lastAngle_,a=s.getRotation();ye.rotateWithoutConstraints(s,a-r)}this.lastAngle_=e}}},ke.handleUpEvent_=function(t){if(!Se.mouseOnly(t))return!0;var i=t.map.getView();i.setHint(1,-1);var s=i.getRotation();return ye.rotate(i,s,void 0,this.duration_),!1},ke.handleDownEvent_=function(t){return!(!Se.mouseOnly(t)||!Se.mouseActionButton(t)||!this.condition_(t)||(t.map.getView().setHint(1,1),this.lastAngle_=void 0,0))},ke.prototype.shouldStopEvent=xh.FALSE;var Ne=function(t){this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null};Gs.inherits(Ne,Us),Ne.prototype.disposeInternal=function(){this.setMap(null)},Ne.prototype.render_=function(){var t=this.startPixel_,i=this.endPixel_,s="px",h=this.element_.style;h.left=Math.min(t[0],i[0])+s,h.top=Math.min(t[1],i[1])+s,h.width=Math.abs(i[0]-t[0])+s,h.height=Math.abs(i[1]-t[1])+s},Ne.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},Ne.prototype.setPixels=function(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()},Ne.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new $h([s])},Ne.prototype.getGeometry=function(){return this.geometry_};var Ce=function(t){Pe.call(this,{handleDownEvent:Ce.handleDownEvent_,handleDragEvent:Ce.handleDragEvent_,handleUpEvent:Ce.handleUpEvent_});var i=t||{};this.box_=new Ne(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.startPixel_=null,this.condition_=i.condition?i.condition:Se.always,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:Ce.defaultBoxEndCondition};Gs.inherits(Ce,Pe),Ce.defaultBoxEndCondition=function(t,i,s){var h=s[0]-i[0],n=s[1]-i[1];return h*h+n*n>=this.minArea_},Ce.handleDragEvent_=function(t){Se.mouseOnly(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXDRAG,t.coordinate,t)))},Ce.prototype.getGeometry=function(){return this.box_.getGeometry()},Ce.prototype.onBoxEnd=Gs.nullFunction,Ce.handleUpEvent_=function(t){return!Se.mouseOnly(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXEND,t.coordinate,t))),!1)},Ce.handleDownEvent_=function(t){return!(!Se.mouseOnly(t)||!Se.mouseActionButton(t)||!this.condition_(t)||(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXSTART,t.coordinate,t)),0))},Ce.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},Ce.Event=function(t,i,s){Vs.call(this,t),this.coordinate=i,this.mapBrowserEvent=s},Gs.inherits(Ce.Event,Vs);var Ae=function(t){var i=t||{},s=i.condition?i.condition:Se.shiftKeyOnly;this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out,Ce.call(this,{condition:s,className:i.className||"ol-dragzoom"})};Gs.inherits(Ae,Ce),Ae.prototype.onBoxEnd=function(){var t=this.getMap(),i=t.getView(),s=t.getSize(),h=this.getGeometry().getExtent();if(this.out_){var n=i.calculateExtent(s),e=zh.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(zh.getBottomLeft(h)),t.getPixelFromCoordinate(zh.getTopRight(h))]),r=i.getResolutionForExtent(e,s);zh.scaleFromCenter(n,1/r),h=n}var a=i.constrainResolution(i.getResolutionForExtent(h,s)),o=zh.getCenter(h);o=i.constrainCenter(o),i.animate({resolution:a,center:o,duration:this.duration_,easing:Fn.easeOut})};var Re=function(t){ye.call(this,{handleEvent:Re.handleEvent});var i=t||{};this.defaultCondition_=function(t){return Se.noModifierKeys(t)&&Se.targetNotEditable(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128};Gs.inherits(Re,ye),Re.handleEvent=function(t){var i=!1;if(t.type==Zs){var s=t.originalEvent.keyCode;if(this.condition_(t)&&(40==s||37==s||39==s||38==s)){var h=t.map.getView(),n=h.getResolution()*this.pixelDelta_,e=0,r=0;40==s?r=-n:37==s?e=-n:39==s?e=n:r=n;var a=[e,r];On.rotate(a,h.getRotation()),ye.pan(h,a,this.duration_),t.preventDefault(),i=!0}}return!i};var Ie=function(t){ye.call(this,{handleEvent:Ie.handleEvent});var i=t||{};this.condition_=i.condition?i.condition:Se.targetNotEditable,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100};Gs.inherits(Ie,ye),Ie.handleEvent=function(t){var i=!1;if(t.type==Zs||t.type==Ks){var s=t.originalEvent.charCode;if(this.condition_(t)&&(s=="+".charCodeAt(0)||s=="-".charCodeAt(0))){var h=t.map,n=s=="+".charCodeAt(0)?this.delta_:-this.delta_,e=h.getView();ye.zoomByDelta(e,n,void 0,this.duration_),t.preventDefault(),i=!0}}return!i};var Te=function(t){ye.call(this,{handleEvent:Te.handleEvent});var i=t||{};this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5};Gs.inherits(Te,ye),Te.handleEvent=function(t){var i=t.type;if(i!==ih&&i!==Qs)return!0;t.preventDefault();var s,h=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ih?(s=n.deltaY,tn.FIREFOX&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=tn.DEVICE_PIXEL_RATIO),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)):t.type==Qs&&(s=-n.wheelDeltaY,tn.SAFARI&&(s/=3)),0===s)return!1;var e=Date.now();if(void 0===this.startTime_&&(this.startTime_=e),(!this.mode_||e-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?Te.Mode_.TRACKPAD:Te.Mode_.WHEEL),this.mode_===Te.Mode_.TRACKPAD){var r=h.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):r.setHint(1,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=r.getResolution()*Math.pow(2,s/this.trackpadDeltaPerZoom_),o=r.getMinResolution(),u=r.getMaxResolution(),c=0;if(a<o?(a=Math.max(a,o/this.trackpadZoomBuffer_),c=1):a>u&&(a=Math.min(a,u*this.trackpadZoomBuffer_),c=-1),this.lastAnchor_){var l=r.calculateCenterZoom(a,this.lastAnchor_);r.setCenter(r.constrainCenter(l))}return r.setResolution(a),0===c&&this.constrainResolution_&&r.animate({resolution:r.constrainResolution(a,s>0?-1:1),easing:Fn.easeOut,anchor:this.lastAnchor_,duration:this.duration_}),c>0?r.animate({resolution:o,easing:Fn.easeOut,anchor:this.lastAnchor_,duration:500}):c<0&&r.animate({resolution:u,easing:Fn.easeOut,anchor:this.lastAnchor_,duration:500}),this.startTime_=e,!1}this.delta_+=s;var f=Math.max(this.timeout_-(e-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,h),f),!1},Te.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(1,-1)},Te.prototype.handleWheelZoom_=function(t){var i=t.getView();i.getAnimating()&&i.cancelAnimations();var s=Gs.MOUSEWHEELZOOM_MAXDELTA,h=rh.clamp(this.delta_,-s,s);ye.zoomByDelta(i,-h,this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},Te.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},Te.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var Oe=function(t){Pe.call(this,{handleDownEvent:Oe.handleDownEvent_,handleDragEvent:Oe.handleDragEvent_,handleUpEvent:Oe.handleUpEvent_});var i=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Oe,Pe),Oe.handleDragEvent_=function(t){var i=0,s=this.targetPointers[0],h=this.targetPointers[1],n=Math.atan2(h.clientY-s.clientY,h.clientX-s.clientX);if(void 0!==this.lastAngle_){var e=n-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=e}this.lastAngle_=n;var r=t.map,a=r.getView();if(a.getConstraints().rotation!==Cn.disable){var o=r.getViewport().getBoundingClientRect(),u=Pe.centroid(this.targetPointers);if(u[0]-=o.left,u[1]-=o.top,this.anchor_=r.getCoordinateFromPixel(u),this.rotating_){var c=a.getRotation();r.render(),ye.rotateWithoutConstraints(a,c+i,this.anchor_)}}},Oe.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();if(i.setHint(1,-1),this.rotating_){var s=i.getRotation();ye.rotate(i,s,this.anchor_,this.duration_)}return!1}return!0},Oe.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},Oe.prototype.shouldStopEvent=xh.FALSE;var Fe=function(t){Pe.call(this,{handleDownEvent:Fe.handleDownEvent_,handleDragEvent:Fe.handleDragEvent_,handleUpEvent:Fe.handleUpEvent_});var i=t||{};this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1};Gs.inherits(Fe,Pe),Fe.handleDragEvent_=function(t){var i=1,s=this.targetPointers[0],h=this.targetPointers[1],n=s.clientX-h.clientX,e=s.clientY-h.clientY,r=Math.sqrt(n*n+e*e);void 0!==this.lastDistance_&&(i=this.lastDistance_/r),this.lastDistance_=r;var a=t.map,o=a.getView(),u=o.getResolution(),c=o.getMaxResolution(),l=o.getMinResolution(),f=u*i;f>c?(i=c/u,f=c):f<l&&(i=l/u,f=l),1!=i&&(this.lastScaleDelta_=i);var d=a.getViewport().getBoundingClientRect(),v=Pe.centroid(this.targetPointers);v[0]-=d.left,v[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(v),a.render(),ye.zoomWithoutConstraints(o,f,this.anchor_)},Fe.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();i.setHint(1,-1);var s=i.getResolution();return(this.constrainResolution_||s<i.getMinResolution()||s>i.getMaxResolution())&&ye.zoom(i,s,this.anchor_,this.duration_,this.lastScaleDelta_-1),!1}return!0},Fe.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},Fe.prototype.shouldStopEvent=xh.FALSE;var Le=function(t){var i=t||{},s=new rn,h=new be(-.005,.05,100);return(void 0===i.altShiftDragRotate||i.altShiftDragRotate)&&s.push(new ke),(void 0===i.doubleClickZoom||i.doubleClickZoom)&&s.push(new Ee({delta:i.zoomDelta,duration:i.zoomDuration})),(void 0===i.dragPan||i.dragPan)&&s.push(new Ge({kinetic:h})),(void 0===i.pinchRotate||i.pinchRotate)&&s.push(new Oe),(void 0===i.pinchZoom||i.pinchZoom)&&s.push(new Fe({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.keyboard||i.keyboard)&&(s.push(new Re),s.push(new Ie({delta:i.zoomDelta,duration:i.zoomDuration}))),(void 0===i.mouseWheelZoom||i.mouseWheelZoom)&&s.push(new Te({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.shiftDragZoom||i.shiftDragZoom)&&s.push(new Ae({duration:i.zoomDuration})),s},De=function(t,i,s,h){qs.call(this),this.extent=t,this.pixelRatio_=s,this.resolution=i,this.state=h};Gs.inherits(De,qs),De.prototype.changed=function(){this.dispatchEvent(Bs)},De.prototype.getExtent=function(){return this.extent},De.prototype.getImage=function(){},De.prototype.getPixelRatio=function(){return this.pixelRatio_},De.prototype.getResolution=function(){return this.resolution},De.prototype.getState=function(){return this.state},De.prototype.load=function(){};var We=function(t,i,s,h,n){this.loader_=void 0!==n?n:null,De.call(this,t,i,s,void 0!==n?0:2),this.canvas_=h,this.error_=null};Gs.inherits(We,De),We.prototype.getError=function(){return this.error_},We.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()},We.prototype.load=function(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))},We.prototype.getImage=function(){return this.canvas_};var je="IMAGE",Ue="TILE",Ve="VECTOR",qe=function(t,i,s,h,n){Vs.call(this,t),this.vectorContext=i,this.frameState=s,this.context=h,this.glContext=n};Gs.inherits(qe,Vs);var Be=function(t){qs.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null};Gs.inherits(Be,qs),Be.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},Be.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Xs)},Be.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},Be.prototype.forEach=function(t,i){for(var s=this.oldest_;s;)t.call(i,s.value_,s.key_,this),s=s.newer},Be.prototype.get=function(t){var i=this.entries_[t];return eh(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},Be.prototype.remove=function(t){var i=this.entries_[t];return eh(void 0!==i,15),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_},Be.prototype.getCount=function(){return this.count_},Be.prototype.getKeys=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.key_;return i},Be.prototype.getValues=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.value_;return i},Be.prototype.peekLast=function(){return this.oldest_.value_},Be.prototype.peekLastKey=function(){return this.oldest_.key_},Be.prototype.peekFirstKey=function(){return this.newest_.key_},Be.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},Be.prototype.replace=function(t,i){this.get(t),this.entries_[t].value_=i},Be.prototype.set=function(t,i){eh(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=s:this.oldest_=s,this.newest_=s,this.entries_[t]=s,++this.count_},Be.prototype.prune=function(){for(;this.canExpireCache();)this.pop()};var Xe,He,Ye={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:"center",defaultTextBaseline:"middle",defaultPadding:[0,0,0,0],defaultLineWidth:1};Ye.labelCache=new Be,Ye.checkedFonts_={},Ye.measureContext_=null,Ye.textHeights_={},Ye.checkFont=function(){var t,i,s=Ye.checkedFonts_,h=Ye.labelCache,n="wmytzilWMYTZIL@#/&?$%10";function e(t){var s=Ye.getMeasureContext();s.font="32px monospace",i=s.measureText(n).width;var h=!0;return"monospace"!=t&&(s.font="32px "+t+",monospace",h=s.measureText(n).width!=i),h}function r(){var i=!0;for(var n in s)s[n]<60&&(e(n)?(s[n]=60,Ws.clear(Ye.textHeights_),Ye.measureContext_=null,h.clear()):(++s[n],i=!1));i&&(window.clearInterval(t),t=void 0)}return function(i){var h=de.getFontFamilies(i);if(h)for(var n=0,a=h.length;n<a;++n){var o=h[n];o in s||(s[o]=60,e(o)||(s[o]=0,void 0===t&&(t=window.setInterval(r,32))))}}}(),Ye.getMeasureContext=function(){var t=Ye.measureContext_;return t||(t=Ye.measureContext_=Dn(1,1)),t},Ye.measureTextHeight=(He=Ye.textHeights_,function(t){var i=He[t];return null==i&&(Xe||((Xe=document.createElement("span")).textContent="M",Xe.style.margin=Xe.style.padding="0 !important",Xe.style.position="absolute !important",Xe.style.left="-99999px !important"),Xe.style.font=t,document.body.appendChild(Xe),i=He[t]=Xe.offsetHeight,document.body.removeChild(Xe)),i}),Ye.measureTextWidth=function(t,i){var s=Ye.getMeasureContext();return t!=s.font&&(s.font=t),s.measureText(i).width},Ye.rotateAtOffset=function(t,i,s,h){0!==i&&(t.translate(s,h),t.rotate(i),t.translate(-s,-h))},Ye.resetTransform_=Oh.create(),Ye.drawImage=function(t,i,s,h,n,e,r,a,o,u,c){var l;1!=s&&(t.globalAlpha=(l=t.globalAlpha)*s),i&&t.setTransform.apply(t,i),t.drawImage(h,n,e,r,a,o,u,r*c,a*c),l&&(t.globalAlpha=l),i&&t.setTransform.apply(t,Ye.resetTransform_)};var Je={HEX_COLOR_RE_:/^#(?:[0-9a-f]{3,4}){1,2}$/i,NAMED_COLOR_RE_:/^([a-z]*)$/i,asArray:function(t){return Array.isArray(t)?t:Je.fromString(t)},asString:function(t){return"string"==typeof t?t:Je.toString(t)},fromNamed:function(t){var i=document.createElement("div");i.style.color=t,document.body.appendChild(i);var s=getComputedStyle(i).color;return document.body.removeChild(i),s}};Je.fromString=function(){var t={},i=0;return function(s){var h;if(t.hasOwnProperty(s))h=t[s];else{if(i>=1024){var n,e=0;for(n in t)3&e++||(delete t[n],--i)}h=Je.fromStringInternal_(s),t[s]=h,++i}return h}}(),Je.fromStringInternal_=function(t){var i,s,h,n,e,r;if(Je.NAMED_COLOR_RE_.exec(t)&&(t=Je.fromNamed(t)),Je.HEX_COLOR_RE_.exec(t)){var a,o=t.length-1;a=o<=4?1:2;var u=4===o||8===o;i=parseInt(t.substr(1+0*a,a),16),s=parseInt(t.substr(1+1*a,a),16),h=parseInt(t.substr(1+2*a,a),16),n=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(i=(i<<4)+i,s=(s<<4)+s,h=(h<<4)+h,u&&(n=(n<<4)+n)),e=[i,s,h,n/255]}else 0==t.indexOf("rgba(")?(r=t.slice(5,-1).split(",").map(Number),e=Je.normalize(r)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),e=Je.normalize(r)):eh(!1,14);return e},Je.normalize=function(t,i){var s=i||[];return s[0]=rh.clamp(t[0]+.5|0,0,255),s[1]=rh.clamp(t[1]+.5|0,0,255),s[2]=rh.clamp(t[2]+.5|0,0,255),s[3]=rh.clamp(t[3],0,1),s},Je.toString=function(t){var i=t[0];i!=(0|i)&&(i=i+.5|0);var s=t[1];s!=(0|s)&&(s=s+.5|0);var h=t[2];return h!=(0|h)&&(h=h+.5|0),"rgba("+i+","+s+","+h+","+(void 0===t[3]?1:t[3])+")"};var Ze={asColorLike:function(t){return Ze.isColorLike(t)?t:Je.asString(t)},isColorLike:function(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient}},Ke=function(){};Ke.prototype.drawCustom=function(){},Ke.prototype.drawGeometry=function(){},Ke.prototype.setStyle=function(){},Ke.prototype.drawCircle=function(){},Ke.prototype.drawFeature=function(){},Ke.prototype.drawGeometryCollection=function(){},Ke.prototype.drawLineString=function(){},Ke.prototype.drawMultiLineString=function(){},Ke.prototype.drawMultiPoint=function(){},Ke.prototype.drawMultiPolygon=function(){},Ke.prototype.drawPoint=function(){},Ke.prototype.drawPolygon=function(){},Ke.prototype.drawText=function(){},Ke.prototype.setFillStrokeStyle=function(){},Ke.prototype.setImageStyle=function(){},Ke.prototype.setTextStyle=function(){};var $e=function(t,i,s,h,n){Ke.call(this),this.context_=t,this.pixelRatio_=i,this.extent_=s,this.transform_=h,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Oh.create()};Gs.inherits($e,Ke),$e.prototype.drawImages_=function(t,i,s){if(this.image_){var h=yh(t,i,s,2,this.transform_,this.pixelCoordinates_),n=this.context_,e=this.tmpLocalTransform_,r=n.globalAlpha;1!=this.imageOpacity_&&(n.globalAlpha=r*this.imageOpacity_);var a,o,u=this.imageRotation_;for(this.imageRotateWithView_&&(u+=this.viewRotation_),a=0,o=h.length;a<o;a+=2){var c=h[a]-this.imageAnchorX_,l=h[a+1]-this.imageAnchorY_;if(this.imageSnapToPixel_&&(c=Math.round(c),l=Math.round(l)),0!==u||1!=this.imageScale_){var f=c+this.imageAnchorX_,d=l+this.imageAnchorY_;Oh.compose(e,f,d,this.imageScale_,this.imageScale_,u,-f,-d),n.setTransform.apply(n,e)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,l,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||n.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(n.globalAlpha=r)}},$e.prototype.drawText_=function(t,i,s,h){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=yh(t,i,s,h,this.transform_,this.pixelCoordinates_),e=this.context_,r=this.textRotation_;for(this.textRotateWithView_&&(r+=this.viewRotation_);i<s;i+=h){var a=n[i]+this.textOffsetX_,o=n[i+1]+this.textOffsetY_;if(0!==r||1!=this.textScale_){var u=Oh.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,r,-a,-o);e.setTransform.apply(e,u)}this.textStrokeState_&&e.strokeText(this.text_,a,o),this.textFillState_&&e.fillText(this.text_,a,o)}0===r&&1==this.textScale_||e.setTransform(1,0,0,1,0,0)}},$e.prototype.moveToLineTo_=function(t,i,s,h,n){var e=this.context_,r=yh(t,i,s,h,this.transform_,this.pixelCoordinates_);e.moveTo(r[0],r[1]);var a=r.length;n&&(a-=2);for(var o=2;o<a;o+=2)e.lineTo(r[o],r[o+1]);return n&&e.closePath(),s},$e.prototype.drawRings_=function(t,i,s,h){var n,e;for(n=0,e=s.length;n<e;++n)i=this.moveToLineTo_(t,i,s[n],h,!0);return i},$e.prototype.drawCircle=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=Lh.transform2D(t,this.transform_,this.pixelCoordinates_),s=i[2]-i[0],h=i[3]-i[1],n=Math.sqrt(s*s+h*h),e=this.context_;e.beginPath(),e.arc(i[0],i[1],n,0,2*Math.PI),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},$e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},$e.prototype.drawGeometry=function(t){switch(t.getType()){case ah:this.drawPoint(t);break;case oh:this.drawLineString(t);break;case ch:this.drawPolygon(t);break;case lh:this.drawMultiPoint(t);break;case fh:this.drawMultiLineString(t);break;case dh:this.drawMultiPolygon(t);break;case vh:this.drawGeometryCollection(t);break;case mh:this.drawCircle(t)}},$e.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&zh.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},$e.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},$e.prototype.drawPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},$e.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},$e.prototype.drawLineString=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(s,0,s.length,t.getStride(),!1),i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoint();this.drawText_(h,0,2,2)}}},$e.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(zh.intersects(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s,h,n=this.context_,e=t.getFlatCoordinates(),r=0,a=t.getEnds(),o=t.getStride();for(n.beginPath(),s=0,h=a.length;s<h;++s)r=this.moveToLineTo_(e,r,a[s],o,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},$e.prototype.drawPolygon=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(""!==this.text_){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}}},$e.prototype.drawMultiPolygon=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i,s,h=this.context_,n=t.getOrientedFlatCoordinates(),e=0,r=t.getEndss(),a=t.getStride();for(h.beginPath(),i=0,s=r.length;i<s;++i)e=this.drawRings_(n,e,r[i],a);this.fillState_&&h.fill(),this.strokeState_&&h.stroke()}if(""!==this.text_){var o=t.getFlatInteriorPoints();this.drawText_(o,0,o.length,2)}}},$e.prototype.setContextFillState_=function(t){var i=this.context_,s=this.contextFillState_;s?s.fillStyle!=t.fillStyle&&(s.fillStyle=i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},$e.prototype.setContextStrokeState_=function(t){var i=this.context_,s=this.contextStrokeState_;s?(s.lineCap!=t.lineCap&&(s.lineCap=i.lineCap=t.lineCap),tn.CANVAS_LINE_DASH&&(_h.equals(s.lineDash,t.lineDash)||i.setLineDash(s.lineDash=t.lineDash),s.lineDashOffset!=t.lineDashOffset&&(s.lineDashOffset=i.lineDashOffset=t.lineDashOffset)),s.lineJoin!=t.lineJoin&&(s.lineJoin=i.lineJoin=t.lineJoin),s.lineWidth!=t.lineWidth&&(s.lineWidth=i.lineWidth=t.lineWidth),s.miterLimit!=t.miterLimit&&(s.miterLimit=i.miterLimit=t.miterLimit),s.strokeStyle!=t.strokeStyle&&(s.strokeStyle=i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,tn.CANVAS_LINE_DASH&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},$e.prototype.setContextTextState_=function(t){var i=this.context_,s=this.contextTextState_,h=t.textAlign?t.textAlign:Ye.defaultTextAlign;s?(s.font!=t.font&&(s.font=i.font=t.font),s.textAlign!=h&&(s.textAlign=h),s.textBaseline!=t.textBaseline&&(s.textBaseline=i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=h,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:h,textBaseline:t.textBaseline})},$e.prototype.setFillStrokeStyle=function(t,i){if(t){var s=t.getColor();this.fillState_={fillStyle:Ze.asColorLike(s||Ye.defaultFillStyle)}}else this.fillState_=null;if(i){var h=i.getColor(),n=i.getLineCap(),e=i.getLineDash(),r=i.getLineDashOffset(),a=i.getLineJoin(),o=i.getWidth(),u=i.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:Ye.defaultLineCap,lineDash:e||Ye.defaultLineDash,lineDashOffset:r||Ye.defaultLineDashOffset,lineJoin:void 0!==a?a:Ye.defaultLineJoin,lineWidth:this.pixelRatio_*(void 0!==o?o:Ye.defaultLineWidth),miterLimit:void 0!==u?u:Ye.defaultMiterLimit,strokeStyle:Ze.asColorLike(h||Ye.defaultStrokeStyle)}}else this.strokeState_=null},$e.prototype.setImageStyle=function(t){if(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getOrigin(),n=t.getSize();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=n[1],this.image_=s,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=h[0],this.imageOriginY_=h[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null},$e.prototype.setTextStyle=function(t){if(t){var i=t.getFill();if(i){var s=i.getColor();this.textFillState_={fillStyle:Ze.asColorLike(s||Ye.defaultFillStyle)}}else this.textFillState_=null;var h=t.getStroke();if(h){var n=h.getColor(),e=h.getLineCap(),r=h.getLineDash(),a=h.getLineDashOffset(),o=h.getLineJoin(),u=h.getWidth(),c=h.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:Ye.defaultLineCap,lineDash:r||Ye.defaultLineDash,lineDashOffset:a||Ye.defaultLineDashOffset,lineJoin:void 0!==o?o:Ye.defaultLineJoin,lineWidth:void 0!==u?u:Ye.defaultLineWidth,miterLimit:void 0!==c?c:Ye.defaultMiterLimit,strokeStyle:Ze.asColorLike(n||Ye.defaultStrokeStyle)}}else this.textStrokeState_=null;var l=t.getFont(),f=t.getOffsetX(),d=t.getOffsetY(),v=t.getRotateWithView(),m=t.getRotation(),p=t.getScale(),_=t.getText(),g=t.getTextAlign(),z=t.getTextBaseline();this.textState_={font:void 0!==l?l:Ye.defaultFont,textAlign:void 0!==g?g:Ye.defaultTextAlign,textBaseline:void 0!==z?z:Ye.defaultTextBaseline},this.text_=void 0!==_?_:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==v&&v,this.textRotation_=void 0!==m?m:0,this.textScale_=this.pixelRatio_*(void 0!==p?p:1)}else this.text_=""};var Qe=function(t){sh.call(this),this.layer_=t};Gs.inherits(Qe,sh),Qe.prototype.forEachFeatureAtCoordinate=Gs.nullFunction,Qe.prototype.hasFeatureAtCoordinate=xh.FALSE,Qe.prototype.createLoadedTileFinder=function(t,i,s){return function(h,n){return t.forEachLoadedTile(i,h,n,(function(t){s[h]||(s[h]={}),s[h][t.tileCoord.toString()]=t}))}},Qe.prototype.getLayer=function(){return this.layer_},Qe.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},Qe.prototype.loadImage=function(t){var i=t.getState();return 2!=i&&3!=i&&js.listen(t,Bs,this.handleImageChange_,this),0==i&&(t.load(),i=t.getState()),2==i},Qe.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Qn&&this.changed()},Qe.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var h=Gs.getUid(t).toString();h in s.usedTiles&&t.expireCache(s.viewState.projection,s.usedTiles[h])}.bind(null,i);t.postRenderFunctions.push(s)}},Qe.prototype.updateLogos=function(t,i){var s=i.getLogo();void 0!==s&&("string"==typeof s?t.logos[s]="":s&&(eh("string"==typeof s.href,44),eh("string"==typeof s.src,45),t.logos[s.src]=s.href))},Qe.prototype.updateUsedTiles=function(t,i,s,h){var n=Gs.getUid(i).toString(),e=s.toString();n in t?e in t[n]?t[n][e].extend(h):t[n][e]=h:(t[n]={},t[n][e]=h)},Qe.prototype.manageTilePyramid=function(t,i,s,h,n,e,r,a,o,u){var c=Gs.getUid(i).toString();c in t.wantedTiles||(t.wantedTiles[c]={});var l,f,d,v,m,p,_=t.wantedTiles[c],g=t.tileQueue;for(p=s.getMinZoom();p<=r;++p)for(f=s.getTileRangeForExtentAndZ(e,p,f),d=s.getResolution(p),v=f.minX;v<=f.maxX;++v)for(m=f.minY;m<=f.maxY;++m)r-p<=a?(0==(l=i.getTile(p,v,m,h,n)).getState()&&(_[l.getKey()]=!0,g.isKeyQueued(l.getKey())||g.enqueue([l,c,s.getTileCoordCenter(l.tileCoord),d])),void 0!==o&&o.call(u,l)):i.useTile(p,v,m,n)};var tr=function(t){Qe.call(this,t),this.transform_=Oh.create()};Gs.inherits(tr,Qe),tr.prototype.clip=function(t,i,s){var h=i.pixelRatio,n=i.size[0]*h,e=i.size[1]*h,r=i.viewState.rotation,a=zh.getTopLeft(s),o=zh.getTopRight(s),u=zh.getBottomRight(s),c=zh.getBottomLeft(s);Oh.apply(i.coordinateToPixelTransform,a),Oh.apply(i.coordinateToPixelTransform,o),Oh.apply(i.coordinateToPixelTransform,u),Oh.apply(i.coordinateToPixelTransform,c),t.save(),Ye.rotateAtOffset(t,-r,n/2,e/2),t.beginPath(),t.moveTo(a[0]*h,a[1]*h),t.lineTo(o[0]*h,o[1]*h),t.lineTo(u[0]*h,u[1]*h),t.lineTo(c[0]*h,c[1]*h),t.clip(),Ye.rotateAtOffset(t,r,n/2,e/2)},tr.prototype.dispatchComposeEvent_=function(t,i,s,h){var n=this.getLayer();if(n.hasListener(t)){var e=s.size[0]*s.pixelRatio,r=s.size[1]*s.pixelRatio,a=s.viewState.rotation;Ye.rotateAtOffset(i,-a,e/2,r/2);var o=void 0!==h?h:this.getTransform(s,0),u=new $e(i,s.pixelRatio,s.extent,o,s.viewState.rotation),c=new qe(t,u,s,i,null);n.dispatchEvent(c),Ye.rotateAtOffset(i,a,e/2,r/2)}},tr.prototype.forEachLayerAtCoordinate=function(t,i,s,h){return this.forEachFeatureAtCoordinate(t,i,0,xh.TRUE,this)?s.call(h,this.getLayer(),null):void 0},tr.prototype.postCompose=function(t,i,s,h){this.dispatchComposeEvent_(ve,t,i,h)},tr.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(me,t,i,s)},tr.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(pe,t,i,s)},tr.prototype.getTransform=function(t,i){var s=t.viewState,h=t.pixelRatio,n=h/s.resolution;return Oh.compose(this.transform_,h*t.size[0]/2,h*t.size[1]/2,n,-n,-s.rotation,-s.center[0]+i,-s.center[1])},tr.prototype.composeFrame=function(){},tr.prototype.prepareFrame=function(){};var ir=function(t){tr.call(this,t),this.coordinateToCanvasPixelTransform=Oh.create(),this.hitCanvasContext_=null};Gs.inherits(ir,tr),ir.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var h=this.getImage();if(h){var n=i.extent,e=void 0!==n&&!zh.containsExtent(n,t.extent)&&zh.intersects(n,t.extent);e&&this.clip(s,t,n);var r=this.getImageTransform(),a=s.globalAlpha;s.globalAlpha=i.opacity;var o=r[5],u=h.width*r[0],c=h.height*r[3];s.drawImage(h,0,0,+h.width,+h.height,Math.round(r[4]),Math.round(o),Math.round(u),Math.round(c)),s.globalAlpha=a,e&&s.restore()}this.postCompose(s,t,i)},ir.prototype.getImage=function(){},ir.prototype.getImageTransform=function(){},ir.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=this.getLayer();return e.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,e)}))},ir.prototype.forEachLayerAtCoordinate=function(t,i,s,h){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Gs.nullFunction)return tr.prototype.forEachLayerAtCoordinate.apply(this,arguments);var n=Oh.apply(this.coordinateToCanvasPixelTransform,t.slice());On.scale(n,i.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Dn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),n[0],n[1],1,1,0,0,1,1);var e=this.hitCanvasContext_.getImageData(0,0,1,1).data;return e[3]>0?s.call(h,this.getLayer(),e):void 0}};var sr=function(t){ir.call(this,t),this.image_=null,this.imageTransform_=Oh.create(),this.skippedFeatures_=[],this.vectorRenderer_=null};Gs.inherits(sr,ir),sr.handles=function(t,i){return t===ne&&(i.getType()===je||i.getType()===Ve&&"image"===i.getRenderMode())},sr.create=function(t,i){var s=new sr(i);if(i.getType()===Ve)for(var h=he.getLayerRendererPlugins(),n=0,e=h.length;n<e;++n){var r=h[n];r!==sr&&r.handles(ne,i)&&s.setVectorRenderer(r.create(t,i))}return s},sr.prototype.getImage=function(){return this.image_?this.image_.getImage():null},sr.prototype.getImageTransform=function(){return this.imageTransform_},sr.prototype.prepareFrame=function(t,i){var s,h=t.pixelRatio,n=t.size,e=t.viewState,r=e.center,a=e.resolution,o=this.getLayer().getSource(),u=t.viewHints,c=t.extent;if(void 0!==i.extent&&(c=zh.getIntersection(c,i.extent)),!u[0]&&!u[1]&&!zh.isEmpty(c)){var l=e.projection;if(!Gs.ENABLE_RASTER_REPROJECTION){var f=o.getProjection();f&&(l=f)}var d=this.vectorRenderer_;if(d){var v=d.context,m=Ws.assign({},t,{size:[zh.getWidth(c)/a,zh.getHeight(c)/a],viewState:Ws.assign({},t.viewState,{rotation:0})}),p=Object.keys(m.skippedFeatureUids).sort();!d.prepareFrame(m,i)||!d.replayGroupChanged&&_h.equals(p,this.skippedFeatures_)||(v.canvas.width=m.size[0]*h,v.canvas.height=m.size[1]*h,d.composeFrame(m,i,v),this.image_=new We(c,a,h,v.canvas),this.skippedFeatures_=p)}else(s=o.getImage(c,a,h,l))&&this.loadImage(s)&&(this.image_=s)}if(this.image_){var _=(s=this.image_).getExtent(),g=s.getResolution(),z=s.getPixelRatio(),M=h*g/(a*z),w=Oh.compose(this.imageTransform_,h*n[0]/2,h*n[1]/2,M,M,0,z*(_[0]-r[0])/g,z*(r[1]-_[3])/g);Oh.compose(this.coordinateToCanvasPixelTransform,h*n[0]/2-w[4],h*n[1]/2-w[5],h/a,-h/a,0,-r[0],-r[1]),this.updateLogos(t,o),this.renderedResolution=g*h/z}return!!this.image_},sr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,h,n):ir.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,h,n)},sr.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var hr=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};hr.getKey=function(t,i,s){return i+":"+t+":"+(s?Je.asString(s):"null")},hr.prototype.clear=function(){this.cache_={},this.cacheSize_=0},hr.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t,i=0;for(t in this.cache_)3&i++||this.cache_[t].hasListener()||(delete this.cache_[t],--this.cacheSize_)}},hr.prototype.get=function(t,i,s){var h=hr.getKey(t,i,s);return h in this.cache_?this.cache_[h]:null},hr.prototype.set=function(t,i,s,h){var n=hr.getKey(t,i,s);this.cache_[n]=h,++this.cacheSize_},hr.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var nr={};nr.iconImageCache=new hr;var er=function(t,i){Us.call(this),this.map_=i,this.layerRenderers_={},this.layerRendererListeners_={}};Gs.inherits(er,Us),er.prototype.calculateMatrices2D=function(t){var i=t.viewState,s=t.coordinateToPixelTransform,h=t.pixelToCoordinateTransform;Oh.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),Oh.invert(Oh.setFromArray(h,s))},er.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},er.expireIconCache_=function(){nr.iconImageCache.expire()},er.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a,o=i.viewState,u=o.resolution;function c(t,s){var e=Gs.getUid(t).toString(),r=i.layerStates[Gs.getUid(s)].managed;if(!(e in i.skippedFeatureUids)||r)return h.call(n,t,r?s:null)}var l=o.projection,f=t;if(l.canWrapX()){var d=l.getExtent(),v=zh.getWidth(d),m=t[0];(m<d[0]||m>d[2])&&(f=[m+v*Math.ceil((d[0]-m)/v),t[1]])}var p,_=i.layerStatesArray;for(p=_.length-1;p>=0;--p){var g=_[p],z=g.layer;if(_e.visibleAtResolution(g,u)&&e.call(r,z)){var M=this.getLayerRenderer(z);if(z.getSource()&&(a=M.forEachFeatureAtCoordinate(z.getSource().getWrapX()?f:t,i,s,c,n)),a)return a}}},er.prototype.forEachLayerAtPixel=function(){},er.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){return void 0!==this.forEachFeatureAtCoordinate(t,i,s,xh.TRUE,this,h,n)},er.prototype.getLayerRenderer=function(t){var i=Gs.getUid(t).toString();if(i in this.layerRenderers_)return this.layerRenderers_[i];for(var s,h=he.getLayerRendererPlugins(),n=this.getType(),e=0,r=h.length;e<r;++e){var a=h[e];if(a.handles(n,t)){s=a.create(this,t);break}}if(!s)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[i]=s,this.layerRendererListeners_[i]=js.listen(s,Bs,this.handleLayerRendererChange_,this),s},er.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},er.prototype.getLayerRenderers=function(){return this.layerRenderers_},er.prototype.getMap=function(){return this.map_},er.prototype.getType=function(){},er.prototype.handleLayerRendererChange_=function(){this.map_.render()},er.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];return delete this.layerRenderers_[t],js.unlistenByKey(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],i},er.prototype.renderFrame=Gs.nullFunction,er.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_)i&&s in i.layerStates||this.removeLayerRendererByKey_(s).dispose()},er.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(er.expireIconCache_)},er.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_)if(!(i in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},er.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var rr=function(t,i){er.call(this,t,i),this.context_=Dn(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=de.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=Oh.create()};Gs.inherits(rr,er),rr.handles=function(t){return t===ne},rr.create=function(t,i){return new rr(t,i)},rr.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap(),h=this.context_;if(s.hasListener(t)){var n=i.extent,e=i.pixelRatio,r=i.viewState.rotation,a=this.getTransform(i),o=new $e(h,e,n,a,r),u=new qe(t,o,i,h,null);s.dispatchEvent(u)}},rr.prototype.getTransform=function(t){var i=t.viewState,s=t.pixelRatio/i.resolution;return Oh.compose(this.transform_,this.canvas_.width/2,this.canvas_.height/2,s,-s,-i.rotation,-i.center[0],-i.center[1])},rr.prototype.getType=function(){return ne},rr.prototype.renderFrame=function(t){if(t){var i=this.context_,s=t.pixelRatio,h=Math.round(t.size[0]*s),n=Math.round(t.size[1]*s);this.canvas_.width!=h||this.canvas_.height!=n?(this.canvas_.width=h,this.canvas_.height=n):i.clearRect(0,0,h,n);var e=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(me,t);var r=t.layerStatesArray;_h.stableSort(r,er.sortByZIndex),e&&(i.save(),Ye.rotateAtOffset(i,e,h/2,n/2));var a,o,u,c,l=t.viewState.resolution;for(a=0,o=r.length;a<o;++a)u=this.getLayerRenderer((c=r[a]).layer),_e.visibleAtResolution(c,l)&&c.sourceState==Qn&&u.prepareFrame(t,c)&&u.composeFrame(t,c,i);e&&i.restore(),this.dispatchComposeEvent_(ve,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},rr.prototype.forEachLayerAtPixel=function(t,i,s,h,n,e){var r,a,o=i.viewState.resolution,u=i.layerStatesArray,c=u.length,l=Oh.apply(i.pixelToCoordinateTransform,t.slice());for(a=c-1;a>=0;--a){var f=u[a],d=f.layer;if(_e.visibleAtResolution(f,o)&&n.call(e,d)&&(r=this.getLayerRenderer(d).forEachLayerAtCoordinate(l,i,s,h)))return r}};var ar=function(t,i,s,h){this.minX=t,this.maxX=i,this.minY=s,this.maxY=h};ar.createOrUpdate=function(t,i,s,h,n){return void 0!==n?(n.minX=t,n.maxX=i,n.minY=s,n.maxY=h,n):new ar(t,i,s,h)},ar.prototype.contains=function(t){return this.containsXY(t[1],t[2])},ar.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},ar.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY},ar.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},ar.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},ar.prototype.getHeight=function(){return this.maxY-this.minY+1},ar.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},ar.prototype.getWidth=function(){return this.maxX-this.minX+1},ar.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var or=function(t){ir.call(this,t),this.context=null===this.context?null:Dn(),this.renderedExtent_=null,this.renderedTiles=[],this.tmpExtent=zh.createEmpty(),this.tmpTileRange_=new ar(0,0,0,0),this.imageTransform_=Oh.create(),this.zDirection=0};Gs.inherits(or,ir),or.handles=function(t,i){return t===ne&&i.getType()===Ue},or.create=function(t,i){return new or(i)},or.prototype.isDrawableTile_=function(t){var i=t.getState(),s=this.getLayer().getUseInterimTilesOnError();return 2==i||4==i||3==i&&!s},or.prototype.prepareFrame=function(t,i){var s=t.pixelRatio,h=t.size,n=t.viewState,e=n.projection,r=n.resolution,a=n.center,o=this.getLayer(),u=o.getSource(),c=u.getRevision(),l=u.getTileGridForProjection(e),f=l.getZForResolution(r,this.zDirection),d=l.getResolution(f),v=Math.round(r/d)||1,m=t.extent;if(void 0!==i.extent&&(m=zh.getIntersection(m,i.extent)),zh.isEmpty(m))return!1;var p=l.getTileRangeForExtentAndZ(m,f),_=l.getTileRangeExtent(f,p),g=u.getTilePixelRatio(s),z={};z[f]={};var M,w,b,x=this.createLoadedTileFinder(u,e,z),y=this.tmpExtent,E=this.tmpTileRange_,S=!1;for(w=p.minX;w<=p.maxX;++w)for(b=p.minY;b<=p.maxY;++b){if(3==(M=u.getTile(f,w,b,s,e)).getState()&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(S=!0):M.setState(2)),this.isDrawableTile_(M)||(M=M.getInterimTile()),this.isDrawableTile_(M)){var P=Gs.getUid(this);if(2==M.getState()){z[f][M.tileCoord.toString()]=M;var G=M.inTransition(P);S||!G&&-1!==this.renderedTiles.indexOf(M)||(S=!0)}if(1===M.getAlpha(P,t.time))continue}var k=l.getTileCoordChildTileRange(M.tileCoord,E,y),N=!1;k&&(N=x(f+1,k)),N||l.forEachTileCoordParentTileRange(M.tileCoord,x,null,E,y)}var C=d*s/g*v,A=t.viewHints,R=A[0]||A[1];if(!(this.renderedResolution&&Date.now()-t.time>16&&R)&&(S||!this.renderedExtent_||!zh.containsExtent(this.renderedExtent_,m)||this.renderedRevision!=c||v!=this.oversampling_||!R&&C!=this.renderedResolution)){var I=this.context;if(I){var T=u.getTilePixelSize(f,s,e),O=Math.round(p.getWidth()*T[0]/v),F=Math.round(p.getHeight()*T[1]/v),L=I.canvas;L.width!=O||L.height!=F?(this.oversampling_=v,L.width=O,L.height=F):(this.renderedExtent_&&!zh.equals(_,this.renderedExtent_)&&I.clearRect(0,0,O,F),v=this.oversampling_)}this.renderedTiles.length=0;var D,W,j,U,V,q,B,X,H=Object.keys(z).map(Number);for(H.sort((function(t,i){return t===f?1:i===f?-1:t>i?1:t<i?-1:0})),U=0,V=H.length;U<V;++U)for(var Y in W=u.getTilePixelSize(j=H[U],s,e),D=l.getResolution(j)/d,B=g*u.getGutter(e),X=z[j])q=l.getTileCoordExtent((M=X[Y]).getTileCoord(),y),this.drawTileImage(M,t,i,w=(q[0]-_[0])/d*g/v,b=(_[3]-q[3])/d*g/v,W[0]*D/v,W[1]*D/v,B,f===j),this.renderedTiles.push(M);this.renderedRevision=c,this.renderedResolution=d*s/g*v,this.renderedExtent_=_}var J=this.renderedResolution/r,Z=Oh.compose(this.imageTransform_,s*h[0]/2,s*h[1]/2,J,J,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);return Oh.compose(this.coordinateToCanvasPixelTransform,s*h[0]/2-Z[4],s*h[1]/2-Z[5],s/r,-s/r,0,-a[0],-a[1]),this.updateUsedTiles(t.usedTiles,u,f,p),this.manageTilePyramid(t,u,l,s,e,m,f,o.getPreload()),this.scheduleExpireCache(t,u),this.updateLogos(t,u),this.renderedTiles.length>0},or.prototype.drawTileImage=function(t,i,s,h,n,e,r,a,o){var u=t.getImage(this.getLayer());if(u){var c=Gs.getUid(this),l=o?t.getAlpha(c,i.time):1;1!==l||this.getLayer().getSource().getOpaque(i.viewState.projection)||this.context.clearRect(h,n,e,r);var f=l!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=l),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,h,n,e,r),f&&this.context.restore(),1!==l?i.animate=!0:o&&t.endTransition(c)}},or.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},or.prototype.getImageTransform=function(){return this.imageTransform_};var ur,cr,lr,fr={exports:{}};function dr(){return ur||(ur=1,fr.exports=function(){function t(s,h,n,e,r){for(;e>n;){if(e-n>600){var a=e-n+1,o=h-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(o-a/2<0?-1:1);t(s,h,Math.max(n,Math.floor(h-o*c/a+l)),Math.min(e,Math.floor(h+(a-o)*c/a+l)),r)}var f=s[h],d=n,v=e;for(i(s,n,h),r(s[e],f)>0&&i(s,n,e);d<v;){for(i(s,d,v),d++,v--;r(s[d],f)<0;)d++;for(;r(s[v],f)>0;)v--}0===r(s[n],f)?i(s,n,v):i(s,++v,e),v<=h&&(n=v+1),h<=v&&(e=v-1)}}function i(t,i,s){var h=t[i];t[i]=t[s],t[s]=h}function s(t,i){return t<i?-1:t>i?1:0}return function(i,h,n,e,r){t(i,h,n||0,e||i.length-1,r||s)}}()),fr.exports}var vr=function(){if(lr)return cr;lr=1,cr=i;var t=dr();function i(t,s){if(!(this instanceof i))return new i(t,s);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),s&&this._initFormat(s),this.clear()}function s(t,i,s){if(!s)return i.indexOf(t);for(var h=0;h<i.length;h++)if(s(t,i[h]))return h;return-1}function h(t,i){n(t,0,t.children.length,i,t)}function n(t,i,s,h,n){n||(n=f(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var r,a=i;a<s;a++)r=t.children[a],e(n,t.leaf?h(r):r);return n}function e(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function r(t,i){return t.minX-i.minX}function a(t,i){return t.minY-i.minY}function o(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function c(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function l(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,s,h,n,e){for(var r,a=[s,h];a.length;)(h=a.pop())-(s=a.pop())<=n||(r=s+Math.ceil((h-s)/n/2)*n,t(i,r,s,h,e),a.push(s,r,r,h))}return i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],h=this.toBBox;if(!l(t,i))return s;for(var n,e,r,a,o=[];i;){for(n=0,e=i.children.length;n<e;n++)r=i.children[n],l(t,a=i.leaf?h(r):r)&&(i.leaf?s.push(r):c(t,a)?this._all(r,s):o.push(r));i=o.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!l(t,i))return!1;for(var h,n,e,r,a=[];i;){for(h=0,n=i.children.length;h<n;h++)if(e=i.children[h],l(t,r=i.leaf?s(e):e)){if(i.leaf||c(t,r))return!0;a.push(e)}i=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++)this.insert(t[i]);return this}var h=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===h.height)this._splitRoot(this.data,h);else{if(this.data.height<h.height){var n=this.data;this.data=h,h=n}this._insert(h,this.data.height-h.height-1,!0)}else this.data=h;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=f([]),this},remove:function(t,i){if(!t)return this;for(var h,n,e,r,a=this.data,o=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],h=l.pop(),r=!0),a.leaf&&-1!==(e=s(t,a.children,i)))return a.children.splice(e,1),u.push(a),this._condense(u),this;r||a.leaf||!c(a,o)?n?(h++,a=n.children[h],r=!1):a=null:(u.push(a),l.push(h),h=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:r,compareMinY:a,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var s=[];t;)t.leaf?i.push.apply(i,t.children):s.push.apply(s,t.children),t=s.pop();return i},_build:function(t,i,s,n){var e,r=s-i+1,a=this._maxEntries;if(r<=a)return h(e=f(t.slice(i,s+1)),this.toBBox),e;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(e=f([])).leaf=!1,e.height=n;var o,u,c,l,v=Math.ceil(r/a),m=v*Math.ceil(Math.sqrt(a));for(d(t,i,s,m,this.compareMinX),o=i;o<=s;o+=m)for(d(t,o,c=Math.min(o+m-1,s),v,this.compareMinY),u=o;u<=c;u+=v)l=Math.min(u+v-1,c),e.children.push(this._build(t,u,l,n-1));return h(e,this.toBBox),e},_chooseSubtree:function(t,i,s,h){for(var n,e,r,a,u,c,l,f,d,v;h.push(i),!i.leaf&&h.length-1!==s;){for(l=f=1/0,n=0,e=i.children.length;n<e;n++)u=o(r=i.children[n]),d=t,v=r,(c=(Math.max(v.maxX,d.maxX)-Math.min(v.minX,d.minX))*(Math.max(v.maxY,d.maxY)-Math.min(v.minY,d.minY))-u)<f?(f=c,l=u<l?u:l,a=r):c===f&&u<l&&(l=u,a=r);i=a||i.children[0]}return i},_insert:function(t,i,s){var h=s?t:(0,this.toBBox)(t),n=[],r=this._chooseSubtree(h,this.data,i,n);for(r.children.push(t),e(r,h);i>=0&&n[i].children.length>this._maxEntries;)this._split(n,i),i--;this._adjustParentBBoxes(h,n,i)},_split:function(t,i){var s=t[i],n=s.children.length,e=this._minEntries;this._chooseSplitAxis(s,e,n);var r=this._chooseSplitIndex(s,e,n),a=f(s.children.splice(r,s.children.length-r));a.height=s.height,a.leaf=s.leaf,h(s,this.toBBox),h(a,this.toBBox),i?t[i-1].children.push(a):this._splitRoot(s,a)},_splitRoot:function(t,i){this.data=f([t,i]),this.data.height=t.height+1,this.data.leaf=!1,h(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var h,e,r,a,u,c,l,f,d,v,m,p,_,g;for(c=l=1/0,h=i;h<=s-i;h++)d=e=n(t,0,h,this.toBBox),v=r=n(t,h,s,this.toBBox),void 0,void 0,void 0,void 0,m=Math.max(d.minX,v.minX),p=Math.max(d.minY,v.minY),_=Math.min(d.maxX,v.maxX),g=Math.min(d.maxY,v.maxY),a=Math.max(0,_-m)*Math.max(0,g-p),u=o(e)+o(r),a<c?(c=a,f=h,l=u<l?u:l):a===c&&u<l&&(l=u,f=h);return f},_chooseSplitAxis:function(t,i,s){var h=t.leaf?this.compareMinX:r,n=t.leaf?this.compareMinY:a;this._allDistMargin(t,i,s,h)<this._allDistMargin(t,i,s,n)&&t.children.sort(h)},_allDistMargin:function(t,i,s,h){t.children.sort(h);var r,a,o=this.toBBox,c=n(t,0,i,o),l=n(t,s-i,s,o),f=u(c)+u(l);for(r=i;r<s-i;r++)a=t.children[r],e(c,t.leaf?o(a):a),f+=u(c);for(r=s-i-1;r>=i;r--)a=t.children[r],e(l,t.leaf?o(a):a),f+=u(l);return f},_adjustParentBBoxes:function(t,i,s){for(var h=s;h>=0;h--)e(i[h],t)},_condense:function(t){for(var i,s=t.length-1;s>=0;s--)0===t[s].children.length?s>0?(i=t[s-1].children).splice(i.indexOf(t[s]),1):this.clear():h(t[s],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},cr}(),mr=d(vr),pr=function(){};pr.prototype.getReplay=function(){},pr.prototype.isEmpty=function(){};var _r="Circle",gr="Default",zr="Image",Mr="LineString",wr="Polygon",br="Text",xr={lineString:function(t,i,s,h){var n,e=t[i],r=t[i+1],a=0;for(n=i+h;n<s;n+=h){var o=t[n],u=t[n+1];a+=Math.sqrt((o-e)*(o-e)+(u-r)*(u-r)),e=o,r=u}return a},linearRing:function(t,i,s,h){var n=xr.lineString(t,i,s,h),e=t[s-h]-t[i],r=t[s-h+1]-t[i+1];return n+Math.sqrt(e*e+r*r)}},yr=function(t,i,s,h,n,e,r,a){for(var o,u,c=[],l=t[i]>t[s-h],f=n.length,d=t[i],v=t[i+1],m=t[i+=h],p=t[i+1],_=0,g=Math.sqrt(Math.pow(m-d,2)+Math.pow(p-v,2)),z="",M=0,w=0;w<f;++w){var b=n.charAt(l?f-w-1:w),x=e(z=l?b+z:z+b)-M;M+=x;for(var y=r+x/2;i<s-h&&_+g<y;)d=m,v=p,m=t[i+=h],p=t[i+1],_+=g,g=Math.sqrt(Math.pow(m-d,2)+Math.pow(p-v,2));var E=y-_,S=Math.atan2(p-v,m-d);if(l&&(S+=S>0?-Math.PI:Math.PI),void 0!==u){var P=S-u;if(P+=P>Math.PI?-2*Math.PI:P<-Math.PI?2*Math.PI:0,Math.abs(P)>a)return null}var G=E/g,k=rh.lerp(d,m,G),N=rh.lerp(v,p,G);u==S?(l&&(o[0]=k,o[1]=N,o[2]=x/2),o[4]=z):(M=x,o=[k,N,x/2,S,z=b],l?c.unshift(o):c.push(o),u=S),r+=x}return c},Er=11,Sr=12,Pr={};Pr.ORDER=[wr,_r,Mr,zr,br,gr],Pr.TEXT_ALIGN={},Pr.TEXT_ALIGN.left=0,Pr.TEXT_ALIGN.end=0,Pr.TEXT_ALIGN.center=.5,Pr.TEXT_ALIGN.right=1,Pr.TEXT_ALIGN.start=1,Pr.TEXT_ALIGN.top=0,Pr.TEXT_ALIGN.middle=.5,Pr.TEXT_ALIGN.hanging=.2,Pr.TEXT_ALIGN.alphabetic=.8,Pr.TEXT_ALIGN.ideographic=.8,Pr.TEXT_ALIGN.bottom=1;var Gr=function(t,i,s,h,n,e){Ke.call(this),this.declutterTree=e,this.tmpExtent_=zh.createEmpty(),this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=h,this.maxLineWidth=0,this.resolution=s,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=Oh.create(),this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0,this.tmpLocalTransform_=Oh.create(),this.resetTransform_=Oh.create()};Gs.inherits(Gr,Ke),Gr.prototype.replayTextBackground_=function(t,i,s,h,n,e,r){t.beginPath(),t.moveTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,h),t.lineTo.apply(t,n),t.lineTo.apply(t,i),e&&(this.fillOrigin_=e[2],this.fill_(t)),r&&(this.setStrokeStyle_(t,r),t.stroke())},Gr.prototype.replayImage_=function(t,i,s,h,n,e,r,a,o,u,c,l,f,d,v,m,p,_){var g=p||_,z=this.tmpLocalTransform_;i-=n*=f,s-=e*=f,d&&(i=Math.round(i),s=Math.round(s));var M,w,b,x,y=v+u>h.width?h.width-u:v,E=a+c>h.height?h.height-c:a,S=this.tmpExtent_,P=m[3]+y*f+m[1],G=m[0]+E*f+m[2],k=i-m[3],N=s-m[0];(g||0!==l)&&(M=[k,N],w=[k+P,N],b=[k+P,N+G],x=[k,N+G]);var C=null;if(0!==l){var A=i+n,R=s+e;C=Oh.compose(z,A,R,1,1,l,-A,-R),zh.createOrUpdateEmpty(S),zh.extendCoordinate(S,Oh.apply(z,M)),zh.extendCoordinate(S,Oh.apply(z,w)),zh.extendCoordinate(S,Oh.apply(z,b)),zh.extendCoordinate(S,Oh.apply(z,x))}else zh.createOrUpdate(k,N,k+P,N+G,S);var I=t.canvas,T=S[0]<=I.width&&S[2]>=0&&S[1]<=I.height&&S[3]>=0;if(r){if(!T&&1==r[4])return;zh.extend(r,S);var O=T?[t,C?C.slice(0):null,o,h,u,c,y,E,i,s,f]:null;O&&g&&O.push(p,_,M,w,b,x),r.push(O)}else T&&(g&&this.replayTextBackground_(t,M,w,b,x,p,_),Ye.drawImage(t,C,o,h,u,c,y,E,i,s,f))},Gr.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return 1==i?t:t.map((function(t){return t*i}))},Gr.prototype.appendFlatCoordinates=function(t,i,s,h,n,e){var r=this.coordinates.length,a=this.getBufferedMaxExtent();e&&(i+=h);var o,u,c,l=[t[i],t[i+1]],f=[NaN,NaN],d=!0;for(o=i+h;o<s;o+=h)f[0]=t[o],f[1]=t[o+1],(c=zh.coordinateRelationship(a,f))!==u?(d&&(this.coordinates[r++]=l[0],this.coordinates[r++]=l[1]),this.coordinates[r++]=f[0],this.coordinates[r++]=f[1],d=!1):1===c?(this.coordinates[r++]=f[0],this.coordinates[r++]=f[1],d=!1):d=!0,l[0]=f[0],l[1]=f[1],u=c;return(n&&d||o===i+h)&&(this.coordinates[r++]=l[0],this.coordinates[r++]=l[1]),r},Gr.prototype.drawCustomCoordinates_=function(t,i,s,h,n){for(var e=0,r=s.length;e<r;++e){var a=s[e],o=this.appendFlatCoordinates(t,i,a,h,!1,!1);n.push(o),i=a}return i},Gr.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var h,n,e,r,a,o=t.getType(),u=t.getStride(),c=this.coordinates.length;if(o==dh){h=t.getOrientedFlatCoordinates(),r=[];var l=t.getEndss();a=0;for(var f=0,d=l.length;f<d;++f){var v=[];a=this.drawCustomCoordinates_(h,a,l[f],u,v),r.push(v)}this.instructions.push([4,c,r,t,s,Uh.coordinatesss])}else o==ch||o==fh?(e=[],h=o==ch?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(h,0,t.getEnds(),u,e),this.instructions.push([4,c,e,t,s,Uh.coordinatess])):o==oh||o==lh?(h=t.getFlatCoordinates(),n=this.appendFlatCoordinates(h,0,h.length,u,!1,!1),this.instructions.push([4,c,n,t,s,Uh.coordinates])):o==ah&&(h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),this.instructions.push([4,c,n=this.coordinates.length,t,s]));this.endGeometry(t,i)},Gr.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[0,i,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[0,i,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},Gr.prototype.fill_=function(t){if(this.fillOrigin_){var i=Oh.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]),t.rotate(this.viewRotation_)}t.fill(),this.fillOrigin_&&t.setTransform.apply(t,Ye.resetTransform_)},Gr.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1],t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],tn.CANVAS_LINE_DASH&&(t.lineDashOffset=i[7],t.setLineDash(i[6]))},Gr.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(1==s||s==t.length-5){var h={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(h)){this.declutterTree.insert(h);for(var n=Ye.drawImage,e=5,r=t.length;e<r;++e){var a=t[e];a&&(a.length>11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),n.apply(void 0,a))}}t.length=5,zh.createOrUpdateEmpty(t)}}},Gr.prototype.replay_=function(t,i,s,h,n,e){var r;this.pixelCoordinates_&&_h.equals(i,this.renderedTransform_)?r=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),r=yh(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Oh.setFromArray(this.renderedTransform_,i));for(var a,o,u,c,l,f,d,v,m,p=!Ws.isEmpty(s),_=0,g=h.length,z=0,M=0,w=0,b=null,x=null,y=this.coordinateCache_,E=this.viewRotation_,S={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:E},P=this.instructions!=h||this.overlaps?0:200;_<g;){var G,k,N,C=h[_];switch(C[0]){case 0:G=C[1],p&&s[Gs.getUid(G).toString()]||!G.getGeometry()?_=C[2]:void 0===e||zh.intersects(e,G.getGeometry().getExtent())?++_:_=C[2]+1;break;case 1:M>P&&(this.fill_(t),M=0),w>P&&(t.stroke(),w=0),M||w||(t.beginPath(),c=l=NaN),++_;break;case 2:var A=r[z=C[1]],R=r[z+1],I=r[z+2]-A,T=r[z+3]-R,O=Math.sqrt(I*I+T*T);t.moveTo(A+O,R),t.arc(A,R,O,0,2*Math.PI,!0),++_;break;case 3:t.closePath(),++_;break;case 4:z=C[1],a=C[2];var F=C[4],L=6==C.length?C[5]:void 0;S.geometry=C[3],S.feature=G,_ in y||(y[_]=[]);var D=y[_];L?L(r,z,a,2,D):(D[0]=r[z],D[1]=r[z+1],D.length=2),F(D,S),++_;break;case 6:z=C[1],a=C[2],m=C[3],o=C[4],u=C[5],v=n?null:C[6];var W,j,U,V=C[7],q=C[8],B=C[9],X=C[10],H=C[12],Y=C[13],J=C[14],Z=C[15];for(C.length>16?(W=C[16],j=C[17],U=C[18]):(W=Ye.defaultPadding,j=U=!1),C[11]&&(H+=E);z<a;z+=2)this.replayImage_(t,r[z],r[z+1],m,o,u,v,V,q,B,X,H,Y,J,Z,W,j?b:null,U?x:null);this.renderDeclutter_(v,G),++_;break;case 5:var K=C[1],$=C[2],Q=C[3];v=n?null:C[4];var tt=C[5],it=C[6],st=C[7],ht=C[8],nt=C[9],et=C[10],rt=C[11],at=C[12],ot=C[13],ut=C[14],ct=xr.lineString(r,K,$,2),lt=ht(at);if(tt||lt<=ct){var ft=yr(r,K,$,2,at,ht,(ct-lt)*Pr.TEXT_ALIGN[this.textStates[ot].textAlign],st);if(ft){var dt,vt,mt,pt;if(et)for(dt=0,vt=ft.length;dt<vt;++dt)mt=this.getImage((pt=ft[dt])[4],ot,"",et),this.replayImage_(t,pt[0],pt[1],mt,o=pt[2]+rt,u=Q*mt.height+2*(.5-Q)*rt-nt,v,mt.height,1,0,0,pt[3],ut,!1,mt.width,Ye.defaultPadding,null,null);if(it)for(dt=0,vt=ft.length;dt<vt;++dt)mt=this.getImage((pt=ft[dt])[4],ot,it,""),this.replayImage_(t,pt[0],pt[1],mt,o=pt[2],u=Q*mt.height-nt,v,mt.height,1,0,0,pt[3],ut,!1,mt.width,Ye.defaultPadding,null,null)}}this.renderDeclutter_(v,G),++_;break;case 7:if(void 0!==n){var _t=n(G=C[1]);if(_t)return _t}++_;break;case 8:P?M++:this.fill_(t),++_;break;case 9:for(a=C[2],d=(N=r[(z=C[1])+1])+.5|0,(f=(k=r[z])+.5|0)===c&&d===l||(t.moveTo(k,N),c=f,l=d),z+=2;z<a;z+=2)f=(k=r[z])+.5|0,d=(N=r[z+1])+.5|0,z!=a-2&&f===c&&d===l||(t.lineTo(k,N),c=f,l=d);++_;break;case 10:b=C,this.fillOrigin_=C[2],M&&(this.fill_(t),M=0,w&&(t.stroke(),w=0)),t.fillStyle=C[1],++_;break;case Er:x=C,w&&(t.stroke(),w=0),this.setStrokeStyle_(t,C),++_;break;case Sr:P?w++:t.stroke(),++_;break;default:++_}}M&&this.fill_(t),w&&t.stroke()},Gr.prototype.replay=function(t,i,s,h){this.viewRotation_=s,this.replay_(t,i,h,this.instructions,void 0,void 0)},Gr.prototype.replayHitDetection=function(t,i,s,h,n,e){return this.viewRotation_=s,this.replay_(t,i,h,this.hitDetectionInstructions,n,e)},Gr.prototype.reverseHitDetectionInstructions=function(){var t,i=this.hitDetectionInstructions;i.reverse();var s,h,n=i.length,e=-1;for(t=0;t<n;++t)7==(h=(s=i[t])[0])?e=t:0==h&&(s[2]=t,_h.reverseSubArray(this.hitDetectionInstructions,e,t),e=-1)},Gr.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var h=t.getColor();s.fillStyle=Ze.asColorLike(h||Ye.defaultFillStyle)}else s.fillStyle=void 0;if(i){var n=i.getColor();s.strokeStyle=Ze.asColorLike(n||Ye.defaultStrokeStyle);var e=i.getLineCap();s.lineCap=void 0!==e?e:Ye.defaultLineCap;var r=i.getLineDash();s.lineDash=r?r.slice():Ye.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a||Ye.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=void 0!==o?o:Ye.defaultLineJoin;var u=i.getWidth();s.lineWidth=void 0!==u?u:Ye.defaultLineWidth;var c=i.getMiterLimit();s.miterLimit=void 0!==c?c:Ye.defaultMiterLimit,s.lineWidth>this.maxLineWidth&&(this.maxLineWidth=s.lineWidth,this.bufferedMaxExtent_=null)}else s.strokeStyle=void 0,s.lineCap=void 0,s.lineDash=null,s.lineDashOffset=void 0,s.lineJoin=void 0,s.lineWidth=void 0,s.miterLimit=void 0},Gr.prototype.applyFill=function(t,i){var s=t.fillStyle,h=[10,s];if("string"!=typeof s){var n=i.getExtent();h.push([n[0],n[3]])}this.instructions.push(h)},Gr.prototype.applyStroke=function(t){this.instructions.push([Er,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])},Gr.prototype.updateFillStyle=function(t,i,s){var h=t.fillStyle;"string"==typeof h&&t.currentFillStyle==h||(i.call(this,t,s),t.currentFillStyle=h)},Gr.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle,h=t.lineCap,n=t.lineDash,e=t.lineDashOffset,r=t.lineJoin,a=t.lineWidth,o=t.miterLimit;(t.currentStrokeStyle!=s||t.currentLineCap!=h||n!=t.currentLineDash&&!_h.equals(t.currentLineDash,n)||t.currentLineDashOffset!=e||t.currentLineJoin!=r||t.currentLineWidth!=a||t.currentMiterLimit!=o)&&(i.call(this,t),t.currentStrokeStyle=s,t.currentLineCap=h,t.currentLineDash=n,t.currentLineDashOffset=e,t.currentLineJoin=r,t.currentLineWidth=a,t.currentMiterLimit=o)},Gr.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var s=[7,i];this.instructions.push(s),this.hitDetectionInstructions.push(s)},Gr.prototype.finish=Gs.nullFunction,Gr.prototype.getBufferedMaxExtent=function(){return this.bufferedMaxExtent_||(this.bufferedMaxExtent_=zh.clone(this.maxExtent),this.maxLineWidth>0&&zh.buffer(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_)),this.bufferedMaxExtent_};var kr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0};Gs.inherits(kr,Gr),kr.prototype.drawCoordinates_=function(t,i,s,h){return this.appendFlatCoordinates(t,i,s,h,!1,!1)},kr.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,e=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,e,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,e,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},kr.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,e=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,e,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,e,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},kr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.snapToPixel_=void 0,this.width_=void 0},kr.prototype.setImageStyle=function(t,i){var s=t.getAnchor(),h=t.getSize(),n=t.getHitDetectionImage(1),e=t.getImage(1),r=t.getOrigin();this.anchorX_=s[0],this.anchorY_=s[1],this.declutterGroup_=i,this.hitDetectionImage_=n,this.image_=e,this.height_=h[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=h[0]};var Nr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e)};Gs.inherits(Nr,Gr),Nr.prototype.drawFlatCoordinates_=function(t,i,s,h){var n=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,s,h,!1,!1)];return this.instructions.push(n),this.hitDetectionInstructions.push(n),s},Nr.prototype.drawLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h=t.getFlatCoordinates(),n=t.getStride();this.drawFlatCoordinates_(h,0,h.length,n),this.hitDetectionInstructions.push([Sr]),this.endGeometry(t,i)}},Nr.prototype.drawMultiLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h,n,e=t.getEnds(),r=t.getFlatCoordinates(),a=t.getStride(),o=0;for(h=0,n=e.length;h<n;++h)o=this.drawFlatCoordinates_(r,o,e[h],a);this.hitDetectionInstructions.push([Sr]),this.endGeometry(t,i)}},Nr.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push([Sr]),this.reverseHitDetectionInstructions(),this.state=null},Nr.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push([Sr]),t.lastStroke=this.coordinates.length),t.lastStroke=0,Gr.prototype.applyStroke.call(this,t),this.instructions.push([1])};var Cr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e)};Gs.inherits(Cr,Gr),Cr.prototype.drawFlatCoordinatess_=function(t,i,s,h){var n=this.state,e=void 0!==n.fillStyle,r=null!=n.strokeStyle,a=s.length,o=[1];this.instructions.push(o),this.hitDetectionInstructions.push(o);for(var u=0;u<a;++u){var c=s[u],l=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,c,h,!0,!r)];if(this.instructions.push(l),this.hitDetectionInstructions.push(l),r){var f=[3];this.instructions.push(f),this.hitDetectionInstructions.push(f)}i=c}var d=[8];if(this.hitDetectionInstructions.push(d),e&&this.instructions.push(d),r){var v=[Sr];this.instructions.push(v),this.hitDetectionInstructions.push(v)}return i},Cr.prototype.drawCircle=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getFlatCoordinates(),n=t.getStride(),e=this.coordinates.length;this.appendFlatCoordinates(h,0,h.length,n,!1,!1);var r=[1],a=[2,e];this.instructions.push(r,a),this.hitDetectionInstructions.push(r,a);var o=[8];if(this.hitDetectionInstructions.push(o),void 0!==s.fillStyle&&this.instructions.push(o),void 0!==s.strokeStyle){var u=[Sr];this.instructions.push(u),this.hitDetectionInstructions.push(u)}this.endGeometry(t,i)}},Cr.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getEnds(),n=t.getOrientedFlatCoordinates(),e=t.getStride();this.drawFlatCoordinatess_(n,0,h,e),this.endGeometry(t,i)},Cr.prototype.drawMultiPolygon=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h,n,e=t.getEndss(),r=t.getOrientedFlatCoordinates(),a=t.getStride(),o=0;for(h=0,n=e.length;h<n;++h)o=this.drawFlatCoordinatess_(r,o,e[h],a);this.endGeometry(t,i)}},Cr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t){var i,s,h=this.coordinates;for(i=0,s=h.length;i<s;++i)h[i]=Vh.snap(h[i],t)}},Cr.prototype.setFillStrokeStyles_=function(t){var i=this.state;void 0!==i.fillStyle&&this.updateFillStyle(i,this.applyFill,t),void 0!==i.strokeStyle&&this.updateStrokeStyle(i,this.applyStroke)};var Ar=function(t,i,s,h,n){var e,r,a,o,u,c,l,f,d,v=s,m=s,p=0,_=0,g=s;for(e=s;e<h;e+=n){var z=i[e],M=i[e+1];void 0!==o&&(f=z-o,d=M-u,a=Math.sqrt(f*f+d*d),void 0!==c&&(_+=r,Math.acos((c*f+l*d)/(r*a))>t&&(_>p&&(p=_,v=g,m=e),_=0,g=e-n)),r=a,c=f,l=d),o=z,u=M}return(_+=a)>p?[g,e]:[v,m]},Rr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Ye.labelCache.prune()};Gs.inherits(Rr,Gr),Rr.measureTextWidths=function(t,i,s){var h,n,e=i.length,r=0;for(n=0;n<e;++n)h=Ye.measureTextWidth(t,i[n]),r=Math.max(r,h),s.push(h);return r},Rr.prototype.drawText=function(t,i){var s=this.textState_;if(""!==this.text_&&s&&(this.textFillState_||this.textStrokeState_)){var h,n,e=this.coordinates.length,r=t.getType(),a=null,o=2,u=2;if("line"===s.placement){if(!zh.intersects(this.getBufferedMaxExtent(),t.getExtent()))return;var c;if(a=t.getFlatCoordinates(),u=t.getStride(),r==oh)c=[a.length];else if(r==fh)c=t.getEnds();else if(r==ch)c=t.getEnds().slice(0,1);else if(r==dh){var l=t.getEndss();for(c=[],h=0,n=l.length;h<n;++h)c.push(l[h][0])}this.beginGeometry(t,i);for(var f,d=s.textAlign,v=0,m=0,p=c.length;m<p;++m){if(null==d){var _=Ar(s.maxAngle,a,v,c[m],u);v=_[0],f=_[1]}else f=c[m];for(h=v;h<f;h+=u)this.coordinates.push(a[h],a[h+1]);v=c[m],this.drawChars_(e,o=this.coordinates.length,this.declutterGroup_),e=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),z=g.width/this.pixelRatio;switch(r){case ah:case lh:o=(a=t.getFlatCoordinates()).length;break;case oh:a=t.getFlatMidpoint();break;case mh:a=t.getCenter();break;case fh:o=(a=t.getFlatMidpoints()).length;break;case ch:if(a=t.getFlatInteriorPoint(),!s.overflow&&a[2]/this.resolution<z)return;u=3;break;case dh:var M=t.getFlatInteriorPoints();for(a=[],h=0,n=M.length;h<n;h+=3)(s.overflow||M[h+2]/this.resolution>=z)&&a.push(M[h],M[h+1]);if(0==(o=a.length))return}o=this.appendFlatCoordinates(a,0,o,u,!1,!1),this.beginGeometry(t,i),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,t),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(g,e,o),this.endGeometry(t,i)}}},Rr.prototype.getImage=function(t,i,s,h){var n,e=h+i+t+s+this.pixelRatio,r=Ye.labelCache;if(!r.containsKey(e)){var a=h?this.strokeStates[h]||this.textStrokeState_:null,o=s?this.fillStates[s]||this.textFillState_:null,u=this.textStates[i]||this.textState_,c=u.scale*this.pixelRatio,l=Pr.TEXT_ALIGN[u.textAlign||Ye.defaultTextAlign],f=h&&a.lineWidth?a.lineWidth:0,d=t.split("\n"),v=d.length,m=[],p=Rr.measureTextWidths(u.font,d,m),_=Ye.measureTextHeight(u.font),g=_*v,z=Dn(Math.ceil((p+f)*c),Math.ceil((g+f)*c));r.set(e,n=z.canvas),1!=c&&z.scale(c,c),z.font=u.font,h&&(z.strokeStyle=a.strokeStyle,z.lineWidth=f*(tn.SAFARI?c:1),z.lineCap=a.lineCap,z.lineJoin=a.lineJoin,z.miterLimit=a.miterLimit,tn.CANVAS_LINE_DASH&&a.lineDash.length&&(z.setLineDash(a.lineDash),z.lineDashOffset=a.lineDashOffset)),s&&(z.fillStyle=o.fillStyle),z.textBaseline="middle",z.textAlign="center";var M,w=.5-l,b=l*n.width/c+w*f;if(h)for(M=0;M<v;++M)z.strokeText(d[M],b+w*m[M],.5*(f+_)+M*_);if(s)for(M=0;M<v;++M)z.fillText(d[M],b+w*m[M],.5*(f+_)+M*_)}return r.get(e)},Rr.prototype.drawTextImage_=function(t,i,s){var h=this.textState_,n=this.textStrokeState_,e=this.pixelRatio,r=Pr.TEXT_ALIGN[h.textAlign||Ye.defaultTextAlign],a=Pr.TEXT_ALIGN[h.textBaseline],o=n&&n.lineWidth?n.lineWidth:0,u=r*t.width/e+2*(.5-r)*o,c=a*t.height/e+2*(.5-a)*o;this.instructions.push([6,i,s,t,(u-this.textOffsetX_)*e,(c-this.textOffsetY_)*e,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,h.padding==Ye.defaultPadding?Ye.defaultPadding:h.padding.map((function(t){return t*e})),!!h.backgroundFill,!!h.backgroundStroke]),this.hitDetectionInstructions.push([6,i,s,t,(u-this.textOffsetX_)*e,(c-this.textOffsetY_)*e,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/e,!0,t.width,h.padding,!!h.backgroundFill,!!h.backgroundStroke])},Rr.prototype.drawChars_=function(t,i,s){var h=this.textStrokeState_,n=this.textState_,e=this.textFillState_,r=this.strokeKey_;h&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:h.strokeStyle,lineCap:h.lineCap,lineDashOffset:h.lineDashOffset,lineWidth:h.lineWidth,lineJoin:h.lineJoin,miterLimit:h.miterLimit,lineDash:h.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||Ye.defaultTextAlign,scale:n.scale});var o=this.fillKey_;e&&(o in this.fillStates||(this.fillStates[o]={fillStyle:e.fillStyle}));var u=this.pixelRatio,c=Pr.TEXT_ALIGN[n.textBaseline],l=this.textOffsetY_*u,f=this.text_,d=n.font,v=n.scale,m=h?h.lineWidth*v/2:0,p=this.widths_[d];p||(this.widths_[d]=p={}),this.instructions.push([5,t,i,c,s,n.overflow,o,n.maxAngle,function(t){var i=p[t];return i||(i=p[t]=Ye.measureTextWidth(d,t)),i*v*u},l,r,m*u,f,a,1]),this.hitDetectionInstructions.push([5,t,i,c,s,n.overflow,o,n.maxAngle,function(t){var i=p[t];return i||(i=p[t]=Ye.measureTextWidth(d,t)),i*v},l,r,m,f,a,1/u])},Rr.prototype.setTextStyle=function(t,i){var s,h,n;if(t){this.declutterGroup_=i;var e=t.getFill();e?((h=this.textFillState_)||(h=this.textFillState_={}),h.fillStyle=Ze.asColorLike(e.getColor()||Ye.defaultFillStyle)):h=this.textFillState_=null;var r=t.getStroke();if(r){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var a=r.getLineDash(),o=r.getLineDashOffset(),u=r.getWidth(),c=r.getMiterLimit();n.lineCap=r.getLineCap()||Ye.defaultLineCap,n.lineDash=a?a.slice():Ye.defaultLineDash,n.lineDashOffset=void 0===o?Ye.defaultLineDashOffset:o,n.lineJoin=r.getLineJoin()||Ye.defaultLineJoin,n.lineWidth=void 0===u?Ye.defaultLineWidth:u,n.miterLimit=void 0===c?Ye.defaultMiterLimit:c,n.strokeStyle=Ze.asColorLike(r.getColor()||Ye.defaultStrokeStyle)}else n=this.textStrokeState_=null;s=this.textState_;var l=t.getFont()||Ye.defaultFont;Ye.checkFont(l);var f=t.getScale();s.overflow=t.getOverflow(),s.font=l,s.maxAngle=t.getMaxAngle(),s.placement=t.getPlacement(),s.textAlign=t.getTextAlign(),s.textBaseline=t.getTextBaseline()||Ye.defaultTextBaseline,s.backgroundFill=t.getBackgroundFill(),s.backgroundStroke=t.getBackgroundStroke(),s.padding=t.getPadding()||Ye.defaultPadding,s.scale=void 0===f?1:f;var d=t.getOffsetX(),v=t.getOffsetY(),m=t.getRotateWithView(),p=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===v?0:v,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===p?0:p,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Gs.getUid(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=s.font+s.scale+(s.textAlign||"?"),this.fillKey_=h?"string"==typeof h.fillStyle?h.fillStyle:"|"+Gs.getUid(h.fillStyle):""}else this.text_=""};var Ir=function(t,i,s,h,n,e,r){pr.call(this),this.declutterTree_=e,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=h,this.resolution_=s,this.renderBuffer_=r,this.replaysByZIndex_={},this.hitDetectionContext_=Dn(1,1),this.hitDetectionTransform_=Oh.create()};Gs.inherits(Ir,pr),Ir.circleArrayCache_={0:[[!0]]},Ir.fillCircleArrayRowToMiddle_=function(t,i,s){var h,n=Math.floor(t.length/2);if(i>=n)for(h=n;h<i;h++)t[h][s]=!0;else if(i<n)for(h=i+1;h<n;h++)t[h][s]=!0},Ir.getCircleArray_=function(t){if(void 0!==Ir.circleArrayCache_[t])return Ir.circleArrayCache_[t];for(var i=2*t+1,s=new Array(i),h=0;h<i;h++)s[h]=new Array(i);for(var n=t,e=0,r=0;n>=e;)Ir.fillCircleArrayRowToMiddle_(s,t+n,t+e),Ir.fillCircleArrayRowToMiddle_(s,t+e,t+n),Ir.fillCircleArrayRowToMiddle_(s,t-e,t+n),Ir.fillCircleArrayRowToMiddle_(s,t-n,t+e),Ir.fillCircleArrayRowToMiddle_(s,t-n,t-e),Ir.fillCircleArrayRowToMiddle_(s,t-e,t-n),Ir.fillCircleArrayRowToMiddle_(s,t+e,t-n),Ir.fillCircleArrayRowToMiddle_(s,t+n,t-e),2*((r+=1+2*++e)-n)+1>0&&(r+=1-2*(n-=1));return Ir.circleArrayCache_[t]=s,s},Ir.replayDeclutter=function(t,i,s){for(var h=Object.keys(t).map(Number).sort(_h.numberSafeCompareFunction),n={},e=0,r=h.length;e<r;++e)for(var a=t[h[e].toString()],o=0,u=a.length;o<u;){var c=a[o++],l=a[o++];c.replay(i,l,s,n)}},Ir.prototype.addDeclutter=function(t){var i=null;return this.declutterTree_&&(t?(i=this.declutterGroup_)[4]++:(i=this.declutterGroup_=zh.createEmpty()).push(1)),i},Ir.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath(),t.moveTo(s[0],s[1]),t.lineTo(s[2],s[3]),t.lineTo(s[4],s[5]),t.lineTo(s[6],s[7]),t.clip()},Ir.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_)for(var s=this.replaysByZIndex_[i],h=0,n=t.length;h<n;++h)if(t[h]in s)return!0;return!1},Ir.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i,s=this.replaysByZIndex_[t];for(i in s)s[i].finish()}},Ir.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a,o=2*(h=Math.round(h))+1,u=Oh.compose(this.hitDetectionTransform_,h+.5,h+.5,1/i,-1/i,-s,-t[0],-t[1]),c=this.hitDetectionContext_;c.canvas.width!==o||c.canvas.height!==o?(c.canvas.width=o,c.canvas.height=o):c.clearRect(0,0,o,o),void 0!==this.renderBuffer_&&(a=zh.createEmpty(),zh.extendCoordinate(a,t),zh.buffer(a,i*(this.renderBuffer_+h),a));var l,f,d=Ir.getCircleArray_(h);function v(t){for(var i=c.getImageData(0,0,o,o).data,s=0;s<o;s++)for(var h=0;h<o;h++){var n;if(d[s][h]&&i[4*(h*o+s)+3]>0)return(!l||f!=zr&&f!=br||-1!==l.indexOf(t))&&(n=e(t)),n||void c.clearRect(0,0,o,o)}}this.declutterTree_&&(l=this.declutterTree_.all().map((function(t){return t.value})));var m,p,_,g,z,M=Object.keys(this.replaysByZIndex_).map(Number);for(M.sort(_h.numberSafeCompareFunction),m=M.length-1;m>=0;--m){var w=M[m].toString();for(_=this.replaysByZIndex_[w],p=Pr.ORDER.length-1;p>=0;--p)if(void 0!==(g=_[f=Pr.ORDER[p]]))if(!r||f!=zr&&f!=br){if(z=g.replayHitDetection(c,u,s,n,v,a))return z}else{var b=r[w];b?b.push(g,u.slice(0)):r[w]=[g,u.slice(0)]}}},Ir.prototype.getClipCoords=function(t){var i=this.maxExtent_,s=i[0],h=i[1],n=i[2],e=i[3],r=[s,h,s,e,n,e,n,h];return yh(r,0,8,2,t,r),r},Ir.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,Ir.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),h[i]=n),n},Ir.prototype.getReplays=function(){return this.replaysByZIndex_},Ir.prototype.isEmpty=function(){return Ws.isEmpty(this.replaysByZIndex_)},Ir.prototype.replay=function(t,i,s,h,n,e){var r=Object.keys(this.replaysByZIndex_).map(Number);r.sort(_h.numberSafeCompareFunction),t.save(),this.clip(t,i);var a,o,u,c,l,f,d=n||Pr.ORDER;for(a=0,o=r.length;a<o;++a){var v=r[a].toString();for(l=this.replaysByZIndex_[v],u=0,c=d.length;u<c;++u){var m=d[u];if(void 0!==(f=l[m]))if(!e||m!=zr&&m!=br)f.replay(t,i,s,h);else{var p=e[v];p?p.push(f,i.slice(0)):e[v]=[f,i.slice(0)]}}}t.restore()},Ir.BATCH_CONSTRUCTORS_={Circle:Cr,Default:Gr,Image:kr,LineString:Nr,Polygon:Cr,Text:Rr};var Tr={defaultOrder:function(t,i){return Gs.getUid(t)-Gs.getUid(i)},getSquaredTolerance:function(t,i){var s=Tr.getTolerance(t,i);return s*s},getTolerance:function(t,i){return Gs.SIMPLIFY_TOLERANCE*t/i},renderCircleGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(n||e){var r=t.getReplay(s.getZIndex(),_r);r.setFillStrokeStyle(n,e),r.drawCircle(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}},renderFeature:function(t,i,s,h,n,e){var r,a,o=!1;return(r=s.getImage())&&(2==(a=r.getImageState())||3==a?r.unlistenImageChange(n,e):(0==a&&r.load(),a=r.getImageState(),r.listenImageChange(n,e),o=!0)),Tr.renderFeature_(t,i,s,h),o},renderFeature_:function(t,i,s,h){var n=s.getGeometryFunction()(i);if(n){var e=n.getSimplifiedGeometry(h);s.getRenderer()?Tr.renderGeometry_(t,e,s,i):(0,Tr.GEOMETRY_RENDERERS_[e.getType()])(t,e,s,i)}},renderGeometry_:function(t,i,s,h){if(i.getType()!=vh)t.getReplay(s.getZIndex(),gr).drawCustom(i,h,s.getRenderer());else for(var n=i.getGeometries(),e=0,r=n.length;e<r;++e)Tr.renderGeometry_(t,n[e],s,h)},renderGeometryCollectionGeometry_:function(t,i,s,h){var n,e,r=i.getGeometriesArray();for(n=0,e=r.length;n<e;++n)(0,Tr.GEOMETRY_RENDERERS_[r[n].getType()])(t,r[n],s,h)},renderLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var e=t.getReplay(s.getZIndex(),Mr);e.setFillStrokeStyle(null,n),e.drawLineString(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!1)),a.drawText(i,h)}},renderMultiLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var e=t.getReplay(s.getZIndex(),Mr);e.setFillStrokeStyle(null,n),e.drawMultiLineString(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!1)),a.drawText(i,h)}},renderMultiPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(e||n){var r=t.getReplay(s.getZIndex(),wr);r.setFillStrokeStyle(n,e),r.drawMultiPolygon(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}},renderPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var e=t.getReplay(s.getZIndex(),zr);e.setImageStyle(n,t.addDeclutter(!1)),e.drawPoint(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!!n)),a.drawText(i,h)}},renderMultiPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var e=t.getReplay(s.getZIndex(),zr);e.setImageStyle(n,t.addDeclutter(!1)),e.drawMultiPoint(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!!n)),a.drawText(i,h)}},renderPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(n||e){var r=t.getReplay(s.getZIndex(),wr);r.setFillStrokeStyle(n,e),r.drawPolygon(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}}};Tr.GEOMETRY_RENDERERS_={Point:Tr.renderPointGeometry_,LineString:Tr.renderLineStringGeometry_,Polygon:Tr.renderPolygonGeometry_,MultiPoint:Tr.renderMultiPointGeometry_,MultiLineString:Tr.renderMultiLineStringGeometry_,MultiPolygon:Tr.renderMultiPolygonGeometry_,GeometryCollection:Tr.renderGeometryCollectionGeometry_,Circle:Tr.renderCircleGeometry_};var Or=function(t){tr.call(this,t),this.declutterTree_=t.getDeclutter()?mr(9):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=zh.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=Dn(),js.listen(Ye.labelCache,Xs,this.handleFontsChanged_,this)};Gs.inherits(Or,tr),Or.handles=function(t,i){return t===ne&&i.getType()===Ve},Or.create=function(t,i){return new Or(i)},Or.prototype.disposeInternal=function(){js.unlisten(Ye.labelCache,Xs,this.handleFontsChanged_,this),tr.prototype.disposeInternal.call(this)},Or.prototype.composeFrame=function(t,i,s){var h=t.extent,n=t.pixelRatio,e=i.managed?t.skippedFeatureUids:{},r=t.viewState,a=r.projection,o=r.rotation,u=a.getExtent(),c=this.getLayer().getSource(),l=this.getTransform(t,0);this.preCompose(s,t,l);var f=i.extent,d=void 0!==f;d&&this.clip(s,t,f);var v=this.replayGroup_;if(v&&!v.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var m,p=this.getLayer(),_=0,g=0,z=1!==i.opacity,M=p.hasListener(pe);if(z||M){var w=s.canvas.width,b=s.canvas.height;if(o){var x=Math.round(Math.sqrt(w*w+b*b));_=(x-w)/2,g=(x-b)/2,w=b=x}this.context.canvas.width=w,this.context.canvas.height=b,m=this.context}else m=s;var y=m.globalAlpha;z||(m.globalAlpha=i.opacity),m!=s&&m.translate(_,g);var E=t.size[0]*n,S=t.size[1]*n;if(Ye.rotateAtOffset(m,-o,E/2,S/2),v.replay(m,l,o,e),c.getWrapX()&&a.canWrapX()&&!zh.containsExtent(u,h)){for(var P=h[0],G=zh.getWidth(u),k=0;P<u[0];)--k,l=this.getTransform(t,G*k),v.replay(m,l,o,e),P+=G;for(k=0,P=h[2];P>u[2];)++k,l=this.getTransform(t,G*k),v.replay(m,l,o,e),P-=G;l=this.getTransform(t,0)}if(Ye.rotateAtOffset(m,o,E/2,S/2),m!=s){if(M&&this.dispatchRenderEvent(m,t,l),z){var N=s.globalAlpha;s.globalAlpha=i.opacity,s.drawImage(m.canvas,-_,-g),s.globalAlpha=N}else s.drawImage(m.canvas,-_,-g);m.translate(-_,-g)}z||(m.globalAlpha=y)}d&&s.restore(),this.postCompose(s,t,i,l)},Or.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_){var e=i.viewState.resolution,r=i.viewState.rotation,a=this.getLayer(),o={},u=this.replayGroup_.forEachFeatureAtCoordinate(t,e,r,s,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in o))return o[i]=!0,h.call(n,t,a)}),null);return u}},Or.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},Or.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Or.prototype.prepareFrame=function(t){var i=this.getLayer(),s=i.getSource();this.updateLogos(t,s);var h=t.viewHints[0],n=t.viewHints[1],e=i.getUpdateWhileAnimating(),r=i.getUpdateWhileInteracting();if(!this.dirty_&&!e&&h||!r&&n)return!0;var a=t.extent,o=t.viewState,u=o.projection,c=o.resolution,l=t.pixelRatio,f=i.getRevision(),d=i.getRenderBuffer(),v=i.getRenderOrder();void 0===v&&(v=Tr.defaultOrder);var m=zh.buffer(a,d*c),p=o.projection.getExtent();if(s.getWrapX()&&o.projection.canWrapX()&&!zh.containsExtent(p,t.extent)){var _=zh.getWidth(p),g=Math.max(zh.getWidth(m)/2,_);m[0]=p[0]-g,m[2]=p[2]+g}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==v&&zh.containsExtent(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var z=new Ir(Tr.getTolerance(c,l),m,c,l,s.getOverlaps(),this.declutterTree_,i.getRenderBuffer());s.loadFeatures(m,c,u);var M=function(t){var s,h=t.getStyleFunction();if(h?s=h.call(t,c):(h=i.getStyleFunction())&&(s=h(t,c)),s){var n=this.renderFeature(t,c,l,s,z);this.dirty_=this.dirty_||n}}.bind(this);if(v){var w=[];s.forEachFeatureInExtent(m,(function(t){w.push(t)}),this),w.sort(v);for(var b=0,x=w.length;b<x;++b)M(w[b])}else s.forEachFeatureInExtent(m,M,this);return z.finish(),this.renderedResolution_=c,this.renderedRevision_=f,this.renderedRenderOrder_=v,this.renderedExtent_=m,this.replayGroup_=z,this.replayGroupChanged=!0,!0},Or.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var e=!1;if(Array.isArray(h))for(var r=0,a=h.length;r<a;++r)e=Tr.renderFeature(n,t,h[r],Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;else e=Tr.renderFeature(n,t,h,Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this);return e};var Fr="vector",Lr=function(t){this.context=null,or.call(this,t),this.declutterTree_=t.getDeclutter()?mr(9):null,this.dirty_=!1,this.tmpTransform_=Oh.create(),this.zDirection=t.getRenderMode()==Fr?1:0,js.listen(Ye.labelCache,Xs,this.handleFontsChanged_,this)};Gs.inherits(Lr,or),Lr.handles=function(t,i){return t===ne&&"VECTOR_TILE"===i.getType()},Lr.create=function(t,i){return new Lr(i)},Lr.IMAGE_REPLAYS={image:[wr,_r,Mr,zr,br],hybrid:[wr,Mr]},Lr.VECTOR_REPLAYS={image:[gr],hybrid:[zr,br,gr],vector:Pr.ORDER},Lr.prototype.disposeInternal=function(){js.unlisten(Ye.labelCache,Xs,this.handleFontsChanged_,this),or.prototype.disposeInternal.call(this)},Lr.prototype.prepareFrame=function(t,i){var s=this.getLayer(),h=s.getRevision();if(this.renderedLayerRevision_!=h){this.renderedTiles.length=0;var n=s.getRenderMode();this.context||n==Fr||(this.context=Dn()),this.context&&n==Fr&&(this.context=null)}return this.renderedLayerRevision_=h,or.prototype.prepareFrame.apply(this,arguments)},Lr.prototype.createReplayGroup_=function(t,i){var s=this.getLayer(),h=i.pixelRatio,n=i.viewState.projection,e=s.getRevision(),r=s.getRenderOrder()||null,a=t.getReplayState(s);if(a.dirty||a.renderedRevision!=e||a.renderedRenderOrder!=r){for(var o=s.getSource(),u=o.getTileGrid(),c=o.getTileGridForProjection(n),l=c.getResolution(t.tileCoord[0]),f=c.getTileCoordExtent(t.wrappedTileCoord),d=0,v=t.tileKeys.length;d<v;++d){var m=t.getTile(t.tileKeys[d]);if(3!=m.getState()){var p=u.getTileCoordExtent(m.tileCoord),_=zh.getIntersection(f,p),g=zh.equals(p,_)?null:zh.buffer(_,s.getRenderBuffer()*l),z=m.getProjection(),M=!1;Th.equivalent(n,z)||(M=!0,m.setProjection(n)),a.dirty=!1;var w,b=new Ir(0,_,l,h,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer()),x=Tr.getSquaredTolerance(l,h),y=function(t){var i,h=t.getStyleFunction();if(h?i=h.call(t,l):(h=s.getStyleFunction())&&(i=h(t,l)),i){var n=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||n,a.dirty=a.dirty||n}},E=m.getFeatures();r&&r!==a.renderedRenderOrder&&E.sort(r);for(var S=0,P=E.length;S<P;++S)w=E[S],M&&(z.getUnits()==Gh.TILE_PIXELS&&(z.setWorldExtent(p),z.setExtent(m.getExtent())),w.getGeometry().transform(z,n)),g&&!zh.intersects(g,w.getGeometry().getExtent())||y.call(this,w);for(var G in b.finish(),b.getReplays());m.setReplayGroup(s,t.tileCoord.toString(),b)}}a.renderedRevision=e,a.renderedRenderOrder=r}},Lr.prototype.drawTileImage=function(t,i,s,h,n,e,r,a,o){var u=t;this.createReplayGroup_(u,i),this.context&&(this.renderTileImage_(u,i,s),or.prototype.drawTileImage.apply(this,arguments))},Lr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=i.viewState.resolution,r=i.viewState.rotation;s=null==s?0:s;var a,o,u,c,l,f,d,v=this.getLayer(),m={},p=this.renderedTiles,_=v.getSource().getTileGridForProjection(i.viewState.projection);for(u=0,c=p.length;u<c;++u)if(d=_.getTileCoordExtent((f=p[u]).wrappedTileCoord,this.tmpExtent),a=zh.buffer(d,s*e,a),zh.containsCoordinate(a,t))for(var g=0,z=f.tileKeys.length;g<z;++g){var M=f.getTile(f.tileKeys[g]);3!=M.getState()&&(l=M.getReplayGroup(v,f.tileCoord.toString()),o=o||l.forEachFeatureAtCoordinate(t,e,r,s,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in m))return m[i]=!0,h.call(n,t,v)}),null))}return o},Lr.prototype.getReplayTransform_=function(t,i){var s=this.getLayer().getSource().getTileGrid(),h=t.tileCoord,n=s.getResolution(h[0]),e=i.viewState,r=i.pixelRatio,a=e.resolution/r,o=s.getTileCoordExtent(h,this.tmpExtent),u=e.center,c=zh.getTopLeft(o),l=i.size,f=Math.round(r*l[0]/2),d=Math.round(r*l[1]/2);return Oh.compose(this.tmpTransform_,f,d,n/a,n/a,e.rotation,(c[0]-u[0])/n,(u[1]-c[1])/n)},Lr.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},Lr.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Lr.prototype.postCompose=function(t,i,s){var h,n,e=this.getLayer(),r=e.getDeclutter()?{}:null,a=e.getSource(),o=e.getRenderMode(),u=Lr.VECTOR_REPLAYS[o],c=i.pixelRatio,l=i.viewState.rotation,f=i.size;l&&(h=Math.round(c*f[0]/2),n=Math.round(c*f[1]/2),Ye.rotateAtOffset(t,-l,h,n)),r&&this.declutterTree_.clear();for(var d=this.renderedTiles,v=a.getTileGridForProjection(i.viewState.projection),m=[],p=[],_=d.length-1;_>=0;--_){var g=d[_];if(5!=g.getState())for(var z=g.tileCoord,M=v.getTileCoordExtent(z)[0]-v.getTileCoordExtent(g.wrappedTileCoord)[0],w=void 0,b=0,x=g.tileKeys.length;b<x;++b){var y=g.getTile(g.tileKeys[b]);if(3!=y.getState()){var E=y.getReplayGroup(e,z.toString());if(o==Fr||E.hasReplays(u)){w||(w=this.getTransform(i,M));var S=y.tileCoord[0],P=E.getClipCoords(w);t.save(),t.globalAlpha=s.opacity;for(var G=0,k=m.length;G<k;++G){var N=m[G];S<p[G]&&(t.beginPath(),t.moveTo(P[0],P[1]),t.lineTo(P[2],P[3]),t.lineTo(P[4],P[5]),t.lineTo(P[6],P[7]),t.moveTo(N[6],N[7]),t.lineTo(N[4],N[5]),t.lineTo(N[2],N[3]),t.lineTo(N[0],N[1]),t.clip())}E.replay(t,w,l,{},u,r),t.restore(),m.push(P),p.push(S)}}}}r&&Ir.replayDeclutter(r,t,l),l&&Ye.rotateAtOffset(t,l,h,n),or.prototype.postCompose.apply(this,arguments)},Lr.prototype.renderFeature=function(t,i,s,h){if(!s)return!1;var n=!1;if(Array.isArray(s))for(var e=0,r=s.length;e<r;++e)n=Tr.renderFeature(h,t,s[e],i,this.handleStyleImageChange_,this)||n;else n=Tr.renderFeature(h,t,s,i,this.handleStyleImageChange_,this);return n},Lr.prototype.renderTileImage_=function(t,i){var s=this.getLayer(),h=t.getReplayState(s),n=s.getRevision(),e=Lr.IMAGE_REPLAYS[s.getRenderMode()];if(e&&h.renderedTileRevision!==n){h.renderedTileRevision=n;var r=t.wrappedTileCoord,a=r[0],o=i.pixelRatio,u=s.getSource(),c=u.getTileGridForProjection(i.viewState.projection),l=c.getResolution(a),f=t.getContext(s),d=u.getTilePixelSize(a,o,i.viewState.projection);f.canvas.width=d[0],f.canvas.height=d[1];for(var v=c.getTileCoordExtent(r),m=0,p=t.tileKeys.length;m<p;++m){var _=t.getTile(t.tileKeys[m]);if(3!=_.getState()){var g=o/l,z=Oh.reset(this.tmpTransform_);Oh.scale(z,g,-g),Oh.translate(z,-v[0],-v[3]),_.getReplayGroup(s,t.tileCoord.toString()).replay(f,z,0,{},e)}}}};var Dr=function(t){this.source_=t};Dr.prototype.getType=function(){},Dr.prototype.getSource=function(){return this.source_},Dr.prototype.isAnimated=xh.FALSE;var Wr=function(t){Dr.call(this,t)};Gs.inherits(Wr,Dr),Wr.prototype.getType=function(){return Qh.FRAGMENT_SHADER};var jr=function(t){Dr.call(this,t)};Gs.inherits(jr,Dr),jr.prototype.getType=function(){return Qh.VERTEX_SHADER};var Ur={};Ur.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"),Ur.vertex=new jr(Gs.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Vr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_pixelRatio=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_pixelRatio":"l"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"m"),this.u_fillColor=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_fillColor":"n"),this.u_strokeColor=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_strokeColor":"o"),this.u_size=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_size":"p"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"e"),this.a_instruction=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_instruction":"f"),this.a_radius=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_radius":"g")},qr=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Br=function(t,i){return t[0]=i[0],t[1]=i[1],t[4]=i[2],t[5]=i[3],t[12]=i[4],t[13]=i[5],t},Xr=function(t,i){Ke.call(this),this.tolerance=t,this.maxExtent=i,this.origin=zh.getCenter(i),this.projectionMatrix_=Oh.create(),this.offsetRotateMatrix_=Oh.create(),this.offsetScaleMatrix_=Oh.create(),this.tmpMat4_=qr(),this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0};Gs.inherits(Xr,Ke),Xr.prototype.getDeleteResourcesFunction=function(){},Xr.prototype.finish=function(){},Xr.prototype.setUpProgram=function(){},Xr.prototype.shutDownProgram=function(){},Xr.prototype.drawReplay=function(){},Xr.prototype.drawHitDetectionReplayOneByOne=function(){},Xr.prototype.drawHitDetectionReplay=function(t,i,s,h,n,e){return n?this.drawHitDetectionReplayOneByOne(t,i,s,h,e):this.drawHitDetectionReplayAll(t,i,s,h)},Xr.prototype.drawHitDetectionReplayAll=function(t,i,s,h){return t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,i,s,!0),h(null)||void 0},Xr.prototype.replay=function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d,v,m,p,_,g,z=t.getGL();this.lineStringReplay&&(l=z.isEnabled(z.STENCIL_TEST),f=z.getParameter(z.STENCIL_FUNC),d=z.getParameter(z.STENCIL_VALUE_MASK),v=z.getParameter(z.STENCIL_REF),m=z.getParameter(z.STENCIL_WRITEMASK),p=z.getParameter(z.STENCIL_FAIL),_=z.getParameter(z.STENCIL_PASS_DEPTH_PASS),g=z.getParameter(z.STENCIL_PASS_DEPTH_FAIL),z.enable(z.STENCIL_TEST),z.clear(z.STENCIL_BUFFER_BIT),z.stencilMask(255),z.stencilFunc(z.ALWAYS,1,255),z.stencilOp(z.KEEP,z.KEEP,z.REPLACE),this.lineStringReplay.replay(t,i,s,h,n,e,r,a,o,u,c),z.stencilMask(0),z.stencilFunc(z.NOTEQUAL,1,255)),t.bindBuffer(Qh.ARRAY_BUFFER,this.verticesBuffer),t.bindBuffer(Qh.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var M=this.setUpProgram(z,t,n,e),w=Oh.reset(this.projectionMatrix_);Oh.scale(w,2/(s*n[0]),2/(s*n[1])),Oh.rotate(w,-h),Oh.translate(w,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var b=Oh.reset(this.offsetScaleMatrix_);Oh.scale(b,2/n[0],2/n[1]);var x,y=Oh.reset(this.offsetRotateMatrix_);return 0!==h&&Oh.rotate(y,-h),z.uniformMatrix4fv(M.u_projectionMatrix,!1,Br(this.tmpMat4_,w)),z.uniformMatrix4fv(M.u_offsetScaleMatrix,!1,Br(this.tmpMat4_,b)),z.uniformMatrix4fv(M.u_offsetRotateMatrix,!1,Br(this.tmpMat4_,y)),z.uniform1f(M.u_opacity,r),void 0===o?this.drawReplay(z,t,a,!1):x=this.drawHitDetectionReplay(z,t,a,o,u,c),this.shutDownProgram(z,M),this.lineStringReplay&&(l||z.disable(z.STENCIL_TEST),z.clear(z.STENCIL_BUFFER_BIT),z.stencilFunc(f,v,d),z.stencilMask(m),z.stencilOp(p,g,_)),x},Xr.prototype.drawElements=function(t,i,s,h){t.drawElements(Qh.TRIANGLES,h-s,i.hasOESElementIndexUint?Qh.UNSIGNED_INT:Qh.UNSIGNED_SHORT,s*(i.hasOESElementIndexUint?4:2))};var Hr={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:.5,defaultTextBaseline:.5,defaultLineWidth:1,triangleIsCounterClockwise:function(t,i,s,h,n,e){var r=(s-t)*(e-i)-(n-t)*(h-i);return r<=Hr.EPSILON&&r>=-Hr.EPSILON?void 0:r>0}};Hr.EPSILON=Number.EPSILON||2220446049250313e-31;var Yr=function(t,i){this.arr_=void 0!==t?t:[],this.usage_=void 0!==i?i:Yr.Usage_.STATIC_DRAW};Yr.prototype.getArray=function(){return this.arr_},Yr.prototype.getUsage=function(){return this.usage_},Yr.Usage_={STATIC_DRAW:Qh.STATIC_DRAW,STREAM_DRAW:Qh.STREAM_DRAW,DYNAMIC_DRAW:Qh.DYNAMIC_DRAW};var Jr=function(t,i){Xr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}};Gs.inherits(Jr,Xr),Jr.prototype.drawCoordinates_=function(t,i,s,h){var n,e,r=this.vertices.length,a=this.indices.length,o=r/4;for(n=i,e=s;n<e;n+=h)this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=0,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=1,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=2,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=3,this.vertices[r++]=this.radius_,this.indices[a++]=o,this.indices[a++]=o+1,this.indices[a++]=o+2,this.indices[a++]=o+2,this.indices[a++]=o+3,this.indices[a++]=o,o+=4},Jr.prototype.drawCircle=function(t,i){var s=t.getRadius(),h=t.getStride();if(s){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=s;var n=t.getFlatCoordinates();n=Ph(n,0,2,h,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,h)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var e=this.styles_[this.styles_.length-1];this.state_.fillColor=e[0],this.state_.strokeColor=e[1],this.state_.lineWidth=e[2],this.state_.changed=!1}},Jr.prototype.finish=function(){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Jr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Jr.prototype.setUpProgram=function(t,i,s,h){var n,e=i.getProgram(Ur.fragment,Ur.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Vr(t,e),this.defaultLocations_=n),i.useProgram(e),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Qh.FLOAT,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,Qh.FLOAT,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,Qh.FLOAT,!1,16,12),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Jr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_instruction),t.disableVertexAttribArray(i.a_radius)},Jr.prototype.drawReplay=function(t,i,s){var h,n,e,r;if(Ws.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],h=this.styleIndices_.length-1;h>=0;--h)n=this.styleIndices_[h],this.setFillStyle_(t,(r=this.styles_[h])[0]),this.setStrokeStyle_(t,r[1],r[2]),this.drawElements(t,i,n,e),e=n;else this.drawReplaySkipping_(t,i,s)},Jr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c,l;for(a=this.startIndices[1+(l=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setFillStyle_(t,(o=this.styles_[e])[0]),this.setStrokeStyle_(t,o[1],o[2]),u=this.styleIndices_[e];l>=0&&this.startIndices[l]>=u;){if(r=this.startIndices[l],void 0===s[Gs.getUid(c=this.startIndicesFeature[l]).toString()]&&c.getGeometry()&&(void 0===n||zh.intersects(n,c.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var f=h(c);if(f)return f}l--,a=r}},Jr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o,u;for(e=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,(r=this.styles_[h])[0]),this.setStrokeStyle_(t,r[1],r[2]),a=this.styleIndices_[h];o>=0&&this.startIndices[o]>=a;)u=this.startIndices[o],s[Gs.getUid(this.startIndicesFeature[o]).toString()]&&(n!==e&&this.drawElements(t,i,n,e),e=u),o--,n=u;n!==e&&this.drawElements(t,i,n,e),n=e=a}},Jr.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)},Jr.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s)},Jr.prototype.setFillStrokeStyle=function(t,i){var s,h;if(i){var n=i.getLineDash();this.state_.lineDash=n||Hr.defaultLineDash;var e=i.getLineDashOffset();this.state_.lineDashOffset=e||Hr.defaultLineDashOffset,s=(s=i.getColor())instanceof CanvasGradient||s instanceof CanvasPattern?Hr.defaultStrokeStyle:Je.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultStrokeStyle,h=void 0!==(h=i.getWidth())?h:Hr.defaultLineWidth}else s=[0,0,0,0],h=0;var r=t?t.getColor():[0,0,0,0];r=r instanceof CanvasGradient||r instanceof CanvasPattern?Hr.defaultFillStyle:Je.asArray(r).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultFillStyle,this.state_.strokeColor&&_h.equals(this.state_.strokeColor,s)&&this.state_.fillColor&&_h.equals(this.state_.fillColor,r)&&this.state_.lineWidth===h||(this.state_.changed=!0,this.state_.fillColor=r,this.state_.strokeColor=s,this.state_.lineWidth=h,this.styles_.push([r,s,h]))};var Zr={};Zr.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Zr.vertex=new jr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Kr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"k"),this.u_image=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_image":"l"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"c"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"d"),this.a_offsets=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_offsets":"e"),this.a_opacity=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_opacity":"f"),this.a_rotateWithView=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_rotateWithView":"g")},$r="webglcontextlost",Qr="webglcontextrestored",ta=function(t,i){this.canvas_=t,this.gl_=i,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=_h.includes(Gs.WEBGL_EXTENSIONS,"OES_element_index_uint"),this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint"),js.listen(this.canvas_,$r,this.handleWebGLContextLost,this),js.listen(this.canvas_,Qr,this.handleWebGLContextRestored,this)};Gs.inherits(ta,Us),ta.prototype.bindBuffer=function(t,i){var s=this.getGL(),h=i.getArray(),n=String(Gs.getUid(i));if(n in this.bufferCache_)s.bindBuffer(t,this.bufferCache_[n].buffer);else{var e,r=s.createBuffer();s.bindBuffer(t,r),t==Qh.ARRAY_BUFFER?e=new Float32Array(h):t==Qh.ELEMENT_ARRAY_BUFFER&&(e=this.hasOESElementIndexUint?new Uint32Array(h):new Uint16Array(h)),s.bufferData(t,e,i.getUsage()),this.bufferCache_[n]={buf:i,buffer:r}}},ta.prototype.deleteBuffer=function(t){var i=this.getGL(),s=String(Gs.getUid(t)),h=this.bufferCache_[s];i.isContextLost()||i.deleteBuffer(h.buffer),delete this.bufferCache_[s]},ta.prototype.disposeInternal=function(){js.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_)t.deleteBuffer(this.bufferCache_[i].buffer);for(i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(i in this.shaderCache_)t.deleteShader(this.shaderCache_[i]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},ta.prototype.getCanvas=function(){return this.canvas_},ta.prototype.getGL=function(){return this.gl_},ta.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},ta.prototype.getShader=function(t){var i=String(Gs.getUid(t));if(i in this.shaderCache_)return this.shaderCache_[i];var s=this.getGL(),h=s.createShader(t.getType());return s.shaderSource(h,t.getSource()),s.compileShader(h),this.shaderCache_[i]=h,h},ta.prototype.getProgram=function(t,i){var s=Gs.getUid(t)+"/"+Gs.getUid(i);if(s in this.programCache_)return this.programCache_[s];var h=this.getGL(),n=h.createProgram();return h.attachShader(n,this.getShader(t)),h.attachShader(n,this.getShader(i)),h.linkProgram(n),this.programCache_[s]=n,n},ta.prototype.handleWebGLContextLost=function(){Ws.clear(this.bufferCache_),Ws.clear(this.shaderCache_),Ws.clear(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},ta.prototype.handleWebGLContextRestored=function(){},ta.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=ta.createEmptyTexture(t,1,1),h=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,h),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,h),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=i,this.hitDetectionTexture_=s,this.hitDetectionRenderbuffer_=h},ta.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},ta.createTexture_=function(t,i,s){var h=t.createTexture();return t.bindTexture(t.TEXTURE_2D,h),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==i&&t.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_S,i),void 0!==s&&t.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_T,s),h},ta.createEmptyTexture=function(t,i,s,h,n){var e=ta.createTexture_(t,h,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null),e},ta.createTexture=function(t,i,s,h){var n=ta.createTexture_(t,s,h);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),n};var ia=function(t,i){Xr.call(this,t,i),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0};Gs.inherits(ia,Xr),ia.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.getTextures(!0),n=t.getGL();return function(){var e,r;if(!n.isContextLost())for(e=0,r=h.length;e<r;++e)n.deleteTexture(h[e]);t.deleteBuffer(i),t.deleteBuffer(s)}},ia.prototype.drawCoordinates=function(t,i,s,h){var n,e,r,a,o,u,c=this.anchorX,l=this.anchorY,f=this.height,d=this.imageHeight,v=this.imageWidth,m=this.opacity,p=this.originX,_=this.originY,g=this.rotateWithView?1:0,z=-this.rotation,M=this.scale,w=this.width,b=Math.cos(z),x=Math.sin(z),y=this.indices.length,E=this.vertices.length;for(n=i;n<s;n+=h)u=t[n+1]-this.origin[1],e=E/8,r=-M*c,a=-M*(f-l),this.vertices[E++]=o=t[n]-this.origin[0],this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=p/v,this.vertices[E++]=(_+f)/d,this.vertices[E++]=m,this.vertices[E++]=g,r=M*(w-c),a=-M*(f-l),this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=(p+w)/v,this.vertices[E++]=(_+f)/d,this.vertices[E++]=m,this.vertices[E++]=g,r=M*(w-c),a=M*l,this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=(p+w)/v,this.vertices[E++]=_/d,this.vertices[E++]=m,this.vertices[E++]=g,r=-M*c,a=M*l,this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=p/v,this.vertices[E++]=_/d,this.vertices[E++]=m,this.vertices[E++]=g,this.indices[y++]=e,this.indices[y++]=e+1,this.indices[y++]=e+2,this.indices[y++]=e,this.indices[y++]=e+2,this.indices[y++]=e+3;return E},ia.prototype.createTextures=function(t,i,s,h){var n,e,r,a,o=i.length;for(a=0;a<o;++a)(r=Gs.getUid(e=i[a]).toString())in s?n=s[r]:(n=ta.createTexture(h,e,Qh.CLAMP_TO_EDGE,Qh.CLAMP_TO_EDGE),s[r]=n),t[a]=n},ia.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Zr.fragment,Zr.vertex);return this.defaultLocations?s=this.defaultLocations:(s=new Kr(t,h),this.defaultLocations=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Qh.FLOAT,!1,32,0),t.enableVertexAttribArray(s.a_offsets),t.vertexAttribPointer(s.a_offsets,2,Qh.FLOAT,!1,32,8),t.enableVertexAttribArray(s.a_texCoord),t.vertexAttribPointer(s.a_texCoord,2,Qh.FLOAT,!1,32,16),t.enableVertexAttribArray(s.a_opacity),t.vertexAttribPointer(s.a_opacity,1,Qh.FLOAT,!1,32,24),t.enableVertexAttribArray(s.a_rotateWithView),t.vertexAttribPointer(s.a_rotateWithView,1,Qh.FLOAT,!1,32,28),s},ia.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_offsets),t.disableVertexAttribArray(i.a_texCoord),t.disableVertexAttribArray(i.a_opacity),t.disableVertexAttribArray(i.a_rotateWithView)},ia.prototype.drawReplay=function(t,i,s,h){var n,e,r,a=h?this.getHitDetectionTextures():this.getTextures(),o=h?this.hitDetectionGroupIndices:this.groupIndices;if(Ws.isEmpty(s))for(n=0,e=a.length,r=0;n<e;++n){t.bindTexture(Qh.TEXTURE_2D,a[n]);var u=o[n];this.drawElements(t,i,r,u),r=u}else this.drawReplaySkipping(t,i,s,a,o)},ia.prototype.drawReplaySkipping=function(t,i,s,h,n){var e,r,a=0;for(e=0,r=h.length;e<r;++e){t.bindTexture(Qh.TEXTURE_2D,h[e]);for(var o=e>0?n[e-1]:0,u=n[e],c=o,l=o;a<this.startIndices.length&&this.startIndices[a]<=u;)void 0!==s[Gs.getUid(this.startIndicesFeature[a]).toString()]?(c!==l&&this.drawElements(t,i,c,l),l=c=a===this.startIndices.length-1?u:this.startIndices[a+1]):l=a===this.startIndices.length-1?u:this.startIndices[a+1],a++;c!==l&&this.drawElements(t,i,c,l)}},ia.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c=this.startIndices.length-1,l=this.getHitDetectionTextures();for(e=l.length-1;e>=0;--e)for(t.bindTexture(Qh.TEXTURE_2D,l[e]),r=e>0?this.hitDetectionGroupIndices[e-1]:0,o=this.hitDetectionGroupIndices[e];c>=0&&this.startIndices[c]>=r;){if(a=this.startIndices[c],void 0===s[Gs.getUid(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||zh.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,a,o);var f=h(u);if(f)return f}o=a,c--}},ia.prototype.finish=function(){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},ia.prototype.getTextures=function(){},ia.prototype.getHitDetectionTextures=function(){};var sa=function(t,i){ia.call(this,t,i),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]};Gs.inherits(sa,ia),sa.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},sa.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},sa.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,s,i),this.images_=null,this.hitDetectionImages_=null,ia.prototype.finish.call(this,t)},sa.prototype.setImageStyle=function(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getImageSize(),n=t.getHitDetectionImage(1),e=t.getOpacity(),r=t.getOrigin(),a=t.getRotateWithView(),o=t.getRotation(),u=t.getSize(),c=t.getScale();0===this.images_.length?this.images_.push(s):Gs.getUid(this.images_[this.images_.length-1])!=Gs.getUid(s)&&(this.groupIndices.push(this.indices.length),this.images_.push(s)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):Gs.getUid(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=Gs.getUid(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=i[0],this.anchorY=i[1],this.height=u[1],this.imageHeight=h[1],this.imageWidth=h[0],this.opacity=e,this.originX=r[0],this.originY=r[1],this.rotation=o,this.rotateWithView=a,this.scale=c,this.width=u[0]},sa.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},sa.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var ha=function(t,i,s,h){var n=s-h;return t[i]===t[n]&&t[i+1]===t[n+1]&&(s-i)/h>3&&!!Dh.linearRing(t,i,s,h)},na={};na.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),na.vertex=new jr(Gs.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var ea=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_miterLimit=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_miterLimit":"l"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"m"),this.u_color=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_color":"n"),this.u_size=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_size":"o"),this.u_pixelRatio=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_pixelRatio":"p"),this.a_lastPos=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_lastPos":"d"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"e"),this.a_nextPos=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_nextPos":"f"),this.a_direction=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_direction":"g")},ra=function(t,i){Xr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}};Gs.inherits(ra,Xr),ra.prototype.drawCoordinates_=function(t,i,s,h){var n,e,r,a,o,u,c,l,f=this.vertices.length,d=this.indices.length,v="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,m="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,p=ha(t,i,s,h),_=d,g=1;for(n=i,e=s;n<e;n+=h){if(o=f/7,u=c,c=l||[t[n],t[n+1]],n===i){if(l=[t[n+h],t[n+h+1]],s-i==2*h&&_h.equals(c,l))break;if(!p){m&&(f=this.addVertices_([0,0],c,l,g*ra.Instruction_.BEGIN_LINE_CAP*m,f),f=this.addVertices_([0,0],c,l,-g*ra.Instruction_.BEGIN_LINE_CAP*m,f),this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=o+1,this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o+2),f=this.addVertices_([0,0],c,l,g*ra.Instruction_.BEGIN_LINE*(m||1),f),_=(f=this.addVertices_([0,0],c,l,-g*ra.Instruction_.BEGIN_LINE*(m||1),f))/7-1;continue}u=[t[s-2*h],t[s-2*h+1]],r=l}else{if(n===s-h){if(p){l=r;break}f=this.addVertices_(u=u||[0,0],c,[0,0],g*ra.Instruction_.END_LINE*(m||1),f),f=this.addVertices_(u,c,[0,0],-g*ra.Instruction_.END_LINE*(m||1),f),this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=_,this.indices[d++]=o+1,this.indices[d++]=o,m&&(f=this.addVertices_(u,c,[0,0],g*ra.Instruction_.END_LINE_CAP*m,f),f=this.addVertices_(u,c,[0,0],-g*ra.Instruction_.END_LINE_CAP*m,f),this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=o+1,this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o+2);break}l=[t[n+h],t[n+h+1]]}a=Hr.triangleIsCounterClockwise(u[0],u[1],c[0],c[1],l[0],l[1])?-1:1,f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_FIRST*(v||1),f),f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_SECOND*(v||1),f),f=this.addVertices_(u,c,l,-a*ra.Instruction_.MITER_BOTTOM*(v||1),f),n>i&&(this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=g*a>0?_:_-1),this.indices[d++]=o,this.indices[d++]=o+2,this.indices[d++]=o+1,_=o+2,g=a,v&&(f=this.addVertices_(u,c,l,a*ra.Instruction_.MITER_TOP*v,f),this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o)}p&&(o=o||f/7,a=Kh.linearRingIsClockwise([u[0],u[1],c[0],c[1],l[0],l[1]],0,6,2)?1:-1,f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_FIRST*(v||1),f),f=this.addVertices_(u,c,l,-a*ra.Instruction_.MITER_BOTTOM*(v||1),f),this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=o+1,this.indices[d++]=o,this.indices[d++]=g*a>0?_:_-1)},ra.prototype.addVertices_=function(t,i,s,h,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=s[0],this.vertices[n++]=s[1],this.vertices[n++]=h,n},ra.prototype.isValid_=function(t,i,s,h){var n=s-i;return!(n<2*h||n===2*h&&_h.equals([t[i],t[i+1]],[t[i+h],t[i+h+1]]))},ra.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates(),h=t.getStride();this.isValid_(s,0,s.length,h)&&(s=Ph(s,0,s.length,h,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.drawCoordinates_(s,0,s.length,h))},ra.prototype.drawMultiLineString=function(t,i){var s=this.indices.length,h=t.getEnds();h.unshift(0);var n,e,r=t.getFlatCoordinates(),a=t.getStride();if(h.length>1)for(n=1,e=h.length;n<e;++n)if(this.isValid_(r,h[n-1],h[n],a)){var o=Ph(r,h[n-1],h[n],a,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,a)}this.indices.length>s&&(this.startIndices.push(s),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1))},ra.prototype.drawPolygonCoordinates=function(t,i,s){var h,n;if(ha(t,0,t.length,s)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,s),i.length)for(h=0,n=i.length;h<n;++h)ha(i[h],0,i[h].length,s)||(i[h].push(i[h][0]),i[h].push(i[h][1])),this.drawCoordinates_(i[h],0,i[h].length,s)},ra.prototype.setPolygonStyle=function(t,i){var s=void 0===i?this.indices.length:i;this.startIndices.push(s),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1)},ra.prototype.getCurrentIndex=function(){return this.indices.length},ra.prototype.finish=function(){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},ra.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},ra.prototype.setUpProgram=function(t,i,s,h){var n,e=i.getProgram(na.fragment,na.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new ea(t,e),this.defaultLocations_=n),i.useProgram(e),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,Qh.FLOAT,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Qh.FLOAT,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,Qh.FLOAT,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,Qh.FLOAT,!1,28,24),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},ra.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos),t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_nextPos),t.disableVertexAttribArray(i.a_direction)},ra.prototype.drawReplay=function(t,i,s,h){var n,e,r,a,o=t.getParameter(t.DEPTH_FUNC),u=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Ws.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)e=this.styleIndices_[n],this.setStrokeStyle_(t,(a=this.styles_[n])[0],a[1],a[2]),this.drawElements(t,i,e,r),t.clear(t.DEPTH_BUFFER_BIT),r=e;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(u),t.depthFunc(o))},ra.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o,u;for(e=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setStrokeStyle_(t,(r=this.styles_[h])[0],r[1],r[2]),a=this.styleIndices_[h];o>=0&&this.startIndices[o]>=a;)u=this.startIndices[o],s[Gs.getUid(this.startIndicesFeature[o]).toString()]&&(n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),e=u),o--,n=u;n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),n=e=a}},ra.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c,l;for(a=this.startIndices[1+(l=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setStrokeStyle_(t,(o=this.styles_[e])[0],o[1],o[2]),u=this.styleIndices_[e];l>=0&&this.startIndices[l]>=u;){if(r=this.startIndices[l],void 0===s[Gs.getUid(c=this.startIndicesFeature[l]).toString()]&&c.getGeometry()&&(void 0===n||zh.intersects(n,c.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var f=h(c);if(f)return f}l--,a=r}},ra.prototype.setStrokeStyle_=function(t,i,s,h){t.uniform4fv(this.defaultLocations_.u_color,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s),t.uniform1f(this.defaultLocations_.u_miterLimit,h)},ra.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=void 0!==s?s:Hr.defaultLineCap;var h=i.getLineDash();this.state_.lineDash=h||Hr.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n||Hr.defaultLineDashOffset;var e=i.getLineJoin();this.state_.lineJoin=void 0!==e?e:Hr.defaultLineJoin;var r=i.getColor();r=r instanceof CanvasGradient||r instanceof CanvasPattern?Hr.defaultStrokeStyle:Je.asArray(r).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultStrokeStyle;var a=i.getWidth();a=void 0!==a?a:Hr.defaultLineWidth;var o=i.getMiterLimit();o=void 0!==o?o:Hr.defaultMiterLimit,this.state_.strokeColor&&_h.equals(this.state_.strokeColor,r)&&this.state_.lineWidth===a&&this.state_.miterLimit===o||(this.state_.changed=!0,this.state_.strokeColor=r,this.state_.lineWidth=a,this.state_.miterLimit=o,this.styles_.push([r,a,o]))},ra.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var aa={};aa.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),aa.vertex=new jr(Gs.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var oa=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"b"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"c"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"d"),this.u_color=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_color":"e"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"f"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"a")},ua=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width,this.checksum_=void 0};ua.prototype.clone=function(){var t=this.getColor();return new ua({color:t&&t.slice?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},ua.prototype.getColor=function(){return this.color_},ua.prototype.getLineCap=function(){return this.lineCap_},ua.prototype.getLineDash=function(){return this.lineDash_},ua.prototype.getLineDashOffset=function(){return this.lineDashOffset_},ua.prototype.getLineJoin=function(){return this.lineJoin_},ua.prototype.getMiterLimit=function(){return this.miterLimit_},ua.prototype.getWidth=function(){return this.width_},ua.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},ua.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},ua.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},ua.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},ua.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},ua.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},ua.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},ua.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.checksum_+=this.color_?"string"==typeof this.color_?this.color_:Gs.getUid(this.color_).toString():"-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var ca=function(t){this.first_=void 0,this.last_=void 0,this.head_=void 0,this.circular_=void 0===t||t,this.length_=0};ca.prototype.insertItem=function(t){var i={prev:void 0,next:void 0,data:t},s=this.head_;if(s){var h=s.next;i.prev=s,i.next=h,s.next=i,h&&(h.prev=i),s===this.last_&&(this.last_=i)}else this.first_=i,this.last_=i,this.circular_&&(i.next=i,i.prev=i);this.head_=i,this.length_++},ca.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next,s=t.prev;i&&(i.prev=s),s&&(s.next=i),this.head_=i||s,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=s?this.head_.prev:this.head_),this.length_--}},ca.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},ca.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},ca.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},ca.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},ca.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},ca.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},ca.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},ca.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},ca.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,i.prev=t.last_,t.last_.next=i,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},ca.prototype.getLength=function(){return this.length_};var la=function(t){this.rbush_=mr(t),this.items_={}};la.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s),this.items_[Gs.getUid(i)]=s},la.prototype.load=function(t,i){for(var s=new Array(i.length),h=0,n=i.length;h<n;h++){var e=t[h],r=i[h],a={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:r};s[h]=a,this.items_[Gs.getUid(r)]=a}this.rbush_.load(s)},la.prototype.remove=function(t){var i=Gs.getUid(t),s=this.items_[i];return delete this.items_[i],null!==this.rbush_.remove(s)},la.prototype.update=function(t,i){var s=this.items_[Gs.getUid(i)];zh.equals([s.minX,s.minY,s.maxX,s.maxY],t)||(this.remove(i),this.insert(t,i))},la.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},la.prototype.getInExtent=function(t){return this.rbush_.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).map((function(t){return t.value}))},la.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)},la.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)},la.prototype.forEach_=function(t,i,s){for(var h,n=0,e=t.length;n<e;n++)if(h=i.call(s,t[n]))return h;return h},la.prototype.isEmpty=function(){return Ws.isEmpty(this.items_)},la.prototype.clear=function(){this.rbush_.clear(),this.items_={}},la.prototype.getExtent=function(t){var i=this.rbush_.data;return zh.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)},la.prototype.concat=function(t){for(var i in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|i]=t.items_[0|i]};var fa=function(t,i){Xr.call(this,t,i),this.lineStringReplay=new ra(t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}};Gs.inherits(fa,Xr),fa.prototype.drawCoordinates_=function(t,i,s){var h=new ca,n=new la;this.processFlatCoordinates_(t,s,h,n,!0);var e=this.getMaxCoords_(h);if(i.length){var r,a,o=[];for(r=0,a=i.length;r<a;++r){var u={list:new ca,maxCoords:void 0,rtree:new la};o.push(u),this.processFlatCoordinates_(i[r],s,u.list,u.rtree,!1),this.classifyPoints_(u.list,u.rtree,!0),u.maxCoords=this.getMaxCoords_(u.list)}for(o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]})),r=0;r<o.length;++r){var c,l=o[r].list,f=l.firstItem(),d=f;do{if(this.getIntersections_(d,n).length){c=!0;break}d=l.nextItem()}while(f!==d);c||this.bridgeHole_(l,o[r].maxCoords[0],h,e[0],n)&&(n.concat(o[r].rtree),this.classifyPoints_(h,n,!1))}}else this.classifyPoints_(h,n,!1);this.triangulate_(h,n)},fa.prototype.processFlatCoordinates_=function(t,i,s,h,n){var e,r,a,o,u,c=Kh.linearRingIsClockwise(t,0,t.length,i),l=this.vertices.length/2,f=[],d=[];if(n===c){for(o=a=this.createPoint_(t[0],t[1],l++),e=i,r=t.length;e<r;e+=i)u=this.createPoint_(t[e],t[e+1],l++),d.push(this.insertItem_(o,u,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)]),o=u;d.push(this.insertItem_(u,a,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)])}else{var v=t.length-i;for(o=a=this.createPoint_(t[v],t[v+1],l++),e=v-i,r=0;e>=r;e-=i)u=this.createPoint_(t[e],t[e+1],l++),d.push(this.insertItem_(o,u,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)]),o=u;d.push(this.insertItem_(u,a,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)])}h.load(f,d)},fa.prototype.getMaxCoords_=function(t){var i=t.firstItem(),s=i,h=[s.p0.x,s.p0.y];do{(s=t.nextItem()).p0.x>h[0]&&(h=[s.p0.x,s.p0.y])}while(s!==i);return h},fa.prototype.classifyPoints_=function(t,i,s){var h=t.firstItem(),n=h,e=t.nextItem(),r=!1;do{var a=s?Hr.triangleIsCounterClockwise(e.p1.x,e.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Hr.triangleIsCounterClockwise(n.p0.x,n.p0.y,n.p1.x,n.p1.y,e.p1.x,e.p1.y);void 0===a?(this.removeItem_(n,e,t,i),r=!0,e===h&&(h=t.getNextItem()),e=n,t.prevItem()):n.p1.reflex!==a&&(n.p1.reflex=a,r=!0),n=e,e=t.nextItem()}while(n!==h);return r},fa.prototype.bridgeHole_=function(t,i,s,h,n){for(var e=t.firstItem();e.p1.x!==i;)e=t.nextItem();var r,a,o,u,c=e.p1,l={x:h,y:c.y,i:-1},f=1/0,d=this.getIntersections_({p0:c,p1:l},n,!0);for(r=0,a=d.length;r<a;++r){var v=d[r],m=this.calculateIntersection_(c,l,v.p0,v.p1,!0),p=Math.abs(c.x-m[0]);p<f&&void 0!==Hr.triangleIsCounterClockwise(c.x,c.y,v.p0.x,v.p0.y,v.p1.x,v.p1.y)&&(f=p,u={x:m[0],y:m[1],i:-1},e=v)}if(f===1/0)return!1;if(o=e.p1,f>0){var _=this.getPointsInTriangle_(c,u,e.p1,n);if(_.length){var g=1/0;for(r=0,a=_.length;r<a;++r){var z=_[r],M=Math.atan2(c.y-z.y,l.x-z.x);(M<g||M===g&&z.x<o.x)&&(g=M,o=z)}}}for(e=s.firstItem();e.p1.x!==o.x||e.p1.y!==o.y;)e=s.nextItem();var w={x:c.x,y:c.y,i:c.i,reflex:void 0},b={x:e.p1.x,y:e.p1.y,i:e.p1.i,reflex:void 0};return t.getNextItem().p0=w,this.insertItem_(c,e.p1,t,n),this.insertItem_(b,w,t,n),e.p1=b,t.setFirstItem(),s.concat(t),!0},fa.prototype.triangulate_=function(t,i){for(var s=!1,h=this.isSimple_(t,i);t.getLength()>3;)if(h){if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i,!0))break}else if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i)){if(!(h=this.isSimple_(t,i))){this.splitPolygon_(t,i);break}s=!this.isClockwise_(t),this.classifyPoints_(t,i,s)}if(3===t.getLength()){var n=this.indices.length;this.indices[n++]=t.getPrevItem().p0.i,this.indices[n++]=t.getCurrItem().p0.i,this.indices[n++]=t.getNextItem().p0.i}},fa.prototype.clipEars_=function(t,i,s,h){var n,e,r,a=this.indices.length,o=t.firstItem(),u=t.getPrevItem(),c=o,l=t.nextItem(),f=t.getNextItem(),d=!1;do{var v;n=c.p0,r=l.p1,!1===(e=c.p1).reflex&&(v=s?0===this.getPointsInTriangle_(n,e,r,i,!0).length:h?this.diagonalIsInside_(f.p1,r,e,n,u.p0):this.diagonalIsInside_(u.p0,n,e,r,f.p1),(s||0===this.getIntersections_({p0:n,p1:r},i).length)&&v&&(s||!1===n.reflex||!1===r.reflex||Kh.linearRingIsClockwise([u.p0.x,u.p0.y,n.x,n.y,e.x,e.y,r.x,r.y,f.p1.x,f.p1.y],0,10,2)===!h)&&(this.indices[a++]=n.i,this.indices[a++]=e.i,this.indices[a++]=r.i,this.removeItem_(c,l,t,i),l===o&&(o=f),d=!0)),u=t.getPrevItem(),c=t.getCurrItem(),l=t.nextItem(),f=t.getNextItem()}while(c!==o&&t.getLength()>3);return d},fa.prototype.resolveSelfIntersections_=function(t,i,s){var h=t.firstItem();t.nextItem();var n=h,e=t.nextItem(),r=!1;do{var a=this.calculateIntersection_(n.p0,n.p1,e.p0,e.p1,s);if(a){var o,u=!1,c=this.indices.length,l=this.vertices.length/2,f=t.prevItem();if(t.removeItem(),i.remove(f),u=f===h,s?(a[0]===n.p0.x&&a[1]===n.p0.y?(t.prevItem(),e.p0=o=n.p0,i.remove(n),u=u||n===h):(n.p1=o=e.p1,i.remove(e),u=u||e===h),t.removeItem()):(o=this.createPoint_(a[0],a[1],l),n.p1=o,e.p0=o,i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),i.update([Math.min(e.p0.x,e.p1.x),Math.min(e.p0.y,e.p1.y),Math.max(e.p0.x,e.p1.x),Math.max(e.p0.y,e.p1.y)],e)),this.indices[c++]=f.p0.i,this.indices[c++]=f.p1.i,this.indices[c++]=o.i,r=!0,u)break}n=t.getPrevItem(),e=t.nextItem()}while(n!==h);return r},fa.prototype.isSimple_=function(t,i){var s=t.firstItem(),h=s;do{if(this.getIntersections_(h,i).length)return!1;h=t.nextItem()}while(h!==s);return!0},fa.prototype.isClockwise_=function(t){var i=2*t.getLength(),s=new Array(i),h=t.firstItem(),n=h,e=0;do{s[e++]=n.p0.x,s[e++]=n.p0.y,n=t.nextItem()}while(n!==h);return Kh.linearRingIsClockwise(s,0,i,2)},fa.prototype.splitPolygon_=function(t,i){var s=t.firstItem(),h=s;do{var n=this.getIntersections_(h,i);if(n.length){var e=n[0],r=this.vertices.length/2,a=this.calculateIntersection_(h.p0,h.p1,e.p0,e.p1),o=this.createPoint_(a[0],a[1],r),u=new ca,c=new la;this.insertItem_(o,h.p1,u,c),h.p1=o,i.update([Math.min(h.p0.x,o.x),Math.min(h.p0.y,o.y),Math.max(h.p0.x,o.x),Math.max(h.p0.y,o.y)],h);for(var l=t.nextItem();l!==e;)this.insertItem_(l.p0,l.p1,u,c),i.remove(l),t.removeItem(),l=t.getCurrItem();this.insertItem_(e.p0,o,u,c),e.p0=o,i.update([Math.min(e.p1.x,o.x),Math.min(e.p1.y,o.y),Math.max(e.p1.x,o.x),Math.max(e.p1.y,o.y)],e),this.classifyPoints_(t,i,!1),this.triangulate_(t,i),this.classifyPoints_(u,c,!1),this.triangulate_(u,c);break}h=t.nextItem()}while(h!==s)},fa.prototype.createPoint_=function(t,i,s){var h=this.vertices.length;return this.vertices[h++]=t,this.vertices[h++]=i,{x:t,y:i,i:s,reflex:void 0}},fa.prototype.insertItem_=function(t,i,s,h){var n={p0:t,p1:i};return s.insertItem(n),h&&h.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],n),n},fa.prototype.removeItem_=function(t,i,s,h){s.getCurrItem()===i&&(s.removeItem(),t.p1=i.p1,h.remove(i),h.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},fa.prototype.getPointsInTriangle_=function(t,i,s,h,n){var e,r,a,o,u=[],c=h.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(e=0,r=c.length;e<r;++e)for(a in c[e])"object"!=typeof(o=c[e][a])||n&&!o.reflex||o.x===t.x&&o.y===t.y||o.x===i.x&&o.y===i.y||o.x===s.x&&o.y===s.y||-1!==u.indexOf(o)||!Xh.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)||u.push(o);return u},fa.prototype.getIntersections_=function(t,i,s){var h,n,e=t.p0,r=t.p1,a=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]),o=[];for(h=0,n=a.length;h<n;++h){var u=a[h];t!==u&&(s||u.p0!==r||u.p1!==e)&&this.calculateIntersection_(e,r,u.p0,u.p1,s)&&o.push(u)}return o},fa.prototype.calculateIntersection_=function(t,i,s,h,n){var e=(h.y-s.y)*(i.x-t.x)-(h.x-s.x)*(i.y-t.y);if(0!==e){var r=((h.x-s.x)*(t.y-s.y)-(h.y-s.y)*(t.x-s.x))/e,a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/e;if(!n&&r>Hr.EPSILON&&r<1-Hr.EPSILON&&a>Hr.EPSILON&&a<1-Hr.EPSILON||n&&r>=0&&r<=1&&a>=0&&a<=1)return[t.x+r*(i.x-t.x),t.y+r*(i.y-t.y)]}},fa.prototype.diagonalIsInside_=function(t,i,s,h,n){if(void 0===i.reflex||void 0===h.reflex)return!1;var e=(s.x-h.x)*(i.y-h.y)>(s.y-h.y)*(i.x-h.x),r=(n.x-h.x)*(i.y-h.y)<(n.y-h.y)*(i.x-h.x),a=(t.x-i.x)*(h.y-i.y)>(t.y-i.y)*(h.x-i.x),o=(s.x-i.x)*(h.y-i.y)<(s.y-i.y)*(h.x-i.x);return(h.reflex?r||e:r&&e)&&(i.reflex?o||a:o&&a)},fa.prototype.drawMultiPolygon=function(t,i){var s,h,n,e,r=t.getEndss(),a=t.getStride(),o=this.indices.length,u=this.lineStringReplay.getCurrentIndex(),c=t.getFlatCoordinates(),l=0;for(s=0,h=r.length;s<h;++s){var f=r[s];if(f.length>0){var d=Ph(c,l,f[0],a,-this.origin[0],-this.origin[1]);if(d.length){var v,m=[];for(n=1,e=f.length;n<e;++n)f[n]!==f[n-1]&&(v=Ph(c,f[n-1],f[n],a,-this.origin[0],-this.origin[1]),m.push(v));this.lineStringReplay.drawPolygonCoordinates(d,m,a),this.drawCoordinates_(d,m,a)}}l=f[f.length-1]}this.indices.length>o&&(this.startIndices.push(o),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(o),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>u&&this.lineStringReplay.setPolygonStyle(i,u)},fa.prototype.drawPolygon=function(t,i){var s=t.getEnds(),h=t.getStride();if(s.length>0){var n=t.getFlatCoordinates().map(Number),e=Ph(n,0,s[0],h,-this.origin[0],-this.origin[1]);if(e.length){var r,a,o,u=[];for(r=1,a=s.length;r<a;++r)s[r]!==s[r-1]&&(o=Ph(n,s[r-1],s[r],h,-this.origin[0],-this.origin[1]),u.push(o));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(i),this.lineStringReplay.drawPolygonCoordinates(e,u,h),this.drawCoordinates_(e,u,h)}}},fa.prototype.finish=function(t){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},fa.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i),t.deleteBuffer(s),h()}},fa.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(aa.fragment,aa.vertex);return this.defaultLocations_?s=this.defaultLocations_:(s=new oa(t,h),this.defaultLocations_=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Qh.FLOAT,!1,8,0),s},fa.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)},fa.prototype.drawReplay=function(t,i,s,h){var n,e,r,a=t.getParameter(t.DEPTH_FUNC),o=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),Ws.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)e=this.styleIndices_[n],this.setFillStyle_(t,this.styles_[n]),this.drawElements(t,i,e,r),r=e;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(o),t.depthFunc(a))},fa.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c;for(a=this.startIndices[1+(c=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setFillStyle_(t,this.styles_[e]),o=this.styleIndices_[e];c>=0&&this.startIndices[c]>=o;){if(r=this.startIndices[c],void 0===s[Gs.getUid(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||zh.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var l=h(u);if(l)return l}c--,a=r}},fa.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o;for(e=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,this.styles_[h]),r=this.styleIndices_[h];a>=0&&this.startIndices[a]>=r;)o=this.startIndices[a],s[Gs.getUid(this.startIndicesFeature[a]).toString()]&&(n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),e=o),a--,n=o;n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),n=e=r}},fa.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)},fa.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(s=s instanceof CanvasGradient||s instanceof CanvasPattern?Hr.defaultFillStyle:Je.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultFillStyle,this.state_.fillColor&&_h.equals(s,this.state_.fillColor)||(this.state_.fillColor=s,this.state_.changed=!0,this.styles_.push(s)),i)this.lineStringReplay.setFillStrokeStyle(null,i);else{var h=new ua({color:[0,0,0,0]});this.lineStringReplay.setFillStrokeStyle(null,h)}};var da=function(t,i){this.space_=i,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=Dn(t,t),this.canvas_=this.context_.canvas};da.prototype.get=function(t){return this.entries_[t]||null},da.prototype.add=function(t,i,s,h,n){var e,r,a;for(r=0,a=this.emptyBlocks_.length;r<a;++r)if((e=this.emptyBlocks_[r]).width>=i+this.space_&&e.height>=s+this.space_){var o={offsetX:e.x+this.space_,offsetY:e.y+this.space_,image:this.canvas_};return this.entries_[t]=o,h.call(n,this.context_,e.x+this.space_,e.y+this.space_),this.split_(r,e,i+this.space_,s+this.space_),o}return null},da.prototype.split_=function(t,i,s,h){i.width-s>i.height-h?this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:i.height},{x:i.x,y:i.y+h,width:s,height:i.height-h}):this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:h},{x:i.x,y:i.y+h,width:i.width,height:i.height-h})},da.prototype.updateBlocks_=function(t,i,s){var h=[t,1];i.width>0&&i.height>0&&h.push(i),s.width>0&&s.height>0&&h.push(s),this.emptyBlocks_.splice.apply(this.emptyBlocks_,h)};var va=function(t){var i=t||{};this.currentSize_=void 0!==i.initialSize?i.initialSize:Gs.INITIAL_ATLAS_SIZE,this.maxSize_=void 0!==i.maxSize?i.maxSize:-1!=Gs.MAX_ATLAS_SIZE?Gs.MAX_ATLAS_SIZE:void 0!==Gs.WEBGL_MAX_TEXTURE_SIZE?Gs.WEBGL_MAX_TEXTURE_SIZE:2048,this.space_=void 0!==i.space?i.space:1,this.atlases_=[new da(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new da(this.currentHitSize_,this.space_)]};va.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i)return null;var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)},va.prototype.getInfo_=function(t,i){var s,h,n;for(h=0,n=t.length;h<n;++h)if(s=t[h].get(i))return s;return null},va.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}},va.prototype.add=function(t,i,s,h,n,e){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_)return null;var r=this.add_(!1,t,i,s,h,e);if(!r)return null;var a=this.add_(!0,t,i,s,void 0!==n?n:Gs.nullFunction,e);return this.mergeInfos_(r,a)},va.prototype.add_=function(t,i,s,h,n,e){var r,a,o,u,c=t?this.hitAtlases_:this.atlases_;for(o=0,u=c.length;o<u;++o){if(a=(r=c[o]).add(i,s,h,n,e))return a;var l;a||o!==u-1||(t?(l=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=l):(l=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=l),r=new da(l,this.space_),c.push(r),++u)}return null};var ma=function(t,i){ia.call(this,t,i),this.images_=[],this.textures_=[],this.measureCanvas_=Dn(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1};Gs.inherits(ma,ia),ma.prototype.drawText=function(t,i){if(this.text_){var s=null,h=2,n=2;switch(t.getType()){case ah:case lh:h=(s=t.getFlatCoordinates()).length,n=t.getStride();break;case mh:s=t.getCenter();break;case oh:s=t.getFlatMidpoint();break;case fh:h=(s=t.getFlatMidpoints()).length;break;case ch:s=t.getFlatInteriorPoint();break;case dh:h=(s=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var e,r,a,o,u,c,l,f,d=this.currAtlas_,v=this.text_.split("\n"),m=this.getTextSize_(v),p=Math.round(m[0]*this.textAlign_-this.offsetX_),_=Math.round(m[1]*this.textBaseline_-this.offsetY_),g=this.state_.lineWidth/2*this.state_.scale;for(e=0,r=v.length;e<r;++e)for(u=0,c=d.height*e,a=0,o=(l=v[e].split("")).length;a<o;++a){if(f=d.atlas.getInfo(l[a])){var z=f.image;this.anchorX=p-u,this.anchorY=_-c,this.originX=0===a?f.offsetX-g:f.offsetX,this.originY=f.offsetY,this.height=d.height,this.width=0===a||a===l.length-1?d.width[l[a]]+g:d.width[l[a]],this.imageHeight=z.height,this.imageWidth=z.width,0===this.images_.length?this.images_.push(z):Gs.getUid(this.images_[this.images_.length-1])!=Gs.getUid(z)&&(this.groupIndices.push(this.indices.length),this.images_.push(z)),this.drawText_(s,0,h,n)}u+=this.width}}},ma.prototype.getTextSize_=function(t){var i=this,s=this.currAtlas_,h=t.length*s.height;return[t.map((function(t){var h,n,e=0;for(h=0,n=t.length;h<n;++h){var r=t[h];s.width[r]||i.addCharToAtlas_(r),e+=s.width[r]?s.width[r]:0}return e})).reduce((function(t,i){return Math.max(t,i)})),h]},ma.prototype.drawText_=function(t,i,s,h){var n,e;for(n=i,e=s;n<e;n+=h)this.drawCoordinates(t,i,s,h)},ma.prototype.addCharToAtlas_=function(t){if(1===t.length){var i=this.currAtlas_,s=this.state_,h=this.measureCanvas_.getContext("2d");h.font=s.font;var n=Math.ceil(h.measureText(t).width*s.scale);i.atlas.add(t,n,i.height,(function(i,h,n){i.font=s.font,i.fillStyle=s.fillColor,i.strokeStyle=s.strokeColor,i.lineWidth=s.lineWidth,i.lineCap=s.lineCap,i.lineJoin=s.lineJoin,i.miterLimit=s.miterLimit,i.textAlign="left",i.textBaseline="top",tn.CANVAS_LINE_DASH&&s.lineDash&&(i.setLineDash(s.lineDash),i.lineDashOffset=s.lineDashOffset),1!==s.scale&&i.setTransform(s.scale,0,0,s.scale,0,0),s.strokeColor&&i.strokeText(t,h,n),s.fillColor&&i.fillText(t,h,n)}))&&(i.width[t]=n)}},ma.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.createTextures(this.textures_,this.images_,{},i),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,ia.prototype.finish.call(this,t)},ma.prototype.setTextStyle=function(t){var i=this.state_,s=t.getFill(),h=t.getStroke();if(t&&t.getText()&&(s||h)){if(s){var n=s.getColor();i.fillColor=Ze.asColorLike(n||Hr.defaultFillStyle)}else i.fillColor=null;if(h){var e=h.getColor();i.strokeColor=Ze.asColorLike(e||Hr.defaultStrokeStyle),i.lineWidth=h.getWidth()||Hr.defaultLineWidth,i.lineCap=h.getLineCap()||Hr.defaultLineCap,i.lineDashOffset=h.getLineDashOffset()||Hr.defaultLineDashOffset,i.lineJoin=h.getLineJoin()||Hr.defaultLineJoin,i.miterLimit=h.getMiterLimit()||Hr.defaultMiterLimit;var r=h.getLineDash();i.lineDash=r?r.slice():Hr.defaultLineDash}else i.strokeColor=null,i.lineWidth=0;i.font=t.getFont()||Hr.defaultFont,i.scale=t.getScale()||1,this.text_=t.getText();var a=Pr.TEXT_ALIGN[t.getTextAlign()],o=Pr.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=void 0===a?Hr.defaultTextAlign:a,this.textBaseline_=void 0===o?Hr.defaultTextBaseline:o,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(i)}else this.text_=""},ma.prototype.getAtlas_=function(t){var i,s=[];for(i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?s=s.concat(t[i]):s.push(t[i]));var h=this.calculateHash_(s);if(!this.atlases_[h]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var e=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[h]={atlas:new va({space:t.lineWidth+1}),width:{},height:e}}return this.atlases_[h]},ma.prototype.calculateHash_=function(t){var i,s,h="";for(i=0,s=t.length;i<s;++i)h+=t[i];return h},ma.prototype.getTextures=function(){return this.textures_},ma.prototype.getHitDetectionTextures=function(){return this.textures_};var pa=function(t,i,s){pr.call(this),this.maxExtent_=i,this.tolerance_=t,this.renderBuffer_=s,this.replaysByZIndex_={}};Gs.inherits(pa,pr),pa.prototype.addDeclutter=function(){},pa.prototype.getDeleteResourcesFunction=function(t){var i,s=[];for(i in this.replaysByZIndex_){var h,n=this.replaysByZIndex_[i];for(h in n)s.push(n[h].getDeleteResourcesFunction(t))}return function(){for(var t,i=s.length,h=0;h<i;h++)t=s[h].apply(this,arguments);return t}},pa.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s,h=this.replaysByZIndex_[i];for(s in h)h[s].finish(t)}},pa.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,pa.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_),h[i]=n),n},pa.prototype.isEmpty=function(){return Ws.isEmpty(this.replaysByZIndex_)},pa.prototype.replay=function(t,i,s,h,n,e,r,a){var o,u,c,l,f,d,v=Object.keys(this.replaysByZIndex_).map(Number);for(v.sort(_h.numberSafeCompareFunction),o=0,u=v.length;o<u;++o)for(f=this.replaysByZIndex_[v[o].toString()],c=0,l=Pr.ORDER.length;c<l;++c)void 0!==(d=f[Pr.ORDER[c]])&&d.replay(t,i,s,h,n,e,r,a,void 0,!1)},pa.prototype.replayHitDetection_=function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d,v,m,p,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort((function(t,i){return i-t})),l=0,f=_.length;l<f;++l)for(v=this.replaysByZIndex_[_[l].toString()],d=Pr.ORDER.length-1;d>=0;--d)if(void 0!==(m=v[Pr.ORDER[d]])&&(p=m.replay(t,i,s,h,n,e,r,a,o,u,c)))return p},pa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r,a,o,u){var c,l=i.getGL();return l.bindFramebuffer(l.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(c=zh.buffer(zh.createOrUpdateFromCoordinate(t),h*this.renderBuffer_)),this.replayHitDetection_(i,t,h,n,pa.HIT_DETECTION_SIZE_,r,a,o,(function(t){var i=new Uint8Array(4);if(l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,i),i[3]>0){var s=u(t);if(s)return s}}),!0,c)},pa.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n,e,r,a,o){var u=i.getGL();return u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(i,t,h,n,pa.HIT_DETECTION_SIZE_,r,a,o,(function(){var t=new Uint8Array(4);return u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,t),t[3]>0}),!1)},pa.HIT_DETECTION_SIZE_=[1,1],pa.BATCH_CONSTRUCTORS_={Circle:Jr,Image:sa,LineString:ra,Polygon:fa,Text:ma};var _a=function(t,i,s,h,n,e,r){Ke.call(this),this.context_=t,this.center_=i,this.extent_=e,this.pixelRatio_=r,this.size_=n,this.rotation_=h,this.resolution_=s,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null};Gs.inherits(_a,Ke),_a.prototype.drawText_=function(t,i){var s=this.context_,h=t.getReplay(0,br);h.setTextStyle(this.textStyle_),h.drawText(i,null),h.finish(s),h.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),h.getDeleteResourcesFunction(s)()},_a.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},_a.prototype.drawGeometry=function(t){switch(t.getType()){case ah:this.drawPoint(t,null);break;case oh:this.drawLineString(t,null);break;case ch:this.drawPolygon(t,null);break;case lh:this.drawMultiPoint(t,null);break;case fh:this.drawMultiLineString(t,null);break;case dh:this.drawMultiPolygon(t,null);break;case vh:this.drawGeometryCollection(t,null);break;case mh:this.drawCircle(t,null)}},_a.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&zh.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},_a.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},_a.prototype.drawPoint=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,zr);n.setImageStyle(this.imageStyle_),n.drawPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiPoint=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,zr);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawLineString=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,Mr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiLineString=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,Mr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawPolygon=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,wr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiPolygon=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,wr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawCircle=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,_r);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.setImageStyle=function(t){this.imageStyle_=t},_a.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t,this.strokeStyle_=i},_a.prototype.setTextStyle=function(t){this.textStyle_=t};var ga={};ga.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"),ga.vertex=new jr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var za=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texCoordMatrix":"d"),this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"e"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"f"),this.u_texture=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texture":"g"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"c")},Ma=function(t,i){Qe.call(this,i),this.mapRenderer=t,this.arrayBuffer_=new Yr([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=Oh.create(),this.projectionMatrix=Oh.create(),this.tmpMat4_=qr(),this.defaultLocations_=null};Gs.inherits(Ma,Qe),Ma.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=i){var h=function(t,i,s){t.isContextLost()||(t.deleteFramebuffer(i),t.deleteTexture(s))}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(h);var n=ta.createEmptyTexture(s,i,i),e=s.createFramebuffer();s.bindFramebuffer(Qh.FRAMEBUFFER,e),s.framebufferTexture2D(Qh.FRAMEBUFFER,Qh.COLOR_ATTACHMENT0,Qh.TEXTURE_2D,n,0),this.texture=n,this.framebuffer=e,this.framebufferDimension=i}else s.bindFramebuffer(Qh.FRAMEBUFFER,this.framebuffer)},Ma.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(me,s,t),s.bindBuffer(Qh.ARRAY_BUFFER,this.arrayBuffer_);var h,n=s.getGL(),e=s.getProgram(ga.fragment,ga.vertex);this.defaultLocations_?h=this.defaultLocations_:(h=new za(n,e),this.defaultLocations_=h),s.useProgram(e)&&(n.enableVertexAttribArray(h.a_position),n.vertexAttribPointer(h.a_position,2,Qh.FLOAT,!1,16,0),n.enableVertexAttribArray(h.a_texCoord),n.vertexAttribPointer(h.a_texCoord,2,Qh.FLOAT,!1,16,8),n.uniform1i(h.u_texture,0)),n.uniformMatrix4fv(h.u_texCoordMatrix,!1,Br(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(h.u_projectionMatrix,!1,Br(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(h.u_opacity,i.opacity),n.bindTexture(Qh.TEXTURE_2D,this.getTexture()),n.drawArrays(Qh.TRIANGLE_STRIP,0,4),this.dispatchComposeEvent_(ve,s,t)},Ma.prototype.dispatchComposeEvent_=function(t,i,s){var h=this.getLayer();if(h.hasListener(t)){var n=s.viewState,e=new _a(i,n.center,n.resolution,n.rotation,s.size,s.extent,s.pixelRatio),r=new qe(t,e,s,null,i);h.dispatchEvent(r)}},Ma.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},Ma.prototype.getTexture=function(){return this.texture},Ma.prototype.getProjectionMatrix=function(){return this.projectionMatrix},Ma.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},Ma.prototype.prepareFrame=function(){},Ma.prototype.forEachLayerAtPixel=function(){};var wa=function(t,i){Ma.call(this,t,i),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null};Gs.inherits(wa,Ma),wa.handles=function(t,i){return t===ee&&i.getType()===je},wa.create=function(t,i){return new wa(t,i)},wa.prototype.createTexture_=function(t){var i=t.getImage(),s=this.mapRenderer.getGL();return ta.createTexture(s,i,Qh.CLAMP_TO_EDGE,Qh.CLAMP_TO_EDGE)},wa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=this.getLayer();return e.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,e)}))},wa.prototype.prepareFrame=function(t,i){var s=this.mapRenderer.getGL(),h=t.pixelRatio,n=t.viewState,e=n.center,r=n.resolution,a=n.rotation,o=this.image_,u=this.texture,c=this.getLayer().getSource(),l=t.viewHints,f=t.extent;if(void 0!==i.extent&&(f=zh.getIntersection(f,i.extent)),!l[0]&&!l[1]&&!zh.isEmpty(f)){var d=n.projection;if(!Gs.ENABLE_RASTER_REPROJECTION){var v=c.getProjection();v&&(d=v)}var m=c.getImage(f,r,h,d);if(m&&this.loadImage(m)&&(o=m,u=this.createTexture_(m),this.texture)){var p=function(t,i){t.isContextLost()||t.deleteTexture(i)}.bind(null,s,this.texture);t.postRenderFunctions.push(p)}}if(o){var _=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(_.width,_.height,h,e,r,a,o.getExtent()),this.hitTransformationMatrix_=null;var g=this.texCoordMatrix;Oh.reset(g),Oh.scale(g,1,-1),Oh.translate(g,0,-1),this.image_=o,this.texture=u,this.updateLogos(t,c)}return!!o},wa.prototype.updateProjectionMatrix_=function(t,i,s,h,n,e,r){var a=t*n,o=i*n,u=this.projectionMatrix;Oh.reset(u),Oh.scale(u,2*s/a,2*s/o),Oh.rotate(u,-e),Oh.translate(u,r[0]-h[0],r[1]-h[1]),Oh.scale(u,(r[2]-r[0])/2,(r[3]-r[1])/2),Oh.translate(u,1,1)},wa.prototype.hasFeatureAtCoordinate=function(t,i){return void 0!==this.forEachFeatureAtCoordinate(t,i,0,xh.TRUE,this)},wa.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Gs.nullFunction){var n=Oh.apply(i.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,i,0,xh.TRUE,this)?s.call(h,this.getLayer(),null):void 0}var e=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,e));var r=Oh.apply(this.hitTransformationMatrix_,t.slice());if(!(r[0]<0||r[0]>e[0]||r[1]<0||r[1]>e[1])){this.hitCanvasContext_||(this.hitCanvasContext_=Dn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),r[0],r[1],1,1,0,0,1,1);var a=this.hitCanvasContext_.getImageData(0,0,1,1).data;return a[3]>0?s.call(h,this.getLayer(),a):void 0}}},wa.prototype.getHitTransformationMatrix_=function(t,i){var s=Oh.create();Oh.translate(s,-1,-1),Oh.scale(s,2/t[0],2/t[1]),Oh.translate(s,0,t[1]),Oh.scale(s,1,-1);var h=Oh.invert(this.projectionMatrix.slice()),n=Oh.create();return Oh.translate(n,0,i[1]),Oh.scale(n,1,-1),Oh.scale(n,i[0]/2,i[1]/2),Oh.translate(n,1,1),Oh.multiply(n,h),Oh.multiply(n,s),n};var ba=function(t,i){er.call(this,t,i),this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=de.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=Dn(),this.renderedVisible_=!0,this.gl_=Qh.getContext(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new ta(this.canvas_,this.gl_),js.listen(this.canvas_,$r,this.handleWebGLContextLost,this),js.listen(this.canvas_,Qr,this.handleWebGLContextRestored,this),this.textureCache_=new Be,this.focus_=null,this.tileTextureQueue_=new Sn(function(t){var i=t[1],s=t[2],h=i[0]-this.focus_[0],n=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(h*h+n*n)/s}.bind(this),(function(t){return t[0].getKey()})),this.loadNextTileTexture_=function(){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var t=this.tileTextureQueue_.dequeue();this.bindTileTexture(t[0],t[3],t[4],Qh.LINEAR,Qh.LINEAR)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()};Gs.inherits(ba,er),ba.handles=function(t){return tn.WEBGL&&t===ee},ba.create=function(t,i){return new ba(t,i)},ba.prototype.bindTileTexture=function(t,i,s,h,n){var e=this.getGL(),r=t.getKey();if(this.textureCache_.containsKey(r)){var a=this.textureCache_.get(r);e.bindTexture(Qh.TEXTURE_2D,a.texture),a.magFilter!=h&&(e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MAG_FILTER,h),a.magFilter=h),a.minFilter!=n&&(e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MIN_FILTER,n),a.minFilter=n)}else{var o=e.createTexture();if(e.bindTexture(Qh.TEXTURE_2D,o),s>0){var u=this.clipTileContext_.canvas,c=this.clipTileContext_;this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]?(u.width=i[0],u.height=i[1],this.clipTileCanvasWidth_=i[0],this.clipTileCanvasHeight_=i[1]):c.clearRect(0,0,i[0],i[1]),c.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]),e.texImage2D(Qh.TEXTURE_2D,0,Qh.RGBA,Qh.RGBA,Qh.UNSIGNED_BYTE,u)}else e.texImage2D(Qh.TEXTURE_2D,0,Qh.RGBA,Qh.RGBA,Qh.UNSIGNED_BYTE,t.getImage());e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MAG_FILTER,h),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MIN_FILTER,n),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_S,Qh.CLAMP_TO_EDGE),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_T,Qh.CLAMP_TO_EDGE),this.textureCache_.set(r,{texture:o,magFilter:h,minFilter:n})}},ba.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var h=this.context_,n=i.viewState,e=new _a(h,n.center,n.resolution,n.rotation,i.size,i.extent,i.pixelRatio),r=new qe(t,e,i,null,h);s.dispatchEvent(r)}},ba.prototype.disposeInternal=function(){var t=this.getGL();t.isContextLost()||this.textureCache_.forEach((function(i){i&&t.deleteTexture(i.texture)})),this.context_.dispose(),er.prototype.disposeInternal.call(this)},ba.prototype.expireCache_=function(t,i){for(var s,h=this.getGL();this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Gs.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK;){if(s=this.textureCache_.peekLast())h.deleteTexture(s.texture);else{if(+this.textureCache_.peekLastKey()==i.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},ba.prototype.getContext=function(){return this.context_},ba.prototype.getGL=function(){return this.gl_},ba.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},ba.prototype.getType=function(){return ee},ba.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i)i[s].handleWebGLContextLost()},ba.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},ba.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(Qh.TEXTURE0),t.blendFuncSeparate(Qh.SRC_ALPHA,Qh.ONE_MINUS_SRC_ALPHA,Qh.ONE,Qh.ONE_MINUS_SRC_ALPHA),t.disable(Qh.CULL_FACE),t.disable(Qh.DEPTH_TEST),t.disable(Qh.SCISSOR_TEST),t.disable(Qh.STENCIL_TEST)},ba.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},ba.prototype.renderFrame=function(t){var i=this.getContext(),s=this.getGL();if(s.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(me,t);var h=[],n=t.layerStatesArray;_h.stableSort(n,er.sortByZIndex);var e,r,a,o=t.viewState.resolution;for(e=0,r=n.length;e<r;++e)_e.visibleAtResolution(a=n[e],o)&&a.sourceState==Qn&&this.getLayerRenderer(a.layer).prepareFrame(t,a,i)&&h.push(a);var u=t.size[0]*t.pixelRatio,c=t.size[1]*t.pixelRatio;for(this.canvas_.width==u&&this.canvas_.height==c||(this.canvas_.width=u,this.canvas_.height=c),s.bindFramebuffer(Qh.FRAMEBUFFER,null),s.clearColor(0,0,0,0),s.clear(Qh.COLOR_BUFFER_BIT),s.enable(Qh.BLEND),s.viewport(0,0,this.canvas_.width,this.canvas_.height),e=0,r=h.length;e<r;++e)this.getLayerRenderer((a=h[e]).layer).composeFrame(t,a,i);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Gs.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(ve,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},ba.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a;if(this.getGL().isContextLost())return!1;var o,u=i.viewState,c=i.layerStatesArray;for(o=c.length-1;o>=0;--o){var l=c[o],f=l.layer;if(_e.visibleAtResolution(l,u.resolution)&&e.call(r,f)&&(a=this.getLayerRenderer(f).forEachFeatureAtCoordinate(t,i,s,h,n)))return a}},ba.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){var e=!1;if(this.getGL().isContextLost())return!1;var r,a=i.viewState,o=i.layerStatesArray;for(r=o.length-1;r>=0;--r){var u=o[r],c=u.layer;if(_e.visibleAtResolution(u,a.resolution)&&h.call(n,c)&&(e=this.getLayerRenderer(c).hasFeatureAtCoordinate(t,i)))return!0}return e},ba.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.getGL().isContextLost())return!1;var e,r,a=i.viewState,o=i.layerStatesArray;for(r=o.length-1;r>=0;--r){var u=o[r],c=u.layer;if(_e.visibleAtResolution(u,a.resolution)&&n.call(h,c)&&(e=this.getLayerRenderer(c).forEachLayerAtPixel(t,i,s,h)))return e}};var xa={};xa.fragment=new Wr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"),xa.vertex=new jr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var ya=function(t,i){this.u_tileOffset=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_tileOffset":"d"),this.u_texture=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texture":"e"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"c")},Ea=function(t,i){Ma.call(this,t,i),this.fragmentShader_=xa.fragment,this.vertexShader_=xa.vertex,this.locations_=null,this.renderArrayBuffer_=new Yr([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]};Gs.inherits(Ea,Ma),Ea.handles=function(t,i){return t===ee&&i.getType()===Ue},Ea.create=function(t,i){return new Ea(t,i)},Ea.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),Ma.prototype.disposeInternal.call(this)},Ea.prototype.createLoadedTileFinder=function(t,i,s){var h=this.mapRenderer;return function(n,e){return t.forEachLoadedTile(i,n,e,(function(t){var i=h.isTileTextureLoaded(t);return i&&(s[n]||(s[n]={}),s[n][t.tileCoord.toString()]=t),i}))}},Ea.prototype.handleWebGLContextLost=function(){Ma.prototype.handleWebGLContextLost.call(this),this.locations_=null},Ea.prototype.prepareFrame=function(t,i,s){var h,n=this.mapRenderer,e=s.getGL(),r=t.viewState,a=r.projection,o=this.getLayer(),u=o.getSource(),c=u.getTileGridForProjection(a),l=c.getZForResolution(r.resolution),f=c.getResolution(l),d=u.getTilePixelSize(l,t.pixelRatio,a),v=d[0]/oe(c.getTileSize(l),this.tmpSize_)[0],m=f/v,p=u.getTilePixelRatio(v)*u.getGutter(a),_=r.center,g=t.extent,z=c.getTileRangeForExtentAndZ(g,l);if(this.renderedTileRange_&&this.renderedTileRange_.equals(z)&&this.renderedRevision_==u.getRevision())h=this.renderedFramebufferExtent_;else{var M=z.getSize(),w=Math.max(M[0]*d[0],M[1]*d[1]),b=rh.roundUpToPowerOfTwo(w),x=m*b,y=c.getOrigin(l),E=y[0]+z.minX*d[0]*m,S=y[1]+z.minY*d[1]*m;h=[E,S,E+x,S+x],this.bindFramebuffer(t,b),e.viewport(0,0,b,b),e.clearColor(0,0,0,0),e.clear(Qh.COLOR_BUFFER_BIT),e.disable(Qh.BLEND);var P=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(P),this.locations_||(this.locations_=new ya(e,P)),s.bindBuffer(Qh.ARRAY_BUFFER,this.renderArrayBuffer_),e.enableVertexAttribArray(this.locations_.a_position),e.vertexAttribPointer(this.locations_.a_position,2,Qh.FLOAT,!1,16,0),e.enableVertexAttribArray(this.locations_.a_texCoord),e.vertexAttribPointer(this.locations_.a_texCoord,2,Qh.FLOAT,!1,16,8),e.uniform1i(this.locations_.u_texture,0);var G={};G[l]={};var k,N,C,A,R,I,T=this.createLoadedTileFinder(u,a,G),O=o.getUseInterimTilesOnError(),F=!0,L=zh.createEmpty(),D=new ar(0,0,0,0);for(A=z.minX;A<=z.maxX;++A)for(R=z.minY;R<=z.maxY;++R)if(N=u.getTile(l,A,R,v,a),void 0===i.extent||(I=c.getTileCoordExtent(N.tileCoord,L),zh.intersects(I,i.extent))){if(2==(C=N.getState())||4==C||3==C&&!O||(N=N.getInterimTile()),2==(C=N.getState())){if(n.isTileTextureLoaded(N)){G[l][N.tileCoord.toString()]=N;continue}}else if(4==C||3==C&&!O)continue;F=!1,c.forEachTileCoordParentTileRange(N.tileCoord,T,null,D,L)||(k=c.getTileCoordChildTileRange(N.tileCoord,D,L))&&T(l+1,k)}var W=Object.keys(G).map(Number);W.sort(_h.numberSafeCompareFunction);var j,U,V,q,B=new Float32Array(4);for(j=0,U=W.length;j<U;++j)for(V in q=G[W[j]])I=c.getTileCoordExtent((N=q[V]).tileCoord,L),B[0]=2*(I[2]-I[0])/x,B[1]=2*(I[3]-I[1])/x,B[2]=2*(I[0]-h[0])/x-1,B[3]=2*(I[1]-h[1])/x-1,e.uniform4fv(this.locations_.u_tileOffset,B),n.bindTileTexture(N,d,p*v,Qh.LINEAR,Qh.LINEAR),e.drawArrays(Qh.TRIANGLE_STRIP,0,4);F?(this.renderedTileRange_=z,this.renderedFramebufferExtent_=h,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,l,z);var X=n.getTileTextureQueue();this.manageTilePyramid(t,u,c,v,a,g,l,o.getPreload(),(function(t){2!=t.getState()||n.isTileTextureLoaded(t)||X.isKeyQueued(t.getKey())||X.enqueue([t,c.getTileCoordCenter(t.tileCoord),c.getResolution(t.tileCoord[0]),d,p*v])}),this),this.scheduleExpireCache(t,u),this.updateLogos(t,u);var H=this.texCoordMatrix;return Oh.reset(H),Oh.translate(H,(Math.round(_[0]/f)*f-h[0])/(h[2]-h[0]),(Math.round(_[1]/f)*f-h[1])/(h[3]-h[1])),0!==r.rotation&&Oh.rotate(H,r.rotation),Oh.scale(H,t.size[0]*r.resolution/(h[2]-h[0]),t.size[1]*r.resolution/(h[3]-h[1])),Oh.translate(H,-.5,-.5),!0},Ea.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.framebuffer){var n=Oh.apply(this.texCoordMatrix,[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]].slice()),e=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension],r=this.mapRenderer.getContext().getGL();r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer);var a=new Uint8Array(4);return r.readPixels(e[0],e[1],1,1,r.RGBA,r.UNSIGNED_BYTE,a),a[3]>0?s.call(h,this.getLayer(),a):void 0}};var Sa=function(t,i){Ma.call(this,t,i),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=zh.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null};Gs.inherits(Sa,Ma),Sa.handles=function(t,i){return t===ee&&i.getType()===Ve},Sa.create=function(t,i){return new Sa(t,i)},Sa.prototype.composeFrame=function(t,i,s){this.layerState_=i;var h=t.viewState,n=this.replayGroup_,e=t.size,r=t.pixelRatio,a=this.mapRenderer.getGL();n&&!n.isEmpty()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,e[0]*r,e[1]*r),n.replay(s,h.center,h.resolution,h.rotation,e,r,i.opacity,i.managed?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},Sa.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)(),this.replayGroup_=null}Ma.prototype.disposeInternal.call(this)},Sa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_&&this.layerState_){var e=this.mapRenderer.getContext(),r=i.viewState,a=this.getLayer(),o={};return this.replayGroup_.forEachFeatureAtCoordinate(t,e,r.center,r.resolution,r.rotation,i.size,i.pixelRatio,this.layerState_.opacity,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in o))return o[i]=!0,h.call(n,t,a)}))}},Sa.prototype.hasFeatureAtCoordinate=function(t,i){if(this.replayGroup_&&this.layerState_){var s=this.mapRenderer.getContext(),h=i.viewState;return this.replayGroup_.hasFeatureAtCoordinate(t,s,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,this.layerState_.opacity,i.skippedFeatureUids)}return!1},Sa.prototype.forEachLayerAtPixel=function(t,i,s,h){var n=Oh.apply(i.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,i)?s.call(h,this.getLayer(),null):void 0},Sa.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Sa.prototype.prepareFrame=function(t,i,s){var h=this.getLayer(),n=h.getSource();this.updateLogos(t,n);var e=t.viewHints[0],r=t.viewHints[1],a=h.getUpdateWhileAnimating(),o=h.getUpdateWhileInteracting();if(!this.dirty_&&!a&&e||!o&&r)return!0;var u=t.extent,c=t.viewState,l=c.projection,f=c.resolution,d=t.pixelRatio,v=h.getRevision(),m=h.getRenderBuffer(),p=h.getRenderOrder();void 0===p&&(p=Tr.defaultOrder);var _=zh.buffer(u,m*f);if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==v&&this.renderedRenderOrder_==p&&zh.containsExtent(this.renderedExtent_,_))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s)),this.dirty_=!1;var g=new pa(Tr.getTolerance(f,d),_,h.getRenderBuffer());n.loadFeatures(_,f,l);var z=function(t){var i,s=t.getStyleFunction();if(s?i=s.call(t,f):(s=h.getStyleFunction())&&(i=s(t,f)),i){var n=this.renderFeature(t,f,d,i,g);this.dirty_=this.dirty_||n}};if(p){var M=[];n.forEachFeatureInExtent(_,(function(t){M.push(t)}),this),M.sort(p),M.forEach(z,this)}else n.forEachFeatureInExtent(_,z,this);return g.finish(s),this.renderedResolution_=f,this.renderedRevision_=v,this.renderedRenderOrder_=p,this.renderedExtent_=_,this.replayGroup_=g,!0},Sa.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var e=!1;if(Array.isArray(h))for(var r=h.length-1;r>=0;--r)e=Tr.renderFeature(n,t,h[r],Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;else e=Tr.renderFeature(n,t,h,Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;return e},Gs.ENABLE_CANVAS&&(he.register(ie,rr),he.registerMultiple(se,[sr,or,Or,Lr])),Gs.ENABLE_WEBGL&&(he.register(ie,ba),he.registerMultiple(se,[wa,Ea,Sa]));var Pa=function(t){(t=Ws.assign({},t)).controls||(t.controls=we()),t.interactions||(t.interactions=Le()),ue.call(this,t)};Gs.inherits(Pa,ue);var Ga="bottom-center",ka="bottom-right",Na="center-center",Ca="center-right",Aa=function(t){hh.call(this),this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("DIV"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container "+de.CLASS_SELECTABLE,this.element.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.autoPanAnimation=t.autoPanAnimation||{},this.autoPanMargin=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,js.listen(this,hh.getChangeEventType(Aa.Property.ELEMENT),this.handleElementChanged,this),js.listen(this,hh.getChangeEventType(Aa.Property.MAP),this.handleMapChanged,this),js.listen(this,hh.getChangeEventType(Aa.Property.OFFSET),this.handleOffsetChanged,this),js.listen(this,hh.getChangeEventType(Aa.Property.POSITION),this.handlePositionChanged,this),js.listen(this,hh.getChangeEventType(Aa.Property.POSITIONING),this.handlePositioningChanged,this),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(void 0!==t.positioning?t.positioning:"top-left"),void 0!==t.position&&this.setPosition(t.position)};Gs.inherits(Aa,hh),Aa.prototype.getElement=function(){return this.get(Aa.Property.ELEMENT)},Aa.prototype.getId=function(){return this.id},Aa.prototype.getMap=function(){return this.get(Aa.Property.MAP)},Aa.prototype.getOffset=function(){return this.get(Aa.Property.OFFSET)},Aa.prototype.getPosition=function(){return this.get(Aa.Property.POSITION)},Aa.prototype.getPositioning=function(){return this.get(Aa.Property.POSITIONING)},Aa.prototype.handleElementChanged=function(){qn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},Aa.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Vn(this.element),js.unlistenByKey(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=js.listen(t,wn,this.render,this),this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?i.insertBefore(this.element,i.childNodes[0]||null):i.appendChild(this.element)}},Aa.prototype.render=function(){this.updatePixelPosition()},Aa.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},Aa.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(Aa.Property.POSITION)&&this.autoPan&&this.panIntoView()},Aa.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},Aa.prototype.setElement=function(t){this.set(Aa.Property.ELEMENT,t)},Aa.prototype.setMap=function(t){this.set(Aa.Property.MAP,t)},Aa.prototype.setOffset=function(t){this.set(Aa.Property.OFFSET,t)},Aa.prototype.setPosition=function(t){this.set(Aa.Property.POSITION,t)},Aa.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var i=this.getRect(t.getTargetElement(),t.getSize()),s=this.getElement(),h=this.getRect(s,[Wn(s),jn(s)]),n=this.autoPanMargin;if(!zh.containsExtent(i,h)){var e=h[0]-i[0],r=i[2]-h[2],a=h[1]-i[1],o=i[3]-h[3],u=[0,0];if(e<0?u[0]=e-n:r<0&&(u[0]=Math.abs(r)+n),a<0?u[1]=a-n:o<0&&(u[1]=Math.abs(o)+n),0!==u[0]||0!==u[1]){var c=t.getView().getCenter(),l=t.getPixelFromCoordinate(c),f=[l[0]+u[0],l[1]+u[1]];t.getView().animate({center:t.getCoordinateFromPixel(f),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},Aa.prototype.getRect=function(t,i){var s=t.getBoundingClientRect(),h=s.left+window.pageXOffset,n=s.top+window.pageYOffset;return[h,n,h+i[0],n+i[1]]},Aa.prototype.setPositioning=function(t){this.set(Aa.Property.POSITIONING,t)},Aa.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},Aa.prototype.updatePixelPosition=function(){var t=this.getMap(),i=this.getPosition();if(t&&t.isRendered()&&i){var s=t.getPixelFromCoordinate(i),h=t.getSize();this.updateRenderedPosition(s,h)}else this.setVisible(!1)},Aa.prototype.updateRenderedPosition=function(t,i){var s=this.element.style,h=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var e=h[0],r=h[1];if(n==ka||n==Ca||"top-right"==n){""!==this.rendered.left_&&(this.rendered.left_=s.left="");var a=Math.round(i[0]-t[0]-e)+"px";this.rendered.right_!=a&&(this.rendered.right_=s.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=s.right=""),n!=Ga&&n!=Na&&"top-center"!=n||(e-=this.element.offsetWidth/2);var o=Math.round(t[0]+e)+"px";this.rendered.left_!=o&&(this.rendered.left_=s.left=o)}if("bottom-left"==n||n==Ga||n==ka){""!==this.rendered.top_&&(this.rendered.top_=s.top="");var u=Math.round(i[1]-t[1]-r)+"px";this.rendered.bottom_!=u&&(this.rendered.bottom_=s.bottom=u)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=s.bottom=""),"center-left"!=n&&n!=Na&&n!=Ca||(r-=this.element.offsetHeight/2);var c=Math.round(t[1]+r)+"px";this.rendered.top_!=c&&(this.rendered.top_=s.top=c)}},Aa.prototype.getOptions=function(){return this.options},Aa.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var Ra=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};Ra.prototype.getOpacity=function(){return this.opacity_},Ra.prototype.getRotateWithView=function(){return this.rotateWithView_},Ra.prototype.getRotation=function(){return this.rotation_},Ra.prototype.getScale=function(){return this.scale_},Ra.prototype.getSnapToPixel=function(){return this.snapToPixel_},Ra.prototype.getAnchor=function(){},Ra.prototype.getImage=function(){},Ra.prototype.getHitDetectionImage=function(){},Ra.prototype.getImageState=function(){},Ra.prototype.getImageSize=function(){},Ra.prototype.getHitDetectionImageSize=function(){},Ra.prototype.getOrigin=function(){},Ra.prototype.getSize=function(){},Ra.prototype.setOpacity=function(t){this.opacity_=t},Ra.prototype.setRotateWithView=function(t){this.rotateWithView_=t},Ra.prototype.setRotation=function(t){this.rotation_=t},Ra.prototype.setScale=function(t){this.scale_=t},Ra.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},Ra.prototype.listenImageChange=function(){},Ra.prototype.load=function(){},Ra.prototype.unlistenImageChange=function(){};var Ia=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_),Ra.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})};Gs.inherits(Ia,Ra),Ia.prototype.clone=function(){var t=new Ia({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},Ia.prototype.getAnchor=function(){return this.anchor_},Ia.prototype.getAngle=function(){return this.angle_},Ia.prototype.getFill=function(){return this.fill_},Ia.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},Ia.prototype.getImage=function(){return this.canvas_},Ia.prototype.getImageSize=function(){return this.imageSize_},Ia.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},Ia.prototype.getImageState=function(){return 2},Ia.prototype.getOrigin=function(){return this.origin_},Ia.prototype.getPoints=function(){return this.points_},Ia.prototype.getRadius=function(){return this.radius_},Ia.prototype.getRadius2=function(){return this.radius2_},Ia.prototype.getSize=function(){return this.size_},Ia.prototype.getStroke=function(){return this.stroke_},Ia.prototype.listenImageChange=function(){},Ia.prototype.load=function(){},Ia.prototype.unlistenImageChange=function(){},Ia.prototype.render_=function(t){var i,s,h="",n="",e=0,r=null,a=0,o=0;this.stroke_&&(null===(s=this.stroke_.getColor())&&(s=Ye.defaultStrokeStyle),s=Ze.asColorLike(s),void 0===(o=this.stroke_.getWidth())&&(o=Ye.defaultLineWidth),r=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),tn.CANVAS_LINE_DASH||(r=null,a=0),void 0===(n=this.stroke_.getLineJoin())&&(n=Ye.defaultLineJoin),void 0===(h=this.stroke_.getLineCap())&&(h=Ye.defaultLineCap),void 0===(e=this.stroke_.getMiterLimit())&&(e=Ye.defaultMiterLimit));var u=2*(this.radius_+o)+1,c={strokeStyle:s,strokeWidth:o,size:u,lineCap:h,lineDash:r,lineDashOffset:a,lineJoin:n,miterLimit:e};if(void 0===t){var l=Dn(u,u);this.canvas_=l.canvas,i=u=this.canvas_.width,this.draw_(c,l,0,0),this.createHitDetectionCanvas_(c)}else{u=Math.round(u);var f,d=!this.fill_;d&&(f=this.drawHitDetectionCanvas_.bind(this,c));var v=this.getChecksum(),m=t.add(v,u,u,this.draw_.bind(this,c),f);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],i=m.image.width,d?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[i,i])}this.anchor_=[u/2,u/2],this.size_=[u,u],this.imageSize_=[i,i]},Ia.prototype.draw_=function(t,i,s,h){var n,e,r;i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var a=this.points_;if(a===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;for(o!==this.radius_&&(a*=2),n=0;n<=a;n++)e=2*n*Math.PI/a-Math.PI/2+this.angle_,i.lineTo(t.size/2+(r=n%2==0?this.radius_:o)*Math.cos(e),t.size/2+r*Math.sin(e))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=Ye.defaultFillStyle),i.fillStyle=Ze.asColorLike(u),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},Ia.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var i=Dn(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i,0,0)}},Ia.prototype.drawHitDetectionCanvas_=function(t,i,s,h){i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var n=this.points_;if(n===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var e,r,a,o=void 0!==this.radius2_?this.radius2_:this.radius_;for(o!==this.radius_&&(n*=2),e=0;e<=n;e++)a=2*e*Math.PI/n-Math.PI/2+this.angle_,i.lineTo(t.size/2+(r=e%2==0?this.radius_:o)*Math.cos(a),t.size/2+r*Math.sin(a))}i.fillStyle=Ye.defaultFillStyle,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},Ia.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",i=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var s="r"+t+i+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[s,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var Ta=function(t){var i=t||{};Ia.call(this,{points:1/0,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};Gs.inherits(Ta,Ia),Ta.prototype.clone=function(){var t=new Ta({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},Ta.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)};var Oa=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.checksum_=void 0};Oa.prototype.clone=function(){var t=this.getColor();return new Oa({color:t&&t.slice?t.slice():t||void 0})},Oa.prototype.getColor=function(){return this.color_},Oa.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},Oa.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_=this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?Gs.getUid(this.color_).toString():"f"+(this.color_?Je.asString(this.color_):"-")),this.checksum_};var Fa=function(t){var i=t||{};this.geometry_=null,this.geometryFunction_=Fa.defaultGeometryFunction,void 0!==i.geometry&&this.setGeometry(i.geometry),this.fill_=void 0!==i.fill?i.fill:null,this.image_=void 0!==i.image?i.image:null,this.renderer_=void 0!==i.renderer?i.renderer:null,this.stroke_=void 0!==i.stroke?i.stroke:null,this.text_=void 0!==i.text?i.text:null,this.zIndex_=i.zIndex};Fa.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new Fa({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Fa.prototype.getRenderer=function(){return this.renderer_},Fa.prototype.setRenderer=function(t){this.renderer_=t},Fa.prototype.getGeometry=function(){return this.geometry_},Fa.prototype.getGeometryFunction=function(){return this.geometryFunction_},Fa.prototype.getFill=function(){return this.fill_},Fa.prototype.setFill=function(t){this.fill_=t},Fa.prototype.getImage=function(){return this.image_},Fa.prototype.setImage=function(t){this.image_=t},Fa.prototype.getStroke=function(){return this.stroke_},Fa.prototype.setStroke=function(t){this.stroke_=t},Fa.prototype.getText=function(){return this.text_},Fa.prototype.setText=function(t){this.text_=t},Fa.prototype.getZIndex=function(){return this.zIndex_},Fa.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(i){return i.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Fa.defaultGeometryFunction,this.geometry_=t},Fa.prototype.setZIndex=function(t){this.zIndex_=t},Fa.createFunction=function(t){var i,s;return"function"==typeof t?i=t:(Array.isArray(t)?s=t:(eh(t instanceof Fa,41),s=[t]),i=function(){return s}),i},Fa.default_=null,Fa.defaultFunction=function(){if(!Fa.default_){var t=new Oa({color:"rgba(255,255,255,0.4)"}),i=new ua({color:"#3399CC",width:1.25});Fa.default_=[new Fa({image:new Ta({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Fa.default_},Fa.createDefaultEditing=function(){var t={},i=[255,255,255,1],s=[0,153,255,1];return t[ch]=[new Fa({fill:new Oa({color:[255,255,255,.5]})})],t[dh]=t[ch],t[oh]=[new Fa({stroke:new ua({color:i,width:5})}),new Fa({stroke:new ua({color:s,width:3})})],t[fh]=t[oh],t[mh]=t[ch].concat(t[oh]),t[ah]=[new Fa({image:new Ta({radius:6,fill:new Oa({color:s}),stroke:new ua({color:i,width:1.5})}),zIndex:1/0})],t[lh]=t[ah],t[vh]=t[ch].concat(t[oh],t[ah]),t},Fa.defaultGeometryFunction=function(t){return t.getGeometry()};var La=function(t){hh.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,js.listen(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t&&(t instanceof Fh||!t?this.setGeometry(t):this.setProperties(t))};Gs.inherits(La,hh),La.prototype.clone=function(){var t=new La(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var s=this.getStyle();return s&&t.setStyle(s),t},La.prototype.getGeometry=function(){return this.get(this.geometryName_)},La.prototype.getId=function(){return this.id_},La.prototype.getGeometryName=function(){return this.geometryName_},La.prototype.getStyle=function(){return this.style_},La.prototype.getStyleFunction=function(){return this.styleFunction_},La.prototype.handleGeometryChange_=function(){this.changed()},La.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(js.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=js.listen(t,Bs,this.handleGeometryChange_,this)),this.changed()},La.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},La.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?La.createStyleFunction(t):void 0,this.changed()},La.prototype.setId=function(t){this.id_=t,this.changed()},La.prototype.setGeometryName=function(t){js.unlisten(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,js.listen(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},La.createStyleFunction=function(t){var i,s;return"function"==typeof t?i=2==t.length?function(i){return t(this,i)}:t:(Array.isArray(t)?s=t:(eh(t instanceof Fa,41),s=[t]),i=function(){return s}),i};var Da={createOrUpdate:function(t,i,s,h){return void 0!==h?(h[0]=t,h[1]=i,h[2]=s,h):[t,i,s]},getKeyZXY:function(t,i,s){return t+"/"+i+"/"+s},getKey:function(t){return Da.getKeyZXY(t[0],t[1],t[2])},fromKey:function(t){return t.split("/").map(Number)},hash:function(t){return(t[1]<<t[0])+t[2]},quadKey:function(t){var i,s,h=t[0],n=new Array(h),e=1<<h-1;for(i=0;i<h;++i)s=48,t[1]&e&&(s+=1),t[2]&e&&(s+=2),n[i]=String.fromCharCode(s),e>>=1;return n.join("")},withinExtentAndZ:function(t,i){var s=t[0],h=t[1],n=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom())return!1;var e,r=i.getExtent();return!(e=r?i.getTileRangeForExtentAndZ(r,s):i.getFullTileRange(s))||e.containsXY(h,n)}},Wa={createFromTemplate:function(t,i){var s=/\{z\}/g,h=/\{x\}/g,n=/\{y\}/g,e=/\{-y\}/g;return function(r){return r?t.replace(s,r[0].toString()).replace(h,r[1].toString()).replace(n,(function(){return(-r[2]-1).toString()})).replace(e,(function(){var t=i.getFullTileRange(r[0]);return eh(t,55),(t.getHeight()+r[2]).toString()})):void 0}},createFromTemplates:function(t,i){for(var s=t.length,h=new Array(s),n=0;n<s;++n)h[n]=Wa.createFromTemplate(t[n],i);return Wa.createFromTileUrlFunctions(h)},createFromTileUrlFunctions:function(t){return 1===t.length?t[0]:function(i,s,h){if(i){var n=Da.hash(i),e=rh.modulo(n,t.length);return t[e](i,s,h)}}},nullTileUrlFunction:function(){},expandUrl:function(t){var i=[],s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var h,n=s[1].charCodeAt(0),e=s[2].charCodeAt(0);for(h=n;h<=e;++h)i.push(t.replace(s[0],String.fromCharCode(h)));return i}if(s=s=/\{(\d+)-(\d+)\}/.exec(t)){for(var r=parseInt(s[2],10),a=parseInt(s[1],10);a<=r;a++)i.push(t.replace(s[0],a.toString()));return i}return i.push(t),i}},ja=function(t,i,s){qs.call(this);var h=s||{};this.tileCoord=t,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===h.transition?250:h.transition,this.transitionStarts_={}};Gs.inherits(ja,qs),ja.prototype.changed=function(){this.dispatchEvent(Bs)},ja.prototype.getKey=function(){return this.key+"/"+this.tileCoord},ja.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return t;t=t.interimTile}while(t);return this},ja.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,i=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?i=t:0==t.getState()?i.interimTile=t.interimTile:i=t,t=i.interimTile}while(t)}},ja.prototype.getTileCoord=function(){return this.tileCoord},ja.prototype.getState=function(){return this.state},ja.prototype.setState=function(t){this.state=t,this.changed()},ja.prototype.load=function(){},ja.prototype.getAlpha=function(t,i){if(!this.transition_)return 1;var s=this.transitionStarts_[t];if(s){if(-1===s)return 1}else this.transitionStarts_[t]=s=i;var h=i-s+1e3/60;return h>=this.transition_?1:Fn.easeIn(h/this.transition_)},ja.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},ja.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)};var Ua=function(t,i,s,h,n,e){ja.call(this,t,i,e),this.crossOrigin_=h,this.src_=s,this.image_=new Image,null!==h&&(this.image_.crossOrigin=h),this.imageListenerKeys_=null,this.tileLoadFunction_=n};Gs.inherits(Ua,ja),Ua.prototype.disposeInternal=function(){1==this.state&&(this.unlistenImage_(),this.image_=Ua.getBlankImage()),this.interimTile&&this.interimTile.dispose(),this.state=5,this.changed(),ja.prototype.disposeInternal.call(this)},Ua.prototype.getImage=function(){return this.image_},Ua.prototype.getKey=function(){return this.src_},Ua.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.image_=Ua.getBlankImage(),this.changed()},Ua.prototype.handleImageLoad_=function(){this.state=this.image_.naturalWidth&&this.image_.naturalHeight?2:4,this.unlistenImage_(),this.changed()},Ua.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.imageListenerKeys_=[js.listenOnce(this.image_,Js,this.handleImageError_,this),js.listenOnce(this.image_,$s,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},Ua.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(js.unlistenByKey),this.imageListenerKeys_=null},Ua.getBlankImage=function(){var t=Dn(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas};var Va=function(t){Be.call(this,t)};Gs.inherits(Va,Be),Va.prototype.expireCache=function(t){for(var i,s;this.canExpireCache()&&(!((s=(i=this.peekLast()).tileCoord[0].toString())in t)||!t[s].contains(i.tileCoord));)this.pop().dispose()},Va.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),i=Da.fromKey(t)[0];this.forEach((function(t){t.tileCoord[0]!==i&&(this.remove(Da.getKey(t.tileCoord)),t.dispose())}),this)}};var qa={calculateSourceResolution:function(t,i,s,h){var n=Th.transform(s,i,t),e=Th.getPointResolution(i,h,s),r=i.getMetersPerUnit();void 0!==r&&(e*=r);var a=t.getMetersPerUnit();void 0!==a&&(e/=a);var o=t.getExtent();if(!o||zh.containsCoordinate(o,n)){var u=Th.getPointResolution(t,e,n)/e;isFinite(u)&&u>0&&(e/=u)}return e},enlargeClipPoint_:function(t,i,s,h){var n=s-t,e=h-i,r=Math.sqrt(n*n+e*e);return[Math.round(s+n/r),Math.round(h+e/r)]},render:function(t,i,s,h,n,e,r,a,o,u,c){var l=Dn(Math.round(s*t),Math.round(s*i));if(0===o.length)return l.canvas;l.scale(s,s);var f=zh.createEmpty();o.forEach((function(t){zh.extend(f,t.extent)}));var d=zh.getWidth(f),v=zh.getHeight(f),m=Dn(Math.round(s*d/h),Math.round(s*v/h)),p=s/h;o.forEach((function(t){var i=t.extent[0]-f[0],s=-(t.extent[3]-f[3]),h=zh.getWidth(t.extent),n=zh.getHeight(t.extent);m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*p,s*p,h*p,n*p)}));var _=zh.getTopLeft(r);return a.getTriangles().forEach((function(t){var i=t.source,n=t.target,r=i[0][0],a=i[0][1],o=i[1][0],u=i[1][1],c=i[2][0],d=i[2][1],v=(n[0][0]-_[0])/e,p=-(n[0][1]-_[1])/e,g=(n[1][0]-_[0])/e,z=-(n[1][1]-_[1])/e,M=(n[2][0]-_[0])/e,w=-(n[2][1]-_[1])/e,b=r,x=a;r=0,a=0;var y=rh.solveLinearSystem([[o-=b,u-=x,0,0,g-v],[c-=b,d-=x,0,0,M-v],[0,0,o,u,z-p],[0,0,c,d,w-p]]);if(y){l.save(),l.beginPath();var E=(v+g+M)/3,S=(p+z+w)/3,P=qa.enlargeClipPoint_(E,S,v,p),G=qa.enlargeClipPoint_(E,S,g,z),k=qa.enlargeClipPoint_(E,S,M,w);l.moveTo(G[0],G[1]),l.lineTo(P[0],P[1]),l.lineTo(k[0],k[1]),l.clip(),l.transform(y[0],y[2],y[1],y[3],v,p),l.translate(f[0]-b,f[3]-x),l.scale(h/s,-h/s),l.drawImage(m.canvas,0,0),l.restore()}})),c&&(l.save(),l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t){var i=t.target,s=(i[0][0]-_[0])/e,h=-(i[0][1]-_[1])/e,n=(i[1][0]-_[0])/e,r=-(i[1][1]-_[1])/e,a=(i[2][0]-_[0])/e,o=-(i[2][1]-_[1])/e;l.beginPath(),l.moveTo(n,r),l.lineTo(s,h),l.lineTo(a,o),l.closePath(),l.stroke()})),l.restore()),l.canvas}},Ba=function(t,i,s,h,n){this.sourceProj_=t,this.targetProj_=i;var e={},r=Th.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return e[i]||(e[i]=r(t)),e[i]},this.maxSourceExtent_=h,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!h&&!!this.sourceProj_.getExtent()&&zh.getWidth(h)==zh.getWidth(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?zh.getWidth(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?zh.getWidth(this.targetProj_.getExtent()):null;var a=zh.getTopLeft(s),o=zh.getTopRight(s),u=zh.getBottomRight(s),c=zh.getBottomLeft(s),l=this.transformInv_(a),f=this.transformInv_(o),d=this.transformInv_(u),v=this.transformInv_(c);if(this.addQuad_(a,o,u,c,l,f,d,v,Gs.RASTER_REPROJECTION_MAX_SUBDIVISION),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-m>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-m>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-m>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var s=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-s<this.sourceWorldWidth_/2&&(t.source=i)}}),this)}e={}};Ba.prototype.addTriangle_=function(t,i,s,h,n,e){this.triangles_.push({source:[h,n,e],target:[t,i,s]})},Ba.prototype.addQuad_=function(t,i,s,h,n,e,r,a,o){var u=zh.boundingExtent([n,e,r,a]),c=this.sourceWorldWidth_?zh.getWidth(u)/this.sourceWorldWidth_:null,l=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,d=!1;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=zh.boundingExtent([t,i,s,h]);d|=zh.getWidth(v)/this.targetWorldWidth_>Gs.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}!f&&this.sourceProj_.isGlobal()&&c&&(d|=c>Gs.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH)}if(d||!this.maxSourceExtent_||zh.intersects(u,this.maxSourceExtent_)){if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(o>0))return;d=!0}if(o>0){if(!d){var m,p=this.transformInv_([(t[0]+s[0])/2,(t[1]+s[1])/2]);m=f?(rh.modulo(n[0],l)+rh.modulo(r[0],l))/2-rh.modulo(p[0],l):(n[0]+r[0])/2-p[0];var _=(n[1]+r[1])/2-p[1];d=m*m+_*_>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var g=[(i[0]+s[0])/2,(i[1]+s[1])/2],z=this.transformInv_(g),M=[(h[0]+t[0])/2,(h[1]+t[1])/2],w=this.transformInv_(M);this.addQuad_(t,i,g,M,n,e,z,w,o-1),this.addQuad_(M,g,s,h,w,z,r,a,o-1)}else{var b=[(t[0]+i[0])/2,(t[1]+i[1])/2],x=this.transformInv_(b),y=[(s[0]+h[0])/2,(s[1]+h[1])/2],E=this.transformInv_(y);this.addQuad_(t,b,y,h,n,x,E,a,o-1),this.addQuad_(b,i,s,y,x,e,r,E,o-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,s,h,n,r,a),this.addTriangle_(t,i,s,n,e,r)}},Ba.prototype.calculateSourceExtent=function(){var t=zh.createEmpty();return this.triangles_.forEach((function(i){var s=i.source;zh.extendCoordinate(t,s[0]),zh.extendCoordinate(t,s[1]),zh.extendCoordinate(t,s[2])})),t},Ba.prototype.getTriangles=function(){return this.triangles_};var Xa=function(t,i,s,h,n,e,r,a,o,u,c){ja.call(this,n,0),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=r,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=h,this.wrappedTileCoord_=e||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var l=h.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent(),d=this.sourceTileGrid_.getExtent(),v=f?zh.getIntersection(l,f):l;if(0!==zh.getArea(v)){var m=t.getExtent();m&&(d=d?zh.getIntersection(d,m):m);var p=h.getResolution(this.wrappedTileCoord_[0]),_=zh.getCenter(v),g=qa.calculateSourceResolution(t,s,_,p);if(!isFinite(g)||g<=0)this.state=4;else if(this.triangulation_=new Ba(t,s,v,d,g*(void 0!==u?u:Gs.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD)),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(g);var z=this.triangulation_.calculateSourceExtent();if(d&&(t.canWrapX()?(z[1]=rh.clamp(z[1],d[1],d[3]),z[3]=rh.clamp(z[3],d[1],d[3])):z=zh.getIntersection(z,d)),zh.getArea(z)){for(var M=i.getTileRangeForExtentAndZ(z,this.sourceZ_),w=M.minX;w<=M.maxX;w++)for(var b=M.minY;b<=M.maxY;b++){var x=o(this.sourceZ_,w,b,r);x&&this.sourceTiles_.push(x)}0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}else this.state=4}else this.state=4};Gs.inherits(Xa,ja),Xa.prototype.disposeInternal=function(){1==this.state&&this.unlistenSources_(),ja.prototype.disposeInternal.call(this)},Xa.prototype.getImage=function(){return this.canvas_},Xa.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach((function(i){i&&2==i.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}),this),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var i=this.wrappedTileCoord_[0],s=this.targetTileGrid_.getTileSize(i),h="number"==typeof s?s:s[0],n="number"==typeof s?s:s[1],e=this.targetTileGrid_.getResolution(i),r=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=qa.render(h,n,this.pixelRatio_,r,this.sourceTileGrid_.getExtent(),e,a,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=2}this.changed()},Xa.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((function(i){var s,h=i.getState();0!=h&&1!=h||(t++,s=js.listen(i,Bs,(function(){var h=i.getState();2!=h&&3!=h&&4!=h||(js.unlistenByKey(s),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this),this.sourcesListenerKeys_.push(s))}),this),this.sourceTiles_.forEach((function(t){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},Xa.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(js.unlistenByKey),this.sourcesListenerKeys_=null};var Ha=function(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,eh(_h.isSorted(this.resolutions_,(function(t,i){return i-t}),!0),17),!t.origins)for(var s=0,h=this.resolutions_.length-1;s<h;++s)if(i){if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=void 0;break}}else i=this.resolutions_[s]/this.resolutions_[s+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,eh(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=zh.getTopLeft(n)),eh(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,eh(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Gs.DEFAULT_TILE_SIZE,eh(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t){return new ar(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):n&&this.calculateTileRanges_(n)};Ha.tmpTileCoord_=[0,0,0],Ha.prototype.forEachTileCoord=function(t,i,s){for(var h=this.getTileRangeForExtentAndZ(t,i),n=h.minX,e=h.maxX;n<=e;++n)for(var r=h.minY,a=h.maxY;r<=a;++r)s([i,n,r])},Ha.prototype.forEachTileCoordParentTileRange=function(t,i,s,h,n){var e,r,a,o=null,u=t[0]-1;for(2===this.zoomFactor_?(r=t[1],a=t[2]):o=this.getTileCoordExtent(t,n);u>=this.minZoom;){if(2===this.zoomFactor_?(r=Math.floor(r/2),a=Math.floor(a/2),e=ar.createOrUpdate(r,r,a,a,h)):e=this.getTileRangeForExtentAndZ(o,u,h),i.call(s,u,e))return!0;--u}return!1},Ha.prototype.getExtent=function(){return this.extent_},Ha.prototype.getMaxZoom=function(){return this.maxZoom},Ha.prototype.getMinZoom=function(){return this.minZoom},Ha.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Ha.prototype.getResolution=function(t){return this.resolutions_[t]},Ha.prototype.getResolutions=function(){return this.resolutions_},Ha.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var h=2*t[1],n=2*t[2];return ar.createOrUpdate(h,h+1,n,n+1,i)}var e=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(e,t[0]+1,i)}return null},Ha.prototype.getTileRangeExtent=function(t,i,s){var h=this.getOrigin(t),n=this.getResolution(t),e=oe(this.getTileSize(t),this.tmpSize_);return zh.createOrUpdate(h[0]+i.minX*e[0]*n,h[1]+i.minY*e[1]*n,h[0]+(i.maxX+1)*e[0]*n,h[1]+(i.maxY+1)*e[1]*n,s)},Ha.prototype.getTileRangeForExtentAndZ=function(t,i,s){var h=Ha.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,h);var n=h[1],e=h[2];return this.getTileCoordForXYAndZ_(t[2],t[3],i,!0,h),ar.createOrUpdate(n,h[1],e,h[2],s)},Ha.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),s=this.getResolution(t[0]),h=oe(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*h[0]*s,i[1]+(t[2]+.5)*h[1]*s]},Ha.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]),h=this.getResolution(t[0]),n=oe(this.getTileSize(t[0]),this.tmpSize_),e=s[0]+t[1]*n[0]*h,r=s[1]+t[2]*n[1]*h;return zh.createOrUpdate(e,r,e+n[0]*h,r+n[1]*h,i)},Ha.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,s)},Ha.prototype.getTileCoordForXYAndResolution_=function(t,i,s,h,n){var e=this.getZForResolution(s),r=s/this.getResolution(e),a=this.getOrigin(e),o=oe(this.getTileSize(e),this.tmpSize_),u=h?0:.5,c=Math.floor((t-a[0])/s+(h?.5:0)),l=Math.floor((i-a[1])/s+u),f=r*c/o[0],d=r*l/o[1];return h?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),Da.createOrUpdate(e,f,d,n)},Ha.prototype.getTileCoordForXYAndZ_=function(t,i,s,h,n){var e=this.getOrigin(s),r=this.getResolution(s),a=oe(this.getTileSize(s),this.tmpSize_),o=h?0:.5,u=Math.floor((t-e[0])/r+(h?.5:0)),c=Math.floor((i-e[1])/r+o),l=u/a[0],f=c/a[1];return h?(l=Math.ceil(l)-1,f=Math.ceil(f)-1):(l=Math.floor(l),f=Math.floor(f)),Da.createOrUpdate(s,l,f,n)},Ha.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,s)},Ha.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Ha.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Ha.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Ha.prototype.getZForResolution=function(t,i){var s=_h.linearFindNearest(this.resolutions_,t,i||0);return rh.clamp(s,this.minZoom,this.maxZoom)},Ha.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,s=new Array(i),h=this.minZoom;h<i;++h)s[h]=this.getTileRangeForExtentAndZ(t,h);this.fullTileRanges_=s};var Ya={getForProjection:function(t){var i=t.getDefaultTileGrid();return i||(i=Ya.createForProjection(t),t.setDefaultTileGrid(i)),i},wrapX:function(t,i,s){var h=i[0],n=t.getTileCoordCenter(i),e=Ya.extentFromProjection(s);if(zh.containsCoordinate(e,n))return i;var r=zh.getWidth(e),a=Math.ceil((e[0]-n[0])/r);return n[0]+=r*a,t.getTileCoordForCoordAndZ(n,h)},createForExtent:function(t,i,s,h){var n=void 0!==h?h:gh,e=Ya.resolutionsFromExtent(t,i,s);return new Ha({extent:t,origin:zh.getCorner(t,n),resolutions:e,tileSize:s})},createXYZ:function(t){var i={};return Ws.assign(i,void 0!==t?t:{}),void 0===i.extent&&(i.extent=Th.get("EPSG:3857").getExtent()),i.resolutions=Ya.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize),delete i.maxZoom,new Ha(i)},resolutionsFromExtent:function(t,i,s){for(var h=void 0!==i?i:Gs.DEFAULT_MAX_ZOOM,n=zh.getHeight(t),e=zh.getWidth(t),r=oe(void 0!==s?s:Gs.DEFAULT_TILE_SIZE),a=Math.max(e/r[0],n/r[1]),o=h+1,u=new Array(o),c=0;c<o;++c)u[c]=a/Math.pow(2,c);return u},createForProjection:function(t,i,s,h){var n=Ya.extentFromProjection(t);return Ya.createForExtent(n,i,s,h)},extentFromProjection:function(t){var i=(t=Th.get(t)).getExtent();if(!i){var s=180*Th.METERS_PER_UNIT[Gh.DEGREES]/t.getMetersPerUnit();i=zh.createOrUpdate(-s,-s,s,s)}return i}},Ja=function(t){this.html_=t.html,this.tileRanges_=t.tileRanges?t.tileRanges:null};Ja.prototype.getHTML=function(){return this.html_},Ja.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_)return!0;var h,n,e,r;for(r in t){var a;if(r in this.tileRanges_)for(e=t[r],h=0,n=this.tileRanges_[r].length;h<n;++h){if((a=this.tileRanges_[r][h]).intersects(e))return!0;var o=i.getTileRangeForExtentAndZ(Ya.extentFromProjection(s),parseInt(r,10)),u=o.getWidth();if(e.minX<o.minX||e.maxX>o.maxX){if(a.intersects(new ar(rh.modulo(e.minX,u),rh.modulo(e.maxX,u),e.minY,e.maxY)))return!0;if(e.getWidth()>u&&a.intersects(o))return!0}}}return!1};var Za=function(t){hh.call(this),this.projection_=Th.get(t.projection),this.attributions_=null,this.attributions2_=this.adaptAttributions_(t.attributions),this.logo_=t.logo,this.state_=void 0!==t.state?t.state:Qn,this.wrapX_=void 0!==t.wrapX&&t.wrapX};Gs.inherits(Za,hh),Za.prototype.adaptAttributions_=function(t){if(!t)return null;if(t instanceof Ja)return this.attributions_=[t],function(){return[t.getHTML()]};if(Array.isArray(t)){if(t[0]instanceof Ja){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(){return i}}return this.attributions_=t.map((function(t){return new Ja({html:t})})),function(){return t}}return"function"==typeof t?t:(this.attributions_=[new Ja({html:t})],function(){return[t]})},Za.prototype.forEachFeatureAtCoordinate=Gs.nullFunction,Za.prototype.getAttributions=function(){return this.attributions_},Za.prototype.getAttributions2=function(){return this.attributions2_},Za.prototype.getLogo=function(){return this.logo_},Za.prototype.getProjection=function(){return this.projection_},Za.prototype.getResolutions=function(){},Za.prototype.getState=function(){return this.state_},Za.prototype.getWrapX=function(){return this.wrapX_},Za.prototype.refresh=function(){this.changed()},Za.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t),this.changed()},Za.prototype.setLogo=function(t){this.logo_=t},Za.prototype.setState=function(t){this.state_=t,this.changed()};var Ka=function(t){Za.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new Va(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}};Gs.inherits(Ka,Za),Ka.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},Ka.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);s&&s.expireCache(i)},Ka.prototype.forEachLoadedTile=function(t,i,s,h){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var e,r,a,o=!0,u=s.minX;u<=s.maxX;++u)for(var c=s.minY;c<=s.maxY;++c)r=Da.getKeyZXY(i,u,c),a=!1,n.containsKey(r)&&(a=2===(e=n.get(r)).getState())&&(a=!1!==h(e)),a||(o=!1);return o},Ka.prototype.getGutter=function(){return 0},Ka.prototype.getKey=function(){return this.key_},Ka.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},Ka.prototype.getOpaque=function(){return this.opaque_},Ka.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},Ka.prototype.getTile=function(){},Ka.prototype.getTileGrid=function(){return this.tileGrid},Ka.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ya.getForProjection(t)},Ka.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();return i&&!Th.equivalent(i,t)?null:this.tileCache},Ka.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},Ka.prototype.getTilePixelSize=function(t,i,s){var h=this.getTileGridForProjection(s),n=this.getTilePixelRatio(i),e=oe(h.getTileSize(t),this.tmpSize);return 1==n?e:ae(e,n,this.tmpSize)},Ka.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=void 0!==i?i:this.getProjection(),h=this.getTileGridForProjection(s);return this.getWrapX()&&s.isGlobal()&&(t=Ya.wrapX(h,t,s)),Da.withinExtentAndZ(t,h)?t:null},Ka.prototype.refresh=function(){this.tileCache.clear(),this.changed()},Ka.prototype.useTile=Gs.nullFunction,Gs.inherits(Ka.Event=function(t,i){Vs.call(this,t),this.tile=i},Vs);var $a=function(t){Ka.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Wa.nullTileUrlFunction,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}};Gs.inherits($a,Ka),$a.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},$a.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},$a.prototype.getUrls=function(){return this.urls},$a.prototype.handleTileChange=function(t){var i,s=t.target,h=Gs.getUid(s),n=s.getState();1==n?(this.tileLoadingKeys_[h]=!0,i="tileloadstart"):h in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[h],i=3==n?"tileloaderror":2==n||5==n?"tileloadend":void 0),null!=i&&this.dispatchEvent(new Ka.Event(i,s))},$a.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},$a.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==i?this.setKey(i):this.changed()},$a.prototype.setUrl=function(t){var i=this.urls=Wa.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Wa.createFromTemplates(i,this.tileGrid),t)},$a.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Wa.createFromTemplates(t,this.tileGrid),i)},$a.prototype.useTile=function(t,i,s){var h=Da.getKeyZXY(t,i,s);this.tileCache.containsKey(h)&&this.tileCache.get(h)};var Qa=function(t){$a.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Qa.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Ua,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1};Gs.inherits(Qa,$a),Qa.prototype.canExpireCache=function(){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},Qa.prototype.expireCache=function(t,i){if(Gs.ENABLE_RASTER_REPROJECTION){var s=this.getTileCacheForProjection(t);for(var h in this.tileCache.expireCache(this.tileCache==s?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[h];n.expireCache(n==s?i:{})}}else $a.prototype.expireCache.call(this,t,i)},Qa.prototype.getGutter=function(t){return Gs.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Th.equivalent(this.getProjection(),t)?0:this.getGutterInternal()},Qa.prototype.getGutterInternal=function(){return 0},Qa.prototype.getOpaque=function(t){return!(Gs.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Th.equivalent(this.getProjection(),t))&&$a.prototype.getOpaque.call(this,t)},Qa.prototype.getTileGridForProjection=function(t){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!Th.equivalent(i,t)){var s=Gs.getUid(t).toString();return s in this.tileGridForProjection||(this.tileGridForProjection[s]=Ya.getForProjection(t)),this.tileGridForProjection[s]}return this.tileGrid},Qa.prototype.getTileCacheForProjection=function(t){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||Th.equivalent(i,t))return this.tileCache;var s=Gs.getUid(t).toString();return s in this.tileCacheForProjection||(this.tileCacheForProjection[s]=new Va(this.tileCache.highWaterMark)),this.tileCacheForProjection[s]},Qa.prototype.createTile_=function(t,i,s,h,n,e){var r=[t,i,s],a=this.getTileCoordForTileUrlFunction(r,n),o=a?this.tileUrlFunction(a,h,n):void 0,u=new this.tileClass(r,void 0!==o?0:4,void 0!==o?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=e,js.listen(u,Bs,this.handleTileChange,this),u},Qa.prototype.getTile=function(t,i,s,h,n){var e=this.getProjection();if(Gs.ENABLE_RASTER_REPROJECTION&&e&&n&&!Th.equivalent(e,n)){var r,a=this.getTileCacheForProjection(n),o=[t,i,s],u=Da.getKey(o);a.containsKey(u)&&(r=a.get(u));var c=this.getKey();if(r&&r.key==c)return r;var l=this.getTileGridForProjection(e),f=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(o,n),v=new Xa(e,l,n,f,o,d,this.getTilePixelRatio(h),this.getGutterInternal(),function(t,i,s,h){return this.getTileInternal(t,i,s,h,e)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return v.key=c,r?(v.interimTile=r,v.refreshInterimChain(),a.replace(u,v)):a.set(u,v),v}return this.getTileInternal(t,i,s,h,e||n)},Qa.prototype.getTileInternal=function(t,i,s,h,n){var e=null,r=Da.getKeyZXY(t,i,s),a=this.getKey();if(this.tileCache.containsKey(r)){if((e=this.tileCache.get(r)).key!=a){var o=e;(e=this.createTile_(t,i,s,h,n,a)).interimTile=0==o.getState()?o.interimTile:o,e.refreshInterimChain(),this.tileCache.replace(r,e)}}else e=this.createTile_(t,i,s,h,n,a),this.tileCache.set(r,e);return e},Qa.prototype.setRenderReprojectionEdges=function(t){if(Gs.ENABLE_RASTER_REPROJECTION&&this.renderReprojectionEdges_!=t){for(var i in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[i].clear();this.changed()}},Qa.prototype.setTileGridForProjection=function(t,i){if(Gs.ENABLE_RASTER_REPROJECTION){var s=Th.get(t);if(s){var h=Gs.getUid(s).toString();h in this.tileGridForProjection||(this.tileGridForProjection[h]=i)}}},Qa.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var to="KVP",io=function(t){this.matrixIds_=t.matrixIds,Ha.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};Gs.inherits(io,Ha),io.prototype.getMatrixId=function(t){return this.matrixIds_[t]},io.prototype.getMatrixIds=function(){return this.matrixIds_},io.createFromCapabilitiesMatrixSet=function(t,i,s){var h=[],n=[],e=[],r=[],a=[],o=void 0!==s?s:[],u="TileMatrix",c="Identifier",l="ScaleDenominator",f="TopLeftCorner",d=t.SupportedCRS,v=Th.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(d),m=v.getMetersPerUnit(),p="ne"==v.getAxisOrientation().substr(0,2);return t[u].sort((function(t,i){return i[l]-t[l]})),t[u].forEach((function(t){if(!(o.length>0)||_h.find(o,(function(i){return t[c]==i[u]}))){n.push(t[c]);var i=28e-5*t[l]/m,s=t.TileWidth,d=t.TileHeight;e.push(p?[t[f][1],t[f][0]]:t[f]),h.push(i),r.push(s==d?s:[s,d]),a.push([t.MatrixWidth,-t.MatrixHeight])}})),new io({extent:i,origins:e,resolutions:h,matrixIds:n,tileSizes:r,sizes:a})};var so=function(t,i){var s=[];Object.keys(i).forEach((function(t){null!=i[t]&&s.push(t+"="+encodeURIComponent(i[t]))}));var h=s.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+h},ho=function(t){this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style;var i=t.urls;void 0===i&&void 0!==t.url&&(i=Wa.expandUrl(t.url)),this.requestEncoding_=void 0!==t.requestEncoding?t.requestEncoding:to;var s=this.requestEncoding_,h=t.tileGrid,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==to&&Ws.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});var e=this.dimensions_;this.createFromWMTSTemplate_=function(t){return t=s==to?so(t,n):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in n?n[i.toLowerCase()]:t})),function(i){if(i){var n={TileMatrix:h.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};Ws.assign(n,e);var r=t;return s==to?so(r,n):r.replace(/\{(\w+?)\}/g,(function(t,i){return n[i]}))}}};var r=i&&i.length>0?Wa.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):Wa.nullTileUrlFunction;Qa.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:h,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:r,urls:i,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}),this.setKey(this.getKeyForDimensions_())};Gs.inherits(ho,Qa),ho.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):Wa.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)},ho.prototype.getDimensions=function(){return this.dimensions_},ho.prototype.getFormat=function(){return this.format_},ho.prototype.getLayer=function(){return this.layer_},ho.prototype.getMatrixSet=function(){return this.matrixSet_},ho.prototype.getRequestEncoding=function(){return this.requestEncoding_},ho.prototype.getStyle=function(){return this.style_},ho.prototype.getVersion=function(){return this.version_},ho.prototype.getKeyForDimensions_=function(){var t=0,i=[];for(var s in this.dimensions_)i[t++]=s+"-"+this.dimensions_[s];return i.join("/")},ho.prototype.updateDimensions=function(t){Ws.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},ho.optionsFromCapabilities=function(t,i){var s=_h.find(t.Contents.Layer,(function(t){return t.Identifier==i.layer}));if(null===s)return null;var h,n,e,r=t.Contents.TileMatrixSet;(h=s.TileMatrixSetLink.length>1?_h.findIndex(s.TileMatrixSetLink,"projection"in i?function(t){var s=_h.find(r,(function(i){return i.Identifier==t.TileMatrixSet})).SupportedCRS,h=Th.get(s.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(s),n=Th.get(i.projection);return h&&n?Th.equivalent(h,n):s==i.projection}:function(t){return t.TileMatrixSet==i.matrixSet}):0)<0&&(h=0),n=s.TileMatrixSetLink[h].TileMatrixSet,e=s.TileMatrixSetLink[h].TileMatrixSetLimits;var a=s.Format[0];"format"in i&&(a=i.format),(h=_h.findIndex(s.Style,(function(t){return"style"in i?t.Title==i.style:t.isDefault})))<0&&(h=0);var o=s.Style[h].Identifier,u={};"Dimension"in s&&s.Dimension.forEach((function(t){var i=t.Default;void 0===i&&(i=t.Value[0]),u[t.Identifier]=i}));var c,l=_h.find(t.Contents.TileMatrixSet,(function(t){return t.Identifier==n})),f=l.SupportedCRS;if(f&&(c=Th.get(f.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(f)),"projection"in i){var d=Th.get(i.projection);d&&(c&&!Th.equivalent(d,c)||(c=d))}var v,m,p=s.WGS84BoundingBox;if(void 0!==p){var _=Th.get("EPSG:4326").getExtent();m=p[0]==_[0]&&p[2]==_[2],v=Th.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();g&&(zh.containsExtent(g,v)||(v=void 0))}var z=io.createFromCapabilitiesMatrixSet(l,v,e),M=[],w=i.requestEncoding;if(w=void 0!==w?w:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var b=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,y=b.length;x<y;++x)if(b[x].Constraint){var E=_h.find(b[x].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===w&&(w=E[0]),w!==to)break;_h.includes(E,to)&&M.push(b[x].href)}else b[x].href&&(w=to,M.push(b[x].href));return 0===M.length&&(w="REST",s.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(a=t.format,M.push(t.template))}))),{urls:M,layer:i.layer,matrixSet:n,format:a,projection:c,requestEncoding:w,tileGrid:z,style:o,dimensions:u,wrapX:m,crossOrigin:i.crossOrigin}};var no="arraybuffer",eo={};eo.DOCUMENT=document.implementation.createDocument("","",null),eo.createElementNS=function(t,i){return eo.DOCUMENT.createElementNS(t,i)},eo.getAllTextContent=function(t,i){return eo.getAllTextContent_(t,i,[]).join("")},eo.getAllTextContent_=function(t,i,s){var h;if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)s.push(i?String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""):t.nodeValue);else for(h=t.firstChild;h;h=h.nextSibling)eo.getAllTextContent_(h,i,s);return s},eo.isDocument=function(t){return t instanceof Document},eo.isNode=function(t){return t instanceof Node},eo.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""},eo.setAttributeNS=function(t,i,s,h){t.setAttributeNS(i,s,h)},eo.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")},eo.makeArrayExtender=function(t,i){return function(s,h){var n=t.call(i,s,h);void 0!==n&&_h.extend(h[h.length-1],n)}},eo.makeArrayPusher=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&h[h.length-1].push(n)}},eo.makeReplacer=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&(h[h.length-1]=n)}},eo.makeObjectPropertyPusher=function(t,i,s){return function(h,n){var e=t.call(void 0!==s?s:this,h,n);if(void 0!==e){var r=n[n.length-1],a=void 0!==i?i:h.localName;(a in r?r[a]:r[a]=[]).push(e)}}},eo.makeObjectPropertySetter=function(t,i,s){return function(h,n){var e=t.call(void 0!==s?s:this,h,n);void 0!==e&&(n[n.length-1][void 0!==i?i:h.localName]=e)}},eo.makeChildAppender=function(t,i){return function(s,h,n){t.call(void 0!==i?i:this,s,h,n),n[n.length-1].node.appendChild(s)}},eo.makeArraySerializer=function(t){var i,s;return function(h,n,e){if(void 0===i){i={};var r={};r[h.localName]=t,i[h.namespaceURI]=r,s=eo.makeSimpleNodeFactory(h.localName)}eo.serialize(i,s,n,e)}},eo.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,h,n){var e=s;void 0===e&&(e=n);var r=i;return void 0===i&&(r=h[h.length-1].node.namespaceURI),eo.createElementNS(r,e)}},eo.OBJECT_PROPERTY_NODE_FACTORY=eo.makeSimpleNodeFactory(),eo.makeSequence=function(t,i){for(var s=i.length,h=new Array(s),n=0;n<s;++n)h[n]=t[i[n]];return h},eo.makeStructureNS=function(t,i,s){var h,n,e=void 0!==s?s:{};for(h=0,n=t.length;h<n;++h)e[t[h]]=i;return e},eo.parseNode=function(t,i,s,h){var n;for(n=i.firstElementChild;n;n=n.nextElementSibling){var e=t[n.namespaceURI];if(void 0!==e){var r=e[n.localName];void 0!==r&&r.call(h,n,s)}}},eo.pushParseAndPop=function(t,i,s,h,n){return h.push(t),eo.parseNode(i,s,h,n),h.pop()},eo.serialize=function(t,i,s,h,n,e){for(var r,a,o=(void 0!==n?n:s).length,u=0;u<o;++u)void 0!==(r=s[u])&&void 0!==(a=i.call(e,r,h,void 0!==n?n[u]:void 0))&&t[a.namespaceURI][a.localName].call(e,a,r,h)},eo.pushSerializeAndPop=function(t,i,s,h,n,e,r){return n.push(t),eo.serialize(i,s,h,n,e,r),n.pop()};var ro={loadFeaturesXhr:function(t,i,s,h){return function(n,e,r){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,e,r):t,!0),i.getType()==no&&(a.responseType="arraybuffer"),a.onload=function(){if(!a.status||a.status>=200&&a.status<300){var t,n=i.getType();"json"==n||"text"==n?t=a.responseText:"xml"==n?(t=a.responseXML)||(t=eo.parse(a.responseText)):n==no&&(t=a.response),t?s.call(this,i.readFeatures(t,{featureProjection:r}),i.readProjection(t),i.getLastExtent()):h.call(this)}else h.call(this)}.bind(this),a.onerror=function(){h.call(this)}.bind(this),a.send()}},xhr:function(t,i){return ro.loadFeaturesXhr(t,i,(function(t){this.addFeatures(t)}),Gs.nullFunction)}},ao={all:function(){return[[-1/0,-1/0,1/0,1/0]]},bbox:function(t){return[t]},tile:function(t){return function(i,s){var h=t.getZForResolution(s),n=t.getTileRangeForExtentAndZ(i,h),e=[],r=[h,0,0];for(r[1]=n.minX;r[1]<=n.maxX;++r[1])for(r[2]=n.minY;r[2]<=n.maxY;++r[2])e.push(t.getTileCoordExtent(r));return e}}},oo="addfeature",uo="removefeature",co=function(t){var i=t||{};Za.call(this,{attributions:i.attributions,logo:i.logo,projection:void 0,state:Qn,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=Gs.nullFunction,this.format_=i.format,this.overlaps_=null==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(eh(this.format_,7),this.loader_=ro.xhr(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:ao.all;var s,h,n=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=n?new la:null,this.loadedExtentsRtree_=new la,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,i.features instanceof rn?h=(s=i.features).getArray():Array.isArray(i.features)&&(h=i.features),n||void 0!==s||(s=new rn(h)),void 0!==h&&this.addFeaturesInternal(h),void 0!==s&&this.bindFeaturesCollection_(s)};Gs.inherits(co,Za),co.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},co.prototype.addFeatureInternal=function(t){var i=Gs.getUid(t).toString();if(this.addToIndex_(i,t)){this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var h=s.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(h,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new co.Event(oo,t))}},co.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[js.listen(i,Bs,this.handleFeatureChange_,this),js.listen(i,Ds,this.handleFeatureChange_,this)]},co.prototype.addToIndex_=function(t,i){var s=!0,h=i.getId();return void 0!==h?h.toString()in this.idIndex_?s=!1:this.idIndex_[h.toString()]=i:(eh(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=i),s},co.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},co.prototype.addFeaturesInternal=function(t){var i,s,h,n,e=[],r=[],a=[];for(s=0,h=t.length;s<h;s++)i=Gs.getUid(n=t[s]).toString(),this.addToIndex_(i,n)&&r.push(n);for(s=0,h=r.length;s<h;s++){i=Gs.getUid(n=r[s]).toString(),this.setupChangeEvents_(i,n);var o=n.getGeometry();if(o){var u=o.getExtent();e.push(u),a.push(n)}else this.nullGeometryFeatures_[i]=n}for(this.featuresRtree_&&this.featuresRtree_.load(e,a),s=0,h=r.length;s<h;s++)this.dispatchEvent(new co.Event(oo,r[s]))},co.prototype.bindFeaturesCollection_=function(t){var i=!1;js.listen(this,oo,(function(s){i||(i=!0,t.push(s.feature),i=!1)})),js.listen(this,uo,(function(s){i||(i=!0,t.remove(s.feature),i=!1)})),js.listen(t,nn,(function(t){i||(i=!0,this.addFeature(t.element),i=!1)}),this),js.listen(t,en,(function(t){i||(i=!0,this.removeFeature(t.element),i=!1)}),this),this.featuresCollection_=t},co.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(js.unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var s in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var h=new co.Event("clear");this.dispatchEvent(h),this.changed()},co.prototype.forEachFeature=function(t,i){return this.featuresRtree_?this.featuresRtree_.forEach(t,i):this.featuresCollection_?this.featuresCollection_.forEach(t,i):void 0},co.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){return this.forEachFeatureInExtent([t[0],t[1],t[0],t[1]],(function(h){return h.getGeometry().intersectsCoordinate(t)?i.call(s,h):void 0}))},co.prototype.forEachFeatureInExtent=function(t,i,s){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,i,s):this.featuresCollection_?this.featuresCollection_.forEach(i,s):void 0},co.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(h){if(h.getGeometry().intersectsExtent(t)){var n=i.call(s,h);if(n)return n}}))},co.prototype.getFeaturesCollection=function(){return this.featuresCollection_},co.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Ws.isEmpty(this.nullGeometryFeatures_)||_h.extend(t,Ws.getValues(this.nullGeometryFeatures_))),t},co.prototype.getFeaturesAtCoordinate=function(t){var i=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)})),i},co.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},co.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0],h=t[1],n=null,e=[NaN,NaN],r=1/0,a=[-1/0,-1/0,1/0,1/0],o=i||xh.TRUE;return this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry(),u=r;if((r=i.closestPointXY(s,h,e,r))<u){n=t;var c=Math.sqrt(r);a[0]=s-c,a[1]=h-c,a[2]=s+c,a[3]=h+c}}})),n},co.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},co.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return void 0!==i?i:null},co.prototype.getFormat=function(){return this.format_},co.prototype.getOverlaps=function(){return this.overlaps_},co.prototype.getResolutions=function(){},co.prototype.getUrl=function(){return this.url_},co.prototype.handleFeatureChange_=function(t){var i=t.target,s=Gs.getUid(i).toString(),h=i.getGeometry();if(h){var n=h.getExtent();s in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[s],this.featuresRtree_&&this.featuresRtree_.insert(n,i)):this.featuresRtree_&&this.featuresRtree_.update(n,i)}else s in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(i),this.nullGeometryFeatures_[s]=i);var e=i.getId();if(void 0!==e){var r=e.toString();s in this.undefIdIndex_?(delete this.undefIdIndex_[s],this.idIndex_[r]=i):this.idIndex_[r]!==i&&(this.removeFromIdIndex_(i),this.idIndex_[r]=i)}else s in this.undefIdIndex_||(this.removeFromIdIndex_(i),this.undefIdIndex_[s]=i);this.changed(),this.dispatchEvent(new co.Event("changefeature",i))},co.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&Ws.isEmpty(this.nullGeometryFeatures_)},co.prototype.loadFeatures=function(t,i,s){var h,n,e=this.loadedExtentsRtree_,r=this.strategy_(t,i);for(h=0,n=r.length;h<n;++h){var a=r[h];e.forEachInExtent(a,(function(t){return zh.containsExtent(t.extent,a)}))||(this.loader_.call(this,a,i,s),e.insert(a,{extent:a.slice()}))}},co.prototype.removeLoadedExtent=function(t){var i,s=this.loadedExtentsRtree_;s.forEachInExtent(t,(function(s){if(zh.equals(s.extent,t))return i=s,!0})),i&&s.remove(i)},co.prototype.removeFeature=function(t){var i=Gs.getUid(t).toString();i in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[i]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},co.prototype.removeFeatureInternal=function(t){var i=Gs.getUid(t).toString();this.featureChangeKeys_[i].forEach(js.unlistenByKey),delete this.featureChangeKeys_[i];var s=t.getId();void 0!==s?delete this.idIndex_[s.toString()]:delete this.undefIdIndex_[i],this.dispatchEvent(new co.Event(uo,t))},co.prototype.removeFromIdIndex_=function(t){var i=!1;for(var s in this.idIndex_)if(this.idIndex_[s]===t){delete this.idIndex_[s],i=!0;break}return i},co.prototype.setLoader=function(t){this.loader_=t},Gs.inherits(co.Event=function(t,i){Vs.call(this,t),this.feature=i},Vs);var lo={lineString:function(t,i,s,h,n,e){var r=NaN,a=NaN,o=(s-i)/h;if(1===o)r=t[i],a=t[i+1];else if(2==o)r=(1-n)*t[i]+n*t[i+h],a=(1-n)*t[i+1]+n*t[i+h+1];else if(0!==o){var u,c=t[i],l=t[i+1],f=0,d=[0];for(u=i+h;u<s;u+=h){var v=t[u],m=t[u+1];f+=Math.sqrt((v-c)*(v-c)+(m-l)*(m-l)),d.push(f),c=v,l=m}var p=n*f,_=_h.binarySearch(d,p);if(_<0){var g=(p-d[-_-2])/(d[-_-1]-d[-_-2]),z=i+(-_-2)*h;r=rh.lerp(t[z],t[z+h],g),a=rh.lerp(t[z+1],t[z+h+1],g)}else r=t[i+_*h],a=t[i+_*h+1]}return e?(e[0]=r,e[1]=a,e):[r,a]},lineStringCoordinateAtM:function(t,i,s,h,n,e){if(s==i)return null;var r;if(n<t[i+h-1])return e?((r=t.slice(i,i+h))[h-1]=n,r):null;if(t[s-1]<n)return e?((r=t.slice(s-h,s))[h-1]=n,r):null;if(n==t[i+h-1])return t.slice(i,i+h);for(var a=i/h,o=s/h;a<o;){var u=a+o>>1;n<t[(u+1)*h-1]?o=u:a=u+1}var c=t[a*h-1];if(n==c)return t.slice((a-1)*h,(a-1)*h+h);var l,f=(n-c)/(t[(a+1)*h-1]-c);for(r=[],l=0;l<h-1;++l)r.push(rh.lerp(t[(a-1)*h+l],t[a*h+l],f));return r.push(n),r},lineStringsCoordinateAtM:function(t,i,s,h,n,e,r){if(r)return lo.lineStringCoordinateAtM(t,i,s[s.length-1],h,n,e);var a,o,u;if(n<t[h-1])return e?((a=t.slice(0,h))[h-1]=n,a):null;if(t[t.length-1]<n)return e?((a=t.slice(t.length-h))[h-1]=n,a):null;for(o=0,u=s.length;o<u;++o){var c=s[o];if(i!=c){if(n<t[i+h-1])return null;if(n<=t[c-1])return lo.lineStringCoordinateAtM(t,i,c,h,n,!1);i=c}}return null}},fo=function(t,i){Lh.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};Gs.inherits(fo,Lh),fo.prototype.appendCoordinate=function(t){this.flatCoordinates?_h.extend(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},fo.prototype.clone=function(){var t=new fo(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},fo.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wh.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Wh.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,i,s,h))},fo.prototype.forEachSegment=function(t,i){return Yh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},fo.prototype.getCoordinateAtM=function(t,i){return this.layout!=wh&&this.layout!=bh?null:lo.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,void 0!==i&&i)},fo.prototype.getCoordinates=function(){return Uh.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},fo.prototype.getCoordinateAt=function(t,i){return lo.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},fo.prototype.getLength=function(){return xr.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},fo.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},fo.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Vh.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new fo(null);return s.setFlatCoordinates(Mh,i),s},fo.prototype.getType=function(){return oh},fo.prototype.intersectsExtent=function(t){return Jh.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},fo.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=jh.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},fo.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var vo="preload",mo="useInterimTilesOnError",po=function(t){var i=t||{},s=Ws.assign({},i);delete s.preload,delete s.useInterimTilesOnError,_e.call(this,s),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=Ue};Gs.inherits(po,_e),po.prototype.getPreload=function(){return this.get(vo)},po.prototype.setPreload=function(t){this.set(vo,t)},po.prototype.getUseInterimTilesOnError=function(){return this.get(mo)},po.prototype.setUseInterimTilesOnError=function(t){this.set(mo,t)};var _o=function(t){var i=t||{},s=Ws.assign({},i);delete s.style,delete s.renderBuffer,delete s.updateWhileAnimating,delete s.updateWhileInteracting,_e.call(this,s),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||"vector",this.type=Ve};Gs.inherits(_o,_e),_o.prototype.getDeclutter=function(){return this.declutter_},_o.prototype.setDeclutter=function(t){this.declutter_=t},_o.prototype.getRenderBuffer=function(){return this.renderBuffer_},_o.prototype.getRenderOrder=function(){return this.get(_o.Property_.RENDER_ORDER)},_o.prototype.getStyle=function(){return this.style_},_o.prototype.getStyleFunction=function(){return this.styleFunction_},_o.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},_o.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},_o.prototype.setRenderOrder=function(t){this.set(_o.Property_.RENDER_ORDER,t)},_o.prototype.setStyle=function(t){this.style_=void 0!==t?t:Fa.defaultFunction,this.styleFunction_=null===t?void 0:Fa.createFunction(this.style_),this.changed()},_o.prototype.getRenderMode=function(){return this.renderMode_},_o.Property_={RENDER_ORDER:"renderOrder"};var go="degrees",zo="metric",Mo=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV"),this.innerElement_.className=s+"-inner",this.element_=document.createElement("DIV"),this.element_.className=s+" "+de.CLASS_UNSELECTABLE,this.element_.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==i.minWidth?i.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",ce.call(this,{element:this.element_,render:i.render?i.render:Mo.render,target:i.target}),js.listen(this,hh.getChangeEventType(Mo.Property_.UNITS),this.handleUnitsChanged_,this),this.setUnits(i.units||zo)};Gs.inherits(Mo,ce),Mo.LEADING_DIGITS=[1,2,5],Mo.prototype.getUnits=function(){return this.get(Mo.Property_.UNITS)},Mo.render=function(t){var i=t.frameState;this.viewState_=i?i.viewState:null,this.updateElement_()},Mo.prototype.handleUnitsChanged_=function(){this.updateElement_()},Mo.prototype.setUnits=function(t){this.set(Mo.Property_.UNITS,t)},Mo.prototype.updateElement_=function(){var t=this.viewState_;if(t){var i=t.center,s=t.projection,h=this.getUnits(),n=Th.getPointResolution(s,t.resolution,i,h==go?Gh.DEGREES:Gh.METERS);h!=go&&(n*=s.getMetersPerUnit());var e=this.minWidth_*n,r="";if(h==go){var a=Th.METERS_PER_UNIT[Gh.DEGREES];s.getUnits()==Gh.DEGREES?e*=a:n/=a,e<a/60?(r="″",n*=3600):e<a?(r="′",n*=60):r="°"}else"imperial"==h?e<.9144?(r="in",n/=.0254):e<1609.344?(r="ft",n/=.3048):(r="mi",n/=1609.344):"nautical"==h?(n/=1852,r="nm"):h==zo?e<.001?(r="μm",n*=1e6):e<1?(r="mm",n*=1e3):e<1e3?r="m":(r="km",n/=1e3):"us"==h?e<.9144?(r="in",n*=39.37):e<1609.344?(r="ft",n/=.30480061):(r="mi",n/=1609.3472):eh(!1,33);for(var o,u,c=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){if(o=Mo.LEADING_DIGITS[(c%3+3)%3]*Math.pow(10,Math.floor(c/3)),u=Math.round(o/n),isNaN(u))return this.element_.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++c}var l=o+" "+r;this.renderedHTML_!=l&&(this.innerElement_.innerHTML=l,this.renderedHTML_=l),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},Mo.Property_={UNITS:"units"};var wo="fraction",bo=function(t,i,s,h,n,e){qs.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==h&&(this.image_.crossOrigin=h),this.canvas_=e?document.createElement("CANVAS"):null,this.color_=e,this.imageListenerKeys_=null,this.imageState_=n,this.size_=s,this.src_=i,this.tainting_=!1,2==this.imageState_&&this.determineTainting_()};Gs.inherits(bo,qs),bo.get=function(t,i,s,h,n,e){var r=nr.iconImageCache,a=r.get(i,h,e);return a||(a=new bo(t,i,s,h,n,e),r.set(i,h,e,a)),a},bo.prototype.determineTainting_=function(){var t=Dn(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainting_=!0}},bo.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Bs)},bo.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},bo.prototype.handleImageLoad_=function(){this.imageState_=2,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},bo.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},bo.prototype.getImageState=function(){return this.imageState_},bo.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.tainting_){var t=this.size_[0],i=this.size_[1],s=Dn(t,i);s.fillRect(0,0,t,i),this.hitDetectionImage_=s.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},bo.prototype.getSize=function(){return this.size_},bo.prototype.getSrc=function(){return this.src_},bo.prototype.load=function(){if(0==this.imageState_){this.imageState_=1,this.imageListenerKeys_=[js.listenOnce(this.image_,Js,this.handleImageError_,this),js.listenOnce(this.image_,$s,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},bo.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),s=i.data,h=this.color_[0]/255,n=this.color_[1]/255,e=this.color_[2]/255,r=0,a=s.length;r<a;r+=4)s[r]*=h,s[r+1]*=n,s[r+2]*=e;t.putImageData(i,0,0)}},bo.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(js.unlistenByKey),this.imageListenerKeys_=null};var xo="bottom-left",yo="bottom-right",Eo="top-left",So="top-right",Po=function(t){var i=t||{};this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Eo,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:wo,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:wo,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,n=i.src;eh(!(void 0!==n&&s),4),eh(!s||s&&h,5),void 0!==n&&0!==n.length||!s||(n=s.src||Gs.getUid(s).toString()),eh(void 0!==n&&n.length>0,6);var e=void 0!==i.src?0:2;this.color_=void 0!==i.color?Je.asArray(i.color):null,this.iconImage_=bo.get(s,n,h,this.crossOrigin_,e,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Eo,this.origin_=null,this.size_=void 0!==i.size?i.size:null,Ra.call(this,{opacity:void 0!==i.opacity?i.opacity:1,rotation:void 0!==i.rotation?i.rotation:0,scale:void 0!==i.scale?i.scale:1,snapToPixel:void 0===i.snapToPixel||i.snapToPixel,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView})};Gs.inherits(Po,Ra),Po.prototype.clone=function(){return new Po({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Po.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,i=this.getSize();if(this.anchorXUnits_==wo||this.anchorYUnits_==wo){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_==wo&&(t[0]*=i[0]),this.anchorYUnits_==wo&&(t[1]*=i[1])}if(this.anchorOrigin_!=Eo){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=So&&this.anchorOrigin_!=yo||(t[0]=-t[0]+i[0]),this.anchorOrigin_!=xo&&this.anchorOrigin_!=yo||(t[1]=-t[1]+i[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},Po.prototype.getColor=function(){return this.color_},Po.prototype.getImage=function(t){return this.iconImage_.getImage(t)},Po.prototype.getImageSize=function(){return this.iconImage_.getSize()},Po.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},Po.prototype.getImageState=function(){return this.iconImage_.getImageState()},Po.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},Po.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Eo){var i=this.getSize(),s=this.iconImage_.getSize();if(!i||!s)return null;t=t.slice(),this.offsetOrigin_!=So&&this.offsetOrigin_!=yo||(t[0]=s[0]-i[0]-t[0]),this.offsetOrigin_!=xo&&this.offsetOrigin_!=yo||(t[1]=s[1]-i[1]-t[1])}return this.origin_=t,this.origin_},Po.prototype.getSrc=function(){return this.iconImage_.getSrc()},Po.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},Po.prototype.listenImageChange=function(t,i){return js.listen(this.iconImage_,Bs,t,i)},Po.prototype.load=function(){this.iconImage_.load()},Po.prototype.unlistenImageChange=function(t,i){js.unlisten(this.iconImage_,Bs,t,i)},window.proj4=Ps,window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const Go={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`},ko=Object.assign(Object.assign({},Go),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`}),No=Object.assign(Object.assign({},Go),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`}),Co=class{constructor(s){t(this,s),this.stzhInitialized=i(this,"stzhInitialized"),this.stzhPostRender=i(this,"stzhPostRender"),this.stzhMoveStart=i(this,"stzhMoveStart"),this.stzhMoveEnd=i(this,"stzhMoveEnd"),this.stzhMovePanZoom=i(this,"stzhMovePanZoom"),this.hostname="www.ogc.stadt-zuerich.ch",this.scaleControl=!0,this.layerControl=!0,this.printControl=!0,this.locationControl=!1,this.layer="streets",this.zoom=7,this.zoomLocation=7,this.center=[2683311,1247082],this.centerMarker=!0,this.pinchRotateThreshold=.3,this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333],this.writeExtentToUrlEnabled=!1,this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}},this._layers={},this.geoPositionChanged=!1,this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})},this.handleDoubleClick=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})},this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"}),this.writeExtentToUrl().catch()},this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleInsideModalOpen=()=>{this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))},this.handlePrintButtonClick=()=>{this.printIframe||(this.printIframe=document.createElement("iframe"),Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"}),this.element.append(this.printIframe)),this.printIframe.innerHTML="";const t=this.printIframe.contentWindow,i=this.constructor.style.replace('@charset "UTF-8";',""),s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let h;this.map.once("postcompose",(function(t){h=t.context.canvas.toDataURL("image/png")})),this.map.renderSync(),t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${h}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `,setTimeout((()=>{try{t.document.execCommand("print",!1,null)}catch(i){t.print()}}),1e3)}}layersWatcher(t){this._layers="string"==typeof t?JSON.parse(t):t}resolutionsWatcher(t){this._resolutions="string"==typeof t?JSON.parse(t):t}zoomWatcher(t){this.map&&this.map.getView().setZoom(t)}scaleControlWatcher(t){this.map&&(t?(this.scaleControlOl=new Mo({units:"metric"}),this.map.addControl(this.scaleControlOl)):(this.scaleControl&&this.map.removeControl(this.scaleControlOl),this.scaleControlOl=null))}printControlWatcher(t){this.map&&(t?(this.printControlElement=document.createElement("button"),this.printControlElement.className="ol-print",this.printControlElement.type="button",this.printControlElement.ariaLabel=this.localization.printLabel,this.printControlElement.addEventListener("click",this.handlePrintButtonClick),this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>',this.printControlOl=new ce({element:this.printControlElement}),this.map.addControl(this.printControlOl)):(this.printControlOl&&this.map.removeControl(this.printControlOl),this.printControlOl=null,this.printControlElement=null))}layerControlWatcher(t){this.map&&1!==this.layersArray.length&&(t?(this.layerControlElement=document.createElement("button"),this.layerControlElement.className="ol-layer",this.layerControlElement.type="button",this.layerControlElement.addEventListener("click",(()=>{this.layer="streets"===this.layer?"satellite":"streets"})),this.layerControlImageElement=document.createElement("img"),this.layerControlImageElement.className="ol-layer__thumbnail",this.layerControlImageElement.setAttribute("role","presentation"),this.layerControlImageElement.setAttribute("alt",""),this.layerControlTextElement=document.createElement("span"),this.layerControlTextElement.className="ol-layer__text",this.layerControlElement.appendChild(this.layerControlImageElement),this.layerControlElement.appendChild(this.layerControlTextElement),this.layerControlOl=new ce({element:this.layerControlElement}),this.map.addControl(this.layerControlOl)):(this.layerControlOl&&this.map.removeControl(this.layerControlOl),this.layerControlOl=null,this.layerControlElement=null,this.layerControlImageElement=null,this.layerControlTextElement=null))}locationControlWatcher(t){if(this.map)if(t){this.locationControlElement=document.createElement("button"),this.locationControlElement.type="button",this.locationControlElement.className="ol-location",this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>',this.locationControlElement.addEventListener("click",(()=>{this.geolocation.getTracking()?this.disableLocationTracking().catch():this.enableLocationTracking().catch()})),this.locationControlOl=new ce({element:this.locationControlElement}),this.geolocation=new hn({projection:this.map.getView().getProjection()}),this.positionMarkerOl=new La,this.positionMarkerOl.setId("position");const t=new Fa({image:new Po(No)});this.positionMarkerOl.setStyle(t),this.positionLayer.getSource().addFeature(this.positionMarkerOl),this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new Bh(t)),!this.geoPositionChanged&&zh.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())&&(this.geoPositionChanged=!0,this.map.getView().setCenter(t),this.zoomLocation&&this.map.getView().setZoom(this.zoomLocation))})),this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null),this.setLocationControlState(t)})),this.geolocation.on("error",(()=>{this.setLocationControlState(!1)})),this.map.addControl(this.locationControlOl)}else this.disableLocationTracking().catch(),this.locationControlOl&&this.map.removeControl(this.locationControlOl),this.positionMarkerOl&&this.positionLayer.getSource().removeFeature(this.positionMarkerOl),this.locationControlOl=null,this.locationControlElement=null,this.geolocation=null,this.positionMarkerOl=null}layerWatcher(t){this.map&&Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(!0),this.map.getView().set("projection",this.projections[t]);const h=this.layersArray.find((([t])=>t!==this.layer));if(h&&(this.layerControlImageElement&&(this.layerControlImageElement.src=h[1].thumbnailUrl),this.layerControlTextElement)){let t="";"streets"===i?t=this.localization.streetsLayerTitle:"satellite"===i&&(t=this.localization.satelliteLayerTitle),this.layerControlTextElement.textContent=h[1].title||t}}else s.setVisible(!1)}))}centerWatcher(t){this._center="string"==typeof t?JSON.parse(t):t,this.map&&!this._initialExtent&&(this.map.getView().setCenter(this._center),this.centerMarkerOl&&this.centerMarkerOl.setGeometry(new Bh(this._center)))}async centerMarkerWatcher(t){t?this.centerMarkerOl=await this.addIconMarker(this._center):this.centerMarkerOl&&this.removeIconMarker(this.centerMarkerOl)}async getMap(){return this.map}async writeExtentToUrl(){if(this.writeExtentToUrlEnabled){const t=this.map.getView().calculateExtent(this.map.getSize()),[i,s,h,n]=t,e=new URLSearchParams(window.location.search);e.set("extent[0]",i.toFixed(10)),e.set("extent[1]",s.toFixed(10)),e.set("extent[2]",h.toFixed(10)),e.set("extent[3]",n.toFixed(10));const r=`${window.location.pathname}?${e.toString()}`;history.replaceState(null,"",r)}}async getVisibleMarkers(){const t=this.iconLayer.getSource().getFeatures();if(0===t.length)return[];const i=this.map.getView().calculateExtent(this.map.getSize());return t.filter((t=>{const s=t.getGeometry().getExtent();return zh.intersects(i,s)}))}async findMarkerById(t){return this.iconLayer.getSource().getFeatures().find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new La({geometry:new Bh(t)}),h=new Fa({image:new Po(Go)});return i&&i.id&&(s.setProperties({id:i.id}),s.setId(i.id)),s.setProperties({stzh:i}),s.setStyle(h),this.iconLayer.getSource().addFeature(s),s}async addIconMarkers(t){for(const i of t)await this.addIconMarker(i.coordinates,i.props);return!0}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource().getFeatures();if(0===i.length)return;let s=zh.createEmpty();i.forEach((t=>{zh.extend(s,t.getGeometry().getExtent())})),this.map.getView().fit(s,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new Fa({image:new Po(ko)}))}async setIconMarkerInactive(t){t.setStyle(new Fa({image:new Po(Go)}))}async setAllIconMarkersInactive(){this.iconLayer.getSource().getFeatures().forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=!0){this.setLocationControlState(!0),this.geoPositionChanged=!t,this.geolocation&&this.geolocation.setTracking(!0)}async disableLocationTracking(){this.setLocationControlState(!1),this.geolocation&&this.geolocation.setTracking(!1)}async getDistance(t,i){const s=new fo([t,i]);return ph.getLength(s,{projection:this.map.getView().getProjection()})}handleLoad(){this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))}showPopover(t,i){i.imageUri&&(this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`);let s='<div class="stzh-olmap__popover-content">';i.title&&(s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`),i.text&&(s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`),i.data&&i.data.length&&i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name="${t.icon}"></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`})),s+="</div>",this.popoverElement.innerHTML+=s,i.href&&(this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`);const h=new Aa({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:!1,autoPanAnimation:{duration:300}});this.map.addOverlay(h),this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent),s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});this.map.getTargetElement().style.cursor=s?"pointer":""}))}setLocationControlState(t){this.positionLayer&&this.positionLayer.setVisible(t),this.locationControlElement&&this.locationControlElement.classList.toggle("active",t)}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel,t.name="plus",t.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel,i.name="minus",i.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const s=document.createElement("div");s.innerHTML='<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';const h=document.createElement("span");return h.innerText=this.localization.rotateLabel,s.appendChild(h),new Pa({controls:we({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new rn([new ke,new Ee,new Ge,new Oe({threshold:this.pinchRotateThreshold}),new Fe,new Re,new Ie,new Ae]),loadTilesWhileAnimating:!0,loadTilesWhileInteracting:!0,target:this.mapElement,logo:!1})}createRasterLayer(t,i){return new po({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){return this.projections||(this.projections={}),this.projections[t]=new Nh({code:"EPSG:2056",extent:i.extent}),this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:h,matrixSet:n,origin:e}=i,r=[];for(let t=0;t<this._resolutions.length;t++)r.push(t);const a=new io({origin:e,resolutions:this._resolutions,matrixIds:r,tileSize:[512,512]});return new ho({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:h,matrixSet:n,requestEncoding:"REST"})}createIconLayer(){return new _o({source:new co({})})}initMap(){if(this.map=this.createMap(),this.map.on("postrender",this.handlePostRender),this.map.on("movestart",this.handleMoveStart),this.map.on("dblclick",this.handleDoubleClick),this.map.on("moveend",this.handleMoveEnd),this.map.on("pointerdrag",this.handlePointerdrag),this.map.on("change:resolution",this.handleChangeResolution),this.layersArray=Object.entries(this._layers),this.layersArray.length>2)throw new Error("There are only two different layers allowed.");this.rasterLayers={},this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname),this.rasterLayers[t]=this.createRasterLayer(t,i.options),this.map.addLayer(this.rasterLayers[t])})),this.positionLayer=this.createIconLayer(),this.positionLayer.setVisible(!1),this.map.addLayer(this.positionLayer),this.iconLayer=this.createIconLayer(),this.map.addLayer(this.iconLayer);const t=new Ln({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});this._initialExtent&&t.fit(this._initialExtent,{size:this.map.getSize()}),this.map.setView(t),this.centerWatcher(this.center),this.scaleControlWatcher(this.scaleControl),this.printControlWatcher(this.printControl),this.locationControlWatcher(this.locationControl),this.layerControlWatcher(this.layerControl),this.layerWatcher(this.layer),this.centerMarkerWatcher(this.centerMarker),this.initializeMarkerHover(),this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch(),this.popoverElement.innerHTML="",this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof Bh){this.setIconMarkerActive(t).catch();const i=t.getProperties();return i.stzh&&this.showPopover(i.geometry.flatCoordinates,i.stzh),!0}}))})),requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})})),this.handleMoveEnd()}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers),this.resolutionsWatcher(this.resolutions),this.localization||(this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap"));const t=new URLSearchParams(window.location.search),i=[parseFloat(t.get("extent[0]")),parseFloat(t.get("extent[1]")),parseFloat(t.get("extent[2]")),parseFloat(t.get("extent[3]"))];isNaN(i[0])||isNaN(i[1])||isNaN(i[2])||isNaN(i[3])||(this._initialExtent=i)}componentWillUpdate(){this.map&&(this.map.setTarget(null),this.map=null)}componentDidRender(){this.map||this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");t&&t.addEventListener("stzhOpen",this.handleInsideModalOpen)}disconnectedCallback(){this.map&&(this.map.setTarget(null),this.map=null);const t=this.element.closest("stzh-dialog");t&&t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}render(){return n(r,{key:"b4f1daa646020194dfedc58cac58677aa7ae3be0"},n("div",{key:"6ba70a1fa94c06935bcebb71891a7fbff9430194",class:{"stzh-olmap":!0,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl}},n("div",{key:"57007211eeca6f538f27a2a5ef44276243d25fdf",ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),n("div",{key:"d215240721be6eb7efd7973842979d2ff94a5d8f",ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return a(this)}static get watchers(){return{layers:[{layersWatcher:0}],resolutions:[{resolutionsWatcher:0}],zoom:[{zoomWatcher:0}],scaleControl:[{scaleControlWatcher:0}],printControl:[{printControlWatcher:0}],layerControl:[{layerControlWatcher:0}],locationControl:[{locationControlWatcher:0}],layer:[{layerWatcher:0}],center:[{centerWatcher:0}],centerMarker:[{centerMarkerWatcher:0}]}}};Co.style=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host{}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}stzh-olmap[hidden],stzh-olmap[stzh-hidden]{display:none}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap{}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{position:relative;width:100%;aspect-ratio:1/1}@media print{stzh-olmap{page-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge, 32px);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:0.125rem solid transparent;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}@media (forced-colors: active){.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{transition:none;color:ButtonText;border-color:ButtonBorder;background-color:ButtonFace}}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}@media (forced-colors: active){.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:HighlightText;border-color:Highlight;background-color:Highlight}}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall, 8px);bottom:var(--stzh-space-xsmall, 8px);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall, 8px);right:auto;padding:var(--stzh-space-xxxsmall, 2px);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall, 2px) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall, 2px) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2)}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px));background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall, 2px)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall, 8px);bottom:var(--stzh-space-xsmall, 8px);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall, 2px) + var(--stzh-space-xsmall, 8px))}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap{}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap{}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap{}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall, 8px) * 3 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap{}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{padding:var(--stzh-space-small, 12px)}}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium, 16px)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-xlarge, 24px)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';const Ao="stzh-overlay-open",Ro=class{constructor(s){t(this,s),this.stzhOpen=i(this,"stzhOpen"),this.stzhClose=i(this,"stzhClose"),this.open=!1,this.stay=!0,this.a11yLabel=""}async show(){this.open=!0,this.stzhOpen.emit({component:"stzh-overlay"})}async hide(){this.open=!1,this.stzhClose.emit({component:"stzh-overlay"})}getSiblings(){return this.containerElement?Array.from(this.containerElement.children).filter((t=>t!==this.element)):[]}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}dialogShown(){document.body.classList.add(Ao),this.disableSiblings(),this.trap&&this.trap.activate()}dialogHidden(){document.body.classList.remove(Ao),this.enableSiblings(),this.trap&&this.trap.deactivate()}connectedCallback(){this.stay||this.element.parentElement===document.body||document.body.appendChild(this.element),this.containerElement=this.element.parentElement}componentDidRender(){this.open?this.dialogShown():this.dialogHidden()}componentDidUpdate(){this.trap.updateContainerElements(this.element)}componentDidLoad(){this.trap=l(this.element,Object.assign({fallbackFocus:this.dialogElement},f())),this.open&&this.dialogShown()}disconnectedCallback(){this.dialogHidden()}render(){return n(r,{key:"fdbd41e21e69da9bdf779186f59a5b25d601b300"},n("div",{key:"383e5312e002e838de74a744d347fcdba939f1d1",class:{"stzh-overlay":!0,"stzh-overlay--is-open":this.open}},n("div",{key:"6787cebf78ab94c79d30f9a1149092c1f8528451",class:"stzh-overlay__backdrop"}),n("div",{key:"1b22ddec485197eb5ae3b5d8c2e461561f3995d4",class:"stzh-overlay__content"},n("div",{key:"991e04254c097825350912865c4e0e4c1f0ebcac",class:"stzh-overlay__content-inner",ref:t=>this.dialogElement=t,tabindex:"-1",role:"dialog","aria-label":this.a11yLabel||null,"aria-hidden":this.open?"false":"true"},n("slot",{key:"632169135c477cdb1a709420891a13e3bfd0394e"})))))}get element(){return a(this)}};Ro.style=".sc-stzh-overlay-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-overlay-h,[stzh-hidden].sc-stzh-overlay-h{display:none}.sc-stzh-overlay-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-overlay-h *.sc-stzh-overlay,.sc-stzh-overlay-h *.sc-stzh-overlay::before,.sc-stzh-overlay-h *.sc-stzh-overlay::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-overlay-h .has-focus.sc-stzh-overlay{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay{outline-style:none !important}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay::-moz-focus-inner{border:0 !important}.sc-stzh-overlay-h{--backdrop-opacity:var(--stzh-overlay-backdrop-opacity);--backdrop-background-color:var(--stzh-overlay-backdrop-background-color)}.stzh-overlay.sc-stzh-overlay{display:none;z-index:var(--stzh-z-index-overlay);position:fixed;top:0;left:0;width:100%;height:100%;flex-direction:column;justify-content:stretch;align-items:stretch}.stzh-overlay__backdrop.sc-stzh-overlay{z-index:1;background-color:var(--backdrop-background-color);opacity:var(--backdrop-opacity);position:absolute;top:0;left:0;width:100%;height:100%}.stzh-overlay__content.sc-stzh-overlay{z-index:2;display:flex;flex-direction:column;align-items:center;position:relative;flex-grow:1;overflow:auto}.stzh-overlay__content-inner.sc-stzh-overlay{margin-top:auto;margin-bottom:auto;outline:none}.stzh-overlay--is-open.sc-stzh-overlay{display:flex}";export{m as stzh_header,Co as stzh_olmap,Ro as stzh_overlay}
|
|
7
|
+
*/ph.prototype.geodesicArea=function(t){return ph.getArea_(t,this.radius)},ph.prototype.haversineDistance=function(t,i){return ph.getDistance_(t,i,this.radius)},ph.prototype.offset=function(t,i,s){var h=rh.toRadians(t[1]),n=rh.toRadians(t[0]),e=i/this.radius,r=Math.asin(Math.sin(h)*Math.cos(e)+Math.cos(h)*Math.sin(e)*Math.cos(s)),a=n+Math.atan2(Math.sin(s)*Math.sin(e)*Math.cos(h),Math.cos(e)-Math.sin(h)*Math.sin(r));return[rh.toDegrees(a),rh.toDegrees(r)]},ph.DEFAULT_RADIUS=6371008.8,ph.getLength=function(t,i){var s,h,n,e,r,a,o=i||{},u=o.radius||ph.DEFAULT_RADIUS,c=o.projection||"EPSG:3857",l=(t=t.clone().transform(c,"EPSG:4326")).getType(),f=0;switch(l){case ah:case lh:break;case oh:case uh:s=t.getCoordinates(),f=ph.getLength_(s,u);break;case fh:case ch:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)f+=ph.getLength_(s[n],u);break;case dh:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)for(r=0,a=(h=s[n]).length;r<a;++r)f+=ph.getLength_(h[r],u);break;case vh:var d=t.getGeometries();for(n=0,e=d.length;n<e;++n)f+=ph.getLength(d[n],i);break;default:throw new Error("Unsupported geometry type: "+l)}return f},ph.getLength_=function(t,i){for(var s=0,h=0,n=t.length;h<n-1;++h)s+=ph.getDistance_(t[h],t[h+1],i);return s},ph.getDistance_=function(t,i,s){var h=rh.toRadians(t[1]),n=rh.toRadians(i[1]),e=(n-h)/2,r=rh.toRadians(i[0]-t[0])/2,a=Math.sin(e)*Math.sin(e)+Math.sin(r)*Math.sin(r)*Math.cos(h)*Math.cos(n);return 2*s*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))},ph.getArea=function(t,i){var s,h,n,e,r,a,o=i||{},u=o.radius||ph.DEFAULT_RADIUS,c=o.projection||"EPSG:3857",l=(t=t.clone().transform(c,"EPSG:4326")).getType(),f=0;switch(l){case ah:case lh:case oh:case fh:case uh:break;case ch:for(s=t.getCoordinates(),f=Math.abs(ph.getArea_(s[0],u)),n=1,e=s.length;n<e;++n)f-=Math.abs(ph.getArea_(s[n],u));break;case dh:for(n=0,e=(s=t.getCoordinates()).length;n<e;++n)for(h=s[n],f+=Math.abs(ph.getArea_(h[0],u)),r=1,a=h.length;r<a;++r)f-=Math.abs(ph.getArea_(h[r],u));break;case vh:var d=t.getGeometries();for(n=0,e=d.length;n<e;++n)f+=ph.getArea(d[n],i);break;default:throw new Error("Unsupported geometry type: "+l)}return f},ph.getArea_=function(t,i){for(var s=0,h=t.length,n=t[h-1][0],e=t[h-1][1],r=0;r<h;r++){var a=t[r][0],o=t[r][1];s+=rh.toRadians(a-n)*(2+Math.sin(rh.toRadians(e))+Math.sin(rh.toRadians(o))),n=a,e=o}return s*i*i/2};var _h={binarySearch:function(t,i,s){for(var h,n,e=s||_h.numberSafeCompareFunction,r=0,a=t.length,o=!1;r<a;)(n=+e(t[h=r+(a-r>>1)],i))<0?r=h+1:(a=h,o=!n);return o?r:~r},numberSafeCompareFunction:function(t,i){return t>i?1:t<i?-1:0},includes:function(t,i){return t.indexOf(i)>=0},linearFindNearest:function(t,i,s){var h,n=t.length;if(t[0]<=i)return 0;if(i<=t[n-1])return n-1;if(s>0){for(h=1;h<n;++h)if(t[h]<i)return h-1}else if(s<0){for(h=1;h<n;++h)if(t[h]<=i)return h}else for(h=1;h<n;++h){if(t[h]==i)return h;if(t[h]<i)return t[h-1]-i<i-t[h]?h-1:h}return n-1},reverseSubArray:function(t,i,s){for(;i<s;){var h=t[i];t[i]=t[s],t[s]=h,++i,--s}},extend:function(t,i){var s,h=Array.isArray(i)?i:[i],n=h.length;for(s=0;s<n;s++)t[t.length]=h[s]},remove:function(t,i){var s=t.indexOf(i),h=s>-1;return h&&t.splice(s,1),h},find:function(t,i){for(var s,h=t.length>>>0,n=0;n<h;n++)if(i(s=t[n],n,t))return s;return null},equals:function(t,i){var s=t.length;if(s!==i.length)return!1;for(var h=0;h<s;h++)if(t[h]!==i[h])return!1;return!0},stableSort:function(t,i){var s,h=t.length,n=Array(t.length);for(s=0;s<h;s++)n[s]={index:s,value:t[s]};for(n.sort((function(t,s){return i(t.value,s.value)||t.index-s.index})),s=0;s<t.length;s++)t[s]=n[s].value},findIndex:function(t,i){var s;return t.every((function(h,n){return s=n,!i(h,n,t)}))?-1:s},isSorted:function(t,i,s){var h=i||_h.numberSafeCompareFunction;return t.every((function(i,n){if(0===n)return!0;var e=h(t[n-1],i);return!(e>0||s&&0===e)}))}},gh="top-left",zh={boundingExtent:function(t){for(var i=zh.createEmpty(),s=0,h=t.length;s<h;++s)zh.extendCoordinate(i,t[s]);return i},boundingExtentXYs_:function(t,i,s){var h=Math.min.apply(null,t),n=Math.min.apply(null,i),e=Math.max.apply(null,t),r=Math.max.apply(null,i);return zh.createOrUpdate(h,n,e,r,s)},buffer:function(t,i,s){return s?(s[0]=t[0]-i,s[1]=t[1]-i,s[2]=t[2]+i,s[3]=t[3]+i,s):[t[0]-i,t[1]-i,t[2]+i,t[3]+i]},clone:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t.slice()},closestSquaredDistanceXY:function(t,i,s){var h,n;return(h=i<t[0]?t[0]-i:t[2]<i?i-t[2]:0)*h+(n=s<t[1]?t[1]-s:t[3]<s?s-t[3]:0)*n},containsCoordinate:function(t,i){return zh.containsXY(t,i[0],i[1])},containsExtent:function(t,i){return t[0]<=i[0]&&i[2]<=t[2]&&t[1]<=i[1]&&i[3]<=t[3]},containsXY:function(t,i,s){return t[0]<=i&&i<=t[2]&&t[1]<=s&&s<=t[3]},coordinateRelationship:function(t,i){var s=i[0],h=i[1],n=0;return s<t[0]?n|=16:s>t[2]&&(n|=4),h<t[1]?n|=8:h>t[3]&&(n|=2),0===n&&(n=1),n},createEmpty:function(){return[1/0,1/0,-1/0,-1/0]},createOrUpdate:function(t,i,s,h,n){return n?(n[0]=t,n[1]=i,n[2]=s,n[3]=h,n):[t,i,s,h]},createOrUpdateEmpty:function(t){return zh.createOrUpdate(1/0,1/0,-1/0,-1/0,t)},createOrUpdateFromCoordinate:function(t,i){var s=t[0],h=t[1];return zh.createOrUpdate(s,h,s,h,i)},createOrUpdateFromCoordinates:function(t,i){var s=zh.createOrUpdateEmpty(i);return zh.extendCoordinates(s,t)},createOrUpdateFromFlatCoordinates:function(t,i,s,h,n){var e=zh.createOrUpdateEmpty(n);return zh.extendFlatCoordinates(e,t,i,s,h)},createOrUpdateFromRings:function(t,i){var s=zh.createOrUpdateEmpty(i);return zh.extendRings(s,t)},equals:function(t,i){return t[0]==i[0]&&t[2]==i[2]&&t[1]==i[1]&&t[3]==i[3]},extend:function(t,i){return i[0]<t[0]&&(t[0]=i[0]),i[2]>t[2]&&(t[2]=i[2]),i[1]<t[1]&&(t[1]=i[1]),i[3]>t[3]&&(t[3]=i[3]),t},extendCoordinate:function(t,i){i[0]<t[0]&&(t[0]=i[0]),i[0]>t[2]&&(t[2]=i[0]),i[1]<t[1]&&(t[1]=i[1]),i[1]>t[3]&&(t[3]=i[1])},extendCoordinates:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)zh.extendCoordinate(t,i[s]);return t},extendFlatCoordinates:function(t,i,s,h,n){for(;s<h;s+=n)zh.extendXY(t,i[s],i[s+1]);return t},extendRings:function(t,i){var s,h;for(s=0,h=i.length;s<h;++s)zh.extendCoordinates(t,i[s]);return t},extendXY:function(t,i,s){t[0]=Math.min(t[0],i),t[1]=Math.min(t[1],s),t[2]=Math.max(t[2],i),t[3]=Math.max(t[3],s)},forEachCorner:function(t,i,s){var h;return(h=i.call(s,zh.getBottomLeft(t)))||(h=i.call(s,zh.getBottomRight(t)))||(h=i.call(s,zh.getTopRight(t)))?h:(h=i.call(s,zh.getTopLeft(t)))||!1},getArea:function(t){var i=0;return zh.isEmpty(t)||(i=zh.getWidth(t)*zh.getHeight(t)),i},getBottomLeft:function(t){return[t[0],t[1]]},getBottomRight:function(t){return[t[2],t[1]]},getCenter:function(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]},getCorner:function(t,i){var s;return"bottom-left"===i?s=zh.getBottomLeft(t):"bottom-right"===i?s=zh.getBottomRight(t):i===gh?s=zh.getTopLeft(t):"top-right"===i?s=zh.getTopRight(t):eh(!1,13),s},getEnlargedArea:function(t,i){var s=Math.min(t[0],i[0]),h=Math.min(t[1],i[1]);return(Math.max(t[2],i[2])-s)*(Math.max(t[3],i[3])-h)},getForViewAndSize:function(t,i,s,h,n){var e=i*h[0]/2,r=i*h[1]/2,a=Math.cos(s),o=Math.sin(s),u=e*a,c=e*o,l=r*a,f=r*o,d=t[0],v=t[1],m=d-u+f,p=d-u-f,_=d+u-f,g=d+u+f,z=v-c-l,M=v-c+l,w=v+c+l,b=v+c-l;return zh.createOrUpdate(Math.min(m,p,_,g),Math.min(z,M,w,b),Math.max(m,p,_,g),Math.max(z,M,w,b),n)},getHeight:function(t){return t[3]-t[1]},getIntersectionArea:function(t,i){var s=zh.getIntersection(t,i);return zh.getArea(s)},getIntersection:function(t,i,s){var h=s||zh.createEmpty();return zh.intersects(t,i)&&(h[0]=t[0]>i[0]?t[0]:i[0],h[1]=t[1]>i[1]?t[1]:i[1],h[2]=t[2]<i[2]?t[2]:i[2],h[3]=t[3]<i[3]?t[3]:i[3]),h},getMargin:function(t){return zh.getWidth(t)+zh.getHeight(t)},getSize:function(t){return[t[2]-t[0],t[3]-t[1]]},getTopLeft:function(t){return[t[0],t[3]]},getTopRight:function(t){return[t[2],t[3]]},getWidth:function(t){return t[2]-t[0]},intersects:function(t,i){return t[0]<=i[2]&&t[2]>=i[0]&&t[1]<=i[3]&&t[3]>=i[1]},isEmpty:function(t){return t[2]<t[0]||t[3]<t[1]},returnOrUpdate:function(t,i){return i?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i):t},scaleFromCenter:function(t,i){var s=(t[2]-t[0])/2*(i-1),h=(t[3]-t[1])/2*(i-1);t[0]-=s,t[2]+=s,t[1]-=h,t[3]+=h},intersectsSegment:function(t,i,s){var h=!1,n=zh.coordinateRelationship(t,i),e=zh.coordinateRelationship(t,s);if(1===n||1===e)h=!0;else{var r,a,o=t[0],u=t[1],c=t[2],l=t[3],f=s[0],d=s[1],v=(d-i[1])/(f-i[0]);2&e&&!(2&n)&&(h=(r=f-(d-l)/v)>=o&&r<=c),h||!(4&e)||4&n||(h=(a=d-(f-c)*v)>=u&&a<=l),h||!(8&e)||8&n||(h=(r=f-(d-u)/v)>=o&&r<=c),h||!(16&e)||16&n||(h=(a=d-(f-o)*v)>=u&&a<=l)}return h},applyTransform:function(t,i,s){var h=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];return i(h,h,2),zh.boundingExtentXYs_([h[0],h[2],h[4],h[6]],[h[1],h[3],h[5],h[7]],s)}},Mh="XY",wh="XYM",bh="XYZM",xh={TRUE:function(){return!0},FALSE:function(){return!1}},yh=function(t,i,s,h,n,e){var r,a=e||[],o=0;for(r=i;r<s;r+=h){var u=t[r],c=t[r+1];a[o++]=n[0]*u+n[2]*c+n[4],a[o++]=n[1]*u+n[3]*c+n[5]}return e&&a.length!=o&&(a.length=o),a},Eh=function(t,i,s,h,n,e,r){for(var a=r||[],o=Math.cos(n),u=Math.sin(n),c=e[0],l=e[1],f=0,d=i;d<s;d+=h){var v=t[d]-c,m=t[d+1]-l;a[f++]=c+v*o-m*u,a[f++]=l+v*u+m*o;for(var p=d+2;p<d+h;++p)a[f++]=t[p]}return r&&a.length!=f&&(a.length=f),a},Sh=function(t,i,s,h,n,e,r,a){for(var o=a||[],u=r[0],c=r[1],l=0,f=i;f<s;f+=h){var d=t[f+1]-c;o[l++]=u+n*(t[f]-u),o[l++]=c+e*d;for(var v=f+2;v<f+h;++v)o[l++]=t[v]}return a&&o.length!=l&&(o.length=l),o},Ph=function(t,i,s,h,n,e,r){var a,o,u=r||[],c=0;for(a=i;a<s;a+=h)for(u[c++]=t[a]+n,u[c++]=t[a+1]+e,o=a+2;o<a+h;++o)u[c++]=t[o];return r&&u.length!=c&&(u.length=c),u},Gh={DEGREES:"degrees",FEET:"ft",METERS:"m",TILE_PIXELS:"tile-pixels",USFEET:"us-ft",METERS_PER_UNIT:{}};Gh.METERS_PER_UNIT[Gh.DEGREES]=2*Math.PI*6370997/360,Gh.METERS_PER_UNIT[Gh.FEET]=.3048,Gh.METERS_PER_UNIT[Gh.METERS]=1,Gh.METERS_PER_UNIT[Gh.USFEET]=1200/3937;var kh={cache_:null,set:function(t){kh.cache_=t},get:function(){return kh.cache_||window.proj4}},Nh=function(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit;var i=t.code;if(Gs.ENABLE_PROJ4JS){var s=kh.get();if("function"==typeof s){var h=s.defs(i);void 0!==h&&(void 0!==h.axis&&void 0===t.axisOrientation&&(this.axisOrientation_=h.axis),void 0===t.metersPerUnit&&(this.metersPerUnit_=h.to_meter),void 0===t.units&&(this.units_=h.units))}}};Nh.prototype.canWrapX=function(){return this.canWrapX_},Nh.prototype.getCode=function(){return this.code_},Nh.prototype.getExtent=function(){return this.extent_},Nh.prototype.getUnits=function(){return this.units_},Nh.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Gh.METERS_PER_UNIT[this.units_]},Nh.prototype.getWorldExtent=function(){return this.worldExtent_},Nh.prototype.getAxisOrientation=function(){return this.axisOrientation_},Nh.prototype.isGlobal=function(){return this.global_},Nh.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},Nh.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},Nh.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},Nh.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},Nh.prototype.setWorldExtent=function(t){this.worldExtent_=t},Nh.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},Nh.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var Ch={Projection_:function(t){Nh.call(this,{code:t,units:Gh.METERS,extent:Ch.EXTENT,global:!0,worldExtent:Ch.WORLD_EXTENT,getPointResolution:function(t,i){return t/rh.cosh(i[1]/Ch.RADIUS)}})}};Gs.inherits(Ch.Projection_,Nh),Ch.RADIUS=6378137,Ch.HALF_SIZE=Math.PI*Ch.RADIUS,Ch.EXTENT=[-Ch.HALF_SIZE,-Ch.HALF_SIZE,Ch.HALF_SIZE,Ch.HALF_SIZE],Ch.WORLD_EXTENT=[-180,-85,180,85],Ch.PROJECTIONS=[new Ch.Projection_("EPSG:3857"),new Ch.Projection_("EPSG:102100"),new Ch.Projection_("EPSG:102113"),new Ch.Projection_("EPSG:900913"),new Ch.Projection_("urn:ogc:def:crs:EPSG:6.18:3:3857"),new Ch.Projection_("urn:ogc:def:crs:EPSG::3857"),new Ch.Projection_("http://www.opengis.net/gml/srs/epsg.xml#3857")],Ch.fromEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,e=i;void 0===e&&(e=n>2?t.slice():new Array(h));for(var r=Ch.HALF_SIZE,a=0;a<h;a+=n){e[a]=r*t[a]/180;var o=Ch.RADIUS*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));o>r?o=r:o<-r&&(o=-r),e[a+1]=o}return e},Ch.toEPSG4326=function(t,i,s){var h=t.length,n=s>1?s:2,e=i;void 0===e&&(e=n>2?t.slice():new Array(h));for(var r=0;r<h;r+=n)e[r]=180*t[r]/Ch.HALF_SIZE,e[r+1]=360*Math.atan(Math.exp(t[r+1]/Ch.RADIUS))/Math.PI-90;return e};var Ah={Projection_:function(t,i){Nh.call(this,{code:t,units:Gh.DEGREES,extent:Ah.EXTENT,axisOrientation:i,global:!0,metersPerUnit:Ah.METERS_PER_UNIT,worldExtent:Ah.EXTENT})}};Gs.inherits(Ah.Projection_,Nh),Ah.RADIUS=6378137,Ah.EXTENT=[-180,-90,180,90],Ah.METERS_PER_UNIT=Math.PI*Ah.RADIUS/180,Ah.PROJECTIONS=[new Ah.Projection_("CRS:84"),new Ah.Projection_("EPSG:4326","neu"),new Ah.Projection_("urn:ogc:def:crs:EPSG::4326","neu"),new Ah.Projection_("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new Ah.Projection_("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ah.Projection_("urn:ogc:def:crs:OGC:2:84"),new Ah.Projection_("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ah.Projection_("urn:x-ogc:def:crs:EPSG:4326","neu")];var Rh={cache_:{},clear:function(){Rh.cache_={}},get:function(t){return Rh.cache_[t]||null},add:function(t,i){Rh.cache_[t]=i}},Ih={cache_:{},clear:function(){Ih.cache_={}},add:function(t,i,s){var h=t.getCode(),n=i.getCode(),e=Ih.cache_;h in e||(e[h]={}),e[h][n]=s},remove:function(t,i){var s=t.getCode(),h=i.getCode(),n=Ih.cache_,e=n[s][h];return delete n[s][h],js.isEmpty(n[s])&&delete n[s],e},get:function(t,i){var s,h=Ih.cache_;return t in h&&i in h[t]&&(s=h[t][i]),s}},Th={};Th.METERS_PER_UNIT=Gh.METERS_PER_UNIT,Th.SPHERE_=new ph(ph.DEFAULT_RADIUS),Gs.ENABLE_PROJ4JS&&(Th.setProj4=function(t){kh.set(t)}),Th.getPointResolution=function(t,i,s,h){var n,e=(t=Th.get(t)).getPointResolutionFunc();if(e)n=e(i,s);else if(t.getUnits()==Gh.DEGREES&&!h||h==Gh.DEGREES)n=i;else{var r=Th.getTransformFromProjections(t,Th.get("EPSG:4326")),a=[s[0]-i/2,s[1],s[0]+i/2,s[1],s[0],s[1]-i/2,s[0],s[1]+i/2];a=r(a,a,2),n=(Th.SPHERE_.haversineDistance(a.slice(0,2),a.slice(2,4))+Th.SPHERE_.haversineDistance(a.slice(4,6),a.slice(6,8)))/2;var o=h?Gh.METERS_PER_UNIT[h]:t.getMetersPerUnit();void 0!==o&&(n/=o)}return n},Th.addEquivalentProjections=function(t){Th.addProjections(t),t.forEach((function(i){t.forEach((function(t){i!==t&&Ih.add(i,t,Th.cloneTransform)}))}))},Th.addEquivalentTransforms=function(t,i,s,h){t.forEach((function(t){i.forEach((function(i){Ih.add(t,i,s),Ih.add(i,t,h)}))}))},Th.addProjection=function(t){Rh.add(t.getCode(),t),Ih.add(t,t,Th.cloneTransform)},Th.addProjections=function(t){t.forEach(Th.addProjection)},Th.clearAllProjections=function(){Rh.clear(),Ih.clear()},Th.createProjection=function(t,i){return t?"string"==typeof t?Th.get(t):t:Th.get(i)},Th.addCoordinateTransforms=function(t,i,s,h){var n=Th.get(t),e=Th.get(i);Ih.add(n,e,Th.createTransformFromCoordinateTransform(s)),Ih.add(e,n,Th.createTransformFromCoordinateTransform(h))},Th.createTransformFromCoordinateTransform=function(t){return function(i,s,h){var n,e,r,a=i.length,o=void 0!==h?h:2,u=void 0!==s?s:new Array(a);for(e=0;e<a;e+=o)for(n=t([i[e],i[e+1]]),u[e]=n[0],u[e+1]=n[1],r=o-1;r>=2;--r)u[e+r]=i[e+r];return u}},Th.fromLonLat=function(t,i){return Th.transform(t,"EPSG:4326",void 0!==i?i:"EPSG:3857")},Th.toLonLat=function(t,i){var s=Th.transform(t,void 0!==i?i:"EPSG:3857","EPSG:4326"),h=s[0];return(h<-180||h>180)&&(s[0]=rh.modulo(h+180,360)-180),s},Th.get=function(t){var i=null;if(t instanceof Nh)i=t;else if("string"==typeof t){var s=t;if(i=Rh.get(s),Gs.ENABLE_PROJ4JS&&!i){var h=kh.get();"function"==typeof h&&void 0!==h.defs(s)&&(i=new Nh({code:s}),Th.addProjection(i))}}return i},Th.equivalent=function(t,i){if(t===i)return!0;var s=t.getUnits()===i.getUnits();return(t.getCode()===i.getCode()||Th.getTransformFromProjections(t,i)===Th.cloneTransform)&&s},Th.getTransform=function(t,i){var s=Th.get(t),h=Th.get(i);return Th.getTransformFromProjections(s,h)},Th.getTransformFromProjections=function(t,i){var s=t.getCode(),h=i.getCode(),n=Ih.get(s,h);if(Gs.ENABLE_PROJ4JS&&!n){var e=kh.get();if("function"==typeof e){var r=e.defs(s),a=e.defs(h);if(void 0!==r&&void 0!==a){if(r===a)Th.addEquivalentProjections([i,t]);else{var o=e(h,s);Th.addCoordinateTransforms(i,t,o.forward,o.inverse)}n=Ih.get(s,h)}}}return n||(n=Th.identityTransform),n},Th.identityTransform=function(t,i){if(void 0!==i&&t!==i){for(var s=0,h=t.length;s<h;++s)i[s]=t[s];t=i}return t},Th.cloneTransform=function(t,i){var s;if(void 0!==i){for(var h=0,n=t.length;h<n;++h)i[h]=t[h];s=i}else s=t.slice();return s},Th.transform=function(t,i,s){return Th.getTransform(i,s)(t,void 0,t.length)},Th.transformExtent=function(t,i,s){var h=Th.getTransform(i,s);return zh.applyTransform(t,h)},Th.transformWithProjections=function(t,i,s){return Th.getTransformFromProjections(i,s)(t)},Th.addCommon=function(){Th.addEquivalentProjections(Ch.PROJECTIONS),Th.addEquivalentProjections(Ah.PROJECTIONS),Th.addEquivalentTransforms(Ah.PROJECTIONS,Ch.PROJECTIONS,Ch.fromEPSG4326,Ch.toEPSG4326)},Th.addCommon();var Oh={};Oh.tmp_=new Array(6),Oh.create=function(){return[1,0,0,1,0,0]},Oh.reset=function(t){return Oh.set(t,1,0,0,1,0,0)},Oh.multiply=function(t,i){var s=t[0],h=t[1],n=t[2],e=t[3],r=t[4],a=t[5],o=i[0],u=i[1],c=i[2],l=i[3],f=i[4],d=i[5];return t[0]=s*o+n*u,t[1]=h*o+e*u,t[2]=s*c+n*l,t[3]=h*c+e*l,t[4]=s*f+n*d+r,t[5]=h*f+e*d+a,t},Oh.set=function(t,i,s,h,n,e,r){return t[0]=i,t[1]=s,t[2]=h,t[3]=n,t[4]=e,t[5]=r,t},Oh.setFromArray=function(t,i){return t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t[4]=i[4],t[5]=i[5],t},Oh.apply=function(t,i){var s=i[0],h=i[1];return i[0]=t[0]*s+t[2]*h+t[4],i[1]=t[1]*s+t[3]*h+t[5],i},Oh.rotate=function(t,i){var s=Math.cos(i),h=Math.sin(i);return Oh.multiply(t,Oh.set(Oh.tmp_,s,h,-h,s,0,0))},Oh.scale=function(t,i,s){return Oh.multiply(t,Oh.set(Oh.tmp_,i,0,0,s,0,0))},Oh.translate=function(t,i,s){return Oh.multiply(t,Oh.set(Oh.tmp_,1,0,0,1,i,s))},Oh.compose=function(t,i,s,h,n,e,r,a){var o=Math.sin(e),u=Math.cos(e);return t[0]=h*u,t[1]=n*o,t[2]=-h*o,t[3]=n*u,t[4]=r*h*u-a*h*o+i,t[5]=r*n*o+a*n*u+s,t},Oh.invert=function(t){var i=Oh.determinant(t);eh(0!==i,32);var s=t[0],h=t[1],n=t[2],e=t[3],r=t[4],a=t[5];return t[0]=e/i,t[1]=-h/i,t[2]=-n/i,t[3]=s/i,t[4]=(n*a-e*r)/i,t[5]=-(s*a-h*r)/i,t},Oh.determinant=function(t){return t[0]*t[3]-t[1]*t[2]};var Fh=function(){hh.call(this),this.extent_=zh.createEmpty(),this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.tmpTransform_=Oh.create()};Gs.inherits(Fh,hh),Fh.prototype.clone=function(){},Fh.prototype.closestPointXY=function(){},Fh.prototype.getClosestPoint=function(t,i){var s=i||[NaN,NaN];return this.closestPointXY(t[0],t[1],s,1/0),s},Fh.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},Fh.prototype.computeExtent=function(){},Fh.prototype.containsXY=xh.FALSE,Fh.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),zh.returnOrUpdate(this.extent_,t)},Fh.prototype.rotate=function(){},Fh.prototype.scale=function(){},Fh.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},Fh.prototype.getSimplifiedGeometry=function(){},Fh.prototype.getType=function(){},Fh.prototype.applyTransform=function(){},Fh.prototype.intersectsExtent=function(){},Fh.prototype.translate=function(){},Fh.prototype.transform=function(t,i){var s=this.tmpTransform_,h=(t=Th.get(t)).getUnits()==Gh.TILE_PIXELS?function(h,n,e){var r=t.getExtent(),a=t.getWorldExtent(),o=zh.getHeight(a)/zh.getHeight(r);return Oh.compose(s,a[0],a[3],o,-o,0,0,0),yh(h,0,h.length,e,s,n),Th.getTransform(t,i)(h,n,e)}:Th.getTransform(t,i);return this.applyTransform(h),this};var Lh=function(){Fh.call(this),this.layout=Mh,this.stride=2,this.flatCoordinates=null};Gs.inherits(Lh,Fh),Lh.getLayoutForStride_=function(t){var i;return 2==t?i=Mh:3==t?i="XYZ":4==t&&(i=bh),i},Lh.getStrideForLayout=function(t){var i;return t==Mh?i=2:"XYZ"==t||t==wh?i=3:t==bh&&(i=4),i},Lh.prototype.containsXY=xh.FALSE,Lh.prototype.computeExtent=function(t){return zh.createOrUpdateFromFlatCoordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},Lh.prototype.getCoordinates=function(){},Lh.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},Lh.prototype.getFlatCoordinates=function(){return this.flatCoordinates},Lh.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},Lh.prototype.getLayout=function(){return this.layout},Lh.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!=this.getRevision()&&(js.clear(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var i=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(i))return this.simplifiedGeometryCache[i];var s=this.getSimplifiedGeometryInternal(t);return s.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[i]=s,s):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},Lh.prototype.getSimplifiedGeometryInternal=function(){return this},Lh.prototype.getStride=function(){return this.stride},Lh.prototype.setFlatCoordinatesInternal=function(t,i){this.stride=Lh.getStrideForLayout(t),this.layout=t,this.flatCoordinates=i},Lh.prototype.setCoordinates=function(){},Lh.prototype.setLayout=function(t,i,s){var h;if(t)h=Lh.getStrideForLayout(t);else{var n;for(n=0;n<s;++n){if(0===i.length)return this.layout=Mh,void(this.stride=2);i=i[0]}t=Lh.getLayoutForStride_(h=i.length)}this.layout=t,this.stride=h},Lh.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},Lh.prototype.rotate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();Eh(s,0,s.length,h,t,i,s),this.changed()}},Lh.prototype.scale=function(t,i,s){var h=i;void 0===h&&(h=t);var n=s;n||(n=zh.getCenter(this.getExtent()));var e=this.getFlatCoordinates();if(e){var r=this.getStride();Sh(e,0,e.length,r,t,h,n,e),this.changed()}},Lh.prototype.translate=function(t,i){var s=this.getFlatCoordinates();if(s){var h=this.getStride();Ph(s,0,s.length,h,t,i,s),this.changed()}},Lh.transform2D=function(t,i,s){var h=t.getFlatCoordinates();if(h){var n=t.getStride();return yh(h,0,h.length,n,i,s)}return null};var Dh={linearRing:function(t,i,s,h){for(var n=0,e=t[s-h],r=t[s-h+1];i<s;i+=h){var a=t[i],o=t[i+1];n+=r*a-e*o,e=a,r=o}return n/2},linearRings:function(t,i,s,h){var n,e,r=0;for(n=0,e=s.length;n<e;++n){var a=s[n];r+=Dh.linearRing(t,i,a,h),i=a}return r},linearRingss:function(t,i,s,h){var n,e,r=0;for(n=0,e=s.length;n<e;++n){var a=s[n];r+=Dh.linearRings(t,i,a,h),i=a[a.length-1]}return r}},jh={point:function(t,i,s,h,n,e,r){var a,o,u=t[i],c=t[i+1],l=t[s]-u,f=t[s+1]-c;if(0===l&&0===f)o=i;else{var d=((n-u)*l+(e-c)*f)/(l*l+f*f);if(d>1)o=s;else{if(d>0){for(a=0;a<h;++a)r[a]=rh.lerp(t[i+a],t[s+a],d);return void(r.length=h)}o=i}}for(a=0;a<h;++a)r[a]=t[o+a];r.length=h},getMaxSquaredDelta:function(t,i,s,h,n){var e=t[i],r=t[i+1];for(i+=h;i<s;i+=h){var a=t[i],o=t[i+1],u=rh.squaredDistance(e,r,a,o);u>n&&(n=u),e=a,r=o}return n},getsMaxSquaredDelta:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];n=jh.getMaxSquaredDelta(t,i,a,h,n),i=a}return n},getssMaxSquaredDelta:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];n=jh.getsMaxSquaredDelta(t,i,a,h,n),i=a[a.length-1]}return n},getClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){if(i==s)return u;var l,f;if(0===n){if((f=rh.squaredDistance(r,a,t[i],t[i+1]))<u){for(l=0;l<h;++l)o[l]=t[i+l];return o.length=h,f}return u}for(var d=c||[NaN,NaN],v=i+h;v<s;)if(jh.point(t,v-h,v,h,r,a,d),(f=rh.squaredDistance(r,a,d[0],d[1]))<u){for(u=f,l=0;l<h;++l)o[l]=d[l];o.length=h,v+=h}else v+=h*Math.max((Math.sqrt(f)-Math.sqrt(u))/n|0,1);if(e&&(jh.point(t,s-h,i,h,r,a,d),(f=rh.squaredDistance(r,a,d[0],d[1]))<u)){for(u=f,l=0;l<h;++l)o[l]=d[l];o.length=h}return u},getsClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d=c||[NaN,NaN];for(l=0,f=s.length;l<f;++l){var v=s[l];u=jh.getClosestPoint(t,i,v,h,n,e,r,a,o,u,d),i=v}return u},getssClosestPoint:function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d=c||[NaN,NaN];for(l=0,f=s.length;l<f;++l){var v=s[l];u=jh.getsClosestPoint(t,i,v,h,n,e,r,a,o,u,d),i=v[v.length-1]}return u}},Wh={coordinate:function(t,i,s){var h,n;for(h=0,n=s.length;h<n;++h)t[i++]=s[h];return i},coordinates:function(t,i,s,h){var n,e;for(n=0,e=s.length;n<e;++n){var r,a=s[n];for(r=0;r<h;++r)t[i++]=a[r]}return i},coordinatess:function(t,i,s,h,n){var e,r,a=n||[],o=0;for(e=0,r=s.length;e<r;++e){var u=Wh.coordinates(t,i,s[e],h);a[o++]=u,i=u}return a.length=o,a},coordinatesss:function(t,i,s,h,n){var e,r,a=n||[],o=0;for(e=0,r=s.length;e<r;++e){var u=Wh.coordinatess(t,i,s[e],h,a[o]);a[o++]=u,i=u[u.length-1]}return a.length=o,a}},Uh={coordinates:function(t,i,s,h,n){var e,r=void 0!==n?n:[],a=0;for(e=i;e<s;e+=h)r[a++]=t.slice(e,e+h);return r.length=a,r},coordinatess:function(t,i,s,h,n){var e,r,a=void 0!==n?n:[],o=0;for(e=0,r=s.length;e<r;++e){var u=s[e];a[o++]=Uh.coordinates(t,i,u,h,a[o]),i=u}return a.length=o,a},coordinatesss:function(t,i,s,h,n){var e,r,a=void 0!==n?n:[],o=0;for(e=0,r=s.length;e<r;++e){var u=s[e];a[o++]=Uh.coordinatess(t,i,u,h,a[o]),i=u[u.length-1]}return a.length=o,a}},Vh={lineString:function(t,i,s,h,n,e,r){var a=void 0!==r?r:[];return e||(s=Vh.radialDistance(t,i,s,h,n,a,0),t=a,i=0,h=2),a.length=Vh.douglasPeucker(t,i,s,h,n,a,0),a},douglasPeucker:function(t,i,s,h,n,e,r){var a=(s-i)/h;if(a<3){for(;i<s;i+=h)e[r++]=t[i],e[r++]=t[i+1];return r}var o=new Array(a);o[0]=1,o[a-1]=1;for(var u,c=[i,s-h],l=0;c.length>0;){var f=c.pop(),d=c.pop(),v=0,m=t[d],p=t[d+1],_=t[f],g=t[f+1];for(u=d+h;u<f;u+=h){var z=rh.squaredSegmentDistance(t[u],t[u+1],m,p,_,g);z>v&&(l=u,v=z)}v>n&&(o[(l-i)/h]=1,d+h<l&&c.push(d,l),l+h<f&&c.push(l,f))}for(u=0;u<a;++u)o[u]&&(e[r++]=t[i+u*h],e[r++]=t[i+u*h+1]);return r},douglasPeuckers:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o];r=Vh.douglasPeucker(t,i,c,h,n,e,r),a.push(r),i=c}return r},douglasPeuckerss:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o],l=[];r=Vh.douglasPeuckers(t,i,c,h,n,e,r,l),a.push(l),i=c[c.length-1]}return r},radialDistance:function(t,i,s,h,n,e,r){if(s<=i+h){for(;i<s;i+=h)e[r++]=t[i],e[r++]=t[i+1];return r}var a=t[i],o=t[i+1];e[r++]=a,e[r++]=o;var u=a,c=o;for(i+=h;i<s;i+=h)rh.squaredDistance(a,o,u=t[i],c=t[i+1])>n&&(e[r++]=u,e[r++]=c,a=u,o=c);return u==a&&c==o||(e[r++]=u,e[r++]=c),r},snap:function(t,i){return i*Math.round(t/i)},quantize:function(t,i,s,h,n,e,r){if(i==s)return r;var a,o,u=Vh.snap(t[i],n),c=Vh.snap(t[i+1],n);i+=h,e[r++]=u,e[r++]=c;do{if(a=Vh.snap(t[i],n),o=Vh.snap(t[i+1],n),(i+=h)==s)return e[r++]=a,e[r++]=o,r}while(a==u&&o==c);for(;i<s;){var l,f;if(l=Vh.snap(t[i],n),f=Vh.snap(t[i+1],n),i+=h,l!=a||f!=o){var d=a-u,v=o-c,m=l-u,p=f-c;d*p==v*m&&(d<0&&m<d||d==m||d>0&&m>d)&&(v<0&&p<v||v==p||v>0&&p>v)?(a=l,o=f):(e[r++]=a,e[r++]=o,u=a,c=o,a=l,o=f)}}return e[r++]=a,e[r++]=o,r},quantizes:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o];r=Vh.quantize(t,i,c,h,n,e,r),a.push(r),i=c}return r},quantizess:function(t,i,s,h,n,e,r,a){var o,u;for(o=0,u=s.length;o<u;++o){var c=s[o],l=[];r=Vh.quantizes(t,i,c,h,n,e,r,l),a.push(l),i=c[c.length-1]}return r}},qh=function(t,i){Lh.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};Gs.inherits(qh,Lh),qh.prototype.clone=function(){var t=new qh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},qh.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(jh.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jh.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,i,s,h))},qh.prototype.getArea=function(){return Dh.linearRing(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},qh.prototype.getCoordinates=function(){return Uh.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},qh.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Vh.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new qh(null);return s.setFlatCoordinates(Mh,i),s},qh.prototype.getType=function(){return uh},qh.prototype.intersectsExtent=function(){},qh.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Wh.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},qh.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Bh=function(t,i){Lh.call(this),this.setCoordinates(t,i)};Gs.inherits(Bh,Lh),Bh.prototype.clone=function(){var t=new Bh(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},Bh.prototype.closestPointXY=function(t,i,s,h){var n=this.flatCoordinates,e=rh.squaredDistance(t,i,n[0],n[1]);if(e<h){var r,a=this.stride;for(r=0;r<a;++r)s[r]=n[r];return s.length=a,e}return h},Bh.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},Bh.prototype.computeExtent=function(t){return zh.createOrUpdateFromCoordinate(this.flatCoordinates,t)},Bh.prototype.getType=function(){return ah},Bh.prototype.intersectsExtent=function(t){return zh.containsXY(t,this.flatCoordinates[0],this.flatCoordinates[1])},Bh.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Wh.coordinate(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},Bh.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var Xh={linearRingContainsExtent:function(t,i,s,h,n){return!zh.forEachCorner(n,(function(n){return!Xh.linearRingContainsXY(t,i,s,h,n[0],n[1])}))},linearRingContainsXY:function(t,i,s,h,n,e){for(var r=0,a=t[s-h],o=t[s-h+1];i<s;i+=h){var u=t[i],c=t[i+1];o<=e?c>e&&(u-a)*(e-o)-(n-a)*(c-o)>0&&r++:c<=e&&(u-a)*(e-o)-(n-a)*(c-o)<0&&r--,a=u,o=c}return 0!==r},linearRingsContainsXY:function(t,i,s,h,n,e){if(0===s.length)return!1;if(!Xh.linearRingContainsXY(t,i,s[0],h,n,e))return!1;var r,a;for(r=1,a=s.length;r<a;++r)if(Xh.linearRingContainsXY(t,s[r-1],s[r],h,n,e))return!1;return!0},linearRingssContainsXY:function(t,i,s,h,n,e){if(0===s.length)return!1;var r,a;for(r=0,a=s.length;r<a;++r){var o=s[r];if(Xh.linearRingsContainsXY(t,i,o,h,n,e))return!0;i=o[o.length-1]}return!1}},Hh={linearRings:function(t,i,s,h,n,e,r){for(var a,o,u,c,l,f,d,v=n[e+1],m=[],p=0,_=s.length;p<_;++p){var g=s[p];for(c=t[g-h],f=t[g-h+1],a=i;a<g;a+=h)l=t[a],d=t[a+1],(v<=f&&d<=v||f<=v&&v<=d)&&m.push(u=(v-f)/(d-f)*(l-c)+c),c=l,f=d}var z=NaN,M=-1/0;for(m.sort(_h.numberSafeCompareFunction),c=m[0],a=1,o=m.length;a<o;++a){l=m[a];var w=Math.abs(l-c);w>M&&Xh.linearRingsContainsXY(t,i,s,h,u=(c+l)/2,v)&&(z=u,M=w),c=l}return isNaN(z)&&(z=n[e]),r?(r.push(z,v,M),r):[z,v,M]},linearRingss:function(t,i,s,h,n){var e,r,a=[];for(e=0,r=s.length;e<r;++e){var o=s[e];a=Hh.linearRings(t,i,o,h,n,2*e,a),i=o[o.length-1]}return a}},Yh=function(t,i,s,h,n,e){for(var r,a=[t[i],t[i+1]],o=[];i+h<s;i+=h){if(o[0]=t[i+h],o[1]=t[i+h+1],r=n.call(e,a,o))return r;a[0]=o[0],a[1]=o[1]}return!1},Jh={lineString:function(t,i,s,h,n){var e=zh.extendFlatCoordinates(zh.createEmpty(),t,i,s,h);return!!zh.intersects(n,e)&&(!!zh.containsExtent(n,e)||e[0]>=n[0]&&e[2]<=n[2]||e[1]>=n[1]&&e[3]<=n[3]||Yh(t,i,s,h,(function(t,i){return zh.intersectsSegment(n,t,i)})))},lineStrings:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){if(Jh.lineString(t,i,s[e],h,n))return!0;i=s[e]}return!1},linearRing:function(t,i,s,h,n){return!!(Jh.lineString(t,i,s,h,n)||Xh.linearRingContainsXY(t,i,s,h,n[0],n[1])||Xh.linearRingContainsXY(t,i,s,h,n[0],n[3])||Xh.linearRingContainsXY(t,i,s,h,n[2],n[1])||Xh.linearRingContainsXY(t,i,s,h,n[2],n[3]))},linearRings:function(t,i,s,h,n){if(!Jh.linearRing(t,i,s[0],h,n))return!1;if(1===s.length)return!0;var e,r;for(e=1,r=s.length;e<r;++e)if(Xh.linearRingContainsExtent(t,s[e-1],s[e],h,n))return!1;return!0},linearRingss:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e){var a=s[e];if(Jh.linearRings(t,i,a,h,n))return!0;i=a[a.length-1]}return!1}},Zh=function(t,i,s,h){for(;i<s-h;){var n;for(n=0;n<h;++n){var e=t[i+n];t[i+n]=t[s-h+n],t[s-h+n]=e}i+=h,s-=h}},Kh={linearRingIsClockwise:function(t,i,s,h){for(var n=0,e=t[s-h],r=t[s-h+1];i<s;i+=h){var a=t[i],o=t[i+1];n+=(a-e)*(o+r),e=a,r=o}return n>0},linearRingsAreOriented:function(t,i,s,h,n){var e,r,a=void 0!==n&&n;for(e=0,r=s.length;e<r;++e){var o=s[e],u=Kh.linearRingIsClockwise(t,i,o,h);if(0===e){if(a&&u||!a&&!u)return!1}else if(a&&!u||!a&&u)return!1;i=o}return!0},linearRingssAreOriented:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e)if(!Kh.linearRingsAreOriented(t,i,s[e],h,n))return!1;return!0},orientLinearRings:function(t,i,s,h,n){var e,r,a=void 0!==n&&n;for(e=0,r=s.length;e<r;++e){var o=s[e],u=Kh.linearRingIsClockwise(t,i,o,h);(0===e?a&&u||!a&&!u:a&&!u||!a&&u)&&Zh(t,i,o,h),i=o}return i},orientLinearRingss:function(t,i,s,h,n){var e,r;for(e=0,r=s.length;e<r;++e)i=Kh.orientLinearRings(t,i,s[e],h,n);return i}},$h=function(t,i){Lh.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,this.setCoordinates(t,i)};Gs.inherits($h,Lh),$h.prototype.appendLinearRing=function(t){this.flatCoordinates?_h.extend(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},$h.prototype.clone=function(){var t=new $h(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice(),this.ends_.slice()),t},$h.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(jh.getsMaxSquaredDelta(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jh.getsClosestPoint(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,i,s,h))},$h.prototype.containsXY=function(t,i){return Xh.linearRingsContainsXY(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,i)},$h.prototype.getArea=function(){return Dh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},$h.prototype.getCoordinates=function(t){var i;return void 0!==t?(i=this.getOrientedFlatCoordinates().slice(),Kh.orientLinearRings(i,0,this.ends_,this.stride,t)):i=this.flatCoordinates,Uh.coordinatess(i,0,this.ends_,this.stride)},$h.prototype.getEnds=function(){return this.ends_},$h.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=zh.getCenter(this.getExtent());this.flatInteriorPoint_=Hh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},$h.prototype.getInteriorPoint=function(){return new Bh(this.getFlatInteriorPoint(),wh)},$h.prototype.getLinearRingCount=function(){return this.ends_.length},$h.prototype.getLinearRing=function(t){if(t<0||this.ends_.length<=t)return null;var i=new qh(null);return i.setFlatCoordinates(this.layout,this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t])),i},$h.prototype.getLinearRings=function(){var t,i,s=this.layout,h=this.flatCoordinates,n=this.ends_,e=[],r=0;for(t=0,i=n.length;t<i;++t){var a=n[t],o=new qh(null);o.setFlatCoordinates(s,h.slice(r,a)),e.push(o),r=a}return e},$h.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Kh.linearRingsAreOriented(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Kh.orientLinearRings(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},$h.prototype.getSimplifiedGeometryInternal=function(t){var i=[],s=[];i.length=Vh.quantizes(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,s);var h=new $h(null);return h.setFlatCoordinates(Mh,i,s),h},$h.prototype.getType=function(){return ch},$h.prototype.intersectsExtent=function(t){return Jh.linearRings(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},$h.prototype.setCoordinates=function(t,i){if(t){this.setLayout(i,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var s=Wh.coordinatess(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===s.length?0:s[s.length-1],this.changed()}else this.setFlatCoordinates(Mh,null,this.ends_)},$h.prototype.setFlatCoordinates=function(t,i,s){this.setFlatCoordinatesInternal(t,i),this.ends_=s,this.changed()},$h.circular=function(t,i,s,h){var n,e=h||32,r=[];for(n=0;n<e;++n)_h.extend(r,t.offset(i,s,2*Math.PI*n/e));r.push(r[0],r[1]);var a=new $h(null);return a.setFlatCoordinates(Mh,r,[r.length]),a},$h.fromExtent=function(t){var i=t[0],s=t[1],h=t[2],n=t[3],e=[i,s,i,n,h,n,h,s,i,s],r=new $h(null);return r.setFlatCoordinates(Mh,e,[e.length]),r},$h.fromCircle=function(t,i,s){for(var h=i||32,n=t.getStride(),e=t.getLayout(),r=new $h(null,e),a=n*(h+1),o=new Array(a),u=0;u<a;u++)o[u]=0;return r.setFlatCoordinates(e,o,[o.length]),$h.makeRegular(r,t.getCenter(),t.getRadius(),s),r},$h.makeRegular=function(t,i,s,h){for(var n,e,r=t.getFlatCoordinates(),a=t.getLayout(),o=t.getStride(),u=t.getEnds(),c=r.length/o-1,l=h||0,f=0;f<=c;++f)e=f*o,n=l+2*rh.modulo(f,c)*Math.PI/c,r[e]=i[0]+s*Math.cos(n),r[e+1]=i[1]+s*Math.sin(n);t.setFlatCoordinates(a,r,u)};var Qh={ONE:1,SRC_ALPHA:770,COLOR_ATTACHMENT0:36064,COLOR_BUFFER_BIT:16384,TRIANGLES:4,TRIANGLE_STRIP:5,ONE_MINUS_SRC_ALPHA:771,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,CULL_FACE:2884,BLEND:3042,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,RGBA:6408,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,LINK_STATUS:35714,LINEAR:9729,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE0:33984,CLAMP_TO_EDGE:33071,COMPILE_STATUS:35713,FRAMEBUFFER:36160,CONTEXT_IDS_:["experimental-webgl","webgl","webkit-3d","moz-webgl"],getContext:function(t,i){var s,h,n=Qh.CONTEXT_IDS_.length;for(h=0;h<n;++h)try{if(s=t.getContext(Qh.CONTEXT_IDS_[h],i))return s}catch(t){}return null}},tn={},sn="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";tn.FIREFOX=-1!==sn.indexOf("firefox"),tn.SAFARI=-1!==sn.indexOf("safari")&&-1==sn.indexOf("chrom"),tn.WEBKIT=-1!==sn.indexOf("webkit")&&-1==sn.indexOf("edge"),tn.MAC=-1!==sn.indexOf("macintosh"),tn.DEVICE_PIXEL_RATIO=window.devicePixelRatio||1,tn.CANVAS_LINE_DASH=!1,tn.CANVAS=Gs.ENABLE_CANVAS&&function(){if(!("HTMLCanvasElement"in window))return!1;try{var t=document.createElement("CANVAS").getContext("2d");return!!t&&(void 0!==t.setLineDash&&(tn.CANVAS_LINE_DASH=!0),!0)}catch(t){return!1}}(),tn.DEVICE_ORIENTATION="DeviceOrientationEvent"in window,tn.GEOLOCATION="geolocation"in navigator,tn.TOUCH=Gs.ASSUME_TOUCH||"ontouchstart"in window,tn.POINTER="PointerEvent"in window,tn.MSPOINTER=!!navigator.msPointerEnabled,function(){if(Gs.ENABLE_WEBGL){var t,i=!1,s=[];if("WebGLRenderingContext"in window)try{var h=document.createElement("CANVAS"),n=Qh.getContext(h,{failIfMajorPerformanceCaveat:!0});n&&(i=!0,t=n.getParameter(n.MAX_TEXTURE_SIZE),s=n.getSupportedExtensions())}catch(t){}tn.WEBGL=i,Gs.WEBGL_EXTENSIONS=s,Gs.WEBGL_MAX_TEXTURE_SIZE=t}}();var hn=function(t){hh.call(this);var i=t||{};this.position_=null,this.transform_=Th.identityTransform,this.sphere_=new ph(Ah.RADIUS),this.watchId_=void 0,Ws.listen(this,hh.getChangeEventType(Ts),this.handleProjectionChanged_,this),Ws.listen(this,hh.getChangeEventType(Fs),this.handleTrackingChanged_,this),void 0!==i.projection&&this.setProjection(i.projection),void 0!==i.trackingOptions&&this.setTrackingOptions(i.trackingOptions),this.setTracking(void 0!==i.tracking&&i.tracking)};Gs.inherits(hn,hh),hn.prototype.disposeInternal=function(){this.setTracking(!1),hh.prototype.disposeInternal.call(this)},hn.prototype.handleProjectionChanged_=function(){var t=this.getProjection();t&&(this.transform_=Th.getTransformFromProjections(Th.get("EPSG:4326"),t),this.position_&&this.set(Is,this.transform_(this.position_)))},hn.prototype.handleTrackingChanged_=function(){if(tn.GEOLOCATION){var t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}},hn.prototype.positionChange_=function(t){var i=t.coords;this.set(ks,i.accuracy),this.set(Cs,null===i.altitude?void 0:i.altitude),this.set(As,null===i.altitudeAccuracy?void 0:i.altitudeAccuracy),this.set(Rs,null===i.heading?void 0:rh.toRadians(i.heading)),this.position_?(this.position_[0]=i.longitude,this.position_[1]=i.latitude):this.position_=[i.longitude,i.latitude];var s=this.transform_(this.position_);this.set(Is,s),this.set(Os,null===i.speed?void 0:i.speed);var h=$h.circular(this.sphere_,this.position_,i.accuracy);h.applyTransform(this.transform_),this.set(Ns,h),this.changed()},hn.prototype.positionError_=function(t){t.type=Js,this.setTracking(!1),this.dispatchEvent(t)},hn.prototype.getAccuracy=function(){return this.get(ks)},hn.prototype.getAccuracyGeometry=function(){return this.get(Ns)||null},hn.prototype.getAltitude=function(){return this.get(Cs)},hn.prototype.getAltitudeAccuracy=function(){return this.get(As)},hn.prototype.getHeading=function(){return this.get(Rs)},hn.prototype.getPosition=function(){return this.get(Is)},hn.prototype.getProjection=function(){return this.get(Ts)},hn.prototype.getSpeed=function(){return this.get(Os)},hn.prototype.getTracking=function(){return this.get(Fs)},hn.prototype.getTrackingOptions=function(){return this.get(Ls)},hn.prototype.setProjection=function(t){this.set(Ts,Th.get(t))},hn.prototype.setTracking=function(t){this.set(Fs,t)},hn.prototype.setTrackingOptions=function(t){this.set(Ls,t)};var nn="add",en="remove",rn=function(t,i){if(hh.call(this),this.unique_=!!(i||{}).unique,this.array_=t||[],this.unique_)for(var s=0,h=this.array_.length;s<h;++s)this.assertUnique_(this.array_[s],s);this.updateLength_()};Gs.inherits(rn,hh),rn.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},rn.prototype.extend=function(t){var i,s;for(i=0,s=t.length;i<s;++i)this.push(t[i]);return this},rn.prototype.forEach=function(t,i){for(var s=i?t.bind(i):t,h=this.array_,n=0,e=h.length;n<e;++n)s(h[n],n,h)},rn.prototype.getArray=function(){return this.array_},rn.prototype.item=function(t){return this.array_[t]},rn.prototype.getLength=function(){return this.get(rn.Property_.LENGTH)},rn.prototype.insertAt=function(t,i){this.unique_&&this.assertUnique_(i),this.array_.splice(t,0,i),this.updateLength_(),this.dispatchEvent(new rn.Event(nn,i))},rn.prototype.pop=function(){return this.removeAt(this.getLength()-1)},rn.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var i=this.getLength();return this.insertAt(i,t),this.getLength()},rn.prototype.remove=function(t){var i,s,h=this.array_;for(i=0,s=h.length;i<s;++i)if(h[i]===t)return this.removeAt(i)},rn.prototype.removeAt=function(t){var i=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new rn.Event(en,i)),i},rn.prototype.setAt=function(t,i){var s=this.getLength();if(t<s){this.unique_&&this.assertUnique_(i,t);var h=this.array_[t];this.array_[t]=i,this.dispatchEvent(new rn.Event(en,h)),this.dispatchEvent(new rn.Event(nn,i))}else{var n;for(n=s;n<t;++n)this.insertAt(n,void 0);this.insertAt(t,i)}},rn.prototype.updateLength_=function(){this.set(rn.Property_.LENGTH,this.array_.length)},rn.prototype.assertUnique_=function(t,i){for(var s=0,h=this.array_.length;s<h;++s)if(this.array_[s]===t&&s!==i)throw new nh(58)},rn.Property_={LENGTH:"length"},Gs.inherits(rn.Event=function(t,i){Vs.call(this,t),this.element=i},Vs);var an=function(t,i,s){Vs.call(this,t),this.map=i,this.frameState=void 0!==s?s:null};Gs.inherits(an,Vs);var on=function(t,i,s,h,n){an.call(this,t,i,n),this.originalEvent=s,this.pixel=i.getEventPixel(s),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==h&&h};Gs.inherits(on,an),on.prototype.preventDefault=function(){an.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},on.prototype.stopPropagation=function(){an.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()};var un={SINGLECLICK:"singleclick",CLICK:Hs,DBLCLICK:Ys,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},cn=function(t,i,s,h,n){on.call(this,t,i,s.originalEvent,h,n),this.pointerEvent=s};Gs.inherits(cn,on);var ln="pointermove",fn="pointerdown",dn=function(t,i){this.dispatcher=t,this.mapping_=i};dn.prototype.getEvents=function(){return Object.keys(this.mapping_)},dn.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var vn=function(t){dn.call(this,t,{mousedown:this.mousedown,mousemove:this.mousemove,mouseup:this.mouseup,mouseover:this.mouseover,mouseout:this.mouseout}),this.pointerMap=t.pointerMap,this.lastTouches=[]};Gs.inherits(vn,dn),vn.POINTER_ID=1,vn.POINTER_TYPE="mouse",vn.DEDUP_DIST=25,vn.prototype.isEventSimulatedFromTouch_=function(t){for(var i,s=this.lastTouches,h=t.clientX,n=t.clientY,e=0,r=s.length;e<r&&(i=s[e]);e++){var a=Math.abs(h-i[0]),o=Math.abs(n-i[1]);if(a<=vn.DEDUP_DIST&&o<=vn.DEDUP_DIST)return!0}return!1},vn.prepareEvent=function(t,i){var s=i.cloneEvent(t,t),h=s.preventDefault;return s.preventDefault=function(){t.preventDefault(),h()},s.pointerId=vn.POINTER_ID,s.isPrimary=!0,s.pointerType=vn.POINTER_TYPE,s},vn.prototype.mousedown=function(t){if(!this.isEventSimulatedFromTouch_(t)){vn.POINTER_ID.toString()in this.pointerMap&&this.cancel(t);var i=vn.prepareEvent(t,this.dispatcher);this.pointerMap[vn.POINTER_ID.toString()]=t,this.dispatcher.down(i,t)}},vn.prototype.mousemove=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.move(i,t)}},vn.prototype.mouseup=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=this.pointerMap[vn.POINTER_ID.toString()];if(i&&i.button===t.button){var s=vn.prepareEvent(t,this.dispatcher);this.dispatcher.up(s,t),this.cleanupMouse()}}},vn.prototype.mouseover=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.enterOver(i,t)}},vn.prototype.mouseout=function(t){if(!this.isEventSimulatedFromTouch_(t)){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.leaveOut(i,t)}},vn.prototype.cancel=function(t){var i=vn.prepareEvent(t,this.dispatcher);this.dispatcher.cancel(i,t),this.cleanupMouse()},vn.prototype.cleanupMouse=function(){delete this.pointerMap[vn.POINTER_ID.toString()]};var mn=function(t){dn.call(this,t,{MSPointerDown:this.msPointerDown,MSPointerMove:this.msPointerMove,MSPointerUp:this.msPointerUp,MSPointerOut:this.msPointerOut,MSPointerOver:this.msPointerOver,MSPointerCancel:this.msPointerCancel,MSGotPointerCapture:this.msGotPointerCapture,MSLostPointerCapture:this.msLostPointerCapture}),this.pointerMap=t.pointerMap,this.POINTER_TYPES=["","unavailable","touch","pen","mouse"]};Gs.inherits(mn,dn),mn.prototype.prepareEvent_=function(t){var i=t;return"number"==typeof t.pointerType&&((i=this.dispatcher.cloneEvent(t,t)).pointerType=this.POINTER_TYPES[t.pointerType]),i},mn.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},mn.prototype.msPointerDown=function(t){this.pointerMap[t.pointerId.toString()]=t;var i=this.prepareEvent_(t);this.dispatcher.down(i,t)},mn.prototype.msPointerMove=function(t){var i=this.prepareEvent_(t);this.dispatcher.move(i,t)},mn.prototype.msPointerUp=function(t){var i=this.prepareEvent_(t);this.dispatcher.up(i,t),this.cleanup(t.pointerId)},mn.prototype.msPointerOut=function(t){var i=this.prepareEvent_(t);this.dispatcher.leaveOut(i,t)},mn.prototype.msPointerOver=function(t){var i=this.prepareEvent_(t);this.dispatcher.enterOver(i,t)},mn.prototype.msPointerCancel=function(t){var i=this.prepareEvent_(t);this.dispatcher.cancel(i,t),this.cleanup(t.pointerId)},mn.prototype.msLostPointerCapture=function(t){var i=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(i)},mn.prototype.msGotPointerCapture=function(t){var i=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(i)};var pn=function(t){dn.call(this,t,{pointerdown:this.pointerDown,pointermove:this.pointerMove,pointerup:this.pointerUp,pointerout:this.pointerOut,pointerover:this.pointerOver,pointercancel:this.pointerCancel,gotpointercapture:this.gotPointerCapture,lostpointercapture:this.lostPointerCapture})};Gs.inherits(pn,dn),pn.prototype.pointerDown=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerMove=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerUp=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerOut=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerOver=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.pointerCancel=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.lostPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)},pn.prototype.gotPointerCapture=function(t){this.dispatcher.fireNativeEvent(t)};var _n=function(t,i,s){Vs.call(this,t),this.originalEvent=i;var h=s||{};this.buttons=this.getButtons_(h),this.pressure=this.getPressure_(h,this.buttons),this.bubbles="bubbles"in h&&h.bubbles,this.cancelable="cancelable"in h&&h.cancelable,this.view="view"in h?h.view:null,this.detail="detail"in h?h.detail:null,this.screenX="screenX"in h?h.screenX:0,this.screenY="screenY"in h?h.screenY:0,this.clientX="clientX"in h?h.clientX:0,this.clientY="clientY"in h?h.clientY:0,this.ctrlKey="ctrlKey"in h&&h.ctrlKey,this.altKey="altKey"in h&&h.altKey,this.shiftKey="shiftKey"in h&&h.shiftKey,this.metaKey="metaKey"in h&&h.metaKey,this.button="button"in h?h.button:0,this.relatedTarget="relatedTarget"in h?h.relatedTarget:null,this.pointerId="pointerId"in h?h.pointerId:0,this.width="width"in h?h.width:0,this.height="height"in h?h.height:0,this.tiltX="tiltX"in h?h.tiltX:0,this.tiltY="tiltY"in h?h.tiltY:0,this.pointerType="pointerType"in h?h.pointerType:"",this.hwTimestamp="hwTimestamp"in h?h.hwTimestamp:0,this.isPrimary="isPrimary"in h&&h.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})};Gs.inherits(_n,Vs),_n.prototype.getButtons_=function(t){var i;if(t.buttons||_n.HAS_BUTTONS)i=t.buttons;else switch(t.which){case 1:i=1;break;case 2:i=4;break;case 3:i=2;break;default:i=0}return i},_n.prototype.getPressure_=function(t,i){return t.pressure?t.pressure:i?.5:0},_n.HAS_BUTTONS=!1,function(){try{var t=new MouseEvent("click",{buttons:1});_n.HAS_BUTTONS=1===t.buttons}catch(t){}}();var gn=function(t,i){dn.call(this,t,{touchstart:this.touchstart,touchmove:this.touchmove,touchend:this.touchend,touchcancel:this.touchcancel}),this.pointerMap=t.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_=void 0};Gs.inherits(gn,dn),gn.DEDUP_TIMEOUT=2500,gn.CLICK_COUNT_TIMEOUT=200,gn.POINTER_TYPE="touch",gn.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},gn.prototype.setPrimaryTouch_=function(t){var i=Object.keys(this.pointerMap).length;(0===i||1===i&&vn.POINTER_ID.toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},gn.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},gn.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),gn.CLICK_COUNT_TIMEOUT)},gn.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},gn.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},gn.prototype.touchToPointer_=function(t,i){var s=this.dispatcher.cloneEvent(t,i);return s.pointerId=i.identifier+2,s.bubbles=!0,s.cancelable=!0,s.detail=this.clickCount_,s.button=0,s.buttons=1,s.width=i.webkitRadiusX||i.radiusX||0,s.height=i.webkitRadiusY||i.radiusY||0,s.pressure=i.webkitForce||i.force||.5,s.isPrimary=this.isPrimaryTouch_(i),s.pointerType=gn.POINTER_TYPE,s.clientX=i.clientX,s.clientY=i.clientY,s.screenX=i.screenX,s.screenY=i.screenY,s},gn.prototype.processTouches_=function(t,i){var s,h,n=Array.prototype.slice.call(t.changedTouches),e=n.length;function r(){t.preventDefault()}for(s=0;s<e;++s)(h=this.touchToPointer_(t,n[s])).preventDefault=r,i.call(this,t,h)},gn.prototype.findTouch_=function(t,i){for(var s=t.length,h=0;h<s;h++)if(t[h].identifier===i)return!0;return!1},gn.prototype.vacuumTouches_=function(t){var i=t.touches,s=Object.keys(this.pointerMap),h=s.length;if(h>=i.length){var n,e,r,a=[];for(n=0;n<h;++n)r=this.pointerMap[e=s[n]],e==vn.POINTER_ID||this.findTouch_(i,e-2)||a.push(r.out);for(n=0;n<a.length;++n)this.cancelOut_(t,a[n])}},gn.prototype.touchstart=function(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)},gn.prototype.overDown_=function(t,i){this.pointerMap[i.pointerId]={target:i.target,out:i,outTarget:i.target},this.dispatcher.over(i,t),this.dispatcher.enter(i,t),this.dispatcher.down(i,t)},gn.prototype.touchmove=function(t){t.preventDefault(),this.processTouches_(t,this.moveOverOut_)},gn.prototype.moveOverOut_=function(t,i){var s=i,h=this.pointerMap[s.pointerId];if(h){var n=h.out,e=h.outTarget;this.dispatcher.move(s,t),n&&e!==s.target&&(n.relatedTarget=s.target,s.relatedTarget=e,n.target=e,s.target?(this.dispatcher.leaveOut(n,t),this.dispatcher.enterOver(s,t)):(s.target=e,s.relatedTarget=null,this.cancelOut_(t,s))),h.out=s,h.outTarget=s.target}},gn.prototype.touchend=function(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)},gn.prototype.upOut_=function(t,i){this.dispatcher.up(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},gn.prototype.touchcancel=function(t){this.processTouches_(t,this.cancelOut_)},gn.prototype.cancelOut_=function(t,i){this.dispatcher.cancel(i,t),this.dispatcher.out(i,t),this.dispatcher.leave(i,t),this.cleanUpPointer_(i)},gn.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},gn.prototype.dedupSynthMouse_=function(t){var i=this.mouseSource.lastTouches,s=t.changedTouches[0];if(this.isPrimaryTouch_(s)){var h=[s.clientX,s.clientY];i.push(h),setTimeout((function(){_h.remove(i,h)}),gn.DEDUP_TIMEOUT)}};var zn=function(t){qs.call(this),this.element_=t,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()};Gs.inherits(zn,qs),zn.prototype.registerSources=function(){if(tn.POINTER)this.registerSource("native",new pn(this));else if(tn.MSPOINTER)this.registerSource("ms",new mn(this));else{var t=new vn(this);this.registerSource("mouse",t),tn.TOUCH&&this.registerSource("touch",new gn(this,t))}this.register_()},zn.prototype.registerSource=function(t,i){var s=i,h=s.getEvents();h&&(h.forEach((function(t){var i=s.getHandlerForEvent(t);i&&(this.eventMap_[t]=i.bind(s))}),this),this.eventSourceList_.push(s))},zn.prototype.register_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.addEvents_(this.eventSourceList_[i].getEvents())},zn.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,i=0;i<t;i++)this.removeEvents_(this.eventSourceList_[i].getEvents())},zn.prototype.eventHandler_=function(t){var i=this.eventMap_[t.type];i&&i(t)},zn.prototype.addEvents_=function(t){t.forEach((function(t){Ws.listen(this.element_,t,this.eventHandler_,this)}),this)},zn.prototype.removeEvents_=function(t){t.forEach((function(t){Ws.unlisten(this.element_,t,this.eventHandler_,this)}),this)},zn.prototype.cloneEvent=function(t,i){for(var s,h={},n=0,e=zn.CLONE_PROPS.length;n<e;n++)h[s=zn.CLONE_PROPS[n][0]]=t[s]||i[s]||zn.CLONE_PROPS[n][1];return h},zn.prototype.down=function(t,i){this.fireEvent(fn,t,i)},zn.prototype.move=function(t,i){this.fireEvent(ln,t,i)},zn.prototype.up=function(t,i){this.fireEvent("pointerup",t,i)},zn.prototype.enter=function(t,i){t.bubbles=!1,this.fireEvent("pointerenter",t,i)},zn.prototype.leave=function(t,i){t.bubbles=!1,this.fireEvent("pointerleave",t,i)},zn.prototype.over=function(t,i){t.bubbles=!0,this.fireEvent("pointerover",t,i)},zn.prototype.out=function(t,i){t.bubbles=!0,this.fireEvent("pointerout",t,i)},zn.prototype.cancel=function(t,i){this.fireEvent("pointercancel",t,i)},zn.prototype.leaveOut=function(t,i){this.out(t,i),this.contains_(t.target,t.relatedTarget)||this.leave(t,i)},zn.prototype.enterOver=function(t,i){this.over(t,i),this.contains_(t.target,t.relatedTarget)||this.enter(t,i)},zn.prototype.contains_=function(t,i){return!(!t||!i)&&t.contains(i)},zn.prototype.makeEvent=function(t,i,s){return new _n(t,s,i)},zn.prototype.fireEvent=function(t,i,s){var h=this.makeEvent(t,i,s);this.dispatchEvent(h)},zn.prototype.fireNativeEvent=function(t){var i=this.makeEvent(t.type,t,t);this.dispatchEvent(i)},zn.prototype.wrapMouseEvent=function(t,i){return this.makeEvent(t,vn.prepareEvent(i,this),i)},zn.prototype.disposeInternal=function(){this.unregister_(),qs.prototype.disposeInternal.call(this)},zn.CLONE_PROPS=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]];var Mn=function(t,i){qs.call(this),this.map_=t,this.clickTimeoutId_=0,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*tn.DEVICE_PIXEL_RATIO:tn.DEVICE_PIXEL_RATIO,this.down_=null;var s=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new zn(s),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=Ws.listen(this.pointerEventHandler_,fn,this.handlePointerDown_,this),this.relayedListenerKey_=Ws.listen(this.pointerEventHandler_,ln,this.relayEvent_,this)};Gs.inherits(Mn,qs),Mn.prototype.emulateClick_=function(t){var i=new cn(un.CLICK,this.map_,t);this.dispatchEvent(i),0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=0,i=new cn(un.DBLCLICK,this.map_,t),this.dispatchEvent(i)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=0;var i=new cn(un.SINGLECLICK,this.map_,t);this.dispatchEvent(i)}.bind(this),250)},Mn.prototype.updateActivePointers_=function(t){var i=t;i.type==un.POINTERUP||i.type==un.POINTERCANCEL?delete this.trackedTouches_[i.pointerId]:i.type==un.POINTERDOWN&&(this.trackedTouches_[i.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},Mn.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var i=new cn(un.POINTERUP,this.map_,t);this.dispatchEvent(i),i.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(Ws.unlistenByKey),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},Mn.prototype.isMouseActionButton_=function(t){return 0===t.button},Mn.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var i=new cn(un.POINTERDOWN,this.map_,t);this.dispatchEvent(i),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new zn(document),this.dragListenerKeys_.push(Ws.listen(this.documentPointerEventHandler_,un.POINTERMOVE,this.handlePointerMove_,this),Ws.listen(this.documentPointerEventHandler_,un.POINTERUP,this.handlePointerUp_,this),Ws.listen(this.pointerEventHandler_,un.POINTERCANCEL,this.handlePointerUp_,this)))},Mn.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var i=new cn(un.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(i)}t.preventDefault()},Mn.prototype.relayEvent_=function(t){var i=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new cn(t.type,this.map_,t,i))},Mn.prototype.isMoving_=function(t){return Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},Mn.prototype.disposeInternal=function(){this.relayedListenerKey_&&(Ws.unlistenByKey(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(Ws.unlistenByKey(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Ws.unlistenByKey),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),qs.prototype.disposeInternal.call(this)};var wn="postrender",bn="layergroup",xn="size",yn="target",En="view",Sn=function(t,i){this.priorityFunction_=t,this.keyFunction_=i,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Sn.DROP=1/0,Sn.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,js.clear(this.queuedElements_)},Sn.prototype.dequeue=function(){var t=this.elements_,i=this.priorities_,s=t[0];1==t.length?(t.length=0,i.length=0):(t[0]=t.pop(),i[0]=i.pop(),this.siftUp_(0));var h=this.keyFunction_(s);return delete this.queuedElements_[h],s},Sn.prototype.enqueue=function(t){eh(!(this.keyFunction_(t)in this.queuedElements_),31);var i=this.priorityFunction_(t);return i!=Sn.DROP&&(this.elements_.push(t),this.priorities_.push(i),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Sn.prototype.getCount=function(){return this.elements_.length},Sn.prototype.getLeftChildIndex_=function(t){return 2*t+1},Sn.prototype.getRightChildIndex_=function(t){return 2*t+2},Sn.prototype.getParentIndex_=function(t){return t-1>>1},Sn.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Sn.prototype.isEmpty=function(){return 0===this.elements_.length},Sn.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Sn.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Sn.prototype.siftUp_=function(t){for(var i=this.elements_,s=this.priorities_,h=i.length,n=i[t],e=s[t],r=t;t<h>>1;){var a=this.getLeftChildIndex_(t),o=this.getRightChildIndex_(t),u=o<h&&s[o]<s[a]?o:a;i[t]=i[u],s[t]=s[u],t=u}i[t]=n,s[t]=e,this.siftDown_(r,t)},Sn.prototype.siftDown_=function(t,i){for(var s=this.elements_,h=this.priorities_,n=s[i],e=h[i];i>t;){var r=this.getParentIndex_(i);if(!(h[r]>e))break;s[i]=s[r],h[i]=h[r],i=r}s[i]=n,h[i]=e},Sn.prototype.reprioritize=function(){var t,i,s,h=this.priorityFunction_,n=this.elements_,e=this.priorities_,r=0,a=n.length;for(i=0;i<a;++i)(s=h(t=n[i]))==Sn.DROP?delete this.queuedElements_[this.keyFunction_(t)]:(e[r]=s,n[r++]=t);n.length=r,e.length=r,this.heapify_()};var Pn=function(t,i){Sn.call(this,(function(i){return t.apply(null,i)}),(function(t){return t[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}};Gs.inherits(Pn,Sn),Pn.prototype.enqueue=function(t){var i=Sn.prototype.enqueue.call(this,t);return i&&Ws.listen(t[0],Bs,this.handleTileChange,this),i},Pn.prototype.getTilesLoading=function(){return this.tilesLoading_},Pn.prototype.handleTileChange=function(t){var i=t.target,s=i.getState();if(2===s||3===s||4===s||5===s){Ws.unlisten(i,Bs,this.handleTileChange,this);var h=i.getKey();h in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[h],--this.tilesLoading_),this.tileChangeCallback_()}},Pn.prototype.loadMoreTiles=function(t,i){for(var s,h,n,e=0,r=!1;this.tilesLoading_<t&&e<i&&this.getCount()>0;)n=(h=this.dequeue()[0]).getKey(),5===(s=h.getState())?r=!0:0!==s||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++e,h.load());0===e&&r&&this.tileChangeCallback_()};var Gn={createExtent:function(t){return function(i){return i?[rh.clamp(i[0],t[0],t[2]),rh.clamp(i[1],t[1],t[3])]:void 0}},none:function(t){return t}},kn=function(t){return function(i,s,h){if(void 0!==i){var n=_h.linearFindNearest(t,i,h);n=rh.clamp(n+s,0,t.length-1);var e=Math.floor(n);return n!=e&&e<t.length-1?t[e]/Math.pow(t[e]/t[e+1],n-e):t[e]}}},Nn=function(t,i,s){return function(h,n,e){if(void 0!==h){var r=-e/2+.5,a=Math.floor(Math.log(i/h)/Math.log(t)+r),o=Math.max(a+n,0);return void 0!==s&&(o=Math.min(o,s)),i/Math.pow(t,o)}}},Cn={disable:function(t){return void 0!==t?0:void 0},none:function(t,i){return void 0!==t?t+i:void 0},createSnapToN:function(t){var i=2*Math.PI/t;return function(t,s){return void 0!==t?t=Math.floor((t+s)/i+.5)*i:void 0}},createSnapToZero:function(t){var i=t||rh.toRadians(5);return function(t,s){return void 0!==t?Math.abs(t+s)<=i?0:t+s:void 0}}},An="center",Rn="resolution",In="rotation",Tn=function(t,i,s){var h=void 0!==s?t.toFixed(s):""+t,n=h.indexOf(".");return(n=-1===n?h.length:n)>i?h:new Array(1+i-n).join("0")+h},On={add:function(t,i){return t[0]+=i[0],t[1]+=i[1],t},closestOnCircle:function(t,i){var s=i.getRadius(),h=i.getCenter(),n=h[0],e=h[1],r=t[0]-n,a=t[1]-e;0===r&&0===a&&(r=1);var o=Math.sqrt(r*r+a*a);return[n+s*r/o,e+s*a/o]},closestOnSegment:function(t,i){var s,h,n=i[0],e=i[1],r=n[0],a=n[1],o=e[0],u=e[1],c=o-r,l=u-a,f=0===c&&0===l?0:(c*(t[0]-r)+l*(t[1]-a))/(c*c+l*l||0);return f<=0?(s=r,h=a):f>=1?(s=o,h=u):(s=r+f*c,h=a+f*l),[s,h]},createStringXY:function(t){return function(i){return On.toStringXY(i,t)}},degreesToStringHDMS:function(t,i,s){var h=rh.modulo(i+180,360)-180,n=Math.abs(3600*h),e=s||0,r=Math.pow(10,e),a=Math.floor(n/3600),o=Math.floor((n-3600*a)/60),u=n-3600*a-60*o;return(u=Math.ceil(u*r)/r)>=60&&(u=0,o+=1),o>=60&&(o=0,a+=1),a+"° "+Tn(o,2)+"′ "+Tn(u,2,e)+"″"+(0==h?"":" "+t.charAt(h<0?1:0))},format:function(t,i,s){return t?i.replace("{x}",t[0].toFixed(s)).replace("{y}",t[1].toFixed(s)):""},equals:function(t,i){for(var s=!0,h=t.length-1;h>=0;--h)if(t[h]!=i[h]){s=!1;break}return s},rotate:function(t,i){var s=Math.cos(i),h=Math.sin(i),n=t[1]*s+t[0]*h;return t[0]=t[0]*s-t[1]*h,t[1]=n,t},scale:function(t,i){return t[0]*=i,t[1]*=i,t},sub:function(t,i){return t[0]-=i[0],t[1]-=i[1],t},squaredDistance:function(t,i){var s=t[0]-i[0],h=t[1]-i[1];return s*s+h*h},distance:function(t,i){return Math.sqrt(On.squaredDistance(t,i))},squaredDistanceToSegment:function(t,i){return On.squaredDistance(t,On.closestOnSegment(t,i))},toStringHDMS:function(t,i){return t?On.degreesToStringHDMS("NS",t[1],i)+" "+On.degreesToStringHDMS("EW",t[0],i):""},toStringXY:function(t,i){return On.format(t,"{x}, {y}",i)}},Fn={easeIn:function(t){return Math.pow(t,3)},easeOut:function(t){return 1-Fn.easeIn(1-t)},inAndOut:function(t){return 3*t*t-2*t*t*t},linear:function(t){return t},upAndDown:function(t){return t<.5?Fn.inAndOut(2*t):1-Fn.inAndOut(2*(t-.5))}},Ln=function(t){hh.call(this);var i=js.assign({},t);this.hints_=[0,0],this.animations_=[],this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=Th.createProjection(i.projection,"EPSG:3857"),this.applyOptions_(i)};Gs.inherits(Ln,hh),Ln.prototype.applyOptions_=function(t){var i={};i[An]=void 0!==t.center?t.center:null;var s=Ln.createResolutionConstraint_(t);this.maxResolution_=s.maxResolution,this.minResolution_=s.minResolution,this.zoomFactor_=s.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=s.minZoom;var h=Ln.createCenterConstraint_(t),n=s.constraint,e=Ln.createRotationConstraint_(t);this.constraints_={center:h,resolution:n,rotation:e},void 0!==t.resolution?i[Rn]=t.resolution:void 0!==t.zoom&&(i[Rn]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(i[Rn]=rh.clamp(Number(this.getResolution()||i[Rn]),this.minResolution_,this.maxResolution_))),i[In]=void 0!==t.rotation?t.rotation:0,this.setProperties(i),this.options_=t},Ln.prototype.getUpdatedOptions_=function(t){var i=js.assign({},this.options_);return void 0!==i.resolution?i.resolution=this.getResolution():i.zoom=this.getZoom(),i.center=this.getCenter(),i.rotation=this.getRotation(),js.assign({},i,t)},Ln.prototype.animate=function(t){var i,s=arguments.length;if(s>1&&"function"==typeof arguments[s-1]&&(i=arguments[s-1],--s),!this.isDef()){var h=arguments[s-1];return h.center&&this.setCenter(h.center),void 0!==h.zoom&&this.setZoom(h.zoom),void 0!==h.rotation&&this.setRotation(h.rotation),void(i&&i(!0))}for(var n=Date.now(),e=this.getCenter().slice(),r=this.getResolution(),a=this.getRotation(),o=[],u=0;u<s;++u){var c=arguments[u],l={start:n,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||Fn.inAndOut};if(c.center&&(l.sourceCenter=e,l.targetCenter=c.center,e=l.targetCenter),void 0!==c.zoom?(l.sourceResolution=r,l.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),r=l.targetResolution):c.resolution&&(l.sourceResolution=r,l.targetResolution=c.resolution,r=l.targetResolution),void 0!==c.rotation){l.sourceRotation=a;var f=rh.modulo(c.rotation-a+Math.PI,2*Math.PI)-Math.PI;l.targetRotation=a+f,a=l.targetRotation}l.callback=i,Ln.isNoopAnimation(l)?l.complete=!0:n+=l.duration,o.push(l)}this.animations_.push(o),this.setHint(0,1),this.updateAnimations_()},Ln.prototype.getAnimating=function(){return this.hints_[0]>0},Ln.prototype.getInteracting=function(){return this.hints_[1]>0},Ln.prototype.cancelAnimations=function(){this.setHint(0,-this.hints_[0]);for(var t=0,i=this.animations_.length;t<i;++t){var s=this.animations_[t];s[0].callback&&s[0].callback(!1)}this.animations_.length=0},Ln.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),i=!1,s=this.animations_.length-1;s>=0;--s){for(var h=this.animations_[s],n=!0,e=0,r=h.length;e<r;++e){var a=h[e];if(!a.complete){var o=a.duration>0?(t-a.start)/a.duration:1;o>=1?(a.complete=!0,o=1):n=!1;var u=a.easing(o);if(a.sourceCenter){var c=a.sourceCenter[0],l=a.sourceCenter[1];this.set(An,[c+u*(a.targetCenter[0]-c),l+u*(a.targetCenter[1]-l)])}if(a.sourceResolution&&a.targetResolution){var f=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(An,this.calculateCenterZoom(f,a.anchor)),this.set(Rn,f)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var d=1===u?rh.modulo(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(An,this.calculateCenterRotate(d,a.anchor)),this.set(In,d)}if(i=!0,!a.complete)break}}if(n){this.animations_[s]=null,this.setHint(0,-1);var v=h[0].callback;v&&v(!0)}}this.animations_=this.animations_.filter(Boolean),i&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},Ln.prototype.calculateCenterRotate=function(t,i){var s,h=this.getCenter();return void 0!==h&&(On.rotate(s=[h[0]-i[0],h[1]-i[1]],t-this.getRotation()),On.add(s,i)),s},Ln.prototype.calculateCenterZoom=function(t,i){var s,h=this.getCenter(),n=this.getResolution();return void 0!==h&&void 0!==n&&(s=[i[0]-t*(i[0]-h[0])/n,i[1]-t*(i[1]-h[1])/n]),s},Ln.prototype.getSizeFromViewport_=function(){var t=[100,100],i='.ol-viewport[data-view="'+Gs.getUid(this)+'"]',s=document.querySelector(i);if(s){var h=getComputedStyle(s);t[0]=parseInt(h.width,10),t[1]=parseInt(h.height,10)}return t},Ln.prototype.constrainCenter=function(t){return this.constraints_.center(t)},Ln.prototype.constrainResolution=function(t,i,s){return this.constraints_.resolution(t,i||0,s||0)},Ln.prototype.constrainRotation=function(t,i){return this.constraints_.rotation(t,i||0)},Ln.prototype.getCenter=function(){return this.get(An)},Ln.prototype.getConstraints=function(){return this.constraints_},Ln.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},Ln.prototype.calculateExtent=function(t){var i=t||this.getSizeFromViewport_(),s=this.getCenter();eh(s,1);var h=this.getResolution();eh(void 0!==h,2);var n=this.getRotation();return eh(void 0!==n,3),zh.getForViewAndSize(s,h,n,i)},Ln.prototype.getMaxResolution=function(){return this.maxResolution_},Ln.prototype.getMinResolution=function(){return this.minResolution_},Ln.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},Ln.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},Ln.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},Ln.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},Ln.prototype.getProjection=function(){return this.projection_},Ln.prototype.getResolution=function(){return this.get(Rn)},Ln.prototype.getResolutions=function(){return this.resolutions_},Ln.prototype.getResolutionForExtent=function(t,i){var s=i||this.getSizeFromViewport_(),h=zh.getWidth(t)/s[0],n=zh.getHeight(t)/s[1];return Math.max(h,n)},Ln.prototype.getResolutionForValueFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return s/Math.pow(i,t*h)}},Ln.prototype.getRotation=function(){return this.get(In)},Ln.prototype.getValueForResolutionFunction=function(t){var i=t||2,s=this.maxResolution_,h=Math.log(s/this.minResolution_)/Math.log(i);return function(t){return Math.log(s/t)/Math.log(i)/h}},Ln.prototype.getState=function(){var t=this.getCenter(),i=this.getProjection(),s=this.getResolution(),h=this.getRotation();return{center:t.slice(),projection:void 0!==i?i:null,resolution:s,rotation:h,zoom:this.getZoom()}},Ln.prototype.getZoom=function(){var t,i=this.getResolution();return void 0!==i&&(t=this.getZoomForResolution(i)),t},Ln.prototype.getZoomForResolution=function(t){var i,s,h=this.minZoom_||0;if(this.resolutions_){var n=_h.linearFindNearest(this.resolutions_,t,1);h=n,i=this.resolutions_[n],s=n==this.resolutions_.length-1?2:i/this.resolutions_[n+1]}else i=this.maxResolution_,s=this.zoomFactor_;return h+Math.log(i/t)/Math.log(s)},Ln.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},Ln.prototype.fit=function(t,i){var s,h=i||{},n=h.size;n||(n=this.getSizeFromViewport_()),t instanceof Lh?t.getType()===mh?(t=t.getExtent(),(s=$h.fromExtent(t)).rotate(this.getRotation(),zh.getCenter(t))):s=t:(eh(Array.isArray(t),24),eh(!zh.isEmpty(t),25),s=$h.fromExtent(t));var e,r=void 0!==h.padding?h.padding:[0,0,0,0],a=void 0===h.constrainResolution||h.constrainResolution,o=void 0!==h.nearest&&h.nearest;e=void 0!==h.minResolution?h.minResolution:void 0!==h.maxZoom?this.constrainResolution(this.maxResolution_,h.maxZoom-this.minZoom_,0):0;for(var u=s.getFlatCoordinates(),c=this.getRotation(),l=Math.cos(-c),f=Math.sin(-c),d=1/0,v=1/0,m=-1/0,p=-1/0,_=s.getStride(),g=0,z=u.length;g<z;g+=_){var M=u[g]*l-u[g+1]*f,w=u[g]*f+u[g+1]*l;d=Math.min(d,M),v=Math.min(v,w),m=Math.max(m,M),p=Math.max(p,w)}var b=this.getResolutionForExtent([d,v,m,p],[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);if(b=isNaN(b)?e:Math.max(b,e),a){var x=this.constrainResolution(b,0,0);!o&&x<b&&(x=this.constrainResolution(x,-1,0)),b=x}var y=(d+m)/2,E=(v+p)/2,S=[(y+=(r[1]-r[3])/2*b)*l-(E+=(r[0]-r[2])/2*b)*(f=-f),E*l+y*f],P=h.callback?h.callback:Gs.nullFunction;void 0!==h.duration?this.animate({resolution:b,center:S,duration:h.duration,easing:h.easing},P):(this.setResolution(b),this.setCenter(S),setTimeout(P.bind(void 0,!0),0))},Ln.prototype.centerOn=function(t,i,s){var h=this.getRotation(),n=Math.cos(-h),e=Math.sin(-h),r=t[0]*n-t[1]*e,a=t[1]*n+t[0]*e,o=this.getResolution();this.setCenter([(r+=(i[0]/2-s[0])*o)*n-(a+=(s[1]-i[1]/2)*o)*(e=-e),a*n+r*e])},Ln.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},Ln.prototype.rotate=function(t,i){if(void 0!==i){var s=this.calculateCenterRotate(t,i);this.setCenter(s)}this.setRotation(t)},Ln.prototype.setCenter=function(t){this.set(An,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setHint=function(t,i){return this.hints_[t]+=i,this.changed(),this.hints_[t]},Ln.prototype.setResolution=function(t){this.set(Rn,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setRotation=function(t){this.set(In,t),this.getAnimating()&&this.cancelAnimations()},Ln.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},Ln.createCenterConstraint_=function(t){return void 0!==t.extent?Gn.createExtent(t.extent):Gn.none},Ln.createResolutionConstraint_=function(t){var i,s,h,n=void 0!==t.minZoom?t.minZoom:Gs.DEFAULT_MIN_ZOOM,e=void 0!==t.maxZoom?t.maxZoom:28,r=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;s=a[n],h=void 0!==a[e]?a[e]:a[a.length-1],i=kn(a)}else{var o=Th.createProjection(t.projection,"EPSG:3857"),u=o.getExtent(),c=(u?Math.max(zh.getWidth(u),zh.getHeight(u)):360*Th.METERS_PER_UNIT[Gh.DEGREES]/o.getMetersPerUnit())/Gs.DEFAULT_TILE_SIZE/Math.pow(2,Gs.DEFAULT_MIN_ZOOM),l=c/Math.pow(2,28-Gs.DEFAULT_MIN_ZOOM);void 0!==(s=t.maxResolution)?n=0:s=c/Math.pow(r,n),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?s/Math.pow(r,e):c/Math.pow(r,e):l),e=n+Math.floor(Math.log(s/h)/Math.log(r)),h=s/Math.pow(r,e-n),i=Nn(r,s,e-n)}return{constraint:i,maxResolution:s,minResolution:h,minZoom:n,zoomFactor:r}},Ln.createRotationConstraint_=function(t){if(void 0===t.enableRotation||t.enableRotation){var i=t.constrainRotation;return void 0===i||!0===i?Cn.createSnapToZero():!1===i?Cn.none:"number"==typeof i?Cn.createSnapToN(i):Cn.none}return Cn.disable},Ln.isNoopAnimation=function(t){return!(t.sourceCenter&&t.targetCenter&&!On.equals(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation};var Dn=function(t,i){var s=document.createElement("CANVAS");return t&&(s.width=t),i&&(s.height=i),s.getContext("2d")},jn=function(t){var i=t.offsetWidth,s=getComputedStyle(t);return i+(parseInt(s.marginLeft,10)+parseInt(s.marginRight,10))},Wn=function(t){var i=t.offsetHeight,s=getComputedStyle(t);return i+(parseInt(s.marginTop,10)+parseInt(s.marginBottom,10))},Un=function(t,i){var s=i.parentNode;s&&s.replaceChild(t,i)},Vn=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},qn=function(t){for(;t.lastChild;)t.removeChild(t.lastChild)},Bn="opacity",Xn="visible",Hn="extent",Yn="zIndex",Jn="maxResolution",Zn="minResolution",Kn="source",$n=function(t){hh.call(this);var i=js.assign({},t);i[Bn]=void 0!==t.opacity?t.opacity:1,i[Xn]=void 0===t.visible||t.visible,i[Yn]=void 0!==t.zIndex?t.zIndex:0,i[Jn]=void 0!==t.maxResolution?t.maxResolution:1/0,i[Zn]=void 0!==t.minResolution?t.minResolution:0,this.setProperties(i),this.state_={layer:this,managed:!0}};Gs.inherits($n,hh),$n.prototype.getType=function(){return this.type},$n.prototype.getLayerState=function(){return this.state_.opacity=rh.clamp(this.getOpacity(),0,1),this.state_.sourceState=this.getSourceState(),this.state_.visible=this.getVisible(),this.state_.extent=this.getExtent(),this.state_.zIndex=this.getZIndex(),this.state_.maxResolution=this.getMaxResolution(),this.state_.minResolution=Math.max(this.getMinResolution(),0),this.state_},$n.prototype.getLayersArray=function(){},$n.prototype.getLayerStatesArray=function(){},$n.prototype.getExtent=function(){return this.get(Hn)},$n.prototype.getMaxResolution=function(){return this.get(Jn)},$n.prototype.getMinResolution=function(){return this.get(Zn)},$n.prototype.getOpacity=function(){return this.get(Bn)},$n.prototype.getSourceState=function(){},$n.prototype.getVisible=function(){return this.get(Xn)},$n.prototype.getZIndex=function(){return this.get(Yn)},$n.prototype.setExtent=function(t){this.set(Hn,t)},$n.prototype.setMaxResolution=function(t){this.set(Jn,t)},$n.prototype.setMinResolution=function(t){this.set(Zn,t)},$n.prototype.setOpacity=function(t){this.set(Bn,t)},$n.prototype.setVisible=function(t){this.set(Xn,t)},$n.prototype.setZIndex=function(t){this.set(Yn,t)};var Qn="ready",te=function(t){var i=t||{},s=js.assign({},i);delete s.layers;var h=i.layers;$n.call(this,s),this.layersListenerKeys_=[],this.listenerKeys_={},Ws.listen(this,hh.getChangeEventType(te.Property_.LAYERS),this.handleLayersChanged_,this),h?Array.isArray(h)?h=new rn(h.slice(),{unique:!0}):eh(h instanceof rn,43):h=new rn(void 0,{unique:!0}),this.setLayers(h)};Gs.inherits(te,$n),te.prototype.handleLayerChange_=function(){this.changed()},te.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(Ws.unlistenByKey),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var i in this.layersListenerKeys_.push(Ws.listen(t,nn,this.handleLayersAdd_,this),Ws.listen(t,en,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[i].forEach(Ws.unlistenByKey);js.clear(this.listenerKeys_);var s,h,n,e=t.getArray();for(s=0,h=e.length;s<h;s++)this.listenerKeys_[Gs.getUid(n=e[s]).toString()]=[Ws.listen(n,Ds,this.handleLayerChange_,this),Ws.listen(n,Bs,this.handleLayerChange_,this)];this.changed()},te.prototype.handleLayersAdd_=function(t){var i=t.element,s=Gs.getUid(i).toString();this.listenerKeys_[s]=[Ws.listen(i,Ds,this.handleLayerChange_,this),Ws.listen(i,Bs,this.handleLayerChange_,this)],this.changed()},te.prototype.handleLayersRemove_=function(t){var i=Gs.getUid(t.element).toString();this.listenerKeys_[i].forEach(Ws.unlistenByKey),delete this.listenerKeys_[i],this.changed()},te.prototype.getLayers=function(){return this.get(te.Property_.LAYERS)},te.prototype.setLayers=function(t){this.set(te.Property_.LAYERS,t)},te.prototype.getLayersArray=function(t){var i=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(i)})),i},te.prototype.getLayerStatesArray=function(t){var i=void 0!==t?t:[],s=i.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(i)}));var h,n,e,r=this.getLayerState();for(h=s,n=i.length;h<n;h++)(e=i[h]).opacity*=r.opacity,e.visible=e.visible&&r.visible,e.maxResolution=Math.min(e.maxResolution,r.maxResolution),e.minResolution=Math.max(e.minResolution,r.minResolution),void 0!==r.extent&&(e.extent=void 0!==e.extent?zh.getIntersection(e.extent,r.extent):r.extent);return i},te.prototype.getSourceState=function(){return Qn},te.Property_={LAYERS:"layers"};var ie="MAP_RENDERER",se="LAYER_RENDERER",he={mapRendererPlugins_:[],getMapRendererPlugins:function(){return he.mapRendererPlugins_},layerRendererPlugins_:[],getLayerRendererPlugins:function(){return he.layerRendererPlugins_},register:function(t,i){switch(t){case ie:he.mapRendererPlugins_.push(i);break;case se:he.layerRendererPlugins_.push(i);break;default:throw new Error("Unsupported plugin type: "+t)}},registerMultiple:function(t,i){for(var s=0,h=i.length;s<h;++s)he.register(t,i[s])}},ne="canvas",ee="webgl",re=function(t){return t[0]>0&&t[1]>0},ae=function(t,i,s){return void 0===s&&(s=[0,0]),s[0]=t[0]*i+.5|0,s[1]=t[1]*i+.5|0,s},oe=function(t,i){return Array.isArray(t)?t:(void 0===i?i=[t,t]:i[0]=i[1]=t,i)},ue=function(t){hh.call(this);var i=ue.createOptionsInternal(t);this.loadTilesWhileAnimating_=void 0!==t.loadTilesWhileAnimating&&t.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==t.loadTilesWhileInteracting&&t.loadTilesWhileInteracting,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:tn.DEVICE_PIXEL_RATIO,this.logos_=i.logos,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=Oh.create(),this.pixelToCoordinateTransform_=Oh.create(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("DIV"),this.viewport_.className="ol-viewport"+(tn.TOUCH?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("DIV"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("DIV"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var s=[Hs,Ys,"mousedown","touchstart","MSPointerDown",un.POINTERDOWN,Qs,ih],h=0,n=s.length;h<n;++h)Ws.listen(this.overlayContainerStopEvent_,s[h],Vs.stopPropagation);for(var e in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new Mn(this,t.moveTolerance),un)Ws.listen(this.mapBrowserEventHandler_,un[e],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,Ws.listen(this.viewport_,ih,this.handleBrowserEvent,this),Ws.listen(this.viewport_,Qs,this.handleBrowserEvent,this),this.controls=i.controls||new rn,this.interactions=i.interactions||new rn,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=i.mapRendererPlugin.create(this.viewport_,this),this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new Pn(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},Ws.listen(this,hh.getChangeEventType(bn),this.handleLayerGroupChanged_,this),Ws.listen(this,hh.getChangeEventType(En),this.handleViewChanged_,this),Ws.listen(this,hh.getChangeEventType(xn),this.handleSizeChanged_,this),Ws.listen(this,hh.getChangeEventType(yn),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach((function(t){t.setMap(this)}),this),Ws.listen(this.controls,nn,(function(t){t.element.setMap(this)}),this),Ws.listen(this.controls,en,(function(t){t.element.setMap(null)}),this),this.interactions.forEach((function(t){t.setMap(this)}),this),Ws.listen(this.interactions,nn,(function(t){t.element.setMap(this)}),this),Ws.listen(this.interactions,en,(function(t){t.element.setMap(null)}),this),this.overlays_.forEach(this.addOverlayInternal_,this),Ws.listen(this.overlays_,nn,(function(t){this.addOverlayInternal_(t.element)}),this),Ws.listen(this.overlays_,en,(function(t){var i=t.element.getId();void 0!==i&&delete this.overlayIdIndex_[i.toString()],t.element.setMap(null)}),this)};Gs.inherits(ue,hh),ue.prototype.addControl=function(t){this.getControls().push(t)},ue.prototype.addInteraction=function(t){this.getInteractions().push(t)},ue.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},ue.prototype.addOverlay=function(t){this.getOverlays().push(t)},ue.prototype.addOverlayInternal_=function(t){var i=t.getId();void 0!==i&&(this.overlayIdIndex_[i.toString()]=t),t.setMap(this)},ue.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),Ws.unlisten(this.viewport_,ih,this.handleBrowserEvent,this),Ws.unlisten(this.viewport_,Qs,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(window.removeEventListener(th,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),hh.prototype.disposeInternal.call(this)},ue.prototype.forEachFeatureAtPixel=function(t,i,s){if(this.frameState_){var h=this.getCoordinateFromPixel(t);return this.renderer_.forEachFeatureAtCoordinate(h,this.frameState_,void 0!==(s=void 0!==s?s:{}).hitTolerance?s.hitTolerance*this.frameState_.pixelRatio:0,i,null,void 0!==s.layerFilter?s.layerFilter:xh.TRUE,null)}},ue.prototype.getFeaturesAtPixel=function(t,i){var s=null;return this.forEachFeatureAtPixel(t,(function(t){s||(s=[]),s.push(t)}),i),s},ue.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.frameState_)return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,void 0!==s?s:null,void 0!==h?h:xh.TRUE,void 0!==n?n:null)},ue.prototype.hasFeatureAtPixel=function(t,i){if(!this.frameState_)return!1;var s=this.getCoordinateFromPixel(t);return this.renderer_.hasFeatureAtCoordinate(s,this.frameState_,void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,void 0!==i.layerFilter?i.layerFilter:xh.TRUE,null)},ue.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},ue.prototype.getEventPixel=function(t){var i=this.viewport_.getBoundingClientRect(),s=t.changedTouches?t.changedTouches[0]:t;return[s.clientX-i.left,s.clientY-i.top]},ue.prototype.getTarget=function(){return this.get(yn)},ue.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},ue.prototype.getCoordinateFromPixel=function(t){var i=this.frameState_;return i?Oh.apply(i.pixelToCoordinateTransform,t.slice()):null},ue.prototype.getControls=function(){return this.controls},ue.prototype.getOverlays=function(){return this.overlays_},ue.prototype.getOverlayById=function(t){var i=this.overlayIdIndex_[t.toString()];return void 0!==i?i:null},ue.prototype.getInteractions=function(){return this.interactions},ue.prototype.getLayerGroup=function(){return this.get(bn)},ue.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},ue.prototype.getPixelFromCoordinate=function(t){var i=this.frameState_;return i?Oh.apply(i.coordinateToPixelTransform,t.slice(0,2)):null},ue.prototype.getRenderer=function(){return this.renderer_},ue.prototype.getSize=function(){return this.get(xn)},ue.prototype.getView=function(){return this.get(En)},ue.prototype.getViewport=function(){return this.viewport_},ue.prototype.getOverlayContainer=function(){return this.overlayContainer_},ue.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},ue.prototype.getTilePriority=function(t,i,s,h){var n=this.frameState_;if(!n||!(i in n.wantedTiles))return Sn.DROP;if(!n.wantedTiles[i][t.getKey()])return Sn.DROP;var e=s[0]-n.focus[0],r=s[1]-n.focus[1];return 65536*Math.log(h)+Math.sqrt(e*e+r*r)/h},ue.prototype.handleBrowserEvent=function(t,i){var s=new on(i||t.type,this,t);this.handleMapBrowserEvent(s)},ue.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var i,s=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(i=s.length-1;i>=0;i--){var h=s[i];if(h.getActive()&&!h.handleEvent(t))break}}},ue.prototype.handlePostRender=function(){var t=this.frameState_,i=this.tileQueue_;if(!i.isEmpty()){var s=16,h=s;if(t){var n=t.viewHints;n[0]&&(s=this.loadTilesWhileAnimating_?8:0,h=2),n[1]&&(s=this.loadTilesWhileInteracting_?8:0,h=2)}i.getTilesLoading()<s&&(i.reprioritize(),i.loadMoreTiles(s,h))}var e,r,a=this.postRenderFunctions_;for(e=0,r=a.length;e<r;++e)a[e](this,t);a.length=0},ue.prototype.handleSizeChanged_=function(){this.render()},ue.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var i=0,s=this.keyHandlerKeys_.length;i<s;++i)Ws.unlistenByKey(this.keyHandlerKeys_[i]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var h=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[Ws.listen(h,Zs,this.handleBrowserEvent,this),Ws.listen(h,Ks,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(th,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Vn(this.viewport_),void 0!==this.handleResize_&&(window.removeEventListener(th,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},ue.prototype.handleTileChange_=function(){this.render()},ue.prototype.handleViewPropertyChanged_=function(){this.render()},ue.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(Ws.unlistenByKey(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Ws.unlistenByKey(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",Gs.getUid(t)),this.viewPropertyListenerKey_=Ws.listen(t,Ds,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Ws.listen(t,Bs,this.handleViewPropertyChanged_,this)),this.render()},ue.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Ws.unlistenByKey),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[Ws.listen(t,Ds,this.render,this),Ws.listen(t,Bs,this.render,this)]),this.render()},ue.prototype.isRendered=function(){return!!this.frameState_},ue.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},ue.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},ue.prototype.removeControl=function(t){return this.getControls().remove(t)},ue.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},ue.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},ue.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},ue.prototype.renderFrame_=function(t){var i,s,h,n=this.getSize(),e=this.getView(),r=zh.createEmpty(),a=this.frameState_,o=null;if(void 0!==n&&re(n)&&e&&e.isDef()){var u=e.getHints(this.frameState_?this.frameState_.viewHints:void 0),c=this.getLayerGroup().getLayerStatesArray(),l={};for(i=0,s=c.length;i<s;++i)l[Gs.getUid(c[i].layer)]=c[i];var f=(h=e.getState()).center,d=h.resolution/this.pixelRatio_;f[0]=Math.round(f[0]/d)*d,f[1]=Math.round(f[1]/d)*d,o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:r,focus:this.focus_?this.focus_:f,index:this.frameIndex_++,layerStates:l,layerStatesArray:c,logos:js.assign({},this.logos_),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:h,viewHints:u,wantedTiles:{}}}o&&(o.extent=zh.getForViewAndSize(h.center,h.resolution,h.rotation,o.size,r)),this.frameState_=o,this.renderer_.renderFrame(o),o&&(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),a&&(!this.previousExtent_||!zh.isEmpty(this.previousExtent_)&&!zh.equals(o.extent,this.previousExtent_))&&(this.dispatchEvent(new an("movestart",this,a)),this.previousExtent_=zh.createOrUpdateEmpty(this.previousExtent_)),this.previousExtent_&&!o.viewHints[0]&&!o.viewHints[1]&&!zh.equals(o.extent,this.previousExtent_)&&(this.dispatchEvent(new an("moveend",this,o)),zh.clone(o.extent,this.previousExtent_))),this.dispatchEvent(new an(wn,this,o)),setTimeout(this.handlePostRender.bind(this),0)},ue.prototype.setLayerGroup=function(t){this.set(bn,t)},ue.prototype.setSize=function(t){this.set(xn,t)},ue.prototype.setTarget=function(t){this.set(yn,t)},ue.prototype.setView=function(t){this.set(En,t)},ue.prototype.skipFeature=function(t){var i=Gs.getUid(t).toString();this.skippedFeatureUids_[i]=!0,this.render()},ue.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var i=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth)])}else this.setSize(void 0)},ue.prototype.unskipFeature=function(t){var i=Gs.getUid(t).toString();delete this.skippedFeatureUids_[i],this.render()},ue.DEFAULT_RENDERER_TYPES=[ne,ee],ue.LOGO_URL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAAHGAAABxgEXwfpGAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAAAhNQTFRF////AP//AICAgP//AFVVQECA////K1VVSbbbYL/fJ05idsTYJFtbbcjbJllmZszWWMTOIFhoHlNiZszTa9DdUcHNHlNlV8XRIVdiasrUHlZjIVZjaMnVH1RlIFRkH1RkH1ZlasvYasvXVsPQH1VkacnVa8vWIVZjIFRjVMPQa8rXIVVkXsXRsNveIFVkIFZlIVVj3eDeh6GmbMvXH1ZkIFRka8rWbMvXIFVkIFVjIFVkbMvWH1VjbMvWIFVlbcvWIFVla8vVIFVkbMvWbMvVH1VkbMvWIFVlbcvWIFVkbcvVbMvWjNPbIFVkU8LPwMzNIFVkbczWIFVkbsvWbMvXIFVkRnB8bcvW2+TkW8XRIFVkIlZlJVloJlpoKlxrLl9tMmJwOWd0Omh1RXF8TneCT3iDUHiDU8LPVMLPVcLPVcPQVsPPVsPQV8PQWMTQWsTQW8TQXMXSXsXRX4SNX8bSYMfTYcfTYsfTY8jUZcfSZsnUaIqTacrVasrVa8jTa8rWbI2VbMvWbcvWdJObdcvUdszUd8vVeJaee87Yfc3WgJyjhqGnitDYjaarldPZnrK2oNbborW5o9bbo9fbpLa6q9ndrL3ArtndscDDutzfu8fJwN7gwt7gxc/QyuHhy+HizeHi0NfX0+Pj19zb1+Tj2uXk29/e3uLg3+Lh3+bl4uXj4ufl4+fl5Ofl5ufl5ujm5+jmySDnBAAAAFp0Uk5TAAECAgMEBAYHCA0NDg4UGRogIiMmKSssLzU7PkJJT1JTVFliY2hrdHZ3foSFhYeJjY2QkpugqbG1tre5w8zQ09XY3uXn6+zx8vT09vf4+Pj5+fr6/P39/f3+gz7SsAAAAVVJREFUOMtjYKA7EBDnwCPLrObS1BRiLoJLnte6CQy8FLHLCzs2QUG4FjZ5GbcmBDDjxJBXDWxCBrb8aM4zbkIDzpLYnAcE9VXlJSWlZRU13koIeW57mGx5XjoMZEUqwxWYQaQbSzLSkYGfKFSe0QMsX5WbjgY0YS4MBplemI4BdGBW+DQ11eZiymfqQuXZIjqwyadPNoSZ4L+0FVM6e+oGI6g8a9iKNT3o8kVzNkzRg5lgl7p4wyRUL9Yt2jAxVh6mQCogae6GmflI8p0r13VFWTHBQ0rWPW7ahgWVcPm+9cuLoyy4kCJDzCm6d8PSFoh0zvQNC5OjDJhQopPPJqph1doJBUD5tnkbZiUEqaCnB3bTqLTFG1bPn71kw4b+GFdpLElKIzRxxgYgWNYc5SCENVHKeUaltHdXx0dZ8uBI1hJ2UUDgq82CM2MwKeibqAvSO7MCABq0wXEPiqWEAAAAAElFTkSuQmCC",ue.createOptionsInternal=function(t){var i=null;void 0!==t.keyboardEventTarget&&(i="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var s={},h={};if(void 0===t.logo||"boolean"==typeof t.logo&&t.logo)h[ue.LOGO_URL]="https://openlayers.org/";else{var n=t.logo;"string"==typeof n?h[n]="":n instanceof HTMLElement?h[Gs.getUid(n).toString()]=n:n&&(eh("string"==typeof n.href,44),eh("string"==typeof n.src,45),h[n.src]=n.href)}var e,r,a=t.layers instanceof te?t.layers:new te({layers:t.layers});s[bn]=a,s[yn]=t.target,s[En]=void 0!==t.view?t.view:new Ln,void 0!==t.renderer?(Array.isArray(t.renderer)?e=t.renderer:"string"==typeof t.renderer?e=[t.renderer]:eh(!1,46),e.indexOf("dom")>=0&&(e=e.concat(ue.DEFAULT_RENDERER_TYPES))):e=ue.DEFAULT_RENDERER_TYPES;var o,u,c,l=he.getMapRendererPlugins();t:for(var f=0,d=e.length;f<d;++f)for(var v=e[f],m=0,p=l.length;m<p;++m){var _=l[m];if(_.handles(v)){r=_;break t}}if(!r)throw new Error("Unable to create a map renderer for types: "+e.join(", "));return void 0!==t.controls&&(Array.isArray(t.controls)?o=new rn(t.controls.slice()):(eh(t.controls instanceof rn,47),o=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?u=new rn(t.interactions.slice()):(eh(t.interactions instanceof rn,48),u=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?c=new rn(t.overlays.slice()):(eh(t.overlays instanceof rn,49),c=t.overlays):c=new rn,{controls:o,interactions:u,keyboardEventTarget:i,logos:h,overlays:c,mapRendererPlugin:r,values:s}};var ce=function(t){hh.call(this),this.element=t.element?t.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=t.render?t.render:Gs.nullFunction,t.target&&this.setTarget(t.target)};Gs.inherits(ce,hh),ce.prototype.disposeInternal=function(){Vn(this.element),hh.prototype.disposeInternal.call(this)},ce.prototype.getMap=function(){return this.map_},ce.prototype.setMap=function(t){this.map_&&Vn(this.element);for(var i=0,s=this.listenerKeys.length;i<s;++i)Ws.unlistenByKey(this.listenerKeys[i]);this.listenerKeys.length=0,this.map_=t,this.map_&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==Gs.nullFunction&&this.listenerKeys.push(Ws.listen(t,wn,this.render,this)),t.render())},ce.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t};var le,fe,de={CLASS_HIDDEN:"ol-hidden",CLASS_SELECTABLE:"ol-selectable",CLASS_UNSELECTABLE:"ol-unselectable",CLASS_UNSUPPORTED:"ol-unsupported",CLASS_CONTROL:"ol-control"};de.getFontFamilies=(fe={},function(t){if(le||(le=document.createElement("div").style),!(t in fe)){le.font=t;var i=le.fontFamily;if(le.font="",!i)return null;fe[t]=i.split(/,\s?/)}return fe[t]});var ve="postcompose",me="precompose",pe="render",_e=function(t){var i=js.assign({},t);delete i.source,$n.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,t.map&&this.setMap(t.map),Ws.listen(this,hh.getChangeEventType(Kn),this.handleSourcePropertyChange_,this),this.setSource(t.source?t.source:null)};Gs.inherits(_e,$n),_e.visibleAtResolution=function(t,i){return t.visible&&i>=t.minResolution&&i<t.maxResolution},_e.prototype.getLayersArray=function(t){var i=t||[];return i.push(this),i},_e.prototype.getLayerStatesArray=function(t){var i=t||[];return i.push(this.getLayerState()),i},_e.prototype.getSource=function(){return this.get(Kn)||null},_e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},_e.prototype.handleSourceChange_=function(){this.changed()},_e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(Ws.unlistenByKey(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=Ws.listen(t,Bs,this.handleSourceChange_,this)),this.changed()},_e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(Ws.unlistenByKey(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Ws.unlistenByKey(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Ws.listen(t,me,(function(t){var i=this.getLayerState();i.managed=!1,i.zIndex=1/0,t.frameState.layerStatesArray.push(i),t.frameState.layerStates[Gs.getUid(this)]=i}),this),this.mapRenderKey_=Ws.listen(this,Bs,t.render,t),this.changed())},_e.prototype.setSource=function(t){this.set(Kn,t)};var ge=function(t){var i=t||{};this.ulElement_=document.createElement("UL"),this.logoLi_=document.createElement("LI"),this.ulElement_.appendChild(this.logoLi_),this.logoLi_.style.display="none",this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var s=void 0!==i.className?i.className:"ol-attribution",h=void 0!==i.tipLabel?i.tipLabel:"Attributions",n=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;var e=void 0!==i.label?i.label:"i";"string"==typeof e?(this.label_=document.createElement("span"),this.label_.textContent=e):this.label_=e;var r=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,a=document.createElement("button");a.setAttribute("type","button"),a.title=h,a.appendChild(r),Ws.listen(a,Hs,this.handleClick_,this);var o=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),u=document.createElement("div");u.className=o,u.appendChild(this.ulElement_),u.appendChild(a),ce.call(this,{element:u,render:i.render?i.render:ge.render,target:i.target}),this.renderedAttributions_=[],this.renderedVisible_=!0,this.logoElements_={}};Gs.inherits(ge,ce),ge.prototype.getSourceAttributions_=function(t){for(var i={},s=[],h=t.layerStatesArray,n=t.viewState.resolution,e=0,r=h.length;e<r;++e){var a=h[e];if(_e.visibleAtResolution(a,n)){var o=a.layer.getSource();if(o){var u=o.getAttributions2();if(u){var c=u(t);if(c)if(Array.isArray(c))for(var l=0,f=c.length;l<f;++l)c[l]in i||(s.push(c[l]),i[c[l]]=!0);else c in i||(s.push(c),i[c]=!0)}}}}return s},ge.render=function(t){this.updateElement_(t.frameState)},ge.prototype.updateElement_=function(t){if(t){var i=this.getSourceAttributions_(t);if(!_h.equals(i,this.renderedAttributions_)){for(;this.ulElement_.lastChild!==this.logoLi_;)this.ulElement_.removeChild(this.ulElement_.lastChild);for(var s=0,h=i.length;s<h;++s){var n=document.createElement("LI");n.innerHTML=i[s],this.ulElement_.appendChild(n)}0===i.length&&this.renderedAttributions_.length>0?this.element.classList.add("ol-logo-only"):0===this.renderedAttributions_.length&&i.length>0&&this.element.classList.remove("ol-logo-only");var e=i.length>0||!js.isEmpty(t.logos);this.renderedVisible_!=e&&(this.element.style.display=e?"":"none",this.renderedVisible_=e),this.renderedAttributions_=i,this.insertLogos_(t)}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},ge.prototype.insertLogos_=function(t){var i,s,h,n,e=t.logos,r=this.logoElements_;for(i in r)i in e||(Vn(r[i]),delete r[i]);for(n in e){var a=e[n];a instanceof HTMLElement&&(this.logoLi_.appendChild(a),r[n]=a),n in r||((s=new Image).src=n,""===a?h=s:((h=document.createElement("a")).href=a,h.appendChild(s)),this.logoLi_.appendChild(h),r[n]=h)}this.logoLi_.style.display=js.isEmpty(e)?"none":""},ge.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},ge.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Un(this.collapseLabel_,this.label_):Un(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_},ge.prototype.getCollapsible=function(){return this.collapsible_},ge.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},ge.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},ge.prototype.getCollapsed=function(){return this.collapsed_};var ze=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-rotate",h=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof h?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=h):(this.label_=h,this.label_.classList.add("ol-compass"));var n=i.tipLabel?i.tipLabel:"Reset rotation",e=document.createElement("button");e.className=s+"-reset",e.setAttribute("type","button"),e.title=n,e.appendChild(this.label_),Ws.listen(e,Hs,ze.prototype.handleClick_,this);var r=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL,a=document.createElement("div");a.className=r,a.appendChild(e);var o=i.render?i.render:ze.render;this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,ce.call(this,{element:a,render:o,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(de.CLASS_HIDDEN)};Gs.inherits(ze,ce),ze.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},ze.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:Fn.easeOut}):t.setRotation(0))},ze.render=function(t){var i=t.frameState;if(i){var s=i.viewState.rotation;if(s!=this.rotation_){var h="rotate("+s+"rad)";if(this.autoHide_){var n=this.element.classList.contains(de.CLASS_HIDDEN);n||0!==s?n&&0!==s&&this.element.classList.remove(de.CLASS_HIDDEN):this.element.classList.add(de.CLASS_HIDDEN)}this.label_.style.msTransform=h,this.label_.style.webkitTransform=h,this.label_.style.transform=h}this.rotation_=s}};var Me=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-zoom",h=void 0!==i.delta?i.delta:1,n=void 0!==i.zoomInLabel?i.zoomInLabel:"+",e=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",r=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",a=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",o=document.createElement("button");o.className=s+"-in",o.setAttribute("type","button"),o.title=r,o.appendChild("string"==typeof n?document.createTextNode(n):n),Ws.listen(o,Hs,Me.prototype.handleClick_.bind(this,h));var u=document.createElement("button");u.className=s+"-out",u.setAttribute("type","button"),u.title=a,u.appendChild("string"==typeof e?document.createTextNode(e):e),Ws.listen(u,Hs,Me.prototype.handleClick_.bind(this,-h));var c=s+" "+de.CLASS_UNSELECTABLE+" "+de.CLASS_CONTROL,l=document.createElement("div");l.className=c,l.appendChild(o),l.appendChild(u),ce.call(this,{element:l,target:i.target}),this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Me,ce),Me.prototype.handleClick_=function(t,i){i.preventDefault(),this.zoomByDelta_(t)},Me.prototype.zoomByDelta_=function(t){var i=this.getMap().getView();if(i){var s=i.getResolution();if(s){var h=i.constrainResolution(s,t);this.duration_>0?(i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:h,duration:this.duration_,easing:Fn.easeOut})):i.setResolution(h)}}};var we=function(t){var i=t||{},s=new rn;return(void 0===i.zoom||i.zoom)&&s.push(new Me(i.zoomOptions)),(void 0===i.rotate||i.rotate)&&s.push(new ze(i.rotateOptions)),(void 0===i.attribution||i.attribution)&&s.push(new ge(i.attributionOptions)),s},be=function(t,i,s){this.decay_=t,this.minVelocity_=i,this.delay_=s,this.points_=[],this.angle_=0,this.initialVelocity_=0};be.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},be.prototype.update=function(t,i){this.points_.push(t,i,Date.now())},be.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,i=this.points_.length-3;if(this.points_[i+2]<t)return!1;for(var s=i-3;s>0&&this.points_[s+2]>t;)s-=3;var h=this.points_[i+2]-this.points_[s+2];if(h<1e3/60)return!1;var n=this.points_[i]-this.points_[s],e=this.points_[i+1]-this.points_[s+1];return this.angle_=Math.atan2(e,n),this.initialVelocity_=Math.sqrt(n*n+e*e)/h,this.initialVelocity_>this.minVelocity_},be.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},be.prototype.getAngle=function(){return this.angle_};var xe="active",ye=function(t){hh.call(this),this.map_=null,this.setActive(!0),this.handleEvent=t.handleEvent};Gs.inherits(ye,hh),ye.prototype.getActive=function(){return this.get(xe)},ye.prototype.getMap=function(){return this.map_},ye.prototype.setActive=function(t){this.set(xe,t)},ye.prototype.setMap=function(t){this.map_=t},ye.pan=function(t,i,s){var h=t.getCenter();if(h){var n=t.constrainCenter([h[0]+i[0],h[1]+i[1]]);s?t.animate({duration:s,easing:Fn.linear,center:n}):t.setCenter(n)}},ye.rotate=function(t,i,s,h){i=t.constrainRotation(i,0),ye.rotateWithoutConstraints(t,i,s,h)},ye.rotateWithoutConstraints=function(t,i,s,h){if(void 0!==i){var n=t.getRotation(),e=t.getCenter();void 0!==n&&e&&h>0?t.animate({rotation:i,anchor:s,duration:h,easing:Fn.easeOut}):t.rotate(i,s)}},ye.zoom=function(t,i,s,h,n){i=t.constrainResolution(i,0,n),ye.zoomWithoutConstraints(t,i,s,h)},ye.zoomByDelta=function(t,i,s,h){var n=t.getResolution(),e=t.constrainResolution(n,i,0);if(void 0!==e){var r=t.getResolutions();e=rh.clamp(e,t.getMinResolution()||r[r.length-1],t.getMaxResolution()||r[0])}if(s&&void 0!==e&&e!==n){var a=t.getCenter(),o=t.calculateCenterZoom(e,s);o=t.constrainCenter(o),s=[(e*a[0]-n*o[0])/(e-n),(e*a[1]-n*o[1])/(e-n)]}ye.zoomWithoutConstraints(t,e,s,h)},ye.zoomWithoutConstraints=function(t,i,s,h){if(i){var n=t.getResolution(),e=t.getCenter();if(void 0!==n&&e&&i!==n&&h)t.animate({resolution:i,anchor:s,duration:h,easing:Fn.easeOut});else{if(s){var r=t.calculateCenterZoom(i,s);t.setCenter(r)}t.setResolution(i)}}};var Ee=function(t){var i=t||{};this.delta_=i.delta?i.delta:1,ye.call(this,{handleEvent:Ee.handleEvent}),this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Ee,ye),Ee.handleEvent=function(t){var i=!1;if(t.type==un.DBLCLICK){var s=t.coordinate,h=t.originalEvent.shiftKey?-this.delta_:this.delta_,n=t.map.getView();ye.zoomByDelta(n,h,s,this.duration_),t.preventDefault(),i=!0}return!i};var Se={altKeyOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},altShiftKeysOnly:function(t){var i=t.originalEvent;return i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey}};Se.always=xh.TRUE,Se.click=function(t){return t.type==un.CLICK},Se.mouseActionButton=function(t){var i=t.originalEvent;return 0==i.button&&!(tn.WEBKIT&&tn.MAC&&i.ctrlKey)},Se.never=xh.FALSE,Se.pointerMove=function(t){return"pointermove"==t.type},Se.singleClick=function(t){return t.type==un.SINGLECLICK},Se.doubleClick=function(t){return t.type==un.DBLCLICK},Se.noModifierKeys=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&!i.shiftKey},Se.platformModifierKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&(tn.MAC?i.metaKey:i.ctrlKey)&&!i.shiftKey},Se.shiftKeyOnly=function(t){var i=t.originalEvent;return!i.altKey&&!(i.metaKey||i.ctrlKey)&&i.shiftKey},Se.targetNotEditable=function(t){var i=t.originalEvent.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i},Se.mouseOnly=function(t){return eh(t.pointerEvent,56),"mouse"==t.pointerEvent.pointerType},Se.primaryAction=function(t){var i=t.pointerEvent;return i.isPrimary&&0===i.button};var Pe=function(t){var i=t||{};ye.call(this,{handleEvent:i.handleEvent?i.handleEvent:Pe.handleEvent}),this.handleDownEvent_=i.handleDownEvent?i.handleDownEvent:Pe.handleDownEvent,this.handleDragEvent_=i.handleDragEvent?i.handleDragEvent:Pe.handleDragEvent,this.handleMoveEvent_=i.handleMoveEvent?i.handleMoveEvent:Pe.handleMoveEvent,this.handleUpEvent_=i.handleUpEvent?i.handleUpEvent:Pe.handleUpEvent,this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]};Gs.inherits(Pe,ye),Pe.centroid=function(t){for(var i=t.length,s=0,h=0,n=0;n<i;n++)s+=t[n].clientX,h+=t[n].clientY;return[s/i,h/i]},Pe.prototype.isPointerDraggingEvent_=function(t){var i=t.type;return i===un.POINTERDOWN||i===un.POINTERDRAG||i===un.POINTERUP},Pe.prototype.updateTrackedPointers_=function(t){if(this.isPointerDraggingEvent_(t)){var i=t.pointerEvent,s=i.pointerId.toString();t.type==un.POINTERUP?delete this.trackedPointers_[s]:(t.type==un.POINTERDOWN||s in this.trackedPointers_)&&(this.trackedPointers_[s]=i),this.targetPointers=js.getValues(this.trackedPointers_)}},Pe.handleDragEvent=Gs.nullFunction,Pe.handleUpEvent=xh.FALSE,Pe.handleDownEvent=xh.FALSE,Pe.handleMoveEvent=Gs.nullFunction,Pe.handleEvent=function(t){if(!(t instanceof cn))return!0;var i=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==un.POINTERDRAG)this.handleDragEvent_(t);else if(t.type==un.POINTERUP){var s=this.handleUpEvent_(t);this.handlingDownUpSequence=s&&this.targetPointers.length>0}}else if(t.type==un.POINTERDOWN){var h=this.handleDownEvent_(t);this.handlingDownUpSequence=h,i=this.shouldStopEvent(h)}else t.type==un.POINTERMOVE&&this.handleMoveEvent_(t);return!i},Pe.prototype.shouldStopEvent=function(t){return t};var Ge=function(t){Pe.call(this,{handleDownEvent:Ge.handleDownEvent_,handleDragEvent:Ge.handleDragEvent_,handleUpEvent:Ge.handleUpEvent_});var i=t||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.condition_=i.condition?i.condition:Se.noModifierKeys,this.noKinetic_=!1};Gs.inherits(Ge,Pe),Ge.handleDragEvent_=function(t){var i=this.targetPointers,s=Pe.centroid(i);if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){var h=this.lastCentroid[0]-s[0],n=s[1]-this.lastCentroid[1],e=t.map.getView(),r=e.getState(),a=[h,n];On.scale(a,r.resolution),On.rotate(a,r.rotation),On.add(a,r.center),a=e.constrainCenter(a),e.setCenter(a)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=i.length},Ge.handleUpEvent_=function(t){var i=t.map,s=i.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var h=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),e=s.getCenter(),r=i.getPixelFromCoordinate(e),a=i.getCoordinateFromPixel([r[0]-h*Math.cos(n),r[1]-h*Math.sin(n)]);s.animate({center:s.constrainCenter(a),duration:500,easing:Fn.easeOut})}return s.setHint(1,-1),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},Ge.handleDownEvent_=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var i=t.map.getView();return this.lastCentroid=null,this.handlingDownUpSequence||i.setHint(1,1),i.getAnimating()&&i.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},Ge.prototype.shouldStopEvent=xh.FALSE;var ke=function(t){var i=t||{};Pe.call(this,{handleDownEvent:ke.handleDownEvent_,handleDragEvent:ke.handleDragEvent_,handleUpEvent:ke.handleUpEvent_}),this.condition_=i.condition?i.condition:Se.altShiftKeysOnly,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(ke,Pe),ke.handleDragEvent_=function(t){if(Se.mouseOnly(t)){var i=t.map,s=i.getView();if(s.getConstraints().rotation!==Cn.disable){var h=i.getSize(),n=t.pixel,e=Math.atan2(h[1]/2-n[1],n[0]-h[0]/2);if(void 0!==this.lastAngle_){var r=e-this.lastAngle_,a=s.getRotation();ye.rotateWithoutConstraints(s,a-r)}this.lastAngle_=e}}},ke.handleUpEvent_=function(t){if(!Se.mouseOnly(t))return!0;var i=t.map.getView();i.setHint(1,-1);var s=i.getRotation();return ye.rotate(i,s,void 0,this.duration_),!1},ke.handleDownEvent_=function(t){return!(!Se.mouseOnly(t)||!Se.mouseActionButton(t)||!this.condition_(t)||(t.map.getView().setHint(1,1),this.lastAngle_=void 0,0))},ke.prototype.shouldStopEvent=xh.FALSE;var Ne=function(t){this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null};Gs.inherits(Ne,Us),Ne.prototype.disposeInternal=function(){this.setMap(null)},Ne.prototype.render_=function(){var t=this.startPixel_,i=this.endPixel_,s="px",h=this.element_.style;h.left=Math.min(t[0],i[0])+s,h.top=Math.min(t[1],i[1])+s,h.width=Math.abs(i[0]-t[0])+s,h.height=Math.abs(i[1]-t[1])+s},Ne.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var i=this.element_.style;i.left=i.top=i.width=i.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},Ne.prototype.setPixels=function(t,i){this.startPixel_=t,this.endPixel_=i,this.createOrUpdateGeometry(),this.render_()},Ne.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,i=this.endPixel_,s=[t,[t[0],i[1]],i,[i[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new $h([s])},Ne.prototype.getGeometry=function(){return this.geometry_};var Ce=function(t){Pe.call(this,{handleDownEvent:Ce.handleDownEvent_,handleDragEvent:Ce.handleDragEvent_,handleUpEvent:Ce.handleUpEvent_});var i=t||{};this.box_=new Ne(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.startPixel_=null,this.condition_=i.condition?i.condition:Se.always,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:Ce.defaultBoxEndCondition};Gs.inherits(Ce,Pe),Ce.defaultBoxEndCondition=function(t,i,s){var h=s[0]-i[0],n=s[1]-i[1];return h*h+n*n>=this.minArea_},Ce.handleDragEvent_=function(t){Se.mouseOnly(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXDRAG,t.coordinate,t)))},Ce.prototype.getGeometry=function(){return this.box_.getGeometry()},Ce.prototype.onBoxEnd=Gs.nullFunction,Ce.handleUpEvent_=function(t){return!Se.mouseOnly(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd(t),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXEND,t.coordinate,t))),!1)},Ce.handleDownEvent_=function(t){return!(!Se.mouseOnly(t)||!Se.mouseActionButton(t)||!this.condition_(t)||(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Ce.Event(Ce.EventType_.BOXSTART,t.coordinate,t)),0))},Ce.EventType_={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend"},Ce.Event=function(t,i,s){Vs.call(this,t),this.coordinate=i,this.mapBrowserEvent=s},Gs.inherits(Ce.Event,Vs);var Ae=function(t){var i=t||{},s=i.condition?i.condition:Se.shiftKeyOnly;this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out,Ce.call(this,{condition:s,className:i.className||"ol-dragzoom"})};Gs.inherits(Ae,Ce),Ae.prototype.onBoxEnd=function(){var t=this.getMap(),i=t.getView(),s=t.getSize(),h=this.getGeometry().getExtent();if(this.out_){var n=i.calculateExtent(s),e=zh.createOrUpdateFromCoordinates([t.getPixelFromCoordinate(zh.getBottomLeft(h)),t.getPixelFromCoordinate(zh.getTopRight(h))]),r=i.getResolutionForExtent(e,s);zh.scaleFromCenter(n,1/r),h=n}var a=i.constrainResolution(i.getResolutionForExtent(h,s)),o=zh.getCenter(h);o=i.constrainCenter(o),i.animate({resolution:a,center:o,duration:this.duration_,easing:Fn.easeOut})};var Re=function(t){ye.call(this,{handleEvent:Re.handleEvent});var i=t||{};this.defaultCondition_=function(t){return Se.noModifierKeys(t)&&Se.targetNotEditable(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128};Gs.inherits(Re,ye),Re.handleEvent=function(t){var i=!1;if(t.type==Zs){var s=t.originalEvent.keyCode;if(this.condition_(t)&&(40==s||37==s||39==s||38==s)){var h=t.map.getView(),n=h.getResolution()*this.pixelDelta_,e=0,r=0;40==s?r=-n:37==s?e=-n:39==s?e=n:r=n;var a=[e,r];On.rotate(a,h.getRotation()),ye.pan(h,a,this.duration_),t.preventDefault(),i=!0}}return!i};var Ie=function(t){ye.call(this,{handleEvent:Ie.handleEvent});var i=t||{};this.condition_=i.condition?i.condition:Se.targetNotEditable,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100};Gs.inherits(Ie,ye),Ie.handleEvent=function(t){var i=!1;if(t.type==Zs||t.type==Ks){var s=t.originalEvent.charCode;if(this.condition_(t)&&(s=="+".charCodeAt(0)||s=="-".charCodeAt(0))){var h=t.map,n=s=="+".charCodeAt(0)?this.delta_:-this.delta_,e=h.getView();ye.zoomByDelta(e,n,void 0,this.duration_),t.preventDefault(),i=!0}}return!i};var Te=function(t){ye.call(this,{handleEvent:Te.handleEvent});var i=t||{};this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_=void 0,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5};Gs.inherits(Te,ye),Te.handleEvent=function(t){var i=t.type;if(i!==ih&&i!==Qs)return!0;t.preventDefault();var s,h=t.map,n=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ih?(s=n.deltaY,tn.FIREFOX&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(s/=tn.DEVICE_PIXEL_RATIO),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(s*=40)):t.type==Qs&&(s=-n.wheelDeltaY,tn.SAFARI&&(s/=3)),0===s)return!1;var e=Date.now();if(void 0===this.startTime_&&(this.startTime_=e),(!this.mode_||e-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(s)<4?Te.Mode_.TRACKPAD:Te.Mode_.WHEEL),this.mode_===Te.Mode_.TRACKPAD){var r=h.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):r.setHint(1,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=r.getResolution()*Math.pow(2,s/this.trackpadDeltaPerZoom_),o=r.getMinResolution(),u=r.getMaxResolution(),c=0;if(a<o?(a=Math.max(a,o/this.trackpadZoomBuffer_),c=1):a>u&&(a=Math.min(a,u*this.trackpadZoomBuffer_),c=-1),this.lastAnchor_){var l=r.calculateCenterZoom(a,this.lastAnchor_);r.setCenter(r.constrainCenter(l))}return r.setResolution(a),0===c&&this.constrainResolution_&&r.animate({resolution:r.constrainResolution(a,s>0?-1:1),easing:Fn.easeOut,anchor:this.lastAnchor_,duration:this.duration_}),c>0?r.animate({resolution:o,easing:Fn.easeOut,anchor:this.lastAnchor_,duration:500}):c<0&&r.animate({resolution:u,easing:Fn.easeOut,anchor:this.lastAnchor_,duration:500}),this.startTime_=e,!1}this.delta_+=s;var f=Math.max(this.timeout_-(e-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,h),f),!1},Te.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(1,-1)},Te.prototype.handleWheelZoom_=function(t){var i=t.getView();i.getAnimating()&&i.cancelAnimations();var s=Gs.MOUSEWHEELZOOM_MAXDELTA,h=rh.clamp(this.delta_,-s,s);ye.zoomByDelta(i,-h,this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},Te.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},Te.Mode_={TRACKPAD:"trackpad",WHEEL:"wheel"};var Oe=function(t){Pe.call(this,{handleDownEvent:Oe.handleDownEvent_,handleDragEvent:Oe.handleDragEvent_,handleUpEvent:Oe.handleUpEvent_});var i=t||{};this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250};Gs.inherits(Oe,Pe),Oe.handleDragEvent_=function(t){var i=0,s=this.targetPointers[0],h=this.targetPointers[1],n=Math.atan2(h.clientY-s.clientY,h.clientX-s.clientX);if(void 0!==this.lastAngle_){var e=n-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),i=e}this.lastAngle_=n;var r=t.map,a=r.getView();if(a.getConstraints().rotation!==Cn.disable){var o=r.getViewport().getBoundingClientRect(),u=Pe.centroid(this.targetPointers);if(u[0]-=o.left,u[1]-=o.top,this.anchor_=r.getCoordinateFromPixel(u),this.rotating_){var c=a.getRotation();r.render(),ye.rotateWithoutConstraints(a,c+i,this.anchor_)}}},Oe.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();if(i.setHint(1,-1),this.rotating_){var s=i.getRotation();ye.rotate(i,s,this.anchor_,this.duration_)}return!1}return!0},Oe.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},Oe.prototype.shouldStopEvent=xh.FALSE;var Fe=function(t){Pe.call(this,{handleDownEvent:Fe.handleDownEvent_,handleDragEvent:Fe.handleDragEvent_,handleUpEvent:Fe.handleUpEvent_});var i=t||{};this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1};Gs.inherits(Fe,Pe),Fe.handleDragEvent_=function(t){var i=1,s=this.targetPointers[0],h=this.targetPointers[1],n=s.clientX-h.clientX,e=s.clientY-h.clientY,r=Math.sqrt(n*n+e*e);void 0!==this.lastDistance_&&(i=this.lastDistance_/r),this.lastDistance_=r;var a=t.map,o=a.getView(),u=o.getResolution(),c=o.getMaxResolution(),l=o.getMinResolution(),f=u*i;f>c?(i=c/u,f=c):f<l&&(i=l/u,f=l),1!=i&&(this.lastScaleDelta_=i);var d=a.getViewport().getBoundingClientRect(),v=Pe.centroid(this.targetPointers);v[0]-=d.left,v[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(v),a.render(),ye.zoomWithoutConstraints(o,f,this.anchor_)},Fe.handleUpEvent_=function(t){if(this.targetPointers.length<2){var i=t.map.getView();i.setHint(1,-1);var s=i.getResolution();return(this.constrainResolution_||s<i.getMinResolution()||s>i.getMaxResolution())&&ye.zoom(i,s,this.anchor_,this.duration_,this.lastScaleDelta_-1),!1}return!0},Fe.handleDownEvent_=function(t){if(this.targetPointers.length>=2){var i=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||i.getView().setHint(1,1),!0}return!1},Fe.prototype.shouldStopEvent=xh.FALSE;var Le=function(t){var i=t||{},s=new rn,h=new be(-.005,.05,100);return(void 0===i.altShiftDragRotate||i.altShiftDragRotate)&&s.push(new ke),(void 0===i.doubleClickZoom||i.doubleClickZoom)&&s.push(new Ee({delta:i.zoomDelta,duration:i.zoomDuration})),(void 0===i.dragPan||i.dragPan)&&s.push(new Ge({kinetic:h})),(void 0===i.pinchRotate||i.pinchRotate)&&s.push(new Oe),(void 0===i.pinchZoom||i.pinchZoom)&&s.push(new Fe({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.keyboard||i.keyboard)&&(s.push(new Re),s.push(new Ie({delta:i.zoomDelta,duration:i.zoomDuration}))),(void 0===i.mouseWheelZoom||i.mouseWheelZoom)&&s.push(new Te({constrainResolution:i.constrainResolution,duration:i.zoomDuration})),(void 0===i.shiftDragZoom||i.shiftDragZoom)&&s.push(new Ae({duration:i.zoomDuration})),s},De=function(t,i,s,h){qs.call(this),this.extent=t,this.pixelRatio_=s,this.resolution=i,this.state=h};Gs.inherits(De,qs),De.prototype.changed=function(){this.dispatchEvent(Bs)},De.prototype.getExtent=function(){return this.extent},De.prototype.getImage=function(){},De.prototype.getPixelRatio=function(){return this.pixelRatio_},De.prototype.getResolution=function(){return this.resolution},De.prototype.getState=function(){return this.state},De.prototype.load=function(){};var je=function(t,i,s,h,n){this.loader_=void 0!==n?n:null,De.call(this,t,i,s,void 0!==n?0:2),this.canvas_=h,this.error_=null};Gs.inherits(je,De),je.prototype.getError=function(){return this.error_},je.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()},je.prototype.load=function(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))},je.prototype.getImage=function(){return this.canvas_};var We="IMAGE",Ue="TILE",Ve="VECTOR",qe=function(t,i,s,h,n){Vs.call(this,t),this.vectorContext=i,this.frameState=s,this.context=h,this.glContext=n};Gs.inherits(qe,Vs);var Be=function(t){qs.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null};Gs.inherits(Be,qs),Be.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},Be.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(Xs)},Be.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},Be.prototype.forEach=function(t,i){for(var s=this.oldest_;s;)t.call(i,s.value_,s.key_,this),s=s.newer},Be.prototype.get=function(t){var i=this.entries_[t];return eh(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_},Be.prototype.remove=function(t){var i=this.entries_[t];return eh(void 0!==i,15),i===this.newest_?(this.newest_=i.older,this.newest_&&(this.newest_.newer=null)):i===this.oldest_?(this.oldest_=i.newer,this.oldest_&&(this.oldest_.older=null)):(i.newer.older=i.older,i.older.newer=i.newer),delete this.entries_[t],--this.count_,i.value_},Be.prototype.getCount=function(){return this.count_},Be.prototype.getKeys=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.key_;return i},Be.prototype.getValues=function(){var t,i=new Array(this.count_),s=0;for(t=this.newest_;t;t=t.older)i[s++]=t.value_;return i},Be.prototype.peekLast=function(){return this.oldest_.value_},Be.prototype.peekLastKey=function(){return this.oldest_.key_},Be.prototype.peekFirstKey=function(){return this.newest_.key_},Be.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},Be.prototype.replace=function(t,i){this.get(t),this.entries_[t].value_=i},Be.prototype.set=function(t,i){eh(!(t in this.entries_),16);var s={key_:t,newer:null,older:this.newest_,value_:i};this.newest_?this.newest_.newer=s:this.oldest_=s,this.newest_=s,this.entries_[t]=s,++this.count_},Be.prototype.prune=function(){for(;this.canExpireCache();)this.pop()};var Xe,He,Ye={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:"center",defaultTextBaseline:"middle",defaultPadding:[0,0,0,0],defaultLineWidth:1};Ye.labelCache=new Be,Ye.checkedFonts_={},Ye.measureContext_=null,Ye.textHeights_={},Ye.checkFont=function(){var t,i,s=Ye.checkedFonts_,h=Ye.labelCache,n="wmytzilWMYTZIL@#/&?$%10";function e(t){var s=Ye.getMeasureContext();s.font="32px monospace",i=s.measureText(n).width;var h=!0;return"monospace"!=t&&(s.font="32px "+t+",monospace",h=s.measureText(n).width!=i),h}function r(){var i=!0;for(var n in s)s[n]<60&&(e(n)?(s[n]=60,js.clear(Ye.textHeights_),Ye.measureContext_=null,h.clear()):(++s[n],i=!1));i&&(window.clearInterval(t),t=void 0)}return function(i){var h=de.getFontFamilies(i);if(h)for(var n=0,a=h.length;n<a;++n){var o=h[n];o in s||(s[o]=60,e(o)||(s[o]=0,void 0===t&&(t=window.setInterval(r,32))))}}}(),Ye.getMeasureContext=function(){var t=Ye.measureContext_;return t||(t=Ye.measureContext_=Dn(1,1)),t},Ye.measureTextHeight=(He=Ye.textHeights_,function(t){var i=He[t];return null==i&&(Xe||((Xe=document.createElement("span")).textContent="M",Xe.style.margin=Xe.style.padding="0 !important",Xe.style.position="absolute !important",Xe.style.left="-99999px !important"),Xe.style.font=t,document.body.appendChild(Xe),i=He[t]=Xe.offsetHeight,document.body.removeChild(Xe)),i}),Ye.measureTextWidth=function(t,i){var s=Ye.getMeasureContext();return t!=s.font&&(s.font=t),s.measureText(i).width},Ye.rotateAtOffset=function(t,i,s,h){0!==i&&(t.translate(s,h),t.rotate(i),t.translate(-s,-h))},Ye.resetTransform_=Oh.create(),Ye.drawImage=function(t,i,s,h,n,e,r,a,o,u,c){var l;1!=s&&(t.globalAlpha=(l=t.globalAlpha)*s),i&&t.setTransform.apply(t,i),t.drawImage(h,n,e,r,a,o,u,r*c,a*c),l&&(t.globalAlpha=l),i&&t.setTransform.apply(t,Ye.resetTransform_)};var Je={HEX_COLOR_RE_:/^#(?:[0-9a-f]{3,4}){1,2}$/i,NAMED_COLOR_RE_:/^([a-z]*)$/i,asArray:function(t){return Array.isArray(t)?t:Je.fromString(t)},asString:function(t){return"string"==typeof t?t:Je.toString(t)},fromNamed:function(t){var i=document.createElement("div");i.style.color=t,document.body.appendChild(i);var s=getComputedStyle(i).color;return document.body.removeChild(i),s}};Je.fromString=function(){var t={},i=0;return function(s){var h;if(t.hasOwnProperty(s))h=t[s];else{if(i>=1024){var n,e=0;for(n in t)3&e++||(delete t[n],--i)}h=Je.fromStringInternal_(s),t[s]=h,++i}return h}}(),Je.fromStringInternal_=function(t){var i,s,h,n,e,r;if(Je.NAMED_COLOR_RE_.exec(t)&&(t=Je.fromNamed(t)),Je.HEX_COLOR_RE_.exec(t)){var a,o=t.length-1;a=o<=4?1:2;var u=4===o||8===o;i=parseInt(t.substr(1+0*a,a),16),s=parseInt(t.substr(1+1*a,a),16),h=parseInt(t.substr(1+2*a,a),16),n=u?parseInt(t.substr(1+3*a,a),16):255,1==a&&(i=(i<<4)+i,s=(s<<4)+s,h=(h<<4)+h,u&&(n=(n<<4)+n)),e=[i,s,h,n/255]}else 0==t.indexOf("rgba(")?(r=t.slice(5,-1).split(",").map(Number),e=Je.normalize(r)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),e=Je.normalize(r)):eh(!1,14);return e},Je.normalize=function(t,i){var s=i||[];return s[0]=rh.clamp(t[0]+.5|0,0,255),s[1]=rh.clamp(t[1]+.5|0,0,255),s[2]=rh.clamp(t[2]+.5|0,0,255),s[3]=rh.clamp(t[3],0,1),s},Je.toString=function(t){var i=t[0];i!=(0|i)&&(i=i+.5|0);var s=t[1];s!=(0|s)&&(s=s+.5|0);var h=t[2];return h!=(0|h)&&(h=h+.5|0),"rgba("+i+","+s+","+h+","+(void 0===t[3]?1:t[3])+")"};var Ze={asColorLike:function(t){return Ze.isColorLike(t)?t:Je.asString(t)},isColorLike:function(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient}},Ke=function(){};Ke.prototype.drawCustom=function(){},Ke.prototype.drawGeometry=function(){},Ke.prototype.setStyle=function(){},Ke.prototype.drawCircle=function(){},Ke.prototype.drawFeature=function(){},Ke.prototype.drawGeometryCollection=function(){},Ke.prototype.drawLineString=function(){},Ke.prototype.drawMultiLineString=function(){},Ke.prototype.drawMultiPoint=function(){},Ke.prototype.drawMultiPolygon=function(){},Ke.prototype.drawPoint=function(){},Ke.prototype.drawPolygon=function(){},Ke.prototype.drawText=function(){},Ke.prototype.setFillStrokeStyle=function(){},Ke.prototype.setImageStyle=function(){},Ke.prototype.setTextStyle=function(){};var $e=function(t,i,s,h,n){Ke.call(this),this.context_=t,this.pixelRatio_=i,this.extent_=s,this.transform_=h,this.viewRotation_=n,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageSnapToPixel_=!1,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Oh.create()};Gs.inherits($e,Ke),$e.prototype.drawImages_=function(t,i,s){if(this.image_){var h=yh(t,i,s,2,this.transform_,this.pixelCoordinates_),n=this.context_,e=this.tmpLocalTransform_,r=n.globalAlpha;1!=this.imageOpacity_&&(n.globalAlpha=r*this.imageOpacity_);var a,o,u=this.imageRotation_;for(this.imageRotateWithView_&&(u+=this.viewRotation_),a=0,o=h.length;a<o;a+=2){var c=h[a]-this.imageAnchorX_,l=h[a+1]-this.imageAnchorY_;if(this.imageSnapToPixel_&&(c=Math.round(c),l=Math.round(l)),0!==u||1!=this.imageScale_){var f=c+this.imageAnchorX_,d=l+this.imageAnchorY_;Oh.compose(e,f,d,this.imageScale_,this.imageScale_,u,-f,-d),n.setTransform.apply(n,e)}n.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,l,this.imageWidth_,this.imageHeight_)}0===u&&1==this.imageScale_||n.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(n.globalAlpha=r)}},$e.prototype.drawText_=function(t,i,s,h){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var n=yh(t,i,s,h,this.transform_,this.pixelCoordinates_),e=this.context_,r=this.textRotation_;for(this.textRotateWithView_&&(r+=this.viewRotation_);i<s;i+=h){var a=n[i]+this.textOffsetX_,o=n[i+1]+this.textOffsetY_;if(0!==r||1!=this.textScale_){var u=Oh.compose(this.tmpLocalTransform_,a,o,this.textScale_,this.textScale_,r,-a,-o);e.setTransform.apply(e,u)}this.textStrokeState_&&e.strokeText(this.text_,a,o),this.textFillState_&&e.fillText(this.text_,a,o)}0===r&&1==this.textScale_||e.setTransform(1,0,0,1,0,0)}},$e.prototype.moveToLineTo_=function(t,i,s,h,n){var e=this.context_,r=yh(t,i,s,h,this.transform_,this.pixelCoordinates_);e.moveTo(r[0],r[1]);var a=r.length;n&&(a-=2);for(var o=2;o<a;o+=2)e.lineTo(r[o],r[o+1]);return n&&e.closePath(),s},$e.prototype.drawRings_=function(t,i,s,h){var n,e;for(n=0,e=s.length;n<e;++n)i=this.moveToLineTo_(t,i,s[n],h,!0);return i},$e.prototype.drawCircle=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=Lh.transform2D(t,this.transform_,this.pixelCoordinates_),s=i[2]-i[0],h=i[3]-i[1],n=Math.sqrt(s*s+h*h),e=this.context_;e.beginPath(),e.arc(i[0],i[1],n,0,2*Math.PI),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},$e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},$e.prototype.drawGeometry=function(t){switch(t.getType()){case ah:this.drawPoint(t);break;case oh:this.drawLineString(t);break;case ch:this.drawPolygon(t);break;case lh:this.drawMultiPoint(t);break;case fh:this.drawMultiLineString(t);break;case dh:this.drawMultiPolygon(t);break;case vh:this.drawGeometryCollection(t);break;case mh:this.drawCircle(t)}},$e.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&zh.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},$e.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},$e.prototype.drawPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},$e.prototype.drawMultiPoint=function(t){var i=t.getFlatCoordinates(),s=t.getStride();this.image_&&this.drawImages_(i,0,i.length,s),""!==this.text_&&this.drawText_(i,0,i.length,s)},$e.prototype.drawLineString=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,s=t.getFlatCoordinates();i.beginPath(),this.moveToLineTo_(s,0,s.length,t.getStride(),!1),i.stroke()}if(""!==this.text_){var h=t.getFlatMidpoint();this.drawText_(h,0,2,2)}}},$e.prototype.drawMultiLineString=function(t){var i=t.getExtent();if(zh.intersects(this.extent_,i)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var s,h,n=this.context_,e=t.getFlatCoordinates(),r=0,a=t.getEnds(),o=t.getStride();for(n.beginPath(),s=0,h=a.length;s<h;++s)r=this.moveToLineTo_(e,r,a[s],o,!1);n.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},$e.prototype.drawPolygon=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i=this.context_;i.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&i.fill(),this.strokeState_&&i.stroke()}if(""!==this.text_){var s=t.getFlatInteriorPoint();this.drawText_(s,0,2,2)}}},$e.prototype.drawMultiPolygon=function(t){if(zh.intersects(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var i,s,h=this.context_,n=t.getOrientedFlatCoordinates(),e=0,r=t.getEndss(),a=t.getStride();for(h.beginPath(),i=0,s=r.length;i<s;++i)e=this.drawRings_(n,e,r[i],a);this.fillState_&&h.fill(),this.strokeState_&&h.stroke()}if(""!==this.text_){var o=t.getFlatInteriorPoints();this.drawText_(o,0,o.length,2)}}},$e.prototype.setContextFillState_=function(t){var i=this.context_,s=this.contextFillState_;s?s.fillStyle!=t.fillStyle&&(s.fillStyle=i.fillStyle=t.fillStyle):(i.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},$e.prototype.setContextStrokeState_=function(t){var i=this.context_,s=this.contextStrokeState_;s?(s.lineCap!=t.lineCap&&(s.lineCap=i.lineCap=t.lineCap),tn.CANVAS_LINE_DASH&&(_h.equals(s.lineDash,t.lineDash)||i.setLineDash(s.lineDash=t.lineDash),s.lineDashOffset!=t.lineDashOffset&&(s.lineDashOffset=i.lineDashOffset=t.lineDashOffset)),s.lineJoin!=t.lineJoin&&(s.lineJoin=i.lineJoin=t.lineJoin),s.lineWidth!=t.lineWidth&&(s.lineWidth=i.lineWidth=t.lineWidth),s.miterLimit!=t.miterLimit&&(s.miterLimit=i.miterLimit=t.miterLimit),s.strokeStyle!=t.strokeStyle&&(s.strokeStyle=i.strokeStyle=t.strokeStyle)):(i.lineCap=t.lineCap,tn.CANVAS_LINE_DASH&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineJoin=t.lineJoin,i.lineWidth=t.lineWidth,i.miterLimit=t.miterLimit,i.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},$e.prototype.setContextTextState_=function(t){var i=this.context_,s=this.contextTextState_,h=t.textAlign?t.textAlign:Ye.defaultTextAlign;s?(s.font!=t.font&&(s.font=i.font=t.font),s.textAlign!=h&&(s.textAlign=h),s.textBaseline!=t.textBaseline&&(s.textBaseline=i.textBaseline=t.textBaseline)):(i.font=t.font,i.textAlign=h,i.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:h,textBaseline:t.textBaseline})},$e.prototype.setFillStrokeStyle=function(t,i){if(t){var s=t.getColor();this.fillState_={fillStyle:Ze.asColorLike(s||Ye.defaultFillStyle)}}else this.fillState_=null;if(i){var h=i.getColor(),n=i.getLineCap(),e=i.getLineDash(),r=i.getLineDashOffset(),a=i.getLineJoin(),o=i.getWidth(),u=i.getMiterLimit();this.strokeState_={lineCap:void 0!==n?n:Ye.defaultLineCap,lineDash:e||Ye.defaultLineDash,lineDashOffset:r||Ye.defaultLineDashOffset,lineJoin:void 0!==a?a:Ye.defaultLineJoin,lineWidth:this.pixelRatio_*(void 0!==o?o:Ye.defaultLineWidth),miterLimit:void 0!==u?u:Ye.defaultMiterLimit,strokeStyle:Ze.asColorLike(h||Ye.defaultStrokeStyle)}}else this.strokeState_=null},$e.prototype.setImageStyle=function(t){if(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getOrigin(),n=t.getSize();this.imageAnchorX_=i[0],this.imageAnchorY_=i[1],this.imageHeight_=n[1],this.image_=s,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=h[0],this.imageOriginY_=h[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageSnapToPixel_=t.getSnapToPixel(),this.imageWidth_=n[0]}else this.image_=null},$e.prototype.setTextStyle=function(t){if(t){var i=t.getFill();if(i){var s=i.getColor();this.textFillState_={fillStyle:Ze.asColorLike(s||Ye.defaultFillStyle)}}else this.textFillState_=null;var h=t.getStroke();if(h){var n=h.getColor(),e=h.getLineCap(),r=h.getLineDash(),a=h.getLineDashOffset(),o=h.getLineJoin(),u=h.getWidth(),c=h.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:Ye.defaultLineCap,lineDash:r||Ye.defaultLineDash,lineDashOffset:a||Ye.defaultLineDashOffset,lineJoin:void 0!==o?o:Ye.defaultLineJoin,lineWidth:void 0!==u?u:Ye.defaultLineWidth,miterLimit:void 0!==c?c:Ye.defaultMiterLimit,strokeStyle:Ze.asColorLike(n||Ye.defaultStrokeStyle)}}else this.textStrokeState_=null;var l=t.getFont(),f=t.getOffsetX(),d=t.getOffsetY(),v=t.getRotateWithView(),m=t.getRotation(),p=t.getScale(),_=t.getText(),g=t.getTextAlign(),z=t.getTextBaseline();this.textState_={font:void 0!==l?l:Ye.defaultFont,textAlign:void 0!==g?g:Ye.defaultTextAlign,textBaseline:void 0!==z?z:Ye.defaultTextBaseline},this.text_=void 0!==_?_:"",this.textOffsetX_=void 0!==f?this.pixelRatio_*f:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==v&&v,this.textRotation_=void 0!==m?m:0,this.textScale_=this.pixelRatio_*(void 0!==p?p:1)}else this.text_=""};var Qe=function(t){sh.call(this),this.layer_=t};Gs.inherits(Qe,sh),Qe.prototype.forEachFeatureAtCoordinate=Gs.nullFunction,Qe.prototype.hasFeatureAtCoordinate=xh.FALSE,Qe.prototype.createLoadedTileFinder=function(t,i,s){return function(h,n){return t.forEachLoadedTile(i,h,n,(function(t){s[h]||(s[h]={}),s[h][t.tileCoord.toString()]=t}))}},Qe.prototype.getLayer=function(){return this.layer_},Qe.prototype.handleImageChange_=function(t){2===t.target.getState()&&this.renderIfReadyAndVisible()},Qe.prototype.loadImage=function(t){var i=t.getState();return 2!=i&&3!=i&&Ws.listen(t,Bs,this.handleImageChange_,this),0==i&&(t.load(),i=t.getState()),2==i},Qe.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Qn&&this.changed()},Qe.prototype.scheduleExpireCache=function(t,i){if(i.canExpireCache()){var s=function(t,i,s){var h=Gs.getUid(t).toString();h in s.usedTiles&&t.expireCache(s.viewState.projection,s.usedTiles[h])}.bind(null,i);t.postRenderFunctions.push(s)}},Qe.prototype.updateLogos=function(t,i){var s=i.getLogo();void 0!==s&&("string"==typeof s?t.logos[s]="":s&&(eh("string"==typeof s.href,44),eh("string"==typeof s.src,45),t.logos[s.src]=s.href))},Qe.prototype.updateUsedTiles=function(t,i,s,h){var n=Gs.getUid(i).toString(),e=s.toString();n in t?e in t[n]?t[n][e].extend(h):t[n][e]=h:(t[n]={},t[n][e]=h)},Qe.prototype.manageTilePyramid=function(t,i,s,h,n,e,r,a,o,u){var c=Gs.getUid(i).toString();c in t.wantedTiles||(t.wantedTiles[c]={});var l,f,d,v,m,p,_=t.wantedTiles[c],g=t.tileQueue;for(p=s.getMinZoom();p<=r;++p)for(f=s.getTileRangeForExtentAndZ(e,p,f),d=s.getResolution(p),v=f.minX;v<=f.maxX;++v)for(m=f.minY;m<=f.maxY;++m)r-p<=a?(0==(l=i.getTile(p,v,m,h,n)).getState()&&(_[l.getKey()]=!0,g.isKeyQueued(l.getKey())||g.enqueue([l,c,s.getTileCoordCenter(l.tileCoord),d])),void 0!==o&&o.call(u,l)):i.useTile(p,v,m,n)};var tr=function(t){Qe.call(this,t),this.transform_=Oh.create()};Gs.inherits(tr,Qe),tr.prototype.clip=function(t,i,s){var h=i.pixelRatio,n=i.size[0]*h,e=i.size[1]*h,r=i.viewState.rotation,a=zh.getTopLeft(s),o=zh.getTopRight(s),u=zh.getBottomRight(s),c=zh.getBottomLeft(s);Oh.apply(i.coordinateToPixelTransform,a),Oh.apply(i.coordinateToPixelTransform,o),Oh.apply(i.coordinateToPixelTransform,u),Oh.apply(i.coordinateToPixelTransform,c),t.save(),Ye.rotateAtOffset(t,-r,n/2,e/2),t.beginPath(),t.moveTo(a[0]*h,a[1]*h),t.lineTo(o[0]*h,o[1]*h),t.lineTo(u[0]*h,u[1]*h),t.lineTo(c[0]*h,c[1]*h),t.clip(),Ye.rotateAtOffset(t,r,n/2,e/2)},tr.prototype.dispatchComposeEvent_=function(t,i,s,h){var n=this.getLayer();if(n.hasListener(t)){var e=s.size[0]*s.pixelRatio,r=s.size[1]*s.pixelRatio,a=s.viewState.rotation;Ye.rotateAtOffset(i,-a,e/2,r/2);var o=void 0!==h?h:this.getTransform(s,0),u=new $e(i,s.pixelRatio,s.extent,o,s.viewState.rotation),c=new qe(t,u,s,i,null);n.dispatchEvent(c),Ye.rotateAtOffset(i,a,e/2,r/2)}},tr.prototype.forEachLayerAtCoordinate=function(t,i,s,h){return this.forEachFeatureAtCoordinate(t,i,0,xh.TRUE,this)?s.call(h,this.getLayer(),null):void 0},tr.prototype.postCompose=function(t,i,s,h){this.dispatchComposeEvent_(ve,t,i,h)},tr.prototype.preCompose=function(t,i,s){this.dispatchComposeEvent_(me,t,i,s)},tr.prototype.dispatchRenderEvent=function(t,i,s){this.dispatchComposeEvent_(pe,t,i,s)},tr.prototype.getTransform=function(t,i){var s=t.viewState,h=t.pixelRatio,n=h/s.resolution;return Oh.compose(this.transform_,h*t.size[0]/2,h*t.size[1]/2,n,-n,-s.rotation,-s.center[0]+i,-s.center[1])},tr.prototype.composeFrame=function(){},tr.prototype.prepareFrame=function(){};var ir=function(t){tr.call(this,t),this.coordinateToCanvasPixelTransform=Oh.create(),this.hitCanvasContext_=null};Gs.inherits(ir,tr),ir.prototype.composeFrame=function(t,i,s){this.preCompose(s,t);var h=this.getImage();if(h){var n=i.extent,e=void 0!==n&&!zh.containsExtent(n,t.extent)&&zh.intersects(n,t.extent);e&&this.clip(s,t,n);var r=this.getImageTransform(),a=s.globalAlpha;s.globalAlpha=i.opacity;var o=r[5],u=h.width*r[0],c=h.height*r[3];s.drawImage(h,0,0,+h.width,+h.height,Math.round(r[4]),Math.round(o),Math.round(u),Math.round(c)),s.globalAlpha=a,e&&s.restore()}this.postCompose(s,t,i)},ir.prototype.getImage=function(){},ir.prototype.getImageTransform=function(){},ir.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=this.getLayer();return e.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,e)}))},ir.prototype.forEachLayerAtCoordinate=function(t,i,s,h){if(this.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Gs.nullFunction)return tr.prototype.forEachLayerAtCoordinate.apply(this,arguments);var n=Oh.apply(this.coordinateToCanvasPixelTransform,t.slice());On.scale(n,i.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Dn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),n[0],n[1],1,1,0,0,1,1);var e=this.hitCanvasContext_.getImageData(0,0,1,1).data;return e[3]>0?s.call(h,this.getLayer(),e):void 0}};var sr=function(t){ir.call(this,t),this.image_=null,this.imageTransform_=Oh.create(),this.skippedFeatures_=[],this.vectorRenderer_=null};Gs.inherits(sr,ir),sr.handles=function(t,i){return t===ne&&(i.getType()===We||i.getType()===Ve&&"image"===i.getRenderMode())},sr.create=function(t,i){var s=new sr(i);if(i.getType()===Ve)for(var h=he.getLayerRendererPlugins(),n=0,e=h.length;n<e;++n){var r=h[n];r!==sr&&r.handles(ne,i)&&s.setVectorRenderer(r.create(t,i))}return s},sr.prototype.getImage=function(){return this.image_?this.image_.getImage():null},sr.prototype.getImageTransform=function(){return this.imageTransform_},sr.prototype.prepareFrame=function(t,i){var s,h=t.pixelRatio,n=t.size,e=t.viewState,r=e.center,a=e.resolution,o=this.getLayer().getSource(),u=t.viewHints,c=t.extent;if(void 0!==i.extent&&(c=zh.getIntersection(c,i.extent)),!u[0]&&!u[1]&&!zh.isEmpty(c)){var l=e.projection;if(!Gs.ENABLE_RASTER_REPROJECTION){var f=o.getProjection();f&&(l=f)}var d=this.vectorRenderer_;if(d){var v=d.context,m=js.assign({},t,{size:[zh.getWidth(c)/a,zh.getHeight(c)/a],viewState:js.assign({},t.viewState,{rotation:0})}),p=Object.keys(m.skippedFeatureUids).sort();!d.prepareFrame(m,i)||!d.replayGroupChanged&&_h.equals(p,this.skippedFeatures_)||(v.canvas.width=m.size[0]*h,v.canvas.height=m.size[1]*h,d.composeFrame(m,i,v),this.image_=new je(c,a,h,v.canvas),this.skippedFeatures_=p)}else(s=o.getImage(c,a,h,l))&&this.loadImage(s)&&(this.image_=s)}if(this.image_){var _=(s=this.image_).getExtent(),g=s.getResolution(),z=s.getPixelRatio(),M=h*g/(a*z),w=Oh.compose(this.imageTransform_,h*n[0]/2,h*n[1]/2,M,M,0,z*(_[0]-r[0])/g,z*(r[1]-_[3])/g);Oh.compose(this.coordinateToCanvasPixelTransform,h*n[0]/2-w[4],h*n[1]/2-w[5],h/a,-h/a,0,-r[0],-r[1]),this.updateLogos(t,o),this.renderedResolution=g*h/z}return!!this.image_},sr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,i,s,h,n):ir.prototype.forEachFeatureAtCoordinate.call(this,t,i,s,h,n)},sr.prototype.setVectorRenderer=function(t){this.vectorRenderer_=t};var hr=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};hr.getKey=function(t,i,s){return i+":"+t+":"+(s?Je.asString(s):"null")},hr.prototype.clear=function(){this.cache_={},this.cacheSize_=0},hr.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t,i=0;for(t in this.cache_)3&i++||this.cache_[t].hasListener()||(delete this.cache_[t],--this.cacheSize_)}},hr.prototype.get=function(t,i,s){var h=hr.getKey(t,i,s);return h in this.cache_?this.cache_[h]:null},hr.prototype.set=function(t,i,s,h){var n=hr.getKey(t,i,s);this.cache_[n]=h,++this.cacheSize_},hr.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var nr={};nr.iconImageCache=new hr;var er=function(t,i){Us.call(this),this.map_=i,this.layerRenderers_={},this.layerRendererListeners_={}};Gs.inherits(er,Us),er.prototype.calculateMatrices2D=function(t){var i=t.viewState,s=t.coordinateToPixelTransform,h=t.pixelToCoordinateTransform;Oh.compose(s,t.size[0]/2,t.size[1]/2,1/i.resolution,-1/i.resolution,-i.rotation,-i.center[0],-i.center[1]),Oh.invert(Oh.setFromArray(h,s))},er.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},er.expireIconCache_=function(){nr.iconImageCache.expire()},er.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a,o=i.viewState,u=o.resolution;function c(t,s){var e=Gs.getUid(t).toString(),r=i.layerStates[Gs.getUid(s)].managed;if(!(e in i.skippedFeatureUids)||r)return h.call(n,t,r?s:null)}var l=o.projection,f=t;if(l.canWrapX()){var d=l.getExtent(),v=zh.getWidth(d),m=t[0];(m<d[0]||m>d[2])&&(f=[m+v*Math.ceil((d[0]-m)/v),t[1]])}var p,_=i.layerStatesArray;for(p=_.length-1;p>=0;--p){var g=_[p],z=g.layer;if(_e.visibleAtResolution(g,u)&&e.call(r,z)){var M=this.getLayerRenderer(z);if(z.getSource()&&(a=M.forEachFeatureAtCoordinate(z.getSource().getWrapX()?f:t,i,s,c,n)),a)return a}}},er.prototype.forEachLayerAtPixel=function(){},er.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){return void 0!==this.forEachFeatureAtCoordinate(t,i,s,xh.TRUE,this,h,n)},er.prototype.getLayerRenderer=function(t){var i=Gs.getUid(t).toString();if(i in this.layerRenderers_)return this.layerRenderers_[i];for(var s,h=he.getLayerRendererPlugins(),n=this.getType(),e=0,r=h.length;e<r;++e){var a=h[e];if(a.handles(n,t)){s=a.create(this,t);break}}if(!s)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[i]=s,this.layerRendererListeners_[i]=Ws.listen(s,Bs,this.handleLayerRendererChange_,this),s},er.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},er.prototype.getLayerRenderers=function(){return this.layerRenderers_},er.prototype.getMap=function(){return this.map_},er.prototype.getType=function(){},er.prototype.handleLayerRendererChange_=function(){this.map_.render()},er.prototype.removeLayerRendererByKey_=function(t){var i=this.layerRenderers_[t];return delete this.layerRenderers_[t],Ws.unlistenByKey(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],i},er.prototype.renderFrame=Gs.nullFunction,er.prototype.removeUnusedLayerRenderers_=function(t,i){var s;for(s in this.layerRenderers_)i&&s in i.layerStates||this.removeLayerRendererByKey_(s).dispose()},er.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(er.expireIconCache_)},er.prototype.scheduleRemoveUnusedLayerRenderers=function(t){var i;for(i in this.layerRenderers_)if(!(i in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},er.sortByZIndex=function(t,i){return t.zIndex-i.zIndex};var rr=function(t,i){er.call(this,t,i),this.context_=Dn(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=de.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=Oh.create()};Gs.inherits(rr,er),rr.handles=function(t){return t===ne},rr.create=function(t,i){return new rr(t,i)},rr.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap(),h=this.context_;if(s.hasListener(t)){var n=i.extent,e=i.pixelRatio,r=i.viewState.rotation,a=this.getTransform(i),o=new $e(h,e,n,a,r),u=new qe(t,o,i,h,null);s.dispatchEvent(u)}},rr.prototype.getTransform=function(t){var i=t.viewState,s=t.pixelRatio/i.resolution;return Oh.compose(this.transform_,this.canvas_.width/2,this.canvas_.height/2,s,-s,-i.rotation,-i.center[0],-i.center[1])},rr.prototype.getType=function(){return ne},rr.prototype.renderFrame=function(t){if(t){var i=this.context_,s=t.pixelRatio,h=Math.round(t.size[0]*s),n=Math.round(t.size[1]*s);this.canvas_.width!=h||this.canvas_.height!=n?(this.canvas_.width=h,this.canvas_.height=n):i.clearRect(0,0,h,n);var e=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchComposeEvent_(me,t);var r=t.layerStatesArray;_h.stableSort(r,er.sortByZIndex),e&&(i.save(),Ye.rotateAtOffset(i,e,h/2,n/2));var a,o,u,c,l=t.viewState.resolution;for(a=0,o=r.length;a<o;++a)u=this.getLayerRenderer((c=r[a]).layer),_e.visibleAtResolution(c,l)&&c.sourceState==Qn&&u.prepareFrame(t,c)&&u.composeFrame(t,c,i);e&&i.restore(),this.dispatchComposeEvent_(ve,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},rr.prototype.forEachLayerAtPixel=function(t,i,s,h,n,e){var r,a,o=i.viewState.resolution,u=i.layerStatesArray,c=u.length,l=Oh.apply(i.pixelToCoordinateTransform,t.slice());for(a=c-1;a>=0;--a){var f=u[a],d=f.layer;if(_e.visibleAtResolution(f,o)&&n.call(e,d)&&(r=this.getLayerRenderer(d).forEachLayerAtCoordinate(l,i,s,h)))return r}};var ar=function(t,i,s,h){this.minX=t,this.maxX=i,this.minY=s,this.maxY=h};ar.createOrUpdate=function(t,i,s,h,n){return void 0!==n?(n.minX=t,n.maxX=i,n.minY=s,n.maxY=h,n):new ar(t,i,s,h)},ar.prototype.contains=function(t){return this.containsXY(t[1],t[2])},ar.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},ar.prototype.containsXY=function(t,i){return this.minX<=t&&t<=this.maxX&&this.minY<=i&&i<=this.maxY},ar.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},ar.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},ar.prototype.getHeight=function(){return this.maxY-this.minY+1},ar.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},ar.prototype.getWidth=function(){return this.maxX-this.minX+1},ar.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var or=function(t){ir.call(this,t),this.context=null===this.context?null:Dn(),this.renderedExtent_=null,this.renderedTiles=[],this.tmpExtent=zh.createEmpty(),this.tmpTileRange_=new ar(0,0,0,0),this.imageTransform_=Oh.create(),this.zDirection=0};Gs.inherits(or,ir),or.handles=function(t,i){return t===ne&&i.getType()===Ue},or.create=function(t,i){return new or(i)},or.prototype.isDrawableTile_=function(t){var i=t.getState(),s=this.getLayer().getUseInterimTilesOnError();return 2==i||4==i||3==i&&!s},or.prototype.prepareFrame=function(t,i){var s=t.pixelRatio,h=t.size,n=t.viewState,e=n.projection,r=n.resolution,a=n.center,o=this.getLayer(),u=o.getSource(),c=u.getRevision(),l=u.getTileGridForProjection(e),f=l.getZForResolution(r,this.zDirection),d=l.getResolution(f),v=Math.round(r/d)||1,m=t.extent;if(void 0!==i.extent&&(m=zh.getIntersection(m,i.extent)),zh.isEmpty(m))return!1;var p=l.getTileRangeForExtentAndZ(m,f),_=l.getTileRangeExtent(f,p),g=u.getTilePixelRatio(s),z={};z[f]={};var M,w,b,x=this.createLoadedTileFinder(u,e,z),y=this.tmpExtent,E=this.tmpTileRange_,S=!1;for(w=p.minX;w<=p.maxX;++w)for(b=p.minY;b<=p.maxY;++b){if(3==(M=u.getTile(f,w,b,s,e)).getState()&&(o.getUseInterimTilesOnError()?o.getPreload()>0&&(S=!0):M.setState(2)),this.isDrawableTile_(M)||(M=M.getInterimTile()),this.isDrawableTile_(M)){var P=Gs.getUid(this);if(2==M.getState()){z[f][M.tileCoord.toString()]=M;var G=M.inTransition(P);S||!G&&-1!==this.renderedTiles.indexOf(M)||(S=!0)}if(1===M.getAlpha(P,t.time))continue}var k=l.getTileCoordChildTileRange(M.tileCoord,E,y),N=!1;k&&(N=x(f+1,k)),N||l.forEachTileCoordParentTileRange(M.tileCoord,x,null,E,y)}var C=d*s/g*v,A=t.viewHints,R=A[0]||A[1];if(!(this.renderedResolution&&Date.now()-t.time>16&&R)&&(S||!this.renderedExtent_||!zh.containsExtent(this.renderedExtent_,m)||this.renderedRevision!=c||v!=this.oversampling_||!R&&C!=this.renderedResolution)){var I=this.context;if(I){var T=u.getTilePixelSize(f,s,e),O=Math.round(p.getWidth()*T[0]/v),F=Math.round(p.getHeight()*T[1]/v),L=I.canvas;L.width!=O||L.height!=F?(this.oversampling_=v,L.width=O,L.height=F):(this.renderedExtent_&&!zh.equals(_,this.renderedExtent_)&&I.clearRect(0,0,O,F),v=this.oversampling_)}this.renderedTiles.length=0;var D,j,W,U,V,q,B,X,H=Object.keys(z).map(Number);for(H.sort((function(t,i){return t===f?1:i===f?-1:t>i?1:t<i?-1:0})),U=0,V=H.length;U<V;++U)for(var Y in j=u.getTilePixelSize(W=H[U],s,e),D=l.getResolution(W)/d,B=g*u.getGutter(e),X=z[W])q=l.getTileCoordExtent((M=X[Y]).getTileCoord(),y),this.drawTileImage(M,t,i,w=(q[0]-_[0])/d*g/v,b=(_[3]-q[3])/d*g/v,j[0]*D/v,j[1]*D/v,B,f===W),this.renderedTiles.push(M);this.renderedRevision=c,this.renderedResolution=d*s/g*v,this.renderedExtent_=_}var J=this.renderedResolution/r,Z=Oh.compose(this.imageTransform_,s*h[0]/2,s*h[1]/2,J,J,0,(this.renderedExtent_[0]-a[0])/this.renderedResolution*s,(a[1]-this.renderedExtent_[3])/this.renderedResolution*s);return Oh.compose(this.coordinateToCanvasPixelTransform,s*h[0]/2-Z[4],s*h[1]/2-Z[5],s/r,-s/r,0,-a[0],-a[1]),this.updateUsedTiles(t.usedTiles,u,f,p),this.manageTilePyramid(t,u,l,s,e,m,f,o.getPreload()),this.scheduleExpireCache(t,u),this.updateLogos(t,u),this.renderedTiles.length>0},or.prototype.drawTileImage=function(t,i,s,h,n,e,r,a,o){var u=t.getImage(this.getLayer());if(u){var c=Gs.getUid(this),l=o?t.getAlpha(c,i.time):1;1!==l||this.getLayer().getSource().getOpaque(i.viewState.projection)||this.context.clearRect(h,n,e,r);var f=l!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=l),this.context.drawImage(u,a,a,u.width-2*a,u.height-2*a,h,n,e,r),f&&this.context.restore(),1!==l?i.animate=!0:o&&t.endTransition(c)}},or.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},or.prototype.getImageTransform=function(){return this.imageTransform_};var ur,cr,lr,fr={exports:{}};function dr(){return ur||(ur=1,fr.exports=function(){function t(s,h,n,e,r){for(;e>n;){if(e-n>600){var a=e-n+1,o=h-n+1,u=Math.log(a),c=.5*Math.exp(2*u/3),l=.5*Math.sqrt(u*c*(a-c)/a)*(o-a/2<0?-1:1);t(s,h,Math.max(n,Math.floor(h-o*c/a+l)),Math.min(e,Math.floor(h+(a-o)*c/a+l)),r)}var f=s[h],d=n,v=e;for(i(s,n,h),r(s[e],f)>0&&i(s,n,e);d<v;){for(i(s,d,v),d++,v--;r(s[d],f)<0;)d++;for(;r(s[v],f)>0;)v--}0===r(s[n],f)?i(s,n,v):i(s,++v,e),v<=h&&(n=v+1),h<=v&&(e=v-1)}}function i(t,i,s){var h=t[i];t[i]=t[s],t[s]=h}function s(t,i){return t<i?-1:t>i?1:0}return function(i,h,n,e,r){t(i,h,n||0,e||i.length-1,r||s)}}()),fr.exports}var vr=function(){if(lr)return cr;lr=1,cr=i;var t=dr();function i(t,s){if(!(this instanceof i))return new i(t,s);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),s&&this._initFormat(s),this.clear()}function s(t,i,s){if(!s)return i.indexOf(t);for(var h=0;h<i.length;h++)if(s(t,i[h]))return h;return-1}function h(t,i){n(t,0,t.children.length,i,t)}function n(t,i,s,h,n){n||(n=f(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(var r,a=i;a<s;a++)r=t.children[a],e(n,t.leaf?h(r):r);return n}function e(t,i){return t.minX=Math.min(t.minX,i.minX),t.minY=Math.min(t.minY,i.minY),t.maxX=Math.max(t.maxX,i.maxX),t.maxY=Math.max(t.maxY,i.maxY),t}function r(t,i){return t.minX-i.minX}function a(t,i){return t.minY-i.minY}function o(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function u(t){return t.maxX-t.minX+(t.maxY-t.minY)}function c(t,i){return t.minX<=i.minX&&t.minY<=i.minY&&i.maxX<=t.maxX&&i.maxY<=t.maxY}function l(t,i){return i.minX<=t.maxX&&i.minY<=t.maxY&&i.maxX>=t.minX&&i.maxY>=t.minY}function f(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(i,s,h,n,e){for(var r,a=[s,h];a.length;)(h=a.pop())-(s=a.pop())<=n||(r=s+Math.ceil((h-s)/n/2)*n,t(i,r,s,h,e),a.push(s,r,r,h))}return i.prototype={all:function(){return this._all(this.data,[])},search:function(t){var i=this.data,s=[],h=this.toBBox;if(!l(t,i))return s;for(var n,e,r,a,o=[];i;){for(n=0,e=i.children.length;n<e;n++)r=i.children[n],l(t,a=i.leaf?h(r):r)&&(i.leaf?s.push(r):c(t,a)?this._all(r,s):o.push(r));i=o.pop()}return s},collides:function(t){var i=this.data,s=this.toBBox;if(!l(t,i))return!1;for(var h,n,e,r,a=[];i;){for(h=0,n=i.children.length;h<n;h++)if(e=i.children[h],l(t,r=i.leaf?s(e):e)){if(i.leaf||c(t,r))return!0;a.push(e)}i=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var i=0,s=t.length;i<s;i++)this.insert(t[i]);return this}var h=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===h.height)this._splitRoot(this.data,h);else{if(this.data.height<h.height){var n=this.data;this.data=h,h=n}this._insert(h,this.data.height-h.height-1,!0)}else this.data=h;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=f([]),this},remove:function(t,i){if(!t)return this;for(var h,n,e,r,a=this.data,o=this.toBBox(t),u=[],l=[];a||u.length;){if(a||(a=u.pop(),n=u[u.length-1],h=l.pop(),r=!0),a.leaf&&-1!==(e=s(t,a.children,i)))return a.children.splice(e,1),u.push(a),this._condense(u),this;r||a.leaf||!c(a,o)?n?(h++,a=n.children[h],r=!1):a=null:(u.push(a),l.push(h),h=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:r,compareMinY:a,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,i){for(var s=[];t;)t.leaf?i.push.apply(i,t.children):s.push.apply(s,t.children),t=s.pop();return i},_build:function(t,i,s,n){var e,r=s-i+1,a=this._maxEntries;if(r<=a)return h(e=f(t.slice(i,s+1)),this.toBBox),e;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(e=f([])).leaf=!1,e.height=n;var o,u,c,l,v=Math.ceil(r/a),m=v*Math.ceil(Math.sqrt(a));for(d(t,i,s,m,this.compareMinX),o=i;o<=s;o+=m)for(d(t,o,c=Math.min(o+m-1,s),v,this.compareMinY),u=o;u<=c;u+=v)l=Math.min(u+v-1,c),e.children.push(this._build(t,u,l,n-1));return h(e,this.toBBox),e},_chooseSubtree:function(t,i,s,h){for(var n,e,r,a,u,c,l,f,d,v;h.push(i),!i.leaf&&h.length-1!==s;){for(l=f=1/0,n=0,e=i.children.length;n<e;n++)u=o(r=i.children[n]),d=t,v=r,(c=(Math.max(v.maxX,d.maxX)-Math.min(v.minX,d.minX))*(Math.max(v.maxY,d.maxY)-Math.min(v.minY,d.minY))-u)<f?(f=c,l=u<l?u:l,a=r):c===f&&u<l&&(l=u,a=r);i=a||i.children[0]}return i},_insert:function(t,i,s){var h=s?t:(0,this.toBBox)(t),n=[],r=this._chooseSubtree(h,this.data,i,n);for(r.children.push(t),e(r,h);i>=0&&n[i].children.length>this._maxEntries;)this._split(n,i),i--;this._adjustParentBBoxes(h,n,i)},_split:function(t,i){var s=t[i],n=s.children.length,e=this._minEntries;this._chooseSplitAxis(s,e,n);var r=this._chooseSplitIndex(s,e,n),a=f(s.children.splice(r,s.children.length-r));a.height=s.height,a.leaf=s.leaf,h(s,this.toBBox),h(a,this.toBBox),i?t[i-1].children.push(a):this._splitRoot(s,a)},_splitRoot:function(t,i){this.data=f([t,i]),this.data.height=t.height+1,this.data.leaf=!1,h(this.data,this.toBBox)},_chooseSplitIndex:function(t,i,s){var h,e,r,a,u,c,l,f,d,v,m,p,_,g;for(c=l=1/0,h=i;h<=s-i;h++)d=e=n(t,0,h,this.toBBox),v=r=n(t,h,s,this.toBBox),void 0,void 0,void 0,void 0,m=Math.max(d.minX,v.minX),p=Math.max(d.minY,v.minY),_=Math.min(d.maxX,v.maxX),g=Math.min(d.maxY,v.maxY),a=Math.max(0,_-m)*Math.max(0,g-p),u=o(e)+o(r),a<c?(c=a,f=h,l=u<l?u:l):a===c&&u<l&&(l=u,f=h);return f},_chooseSplitAxis:function(t,i,s){var h=t.leaf?this.compareMinX:r,n=t.leaf?this.compareMinY:a;this._allDistMargin(t,i,s,h)<this._allDistMargin(t,i,s,n)&&t.children.sort(h)},_allDistMargin:function(t,i,s,h){t.children.sort(h);var r,a,o=this.toBBox,c=n(t,0,i,o),l=n(t,s-i,s,o),f=u(c)+u(l);for(r=i;r<s-i;r++)a=t.children[r],e(c,t.leaf?o(a):a),f+=u(c);for(r=s-i-1;r>=i;r--)a=t.children[r],e(l,t.leaf?o(a):a),f+=u(l);return f},_adjustParentBBoxes:function(t,i,s){for(var h=s;h>=0;h--)e(i[h],t)},_condense:function(t){for(var i,s=t.length-1;s>=0;s--)0===t[s].children.length?s>0?(i=t[s-1].children).splice(i.indexOf(t[s]),1):this.clear():h(t[s],this.toBBox)},_initFormat:function(t){var i=["return a"," - b",";"];this.compareMinX=new Function("a","b",i.join(t[0])),this.compareMinY=new Function("a","b",i.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}},cr}(),mr=d(vr),pr=function(){};pr.prototype.getReplay=function(){},pr.prototype.isEmpty=function(){};var _r="Circle",gr="Default",zr="Image",Mr="LineString",wr="Polygon",br="Text",xr={lineString:function(t,i,s,h){var n,e=t[i],r=t[i+1],a=0;for(n=i+h;n<s;n+=h){var o=t[n],u=t[n+1];a+=Math.sqrt((o-e)*(o-e)+(u-r)*(u-r)),e=o,r=u}return a},linearRing:function(t,i,s,h){var n=xr.lineString(t,i,s,h),e=t[s-h]-t[i],r=t[s-h+1]-t[i+1];return n+Math.sqrt(e*e+r*r)}},yr=function(t,i,s,h,n,e,r,a){for(var o,u,c=[],l=t[i]>t[s-h],f=n.length,d=t[i],v=t[i+1],m=t[i+=h],p=t[i+1],_=0,g=Math.sqrt(Math.pow(m-d,2)+Math.pow(p-v,2)),z="",M=0,w=0;w<f;++w){var b=n.charAt(l?f-w-1:w),x=e(z=l?b+z:z+b)-M;M+=x;for(var y=r+x/2;i<s-h&&_+g<y;)d=m,v=p,m=t[i+=h],p=t[i+1],_+=g,g=Math.sqrt(Math.pow(m-d,2)+Math.pow(p-v,2));var E=y-_,S=Math.atan2(p-v,m-d);if(l&&(S+=S>0?-Math.PI:Math.PI),void 0!==u){var P=S-u;if(P+=P>Math.PI?-2*Math.PI:P<-Math.PI?2*Math.PI:0,Math.abs(P)>a)return null}var G=E/g,k=rh.lerp(d,m,G),N=rh.lerp(v,p,G);u==S?(l&&(o[0]=k,o[1]=N,o[2]=x/2),o[4]=z):(M=x,o=[k,N,x/2,S,z=b],l?c.unshift(o):c.push(o),u=S),r+=x}return c},Er=11,Sr=12,Pr={};Pr.ORDER=[wr,_r,Mr,zr,br,gr],Pr.TEXT_ALIGN={},Pr.TEXT_ALIGN.left=0,Pr.TEXT_ALIGN.end=0,Pr.TEXT_ALIGN.center=.5,Pr.TEXT_ALIGN.right=1,Pr.TEXT_ALIGN.start=1,Pr.TEXT_ALIGN.top=0,Pr.TEXT_ALIGN.middle=.5,Pr.TEXT_ALIGN.hanging=.2,Pr.TEXT_ALIGN.alphabetic=.8,Pr.TEXT_ALIGN.ideographic=.8,Pr.TEXT_ALIGN.bottom=1;var Gr=function(t,i,s,h,n,e){Ke.call(this),this.declutterTree=e,this.tmpExtent_=zh.createEmpty(),this.tolerance=t,this.maxExtent=i,this.overlaps=n,this.pixelRatio=h,this.maxLineWidth=0,this.resolution=s,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=Oh.create(),this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0,this.tmpLocalTransform_=Oh.create(),this.resetTransform_=Oh.create()};Gs.inherits(Gr,Ke),Gr.prototype.replayTextBackground_=function(t,i,s,h,n,e,r){t.beginPath(),t.moveTo.apply(t,i),t.lineTo.apply(t,s),t.lineTo.apply(t,h),t.lineTo.apply(t,n),t.lineTo.apply(t,i),e&&(this.fillOrigin_=e[2],this.fill_(t)),r&&(this.setStrokeStyle_(t,r),t.stroke())},Gr.prototype.replayImage_=function(t,i,s,h,n,e,r,a,o,u,c,l,f,d,v,m,p,_){var g=p||_,z=this.tmpLocalTransform_;i-=n*=f,s-=e*=f,d&&(i=Math.round(i),s=Math.round(s));var M,w,b,x,y=v+u>h.width?h.width-u:v,E=a+c>h.height?h.height-c:a,S=this.tmpExtent_,P=m[3]+y*f+m[1],G=m[0]+E*f+m[2],k=i-m[3],N=s-m[0];(g||0!==l)&&(M=[k,N],w=[k+P,N],b=[k+P,N+G],x=[k,N+G]);var C=null;if(0!==l){var A=i+n,R=s+e;C=Oh.compose(z,A,R,1,1,l,-A,-R),zh.createOrUpdateEmpty(S),zh.extendCoordinate(S,Oh.apply(z,M)),zh.extendCoordinate(S,Oh.apply(z,w)),zh.extendCoordinate(S,Oh.apply(z,b)),zh.extendCoordinate(S,Oh.apply(z,x))}else zh.createOrUpdate(k,N,k+P,N+G,S);var I=t.canvas,T=S[0]<=I.width&&S[2]>=0&&S[1]<=I.height&&S[3]>=0;if(r){if(!T&&1==r[4])return;zh.extend(r,S);var O=T?[t,C?C.slice(0):null,o,h,u,c,y,E,i,s,f]:null;O&&g&&O.push(p,_,M,w,b,x),r.push(O)}else T&&(g&&this.replayTextBackground_(t,M,w,b,x,p,_),Ye.drawImage(t,C,o,h,u,c,y,E,i,s,f))},Gr.prototype.applyPixelRatio=function(t){var i=this.pixelRatio;return 1==i?t:t.map((function(t){return t*i}))},Gr.prototype.appendFlatCoordinates=function(t,i,s,h,n,e){var r=this.coordinates.length,a=this.getBufferedMaxExtent();e&&(i+=h);var o,u,c,l=[t[i],t[i+1]],f=[NaN,NaN],d=!0;for(o=i+h;o<s;o+=h)f[0]=t[o],f[1]=t[o+1],(c=zh.coordinateRelationship(a,f))!==u?(d&&(this.coordinates[r++]=l[0],this.coordinates[r++]=l[1]),this.coordinates[r++]=f[0],this.coordinates[r++]=f[1],d=!1):1===c?(this.coordinates[r++]=f[0],this.coordinates[r++]=f[1],d=!1):d=!0,l[0]=f[0],l[1]=f[1],u=c;return(n&&d||o===i+h)&&(this.coordinates[r++]=l[0],this.coordinates[r++]=l[1]),r},Gr.prototype.drawCustomCoordinates_=function(t,i,s,h,n){for(var e=0,r=s.length;e<r;++e){var a=s[e],o=this.appendFlatCoordinates(t,i,a,h,!1,!1);n.push(o),i=a}return i},Gr.prototype.drawCustom=function(t,i,s){this.beginGeometry(t,i);var h,n,e,r,a,o=t.getType(),u=t.getStride(),c=this.coordinates.length;if(o==dh){h=t.getOrientedFlatCoordinates(),r=[];var l=t.getEndss();a=0;for(var f=0,d=l.length;f<d;++f){var v=[];a=this.drawCustomCoordinates_(h,a,l[f],u,v),r.push(v)}this.instructions.push([4,c,r,t,s,Uh.coordinatesss])}else o==ch||o==fh?(e=[],h=o==ch?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(h,0,t.getEnds(),u,e),this.instructions.push([4,c,e,t,s,Uh.coordinatess])):o==oh||o==lh?(h=t.getFlatCoordinates(),n=this.appendFlatCoordinates(h,0,h.length,u,!1,!1),this.instructions.push([4,c,n,t,s,Uh.coordinates])):o==ah&&(h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),this.instructions.push([4,c,n=this.coordinates.length,t,s]));this.endGeometry(t,i)},Gr.prototype.beginGeometry=function(t,i){this.beginGeometryInstruction1_=[0,i,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[0,i,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},Gr.prototype.fill_=function(t){if(this.fillOrigin_){var i=Oh.apply(this.renderedTransform_,this.fillOrigin_.slice());t.translate(i[0],i[1]),t.rotate(this.viewRotation_)}t.fill(),this.fillOrigin_&&t.setTransform.apply(t,Ye.resetTransform_)},Gr.prototype.setStrokeStyle_=function(t,i){t.strokeStyle=i[1],t.lineWidth=i[2],t.lineCap=i[3],t.lineJoin=i[4],t.miterLimit=i[5],tn.CANVAS_LINE_DASH&&(t.lineDashOffset=i[7],t.setLineDash(i[6]))},Gr.prototype.renderDeclutter_=function(t,i){if(t&&t.length>5){var s=t[4];if(1==s||s==t.length-5){var h={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};if(!this.declutterTree.collides(h)){this.declutterTree.insert(h);for(var n=Ye.drawImage,e=5,r=t.length;e<r;++e){var a=t[e];a&&(a.length>11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),n.apply(void 0,a))}}t.length=5,zh.createOrUpdateEmpty(t)}}},Gr.prototype.replay_=function(t,i,s,h,n,e){var r;this.pixelCoordinates_&&_h.equals(i,this.renderedTransform_)?r=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),r=yh(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Oh.setFromArray(this.renderedTransform_,i));for(var a,o,u,c,l,f,d,v,m,p=!js.isEmpty(s),_=0,g=h.length,z=0,M=0,w=0,b=null,x=null,y=this.coordinateCache_,E=this.viewRotation_,S={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:E},P=this.instructions!=h||this.overlaps?0:200;_<g;){var G,k,N,C=h[_];switch(C[0]){case 0:G=C[1],p&&s[Gs.getUid(G).toString()]||!G.getGeometry()?_=C[2]:void 0===e||zh.intersects(e,G.getGeometry().getExtent())?++_:_=C[2]+1;break;case 1:M>P&&(this.fill_(t),M=0),w>P&&(t.stroke(),w=0),M||w||(t.beginPath(),c=l=NaN),++_;break;case 2:var A=r[z=C[1]],R=r[z+1],I=r[z+2]-A,T=r[z+3]-R,O=Math.sqrt(I*I+T*T);t.moveTo(A+O,R),t.arc(A,R,O,0,2*Math.PI,!0),++_;break;case 3:t.closePath(),++_;break;case 4:z=C[1],a=C[2];var F=C[4],L=6==C.length?C[5]:void 0;S.geometry=C[3],S.feature=G,_ in y||(y[_]=[]);var D=y[_];L?L(r,z,a,2,D):(D[0]=r[z],D[1]=r[z+1],D.length=2),F(D,S),++_;break;case 6:z=C[1],a=C[2],m=C[3],o=C[4],u=C[5],v=n?null:C[6];var j,W,U,V=C[7],q=C[8],B=C[9],X=C[10],H=C[12],Y=C[13],J=C[14],Z=C[15];for(C.length>16?(j=C[16],W=C[17],U=C[18]):(j=Ye.defaultPadding,W=U=!1),C[11]&&(H+=E);z<a;z+=2)this.replayImage_(t,r[z],r[z+1],m,o,u,v,V,q,B,X,H,Y,J,Z,j,W?b:null,U?x:null);this.renderDeclutter_(v,G),++_;break;case 5:var K=C[1],$=C[2],Q=C[3];v=n?null:C[4];var tt=C[5],it=C[6],st=C[7],ht=C[8],nt=C[9],et=C[10],rt=C[11],at=C[12],ot=C[13],ut=C[14],ct=xr.lineString(r,K,$,2),lt=ht(at);if(tt||lt<=ct){var ft=yr(r,K,$,2,at,ht,(ct-lt)*Pr.TEXT_ALIGN[this.textStates[ot].textAlign],st);if(ft){var dt,vt,mt,pt;if(et)for(dt=0,vt=ft.length;dt<vt;++dt)mt=this.getImage((pt=ft[dt])[4],ot,"",et),this.replayImage_(t,pt[0],pt[1],mt,o=pt[2]+rt,u=Q*mt.height+2*(.5-Q)*rt-nt,v,mt.height,1,0,0,pt[3],ut,!1,mt.width,Ye.defaultPadding,null,null);if(it)for(dt=0,vt=ft.length;dt<vt;++dt)mt=this.getImage((pt=ft[dt])[4],ot,it,""),this.replayImage_(t,pt[0],pt[1],mt,o=pt[2],u=Q*mt.height-nt,v,mt.height,1,0,0,pt[3],ut,!1,mt.width,Ye.defaultPadding,null,null)}}this.renderDeclutter_(v,G),++_;break;case 7:if(void 0!==n){var _t=n(G=C[1]);if(_t)return _t}++_;break;case 8:P?M++:this.fill_(t),++_;break;case 9:for(a=C[2],d=(N=r[(z=C[1])+1])+.5|0,(f=(k=r[z])+.5|0)===c&&d===l||(t.moveTo(k,N),c=f,l=d),z+=2;z<a;z+=2)f=(k=r[z])+.5|0,d=(N=r[z+1])+.5|0,z!=a-2&&f===c&&d===l||(t.lineTo(k,N),c=f,l=d);++_;break;case 10:b=C,this.fillOrigin_=C[2],M&&(this.fill_(t),M=0,w&&(t.stroke(),w=0)),t.fillStyle=C[1],++_;break;case Er:x=C,w&&(t.stroke(),w=0),this.setStrokeStyle_(t,C),++_;break;case Sr:P?w++:t.stroke(),++_;break;default:++_}}M&&this.fill_(t),w&&t.stroke()},Gr.prototype.replay=function(t,i,s,h){this.viewRotation_=s,this.replay_(t,i,h,this.instructions,void 0,void 0)},Gr.prototype.replayHitDetection=function(t,i,s,h,n,e){return this.viewRotation_=s,this.replay_(t,i,h,this.hitDetectionInstructions,n,e)},Gr.prototype.reverseHitDetectionInstructions=function(){var t,i=this.hitDetectionInstructions;i.reverse();var s,h,n=i.length,e=-1;for(t=0;t<n;++t)7==(h=(s=i[t])[0])?e=t:0==h&&(s[2]=t,_h.reverseSubArray(this.hitDetectionInstructions,e,t),e=-1)},Gr.prototype.setFillStrokeStyle=function(t,i){var s=this.state;if(t){var h=t.getColor();s.fillStyle=Ze.asColorLike(h||Ye.defaultFillStyle)}else s.fillStyle=void 0;if(i){var n=i.getColor();s.strokeStyle=Ze.asColorLike(n||Ye.defaultStrokeStyle);var e=i.getLineCap();s.lineCap=void 0!==e?e:Ye.defaultLineCap;var r=i.getLineDash();s.lineDash=r?r.slice():Ye.defaultLineDash;var a=i.getLineDashOffset();s.lineDashOffset=a||Ye.defaultLineDashOffset;var o=i.getLineJoin();s.lineJoin=void 0!==o?o:Ye.defaultLineJoin;var u=i.getWidth();s.lineWidth=void 0!==u?u:Ye.defaultLineWidth;var c=i.getMiterLimit();s.miterLimit=void 0!==c?c:Ye.defaultMiterLimit,s.lineWidth>this.maxLineWidth&&(this.maxLineWidth=s.lineWidth,this.bufferedMaxExtent_=null)}else s.strokeStyle=void 0,s.lineCap=void 0,s.lineDash=null,s.lineDashOffset=void 0,s.lineJoin=void 0,s.lineWidth=void 0,s.miterLimit=void 0},Gr.prototype.applyFill=function(t,i){var s=t.fillStyle,h=[10,s];if("string"!=typeof s){var n=i.getExtent();h.push([n[0],n[3]])}this.instructions.push(h)},Gr.prototype.applyStroke=function(t){this.instructions.push([Er,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])},Gr.prototype.updateFillStyle=function(t,i,s){var h=t.fillStyle;"string"==typeof h&&t.currentFillStyle==h||(i.call(this,t,s),t.currentFillStyle=h)},Gr.prototype.updateStrokeStyle=function(t,i){var s=t.strokeStyle,h=t.lineCap,n=t.lineDash,e=t.lineDashOffset,r=t.lineJoin,a=t.lineWidth,o=t.miterLimit;(t.currentStrokeStyle!=s||t.currentLineCap!=h||n!=t.currentLineDash&&!_h.equals(t.currentLineDash,n)||t.currentLineDashOffset!=e||t.currentLineJoin!=r||t.currentLineWidth!=a||t.currentMiterLimit!=o)&&(i.call(this,t),t.currentStrokeStyle=s,t.currentLineCap=h,t.currentLineDash=n,t.currentLineDashOffset=e,t.currentLineJoin=r,t.currentLineWidth=a,t.currentMiterLimit=o)},Gr.prototype.endGeometry=function(t,i){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var s=[7,i];this.instructions.push(s),this.hitDetectionInstructions.push(s)},Gr.prototype.finish=Gs.nullFunction,Gr.prototype.getBufferedMaxExtent=function(){return this.bufferedMaxExtent_||(this.bufferedMaxExtent_=zh.clone(this.maxExtent),this.maxLineWidth>0&&zh.buffer(this.bufferedMaxExtent_,this.resolution*(this.maxLineWidth+1)/2,this.bufferedMaxExtent_)),this.bufferedMaxExtent_};var kr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.snapToPixel_=void 0,this.width_=void 0};Gs.inherits(kr,Gr),kr.prototype.drawCoordinates_=function(t,i,s,h){return this.appendFlatCoordinates(t,i,s,h,!1,!1)},kr.prototype.drawPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,e=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,e,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,e,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},kr.prototype.drawMultiPoint=function(t,i){if(this.image_){this.beginGeometry(t,i);var s=t.getFlatCoordinates(),h=t.getStride(),n=this.coordinates.length,e=this.drawCoordinates_(s,0,s.length,h);this.instructions.push([6,n,e,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([6,n,e,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,i)}},kr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.snapToPixel_=void 0,this.width_=void 0},kr.prototype.setImageStyle=function(t,i){var s=t.getAnchor(),h=t.getSize(),n=t.getHitDetectionImage(1),e=t.getImage(1),r=t.getOrigin();this.anchorX_=s[0],this.anchorY_=s[1],this.declutterGroup_=i,this.hitDetectionImage_=n,this.image_=e,this.height_=h[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.snapToPixel_=t.getSnapToPixel(),this.width_=h[0]};var Nr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e)};Gs.inherits(Nr,Gr),Nr.prototype.drawFlatCoordinates_=function(t,i,s,h){var n=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,s,h,!1,!1)];return this.instructions.push(n),this.hitDetectionInstructions.push(n),s},Nr.prototype.drawLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h=t.getFlatCoordinates(),n=t.getStride();this.drawFlatCoordinates_(h,0,h.length,n),this.hitDetectionInstructions.push([Sr]),this.endGeometry(t,i)}},Nr.prototype.drawMultiLineString=function(t,i){var s=this.state;if(void 0!==s.strokeStyle&&void 0!==s.lineWidth){this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,i),this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset],[1]);var h,n,e=t.getEnds(),r=t.getFlatCoordinates(),a=t.getStride(),o=0;for(h=0,n=e.length;h<n;++h)o=this.drawFlatCoordinates_(r,o,e[h],a);this.hitDetectionInstructions.push([Sr]),this.endGeometry(t,i)}},Nr.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push([Sr]),this.reverseHitDetectionInstructions(),this.state=null},Nr.prototype.applyStroke=function(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push([Sr]),t.lastStroke=this.coordinates.length),t.lastStroke=0,Gr.prototype.applyStroke.call(this,t),this.instructions.push([1])};var Cr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e)};Gs.inherits(Cr,Gr),Cr.prototype.drawFlatCoordinatess_=function(t,i,s,h){var n=this.state,e=void 0!==n.fillStyle,r=null!=n.strokeStyle,a=s.length,o=[1];this.instructions.push(o),this.hitDetectionInstructions.push(o);for(var u=0;u<a;++u){var c=s[u],l=[9,this.coordinates.length,this.appendFlatCoordinates(t,i,c,h,!0,!r)];if(this.instructions.push(l),this.hitDetectionInstructions.push(l),r){var f=[3];this.instructions.push(f),this.hitDetectionInstructions.push(f)}i=c}var d=[8];if(this.hitDetectionInstructions.push(d),e&&this.instructions.push(d),r){var v=[Sr];this.instructions.push(v),this.hitDetectionInstructions.push(v)}return i},Cr.prototype.drawCircle=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getFlatCoordinates(),n=t.getStride(),e=this.coordinates.length;this.appendFlatCoordinates(h,0,h.length,n,!1,!1);var r=[1],a=[2,e];this.instructions.push(r,a),this.hitDetectionInstructions.push(r,a);var o=[8];if(this.hitDetectionInstructions.push(o),void 0!==s.fillStyle&&this.instructions.push(o),void 0!==s.strokeStyle){var u=[Sr];this.instructions.push(u),this.hitDetectionInstructions.push(u)}this.endGeometry(t,i)}},Cr.prototype.drawPolygon=function(t,i){var s=this.state;this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h=t.getEnds(),n=t.getOrientedFlatCoordinates(),e=t.getStride();this.drawFlatCoordinatess_(n,0,h,e),this.endGeometry(t,i)},Cr.prototype.drawMultiPolygon=function(t,i){var s=this.state;if(void 0!==s.fillStyle||void 0!==s.strokeStyle){this.setFillStrokeStyles_(t),this.beginGeometry(t,i),this.hitDetectionInstructions.push([10,Je.asString(Ye.defaultFillStyle)]),void 0!==s.strokeStyle&&this.hitDetectionInstructions.push([Er,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,s.lineDash,s.lineDashOffset]);var h,n,e=t.getEndss(),r=t.getOrientedFlatCoordinates(),a=t.getStride(),o=0;for(h=0,n=e.length;h<n;++h)o=this.drawFlatCoordinatess_(r,o,e[h],a);this.endGeometry(t,i)}},Cr.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t){var i,s,h=this.coordinates;for(i=0,s=h.length;i<s;++i)h[i]=Vh.snap(h[i],t)}},Cr.prototype.setFillStrokeStyles_=function(t){var i=this.state;void 0!==i.fillStyle&&this.updateFillStyle(i,this.applyFill,t),void 0!==i.strokeStyle&&this.updateStrokeStyle(i,this.applyStroke)};var Ar=function(t,i,s,h,n){var e,r,a,o,u,c,l,f,d,v=s,m=s,p=0,_=0,g=s;for(e=s;e<h;e+=n){var z=i[e],M=i[e+1];void 0!==o&&(f=z-o,d=M-u,a=Math.sqrt(f*f+d*d),void 0!==c&&(_+=r,Math.acos((c*f+l*d)/(r*a))>t&&(_>p&&(p=_,v=g,m=e),_=0,g=e-n)),r=a,c=f,l=d),o=z,u=M}return(_+=a)>p?[g,e]:[v,m]},Rr=function(t,i,s,h,n,e){Gr.call(this,t,i,s,h,n,e),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},Ye.labelCache.prune()};Gs.inherits(Rr,Gr),Rr.measureTextWidths=function(t,i,s){var h,n,e=i.length,r=0;for(n=0;n<e;++n)h=Ye.measureTextWidth(t,i[n]),r=Math.max(r,h),s.push(h);return r},Rr.prototype.drawText=function(t,i){var s=this.textState_;if(""!==this.text_&&s&&(this.textFillState_||this.textStrokeState_)){var h,n,e=this.coordinates.length,r=t.getType(),a=null,o=2,u=2;if("line"===s.placement){if(!zh.intersects(this.getBufferedMaxExtent(),t.getExtent()))return;var c;if(a=t.getFlatCoordinates(),u=t.getStride(),r==oh)c=[a.length];else if(r==fh)c=t.getEnds();else if(r==ch)c=t.getEnds().slice(0,1);else if(r==dh){var l=t.getEndss();for(c=[],h=0,n=l.length;h<n;++h)c.push(l[h][0])}this.beginGeometry(t,i);for(var f,d=s.textAlign,v=0,m=0,p=c.length;m<p;++m){if(null==d){var _=Ar(s.maxAngle,a,v,c[m],u);v=_[0],f=_[1]}else f=c[m];for(h=v;h<f;h+=u)this.coordinates.push(a[h],a[h+1]);v=c[m],this.drawChars_(e,o=this.coordinates.length,this.declutterGroup_),e=o}this.endGeometry(t,i)}else{var g=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),z=g.width/this.pixelRatio;switch(r){case ah:case lh:o=(a=t.getFlatCoordinates()).length;break;case oh:a=t.getFlatMidpoint();break;case mh:a=t.getCenter();break;case fh:o=(a=t.getFlatMidpoints()).length;break;case ch:if(a=t.getFlatInteriorPoint(),!s.overflow&&a[2]/this.resolution<z)return;u=3;break;case dh:var M=t.getFlatInteriorPoints();for(a=[],h=0,n=M.length;h<n;h+=3)(s.overflow||M[h+2]/this.resolution>=z)&&a.push(M[h],M[h+1]);if(0==(o=a.length))return}o=this.appendFlatCoordinates(a,0,o,u,!1,!1),this.beginGeometry(t,i),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,t),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(g,e,o),this.endGeometry(t,i)}}},Rr.prototype.getImage=function(t,i,s,h){var n,e=h+i+t+s+this.pixelRatio,r=Ye.labelCache;if(!r.containsKey(e)){var a=h?this.strokeStates[h]||this.textStrokeState_:null,o=s?this.fillStates[s]||this.textFillState_:null,u=this.textStates[i]||this.textState_,c=u.scale*this.pixelRatio,l=Pr.TEXT_ALIGN[u.textAlign||Ye.defaultTextAlign],f=h&&a.lineWidth?a.lineWidth:0,d=t.split("\n"),v=d.length,m=[],p=Rr.measureTextWidths(u.font,d,m),_=Ye.measureTextHeight(u.font),g=_*v,z=Dn(Math.ceil((p+f)*c),Math.ceil((g+f)*c));r.set(e,n=z.canvas),1!=c&&z.scale(c,c),z.font=u.font,h&&(z.strokeStyle=a.strokeStyle,z.lineWidth=f*(tn.SAFARI?c:1),z.lineCap=a.lineCap,z.lineJoin=a.lineJoin,z.miterLimit=a.miterLimit,tn.CANVAS_LINE_DASH&&a.lineDash.length&&(z.setLineDash(a.lineDash),z.lineDashOffset=a.lineDashOffset)),s&&(z.fillStyle=o.fillStyle),z.textBaseline="middle",z.textAlign="center";var M,w=.5-l,b=l*n.width/c+w*f;if(h)for(M=0;M<v;++M)z.strokeText(d[M],b+w*m[M],.5*(f+_)+M*_);if(s)for(M=0;M<v;++M)z.fillText(d[M],b+w*m[M],.5*(f+_)+M*_)}return r.get(e)},Rr.prototype.drawTextImage_=function(t,i,s){var h=this.textState_,n=this.textStrokeState_,e=this.pixelRatio,r=Pr.TEXT_ALIGN[h.textAlign||Ye.defaultTextAlign],a=Pr.TEXT_ALIGN[h.textBaseline],o=n&&n.lineWidth?n.lineWidth:0,u=r*t.width/e+2*(.5-r)*o,c=a*t.height/e+2*(.5-a)*o;this.instructions.push([6,i,s,t,(u-this.textOffsetX_)*e,(c-this.textOffsetY_)*e,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,!0,t.width,h.padding==Ye.defaultPadding?Ye.defaultPadding:h.padding.map((function(t){return t*e})),!!h.backgroundFill,!!h.backgroundStroke]),this.hitDetectionInstructions.push([6,i,s,t,(u-this.textOffsetX_)*e,(c-this.textOffsetY_)*e,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/e,!0,t.width,h.padding,!!h.backgroundFill,!!h.backgroundStroke])},Rr.prototype.drawChars_=function(t,i,s){var h=this.textStrokeState_,n=this.textState_,e=this.textFillState_,r=this.strokeKey_;h&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:h.strokeStyle,lineCap:h.lineCap,lineDashOffset:h.lineDashOffset,lineWidth:h.lineWidth,lineJoin:h.lineJoin,miterLimit:h.miterLimit,lineDash:h.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:n.font,textAlign:n.textAlign||Ye.defaultTextAlign,scale:n.scale});var o=this.fillKey_;e&&(o in this.fillStates||(this.fillStates[o]={fillStyle:e.fillStyle}));var u=this.pixelRatio,c=Pr.TEXT_ALIGN[n.textBaseline],l=this.textOffsetY_*u,f=this.text_,d=n.font,v=n.scale,m=h?h.lineWidth*v/2:0,p=this.widths_[d];p||(this.widths_[d]=p={}),this.instructions.push([5,t,i,c,s,n.overflow,o,n.maxAngle,function(t){var i=p[t];return i||(i=p[t]=Ye.measureTextWidth(d,t)),i*v*u},l,r,m*u,f,a,1]),this.hitDetectionInstructions.push([5,t,i,c,s,n.overflow,o,n.maxAngle,function(t){var i=p[t];return i||(i=p[t]=Ye.measureTextWidth(d,t)),i*v},l,r,m,f,a,1/u])},Rr.prototype.setTextStyle=function(t,i){var s,h,n;if(t){this.declutterGroup_=i;var e=t.getFill();e?((h=this.textFillState_)||(h=this.textFillState_={}),h.fillStyle=Ze.asColorLike(e.getColor()||Ye.defaultFillStyle)):h=this.textFillState_=null;var r=t.getStroke();if(r){(n=this.textStrokeState_)||(n=this.textStrokeState_={});var a=r.getLineDash(),o=r.getLineDashOffset(),u=r.getWidth(),c=r.getMiterLimit();n.lineCap=r.getLineCap()||Ye.defaultLineCap,n.lineDash=a?a.slice():Ye.defaultLineDash,n.lineDashOffset=void 0===o?Ye.defaultLineDashOffset:o,n.lineJoin=r.getLineJoin()||Ye.defaultLineJoin,n.lineWidth=void 0===u?Ye.defaultLineWidth:u,n.miterLimit=void 0===c?Ye.defaultMiterLimit:c,n.strokeStyle=Ze.asColorLike(r.getColor()||Ye.defaultStrokeStyle)}else n=this.textStrokeState_=null;s=this.textState_;var l=t.getFont()||Ye.defaultFont;Ye.checkFont(l);var f=t.getScale();s.overflow=t.getOverflow(),s.font=l,s.maxAngle=t.getMaxAngle(),s.placement=t.getPlacement(),s.textAlign=t.getTextAlign(),s.textBaseline=t.getTextBaseline()||Ye.defaultTextBaseline,s.backgroundFill=t.getBackgroundFill(),s.backgroundStroke=t.getBackgroundStroke(),s.padding=t.getPadding()||Ye.defaultPadding,s.scale=void 0===f?1:f;var d=t.getOffsetX(),v=t.getOffsetY(),m=t.getRotateWithView(),p=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===v?0:v,this.textRotateWithView_=void 0!==m&&m,this.textRotation_=void 0===p?0:p,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Gs.getUid(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=s.font+s.scale+(s.textAlign||"?"),this.fillKey_=h?"string"==typeof h.fillStyle?h.fillStyle:"|"+Gs.getUid(h.fillStyle):""}else this.text_=""};var Ir=function(t,i,s,h,n,e,r){pr.call(this),this.declutterTree_=e,this.declutterGroup_=null,this.tolerance_=t,this.maxExtent_=i,this.overlaps_=n,this.pixelRatio_=h,this.resolution_=s,this.renderBuffer_=r,this.replaysByZIndex_={},this.hitDetectionContext_=Dn(1,1),this.hitDetectionTransform_=Oh.create()};Gs.inherits(Ir,pr),Ir.circleArrayCache_={0:[[!0]]},Ir.fillCircleArrayRowToMiddle_=function(t,i,s){var h,n=Math.floor(t.length/2);if(i>=n)for(h=n;h<i;h++)t[h][s]=!0;else if(i<n)for(h=i+1;h<n;h++)t[h][s]=!0},Ir.getCircleArray_=function(t){if(void 0!==Ir.circleArrayCache_[t])return Ir.circleArrayCache_[t];for(var i=2*t+1,s=new Array(i),h=0;h<i;h++)s[h]=new Array(i);for(var n=t,e=0,r=0;n>=e;)Ir.fillCircleArrayRowToMiddle_(s,t+n,t+e),Ir.fillCircleArrayRowToMiddle_(s,t+e,t+n),Ir.fillCircleArrayRowToMiddle_(s,t-e,t+n),Ir.fillCircleArrayRowToMiddle_(s,t-n,t+e),Ir.fillCircleArrayRowToMiddle_(s,t-n,t-e),Ir.fillCircleArrayRowToMiddle_(s,t-e,t-n),Ir.fillCircleArrayRowToMiddle_(s,t+e,t-n),Ir.fillCircleArrayRowToMiddle_(s,t+n,t-e),2*((r+=1+2*++e)-n)+1>0&&(r+=1-2*(n-=1));return Ir.circleArrayCache_[t]=s,s},Ir.replayDeclutter=function(t,i,s){for(var h=Object.keys(t).map(Number).sort(_h.numberSafeCompareFunction),n={},e=0,r=h.length;e<r;++e)for(var a=t[h[e].toString()],o=0,u=a.length;o<u;){var c=a[o++],l=a[o++];c.replay(i,l,s,n)}},Ir.prototype.addDeclutter=function(t){var i=null;return this.declutterTree_&&(t?(i=this.declutterGroup_)[4]++:(i=this.declutterGroup_=zh.createEmpty()).push(1)),i},Ir.prototype.clip=function(t,i){var s=this.getClipCoords(i);t.beginPath(),t.moveTo(s[0],s[1]),t.lineTo(s[2],s[3]),t.lineTo(s[4],s[5]),t.lineTo(s[6],s[7]),t.clip()},Ir.prototype.hasReplays=function(t){for(var i in this.replaysByZIndex_)for(var s=this.replaysByZIndex_[i],h=0,n=t.length;h<n;++h)if(t[h]in s)return!0;return!1},Ir.prototype.finish=function(){var t;for(t in this.replaysByZIndex_){var i,s=this.replaysByZIndex_[t];for(i in s)s[i].finish()}},Ir.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a,o=2*(h=Math.round(h))+1,u=Oh.compose(this.hitDetectionTransform_,h+.5,h+.5,1/i,-1/i,-s,-t[0],-t[1]),c=this.hitDetectionContext_;c.canvas.width!==o||c.canvas.height!==o?(c.canvas.width=o,c.canvas.height=o):c.clearRect(0,0,o,o),void 0!==this.renderBuffer_&&(a=zh.createEmpty(),zh.extendCoordinate(a,t),zh.buffer(a,i*(this.renderBuffer_+h),a));var l,f,d=Ir.getCircleArray_(h);function v(t){for(var i=c.getImageData(0,0,o,o).data,s=0;s<o;s++)for(var h=0;h<o;h++){var n;if(d[s][h]&&i[4*(h*o+s)+3]>0)return(!l||f!=zr&&f!=br||-1!==l.indexOf(t))&&(n=e(t)),n||void c.clearRect(0,0,o,o)}}this.declutterTree_&&(l=this.declutterTree_.all().map((function(t){return t.value})));var m,p,_,g,z,M=Object.keys(this.replaysByZIndex_).map(Number);for(M.sort(_h.numberSafeCompareFunction),m=M.length-1;m>=0;--m){var w=M[m].toString();for(_=this.replaysByZIndex_[w],p=Pr.ORDER.length-1;p>=0;--p)if(void 0!==(g=_[f=Pr.ORDER[p]]))if(!r||f!=zr&&f!=br){if(z=g.replayHitDetection(c,u,s,n,v,a))return z}else{var b=r[w];b?b.push(g,u.slice(0)):r[w]=[g,u.slice(0)]}}},Ir.prototype.getClipCoords=function(t){var i=this.maxExtent_,s=i[0],h=i[1],n=i[2],e=i[3],r=[s,h,s,e,n,e,n,h];return yh(r,0,8,2,t,r),r},Ir.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,Ir.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),h[i]=n),n},Ir.prototype.getReplays=function(){return this.replaysByZIndex_},Ir.prototype.isEmpty=function(){return js.isEmpty(this.replaysByZIndex_)},Ir.prototype.replay=function(t,i,s,h,n,e){var r=Object.keys(this.replaysByZIndex_).map(Number);r.sort(_h.numberSafeCompareFunction),t.save(),this.clip(t,i);var a,o,u,c,l,f,d=n||Pr.ORDER;for(a=0,o=r.length;a<o;++a){var v=r[a].toString();for(l=this.replaysByZIndex_[v],u=0,c=d.length;u<c;++u){var m=d[u];if(void 0!==(f=l[m]))if(!e||m!=zr&&m!=br)f.replay(t,i,s,h);else{var p=e[v];p?p.push(f,i.slice(0)):e[v]=[f,i.slice(0)]}}}t.restore()},Ir.BATCH_CONSTRUCTORS_={Circle:Cr,Default:Gr,Image:kr,LineString:Nr,Polygon:Cr,Text:Rr};var Tr={defaultOrder:function(t,i){return Gs.getUid(t)-Gs.getUid(i)},getSquaredTolerance:function(t,i){var s=Tr.getTolerance(t,i);return s*s},getTolerance:function(t,i){return Gs.SIMPLIFY_TOLERANCE*t/i},renderCircleGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(n||e){var r=t.getReplay(s.getZIndex(),_r);r.setFillStrokeStyle(n,e),r.drawCircle(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}},renderFeature:function(t,i,s,h,n,e){var r,a,o=!1;return(r=s.getImage())&&(2==(a=r.getImageState())||3==a?r.unlistenImageChange(n,e):(0==a&&r.load(),a=r.getImageState(),r.listenImageChange(n,e),o=!0)),Tr.renderFeature_(t,i,s,h),o},renderFeature_:function(t,i,s,h){var n=s.getGeometryFunction()(i);if(n){var e=n.getSimplifiedGeometry(h);s.getRenderer()?Tr.renderGeometry_(t,e,s,i):(0,Tr.GEOMETRY_RENDERERS_[e.getType()])(t,e,s,i)}},renderGeometry_:function(t,i,s,h){if(i.getType()!=vh)t.getReplay(s.getZIndex(),gr).drawCustom(i,h,s.getRenderer());else for(var n=i.getGeometries(),e=0,r=n.length;e<r;++e)Tr.renderGeometry_(t,n[e],s,h)},renderGeometryCollectionGeometry_:function(t,i,s,h){var n,e,r=i.getGeometriesArray();for(n=0,e=r.length;n<e;++n)(0,Tr.GEOMETRY_RENDERERS_[r[n].getType()])(t,r[n],s,h)},renderLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var e=t.getReplay(s.getZIndex(),Mr);e.setFillStrokeStyle(null,n),e.drawLineString(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!1)),a.drawText(i,h)}},renderMultiLineStringGeometry_:function(t,i,s,h){var n=s.getStroke();if(n){var e=t.getReplay(s.getZIndex(),Mr);e.setFillStrokeStyle(null,n),e.drawMultiLineString(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!1)),a.drawText(i,h)}},renderMultiPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(e||n){var r=t.getReplay(s.getZIndex(),wr);r.setFillStrokeStyle(n,e),r.drawMultiPolygon(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}},renderPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var e=t.getReplay(s.getZIndex(),zr);e.setImageStyle(n,t.addDeclutter(!1)),e.drawPoint(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!!n)),a.drawText(i,h)}},renderMultiPointGeometry_:function(t,i,s,h){var n=s.getImage();if(n){if(2!=n.getImageState())return;var e=t.getReplay(s.getZIndex(),zr);e.setImageStyle(n,t.addDeclutter(!1)),e.drawMultiPoint(i,h)}var r=s.getText();if(r){var a=t.getReplay(s.getZIndex(),br);a.setTextStyle(r,t.addDeclutter(!!n)),a.drawText(i,h)}},renderPolygonGeometry_:function(t,i,s,h){var n=s.getFill(),e=s.getStroke();if(n||e){var r=t.getReplay(s.getZIndex(),wr);r.setFillStrokeStyle(n,e),r.drawPolygon(i,h)}var a=s.getText();if(a){var o=t.getReplay(s.getZIndex(),br);o.setTextStyle(a,t.addDeclutter(!1)),o.drawText(i,h)}}};Tr.GEOMETRY_RENDERERS_={Point:Tr.renderPointGeometry_,LineString:Tr.renderLineStringGeometry_,Polygon:Tr.renderPolygonGeometry_,MultiPoint:Tr.renderMultiPointGeometry_,MultiLineString:Tr.renderMultiLineStringGeometry_,MultiPolygon:Tr.renderMultiPolygonGeometry_,GeometryCollection:Tr.renderGeometryCollectionGeometry_,Circle:Tr.renderCircleGeometry_};var Or=function(t){tr.call(this,t),this.declutterTree_=t.getDeclutter()?mr(9):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=zh.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=Dn(),Ws.listen(Ye.labelCache,Xs,this.handleFontsChanged_,this)};Gs.inherits(Or,tr),Or.handles=function(t,i){return t===ne&&i.getType()===Ve},Or.create=function(t,i){return new Or(i)},Or.prototype.disposeInternal=function(){Ws.unlisten(Ye.labelCache,Xs,this.handleFontsChanged_,this),tr.prototype.disposeInternal.call(this)},Or.prototype.composeFrame=function(t,i,s){var h=t.extent,n=t.pixelRatio,e=i.managed?t.skippedFeatureUids:{},r=t.viewState,a=r.projection,o=r.rotation,u=a.getExtent(),c=this.getLayer().getSource(),l=this.getTransform(t,0);this.preCompose(s,t,l);var f=i.extent,d=void 0!==f;d&&this.clip(s,t,f);var v=this.replayGroup_;if(v&&!v.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var m,p=this.getLayer(),_=0,g=0,z=1!==i.opacity,M=p.hasListener(pe);if(z||M){var w=s.canvas.width,b=s.canvas.height;if(o){var x=Math.round(Math.sqrt(w*w+b*b));_=(x-w)/2,g=(x-b)/2,w=b=x}this.context.canvas.width=w,this.context.canvas.height=b,m=this.context}else m=s;var y=m.globalAlpha;z||(m.globalAlpha=i.opacity),m!=s&&m.translate(_,g);var E=t.size[0]*n,S=t.size[1]*n;if(Ye.rotateAtOffset(m,-o,E/2,S/2),v.replay(m,l,o,e),c.getWrapX()&&a.canWrapX()&&!zh.containsExtent(u,h)){for(var P=h[0],G=zh.getWidth(u),k=0;P<u[0];)--k,l=this.getTransform(t,G*k),v.replay(m,l,o,e),P+=G;for(k=0,P=h[2];P>u[2];)++k,l=this.getTransform(t,G*k),v.replay(m,l,o,e),P-=G;l=this.getTransform(t,0)}if(Ye.rotateAtOffset(m,o,E/2,S/2),m!=s){if(M&&this.dispatchRenderEvent(m,t,l),z){var N=s.globalAlpha;s.globalAlpha=i.opacity,s.drawImage(m.canvas,-_,-g),s.globalAlpha=N}else s.drawImage(m.canvas,-_,-g);m.translate(-_,-g)}z||(m.globalAlpha=y)}d&&s.restore(),this.postCompose(s,t,i,l)},Or.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_){var e=i.viewState.resolution,r=i.viewState.rotation,a=this.getLayer(),o={},u=this.replayGroup_.forEachFeatureAtCoordinate(t,e,r,s,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in o))return o[i]=!0,h.call(n,t,a)}),null);return u}},Or.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},Or.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Or.prototype.prepareFrame=function(t){var i=this.getLayer(),s=i.getSource();this.updateLogos(t,s);var h=t.viewHints[0],n=t.viewHints[1],e=i.getUpdateWhileAnimating(),r=i.getUpdateWhileInteracting();if(!this.dirty_&&!e&&h||!r&&n)return!0;var a=t.extent,o=t.viewState,u=o.projection,c=o.resolution,l=t.pixelRatio,f=i.getRevision(),d=i.getRenderBuffer(),v=i.getRenderOrder();void 0===v&&(v=Tr.defaultOrder);var m=zh.buffer(a,d*c),p=o.projection.getExtent();if(s.getWrapX()&&o.projection.canWrapX()&&!zh.containsExtent(p,t.extent)){var _=zh.getWidth(p),g=Math.max(zh.getWidth(m)/2,_);m[0]=p[0]-g,m[2]=p[2]+g}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==f&&this.renderedRenderOrder_==v&&zh.containsExtent(this.renderedExtent_,m))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var z=new Ir(Tr.getTolerance(c,l),m,c,l,s.getOverlaps(),this.declutterTree_,i.getRenderBuffer());s.loadFeatures(m,c,u);var M=function(t){var s,h=t.getStyleFunction();if(h?s=h.call(t,c):(h=i.getStyleFunction())&&(s=h(t,c)),s){var n=this.renderFeature(t,c,l,s,z);this.dirty_=this.dirty_||n}}.bind(this);if(v){var w=[];s.forEachFeatureInExtent(m,(function(t){w.push(t)}),this),w.sort(v);for(var b=0,x=w.length;b<x;++b)M(w[b])}else s.forEachFeatureInExtent(m,M,this);return z.finish(),this.renderedResolution_=c,this.renderedRevision_=f,this.renderedRenderOrder_=v,this.renderedExtent_=m,this.replayGroup_=z,this.replayGroupChanged=!0,!0},Or.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var e=!1;if(Array.isArray(h))for(var r=0,a=h.length;r<a;++r)e=Tr.renderFeature(n,t,h[r],Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;else e=Tr.renderFeature(n,t,h,Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this);return e};var Fr="vector",Lr=function(t){this.context=null,or.call(this,t),this.declutterTree_=t.getDeclutter()?mr(9):null,this.dirty_=!1,this.tmpTransform_=Oh.create(),this.zDirection=t.getRenderMode()==Fr?1:0,Ws.listen(Ye.labelCache,Xs,this.handleFontsChanged_,this)};Gs.inherits(Lr,or),Lr.handles=function(t,i){return t===ne&&"VECTOR_TILE"===i.getType()},Lr.create=function(t,i){return new Lr(i)},Lr.IMAGE_REPLAYS={image:[wr,_r,Mr,zr,br],hybrid:[wr,Mr]},Lr.VECTOR_REPLAYS={image:[gr],hybrid:[zr,br,gr],vector:Pr.ORDER},Lr.prototype.disposeInternal=function(){Ws.unlisten(Ye.labelCache,Xs,this.handleFontsChanged_,this),or.prototype.disposeInternal.call(this)},Lr.prototype.prepareFrame=function(t,i){var s=this.getLayer(),h=s.getRevision();if(this.renderedLayerRevision_!=h){this.renderedTiles.length=0;var n=s.getRenderMode();this.context||n==Fr||(this.context=Dn()),this.context&&n==Fr&&(this.context=null)}return this.renderedLayerRevision_=h,or.prototype.prepareFrame.apply(this,arguments)},Lr.prototype.createReplayGroup_=function(t,i){var s=this.getLayer(),h=i.pixelRatio,n=i.viewState.projection,e=s.getRevision(),r=s.getRenderOrder()||null,a=t.getReplayState(s);if(a.dirty||a.renderedRevision!=e||a.renderedRenderOrder!=r){for(var o=s.getSource(),u=o.getTileGrid(),c=o.getTileGridForProjection(n),l=c.getResolution(t.tileCoord[0]),f=c.getTileCoordExtent(t.wrappedTileCoord),d=0,v=t.tileKeys.length;d<v;++d){var m=t.getTile(t.tileKeys[d]);if(3!=m.getState()){var p=u.getTileCoordExtent(m.tileCoord),_=zh.getIntersection(f,p),g=zh.equals(p,_)?null:zh.buffer(_,s.getRenderBuffer()*l),z=m.getProjection(),M=!1;Th.equivalent(n,z)||(M=!0,m.setProjection(n)),a.dirty=!1;var w,b=new Ir(0,_,l,h,o.getOverlaps(),this.declutterTree_,s.getRenderBuffer()),x=Tr.getSquaredTolerance(l,h),y=function(t){var i,h=t.getStyleFunction();if(h?i=h.call(t,l):(h=s.getStyleFunction())&&(i=h(t,l)),i){var n=this.renderFeature(t,x,i,b);this.dirty_=this.dirty_||n,a.dirty=a.dirty||n}},E=m.getFeatures();r&&r!==a.renderedRenderOrder&&E.sort(r);for(var S=0,P=E.length;S<P;++S)w=E[S],M&&(z.getUnits()==Gh.TILE_PIXELS&&(z.setWorldExtent(p),z.setExtent(m.getExtent())),w.getGeometry().transform(z,n)),g&&!zh.intersects(g,w.getGeometry().getExtent())||y.call(this,w);for(var G in b.finish(),b.getReplays());m.setReplayGroup(s,t.tileCoord.toString(),b)}}a.renderedRevision=e,a.renderedRenderOrder=r}},Lr.prototype.drawTileImage=function(t,i,s,h,n,e,r,a,o){var u=t;this.createReplayGroup_(u,i),this.context&&(this.renderTileImage_(u,i,s),or.prototype.drawTileImage.apply(this,arguments))},Lr.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=i.viewState.resolution,r=i.viewState.rotation;s=null==s?0:s;var a,o,u,c,l,f,d,v=this.getLayer(),m={},p=this.renderedTiles,_=v.getSource().getTileGridForProjection(i.viewState.projection);for(u=0,c=p.length;u<c;++u)if(d=_.getTileCoordExtent((f=p[u]).wrappedTileCoord,this.tmpExtent),a=zh.buffer(d,s*e,a),zh.containsCoordinate(a,t))for(var g=0,z=f.tileKeys.length;g<z;++g){var M=f.getTile(f.tileKeys[g]);3!=M.getState()&&(l=M.getReplayGroup(v,f.tileCoord.toString()),o=o||l.forEachFeatureAtCoordinate(t,e,r,s,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in m))return m[i]=!0,h.call(n,t,v)}),null))}return o},Lr.prototype.getReplayTransform_=function(t,i){var s=this.getLayer().getSource().getTileGrid(),h=t.tileCoord,n=s.getResolution(h[0]),e=i.viewState,r=i.pixelRatio,a=e.resolution/r,o=s.getTileCoordExtent(h,this.tmpExtent),u=e.center,c=zh.getTopLeft(o),l=i.size,f=Math.round(r*l[0]/2),d=Math.round(r*l[1]/2);return Oh.compose(this.tmpTransform_,f,d,n/a,n/a,e.rotation,(c[0]-u[0])/n,(u[1]-c[1])/n)},Lr.prototype.handleFontsChanged_=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},Lr.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Lr.prototype.postCompose=function(t,i,s){var h,n,e=this.getLayer(),r=e.getDeclutter()?{}:null,a=e.getSource(),o=e.getRenderMode(),u=Lr.VECTOR_REPLAYS[o],c=i.pixelRatio,l=i.viewState.rotation,f=i.size;l&&(h=Math.round(c*f[0]/2),n=Math.round(c*f[1]/2),Ye.rotateAtOffset(t,-l,h,n)),r&&this.declutterTree_.clear();for(var d=this.renderedTiles,v=a.getTileGridForProjection(i.viewState.projection),m=[],p=[],_=d.length-1;_>=0;--_){var g=d[_];if(5!=g.getState())for(var z=g.tileCoord,M=v.getTileCoordExtent(z)[0]-v.getTileCoordExtent(g.wrappedTileCoord)[0],w=void 0,b=0,x=g.tileKeys.length;b<x;++b){var y=g.getTile(g.tileKeys[b]);if(3!=y.getState()){var E=y.getReplayGroup(e,z.toString());if(o==Fr||E.hasReplays(u)){w||(w=this.getTransform(i,M));var S=y.tileCoord[0],P=E.getClipCoords(w);t.save(),t.globalAlpha=s.opacity;for(var G=0,k=m.length;G<k;++G){var N=m[G];S<p[G]&&(t.beginPath(),t.moveTo(P[0],P[1]),t.lineTo(P[2],P[3]),t.lineTo(P[4],P[5]),t.lineTo(P[6],P[7]),t.moveTo(N[6],N[7]),t.lineTo(N[4],N[5]),t.lineTo(N[2],N[3]),t.lineTo(N[0],N[1]),t.clip())}E.replay(t,w,l,{},u,r),t.restore(),m.push(P),p.push(S)}}}}r&&Ir.replayDeclutter(r,t,l),l&&Ye.rotateAtOffset(t,l,h,n),or.prototype.postCompose.apply(this,arguments)},Lr.prototype.renderFeature=function(t,i,s,h){if(!s)return!1;var n=!1;if(Array.isArray(s))for(var e=0,r=s.length;e<r;++e)n=Tr.renderFeature(h,t,s[e],i,this.handleStyleImageChange_,this)||n;else n=Tr.renderFeature(h,t,s,i,this.handleStyleImageChange_,this);return n},Lr.prototype.renderTileImage_=function(t,i){var s=this.getLayer(),h=t.getReplayState(s),n=s.getRevision(),e=Lr.IMAGE_REPLAYS[s.getRenderMode()];if(e&&h.renderedTileRevision!==n){h.renderedTileRevision=n;var r=t.wrappedTileCoord,a=r[0],o=i.pixelRatio,u=s.getSource(),c=u.getTileGridForProjection(i.viewState.projection),l=c.getResolution(a),f=t.getContext(s),d=u.getTilePixelSize(a,o,i.viewState.projection);f.canvas.width=d[0],f.canvas.height=d[1];for(var v=c.getTileCoordExtent(r),m=0,p=t.tileKeys.length;m<p;++m){var _=t.getTile(t.tileKeys[m]);if(3!=_.getState()){var g=o/l,z=Oh.reset(this.tmpTransform_);Oh.scale(z,g,-g),Oh.translate(z,-v[0],-v[3]),_.getReplayGroup(s,t.tileCoord.toString()).replay(f,z,0,{},e)}}}};var Dr=function(t){this.source_=t};Dr.prototype.getType=function(){},Dr.prototype.getSource=function(){return this.source_},Dr.prototype.isAnimated=xh.FALSE;var jr=function(t){Dr.call(this,t)};Gs.inherits(jr,Dr),jr.prototype.getType=function(){return Qh.FRAGMENT_SHADER};var Wr=function(t){Dr.call(this,t)};Gs.inherits(Wr,Dr),Wr.prototype.getType=function(){return Qh.VERTEX_SHADER};var Ur={};Ur.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_fillColor;\nuniform vec4 u_strokeColor;\nuniform vec2 u_size;\n\nvoid main(void) {\n vec2 windowCenter = vec2((v_center.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_center.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n vec2 windowOffset = vec2((v_offset.x + 1.0) / 2.0 * u_size.x * v_pixelRatio,\n (v_offset.y + 1.0) / 2.0 * u_size.y * v_pixelRatio);\n float radius = length(windowCenter - windowOffset);\n float dist = length(windowCenter - gl_FragCoord.xy);\n if (dist > radius + v_halfWidth) {\n if (u_strokeColor.a == 0.0) {\n gl_FragColor = u_fillColor;\n } else {\n gl_FragColor = u_strokeColor;\n }\n gl_FragColor.a = gl_FragColor.a - (dist - (radius + v_halfWidth));\n } else if (u_fillColor.a == 0.0) {\n // Hooray, no fill, just stroke. We can use real antialiasing.\n gl_FragColor = u_strokeColor;\n if (dist < radius - v_halfWidth) {\n gl_FragColor.a = gl_FragColor.a - (radius - v_halfWidth - dist);\n }\n } else {\n gl_FragColor = u_fillColor;\n float strokeDist = radius - v_halfWidth;\n float antialias = 2.0 * v_pixelRatio;\n if (dist > strokeDist) {\n gl_FragColor = u_strokeColor;\n } else if (dist >= strokeDist - antialias) {\n float step = smoothstep(strokeDist - antialias, strokeDist, dist);\n gl_FragColor = mix(u_fillColor, u_strokeColor, step);\n }\n }\n gl_FragColor.a = gl_FragColor.a * u_opacity;\n if (gl_FragColor.a <= 0.0) {\n discard;\n }\n}\n":"precision mediump float;varying vec2 a;varying vec2 b;varying float c;varying float d;uniform float m;uniform vec4 n;uniform vec4 o;uniform vec2 p;void main(void){vec2 windowCenter=vec2((a.x+1.0)/2.0*p.x*d,(a.y+1.0)/2.0*p.y*d);vec2 windowOffset=vec2((b.x+1.0)/2.0*p.x*d,(b.y+1.0)/2.0*p.y*d);float radius=length(windowCenter-windowOffset);float dist=length(windowCenter-gl_FragCoord.xy);if(dist>radius+c){if(o.a==0.0){gl_FragColor=n;}else{gl_FragColor=o;}gl_FragColor.a=gl_FragColor.a-(dist-(radius+c));}else if(n.a==0.0){gl_FragColor=o;if(dist<radius-c){gl_FragColor.a=gl_FragColor.a-(radius-c-dist);}} else{gl_FragColor=n;float strokeDist=radius-c;float antialias=2.0*d;if(dist>strokeDist){gl_FragColor=o;}else if(dist>=strokeDist-antialias){float step=smoothstep(strokeDist-antialias,strokeDist,dist);gl_FragColor=mix(n,o,step);}} gl_FragColor.a=gl_FragColor.a*m;if(gl_FragColor.a<=0.0){discard;}}"),Ur.vertex=new Wr(Gs.DEBUG_WEBGL?"varying vec2 v_center;\nvarying vec2 v_offset;\nvarying float v_halfWidth;\nvarying float v_pixelRatio;\n\n\nattribute vec2 a_position;\nattribute float a_instruction;\nattribute float a_radius;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n v_center = vec4(u_projectionMatrix * vec4(a_position, 0.0, 1.0)).xy;\n v_pixelRatio = u_pixelRatio;\n float lineWidth = u_lineWidth * u_pixelRatio;\n v_halfWidth = lineWidth / 2.0;\n if (lineWidth == 0.0) {\n lineWidth = 2.0 * u_pixelRatio;\n }\n vec2 offset;\n // Radius with anitaliasing (roughly).\n float radius = a_radius + 3.0 * u_pixelRatio;\n // Until we get gl_VertexID in WebGL, we store an instruction.\n if (a_instruction == 0.0) {\n // Offsetting the edges of the triangle by lineWidth / 2 is necessary, however\n // we should also leave some space for the antialiasing, thus we offset by lineWidth.\n offset = vec2(-1.0, 1.0);\n } else if (a_instruction == 1.0) {\n offset = vec2(-1.0, -1.0);\n } else if (a_instruction == 2.0) {\n offset = vec2(1.0, -1.0);\n } else {\n offset = vec2(1.0, 1.0);\n }\n\n gl_Position = u_projectionMatrix * vec4(a_position + offset * radius, 0.0, 1.0) +\n offsetMatrix * vec4(offset * lineWidth, 0.0, 0.0);\n v_offset = vec4(u_projectionMatrix * vec4(a_position.x + a_radius, a_position.y,\n 0.0, 1.0)).xy;\n\n if (distance(v_center, v_offset) > 20000.0) {\n gl_Position = vec4(v_center, 0.0, 1.0);\n }\n}\n\n\n":"varying vec2 a;varying vec2 b;varying float c;varying float d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;void main(void){mat4 offsetMatrix=i*j;a=vec4(h*vec4(e,0.0,1.0)).xy;d=l;float lineWidth=k*l;c=lineWidth/2.0;if(lineWidth==0.0){lineWidth=2.0*l;}vec2 offset;float radius=g+3.0*l;//Until we get gl_VertexID in WebGL,we store an instruction.if(f==0.0){//Offsetting the edges of the triangle by lineWidth/2 is necessary,however//we should also leave some space for the antialiasing,thus we offset by lineWidth.offset=vec2(-1.0,1.0);}else if(f==1.0){offset=vec2(-1.0,-1.0);}else if(f==2.0){offset=vec2(1.0,-1.0);}else{offset=vec2(1.0,1.0);}gl_Position=h*vec4(e+offset*radius,0.0,1.0)+offsetMatrix*vec4(offset*lineWidth,0.0,0.0);b=vec4(h*vec4(e.x+g,e.y,0.0,1.0)).xy;if(distance(a,b)>20000.0){gl_Position=vec4(a,0.0,1.0);}}");var Vr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_pixelRatio=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_pixelRatio":"l"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"m"),this.u_fillColor=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_fillColor":"n"),this.u_strokeColor=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_strokeColor":"o"),this.u_size=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_size":"p"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"e"),this.a_instruction=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_instruction":"f"),this.a_radius=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_radius":"g")},qr=function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},Br=function(t,i){return t[0]=i[0],t[1]=i[1],t[4]=i[2],t[5]=i[3],t[12]=i[4],t[13]=i[5],t},Xr=function(t,i){Ke.call(this),this.tolerance=t,this.maxExtent=i,this.origin=zh.getCenter(i),this.projectionMatrix_=Oh.create(),this.offsetRotateMatrix_=Oh.create(),this.offsetScaleMatrix_=Oh.create(),this.tmpMat4_=qr(),this.indices=[],this.indicesBuffer=null,this.startIndices=[],this.startIndicesFeature=[],this.vertices=[],this.verticesBuffer=null,this.lineStringReplay=void 0};Gs.inherits(Xr,Ke),Xr.prototype.getDeleteResourcesFunction=function(){},Xr.prototype.finish=function(){},Xr.prototype.setUpProgram=function(){},Xr.prototype.shutDownProgram=function(){},Xr.prototype.drawReplay=function(){},Xr.prototype.drawHitDetectionReplayOneByOne=function(){},Xr.prototype.drawHitDetectionReplay=function(t,i,s,h,n,e){return n?this.drawHitDetectionReplayOneByOne(t,i,s,h,e):this.drawHitDetectionReplayAll(t,i,s,h)},Xr.prototype.drawHitDetectionReplayAll=function(t,i,s,h){return t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawReplay(t,i,s,!0),h(null)||void 0},Xr.prototype.replay=function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d,v,m,p,_,g,z=t.getGL();this.lineStringReplay&&(l=z.isEnabled(z.STENCIL_TEST),f=z.getParameter(z.STENCIL_FUNC),d=z.getParameter(z.STENCIL_VALUE_MASK),v=z.getParameter(z.STENCIL_REF),m=z.getParameter(z.STENCIL_WRITEMASK),p=z.getParameter(z.STENCIL_FAIL),_=z.getParameter(z.STENCIL_PASS_DEPTH_PASS),g=z.getParameter(z.STENCIL_PASS_DEPTH_FAIL),z.enable(z.STENCIL_TEST),z.clear(z.STENCIL_BUFFER_BIT),z.stencilMask(255),z.stencilFunc(z.ALWAYS,1,255),z.stencilOp(z.KEEP,z.KEEP,z.REPLACE),this.lineStringReplay.replay(t,i,s,h,n,e,r,a,o,u,c),z.stencilMask(0),z.stencilFunc(z.NOTEQUAL,1,255)),t.bindBuffer(Qh.ARRAY_BUFFER,this.verticesBuffer),t.bindBuffer(Qh.ELEMENT_ARRAY_BUFFER,this.indicesBuffer);var M=this.setUpProgram(z,t,n,e),w=Oh.reset(this.projectionMatrix_);Oh.scale(w,2/(s*n[0]),2/(s*n[1])),Oh.rotate(w,-h),Oh.translate(w,-(i[0]-this.origin[0]),-(i[1]-this.origin[1]));var b=Oh.reset(this.offsetScaleMatrix_);Oh.scale(b,2/n[0],2/n[1]);var x,y=Oh.reset(this.offsetRotateMatrix_);return 0!==h&&Oh.rotate(y,-h),z.uniformMatrix4fv(M.u_projectionMatrix,!1,Br(this.tmpMat4_,w)),z.uniformMatrix4fv(M.u_offsetScaleMatrix,!1,Br(this.tmpMat4_,b)),z.uniformMatrix4fv(M.u_offsetRotateMatrix,!1,Br(this.tmpMat4_,y)),z.uniform1f(M.u_opacity,r),void 0===o?this.drawReplay(z,t,a,!1):x=this.drawHitDetectionReplay(z,t,a,o,u,c),this.shutDownProgram(z,M),this.lineStringReplay&&(l||z.disable(z.STENCIL_TEST),z.clear(z.STENCIL_BUFFER_BIT),z.stencilFunc(f,v,d),z.stencilMask(m),z.stencilOp(p,g,_)),x},Xr.prototype.drawElements=function(t,i,s,h){t.drawElements(Qh.TRIANGLES,h-s,i.hasOESElementIndexUint?Qh.UNSIGNED_INT:Qh.UNSIGNED_SHORT,s*(i.hasOESElementIndexUint?4:2))};var Hr={defaultFont:"10px sans-serif",defaultFillStyle:[0,0,0,1],defaultLineCap:"round",defaultLineDash:[],defaultLineDashOffset:0,defaultLineJoin:"round",defaultMiterLimit:10,defaultStrokeStyle:[0,0,0,1],defaultTextAlign:.5,defaultTextBaseline:.5,defaultLineWidth:1,triangleIsCounterClockwise:function(t,i,s,h,n,e){var r=(s-t)*(e-i)-(n-t)*(h-i);return r<=Hr.EPSILON&&r>=-Hr.EPSILON?void 0:r>0}};Hr.EPSILON=Number.EPSILON||2220446049250313e-31;var Yr=function(t,i){this.arr_=void 0!==t?t:[],this.usage_=void 0!==i?i:Yr.Usage_.STATIC_DRAW};Yr.prototype.getArray=function(){return this.arr_},Yr.prototype.getUsage=function(){return this.usage_},Yr.Usage_={STATIC_DRAW:Qh.STATIC_DRAW,STREAM_DRAW:Qh.STREAM_DRAW,DYNAMIC_DRAW:Qh.DYNAMIC_DRAW};var Jr=function(t,i){Xr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.radius_=0,this.state_={fillColor:null,strokeColor:null,lineDash:null,lineDashOffset:void 0,lineWidth:void 0,changed:!1}};Gs.inherits(Jr,Xr),Jr.prototype.drawCoordinates_=function(t,i,s,h){var n,e,r=this.vertices.length,a=this.indices.length,o=r/4;for(n=i,e=s;n<e;n+=h)this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=0,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=1,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=2,this.vertices[r++]=this.radius_,this.vertices[r++]=t[n],this.vertices[r++]=t[n+1],this.vertices[r++]=3,this.vertices[r++]=this.radius_,this.indices[a++]=o,this.indices[a++]=o+1,this.indices[a++]=o+2,this.indices[a++]=o+2,this.indices[a++]=o+3,this.indices[a++]=o,o+=4},Jr.prototype.drawCircle=function(t,i){var s=t.getRadius(),h=t.getStride();if(s){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.radius_=s;var n=t.getFlatCoordinates();n=Ph(n,0,2,h,-this.origin[0],-this.origin[1]),this.drawCoordinates_(n,0,2,h)}else if(this.state_.changed&&(this.styles_.pop(),this.styles_.length)){var e=this.styles_[this.styles_.length-1];this.state_.fillColor=e[0],this.state_.strokeColor=e[1],this.state_.lineWidth=e[2],this.state_.changed=!1}},Jr.prototype.finish=function(){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},Jr.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},Jr.prototype.setUpProgram=function(t,i,s,h){var n,e=i.getProgram(Ur.fragment,Ur.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new Vr(t,e),this.defaultLocations_=n),i.useProgram(e),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Qh.FLOAT,!1,16,0),t.enableVertexAttribArray(n.a_instruction),t.vertexAttribPointer(n.a_instruction,1,Qh.FLOAT,!1,16,8),t.enableVertexAttribArray(n.a_radius),t.vertexAttribPointer(n.a_radius,1,Qh.FLOAT,!1,16,12),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},Jr.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_instruction),t.disableVertexAttribArray(i.a_radius)},Jr.prototype.drawReplay=function(t,i,s){var h,n,e,r;if(js.isEmpty(s))for(e=this.startIndices[this.startIndices.length-1],h=this.styleIndices_.length-1;h>=0;--h)n=this.styleIndices_[h],this.setFillStyle_(t,(r=this.styles_[h])[0]),this.setStrokeStyle_(t,r[1],r[2]),this.drawElements(t,i,n,e),e=n;else this.drawReplaySkipping_(t,i,s)},Jr.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c,l;for(a=this.startIndices[1+(l=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setFillStyle_(t,(o=this.styles_[e])[0]),this.setStrokeStyle_(t,o[1],o[2]),u=this.styleIndices_[e];l>=0&&this.startIndices[l]>=u;){if(r=this.startIndices[l],void 0===s[Gs.getUid(c=this.startIndicesFeature[l]).toString()]&&c.getGeometry()&&(void 0===n||zh.intersects(n,c.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var f=h(c);if(f)return f}l--,a=r}},Jr.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o,u;for(e=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,(r=this.styles_[h])[0]),this.setStrokeStyle_(t,r[1],r[2]),a=this.styleIndices_[h];o>=0&&this.startIndices[o]>=a;)u=this.startIndices[o],s[Gs.getUid(this.startIndicesFeature[o]).toString()]&&(n!==e&&this.drawElements(t,i,n,e),e=u),o--,n=u;n!==e&&this.drawElements(t,i,n,e),n=e=a}},Jr.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_fillColor,i)},Jr.prototype.setStrokeStyle_=function(t,i,s){t.uniform4fv(this.defaultLocations_.u_strokeColor,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s)},Jr.prototype.setFillStrokeStyle=function(t,i){var s,h;if(i){var n=i.getLineDash();this.state_.lineDash=n||Hr.defaultLineDash;var e=i.getLineDashOffset();this.state_.lineDashOffset=e||Hr.defaultLineDashOffset,s=(s=i.getColor())instanceof CanvasGradient||s instanceof CanvasPattern?Hr.defaultStrokeStyle:Je.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultStrokeStyle,h=void 0!==(h=i.getWidth())?h:Hr.defaultLineWidth}else s=[0,0,0,0],h=0;var r=t?t.getColor():[0,0,0,0];r=r instanceof CanvasGradient||r instanceof CanvasPattern?Hr.defaultFillStyle:Je.asArray(r).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultFillStyle,this.state_.strokeColor&&_h.equals(this.state_.strokeColor,s)&&this.state_.fillColor&&_h.equals(this.state_.fillColor,r)&&this.state_.lineWidth===h||(this.state_.changed=!0,this.state_.fillColor=r,this.state_.strokeColor=s,this.state_.lineWidth=h,this.styles_.push([r,s,h]))};var Zr={};Zr.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\nvarying float v_opacity;\n\nuniform float u_opacity;\nuniform sampler2D u_image;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_image, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n float alpha = texColor.a * v_opacity * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying vec2 a;varying float b;uniform float k;uniform sampler2D l;void main(void){vec4 texColor=texture2D(l,a);gl_FragColor.rgb=texColor.rgb;float alpha=texColor.a*b*k;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),Zr.vertex=new Wr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\nvarying float v_opacity;\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nattribute vec2 a_offsets;\nattribute float a_opacity;\nattribute float a_rotateWithView;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n if (a_rotateWithView == 1.0) {\n offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n }\n vec4 offsets = offsetMatrix * vec4(a_offsets, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n v_texCoord = a_texCoord;\n v_opacity = a_opacity;\n}\n\n\n":"varying vec2 a;varying float b;attribute vec2 c;attribute vec2 d;attribute vec2 e;attribute float f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;void main(void){mat4 offsetMatrix=i;if(g==1.0){offsetMatrix=i*j;}vec4 offsets=offsetMatrix*vec4(e,0.0,0.0);gl_Position=h*vec4(c,0.0,1.0)+offsets;a=d;b=f;}");var Kr=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"k"),this.u_image=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_image":"l"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"c"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"d"),this.a_offsets=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_offsets":"e"),this.a_opacity=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_opacity":"f"),this.a_rotateWithView=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_rotateWithView":"g")},$r="webglcontextlost",Qr="webglcontextrestored",ta=function(t,i){this.canvas_=t,this.gl_=i,this.bufferCache_={},this.shaderCache_={},this.programCache_={},this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null,this.hasOESElementIndexUint=_h.includes(Gs.WEBGL_EXTENSIONS,"OES_element_index_uint"),this.hasOESElementIndexUint&&i.getExtension("OES_element_index_uint"),Ws.listen(this.canvas_,$r,this.handleWebGLContextLost,this),Ws.listen(this.canvas_,Qr,this.handleWebGLContextRestored,this)};Gs.inherits(ta,Us),ta.prototype.bindBuffer=function(t,i){var s=this.getGL(),h=i.getArray(),n=String(Gs.getUid(i));if(n in this.bufferCache_)s.bindBuffer(t,this.bufferCache_[n].buffer);else{var e,r=s.createBuffer();s.bindBuffer(t,r),t==Qh.ARRAY_BUFFER?e=new Float32Array(h):t==Qh.ELEMENT_ARRAY_BUFFER&&(e=this.hasOESElementIndexUint?new Uint32Array(h):new Uint16Array(h)),s.bufferData(t,e,i.getUsage()),this.bufferCache_[n]={buf:i,buffer:r}}},ta.prototype.deleteBuffer=function(t){var i=this.getGL(),s=String(Gs.getUid(t)),h=this.bufferCache_[s];i.isContextLost()||i.deleteBuffer(h.buffer),delete this.bufferCache_[s]},ta.prototype.disposeInternal=function(){Ws.unlistenAll(this.canvas_);var t=this.getGL();if(!t.isContextLost()){var i;for(i in this.bufferCache_)t.deleteBuffer(this.bufferCache_[i].buffer);for(i in this.programCache_)t.deleteProgram(this.programCache_[i]);for(i in this.shaderCache_)t.deleteShader(this.shaderCache_[i]);t.deleteFramebuffer(this.hitDetectionFramebuffer_),t.deleteRenderbuffer(this.hitDetectionRenderbuffer_),t.deleteTexture(this.hitDetectionTexture_)}},ta.prototype.getCanvas=function(){return this.canvas_},ta.prototype.getGL=function(){return this.gl_},ta.prototype.getHitDetectionFramebuffer=function(){return this.hitDetectionFramebuffer_||this.initHitDetectionFramebuffer_(),this.hitDetectionFramebuffer_},ta.prototype.getShader=function(t){var i=String(Gs.getUid(t));if(i in this.shaderCache_)return this.shaderCache_[i];var s=this.getGL(),h=s.createShader(t.getType());return s.shaderSource(h,t.getSource()),s.compileShader(h),this.shaderCache_[i]=h,h},ta.prototype.getProgram=function(t,i){var s=Gs.getUid(t)+"/"+Gs.getUid(i);if(s in this.programCache_)return this.programCache_[s];var h=this.getGL(),n=h.createProgram();return h.attachShader(n,this.getShader(t)),h.attachShader(n,this.getShader(i)),h.linkProgram(n),this.programCache_[s]=n,n},ta.prototype.handleWebGLContextLost=function(){js.clear(this.bufferCache_),js.clear(this.shaderCache_),js.clear(this.programCache_),this.currentProgram_=null,this.hitDetectionFramebuffer_=null,this.hitDetectionTexture_=null,this.hitDetectionRenderbuffer_=null},ta.prototype.handleWebGLContextRestored=function(){},ta.prototype.initHitDetectionFramebuffer_=function(){var t=this.gl_,i=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,i);var s=ta.createEmptyTexture(t,1,1),h=t.createRenderbuffer();t.bindRenderbuffer(t.RENDERBUFFER,h),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,1,1),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,s,0),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,h),t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.hitDetectionFramebuffer_=i,this.hitDetectionTexture_=s,this.hitDetectionRenderbuffer_=h},ta.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,!0)},ta.createTexture_=function(t,i,s){var h=t.createTexture();return t.bindTexture(t.TEXTURE_2D,h),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),void 0!==i&&t.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_S,i),void 0!==s&&t.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_T,s),h},ta.createEmptyTexture=function(t,i,s,h,n){var e=ta.createTexture_(t,h,n);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,i,s,0,t.RGBA,t.UNSIGNED_BYTE,null),e},ta.createTexture=function(t,i,s,h){var n=ta.createTexture_(t,s,h);return t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i),n};var ia=function(t,i){Xr.call(this,t,i),this.anchorX=void 0,this.anchorY=void 0,this.groupIndices=[],this.hitDetectionGroupIndices=[],this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.defaultLocations=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.width=void 0};Gs.inherits(ia,Xr),ia.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.getTextures(!0),n=t.getGL();return function(){var e,r;if(!n.isContextLost())for(e=0,r=h.length;e<r;++e)n.deleteTexture(h[e]);t.deleteBuffer(i),t.deleteBuffer(s)}},ia.prototype.drawCoordinates=function(t,i,s,h){var n,e,r,a,o,u,c=this.anchorX,l=this.anchorY,f=this.height,d=this.imageHeight,v=this.imageWidth,m=this.opacity,p=this.originX,_=this.originY,g=this.rotateWithView?1:0,z=-this.rotation,M=this.scale,w=this.width,b=Math.cos(z),x=Math.sin(z),y=this.indices.length,E=this.vertices.length;for(n=i;n<s;n+=h)u=t[n+1]-this.origin[1],e=E/8,r=-M*c,a=-M*(f-l),this.vertices[E++]=o=t[n]-this.origin[0],this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=p/v,this.vertices[E++]=(_+f)/d,this.vertices[E++]=m,this.vertices[E++]=g,r=M*(w-c),a=-M*(f-l),this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=(p+w)/v,this.vertices[E++]=(_+f)/d,this.vertices[E++]=m,this.vertices[E++]=g,r=M*(w-c),a=M*l,this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=(p+w)/v,this.vertices[E++]=_/d,this.vertices[E++]=m,this.vertices[E++]=g,r=-M*c,a=M*l,this.vertices[E++]=o,this.vertices[E++]=u,this.vertices[E++]=r*b-a*x,this.vertices[E++]=r*x+a*b,this.vertices[E++]=p/v,this.vertices[E++]=_/d,this.vertices[E++]=m,this.vertices[E++]=g,this.indices[y++]=e,this.indices[y++]=e+1,this.indices[y++]=e+2,this.indices[y++]=e,this.indices[y++]=e+2,this.indices[y++]=e+3;return E},ia.prototype.createTextures=function(t,i,s,h){var n,e,r,a,o=i.length;for(a=0;a<o;++a)(r=Gs.getUid(e=i[a]).toString())in s?n=s[r]:(n=ta.createTexture(h,e,Qh.CLAMP_TO_EDGE,Qh.CLAMP_TO_EDGE),s[r]=n),t[a]=n},ia.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(Zr.fragment,Zr.vertex);return this.defaultLocations?s=this.defaultLocations:(s=new Kr(t,h),this.defaultLocations=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Qh.FLOAT,!1,32,0),t.enableVertexAttribArray(s.a_offsets),t.vertexAttribPointer(s.a_offsets,2,Qh.FLOAT,!1,32,8),t.enableVertexAttribArray(s.a_texCoord),t.vertexAttribPointer(s.a_texCoord,2,Qh.FLOAT,!1,32,16),t.enableVertexAttribArray(s.a_opacity),t.vertexAttribPointer(s.a_opacity,1,Qh.FLOAT,!1,32,24),t.enableVertexAttribArray(s.a_rotateWithView),t.vertexAttribPointer(s.a_rotateWithView,1,Qh.FLOAT,!1,32,28),s},ia.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_offsets),t.disableVertexAttribArray(i.a_texCoord),t.disableVertexAttribArray(i.a_opacity),t.disableVertexAttribArray(i.a_rotateWithView)},ia.prototype.drawReplay=function(t,i,s,h){var n,e,r,a=h?this.getHitDetectionTextures():this.getTextures(),o=h?this.hitDetectionGroupIndices:this.groupIndices;if(js.isEmpty(s))for(n=0,e=a.length,r=0;n<e;++n){t.bindTexture(Qh.TEXTURE_2D,a[n]);var u=o[n];this.drawElements(t,i,r,u),r=u}else this.drawReplaySkipping(t,i,s,a,o)},ia.prototype.drawReplaySkipping=function(t,i,s,h,n){var e,r,a=0;for(e=0,r=h.length;e<r;++e){t.bindTexture(Qh.TEXTURE_2D,h[e]);for(var o=e>0?n[e-1]:0,u=n[e],c=o,l=o;a<this.startIndices.length&&this.startIndices[a]<=u;)void 0!==s[Gs.getUid(this.startIndicesFeature[a]).toString()]?(c!==l&&this.drawElements(t,i,c,l),l=c=a===this.startIndices.length-1?u:this.startIndices[a+1]):l=a===this.startIndices.length-1?u:this.startIndices[a+1],a++;c!==l&&this.drawElements(t,i,c,l)}},ia.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c=this.startIndices.length-1,l=this.getHitDetectionTextures();for(e=l.length-1;e>=0;--e)for(t.bindTexture(Qh.TEXTURE_2D,l[e]),r=e>0?this.hitDetectionGroupIndices[e-1]:0,o=this.hitDetectionGroupIndices[e];c>=0&&this.startIndices[c]>=r;){if(a=this.startIndices[c],void 0===s[Gs.getUid(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||zh.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,a,o);var f=h(u);if(f)return f}o=a,c--}},ia.prototype.finish=function(){this.anchorX=void 0,this.anchorY=void 0,this.height=void 0,this.imageHeight=void 0,this.imageWidth=void 0,this.indices=null,this.opacity=void 0,this.originX=void 0,this.originY=void 0,this.rotateWithView=void 0,this.rotation=void 0,this.scale=void 0,this.vertices=null,this.width=void 0},ia.prototype.getTextures=function(){},ia.prototype.getHitDetectionTextures=function(){};var sa=function(t,i){ia.call(this,t,i),this.images_=[],this.hitDetectionImages_=[],this.textures_=[],this.hitDetectionTextures_=[]};Gs.inherits(sa,ia),sa.prototype.drawMultiPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},sa.prototype.drawPoint=function(t,i){this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var s=t.getFlatCoordinates(),h=t.getStride();this.drawCoordinates(s,0,s.length,h)},sa.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices.push(this.indices.length),this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices);var s={};this.createTextures(this.textures_,this.images_,s,i),this.createTextures(this.hitDetectionTextures_,this.hitDetectionImages_,s,i),this.images_=null,this.hitDetectionImages_=null,ia.prototype.finish.call(this,t)},sa.prototype.setImageStyle=function(t){var i=t.getAnchor(),s=t.getImage(1),h=t.getImageSize(),n=t.getHitDetectionImage(1),e=t.getOpacity(),r=t.getOrigin(),a=t.getRotateWithView(),o=t.getRotation(),u=t.getSize(),c=t.getScale();0===this.images_.length?this.images_.push(s):Gs.getUid(this.images_[this.images_.length-1])!=Gs.getUid(s)&&(this.groupIndices.push(this.indices.length),this.images_.push(s)),0===this.hitDetectionImages_.length?this.hitDetectionImages_.push(n):Gs.getUid(this.hitDetectionImages_[this.hitDetectionImages_.length-1])!=Gs.getUid(n)&&(this.hitDetectionGroupIndices.push(this.indices.length),this.hitDetectionImages_.push(n)),this.anchorX=i[0],this.anchorY=i[1],this.height=u[1],this.imageHeight=h[1],this.imageWidth=h[0],this.opacity=e,this.originX=r[0],this.originY=r[1],this.rotation=o,this.rotateWithView=a,this.scale=c,this.width=u[0]},sa.prototype.getTextures=function(t){return t?this.textures_.concat(this.hitDetectionTextures_):this.textures_},sa.prototype.getHitDetectionTextures=function(){return this.hitDetectionTextures_};var ha=function(t,i,s,h){var n=s-h;return t[i]===t[n]&&t[i+1]===t[n+1]&&(s-i)/h>3&&!!Dh.linearRing(t,i,s,h)},na={};na.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\n\nuniform float u_opacity;\nuniform vec4 u_color;\nuniform vec2 u_size;\nuniform float u_pixelRatio;\n\nvoid main(void) {\n if (v_round > 0.0) {\n vec2 windowCoords = vec2((v_roundVertex.x + 1.0) / 2.0 * u_size.x * u_pixelRatio,\n (v_roundVertex.y + 1.0) / 2.0 * u_size.y * u_pixelRatio);\n if (length(windowCoords - gl_FragCoord.xy) > v_halfWidth * u_pixelRatio) {\n discard;\n }\n }\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;varying float a;varying vec2 aVertex;varying float c;uniform float m;uniform vec4 n;uniform vec2 o;uniform float p;void main(void){if(a>0.0){vec2 windowCoords=vec2((aVertex.x+1.0)/2.0*o.x*p,(aVertex.y+1.0)/2.0*o.y*p);if(length(windowCoords-gl_FragCoord.xy)>c*p){discard;}} gl_FragColor=n;float alpha=n.a*m;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),na.vertex=new Wr(Gs.DEBUG_WEBGL?"varying float v_round;\nvarying vec2 v_roundVertex;\nvarying float v_halfWidth;\n\n\nattribute vec2 a_lastPos;\nattribute vec2 a_position;\nattribute vec2 a_nextPos;\nattribute float a_direction;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_lineWidth;\nuniform float u_miterLimit;\n\nbool nearlyEquals(in float value, in float ref) {\n float epsilon = 0.000000000001;\n return value >= ref - epsilon && value <= ref + epsilon;\n}\n\nvoid alongNormal(out vec2 offset, in vec2 nextP, in float turnDir, in float direction) {\n vec2 dirVect = nextP - a_position;\n vec2 normal = normalize(vec2(-turnDir * dirVect.y, turnDir * dirVect.x));\n offset = u_lineWidth / 2.0 * normal * direction;\n}\n\nvoid miterUp(out vec2 offset, out float round, in bool isRound, in float direction) {\n float halfWidth = u_lineWidth / 2.0;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_nextPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n round = 0.0;\n if (isRound) {\n round = 1.0;\n } else if (miterLength > u_miterLimit + u_lineWidth) {\n offset = halfWidth * tmpNormal * direction;\n }\n}\n\nbool miterDown(out vec2 offset, in vec4 projPos, in mat4 offsetMatrix, in float direction) {\n bool degenerate = false;\n vec2 tangent = normalize(normalize(a_nextPos - a_position) + normalize(a_position - a_lastPos));\n vec2 normal = vec2(-tangent.y, tangent.x);\n vec2 dirVect = a_lastPos - a_position;\n vec2 tmpNormal = normalize(vec2(-dirVect.y, dirVect.x));\n vec2 longOffset, shortOffset, longVertex;\n vec4 shortProjVertex;\n float halfWidth = u_lineWidth / 2.0;\n if (length(a_nextPos - a_position) > length(a_lastPos - a_position)) {\n longOffset = tmpNormal * direction * halfWidth;\n shortOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_nextPos;\n shortProjVertex = u_projectionMatrix * vec4(a_lastPos, 0.0, 1.0);\n } else {\n shortOffset = tmpNormal * direction * halfWidth;\n longOffset = normalize(vec2(dirVect.y, -dirVect.x)) * direction * halfWidth;\n longVertex = a_lastPos;\n shortProjVertex = u_projectionMatrix * vec4(a_nextPos, 0.0, 1.0);\n }\n //Intersection algorithm based on theory by Paul Bourke (http://paulbourke.net/geometry/pointlineplane/).\n vec4 p1 = u_projectionMatrix * vec4(longVertex, 0.0, 1.0) + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p2 = projPos + offsetMatrix * vec4(longOffset, 0.0, 0.0);\n vec4 p3 = shortProjVertex + offsetMatrix * vec4(-shortOffset, 0.0, 0.0);\n vec4 p4 = shortProjVertex + offsetMatrix * vec4(shortOffset, 0.0, 0.0);\n float denom = (p4.y - p3.y) * (p2.x - p1.x) - (p4.x - p3.x) * (p2.y - p1.y);\n float firstU = ((p4.x - p3.x) * (p1.y - p3.y) - (p4.y - p3.y) * (p1.x - p3.x)) / denom;\n float secondU = ((p2.x - p1.x) * (p1.y - p3.y) - (p2.y - p1.y) * (p1.x - p3.x)) / denom;\n float epsilon = 0.000000000001;\n if (firstU > epsilon && firstU < 1.0 - epsilon && secondU > epsilon && secondU < 1.0 - epsilon) {\n shortProjVertex.x = p1.x + firstU * (p2.x - p1.x);\n shortProjVertex.y = p1.y + firstU * (p2.y - p1.y);\n offset = shortProjVertex.xy;\n degenerate = true;\n } else {\n float miterLength = abs(halfWidth / dot(normal, tmpNormal));\n offset = normal * direction * miterLength;\n }\n return degenerate;\n}\n\nvoid squareCap(out vec2 offset, out float round, in bool isRound, in vec2 nextP,\n in float turnDir, in float direction) {\n round = 0.0;\n vec2 dirVect = a_position - nextP;\n vec2 firstNormal = normalize(dirVect);\n vec2 secondNormal = vec2(turnDir * firstNormal.y * direction, -turnDir * firstNormal.x * direction);\n vec2 hypotenuse = normalize(firstNormal - secondNormal);\n vec2 normal = vec2(turnDir * hypotenuse.y * direction, -turnDir * hypotenuse.x * direction);\n float length = sqrt(v_halfWidth * v_halfWidth * 2.0);\n offset = normal * length;\n if (isRound) {\n round = 1.0;\n }\n}\n\nvoid main(void) {\n bool degenerate = false;\n float direction = float(sign(a_direction));\n mat4 offsetMatrix = u_offsetScaleMatrix * u_offsetRotateMatrix;\n vec2 offset;\n vec4 projPos = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n bool round = nearlyEquals(mod(a_direction, 2.0), 0.0);\n\n v_round = 0.0;\n v_halfWidth = u_lineWidth / 2.0;\n v_roundVertex = projPos.xy;\n\n if (nearlyEquals(mod(a_direction, 3.0), 0.0) || nearlyEquals(mod(a_direction, 17.0), 0.0)) {\n alongNormal(offset, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 5.0), 0.0) || nearlyEquals(mod(a_direction, 13.0), 0.0)) {\n alongNormal(offset, a_lastPos, -1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 23.0), 0.0)) {\n miterUp(offset, v_round, round, direction);\n } else if (nearlyEquals(mod(a_direction, 19.0), 0.0)) {\n degenerate = miterDown(offset, projPos, offsetMatrix, direction);\n } else if (nearlyEquals(mod(a_direction, 7.0), 0.0)) {\n squareCap(offset, v_round, round, a_nextPos, 1.0, direction);\n } else if (nearlyEquals(mod(a_direction, 11.0), 0.0)) {\n squareCap(offset, v_round, round, a_lastPos, -1.0, direction);\n }\n if (!degenerate) {\n vec4 offsets = offsetMatrix * vec4(offset, 0.0, 0.0);\n gl_Position = projPos + offsets;\n } else {\n gl_Position = vec4(offset, 0.0, 1.0);\n }\n}\n\n\n":"varying float a;varying vec2 aVertex;varying float c;attribute vec2 d;attribute vec2 e;attribute vec2 f;attribute float g;uniform mat4 h;uniform mat4 i;uniform mat4 j;uniform float k;uniform float l;bool nearlyEquals(in float value,in float ref){float epsilon=0.000000000001;return value>=ref-epsilon&&value<=ref+epsilon;}void alongNormal(out vec2 offset,in vec2 nextP,in float turnDir,in float direction){vec2 dirVect=nextP-e;vec2 normal=normalize(vec2(-turnDir*dirVect.y,turnDir*dirVect.x));offset=k/2.0*normal*direction;}void miterUp(out vec2 offset,out float round,in bool isRound,in float direction){float halfWidth=k/2.0;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=f-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;round=0.0;if(isRound){round=1.0;}else if(miterLength>l+k){offset=halfWidth*tmpNormal*direction;}} bool miterDown(out vec2 offset,in vec4 projPos,in mat4 offsetMatrix,in float direction){bool degenerate=false;vec2 tangent=normalize(normalize(f-e)+normalize(e-d));vec2 normal=vec2(-tangent.y,tangent.x);vec2 dirVect=d-e;vec2 tmpNormal=normalize(vec2(-dirVect.y,dirVect.x));vec2 longOffset,shortOffset,longVertex;vec4 shortProjVertex;float halfWidth=k/2.0;if(length(f-e)>length(d-e)){longOffset=tmpNormal*direction*halfWidth;shortOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=f;shortProjVertex=h*vec4(d,0.0,1.0);}else{shortOffset=tmpNormal*direction*halfWidth;longOffset=normalize(vec2(dirVect.y,-dirVect.x))*direction*halfWidth;longVertex=d;shortProjVertex=h*vec4(f,0.0,1.0);}vec4 p1=h*vec4(longVertex,0.0,1.0)+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p2=projPos+offsetMatrix*vec4(longOffset,0.0,0.0);vec4 p3=shortProjVertex+offsetMatrix*vec4(-shortOffset,0.0,0.0);vec4 p4=shortProjVertex+offsetMatrix*vec4(shortOffset,0.0,0.0);float denom=(p4.y-p3.y)*(p2.x-p1.x)-(p4.x-p3.x)*(p2.y-p1.y);float firstU=((p4.x-p3.x)*(p1.y-p3.y)-(p4.y-p3.y)*(p1.x-p3.x))/denom;float secondU=((p2.x-p1.x)*(p1.y-p3.y)-(p2.y-p1.y)*(p1.x-p3.x))/denom;float epsilon=0.000000000001;if(firstU>epsilon&&firstU<1.0-epsilon&&secondU>epsilon&&secondU<1.0-epsilon){shortProjVertex.x=p1.x+firstU*(p2.x-p1.x);shortProjVertex.y=p1.y+firstU*(p2.y-p1.y);offset=shortProjVertex.xy;degenerate=true;}else{float miterLength=abs(halfWidth/dot(normal,tmpNormal));offset=normal*direction*miterLength;}return degenerate;}void squareCap(out vec2 offset,out float round,in bool isRound,in vec2 nextP,in float turnDir,in float direction){round=0.0;vec2 dirVect=e-nextP;vec2 firstNormal=normalize(dirVect);vec2 secondNormal=vec2(turnDir*firstNormal.y*direction,-turnDir*firstNormal.x*direction);vec2 hypotenuse=normalize(firstNormal-secondNormal);vec2 normal=vec2(turnDir*hypotenuse.y*direction,-turnDir*hypotenuse.x*direction);float length=sqrt(c*c*2.0);offset=normal*length;if(isRound){round=1.0;}} void main(void){bool degenerate=false;float direction=float(sign(g));mat4 offsetMatrix=i*j;vec2 offset;vec4 projPos=h*vec4(e,0.0,1.0);bool round=nearlyEquals(mod(g,2.0),0.0);a=0.0;c=k/2.0;aVertex=projPos.xy;if(nearlyEquals(mod(g,3.0),0.0)||nearlyEquals(mod(g,17.0),0.0)){alongNormal(offset,f,1.0,direction);}else if(nearlyEquals(mod(g,5.0),0.0)||nearlyEquals(mod(g,13.0),0.0)){alongNormal(offset,d,-1.0,direction);}else if(nearlyEquals(mod(g,23.0),0.0)){miterUp(offset,a,round,direction);}else if(nearlyEquals(mod(g,19.0),0.0)){degenerate=miterDown(offset,projPos,offsetMatrix,direction);}else if(nearlyEquals(mod(g,7.0),0.0)){squareCap(offset,a,round,f,1.0,direction);}else if(nearlyEquals(mod(g,11.0),0.0)){squareCap(offset,a,round,d,-1.0,direction);}if(!degenerate){vec4 offsets=offsetMatrix*vec4(offset,0.0,0.0);gl_Position=projPos+offsets;}else{gl_Position=vec4(offset,0.0,1.0);}}");var ea=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"h"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"i"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"j"),this.u_lineWidth=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_lineWidth":"k"),this.u_miterLimit=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_miterLimit":"l"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"m"),this.u_color=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_color":"n"),this.u_size=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_size":"o"),this.u_pixelRatio=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_pixelRatio":"p"),this.a_lastPos=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_lastPos":"d"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"e"),this.a_nextPos=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_nextPos":"f"),this.a_direction=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_direction":"g")},ra=function(t,i){Xr.call(this,t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:void 0,miterLimit:void 0,changed:!1}};Gs.inherits(ra,Xr),ra.prototype.drawCoordinates_=function(t,i,s,h){var n,e,r,a,o,u,c,l,f=this.vertices.length,d=this.indices.length,v="bevel"===this.state_.lineJoin?0:"miter"===this.state_.lineJoin?1:2,m="butt"===this.state_.lineCap?0:"square"===this.state_.lineCap?1:2,p=ha(t,i,s,h),_=d,g=1;for(n=i,e=s;n<e;n+=h){if(o=f/7,u=c,c=l||[t[n],t[n+1]],n===i){if(l=[t[n+h],t[n+h+1]],s-i==2*h&&_h.equals(c,l))break;if(!p){m&&(f=this.addVertices_([0,0],c,l,g*ra.Instruction_.BEGIN_LINE_CAP*m,f),f=this.addVertices_([0,0],c,l,-g*ra.Instruction_.BEGIN_LINE_CAP*m,f),this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=o+1,this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o+2),f=this.addVertices_([0,0],c,l,g*ra.Instruction_.BEGIN_LINE*(m||1),f),_=(f=this.addVertices_([0,0],c,l,-g*ra.Instruction_.BEGIN_LINE*(m||1),f))/7-1;continue}u=[t[s-2*h],t[s-2*h+1]],r=l}else{if(n===s-h){if(p){l=r;break}f=this.addVertices_(u=u||[0,0],c,[0,0],g*ra.Instruction_.END_LINE*(m||1),f),f=this.addVertices_(u,c,[0,0],-g*ra.Instruction_.END_LINE*(m||1),f),this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=_,this.indices[d++]=o+1,this.indices[d++]=o,m&&(f=this.addVertices_(u,c,[0,0],g*ra.Instruction_.END_LINE_CAP*m,f),f=this.addVertices_(u,c,[0,0],-g*ra.Instruction_.END_LINE_CAP*m,f),this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=o+1,this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o+2);break}l=[t[n+h],t[n+h+1]]}a=Hr.triangleIsCounterClockwise(u[0],u[1],c[0],c[1],l[0],l[1])?-1:1,f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_FIRST*(v||1),f),f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_SECOND*(v||1),f),f=this.addVertices_(u,c,l,-a*ra.Instruction_.MITER_BOTTOM*(v||1),f),n>i&&(this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=o+2,this.indices[d++]=o,this.indices[d++]=g*a>0?_:_-1),this.indices[d++]=o,this.indices[d++]=o+2,this.indices[d++]=o+1,_=o+2,g=a,v&&(f=this.addVertices_(u,c,l,a*ra.Instruction_.MITER_TOP*v,f),this.indices[d++]=o+1,this.indices[d++]=o+3,this.indices[d++]=o)}p&&(o=o||f/7,a=Kh.linearRingIsClockwise([u[0],u[1],c[0],c[1],l[0],l[1]],0,6,2)?1:-1,f=this.addVertices_(u,c,l,a*ra.Instruction_.BEVEL_FIRST*(v||1),f),f=this.addVertices_(u,c,l,-a*ra.Instruction_.MITER_BOTTOM*(v||1),f),this.indices[d++]=o,this.indices[d++]=_-1,this.indices[d++]=_,this.indices[d++]=o+1,this.indices[d++]=o,this.indices[d++]=g*a>0?_:_-1)},ra.prototype.addVertices_=function(t,i,s,h,n){return this.vertices[n++]=t[0],this.vertices[n++]=t[1],this.vertices[n++]=i[0],this.vertices[n++]=i[1],this.vertices[n++]=s[0],this.vertices[n++]=s[1],this.vertices[n++]=h,n},ra.prototype.isValid_=function(t,i,s,h){var n=s-i;return!(n<2*h||n===2*h&&_h.equals([t[i],t[i+1]],[t[i+h],t[i+h+1]]))},ra.prototype.drawLineString=function(t,i){var s=t.getFlatCoordinates(),h=t.getStride();this.isValid_(s,0,s.length,h)&&(s=Ph(s,0,s.length,h,-this.origin[0],-this.origin[1]),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.drawCoordinates_(s,0,s.length,h))},ra.prototype.drawMultiLineString=function(t,i){var s=this.indices.length,h=t.getEnds();h.unshift(0);var n,e,r=t.getFlatCoordinates(),a=t.getStride();if(h.length>1)for(n=1,e=h.length;n<e;++n)if(this.isValid_(r,h[n-1],h[n],a)){var o=Ph(r,h[n-1],h[n],a,-this.origin[0],-this.origin[1]);this.drawCoordinates_(o,0,o.length,a)}this.indices.length>s&&(this.startIndices.push(s),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1))},ra.prototype.drawPolygonCoordinates=function(t,i,s){var h,n;if(ha(t,0,t.length,s)||(t.push(t[0]),t.push(t[1])),this.drawCoordinates_(t,0,t.length,s),i.length)for(h=0,n=i.length;h<n;++h)ha(i[h],0,i[h].length,s)||(i[h].push(i[h][0]),i[h].push(i[h][1])),this.drawCoordinates_(i[h],0,i[h].length,s)},ra.prototype.setPolygonStyle=function(t,i){var s=void 0===i?this.indices.length:i;this.startIndices.push(s),this.startIndicesFeature.push(t),this.state_.changed&&(this.styleIndices_.push(s),this.state_.changed=!1)},ra.prototype.getCurrentIndex=function(){return this.indices.length},ra.prototype.finish=function(){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},ra.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer;return function(){t.deleteBuffer(i),t.deleteBuffer(s)}},ra.prototype.setUpProgram=function(t,i,s,h){var n,e=i.getProgram(na.fragment,na.vertex);return this.defaultLocations_?n=this.defaultLocations_:(n=new ea(t,e),this.defaultLocations_=n),i.useProgram(e),t.enableVertexAttribArray(n.a_lastPos),t.vertexAttribPointer(n.a_lastPos,2,Qh.FLOAT,!1,28,0),t.enableVertexAttribArray(n.a_position),t.vertexAttribPointer(n.a_position,2,Qh.FLOAT,!1,28,8),t.enableVertexAttribArray(n.a_nextPos),t.vertexAttribPointer(n.a_nextPos,2,Qh.FLOAT,!1,28,16),t.enableVertexAttribArray(n.a_direction),t.vertexAttribPointer(n.a_direction,1,Qh.FLOAT,!1,28,24),t.uniform2fv(n.u_size,s),t.uniform1f(n.u_pixelRatio,h),n},ra.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_lastPos),t.disableVertexAttribArray(i.a_position),t.disableVertexAttribArray(i.a_nextPos),t.disableVertexAttribArray(i.a_direction)},ra.prototype.drawReplay=function(t,i,s,h){var n,e,r,a,o=t.getParameter(t.DEPTH_FUNC),u=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),js.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)e=this.styleIndices_[n],this.setStrokeStyle_(t,(a=this.styles_[n])[0],a[1],a[2]),this.drawElements(t,i,e,r),t.clear(t.DEPTH_BUFFER_BIT),r=e;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(u),t.depthFunc(o))},ra.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o,u;for(e=n=this.startIndices[1+(o=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setStrokeStyle_(t,(r=this.styles_[h])[0],r[1],r[2]),a=this.styleIndices_[h];o>=0&&this.startIndices[o]>=a;)u=this.startIndices[o],s[Gs.getUid(this.startIndicesFeature[o]).toString()]&&(n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),e=u),o--,n=u;n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),n=e=a}},ra.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c,l;for(a=this.startIndices[1+(l=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setStrokeStyle_(t,(o=this.styles_[e])[0],o[1],o[2]),u=this.styleIndices_[e];l>=0&&this.startIndices[l]>=u;){if(r=this.startIndices[l],void 0===s[Gs.getUid(c=this.startIndicesFeature[l]).toString()]&&c.getGeometry()&&(void 0===n||zh.intersects(n,c.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var f=h(c);if(f)return f}l--,a=r}},ra.prototype.setStrokeStyle_=function(t,i,s,h){t.uniform4fv(this.defaultLocations_.u_color,i),t.uniform1f(this.defaultLocations_.u_lineWidth,s),t.uniform1f(this.defaultLocations_.u_miterLimit,h)},ra.prototype.setFillStrokeStyle=function(t,i){var s=i.getLineCap();this.state_.lineCap=void 0!==s?s:Hr.defaultLineCap;var h=i.getLineDash();this.state_.lineDash=h||Hr.defaultLineDash;var n=i.getLineDashOffset();this.state_.lineDashOffset=n||Hr.defaultLineDashOffset;var e=i.getLineJoin();this.state_.lineJoin=void 0!==e?e:Hr.defaultLineJoin;var r=i.getColor();r=r instanceof CanvasGradient||r instanceof CanvasPattern?Hr.defaultStrokeStyle:Je.asArray(r).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultStrokeStyle;var a=i.getWidth();a=void 0!==a?a:Hr.defaultLineWidth;var o=i.getMiterLimit();o=void 0!==o?o:Hr.defaultMiterLimit,this.state_.strokeColor&&_h.equals(this.state_.strokeColor,r)&&this.state_.lineWidth===a&&this.state_.miterLimit===o||(this.state_.changed=!0,this.state_.strokeColor=r,this.state_.lineWidth=a,this.state_.miterLimit=o,this.styles_.push([r,a,o]))},ra.Instruction_={ROUND:2,BEGIN_LINE:3,END_LINE:5,BEGIN_LINE_CAP:7,END_LINE_CAP:11,BEVEL_FIRST:13,BEVEL_SECOND:17,MITER_BOTTOM:19,MITER_TOP:23};var aa={};aa.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\n\n\n\nuniform vec4 u_color;\nuniform float u_opacity;\n\nvoid main(void) {\n gl_FragColor = u_color;\n float alpha = u_color.a * u_opacity;\n if (alpha == 0.0) {\n discard;\n }\n gl_FragColor.a = alpha;\n}\n":"precision mediump float;uniform vec4 e;uniform float f;void main(void){gl_FragColor=e;float alpha=e.a*f;if(alpha==0.0){discard;}gl_FragColor.a=alpha;}"),aa.vertex=new Wr(Gs.DEBUG_WEBGL?"\n\nattribute vec2 a_position;\n\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n}\n\n\n":"attribute vec2 a;uniform mat4 b;uniform mat4 c;uniform mat4 d;void main(void){gl_Position=b*vec4(a,0.0,1.0);}");var oa=function(t,i){this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"b"),this.u_offsetScaleMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetScaleMatrix":"c"),this.u_offsetRotateMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_offsetRotateMatrix":"d"),this.u_color=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_color":"e"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"f"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"a")},ua=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.lineCap_=i.lineCap,this.lineDash_=void 0!==i.lineDash?i.lineDash:null,this.lineDashOffset_=i.lineDashOffset,this.lineJoin_=i.lineJoin,this.miterLimit_=i.miterLimit,this.width_=i.width,this.checksum_=void 0};ua.prototype.clone=function(){var t=this.getColor();return new ua({color:t&&t.slice?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},ua.prototype.getColor=function(){return this.color_},ua.prototype.getLineCap=function(){return this.lineCap_},ua.prototype.getLineDash=function(){return this.lineDash_},ua.prototype.getLineDashOffset=function(){return this.lineDashOffset_},ua.prototype.getLineJoin=function(){return this.lineJoin_},ua.prototype.getMiterLimit=function(){return this.miterLimit_},ua.prototype.getWidth=function(){return this.width_},ua.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},ua.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},ua.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},ua.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},ua.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},ua.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},ua.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},ua.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.checksum_+=this.color_?"string"==typeof this.color_?this.color_:Gs.getUid(this.color_).toString():"-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var ca=function(t){this.first_=void 0,this.last_=void 0,this.head_=void 0,this.circular_=void 0===t||t,this.length_=0};ca.prototype.insertItem=function(t){var i={prev:void 0,next:void 0,data:t},s=this.head_;if(s){var h=s.next;i.prev=s,i.next=h,s.next=i,h&&(h.prev=i),s===this.last_&&(this.last_=i)}else this.first_=i,this.last_=i,this.circular_&&(i.next=i,i.prev=i);this.head_=i,this.length_++},ca.prototype.removeItem=function(){var t=this.head_;if(t){var i=t.next,s=t.prev;i&&(i.prev=s),s&&(s.next=i),this.head_=i||s,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=s?this.head_.prev:this.head_),this.length_--}},ca.prototype.firstItem=function(){if(this.head_=this.first_,this.head_)return this.head_.data},ca.prototype.lastItem=function(){if(this.head_=this.last_,this.head_)return this.head_.data},ca.prototype.nextItem=function(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data},ca.prototype.getNextItem=function(){if(this.head_&&this.head_.next)return this.head_.next.data},ca.prototype.prevItem=function(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data},ca.prototype.getPrevItem=function(){if(this.head_&&this.head_.prev)return this.head_.prev.data},ca.prototype.getCurrItem=function(){if(this.head_)return this.head_.data},ca.prototype.setFirstItem=function(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)},ca.prototype.concat=function(t){if(t.head_){if(this.head_){var i=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,i.prev=t.last_,t.last_.next=i,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}},ca.prototype.getLength=function(){return this.length_};var la=function(t){this.rbush_=mr(t),this.items_={}};la.prototype.insert=function(t,i){var s={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:i};this.rbush_.insert(s),this.items_[Gs.getUid(i)]=s},la.prototype.load=function(t,i){for(var s=new Array(i.length),h=0,n=i.length;h<n;h++){var e=t[h],r=i[h],a={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:r};s[h]=a,this.items_[Gs.getUid(r)]=a}this.rbush_.load(s)},la.prototype.remove=function(t){var i=Gs.getUid(t),s=this.items_[i];return delete this.items_[i],null!==this.rbush_.remove(s)},la.prototype.update=function(t,i){var s=this.items_[Gs.getUid(i)];zh.equals([s.minX,s.minY,s.maxX,s.maxY],t)||(this.remove(i),this.insert(t,i))},la.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},la.prototype.getInExtent=function(t){return this.rbush_.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}).map((function(t){return t.value}))},la.prototype.forEach=function(t,i){return this.forEach_(this.getAll(),t,i)},la.prototype.forEachInExtent=function(t,i,s){return this.forEach_(this.getInExtent(t),i,s)},la.prototype.forEach_=function(t,i,s){for(var h,n=0,e=t.length;n<e;n++)if(h=i.call(s,t[n]))return h;return h},la.prototype.isEmpty=function(){return js.isEmpty(this.items_)},la.prototype.clear=function(){this.rbush_.clear(),this.items_={}},la.prototype.getExtent=function(t){var i=this.rbush_.data;return zh.createOrUpdate(i.minX,i.minY,i.maxX,i.maxY,t)},la.prototype.concat=function(t){for(var i in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[0|i]=t.items_[0|i]};var fa=function(t,i){Xr.call(this,t,i),this.lineStringReplay=new ra(t,i),this.defaultLocations_=null,this.styles_=[],this.styleIndices_=[],this.state_={fillColor:null,changed:!1}};Gs.inherits(fa,Xr),fa.prototype.drawCoordinates_=function(t,i,s){var h=new ca,n=new la;this.processFlatCoordinates_(t,s,h,n,!0);var e=this.getMaxCoords_(h);if(i.length){var r,a,o=[];for(r=0,a=i.length;r<a;++r){var u={list:new ca,maxCoords:void 0,rtree:new la};o.push(u),this.processFlatCoordinates_(i[r],s,u.list,u.rtree,!1),this.classifyPoints_(u.list,u.rtree,!0),u.maxCoords=this.getMaxCoords_(u.list)}for(o.sort((function(t,i){return i.maxCoords[0]===t.maxCoords[0]?t.maxCoords[1]-i.maxCoords[1]:i.maxCoords[0]-t.maxCoords[0]})),r=0;r<o.length;++r){var c,l=o[r].list,f=l.firstItem(),d=f;do{if(this.getIntersections_(d,n).length){c=!0;break}d=l.nextItem()}while(f!==d);c||this.bridgeHole_(l,o[r].maxCoords[0],h,e[0],n)&&(n.concat(o[r].rtree),this.classifyPoints_(h,n,!1))}}else this.classifyPoints_(h,n,!1);this.triangulate_(h,n)},fa.prototype.processFlatCoordinates_=function(t,i,s,h,n){var e,r,a,o,u,c=Kh.linearRingIsClockwise(t,0,t.length,i),l=this.vertices.length/2,f=[],d=[];if(n===c){for(o=a=this.createPoint_(t[0],t[1],l++),e=i,r=t.length;e<r;e+=i)u=this.createPoint_(t[e],t[e+1],l++),d.push(this.insertItem_(o,u,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)]),o=u;d.push(this.insertItem_(u,a,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)])}else{var v=t.length-i;for(o=a=this.createPoint_(t[v],t[v+1],l++),e=v-i,r=0;e>=r;e-=i)u=this.createPoint_(t[e],t[e+1],l++),d.push(this.insertItem_(o,u,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)]),o=u;d.push(this.insertItem_(u,a,s)),f.push([Math.min(o.x,u.x),Math.min(o.y,u.y),Math.max(o.x,u.x),Math.max(o.y,u.y)])}h.load(f,d)},fa.prototype.getMaxCoords_=function(t){var i=t.firstItem(),s=i,h=[s.p0.x,s.p0.y];do{(s=t.nextItem()).p0.x>h[0]&&(h=[s.p0.x,s.p0.y])}while(s!==i);return h},fa.prototype.classifyPoints_=function(t,i,s){var h=t.firstItem(),n=h,e=t.nextItem(),r=!1;do{var a=s?Hr.triangleIsCounterClockwise(e.p1.x,e.p1.y,n.p1.x,n.p1.y,n.p0.x,n.p0.y):Hr.triangleIsCounterClockwise(n.p0.x,n.p0.y,n.p1.x,n.p1.y,e.p1.x,e.p1.y);void 0===a?(this.removeItem_(n,e,t,i),r=!0,e===h&&(h=t.getNextItem()),e=n,t.prevItem()):n.p1.reflex!==a&&(n.p1.reflex=a,r=!0),n=e,e=t.nextItem()}while(n!==h);return r},fa.prototype.bridgeHole_=function(t,i,s,h,n){for(var e=t.firstItem();e.p1.x!==i;)e=t.nextItem();var r,a,o,u,c=e.p1,l={x:h,y:c.y,i:-1},f=1/0,d=this.getIntersections_({p0:c,p1:l},n,!0);for(r=0,a=d.length;r<a;++r){var v=d[r],m=this.calculateIntersection_(c,l,v.p0,v.p1,!0),p=Math.abs(c.x-m[0]);p<f&&void 0!==Hr.triangleIsCounterClockwise(c.x,c.y,v.p0.x,v.p0.y,v.p1.x,v.p1.y)&&(f=p,u={x:m[0],y:m[1],i:-1},e=v)}if(f===1/0)return!1;if(o=e.p1,f>0){var _=this.getPointsInTriangle_(c,u,e.p1,n);if(_.length){var g=1/0;for(r=0,a=_.length;r<a;++r){var z=_[r],M=Math.atan2(c.y-z.y,l.x-z.x);(M<g||M===g&&z.x<o.x)&&(g=M,o=z)}}}for(e=s.firstItem();e.p1.x!==o.x||e.p1.y!==o.y;)e=s.nextItem();var w={x:c.x,y:c.y,i:c.i,reflex:void 0},b={x:e.p1.x,y:e.p1.y,i:e.p1.i,reflex:void 0};return t.getNextItem().p0=w,this.insertItem_(c,e.p1,t,n),this.insertItem_(b,w,t,n),e.p1=b,t.setFirstItem(),s.concat(t),!0},fa.prototype.triangulate_=function(t,i){for(var s=!1,h=this.isSimple_(t,i);t.getLength()>3;)if(h){if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i,!0))break}else if(!this.clipEars_(t,i,h,s)&&!this.classifyPoints_(t,i,s)&&!this.resolveSelfIntersections_(t,i)){if(!(h=this.isSimple_(t,i))){this.splitPolygon_(t,i);break}s=!this.isClockwise_(t),this.classifyPoints_(t,i,s)}if(3===t.getLength()){var n=this.indices.length;this.indices[n++]=t.getPrevItem().p0.i,this.indices[n++]=t.getCurrItem().p0.i,this.indices[n++]=t.getNextItem().p0.i}},fa.prototype.clipEars_=function(t,i,s,h){var n,e,r,a=this.indices.length,o=t.firstItem(),u=t.getPrevItem(),c=o,l=t.nextItem(),f=t.getNextItem(),d=!1;do{var v;n=c.p0,r=l.p1,!1===(e=c.p1).reflex&&(v=s?0===this.getPointsInTriangle_(n,e,r,i,!0).length:h?this.diagonalIsInside_(f.p1,r,e,n,u.p0):this.diagonalIsInside_(u.p0,n,e,r,f.p1),(s||0===this.getIntersections_({p0:n,p1:r},i).length)&&v&&(s||!1===n.reflex||!1===r.reflex||Kh.linearRingIsClockwise([u.p0.x,u.p0.y,n.x,n.y,e.x,e.y,r.x,r.y,f.p1.x,f.p1.y],0,10,2)===!h)&&(this.indices[a++]=n.i,this.indices[a++]=e.i,this.indices[a++]=r.i,this.removeItem_(c,l,t,i),l===o&&(o=f),d=!0)),u=t.getPrevItem(),c=t.getCurrItem(),l=t.nextItem(),f=t.getNextItem()}while(c!==o&&t.getLength()>3);return d},fa.prototype.resolveSelfIntersections_=function(t,i,s){var h=t.firstItem();t.nextItem();var n=h,e=t.nextItem(),r=!1;do{var a=this.calculateIntersection_(n.p0,n.p1,e.p0,e.p1,s);if(a){var o,u=!1,c=this.indices.length,l=this.vertices.length/2,f=t.prevItem();if(t.removeItem(),i.remove(f),u=f===h,s?(a[0]===n.p0.x&&a[1]===n.p0.y?(t.prevItem(),e.p0=o=n.p0,i.remove(n),u=u||n===h):(n.p1=o=e.p1,i.remove(e),u=u||e===h),t.removeItem()):(o=this.createPoint_(a[0],a[1],l),n.p1=o,e.p0=o,i.update([Math.min(n.p0.x,n.p1.x),Math.min(n.p0.y,n.p1.y),Math.max(n.p0.x,n.p1.x),Math.max(n.p0.y,n.p1.y)],n),i.update([Math.min(e.p0.x,e.p1.x),Math.min(e.p0.y,e.p1.y),Math.max(e.p0.x,e.p1.x),Math.max(e.p0.y,e.p1.y)],e)),this.indices[c++]=f.p0.i,this.indices[c++]=f.p1.i,this.indices[c++]=o.i,r=!0,u)break}n=t.getPrevItem(),e=t.nextItem()}while(n!==h);return r},fa.prototype.isSimple_=function(t,i){var s=t.firstItem(),h=s;do{if(this.getIntersections_(h,i).length)return!1;h=t.nextItem()}while(h!==s);return!0},fa.prototype.isClockwise_=function(t){var i=2*t.getLength(),s=new Array(i),h=t.firstItem(),n=h,e=0;do{s[e++]=n.p0.x,s[e++]=n.p0.y,n=t.nextItem()}while(n!==h);return Kh.linearRingIsClockwise(s,0,i,2)},fa.prototype.splitPolygon_=function(t,i){var s=t.firstItem(),h=s;do{var n=this.getIntersections_(h,i);if(n.length){var e=n[0],r=this.vertices.length/2,a=this.calculateIntersection_(h.p0,h.p1,e.p0,e.p1),o=this.createPoint_(a[0],a[1],r),u=new ca,c=new la;this.insertItem_(o,h.p1,u,c),h.p1=o,i.update([Math.min(h.p0.x,o.x),Math.min(h.p0.y,o.y),Math.max(h.p0.x,o.x),Math.max(h.p0.y,o.y)],h);for(var l=t.nextItem();l!==e;)this.insertItem_(l.p0,l.p1,u,c),i.remove(l),t.removeItem(),l=t.getCurrItem();this.insertItem_(e.p0,o,u,c),e.p0=o,i.update([Math.min(e.p1.x,o.x),Math.min(e.p1.y,o.y),Math.max(e.p1.x,o.x),Math.max(e.p1.y,o.y)],e),this.classifyPoints_(t,i,!1),this.triangulate_(t,i),this.classifyPoints_(u,c,!1),this.triangulate_(u,c);break}h=t.nextItem()}while(h!==s)},fa.prototype.createPoint_=function(t,i,s){var h=this.vertices.length;return this.vertices[h++]=t,this.vertices[h++]=i,{x:t,y:i,i:s,reflex:void 0}},fa.prototype.insertItem_=function(t,i,s,h){var n={p0:t,p1:i};return s.insertItem(n),h&&h.insert([Math.min(t.x,i.x),Math.min(t.y,i.y),Math.max(t.x,i.x),Math.max(t.y,i.y)],n),n},fa.prototype.removeItem_=function(t,i,s,h){s.getCurrItem()===i&&(s.removeItem(),t.p1=i.p1,h.remove(i),h.update([Math.min(t.p0.x,t.p1.x),Math.min(t.p0.y,t.p1.y),Math.max(t.p0.x,t.p1.x),Math.max(t.p0.y,t.p1.y)],t))},fa.prototype.getPointsInTriangle_=function(t,i,s,h,n){var e,r,a,o,u=[],c=h.getInExtent([Math.min(t.x,i.x,s.x),Math.min(t.y,i.y,s.y),Math.max(t.x,i.x,s.x),Math.max(t.y,i.y,s.y)]);for(e=0,r=c.length;e<r;++e)for(a in c[e])"object"!=typeof(o=c[e][a])||n&&!o.reflex||o.x===t.x&&o.y===t.y||o.x===i.x&&o.y===i.y||o.x===s.x&&o.y===s.y||-1!==u.indexOf(o)||!Xh.linearRingContainsXY([t.x,t.y,i.x,i.y,s.x,s.y],0,6,2,o.x,o.y)||u.push(o);return u},fa.prototype.getIntersections_=function(t,i,s){var h,n,e=t.p0,r=t.p1,a=i.getInExtent([Math.min(e.x,r.x),Math.min(e.y,r.y),Math.max(e.x,r.x),Math.max(e.y,r.y)]),o=[];for(h=0,n=a.length;h<n;++h){var u=a[h];t!==u&&(s||u.p0!==r||u.p1!==e)&&this.calculateIntersection_(e,r,u.p0,u.p1,s)&&o.push(u)}return o},fa.prototype.calculateIntersection_=function(t,i,s,h,n){var e=(h.y-s.y)*(i.x-t.x)-(h.x-s.x)*(i.y-t.y);if(0!==e){var r=((h.x-s.x)*(t.y-s.y)-(h.y-s.y)*(t.x-s.x))/e,a=((i.x-t.x)*(t.y-s.y)-(i.y-t.y)*(t.x-s.x))/e;if(!n&&r>Hr.EPSILON&&r<1-Hr.EPSILON&&a>Hr.EPSILON&&a<1-Hr.EPSILON||n&&r>=0&&r<=1&&a>=0&&a<=1)return[t.x+r*(i.x-t.x),t.y+r*(i.y-t.y)]}},fa.prototype.diagonalIsInside_=function(t,i,s,h,n){if(void 0===i.reflex||void 0===h.reflex)return!1;var e=(s.x-h.x)*(i.y-h.y)>(s.y-h.y)*(i.x-h.x),r=(n.x-h.x)*(i.y-h.y)<(n.y-h.y)*(i.x-h.x),a=(t.x-i.x)*(h.y-i.y)>(t.y-i.y)*(h.x-i.x),o=(s.x-i.x)*(h.y-i.y)<(s.y-i.y)*(h.x-i.x);return(h.reflex?r||e:r&&e)&&(i.reflex?o||a:o&&a)},fa.prototype.drawMultiPolygon=function(t,i){var s,h,n,e,r=t.getEndss(),a=t.getStride(),o=this.indices.length,u=this.lineStringReplay.getCurrentIndex(),c=t.getFlatCoordinates(),l=0;for(s=0,h=r.length;s<h;++s){var f=r[s];if(f.length>0){var d=Ph(c,l,f[0],a,-this.origin[0],-this.origin[1]);if(d.length){var v,m=[];for(n=1,e=f.length;n<e;++n)f[n]!==f[n-1]&&(v=Ph(c,f[n-1],f[n],a,-this.origin[0],-this.origin[1]),m.push(v));this.lineStringReplay.drawPolygonCoordinates(d,m,a),this.drawCoordinates_(d,m,a)}}l=f[f.length-1]}this.indices.length>o&&(this.startIndices.push(o),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(o),this.state_.changed=!1)),this.lineStringReplay.getCurrentIndex()>u&&this.lineStringReplay.setPolygonStyle(i,u)},fa.prototype.drawPolygon=function(t,i){var s=t.getEnds(),h=t.getStride();if(s.length>0){var n=t.getFlatCoordinates().map(Number),e=Ph(n,0,s[0],h,-this.origin[0],-this.origin[1]);if(e.length){var r,a,o,u=[];for(r=1,a=s.length;r<a;++r)s[r]!==s[r-1]&&(o=Ph(n,s[r-1],s[r],h,-this.origin[0],-this.origin[1]),u.push(o));this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i),this.state_.changed&&(this.styleIndices_.push(this.indices.length),this.state_.changed=!1),this.lineStringReplay.setPolygonStyle(i),this.lineStringReplay.drawPolygonCoordinates(e,u,h),this.drawCoordinates_(e,u,h)}}},fa.prototype.finish=function(t){this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.startIndices.push(this.indices.length),this.lineStringReplay.finish(t),0===this.styleIndices_.length&&this.styles_.length>0&&(this.styles_=[]),this.vertices=null,this.indices=null},fa.prototype.getDeleteResourcesFunction=function(t){var i=this.verticesBuffer,s=this.indicesBuffer,h=this.lineStringReplay.getDeleteResourcesFunction(t);return function(){t.deleteBuffer(i),t.deleteBuffer(s),h()}},fa.prototype.setUpProgram=function(t,i){var s,h=i.getProgram(aa.fragment,aa.vertex);return this.defaultLocations_?s=this.defaultLocations_:(s=new oa(t,h),this.defaultLocations_=s),i.useProgram(h),t.enableVertexAttribArray(s.a_position),t.vertexAttribPointer(s.a_position,2,Qh.FLOAT,!1,8,0),s},fa.prototype.shutDownProgram=function(t,i){t.disableVertexAttribArray(i.a_position)},fa.prototype.drawReplay=function(t,i,s,h){var n,e,r,a=t.getParameter(t.DEPTH_FUNC),o=t.getParameter(t.DEPTH_WRITEMASK);if(h||(t.enable(t.DEPTH_TEST),t.depthMask(!0),t.depthFunc(t.NOTEQUAL)),js.isEmpty(s))for(r=this.startIndices[this.startIndices.length-1],n=this.styleIndices_.length-1;n>=0;--n)e=this.styleIndices_[n],this.setFillStyle_(t,this.styles_[n]),this.drawElements(t,i,e,r),r=e;else this.drawReplaySkipping_(t,i,s);h||(t.disable(t.DEPTH_TEST),t.clear(t.DEPTH_BUFFER_BIT),t.depthMask(o),t.depthFunc(a))},fa.prototype.drawHitDetectionReplayOneByOne=function(t,i,s,h,n){var e,r,a,o,u,c;for(a=this.startIndices[1+(c=this.startIndices.length-2)],e=this.styleIndices_.length-1;e>=0;--e)for(this.setFillStyle_(t,this.styles_[e]),o=this.styleIndices_[e];c>=0&&this.startIndices[c]>=o;){if(r=this.startIndices[c],void 0===s[Gs.getUid(u=this.startIndicesFeature[c]).toString()]&&u.getGeometry()&&(void 0===n||zh.intersects(n,u.getGeometry().getExtent()))){t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),this.drawElements(t,i,r,a);var l=h(u);if(l)return l}c--,a=r}},fa.prototype.drawReplaySkipping_=function(t,i,s){var h,n,e,r,a,o;for(e=n=this.startIndices[1+(a=this.startIndices.length-2)],h=this.styleIndices_.length-1;h>=0;--h){for(this.setFillStyle_(t,this.styles_[h]),r=this.styleIndices_[h];a>=0&&this.startIndices[a]>=r;)o=this.startIndices[a],s[Gs.getUid(this.startIndicesFeature[a]).toString()]&&(n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),e=o),a--,n=o;n!==e&&(this.drawElements(t,i,n,e),t.clear(t.DEPTH_BUFFER_BIT)),n=e=r}},fa.prototype.setFillStyle_=function(t,i){t.uniform4fv(this.defaultLocations_.u_color,i)},fa.prototype.setFillStrokeStyle=function(t,i){var s=t?t.getColor():[0,0,0,0];if(s=s instanceof CanvasGradient||s instanceof CanvasPattern?Hr.defaultFillStyle:Je.asArray(s).map((function(t,i){return 3!=i?t/255:t}))||Hr.defaultFillStyle,this.state_.fillColor&&_h.equals(s,this.state_.fillColor)||(this.state_.fillColor=s,this.state_.changed=!0,this.styles_.push(s)),i)this.lineStringReplay.setFillStrokeStyle(null,i);else{var h=new ua({color:[0,0,0,0]});this.lineStringReplay.setFillStrokeStyle(null,h)}};var da=function(t,i){this.space_=i,this.emptyBlocks_=[{x:0,y:0,width:t,height:t}],this.entries_={},this.context_=Dn(t,t),this.canvas_=this.context_.canvas};da.prototype.get=function(t){return this.entries_[t]||null},da.prototype.add=function(t,i,s,h,n){var e,r,a;for(r=0,a=this.emptyBlocks_.length;r<a;++r)if((e=this.emptyBlocks_[r]).width>=i+this.space_&&e.height>=s+this.space_){var o={offsetX:e.x+this.space_,offsetY:e.y+this.space_,image:this.canvas_};return this.entries_[t]=o,h.call(n,this.context_,e.x+this.space_,e.y+this.space_),this.split_(r,e,i+this.space_,s+this.space_),o}return null},da.prototype.split_=function(t,i,s,h){i.width-s>i.height-h?this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:i.height},{x:i.x,y:i.y+h,width:s,height:i.height-h}):this.updateBlocks_(t,{x:i.x+s,y:i.y,width:i.width-s,height:h},{x:i.x,y:i.y+h,width:i.width,height:i.height-h})},da.prototype.updateBlocks_=function(t,i,s){var h=[t,1];i.width>0&&i.height>0&&h.push(i),s.width>0&&s.height>0&&h.push(s),this.emptyBlocks_.splice.apply(this.emptyBlocks_,h)};var va=function(t){var i=t||{};this.currentSize_=void 0!==i.initialSize?i.initialSize:Gs.INITIAL_ATLAS_SIZE,this.maxSize_=void 0!==i.maxSize?i.maxSize:-1!=Gs.MAX_ATLAS_SIZE?Gs.MAX_ATLAS_SIZE:void 0!==Gs.WEBGL_MAX_TEXTURE_SIZE?Gs.WEBGL_MAX_TEXTURE_SIZE:2048,this.space_=void 0!==i.space?i.space:1,this.atlases_=[new da(this.currentSize_,this.space_)],this.currentHitSize_=this.currentSize_,this.hitAtlases_=[new da(this.currentHitSize_,this.space_)]};va.prototype.getInfo=function(t){var i=this.getInfo_(this.atlases_,t);if(!i)return null;var s=this.getInfo_(this.hitAtlases_,t);return this.mergeInfos_(i,s)},va.prototype.getInfo_=function(t,i){var s,h,n;for(h=0,n=t.length;h<n;++h)if(s=t[h].get(i))return s;return null},va.prototype.mergeInfos_=function(t,i){return{offsetX:t.offsetX,offsetY:t.offsetY,image:t.image,hitImage:i.image}},va.prototype.add=function(t,i,s,h,n,e){if(i+this.space_>this.maxSize_||s+this.space_>this.maxSize_)return null;var r=this.add_(!1,t,i,s,h,e);if(!r)return null;var a=this.add_(!0,t,i,s,void 0!==n?n:Gs.nullFunction,e);return this.mergeInfos_(r,a)},va.prototype.add_=function(t,i,s,h,n,e){var r,a,o,u,c=t?this.hitAtlases_:this.atlases_;for(o=0,u=c.length;o<u;++o){if(a=(r=c[o]).add(i,s,h,n,e))return a;var l;a||o!==u-1||(t?(l=Math.min(2*this.currentHitSize_,this.maxSize_),this.currentHitSize_=l):(l=Math.min(2*this.currentSize_,this.maxSize_),this.currentSize_=l),r=new da(l,this.space_),c.push(r),++u)}return null};var ma=function(t,i){ia.call(this,t,i),this.images_=[],this.textures_=[],this.measureCanvas_=Dn(0,0).canvas,this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.atlases_={},this.currAtlas_=void 0,this.scale=1,this.opacity=1};Gs.inherits(ma,ia),ma.prototype.drawText=function(t,i){if(this.text_){var s=null,h=2,n=2;switch(t.getType()){case ah:case lh:h=(s=t.getFlatCoordinates()).length,n=t.getStride();break;case mh:s=t.getCenter();break;case oh:s=t.getFlatMidpoint();break;case fh:h=(s=t.getFlatMidpoints()).length;break;case ch:s=t.getFlatInteriorPoint();break;case dh:h=(s=t.getFlatInteriorPoints()).length}this.startIndices.push(this.indices.length),this.startIndicesFeature.push(i);var e,r,a,o,u,c,l,f,d=this.currAtlas_,v=this.text_.split("\n"),m=this.getTextSize_(v),p=Math.round(m[0]*this.textAlign_-this.offsetX_),_=Math.round(m[1]*this.textBaseline_-this.offsetY_),g=this.state_.lineWidth/2*this.state_.scale;for(e=0,r=v.length;e<r;++e)for(u=0,c=d.height*e,a=0,o=(l=v[e].split("")).length;a<o;++a){if(f=d.atlas.getInfo(l[a])){var z=f.image;this.anchorX=p-u,this.anchorY=_-c,this.originX=0===a?f.offsetX-g:f.offsetX,this.originY=f.offsetY,this.height=d.height,this.width=0===a||a===l.length-1?d.width[l[a]]+g:d.width[l[a]],this.imageHeight=z.height,this.imageWidth=z.width,0===this.images_.length?this.images_.push(z):Gs.getUid(this.images_[this.images_.length-1])!=Gs.getUid(z)&&(this.groupIndices.push(this.indices.length),this.images_.push(z)),this.drawText_(s,0,h,n)}u+=this.width}}},ma.prototype.getTextSize_=function(t){var i=this,s=this.currAtlas_,h=t.length*s.height;return[t.map((function(t){var h,n,e=0;for(h=0,n=t.length;h<n;++h){var r=t[h];s.width[r]||i.addCharToAtlas_(r),e+=s.width[r]?s.width[r]:0}return e})).reduce((function(t,i){return Math.max(t,i)})),h]},ma.prototype.drawText_=function(t,i,s,h){var n,e;for(n=i,e=s;n<e;n+=h)this.drawCoordinates(t,i,s,h)},ma.prototype.addCharToAtlas_=function(t){if(1===t.length){var i=this.currAtlas_,s=this.state_,h=this.measureCanvas_.getContext("2d");h.font=s.font;var n=Math.ceil(h.measureText(t).width*s.scale);i.atlas.add(t,n,i.height,(function(i,h,n){i.font=s.font,i.fillStyle=s.fillColor,i.strokeStyle=s.strokeColor,i.lineWidth=s.lineWidth,i.lineCap=s.lineCap,i.lineJoin=s.lineJoin,i.miterLimit=s.miterLimit,i.textAlign="left",i.textBaseline="top",tn.CANVAS_LINE_DASH&&s.lineDash&&(i.setLineDash(s.lineDash),i.lineDashOffset=s.lineDashOffset),1!==s.scale&&i.setTransform(s.scale,0,0,s.scale,0,0),s.strokeColor&&i.strokeText(t,h,n),s.fillColor&&i.fillText(t,h,n)}))&&(i.width[t]=n)}},ma.prototype.finish=function(t){var i=t.getGL();this.groupIndices.push(this.indices.length),this.hitDetectionGroupIndices=this.groupIndices,this.verticesBuffer=new Yr(this.vertices),this.indicesBuffer=new Yr(this.indices),this.createTextures(this.textures_,this.images_,{},i),this.state_={strokeColor:null,lineCap:void 0,lineDash:null,lineDashOffset:void 0,lineJoin:void 0,lineWidth:0,miterLimit:void 0,fillColor:null,font:void 0,scale:void 0},this.text_="",this.textAlign_=void 0,this.textBaseline_=void 0,this.offsetX_=void 0,this.offsetY_=void 0,this.images_=null,this.atlases_={},this.currAtlas_=void 0,ia.prototype.finish.call(this,t)},ma.prototype.setTextStyle=function(t){var i=this.state_,s=t.getFill(),h=t.getStroke();if(t&&t.getText()&&(s||h)){if(s){var n=s.getColor();i.fillColor=Ze.asColorLike(n||Hr.defaultFillStyle)}else i.fillColor=null;if(h){var e=h.getColor();i.strokeColor=Ze.asColorLike(e||Hr.defaultStrokeStyle),i.lineWidth=h.getWidth()||Hr.defaultLineWidth,i.lineCap=h.getLineCap()||Hr.defaultLineCap,i.lineDashOffset=h.getLineDashOffset()||Hr.defaultLineDashOffset,i.lineJoin=h.getLineJoin()||Hr.defaultLineJoin,i.miterLimit=h.getMiterLimit()||Hr.defaultMiterLimit;var r=h.getLineDash();i.lineDash=r?r.slice():Hr.defaultLineDash}else i.strokeColor=null,i.lineWidth=0;i.font=t.getFont()||Hr.defaultFont,i.scale=t.getScale()||1,this.text_=t.getText();var a=Pr.TEXT_ALIGN[t.getTextAlign()],o=Pr.TEXT_ALIGN[t.getTextBaseline()];this.textAlign_=void 0===a?Hr.defaultTextAlign:a,this.textBaseline_=void 0===o?Hr.defaultTextBaseline:o,this.offsetX_=t.getOffsetX()||0,this.offsetY_=t.getOffsetY()||0,this.rotateWithView=!!t.getRotateWithView(),this.rotation=t.getRotation()||0,this.currAtlas_=this.getAtlas_(i)}else this.text_=""},ma.prototype.getAtlas_=function(t){var i,s=[];for(i in t)(t[i]||0===t[i])&&(Array.isArray(t[i])?s=s.concat(t[i]):s.push(t[i]));var h=this.calculateHash_(s);if(!this.atlases_[h]){var n=this.measureCanvas_.getContext("2d");n.font=t.font;var e=Math.ceil((1.5*n.measureText("M").width+t.lineWidth/2)*t.scale);this.atlases_[h]={atlas:new va({space:t.lineWidth+1}),width:{},height:e}}return this.atlases_[h]},ma.prototype.calculateHash_=function(t){var i,s,h="";for(i=0,s=t.length;i<s;++i)h+=t[i];return h},ma.prototype.getTextures=function(){return this.textures_},ma.prototype.getHitDetectionTextures=function(){return this.textures_};var pa=function(t,i,s){pr.call(this),this.maxExtent_=i,this.tolerance_=t,this.renderBuffer_=s,this.replaysByZIndex_={}};Gs.inherits(pa,pr),pa.prototype.addDeclutter=function(){},pa.prototype.getDeleteResourcesFunction=function(t){var i,s=[];for(i in this.replaysByZIndex_){var h,n=this.replaysByZIndex_[i];for(h in n)s.push(n[h].getDeleteResourcesFunction(t))}return function(){for(var t,i=s.length,h=0;h<i;h++)t=s[h].apply(this,arguments);return t}},pa.prototype.finish=function(t){var i;for(i in this.replaysByZIndex_){var s,h=this.replaysByZIndex_[i];for(s in h)h[s].finish(t)}},pa.prototype.getReplay=function(t,i){var s=void 0!==t?t.toString():"0",h=this.replaysByZIndex_[s];void 0===h&&(this.replaysByZIndex_[s]=h={});var n=h[i];return void 0===n&&(n=new(0,pa.BATCH_CONSTRUCTORS_[i])(this.tolerance_,this.maxExtent_),h[i]=n),n},pa.prototype.isEmpty=function(){return js.isEmpty(this.replaysByZIndex_)},pa.prototype.replay=function(t,i,s,h,n,e,r,a){var o,u,c,l,f,d,v=Object.keys(this.replaysByZIndex_).map(Number);for(v.sort(_h.numberSafeCompareFunction),o=0,u=v.length;o<u;++o)for(f=this.replaysByZIndex_[v[o].toString()],c=0,l=Pr.ORDER.length;c<l;++c)void 0!==(d=f[Pr.ORDER[c]])&&d.replay(t,i,s,h,n,e,r,a,void 0,!1)},pa.prototype.replayHitDetection_=function(t,i,s,h,n,e,r,a,o,u,c){var l,f,d,v,m,p,_=Object.keys(this.replaysByZIndex_).map(Number);for(_.sort((function(t,i){return i-t})),l=0,f=_.length;l<f;++l)for(v=this.replaysByZIndex_[_[l].toString()],d=Pr.ORDER.length-1;d>=0;--d)if(void 0!==(m=v[Pr.ORDER[d]])&&(p=m.replay(t,i,s,h,n,e,r,a,o,u,c)))return p},pa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r,a,o,u){var c,l=i.getGL();return l.bindFramebuffer(l.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.renderBuffer_&&(c=zh.buffer(zh.createOrUpdateFromCoordinate(t),h*this.renderBuffer_)),this.replayHitDetection_(i,t,h,n,pa.HIT_DETECTION_SIZE_,r,a,o,(function(t){var i=new Uint8Array(4);if(l.readPixels(0,0,1,1,l.RGBA,l.UNSIGNED_BYTE,i),i[3]>0){var s=u(t);if(s)return s}}),!0,c)},pa.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n,e,r,a,o){var u=i.getGL();return u.bindFramebuffer(u.FRAMEBUFFER,i.getHitDetectionFramebuffer()),void 0!==this.replayHitDetection_(i,t,h,n,pa.HIT_DETECTION_SIZE_,r,a,o,(function(){var t=new Uint8Array(4);return u.readPixels(0,0,1,1,u.RGBA,u.UNSIGNED_BYTE,t),t[3]>0}),!1)},pa.HIT_DETECTION_SIZE_=[1,1],pa.BATCH_CONSTRUCTORS_={Circle:Jr,Image:sa,LineString:ra,Polygon:fa,Text:ma};var _a=function(t,i,s,h,n,e,r){Ke.call(this),this.context_=t,this.center_=i,this.extent_=e,this.pixelRatio_=r,this.size_=n,this.rotation_=h,this.resolution_=s,this.imageStyle_=null,this.fillStyle_=null,this.strokeStyle_=null,this.textStyle_=null};Gs.inherits(_a,Ke),_a.prototype.drawText_=function(t,i){var s=this.context_,h=t.getReplay(0,br);h.setTextStyle(this.textStyle_),h.drawText(i,null),h.finish(s),h.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),h.getDeleteResourcesFunction(s)()},_a.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},_a.prototype.drawGeometry=function(t){switch(t.getType()){case ah:this.drawPoint(t,null);break;case oh:this.drawLineString(t,null);break;case ch:this.drawPolygon(t,null);break;case lh:this.drawMultiPoint(t,null);break;case fh:this.drawMultiLineString(t,null);break;case dh:this.drawMultiPolygon(t,null);break;case vh:this.drawGeometryCollection(t,null);break;case mh:this.drawCircle(t,null)}},_a.prototype.drawFeature=function(t,i){var s=i.getGeometryFunction()(t);s&&zh.intersects(this.extent_,s.getExtent())&&(this.setStyle(i),this.drawGeometry(s))},_a.prototype.drawGeometryCollection=function(t){var i,s,h=t.getGeometriesArray();for(i=0,s=h.length;i<s;++i)this.drawGeometry(h[i])},_a.prototype.drawPoint=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,zr);n.setImageStyle(this.imageStyle_),n.drawPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiPoint=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,zr);n.setImageStyle(this.imageStyle_),n.drawMultiPoint(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawLineString=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,Mr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiLineString=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,Mr);n.setFillStrokeStyle(null,this.strokeStyle_),n.drawMultiLineString(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawPolygon=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,wr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawMultiPolygon=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,wr);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawMultiPolygon(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.drawCircle=function(t,i){var s=this.context_,h=new pa(1,this.extent_),n=h.getReplay(0,_r);n.setFillStrokeStyle(this.fillStyle_,this.strokeStyle_),n.drawCircle(t,i),n.finish(s),n.replay(this.context_,this.center_,this.resolution_,this.rotation_,this.size_,this.pixelRatio_,1,{},void 0,!1),n.getDeleteResourcesFunction(s)(),this.textStyle_&&this.drawText_(h,t)},_a.prototype.setImageStyle=function(t){this.imageStyle_=t},_a.prototype.setFillStrokeStyle=function(t,i){this.fillStyle_=t,this.strokeStyle_=i},_a.prototype.setTextStyle=function(t){this.textStyle_=t};var ga={};ga.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform float u_opacity;\nuniform sampler2D u_texture;\n\nvoid main(void) {\n vec4 texColor = texture2D(u_texture, v_texCoord);\n gl_FragColor.rgb = texColor.rgb;\n gl_FragColor.a = texColor.a * u_opacity;\n}\n":"precision mediump float;varying vec2 a;uniform float f;uniform sampler2D g;void main(void){vec4 texColor=texture2D(g,a);gl_FragColor.rgb=texColor.rgb;gl_FragColor.a=texColor.a*f;}"),ga.vertex=new Wr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\n\nuniform mat4 u_texCoordMatrix;\nuniform mat4 u_projectionMatrix;\n\nvoid main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);\n v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform mat4 d;uniform mat4 e;void main(void){gl_Position=e*vec4(b,0.,1.);a=(d*vec4(c,0.,1.)).st;}");var za=function(t,i){this.u_texCoordMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texCoordMatrix":"d"),this.u_projectionMatrix=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_projectionMatrix":"e"),this.u_opacity=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_opacity":"f"),this.u_texture=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texture":"g"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"c")},Ma=function(t,i){Qe.call(this,i),this.mapRenderer=t,this.arrayBuffer_=new Yr([-1,-1,0,0,1,-1,1,0,-1,1,0,1,1,1,1,1]),this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0,this.texCoordMatrix=Oh.create(),this.projectionMatrix=Oh.create(),this.tmpMat4_=qr(),this.defaultLocations_=null};Gs.inherits(Ma,Qe),Ma.prototype.bindFramebuffer=function(t,i){var s=this.mapRenderer.getGL();if(void 0===this.framebufferDimension||this.framebufferDimension!=i){var h=function(t,i,s){t.isContextLost()||(t.deleteFramebuffer(i),t.deleteTexture(s))}.bind(null,s,this.framebuffer,this.texture);t.postRenderFunctions.push(h);var n=ta.createEmptyTexture(s,i,i),e=s.createFramebuffer();s.bindFramebuffer(Qh.FRAMEBUFFER,e),s.framebufferTexture2D(Qh.FRAMEBUFFER,Qh.COLOR_ATTACHMENT0,Qh.TEXTURE_2D,n,0),this.texture=n,this.framebuffer=e,this.framebufferDimension=i}else s.bindFramebuffer(Qh.FRAMEBUFFER,this.framebuffer)},Ma.prototype.composeFrame=function(t,i,s){this.dispatchComposeEvent_(me,s,t),s.bindBuffer(Qh.ARRAY_BUFFER,this.arrayBuffer_);var h,n=s.getGL(),e=s.getProgram(ga.fragment,ga.vertex);this.defaultLocations_?h=this.defaultLocations_:(h=new za(n,e),this.defaultLocations_=h),s.useProgram(e)&&(n.enableVertexAttribArray(h.a_position),n.vertexAttribPointer(h.a_position,2,Qh.FLOAT,!1,16,0),n.enableVertexAttribArray(h.a_texCoord),n.vertexAttribPointer(h.a_texCoord,2,Qh.FLOAT,!1,16,8),n.uniform1i(h.u_texture,0)),n.uniformMatrix4fv(h.u_texCoordMatrix,!1,Br(this.tmpMat4_,this.getTexCoordMatrix())),n.uniformMatrix4fv(h.u_projectionMatrix,!1,Br(this.tmpMat4_,this.getProjectionMatrix())),n.uniform1f(h.u_opacity,i.opacity),n.bindTexture(Qh.TEXTURE_2D,this.getTexture()),n.drawArrays(Qh.TRIANGLE_STRIP,0,4),this.dispatchComposeEvent_(ve,s,t)},Ma.prototype.dispatchComposeEvent_=function(t,i,s){var h=this.getLayer();if(h.hasListener(t)){var n=s.viewState,e=new _a(i,n.center,n.resolution,n.rotation,s.size,s.extent,s.pixelRatio),r=new qe(t,e,s,null,i);h.dispatchEvent(r)}},Ma.prototype.getTexCoordMatrix=function(){return this.texCoordMatrix},Ma.prototype.getTexture=function(){return this.texture},Ma.prototype.getProjectionMatrix=function(){return this.projectionMatrix},Ma.prototype.handleWebGLContextLost=function(){this.texture=null,this.framebuffer=null,this.framebufferDimension=void 0},Ma.prototype.prepareFrame=function(){},Ma.prototype.forEachLayerAtPixel=function(){};var wa=function(t,i){Ma.call(this,t,i),this.image_=null,this.hitCanvasContext_=null,this.hitTransformationMatrix_=null};Gs.inherits(wa,Ma),wa.handles=function(t,i){return t===ee&&i.getType()===We},wa.create=function(t,i){return new wa(t,i)},wa.prototype.createTexture_=function(t){var i=t.getImage(),s=this.mapRenderer.getGL();return ta.createTexture(s,i,Qh.CLAMP_TO_EDGE,Qh.CLAMP_TO_EDGE)},wa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){var e=this.getLayer();return e.getSource().forEachFeatureAtCoordinate(t,i.viewState.resolution,i.viewState.rotation,s,i.skippedFeatureUids,(function(t){return h.call(n,t,e)}))},wa.prototype.prepareFrame=function(t,i){var s=this.mapRenderer.getGL(),h=t.pixelRatio,n=t.viewState,e=n.center,r=n.resolution,a=n.rotation,o=this.image_,u=this.texture,c=this.getLayer().getSource(),l=t.viewHints,f=t.extent;if(void 0!==i.extent&&(f=zh.getIntersection(f,i.extent)),!l[0]&&!l[1]&&!zh.isEmpty(f)){var d=n.projection;if(!Gs.ENABLE_RASTER_REPROJECTION){var v=c.getProjection();v&&(d=v)}var m=c.getImage(f,r,h,d);if(m&&this.loadImage(m)&&(o=m,u=this.createTexture_(m),this.texture)){var p=function(t,i){t.isContextLost()||t.deleteTexture(i)}.bind(null,s,this.texture);t.postRenderFunctions.push(p)}}if(o){var _=this.mapRenderer.getContext().getCanvas();this.updateProjectionMatrix_(_.width,_.height,h,e,r,a,o.getExtent()),this.hitTransformationMatrix_=null;var g=this.texCoordMatrix;Oh.reset(g),Oh.scale(g,1,-1),Oh.translate(g,0,-1),this.image_=o,this.texture=u,this.updateLogos(t,c)}return!!o},wa.prototype.updateProjectionMatrix_=function(t,i,s,h,n,e,r){var a=t*n,o=i*n,u=this.projectionMatrix;Oh.reset(u),Oh.scale(u,2*s/a,2*s/o),Oh.rotate(u,-e),Oh.translate(u,r[0]-h[0],r[1]-h[1]),Oh.scale(u,(r[2]-r[0])/2,(r[3]-r[1])/2),Oh.translate(u,1,1)},wa.prototype.hasFeatureAtCoordinate=function(t,i){return void 0!==this.forEachFeatureAtCoordinate(t,i,0,xh.TRUE,this)},wa.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.image_&&this.image_.getImage()){if(this.getLayer().getSource().forEachFeatureAtCoordinate!==Gs.nullFunction){var n=Oh.apply(i.pixelToCoordinateTransform,t.slice());return this.forEachFeatureAtCoordinate(n,i,0,xh.TRUE,this)?s.call(h,this.getLayer(),null):void 0}var e=[this.image_.getImage().width,this.image_.getImage().height];this.hitTransformationMatrix_||(this.hitTransformationMatrix_=this.getHitTransformationMatrix_(i.size,e));var r=Oh.apply(this.hitTransformationMatrix_,t.slice());if(!(r[0]<0||r[0]>e[0]||r[1]<0||r[1]>e[1])){this.hitCanvasContext_||(this.hitCanvasContext_=Dn(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.image_.getImage(),r[0],r[1],1,1,0,0,1,1);var a=this.hitCanvasContext_.getImageData(0,0,1,1).data;return a[3]>0?s.call(h,this.getLayer(),a):void 0}}},wa.prototype.getHitTransformationMatrix_=function(t,i){var s=Oh.create();Oh.translate(s,-1,-1),Oh.scale(s,2/t[0],2/t[1]),Oh.translate(s,0,t[1]),Oh.scale(s,1,-1);var h=Oh.invert(this.projectionMatrix.slice()),n=Oh.create();return Oh.translate(n,0,i[1]),Oh.scale(n,1,-1),Oh.scale(n,i[0]/2,i[1]/2),Oh.translate(n,1,1),Oh.multiply(n,h),Oh.multiply(n,s),n};var ba=function(t,i){er.call(this,t,i),this.canvas_=document.createElement("CANVAS"),this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className=de.CLASS_UNSELECTABLE,t.insertBefore(this.canvas_,t.childNodes[0]||null),this.clipTileCanvasWidth_=0,this.clipTileCanvasHeight_=0,this.clipTileContext_=Dn(),this.renderedVisible_=!0,this.gl_=Qh.getContext(this.canvas_,{antialias:!0,depth:!0,failIfMajorPerformanceCaveat:!0,preserveDrawingBuffer:!1,stencil:!0}),this.context_=new ta(this.canvas_,this.gl_),Ws.listen(this.canvas_,$r,this.handleWebGLContextLost,this),Ws.listen(this.canvas_,Qr,this.handleWebGLContextRestored,this),this.textureCache_=new Be,this.focus_=null,this.tileTextureQueue_=new Sn(function(t){var i=t[1],s=t[2],h=i[0]-this.focus_[0],n=i[1]-this.focus_[1];return 65536*Math.log(s)+Math.sqrt(h*h+n*n)/s}.bind(this),(function(t){return t[0].getKey()})),this.loadNextTileTexture_=function(){if(!this.tileTextureQueue_.isEmpty()){this.tileTextureQueue_.reprioritize();var t=this.tileTextureQueue_.dequeue();this.bindTileTexture(t[0],t[3],t[4],Qh.LINEAR,Qh.LINEAR)}return!1}.bind(this),this.textureCacheFrameMarkerCount_=0,this.initializeGL_()};Gs.inherits(ba,er),ba.handles=function(t){return tn.WEBGL&&t===ee},ba.create=function(t,i){return new ba(t,i)},ba.prototype.bindTileTexture=function(t,i,s,h,n){var e=this.getGL(),r=t.getKey();if(this.textureCache_.containsKey(r)){var a=this.textureCache_.get(r);e.bindTexture(Qh.TEXTURE_2D,a.texture),a.magFilter!=h&&(e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MAG_FILTER,h),a.magFilter=h),a.minFilter!=n&&(e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MIN_FILTER,n),a.minFilter=n)}else{var o=e.createTexture();if(e.bindTexture(Qh.TEXTURE_2D,o),s>0){var u=this.clipTileContext_.canvas,c=this.clipTileContext_;this.clipTileCanvasWidth_!==i[0]||this.clipTileCanvasHeight_!==i[1]?(u.width=i[0],u.height=i[1],this.clipTileCanvasWidth_=i[0],this.clipTileCanvasHeight_=i[1]):c.clearRect(0,0,i[0],i[1]),c.drawImage(t.getImage(),s,s,i[0],i[1],0,0,i[0],i[1]),e.texImage2D(Qh.TEXTURE_2D,0,Qh.RGBA,Qh.RGBA,Qh.UNSIGNED_BYTE,u)}else e.texImage2D(Qh.TEXTURE_2D,0,Qh.RGBA,Qh.RGBA,Qh.UNSIGNED_BYTE,t.getImage());e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MAG_FILTER,h),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_MIN_FILTER,n),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_S,Qh.CLAMP_TO_EDGE),e.texParameteri(Qh.TEXTURE_2D,Qh.TEXTURE_WRAP_T,Qh.CLAMP_TO_EDGE),this.textureCache_.set(r,{texture:o,magFilter:h,minFilter:n})}},ba.prototype.dispatchComposeEvent_=function(t,i){var s=this.getMap();if(s.hasListener(t)){var h=this.context_,n=i.viewState,e=new _a(h,n.center,n.resolution,n.rotation,i.size,i.extent,i.pixelRatio),r=new qe(t,e,i,null,h);s.dispatchEvent(r)}},ba.prototype.disposeInternal=function(){var t=this.getGL();t.isContextLost()||this.textureCache_.forEach((function(i){i&&t.deleteTexture(i.texture)})),this.context_.dispose(),er.prototype.disposeInternal.call(this)},ba.prototype.expireCache_=function(t,i){for(var s,h=this.getGL();this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Gs.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK;){if(s=this.textureCache_.peekLast())h.deleteTexture(s.texture);else{if(+this.textureCache_.peekLastKey()==i.index)break;--this.textureCacheFrameMarkerCount_}this.textureCache_.pop()}},ba.prototype.getContext=function(){return this.context_},ba.prototype.getGL=function(){return this.gl_},ba.prototype.getTileTextureQueue=function(){return this.tileTextureQueue_},ba.prototype.getType=function(){return ee},ba.prototype.handleWebGLContextLost=function(t){t.preventDefault(),this.textureCache_.clear(),this.textureCacheFrameMarkerCount_=0;var i=this.getLayerRenderers();for(var s in i)i[s].handleWebGLContextLost()},ba.prototype.handleWebGLContextRestored=function(){this.initializeGL_(),this.getMap().render()},ba.prototype.initializeGL_=function(){var t=this.gl_;t.activeTexture(Qh.TEXTURE0),t.blendFuncSeparate(Qh.SRC_ALPHA,Qh.ONE_MINUS_SRC_ALPHA,Qh.ONE,Qh.ONE_MINUS_SRC_ALPHA),t.disable(Qh.CULL_FACE),t.disable(Qh.DEPTH_TEST),t.disable(Qh.SCISSOR_TEST),t.disable(Qh.STENCIL_TEST)},ba.prototype.isTileTextureLoaded=function(t){return this.textureCache_.containsKey(t.getKey())},ba.prototype.renderFrame=function(t){var i=this.getContext(),s=this.getGL();if(s.isContextLost())return!1;if(!t)return this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1),!1;this.focus_=t.focus,this.textureCache_.set((-t.index).toString(),null),++this.textureCacheFrameMarkerCount_,this.dispatchComposeEvent_(me,t);var h=[],n=t.layerStatesArray;_h.stableSort(n,er.sortByZIndex);var e,r,a,o=t.viewState.resolution;for(e=0,r=n.length;e<r;++e)_e.visibleAtResolution(a=n[e],o)&&a.sourceState==Qn&&this.getLayerRenderer(a.layer).prepareFrame(t,a,i)&&h.push(a);var u=t.size[0]*t.pixelRatio,c=t.size[1]*t.pixelRatio;for(this.canvas_.width==u&&this.canvas_.height==c||(this.canvas_.width=u,this.canvas_.height=c),s.bindFramebuffer(Qh.FRAMEBUFFER,null),s.clearColor(0,0,0,0),s.clear(Qh.COLOR_BUFFER_BIT),s.enable(Qh.BLEND),s.viewport(0,0,this.canvas_.width,this.canvas_.height),e=0,r=h.length;e<r;++e)this.getLayerRenderer((a=h[e]).layer).composeFrame(t,a,i);this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.calculateMatrices2D(t),this.textureCache_.getCount()-this.textureCacheFrameMarkerCount_>Gs.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK&&t.postRenderFunctions.push(this.expireCache_.bind(this)),this.tileTextureQueue_.isEmpty()||(t.postRenderFunctions.push(this.loadNextTileTexture_),t.animate=!0),this.dispatchComposeEvent_(ve,t),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)},ba.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n,e,r){var a;if(this.getGL().isContextLost())return!1;var o,u=i.viewState,c=i.layerStatesArray;for(o=c.length-1;o>=0;--o){var l=c[o],f=l.layer;if(_e.visibleAtResolution(l,u.resolution)&&e.call(r,f)&&(a=this.getLayerRenderer(f).forEachFeatureAtCoordinate(t,i,s,h,n)))return a}},ba.prototype.hasFeatureAtCoordinate=function(t,i,s,h,n){var e=!1;if(this.getGL().isContextLost())return!1;var r,a=i.viewState,o=i.layerStatesArray;for(r=o.length-1;r>=0;--r){var u=o[r],c=u.layer;if(_e.visibleAtResolution(u,a.resolution)&&h.call(n,c)&&(e=this.getLayerRenderer(c).hasFeatureAtCoordinate(t,i)))return!0}return e},ba.prototype.forEachLayerAtPixel=function(t,i,s,h,n){if(this.getGL().isContextLost())return!1;var e,r,a=i.viewState,o=i.layerStatesArray;for(r=o.length-1;r>=0;--r){var u=o[r],c=u.layer;if(_e.visibleAtResolution(u,a.resolution)&&n.call(h,c)&&(e=this.getLayerRenderer(c).forEachLayerAtPixel(t,i,s,h)))return e}};var xa={};xa.fragment=new jr(Gs.DEBUG_WEBGL?"precision mediump float;\nvarying vec2 v_texCoord;\n\n\nuniform sampler2D u_texture;\n\nvoid main(void) {\n gl_FragColor = texture2D(u_texture, v_texCoord);\n}\n":"precision mediump float;varying vec2 a;uniform sampler2D e;void main(void){gl_FragColor=texture2D(e,a);}"),xa.vertex=new Wr(Gs.DEBUG_WEBGL?"varying vec2 v_texCoord;\n\n\nattribute vec2 a_position;\nattribute vec2 a_texCoord;\nuniform vec4 u_tileOffset;\n\nvoid main(void) {\n gl_Position = vec4(a_position * u_tileOffset.xy + u_tileOffset.zw, 0., 1.);\n v_texCoord = a_texCoord;\n}\n\n\n":"varying vec2 a;attribute vec2 b;attribute vec2 c;uniform vec4 d;void main(void){gl_Position=vec4(b*d.xy+d.zw,0.,1.);a=c;}");var ya=function(t,i){this.u_tileOffset=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_tileOffset":"d"),this.u_texture=t.getUniformLocation(i,Gs.DEBUG_WEBGL?"u_texture":"e"),this.a_position=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_position":"b"),this.a_texCoord=t.getAttribLocation(i,Gs.DEBUG_WEBGL?"a_texCoord":"c")},Ea=function(t,i){Ma.call(this,t,i),this.fragmentShader_=xa.fragment,this.vertexShader_=xa.vertex,this.locations_=null,this.renderArrayBuffer_=new Yr([0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0]),this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,this.tmpSize_=[0,0]};Gs.inherits(Ea,Ma),Ea.handles=function(t,i){return t===ee&&i.getType()===Ue},Ea.create=function(t,i){return new Ea(t,i)},Ea.prototype.disposeInternal=function(){this.mapRenderer.getContext().deleteBuffer(this.renderArrayBuffer_),Ma.prototype.disposeInternal.call(this)},Ea.prototype.createLoadedTileFinder=function(t,i,s){var h=this.mapRenderer;return function(n,e){return t.forEachLoadedTile(i,n,e,(function(t){var i=h.isTileTextureLoaded(t);return i&&(s[n]||(s[n]={}),s[n][t.tileCoord.toString()]=t),i}))}},Ea.prototype.handleWebGLContextLost=function(){Ma.prototype.handleWebGLContextLost.call(this),this.locations_=null},Ea.prototype.prepareFrame=function(t,i,s){var h,n=this.mapRenderer,e=s.getGL(),r=t.viewState,a=r.projection,o=this.getLayer(),u=o.getSource(),c=u.getTileGridForProjection(a),l=c.getZForResolution(r.resolution),f=c.getResolution(l),d=u.getTilePixelSize(l,t.pixelRatio,a),v=d[0]/oe(c.getTileSize(l),this.tmpSize_)[0],m=f/v,p=u.getTilePixelRatio(v)*u.getGutter(a),_=r.center,g=t.extent,z=c.getTileRangeForExtentAndZ(g,l);if(this.renderedTileRange_&&this.renderedTileRange_.equals(z)&&this.renderedRevision_==u.getRevision())h=this.renderedFramebufferExtent_;else{var M=z.getSize(),w=Math.max(M[0]*d[0],M[1]*d[1]),b=rh.roundUpToPowerOfTwo(w),x=m*b,y=c.getOrigin(l),E=y[0]+z.minX*d[0]*m,S=y[1]+z.minY*d[1]*m;h=[E,S,E+x,S+x],this.bindFramebuffer(t,b),e.viewport(0,0,b,b),e.clearColor(0,0,0,0),e.clear(Qh.COLOR_BUFFER_BIT),e.disable(Qh.BLEND);var P=s.getProgram(this.fragmentShader_,this.vertexShader_);s.useProgram(P),this.locations_||(this.locations_=new ya(e,P)),s.bindBuffer(Qh.ARRAY_BUFFER,this.renderArrayBuffer_),e.enableVertexAttribArray(this.locations_.a_position),e.vertexAttribPointer(this.locations_.a_position,2,Qh.FLOAT,!1,16,0),e.enableVertexAttribArray(this.locations_.a_texCoord),e.vertexAttribPointer(this.locations_.a_texCoord,2,Qh.FLOAT,!1,16,8),e.uniform1i(this.locations_.u_texture,0);var G={};G[l]={};var k,N,C,A,R,I,T=this.createLoadedTileFinder(u,a,G),O=o.getUseInterimTilesOnError(),F=!0,L=zh.createEmpty(),D=new ar(0,0,0,0);for(A=z.minX;A<=z.maxX;++A)for(R=z.minY;R<=z.maxY;++R)if(N=u.getTile(l,A,R,v,a),void 0===i.extent||(I=c.getTileCoordExtent(N.tileCoord,L),zh.intersects(I,i.extent))){if(2==(C=N.getState())||4==C||3==C&&!O||(N=N.getInterimTile()),2==(C=N.getState())){if(n.isTileTextureLoaded(N)){G[l][N.tileCoord.toString()]=N;continue}}else if(4==C||3==C&&!O)continue;F=!1,c.forEachTileCoordParentTileRange(N.tileCoord,T,null,D,L)||(k=c.getTileCoordChildTileRange(N.tileCoord,D,L))&&T(l+1,k)}var j=Object.keys(G).map(Number);j.sort(_h.numberSafeCompareFunction);var W,U,V,q,B=new Float32Array(4);for(W=0,U=j.length;W<U;++W)for(V in q=G[j[W]])I=c.getTileCoordExtent((N=q[V]).tileCoord,L),B[0]=2*(I[2]-I[0])/x,B[1]=2*(I[3]-I[1])/x,B[2]=2*(I[0]-h[0])/x-1,B[3]=2*(I[1]-h[1])/x-1,e.uniform4fv(this.locations_.u_tileOffset,B),n.bindTileTexture(N,d,p*v,Qh.LINEAR,Qh.LINEAR),e.drawArrays(Qh.TRIANGLE_STRIP,0,4);F?(this.renderedTileRange_=z,this.renderedFramebufferExtent_=h,this.renderedRevision_=u.getRevision()):(this.renderedTileRange_=null,this.renderedFramebufferExtent_=null,this.renderedRevision_=-1,t.animate=!0)}this.updateUsedTiles(t.usedTiles,u,l,z);var X=n.getTileTextureQueue();this.manageTilePyramid(t,u,c,v,a,g,l,o.getPreload(),(function(t){2!=t.getState()||n.isTileTextureLoaded(t)||X.isKeyQueued(t.getKey())||X.enqueue([t,c.getTileCoordCenter(t.tileCoord),c.getResolution(t.tileCoord[0]),d,p*v])}),this),this.scheduleExpireCache(t,u),this.updateLogos(t,u);var H=this.texCoordMatrix;return Oh.reset(H),Oh.translate(H,(Math.round(_[0]/f)*f-h[0])/(h[2]-h[0]),(Math.round(_[1]/f)*f-h[1])/(h[3]-h[1])),0!==r.rotation&&Oh.rotate(H,r.rotation),Oh.scale(H,t.size[0]*r.resolution/(h[2]-h[0]),t.size[1]*r.resolution/(h[3]-h[1])),Oh.translate(H,-.5,-.5),!0},Ea.prototype.forEachLayerAtPixel=function(t,i,s,h){if(this.framebuffer){var n=Oh.apply(this.texCoordMatrix,[t[0]/i.size[0],(i.size[1]-t[1])/i.size[1]].slice()),e=[n[0]*this.framebufferDimension,n[1]*this.framebufferDimension],r=this.mapRenderer.getContext().getGL();r.bindFramebuffer(r.FRAMEBUFFER,this.framebuffer);var a=new Uint8Array(4);return r.readPixels(e[0],e[1],1,1,r.RGBA,r.UNSIGNED_BYTE,a),a[3]>0?s.call(h,this.getLayer(),a):void 0}};var Sa=function(t,i){Ma.call(this,t,i),this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=zh.createEmpty(),this.renderedRenderOrder_=null,this.replayGroup_=null,this.layerState_=null};Gs.inherits(Sa,Ma),Sa.handles=function(t,i){return t===ee&&i.getType()===Ve},Sa.create=function(t,i){return new Sa(t,i)},Sa.prototype.composeFrame=function(t,i,s){this.layerState_=i;var h=t.viewState,n=this.replayGroup_,e=t.size,r=t.pixelRatio,a=this.mapRenderer.getGL();n&&!n.isEmpty()&&(a.enable(a.SCISSOR_TEST),a.scissor(0,0,e[0]*r,e[1]*r),n.replay(s,h.center,h.resolution,h.rotation,e,r,i.opacity,i.managed?t.skippedFeatureUids:{}),a.disable(a.SCISSOR_TEST))},Sa.prototype.disposeInternal=function(){var t=this.replayGroup_;if(t){var i=this.mapRenderer.getContext();t.getDeleteResourcesFunction(i)(),this.replayGroup_=null}Ma.prototype.disposeInternal.call(this)},Sa.prototype.forEachFeatureAtCoordinate=function(t,i,s,h,n){if(this.replayGroup_&&this.layerState_){var e=this.mapRenderer.getContext(),r=i.viewState,a=this.getLayer(),o={};return this.replayGroup_.forEachFeatureAtCoordinate(t,e,r.center,r.resolution,r.rotation,i.size,i.pixelRatio,this.layerState_.opacity,{},(function(t){var i=Gs.getUid(t).toString();if(!(i in o))return o[i]=!0,h.call(n,t,a)}))}},Sa.prototype.hasFeatureAtCoordinate=function(t,i){if(this.replayGroup_&&this.layerState_){var s=this.mapRenderer.getContext(),h=i.viewState;return this.replayGroup_.hasFeatureAtCoordinate(t,s,h.center,h.resolution,h.rotation,i.size,i.pixelRatio,this.layerState_.opacity,i.skippedFeatureUids)}return!1},Sa.prototype.forEachLayerAtPixel=function(t,i,s,h){var n=Oh.apply(i.pixelToCoordinateTransform,t.slice());return this.hasFeatureAtCoordinate(n,i)?s.call(h,this.getLayer(),null):void 0},Sa.prototype.handleStyleImageChange_=function(){this.renderIfReadyAndVisible()},Sa.prototype.prepareFrame=function(t,i,s){var h=this.getLayer(),n=h.getSource();this.updateLogos(t,n);var e=t.viewHints[0],r=t.viewHints[1],a=h.getUpdateWhileAnimating(),o=h.getUpdateWhileInteracting();if(!this.dirty_&&!a&&e||!o&&r)return!0;var u=t.extent,c=t.viewState,l=c.projection,f=c.resolution,d=t.pixelRatio,v=h.getRevision(),m=h.getRenderBuffer(),p=h.getRenderOrder();void 0===p&&(p=Tr.defaultOrder);var _=zh.buffer(u,m*f);if(!this.dirty_&&this.renderedResolution_==f&&this.renderedRevision_==v&&this.renderedRenderOrder_==p&&zh.containsExtent(this.renderedExtent_,_))return!0;this.replayGroup_&&t.postRenderFunctions.push(this.replayGroup_.getDeleteResourcesFunction(s)),this.dirty_=!1;var g=new pa(Tr.getTolerance(f,d),_,h.getRenderBuffer());n.loadFeatures(_,f,l);var z=function(t){var i,s=t.getStyleFunction();if(s?i=s.call(t,f):(s=h.getStyleFunction())&&(i=s(t,f)),i){var n=this.renderFeature(t,f,d,i,g);this.dirty_=this.dirty_||n}};if(p){var M=[];n.forEachFeatureInExtent(_,(function(t){M.push(t)}),this),M.sort(p),M.forEach(z,this)}else n.forEachFeatureInExtent(_,z,this);return g.finish(s),this.renderedResolution_=f,this.renderedRevision_=v,this.renderedRenderOrder_=p,this.renderedExtent_=_,this.replayGroup_=g,!0},Sa.prototype.renderFeature=function(t,i,s,h,n){if(!h)return!1;var e=!1;if(Array.isArray(h))for(var r=h.length-1;r>=0;--r)e=Tr.renderFeature(n,t,h[r],Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;else e=Tr.renderFeature(n,t,h,Tr.getSquaredTolerance(i,s),this.handleStyleImageChange_,this)||e;return e},Gs.ENABLE_CANVAS&&(he.register(ie,rr),he.registerMultiple(se,[sr,or,Or,Lr])),Gs.ENABLE_WEBGL&&(he.register(ie,ba),he.registerMultiple(se,[wa,Ea,Sa]));var Pa=function(t){(t=js.assign({},t)).controls||(t.controls=we()),t.interactions||(t.interactions=Le()),ue.call(this,t)};Gs.inherits(Pa,ue);var Ga="bottom-center",ka="bottom-right",Na="center-center",Ca="center-right",Aa=function(t){hh.call(this),this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("DIV"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container "+de.CLASS_SELECTABLE,this.element.style.position="absolute",this.autoPan=void 0!==t.autoPan&&t.autoPan,this.autoPanAnimation=t.autoPanAnimation||{},this.autoPanMargin=void 0!==t.autoPanMargin?t.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,Ws.listen(this,hh.getChangeEventType(Aa.Property.ELEMENT),this.handleElementChanged,this),Ws.listen(this,hh.getChangeEventType(Aa.Property.MAP),this.handleMapChanged,this),Ws.listen(this,hh.getChangeEventType(Aa.Property.OFFSET),this.handleOffsetChanged,this),Ws.listen(this,hh.getChangeEventType(Aa.Property.POSITION),this.handlePositionChanged,this),Ws.listen(this,hh.getChangeEventType(Aa.Property.POSITIONING),this.handlePositioningChanged,this),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(void 0!==t.positioning?t.positioning:"top-left"),void 0!==t.position&&this.setPosition(t.position)};Gs.inherits(Aa,hh),Aa.prototype.getElement=function(){return this.get(Aa.Property.ELEMENT)},Aa.prototype.getId=function(){return this.id},Aa.prototype.getMap=function(){return this.get(Aa.Property.MAP)},Aa.prototype.getOffset=function(){return this.get(Aa.Property.OFFSET)},Aa.prototype.getPosition=function(){return this.get(Aa.Property.POSITION)},Aa.prototype.getPositioning=function(){return this.get(Aa.Property.POSITIONING)},Aa.prototype.handleElementChanged=function(){qn(this.element);var t=this.getElement();t&&this.element.appendChild(t)},Aa.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Vn(this.element),Ws.unlistenByKey(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=Ws.listen(t,wn,this.render,this),this.updatePixelPosition();var i=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?i.insertBefore(this.element,i.childNodes[0]||null):i.appendChild(this.element)}},Aa.prototype.render=function(){this.updatePixelPosition()},Aa.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},Aa.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(Aa.Property.POSITION)&&this.autoPan&&this.panIntoView()},Aa.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},Aa.prototype.setElement=function(t){this.set(Aa.Property.ELEMENT,t)},Aa.prototype.setMap=function(t){this.set(Aa.Property.MAP,t)},Aa.prototype.setOffset=function(t){this.set(Aa.Property.OFFSET,t)},Aa.prototype.setPosition=function(t){this.set(Aa.Property.POSITION,t)},Aa.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var i=this.getRect(t.getTargetElement(),t.getSize()),s=this.getElement(),h=this.getRect(s,[jn(s),Wn(s)]),n=this.autoPanMargin;if(!zh.containsExtent(i,h)){var e=h[0]-i[0],r=i[2]-h[2],a=h[1]-i[1],o=i[3]-h[3],u=[0,0];if(e<0?u[0]=e-n:r<0&&(u[0]=Math.abs(r)+n),a<0?u[1]=a-n:o<0&&(u[1]=Math.abs(o)+n),0!==u[0]||0!==u[1]){var c=t.getView().getCenter(),l=t.getPixelFromCoordinate(c),f=[l[0]+u[0],l[1]+u[1]];t.getView().animate({center:t.getCoordinateFromPixel(f),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},Aa.prototype.getRect=function(t,i){var s=t.getBoundingClientRect(),h=s.left+window.pageXOffset,n=s.top+window.pageYOffset;return[h,n,h+i[0],n+i[1]]},Aa.prototype.setPositioning=function(t){this.set(Aa.Property.POSITIONING,t)},Aa.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},Aa.prototype.updatePixelPosition=function(){var t=this.getMap(),i=this.getPosition();if(t&&t.isRendered()&&i){var s=t.getPixelFromCoordinate(i),h=t.getSize();this.updateRenderedPosition(s,h)}else this.setVisible(!1)},Aa.prototype.updateRenderedPosition=function(t,i){var s=this.element.style,h=this.getOffset(),n=this.getPositioning();this.setVisible(!0);var e=h[0],r=h[1];if(n==ka||n==Ca||"top-right"==n){""!==this.rendered.left_&&(this.rendered.left_=s.left="");var a=Math.round(i[0]-t[0]-e)+"px";this.rendered.right_!=a&&(this.rendered.right_=s.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=s.right=""),n!=Ga&&n!=Na&&"top-center"!=n||(e-=this.element.offsetWidth/2);var o=Math.round(t[0]+e)+"px";this.rendered.left_!=o&&(this.rendered.left_=s.left=o)}if("bottom-left"==n||n==Ga||n==ka){""!==this.rendered.top_&&(this.rendered.top_=s.top="");var u=Math.round(i[1]-t[1]-r)+"px";this.rendered.bottom_!=u&&(this.rendered.bottom_=s.bottom=u)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=s.bottom=""),"center-left"!=n&&n!=Na&&n!=Ca||(r-=this.element.offsetHeight/2);var c=Math.round(t[1]+r)+"px";this.rendered.top_!=c&&(this.rendered.top_=s.top=c)}},Aa.prototype.getOptions=function(){return this.options},Aa.Property={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"};var Ra=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel};Ra.prototype.getOpacity=function(){return this.opacity_},Ra.prototype.getRotateWithView=function(){return this.rotateWithView_},Ra.prototype.getRotation=function(){return this.rotation_},Ra.prototype.getScale=function(){return this.scale_},Ra.prototype.getSnapToPixel=function(){return this.snapToPixel_},Ra.prototype.getAnchor=function(){},Ra.prototype.getImage=function(){},Ra.prototype.getHitDetectionImage=function(){},Ra.prototype.getImageState=function(){},Ra.prototype.getImageSize=function(){},Ra.prototype.getHitDetectionImageSize=function(){},Ra.prototype.getOrigin=function(){},Ra.prototype.getSize=function(){},Ra.prototype.setOpacity=function(t){this.opacity_=t},Ra.prototype.setRotateWithView=function(t){this.rotateWithView_=t},Ra.prototype.setRotation=function(t){this.rotation_=t},Ra.prototype.setScale=function(t){this.scale_=t},Ra.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},Ra.prototype.listenImageChange=function(){},Ra.prototype.load=function(){},Ra.prototype.unlistenImageChange=function(){};var Ia=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_),Ra.call(this,{opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:void 0===t.snapToPixel||t.snapToPixel})};Gs.inherits(Ia,Ra),Ia.prototype.clone=function(){var t=new Ia({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},Ia.prototype.getAnchor=function(){return this.anchor_},Ia.prototype.getAngle=function(){return this.angle_},Ia.prototype.getFill=function(){return this.fill_},Ia.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_},Ia.prototype.getImage=function(){return this.canvas_},Ia.prototype.getImageSize=function(){return this.imageSize_},Ia.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},Ia.prototype.getImageState=function(){return 2},Ia.prototype.getOrigin=function(){return this.origin_},Ia.prototype.getPoints=function(){return this.points_},Ia.prototype.getRadius=function(){return this.radius_},Ia.prototype.getRadius2=function(){return this.radius2_},Ia.prototype.getSize=function(){return this.size_},Ia.prototype.getStroke=function(){return this.stroke_},Ia.prototype.listenImageChange=function(){},Ia.prototype.load=function(){},Ia.prototype.unlistenImageChange=function(){},Ia.prototype.render_=function(t){var i,s,h="",n="",e=0,r=null,a=0,o=0;this.stroke_&&(null===(s=this.stroke_.getColor())&&(s=Ye.defaultStrokeStyle),s=Ze.asColorLike(s),void 0===(o=this.stroke_.getWidth())&&(o=Ye.defaultLineWidth),r=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),tn.CANVAS_LINE_DASH||(r=null,a=0),void 0===(n=this.stroke_.getLineJoin())&&(n=Ye.defaultLineJoin),void 0===(h=this.stroke_.getLineCap())&&(h=Ye.defaultLineCap),void 0===(e=this.stroke_.getMiterLimit())&&(e=Ye.defaultMiterLimit));var u=2*(this.radius_+o)+1,c={strokeStyle:s,strokeWidth:o,size:u,lineCap:h,lineDash:r,lineDashOffset:a,lineJoin:n,miterLimit:e};if(void 0===t){var l=Dn(u,u);this.canvas_=l.canvas,i=u=this.canvas_.width,this.draw_(c,l,0,0),this.createHitDetectionCanvas_(c)}else{u=Math.round(u);var f,d=!this.fill_;d&&(f=this.drawHitDetectionCanvas_.bind(this,c));var v=this.getChecksum(),m=t.add(v,u,u,this.draw_.bind(this,c),f);this.canvas_=m.image,this.origin_=[m.offsetX,m.offsetY],i=m.image.width,d?(this.hitDetectionCanvas_=m.hitImage,this.hitDetectionImageSize_=[m.hitImage.width,m.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[i,i])}this.anchor_=[u/2,u/2],this.size_=[u,u],this.imageSize_=[i,i]},Ia.prototype.draw_=function(t,i,s,h){var n,e,r;i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var a=this.points_;if(a===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o=void 0!==this.radius2_?this.radius2_:this.radius_;for(o!==this.radius_&&(a*=2),n=0;n<=a;n++)e=2*n*Math.PI/a-Math.PI/2+this.angle_,i.lineTo(t.size/2+(r=n%2==0?this.radius_:o)*Math.cos(e),t.size/2+r*Math.sin(e))}if(this.fill_){var u=this.fill_.getColor();null===u&&(u=Ye.defaultFillStyle),i.fillStyle=Ze.asColorLike(u),i.fill()}this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.lineCap=t.lineCap,i.lineJoin=t.lineJoin,i.miterLimit=t.miterLimit,i.stroke()),i.closePath()},Ia.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var i=Dn(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i,0,0)}},Ia.prototype.drawHitDetectionCanvas_=function(t,i,s,h){i.setTransform(1,0,0,1,0,0),i.translate(s,h),i.beginPath();var n=this.points_;if(n===1/0)i.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var e,r,a,o=void 0!==this.radius2_?this.radius2_:this.radius_;for(o!==this.radius_&&(n*=2),e=0;e<=n;e++)a=2*e*Math.PI/n-Math.PI/2+this.angle_,i.lineTo(t.size/2+(r=e%2==0?this.radius_:o)*Math.cos(a),t.size/2+r*Math.sin(a))}i.fillStyle=Ye.defaultFillStyle,i.fill(),this.stroke_&&(i.strokeStyle=t.strokeStyle,i.lineWidth=t.strokeWidth,t.lineDash&&(i.setLineDash(t.lineDash),i.lineDashOffset=t.lineDashOffset),i.stroke()),i.closePath()},Ia.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",i=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||i!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var s="r"+t+i+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[s,t,i,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]};var Ta=function(t){var i=t||{};Ia.call(this,{points:1/0,fill:i.fill,radius:i.radius,snapToPixel:i.snapToPixel,stroke:i.stroke,atlasManager:i.atlasManager})};Gs.inherits(Ta,Ia),Ta.prototype.clone=function(){var t=new Ta({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},Ta.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)};var Oa=function(t){var i=t||{};this.color_=void 0!==i.color?i.color:null,this.checksum_=void 0};Oa.prototype.clone=function(){var t=this.getColor();return new Oa({color:t&&t.slice?t.slice():t||void 0})},Oa.prototype.getColor=function(){return this.color_},Oa.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},Oa.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_=this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?Gs.getUid(this.color_).toString():"f"+(this.color_?Je.asString(this.color_):"-")),this.checksum_};var Fa=function(t){var i=t||{};this.geometry_=null,this.geometryFunction_=Fa.defaultGeometryFunction,void 0!==i.geometry&&this.setGeometry(i.geometry),this.fill_=void 0!==i.fill?i.fill:null,this.image_=void 0!==i.image?i.image:null,this.renderer_=void 0!==i.renderer?i.renderer:null,this.stroke_=void 0!==i.stroke?i.stroke:null,this.text_=void 0!==i.text?i.text:null,this.zIndex_=i.zIndex};Fa.prototype.clone=function(){var t=this.getGeometry();return t&&t.clone&&(t=t.clone()),new Fa({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Fa.prototype.getRenderer=function(){return this.renderer_},Fa.prototype.setRenderer=function(t){this.renderer_=t},Fa.prototype.getGeometry=function(){return this.geometry_},Fa.prototype.getGeometryFunction=function(){return this.geometryFunction_},Fa.prototype.getFill=function(){return this.fill_},Fa.prototype.setFill=function(t){this.fill_=t},Fa.prototype.getImage=function(){return this.image_},Fa.prototype.setImage=function(t){this.image_=t},Fa.prototype.getStroke=function(){return this.stroke_},Fa.prototype.setStroke=function(t){this.stroke_=t},Fa.prototype.getText=function(){return this.text_},Fa.prototype.setText=function(t){this.text_=t},Fa.prototype.getZIndex=function(){return this.zIndex_},Fa.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(i){return i.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Fa.defaultGeometryFunction,this.geometry_=t},Fa.prototype.setZIndex=function(t){this.zIndex_=t},Fa.createFunction=function(t){var i,s;return"function"==typeof t?i=t:(Array.isArray(t)?s=t:(eh(t instanceof Fa,41),s=[t]),i=function(){return s}),i},Fa.default_=null,Fa.defaultFunction=function(){if(!Fa.default_){var t=new Oa({color:"rgba(255,255,255,0.4)"}),i=new ua({color:"#3399CC",width:1.25});Fa.default_=[new Fa({image:new Ta({fill:t,stroke:i,radius:5}),fill:t,stroke:i})]}return Fa.default_},Fa.createDefaultEditing=function(){var t={},i=[255,255,255,1],s=[0,153,255,1];return t[ch]=[new Fa({fill:new Oa({color:[255,255,255,.5]})})],t[dh]=t[ch],t[oh]=[new Fa({stroke:new ua({color:i,width:5})}),new Fa({stroke:new ua({color:s,width:3})})],t[fh]=t[oh],t[mh]=t[ch].concat(t[oh]),t[ah]=[new Fa({image:new Ta({radius:6,fill:new Oa({color:s}),stroke:new ua({color:i,width:1.5})}),zIndex:1/0})],t[lh]=t[ah],t[vh]=t[ch].concat(t[oh],t[ah]),t},Fa.defaultGeometryFunction=function(t){return t.getGeometry()};var La=function(t){hh.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,Ws.listen(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),void 0!==t&&(t instanceof Fh||!t?this.setGeometry(t):this.setProperties(t))};Gs.inherits(La,hh),La.prototype.clone=function(){var t=new La(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var s=this.getStyle();return s&&t.setStyle(s),t},La.prototype.getGeometry=function(){return this.get(this.geometryName_)},La.prototype.getId=function(){return this.id_},La.prototype.getGeometryName=function(){return this.geometryName_},La.prototype.getStyle=function(){return this.style_},La.prototype.getStyleFunction=function(){return this.styleFunction_},La.prototype.handleGeometryChange_=function(){this.changed()},La.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(Ws.unlistenByKey(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=Ws.listen(t,Bs,this.handleGeometryChange_,this)),this.changed()},La.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},La.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?La.createStyleFunction(t):void 0,this.changed()},La.prototype.setId=function(t){this.id_=t,this.changed()},La.prototype.setGeometryName=function(t){Ws.unlisten(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,Ws.listen(this,hh.getChangeEventType(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},La.createStyleFunction=function(t){var i,s;return"function"==typeof t?i=2==t.length?function(i){return t(this,i)}:t:(Array.isArray(t)?s=t:(eh(t instanceof Fa,41),s=[t]),i=function(){return s}),i};var Da={createOrUpdate:function(t,i,s,h){return void 0!==h?(h[0]=t,h[1]=i,h[2]=s,h):[t,i,s]},getKeyZXY:function(t,i,s){return t+"/"+i+"/"+s},getKey:function(t){return Da.getKeyZXY(t[0],t[1],t[2])},fromKey:function(t){return t.split("/").map(Number)},hash:function(t){return(t[1]<<t[0])+t[2]},quadKey:function(t){var i,s,h=t[0],n=new Array(h),e=1<<h-1;for(i=0;i<h;++i)s=48,t[1]&e&&(s+=1),t[2]&e&&(s+=2),n[i]=String.fromCharCode(s),e>>=1;return n.join("")},withinExtentAndZ:function(t,i){var s=t[0],h=t[1],n=t[2];if(i.getMinZoom()>s||s>i.getMaxZoom())return!1;var e,r=i.getExtent();return!(e=r?i.getTileRangeForExtentAndZ(r,s):i.getFullTileRange(s))||e.containsXY(h,n)}},ja={createFromTemplate:function(t,i){var s=/\{z\}/g,h=/\{x\}/g,n=/\{y\}/g,e=/\{-y\}/g;return function(r){return r?t.replace(s,r[0].toString()).replace(h,r[1].toString()).replace(n,(function(){return(-r[2]-1).toString()})).replace(e,(function(){var t=i.getFullTileRange(r[0]);return eh(t,55),(t.getHeight()+r[2]).toString()})):void 0}},createFromTemplates:function(t,i){for(var s=t.length,h=new Array(s),n=0;n<s;++n)h[n]=ja.createFromTemplate(t[n],i);return ja.createFromTileUrlFunctions(h)},createFromTileUrlFunctions:function(t){return 1===t.length?t[0]:function(i,s,h){if(i){var n=Da.hash(i),e=rh.modulo(n,t.length);return t[e](i,s,h)}}},nullTileUrlFunction:function(){},expandUrl:function(t){var i=[],s=/\{([a-z])-([a-z])\}/.exec(t);if(s){var h,n=s[1].charCodeAt(0),e=s[2].charCodeAt(0);for(h=n;h<=e;++h)i.push(t.replace(s[0],String.fromCharCode(h)));return i}if(s=s=/\{(\d+)-(\d+)\}/.exec(t)){for(var r=parseInt(s[2],10),a=parseInt(s[1],10);a<=r;a++)i.push(t.replace(s[0],a.toString()));return i}return i.push(t),i}},Wa=function(t,i,s){qs.call(this);var h=s||{};this.tileCoord=t,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===h.transition?250:h.transition,this.transitionStarts_={}};Gs.inherits(Wa,qs),Wa.prototype.changed=function(){this.dispatchEvent(Bs)},Wa.prototype.getKey=function(){return this.key+"/"+this.tileCoord},Wa.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(2==t.getState())return t;t=t.interimTile}while(t);return this},Wa.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,i=this;do{if(2==t.getState()){t.interimTile=null;break}1==t.getState()?i=t:0==t.getState()?i.interimTile=t.interimTile:i=t,t=i.interimTile}while(t)}},Wa.prototype.getTileCoord=function(){return this.tileCoord},Wa.prototype.getState=function(){return this.state},Wa.prototype.setState=function(t){this.state=t,this.changed()},Wa.prototype.load=function(){},Wa.prototype.getAlpha=function(t,i){if(!this.transition_)return 1;var s=this.transitionStarts_[t];if(s){if(-1===s)return 1}else this.transitionStarts_[t]=s=i;var h=i-s+1e3/60;return h>=this.transition_?1:Fn.easeIn(h/this.transition_)},Wa.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},Wa.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)};var Ua=function(t,i,s,h,n,e){Wa.call(this,t,i,e),this.crossOrigin_=h,this.src_=s,this.image_=new Image,null!==h&&(this.image_.crossOrigin=h),this.imageListenerKeys_=null,this.tileLoadFunction_=n};Gs.inherits(Ua,Wa),Ua.prototype.disposeInternal=function(){1==this.state&&(this.unlistenImage_(),this.image_=Ua.getBlankImage()),this.interimTile&&this.interimTile.dispose(),this.state=5,this.changed(),Wa.prototype.disposeInternal.call(this)},Ua.prototype.getImage=function(){return this.image_},Ua.prototype.getKey=function(){return this.src_},Ua.prototype.handleImageError_=function(){this.state=3,this.unlistenImage_(),this.image_=Ua.getBlankImage(),this.changed()},Ua.prototype.handleImageLoad_=function(){this.state=this.image_.naturalWidth&&this.image_.naturalHeight?2:4,this.unlistenImage_(),this.changed()},Ua.prototype.load=function(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.imageListenerKeys_=[Ws.listenOnce(this.image_,Js,this.handleImageError_,this),Ws.listenOnce(this.image_,$s,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},Ua.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ws.unlistenByKey),this.imageListenerKeys_=null},Ua.getBlankImage=function(){var t=Dn(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas};var Va=function(t){Be.call(this,t)};Gs.inherits(Va,Be),Va.prototype.expireCache=function(t){for(var i,s;this.canExpireCache()&&(!((s=(i=this.peekLast()).tileCoord[0].toString())in t)||!t[s].contains(i.tileCoord));)this.pop().dispose()},Va.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=this.peekFirstKey(),i=Da.fromKey(t)[0];this.forEach((function(t){t.tileCoord[0]!==i&&(this.remove(Da.getKey(t.tileCoord)),t.dispose())}),this)}};var qa={calculateSourceResolution:function(t,i,s,h){var n=Th.transform(s,i,t),e=Th.getPointResolution(i,h,s),r=i.getMetersPerUnit();void 0!==r&&(e*=r);var a=t.getMetersPerUnit();void 0!==a&&(e/=a);var o=t.getExtent();if(!o||zh.containsCoordinate(o,n)){var u=Th.getPointResolution(t,e,n)/e;isFinite(u)&&u>0&&(e/=u)}return e},enlargeClipPoint_:function(t,i,s,h){var n=s-t,e=h-i,r=Math.sqrt(n*n+e*e);return[Math.round(s+n/r),Math.round(h+e/r)]},render:function(t,i,s,h,n,e,r,a,o,u,c){var l=Dn(Math.round(s*t),Math.round(s*i));if(0===o.length)return l.canvas;l.scale(s,s);var f=zh.createEmpty();o.forEach((function(t){zh.extend(f,t.extent)}));var d=zh.getWidth(f),v=zh.getHeight(f),m=Dn(Math.round(s*d/h),Math.round(s*v/h)),p=s/h;o.forEach((function(t){var i=t.extent[0]-f[0],s=-(t.extent[3]-f[3]),h=zh.getWidth(t.extent),n=zh.getHeight(t.extent);m.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,i*p,s*p,h*p,n*p)}));var _=zh.getTopLeft(r);return a.getTriangles().forEach((function(t){var i=t.source,n=t.target,r=i[0][0],a=i[0][1],o=i[1][0],u=i[1][1],c=i[2][0],d=i[2][1],v=(n[0][0]-_[0])/e,p=-(n[0][1]-_[1])/e,g=(n[1][0]-_[0])/e,z=-(n[1][1]-_[1])/e,M=(n[2][0]-_[0])/e,w=-(n[2][1]-_[1])/e,b=r,x=a;r=0,a=0;var y=rh.solveLinearSystem([[o-=b,u-=x,0,0,g-v],[c-=b,d-=x,0,0,M-v],[0,0,o,u,z-p],[0,0,c,d,w-p]]);if(y){l.save(),l.beginPath();var E=(v+g+M)/3,S=(p+z+w)/3,P=qa.enlargeClipPoint_(E,S,v,p),G=qa.enlargeClipPoint_(E,S,g,z),k=qa.enlargeClipPoint_(E,S,M,w);l.moveTo(G[0],G[1]),l.lineTo(P[0],P[1]),l.lineTo(k[0],k[1]),l.clip(),l.transform(y[0],y[2],y[1],y[3],v,p),l.translate(f[0]-b,f[3]-x),l.scale(h/s,-h/s),l.drawImage(m.canvas,0,0),l.restore()}})),c&&(l.save(),l.strokeStyle="black",l.lineWidth=1,a.getTriangles().forEach((function(t){var i=t.target,s=(i[0][0]-_[0])/e,h=-(i[0][1]-_[1])/e,n=(i[1][0]-_[0])/e,r=-(i[1][1]-_[1])/e,a=(i[2][0]-_[0])/e,o=-(i[2][1]-_[1])/e;l.beginPath(),l.moveTo(n,r),l.lineTo(s,h),l.lineTo(a,o),l.closePath(),l.stroke()})),l.restore()),l.canvas}},Ba=function(t,i,s,h,n){this.sourceProj_=t,this.targetProj_=i;var e={},r=Th.getTransform(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var i=t[0]+"/"+t[1];return e[i]||(e[i]=r(t)),e[i]},this.maxSourceExtent_=h,this.errorThresholdSquared_=n*n,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!h&&!!this.sourceProj_.getExtent()&&zh.getWidth(h)==zh.getWidth(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?zh.getWidth(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?zh.getWidth(this.targetProj_.getExtent()):null;var a=zh.getTopLeft(s),o=zh.getTopRight(s),u=zh.getBottomRight(s),c=zh.getBottomLeft(s),l=this.transformInv_(a),f=this.transformInv_(o),d=this.transformInv_(u),v=this.transformInv_(c);if(this.addQuad_(a,o,u,c,l,f,d,v,Gs.RASTER_REPROJECTION_MAX_SUBDIVISION),this.wrapsXInSource_){var m=1/0;this.triangles_.forEach((function(t){m=Math.min(m,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach((function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-m>this.sourceWorldWidth_/2){var i=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];i[0][0]-m>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-m>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-m>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);var s=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-s<this.sourceWorldWidth_/2&&(t.source=i)}}),this)}e={}};Ba.prototype.addTriangle_=function(t,i,s,h,n,e){this.triangles_.push({source:[h,n,e],target:[t,i,s]})},Ba.prototype.addQuad_=function(t,i,s,h,n,e,r,a,o){var u=zh.boundingExtent([n,e,r,a]),c=this.sourceWorldWidth_?zh.getWidth(u)/this.sourceWorldWidth_:null,l=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&c>.5&&c<1,d=!1;if(o>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=zh.boundingExtent([t,i,s,h]);d|=zh.getWidth(v)/this.targetWorldWidth_>Gs.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH}!f&&this.sourceProj_.isGlobal()&&c&&(d|=c>Gs.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH)}if(d||!this.maxSourceExtent_||zh.intersects(u,this.maxSourceExtent_)){if(!(d||isFinite(n[0])&&isFinite(n[1])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(a[0])&&isFinite(a[1]))){if(!(o>0))return;d=!0}if(o>0){if(!d){var m,p=this.transformInv_([(t[0]+s[0])/2,(t[1]+s[1])/2]);m=f?(rh.modulo(n[0],l)+rh.modulo(r[0],l))/2-rh.modulo(p[0],l):(n[0]+r[0])/2-p[0];var _=(n[1]+r[1])/2-p[1];d=m*m+_*_>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-s[0])<=Math.abs(t[1]-s[1])){var g=[(i[0]+s[0])/2,(i[1]+s[1])/2],z=this.transformInv_(g),M=[(h[0]+t[0])/2,(h[1]+t[1])/2],w=this.transformInv_(M);this.addQuad_(t,i,g,M,n,e,z,w,o-1),this.addQuad_(M,g,s,h,w,z,r,a,o-1)}else{var b=[(t[0]+i[0])/2,(t[1]+i[1])/2],x=this.transformInv_(b),y=[(s[0]+h[0])/2,(s[1]+h[1])/2],E=this.transformInv_(y);this.addQuad_(t,b,y,h,n,x,E,a,o-1),this.addQuad_(b,i,s,y,x,e,r,E,o-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,s,h,n,r,a),this.addTriangle_(t,i,s,n,e,r)}},Ba.prototype.calculateSourceExtent=function(){var t=zh.createEmpty();return this.triangles_.forEach((function(i){var s=i.source;zh.extendCoordinate(t,s[0]),zh.extendCoordinate(t,s[1]),zh.extendCoordinate(t,s[2])})),t},Ba.prototype.getTriangles=function(){return this.triangles_};var Xa=function(t,i,s,h,n,e,r,a,o,u,c){Wa.call(this,n,0),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=r,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=h,this.wrappedTileCoord_=e||n,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var l=h.getTileCoordExtent(this.wrappedTileCoord_),f=this.targetTileGrid_.getExtent(),d=this.sourceTileGrid_.getExtent(),v=f?zh.getIntersection(l,f):l;if(0!==zh.getArea(v)){var m=t.getExtent();m&&(d=d?zh.getIntersection(d,m):m);var p=h.getResolution(this.wrappedTileCoord_[0]),_=zh.getCenter(v),g=qa.calculateSourceResolution(t,s,_,p);if(!isFinite(g)||g<=0)this.state=4;else if(this.triangulation_=new Ba(t,s,v,d,g*(void 0!==u?u:Gs.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD)),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(g);var z=this.triangulation_.calculateSourceExtent();if(d&&(t.canWrapX()?(z[1]=rh.clamp(z[1],d[1],d[3]),z[3]=rh.clamp(z[3],d[1],d[3])):z=zh.getIntersection(z,d)),zh.getArea(z)){for(var M=i.getTileRangeForExtentAndZ(z,this.sourceZ_),w=M.minX;w<=M.maxX;w++)for(var b=M.minY;b<=M.maxY;b++){var x=o(this.sourceZ_,w,b,r);x&&this.sourceTiles_.push(x)}0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}else this.state=4}else this.state=4};Gs.inherits(Xa,Wa),Xa.prototype.disposeInternal=function(){1==this.state&&this.unlistenSources_(),Wa.prototype.disposeInternal.call(this)},Xa.prototype.getImage=function(){return this.canvas_},Xa.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach((function(i){i&&2==i.getState()&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(i.tileCoord),image:i.getImage()})}),this),this.sourceTiles_.length=0,0===t.length)this.state=3;else{var i=this.wrappedTileCoord_[0],s=this.targetTileGrid_.getTileSize(i),h="number"==typeof s?s:s[0],n="number"==typeof s?s:s[1],e=this.targetTileGrid_.getResolution(i),r=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=qa.render(h,n,this.pixelRatio_,r,this.sourceTileGrid_.getExtent(),e,a,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=2}this.changed()},Xa.prototype.load=function(){if(0==this.state){this.state=1,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((function(i){var s,h=i.getState();0!=h&&1!=h||(t++,s=Ws.listen(i,Bs,(function(){var h=i.getState();2!=h&&3!=h&&4!=h||(Ws.unlistenByKey(s),0==--t&&(this.unlistenSources_(),this.reproject_()))}),this),this.sourcesListenerKeys_.push(s))}),this),this.sourceTiles_.forEach((function(t){0==t.getState()&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},Xa.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(Ws.unlistenByKey),this.sourcesListenerKeys_=null};var Ha=function(t){var i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,eh(_h.isSorted(this.resolutions_,(function(t,i){return i-t}),!0),17),!t.origins)for(var s=0,h=this.resolutions_.length-1;s<h;++s)if(i){if(this.resolutions_[s]/this.resolutions_[s+1]!==i){i=void 0;break}}else i=this.resolutions_[s]/this.resolutions_[s+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,eh(this.origins_.length==this.resolutions_.length,20));var n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=zh.getTopLeft(n)),eh(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,eh(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Gs.DEFAULT_TILE_SIZE,eh(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t){return new ar(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):n&&this.calculateTileRanges_(n)};Ha.tmpTileCoord_=[0,0,0],Ha.prototype.forEachTileCoord=function(t,i,s){for(var h=this.getTileRangeForExtentAndZ(t,i),n=h.minX,e=h.maxX;n<=e;++n)for(var r=h.minY,a=h.maxY;r<=a;++r)s([i,n,r])},Ha.prototype.forEachTileCoordParentTileRange=function(t,i,s,h,n){var e,r,a,o=null,u=t[0]-1;for(2===this.zoomFactor_?(r=t[1],a=t[2]):o=this.getTileCoordExtent(t,n);u>=this.minZoom;){if(2===this.zoomFactor_?(r=Math.floor(r/2),a=Math.floor(a/2),e=ar.createOrUpdate(r,r,a,a,h)):e=this.getTileRangeForExtentAndZ(o,u,h),i.call(s,u,e))return!0;--u}return!1},Ha.prototype.getExtent=function(){return this.extent_},Ha.prototype.getMaxZoom=function(){return this.maxZoom},Ha.prototype.getMinZoom=function(){return this.minZoom},Ha.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},Ha.prototype.getResolution=function(t){return this.resolutions_[t]},Ha.prototype.getResolutions=function(){return this.resolutions_},Ha.prototype.getTileCoordChildTileRange=function(t,i,s){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var h=2*t[1],n=2*t[2];return ar.createOrUpdate(h,h+1,n,n+1,i)}var e=this.getTileCoordExtent(t,s);return this.getTileRangeForExtentAndZ(e,t[0]+1,i)}return null},Ha.prototype.getTileRangeExtent=function(t,i,s){var h=this.getOrigin(t),n=this.getResolution(t),e=oe(this.getTileSize(t),this.tmpSize_);return zh.createOrUpdate(h[0]+i.minX*e[0]*n,h[1]+i.minY*e[1]*n,h[0]+(i.maxX+1)*e[0]*n,h[1]+(i.maxY+1)*e[1]*n,s)},Ha.prototype.getTileRangeForExtentAndZ=function(t,i,s){var h=Ha.tmpTileCoord_;this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,h);var n=h[1],e=h[2];return this.getTileCoordForXYAndZ_(t[2],t[3],i,!0,h),ar.createOrUpdate(n,h[1],e,h[2],s)},Ha.prototype.getTileCoordCenter=function(t){var i=this.getOrigin(t[0]),s=this.getResolution(t[0]),h=oe(this.getTileSize(t[0]),this.tmpSize_);return[i[0]+(t[1]+.5)*h[0]*s,i[1]+(t[2]+.5)*h[1]*s]},Ha.prototype.getTileCoordExtent=function(t,i){var s=this.getOrigin(t[0]),h=this.getResolution(t[0]),n=oe(this.getTileSize(t[0]),this.tmpSize_),e=s[0]+t[1]*n[0]*h,r=s[1]+t[2]*n[1]*h;return zh.createOrUpdate(e,r,e+n[0]*h,r+n[1]*h,i)},Ha.prototype.getTileCoordForCoordAndResolution=function(t,i,s){return this.getTileCoordForXYAndResolution_(t[0],t[1],i,!1,s)},Ha.prototype.getTileCoordForXYAndResolution_=function(t,i,s,h,n){var e=this.getZForResolution(s),r=s/this.getResolution(e),a=this.getOrigin(e),o=oe(this.getTileSize(e),this.tmpSize_),u=h?0:.5,c=Math.floor((t-a[0])/s+(h?.5:0)),l=Math.floor((i-a[1])/s+u),f=r*c/o[0],d=r*l/o[1];return h?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),Da.createOrUpdate(e,f,d,n)},Ha.prototype.getTileCoordForXYAndZ_=function(t,i,s,h,n){var e=this.getOrigin(s),r=this.getResolution(s),a=oe(this.getTileSize(s),this.tmpSize_),o=h?0:.5,u=Math.floor((t-e[0])/r+(h?.5:0)),c=Math.floor((i-e[1])/r+o),l=u/a[0],f=c/a[1];return h?(l=Math.ceil(l)-1,f=Math.ceil(f)-1):(l=Math.floor(l),f=Math.floor(f)),Da.createOrUpdate(s,l,f,n)},Ha.prototype.getTileCoordForCoordAndZ=function(t,i,s){return this.getTileCoordForXYAndZ_(t[0],t[1],i,!1,s)},Ha.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},Ha.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},Ha.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},Ha.prototype.getZForResolution=function(t,i){var s=_h.linearFindNearest(this.resolutions_,t,i||0);return rh.clamp(s,this.minZoom,this.maxZoom)},Ha.prototype.calculateTileRanges_=function(t){for(var i=this.resolutions_.length,s=new Array(i),h=this.minZoom;h<i;++h)s[h]=this.getTileRangeForExtentAndZ(t,h);this.fullTileRanges_=s};var Ya={getForProjection:function(t){var i=t.getDefaultTileGrid();return i||(i=Ya.createForProjection(t),t.setDefaultTileGrid(i)),i},wrapX:function(t,i,s){var h=i[0],n=t.getTileCoordCenter(i),e=Ya.extentFromProjection(s);if(zh.containsCoordinate(e,n))return i;var r=zh.getWidth(e),a=Math.ceil((e[0]-n[0])/r);return n[0]+=r*a,t.getTileCoordForCoordAndZ(n,h)},createForExtent:function(t,i,s,h){var n=void 0!==h?h:gh,e=Ya.resolutionsFromExtent(t,i,s);return new Ha({extent:t,origin:zh.getCorner(t,n),resolutions:e,tileSize:s})},createXYZ:function(t){var i={};return js.assign(i,void 0!==t?t:{}),void 0===i.extent&&(i.extent=Th.get("EPSG:3857").getExtent()),i.resolutions=Ya.resolutionsFromExtent(i.extent,i.maxZoom,i.tileSize),delete i.maxZoom,new Ha(i)},resolutionsFromExtent:function(t,i,s){for(var h=void 0!==i?i:Gs.DEFAULT_MAX_ZOOM,n=zh.getHeight(t),e=zh.getWidth(t),r=oe(void 0!==s?s:Gs.DEFAULT_TILE_SIZE),a=Math.max(e/r[0],n/r[1]),o=h+1,u=new Array(o),c=0;c<o;++c)u[c]=a/Math.pow(2,c);return u},createForProjection:function(t,i,s,h){var n=Ya.extentFromProjection(t);return Ya.createForExtent(n,i,s,h)},extentFromProjection:function(t){var i=(t=Th.get(t)).getExtent();if(!i){var s=180*Th.METERS_PER_UNIT[Gh.DEGREES]/t.getMetersPerUnit();i=zh.createOrUpdate(-s,-s,s,s)}return i}},Ja=function(t){this.html_=t.html,this.tileRanges_=t.tileRanges?t.tileRanges:null};Ja.prototype.getHTML=function(){return this.html_},Ja.prototype.intersectsAnyTileRange=function(t,i,s){if(!this.tileRanges_)return!0;var h,n,e,r;for(r in t){var a;if(r in this.tileRanges_)for(e=t[r],h=0,n=this.tileRanges_[r].length;h<n;++h){if((a=this.tileRanges_[r][h]).intersects(e))return!0;var o=i.getTileRangeForExtentAndZ(Ya.extentFromProjection(s),parseInt(r,10)),u=o.getWidth();if(e.minX<o.minX||e.maxX>o.maxX){if(a.intersects(new ar(rh.modulo(e.minX,u),rh.modulo(e.maxX,u),e.minY,e.maxY)))return!0;if(e.getWidth()>u&&a.intersects(o))return!0}}}return!1};var Za=function(t){hh.call(this),this.projection_=Th.get(t.projection),this.attributions_=null,this.attributions2_=this.adaptAttributions_(t.attributions),this.logo_=t.logo,this.state_=void 0!==t.state?t.state:Qn,this.wrapX_=void 0!==t.wrapX&&t.wrapX};Gs.inherits(Za,hh),Za.prototype.adaptAttributions_=function(t){if(!t)return null;if(t instanceof Ja)return this.attributions_=[t],function(){return[t.getHTML()]};if(Array.isArray(t)){if(t[0]instanceof Ja){this.attributions_=t;var i=t.map((function(t){return t.getHTML()}));return function(){return i}}return this.attributions_=t.map((function(t){return new Ja({html:t})})),function(){return t}}return"function"==typeof t?t:(this.attributions_=[new Ja({html:t})],function(){return[t]})},Za.prototype.forEachFeatureAtCoordinate=Gs.nullFunction,Za.prototype.getAttributions=function(){return this.attributions_},Za.prototype.getAttributions2=function(){return this.attributions2_},Za.prototype.getLogo=function(){return this.logo_},Za.prototype.getProjection=function(){return this.projection_},Za.prototype.getResolutions=function(){},Za.prototype.getState=function(){return this.state_},Za.prototype.getWrapX=function(){return this.wrapX_},Za.prototype.refresh=function(){this.changed()},Za.prototype.setAttributions=function(t){this.attributions2_=this.adaptAttributions_(t),this.changed()},Za.prototype.setLogo=function(t){this.logo_=t},Za.prototype.setState=function(t){this.state_=t,this.changed()};var Ka=function(t){Za.call(this,{attributions:t.attributions,extent:t.extent,logo:t.logo,projection:t.projection,state:t.state,wrapX:t.wrapX}),this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileCache=new Va(t.cacheSize),this.tmpSize=[0,0],this.key_="",this.tileOptions={transition:t.transition}};Gs.inherits(Ka,Za),Ka.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},Ka.prototype.expireCache=function(t,i){var s=this.getTileCacheForProjection(t);s&&s.expireCache(i)},Ka.prototype.forEachLoadedTile=function(t,i,s,h){var n=this.getTileCacheForProjection(t);if(!n)return!1;for(var e,r,a,o=!0,u=s.minX;u<=s.maxX;++u)for(var c=s.minY;c<=s.maxY;++c)r=Da.getKeyZXY(i,u,c),a=!1,n.containsKey(r)&&(a=2===(e=n.get(r)).getState())&&(a=!1!==h(e)),a||(o=!1);return o},Ka.prototype.getGutter=function(){return 0},Ka.prototype.getKey=function(){return this.key_},Ka.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},Ka.prototype.getOpaque=function(){return this.opaque_},Ka.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},Ka.prototype.getTile=function(){},Ka.prototype.getTileGrid=function(){return this.tileGrid},Ka.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Ya.getForProjection(t)},Ka.prototype.getTileCacheForProjection=function(t){var i=this.getProjection();return i&&!Th.equivalent(i,t)?null:this.tileCache},Ka.prototype.getTilePixelRatio=function(){return this.tilePixelRatio_},Ka.prototype.getTilePixelSize=function(t,i,s){var h=this.getTileGridForProjection(s),n=this.getTilePixelRatio(i),e=oe(h.getTileSize(t),this.tmpSize);return 1==n?e:ae(e,n,this.tmpSize)},Ka.prototype.getTileCoordForTileUrlFunction=function(t,i){var s=void 0!==i?i:this.getProjection(),h=this.getTileGridForProjection(s);return this.getWrapX()&&s.isGlobal()&&(t=Ya.wrapX(h,t,s)),Da.withinExtentAndZ(t,h)?t:null},Ka.prototype.refresh=function(){this.tileCache.clear(),this.changed()},Ka.prototype.useTile=Gs.nullFunction,Gs.inherits(Ka.Event=function(t,i){Vs.call(this,t),this.tile=i},Vs);var $a=function(t){Ka.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition}),this.tileLoadFunction=t.tileLoadFunction,this.tileUrlFunction=this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):ja.nullTileUrlFunction,this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),t.tileUrlFunction&&this.setTileUrlFunction(t.tileUrlFunction),this.tileLoadingKeys_={}};Gs.inherits($a,Ka),$a.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},$a.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},$a.prototype.getUrls=function(){return this.urls},$a.prototype.handleTileChange=function(t){var i,s=t.target,h=Gs.getUid(s),n=s.getState();1==n?(this.tileLoadingKeys_[h]=!0,i="tileloadstart"):h in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[h],i=3==n?"tileloaderror":2==n||5==n?"tileloadend":void 0),null!=i&&this.dispatchEvent(new Ka.Event(i,s))},$a.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},$a.prototype.setTileUrlFunction=function(t,i){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==i?this.setKey(i):this.changed()},$a.prototype.setUrl=function(t){var i=this.urls=ja.expandUrl(t);this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):ja.createFromTemplates(i,this.tileGrid),t)},$a.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):ja.createFromTemplates(t,this.tileGrid),i)},$a.prototype.useTile=function(t,i,s){var h=Da.getKeyZXY(t,i,s);this.tileCache.containsKey(h)&&this.tileCache.get(h)};var Qa=function(t){$a.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,extent:t.extent,logo:t.logo,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Qa.defaultTileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Ua,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1};Gs.inherits(Qa,$a),Qa.prototype.canExpireCache=function(){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.canExpireCache.call(this);if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},Qa.prototype.expireCache=function(t,i){if(Gs.ENABLE_RASTER_REPROJECTION){var s=this.getTileCacheForProjection(t);for(var h in this.tileCache.expireCache(this.tileCache==s?i:{}),this.tileCacheForProjection){var n=this.tileCacheForProjection[h];n.expireCache(n==s?i:{})}}else $a.prototype.expireCache.call(this,t,i)},Qa.prototype.getGutter=function(t){return Gs.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Th.equivalent(this.getProjection(),t)?0:this.getGutterInternal()},Qa.prototype.getGutterInternal=function(){return 0},Qa.prototype.getOpaque=function(t){return!(Gs.ENABLE_RASTER_REPROJECTION&&this.getProjection()&&t&&!Th.equivalent(this.getProjection(),t))&&$a.prototype.getOpaque.call(this,t)},Qa.prototype.getTileGridForProjection=function(t){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.getTileGridForProjection.call(this,t);var i=this.getProjection();if(!this.tileGrid||i&&!Th.equivalent(i,t)){var s=Gs.getUid(t).toString();return s in this.tileGridForProjection||(this.tileGridForProjection[s]=Ya.getForProjection(t)),this.tileGridForProjection[s]}return this.tileGrid},Qa.prototype.getTileCacheForProjection=function(t){if(!Gs.ENABLE_RASTER_REPROJECTION)return $a.prototype.getTileCacheForProjection.call(this,t);var i=this.getProjection();if(!i||Th.equivalent(i,t))return this.tileCache;var s=Gs.getUid(t).toString();return s in this.tileCacheForProjection||(this.tileCacheForProjection[s]=new Va(this.tileCache.highWaterMark)),this.tileCacheForProjection[s]},Qa.prototype.createTile_=function(t,i,s,h,n,e){var r=[t,i,s],a=this.getTileCoordForTileUrlFunction(r,n),o=a?this.tileUrlFunction(a,h,n):void 0,u=new this.tileClass(r,void 0!==o?0:4,void 0!==o?o:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=e,Ws.listen(u,Bs,this.handleTileChange,this),u},Qa.prototype.getTile=function(t,i,s,h,n){var e=this.getProjection();if(Gs.ENABLE_RASTER_REPROJECTION&&e&&n&&!Th.equivalent(e,n)){var r,a=this.getTileCacheForProjection(n),o=[t,i,s],u=Da.getKey(o);a.containsKey(u)&&(r=a.get(u));var c=this.getKey();if(r&&r.key==c)return r;var l=this.getTileGridForProjection(e),f=this.getTileGridForProjection(n),d=this.getTileCoordForTileUrlFunction(o,n),v=new Xa(e,l,n,f,o,d,this.getTilePixelRatio(h),this.getGutterInternal(),function(t,i,s,h){return this.getTileInternal(t,i,s,h,e)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return v.key=c,r?(v.interimTile=r,v.refreshInterimChain(),a.replace(u,v)):a.set(u,v),v}return this.getTileInternal(t,i,s,h,e||n)},Qa.prototype.getTileInternal=function(t,i,s,h,n){var e=null,r=Da.getKeyZXY(t,i,s),a=this.getKey();if(this.tileCache.containsKey(r)){if((e=this.tileCache.get(r)).key!=a){var o=e;(e=this.createTile_(t,i,s,h,n,a)).interimTile=0==o.getState()?o.interimTile:o,e.refreshInterimChain(),this.tileCache.replace(r,e)}}else e=this.createTile_(t,i,s,h,n,a),this.tileCache.set(r,e);return e},Qa.prototype.setRenderReprojectionEdges=function(t){if(Gs.ENABLE_RASTER_REPROJECTION&&this.renderReprojectionEdges_!=t){for(var i in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[i].clear();this.changed()}},Qa.prototype.setTileGridForProjection=function(t,i){if(Gs.ENABLE_RASTER_REPROJECTION){var s=Th.get(t);if(s){var h=Gs.getUid(s).toString();h in this.tileGridForProjection||(this.tileGridForProjection[h]=i)}}},Qa.defaultTileLoadFunction=function(t,i){t.getImage().src=i};var to="KVP",io=function(t){this.matrixIds_=t.matrixIds,Ha.call(this,{extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes})};Gs.inherits(io,Ha),io.prototype.getMatrixId=function(t){return this.matrixIds_[t]},io.prototype.getMatrixIds=function(){return this.matrixIds_},io.createFromCapabilitiesMatrixSet=function(t,i,s){var h=[],n=[],e=[],r=[],a=[],o=void 0!==s?s:[],u="TileMatrix",c="Identifier",l="ScaleDenominator",f="TopLeftCorner",d=t.SupportedCRS,v=Th.get(d.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(d),m=v.getMetersPerUnit(),p="ne"==v.getAxisOrientation().substr(0,2);return t[u].sort((function(t,i){return i[l]-t[l]})),t[u].forEach((function(t){if(!(o.length>0)||_h.find(o,(function(i){return t[c]==i[u]}))){n.push(t[c]);var i=28e-5*t[l]/m,s=t.TileWidth,d=t.TileHeight;e.push(p?[t[f][1],t[f][0]]:t[f]),h.push(i),r.push(s==d?s:[s,d]),a.push([t.MatrixWidth,-t.MatrixHeight])}})),new io({extent:i,origins:e,resolutions:h,matrixIds:n,tileSizes:r,sizes:a})};var so=function(t,i){var s=[];Object.keys(i).forEach((function(t){null!=i[t]&&s.push(t+"="+encodeURIComponent(i[t]))}));var h=s.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+h},ho=function(t){this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style;var i=t.urls;void 0===i&&void 0!==t.url&&(i=ja.expandUrl(t.url)),this.requestEncoding_=void 0!==t.requestEncoding?t.requestEncoding:to;var s=this.requestEncoding_,h=t.tileGrid,n={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};s==to&&js.assign(n,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_});var e=this.dimensions_;this.createFromWMTSTemplate_=function(t){return t=s==to?so(t,n):t.replace(/\{(\w+?)\}/g,(function(t,i){return i.toLowerCase()in n?n[i.toLowerCase()]:t})),function(i){if(i){var n={TileMatrix:h.getMatrixId(i[0]),TileCol:i[1],TileRow:-i[2]-1};js.assign(n,e);var r=t;return s==to?so(r,n):r.replace(/\{(\w+?)\}/g,(function(t,i){return n[i]}))}}};var r=i&&i.length>0?ja.createFromTileUrlFunctions(i.map(this.createFromWMTSTemplate_)):ja.nullTileUrlFunction;Qa.call(this,{attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,logo:t.logo,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:h,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:r,urls:i,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition}),this.setKey(this.getKeyForDimensions_())};Gs.inherits(ho,Qa),ho.prototype.setUrls=function(t){this.urls=t;var i=t.join("\n");this.setTileUrlFunction(this.fixedTileUrlFunction?this.fixedTileUrlFunction.bind(this):ja.createFromTileUrlFunctions(t.map(this.createFromWMTSTemplate_.bind(this))),i)},ho.prototype.getDimensions=function(){return this.dimensions_},ho.prototype.getFormat=function(){return this.format_},ho.prototype.getLayer=function(){return this.layer_},ho.prototype.getMatrixSet=function(){return this.matrixSet_},ho.prototype.getRequestEncoding=function(){return this.requestEncoding_},ho.prototype.getStyle=function(){return this.style_},ho.prototype.getVersion=function(){return this.version_},ho.prototype.getKeyForDimensions_=function(){var t=0,i=[];for(var s in this.dimensions_)i[t++]=s+"-"+this.dimensions_[s];return i.join("/")},ho.prototype.updateDimensions=function(t){js.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())},ho.optionsFromCapabilities=function(t,i){var s=_h.find(t.Contents.Layer,(function(t){return t.Identifier==i.layer}));if(null===s)return null;var h,n,e,r=t.Contents.TileMatrixSet;(h=s.TileMatrixSetLink.length>1?_h.findIndex(s.TileMatrixSetLink,"projection"in i?function(t){var s=_h.find(r,(function(i){return i.Identifier==t.TileMatrixSet})).SupportedCRS,h=Th.get(s.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(s),n=Th.get(i.projection);return h&&n?Th.equivalent(h,n):s==i.projection}:function(t){return t.TileMatrixSet==i.matrixSet}):0)<0&&(h=0),n=s.TileMatrixSetLink[h].TileMatrixSet,e=s.TileMatrixSetLink[h].TileMatrixSetLimits;var a=s.Format[0];"format"in i&&(a=i.format),(h=_h.findIndex(s.Style,(function(t){return"style"in i?t.Title==i.style:t.isDefault})))<0&&(h=0);var o=s.Style[h].Identifier,u={};"Dimension"in s&&s.Dimension.forEach((function(t){var i=t.Default;void 0===i&&(i=t.Value[0]),u[t.Identifier]=i}));var c,l=_h.find(t.Contents.TileMatrixSet,(function(t){return t.Identifier==n})),f=l.SupportedCRS;if(f&&(c=Th.get(f.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"))||Th.get(f)),"projection"in i){var d=Th.get(i.projection);d&&(c&&!Th.equivalent(d,c)||(c=d))}var v,m,p=s.WGS84BoundingBox;if(void 0!==p){var _=Th.get("EPSG:4326").getExtent();m=p[0]==_[0]&&p[2]==_[2],v=Th.transformExtent(p,"EPSG:4326",c);var g=c.getExtent();g&&(zh.containsExtent(g,v)||(v=void 0))}var z=io.createFromCapabilitiesMatrixSet(l,v,e),M=[],w=i.requestEncoding;if(w=void 0!==w?w:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata)for(var b=t.OperationsMetadata.GetTile.DCP.HTTP.Get,x=0,y=b.length;x<y;++x)if(b[x].Constraint){var E=_h.find(b[x].Constraint,(function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===w&&(w=E[0]),w!==to)break;_h.includes(E,to)&&M.push(b[x].href)}else b[x].href&&(w=to,M.push(b[x].href));return 0===M.length&&(w="REST",s.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(a=t.format,M.push(t.template))}))),{urls:M,layer:i.layer,matrixSet:n,format:a,projection:c,requestEncoding:w,tileGrid:z,style:o,dimensions:u,wrapX:m,crossOrigin:i.crossOrigin}};var no="arraybuffer",eo={};eo.DOCUMENT=document.implementation.createDocument("","",null),eo.createElementNS=function(t,i){return eo.DOCUMENT.createElementNS(t,i)},eo.getAllTextContent=function(t,i){return eo.getAllTextContent_(t,i,[]).join("")},eo.getAllTextContent_=function(t,i,s){var h;if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)s.push(i?String(t.nodeValue).replace(/(\r\n|\r|\n)/g,""):t.nodeValue);else for(h=t.firstChild;h;h=h.nextSibling)eo.getAllTextContent_(h,i,s);return s},eo.isDocument=function(t){return t instanceof Document},eo.isNode=function(t){return t instanceof Node},eo.getAttributeNS=function(t,i,s){return t.getAttributeNS(i,s)||""},eo.setAttributeNS=function(t,i,s,h){t.setAttributeNS(i,s,h)},eo.parse=function(t){return(new DOMParser).parseFromString(t,"application/xml")},eo.makeArrayExtender=function(t,i){return function(s,h){var n=t.call(i,s,h);void 0!==n&&_h.extend(h[h.length-1],n)}},eo.makeArrayPusher=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&h[h.length-1].push(n)}},eo.makeReplacer=function(t,i){return function(s,h){var n=t.call(void 0!==i?i:this,s,h);void 0!==n&&(h[h.length-1]=n)}},eo.makeObjectPropertyPusher=function(t,i,s){return function(h,n){var e=t.call(void 0!==s?s:this,h,n);if(void 0!==e){var r=n[n.length-1],a=void 0!==i?i:h.localName;(a in r?r[a]:r[a]=[]).push(e)}}},eo.makeObjectPropertySetter=function(t,i,s){return function(h,n){var e=t.call(void 0!==s?s:this,h,n);void 0!==e&&(n[n.length-1][void 0!==i?i:h.localName]=e)}},eo.makeChildAppender=function(t,i){return function(s,h,n){t.call(void 0!==i?i:this,s,h,n),n[n.length-1].node.appendChild(s)}},eo.makeArraySerializer=function(t){var i,s;return function(h,n,e){if(void 0===i){i={};var r={};r[h.localName]=t,i[h.namespaceURI]=r,s=eo.makeSimpleNodeFactory(h.localName)}eo.serialize(i,s,n,e)}},eo.makeSimpleNodeFactory=function(t,i){var s=t;return function(t,h,n){var e=s;void 0===e&&(e=n);var r=i;return void 0===i&&(r=h[h.length-1].node.namespaceURI),eo.createElementNS(r,e)}},eo.OBJECT_PROPERTY_NODE_FACTORY=eo.makeSimpleNodeFactory(),eo.makeSequence=function(t,i){for(var s=i.length,h=new Array(s),n=0;n<s;++n)h[n]=t[i[n]];return h},eo.makeStructureNS=function(t,i,s){var h,n,e=void 0!==s?s:{};for(h=0,n=t.length;h<n;++h)e[t[h]]=i;return e},eo.parseNode=function(t,i,s,h){var n;for(n=i.firstElementChild;n;n=n.nextElementSibling){var e=t[n.namespaceURI];if(void 0!==e){var r=e[n.localName];void 0!==r&&r.call(h,n,s)}}},eo.pushParseAndPop=function(t,i,s,h,n){return h.push(t),eo.parseNode(i,s,h,n),h.pop()},eo.serialize=function(t,i,s,h,n,e){for(var r,a,o=(void 0!==n?n:s).length,u=0;u<o;++u)void 0!==(r=s[u])&&void 0!==(a=i.call(e,r,h,void 0!==n?n[u]:void 0))&&t[a.namespaceURI][a.localName].call(e,a,r,h)},eo.pushSerializeAndPop=function(t,i,s,h,n,e,r){return n.push(t),eo.serialize(i,s,h,n,e,r),n.pop()};var ro={loadFeaturesXhr:function(t,i,s,h){return function(n,e,r){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,e,r):t,!0),i.getType()==no&&(a.responseType="arraybuffer"),a.onload=function(){if(!a.status||a.status>=200&&a.status<300){var t,n=i.getType();"json"==n||"text"==n?t=a.responseText:"xml"==n?(t=a.responseXML)||(t=eo.parse(a.responseText)):n==no&&(t=a.response),t?s.call(this,i.readFeatures(t,{featureProjection:r}),i.readProjection(t),i.getLastExtent()):h.call(this)}else h.call(this)}.bind(this),a.onerror=function(){h.call(this)}.bind(this),a.send()}},xhr:function(t,i){return ro.loadFeaturesXhr(t,i,(function(t){this.addFeatures(t)}),Gs.nullFunction)}},ao={all:function(){return[[-1/0,-1/0,1/0,1/0]]},bbox:function(t){return[t]},tile:function(t){return function(i,s){var h=t.getZForResolution(s),n=t.getTileRangeForExtentAndZ(i,h),e=[],r=[h,0,0];for(r[1]=n.minX;r[1]<=n.maxX;++r[1])for(r[2]=n.minY;r[2]<=n.maxY;++r[2])e.push(t.getTileCoordExtent(r));return e}}},oo="addfeature",uo="removefeature",co=function(t){var i=t||{};Za.call(this,{attributions:i.attributions,logo:i.logo,projection:void 0,state:Qn,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=Gs.nullFunction,this.format_=i.format,this.overlaps_=null==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(eh(this.format_,7),this.loader_=ro.xhr(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:ao.all;var s,h,n=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=n?new la:null,this.loadedExtentsRtree_=new la,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,i.features instanceof rn?h=(s=i.features).getArray():Array.isArray(i.features)&&(h=i.features),n||void 0!==s||(s=new rn(h)),void 0!==h&&this.addFeaturesInternal(h),void 0!==s&&this.bindFeaturesCollection_(s)};Gs.inherits(co,Za),co.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},co.prototype.addFeatureInternal=function(t){var i=Gs.getUid(t).toString();if(this.addToIndex_(i,t)){this.setupChangeEvents_(i,t);var s=t.getGeometry();if(s){var h=s.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(h,t)}else this.nullGeometryFeatures_[i]=t;this.dispatchEvent(new co.Event(oo,t))}},co.prototype.setupChangeEvents_=function(t,i){this.featureChangeKeys_[t]=[Ws.listen(i,Bs,this.handleFeatureChange_,this),Ws.listen(i,Ds,this.handleFeatureChange_,this)]},co.prototype.addToIndex_=function(t,i){var s=!0,h=i.getId();return void 0!==h?h.toString()in this.idIndex_?s=!1:this.idIndex_[h.toString()]=i:(eh(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=i),s},co.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},co.prototype.addFeaturesInternal=function(t){var i,s,h,n,e=[],r=[],a=[];for(s=0,h=t.length;s<h;s++)i=Gs.getUid(n=t[s]).toString(),this.addToIndex_(i,n)&&r.push(n);for(s=0,h=r.length;s<h;s++){i=Gs.getUid(n=r[s]).toString(),this.setupChangeEvents_(i,n);var o=n.getGeometry();if(o){var u=o.getExtent();e.push(u),a.push(n)}else this.nullGeometryFeatures_[i]=n}for(this.featuresRtree_&&this.featuresRtree_.load(e,a),s=0,h=r.length;s<h;s++)this.dispatchEvent(new co.Event(oo,r[s]))},co.prototype.bindFeaturesCollection_=function(t){var i=!1;Ws.listen(this,oo,(function(s){i||(i=!0,t.push(s.feature),i=!1)})),Ws.listen(this,uo,(function(s){i||(i=!0,t.remove(s.feature),i=!1)})),Ws.listen(t,nn,(function(t){i||(i=!0,this.addFeature(t.element),i=!1)}),this),Ws.listen(t,en,(function(t){i||(i=!0,this.removeFeature(t.element),i=!1)}),this),this.featuresCollection_=t},co.prototype.clear=function(t){if(t){for(var i in this.featureChangeKeys_)this.featureChangeKeys_[i].forEach(Ws.unlistenByKey);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var s in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[s]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var h=new co.Event("clear");this.dispatchEvent(h),this.changed()},co.prototype.forEachFeature=function(t,i){return this.featuresRtree_?this.featuresRtree_.forEach(t,i):this.featuresCollection_?this.featuresCollection_.forEach(t,i):void 0},co.prototype.forEachFeatureAtCoordinateDirect=function(t,i,s){return this.forEachFeatureInExtent([t[0],t[1],t[0],t[1]],(function(h){return h.getGeometry().intersectsCoordinate(t)?i.call(s,h):void 0}))},co.prototype.forEachFeatureInExtent=function(t,i,s){return this.featuresRtree_?this.featuresRtree_.forEachInExtent(t,i,s):this.featuresCollection_?this.featuresCollection_.forEach(i,s):void 0},co.prototype.forEachFeatureIntersectingExtent=function(t,i,s){return this.forEachFeatureInExtent(t,(function(h){if(h.getGeometry().intersectsExtent(t)){var n=i.call(s,h);if(n)return n}}))},co.prototype.getFeaturesCollection=function(){return this.featuresCollection_},co.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),js.isEmpty(this.nullGeometryFeatures_)||_h.extend(t,js.getValues(this.nullGeometryFeatures_))),t},co.prototype.getFeaturesAtCoordinate=function(t){var i=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){i.push(t)})),i},co.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_.getInExtent(t)},co.prototype.getClosestFeatureToCoordinate=function(t,i){var s=t[0],h=t[1],n=null,e=[NaN,NaN],r=1/0,a=[-1/0,-1/0,1/0,1/0],o=i||xh.TRUE;return this.featuresRtree_.forEachInExtent(a,(function(t){if(o(t)){var i=t.getGeometry(),u=r;if((r=i.closestPointXY(s,h,e,r))<u){n=t;var c=Math.sqrt(r);a[0]=s-c,a[1]=h-c,a[2]=s+c,a[3]=h+c}}})),n},co.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},co.prototype.getFeatureById=function(t){var i=this.idIndex_[t.toString()];return void 0!==i?i:null},co.prototype.getFormat=function(){return this.format_},co.prototype.getOverlaps=function(){return this.overlaps_},co.prototype.getResolutions=function(){},co.prototype.getUrl=function(){return this.url_},co.prototype.handleFeatureChange_=function(t){var i=t.target,s=Gs.getUid(i).toString(),h=i.getGeometry();if(h){var n=h.getExtent();s in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[s],this.featuresRtree_&&this.featuresRtree_.insert(n,i)):this.featuresRtree_&&this.featuresRtree_.update(n,i)}else s in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(i),this.nullGeometryFeatures_[s]=i);var e=i.getId();if(void 0!==e){var r=e.toString();s in this.undefIdIndex_?(delete this.undefIdIndex_[s],this.idIndex_[r]=i):this.idIndex_[r]!==i&&(this.removeFromIdIndex_(i),this.idIndex_[r]=i)}else s in this.undefIdIndex_||(this.removeFromIdIndex_(i),this.undefIdIndex_[s]=i);this.changed(),this.dispatchEvent(new co.Event("changefeature",i))},co.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&js.isEmpty(this.nullGeometryFeatures_)},co.prototype.loadFeatures=function(t,i,s){var h,n,e=this.loadedExtentsRtree_,r=this.strategy_(t,i);for(h=0,n=r.length;h<n;++h){var a=r[h];e.forEachInExtent(a,(function(t){return zh.containsExtent(t.extent,a)}))||(this.loader_.call(this,a,i,s),e.insert(a,{extent:a.slice()}))}},co.prototype.removeLoadedExtent=function(t){var i,s=this.loadedExtentsRtree_;s.forEachInExtent(t,(function(s){if(zh.equals(s.extent,t))return i=s,!0})),i&&s.remove(i)},co.prototype.removeFeature=function(t){var i=Gs.getUid(t).toString();i in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[i]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},co.prototype.removeFeatureInternal=function(t){var i=Gs.getUid(t).toString();this.featureChangeKeys_[i].forEach(Ws.unlistenByKey),delete this.featureChangeKeys_[i];var s=t.getId();void 0!==s?delete this.idIndex_[s.toString()]:delete this.undefIdIndex_[i],this.dispatchEvent(new co.Event(uo,t))},co.prototype.removeFromIdIndex_=function(t){var i=!1;for(var s in this.idIndex_)if(this.idIndex_[s]===t){delete this.idIndex_[s],i=!0;break}return i},co.prototype.setLoader=function(t){this.loader_=t},Gs.inherits(co.Event=function(t,i){Vs.call(this,t),this.feature=i},Vs);var lo={lineString:function(t,i,s,h,n,e){var r=NaN,a=NaN,o=(s-i)/h;if(1===o)r=t[i],a=t[i+1];else if(2==o)r=(1-n)*t[i]+n*t[i+h],a=(1-n)*t[i+1]+n*t[i+h+1];else if(0!==o){var u,c=t[i],l=t[i+1],f=0,d=[0];for(u=i+h;u<s;u+=h){var v=t[u],m=t[u+1];f+=Math.sqrt((v-c)*(v-c)+(m-l)*(m-l)),d.push(f),c=v,l=m}var p=n*f,_=_h.binarySearch(d,p);if(_<0){var g=(p-d[-_-2])/(d[-_-1]-d[-_-2]),z=i+(-_-2)*h;r=rh.lerp(t[z],t[z+h],g),a=rh.lerp(t[z+1],t[z+h+1],g)}else r=t[i+_*h],a=t[i+_*h+1]}return e?(e[0]=r,e[1]=a,e):[r,a]},lineStringCoordinateAtM:function(t,i,s,h,n,e){if(s==i)return null;var r;if(n<t[i+h-1])return e?((r=t.slice(i,i+h))[h-1]=n,r):null;if(t[s-1]<n)return e?((r=t.slice(s-h,s))[h-1]=n,r):null;if(n==t[i+h-1])return t.slice(i,i+h);for(var a=i/h,o=s/h;a<o;){var u=a+o>>1;n<t[(u+1)*h-1]?o=u:a=u+1}var c=t[a*h-1];if(n==c)return t.slice((a-1)*h,(a-1)*h+h);var l,f=(n-c)/(t[(a+1)*h-1]-c);for(r=[],l=0;l<h-1;++l)r.push(rh.lerp(t[(a-1)*h+l],t[a*h+l],f));return r.push(n),r},lineStringsCoordinateAtM:function(t,i,s,h,n,e,r){if(r)return lo.lineStringCoordinateAtM(t,i,s[s.length-1],h,n,e);var a,o,u;if(n<t[h-1])return e?((a=t.slice(0,h))[h-1]=n,a):null;if(t[t.length-1]<n)return e?((a=t.slice(t.length-h))[h-1]=n,a):null;for(o=0,u=s.length;o<u;++o){var c=s[o];if(i!=c){if(n<t[i+h-1])return null;if(n<=t[c-1])return lo.lineStringCoordinateAtM(t,i,c,h,n,!1);i=c}}return null}},fo=function(t,i){Lh.call(this),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.setCoordinates(t,i)};Gs.inherits(fo,Lh),fo.prototype.appendCoordinate=function(t){this.flatCoordinates?_h.extend(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},fo.prototype.clone=function(){var t=new fo(null);return t.setFlatCoordinates(this.layout,this.flatCoordinates.slice()),t},fo.prototype.closestPointXY=function(t,i,s,h){return h<zh.closestSquaredDistanceXY(this.getExtent(),t,i)?h:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(jh.getMaxSquaredDelta(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jh.getClosestPoint(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,i,s,h))},fo.prototype.forEachSegment=function(t,i){return Yh(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},fo.prototype.getCoordinateAtM=function(t,i){return this.layout!=wh&&this.layout!=bh?null:lo.lineStringCoordinateAtM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,void 0!==i&&i)},fo.prototype.getCoordinates=function(){return Uh.coordinates(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},fo.prototype.getCoordinateAt=function(t,i){return lo.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i)},fo.prototype.getLength=function(){return xr.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},fo.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},fo.prototype.getSimplifiedGeometryInternal=function(t){var i=[];i.length=Vh.douglasPeucker(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0);var s=new fo(null);return s.setFlatCoordinates(Mh,i),s},fo.prototype.getType=function(){return oh},fo.prototype.intersectsExtent=function(t){return Jh.lineString(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},fo.prototype.setCoordinates=function(t,i){t?(this.setLayout(i,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Wh.coordinates(this.flatCoordinates,0,t,this.stride),this.changed()):this.setFlatCoordinates(Mh,null)},fo.prototype.setFlatCoordinates=function(t,i){this.setFlatCoordinatesInternal(t,i),this.changed()};var vo="preload",mo="useInterimTilesOnError",po=function(t){var i=t||{},s=js.assign({},i);delete s.preload,delete s.useInterimTilesOnError,_e.call(this,s),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=Ue};Gs.inherits(po,_e),po.prototype.getPreload=function(){return this.get(vo)},po.prototype.setPreload=function(t){this.set(vo,t)},po.prototype.getUseInterimTilesOnError=function(){return this.get(mo)},po.prototype.setUseInterimTilesOnError=function(t){this.set(mo,t)};var _o=function(t){var i=t||{},s=js.assign({},i);delete s.style,delete s.renderBuffer,delete s.updateWhileAnimating,delete s.updateWhileInteracting,_e.call(this,s),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||"vector",this.type=Ve};Gs.inherits(_o,_e),_o.prototype.getDeclutter=function(){return this.declutter_},_o.prototype.setDeclutter=function(t){this.declutter_=t},_o.prototype.getRenderBuffer=function(){return this.renderBuffer_},_o.prototype.getRenderOrder=function(){return this.get(_o.Property_.RENDER_ORDER)},_o.prototype.getStyle=function(){return this.style_},_o.prototype.getStyleFunction=function(){return this.styleFunction_},_o.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},_o.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},_o.prototype.setRenderOrder=function(t){this.set(_o.Property_.RENDER_ORDER,t)},_o.prototype.setStyle=function(t){this.style_=void 0!==t?t:Fa.defaultFunction,this.styleFunction_=null===t?void 0:Fa.createFunction(this.style_),this.changed()},_o.prototype.getRenderMode=function(){return this.renderMode_},_o.Property_={RENDER_ORDER:"renderOrder"};var go="degrees",zo="metric",Mo=function(t){var i=t||{},s=void 0!==i.className?i.className:"ol-scale-line";this.innerElement_=document.createElement("DIV"),this.innerElement_.className=s+"-inner",this.element_=document.createElement("DIV"),this.element_.className=s+" "+de.CLASS_UNSELECTABLE,this.element_.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==i.minWidth?i.minWidth:64,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",ce.call(this,{element:this.element_,render:i.render?i.render:Mo.render,target:i.target}),Ws.listen(this,hh.getChangeEventType(Mo.Property_.UNITS),this.handleUnitsChanged_,this),this.setUnits(i.units||zo)};Gs.inherits(Mo,ce),Mo.LEADING_DIGITS=[1,2,5],Mo.prototype.getUnits=function(){return this.get(Mo.Property_.UNITS)},Mo.render=function(t){var i=t.frameState;this.viewState_=i?i.viewState:null,this.updateElement_()},Mo.prototype.handleUnitsChanged_=function(){this.updateElement_()},Mo.prototype.setUnits=function(t){this.set(Mo.Property_.UNITS,t)},Mo.prototype.updateElement_=function(){var t=this.viewState_;if(t){var i=t.center,s=t.projection,h=this.getUnits(),n=Th.getPointResolution(s,t.resolution,i,h==go?Gh.DEGREES:Gh.METERS);h!=go&&(n*=s.getMetersPerUnit());var e=this.minWidth_*n,r="";if(h==go){var a=Th.METERS_PER_UNIT[Gh.DEGREES];s.getUnits()==Gh.DEGREES?e*=a:n/=a,e<a/60?(r="″",n*=3600):e<a?(r="′",n*=60):r="°"}else"imperial"==h?e<.9144?(r="in",n/=.0254):e<1609.344?(r="ft",n/=.3048):(r="mi",n/=1609.344):"nautical"==h?(n/=1852,r="nm"):h==zo?e<.001?(r="μm",n*=1e6):e<1?(r="mm",n*=1e3):e<1e3?r="m":(r="km",n/=1e3):"us"==h?e<.9144?(r="in",n*=39.37):e<1609.344?(r="ft",n/=.30480061):(r="mi",n/=1609.3472):eh(!1,33);for(var o,u,c=3*Math.floor(Math.log(this.minWidth_*n)/Math.log(10));;){if(o=Mo.LEADING_DIGITS[(c%3+3)%3]*Math.pow(10,Math.floor(c/3)),u=Math.round(o/n),isNaN(u))return this.element_.style.display="none",void(this.renderedVisible_=!1);if(u>=this.minWidth_)break;++c}var l=o+" "+r;this.renderedHTML_!=l&&(this.innerElement_.innerHTML=l,this.renderedHTML_=l),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},Mo.Property_={UNITS:"units"};var wo="fraction",bo=function(t,i,s,h,n,e){qs.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==h&&(this.image_.crossOrigin=h),this.canvas_=e?document.createElement("CANVAS"):null,this.color_=e,this.imageListenerKeys_=null,this.imageState_=n,this.size_=s,this.src_=i,this.tainting_=!1,2==this.imageState_&&this.determineTainting_()};Gs.inherits(bo,qs),bo.get=function(t,i,s,h,n,e){var r=nr.iconImageCache,a=r.get(i,h,e);return a||(a=new bo(t,i,s,h,n,e),r.set(i,h,e,a)),a},bo.prototype.determineTainting_=function(){var t=Dn(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainting_=!0}},bo.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(Bs)},bo.prototype.handleImageError_=function(){this.imageState_=3,this.unlistenImage_(),this.dispatchChangeEvent_()},bo.prototype.handleImageLoad_=function(){this.imageState_=2,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},bo.prototype.getImage=function(){return this.canvas_?this.canvas_:this.image_},bo.prototype.getImageState=function(){return this.imageState_},bo.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.tainting_){var t=this.size_[0],i=this.size_[1],s=Dn(t,i);s.fillRect(0,0,t,i),this.hitDetectionImage_=s.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},bo.prototype.getSize=function(){return this.size_},bo.prototype.getSrc=function(){return this.src_},bo.prototype.load=function(){if(0==this.imageState_){this.imageState_=1,this.imageListenerKeys_=[Ws.listenOnce(this.image_,Js,this.handleImageError_,this),Ws.listenOnce(this.image_,$s,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},bo.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var i=t.getImageData(0,0,this.image_.width,this.image_.height),s=i.data,h=this.color_[0]/255,n=this.color_[1]/255,e=this.color_[2]/255,r=0,a=s.length;r<a;r+=4)s[r]*=h,s[r+1]*=n,s[r+2]*=e;t.putImageData(i,0,0)}},bo.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(Ws.unlistenByKey),this.imageListenerKeys_=null};var xo="bottom-left",yo="bottom-right",Eo="top-left",So="top-right",Po=function(t){var i=t||{};this.anchor_=void 0!==i.anchor?i.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Eo,this.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:wo,this.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:wo,this.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var s=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,n=i.src;eh(!(void 0!==n&&s),4),eh(!s||s&&h,5),void 0!==n&&0!==n.length||!s||(n=s.src||Gs.getUid(s).toString()),eh(void 0!==n&&n.length>0,6);var e=void 0!==i.src?0:2;this.color_=void 0!==i.color?Je.asArray(i.color):null,this.iconImage_=bo.get(s,n,h,this.crossOrigin_,e,this.color_),this.offset_=void 0!==i.offset?i.offset:[0,0],this.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Eo,this.origin_=null,this.size_=void 0!==i.size?i.size:null,Ra.call(this,{opacity:void 0!==i.opacity?i.opacity:1,rotation:void 0!==i.rotation?i.rotation:0,scale:void 0!==i.scale?i.scale:1,snapToPixel:void 0===i.snapToPixel||i.snapToPixel,rotateWithView:void 0!==i.rotateWithView&&i.rotateWithView})};Gs.inherits(Po,Ra),Po.prototype.clone=function(){return new Po({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:this.getScale(),snapToPixel:this.getSnapToPixel(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Po.prototype.getAnchor=function(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,i=this.getSize();if(this.anchorXUnits_==wo||this.anchorYUnits_==wo){if(!i)return null;t=this.anchor_.slice(),this.anchorXUnits_==wo&&(t[0]*=i[0]),this.anchorYUnits_==wo&&(t[1]*=i[1])}if(this.anchorOrigin_!=Eo){if(!i)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=So&&this.anchorOrigin_!=yo||(t[0]=-t[0]+i[0]),this.anchorOrigin_!=xo&&this.anchorOrigin_!=yo||(t[1]=-t[1]+i[1])}return this.normalizedAnchor_=t,this.normalizedAnchor_},Po.prototype.getColor=function(){return this.color_},Po.prototype.getImage=function(t){return this.iconImage_.getImage(t)},Po.prototype.getImageSize=function(){return this.iconImage_.getSize()},Po.prototype.getHitDetectionImageSize=function(){return this.getImageSize()},Po.prototype.getImageState=function(){return this.iconImage_.getImageState()},Po.prototype.getHitDetectionImage=function(t){return this.iconImage_.getHitDetectionImage(t)},Po.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Eo){var i=this.getSize(),s=this.iconImage_.getSize();if(!i||!s)return null;t=t.slice(),this.offsetOrigin_!=So&&this.offsetOrigin_!=yo||(t[0]=s[0]-i[0]-t[0]),this.offsetOrigin_!=xo&&this.offsetOrigin_!=yo||(t[1]=s[1]-i[1]-t[1])}return this.origin_=t,this.origin_},Po.prototype.getSrc=function(){return this.iconImage_.getSrc()},Po.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},Po.prototype.listenImageChange=function(t,i){return Ws.listen(this.iconImage_,Bs,t,i)},Po.prototype.load=function(){this.iconImage_.load()},Po.prototype.unlistenImageChange=function(t,i){Ws.unlisten(this.iconImage_,Bs,t,i)},window.proj4=Ps,window.proj4.defs("EPSG:2056","+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs");const Go={anchor:[.5,1],anchorXUnits:"fraction",anchorYUnits:"fraction",scale:.5,src:`${window.stzhComponents.pathMedia}/olmap/marker.png`},ko=Object.assign(Object.assign({},Go),{src:`${window.stzhComponents.pathMedia}/olmap/marker-active.png`}),No=Object.assign(Object.assign({},Go),{anchor:[.5,.5],src:`${window.stzhComponents.pathMedia}/olmap/marker-position.png`}),Co=class{constructor(s){t(this,s),this.stzhInitialized=i(this,"stzhInitialized"),this.stzhPostRender=i(this,"stzhPostRender"),this.stzhMoveStart=i(this,"stzhMoveStart"),this.stzhMoveEnd=i(this,"stzhMoveEnd"),this.stzhMovePanZoom=i(this,"stzhMovePanZoom"),this.hostname="www.ogc.stadt-zuerich.ch",this.scaleControl=!0,this.layerControl=!0,this.printControl=!0,this.locationControl=!1,this.layer="streets",this.zoom=7,this.zoomLocation=7,this.center=[2683311,1247082],this.centerMarker=!0,this.pinchRotateThreshold=.3,this.resolutions=[67.73333333333,33.8666666667,16.9333333333,8.4666666667,4.2333333333,2.1166666667,1.0583333333,.5291666667,.2645833333,.1322916667,.0661458333],this.writeExtentToUrlEnabled=!1,this.layers={streets:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-streets.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"basiskarte_zuerich_gebaeudeschraegansicht",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}},satellite:{thumbnailUrl:`${window.stzhComponents.pathMedia}/olmap/thumb-satellite.jpg`,options:{url:"https://{Hostname}/mapproxy/wmts/1.0.0/{Layer}/{Style}/{TileMatrixSet}/{TileMatrix}/{TileRow}/{TileCol}.png",layer:"orthofoto",matrixSet:"ktzh",origin:[2480237,1315832],extent:[2666867,1220962,2719695.5,1285537]}}},this._layers={},this.geoPositionChanged=!1,this.handlePostRender=()=>{this.stzhPostRender.emit({component:"stzh-olmap"})},this.handleDoubleClick=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleMoveStart=()=>{this.stzhMoveStart.emit({component:"stzh-olmap"})},this.handleMoveEnd=()=>{this.stzhMoveEnd.emit({component:"stzh-olmap"}),this.writeExtentToUrl().catch()},this.handlePointerdrag=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleChangeResolution=()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})},this.handleInsideModalOpen=()=>{this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))},this.handlePrintButtonClick=()=>{this.printIframe||(this.printIframe=document.createElement("iframe"),Object.assign(this.printIframe.style,{height:"0px",width:"0px",position:"absolute",border:"none"}),this.element.append(this.printIframe)),this.printIframe.innerHTML="";const t=this.printIframe.contentWindow,i=this.constructor.style.replace('@charset "UTF-8";',""),s=Array.from(document.querySelectorAll("link")).map((t=>t.outerHTML));let h;this.map.once("postcompose",(function(t){h=t.context.canvas.toDataURL("image/png")})),this.map.renderSync(),t.document.body.innerHTML=`\n ${s.join("")}\n\n <style type="text/css">\n ${i}\n </style>\n\n <div class="stzh-olmap__map stzh-olmap__map--print">\n <img class="stzh-olmap__print-image" src="${h}">\n ${this.element.querySelector(".ol-scale-line.ol-unselectable").outerHTML}\n </div>\n `,setTimeout((()=>{try{t.document.execCommand("print",!1,null)}catch(i){t.print()}}),1e3)}}layersWatcher(t){this._layers="string"==typeof t?JSON.parse(t):t}resolutionsWatcher(t){this._resolutions="string"==typeof t?JSON.parse(t):t}zoomWatcher(t){this.map&&this.map.getView().setZoom(t)}scaleControlWatcher(t){this.map&&(t?(this.scaleControlOl=new Mo({units:"metric"}),this.map.addControl(this.scaleControlOl)):(this.scaleControl&&this.map.removeControl(this.scaleControlOl),this.scaleControlOl=null))}printControlWatcher(t){this.map&&(t?(this.printControlElement=document.createElement("button"),this.printControlElement.className="ol-print",this.printControlElement.type="button",this.printControlElement.ariaLabel=this.localization.printLabel,this.printControlElement.addEventListener("click",this.handlePrintButtonClick),this.printControlElement.innerHTML='<stzh-icon name="print" class="ol-print__icon"></stzh-icon>',this.printControlOl=new ce({element:this.printControlElement}),this.map.addControl(this.printControlOl)):(this.printControlOl&&this.map.removeControl(this.printControlOl),this.printControlOl=null,this.printControlElement=null))}layerControlWatcher(t){this.map&&1!==this.layersArray.length&&(t?(this.layerControlElement=document.createElement("button"),this.layerControlElement.className="ol-layer",this.layerControlElement.type="button",this.layerControlElement.addEventListener("click",(()=>{this.layer="streets"===this.layer?"satellite":"streets"})),this.layerControlImageElement=document.createElement("img"),this.layerControlImageElement.className="ol-layer__thumbnail",this.layerControlImageElement.setAttribute("role","presentation"),this.layerControlImageElement.setAttribute("alt",""),this.layerControlTextElement=document.createElement("span"),this.layerControlTextElement.className="ol-layer__text",this.layerControlElement.appendChild(this.layerControlImageElement),this.layerControlElement.appendChild(this.layerControlTextElement),this.layerControlOl=new ce({element:this.layerControlElement}),this.map.addControl(this.layerControlOl)):(this.layerControlOl&&this.map.removeControl(this.layerControlOl),this.layerControlOl=null,this.layerControlElement=null,this.layerControlImageElement=null,this.layerControlTextElement=null))}locationControlWatcher(t){if(this.map)if(t){this.locationControlElement=document.createElement("button"),this.locationControlElement.type="button",this.locationControlElement.className="ol-location",this.locationControlElement.innerHTML='<stzh-icon name="target-bullet" class="ol-location__icon"></stzh-icon>',this.locationControlElement.addEventListener("click",(()=>{this.geolocation.getTracking()?this.disableLocationTracking().catch():this.enableLocationTracking().catch()})),this.locationControlOl=new ce({element:this.locationControlElement}),this.geolocation=new hn({projection:this.map.getView().getProjection()}),this.positionMarkerOl=new La,this.positionMarkerOl.setId("position");const t=new Fa({image:new Po(No)});this.positionMarkerOl.setStyle(t),this.positionLayer.getSource().addFeature(this.positionMarkerOl),this.geolocation.on("change:position",(()=>{const t=this.geolocation.getPosition();this.positionMarkerOl.setGeometry(new Bh(t)),!this.geoPositionChanged&&zh.containsExtent(this._layers[this.layer].options.extent,this.positionMarkerOl.getGeometry().getExtent())&&(this.geoPositionChanged=!0,this.map.getView().setCenter(t),this.zoomLocation&&this.map.getView().setZoom(this.zoomLocation))})),this.geolocation.on("change:tracking",(()=>{const t=this.geolocation.getTracking();this.positionMarkerOl.setGeometry(null),this.setLocationControlState(t)})),this.geolocation.on("error",(()=>{this.setLocationControlState(!1)})),this.map.addControl(this.locationControlOl)}else this.disableLocationTracking().catch(),this.locationControlOl&&this.map.removeControl(this.locationControlOl),this.positionMarkerOl&&this.positionLayer.getSource().removeFeature(this.positionMarkerOl),this.locationControlOl=null,this.locationControlElement=null,this.geolocation=null,this.positionMarkerOl=null}layerWatcher(t){this.map&&Object.entries(this.rasterLayers).forEach((([i,s])=>{if(i===t){s.setVisible(!0),this.map.getView().set("projection",this.projections[t]);const h=this.layersArray.find((([t])=>t!==this.layer));if(h&&(this.layerControlImageElement&&(this.layerControlImageElement.src=h[1].thumbnailUrl),this.layerControlTextElement)){let t="";"streets"===i?t=this.localization.streetsLayerTitle:"satellite"===i&&(t=this.localization.satelliteLayerTitle),this.layerControlTextElement.textContent=h[1].title||t}}else s.setVisible(!1)}))}centerWatcher(t){this._center="string"==typeof t?JSON.parse(t):t,this.map&&!this._initialExtent&&(this.map.getView().setCenter(this._center),this.centerMarkerOl&&this.centerMarkerOl.setGeometry(new Bh(this._center)))}async centerMarkerWatcher(t){t?this.centerMarkerOl=await this.addIconMarker(this._center):this.centerMarkerOl&&this.removeIconMarker(this.centerMarkerOl)}async getMap(){return this.map}async writeExtentToUrl(){if(this.writeExtentToUrlEnabled){const t=this.map.getView().calculateExtent(this.map.getSize()),[i,s,h,n]=t,e=new URLSearchParams(window.location.search);e.set("extent[0]",i.toFixed(10)),e.set("extent[1]",s.toFixed(10)),e.set("extent[2]",h.toFixed(10)),e.set("extent[3]",n.toFixed(10));const r=`${window.location.pathname}?${e.toString()}`;history.replaceState(null,"",r)}}async getVisibleMarkers(){const t=this.iconLayer.getSource().getFeatures();if(0===t.length)return[];const i=this.map.getView().calculateExtent(this.map.getSize());return t.filter((t=>{const s=t.getGeometry().getExtent();return zh.intersects(i,s)}))}async findMarkerById(t){return this.iconLayer.getSource().getFeatures().find((i=>i.get("id")===t))}async addIconMarker(t,i){const s=new La({geometry:new Bh(t)}),h=new Fa({image:new Po(Go)});return i&&i.id&&(s.setProperties({id:i.id}),s.setId(i.id)),s.setProperties({stzh:i}),s.setStyle(h),this.iconLayer.getSource().addFeature(s),s}async addIconMarkers(t){for(const i of t)await this.addIconMarker(i.coordinates,i.props);return!0}async updateViewToFitMarkers(t=1e3){const i=this.iconLayer.getSource().getFeatures();if(0===i.length)return;let s=zh.createEmpty();i.forEach((t=>{zh.extend(s,t.getGeometry().getExtent())})),this.map.getView().fit(s,{size:this.map.getSize(),duration:t})}async removeAllIconMarkers(){return this.iconLayer.getSource().clear()}async removeIconMarker(t){return this.iconLayer.getSource().removeFeature(t)}async setIconMarkerActive(t){t.setStyle(new Fa({image:new Po(ko)}))}async setIconMarkerInactive(t){t.setStyle(new Fa({image:new Po(Go)}))}async setAllIconMarkersInactive(){this.iconLayer.getSource().getFeatures().forEach((t=>{this.setIconMarkerInactive(t).catch((t=>console.error(t)))}))}async enableLocationTracking(t=!0){this.setLocationControlState(!0),this.geoPositionChanged=!t,this.geolocation&&this.geolocation.setTracking(!0)}async disableLocationTracking(){this.setLocationControlState(!1),this.geolocation&&this.geolocation.setTracking(!1)}async getDistance(t,i){const s=new fo([t,i]);return ph.getLength(s,{projection:this.map.getView().getProjection()})}handleLoad(){this.map&&requestAnimationFrame((()=>{this.map.updateSize()}))}showPopover(t,i){i.imageUri&&(this.popoverElement.innerHTML=`<div class="stzh-olmap__popover-image"><img src="${i.imageUri}" alt="${i.title}"></div>`);let s='<div class="stzh-olmap__popover-content">';i.title&&(s+=`<stzh-heading curve="p2">${i.title}</stzh-heading>`),i.text&&(s+=`<stzh-text size="milli" color="info">${i.text}</stzh-text>`),i.data&&i.data.length&&i.data.map((t=>{s+=`<div class="stzh-poi-teaser-list-item">\n <stzh-icon name="${t.icon}"></stzh-icon>\n <stzh-text size="micro">\n ${t.text}\n </stzh-text>\n </div>`})),s+="</div>",this.popoverElement.innerHTML+=s,i.href&&(this.popoverElement.innerHTML+=`<a href="${i.href}" class="stzh-olmap__popover-link"></a>`);const h=new Aa({element:this.popoverElement,position:t,positioning:"bottom-center",offset:[0,-50],autoPan:!1,autoPanAnimation:{duration:300}});this.map.addOverlay(h),this.map.renderSync()}initializeMarkerHover(){this.map.on("pointermove",(t=>{const i=this.map.getEventPixel(t.originalEvent),s=this.map.hasFeatureAtPixel(i,{layerFilter:t=>t===this.iconLayer});this.map.getTargetElement().style.cursor=s?"pointer":""}))}setLocationControlState(t){this.positionLayer&&this.positionLayer.setVisible(t),this.locationControlElement&&this.locationControlElement.classList.toggle("active",t)}createMap(){const t=document.createElement("stzh-icon");t.ariaLabel=this.localization.zoomInLabel,t.name="plus",t.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const i=document.createElement("stzh-icon");i.ariaLabel=this.localization.zoomOutLabel,i.name="minus",i.addEventListener("click",(()=>{this.stzhMovePanZoom.emit({component:"stzh-olmap"})}));const s=document.createElement("div");s.innerHTML='<svg width="16" height="24" viewBox="0 0 16 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8.0011 22.5728L13.2809 12.0132H2.72134L8.0011 22.5728Z" fill="#DEDEDE" stroke="#BFBFBF" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" fill="#D0021B"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="#D0021B" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n<path d="M7.99976 1.42721L2.71999 11.9867H13.2795L7.99976 1.42721Z" stroke="black" stroke-opacity="0.2" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>\n</svg>\n';const h=document.createElement("span");return h.innerText=this.localization.rotateLabel,s.appendChild(h),new Pa({controls:we({zoomOptions:{zoomInLabel:t,zoomOutLabel:i,zoomInTipLabel:"",zoomOutTipLabel:""},rotateOptions:{label:s,tipLabel:""}}),interactions:new rn([new ke,new Ee,new Ge,new Oe({threshold:this.pinchRotateThreshold}),new Fe,new Re,new Ie,new Ae]),loadTilesWhileAnimating:!0,loadTilesWhileInteracting:!0,target:this.mapElement,logo:!1})}createRasterLayer(t,i){return new po({title:"wmts",type:"base",extent:i.extent,source:this.createLayerSource(t,i)})}createLayerSource(t,i){return this.projections||(this.projections={}),this.projections[t]=new Nh({code:"EPSG:2056",extent:i.extent}),this.creatRasterSource(t,i)}creatRasterSource(t,i){const{url:s,layer:h,matrixSet:n,origin:e}=i,r=[];for(let t=0;t<this._resolutions.length;t++)r.push(t);const a=new io({origin:e,resolutions:this._resolutions,matrixIds:r,tileSize:[512,512]});return new ho({url:s,tileGrid:a,style:"default",projection:this.projections[t],crossOrigin:"anonymous",layer:h,matrixSet:n,requestEncoding:"REST"})}createIconLayer(){return new _o({source:new co({})})}initMap(){if(this.map=this.createMap(),this.map.on("postrender",this.handlePostRender),this.map.on("movestart",this.handleMoveStart),this.map.on("dblclick",this.handleDoubleClick),this.map.on("moveend",this.handleMoveEnd),this.map.on("pointerdrag",this.handlePointerdrag),this.map.on("change:resolution",this.handleChangeResolution),this.layersArray=Object.entries(this._layers),this.layersArray.length>2)throw new Error("There are only two different layers allowed.");this.rasterLayers={},this.layersArray.forEach((([t,i])=>{i.options.url=i.options.url.replace(/\{hostname\}/gi,this.hostname),this.rasterLayers[t]=this.createRasterLayer(t,i.options),this.map.addLayer(this.rasterLayers[t])})),this.positionLayer=this.createIconLayer(),this.positionLayer.setVisible(!1),this.map.addLayer(this.positionLayer),this.iconLayer=this.createIconLayer(),this.map.addLayer(this.iconLayer);const t=new Ln({center:this._center,projection:this.projections[this.layer],zoom:this.zoom,resolutions:this._resolutions});this._initialExtent&&t.fit(this._initialExtent,{size:this.map.getSize()}),this.map.setView(t),this.centerWatcher(this.center),this.scaleControlWatcher(this.scaleControl),this.printControlWatcher(this.printControl),this.locationControlWatcher(this.locationControl),this.layerControlWatcher(this.layerControl),this.layerWatcher(this.layer),this.centerMarkerWatcher(this.centerMarker),this.initializeMarkerHover(),this.map.on("singleclick",(t=>{this.setAllIconMarkersInactive().catch(),this.popoverElement.innerHTML="",this.map.forEachFeatureAtPixel(t.pixel,(t=>{if(t.getGeometry()instanceof Bh){this.setIconMarkerActive(t).catch();const i=t.getProperties();return i.stzh&&this.showPopover(i.geometry.flatCoordinates,i.stzh),!0}}))})),requestAnimationFrame((()=>{this.stzhInitialized.emit({component:"stzh-olmap"})})),this.handleMoveEnd()}componentShouldUpdate(t,i,s){return["hostname","localization","layers","resolutions","pinchRotateThreshold"].includes(s)}async componentWillLoad(){this.layersWatcher(this.layers),this.resolutionsWatcher(this.resolutions),this.localization||(this.localization=await window.stzhComponents.utils.fetchTranslations(this.element,"olmap"));const t=new URLSearchParams(window.location.search),i=[parseFloat(t.get("extent[0]")),parseFloat(t.get("extent[1]")),parseFloat(t.get("extent[2]")),parseFloat(t.get("extent[3]"))];isNaN(i[0])||isNaN(i[1])||isNaN(i[2])||isNaN(i[3])||(this._initialExtent=i)}componentWillUpdate(){this.map&&(this.map.setTarget(null),this.map=null)}componentDidRender(){this.map||this.initMap()}connectedCallback(){const t=this.element.closest("stzh-dialog");t&&t.addEventListener("stzhOpen",this.handleInsideModalOpen)}disconnectedCallback(){this.map&&(this.map.setTarget(null),this.map=null);const t=this.element.closest("stzh-dialog");t&&t.removeEventListener("stzhOpen",this.handleInsideModalOpen)}render(){return n(r,{key:"b4f1daa646020194dfedc58cac58677aa7ae3be0"},n("div",{key:"6ba70a1fa94c06935bcebb71891a7fbff9430194",class:{"stzh-olmap":!0,"stzh-olmap--has-no-layer-control":!this.layerControl,"stzh-olmap--has-no-print-control":!this.printControl,"stzh-olmap--has-location-control":this.locationControl}},n("div",{key:"57007211eeca6f538f27a2a5ef44276243d25fdf",ref:t=>this.mapElement=t,class:"stzh-olmap__map"}),n("div",{key:"d215240721be6eb7efd7973842979d2ff94a5d8f",ref:t=>this.popoverElement=t,class:"stzh-olmap__popover"})))}get element(){return a(this)}static get watchers(){return{layers:[{layersWatcher:0}],resolutions:[{resolutionsWatcher:0}],zoom:[{zoomWatcher:0}],scaleControl:[{scaleControlWatcher:0}],printControl:[{printControlWatcher:0}],layerControl:[{layerControlWatcher:0}],locationControl:[{locationControlWatcher:0}],layer:[{layerWatcher:0}],center:[{centerWatcher:0}],centerMarker:[{centerMarkerWatcher:0}]}}};Co.style=':host{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}:host[hidden],:host[stzh-hidden]{display:none}:host::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}:host *,:host *::before,:host *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}:host{}:host .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}:host .stzh-fylingfocus-focused{outline-style:none !important}:host .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}stzh-olmap[hidden],stzh-olmap[stzh-hidden]{display:none}stzh-olmap::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}stzh-olmap *,stzh-olmap *::before,stzh-olmap *::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}stzh-olmap{}stzh-olmap .has-focus{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}stzh-olmap .stzh-fylingfocus-focused{outline-style:none !important}stzh-olmap .stzh-fylingfocus-focused::-moz-focus-inner{border:0 !important}stzh-olmap{position:relative;width:100%;aspect-ratio:1/1}@media print{stzh-olmap{page-break-inside:avoid;break-inside:avoid}}@media screen and (min-width: 600px){stzh-olmap{aspect-ratio:16/9}}@media screen and (min-width: 900px){stzh-olmap{aspect-ratio:21/9}}.stzh-olmap__map{position:absolute;width:100%;height:100%;top:0;left:0}.stzh-olmap__map--print{margin-top:var(--stzh-space-xxlarge, 32px);max-width:100%;height:auto}.stzh-olmap__print-image{display:block;max-width:100%}.stzh-olmap .ol-overlaycontainer-stopevent{touch-action:manipulation}.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-deca-font-size);line-height:var(--stzh-font-deca-text-line-height);letter-spacing:var(--stzh-font-deca-text-letter-spacing);position:relative;display:flex;align-items:center;justify-content:center;-webkit-user-select:none;user-select:none;border:0.125rem solid transparent;border-radius:0;color:var(--stzh-color-primary);transition:all var(--stzh-base-transition-animation-speed) ease;background-color:var(--stzh-color-white);width:var(--stzh-form-input-small-height);height:var(--stzh-form-input-small-height);cursor:pointer}@media (forced-colors: active){.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom-in,.stzh-olmap .ol-zoom-out,.stzh-olmap .ol-rotate-reset{transition:none;color:ButtonText;border-color:ButtonBorder;background-color:ButtonFace}}.stzh-olmap .ol-print stzh-icon,.stzh-olmap .ol-location stzh-icon,.stzh-olmap .ol-zoom-in stzh-icon,.stzh-olmap .ol-zoom-out stzh-icon,.stzh-olmap .ol-rotate-reset stzh-icon{--size:var(--stzh-icon-size-small)}.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:var(--stzh-color-primary70);background:var(--stzh-color-secondary20)}@media (forced-colors: active){.stzh-olmap .ol-print:hover,.stzh-olmap .ol-location:hover,.stzh-olmap .ol-zoom-in:hover,.stzh-olmap .ol-zoom-out:hover,.stzh-olmap .ol-rotate-reset:hover{color:HighlightText;border-color:Highlight;background-color:Highlight}}.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{position:absolute;right:var(--stzh-space-xsmall, 8px);bottom:var(--stzh-space-xsmall, 8px);box-shadow:var(--stzh-box-shadow-popover);border-radius:var(--stzh-button-border-radius)}@media print{.stzh-olmap .ol-layer,.stzh-olmap .ol-print,.stzh-olmap .ol-location,.stzh-olmap .ol-zoom,.stzh-olmap .ol-rotate-reset{display:none}}.stzh-olmap .ol-layer{left:var(--stzh-space-xsmall, 8px);right:auto;padding:var(--stzh-space-xxxsmall, 2px);border:none;cursor:pointer}.stzh-olmap .ol-layer__thumbnail{width:4.75rem;height:4.75rem;display:block}.stzh-olmap .ol-layer__text{font-family:var(--stzh-font-family-light);font-weight:var(--stzh-font-weight-light);font-style:var(--stzh-font-style-light);font-size:var(--stzh-font-pico-font-size);line-height:var(--stzh-font-pico-text-line-height);position:absolute;bottom:0;left:0;right:0;text-align:left;background-color:var(--stzh-color-white);color:var(--stzh-color-primary);padding-left:calc(var(--stzh-space-xxxsmall, 2px) + 0.0625rem);padding-right:calc(var(--stzh-space-xxxsmall, 2px) + 0.0625rem)}.stzh-olmap .ol-layer:hover .ol-layer__text{color:var(--stzh-color-primary-hover)}.stzh-olmap .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2)}.stzh-olmap .ol-location:hover{color:var(--stzh-color-primary-hover);background:var(--stzh-color-white)}.stzh-olmap .ol-location.active{color:var(--stzh-color-white);background:var(--stzh-color-primary)}.stzh-olmap .ol-zoom{margin-bottom:calc(var(--stzh-form-input-small-height) + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px));background-color:transparent;border-radius:var(--stzh-button-border-radius);overflow:hidden}.stzh-olmap .ol-zoom-in{margin-bottom:var(--stzh-space-xxxsmall, 2px)}.stzh-olmap .ol-rotate-reset{width:2rem;height:2rem;border-radius:50%;box-shadow:none;margin-right:calc((var(--stzh-form-input-small-height) - 2rem) / 2);margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap .ol-rotate-reset span{border:0;clip:rect(0 0 0 0);clip-path:inset(100%);width:0.0625rem;height:0.0625rem;overflow:hidden;padding:0;position:absolute}.stzh-olmap .ol-rotate-reset svg{width:0.99rem;height:1.32188rem}.stzh-olmap .ol-hidden{display:none}.stzh-olmap .ol-compass{display:flex;align-items:center;justify-content:center}.stzh-olmap .ol-scale-line{position:absolute;left:var(--stzh-space-xsmall, 8px);bottom:var(--stzh-space-xsmall, 8px);margin-left:calc(4.75rem + var(--stzh-space-xxxsmall, 2px) + var(--stzh-space-xsmall, 8px))}.stzh-olmap .ol-scale-line-inner{font-size:var(--stzh-font-nano-font-size);line-height:var(--stzh-font-nano-text-line-height);position:relative;color:var(--stzh-color-black);text-align:center;filter:drop-shadow(-0.0625rem 0px 0px white) drop-shadow(0.0625rem 0px 0px white) drop-shadow(0px -0.0625rem 0px white) drop-shadow(0px 0.0625rem 0px white)}.stzh-olmap .ol-scale-line-inner::after{content:"";position:absolute;bottom:0;left:0;width:100%;height:0.28125rem;border:0.0625rem solid var(--stzh-color-black);border-top:0}.stzh-olmap .ol-attribution{display:none}.stzh-olmap{}.stzh-olmap--has-no-layer-control .ol-scale-line{margin-left:0}.stzh-olmap{}.stzh-olmap--has-no-print-control .ol-zoom{margin-bottom:0}.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap{}.stzh-olmap--has-location-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 4 + var(--stzh-space-xsmall, 8px) * 3 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-location{margin-bottom:calc(var(--stzh-form-input-small-height) * 2 + var(--stzh-space-xsmall, 8px) + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap--has-location-control.stzh-olmap--has-no-print-control .ol-rotate-reset{margin-bottom:calc(var(--stzh-form-input-small-height) * 3 + var(--stzh-space-xsmall, 8px) * 2 + var(--stzh-space-xxxsmall, 2px))}.stzh-olmap{}.stzh-olmap__popover{background-color:var(--stzh-color-grey10);width:18.75rem}@media screen and (max-width: 599px){.stzh-olmap__popover{position:fixed;right:0;bottom:0;left:0;width:100%;z-index:5;display:flex}}.stzh-olmap__popover-content{padding:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{padding:var(--stzh-space-small, 12px)}}@media screen and (min-width: 900px){.stzh-olmap__popover-content{padding:var(--stzh-space-medium, 16px)}}@media screen and (min-width: 1260px){.stzh-olmap__popover-content{padding:var(--stzh-space-xlarge, 24px)}}.stzh-olmap__popover-content stzh-heading{margin-bottom:var(--stzh-space-xsmall, 8px)}@media screen and (min-width: 600px){.stzh-olmap__popover-content{aspect-ratio:2/1}}.stzh-olmap__popover-link{position:absolute;top:0;right:0;bottom:0;left:0}.stzh-olmap__popover-image{position:relative}@media screen and (max-width: 599px){.stzh-olmap__popover-image{width:8.75rem;min-width:8.75rem;height:8.75rem;max-height:8.75rem;overflow:hidden}}.stzh-olmap__popover-image img{width:100%}@media screen and (max-width: 599px){.stzh-olmap__popover-image img{position:absolute;top:50%;left:50%;width:100%;height:100%;object-fit:cover;transform:translate(-50%, -50%)}}.stzh-olmap__popover *{text-decoration:none}';const Ao="stzh-overlay-open",Ro=class{constructor(s){t(this,s),this.stzhOpen=i(this,"stzhOpen"),this.stzhClose=i(this,"stzhClose"),this.open=!1,this.stay=!0,this.a11yLabel=""}async show(){this.open=!0,this.stzhOpen.emit({component:"stzh-overlay"})}async hide(){this.open=!1,this.stzhClose.emit({component:"stzh-overlay"})}getSiblings(){return this.containerElement?Array.from(this.containerElement.children).filter((t=>t!==this.element)):[]}disableSiblings(){this.getSiblings().forEach((t=>{t.setAttribute("aria-hidden","true")}))}enableSiblings(){this.getSiblings().forEach((t=>{t.removeAttribute("aria-hidden")}))}dialogShown(){document.body.classList.add(Ao),this.disableSiblings(),this.trap&&this.trap.activate()}dialogHidden(){document.body.classList.remove(Ao),this.enableSiblings(),this.trap&&this.trap.deactivate()}connectedCallback(){this.stay||this.element.parentElement===document.body||document.body.appendChild(this.element),this.containerElement=this.element.parentElement}componentDidRender(){this.open?this.dialogShown():this.dialogHidden()}componentDidUpdate(){this.trap.updateContainerElements(this.element)}componentDidLoad(){this.trap=l(this.element,Object.assign({fallbackFocus:this.dialogElement},f())),this.open&&this.dialogShown()}disconnectedCallback(){this.dialogHidden()}render(){return n(r,{key:"fdbd41e21e69da9bdf779186f59a5b25d601b300"},n("div",{key:"383e5312e002e838de74a744d347fcdba939f1d1",class:{"stzh-overlay":!0,"stzh-overlay--is-open":this.open}},n("div",{key:"6787cebf78ab94c79d30f9a1149092c1f8528451",class:"stzh-overlay__backdrop"}),n("div",{key:"1b22ddec485197eb5ae3b5d8c2e461561f3995d4",class:"stzh-overlay__content"},n("div",{key:"991e04254c097825350912865c4e0e4c1f0ebcac",class:"stzh-overlay__content-inner",ref:t=>this.dialogElement=t,tabindex:"-1",role:"dialog","aria-label":this.a11yLabel||null,"aria-hidden":this.open?"false":"true"},n("slot",{key:"632169135c477cdb1a709420891a13e3bfd0394e"})))))}get element(){return a(this)}};Ro.style=".sc-stzh-overlay-h{font-family:var(--stzh-font-family-medium);font-weight:var(--stzh-font-weight-medium);font-style:var(--stzh-font-style-medium);color:var(--stzh-base-color);box-sizing:border-box;display:block}[hidden].sc-stzh-overlay-h,[stzh-hidden].sc-stzh-overlay-h{display:none}.sc-stzh-overlay-h::selection{color:var(--stzh-selection-color);background-color:var(--stzh-selection-background-color)}.sc-stzh-overlay-h *.sc-stzh-overlay,.sc-stzh-overlay-h *.sc-stzh-overlay::before,.sc-stzh-overlay-h *.sc-stzh-overlay::after{box-sizing:border-box;text-underline-offset:var(--stzh-link-text-underline-offset);text-decoration-thickness:var(--stzh-link-text-decoration-thickness);-webkit-text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink);text-decoration-skip-ink:var(--stzh-link-text-decoration-skip-ink)}.sc-stzh-overlay-h .has-focus.sc-stzh-overlay{outline:var(--stzh-flyingfocus-color) solid 0.125rem;outline-offset:0.125rem}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay{outline-style:none !important}.sc-stzh-overlay-h .stzh-fylingfocus-focused.sc-stzh-overlay::-moz-focus-inner{border:0 !important}.sc-stzh-overlay-h{--backdrop-opacity:var(--stzh-overlay-backdrop-opacity);--backdrop-background-color:var(--stzh-overlay-backdrop-background-color)}.stzh-overlay.sc-stzh-overlay{display:none;z-index:var(--stzh-z-index-overlay);position:fixed;top:0;left:0;width:100%;height:100%;flex-direction:column;justify-content:stretch;align-items:stretch}.stzh-overlay__backdrop.sc-stzh-overlay{z-index:1;background-color:var(--backdrop-background-color);opacity:var(--backdrop-opacity);position:absolute;top:0;left:0;width:100%;height:100%}.stzh-overlay__content.sc-stzh-overlay{z-index:2;display:flex;flex-direction:column;align-items:center;position:relative;flex-grow:1;overflow:auto}.stzh-overlay__content-inner.sc-stzh-overlay{margin-top:auto;margin-bottom:auto;outline:none}.stzh-overlay--is-open.sc-stzh-overlay{display:flex}";export{m as stzh_header,Co as stzh_olmap,Ro as stzh_overlay}
|