@nanoporetech-digital/components 3.14.0 → 4.1.0
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/CHANGELOG.md +41 -0
- package/dist/cjs/{algolia-data-533e3a95.js → algolia-data-ed53eaa8.js} +2 -2
- package/dist/cjs/{algolia-data-533e3a95.js.map → algolia-data-ed53eaa8.js.map} +1 -1
- package/dist/cjs/{component-store-5ad4de07.js → component-store-74d25f63.js} +2 -2
- package/dist/cjs/{component-store-5ad4de07.js.map → component-store-74d25f63.js.map} +1 -1
- package/dist/cjs/{form-control-80c69d1d.js → form-control-2e900f54.js} +2 -2
- package/dist/cjs/{form-control-80c69d1d.js.map → form-control-2e900f54.js.map} +1 -1
- package/dist/cjs/{index-46286eea.js → index-71f899a7.js} +85 -42
- package/dist/cjs/index-71f899a7.js.map +1 -0
- package/dist/cjs/{index-b13f69e7.js → index-99649bef.js} +2 -2
- package/dist/cjs/{index-b13f69e7.js.map → index-99649bef.js.map} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/cjs/nano-accordion.cjs.entry.js +1 -1
- package/dist/cjs/nano-alert.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia-filter.cjs.entry.js +3 -3
- package/dist/cjs/nano-algolia-input.cjs.entry.js +3 -3
- package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia-results.cjs.entry.js +2 -2
- package/dist/cjs/nano-algolia.cjs.entry.js +3 -3
- package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/nano-checkbox.cjs.entry.js +1 -1
- package/dist/cjs/nano-components.cjs.js +3 -3
- package/dist/cjs/nano-components.cjs.js.map +1 -1
- package/dist/cjs/nano-datalist_3.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
- package/dist/cjs/nano-date-picker.cjs.entry.js +1 -1
- package/dist/cjs/nano-demo.cjs.entry.js +1 -1
- package/dist/cjs/nano-details.cjs.entry.js +2 -2
- package/dist/cjs/nano-dialog.cjs.entry.js +3 -3
- package/dist/cjs/nano-drawer.cjs.entry.js +2 -2
- package/dist/cjs/nano-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/nano-field-validator.cjs.entry.js +2 -2
- package/dist/cjs/nano-file-upload.cjs.entry.js +1 -1
- package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +3 -3
- package/dist/cjs/nano-global-nav.cjs.entry.js +31 -34
- package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-global-search-results.cjs.entry.js +1 -1
- package/dist/cjs/nano-grid_3.cjs.entry.js +2 -2
- package/dist/cjs/nano-grid_3.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-hero.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon-button.cjs.entry.js +1 -1
- package/dist/cjs/nano-icon.cjs.entry.js +1 -1
- package/dist/cjs/nano-input.cjs.entry.js +2 -2
- package/dist/cjs/nano-menu-drawer.cjs.entry.js +1 -1
- package/dist/cjs/nano-overflow-nav.cjs.entry.js +282 -0
- package/dist/cjs/nano-overflow-nav.cjs.entry.js.map +1 -0
- package/dist/cjs/nano-progress-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/nano-range.cjs.entry.js +1 -1
- package/dist/cjs/nano-rating.cjs.entry.js +1 -1
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js +4 -4
- package/dist/cjs/nano-resize-observe_2.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-slide.cjs.entry.js +1 -1
- package/dist/cjs/nano-slides.cjs.entry.js +2 -2
- package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
- package/dist/cjs/nano-spinner.cjs.entry.js +1 -1
- package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
- package/dist/cjs/nano-sticker.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-content.cjs.entry.js +1 -1
- package/dist/cjs/nano-tab-group.cjs.entry.js +4 -4
- package/dist/cjs/nano-tab.cjs.entry.js +2 -2
- package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/{nano-table-9044710f.js → nano-table-c5b6630a.js} +4 -4
- package/dist/cjs/{nano-table-9044710f.js.map → nano-table-c5b6630a.js.map} +1 -1
- package/dist/cjs/nano-table.cjs.entry.js +3 -3
- package/dist/cjs/{scroll-a197d9c4.js → scroll-6a9bedb4.js} +15 -8
- package/dist/cjs/scroll-6a9bedb4.js.map +1 -0
- package/dist/cjs/{table.worker-8ad26746.js → table.worker-0876611d.js} +4 -4
- package/dist/cjs/table.worker-0876611d.js.map +1 -0
- package/dist/cjs/{transitions-5cd8f697.js → transitions-1205f12b.js} +3 -3
- package/dist/cjs/transitions-1205f12b.js.map +1 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/global-nav/global-nav.js +30 -31
- package/dist/collection/components/global-nav/global-nav.js.map +1 -1
- package/dist/collection/components/global-nav/style/global-nav.css +8 -5
- package/dist/collection/components/img/img.css +1 -1
- package/dist/collection/components/overflow-nav/overflow-nav.css +223 -0
- package/dist/collection/components/overflow-nav/overflow-nav.js +441 -0
- package/dist/collection/components/overflow-nav/overflow-nav.js.map +1 -0
- package/dist/collection/components/resize-observe/resize-observe.js +5 -5
- package/dist/collection/components/resize-observe/resize-observe.js.map +1 -1
- package/dist/collection/components/skeleton/skeleton.css +2 -2
- package/dist/collection/components/slides/slides.js +1 -1
- package/dist/collection/components/slides/slides.js.map +1 -1
- package/dist/collection/components/tabs/tab.css +1 -1
- package/dist/collection/utils/scroll.js +14 -7
- package/dist/collection/utils/scroll.js.map +1 -1
- package/dist/collection/utils/transitions.js +2 -2
- package/dist/collection/utils/transitions.js.map +1 -1
- package/dist/components/img.js +1 -1
- package/dist/components/img.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/nano-global-nav.js +29 -32
- package/dist/components/nano-global-nav.js.map +1 -1
- package/dist/components/nano-overflow-nav.d.ts +11 -0
- package/dist/components/nano-overflow-nav.js +317 -0
- package/dist/components/nano-overflow-nav.js.map +1 -0
- package/dist/components/nano-slides.js +1 -1
- package/dist/components/nano-slides.js.map +1 -1
- package/dist/components/nano-tab.js +1 -1
- package/dist/components/nano-tab.js.map +1 -1
- package/dist/components/resize-observe.js +3 -3
- package/dist/components/resize-observe.js.map +1 -1
- package/dist/components/scroll.js +14 -7
- package/dist/components/scroll.js.map +1 -1
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/transitions.js +2 -2
- package/dist/components/transitions.js.map +1 -1
- package/dist/esm/{algolia-data-e5e86f12.js → algolia-data-ef2829e0.js} +2 -2
- package/dist/esm/{algolia-data-e5e86f12.js.map → algolia-data-ef2829e0.js.map} +1 -1
- package/dist/esm/{component-store-2044c2c2.js → component-store-244a8431.js} +2 -2
- package/dist/esm/{component-store-2044c2c2.js.map → component-store-244a8431.js.map} +1 -1
- package/dist/esm/{form-control-4f3a88a1.js → form-control-269ba84f.js} +2 -2
- package/dist/esm/{form-control-4f3a88a1.js.map → form-control-269ba84f.js.map} +1 -1
- package/dist/esm/{index-728dda31.js → index-5d0f4704.js} +2 -2
- package/dist/esm/{index-728dda31.js.map → index-5d0f4704.js.map} +1 -1
- package/dist/esm/{index-52b0408e.js → index-dad5627b.js} +85 -42
- package/dist/esm/index-dad5627b.js.map +1 -0
- package/dist/esm/loader.js +4 -4
- package/dist/esm/loader.js.map +1 -1
- package/dist/esm/nano-accordion.entry.js +1 -1
- package/dist/esm/nano-alert.entry.js +2 -2
- package/dist/esm/nano-algolia-filter.entry.js +3 -3
- package/dist/esm/nano-algolia-input.entry.js +3 -3
- package/dist/esm/nano-algolia-pagination.entry.js +2 -2
- package/dist/esm/nano-algolia-results.entry.js +2 -2
- package/dist/esm/nano-algolia.entry.js +3 -3
- package/dist/esm/nano-aspect-ratio.entry.js +1 -1
- package/dist/esm/nano-checkbox-group.entry.js +1 -1
- package/dist/esm/nano-checkbox.entry.js +1 -1
- package/dist/esm/nano-components.js +4 -4
- package/dist/esm/nano-components.js.map +1 -1
- package/dist/esm/nano-datalist_3.entry.js +1 -1
- package/dist/esm/nano-date-input.entry.js +1 -1
- package/dist/esm/nano-date-picker.entry.js +1 -1
- package/dist/esm/nano-demo.entry.js +1 -1
- package/dist/esm/nano-details.entry.js +2 -2
- package/dist/esm/nano-dialog.entry.js +3 -3
- package/dist/esm/nano-drawer.entry.js +2 -2
- package/dist/esm/nano-dropdown.entry.js +1 -1
- package/dist/esm/nano-field-validator.entry.js +2 -2
- package/dist/esm/nano-file-upload.entry.js +1 -1
- package/dist/esm/nano-global-nav-user-profile_3.entry.js +3 -3
- package/dist/esm/nano-global-nav.entry.js +31 -34
- package/dist/esm/nano-global-nav.entry.js.map +1 -1
- package/dist/esm/nano-global-search-results.entry.js +1 -1
- package/dist/esm/nano-grid_3.entry.js +2 -2
- package/dist/esm/nano-grid_3.entry.js.map +1 -1
- package/dist/esm/nano-hero.entry.js +1 -1
- package/dist/esm/nano-icon-button.entry.js +1 -1
- package/dist/esm/nano-icon.entry.js +1 -1
- package/dist/esm/nano-input.entry.js +2 -2
- package/dist/esm/nano-menu-drawer.entry.js +1 -1
- package/dist/esm/nano-overflow-nav.entry.js +278 -0
- package/dist/esm/nano-overflow-nav.entry.js.map +1 -0
- package/dist/esm/nano-progress-bar_2.entry.js +1 -1
- package/dist/esm/nano-range.entry.js +1 -1
- package/dist/esm/nano-rating.entry.js +1 -1
- package/dist/esm/nano-resize-observe_2.entry.js +4 -4
- package/dist/esm/nano-resize-observe_2.entry.js.map +1 -1
- package/dist/esm/nano-slide.entry.js +1 -1
- package/dist/esm/nano-slides.entry.js +2 -2
- package/dist/esm/nano-slides.entry.js.map +1 -1
- package/dist/esm/nano-spinner.entry.js +1 -1
- package/dist/esm/nano-split-pane.entry.js +1 -1
- package/dist/esm/nano-sticker.entry.js +1 -1
- package/dist/esm/nano-tab-content.entry.js +1 -1
- package/dist/esm/nano-tab-group.entry.js +4 -4
- package/dist/esm/nano-tab.entry.js +2 -2
- package/dist/esm/nano-tab.entry.js.map +1 -1
- package/dist/esm/{nano-table-c46586f1.js → nano-table-ff985e63.js} +4 -4
- package/dist/esm/{nano-table-c46586f1.js.map → nano-table-ff985e63.js.map} +1 -1
- package/dist/esm/nano-table.entry.js +3 -3
- package/dist/esm/{scroll-e5825d8d.js → scroll-952d292a.js} +15 -8
- package/dist/esm/scroll-952d292a.js.map +1 -0
- package/dist/esm/{table.worker-72318b56.js → table.worker-906bc297.js} +4 -4
- package/dist/esm/table.worker-906bc297.js.map +1 -0
- package/dist/esm/{transitions-71cca3ed.js → transitions-686c5fec.js} +3 -3
- package/dist/esm/transitions-686c5fec.js.map +1 -0
- package/dist/nano-components/nano-components.css +1 -1
- package/dist/nano-components/nano-components.esm.js +1 -1
- package/dist/nano-components/nano-components.esm.js.map +1 -1
- package/dist/nano-components/{p-f25d2e90.entry.js → p-053eb1df.entry.js} +2 -2
- package/dist/nano-components/{p-ad3ddbc8.entry.js → p-068bdd89.entry.js} +2 -2
- package/dist/nano-components/{p-fa676bc6.entry.js → p-0c077605.entry.js} +2 -2
- package/dist/nano-components/{p-e4505f00.entry.js → p-0d1ca590.entry.js} +2 -2
- package/dist/nano-components/{p-ece694af.entry.js → p-104b7e3a.entry.js} +2 -2
- package/dist/nano-components/{p-75df97c2.entry.js → p-107d4549.entry.js} +2 -2
- package/dist/nano-components/{p-4c5e0c9e.js → p-13dd65c9.js} +2 -2
- package/dist/nano-components/p-15217442.entry.js +5 -0
- package/dist/nano-components/p-15217442.entry.js.map +1 -0
- package/dist/nano-components/{p-1aff5304.entry.js → p-173cc842.entry.js} +2 -2
- package/dist/nano-components/{p-93bece01.entry.js → p-1c6c94cb.entry.js} +2 -2
- package/dist/nano-components/{p-a9beb006.entry.js → p-207a1fbc.entry.js} +2 -2
- package/dist/nano-components/{p-d32dafd9.entry.js → p-239d343a.entry.js} +2 -2
- package/dist/nano-components/{p-d32dafd9.entry.js.map → p-239d343a.entry.js.map} +1 -1
- package/dist/nano-components/{p-dab8526f.entry.js → p-288dbe6b.entry.js} +2 -2
- package/dist/nano-components/{p-7b21ec0b.entry.js → p-30d55046.entry.js} +2 -2
- package/dist/nano-components/p-4b136a65.js +5 -0
- package/dist/nano-components/{p-378fe272.entry.js → p-57085052.entry.js} +2 -2
- package/dist/nano-components/{p-8f888280.entry.js → p-578f5e8d.entry.js} +2 -2
- package/dist/nano-components/{p-17eebe94.entry.js → p-583d8d70.entry.js} +2 -2
- package/dist/nano-components/{p-6bb4545b.entry.js → p-5984ae16.entry.js} +2 -2
- package/dist/nano-components/{p-76d8a8a8.js → p-5ac74848.js} +2 -2
- package/dist/nano-components/{p-ebb61a70.entry.js → p-5d466a58.entry.js} +2 -2
- package/dist/nano-components/p-60a8c896.js +5 -0
- package/dist/nano-components/{p-e113074e.entry.js → p-68928c59.entry.js} +2 -2
- package/dist/nano-components/{p-3667832c.entry.js → p-7304107c.entry.js} +2 -2
- package/dist/nano-components/{p-16e45583.entry.js → p-76a650b1.entry.js} +2 -2
- package/dist/nano-components/{p-09751447.entry.js → p-7d6065c6.entry.js} +2 -2
- package/dist/nano-components/{p-07b6af21.entry.js → p-935aef3d.entry.js} +2 -2
- package/dist/nano-components/{p-8065d85b.entry.js → p-93cfbdb6.entry.js} +2 -2
- package/dist/nano-components/p-9dfe2c55.entry.js +5 -0
- package/dist/nano-components/{p-f486c940.entry.js.map → p-9dfe2c55.entry.js.map} +1 -1
- package/dist/nano-components/{p-b65e0e63.js → p-9ebbb814.js} +2 -2
- package/dist/nano-components/{p-a26a7de3.entry.js → p-a1c0afb6.entry.js} +2 -2
- package/dist/nano-components/{p-76ab079e.entry.js → p-a5a560e7.entry.js} +2 -2
- package/dist/nano-components/{p-9d1432be.js → p-a6ff5ca6.js} +2 -2
- package/dist/nano-components/{p-4bbb04d3.entry.js → p-a761ac89.entry.js} +2 -2
- package/dist/nano-components/{p-4bbb04d3.entry.js.map → p-a761ac89.entry.js.map} +1 -1
- package/dist/nano-components/{p-62e3646b.entry.js → p-ac0ac58f.entry.js} +2 -2
- package/dist/nano-components/{p-63f1e229.entry.js → p-b6306aff.entry.js} +2 -2
- package/dist/nano-components/p-c38a246f.entry.js +5 -0
- package/dist/nano-components/{p-3e7153c8.entry.js → p-cba50c3e.entry.js} +2 -2
- package/dist/nano-components/{p-ce07df57.entry.js → p-cd2f5e97.entry.js} +2 -2
- package/dist/nano-components/p-d0e15e46.entry.js +5 -0
- package/dist/nano-components/p-d0e15e46.entry.js.map +1 -0
- package/dist/nano-components/{p-dc88e52b.entry.js → p-d792f692.entry.js} +2 -2
- package/dist/nano-components/p-d7c34990.js +5 -0
- package/dist/nano-components/{p-45b7682a.js.map → p-d7c34990.js.map} +1 -1
- package/dist/nano-components/{p-4f17deb9.entry.js → p-db370094.entry.js} +3 -3
- package/dist/nano-components/{p-4f17deb9.entry.js.map → p-db370094.entry.js.map} +1 -1
- package/dist/nano-components/{p-47866646.entry.js → p-e41baa11.entry.js} +2 -2
- package/dist/nano-components/{p-9be2cba5.entry.js → p-e43f76c8.entry.js} +2 -2
- package/dist/nano-components/{p-7f545755.entry.js → p-eab09335.entry.js} +2 -2
- package/dist/nano-components/p-f2d89239.entry.js +5 -0
- package/dist/nano-components/p-f2d89239.entry.js.map +1 -0
- package/dist/nano-components/p-f6a8467a.js +6 -0
- package/dist/nano-components/p-f6a8467a.js.map +1 -0
- package/dist/nano-components/p-f6de2d5d.js +5 -0
- package/dist/nano-components/p-f6de2d5d.js.map +1 -0
- package/dist/nano-components/{p-a20d2028.entry.js → p-f93bd976.entry.js} +2 -2
- package/dist/nano-components/{p-36a2f1c0.entry.js → p-fe7a0158.entry.js} +2 -2
- package/dist/nano-components/{p-6a5ae656.entry.js → p-fecb72b9.entry.js} +2 -2
- package/dist/types/components/global-nav/global-nav.d.ts +1 -1
- package/dist/types/components/overflow-nav/overflow-nav.d.ts +78 -0
- package/dist/types/components/resize-observe/resize-observe.d.ts +4 -2
- package/dist/types/components.d.ts +90 -1
- package/dist/types/utils/transitions.d.ts +1 -1
- package/docs-json.json +282 -6
- package/docs-vscode.json +26 -1
- package/hydrate/index.js +389 -67
- package/package.json +3 -3
- package/dist/cjs/index-46286eea.js.map +0 -1
- package/dist/cjs/scroll-a197d9c4.js.map +0 -1
- package/dist/cjs/table.worker-8ad26746.js.map +0 -1
- package/dist/cjs/transitions-5cd8f697.js.map +0 -1
- package/dist/esm/index-52b0408e.js.map +0 -1
- package/dist/esm/scroll-e5825d8d.js.map +0 -1
- package/dist/esm/table.worker-72318b56.js.map +0 -1
- package/dist/esm/transitions-71cca3ed.js.map +0 -1
- package/dist/nano-components/p-167b9165.js +0 -5
- package/dist/nano-components/p-167b9165.js.map +0 -1
- package/dist/nano-components/p-45b7682a.js +0 -5
- package/dist/nano-components/p-6ef53fa1.js +0 -6
- package/dist/nano-components/p-6ef53fa1.js.map +0 -1
- package/dist/nano-components/p-7733f1f8.entry.js +0 -5
- package/dist/nano-components/p-7733f1f8.entry.js.map +0 -1
- package/dist/nano-components/p-8332890e.js +0 -5
- package/dist/nano-components/p-8c04640c.entry.js +0 -5
- package/dist/nano-components/p-d518b939.js +0 -5
- package/dist/nano-components/p-e44332c2.entry.js +0 -5
- package/dist/nano-components/p-e44332c2.entry.js.map +0 -1
- package/dist/nano-components/p-f486c940.entry.js +0 -5
- /package/dist/nano-components/{p-f25d2e90.entry.js.map → p-053eb1df.entry.js.map} +0 -0
- /package/dist/nano-components/{p-ad3ddbc8.entry.js.map → p-068bdd89.entry.js.map} +0 -0
- /package/dist/nano-components/{p-fa676bc6.entry.js.map → p-0c077605.entry.js.map} +0 -0
- /package/dist/nano-components/{p-e4505f00.entry.js.map → p-0d1ca590.entry.js.map} +0 -0
- /package/dist/nano-components/{p-ece694af.entry.js.map → p-104b7e3a.entry.js.map} +0 -0
- /package/dist/nano-components/{p-75df97c2.entry.js.map → p-107d4549.entry.js.map} +0 -0
- /package/dist/nano-components/{p-4c5e0c9e.js.map → p-13dd65c9.js.map} +0 -0
- /package/dist/nano-components/{p-1aff5304.entry.js.map → p-173cc842.entry.js.map} +0 -0
- /package/dist/nano-components/{p-93bece01.entry.js.map → p-1c6c94cb.entry.js.map} +0 -0
- /package/dist/nano-components/{p-a9beb006.entry.js.map → p-207a1fbc.entry.js.map} +0 -0
- /package/dist/nano-components/{p-dab8526f.entry.js.map → p-288dbe6b.entry.js.map} +0 -0
- /package/dist/nano-components/{p-7b21ec0b.entry.js.map → p-30d55046.entry.js.map} +0 -0
- /package/dist/nano-components/{p-8332890e.js.map → p-4b136a65.js.map} +0 -0
- /package/dist/nano-components/{p-378fe272.entry.js.map → p-57085052.entry.js.map} +0 -0
- /package/dist/nano-components/{p-8f888280.entry.js.map → p-578f5e8d.entry.js.map} +0 -0
- /package/dist/nano-components/{p-17eebe94.entry.js.map → p-583d8d70.entry.js.map} +0 -0
- /package/dist/nano-components/{p-6bb4545b.entry.js.map → p-5984ae16.entry.js.map} +0 -0
- /package/dist/nano-components/{p-76d8a8a8.js.map → p-5ac74848.js.map} +0 -0
- /package/dist/nano-components/{p-ebb61a70.entry.js.map → p-5d466a58.entry.js.map} +0 -0
- /package/dist/nano-components/{p-d518b939.js.map → p-60a8c896.js.map} +0 -0
- /package/dist/nano-components/{p-e113074e.entry.js.map → p-68928c59.entry.js.map} +0 -0
- /package/dist/nano-components/{p-3667832c.entry.js.map → p-7304107c.entry.js.map} +0 -0
- /package/dist/nano-components/{p-16e45583.entry.js.map → p-76a650b1.entry.js.map} +0 -0
- /package/dist/nano-components/{p-09751447.entry.js.map → p-7d6065c6.entry.js.map} +0 -0
- /package/dist/nano-components/{p-07b6af21.entry.js.map → p-935aef3d.entry.js.map} +0 -0
- /package/dist/nano-components/{p-8065d85b.entry.js.map → p-93cfbdb6.entry.js.map} +0 -0
- /package/dist/nano-components/{p-b65e0e63.js.map → p-9ebbb814.js.map} +0 -0
- /package/dist/nano-components/{p-a26a7de3.entry.js.map → p-a1c0afb6.entry.js.map} +0 -0
- /package/dist/nano-components/{p-76ab079e.entry.js.map → p-a5a560e7.entry.js.map} +0 -0
- /package/dist/nano-components/{p-9d1432be.js.map → p-a6ff5ca6.js.map} +0 -0
- /package/dist/nano-components/{p-62e3646b.entry.js.map → p-ac0ac58f.entry.js.map} +0 -0
- /package/dist/nano-components/{p-63f1e229.entry.js.map → p-b6306aff.entry.js.map} +0 -0
- /package/dist/nano-components/{p-8c04640c.entry.js.map → p-c38a246f.entry.js.map} +0 -0
- /package/dist/nano-components/{p-3e7153c8.entry.js.map → p-cba50c3e.entry.js.map} +0 -0
- /package/dist/nano-components/{p-ce07df57.entry.js.map → p-cd2f5e97.entry.js.map} +0 -0
- /package/dist/nano-components/{p-dc88e52b.entry.js.map → p-d792f692.entry.js.map} +0 -0
- /package/dist/nano-components/{p-47866646.entry.js.map → p-e41baa11.entry.js.map} +0 -0
- /package/dist/nano-components/{p-9be2cba5.entry.js.map → p-e43f76c8.entry.js.map} +0 -0
- /package/dist/nano-components/{p-7f545755.entry.js.map → p-eab09335.entry.js.map} +0 -0
- /package/dist/nano-components/{p-a20d2028.entry.js.map → p-f93bd976.entry.js.map} +0 -0
- /package/dist/nano-components/{p-36a2f1c0.entry.js.map → p-fe7a0158.entry.js.map} +0 -0
- /package/dist/nano-components/{p-6a5ae656.entry.js.map → p-fecb72b9.entry.js.map} +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-6ef53fa1.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-9d1432be.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-9746b0a5.js";import{S as v}from"./p-d518b939.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class b{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}b.pendingPromise=false;var w=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],b=r[2],w=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(b){if("/*"===b){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===b){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===b){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===b){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(w)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],b=l[2],w=l[3]||"";for(var x in n)if(n[x]===w){g=x;break}m(y,b),d=l.index+l[0].length,g||e("unrecognized tag type: "+w,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+b(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+b(t,e)+"return tR}"}function b(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var w=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&","<":"<",">":">",'"':""","'":"'"};function C(t){return F[t]}var j=new w({}),I=new w({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new w({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+b(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+b(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+b(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+b(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+b(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new w({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=b,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(w);const F=Object.freeze(Object.assign(Object.create(null),w,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new b;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/>/gm,">").replace(/</gm,"<").replace(/&/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{g as t,e as i,r as e,c as s,w as n,d as r,h as a,a as h}from"./p-f6a8467a.js";import{a as o}from"./p-ed6adde2.js";import{g as l}from"./p-257432ff.js";import{C as u}from"./p-a6ff5ca6.js";import{b as f,c,a as d}from"./p-69a3e911.js";import{d as p}from"./p-9746b0a5.js";import{S as v}from"./p-60a8c896.js";var m=new Map;var g=function(t,i){var e=t.fields,s=t.updater;e.forEach((function(t){s(t,i[t])}))};var y={create:function(i,e){var s=t(i);var n=new Map;var r={wormholes:n,state:e};m.set(i,r);var a=i.connectedCallback;i.connectedCallback=function(){m.set(i,r);if(a){a.call(i)}};var h=i.disconnectedCallback;i.disconnectedCallback=function(){m.delete(i);if(h){h.call(i)}};s.addEventListener("openWormhole",(function(t){t.stopPropagation();var i=t.detail,e=i.consumer,s=i.onOpen;if(n.has(e))return;if(typeof e!=="symbol"){var a=e.connectedCallback,h=e.disconnectedCallback;e.connectedCallback=function(){n.set(e,t.detail);if(a){a.call(e)}};e.disconnectedCallback=function(){n.delete(e);if(h){h.call(e)}}}n.set(e,t.detail);g(t.detail,r.state);s===null||s===void 0?void 0:s.resolve((function(){n.delete(e)}))}));s.addEventListener("closeWormhole",(function(t){var i=t.detail;n.delete(i)}))},Provider:function(t,e){var s=t.state;var n=i();if(m.has(n)){var r=m.get(n);r.state=s;r.wormholes.forEach((function(t){g(t,s)}))}return e}};class w{constructor(){this.queue=[];this.workingOnPromise=false;this.stop=false;this.limit=null}enqueue(t){return new Promise(((i,e)=>{this.queue.push({promise:t,resolve:i,reject:e});this.dequeue()}))}dequeue(){if(this.workingOnPromise){return false}if(this.stop){this.queue=[];this.stop=false;return}const t=this.queue.shift();if(!t){return false}try{this.workingOnPromise=true;t.promise().then((i=>{this.workingOnPromise=false;t.resolve(i);this.dequeue()})).catch((i=>{this.workingOnPromise=false;t.reject(i);this.dequeue()}))}catch(i){this.workingOnPromise=false;t.reject(i);this.dequeue()}return true}}w.pendingPromise=false;var b=c((function(t,i){!function(t,e){e(i)}(d,(function(t){function i(t){var e,s,n=new Error(t);return e=n,s=i.prototype,Object.setPrototypeOf?Object.setPrototypeOf(e,s):e.__proto__=s,n}function e(t,e,s){var n=e.slice(0,s).split(/\n/),r=n.length,a=n[r-1].length+1;throw i(t+=" at line "+r+" col "+a+":\n\n "+e.split(/\n/)[r-1]+"\n "+Array(a).join(" ")+"^")}i.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var s=new Function("return this")().Promise,n=!1;try{n=new Function("return (async function(){}).constructor")()}catch(t){if(!(t instanceof SyntaxError))throw t}function r(t,i){return Object.prototype.hasOwnProperty.call(t,i)}function a(t,i,e){for(var s in i)r(i,s)&&(null==i[s]||"object"!=typeof i[s]||"storage"!==s&&"prefixes"!==s||e?t[s]=i[s]:t[s]=a({},i[s]));return t}var h=/^async +/,o=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,l=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,u=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,f=/[.*+\-?^${}()|[\]\\]/g;function c(t){return f.test(t)?t.replace(f,"\\$&"):t}function d(t,s){s.rmWhitespace&&(t=t.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),o.lastIndex=0,l.lastIndex=0,u.lastIndex=0;var n=s.prefixes,r=[n.h,n.b,n.i,n.r,n.c,n.e].reduce((function(t,i){return t&&i?t+"|"+c(i):i?c(i):t}),""),a=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+c(s.tags[1])+")","g"),f=new RegExp("([^]*?)"+c(s.tags[0])+"(-|_)?\\s*("+r+")?\\s*","g"),d=0,p=!1;function v(i,n){var r,c={f:[]},v=0,m="c";function g(i){var n=t.slice(d,i),r=n.trim();if("f"===m)"safe"===r?c.raw=!0:s.async&&h.test(r)?(r=r.replace(h,""),c.f.push([r,"",!0])):c.f.push([r,""]);else if("fp"===m)c.f[c.f.length-1][1]+=r;else if("err"===m){if(r){var a=n.search(/\S/);e("invalid syntax",t,d+a)}}else c[m]=r;d=i+1}for("h"===n||"b"===n||"c"===n?m="n":"r"===n&&(c.raw=!0,n="i"),a.lastIndex=d;null!==(r=a.exec(t));){var y=r[1],w=r[2],b=r[3],x=r[4],F=r[5],C=r.index;if(y)"("===y?(0===v&&("n"===m?(g(C),m="p"):"f"===m&&(g(C),m="fp")),v++):")"===y?0===--v&&"c"!==m&&(g(C),m="err"):0===v&&"|"===y?(g(C),m="f"):"=>"===y&&(g(C),d+=1,m="res");else if(w){if("/*"===w){var j=t.indexOf("*/",a.lastIndex);-1===j&&e("unclosed comment",t,r.index),a.lastIndex=j+2}else if("'"===w){l.lastIndex=r.index,l.exec(t)?a.lastIndex=l.lastIndex:e("unclosed string",t,r.index)}else if('"'===w){u.lastIndex=r.index,u.exec(t)?a.lastIndex=u.lastIndex:e("unclosed string",t,r.index)}else if("`"===w){o.lastIndex=r.index,o.exec(t)?a.lastIndex=o.lastIndex:e("unclosed string",t,r.index)}}else if(b)return g(C),d=C+r[0].length,f.lastIndex=d,p=F,x&&"h"===n&&(n="s"),c.t=n,c}return e("unclosed tag",t,i),c}var m=function r(a,o){a.b=[],a.d=[];var l,u=!1,c=[];function m(t,i){t&&(t=function(t,i,e,s){var n,r;return"string"==typeof i.autoTrim?n=r=i.autoTrim:Array.isArray(i.autoTrim)&&(n=i.autoTrim[1],r=i.autoTrim[0]),(e||!1===e)&&(n=e),(s||!1===s)&&(r=s),"slurp"===n&&"slurp"===r?t.trim():("_"===n||"slurp"===n?t=String.prototype.trimLeft?t.trimLeft():t.replace(/^[\s\uFEFF\xA0]+/,""):"-"!==n&&"nl"!==n||(t=t.replace(/^(?:\n|\r|\r\n)/,"")),"_"===r||"slurp"===r?t=String.prototype.trimRight?t.trimRight():t.replace(/[\s\uFEFF\xA0]+$/,""):"-"!==r&&"nl"!==r||(t=t.replace(/(?:\n|\r|\r\n)$/,"")),t)}(t,s,p,i))&&(t=t.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),c.push(t))}for(;null!==(l=f.exec(t));){var g,y=l[1],w=l[2],b=l[3]||"";for(var x in n)if(n[x]===b){g=x;break}m(y,w),d=l.index+l[0].length,g||e("unrecognized tag type: "+b,t,d);var F=v(l.index,g),C=F.t;if("h"===C){var j=F.n||"";s.async&&h.test(j)&&(F.a=!0,F.n=j.replace(h,"")),F=r(F),c.push(F)}else if("c"===C){if(a.n===F.n)return u?(u.d=c,a.b.push(u)):a.d=c,a;e("Helper start and end don't match",t,l.index+l[0].length)}else if("b"===C){u?(u.d=c,a.b.push(u)):a.d=c;var I=F.n||"";s.async&&h.test(I)&&(F.a=!0,F.n=I.replace(h,"")),u=F,c=[]}else if("s"===C){var S=F.n||"";s.async&&h.test(S)&&(F.a=!0,F.n=S.replace(h,"")),c.push(F)}else c.push(F)}if(!o)throw i('unclosed helper "'+a.n+'"');return m(t.slice(d,t.length),!1),a.d=c,a}({f:[]},!0);if(s.plugins)for(var g=0;g<s.plugins.length;g++){var y=s.plugins[g];y.processAST&&(m.d=y.processAST(m.d,s))}return m.d}function p(t,i){var e=d(t,i),s="var tR='';"+(i.useWith?"with("+i.varName+"||{}){":"")+w(e,i)+"if(cb){cb(null,tR)} return tR"+(i.useWith?"}":"");if(i.plugins)for(var n=0;n<i.plugins.length;n++){var r=i.plugins[n];r.processFnString&&(s=r.processFnString(s,i))}return s}function v(t,i){for(var e=0;e<i.length;e++){var s=i[e][0],n=i[e][1];t=(i[e][2]?"await ":"")+"c.l('F','"+s+"')("+t,n&&(t+=","+n),t+=")"}return t}function m(t,i,e,s,n,r){var a="{exec:"+(n?"async ":"")+y(e,i,t)+",params:["+s+"]";return r&&(a+=",name:'"+r+"'"),n&&(a+=",async:true"),a+="}"}function g(t,i){for(var e="[",s=0;s<t.length;s++){var n=t[s];e+=m(i,n.res||"",n.d,n.p||"",n.a,n.n),s<t.length&&(e+=",")}return e+="]"}function y(t,i,e){return"function("+i+"){var tR='';"+w(t,e)+"return tR}"}function w(t,i){for(var e=0,s=t.length,n="";e<s;e++){var r=t[e];if("string"==typeof r){n+="tR+='"+r+"';"}else{var a=r.t,h=r.c||"",o=r.f,l=r.n||"",u=r.p||"",f=r.res||"",c=r.b,d=!!r.a;if("i"===a){i.defaultFilter&&(h="c.l('F','"+i.defaultFilter+"')("+h+")");var p=v(h,o);!r.raw&&i.autoEscape&&(p="c.l('F','e')("+p+")"),n+="tR+="+p+";"}else if("h"===a)if(i.storage.nativeHelpers.get(l))n+=i.storage.nativeHelpers.get(l)(r,i);else{var y=(d?"await ":"")+"c.l('H','"+l+"')("+m(i,f,r.d,u,d);y+=c?","+g(c,i):",[]",n+="tR+="+v(y+=",c)",o)+";"}else"s"===a?n+="tR+="+v((d?"await ":"")+"c.l('H','"+l+"')({params:["+u+"]},[],c)",o)+";":"e"===a&&(n+=h+"\n")}}return n}var b=function(){function t(t){this.cache=t}return t.prototype.define=function(t,i){this.cache[t]=i},t.prototype.get=function(t){return this.cache[t]},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.reset=function(){this.cache={}},t.prototype.load=function(t){a(this.cache,t,!0)},t}();function x(t,e,s,n){if(e&&e.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept blocks");if(s&&s.length>0)throw i((n?"Native":"")+"Helper '"+t+"' doesn't accept filters")}var F={"&":"&","<":"<",">":">",'"':""","'":"'"};function C(t){return F[t]}var j=new b({}),I=new b({each:function(t,i){var e="",s=t.params[0];if(x("each",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r){s(i[e],e).then((function(a){n+=a,e===i.length-1?r(n):t(i,e+1,s,n,r)}))}(s,0,t.exec,e,i)}));for(var n=0;n<s.length;n++)e+=t.exec(s[n],n);return e},foreach:function(t,i){var e=t.params[0];if(x("foreach",i,!1),t.async)return new Promise((function(i){!function t(i,e,s,n,r,a){n(e[s],i[e[s]]).then((function(h){r+=h,s===e.length-1?a(r):t(i,e,s+1,n,r,a)}))}(e,Object.keys(e),0,t.exec,"",i)}));var s="";for(var n in e)r(e,n)&&(s+=t.exec(n,e[n]));return s},include:function(t,e,s){x("include",e,!1);var n=s.storage.templates.get(t.params[0]);if(!n)throw i('Could not fetch template "'+t.params[0]+'"');return n(t.params[1],s)},extends:function(t,e,s){var n=t.params[1]||{};n.content=t.exec();for(var r=0;r<e.length;r++){var a=e[r];n[a.name]=a.exec()}var h=s.storage.templates.get(t.params[0]);if(!h)throw i('Could not fetch template "'+t.params[0]+'"');return h(n,s)},useScope:function(t,i){return x("useScope",i,!1),t.exec(t.params[0])}}),S=new b({if:function(t,i){x("if",!1,t.f,!0);var e="if("+t.p+"){"+w(t.d,i)+"}";if(t.b)for(var s=0;s<t.b.length;s++){var n=t.b[s];"else"===n.n?e+="else{"+w(n.d,i)+"}":"elif"===n.n&&(e+="else if("+n.p+"){"+w(n.d,i)+"}")}return e},try:function(t,e){if(x("try",!1,t.f,!0),!t.b||1!==t.b.length||"catch"!==t.b[0].n)throw i("native helper 'try' only accepts 1 block, 'catch'");var s="try{"+w(t.d,e)+"}",n=t.b[0];return s+="catch"+(n.res?"("+n.res+")":"")+"{"+w(n.d,e)+"}"},block:function(t,i){return x("block",t.b,t.f,!0),"if(!"+i.varName+"["+t.p+"]){tR+=("+y(t.d,"",i)+")()}else{tR+="+i.varName+"["+t.p+"]}"}}),z=new b({e:function(t){var i=String(t);return/[&<>"']/.test(i)?i.replace(/[&<>"']/g,C):i}}),O={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(t,e){if("H"===t){var s=this.storage.helpers.get(e);if(s)return s;throw i("Can't find helper '"+e+"'")}if("F"===t){var n=this.storage.filters.get(e);if(n)return n;throw i("Can't find filter '"+e+"'")}},async:!1,storage:{helpers:I,nativeHelpers:S,filters:z,templates:j},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function R(t,i){var e={};return a(e,O),i&&a(e,i),t&&a(e,t),e.l.bind(e),e}function A(t,e){var s=R(e||{}),r=Function;if(s.async){if(!n)throw i("This environment doesn't support async/await");r=n}try{return new r(s.varName,"c","cb",p(t,s))}catch(e){throw e instanceof SyntaxError?i("Bad template syntax\n\n"+e.message+"\n"+Array(e.message.length+1).join("=")+"\n"+p(t,s)):e}}function k(t,i){var e;return i.cache&&i.name&&i.storage.templates.get(i.name)?i.storage.templates.get(i.name):(e="function"==typeof t?t:A(t,i),i.cache&&i.name&&i.storage.templates.define(i.name,e),e)}O.l.bind(O),t.compile=A,t.compileScope=w,t.compileScopeIntoFunction=y,t.compileToString=p,t.defaultConfig=O,t.filters=z,t.getConfig=R,t.helpers=I,t.nativeHelpers=S,t.parse=d,t.render=function(t,e,n,r){var a=R(n||{});if(!a.async)return k(t,a)(e,a);if(!r){if("function"==typeof s)return new s((function(i,s){try{i(k(t,a)(e,a))}catch(t){s(t)}}));throw i("Please provide a callback function, this env doesn't support Promises")}try{k(t,a)(e,a,r)}catch(t){return r(t)}},t.templates=j,Object.defineProperty(t,"__esModule",{value:!0})}))}));const x=f(b);const F=Object.freeze(Object.assign(Object.create(null),b,{default:x}));const C=F;C.filters.define("date_long",((t,i={year:"numeric",month:"long",day:"numeric"})=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=e.toLocaleDateString("en-GB",i);return t}));C.filters.define("date_short",((t,i="d/m/y")=>{if(!t)return;const e=new Date(parseInt(t)*1e3);t=i.replace(/(d)/,e.getDate().toString());t=t.replace(/(m)/,(e.getMonth()+1).toString());t=t.replace(/(y)/,e.getFullYear().toString());return t}));C.filters.define("public_name",(t=>{if(!t)return;t=t.split("_").map((t=>t.length<3?t.toUpperCase():t)).join(" ");return t.charAt(0).toUpperCase()+t.slice(1)}));C.filters.define("trim_to",((t,i=100)=>{if(!t)return;if(t.length<=i)return t;return t.substr(0,i)+"..."}));C.filters.define("classname",(t=>{if(!t)return;return t.replace(/[\W]+/g,"")}));C.filters.define("abs_url",((t,i=null,e)=>{if(!i)return t;if(!t)return;let s=undefined;if(i.domains&&e&&e.origin){const t=i.domains.find((t=>t.origin===e.origin));s=t?t.domain:""}else if(i.domain)s=i.domain;if(!s)return t;return t.match(/^http/)?t:location.protocol+"//"+s+t}));C.filters.define("replace",((t,i,e)=>t.replace(i,e)));C.filters.define("remove_spaces",(t=>t.replace(/ /g,"_")));C.filters.define("add_spaces",(t=>t=t.replace(/[_\-]/g," ")));C.filters.define("capitalise",(t=>t=t.charAt(0).toUpperCase()+t.slice(1)));C.filters.define("lowercase",(t=>t=t.toLowerCase()));const j=C;const I=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{position:relative;display:block}:host ::slotted([slot=search-template]){display:none !important}.loader{opacity:0;position:fixed;block-size:100%;inline-size:100%;min-block-size:100%;max-block-size:100vh !important;max-inline-size:100vw !important;inset-inline-start:0;inset-block-start:0;z-index:-10;font-size:60px;display:flex;align-items:center;justify-content:center;transition:opacity 0.2s ease, z-index 0.01s ease 0.2s}.loader.loading{opacity:1;z-index:10;transition:z-index 0.01s ease, opacity 0.2s ease 0.01s}.default{block-size:100%}.default:focus{outline:none}.results{opacity:0;outline:none;overflow:auto;transition:transform 0.3s ease, opacity 0.3s ease, visibility 0.01s ease 0.3s, z-index 0.01s ease 0.3s;transform:translate(0, 100px);visibility:hidden;z-index:-1;position:absolute;inset-block-start:0;inset-inline-start:0;display:none}.results-container{position:relative}.results.show{transition:z-index 0.01s ease, visibility 0.01s ease, transform 0.3s ease 0.01s, opacity 0.3s ease 0.01s, overflow 0.01s ease 0.31s;transform:translate(0, 0);visibility:visible;opacity:1;z-index:10;overflow:hidden}.results.shown{block-size:auto !important;inline-size:auto !important;display:block;position:static;transform:none;z-index:auto;visibility:inherit;opacity:initial;overflow:visible}";const S=class{constructor(t){e(this,t);this.nanoDidLoad=s(this,"nanoDidLoad",7);this.nanoResultsShown=s(this,"nanoResultsShown",3);this.nanoBeforeQuery=s(this,"nanoBeforeQuery",7);this.nanoAfterQuery=s(this,"nanoAfterQuery",7);this.nanoNewResults=s(this,"nanoNewResults",7);this.staticFacetFilters={};this.dynFacetFilters={};this.hasLoadSlot=false;this.placedAlgoliaEles=[];this.promiseQueue=new w;this.searchChange=async()=>{if(!this.algoliaIndex)return;if(!this.query||this.query.length<this.minChars){if(!this.browseIndex){if(!this.query||this.query.length===0){this.handleSearchReset();return}else return}else if(this.query!=="*"){this.query="*";return}}this.isLoading=true;setTimeout((async()=>{this.resetPage();await this.algoliaSearch(v.Init);await this.updateContent();setTimeout((t=>this.isLoading=false),800);this.showResults=true;this.nanoResultsShown.emit(this.indexResults)}),200)};this.makeAppliedFilters=()=>{const t=[];const i=i=>{Object.values(i).forEach((i=>{if(i.value&&i.value.length){const e=t.find((t=>t.name===i.facetName));if(!e)t.push({name:i.facetName,values:[...i.value]});else e.values=[...e.values,...i.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);if(t.length)return t;return null};this.algoliaSearch=async t=>this.promiseQueue.enqueue((()=>this.queueSearch(t)));this.queueSearch=async t=>{if(!this.algoliaIndex||!this.query||!this.searchIndex||!this.searchIndex.index)return;this.nanoBeforeQuery.emit(this.indexResults);if(v.Init===t)this.clearAllFacetFilters();const i={filters:this.algoliaFilterStr(),page:this.indexResults?this.indexResults.currentPage:0};if(this.searchIndex.filters)i.facets=this.searchIndex.filters;if(this.searchIndex.hitsPerPage)i.hitsPerPage=this.searchIndex.hitsPerPage;let e=await this.algoliaIndex.search(this.query,i);e=this.fixDomain(e);this.changeEvent=t;if(t===v.Init||!this.indexResults){this.indexResults={currentPage:0,totalHits:e.nbHits,hitsPerPage:null,origFilters:e.facets,query:this.query,domain:this.searchIndex.domain||null,totalHitsWithFilters:0,results:[],totalPages:0,appliedFilters:this.makeAppliedFilters(),indexName:this.searchIndex.name||null,index:this.searchIndex.index}}this.indexResults.dynFilters=e.facets;this.indexResults.results=e.hits;this.indexResults.totalHitsWithFilters=e.nbHits;this.indexResults.currentPage=e.page;this.indexResults.totalPages=e.nbPages;this.indexResults.hitsPerPage=e.hitsPerPage;this.indexResults.query=e.query;if(this.changeEvent!==v.Page&&this.changeEvent!==v.Replica){this.facets=e.facets}this.nanoAfterQuery.emit(this.indexResults);return new Promise((t=>{setTimeout((()=>t("tpl updated")),20)})).then((t=>{this.currentHits=this.indexResults.results;this.resultsPage=this.indexResults.currentPage}))};this.handleSearchReset=()=>{this.showResults=false;this.indexResults=null};this.onResultDisplay=()=>{n((()=>{this.resultsDiv.removeEventListener("transitionend",this.onResultDisplay);if(!this.showResults)this.resultsDiv.style.display="none";else{this.defaultDiv.style.display="none";this.resultsDiv.classList.add("shown");this.resultsDiv.style.minHeight="";this.resultsDiv.style.width=""}}))};this._dynFacetFilters={};this.inputField=undefined;this.algoliaIndex=undefined;this.indeces=[];this.resultsEmitterEle=undefined;this.indexResults=undefined;this.filterChanged="";this.currentHits=undefined;this.changeEvent=v.Init;this.isLoading=false;this.wormholeState=this;this.showResults=false;this.resultsPage=0;this.appId=undefined;this.apiKey=undefined;this.searchIndex={};this.searchIndexName="";this.listenTo=null;this.query="";this.operator="and";this.filters=[];this.tplEngine=j;this.tplRenderFn=j.render;this.replicaIndex="";this.browseIndex=false;this.minChars=2;this.storeId=undefined;this.storeMethod="session"}async removeFilters(t,i){if(!t&&!i)this.clearAllFacetFilters();else{Object.keys(this._dynFacetFilters).forEach((e=>{if(t&&this._dynFacetFilters[e].facetName===t){if(!i)this._dynFacetFilters[e].element.value="";else{this._dynFacetFilters[e].element.value=this._dynFacetFilters[e].value.filter((t=>t!==i))}}}))}}onAllTplUpdate(t){t.stopPropagation();if(t.target.tagName==="NANO-ALGOLIA-RESULTS"){requestAnimationFrame((()=>{this.nanoNewResults.emit(this.indexResults)}))}}async onPageChange(t){if(!this.indexResults)return;let i=this.resultsPage;if(t){t.stopPropagation();i=t.detail.page}i=Math.min(this.indexResults.totalPages-1,i);i=Math.max(i,0);if(this.indexResults.currentPage===i)return;this.indexResults.currentPage=i;await this.algoliaSearch(v.Page)}async onFilterChange(t){t.stopPropagation();const i={};const e=t.detail;e.element=t.target;if(this.indexResults){if(this.staticFacetFilters[e.filterId])this.staticFacetFilters[e.filterId]=e;else{i[e.filterId]=e;this._dynFacetFilters=Object.assign(Object.assign({},this._dynFacetFilters),i)}this.indexResults.appliedFilters=this.makeAppliedFilters()}else this.staticFacetFilters[e.filterId]=e;this.filterChanged=e.value&&e.value.length?e.filterId:"all";this.resetPage();this.algoliaSearch(v.Filter)}dynFacetFiltersChange(){Object.values(this._dynFacetFilters).forEach((t=>{if(this.host.ownerDocument===t.element.ownerDocument)this.dynFacetFilters[t.filterId]=t;else delete this.dynFacetFilters[t.filterId]}))}browseIndexChange(){if(this.browseIndex&&(!this.query||this.query.length<this.minChars)){this.query="*"}}inputFieldSet(){if(!this.inputField)return;if(this.query!=="*"&&this.inputField&&this.inputField.value!==this.query)this.inputField.value=this.query}queryChange(){this.searchChange()}async internalIndexSwitch(){if(!this.replicaIndex||!this.indexResults||this.indexResults.index===this.replicaIndex)return;this.indexResults.index=this.replicaIndex;this.algoliaIndex=this.algoliaClient.initIndex(this.indexResults.index);this.resetPage();this.algoliaSearch(v.Replica)}pageChange(){this.onPageChange()}searchIndexNameChange(){if(!this.searchIndexName||!this.searchIndexName.length||this.searchIndex&&this.searchIndex.index===this.searchIndexName)return;this.searchIndex={index:this.searchIndexName}}initAlgoliaClient(){if(!this.appId||!this.apiKey)return;this.algoliaClient=o(this.appId,this.apiKey)}initAlgoliaIndex(){if(!this.algoliaClient||!this.searchIndex)return;if(this.searchIndex.index){if(this.replicaIndex)this.searchIndex.index=this.replicaIndex;this.searchIndexName=this.searchIndex.index;this.algoliaIndex=this.algoliaClient.initIndex(this.searchIndex.index);this.searchChange()}}showResultsChange(){if(!this.resultsDiv||!this.defaultDiv)return;if(this.showResults){this.resultsDiv.style.width=this.host.scrollWidth+"px";this.resultsDiv.style.minHeight=this.host.scrollHeight+"px";n((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.style.display="block";setTimeout((()=>this.resultsDiv.classList.add("show")),50)}))}else{n((()=>{this.resultsDiv.classList.remove("shown");this.defaultDiv.style.display="block";setTimeout((()=>{this.resultsDiv.addEventListener("transitionend",this.onResultDisplay);this.resultsDiv.classList.remove("show");if(!!this.slottedInput)this.slottedInput.focus({preventScroll:true});else this.defaultDiv.focus({preventScroll:true})}),50)}))}}handleFilterpropChange(){this.algoliaSearch(v.Init)}fixDomain(t){if(!this.searchIndex||!this.searchIndex.domain)return t;t.hits.map((t=>{if(t.url&&!t.url.match(/^http/))t.url=location.protocol+"//"+this.searchIndex.domain+t.url}));return t}resetPage(){if(!this.indexResults)return;this.indexResults.currentPage=0}clearAllFacetFilters(){Object.values(this._dynFacetFilters).forEach((t=>{t.element.value=""}));this._dynFacetFilters={}}algoliaFilterStr(){const t={};const i=i=>{let e;let s;Object.keys(i).forEach((n=>{e=i[n];t[n]=t[n]||{name:e.facetName,or:[],and:[],not:[]};s=t[n][e.operator];if(e.value&&e.value.length){t[n][e.operator]=[...s,...e.value]}}))};i(this.dynFacetFilters);i(this.staticFacetFilters);const e=(t,i)=>{if(i.indexOf(" ")>-1)return t+':"'+i+'"';else return t+":"+i};let s=[];let n;let r;Object.values(t).forEach((function(t){Object.keys(t).filter((t=>t.match(/(or|and|not)/))).forEach((i=>{n=t;r=t.name;if(i==="or"||i==="and"){if(n[i].length){s.push("( "+n[i].map((t=>{if(t.length)return e(r,t)})).join(" "+i.toLocaleUpperCase()+" ")+" )")}}else{if(n.not.length){s.push("( "+n[i].map((t=>{if(t.length)return"NOT "+e(r,t)})).join(" AND ")+" )")}}}))}));s=[...this.filters,...s];return s.join(" "+this.operator.toLocaleUpperCase()+" ")}handleInputChange(t){if(t.target!==this.inputField)return;this.query=this.inputField.value}async updateContent(){return this.promiseQueue.enqueue((()=>this.updateContentQueue()))}async updateContentQueue(){const t=this.outputSlot||this.resultsDiv;if(!t||!this.tpl)return"no tpl";const i=document.createElement("div");i.innerHTML=this.tpl;const e=[];this.placedAlgoliaEles=[];Array.from(i.querySelectorAll("nano-algolia, nano-algolia-filter, nano-algolia-results")).forEach(((t,i)=>{const s=document.createElement("div");s.dataset.placeholderId=i.toString();s.classList.add("nano-ele-placeholder");e.push(t);t.parentNode.replaceChild(s,t)}));t.innerHTML=this.tplRenderFn(i.innerHTML.replace(/>/gm,">").replace(/</gm,"<").replace(/&/gm,"&"),this.indexResults);Array.from(t.querySelectorAll("div.nano-ele-placeholder")).forEach((t=>{t.parentNode.replaceChild(e[parseInt(t.dataset.placeholderId)],t);this.placedAlgoliaEles.push(e[parseInt(t.dataset.placeholderId)])}));if(!this.placedAlgoliaEles.length)return Promise.resolve("algolia setup");return new Promise((i=>{const e=s=>{this.placedAlgoliaEles=this.placedAlgoliaEles.filter((t=>t!==s.detail));if(!this.placedAlgoliaEles.length){setTimeout((()=>i("tpl updated")),500);t.removeEventListener("nanoTplUpdated",e)}};t.addEventListener("nanoTplUpdated",e)}))}componentWillLoad(){r((t=>{this.tplSlot=l(this.host,'[slot="template"]')[0];this.outputSlot=l(this.host,'[slot="output"]')[0];this.slottedInput=l(this.host,'[slot="search-input"]')[0];this.hasLoadSlot=!!l(this.host,'[slot="loader"]')[0];if(!!this.tplSlot)this.tpl=this.tplSlot.innerHTML||this.tplSlot.innerText;if(this.slottedInput&&(this.slottedInput.tagName.toLocaleLowerCase()==="nano-input"||this.slottedInput instanceof HTMLInputElement)){this.inputField=this.slottedInput}else if(this.slottedInput){this.inputField=this.slottedInput.querySelector('nano-input, input:not([type="radio"]):not([type="checkbox"])')}n((t=>{if(this.showResults&&this.tpl)this.searchChange()}))}));this.searchIndexNameChange();this.initAlgoliaClient();this.initAlgoliaIndex();y.create(this,this.wormholeState);if(this.storeId){u.init(this,["query","replicaIndex"],this.storeMethod,this.storeId);u.init(this,["apiKey","appId","searchIndex"],"session",this.storeId+"_api")}this.internalIndexSwitch()}connectedCallback(){this.searchChange=p(this.searchChange,300);this.browseIndexChange();this.host.dispatchEvent(new CustomEvent("nanoDidLoad",{detail:this.host}))}render(){const t={indexResults:this.indexResults,results:this.currentHits,filterChanged:this.filterChanged,tplRenderFn:this.tplRenderFn,resultsPage:this.resultsPage,changeEvent:this.changeEvent,facets:this.facets,algoliaIndex:this.algoliaIndex,searchIndex:this.searchIndex,globalStoreMethod:this.storeMethod,isLoading:this.isLoading};return a(h,{class:{"show-results":this.showResults,"is-loading":this.isLoading},"aria-busy":this.isLoading},this.hasLoadSlot&&a("div",{hidden:!this.isLoading},a("slot",{name:"loader"})),!this.hasLoadSlot&&a("div",{class:{loader:true,loading:this.isLoading}},a("nano-spinner",{overlay:true,type:"circle"})),a(y.Provider,{state:t},a("slot",{name:"search-input"}),a("div",{class:"results-container","aria-live":"polite"},a("div",{ref:t=>this.resultsDiv=t,class:"results"},a("slot",{name:"output"})))),a("div",{ref:t=>this.defaultDiv=t,class:"default",tabindex:"-1"},a("slot",null)))}get host(){return t(this)}static get watchers(){return{_dynFacetFilters:["dynFacetFiltersChange"],browseIndex:["browseIndexChange"],inputField:["inputFieldSet"],query:["queryChange"],replicaIndex:["internalIndexSwitch"],resultsPage:["pageChange"],searchIndexName:["searchIndexNameChange"],apiKey:["initAlgoliaClient"],appId:["initAlgoliaClient"],searchIndex:["initAlgoliaIndex"],showResults:["showResultsChange"],filters:["handleFilterpropChange"]}}};S.style=I;export{S as nano_algolia};
|
5
|
+
//# sourceMappingURL=p-a1c0afb6.entry.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as t,c as a,h as o,a as n,g as i}from"./p-6ef53fa1.js";import{g as s,a as r}from"./p-257432ff.js";import{f as e}from"./p-f8f89998.js";import{s as h}from"./p-45b7682a.js";import{C as l}from"./p-9d1432be.js";import{c as d}from"./p-411bb8f1.js";import{d as c}from"./p-167b9165.js";import"./p-9746b0a5.js";import"./p-69a3e911.js";const b=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--indicator-transition:var(--nano-transition-fast, 0.3s);--indicator-color:#90c6e7;--indicator-track-color:#e4e6e8;--indicator-size:0;--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--background-rgb:var(--nano-layer-bg-rgb, 255 255 255);--scroll-btn-color:"currentColor";--content-padding:2rem 2.5rem;--content-bg:rgb(var(--background-rgb));--content-border-radius:var(--border-radius);--tabs-padding-start:2.5rem;--tabs-padding-end:2.5rem;--tabs-padding-top:0;--tabs-padding-bottom:0;--tabs-container-bg:"transparent";--tabs-bg-rgb:var(--background-rgb);--tab-border-radius:var(--border-radius);--tab-text-color:#007495;--shadow-opacity:0.1;--fade-transparency:0;display:block;position:relative;z-index:var(--nano-layer-index-raised, 5)}@media only screen and (max-width: 768px){:host{--tabs-padding-start:1.5rem;--tabs-padding-end:1.5rem}}:host ::slotted(nano-tab){--tab-indicator-color:var(--indicator-color);--bg-rgb:var(--tabs-bg-rgb);--border-radius:var(--tab-border-radius)}:host([placement=start]),:host([placement=end]){--content-padding:1rem;--tabs-padding-start:0;--tabs-padding-end:0;--tabs-padding-top:0;--tabs-padding-bottom:0;--tab-text-color:#455556;--indicator-color:#007495;--indicator-size:2px}:host(.nano-color){--indicator-color:var(--nano-color-tint, var(--nano-color-primary-tint, #2689a5));--tab-text-color:rgb(var(--nano-color-base-rgb) / 70%)}:host(.nano-color) ::slotted(nano-tab){--active-text-color:var(--nano-color-shade, var(--nano-color-primary-shade, #00637f))}.nano-tab-group{display:flex;border-radius:0;width:100%;flex:inherit}.nano-tab-group__tabs{display:flex;position:relative;width:100%}.nano-tab-group__active-tab-indicator{position:absolute;transition:var(--indicator-transition) transform ease, var(--indicator-transition) width ease}.nano-tab-group__body{background:var(--content-bg)}.nano-tab-group:not(.focus-visible) ::slotted(nano-tab){--focus-shadow:none}.nano-tab-group .nano-tab-group__nav-container{position:relative;display:flex;background:var(--tabs-container-bg)}.nano-tab-group button{-webkit-appearance:none;appearance:none;background-color:transparent}.nano-tab-group__scroll-button{display:flex;align-items:center;justify-content:center;position:absolute;inset-block:0;border:unset;z-index:2;transition:var(--nano-transition-fast, 0.3s) ease opacity;opacity:0;color:var(--scroll-btn-color)}.nano-tab-group__scroll-button:focus{outline:none}.nano-tab-group__scroll-button.is-shown{opacity:1}.nano-tab-group__scroll-button.focus-visible:focus{box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))) inset}.nano-tab-group__scroll-button--left{inset-inline-start:0}.nano-tab-group__scroll-button--right{inset-inline-end:0}.nano-tab-group__scroll-button nano-icon{font-size:16px}.nano-tab-group--top{flex-direction:column}.nano-tab-group--top .nano-tab-group__nav-container::after{content:"";width:86%;box-shadow:0 10px 40px 10px rgb(0 0 0/var(--shadow-opacity));height:10px;position:absolute;inset-inline-start:7%;inset-block-end:-10px;border-radius:10px;z-index:-1}.nano-tab-group--top .nano-tab-group__nav{scrollbar-width:none;-ms-overflow-style:none;padding-inline:var(--tabs-padding-start) var(--tabs-padding-end);padding-block:var(--tabs-padding-top) var(--tabs-padding-bottom);display:flex;overflow-x:auto;overflow-y:hidden;transition:var(--nano-transition-medium, 0.5s) ease;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--tabs-padding-start), black calc(var(--tabs-padding-start) * 2), black calc(100% - var(--tabs-padding-end) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--tabs-padding-end)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--tabs-padding-start), black calc(var(--tabs-padding-start) * 2), black calc(100% - var(--tabs-padding-end) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--tabs-padding-end)), rgb(0 0 0/var(--fade-transparency)));-webkit-mask-size:calc(100% + var(--tabs-padding-end) * 4);mask-size:calc(100% + var(--tabs-padding-end) * 4);-webkit-mask-position:calc(var(--tabs-padding-end) * -2);mask-position:calc(var(--tabs-padding-end) * -2)}.nano-tab-group--top .nano-tab-group__nav::-webkit-scrollbar{inline-size:0;block-size:0}.nano-tab-group--top .nano-tab-group__nav::after{content:" ";padding-inline:0 var(--tabs-padding-end);padding-block:var(--tabs-padding-top) var(--tabs-padding-bottom);line-height:1;flex:0 0 auto}.nano-tab-group--top.nano-tab-group--has-scroll-controls-left .nano-tab-group__nav{-webkit-mask-position:0;mask-position:0;-webkit-mask-size:calc(100% + var(--tabs-padding-end) * 2);mask-size:calc(100% + var(--tabs-padding-end) * 2)}.nano-tab-group--top.nano-tab-group--has-scroll-controls-right .nano-tab-group__nav{-webkit-mask-position:calc(var(--tabs-padding-end) * -1);mask-position:calc(var(--tabs-padding-end) * -1);-webkit-mask-size:calc(100% + var(--tabs-padding-end));mask-size:calc(100% + var(--tabs-padding-end))}.nano-tab-group--top.nano-tab-group--has-scroll-controls-left.nano-tab-group--has-scroll-controls-right .nano-tab-group__nav{-webkit-mask-size:100%;mask-size:100%;-webkit-mask-position:0;mask-position:0}.nano-tab-group--top .nano-tab-group__tabs{flex:1 1 auto;position:relative;flex-direction:row;text-align:center;color:var(--tab-text-color);width:auto}.nano-tab-group--top .nano-tab-group__active-tab-indicator{inset-block-end:-2px;-webkit-border-after:solid var(--indicator-size) var(--indicator-color);border-block-end:solid var(--indicator-size) var(--indicator-color)}.nano-tab-group--top .nano-tab-group__body{order:2;background:var(--content-bg);position:relative;overflow:hidden;width:auto;display:flex;justify-content:center;padding:var(--content-padding);border-radius:var(--content-border-radius);flex:1 1 auto}.nano-tab-group--start{flex-direction:row}.nano-tab-group--start .nano-tab-group__tabs{flex:0 0 auto;flex-direction:column;color:var(--tab-text-color);background:rgb(var(--tabs-bg-rgb));-webkit-border-start:solid var(--indicator-size) var(--indicator-track-color);border-inline-start:solid var(--indicator-size) var(--indicator-track-color);text-align:start}.nano-tab-group--start .nano-tab-group__active-tab-indicator{inset-inline-start:-2px;-webkit-border-start:solid var(--indicator-size) var(--indicator-color);border-inline-start:solid var(--indicator-size) var(--indicator-color)}.nano-tab-group--start .nano-tab-group__body{flex:1 1 auto;order:2;padding:var(--content-padding);overflow:hidden;border-start-start-radius:0;border-start-end-radius:var(--content-border-radius);border-end-end-radius:var(--content-border-radius);border-end-start-radius:0}';const p=class{constructor(o){t(this,o);this.nanoTabShow=a(this,"nanoTabShow",7);this.nanoTabHide=a(this,"nanoTabHide",7);this.nanoTabWillClose=a(this,"nanoTabWillClose",7);this.nanoTabClose=a(this,"nanoTabClose",7);this.initialTouchX=null;this.initialTouchY=null;this.mutationObservers=new WeakMap;this.updateScrollControls=()=>{if(this.noScrollControls){this.hasScrollControls=false}else{this.hasScrollControls=["top"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth&&this.nav.scrollWidth>this.tabs.clientWidth}};this.handleClick=t=>{const a=t.target;const o=a.closest("nano-tab");if(o)this.setActiveTab(o)};this.handleKeyDown=t=>{if(["Enter"," "].includes(t.key)){const a=t.target;const o=a.closest("nano-tab");if(o){this.setActiveTab(o);t.preventDefault()}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const a=document.activeElement;if(a&&a.tagName.toLowerCase()==="nano-tab"){const o=this.getAllActiveTabs;let n=o.indexOf(a);if(t.key==="Home"){n=0}else if(t.key==="End"){n=o.length-1}else if(this.isRtl&&t.key==="ArrowRight"||!this.isRtl&&t.key==="ArrowLeft"){n=Math.max(0,n-1)}else if(this.isRtl&&t.key==="ArrowLeft"||!this.isRtl&&t.key==="ArrowRight"){n=Math.min(o.length-1,n+1)}o[n].setFocus();if(["top"].includes(this.placement)){h(o[n],this.nav,"horizontal","center")}t.stopPropagation();t.preventDefault()}}};this.handleTabScroll=()=>{if(!this.hasScrollControls){this.hideControlLeft=this.hideControlRight=true;return}const t=this.isRtl?this.nav.scrollLeft===0:this.nav.scrollWidth-this.nav.scrollLeft===this.nav.clientWidth;const a=this.isRtl?this.nav.scrollWidth+this.nav.scrollLeft===this.nav.clientWidth:this.nav.scrollLeft===0;if(a){this.hideControlLeft=true;this.hideControlRight=false}else if(t){this.hideControlLeft=false;this.hideControlRight=true}else{this.hideControlRight=false;this.hideControlLeft=false}};this.handleBtnClick=(t=false)=>{const a=this.getNavWidth();let o;if(t)o=this.nav.scrollLeft+a-20;else o=this.nav.scrollLeft-a+20;try{this.nav.scroll({left:o,behavior:"smooth"})}catch(t){this.nav.scrollLeft=o}};this.handleTouchStart=t=>{if(this.disableSwipe)return;const a=t.changedTouches[0];this.initialTouchX=a.pageX;this.initialTouchY=a.pageY};this.handleTouchEnd=t=>{if(this.disableSwipe)return;const a=t.changedTouches[0];const o=a.pageX-this.initialTouchX;const n=a.pageY-this.initialTouchY;const i=70;const s=this.initialTouchX-a.clientX;const r=this.initialTouchY-a.clientY;const e=Math.abs(o)>=i&&Math.abs(n)<=i;const h=this.getAllActiveTabs;const l=h.findIndex((t=>t.active));if(e){const t=o<0&&this.placement==="top"||o>0&&this.placement!=="top"?1:-1;if(h[l+t]){this.setActiveTab(h[l+t]);if(Math.abs(s)>Math.abs(r)){if(s>0)this.activePanel.setAttribute("animation-dir","left");else this.activePanel.setAttribute("animation-dir","right")}}}this.initialTouchX=null;this.initialTouchY=null};this.handleContentSlotChange=()=>{setTimeout((()=>{this.setAriaLabels();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false)}))};this.handleTabSlotChange=t=>{setTimeout((()=>{this.setAriaLabels();this.handleTabScroll();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false);this.updateScrollControls()}),500);const a=t.target.assignedElements({flatten:true});a.forEach((t=>{if(!this.mutationObservers.get(t)){const a=new MutationObserver((()=>{setTimeout((()=>{this.syncActiveTabIndicator();this.handleTabScroll();this.updateScrollControls()}),500)}));this.mutationObservers.set(t,a);a.observe(t,{characterData:true,childList:true,subtree:true})}}))};this.hasScrollControls=false;this.hideControlRight=true;this.hideControlLeft=true;this.tab=undefined;this.placement="top";this.noScrollControls=false;this.color=undefined;this.storeId=undefined;this.storeMethod="session";this.disableSwipe=undefined}handleTabNameChange(){if(this.activeTab&&this.activeTab.panel===this.tab)return;const t=this.getAllActiveTabs.find((t=>t.panel===this.tab));this.setActiveTab(t)}handlePlacementChange(){this.syncActiveTabIndicator()}handleNoScrollControlsChange(){this.updateScrollControls()}hideRightBtn(){if(!this.rightBtn)return;c(this.rightBtn,"is-shown",!this.hideControlRight)}hideLeftBtn(){if(!this.leftBtn)return;c(this.leftBtn,"is-shown",!this.hideControlLeft)}watchScrollControls(){if(this.hasScrollControls)setTimeout((t=>this.handleTabScroll()),20);else setTimeout((t=>{this.hideControlLeft=this.hideControlRight=true}),20)}async show(t){if(this.activeTab&&this.activeTab.panel===t)return;const a=this.getAllActiveTabs.find((a=>a.panel===t));if(a)this.setActiveTab(a)}get getAllActiveTabs(){return this.getAllTabs.filter((t=>!t.disabled))}get getAllTabs(){return s(this.host,"nano-tab")}get getAllPanels(){return s(this.host,"nano-tab-content")}get getActiveTab(){return this.getAllActiveTabs.find((t=>t.active))}setActiveTab(t,a=true){if(t&&t!==this.activeTab&&!t.disabled&&this.getAllActiveTabs.includes(t)){const o=this.activeTab;this.activeTab=t;this.tab=t.panel;this.getAllActiveTabs.map((t=>t.active=t===this.activeTab));this.getAllPanels.map((t=>{if(t.name===this.activeTab.panel){t.active=true;this.activePanel=t}else t.active=false;t.removeAttribute("animation-dir")}));this.syncActiveTabIndicator();if(this.nav&&["top"].includes(this.placement)){h(this.activeTab,this.nav,"horizontal","center")}if(a){if(o){this.nanoTabHide.emit({name:o.panel})}this.nanoTabShow.emit({name:this.activeTab.panel})}}}setAriaLabels(){const t=this.getAllActiveTabs;const a=this.getAllPanels;t.map((t=>{const o=a.find((a=>a.name===t.panel));if(o){t.setAttribute("aria-controls",o.getAttribute("id"));o.setAttribute("aria-labelledby",t.getAttribute("id"))}}))}syncActiveTabIndicator(){var t;this.getAllTabs.forEach((t=>t.setAttribute("direction",this.placement==="top"?"horizontal":"vertical")));const a=this.getActiveTab;const o=((t=a.shadowRoot.querySelector(".nanotab"))===null||t===void 0?void 0:t.clientWidth)||0;const n=a.clientHeight;const i=r(a,this.tabs);if(!this.activeTabIndicator)return;const s=i.top+this.nav.scrollTop;const e=i.left;switch(this.placement){case"top":this.activeTabIndicator.style.width=`${o}px`;this.activeTabIndicator.style.height=null;this.activeTabIndicator.style.transform=`translateX(${e}px)`;break;case"start":this.activeTabIndicator.style.width=null;this.activeTabIndicator.style.height=`${n}px`;this.activeTabIndicator.style.transform=`translateY(${s}px)`;break}}getNavWidth(){if(!this.nav)return 0;const t=getComputedStyle(this.nav);let a=this.nav.clientWidth;return a-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)}handleTabClose(t){var a;let o=this.getAllActiveTabs.indexOf(t.target);const n=t.target;if(o<0)return;const i=this.getAllPanels.find((t=>t.name===n.panel));if(!i)return;t.stopImmediatePropagation();const s=this.nanoTabWillClose.emit({name:n.panel});if(s.defaultPrevented)return;if(n.active){o=o===0?1:o-1;const t=(a=this.getAllActiveTabs[o])===null||a===void 0?void 0:a.panel;if(t)this.host.show(t)}n.remove();i.remove();this.nanoTabClose.emit({name:n.panel})}componentDidLoad(){const t=new IntersectionObserver(((t,a)=>{if(t[0].intersectionRatio>0){this.setAriaLabels();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false);if(this.storeId)l.init(this,["tab"],this.storeMethod,this.storeId);a.unobserve(t[0].target)}}));t.observe(this.host);e.observe(this.tabGroup);if(this.leftBtn){e.observe(this.leftBtn);e.observe(this.rightBtn)}requestAnimationFrame((()=>this.updateScrollControls()));if(!window["ResizeObserver"])return;this.resizeObserver=new ResizeObserver((()=>{setTimeout((()=>{this.updateScrollControls();this.syncActiveTabIndicator();h(this.activeTab,this.nav,"horizontal","center")}),500)}));this.resizeObserver.observe(this.nav)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl"}disconnectedCallback(){e.unobserve(this.tabGroup);if(this.leftBtn){e.unobserve(this.leftBtn);e.unobserve(this.rightBtn)}if(this.resizeObserver)this.resizeObserver.unobserve(this.nav)}render(){this.isRtl=this.host.ownerDocument.dir==="rtl";return o(n,{class:Object.assign({},d(this.color)),dir:this.isRtl?"rtl":null},o("div",{part:"base",ref:t=>this.tabGroup=t,class:{"nano-tab-group":true,"nano-tab-group--top":this.placement==="top","nano-tab-group--start":this.placement==="start","nano-tab-group--has-scroll-controls":this.hasScrollControls,"nano-tab-group--has-scroll-controls-left":!this.hideControlLeft,"nano-tab-group--has-scroll-controls-right":!this.hideControlRight},onClick:this.handleClick,onKeyDown:this.handleKeyDown},o("div",{class:"nano-tab-group__nav-container",part:"nav"},this.placement==="top"&&o("button",{class:{"nano-tab-group__scroll-button":true,"nano-tab-group__scroll-button--left":true},ref:t=>this.leftBtn=t,onClick:()=>this.handleBtnClick(false)},o("nano-icon",{name:"light/chevron-left"})),o("div",{ref:t=>this.nav=t,class:"nano-tab-group__nav",onScroll:this.handleTabScroll},o("div",{ref:t=>this.tabs=t,part:"tabs",class:"nano-tab-group__tabs",role:"tablist"},o("div",{ref:t=>this.activeTabIndicator=t,part:"active-tab-indicator",class:"nano-tab-group__active-tab-indicator"}),o("slot",{name:"tabs",onSlotchange:this.handleTabSlotChange}))),this.placement==="top"&&o("button",{class:{"nano-tab-group__scroll-button":true,"nano-tab-group__scroll-button--right":true},ref:t=>this.rightBtn=t,onClick:()=>this.handleBtnClick(true)},o("nano-icon",{name:"light/chevron-right"}))),o("slot",{name:"tab-content-header"}),o("div",{part:"body",class:"nano-tab-group__body",onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},o("slot",{onSlotchange:this.handleContentSlotChange}))))}get host(){return i(this)}static get watchers(){return{tab:["handleTabNameChange"],placement:["handlePlacementChange"],noScrollControls:["handleNoScrollControlsChange"],hideControlRight:["hideRightBtn"],hideControlLeft:["hideLeftBtn"],hasScrollControls:["watchScrollControls"]}}};p.style=b;export{p as nano_tab_group};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{r as t,c as a,h as o,a as n,g as i}from"./p-f6a8467a.js";import{g as s,a as r}from"./p-257432ff.js";import{f as e}from"./p-f8f89998.js";import{s as h}from"./p-d7c34990.js";import{C as d}from"./p-a6ff5ca6.js";import{c as l}from"./p-411bb8f1.js";import{d as c}from"./p-f6de2d5d.js";import"./p-9746b0a5.js";import"./p-69a3e911.js";const b=':host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--indicator-transition:var(--nano-transition-fast, 0.3s);--indicator-color:#90c6e7;--indicator-track-color:#e4e6e8;--indicator-size:0;--border-radius:var(--nano-layer-border-radius, var(--nano-border-radius-medium, 4px));--background-rgb:var(--nano-layer-bg-rgb, 255 255 255);--scroll-btn-color:"currentColor";--content-padding:2rem 2.5rem;--content-bg:rgb(var(--background-rgb));--content-border-radius:var(--border-radius);--tabs-padding-start:2.5rem;--tabs-padding-end:2.5rem;--tabs-padding-top:0;--tabs-padding-bottom:0;--tabs-container-bg:"transparent";--tabs-bg-rgb:var(--background-rgb);--tab-border-radius:var(--border-radius);--tab-text-color:#007495;--shadow-opacity:0.1;--fade-transparency:0;display:block;position:relative;z-index:var(--nano-layer-index-raised, 5)}@media only screen and (max-width: 768px){:host{--tabs-padding-start:1.5rem;--tabs-padding-end:1.5rem}}:host ::slotted(nano-tab){--tab-indicator-color:var(--indicator-color);--bg-rgb:var(--tabs-bg-rgb);--border-radius:var(--tab-border-radius)}:host([placement=start]),:host([placement=end]){--content-padding:1rem;--tabs-padding-start:0;--tabs-padding-end:0;--tabs-padding-top:0;--tabs-padding-bottom:0;--tab-text-color:#455556;--indicator-color:#007495;--indicator-size:2px}:host(.nano-color){--indicator-color:var(--nano-color-tint, var(--nano-color-primary-tint, #2689a5));--tab-text-color:rgb(var(--nano-color-base-rgb) / 70%)}:host(.nano-color) ::slotted(nano-tab){--active-text-color:var(--nano-color-shade, var(--nano-color-primary-shade, #00637f))}.nano-tab-group{display:flex;border-radius:0;width:100%;flex:inherit}.nano-tab-group__tabs{display:flex;position:relative;width:100%}.nano-tab-group__active-tab-indicator{position:absolute;transition:var(--indicator-transition) transform ease, var(--indicator-transition) width ease}.nano-tab-group__body{background:var(--content-bg)}.nano-tab-group:not(.focus-visible) ::slotted(nano-tab){--focus-shadow:none}.nano-tab-group .nano-tab-group__nav-container{position:relative;display:flex;background:var(--tabs-container-bg)}.nano-tab-group button{-webkit-appearance:none;appearance:none;background-color:transparent}.nano-tab-group__scroll-button{display:flex;align-items:center;justify-content:center;position:absolute;inset-block:0;border:unset;z-index:2;transition:var(--nano-transition-fast, 0.3s) ease opacity;opacity:0;color:var(--scroll-btn-color)}.nano-tab-group__scroll-button:focus{outline:none}.nano-tab-group__scroll-button.is-shown{opacity:1}.nano-tab-group__scroll-button.focus-visible:focus{box-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8))) inset}.nano-tab-group__scroll-button--left{inset-inline-start:0}.nano-tab-group__scroll-button--right{inset-inline-end:0}.nano-tab-group__scroll-button nano-icon{font-size:16px}.nano-tab-group--top{flex-direction:column}.nano-tab-group--top .nano-tab-group__nav-container::after{content:"";width:86%;box-shadow:0 10px 40px 10px rgb(0 0 0/var(--shadow-opacity));height:10px;position:absolute;inset-inline-start:7%;inset-block-end:-10px;border-radius:10px;z-index:-1}.nano-tab-group--top .nano-tab-group__nav{scrollbar-width:none;-ms-overflow-style:none;padding-inline:var(--tabs-padding-start) var(--tabs-padding-end);padding-block:var(--tabs-padding-top) var(--tabs-padding-bottom);display:flex;overflow-x:auto;overflow-y:hidden;transition:var(--nano-transition-medium, 0.5s) ease;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=");-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--tabs-padding-start), black calc(var(--tabs-padding-start) * 2), black calc(100% - var(--tabs-padding-end) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--tabs-padding-end)), rgb(0 0 0/var(--fade-transparency)));mask-image:linear-gradient(to left, rgb(0 0 0/var(--fade-transparency)) 0, rgb(0 0 0/var(--fade-transparency)) var(--tabs-padding-start), black calc(var(--tabs-padding-start) * 2), black calc(100% - var(--tabs-padding-end) * 2), rgb(0 0 0/var(--fade-transparency)) calc(100% - var(--tabs-padding-end)), rgb(0 0 0/var(--fade-transparency)));-webkit-mask-size:calc(100% + var(--tabs-padding-end) * 4);mask-size:calc(100% + var(--tabs-padding-end) * 4);-webkit-mask-position:calc(var(--tabs-padding-end) * -2);mask-position:calc(var(--tabs-padding-end) * -2)}.nano-tab-group--top .nano-tab-group__nav::-webkit-scrollbar{inline-size:0;block-size:0}.nano-tab-group--top .nano-tab-group__nav::after{content:" ";padding-inline:0 var(--tabs-padding-end);padding-block:var(--tabs-padding-top) var(--tabs-padding-bottom);line-height:1;flex:0 0 auto}.nano-tab-group--top.nano-tab-group--has-scroll-controls-left .nano-tab-group__nav{-webkit-mask-position:0;mask-position:0;-webkit-mask-size:calc(100% + var(--tabs-padding-end) * 2);mask-size:calc(100% + var(--tabs-padding-end) * 2)}.nano-tab-group--top.nano-tab-group--has-scroll-controls-right .nano-tab-group__nav{-webkit-mask-position:calc(var(--tabs-padding-end) * -1);mask-position:calc(var(--tabs-padding-end) * -1);-webkit-mask-size:calc(100% + var(--tabs-padding-end));mask-size:calc(100% + var(--tabs-padding-end))}.nano-tab-group--top.nano-tab-group--has-scroll-controls-left.nano-tab-group--has-scroll-controls-right .nano-tab-group__nav{-webkit-mask-size:100%;mask-size:100%;-webkit-mask-position:0;mask-position:0}.nano-tab-group--top .nano-tab-group__tabs{flex:1 1 auto;position:relative;flex-direction:row;text-align:center;color:var(--tab-text-color);width:auto}.nano-tab-group--top .nano-tab-group__active-tab-indicator{inset-block-end:-2px;-webkit-border-after:solid var(--indicator-size) var(--indicator-color);border-block-end:solid var(--indicator-size) var(--indicator-color)}.nano-tab-group--top .nano-tab-group__body{order:2;background:var(--content-bg);position:relative;overflow:hidden;width:auto;display:flex;justify-content:center;padding:var(--content-padding);border-radius:var(--content-border-radius);flex:1 1 auto}.nano-tab-group--start{flex-direction:row}.nano-tab-group--start .nano-tab-group__tabs{flex:0 0 auto;flex-direction:column;color:var(--tab-text-color);background:rgb(var(--tabs-bg-rgb));-webkit-border-start:solid var(--indicator-size) var(--indicator-track-color);border-inline-start:solid var(--indicator-size) var(--indicator-track-color);text-align:start}.nano-tab-group--start .nano-tab-group__active-tab-indicator{inset-inline-start:-2px;-webkit-border-start:solid var(--indicator-size) var(--indicator-color);border-inline-start:solid var(--indicator-size) var(--indicator-color)}.nano-tab-group--start .nano-tab-group__body{flex:1 1 auto;order:2;padding:var(--content-padding);overflow:hidden;border-start-start-radius:0;border-start-end-radius:var(--content-border-radius);border-end-end-radius:var(--content-border-radius);border-end-start-radius:0}';const p=class{constructor(o){t(this,o);this.nanoTabShow=a(this,"nanoTabShow",7);this.nanoTabHide=a(this,"nanoTabHide",7);this.nanoTabWillClose=a(this,"nanoTabWillClose",7);this.nanoTabClose=a(this,"nanoTabClose",7);this.initialTouchX=null;this.initialTouchY=null;this.mutationObservers=new WeakMap;this.updateScrollControls=()=>{if(this.noScrollControls){this.hasScrollControls=false}else{this.hasScrollControls=["top"].includes(this.placement)&&this.nav.scrollWidth>this.nav.clientWidth&&this.nav.scrollWidth>this.tabs.clientWidth}};this.handleClick=t=>{const a=t.target;const o=a.closest("nano-tab");if(o)this.setActiveTab(o)};this.handleKeyDown=t=>{if(["Enter"," "].includes(t.key)){const a=t.target;const o=a.closest("nano-tab");if(o){this.setActiveTab(o);t.preventDefault()}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(t.key)){const a=document.activeElement;if(a&&a.tagName.toLowerCase()==="nano-tab"){const o=this.getAllActiveTabs;let n=o.indexOf(a);if(t.key==="Home"){n=0}else if(t.key==="End"){n=o.length-1}else if(this.isRtl&&t.key==="ArrowRight"||!this.isRtl&&t.key==="ArrowLeft"){n=Math.max(0,n-1)}else if(this.isRtl&&t.key==="ArrowLeft"||!this.isRtl&&t.key==="ArrowRight"){n=Math.min(o.length-1,n+1)}o[n].setFocus();if(["top"].includes(this.placement)){h(o[n],this.nav,"horizontal","center")}t.stopPropagation();t.preventDefault()}}};this.handleTabScroll=()=>{if(!this.hasScrollControls){this.hideControlLeft=this.hideControlRight=true;return}const t=this.isRtl?this.nav.scrollLeft===0:this.nav.scrollWidth-this.nav.scrollLeft===this.nav.clientWidth;const a=this.isRtl?this.nav.scrollWidth+this.nav.scrollLeft===this.nav.clientWidth:this.nav.scrollLeft===0;if(a){this.hideControlLeft=true;this.hideControlRight=false}else if(t){this.hideControlLeft=false;this.hideControlRight=true}else{this.hideControlRight=false;this.hideControlLeft=false}};this.handleBtnClick=(t=false)=>{const a=this.getNavWidth();let o;if(t)o=this.nav.scrollLeft+a-20;else o=this.nav.scrollLeft-a+20;try{this.nav.scroll({left:o,behavior:"smooth"})}catch(t){this.nav.scrollLeft=o}};this.handleTouchStart=t=>{if(this.disableSwipe)return;const a=t.changedTouches[0];this.initialTouchX=a.pageX;this.initialTouchY=a.pageY};this.handleTouchEnd=t=>{if(this.disableSwipe)return;const a=t.changedTouches[0];const o=a.pageX-this.initialTouchX;const n=a.pageY-this.initialTouchY;const i=70;const s=this.initialTouchX-a.clientX;const r=this.initialTouchY-a.clientY;const e=Math.abs(o)>=i&&Math.abs(n)<=i;const h=this.getAllActiveTabs;const d=h.findIndex((t=>t.active));if(e){const t=o<0&&this.placement==="top"||o>0&&this.placement!=="top"?1:-1;if(h[d+t]){this.setActiveTab(h[d+t]);if(Math.abs(s)>Math.abs(r)){if(s>0)this.activePanel.setAttribute("animation-dir","left");else this.activePanel.setAttribute("animation-dir","right")}}}this.initialTouchX=null;this.initialTouchY=null};this.handleContentSlotChange=()=>{setTimeout((()=>{this.setAriaLabels();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false)}))};this.handleTabSlotChange=t=>{setTimeout((()=>{this.setAriaLabels();this.handleTabScroll();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false);this.updateScrollControls()}),500);const a=t.target.assignedElements({flatten:true});a.forEach((t=>{if(!this.mutationObservers.get(t)){const a=new MutationObserver((()=>{setTimeout((()=>{this.syncActiveTabIndicator();this.handleTabScroll();this.updateScrollControls()}),500)}));this.mutationObservers.set(t,a);a.observe(t,{characterData:true,childList:true,subtree:true})}}))};this.hasScrollControls=false;this.hideControlRight=true;this.hideControlLeft=true;this.tab=undefined;this.placement="top";this.noScrollControls=false;this.color=undefined;this.storeId=undefined;this.storeMethod="session";this.disableSwipe=undefined}handleTabNameChange(){if(this.activeTab&&this.activeTab.panel===this.tab)return;const t=this.getAllActiveTabs.find((t=>t.panel===this.tab));this.setActiveTab(t)}handlePlacementChange(){this.syncActiveTabIndicator()}handleNoScrollControlsChange(){this.updateScrollControls()}hideRightBtn(){if(!this.rightBtn)return;c(this.rightBtn,"is-shown",!this.hideControlRight)}hideLeftBtn(){if(!this.leftBtn)return;c(this.leftBtn,"is-shown",!this.hideControlLeft)}watchScrollControls(){if(this.hasScrollControls)setTimeout((t=>this.handleTabScroll()),20);else setTimeout((t=>{this.hideControlLeft=this.hideControlRight=true}),20)}async show(t){if(this.activeTab&&this.activeTab.panel===t)return;const a=this.getAllActiveTabs.find((a=>a.panel===t));if(a)this.setActiveTab(a)}get getAllActiveTabs(){return this.getAllTabs.filter((t=>!t.disabled))}get getAllTabs(){return s(this.host,"nano-tab")}get getAllPanels(){return s(this.host,"nano-tab-content")}get getActiveTab(){return this.getAllActiveTabs.find((t=>t.active))}setActiveTab(t,a=true){if(t&&t!==this.activeTab&&!t.disabled&&this.getAllActiveTabs.includes(t)){const o=this.activeTab;this.activeTab=t;this.tab=t.panel;this.getAllActiveTabs.map((t=>t.active=t===this.activeTab));this.getAllPanels.map((t=>{if(t.name===this.activeTab.panel){t.active=true;this.activePanel=t}else t.active=false;t.removeAttribute("animation-dir")}));this.syncActiveTabIndicator();if(this.nav&&["top"].includes(this.placement)){h(this.activeTab,this.nav,"horizontal","center")}if(a){if(o){this.nanoTabHide.emit({name:o.panel})}this.nanoTabShow.emit({name:this.activeTab.panel})}}}setAriaLabels(){const t=this.getAllActiveTabs;const a=this.getAllPanels;t.map((t=>{const o=a.find((a=>a.name===t.panel));if(o){t.setAttribute("aria-controls",o.getAttribute("id"));o.setAttribute("aria-labelledby",t.getAttribute("id"))}}))}syncActiveTabIndicator(){var t;this.getAllTabs.forEach((t=>t.setAttribute("direction",this.placement==="top"?"horizontal":"vertical")));const a=this.getActiveTab;const o=((t=a.shadowRoot.querySelector(".nanotab"))===null||t===void 0?void 0:t.clientWidth)||0;const n=a.clientHeight;const i=r(a,this.tabs);if(!this.activeTabIndicator)return;const s=i.top+this.nav.scrollTop;const e=i.left;switch(this.placement){case"top":this.activeTabIndicator.style.width=`${o}px`;this.activeTabIndicator.style.height=null;this.activeTabIndicator.style.transform=`translateX(${e}px)`;break;case"start":this.activeTabIndicator.style.width=null;this.activeTabIndicator.style.height=`${n}px`;this.activeTabIndicator.style.transform=`translateY(${s}px)`;break}}getNavWidth(){if(!this.nav)return 0;const t=getComputedStyle(this.nav);let a=this.nav.clientWidth;return a-=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight)}handleTabClose(t){var a;let o=this.getAllActiveTabs.indexOf(t.target);const n=t.target;if(o<0)return;const i=this.getAllPanels.find((t=>t.name===n.panel));if(!i)return;t.stopImmediatePropagation();const s=this.nanoTabWillClose.emit({name:n.panel});if(s.defaultPrevented)return;if(n.active){o=o===0?1:o-1;const t=(a=this.getAllActiveTabs[o])===null||a===void 0?void 0:a.panel;if(t)this.host.show(t)}n.remove();i.remove();this.nanoTabClose.emit({name:n.panel})}componentDidLoad(){const t=new IntersectionObserver(((t,a)=>{if(t[0].intersectionRatio>0){this.setAriaLabels();this.setActiveTab(this.getActiveTab||this.getAllActiveTabs[0],false);if(this.storeId)d.init(this,["tab"],this.storeMethod,this.storeId);a.unobserve(t[0].target)}}));t.observe(this.host);e.observe(this.tabGroup);if(this.leftBtn){e.observe(this.leftBtn);e.observe(this.rightBtn)}requestAnimationFrame((()=>this.updateScrollControls()));if(!window["ResizeObserver"])return;this.resizeObserver=new ResizeObserver((()=>{setTimeout((()=>{this.updateScrollControls();this.syncActiveTabIndicator();h(this.activeTab,this.nav,"horizontal","center")}),500)}));this.resizeObserver.observe(this.nav)}connectedCallback(){this.isRtl=this.host.dir==="rtl"||this.host.ownerDocument.dir==="rtl"}disconnectedCallback(){e.unobserve(this.tabGroup);if(this.leftBtn){e.unobserve(this.leftBtn);e.unobserve(this.rightBtn)}if(this.resizeObserver)this.resizeObserver.unobserve(this.nav)}render(){this.isRtl=this.host.ownerDocument.dir==="rtl";return o(n,{class:Object.assign({},l(this.color)),dir:this.isRtl?"rtl":null},o("div",{part:"base",ref:t=>this.tabGroup=t,class:{"nano-tab-group":true,"nano-tab-group--top":this.placement==="top","nano-tab-group--start":this.placement==="start","nano-tab-group--has-scroll-controls":this.hasScrollControls,"nano-tab-group--has-scroll-controls-left":!this.hideControlLeft,"nano-tab-group--has-scroll-controls-right":!this.hideControlRight},onClick:this.handleClick,onKeyDown:this.handleKeyDown},o("div",{class:"nano-tab-group__nav-container",part:"nav"},this.placement==="top"&&o("button",{class:{"nano-tab-group__scroll-button":true,"nano-tab-group__scroll-button--left":true},ref:t=>this.leftBtn=t,onClick:()=>this.handleBtnClick(false)},o("nano-icon",{name:"light/chevron-left"})),o("div",{ref:t=>this.nav=t,class:"nano-tab-group__nav",onScroll:this.handleTabScroll},o("div",{ref:t=>this.tabs=t,part:"tabs",class:"nano-tab-group__tabs",role:"tablist"},o("div",{ref:t=>this.activeTabIndicator=t,part:"active-tab-indicator",class:"nano-tab-group__active-tab-indicator"}),o("slot",{name:"tabs",onSlotchange:this.handleTabSlotChange}))),this.placement==="top"&&o("button",{class:{"nano-tab-group__scroll-button":true,"nano-tab-group__scroll-button--right":true},ref:t=>this.rightBtn=t,onClick:()=>this.handleBtnClick(true)},o("nano-icon",{name:"light/chevron-right"}))),o("slot",{name:"tab-content-header"}),o("div",{part:"body",class:"nano-tab-group__body",onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd},o("slot",{onSlotchange:this.handleContentSlotChange}))))}get host(){return i(this)}static get watchers(){return{tab:["handleTabNameChange"],placement:["handlePlacementChange"],noScrollControls:["handleNoScrollControlsChange"],hideControlRight:["hideRightBtn"],hideControlLeft:["hideLeftBtn"],hasScrollControls:["watchScrollControls"]}}};p.style=b;export{p as nano_tab_group};
|
5
|
+
//# sourceMappingURL=p-a5a560e7.entry.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{g as r}from"./p-6ef53fa1.js";import{d as e}from"./p-9746b0a5.js";import{c as t,g as n}from"./p-69a3e911.js";var o=function r(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var t=Symbol("test");var n=Object(t);if(typeof t==="string"){return false}if(Object.prototype.toString.call(t)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(n)!=="[object Symbol]"){return false}var o=42;e[t]=o;for(t in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t){return false}if(!Object.prototype.propertyIsEnumerable.call(e,t)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==o||a.enumerable!==true){return false}}return true};var i=typeof Symbol!=="undefined"&&Symbol;var a=function r(){if(typeof i!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof i("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return o()};var f="Function.prototype.bind called on incompatible ";var u=Array.prototype.slice;var c=Object.prototype.toString;var y="[object Function]";var p=function r(e){var t=this;if(typeof t!=="function"||c.call(t)!==y){throw new TypeError(f+t)}var n=u.call(arguments,1);var o;var i=function(){if(this instanceof o){var r=t.apply(this,n.concat(u.call(arguments)));if(Object(r)===r){return r}return this}else{return t.apply(e,n.concat(u.call(arguments)))}};var a=Math.max(0,t.length-n.length);var p=[];for(var s=0;s<a;s++){p.push("$"+s)}o=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(i);if(t.prototype){var l=function r(){};l.prototype=t.prototype;o.prototype=new l;l.prototype=null}return o};var s=Function.prototype.bind||p;var l=s.call(Function.call,Object.prototype.hasOwnProperty);var v;var d=SyntaxError;var b=Function;var h=TypeError;var m=function(r){try{return b('"use strict"; return ('+r+").constructor;")()}catch(r){}};var g=Object.getOwnPropertyDescriptor;var S=function(){throw new h};var j=g?function(){try{return S}catch(r){try{return g(arguments,"callee").get}catch(r){return S}}}():S;var A=a();var w=Object.getPrototypeOf||function(r){return r.__proto__};var O={};var P=typeof Uint8Array==="undefined"?v:w(Uint8Array);var E={"%AggregateError%":typeof AggregateError==="undefined"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?v:ArrayBuffer,"%ArrayIteratorPrototype%":A?w([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics==="undefined"?v:Atomics,"%BigInt%":typeof BigInt==="undefined"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?v:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?v:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array==="undefined"?v:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?v:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?w(w([][Symbol.iterator]())):v,"%JSON%":typeof JSON==="object"?JSON:v,"%Map%":typeof Map==="undefined"?v:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!A?v:w((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?v:Promise,"%Proxy%":typeof Proxy==="undefined"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?v:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!A?v:w((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?w(""[Symbol.iterator]()):v,"%Symbol%":A?Symbol:v,"%SyntaxError%":d,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array==="undefined"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?v:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?v:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?v:WeakSet};var I=function r(e){var t;if(e==="%AsyncFunction%"){t=m("async function () {}")}else if(e==="%GeneratorFunction%"){t=m("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){t=m("async function* () {}")}else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");if(n){t=n.prototype}}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");if(o){t=w(o.prototype)}}E[e]=t;return t};var F={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var R=s.call(Function.call,Array.prototype.concat);var k=s.call(Function.apply,Array.prototype.splice);var M=s.call(Function.call,String.prototype.replace);var x=s.call(Function.call,String.prototype.slice);var U=s.call(Function.call,RegExp.prototype.exec);var N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var B=/\\(\\)?/g;var W=function r(e){var t=x(e,0,1);var n=x(e,-1);if(t==="%"&&n!=="%"){throw new d("invalid intrinsic syntax, expected closing `%`")}else if(n==="%"&&t!=="%"){throw new d("invalid intrinsic syntax, expected opening `%`")}var o=[];M(e,N,(function(r,e,t,n){o[o.length]=t?M(n,B,"$1"):e||r}));return o};var T=function r(e,t){var n=e;var o;if(l(F,n)){o=F[n];n="%"+o[0]+"%"}if(l(E,n)){var i=E[n];if(i===O){i=I(n)}if(typeof i==="undefined"&&!t){throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:o,name:n,value:i}}throw new d("intrinsic "+e+" does not exist!")};var D=function r(e,t){if(typeof e!=="string"||e.length===0){throw new h("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof t!=="boolean"){throw new h('"allowMissing" argument must be a boolean')}if(U(/^%?[^%]*%?$/,e)===null){throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var n=W(e);var o=n.length>0?n[0]:"";var i=T("%"+o+"%",t);var a=i.name;var f=i.value;var u=false;var c=i.alias;if(c){o=c[0];k(n,R([0,1],c))}for(var y=1,p=true;y<n.length;y+=1){var s=n[y];var b=x(s,0,1);var m=x(s,-1);if((b==='"'||b==="'"||b==="`"||(m==='"'||m==="'"||m==="`"))&&b!==m){throw new d("property names with quotes must have matching quotes")}if(s==="constructor"||!p){u=true}o+="."+s;a="%"+o+"%";if(l(E,a)){f=E[a]}else if(f!=null){if(!(s in f)){if(!t){throw new h("base intrinsic for "+e+" exists, but the property is not available.")}return void v}if(g&&y+1>=n.length){var S=g(f,s);p=!!S;if(p&&"get"in S&&!("originalValue"in S.get)){f=S.get}else{f=f[s]}}else{p=l(f,s);f=f[s]}if(p&&!u){E[a]=f}}}return f};var C=t((function(r){var e=D("%Function.prototype.apply%");var t=D("%Function.prototype.call%");var n=D("%Reflect.apply%",true)||s.call(t,e);var o=D("%Object.getOwnPropertyDescriptor%",true);var i=D("%Object.defineProperty%",true);var a=D("%Math.max%");if(i){try{i({},"a",{value:1})}catch(r){i=null}}r.exports=function r(e){var f=n(s,t,arguments);if(o&&i){var u=o(f,"length");if(u.configurable){i(f,"length",{value:1+a(0,e.length-(arguments.length-1))})}}return f};var f=function r(){return n(s,e,arguments)};if(i){i(r.exports,"apply",{value:f})}else{r.exports.apply=f}}));var _=C(D("String.prototype.indexOf"));var q=function r(e,t){var n=D(e,!!t);if(typeof n==="function"&&_(e,".prototype.")>-1){return C(n)}return n};const G={};const $=Object.freeze({__proto__:null,default:G});const J=n($);var V=typeof Map==="function"&&Map.prototype;var H=Object.getOwnPropertyDescriptor&&V?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var L=V&&H&&typeof H.get==="function"?H.get:null;var z=V&&Map.prototype.forEach;var Q=typeof Set==="function"&&Set.prototype;var Y=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var K=Q&&Y&&typeof Y.get==="function"?Y.get:null;var X=Q&&Set.prototype.forEach;var Z=typeof WeakMap==="function"&&WeakMap.prototype;var rr=Z?WeakMap.prototype.has:null;var er=typeof WeakSet==="function"&&WeakSet.prototype;var tr=er?WeakSet.prototype.has:null;var nr=typeof WeakRef==="function"&&WeakRef.prototype;var or=nr?WeakRef.prototype.deref:null;var ir=Boolean.prototype.valueOf;var ar=Object.prototype.toString;var fr=Function.prototype.toString;var ur=String.prototype.match;var cr=String.prototype.slice;var yr=String.prototype.replace;var pr=String.prototype.toUpperCase;var sr=String.prototype.toLowerCase;var lr=RegExp.prototype.test;var vr=Array.prototype.concat;var dr=Array.prototype.join;var br=Array.prototype.slice;var hr=Math.floor;var mr=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gr=Object.getOwnPropertySymbols;var Sr=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var jr=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var Ar=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===jr?"object":"symbol")?Symbol.toStringTag:null;var wr=Object.prototype.propertyIsEnumerable;var Or=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Pr(r,e){if(r===Infinity||r===-Infinity||r!==r||r&&r>-1e3&&r<1e3||lr.call(/e/,e)){return e}var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r==="number"){var n=r<0?-hr(-r):hr(r);if(n!==r){var o=String(n);var i=cr.call(e,o.length+1);return yr.call(o,t,"$&_")+"."+yr.call(yr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(e,t,"$&_")}var Er=J.custom;var Ir=Dr(Er)?Er:null;var Fr=function r(e,t,n,o){var i=t||{};if(qr(i,"quoteStyle")&&(i.quoteStyle!=="single"&&i.quoteStyle!=="double")){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(qr(i,"maxStringLength")&&(typeof i.maxStringLength==="number"?i.maxStringLength<0&&i.maxStringLength!==Infinity:i.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var a=qr(i,"customInspect")?i.customInspect:true;if(typeof a!=="boolean"&&a!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(qr(i,"indent")&&i.indent!==null&&i.indent!=="\t"&&!(parseInt(i.indent,10)===i.indent&&i.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(qr(i,"numericSeparator")&&typeof i.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var f=i.numericSeparator;if(typeof e==="undefined"){return"undefined"}if(e===null){return"null"}if(typeof e==="boolean"){return e?"true":"false"}if(typeof e==="string"){return Kr(e,i)}if(typeof e==="number"){if(e===0){return Infinity/e>0?"0":"-0"}var u=String(e);return f?Pr(e,u):u}if(typeof e==="bigint"){var c=String(e)+"n";return f?Pr(e,c):c}var y=typeof i.depth==="undefined"?5:i.depth;if(typeof n==="undefined"){n=0}if(n>=y&&y>0&&typeof e==="object"){return Mr(e)?"[Array]":"[Object]"}var p=ne(i,n);if(typeof o==="undefined"){o=[]}else if(Jr(o,e)>=0){return"[Circular]"}function s(e,t,a){if(t){o=br.call(o);o.push(t)}if(a){var f={depth:i.depth};if(qr(i,"quoteStyle")){f.quoteStyle=i.quoteStyle}return r(e,f,n+1,o)}return r(e,i,n+1,o)}if(typeof e==="function"&&!Ur(e)){var l=$r(e);var v=ie(e,s);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(v.length>0?" { "+dr.call(v,", ")+" }":"")}if(Dr(e)){var d=jr?yr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e==="object"&&!jr?Zr(d):d}if(Yr(e)){var b="<"+sr.call(String(e.nodeName));var h=e.attributes||[];for(var m=0;m<h.length;m++){b+=" "+h[m].name+"="+Rr(kr(h[m].value),"double",i)}b+=">";if(e.childNodes&&e.childNodes.length){b+="..."}b+="</"+sr.call(String(e.nodeName))+">";return b}if(Mr(e)){if(e.length===0){return"[]"}var g=ie(e,s);if(p&&!te(g)){return"["+oe(g,p)+"]"}return"[ "+dr.call(g,", ")+" ]"}if(Nr(e)){var S=ie(e,s);if(!("cause"in Error.prototype)&&"cause"in e&&!wr.call(e,"cause")){return"{ ["+String(e)+"] "+dr.call(vr.call("[cause]: "+s(e.cause),S),", ")+" }"}if(S.length===0){return"["+String(e)+"]"}return"{ ["+String(e)+"] "+dr.call(S,", ")+" }"}if(typeof e==="object"&&a){if(Ir&&typeof e[Ir]==="function"&&J){return J(e,{depth:y-n})}else if(a!=="symbol"&&typeof e.inspect==="function"){return e.inspect()}}if(Vr(e)){var j=[];if(z){z.call(e,(function(r,t){j.push(s(t,e,true)+" => "+s(r,e))}))}return ee("Map",L.call(e),j,p)}if(zr(e)){var A=[];if(X){X.call(e,(function(r){A.push(s(r,e))}))}return ee("Set",K.call(e),A,p)}if(Hr(e)){return re("WeakMap")}if(Qr(e)){return re("WeakSet")}if(Lr(e)){return re("WeakRef")}if(Wr(e)){return Zr(s(Number(e)))}if(Cr(e)){return Zr(s(mr.call(e)))}if(Tr(e)){return Zr(ir.call(e))}if(Br(e)){return Zr(s(String(e)))}if(!xr(e)&&!Ur(e)){var w=ie(e,s);var O=Or?Or(e)===Object.prototype:e instanceof Object||e.constructor===Object;var P=e instanceof Object?"":"null prototype";var E=!O&&Ar&&Object(e)===e&&Ar in e?cr.call(Gr(e),8,-1):P?"Object":"";var I=O||typeof e.constructor!=="function"?"":e.constructor.name?e.constructor.name+" ":"";var F=I+(E||P?"["+dr.call(vr.call([],E||[],P||[]),": ")+"] ":"");if(w.length===0){return F+"{}"}if(p){return F+"{"+oe(w,p)+"}"}return F+"{ "+dr.call(w,", ")+" }"}return String(e)};function Rr(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function kr(r){return yr.call(String(r),/"/g,""")}function Mr(r){return Gr(r)==="[object Array]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function xr(r){return Gr(r)==="[object Date]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Ur(r){return Gr(r)==="[object RegExp]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Nr(r){return Gr(r)==="[object Error]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Br(r){return Gr(r)==="[object String]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Wr(r){return Gr(r)==="[object Number]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Tr(r){return Gr(r)==="[object Boolean]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Dr(r){if(jr){return r&&typeof r==="object"&&r instanceof Symbol}if(typeof r==="symbol"){return true}if(!r||typeof r!=="object"||!Sr){return false}try{Sr.call(r);return true}catch(r){}return false}function Cr(r){if(!r||typeof r!=="object"||!mr){return false}try{mr.call(r);return true}catch(r){}return false}var _r=Object.prototype.hasOwnProperty||function(r){return r in this};function qr(r,e){return _r.call(r,e)}function Gr(r){return ar.call(r)}function $r(r){if(r.name){return r.name}var e=ur.call(fr.call(r),/^function\s*([\w$]+)/);if(e){return e[1]}return null}function Jr(r,e){if(r.indexOf){return r.indexOf(e)}for(var t=0,n=r.length;t<n;t++){if(r[t]===e){return t}}return-1}function Vr(r){if(!L||!r||typeof r!=="object"){return false}try{L.call(r);try{K.call(r)}catch(r){return true}return r instanceof Map}catch(r){}return false}function Hr(r){if(!rr||!r||typeof r!=="object"){return false}try{rr.call(r,rr);try{tr.call(r,tr)}catch(r){return true}return r instanceof WeakMap}catch(r){}return false}function Lr(r){if(!or||!r||typeof r!=="object"){return false}try{or.call(r);return true}catch(r){}return false}function zr(r){if(!K||!r||typeof r!=="object"){return false}try{K.call(r);try{L.call(r)}catch(r){return true}return r instanceof Set}catch(r){}return false}function Qr(r){if(!tr||!r||typeof r!=="object"){return false}try{tr.call(r,tr);try{rr.call(r,rr)}catch(r){return true}return r instanceof WeakSet}catch(r){}return false}function Yr(r){if(!r||typeof r!=="object"){return false}if(typeof HTMLElement!=="undefined"&&r instanceof HTMLElement){return true}return typeof r.nodeName==="string"&&typeof r.getAttribute==="function"}function Kr(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength;var n="... "+t+" more character"+(t>1?"s":"");return Kr(cr.call(r,0,e.maxStringLength),e)+n}var o=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Xr);return Rr(o,"single",e)}function Xr(r){var e=r.charCodeAt(0);var t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];if(t){return"\\"+t}return"\\x"+(e<16?"0":"")+pr.call(e.toString(16))}function Zr(r){return"Object("+r+")"}function re(r){return r+" { ? }"}function ee(r,e,t,n){var o=n?oe(t,n):dr.call(t,", ");return r+" ("+e+") {"+o+"}"}function te(r){for(var e=0;e<r.length;e++){if(Jr(r[e],"\n")>=0){return false}}return true}function ne(r,e){var t;if(r.indent==="\t"){t="\t"}else if(typeof r.indent==="number"&&r.indent>0){t=dr.call(Array(r.indent+1)," ")}else{return null}return{base:t,prev:dr.call(Array(e+1),t)}}function oe(r,e){if(r.length===0){return""}var t="\n"+e.prev+e.base;return t+dr.call(r,","+t)+"\n"+e.prev}function ie(r,e){var t=Mr(r);var n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++){n[o]=qr(r,o)?e(r[o],r):""}}var i=typeof gr==="function"?gr(r):[];var a;if(jr){a={};for(var f=0;f<i.length;f++){a["$"+i[f]]=i[f]}}for(var u in r){if(!qr(r,u)){continue}if(t&&String(Number(u))===u&&u<r.length){continue}if(jr&&a["$"+u]instanceof Symbol){continue}else if(lr.call(/[^\w$]/,u)){n.push(e(u,r)+": "+e(r[u],r))}else{n.push(u+": "+e(r[u],r))}}if(typeof gr==="function"){for(var c=0;c<i.length;c++){if(wr.call(r,i[c])){n.push("["+e(i[c])+"]: "+e(r[i[c]],r))}}}return n}var ae=D("%TypeError%");var fe=D("%WeakMap%",true);var ue=D("%Map%",true);var ce=q("WeakMap.prototype.get",true);var ye=q("WeakMap.prototype.set",true);var pe=q("WeakMap.prototype.has",true);var se=q("Map.prototype.get",true);var le=q("Map.prototype.set",true);var ve=q("Map.prototype.has",true);var de=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n){if(n.key===e){t.next=n.next;n.next=r.next;r.next=n;return n}}};var be=function(r,e){var t=de(r,e);return t&&t.value};var he=function(r,e,t){var n=de(r,e);if(n){n.value=t}else{r.next={key:e,next:r.next,value:t}}};var me=function(r,e){return!!de(r,e)};var ge=function r(){var e;var t;var n;var o={assert:function(r){if(!o.has(r)){throw new ae("Side channel does not contain "+Fr(r))}},get:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return ce(e,r)}}else if(ue){if(t){return se(t,r)}}else{if(n){return be(n,r)}}},has:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return pe(e,r)}}else if(ue){if(t){return ve(t,r)}}else{if(n){return me(n,r)}}return false},set:function(r,o){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(!e){e=new fe}ye(e,r,o)}else if(ue){if(!t){t=new ue}le(t,r,o)}else{if(!n){n={key:{},next:null}}he(n,r,o)}}};return o};var Se=String.prototype.replace;var je=/%20/g;var Ae={RFC1738:"RFC1738",RFC3986:"RFC3986"};var we={default:Ae.RFC3986,formatters:{RFC1738:function(r){return Se.call(r,je,"+")},RFC3986:function(r){return String(r)}},RFC1738:Ae.RFC1738,RFC3986:Ae.RFC3986};var Oe=Object.prototype.hasOwnProperty;var Pe=Array.isArray;var Ee=function(){var r=[];for(var e=0;e<256;++e){r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase())}return r}();var Ie=function r(e){while(e.length>1){var t=e.pop();var n=t.obj[t.prop];if(Pe(n)){var o=[];for(var i=0;i<n.length;++i){if(typeof n[i]!=="undefined"){o.push(n[i])}}t.obj[t.prop]=o}}};var Fe=function r(e,t){var n=t&&t.plainObjects?Object.create(null):{};for(var o=0;o<e.length;++o){if(typeof e[o]!=="undefined"){n[o]=e[o]}}return n};var Re=function r(e,t,n){if(!t){return e}if(typeof t!=="object"){if(Pe(e)){e.push(t)}else if(e&&typeof e==="object"){if(n&&(n.plainObjects||n.allowPrototypes)||!Oe.call(Object.prototype,t)){e[t]=true}}else{return[e,t]}return e}if(!e||typeof e!=="object"){return[e].concat(t)}var o=e;if(Pe(e)&&!Pe(t)){o=Fe(e,n)}if(Pe(e)&&Pe(t)){t.forEach((function(t,o){if(Oe.call(e,o)){var i=e[o];if(i&&typeof i==="object"&&t&&typeof t==="object"){e[o]=r(i,t,n)}else{e.push(t)}}else{e[o]=t}}));return e}return Object.keys(t).reduce((function(e,o){var i=t[o];if(Oe.call(e,o)){e[o]=r(e[o],i,n)}else{e[o]=i}return e}),o)};var ke=function r(e,t){return Object.keys(t).reduce((function(r,e){r[e]=t[e];return r}),e)};var Me=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1"){return n.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(n)}catch(r){return n}};var xe=function r(e,t,n,o,i){if(e.length===0){return e}var a=e;if(typeof e==="symbol"){a=Symbol.prototype.toString.call(e)}else if(typeof e!=="string"){a=String(e)}if(n==="iso-8859-1"){return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(r){return"%26%23"+parseInt(r.slice(2),16)+"%3B"}))}var f="";for(var u=0;u<a.length;++u){var c=a.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===we.RFC1738&&(c===40||c===41)){f+=a.charAt(u);continue}if(c<128){f=f+Ee[c];continue}if(c<2048){f=f+(Ee[192|c>>6]+Ee[128|c&63]);continue}if(c<55296||c>=57344){f=f+(Ee[224|c>>12]+Ee[128|c>>6&63]+Ee[128|c&63]);continue}u+=1;c=65536+((c&1023)<<10|a.charCodeAt(u)&1023);f+=Ee[240|c>>18]+Ee[128|c>>12&63]+Ee[128|c>>6&63]+Ee[128|c&63]}return f};var Ue=function r(e){var t=[{obj:{o:e},prop:"o"}];var n=[];for(var o=0;o<t.length;++o){var i=t[o];var a=i.obj[i.prop];var f=Object.keys(a);for(var u=0;u<f.length;++u){var c=f[u];var y=a[c];if(typeof y==="object"&&y!==null&&n.indexOf(y)===-1){t.push({obj:a,prop:c});n.push(y)}}}Ie(t);return e};var Ne=function r(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var Be=function r(e){if(!e||typeof e!=="object"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};var We=function r(e,t){return[].concat(e,t)};var Te=function r(e,t){if(Pe(e)){var n=[];for(var o=0;o<e.length;o+=1){n.push(t(e[o]))}return n}return t(e)};var De={arrayToObject:Fe,assign:ke,combine:We,compact:Ue,decode:Me,encode:xe,isBuffer:Be,isRegExp:Ne,maybeMap:Te,merge:Re};var Ce=Object.prototype.hasOwnProperty;var _e={brackets:function r(e){return e+"[]"},comma:"comma",indices:function r(e,t){return e+"["+t+"]"},repeat:function r(e){return e}};var qe=Array.isArray;var Ge=String.prototype.split;var $e=Array.prototype.push;var Je=function(r,e){$e.apply(r,qe(e)?e:[e])};var Ve=Date.prototype.toISOString;var He=we["default"];var Le={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:De.encode,encodeValuesOnly:false,format:He,formatter:we.formatters[He],indices:false,serializeDate:function r(e){return Ve.call(e)},skipNulls:false,strictNullHandling:false};var ze=function r(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"};var Qe={};var Ye=function r(e,t,n,o,i,a,f,u,c,y,p,s,l,v,d,b){var h=e;var m=b;var g=0;var S=false;while((m=m.get(Qe))!==void undefined&&!S){var j=m.get(e);g+=1;if(typeof j!=="undefined"){if(j===g){throw new RangeError("Cyclic object value")}else{S=true}}if(typeof m.get(Qe)==="undefined"){g=0}}if(typeof u==="function"){h=u(t,h)}else if(h instanceof Date){h=p(h)}else if(n==="comma"&&qe(h)){h=De.maybeMap(h,(function(r){if(r instanceof Date){return p(r)}return r}))}if(h===null){if(i){return f&&!v?f(t,Le.encoder,d,"key",s):t}h=""}if(ze(h)||De.isBuffer(h)){if(f){var A=v?t:f(t,Le.encoder,d,"key",s);if(n==="comma"&&v){var w=Ge.call(String(h),",");var O="";for(var P=0;P<w.length;++P){O+=(P===0?"":",")+l(f(w[P],Le.encoder,d,"value",s))}return[l(A)+(o&&qe(h)&&w.length===1?"[]":"")+"="+O]}return[l(A)+"="+l(f(h,Le.encoder,d,"value",s))]}return[l(t)+"="+l(String(h))]}var E=[];if(typeof h==="undefined"){return E}var I;if(n==="comma"&&qe(h)){I=[{value:h.length>0?h.join(",")||null:void undefined}]}else if(qe(u)){I=u}else{var F=Object.keys(h);I=c?F.sort(c):F}var R=o&&qe(h)&&h.length===1?t+"[]":t;for(var k=0;k<I.length;++k){var M=I[k];var x=typeof M==="object"&&typeof M.value!=="undefined"?M.value:h[M];if(a&&x===null){continue}var U=qe(h)?typeof n==="function"?n(R,M):R:R+(y?"."+M:"["+M+"]");b.set(e,g);var N=ge();N.set(Qe,b);Je(E,r(x,U,n,o,i,a,f,u,c,y,p,s,l,v,d,N))}return E};var Ke=function r(e){if(!e){return Le}if(e.encoder!==null&&typeof e.encoder!=="undefined"&&typeof e.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var t=e.charset||Le.charset;if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var n=we["default"];if(typeof e.format!=="undefined"){if(!Ce.call(we.formatters,e.format)){throw new TypeError("Unknown format option provided.")}n=e.format}var o=we.formatters[n];var i=Le.filter;if(typeof e.filter==="function"||qe(e.filter)){i=e.filter}return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Le.addQueryPrefix,allowDots:typeof e.allowDots==="undefined"?Le.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Le.charsetSentinel,delimiter:typeof e.delimiter==="undefined"?Le.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Le.encode,encoder:typeof e.encoder==="function"?e.encoder:Le.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Le.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Le.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Le.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Le.strictNullHandling}};var Xe=function(r,e){var t=r;var n=Ke(e);var o;var i;if(typeof n.filter==="function"){i=n.filter;t=i("",t)}else if(qe(n.filter)){i=n.filter;o=i}var a=[];if(typeof t!=="object"||t===null){return""}var f;if(e&&e.arrayFormat in _e){f=e.arrayFormat}else if(e&&"indices"in e){f=e.indices?"indices":"repeat"}else{f="indices"}var u=_e[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var c=u==="comma"&&e&&e.commaRoundTrip;if(!o){o=Object.keys(t)}if(n.sort){o.sort(n.sort)}var y=ge();for(var p=0;p<o.length;++p){var s=o[p];if(n.skipNulls&&t[s]===null){continue}Je(a,Ye(t[s],s,u,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,y))}var l=a.join(n.delimiter);var v=n.addQueryPrefix===true?"?":"";if(n.charsetSentinel){if(n.charset==="iso-8859-1"){v+="utf8=%26%2310003%3B&"}else{v+="utf8=%E2%9C%93&"}}return l.length>0?v+l:""};var Ze=Object.prototype.hasOwnProperty;var rt=Array.isArray;var et={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:De.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var tt=function(r){return r.replace(/&#(\d+);/g,(function(r,e){return String.fromCharCode(parseInt(e,10))}))};var nt=function(r,e){if(r&&typeof r==="string"&&e.comma&&r.indexOf(",")>-1){return r.split(",")}return r};var ot="utf8=%26%2310003%3B";var it="utf8=%E2%9C%93";var at=function r(e,t){var n={};var o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var i=t.parameterLimit===Infinity?undefined:t.parameterLimit;var a=o.split(t.delimiter,i);var f=-1;var u;var c=t.charset;if(t.charsetSentinel){for(u=0;u<a.length;++u){if(a[u].indexOf("utf8=")===0){if(a[u]===it){c="utf-8"}else if(a[u]===ot){c="iso-8859-1"}f=u;u=a.length}}}for(u=0;u<a.length;++u){if(u===f){continue}var y=a[u];var p=y.indexOf("]=");var s=p===-1?y.indexOf("="):p+1;var l,v;if(s===-1){l=t.decoder(y,et.decoder,c,"key");v=t.strictNullHandling?null:""}else{l=t.decoder(y.slice(0,s),et.decoder,c,"key");v=De.maybeMap(nt(y.slice(s+1),t),(function(r){return t.decoder(r,et.decoder,c,"value")}))}if(v&&t.interpretNumericEntities&&c==="iso-8859-1"){v=tt(v)}if(y.indexOf("[]=")>-1){v=rt(v)?[v]:v}if(Ze.call(n,l)){n[l]=De.combine(n[l],v)}else{n[l]=v}}return n};var ft=function(r,e,t,n){var o=n?e:nt(e,t);for(var i=r.length-1;i>=0;--i){var a;var f=r[i];if(f==="[]"&&t.parseArrays){a=[].concat(o)}else{a=t.plainObjects?Object.create(null):{};var u=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f;var c=parseInt(u,10);if(!t.parseArrays&&u===""){a={0:o}}else if(!isNaN(c)&&f!==u&&String(c)===u&&c>=0&&(t.parseArrays&&c<=t.arrayLimit)){a=[];a[c]=o}else if(u!=="__proto__"){a[u]=o}}o=a}return o};var ut=function r(e,t,n,o){if(!e){return}var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var a=/(\[[^[\]]*])/;var f=/(\[[^[\]]*])/g;var u=n.depth>0&&a.exec(i);var c=u?i.slice(0,u.index):i;var y=[];if(c){if(!n.plainObjects&&Ze.call(Object.prototype,c)){if(!n.allowPrototypes){return}}y.push(c)}var p=0;while(n.depth>0&&(u=f.exec(i))!==null&&p<n.depth){p+=1;if(!n.plainObjects&&Ze.call(Object.prototype,u[1].slice(1,-1))){if(!n.allowPrototypes){return}}y.push(u[1])}if(u){y.push("["+i.slice(u.index)+"]")}return ft(y,t,n,o)};var ct=function r(e){if(!e){return et}if(e.decoder!==null&&e.decoder!==undefined&&typeof e.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var t=typeof e.charset==="undefined"?et.charset:e.charset;return{allowDots:typeof e.allowDots==="undefined"?et.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes==="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse==="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit==="number"?e.arrayLimit:et.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma==="boolean"?e.comma:et.comma,decoder:typeof e.decoder==="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter==="string"||De.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth==="number"||e.depth===false?+e.depth:et.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===true,interpretNumericEntities:typeof e.interpretNumericEntities==="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==false,plainObjects:typeof e.plainObjects==="boolean"?e.plainObjects:et.plainObjects,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:et.strictNullHandling}};var yt=function(r,e){var t=ct(e);if(r===""||r===null||typeof r==="undefined"){return t.plainObjects?Object.create(null):{}}var n=typeof r==="string"?at(r,t):r;var o=t.plainObjects?Object.create(null):{};var i=Object.keys(n);for(var a=0;a<i.length;++a){var f=i[a];var u=ut(f,n[f],t,typeof r==="string");o=De.merge(o,u,t)}if(t.allowSparse===true){return o}return De.compact(o)};var pt={formats:we,parse:yt,stringify:Xe};const st="nano-component-store:";const lt=(r="hash",e=window)=>{if(!e||!e.location)return{};if(r==="hash"&&e.location.hash)return pt.parse(e.location.hash.replace(/^\#/,""),{strictNullHandling:true});else if(r==="query"&&e.location.search)return pt.parse(e.location.search,{ignoreQueryPrefix:true});return{}};const vt=(r,e="hash",t=window,n="replace")=>{if(!t||!t.history)return;const o=e==="query"?t.location.search:t.location.hash;const i=e==="query"?t.location.pathname:t.location.pathname+t.location.search;let a=pt.stringify(r,{strictNullHandling:true,addQueryPrefix:false,encodeValuesOnly:true});if(!a||!a.length){if(!o||!o.length)return;if(n==="replace")t.history.replaceState(null,null,i);else t.history.pushState(null,null,i);return}if(e==="hash"&&t.location.hash==="#"+a){try{document.querySelector("#"+a).focus()}catch(r){}return}a=(e==="hash"?"#":"?")+a;if(a===o)return;if(n==="replace")t.history.replaceState(null,null,i+a);else t.history.pushState(null,null,i+a)};const dt=(r,e,t="hash",n=window,o="replace")=>{r=Object.keys(pt.parse(r))[0];const i={};i[r]=e;let a=lt(t,n);a=Object.assign(Object.assign({},a),i);vt(a,t,n,o)};const bt=(r,e="hash",t=window)=>{r=Object.keys(pt.parse(r))[0];const n=lt(e,t);return n[r]||null};const ht=(r,e,t=window)=>{try{if(!e){t.sessionStorage.removeItem(st+r);return}t.sessionStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const mt=(r,e=window)=>{try{const t=e.sessionStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const gt=(r,e,t=window)=>{try{if(!e){t.localStorage.removeItem(st+r);return}t.localStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const St=(r,e=window)=>{try{const t=e.localStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const jt=new Map;const At={init(e,t,n,o){const i=o||e.storeId||r(e).id;if(!i){console.error("No id set. You can only instantiate a new component store with an id. ");return}if(jt.get(i)){console.error("Duplicate store id usage. A store ID must be unique!",i);return}const a=t.reduce(((r,t)=>{if(typeof e[t]!==undefined)r[t]=e[t];return r}),{});jt.set(i,new wt(i,e,t,a,n));const f=jt.get(i);f.dispatchToProps();const u=e.connectedCallback;e.connectedCallback=function(){jt.set(i,new wt(i,e,t,a,n));const r=jt.get(i);if(u){u.call(e)}if(r)r.dispatchToProps()};const c=e.componentDidRender;e.componentDidRender=function(){const r=jt.get(i);if(c){c.call(e)}if(r)r.savePropsToStore()};const y=e.disconnectedCallback;e.disconnectedCallback=function(){const r=jt.get(i);if(r)r.delete();jt.delete(i);if(y){y.call(e)}}}};class wt{constructor(r,t,n,o,i){this.method="session";this.initialState={};this.updateStore=true;this.onUrlChange=()=>{this.dispatchToProps(false)};this.savePropsToStore=()=>{if(this.updateStore){this.save(this.getData)}else if(!this.updateStore)this.updateStore=true};this.dispatchToProps=(r=true)=>{const e=this.retrieve();if(!e&&r)return;this.updateStore=r;this.keys.forEach((r=>{this.component[r]=e?e[r]:undefined}))};this.delete=()=>{if(this.method==="url-hash-push"||this.method==="url-query-push"){window.removeEventListener("popstate",this.onUrlChange)}};if(!r)throw new Error("No id set. You can only instantiate a new component store with an id");this.id=r;this.keys=n;this.component=t;if(o)this.initialState=o;if(i)this.method=i;this.savePropsToStore=e(this.savePropsToStore,500);if(this.method==="url-hash-push"||this.method==="url-query-push"){window.addEventListener("popstate",this.onUrlChange)}}equality(r,e){if(typeof r!==typeof e)return false;if(typeof r!=="object")return r===e;return JSON.stringify(r)===JSON.stringify(e)}get getData(){const r=this.keys.reduce(((r,e)=>{const t=this.equality(this.component[e],this.initialState[e]);if(typeof this.component[e]!=="undefined"&&!t){r[e]=this.component[e]}else if(t)delete r[e];return r}),{});return Object.keys(r).length?r:undefined}retrieve(){switch(this.method){case"url-hash":case"url-hash-push":return bt(this.id,"hash");case"url-query":case"url-query-push":return bt(this.id,"query");case"local":return St(this.id);default:return mt(this.id)}}save(r){switch(this.method){case"url-hash":return dt(this.id,r,"hash");case"url-query":return dt(this.id,r,"query");case"url-hash-push":return dt(this.id,r,"hash",window,"push");case"url-query-push":return dt(this.id,r,"query",window,"push");case"local":return gt(this.id,r);default:return ht(this.id,r)}}}export{At as C};
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{g as r}from"./p-f6a8467a.js";import{d as e}from"./p-9746b0a5.js";import{c as t,g as n}from"./p-69a3e911.js";var o=function r(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function"){return false}if(typeof Symbol.iterator==="symbol"){return true}var e={};var t=Symbol("test");var n=Object(t);if(typeof t==="string"){return false}if(Object.prototype.toString.call(t)!=="[object Symbol]"){return false}if(Object.prototype.toString.call(n)!=="[object Symbol]"){return false}var o=42;e[t]=o;for(t in e){return false}if(typeof Object.keys==="function"&&Object.keys(e).length!==0){return false}if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(e).length!==0){return false}var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==t){return false}if(!Object.prototype.propertyIsEnumerable.call(e,t)){return false}if(typeof Object.getOwnPropertyDescriptor==="function"){var a=Object.getOwnPropertyDescriptor(e,t);if(a.value!==o||a.enumerable!==true){return false}}return true};var i=typeof Symbol!=="undefined"&&Symbol;var a=function r(){if(typeof i!=="function"){return false}if(typeof Symbol!=="function"){return false}if(typeof i("foo")!=="symbol"){return false}if(typeof Symbol("bar")!=="symbol"){return false}return o()};var f="Function.prototype.bind called on incompatible ";var u=Array.prototype.slice;var c=Object.prototype.toString;var y="[object Function]";var p=function r(e){var t=this;if(typeof t!=="function"||c.call(t)!==y){throw new TypeError(f+t)}var n=u.call(arguments,1);var o;var i=function(){if(this instanceof o){var r=t.apply(this,n.concat(u.call(arguments)));if(Object(r)===r){return r}return this}else{return t.apply(e,n.concat(u.call(arguments)))}};var a=Math.max(0,t.length-n.length);var p=[];for(var s=0;s<a;s++){p.push("$"+s)}o=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(i);if(t.prototype){var l=function r(){};l.prototype=t.prototype;o.prototype=new l;l.prototype=null}return o};var s=Function.prototype.bind||p;var l=s.call(Function.call,Object.prototype.hasOwnProperty);var v;var d=SyntaxError;var b=Function;var h=TypeError;var m=function(r){try{return b('"use strict"; return ('+r+").constructor;")()}catch(r){}};var g=Object.getOwnPropertyDescriptor;var S=function(){throw new h};var j=g?function(){try{return S}catch(r){try{return g(arguments,"callee").get}catch(r){return S}}}():S;var A=a();var w=Object.getPrototypeOf||function(r){return r.__proto__};var O={};var P=typeof Uint8Array==="undefined"?v:w(Uint8Array);var E={"%AggregateError%":typeof AggregateError==="undefined"?v:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer==="undefined"?v:ArrayBuffer,"%ArrayIteratorPrototype%":A?w([][Symbol.iterator]()):v,"%AsyncFromSyncIteratorPrototype%":v,"%AsyncFunction%":O,"%AsyncGenerator%":O,"%AsyncGeneratorFunction%":O,"%AsyncIteratorPrototype%":O,"%Atomics%":typeof Atomics==="undefined"?v:Atomics,"%BigInt%":typeof BigInt==="undefined"?v:BigInt,"%BigInt64Array%":typeof BigInt64Array==="undefined"?v:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array==="undefined"?v:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView==="undefined"?v:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array==="undefined"?v:Float32Array,"%Float64Array%":typeof Float64Array==="undefined"?v:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry==="undefined"?v:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":O,"%Int8Array%":typeof Int8Array==="undefined"?v:Int8Array,"%Int16Array%":typeof Int16Array==="undefined"?v:Int16Array,"%Int32Array%":typeof Int32Array==="undefined"?v:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A?w(w([][Symbol.iterator]())):v,"%JSON%":typeof JSON==="object"?JSON:v,"%Map%":typeof Map==="undefined"?v:Map,"%MapIteratorPrototype%":typeof Map==="undefined"||!A?v:w((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise==="undefined"?v:Promise,"%Proxy%":typeof Proxy==="undefined"?v:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect==="undefined"?v:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set==="undefined"?v:Set,"%SetIteratorPrototype%":typeof Set==="undefined"||!A?v:w((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer==="undefined"?v:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A?w(""[Symbol.iterator]()):v,"%Symbol%":A?Symbol:v,"%SyntaxError%":d,"%ThrowTypeError%":j,"%TypedArray%":P,"%TypeError%":h,"%Uint8Array%":typeof Uint8Array==="undefined"?v:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray==="undefined"?v:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array==="undefined"?v:Uint16Array,"%Uint32Array%":typeof Uint32Array==="undefined"?v:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap==="undefined"?v:WeakMap,"%WeakRef%":typeof WeakRef==="undefined"?v:WeakRef,"%WeakSet%":typeof WeakSet==="undefined"?v:WeakSet};var I=function r(e){var t;if(e==="%AsyncFunction%"){t=m("async function () {}")}else if(e==="%GeneratorFunction%"){t=m("function* () {}")}else if(e==="%AsyncGeneratorFunction%"){t=m("async function* () {}")}else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");if(n){t=n.prototype}}else if(e==="%AsyncIteratorPrototype%"){var o=r("%AsyncGenerator%");if(o){t=w(o.prototype)}}E[e]=t;return t};var F={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]};var R=s.call(Function.call,Array.prototype.concat);var k=s.call(Function.apply,Array.prototype.splice);var M=s.call(Function.call,String.prototype.replace);var x=s.call(Function.call,String.prototype.slice);var U=s.call(Function.call,RegExp.prototype.exec);var N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;var B=/\\(\\)?/g;var W=function r(e){var t=x(e,0,1);var n=x(e,-1);if(t==="%"&&n!=="%"){throw new d("invalid intrinsic syntax, expected closing `%`")}else if(n==="%"&&t!=="%"){throw new d("invalid intrinsic syntax, expected opening `%`")}var o=[];M(e,N,(function(r,e,t,n){o[o.length]=t?M(n,B,"$1"):e||r}));return o};var T=function r(e,t){var n=e;var o;if(l(F,n)){o=F[n];n="%"+o[0]+"%"}if(l(E,n)){var i=E[n];if(i===O){i=I(n)}if(typeof i==="undefined"&&!t){throw new h("intrinsic "+e+" exists, but is not available. Please file an issue!")}return{alias:o,name:n,value:i}}throw new d("intrinsic "+e+" does not exist!")};var D=function r(e,t){if(typeof e!=="string"||e.length===0){throw new h("intrinsic name must be a non-empty string")}if(arguments.length>1&&typeof t!=="boolean"){throw new h('"allowMissing" argument must be a boolean')}if(U(/^%?[^%]*%?$/,e)===null){throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name")}var n=W(e);var o=n.length>0?n[0]:"";var i=T("%"+o+"%",t);var a=i.name;var f=i.value;var u=false;var c=i.alias;if(c){o=c[0];k(n,R([0,1],c))}for(var y=1,p=true;y<n.length;y+=1){var s=n[y];var b=x(s,0,1);var m=x(s,-1);if((b==='"'||b==="'"||b==="`"||(m==='"'||m==="'"||m==="`"))&&b!==m){throw new d("property names with quotes must have matching quotes")}if(s==="constructor"||!p){u=true}o+="."+s;a="%"+o+"%";if(l(E,a)){f=E[a]}else if(f!=null){if(!(s in f)){if(!t){throw new h("base intrinsic for "+e+" exists, but the property is not available.")}return void v}if(g&&y+1>=n.length){var S=g(f,s);p=!!S;if(p&&"get"in S&&!("originalValue"in S.get)){f=S.get}else{f=f[s]}}else{p=l(f,s);f=f[s]}if(p&&!u){E[a]=f}}}return f};var C=t((function(r){var e=D("%Function.prototype.apply%");var t=D("%Function.prototype.call%");var n=D("%Reflect.apply%",true)||s.call(t,e);var o=D("%Object.getOwnPropertyDescriptor%",true);var i=D("%Object.defineProperty%",true);var a=D("%Math.max%");if(i){try{i({},"a",{value:1})}catch(r){i=null}}r.exports=function r(e){var f=n(s,t,arguments);if(o&&i){var u=o(f,"length");if(u.configurable){i(f,"length",{value:1+a(0,e.length-(arguments.length-1))})}}return f};var f=function r(){return n(s,e,arguments)};if(i){i(r.exports,"apply",{value:f})}else{r.exports.apply=f}}));var _=C(D("String.prototype.indexOf"));var q=function r(e,t){var n=D(e,!!t);if(typeof n==="function"&&_(e,".prototype.")>-1){return C(n)}return n};const G={};const $=Object.freeze({__proto__:null,default:G});const J=n($);var V=typeof Map==="function"&&Map.prototype;var H=Object.getOwnPropertyDescriptor&&V?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null;var L=V&&H&&typeof H.get==="function"?H.get:null;var z=V&&Map.prototype.forEach;var Q=typeof Set==="function"&&Set.prototype;var Y=Object.getOwnPropertyDescriptor&&Q?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null;var K=Q&&Y&&typeof Y.get==="function"?Y.get:null;var X=Q&&Set.prototype.forEach;var Z=typeof WeakMap==="function"&&WeakMap.prototype;var rr=Z?WeakMap.prototype.has:null;var er=typeof WeakSet==="function"&&WeakSet.prototype;var tr=er?WeakSet.prototype.has:null;var nr=typeof WeakRef==="function"&&WeakRef.prototype;var or=nr?WeakRef.prototype.deref:null;var ir=Boolean.prototype.valueOf;var ar=Object.prototype.toString;var fr=Function.prototype.toString;var ur=String.prototype.match;var cr=String.prototype.slice;var yr=String.prototype.replace;var pr=String.prototype.toUpperCase;var sr=String.prototype.toLowerCase;var lr=RegExp.prototype.test;var vr=Array.prototype.concat;var dr=Array.prototype.join;var br=Array.prototype.slice;var hr=Math.floor;var mr=typeof BigInt==="function"?BigInt.prototype.valueOf:null;var gr=Object.getOwnPropertySymbols;var Sr=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol.prototype.toString:null;var jr=typeof Symbol==="function"&&typeof Symbol.iterator==="object";var Ar=typeof Symbol==="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===jr?"object":"symbol")?Symbol.toStringTag:null;var wr=Object.prototype.propertyIsEnumerable;var Or=(typeof Reflect==="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Pr(r,e){if(r===Infinity||r===-Infinity||r!==r||r&&r>-1e3&&r<1e3||lr.call(/e/,e)){return e}var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r==="number"){var n=r<0?-hr(-r):hr(r);if(n!==r){var o=String(n);var i=cr.call(e,o.length+1);return yr.call(o,t,"$&_")+"."+yr.call(yr.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yr.call(e,t,"$&_")}var Er=J.custom;var Ir=Dr(Er)?Er:null;var Fr=function r(e,t,n,o){var i=t||{};if(qr(i,"quoteStyle")&&(i.quoteStyle!=="single"&&i.quoteStyle!=="double")){throw new TypeError('option "quoteStyle" must be "single" or "double"')}if(qr(i,"maxStringLength")&&(typeof i.maxStringLength==="number"?i.maxStringLength<0&&i.maxStringLength!==Infinity:i.maxStringLength!==null)){throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`')}var a=qr(i,"customInspect")?i.customInspect:true;if(typeof a!=="boolean"&&a!=="symbol"){throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`")}if(qr(i,"indent")&&i.indent!==null&&i.indent!=="\t"&&!(parseInt(i.indent,10)===i.indent&&i.indent>0)){throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`')}if(qr(i,"numericSeparator")&&typeof i.numericSeparator!=="boolean"){throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`')}var f=i.numericSeparator;if(typeof e==="undefined"){return"undefined"}if(e===null){return"null"}if(typeof e==="boolean"){return e?"true":"false"}if(typeof e==="string"){return Kr(e,i)}if(typeof e==="number"){if(e===0){return Infinity/e>0?"0":"-0"}var u=String(e);return f?Pr(e,u):u}if(typeof e==="bigint"){var c=String(e)+"n";return f?Pr(e,c):c}var y=typeof i.depth==="undefined"?5:i.depth;if(typeof n==="undefined"){n=0}if(n>=y&&y>0&&typeof e==="object"){return Mr(e)?"[Array]":"[Object]"}var p=ne(i,n);if(typeof o==="undefined"){o=[]}else if(Jr(o,e)>=0){return"[Circular]"}function s(e,t,a){if(t){o=br.call(o);o.push(t)}if(a){var f={depth:i.depth};if(qr(i,"quoteStyle")){f.quoteStyle=i.quoteStyle}return r(e,f,n+1,o)}return r(e,i,n+1,o)}if(typeof e==="function"&&!Ur(e)){var l=$r(e);var v=ie(e,s);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(v.length>0?" { "+dr.call(v,", ")+" }":"")}if(Dr(e)){var d=jr?yr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Sr.call(e);return typeof e==="object"&&!jr?Zr(d):d}if(Yr(e)){var b="<"+sr.call(String(e.nodeName));var h=e.attributes||[];for(var m=0;m<h.length;m++){b+=" "+h[m].name+"="+Rr(kr(h[m].value),"double",i)}b+=">";if(e.childNodes&&e.childNodes.length){b+="..."}b+="</"+sr.call(String(e.nodeName))+">";return b}if(Mr(e)){if(e.length===0){return"[]"}var g=ie(e,s);if(p&&!te(g)){return"["+oe(g,p)+"]"}return"[ "+dr.call(g,", ")+" ]"}if(Nr(e)){var S=ie(e,s);if(!("cause"in Error.prototype)&&"cause"in e&&!wr.call(e,"cause")){return"{ ["+String(e)+"] "+dr.call(vr.call("[cause]: "+s(e.cause),S),", ")+" }"}if(S.length===0){return"["+String(e)+"]"}return"{ ["+String(e)+"] "+dr.call(S,", ")+" }"}if(typeof e==="object"&&a){if(Ir&&typeof e[Ir]==="function"&&J){return J(e,{depth:y-n})}else if(a!=="symbol"&&typeof e.inspect==="function"){return e.inspect()}}if(Vr(e)){var j=[];if(z){z.call(e,(function(r,t){j.push(s(t,e,true)+" => "+s(r,e))}))}return ee("Map",L.call(e),j,p)}if(zr(e)){var A=[];if(X){X.call(e,(function(r){A.push(s(r,e))}))}return ee("Set",K.call(e),A,p)}if(Hr(e)){return re("WeakMap")}if(Qr(e)){return re("WeakSet")}if(Lr(e)){return re("WeakRef")}if(Wr(e)){return Zr(s(Number(e)))}if(Cr(e)){return Zr(s(mr.call(e)))}if(Tr(e)){return Zr(ir.call(e))}if(Br(e)){return Zr(s(String(e)))}if(!xr(e)&&!Ur(e)){var w=ie(e,s);var O=Or?Or(e)===Object.prototype:e instanceof Object||e.constructor===Object;var P=e instanceof Object?"":"null prototype";var E=!O&&Ar&&Object(e)===e&&Ar in e?cr.call(Gr(e),8,-1):P?"Object":"";var I=O||typeof e.constructor!=="function"?"":e.constructor.name?e.constructor.name+" ":"";var F=I+(E||P?"["+dr.call(vr.call([],E||[],P||[]),": ")+"] ":"");if(w.length===0){return F+"{}"}if(p){return F+"{"+oe(w,p)+"}"}return F+"{ "+dr.call(w,", ")+" }"}return String(e)};function Rr(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function kr(r){return yr.call(String(r),/"/g,""")}function Mr(r){return Gr(r)==="[object Array]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function xr(r){return Gr(r)==="[object Date]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Ur(r){return Gr(r)==="[object RegExp]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Nr(r){return Gr(r)==="[object Error]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Br(r){return Gr(r)==="[object String]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Wr(r){return Gr(r)==="[object Number]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Tr(r){return Gr(r)==="[object Boolean]"&&(!Ar||!(typeof r==="object"&&Ar in r))}function Dr(r){if(jr){return r&&typeof r==="object"&&r instanceof Symbol}if(typeof r==="symbol"){return true}if(!r||typeof r!=="object"||!Sr){return false}try{Sr.call(r);return true}catch(r){}return false}function Cr(r){if(!r||typeof r!=="object"||!mr){return false}try{mr.call(r);return true}catch(r){}return false}var _r=Object.prototype.hasOwnProperty||function(r){return r in this};function qr(r,e){return _r.call(r,e)}function Gr(r){return ar.call(r)}function $r(r){if(r.name){return r.name}var e=ur.call(fr.call(r),/^function\s*([\w$]+)/);if(e){return e[1]}return null}function Jr(r,e){if(r.indexOf){return r.indexOf(e)}for(var t=0,n=r.length;t<n;t++){if(r[t]===e){return t}}return-1}function Vr(r){if(!L||!r||typeof r!=="object"){return false}try{L.call(r);try{K.call(r)}catch(r){return true}return r instanceof Map}catch(r){}return false}function Hr(r){if(!rr||!r||typeof r!=="object"){return false}try{rr.call(r,rr);try{tr.call(r,tr)}catch(r){return true}return r instanceof WeakMap}catch(r){}return false}function Lr(r){if(!or||!r||typeof r!=="object"){return false}try{or.call(r);return true}catch(r){}return false}function zr(r){if(!K||!r||typeof r!=="object"){return false}try{K.call(r);try{L.call(r)}catch(r){return true}return r instanceof Set}catch(r){}return false}function Qr(r){if(!tr||!r||typeof r!=="object"){return false}try{tr.call(r,tr);try{rr.call(r,rr)}catch(r){return true}return r instanceof WeakSet}catch(r){}return false}function Yr(r){if(!r||typeof r!=="object"){return false}if(typeof HTMLElement!=="undefined"&&r instanceof HTMLElement){return true}return typeof r.nodeName==="string"&&typeof r.getAttribute==="function"}function Kr(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength;var n="... "+t+" more character"+(t>1?"s":"");return Kr(cr.call(r,0,e.maxStringLength),e)+n}var o=yr.call(yr.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Xr);return Rr(o,"single",e)}function Xr(r){var e=r.charCodeAt(0);var t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];if(t){return"\\"+t}return"\\x"+(e<16?"0":"")+pr.call(e.toString(16))}function Zr(r){return"Object("+r+")"}function re(r){return r+" { ? }"}function ee(r,e,t,n){var o=n?oe(t,n):dr.call(t,", ");return r+" ("+e+") {"+o+"}"}function te(r){for(var e=0;e<r.length;e++){if(Jr(r[e],"\n")>=0){return false}}return true}function ne(r,e){var t;if(r.indent==="\t"){t="\t"}else if(typeof r.indent==="number"&&r.indent>0){t=dr.call(Array(r.indent+1)," ")}else{return null}return{base:t,prev:dr.call(Array(e+1),t)}}function oe(r,e){if(r.length===0){return""}var t="\n"+e.prev+e.base;return t+dr.call(r,","+t)+"\n"+e.prev}function ie(r,e){var t=Mr(r);var n=[];if(t){n.length=r.length;for(var o=0;o<r.length;o++){n[o]=qr(r,o)?e(r[o],r):""}}var i=typeof gr==="function"?gr(r):[];var a;if(jr){a={};for(var f=0;f<i.length;f++){a["$"+i[f]]=i[f]}}for(var u in r){if(!qr(r,u)){continue}if(t&&String(Number(u))===u&&u<r.length){continue}if(jr&&a["$"+u]instanceof Symbol){continue}else if(lr.call(/[^\w$]/,u)){n.push(e(u,r)+": "+e(r[u],r))}else{n.push(u+": "+e(r[u],r))}}if(typeof gr==="function"){for(var c=0;c<i.length;c++){if(wr.call(r,i[c])){n.push("["+e(i[c])+"]: "+e(r[i[c]],r))}}}return n}var ae=D("%TypeError%");var fe=D("%WeakMap%",true);var ue=D("%Map%",true);var ce=q("WeakMap.prototype.get",true);var ye=q("WeakMap.prototype.set",true);var pe=q("WeakMap.prototype.has",true);var se=q("Map.prototype.get",true);var le=q("Map.prototype.set",true);var ve=q("Map.prototype.has",true);var de=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n){if(n.key===e){t.next=n.next;n.next=r.next;r.next=n;return n}}};var be=function(r,e){var t=de(r,e);return t&&t.value};var he=function(r,e,t){var n=de(r,e);if(n){n.value=t}else{r.next={key:e,next:r.next,value:t}}};var me=function(r,e){return!!de(r,e)};var ge=function r(){var e;var t;var n;var o={assert:function(r){if(!o.has(r)){throw new ae("Side channel does not contain "+Fr(r))}},get:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return ce(e,r)}}else if(ue){if(t){return se(t,r)}}else{if(n){return be(n,r)}}},has:function(r){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(e){return pe(e,r)}}else if(ue){if(t){return ve(t,r)}}else{if(n){return me(n,r)}}return false},set:function(r,o){if(fe&&r&&(typeof r==="object"||typeof r==="function")){if(!e){e=new fe}ye(e,r,o)}else if(ue){if(!t){t=new ue}le(t,r,o)}else{if(!n){n={key:{},next:null}}he(n,r,o)}}};return o};var Se=String.prototype.replace;var je=/%20/g;var Ae={RFC1738:"RFC1738",RFC3986:"RFC3986"};var we={default:Ae.RFC3986,formatters:{RFC1738:function(r){return Se.call(r,je,"+")},RFC3986:function(r){return String(r)}},RFC1738:Ae.RFC1738,RFC3986:Ae.RFC3986};var Oe=Object.prototype.hasOwnProperty;var Pe=Array.isArray;var Ee=function(){var r=[];for(var e=0;e<256;++e){r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase())}return r}();var Ie=function r(e){while(e.length>1){var t=e.pop();var n=t.obj[t.prop];if(Pe(n)){var o=[];for(var i=0;i<n.length;++i){if(typeof n[i]!=="undefined"){o.push(n[i])}}t.obj[t.prop]=o}}};var Fe=function r(e,t){var n=t&&t.plainObjects?Object.create(null):{};for(var o=0;o<e.length;++o){if(typeof e[o]!=="undefined"){n[o]=e[o]}}return n};var Re=function r(e,t,n){if(!t){return e}if(typeof t!=="object"){if(Pe(e)){e.push(t)}else if(e&&typeof e==="object"){if(n&&(n.plainObjects||n.allowPrototypes)||!Oe.call(Object.prototype,t)){e[t]=true}}else{return[e,t]}return e}if(!e||typeof e!=="object"){return[e].concat(t)}var o=e;if(Pe(e)&&!Pe(t)){o=Fe(e,n)}if(Pe(e)&&Pe(t)){t.forEach((function(t,o){if(Oe.call(e,o)){var i=e[o];if(i&&typeof i==="object"&&t&&typeof t==="object"){e[o]=r(i,t,n)}else{e.push(t)}}else{e[o]=t}}));return e}return Object.keys(t).reduce((function(e,o){var i=t[o];if(Oe.call(e,o)){e[o]=r(e[o],i,n)}else{e[o]=i}return e}),o)};var ke=function r(e,t){return Object.keys(t).reduce((function(r,e){r[e]=t[e];return r}),e)};var Me=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1"){return n.replace(/%[0-9a-f]{2}/gi,unescape)}try{return decodeURIComponent(n)}catch(r){return n}};var xe=function r(e,t,n,o,i){if(e.length===0){return e}var a=e;if(typeof e==="symbol"){a=Symbol.prototype.toString.call(e)}else if(typeof e!=="string"){a=String(e)}if(n==="iso-8859-1"){return escape(a).replace(/%u[0-9a-f]{4}/gi,(function(r){return"%26%23"+parseInt(r.slice(2),16)+"%3B"}))}var f="";for(var u=0;u<a.length;++u){var c=a.charCodeAt(u);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||i===we.RFC1738&&(c===40||c===41)){f+=a.charAt(u);continue}if(c<128){f=f+Ee[c];continue}if(c<2048){f=f+(Ee[192|c>>6]+Ee[128|c&63]);continue}if(c<55296||c>=57344){f=f+(Ee[224|c>>12]+Ee[128|c>>6&63]+Ee[128|c&63]);continue}u+=1;c=65536+((c&1023)<<10|a.charCodeAt(u)&1023);f+=Ee[240|c>>18]+Ee[128|c>>12&63]+Ee[128|c>>6&63]+Ee[128|c&63]}return f};var Ue=function r(e){var t=[{obj:{o:e},prop:"o"}];var n=[];for(var o=0;o<t.length;++o){var i=t[o];var a=i.obj[i.prop];var f=Object.keys(a);for(var u=0;u<f.length;++u){var c=f[u];var y=a[c];if(typeof y==="object"&&y!==null&&n.indexOf(y)===-1){t.push({obj:a,prop:c});n.push(y)}}}Ie(t);return e};var Ne=function r(e){return Object.prototype.toString.call(e)==="[object RegExp]"};var Be=function r(e){if(!e||typeof e!=="object"){return false}return!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))};var We=function r(e,t){return[].concat(e,t)};var Te=function r(e,t){if(Pe(e)){var n=[];for(var o=0;o<e.length;o+=1){n.push(t(e[o]))}return n}return t(e)};var De={arrayToObject:Fe,assign:ke,combine:We,compact:Ue,decode:Me,encode:xe,isBuffer:Be,isRegExp:Ne,maybeMap:Te,merge:Re};var Ce=Object.prototype.hasOwnProperty;var _e={brackets:function r(e){return e+"[]"},comma:"comma",indices:function r(e,t){return e+"["+t+"]"},repeat:function r(e){return e}};var qe=Array.isArray;var Ge=String.prototype.split;var $e=Array.prototype.push;var Je=function(r,e){$e.apply(r,qe(e)?e:[e])};var Ve=Date.prototype.toISOString;var He=we["default"];var Le={addQueryPrefix:false,allowDots:false,charset:"utf-8",charsetSentinel:false,delimiter:"&",encode:true,encoder:De.encode,encodeValuesOnly:false,format:He,formatter:we.formatters[He],indices:false,serializeDate:function r(e){return Ve.call(e)},skipNulls:false,strictNullHandling:false};var ze=function r(e){return typeof e==="string"||typeof e==="number"||typeof e==="boolean"||typeof e==="symbol"||typeof e==="bigint"};var Qe={};var Ye=function r(e,t,n,o,i,a,f,u,c,y,p,s,l,v,d,b){var h=e;var m=b;var g=0;var S=false;while((m=m.get(Qe))!==void undefined&&!S){var j=m.get(e);g+=1;if(typeof j!=="undefined"){if(j===g){throw new RangeError("Cyclic object value")}else{S=true}}if(typeof m.get(Qe)==="undefined"){g=0}}if(typeof u==="function"){h=u(t,h)}else if(h instanceof Date){h=p(h)}else if(n==="comma"&&qe(h)){h=De.maybeMap(h,(function(r){if(r instanceof Date){return p(r)}return r}))}if(h===null){if(i){return f&&!v?f(t,Le.encoder,d,"key",s):t}h=""}if(ze(h)||De.isBuffer(h)){if(f){var A=v?t:f(t,Le.encoder,d,"key",s);if(n==="comma"&&v){var w=Ge.call(String(h),",");var O="";for(var P=0;P<w.length;++P){O+=(P===0?"":",")+l(f(w[P],Le.encoder,d,"value",s))}return[l(A)+(o&&qe(h)&&w.length===1?"[]":"")+"="+O]}return[l(A)+"="+l(f(h,Le.encoder,d,"value",s))]}return[l(t)+"="+l(String(h))]}var E=[];if(typeof h==="undefined"){return E}var I;if(n==="comma"&&qe(h)){I=[{value:h.length>0?h.join(",")||null:void undefined}]}else if(qe(u)){I=u}else{var F=Object.keys(h);I=c?F.sort(c):F}var R=o&&qe(h)&&h.length===1?t+"[]":t;for(var k=0;k<I.length;++k){var M=I[k];var x=typeof M==="object"&&typeof M.value!=="undefined"?M.value:h[M];if(a&&x===null){continue}var U=qe(h)?typeof n==="function"?n(R,M):R:R+(y?"."+M:"["+M+"]");b.set(e,g);var N=ge();N.set(Qe,b);Je(E,r(x,U,n,o,i,a,f,u,c,y,p,s,l,v,d,N))}return E};var Ke=function r(e){if(!e){return Le}if(e.encoder!==null&&typeof e.encoder!=="undefined"&&typeof e.encoder!=="function"){throw new TypeError("Encoder has to be a function.")}var t=e.charset||Le.charset;if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var n=we["default"];if(typeof e.format!=="undefined"){if(!Ce.call(we.formatters,e.format)){throw new TypeError("Unknown format option provided.")}n=e.format}var o=we.formatters[n];var i=Le.filter;if(typeof e.filter==="function"||qe(e.filter)){i=e.filter}return{addQueryPrefix:typeof e.addQueryPrefix==="boolean"?e.addQueryPrefix:Le.addQueryPrefix,allowDots:typeof e.allowDots==="undefined"?Le.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:Le.charsetSentinel,delimiter:typeof e.delimiter==="undefined"?Le.delimiter:e.delimiter,encode:typeof e.encode==="boolean"?e.encode:Le.encode,encoder:typeof e.encoder==="function"?e.encoder:Le.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==="boolean"?e.encodeValuesOnly:Le.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate==="function"?e.serializeDate:Le.serializeDate,skipNulls:typeof e.skipNulls==="boolean"?e.skipNulls:Le.skipNulls,sort:typeof e.sort==="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:Le.strictNullHandling}};var Xe=function(r,e){var t=r;var n=Ke(e);var o;var i;if(typeof n.filter==="function"){i=n.filter;t=i("",t)}else if(qe(n.filter)){i=n.filter;o=i}var a=[];if(typeof t!=="object"||t===null){return""}var f;if(e&&e.arrayFormat in _e){f=e.arrayFormat}else if(e&&"indices"in e){f=e.indices?"indices":"repeat"}else{f="indices"}var u=_e[f];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!=="boolean"){throw new TypeError("`commaRoundTrip` must be a boolean, or absent")}var c=u==="comma"&&e&&e.commaRoundTrip;if(!o){o=Object.keys(t)}if(n.sort){o.sort(n.sort)}var y=ge();for(var p=0;p<o.length;++p){var s=o[p];if(n.skipNulls&&t[s]===null){continue}Je(a,Ye(t[s],s,u,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,y))}var l=a.join(n.delimiter);var v=n.addQueryPrefix===true?"?":"";if(n.charsetSentinel){if(n.charset==="iso-8859-1"){v+="utf8=%26%2310003%3B&"}else{v+="utf8=%E2%9C%93&"}}return l.length>0?v+l:""};var Ze=Object.prototype.hasOwnProperty;var rt=Array.isArray;var et={allowDots:false,allowPrototypes:false,allowSparse:false,arrayLimit:20,charset:"utf-8",charsetSentinel:false,comma:false,decoder:De.decode,delimiter:"&",depth:5,ignoreQueryPrefix:false,interpretNumericEntities:false,parameterLimit:1e3,parseArrays:true,plainObjects:false,strictNullHandling:false};var tt=function(r){return r.replace(/&#(\d+);/g,(function(r,e){return String.fromCharCode(parseInt(e,10))}))};var nt=function(r,e){if(r&&typeof r==="string"&&e.comma&&r.indexOf(",")>-1){return r.split(",")}return r};var ot="utf8=%26%2310003%3B";var it="utf8=%E2%9C%93";var at=function r(e,t){var n={};var o=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;var i=t.parameterLimit===Infinity?undefined:t.parameterLimit;var a=o.split(t.delimiter,i);var f=-1;var u;var c=t.charset;if(t.charsetSentinel){for(u=0;u<a.length;++u){if(a[u].indexOf("utf8=")===0){if(a[u]===it){c="utf-8"}else if(a[u]===ot){c="iso-8859-1"}f=u;u=a.length}}}for(u=0;u<a.length;++u){if(u===f){continue}var y=a[u];var p=y.indexOf("]=");var s=p===-1?y.indexOf("="):p+1;var l,v;if(s===-1){l=t.decoder(y,et.decoder,c,"key");v=t.strictNullHandling?null:""}else{l=t.decoder(y.slice(0,s),et.decoder,c,"key");v=De.maybeMap(nt(y.slice(s+1),t),(function(r){return t.decoder(r,et.decoder,c,"value")}))}if(v&&t.interpretNumericEntities&&c==="iso-8859-1"){v=tt(v)}if(y.indexOf("[]=")>-1){v=rt(v)?[v]:v}if(Ze.call(n,l)){n[l]=De.combine(n[l],v)}else{n[l]=v}}return n};var ft=function(r,e,t,n){var o=n?e:nt(e,t);for(var i=r.length-1;i>=0;--i){var a;var f=r[i];if(f==="[]"&&t.parseArrays){a=[].concat(o)}else{a=t.plainObjects?Object.create(null):{};var u=f.charAt(0)==="["&&f.charAt(f.length-1)==="]"?f.slice(1,-1):f;var c=parseInt(u,10);if(!t.parseArrays&&u===""){a={0:o}}else if(!isNaN(c)&&f!==u&&String(c)===u&&c>=0&&(t.parseArrays&&c<=t.arrayLimit)){a=[];a[c]=o}else if(u!=="__proto__"){a[u]=o}}o=a}return o};var ut=function r(e,t,n,o){if(!e){return}var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;var a=/(\[[^[\]]*])/;var f=/(\[[^[\]]*])/g;var u=n.depth>0&&a.exec(i);var c=u?i.slice(0,u.index):i;var y=[];if(c){if(!n.plainObjects&&Ze.call(Object.prototype,c)){if(!n.allowPrototypes){return}}y.push(c)}var p=0;while(n.depth>0&&(u=f.exec(i))!==null&&p<n.depth){p+=1;if(!n.plainObjects&&Ze.call(Object.prototype,u[1].slice(1,-1))){if(!n.allowPrototypes){return}}y.push(u[1])}if(u){y.push("["+i.slice(u.index)+"]")}return ft(y,t,n,o)};var ct=function r(e){if(!e){return et}if(e.decoder!==null&&e.decoder!==undefined&&typeof e.decoder!=="function"){throw new TypeError("Decoder has to be a function.")}if(typeof e.charset!=="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1"){throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined")}var t=typeof e.charset==="undefined"?et.charset:e.charset;return{allowDots:typeof e.allowDots==="undefined"?et.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes==="boolean"?e.allowPrototypes:et.allowPrototypes,allowSparse:typeof e.allowSparse==="boolean"?e.allowSparse:et.allowSparse,arrayLimit:typeof e.arrayLimit==="number"?e.arrayLimit:et.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel==="boolean"?e.charsetSentinel:et.charsetSentinel,comma:typeof e.comma==="boolean"?e.comma:et.comma,decoder:typeof e.decoder==="function"?e.decoder:et.decoder,delimiter:typeof e.delimiter==="string"||De.isRegExp(e.delimiter)?e.delimiter:et.delimiter,depth:typeof e.depth==="number"||e.depth===false?+e.depth:et.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===true,interpretNumericEntities:typeof e.interpretNumericEntities==="boolean"?e.interpretNumericEntities:et.interpretNumericEntities,parameterLimit:typeof e.parameterLimit==="number"?e.parameterLimit:et.parameterLimit,parseArrays:e.parseArrays!==false,plainObjects:typeof e.plainObjects==="boolean"?e.plainObjects:et.plainObjects,strictNullHandling:typeof e.strictNullHandling==="boolean"?e.strictNullHandling:et.strictNullHandling}};var yt=function(r,e){var t=ct(e);if(r===""||r===null||typeof r==="undefined"){return t.plainObjects?Object.create(null):{}}var n=typeof r==="string"?at(r,t):r;var o=t.plainObjects?Object.create(null):{};var i=Object.keys(n);for(var a=0;a<i.length;++a){var f=i[a];var u=ut(f,n[f],t,typeof r==="string");o=De.merge(o,u,t)}if(t.allowSparse===true){return o}return De.compact(o)};var pt={formats:we,parse:yt,stringify:Xe};const st="nano-component-store:";const lt=(r="hash",e=window)=>{if(!e||!e.location)return{};if(r==="hash"&&e.location.hash)return pt.parse(e.location.hash.replace(/^\#/,""),{strictNullHandling:true});else if(r==="query"&&e.location.search)return pt.parse(e.location.search,{ignoreQueryPrefix:true});return{}};const vt=(r,e="hash",t=window,n="replace")=>{if(!t||!t.history)return;const o=e==="query"?t.location.search:t.location.hash;const i=e==="query"?t.location.pathname:t.location.pathname+t.location.search;let a=pt.stringify(r,{strictNullHandling:true,addQueryPrefix:false,encodeValuesOnly:true});if(!a||!a.length){if(!o||!o.length)return;if(n==="replace")t.history.replaceState(null,null,i);else t.history.pushState(null,null,i);return}if(e==="hash"&&t.location.hash==="#"+a){try{document.querySelector("#"+a).focus()}catch(r){}return}a=(e==="hash"?"#":"?")+a;if(a===o)return;if(n==="replace")t.history.replaceState(null,null,i+a);else t.history.pushState(null,null,i+a)};const dt=(r,e,t="hash",n=window,o="replace")=>{r=Object.keys(pt.parse(r))[0];const i={};i[r]=e;let a=lt(t,n);a=Object.assign(Object.assign({},a),i);vt(a,t,n,o)};const bt=(r,e="hash",t=window)=>{r=Object.keys(pt.parse(r))[0];const n=lt(e,t);return n[r]||null};const ht=(r,e,t=window)=>{try{if(!e){t.sessionStorage.removeItem(st+r);return}t.sessionStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const mt=(r,e=window)=>{try{const t=e.sessionStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const gt=(r,e,t=window)=>{try{if(!e){t.localStorage.removeItem(st+r);return}t.localStorage.setItem(st+r,JSON.stringify(e))}catch(r){throw r}};const St=(r,e=window)=>{try{const t=e.localStorage.getItem(st+r);return t!==null?JSON.parse(t):null}catch(r){throw r}};const jt=new Map;const At={init(e,t,n,o){const i=o||e.storeId||r(e).id;if(!i){console.error("No id set. You can only instantiate a new component store with an id. ");return}if(jt.get(i)){console.error("Duplicate store id usage. A store ID must be unique!",i);return}const a=t.reduce(((r,t)=>{if(typeof e[t]!==undefined)r[t]=e[t];return r}),{});jt.set(i,new wt(i,e,t,a,n));const f=jt.get(i);f.dispatchToProps();const u=e.connectedCallback;e.connectedCallback=function(){jt.set(i,new wt(i,e,t,a,n));const r=jt.get(i);if(u){u.call(e)}if(r)r.dispatchToProps()};const c=e.componentDidRender;e.componentDidRender=function(){const r=jt.get(i);if(c){c.call(e)}if(r)r.savePropsToStore()};const y=e.disconnectedCallback;e.disconnectedCallback=function(){const r=jt.get(i);if(r)r.delete();jt.delete(i);if(y){y.call(e)}}}};class wt{constructor(r,t,n,o,i){this.method="session";this.initialState={};this.updateStore=true;this.onUrlChange=()=>{this.dispatchToProps(false)};this.savePropsToStore=()=>{if(this.updateStore){this.save(this.getData)}else if(!this.updateStore)this.updateStore=true};this.dispatchToProps=(r=true)=>{const e=this.retrieve();if(!e&&r)return;this.updateStore=r;this.keys.forEach((r=>{this.component[r]=e?e[r]:undefined}))};this.delete=()=>{if(this.method==="url-hash-push"||this.method==="url-query-push"){window.removeEventListener("popstate",this.onUrlChange)}};if(!r)throw new Error("No id set. You can only instantiate a new component store with an id");this.id=r;this.keys=n;this.component=t;if(o)this.initialState=o;if(i)this.method=i;this.savePropsToStore=e(this.savePropsToStore,500);if(this.method==="url-hash-push"||this.method==="url-query-push"){window.addEventListener("popstate",this.onUrlChange)}}equality(r,e){if(typeof r!==typeof e)return false;if(typeof r!=="object")return r===e;return JSON.stringify(r)===JSON.stringify(e)}get getData(){const r=this.keys.reduce(((r,e)=>{const t=this.equality(this.component[e],this.initialState[e]);if(typeof this.component[e]!=="undefined"&&!t){r[e]=this.component[e]}else if(t)delete r[e];return r}),{});return Object.keys(r).length?r:undefined}retrieve(){switch(this.method){case"url-hash":case"url-hash-push":return bt(this.id,"hash");case"url-query":case"url-query-push":return bt(this.id,"query");case"local":return St(this.id);default:return mt(this.id)}}save(r){switch(this.method){case"url-hash":return dt(this.id,r,"hash");case"url-query":return dt(this.id,r,"query");case"url-hash-push":return dt(this.id,r,"hash",window,"push");case"url-query-push":return dt(this.id,r,"query",window,"push");case"local":return gt(this.id,r);default:return ht(this.id,r)}}}export{At as C};
|
5
|
+
//# sourceMappingURL=p-a6ff5ca6.js.map
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
2
|
* Web Components for Nanopore digital Web Apps
|
3
3
|
*/
|
4
|
-
import{r as
|
5
|
-
//# sourceMappingURL=p-
|
4
|
+
import{r as a,c as t,h as i,a as n,g as o}from"./p-f6a8467a.js";const e=":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--focus-shadow:var(--nano-control-focus-shadow, 0 0 0 0.1875rem var(--nano-control-focus-color, rgba(144, 198, 231, 0.8)));--padding:0.75rem 1rem;--bg-rgb:var(--nano-layer-bg-rgb, 255 255 255);--active-bg:rgb(var(--bg-rgb) / 100%);--inactive-bg:rgb(var(--bg-rgb) / 70%);--disabled-bg-rgb:var(--bg-rgb);--text-color:#007495;--disabled-text-color:#455556;--active-text-color:#0c5a71;--h-font-size:0.93em;--v-font-size:0.875em;--tab-spacing:0.5rem;--tab-divider-size:0;--tab-divider-color:#90c6e7;--tab-indicator-size:5px;display:inline-block}:host([direction=vertical]){--padding:1rem}:host([direction=vertical]) .nanotab{font-size:var(--v-font-size)}:host([direction=vertical]) .nanotab.nanotab--active{font-weight:600;color:var(--active-text-color)}:host([direction=horizontal]) .nanotab{font-size:var(--h-font-size);-webkit-margin-before:var(--tab-indicator-size);margin-block-start:var(--tab-indicator-size);-webkit-border-end:solid var(--tab-divider-size) var(--tab-divider-color);border-inline-end:solid var(--tab-divider-size) var(--tab-divider-color)}:host([direction=horizontal]) .nanotab.nanotab--active{-webkit-margin-before:0;margin-block-start:0;-webkit-border-before:solid var(--tab-indicator-size) var(--tab-indicator-color);border-block-start:solid var(--tab-indicator-size) var(--tab-indicator-color);background:var(--active-bg);color:var(--active-text-color)}.nanotab{font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;-webkit-margin-end:var(--tab-spacing);margin-inline-end:var(--tab-spacing);padding:var(--padding);display:flex;block-size:100%;inline-size:auto;background:var(--inactive-bg);border-radius:var(--border-radius) var(--border-radius) 0 0;-webkit-user-select:none;user-select:none;cursor:pointer;overflow:visible;white-space:nowrap;align-items:center}.nanotab ::slotted(*){display:flex;align-items:center}:host(:last-of-type) .nanotab{-webkit-margin-end:0;margin-inline-end:0}.nanotab:hover:not(.tab--disabled){text-shadow:0 0 0.01px var(--text-color)}.nanotab:focus{outline:none;outline-style:none;box-shadow:none;border-color:transparent}.nanotab:focus:not(.nanotab--disabled){box-shadow:var(--focus-shadow) inset}.nanotab--disabled{background:rgb(var(--disabled-bg-rgb)/100%);opacity:0.5;cursor:not-allowed;color:var(--disabled-text-color)}.nanotab__close-button{-webkit-margin-start:var(--nano-spacing-small, 8px);margin-inline-start:var(--nano-spacing-small, 8px);-webkit-appearance:none !important;appearance:none !important;--padding:var(--nano-spacing-xsmall, 4px) 0 var(--nano-spacing-xsmall, 4px) var(--nano-spacing-xsmall, 4px) !important}";let r=0;const s=class{constructor(i){a(this,i);this.nanoTabClose=t(this,"nanoTabClose",7);this.tabId=`nano-tab-${++r}`;this.handleCloseClick=()=>{this.nanoTabClose.emit()};this.handleCloseKeydown=a=>{if(a.key===" ")this.handleCloseClick()};this.panel="";this.active=false;this.disabled=false;this.closable=false}async setFocus(){this.tab.focus({preventScroll:true})}async removeFocus(){this.tab.blur()}render(){return i(n,{id:this.host.id||this.tabId},i("div",{part:"base",ref:a=>this.tab=a,class:{nanotab:true,"nanotab--active":this.active,"nanotab--disabled":this.disabled,"nanotab--closable":this.closable},role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",tabindex:this.disabled||!this.active?"-1":"0"},i("slot",null),this.closable&&i("nano-icon-button",{label:"Close this tab",iconName:"light/times",class:"nanotab__close-button",onClick:this.handleCloseClick,onKeyDown:this.handleCloseKeydown,tabIndex:-1})))}get host(){return o(this)}};s.style=e;export{s as nano_tab};
|
5
|
+
//# sourceMappingURL=p-a761ac89.entry.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["tabCss","id","Tab","this","tabId","handleCloseClick","nanoTabClose","emit","handleCloseKeydown","e","key","async","tab","focus","preventScroll","blur","render","h","Host","host","part","ref","el","class","nanotab","active","disabled","closable","role","tabindex","label","iconName","onClick","onKeyDown","tabIndex"],"sources":["./src/components/tabs/tab.scss?tag=nano-tab&encapsulation=shadow","./src/components/tabs/tab.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/layers';\n\n/**\n * @prop --focus-shadow: Defaults to #{$control-focus-style};\n\n * @prop --padding: Defaults to .75rem 1rem on placement 'top' and 1rem on placement 'start';\n\n * @prop --bg-rgb: Defaults to #{$layer-bg-color-rgb};\n * @prop --active-bg: Defaults to rgb(var(--bg-rgb) / 10%);\n * @prop --disabled-bg-rgb: Defaults to var(--bg-rgb);\n * @prop --inactive-bg: Defaults to rgb(var(--bg-rgb) / 70%);\n\n * @prop --text-color: Defaults to #{map.get($colors, blue)};\n * @prop --disabled-text-color: Defaults to #{map.get($colors, darkgrey)};\n * @prop --active-text-color: Defaults to #{map.get($colors, darkblue)};\n\n * @prop --h-font-size: Defaults to .93em;\n * @prop --v-font-size: Defaults to .875em;\n * @prop --tab-spacing: Gap between tabs. Defaults to 1rem;\n * @prop --tab-divider-size: Defaults to 0;\n * @prop --tab-divider-color: Defaults to #{map.get($colors, lightblue)};\n */\n\n:host {\n --focus-shadow: #{$control-focus-style};\n --padding: 0.75rem 1rem;\n --bg-rgb: #{$layer-bg-color-rgb};\n --active-bg: rgb(var(--bg-rgb) / 100%);\n --inactive-bg: rgb(var(--bg-rgb) / 70%);\n --disabled-bg-rgb: var(--bg-rgb);\n --text-color: #{map.get($colors, blue)};\n --disabled-text-color: #{map.get($colors, darkgrey)};\n --active-text-color: #{map.get($colors, darkblue)};\n --h-font-size: 0.93em;\n --v-font-size: 0.875em;\n --tab-spacing: 0.5rem;\n --tab-divider-size: 0;\n --tab-divider-color: #{map.get($colors, lightblue)};\n --tab-indicator-size: 5px;\n\n display: inline-block;\n}\n\n:host([direction='vertical']) {\n --padding: 1rem;\n\n .nanotab {\n font-size: var(--v-font-size);\n\n &.nanotab--active {\n font-weight: 600;\n color: var(--active-text-color);\n }\n }\n}\n\n:host([direction='horizontal']) {\n .nanotab {\n font-size: var(--h-font-size);\n margin-block-start: var(--tab-indicator-size);\n border-inline-end: solid var(--tab-divider-size) var(--tab-divider-color);\n\n &.nanotab--active {\n margin-block-start: 0;\n border-block-start:\n solid var(--tab-indicator-size)\n var(--tab-indicator-color);\n background: var(--active-bg);\n color: var(--active-text-color);\n }\n }\n}\n\n.nanotab {\n @include text-inherit();\n\n margin-inline-end: var(--tab-spacing);\n padding: var(--padding);\n display: flex;\n block-size: 100%;\n inline-size: auto;\n background: var(--inactive-bg);\n border-radius: var(--border-radius) var(--border-radius) 0 0;\n user-select: none;\n cursor: pointer;\n overflow: visible;\n white-space: nowrap;\n align-items: center;\n\n & ::slotted(*) {\n display: flex;\n align-items: center;\n }\n\n :host(:last-of-type) & {\n margin-inline-end: 0;\n }\n\n &:hover:not(.tab--disabled) {\n text-shadow: 0 0 0.01px var(--text-color);\n }\n\n &:focus {\n outline: none;\n outline-style: none;\n box-shadow: none;\n border-color: transparent;\n }\n\n &:focus:not(.nanotab--disabled) {\n box-shadow: var(--focus-shadow) inset;\n }\n\n &--disabled {\n background: rgb(var(--disabled-bg-rgb) / 100%);\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--disabled-text-color);\n }\n\n &__close-button {\n margin-inline-start: #{$spacing-small};\n appearance: none !important;\n\n --padding: #{$spacing-xsmall} !important;\n }\n}\n","import {\n Component,\n Element,\n Host,\n ComponentInterface,\n Method,\n Prop,\n h,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nlet id = 0;\n\n/**\n * @slot - The tab's label.\n */\n\n@Component({\n tag: 'nano-tab',\n styleUrl: 'tab.scss',\n shadow: true,\n})\nexport class Tab implements ComponentInterface {\n private tabId = `nano-tab-${++id}`;\n private tab: HTMLElement;\n\n @Element() host: HTMLNanoTabElement;\n\n /** The name of the tab panel the tab will control. The panel must be located in the same tab group. */\n @Prop({ reflect: true }) panel = '';\n\n /** The active, selected tab. If none active, the first will automatically be selected. */\n @Prop({ reflect: true }) active = false;\n\n /** Set to true to draw the tab in an active state. */\n @Prop({ reflect: true }) disabled = false;\n\n /** When true, the tab will be rendered with a close icon. */\n @Prop() closable = false;\n\n /** Emitted when the tab is closable and the close button is activated. */\n @Event() nanoTabClose: EventEmitter;\n\n /** Sets focus to the tab. */\n @Method()\n async setFocus() {\n this.tab.focus({ preventScroll: true });\n }\n\n /** Removes focus from the tab. */\n @Method()\n async removeFocus() {\n this.tab.blur();\n }\n\n private handleCloseClick = () => {\n this.nanoTabClose.emit();\n };\n\n private handleCloseKeydown = (e: KeyboardEvent) => {\n if (e.key === ' ') this.handleCloseClick();\n };\n\n render() {\n return (\n <Host id={this.host.id || this.tabId}>\n <div\n part=\"base\"\n ref={(el) => (this.tab = el)}\n class={{\n nanotab: true,\n 'nanotab--active': this.active,\n 'nanotab--disabled': this.disabled,\n 'nanotab--closable': this.closable,\n }}\n role=\"tab\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.disabled || !this.active ? '-1' : '0'}\n >\n <slot />\n {this.closable && (\n <nano-icon-button\n label=\"Close this tab\"\n iconName=\"light/times\"\n class=\"nanotab__close-button\"\n onClick={this.handleCloseClick}\n onKeyDown={this.handleCloseKeydown}\n tabIndex={-1}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;gEAAA,MAAMA,EAAS,
|
1
|
+
{"version":3,"names":["tabCss","id","Tab","this","tabId","handleCloseClick","nanoTabClose","emit","handleCloseKeydown","e","key","async","tab","focus","preventScroll","blur","render","h","Host","host","part","ref","el","class","nanotab","active","disabled","closable","role","tabindex","label","iconName","onClick","onKeyDown","tabIndex"],"sources":["./src/components/tabs/tab.scss?tag=nano-tab&encapsulation=shadow","./src/components/tabs/tab.tsx"],"sourcesContent":["@use 'sass:map';\n@use 'sass:list';\n\n@import '../../global/style/utilities/globals';\n@import '../../global/style/nano-theme/form';\n@import '../../global/style/nano-theme/base';\n@import '../../global/style/nano-theme/layers';\n\n/**\n * @prop --focus-shadow: Defaults to #{$control-focus-style};\n\n * @prop --padding: Defaults to .75rem 1rem on placement 'top' and 1rem on placement 'start';\n\n * @prop --bg-rgb: Defaults to #{$layer-bg-color-rgb};\n * @prop --active-bg: Defaults to rgb(var(--bg-rgb) / 10%);\n * @prop --disabled-bg-rgb: Defaults to var(--bg-rgb);\n * @prop --inactive-bg: Defaults to rgb(var(--bg-rgb) / 70%);\n\n * @prop --text-color: Defaults to #{map.get($colors, blue)};\n * @prop --disabled-text-color: Defaults to #{map.get($colors, darkgrey)};\n * @prop --active-text-color: Defaults to #{map.get($colors, darkblue)};\n\n * @prop --h-font-size: Defaults to .93em;\n * @prop --v-font-size: Defaults to .875em;\n * @prop --tab-spacing: Gap between tabs. Defaults to 1rem;\n * @prop --tab-divider-size: Defaults to 0;\n * @prop --tab-divider-color: Defaults to #{map.get($colors, lightblue)};\n */\n\n:host {\n --focus-shadow: #{$control-focus-style};\n --padding: 0.75rem 1rem;\n --bg-rgb: #{$layer-bg-color-rgb};\n --active-bg: rgb(var(--bg-rgb) / 100%);\n --inactive-bg: rgb(var(--bg-rgb) / 70%);\n --disabled-bg-rgb: var(--bg-rgb);\n --text-color: #{map.get($colors, blue)};\n --disabled-text-color: #{map.get($colors, darkgrey)};\n --active-text-color: #{map.get($colors, darkblue)};\n --h-font-size: 0.93em;\n --v-font-size: 0.875em;\n --tab-spacing: 0.5rem;\n --tab-divider-size: 0;\n --tab-divider-color: #{map.get($colors, lightblue)};\n --tab-indicator-size: 5px;\n\n display: inline-block;\n}\n\n:host([direction='vertical']) {\n --padding: 1rem;\n\n .nanotab {\n font-size: var(--v-font-size);\n\n &.nanotab--active {\n font-weight: 600;\n color: var(--active-text-color);\n }\n }\n}\n\n:host([direction='horizontal']) {\n .nanotab {\n font-size: var(--h-font-size);\n margin-block-start: var(--tab-indicator-size);\n border-inline-end: solid var(--tab-divider-size) var(--tab-divider-color);\n\n &.nanotab--active {\n margin-block-start: 0;\n border-block-start:\n solid var(--tab-indicator-size)\n var(--tab-indicator-color);\n background: var(--active-bg);\n color: var(--active-text-color);\n }\n }\n}\n\n.nanotab {\n @include text-inherit();\n\n margin-inline-end: var(--tab-spacing);\n padding: var(--padding);\n display: flex;\n block-size: 100%;\n inline-size: auto;\n background: var(--inactive-bg);\n border-radius: var(--border-radius) var(--border-radius) 0 0;\n user-select: none;\n cursor: pointer;\n overflow: visible;\n white-space: nowrap;\n align-items: center;\n\n & ::slotted(*) {\n display: flex;\n align-items: center;\n }\n\n :host(:last-of-type) & {\n margin-inline-end: 0;\n }\n\n &:hover:not(.tab--disabled) {\n text-shadow: 0 0 0.01px var(--text-color);\n }\n\n &:focus {\n outline: none;\n outline-style: none;\n box-shadow: none;\n border-color: transparent;\n }\n\n &:focus:not(.nanotab--disabled) {\n box-shadow: var(--focus-shadow) inset;\n }\n\n &--disabled {\n background: rgb(var(--disabled-bg-rgb) / 100%);\n opacity: 0.5;\n cursor: not-allowed;\n color: var(--disabled-text-color);\n }\n\n &__close-button {\n margin-inline-start: #{$spacing-small};\n appearance: none !important;\n\n --padding: #{$spacing-xsmall} 0 #{$spacing-xsmall} #{$spacing-xsmall} !important;\n }\n}\n","import {\n Component,\n Element,\n Host,\n ComponentInterface,\n Method,\n Prop,\n h,\n Event,\n EventEmitter,\n} from '@stencil/core';\n\nlet id = 0;\n\n/**\n * @slot - The tab's label.\n */\n\n@Component({\n tag: 'nano-tab',\n styleUrl: 'tab.scss',\n shadow: true,\n})\nexport class Tab implements ComponentInterface {\n private tabId = `nano-tab-${++id}`;\n private tab: HTMLElement;\n\n @Element() host: HTMLNanoTabElement;\n\n /** The name of the tab panel the tab will control. The panel must be located in the same tab group. */\n @Prop({ reflect: true }) panel = '';\n\n /** The active, selected tab. If none active, the first will automatically be selected. */\n @Prop({ reflect: true }) active = false;\n\n /** Set to true to draw the tab in an active state. */\n @Prop({ reflect: true }) disabled = false;\n\n /** When true, the tab will be rendered with a close icon. */\n @Prop() closable = false;\n\n /** Emitted when the tab is closable and the close button is activated. */\n @Event() nanoTabClose: EventEmitter;\n\n /** Sets focus to the tab. */\n @Method()\n async setFocus() {\n this.tab.focus({ preventScroll: true });\n }\n\n /** Removes focus from the tab. */\n @Method()\n async removeFocus() {\n this.tab.blur();\n }\n\n private handleCloseClick = () => {\n this.nanoTabClose.emit();\n };\n\n private handleCloseKeydown = (e: KeyboardEvent) => {\n if (e.key === ' ') this.handleCloseClick();\n };\n\n render() {\n return (\n <Host id={this.host.id || this.tabId}>\n <div\n part=\"base\"\n ref={(el) => (this.tab = el)}\n class={{\n nanotab: true,\n 'nanotab--active': this.active,\n 'nanotab--disabled': this.disabled,\n 'nanotab--closable': this.closable,\n }}\n role=\"tab\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-selected={this.active ? 'true' : 'false'}\n tabindex={this.disabled || !this.active ? '-1' : '0'}\n >\n <slot />\n {this.closable && (\n <nano-icon-button\n label=\"Close this tab\"\n iconName=\"light/times\"\n class=\"nanotab__close-button\"\n onClick={this.handleCloseClick}\n onKeyDown={this.handleCloseKeydown}\n tabIndex={-1}\n />\n )}\n </div>\n </Host>\n );\n }\n}\n"],"mappings":";;;gEAAA,MAAMA,EAAS,s0FCYf,IAAIC,EAAK,E,MAWIC,EAAG,M,oEACNC,KAAAC,MAAQ,cAAcH,IAgCtBE,KAAAE,iBAAmB,KACzBF,KAAKG,aAAaC,MAAM,EAGlBJ,KAAAK,mBAAsBC,IAC5B,GAAIA,EAAEC,MAAQ,IAAKP,KAAKE,kBAAkB,E,WA/BX,G,YAGC,M,cAGE,M,cAGjB,K,CAOnBM,iBACER,KAAKS,IAAIC,MAAM,CAAEC,cAAe,M,CAKlCH,oBACER,KAAKS,IAAIG,M,CAWXC,SACE,OACEC,EAACC,EAAI,CAACjB,GAAIE,KAAKgB,KAAKlB,IAAME,KAAKC,OAC7Ba,EAAA,OACEG,KAAK,OACLC,IAAMC,GAAQnB,KAAKS,IAAMU,EACzBC,MAAO,CACLC,QAAS,KACT,kBAAmBrB,KAAKsB,OACxB,oBAAqBtB,KAAKuB,SAC1B,oBAAqBvB,KAAKwB,UAE5BC,KAAK,MAAK,gBACKzB,KAAKuB,SAAW,OAAS,QAAO,gBAChCvB,KAAKsB,OAAS,OAAS,QACtCI,SAAU1B,KAAKuB,WAAavB,KAAKsB,OAAS,KAAO,KAEjDR,EAAA,aACCd,KAAKwB,UACJV,EAAA,oBACEa,MAAM,iBACNC,SAAS,cACTR,MAAM,wBACNS,QAAS7B,KAAKE,iBACd4B,UAAW9B,KAAKK,mBAChB0B,UAAW,K"}
|