@zanichelli/albe-web-components 19.2.2 → 19.2.3-RC1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/_commonjsHelpers-CFO10eej.js +7 -0
- package/dist/cjs/{breakpoints-8a1e87e0.js → breakpoints-B7vFm-3T.js} +0 -2
- package/dist/cjs/{iconset-5d47610c.js → iconset-Bcbz2MS1.js} +3 -4
- package/dist/cjs/index-2H1EJ2Tl.js +2683 -0
- package/dist/cjs/{index-e30d0503.js → index-wGaSHN1_.js} +0 -2
- package/dist/cjs/index.cjs.js +112 -224
- package/dist/cjs/loader.cjs.js +3 -8
- package/dist/cjs/{utils-4f7b4830.js → utils-C5_wGVkJ.js} +81 -73
- package/dist/cjs/{utils-b1859d65.js → utils-Ctc6JP2n.js} +2 -4
- package/dist/cjs/web-components-library.cjs.js +7 -10
- package/dist/cjs/z-accordion.cjs.entry.js +26 -13
- package/dist/cjs/z-alert.cjs.entry.js +4 -10
- package/dist/cjs/z-anchor-navigation.cjs.entry.js +25 -10
- package/dist/cjs/z-app-header-deprecated.cjs.entry.js +53 -22
- package/dist/cjs/z-app-header_12.cjs.entry.js +261 -150
- package/dist/cjs/z-aria-alert.cjs.entry.js +4 -7
- package/dist/cjs/z-avatar.cjs.entry.js +9 -13
- package/dist/cjs/z-book-card-app.cjs.entry.js +10 -18
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js +10 -24
- package/dist/cjs/z-book-card.cjs.entry.js +11 -23
- package/dist/cjs/z-book-cover.cjs.entry.js +6 -11
- package/dist/cjs/z-breadcrumb.cjs.entry.js +24 -19
- package/dist/cjs/z-button-sort.cjs.entry.js +9 -14
- package/dist/cjs/z-card.cjs.entry.js +9 -12
- package/dist/cjs/z-carousel.cjs.entry.js +49 -29
- package/dist/cjs/z-chip.cjs.entry.js +9 -13
- package/dist/cjs/z-color-picker.cjs.entry.js +24 -18
- package/dist/cjs/z-combobox.cjs.entry.js +27 -26
- package/dist/cjs/z-cover-hero.cjs.entry.js +18 -11
- package/dist/cjs/z-date-picker.cjs.entry.js +351 -330
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js +18 -22
- package/dist/cjs/z-file-upload.cjs.entry.js +21 -18
- package/dist/cjs/z-file.cjs.entry.js +6 -13
- package/dist/cjs/z-ghost-loading.cjs.entry.js +4 -9
- package/dist/cjs/z-info-box.cjs.entry.js +5 -10
- package/dist/cjs/z-info-reveal.cjs.entry.js +20 -13
- package/dist/cjs/z-logo.cjs.entry.js +4 -15
- package/dist/cjs/z-menu-deprecated.cjs.entry.js +23 -14
- package/dist/cjs/z-menu-section-deprecated.cjs.entry.js +10 -13
- package/dist/cjs/z-menu-section.cjs.entry.js +15 -16
- package/dist/cjs/z-menu.cjs.entry.js +27 -17
- package/dist/cjs/z-myz-card-alert.cjs.entry.js +5 -14
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js +9 -12
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js +4 -9
- package/dist/cjs/z-myz-card-footer.cjs.entry.js +7 -15
- package/dist/cjs/z-myz-card-icon.cjs.entry.js +6 -10
- package/dist/cjs/z-myz-card-info.cjs.entry.js +8 -13
- package/dist/cjs/z-myz-card-list.cjs.entry.js +4 -10
- package/dist/cjs/z-myz-card_4.cjs.entry.js +16 -31
- package/dist/cjs/z-myz-list-item.cjs.entry.js +9 -17
- package/dist/cjs/z-myz-list.cjs.entry.js +7 -12
- package/dist/cjs/z-navigation-tabs.cjs.entry.js +28 -18
- package/dist/cjs/z-notification.cjs.entry.js +10 -12
- package/dist/cjs/z-otp.cjs.entry.js +10 -14
- package/dist/cjs/z-pagination.cjs.entry.js +28 -18
- package/dist/cjs/z-panel-elem.cjs.entry.js +7 -17
- package/dist/cjs/z-popover.cjs.entry.js +35 -19
- package/dist/cjs/z-range-picker.cjs.entry.js +38 -31
- package/dist/cjs/z-result-card.cjs.entry.js +7 -16
- package/dist/cjs/z-section-title.cjs.entry.js +12 -10
- package/dist/cjs/z-select.cjs.entry.js +21 -25
- package/dist/cjs/z-skip-to-content.cjs.entry.js +8 -13
- package/dist/cjs/z-slideshow.cjs.entry.js +12 -16
- package/dist/cjs/z-stepper-item.cjs.entry.js +4 -14
- package/dist/cjs/z-stepper.cjs.entry.js +4 -9
- package/dist/cjs/z-table.cjs.entry.js +19 -18
- package/dist/cjs/z-tbody.cjs.entry.js +12 -7
- package/dist/cjs/z-td.cjs.entry.js +54 -8
- package/dist/cjs/z-tfoot.cjs.entry.js +16 -7
- package/dist/cjs/z-th.cjs.entry.js +81 -8
- package/dist/cjs/z-thead.cjs.entry.js +21 -7
- package/dist/cjs/z-toast-notification-list.cjs.entry.js +11 -12
- package/dist/cjs/z-toast-notification.cjs.entry.js +3942 -3963
- package/dist/cjs/z-toggle-button.cjs.entry.js +8 -12
- package/dist/cjs/z-toggle-switch.cjs.entry.js +13 -14
- package/dist/cjs/z-tool.cjs.entry.js +28 -29
- package/dist/cjs/z-toolbar.cjs.entry.js +7 -12
- package/dist/cjs/z-tooltip.cjs.entry.js +15 -11
- package/dist/cjs/z-tr.cjs.entry.js +80 -12
- package/dist/cjs/z-tree-list.cjs.entry.js +10 -14
- package/dist/cjs/z-visually-hidden.cjs.entry.js +4 -9
- package/dist/collection/__mocks__/fileMock.js +0 -1
- package/dist/collection/beans/index.js +0 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/book-card/z-book-card/index.js +55 -34
- package/dist/collection/components/book-card/z-book-card/index.stories.js +0 -1
- package/dist/collection/components/book-card/z-book-card-app/index.js +23 -15
- package/dist/collection/components/book-card/z-book-card-app/index.stories.js +0 -1
- package/dist/collection/components/css-components/z-fab/index.stories.js +0 -1
- package/dist/collection/components/css-components/z-label/index.stories.js +0 -1
- package/dist/collection/components/css-components/z-link/index.stories.js +0 -1
- package/dist/collection/components/css-components/z-scrollbar/index.stories.js +0 -1
- package/dist/collection/components/date-picker/utils.js +0 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js +61 -35
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js +0 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js +61 -34
- package/dist/collection/components/date-picker/z-range-picker/index.stories.js +0 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js +70 -23
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js +0 -1
- package/dist/collection/components/deprecated/z-book-card-deprecated/index.js +57 -40
- package/dist/collection/components/deprecated/z-book-card-deprecated/index.stories.js +0 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js +31 -12
- package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js +0 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js +11 -10
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js +0 -1
- package/dist/collection/components/deprecated/z-section-title/index.js +16 -5
- package/dist/collection/components/deprecated/z-section-title/index.stories.js +0 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js +7 -6
- package/dist/collection/components/file-upload/z-file/index.js +9 -8
- package/dist/collection/components/file-upload/z-file/index.stories.js +0 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js +80 -37
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js +0 -1
- package/dist/collection/components/index.js +0 -1
- package/dist/collection/components/list/z-list/index.js +23 -7
- package/dist/collection/components/list/z-list/index.stories.js +0 -1
- package/dist/collection/components/list/z-list-element/index.js +113 -38
- package/dist/collection/components/list/z-list-element/index.stories.js +0 -1
- package/dist/collection/components/list/z-list-group/index.js +50 -16
- package/dist/collection/components/list/z-list-group/index.stories.js +0 -1
- package/dist/collection/components/list/z-tree-list/index.js +16 -11
- package/dist/collection/components/list/z-tree-list/index.stories.js +0 -1
- package/dist/collection/components/table/cells/z-td/index.js +32 -10
- package/dist/collection/components/table/cells/z-th/index.js +54 -17
- package/dist/collection/components/table/z-table/index.js +10 -3
- package/dist/collection/components/table/z-table/index.stories.js +0 -1
- package/dist/collection/components/table/z-tbody/index.js +1 -2
- package/dist/collection/components/table/z-tfoot/index.js +7 -3
- package/dist/collection/components/table/z-thead/index.js +13 -4
- package/dist/collection/components/table/z-tr/index.js +17 -5
- package/dist/collection/components/z-accordion/index.js +49 -16
- package/dist/collection/components/z-accordion/index.stories.js +0 -1
- package/dist/collection/components/z-anchor-navigation/index.js +33 -6
- package/dist/collection/components/z-anchor-navigation/index.stories.js +0 -1
- package/dist/collection/components/z-app-header/index.js +58 -20
- package/dist/collection/components/z-app-header/index.stories.js +0 -1
- package/dist/collection/components/z-aria-alert/index.js +7 -4
- package/dist/collection/components/z-aria-alert/index.stories.js +0 -1
- package/dist/collection/components/z-avatar/index.js +24 -13
- package/dist/collection/components/z-avatar/index.stories.js +0 -1
- package/dist/collection/components/z-book-cover/index.js +17 -10
- package/dist/collection/components/z-book-cover/index.stories.js +0 -1
- package/dist/collection/components/z-breadcrumb/index.js +37 -17
- package/dist/collection/components/z-breadcrumb/index.stories.js +0 -1
- package/dist/collection/components/z-button/index.js +74 -35
- package/dist/collection/components/z-button/index.stories.js +0 -1
- package/dist/collection/components/z-button-sort/index.js +33 -18
- package/dist/collection/components/z-button-sort/index.stories.js +0 -1
- package/dist/collection/components/z-card/index.js +21 -11
- package/dist/collection/components/z-card/index.stories.js +0 -1
- package/dist/collection/components/z-carousel/index.js +69 -35
- package/dist/collection/components/z-carousel/index.stories.js +2 -3
- package/dist/collection/components/z-chip/index.js +24 -13
- package/dist/collection/components/z-chip/index.stories.js +0 -1
- package/dist/collection/components/z-color-picker/index.js +31 -17
- package/dist/collection/components/z-color-picker/index.stories.js +0 -1
- package/dist/collection/components/z-combobox/index.js +80 -41
- package/dist/collection/components/z-combobox/index.stories.js +0 -1
- package/dist/collection/components/z-cover-hero/index.js +27 -8
- package/dist/collection/components/z-cover-hero/index.stories.js +0 -1
- package/dist/collection/components/z-divider/index.js +17 -7
- package/dist/collection/components/z-divider/index.stories.js +0 -1
- package/dist/collection/components/z-ghost-loading/index.js +1 -2
- package/dist/collection/components/z-ghost-loading/index.stories.js +0 -1
- package/dist/collection/components/z-icon/index.js +25 -22
- package/dist/collection/components/z-icon/index.stories.js +0 -1
- package/dist/collection/components/z-info-box/index.js +9 -6
- package/dist/collection/components/z-info-box/index.stories.js +0 -1
- package/dist/collection/components/z-info-reveal/index.js +30 -11
- package/dist/collection/components/z-info-reveal/index.stories.js +0 -1
- package/dist/collection/components/z-input/index.js +131 -74
- package/dist/collection/components/z-input/index.stories.js +0 -1
- package/dist/collection/components/z-input-message/index.js +15 -12
- package/dist/collection/components/z-input-message/index.stories.js +0 -1
- package/dist/collection/components/z-logo/index.js +25 -22
- package/dist/collection/components/z-logo/index.stories.js +0 -1
- package/dist/collection/components/z-menu/index.js +32 -12
- package/dist/collection/components/z-menu/index.stories.js +0 -1
- package/dist/collection/components/z-menu-section/index.js +17 -12
- package/dist/collection/components/z-menu-section/index.stories.js +0 -1
- package/dist/collection/components/z-modal/index.js +36 -19
- package/dist/collection/components/z-modal/index.stories.js +0 -1
- package/dist/collection/components/z-navigation-tabs/index.js +35 -15
- package/dist/collection/components/z-navigation-tabs/index.stories.js +0 -1
- package/dist/collection/components/z-notification/index.js +30 -15
- package/dist/collection/components/z-notification/index.stories.js +0 -1
- package/dist/collection/components/z-offcanvas/index.js +42 -12
- package/dist/collection/components/z-offcanvas/index.stories.js +0 -1
- package/dist/collection/components/z-pagination/index.js +45 -21
- package/dist/collection/components/z-pagination/index.stories.js +0 -1
- package/dist/collection/components/z-panel-elem/index.js +38 -26
- package/dist/collection/components/z-panel-elem/index.stories.js +0 -1
- package/dist/collection/components/z-popover/index.js +44 -16
- package/dist/collection/components/z-popover/index.stories.js +0 -1
- package/dist/collection/components/z-result-card/index.js +34 -23
- package/dist/collection/components/z-result-card/z-result-card.stories.js +0 -1
- package/dist/collection/components/z-searchbar/index.js +80 -40
- package/dist/collection/components/z-searchbar/index.stories.js +0 -1
- package/dist/collection/components/z-select/index.js +87 -47
- package/dist/collection/components/z-select/index.stories.js +0 -1
- package/dist/collection/components/z-skip-to-content/index.js +13 -8
- package/dist/collection/components/z-skip-to-content/index.stories.js +0 -1
- package/dist/collection/components/z-stepper/index.js +1 -2
- package/dist/collection/components/z-stepper/index.stories.js +0 -1
- package/dist/collection/components/z-stepper-item/index.js +21 -19
- package/dist/collection/components/z-stepper-item/index.stories.js +0 -1
- package/dist/collection/components/z-tag/index.js +11 -14
- package/dist/collection/components/z-tag/index.stories.js +0 -1
- package/dist/collection/components/z-toast-notification/index.js +52 -34
- package/dist/collection/components/z-toast-notification/index.stories.js +0 -1
- package/dist/collection/components/z-toast-notification-list/index.js +12 -6
- package/dist/collection/components/z-toast-notification-list/index.stories.js +0 -1
- package/dist/collection/components/z-toggle-button/index.js +22 -12
- package/dist/collection/components/z-toggle-button/index.stories.js +0 -1
- package/dist/collection/components/z-toggle-switch/index.js +21 -9
- package/dist/collection/components/z-toggle-switch/index.stories.js +0 -1
- package/dist/collection/components/z-tool/index.js +49 -31
- package/dist/collection/components/z-tool/index.stories.js +0 -1
- package/dist/collection/components/z-toolbar/index.js +7 -6
- package/dist/collection/components/z-toolbar/index.stories.js +0 -1
- package/dist/collection/components/z-tooltip/index.js +29 -10
- package/dist/collection/components/z-tooltip/index.stories.js +0 -1
- package/dist/collection/components/z-visually-hidden/index.js +1 -2
- package/dist/collection/components/z-visually-hidden/index.stories.js +0 -1
- package/dist/collection/constants/breakpoints.js +0 -1
- package/dist/collection/constants/icons.js +0 -1
- package/dist/collection/constants/iconset.js +0 -1
- package/dist/collection/index.js +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js +19 -11
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js +17 -16
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js +1 -2
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js +17 -16
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js +25 -12
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js +31 -20
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js +1 -2
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js +15 -12
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js +13 -7
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js +11 -7
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js +5 -5
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js +10 -10
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js +29 -19
- package/dist/collection/snowflakes/myz/z-alert/index.js +7 -8
- package/dist/collection/snowflakes/myz/z-otp/index.js +19 -12
- package/dist/collection/snowflakes/myz/z-slideshow/index.js +11 -9
- package/dist/collection/utils/storybook-utils.js +0 -1
- package/dist/collection/utils/utils.js +0 -1
- package/dist/components/_commonjsHelpers.js +1 -5
- package/dist/components/breakpoints.js +1 -11
- package/dist/components/iconset.js +1 -1013
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -98
- package/dist/components/index10.js +1 -60
- package/dist/components/index11.js +1 -92
- package/dist/components/index12.js +1 -342
- package/dist/components/index13.js +1 -66
- package/dist/components/index14.js +1 -53
- package/dist/components/index15.js +1 -181
- package/dist/components/index16.js +1 -76
- package/dist/components/index17.js +1 -1040
- package/dist/components/index18.js +1 -65
- package/dist/components/index19.js +1 -33
- package/dist/components/index2.js +1 -407
- package/dist/components/index20.js +1 -45
- package/dist/components/index21.js +1 -62
- package/dist/components/index22.js +1 -66
- package/dist/components/index23.js +1 -179
- package/dist/components/index24.js +1 -549
- package/dist/components/index25.js +1 -409
- package/dist/components/index26.js +1 -49
- package/dist/components/index27.js +1 -55
- package/dist/components/index3.js +1 -36
- package/dist/components/index4.js +1 -45
- package/dist/components/index5.js +1 -82
- package/dist/components/index6.js +1 -56
- package/dist/components/index7.js +1 -40
- package/dist/components/index8.js +1 -63
- package/dist/components/index9.js +1 -33
- package/dist/components/utils.js +1 -246
- package/dist/components/utils2.js +1 -2704
- package/dist/components/z-accordion.js +1 -95
- package/dist/components/z-alert.js +1 -8
- package/dist/components/z-anchor-navigation.js +1 -87
- package/dist/components/z-app-header-deprecated.js +1 -255
- package/dist/components/z-app-header.js +1 -367
- package/dist/components/z-aria-alert.js +1 -35
- package/dist/components/z-avatar.js +1 -66
- package/dist/components/z-book-card-app.js +1 -77
- package/dist/components/z-book-card-deprecated.js +1 -175
- package/dist/components/z-book-card.js +1 -149
- package/dist/components/z-book-cover.js +1 -8
- package/dist/components/z-breadcrumb.js +1 -290
- package/dist/components/z-button-sort.js +1 -86
- package/dist/components/z-button.js +1 -8
- package/dist/components/z-card.js +1 -83
- package/dist/components/z-carousel.js +1 -234
- package/dist/components/z-chip.js +1 -8
- package/dist/components/z-color-picker.js +1 -234
- package/dist/components/z-combobox.js +1 -393
- package/dist/components/z-cover-hero.js +1 -66
- package/dist/components/z-date-picker.js +16 -528
- package/dist/components/z-divider.js +1 -8
- package/dist/components/z-dragdrop-area.js +1 -8
- package/dist/components/z-file-upload.js +1 -253
- package/dist/components/z-file.js +1 -89
- package/dist/components/z-ghost-loading.js +1 -8
- package/dist/components/z-icon.js +1 -8
- package/dist/components/z-info-box.js +1 -51
- package/dist/components/z-info-reveal.js +1 -8
- package/dist/components/z-input-message.js +1 -8
- package/dist/components/z-input.js +1 -8
- package/dist/components/z-list-element.js +1 -8
- package/dist/components/z-list-group.js +1 -8
- package/dist/components/z-list.js +1 -8
- package/dist/components/z-logo.js +1 -56
- package/dist/components/z-menu-deprecated.js +1 -144
- package/dist/components/z-menu-section-deprecated.js +1 -84
- package/dist/components/z-menu-section.js +1 -226
- package/dist/components/z-menu.js +1 -353
- package/dist/components/z-modal.js +1 -8
- package/dist/components/z-myz-card-alert.js +1 -101
- package/dist/components/z-myz-card-body.js +1 -8
- package/dist/components/z-myz-card-cover.js +1 -8
- package/dist/components/z-myz-card-dictionary.js +1 -94
- package/dist/components/z-myz-card-footer-sections.js +1 -36
- package/dist/components/z-myz-card-footer.js +1 -99
- package/dist/components/z-myz-card-header.js +1 -8
- package/dist/components/z-myz-card-icon.js +1 -49
- package/dist/components/z-myz-card-info.js +1 -162
- package/dist/components/z-myz-card-list.js +1 -58
- package/dist/components/z-myz-card.js +1 -8
- package/dist/components/z-myz-list-item.js +1 -8
- package/dist/components/z-myz-list.js +1 -71
- package/dist/components/z-navigation-tabs.js +1 -272
- package/dist/components/z-notification.js +1 -68
- package/dist/components/z-offcanvas.js +1 -8
- package/dist/components/z-otp.js +1 -75
- package/dist/components/z-pagination.js +1 -283
- package/dist/components/z-panel-elem.js +1 -66
- package/dist/components/z-popover.js +1 -8
- package/dist/components/z-range-picker.js +1 -413
- package/dist/components/z-result-card.js +1 -121
- package/dist/components/z-searchbar.js +1 -8
- package/dist/components/z-section-title.js +1 -52
- package/dist/components/z-select.js +1 -585
- package/dist/components/z-skip-to-content.js +1 -93
- package/dist/components/z-slideshow.js +1 -161
- package/dist/components/z-stepper-item.js +1 -60
- package/dist/components/z-stepper.js +1 -36
- package/dist/components/z-table.js +1 -68
- package/dist/components/z-tag.js +1 -8
- package/dist/components/z-tbody.js +1 -36
- package/dist/components/z-td.js +1 -89
- package/dist/components/z-tfoot.js +1 -39
- package/dist/components/z-th.js +1 -112
- package/dist/components/z-thead.js +1 -42
- package/dist/components/z-toast-notification-list.js +1 -79
- package/dist/components/z-toast-notification.js +2 -4228
- package/dist/components/z-toggle-button.js +1 -64
- package/dist/components/z-toggle-switch.js +1 -73
- package/dist/components/z-tool.js +1 -260
- package/dist/components/z-toolbar.js +1 -165
- package/dist/components/z-tooltip.js +1 -8
- package/dist/components/z-tr.js +1 -101
- package/dist/components/z-tree-list.js +1 -162
- package/dist/components/z-visually-hidden.js +1 -36
- package/dist/esm/_commonjsHelpers-B85MJLTf.js +5 -0
- package/dist/esm/{breakpoints-d148bfde.js → breakpoints-Q-tWjk7P.js} +0 -2
- package/dist/esm/{iconset-d7823b13.js → iconset-BanpkIXZ.js} +3 -4
- package/dist/esm/{index-106473a8.js → index-BKCj6NR2.js} +0 -2
- package/dist/esm/index-ByN2sYu6.js +2653 -0
- package/dist/esm/index.js +4 -6
- package/dist/esm/loader.js +3 -6
- package/dist/esm/{utils-8d6ca808.js → utils-0PByxJyN.js} +3 -5
- package/dist/esm/{utils-93ac0e6c.js → utils-DuuLzXZj.js} +81 -73
- package/dist/esm/web-components-library.js +5 -7
- package/dist/esm/z-accordion.entry.js +26 -11
- package/dist/esm/z-alert.entry.js +4 -8
- package/dist/esm/z-anchor-navigation.entry.js +25 -8
- package/dist/esm/z-app-header-deprecated.entry.js +53 -20
- package/dist/esm/z-app-header_12.entry.js +261 -148
- package/dist/esm/z-aria-alert.entry.js +4 -5
- package/dist/esm/z-avatar.entry.js +9 -11
- package/dist/esm/z-book-card-app.entry.js +10 -16
- package/dist/esm/z-book-card-deprecated.entry.js +10 -22
- package/dist/esm/z-book-card.entry.js +11 -21
- package/dist/esm/z-book-cover.entry.js +6 -9
- package/dist/esm/z-breadcrumb.entry.js +24 -17
- package/dist/esm/z-button-sort.entry.js +9 -12
- package/dist/esm/z-card.entry.js +9 -10
- package/dist/esm/z-carousel.entry.js +50 -28
- package/dist/esm/z-chip.entry.js +9 -11
- package/dist/esm/z-color-picker.entry.js +24 -16
- package/dist/esm/z-combobox.entry.js +27 -24
- package/dist/esm/z-cover-hero.entry.js +18 -9
- package/dist/esm/z-date-picker.entry.js +352 -329
- package/dist/esm/z-dragdrop-area_2.entry.js +18 -20
- package/dist/esm/z-file-upload.entry.js +21 -16
- package/dist/esm/z-file.entry.js +6 -11
- package/dist/esm/z-ghost-loading.entry.js +4 -7
- package/dist/esm/z-info-box.entry.js +5 -8
- package/dist/esm/z-info-reveal.entry.js +20 -11
- package/dist/esm/z-logo.entry.js +4 -13
- package/dist/esm/z-menu-deprecated.entry.js +23 -12
- package/dist/esm/z-menu-section-deprecated.entry.js +10 -11
- package/dist/esm/z-menu-section.entry.js +15 -14
- package/dist/esm/z-menu.entry.js +27 -15
- package/dist/esm/z-myz-card-alert.entry.js +5 -12
- package/dist/esm/z-myz-card-dictionary.entry.js +9 -10
- package/dist/esm/z-myz-card-footer-sections.entry.js +4 -7
- package/dist/esm/z-myz-card-footer.entry.js +7 -13
- package/dist/esm/z-myz-card-icon.entry.js +6 -8
- package/dist/esm/z-myz-card-info.entry.js +8 -11
- package/dist/esm/z-myz-card-list.entry.js +4 -8
- package/dist/esm/z-myz-card_4.entry.js +16 -29
- package/dist/esm/z-myz-list-item.entry.js +9 -15
- package/dist/esm/z-myz-list.entry.js +7 -10
- package/dist/esm/z-navigation-tabs.entry.js +28 -16
- package/dist/esm/z-notification.entry.js +10 -10
- package/dist/esm/z-otp.entry.js +10 -12
- package/dist/esm/z-pagination.entry.js +28 -16
- package/dist/esm/z-panel-elem.entry.js +7 -15
- package/dist/esm/z-popover.entry.js +35 -17
- package/dist/esm/z-range-picker.entry.js +38 -29
- package/dist/esm/z-result-card.entry.js +7 -14
- package/dist/esm/z-section-title.entry.js +12 -8
- package/dist/esm/z-select.entry.js +21 -23
- package/dist/esm/z-skip-to-content.entry.js +8 -11
- package/dist/esm/z-slideshow.entry.js +12 -14
- package/dist/esm/z-stepper-item.entry.js +4 -12
- package/dist/esm/z-stepper.entry.js +4 -7
- package/dist/esm/z-table.entry.js +19 -16
- package/dist/esm/z-tbody.entry.js +14 -3
- package/dist/esm/z-td.entry.js +56 -4
- package/dist/esm/z-tfoot.entry.js +18 -3
- package/dist/esm/z-th.entry.js +83 -4
- package/dist/esm/z-thead.entry.js +23 -3
- package/dist/esm/z-toast-notification-list.entry.js +11 -10
- package/dist/esm/z-toast-notification.entry.js +3942 -3961
- package/dist/esm/z-toggle-button.entry.js +8 -10
- package/dist/esm/z-toggle-switch.entry.js +13 -12
- package/dist/esm/z-tool.entry.js +28 -27
- package/dist/esm/z-toolbar.entry.js +7 -10
- package/dist/esm/z-tooltip.entry.js +15 -9
- package/dist/esm/z-tr.entry.js +82 -8
- package/dist/esm/z-tree-list.entry.js +10 -12
- package/dist/esm/z-visually-hidden.entry.js +4 -7
- package/dist/types/components/book-card/z-book-card/index.d.ts +2 -2
- package/dist/types/components/book-card/z-book-card-app/index.d.ts +2 -2
- package/dist/types/components/date-picker/z-date-picker/index.d.ts +2 -2
- package/dist/types/components/date-picker/z-range-picker/index.d.ts +2 -2
- package/dist/types/components/deprecated/z-app-header-deprecated/index.d.ts +2 -2
- package/dist/types/components/deprecated/z-book-card-deprecated/index.d.ts +2 -2
- package/dist/types/components/deprecated/z-menu-deprecated/index.d.ts +2 -2
- package/dist/types/components/deprecated/z-menu-section-deprecated/index.d.ts +2 -2
- package/dist/types/components/deprecated/z-section-title/index.d.ts +2 -1
- package/dist/types/components/file-upload/z-dragdrop-area/index.d.ts +2 -2
- package/dist/types/components/file-upload/z-file/index.d.ts +2 -2
- package/dist/types/components/file-upload/z-file-upload/index.d.ts +2 -2
- package/dist/types/components/list/z-list/index.d.ts +2 -1
- package/dist/types/components/list/z-list-element/index.d.ts +2 -2
- package/dist/types/components/list/z-list-group/index.d.ts +2 -1
- package/dist/types/components/list/z-tree-list/index.d.ts +2 -2
- package/dist/types/components/table/cells/z-td/index.d.ts +2 -2
- package/dist/types/components/table/cells/z-th/index.d.ts +2 -1
- package/dist/types/components/table/z-table/index.d.ts +2 -1
- package/dist/types/components/table/z-tbody/index.d.ts +2 -1
- package/dist/types/components/table/z-tfoot/index.d.ts +2 -1
- package/dist/types/components/table/z-thead/index.d.ts +2 -1
- package/dist/types/components/table/z-tr/index.d.ts +2 -2
- package/dist/types/components/z-accordion/index.d.ts +2 -2
- package/dist/types/components/z-anchor-navigation/index.d.ts +2 -1
- package/dist/types/components/z-app-header/index.d.ts +2 -2
- package/dist/types/components/z-aria-alert/index.d.ts +2 -1
- package/dist/types/components/z-avatar/index.d.ts +2 -1
- package/dist/types/components/z-book-cover/index.d.ts +2 -1
- package/dist/types/components/z-breadcrumb/index.d.ts +2 -2
- package/dist/types/components/z-button/index.d.ts +5 -2
- package/dist/types/components/z-button-sort/index.d.ts +2 -2
- package/dist/types/components/z-card/index.d.ts +2 -1
- package/dist/types/components/z-carousel/index.d.ts +5 -2
- package/dist/types/components/z-carousel/index.stories.d.ts +2 -2
- package/dist/types/components/z-chip/index.d.ts +2 -2
- package/dist/types/components/z-color-picker/index.d.ts +2 -2
- package/dist/types/components/z-combobox/index.d.ts +2 -2
- package/dist/types/components/z-cover-hero/index.d.ts +2 -1
- package/dist/types/components/z-divider/index.d.ts +2 -1
- package/dist/types/components/z-ghost-loading/index.d.ts +2 -1
- package/dist/types/components/z-icon/index.d.ts +2 -1
- package/dist/types/components/z-info-box/index.d.ts +2 -2
- package/dist/types/components/z-info-reveal/index.d.ts +2 -1
- package/dist/types/components/z-input/index.d.ts +2 -2
- package/dist/types/components/z-input-message/index.d.ts +2 -1
- package/dist/types/components/z-logo/index.d.ts +2 -1
- package/dist/types/components/z-menu/index.d.ts +2 -2
- package/dist/types/components/z-menu-section/index.d.ts +2 -2
- package/dist/types/components/z-modal/index.d.ts +2 -2
- package/dist/types/components/z-navigation-tabs/index.d.ts +2 -2
- package/dist/types/components/z-notification/index.d.ts +2 -2
- package/dist/types/components/z-offcanvas/index.d.ts +2 -2
- package/dist/types/components/z-pagination/index.d.ts +2 -2
- package/dist/types/components/z-panel-elem/index.d.ts +2 -1
- package/dist/types/components/z-popover/index.d.ts +2 -2
- package/dist/types/components/z-result-card/index.d.ts +2 -1
- package/dist/types/components/z-searchbar/index.d.ts +2 -2
- package/dist/types/components/z-select/index.d.ts +2 -2
- package/dist/types/components/z-skip-to-content/index.d.ts +2 -1
- package/dist/types/components/z-stepper/index.d.ts +2 -1
- package/dist/types/components/z-stepper-item/index.d.ts +2 -1
- package/dist/types/components/z-tag/index.d.ts +2 -1
- package/dist/types/components/z-toast-notification/index.d.ts +2 -2
- package/dist/types/components/z-toast-notification-list/index.d.ts +2 -1
- package/dist/types/components/z-toggle-button/index.d.ts +2 -2
- package/dist/types/components/z-toggle-switch/index.d.ts +2 -2
- package/dist/types/components/z-tool/index.d.ts +2 -2
- package/dist/types/components/z-toolbar/index.d.ts +2 -1
- package/dist/types/components/z-tooltip/index.d.ts +2 -2
- package/dist/types/components/z-visually-hidden/index.d.ts +2 -1
- package/dist/types/components.d.ts +1299 -166
- package/dist/types/snowflakes/myz/card/z-myz-card/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-alert/index.d.ts +2 -2
- package/dist/types/snowflakes/myz/card/z-myz-card-body/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-cover/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-dictionary/index.d.ts +2 -2
- package/dist/types/snowflakes/myz/card/z-myz-card-footer/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-footer-sections/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-header/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-icon/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/card/z-myz-card-info/index.d.ts +2 -2
- package/dist/types/snowflakes/myz/card/z-myz-card-list/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/list/z-myz-list/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/list/z-myz-list-item/index.d.ts +2 -2
- package/dist/types/snowflakes/myz/z-alert/index.d.ts +2 -1
- package/dist/types/snowflakes/myz/z-otp/index.d.ts +2 -2
- package/dist/types/snowflakes/myz/z-slideshow/index.d.ts +2 -1
- package/dist/types/stencil-public-runtime.d.ts +194 -8
- package/dist/web-components-library/index.esm.js +1 -2
- package/dist/web-components-library/p-00f09ae2.entry.js +1 -0
- package/dist/web-components-library/p-02e588b4.entry.js +1 -0
- package/dist/web-components-library/p-040fbd28.entry.js +1 -0
- package/dist/web-components-library/p-05fe5555.entry.js +1 -0
- package/dist/web-components-library/p-081b1648.entry.js +1 -0
- package/dist/web-components-library/p-0a819ab4.entry.js +1 -0
- package/dist/web-components-library/p-0dde6773.entry.js +1 -0
- package/dist/web-components-library/p-11a90064.entry.js +1 -0
- package/dist/web-components-library/p-1210c90f.entry.js +1 -0
- package/dist/web-components-library/p-1280ac72.entry.js +1 -0
- package/dist/web-components-library/p-17429bce.entry.js +1 -0
- package/dist/web-components-library/p-18782c2f.entry.js +1 -0
- package/dist/web-components-library/p-19536f5e.entry.js +1 -0
- package/dist/web-components-library/p-1b851174.entry.js +1 -0
- package/dist/web-components-library/p-1c75b67f.entry.js +1 -0
- package/dist/web-components-library/p-1e984688.entry.js +1 -0
- package/dist/web-components-library/p-2294f1b0.entry.js +1 -0
- package/dist/web-components-library/p-26fc8a38.entry.js +1 -0
- package/dist/web-components-library/p-27f93251.entry.js +1 -0
- package/dist/web-components-library/p-294f7b4e.entry.js +1 -0
- package/dist/web-components-library/p-2b122a22.entry.js +1 -0
- package/dist/web-components-library/p-2f99634d.entry.js +1 -0
- package/dist/web-components-library/p-30c86858.entry.js +1 -0
- package/dist/web-components-library/p-314302ce.entry.js +1 -0
- package/dist/web-components-library/p-366d2553.entry.js +1 -0
- package/dist/web-components-library/p-3a9aec16.entry.js +1 -0
- package/dist/web-components-library/p-3c861d49.entry.js +1 -0
- package/dist/web-components-library/p-41b55222.entry.js +1 -0
- package/dist/web-components-library/p-44220d6b.entry.js +1 -0
- package/dist/web-components-library/p-48d72b52.entry.js +1 -0
- package/dist/web-components-library/p-50b59012.entry.js +1 -0
- package/dist/web-components-library/p-5883dbc1.entry.js +1 -0
- package/dist/web-components-library/p-58933ba5.entry.js +1 -0
- package/dist/web-components-library/p-5bb77af2.entry.js +1 -0
- package/dist/web-components-library/{p-6c9cd6be.entry.js → p-5c85b7f4.entry.js} +1 -2
- package/dist/web-components-library/p-5e91940f.entry.js +1 -0
- package/dist/web-components-library/p-5fc4048b.entry.js +1 -0
- package/dist/web-components-library/p-61b2ad9b.entry.js +1 -0
- package/dist/web-components-library/p-631f111d.entry.js +1 -0
- package/dist/web-components-library/p-6d0abf8c.entry.js +1 -0
- package/dist/web-components-library/p-6ece59b5.entry.js +1 -0
- package/dist/web-components-library/p-73aaace2.entry.js +1 -0
- package/dist/web-components-library/p-772c3e3e.entry.js +1 -0
- package/dist/web-components-library/p-849d65f5.entry.js +1 -0
- package/dist/web-components-library/p-87306cd0.entry.js +1 -0
- package/dist/web-components-library/p-8745878e.entry.js +1 -0
- package/dist/web-components-library/p-8f5387ef.entry.js +1 -0
- package/dist/web-components-library/p-967549d2.entry.js +1 -0
- package/dist/web-components-library/p-99922496.entry.js +1 -0
- package/dist/web-components-library/p-9b181c2c.entry.js +1 -0
- package/dist/web-components-library/p-9e4db6a2.entry.js +1 -0
- package/dist/web-components-library/p-B85MJLTf.js +1 -0
- package/dist/web-components-library/p-B8WJfd4z.js +1 -0
- package/dist/web-components-library/p-BKCj6NR2.js +1 -0
- package/dist/web-components-library/{p-eb15536d.js → p-BanpkIXZ.js} +1 -2
- package/dist/web-components-library/p-ByN2sYu6.js +2 -0
- package/dist/web-components-library/p-D4yqZKyM.js +1 -0
- package/dist/web-components-library/p-Q-tWjk7P.js +1 -0
- package/dist/web-components-library/p-a336c241.entry.js +1 -0
- package/dist/web-components-library/p-a3a7c406.entry.js +1 -0
- package/dist/web-components-library/p-a9534450.entry.js +1 -0
- package/dist/web-components-library/p-aabb5aea.entry.js +1 -0
- package/dist/web-components-library/p-abfdc045.entry.js +1 -0
- package/dist/web-components-library/p-ad2ed505.entry.js +16 -0
- package/dist/web-components-library/p-aeaf586b.entry.js +1 -0
- package/dist/web-components-library/p-afab22fc.entry.js +1 -0
- package/dist/web-components-library/p-afcabf3b.entry.js +1 -0
- package/dist/web-components-library/p-b38d52e5.entry.js +1 -0
- package/dist/web-components-library/p-b5c180bc.entry.js +1 -0
- package/dist/web-components-library/p-c1677653.entry.js +1 -0
- package/dist/web-components-library/p-c23bfec2.entry.js +1 -0
- package/dist/web-components-library/p-d8f0e022.entry.js +2 -0
- package/dist/web-components-library/p-dc759208.entry.js +1 -0
- package/dist/web-components-library/p-eb722234.entry.js +1 -0
- package/dist/web-components-library/p-ebdbd84c.entry.js +1 -0
- package/dist/web-components-library/p-ecea3d09.entry.js +1 -0
- package/dist/web-components-library/p-fade8c19.entry.js +1 -0
- package/dist/web-components-library/p-fc90579e.entry.js +1 -0
- package/dist/web-components-library/web-components-library.esm.js +1 -2
- package/package.json +14 -10
- package/react/components.js +87 -92
- package/react/index.js +1 -18
- package/react/react-component-lib/createComponent.js +11 -39
- package/react/react-component-lib/createOverlayComponent.js +35 -56
- package/react/react-component-lib/index.js +2 -8
- package/react/react-component-lib/interfaces.js +1 -3
- package/react/react-component-lib/utils/attachProps.js +11 -20
- package/react/react-component-lib/utils/case.js +2 -8
- package/react/react-component-lib/utils/dev.js +3 -9
- package/react/react-component-lib/utils/index.js +10 -35
- package/www/build/index.esm.js +1 -2
- package/www/build/p-00f09ae2.entry.js +1 -0
- package/www/build/p-02e588b4.entry.js +1 -0
- package/www/build/p-040fbd28.entry.js +1 -0
- package/www/build/p-05fe5555.entry.js +1 -0
- package/www/build/p-081b1648.entry.js +1 -0
- package/www/build/p-0a819ab4.entry.js +1 -0
- package/www/build/p-0dde6773.entry.js +1 -0
- package/www/build/p-11a90064.entry.js +1 -0
- package/www/build/p-1210c90f.entry.js +1 -0
- package/www/build/p-1280ac72.entry.js +1 -0
- package/www/build/p-17429bce.entry.js +1 -0
- package/www/build/p-18782c2f.entry.js +1 -0
- package/www/build/p-19536f5e.entry.js +1 -0
- package/www/build/p-1b851174.entry.js +1 -0
- package/www/build/p-1c75b67f.entry.js +1 -0
- package/www/build/p-1e984688.entry.js +1 -0
- package/www/build/p-2294f1b0.entry.js +1 -0
- package/www/build/p-26fc8a38.entry.js +1 -0
- package/www/build/p-27f93251.entry.js +1 -0
- package/www/build/p-294f7b4e.entry.js +1 -0
- package/www/build/p-2b122a22.entry.js +1 -0
- package/www/build/p-2f99634d.entry.js +1 -0
- package/www/build/p-30c86858.entry.js +1 -0
- package/www/build/p-314302ce.entry.js +1 -0
- package/www/build/p-366d2553.entry.js +1 -0
- package/www/build/p-3a9aec16.entry.js +1 -0
- package/www/build/p-3c861d49.entry.js +1 -0
- package/www/build/p-41b55222.entry.js +1 -0
- package/www/build/p-44220d6b.entry.js +1 -0
- package/www/build/p-48d72b52.entry.js +1 -0
- package/www/build/p-50b59012.entry.js +1 -0
- package/www/build/p-5883dbc1.entry.js +1 -0
- package/www/build/p-58933ba5.entry.js +1 -0
- package/www/build/p-5bb77af2.entry.js +1 -0
- package/www/build/{p-6c9cd6be.entry.js → p-5c85b7f4.entry.js} +1 -2
- package/www/build/p-5e91940f.entry.js +1 -0
- package/www/build/p-5fc4048b.entry.js +1 -0
- package/www/build/p-61b2ad9b.entry.js +1 -0
- package/www/build/p-631f111d.entry.js +1 -0
- package/www/build/p-654b3801.js +1 -0
- package/www/build/p-6d0abf8c.entry.js +1 -0
- package/www/build/p-6ece59b5.entry.js +1 -0
- package/www/build/p-73aaace2.entry.js +1 -0
- package/www/build/p-772c3e3e.entry.js +1 -0
- package/www/build/p-849d65f5.entry.js +1 -0
- package/www/build/p-87306cd0.entry.js +1 -0
- package/www/build/p-8745878e.entry.js +1 -0
- package/www/build/p-8f5387ef.entry.js +1 -0
- package/www/build/p-967549d2.entry.js +1 -0
- package/www/build/p-99922496.entry.js +1 -0
- package/www/build/p-9b181c2c.entry.js +1 -0
- package/www/build/p-9e4db6a2.entry.js +1 -0
- package/www/build/p-B85MJLTf.js +1 -0
- package/www/build/p-B8WJfd4z.js +1 -0
- package/www/build/p-BKCj6NR2.js +1 -0
- package/www/build/{p-eb15536d.js → p-BanpkIXZ.js} +1 -2
- package/www/build/p-ByN2sYu6.js +2 -0
- package/www/build/p-D4yqZKyM.js +1 -0
- package/www/build/p-Q-tWjk7P.js +1 -0
- package/www/build/p-a336c241.entry.js +1 -0
- package/www/build/p-a3a7c406.entry.js +1 -0
- package/www/build/p-a9534450.entry.js +1 -0
- package/www/build/p-aabb5aea.entry.js +1 -0
- package/www/build/p-abfdc045.entry.js +1 -0
- package/www/build/p-ad2ed505.entry.js +16 -0
- package/www/build/p-aeaf586b.entry.js +1 -0
- package/www/build/p-afab22fc.entry.js +1 -0
- package/www/build/p-afcabf3b.entry.js +1 -0
- package/www/build/p-b38d52e5.entry.js +1 -0
- package/www/build/p-b5c180bc.entry.js +1 -0
- package/www/build/p-c1677653.entry.js +1 -0
- package/www/build/p-c23bfec2.entry.js +1 -0
- package/www/build/p-d8f0e022.entry.js +2 -0
- package/www/build/p-dc759208.entry.js +1 -0
- package/www/build/p-eb722234.entry.js +1 -0
- package/www/build/p-ebdbd84c.entry.js +1 -0
- package/www/build/p-ecea3d09.entry.js +1 -0
- package/www/build/p-fade8c19.entry.js +1 -0
- package/www/build/p-fc90579e.entry.js +1 -0
- package/www/build/web-components-library.esm.js +1 -2
- package/www/index.html +1 -1
- package/dist/cjs/_commonjsHelpers-68cdf74f.js +0 -7
- package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +0 -1
- package/dist/cjs/app-globals-3a1e7e63.js +0 -7
- package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
- package/dist/cjs/breakpoints-8a1e87e0.js.map +0 -1
- package/dist/cjs/iconset-5d47610c.js.map +0 -1
- package/dist/cjs/index-012853a0.js +0 -21
- package/dist/cjs/index-012853a0.js.map +0 -1
- package/dist/cjs/index-1d7a50cc.js +0 -67
- package/dist/cjs/index-1d7a50cc.js.map +0 -1
- package/dist/cjs/index-2dff20f5.js +0 -20
- package/dist/cjs/index-2dff20f5.js.map +0 -1
- package/dist/cjs/index-86a8a3a4.js +0 -23
- package/dist/cjs/index-86a8a3a4.js.map +0 -1
- package/dist/cjs/index-96af6326.js +0 -2324
- package/dist/cjs/index-96af6326.js.map +0 -1
- package/dist/cjs/index-c38e5b9e.js +0 -73
- package/dist/cjs/index-c38e5b9e.js.map +0 -1
- package/dist/cjs/index-cb280932.js +0 -47
- package/dist/cjs/index-cb280932.js.map +0 -1
- package/dist/cjs/index-e30d0503.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/utils-4f7b4830.js.map +0 -1
- package/dist/cjs/utils-b1859d65.js.map +0 -1
- package/dist/cjs/web-components-library.cjs.js.map +0 -1
- package/dist/cjs/z-accordion.cjs.entry.js.map +0 -1
- package/dist/cjs/z-alert.cjs.entry.js.map +0 -1
- package/dist/cjs/z-anchor-navigation.cjs.entry.js.map +0 -1
- package/dist/cjs/z-app-header-deprecated.cjs.entry.js.map +0 -1
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +0 -1
- package/dist/cjs/z-aria-alert.cjs.entry.js.map +0 -1
- package/dist/cjs/z-avatar.cjs.entry.js.map +0 -1
- package/dist/cjs/z-book-card-app.cjs.entry.js.map +0 -1
- package/dist/cjs/z-book-card-deprecated.cjs.entry.js.map +0 -1
- package/dist/cjs/z-book-card.cjs.entry.js.map +0 -1
- package/dist/cjs/z-book-cover.cjs.entry.js.map +0 -1
- package/dist/cjs/z-breadcrumb.cjs.entry.js.map +0 -1
- package/dist/cjs/z-button-sort.cjs.entry.js.map +0 -1
- package/dist/cjs/z-card.cjs.entry.js.map +0 -1
- package/dist/cjs/z-carousel.cjs.entry.js.map +0 -1
- package/dist/cjs/z-chip.cjs.entry.js.map +0 -1
- package/dist/cjs/z-color-picker.cjs.entry.js.map +0 -1
- package/dist/cjs/z-combobox.cjs.entry.js.map +0 -1
- package/dist/cjs/z-cover-hero.cjs.entry.js.map +0 -1
- package/dist/cjs/z-date-picker.cjs.entry.js.map +0 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +0 -1
- package/dist/cjs/z-file-upload.cjs.entry.js.map +0 -1
- package/dist/cjs/z-file.cjs.entry.js.map +0 -1
- package/dist/cjs/z-ghost-loading.cjs.entry.js.map +0 -1
- package/dist/cjs/z-info-box.cjs.entry.js.map +0 -1
- package/dist/cjs/z-info-reveal.cjs.entry.js.map +0 -1
- package/dist/cjs/z-logo.cjs.entry.js.map +0 -1
- package/dist/cjs/z-menu-deprecated.cjs.entry.js.map +0 -1
- package/dist/cjs/z-menu-section-deprecated.cjs.entry.js.map +0 -1
- package/dist/cjs/z-menu-section.cjs.entry.js.map +0 -1
- package/dist/cjs/z-menu.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-alert.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-dictionary.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-footer-sections.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-footer.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-info.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card-list.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-card_4.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-list-item.cjs.entry.js.map +0 -1
- package/dist/cjs/z-myz-list.cjs.entry.js.map +0 -1
- package/dist/cjs/z-navigation-tabs.cjs.entry.js.map +0 -1
- package/dist/cjs/z-notification.cjs.entry.js.map +0 -1
- package/dist/cjs/z-otp.cjs.entry.js.map +0 -1
- package/dist/cjs/z-pagination.cjs.entry.js.map +0 -1
- package/dist/cjs/z-panel-elem.cjs.entry.js.map +0 -1
- package/dist/cjs/z-popover.cjs.entry.js.map +0 -1
- package/dist/cjs/z-range-picker.cjs.entry.js.map +0 -1
- package/dist/cjs/z-result-card.cjs.entry.js.map +0 -1
- package/dist/cjs/z-section-title.cjs.entry.js.map +0 -1
- package/dist/cjs/z-select.cjs.entry.js.map +0 -1
- package/dist/cjs/z-skip-to-content.cjs.entry.js.map +0 -1
- package/dist/cjs/z-slideshow.cjs.entry.js.map +0 -1
- package/dist/cjs/z-stepper-item.cjs.entry.js.map +0 -1
- package/dist/cjs/z-stepper.cjs.entry.js.map +0 -1
- package/dist/cjs/z-table.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tbody.cjs.entry.js.map +0 -1
- package/dist/cjs/z-td.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tfoot.cjs.entry.js.map +0 -1
- package/dist/cjs/z-th.cjs.entry.js.map +0 -1
- package/dist/cjs/z-thead.cjs.entry.js.map +0 -1
- package/dist/cjs/z-toast-notification-list.cjs.entry.js.map +0 -1
- package/dist/cjs/z-toast-notification.cjs.entry.js.map +0 -1
- package/dist/cjs/z-toggle-button.cjs.entry.js.map +0 -1
- package/dist/cjs/z-toggle-switch.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tool.cjs.entry.js.map +0 -1
- package/dist/cjs/z-toolbar.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tooltip.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tr.cjs.entry.js.map +0 -1
- package/dist/cjs/z-tree-list.cjs.entry.js.map +0 -1
- package/dist/cjs/z-visually-hidden.cjs.entry.js.map +0 -1
- package/dist/collection/__mocks__/fileMock.js.map +0 -1
- package/dist/collection/beans/index.js.map +0 -1
- package/dist/collection/components/book-card/z-book-card/index.js.map +0 -1
- package/dist/collection/components/book-card/z-book-card/index.stories.js.map +0 -1
- package/dist/collection/components/book-card/z-book-card-app/index.js.map +0 -1
- package/dist/collection/components/book-card/z-book-card-app/index.stories.js.map +0 -1
- package/dist/collection/components/css-components/z-fab/index.stories.js.map +0 -1
- package/dist/collection/components/css-components/z-label/index.stories.js.map +0 -1
- package/dist/collection/components/css-components/z-link/index.stories.js.map +0 -1
- package/dist/collection/components/css-components/z-scrollbar/index.stories.js.map +0 -1
- package/dist/collection/components/date-picker/utils.js.map +0 -1
- package/dist/collection/components/date-picker/z-date-picker/index.js.map +0 -1
- package/dist/collection/components/date-picker/z-date-picker/index.stories.js.map +0 -1
- package/dist/collection/components/date-picker/z-range-picker/index.js.map +0 -1
- package/dist/collection/components/date-picker/z-range-picker/index.stories.js.map +0 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.js.map +0 -1
- package/dist/collection/components/deprecated/z-app-header-deprecated/index.stories.js.map +0 -1
- package/dist/collection/components/deprecated/z-book-card-deprecated/index.js.map +0 -1
- package/dist/collection/components/deprecated/z-book-card-deprecated/index.stories.js.map +0 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.js.map +0 -1
- package/dist/collection/components/deprecated/z-menu-deprecated/index.stories.js.map +0 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.js.map +0 -1
- package/dist/collection/components/deprecated/z-menu-section-deprecated/index.stories.js.map +0 -1
- package/dist/collection/components/deprecated/z-section-title/index.js.map +0 -1
- package/dist/collection/components/deprecated/z-section-title/index.stories.js.map +0 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/index.js.map +0 -1
- package/dist/collection/components/file-upload/z-file/index.js.map +0 -1
- package/dist/collection/components/file-upload/z-file/index.stories.js.map +0 -1
- package/dist/collection/components/file-upload/z-file-upload/index.js.map +0 -1
- package/dist/collection/components/file-upload/z-file-upload/index.stories.js.map +0 -1
- package/dist/collection/components/index.js.map +0 -1
- package/dist/collection/components/list/z-list/index.js.map +0 -1
- package/dist/collection/components/list/z-list/index.stories.js.map +0 -1
- package/dist/collection/components/list/z-list-element/index.js.map +0 -1
- package/dist/collection/components/list/z-list-element/index.stories.js.map +0 -1
- package/dist/collection/components/list/z-list-group/index.js.map +0 -1
- package/dist/collection/components/list/z-list-group/index.stories.js.map +0 -1
- package/dist/collection/components/list/z-tree-list/index.js.map +0 -1
- package/dist/collection/components/list/z-tree-list/index.stories.js.map +0 -1
- package/dist/collection/components/table/cells/z-td/index.js.map +0 -1
- package/dist/collection/components/table/cells/z-th/index.js.map +0 -1
- package/dist/collection/components/table/z-table/index.js.map +0 -1
- package/dist/collection/components/table/z-table/index.stories.js.map +0 -1
- package/dist/collection/components/table/z-tbody/index.js.map +0 -1
- package/dist/collection/components/table/z-tfoot/index.js.map +0 -1
- package/dist/collection/components/table/z-thead/index.js.map +0 -1
- package/dist/collection/components/table/z-tr/index.js.map +0 -1
- package/dist/collection/components/z-accordion/index.js.map +0 -1
- package/dist/collection/components/z-accordion/index.stories.js.map +0 -1
- package/dist/collection/components/z-anchor-navigation/index.js.map +0 -1
- package/dist/collection/components/z-anchor-navigation/index.stories.js.map +0 -1
- package/dist/collection/components/z-app-header/index.js.map +0 -1
- package/dist/collection/components/z-app-header/index.stories.js.map +0 -1
- package/dist/collection/components/z-aria-alert/index.js.map +0 -1
- package/dist/collection/components/z-aria-alert/index.stories.js.map +0 -1
- package/dist/collection/components/z-avatar/index.js.map +0 -1
- package/dist/collection/components/z-avatar/index.stories.js.map +0 -1
- package/dist/collection/components/z-book-cover/index.js.map +0 -1
- package/dist/collection/components/z-book-cover/index.stories.js.map +0 -1
- package/dist/collection/components/z-breadcrumb/index.js.map +0 -1
- package/dist/collection/components/z-breadcrumb/index.stories.js.map +0 -1
- package/dist/collection/components/z-button/index.js.map +0 -1
- package/dist/collection/components/z-button/index.stories.js.map +0 -1
- package/dist/collection/components/z-button-sort/index.js.map +0 -1
- package/dist/collection/components/z-button-sort/index.stories.js.map +0 -1
- package/dist/collection/components/z-card/index.js.map +0 -1
- package/dist/collection/components/z-card/index.stories.js.map +0 -1
- package/dist/collection/components/z-carousel/index.js.map +0 -1
- package/dist/collection/components/z-carousel/index.stories.js.map +0 -1
- package/dist/collection/components/z-chip/index.js.map +0 -1
- package/dist/collection/components/z-chip/index.stories.js.map +0 -1
- package/dist/collection/components/z-color-picker/index.js.map +0 -1
- package/dist/collection/components/z-color-picker/index.stories.js.map +0 -1
- package/dist/collection/components/z-combobox/index.js.map +0 -1
- package/dist/collection/components/z-combobox/index.stories.js.map +0 -1
- package/dist/collection/components/z-cover-hero/index.js.map +0 -1
- package/dist/collection/components/z-cover-hero/index.stories.js.map +0 -1
- package/dist/collection/components/z-divider/index.js.map +0 -1
- package/dist/collection/components/z-divider/index.stories.js.map +0 -1
- package/dist/collection/components/z-ghost-loading/index.js.map +0 -1
- package/dist/collection/components/z-ghost-loading/index.stories.js.map +0 -1
- package/dist/collection/components/z-icon/index.js.map +0 -1
- package/dist/collection/components/z-icon/index.stories.js.map +0 -1
- package/dist/collection/components/z-info-box/index.js.map +0 -1
- package/dist/collection/components/z-info-box/index.stories.js.map +0 -1
- package/dist/collection/components/z-info-reveal/index.js.map +0 -1
- package/dist/collection/components/z-info-reveal/index.stories.js.map +0 -1
- package/dist/collection/components/z-input/index.js.map +0 -1
- package/dist/collection/components/z-input/index.stories.js.map +0 -1
- package/dist/collection/components/z-input-message/index.js.map +0 -1
- package/dist/collection/components/z-input-message/index.stories.js.map +0 -1
- package/dist/collection/components/z-logo/index.js.map +0 -1
- package/dist/collection/components/z-logo/index.stories.js.map +0 -1
- package/dist/collection/components/z-menu/index.js.map +0 -1
- package/dist/collection/components/z-menu/index.stories.js.map +0 -1
- package/dist/collection/components/z-menu-section/index.js.map +0 -1
- package/dist/collection/components/z-menu-section/index.stories.js.map +0 -1
- package/dist/collection/components/z-modal/index.js.map +0 -1
- package/dist/collection/components/z-modal/index.stories.js.map +0 -1
- package/dist/collection/components/z-navigation-tabs/index.js.map +0 -1
- package/dist/collection/components/z-navigation-tabs/index.stories.js.map +0 -1
- package/dist/collection/components/z-notification/index.js.map +0 -1
- package/dist/collection/components/z-notification/index.stories.js.map +0 -1
- package/dist/collection/components/z-offcanvas/index.js.map +0 -1
- package/dist/collection/components/z-offcanvas/index.stories.js.map +0 -1
- package/dist/collection/components/z-pagination/index.js.map +0 -1
- package/dist/collection/components/z-pagination/index.stories.js.map +0 -1
- package/dist/collection/components/z-panel-elem/index.js.map +0 -1
- package/dist/collection/components/z-panel-elem/index.stories.js.map +0 -1
- package/dist/collection/components/z-popover/index.js.map +0 -1
- package/dist/collection/components/z-popover/index.stories.js.map +0 -1
- package/dist/collection/components/z-result-card/index.js.map +0 -1
- package/dist/collection/components/z-result-card/z-result-card.stories.js.map +0 -1
- package/dist/collection/components/z-searchbar/index.js.map +0 -1
- package/dist/collection/components/z-searchbar/index.stories.js.map +0 -1
- package/dist/collection/components/z-select/index.js.map +0 -1
- package/dist/collection/components/z-select/index.stories.js.map +0 -1
- package/dist/collection/components/z-skip-to-content/index.js.map +0 -1
- package/dist/collection/components/z-skip-to-content/index.stories.js.map +0 -1
- package/dist/collection/components/z-stepper/index.js.map +0 -1
- package/dist/collection/components/z-stepper/index.stories.js.map +0 -1
- package/dist/collection/components/z-stepper-item/index.js.map +0 -1
- package/dist/collection/components/z-stepper-item/index.stories.js.map +0 -1
- package/dist/collection/components/z-tag/index.js.map +0 -1
- package/dist/collection/components/z-tag/index.stories.js.map +0 -1
- package/dist/collection/components/z-toast-notification/index.js.map +0 -1
- package/dist/collection/components/z-toast-notification/index.stories.js.map +0 -1
- package/dist/collection/components/z-toast-notification-list/index.js.map +0 -1
- package/dist/collection/components/z-toast-notification-list/index.stories.js.map +0 -1
- package/dist/collection/components/z-toggle-button/index.js.map +0 -1
- package/dist/collection/components/z-toggle-button/index.stories.js.map +0 -1
- package/dist/collection/components/z-toggle-switch/index.js.map +0 -1
- package/dist/collection/components/z-toggle-switch/index.stories.js.map +0 -1
- package/dist/collection/components/z-tool/index.js.map +0 -1
- package/dist/collection/components/z-tool/index.stories.js.map +0 -1
- package/dist/collection/components/z-toolbar/index.js.map +0 -1
- package/dist/collection/components/z-toolbar/index.stories.js.map +0 -1
- package/dist/collection/components/z-tooltip/index.js.map +0 -1
- package/dist/collection/components/z-tooltip/index.stories.js.map +0 -1
- package/dist/collection/components/z-visually-hidden/index.js.map +0 -1
- package/dist/collection/components/z-visually-hidden/index.stories.js.map +0 -1
- package/dist/collection/constants/breakpoints.js.map +0 -1
- package/dist/collection/constants/icons.js.map +0 -1
- package/dist/collection/constants/iconset.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-alert/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-body/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-cover/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-dictionary/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-footer-sections/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-header/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-icon/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-info/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/card/z-myz-card-list/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/list/z-myz-list-item/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/z-alert/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/z-otp/index.js.map +0 -1
- package/dist/collection/snowflakes/myz/z-slideshow/index.js.map +0 -1
- package/dist/collection/utils/storybook-utils.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/_commonjsHelpers.js.map +0 -1
- package/dist/components/breakpoints.js.map +0 -1
- package/dist/components/iconset.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index10.js.map +0 -1
- package/dist/components/index11.js.map +0 -1
- package/dist/components/index12.js.map +0 -1
- package/dist/components/index13.js.map +0 -1
- package/dist/components/index14.js.map +0 -1
- package/dist/components/index15.js.map +0 -1
- package/dist/components/index16.js.map +0 -1
- package/dist/components/index17.js.map +0 -1
- package/dist/components/index18.js.map +0 -1
- package/dist/components/index19.js.map +0 -1
- package/dist/components/index2.js.map +0 -1
- package/dist/components/index20.js.map +0 -1
- package/dist/components/index21.js.map +0 -1
- package/dist/components/index22.js.map +0 -1
- package/dist/components/index23.js.map +0 -1
- package/dist/components/index24.js.map +0 -1
- package/dist/components/index25.js.map +0 -1
- package/dist/components/index26.js.map +0 -1
- package/dist/components/index27.js.map +0 -1
- package/dist/components/index3.js.map +0 -1
- package/dist/components/index4.js.map +0 -1
- package/dist/components/index5.js.map +0 -1
- package/dist/components/index6.js.map +0 -1
- package/dist/components/index7.js.map +0 -1
- package/dist/components/index8.js.map +0 -1
- package/dist/components/index9.js.map +0 -1
- package/dist/components/utils.js.map +0 -1
- package/dist/components/utils2.js.map +0 -1
- package/dist/components/z-accordion.js.map +0 -1
- package/dist/components/z-alert.js.map +0 -1
- package/dist/components/z-anchor-navigation.js.map +0 -1
- package/dist/components/z-app-header-deprecated.js.map +0 -1
- package/dist/components/z-app-header.js.map +0 -1
- package/dist/components/z-aria-alert.js.map +0 -1
- package/dist/components/z-avatar.js.map +0 -1
- package/dist/components/z-book-card-app.js.map +0 -1
- package/dist/components/z-book-card-deprecated.js.map +0 -1
- package/dist/components/z-book-card.js.map +0 -1
- package/dist/components/z-book-cover.js.map +0 -1
- package/dist/components/z-breadcrumb.js.map +0 -1
- package/dist/components/z-button-sort.js.map +0 -1
- package/dist/components/z-button.js.map +0 -1
- package/dist/components/z-card.js.map +0 -1
- package/dist/components/z-carousel.js.map +0 -1
- package/dist/components/z-chip.js.map +0 -1
- package/dist/components/z-color-picker.js.map +0 -1
- package/dist/components/z-combobox.js.map +0 -1
- package/dist/components/z-cover-hero.js.map +0 -1
- package/dist/components/z-date-picker.js.map +0 -1
- package/dist/components/z-divider.js.map +0 -1
- package/dist/components/z-dragdrop-area.js.map +0 -1
- package/dist/components/z-file-upload.js.map +0 -1
- package/dist/components/z-file.js.map +0 -1
- package/dist/components/z-ghost-loading.js.map +0 -1
- package/dist/components/z-icon.js.map +0 -1
- package/dist/components/z-info-box.js.map +0 -1
- package/dist/components/z-info-reveal.js.map +0 -1
- package/dist/components/z-input-message.js.map +0 -1
- package/dist/components/z-input.js.map +0 -1
- package/dist/components/z-list-element.js.map +0 -1
- package/dist/components/z-list-group.js.map +0 -1
- package/dist/components/z-list.js.map +0 -1
- package/dist/components/z-logo.js.map +0 -1
- package/dist/components/z-menu-deprecated.js.map +0 -1
- package/dist/components/z-menu-section-deprecated.js.map +0 -1
- package/dist/components/z-menu-section.js.map +0 -1
- package/dist/components/z-menu.js.map +0 -1
- package/dist/components/z-modal.js.map +0 -1
- package/dist/components/z-myz-card-alert.js.map +0 -1
- package/dist/components/z-myz-card-body.js.map +0 -1
- package/dist/components/z-myz-card-cover.js.map +0 -1
- package/dist/components/z-myz-card-dictionary.js.map +0 -1
- package/dist/components/z-myz-card-footer-sections.js.map +0 -1
- package/dist/components/z-myz-card-footer.js.map +0 -1
- package/dist/components/z-myz-card-header.js.map +0 -1
- package/dist/components/z-myz-card-icon.js.map +0 -1
- package/dist/components/z-myz-card-info.js.map +0 -1
- package/dist/components/z-myz-card-list.js.map +0 -1
- package/dist/components/z-myz-card.js.map +0 -1
- package/dist/components/z-myz-list-item.js.map +0 -1
- package/dist/components/z-myz-list.js.map +0 -1
- package/dist/components/z-navigation-tabs.js.map +0 -1
- package/dist/components/z-notification.js.map +0 -1
- package/dist/components/z-offcanvas.js.map +0 -1
- package/dist/components/z-otp.js.map +0 -1
- package/dist/components/z-pagination.js.map +0 -1
- package/dist/components/z-panel-elem.js.map +0 -1
- package/dist/components/z-popover.js.map +0 -1
- package/dist/components/z-range-picker.js.map +0 -1
- package/dist/components/z-result-card.js.map +0 -1
- package/dist/components/z-searchbar.js.map +0 -1
- package/dist/components/z-section-title.js.map +0 -1
- package/dist/components/z-select.js.map +0 -1
- package/dist/components/z-skip-to-content.js.map +0 -1
- package/dist/components/z-slideshow.js.map +0 -1
- package/dist/components/z-stepper-item.js.map +0 -1
- package/dist/components/z-stepper.js.map +0 -1
- package/dist/components/z-table.js.map +0 -1
- package/dist/components/z-tag.js.map +0 -1
- package/dist/components/z-tbody.js.map +0 -1
- package/dist/components/z-td.js.map +0 -1
- package/dist/components/z-tfoot.js.map +0 -1
- package/dist/components/z-th.js.map +0 -1
- package/dist/components/z-thead.js.map +0 -1
- package/dist/components/z-toast-notification-list.js.map +0 -1
- package/dist/components/z-toast-notification.js.map +0 -1
- package/dist/components/z-toggle-button.js.map +0 -1
- package/dist/components/z-toggle-switch.js.map +0 -1
- package/dist/components/z-tool.js.map +0 -1
- package/dist/components/z-toolbar.js.map +0 -1
- package/dist/components/z-tooltip.js.map +0 -1
- package/dist/components/z-tr.js.map +0 -1
- package/dist/components/z-tree-list.js.map +0 -1
- package/dist/components/z-visually-hidden.js.map +0 -1
- package/dist/docs/grid/index.stories.js +0 -54
- package/dist/docs/grid/index.stories.js.map +0 -1
- package/dist/docs/iconset/index.stories.js +0 -32
- package/dist/docs/iconset/index.stories.js.map +0 -1
- package/dist/docs/themes/index.stories.js +0 -108
- package/dist/docs/themes/index.stories.js.map +0 -1
- package/dist/docs/typography/index.stories.js +0 -186
- package/dist/docs/typography/index.stories.js.map +0 -1
- package/dist/esm/_commonjsHelpers-1c8beb5f.js +0 -5
- package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +0 -1
- package/dist/esm/app-globals-0f993ce5.js +0 -5
- package/dist/esm/app-globals-0f993ce5.js.map +0 -1
- package/dist/esm/breakpoints-d148bfde.js.map +0 -1
- package/dist/esm/iconset-d7823b13.js.map +0 -1
- package/dist/esm/index-09bfb4ee.js +0 -18
- package/dist/esm/index-09bfb4ee.js.map +0 -1
- package/dist/esm/index-106473a8.js.map +0 -1
- package/dist/esm/index-3856a6ca.js +0 -19
- package/dist/esm/index-3856a6ca.js.map +0 -1
- package/dist/esm/index-455c0a68.js +0 -21
- package/dist/esm/index-455c0a68.js.map +0 -1
- package/dist/esm/index-6c43bc70.js +0 -65
- package/dist/esm/index-6c43bc70.js.map +0 -1
- package/dist/esm/index-a0b957e0.js +0 -71
- package/dist/esm/index-a0b957e0.js.map +0 -1
- package/dist/esm/index-c8ceadeb.js +0 -2293
- package/dist/esm/index-c8ceadeb.js.map +0 -1
- package/dist/esm/index-f8517155.js +0 -45
- package/dist/esm/index-f8517155.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/utils-8d6ca808.js.map +0 -1
- package/dist/esm/utils-93ac0e6c.js.map +0 -1
- package/dist/esm/web-components-library.js.map +0 -1
- package/dist/esm/z-accordion.entry.js.map +0 -1
- package/dist/esm/z-alert.entry.js.map +0 -1
- package/dist/esm/z-anchor-navigation.entry.js.map +0 -1
- package/dist/esm/z-app-header-deprecated.entry.js.map +0 -1
- package/dist/esm/z-app-header_12.entry.js.map +0 -1
- package/dist/esm/z-aria-alert.entry.js.map +0 -1
- package/dist/esm/z-avatar.entry.js.map +0 -1
- package/dist/esm/z-book-card-app.entry.js.map +0 -1
- package/dist/esm/z-book-card-deprecated.entry.js.map +0 -1
- package/dist/esm/z-book-card.entry.js.map +0 -1
- package/dist/esm/z-book-cover.entry.js.map +0 -1
- package/dist/esm/z-breadcrumb.entry.js.map +0 -1
- package/dist/esm/z-button-sort.entry.js.map +0 -1
- package/dist/esm/z-card.entry.js.map +0 -1
- package/dist/esm/z-carousel.entry.js.map +0 -1
- package/dist/esm/z-chip.entry.js.map +0 -1
- package/dist/esm/z-color-picker.entry.js.map +0 -1
- package/dist/esm/z-combobox.entry.js.map +0 -1
- package/dist/esm/z-cover-hero.entry.js.map +0 -1
- package/dist/esm/z-date-picker.entry.js.map +0 -1
- package/dist/esm/z-dragdrop-area_2.entry.js.map +0 -1
- package/dist/esm/z-file-upload.entry.js.map +0 -1
- package/dist/esm/z-file.entry.js.map +0 -1
- package/dist/esm/z-ghost-loading.entry.js.map +0 -1
- package/dist/esm/z-info-box.entry.js.map +0 -1
- package/dist/esm/z-info-reveal.entry.js.map +0 -1
- package/dist/esm/z-logo.entry.js.map +0 -1
- package/dist/esm/z-menu-deprecated.entry.js.map +0 -1
- package/dist/esm/z-menu-section-deprecated.entry.js.map +0 -1
- package/dist/esm/z-menu-section.entry.js.map +0 -1
- package/dist/esm/z-menu.entry.js.map +0 -1
- package/dist/esm/z-myz-card-alert.entry.js.map +0 -1
- package/dist/esm/z-myz-card-dictionary.entry.js.map +0 -1
- package/dist/esm/z-myz-card-footer-sections.entry.js.map +0 -1
- package/dist/esm/z-myz-card-footer.entry.js.map +0 -1
- package/dist/esm/z-myz-card-icon.entry.js.map +0 -1
- package/dist/esm/z-myz-card-info.entry.js.map +0 -1
- package/dist/esm/z-myz-card-list.entry.js.map +0 -1
- package/dist/esm/z-myz-card_4.entry.js.map +0 -1
- package/dist/esm/z-myz-list-item.entry.js.map +0 -1
- package/dist/esm/z-myz-list.entry.js.map +0 -1
- package/dist/esm/z-navigation-tabs.entry.js.map +0 -1
- package/dist/esm/z-notification.entry.js.map +0 -1
- package/dist/esm/z-otp.entry.js.map +0 -1
- package/dist/esm/z-pagination.entry.js.map +0 -1
- package/dist/esm/z-panel-elem.entry.js.map +0 -1
- package/dist/esm/z-popover.entry.js.map +0 -1
- package/dist/esm/z-range-picker.entry.js.map +0 -1
- package/dist/esm/z-result-card.entry.js.map +0 -1
- package/dist/esm/z-section-title.entry.js.map +0 -1
- package/dist/esm/z-select.entry.js.map +0 -1
- package/dist/esm/z-skip-to-content.entry.js.map +0 -1
- package/dist/esm/z-slideshow.entry.js.map +0 -1
- package/dist/esm/z-stepper-item.entry.js.map +0 -1
- package/dist/esm/z-stepper.entry.js.map +0 -1
- package/dist/esm/z-table.entry.js.map +0 -1
- package/dist/esm/z-tbody.entry.js.map +0 -1
- package/dist/esm/z-td.entry.js.map +0 -1
- package/dist/esm/z-tfoot.entry.js.map +0 -1
- package/dist/esm/z-th.entry.js.map +0 -1
- package/dist/esm/z-thead.entry.js.map +0 -1
- package/dist/esm/z-toast-notification-list.entry.js.map +0 -1
- package/dist/esm/z-toast-notification.entry.js.map +0 -1
- package/dist/esm/z-toggle-button.entry.js.map +0 -1
- package/dist/esm/z-toggle-switch.entry.js.map +0 -1
- package/dist/esm/z-tool.entry.js.map +0 -1
- package/dist/esm/z-toolbar.entry.js.map +0 -1
- package/dist/esm/z-tooltip.entry.js.map +0 -1
- package/dist/esm/z-tr.entry.js.map +0 -1
- package/dist/esm/z-tree-list.entry.js.map +0 -1
- package/dist/esm/z-visually-hidden.entry.js.map +0 -1
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/grid/index.stories.d.ts +0 -9
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/iconset/index.stories.d.ts +0 -11
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/themes/index.stories.d.ts +0 -16
- package/dist/types/home/runner/work/design-system/design-system/.stencil/docs/typography/index.stories.d.ts +0 -96
- package/dist/web-components-library/index.esm.js.map +0 -1
- package/dist/web-components-library/p-05be939d.entry.js +0 -2
- package/dist/web-components-library/p-05be939d.entry.js.map +0 -1
- package/dist/web-components-library/p-061e28d6.js +0 -2
- package/dist/web-components-library/p-061e28d6.js.map +0 -1
- package/dist/web-components-library/p-0643d684.entry.js +0 -2
- package/dist/web-components-library/p-0643d684.entry.js.map +0 -1
- package/dist/web-components-library/p-0aed3ddc.entry.js +0 -2
- package/dist/web-components-library/p-0aed3ddc.entry.js.map +0 -1
- package/dist/web-components-library/p-0b03b0e3.js +0 -2
- package/dist/web-components-library/p-0b03b0e3.js.map +0 -1
- package/dist/web-components-library/p-1b972597.entry.js +0 -2
- package/dist/web-components-library/p-1b972597.entry.js.map +0 -1
- package/dist/web-components-library/p-252893a8.entry.js +0 -2
- package/dist/web-components-library/p-252893a8.entry.js.map +0 -1
- package/dist/web-components-library/p-30a78a06.entry.js +0 -2
- package/dist/web-components-library/p-30a78a06.entry.js.map +0 -1
- package/dist/web-components-library/p-31bd2a1c.entry.js +0 -2
- package/dist/web-components-library/p-31bd2a1c.entry.js.map +0 -1
- package/dist/web-components-library/p-32bc8a40.entry.js +0 -2
- package/dist/web-components-library/p-32bc8a40.entry.js.map +0 -1
- package/dist/web-components-library/p-35d73edf.entry.js +0 -2
- package/dist/web-components-library/p-35d73edf.entry.js.map +0 -1
- package/dist/web-components-library/p-3977b0ae.entry.js +0 -2
- package/dist/web-components-library/p-3977b0ae.entry.js.map +0 -1
- package/dist/web-components-library/p-41891d34.entry.js +0 -2
- package/dist/web-components-library/p-41891d34.entry.js.map +0 -1
- package/dist/web-components-library/p-42abfe3b.entry.js +0 -2
- package/dist/web-components-library/p-42abfe3b.entry.js.map +0 -1
- package/dist/web-components-library/p-43adca09.entry.js +0 -2
- package/dist/web-components-library/p-43adca09.entry.js.map +0 -1
- package/dist/web-components-library/p-447a6391.entry.js +0 -2
- package/dist/web-components-library/p-447a6391.entry.js.map +0 -1
- package/dist/web-components-library/p-4504375f.entry.js +0 -2
- package/dist/web-components-library/p-4504375f.entry.js.map +0 -1
- package/dist/web-components-library/p-4573c419.js +0 -2
- package/dist/web-components-library/p-4573c419.js.map +0 -1
- package/dist/web-components-library/p-47b59f05.entry.js +0 -2
- package/dist/web-components-library/p-47b59f05.entry.js.map +0 -1
- package/dist/web-components-library/p-5145a606.js +0 -2
- package/dist/web-components-library/p-5145a606.js.map +0 -1
- package/dist/web-components-library/p-565c1815.entry.js +0 -2
- package/dist/web-components-library/p-565c1815.entry.js.map +0 -1
- package/dist/web-components-library/p-5989465b.entry.js +0 -2
- package/dist/web-components-library/p-5989465b.entry.js.map +0 -1
- package/dist/web-components-library/p-6164feb9.entry.js +0 -2
- package/dist/web-components-library/p-6164feb9.entry.js.map +0 -1
- package/dist/web-components-library/p-623fdee4.js +0 -2
- package/dist/web-components-library/p-623fdee4.js.map +0 -1
- package/dist/web-components-library/p-66c0f993.entry.js +0 -2
- package/dist/web-components-library/p-66c0f993.entry.js.map +0 -1
- package/dist/web-components-library/p-68d91a93.js +0 -2
- package/dist/web-components-library/p-68d91a93.js.map +0 -1
- package/dist/web-components-library/p-6c6a655e.entry.js +0 -2
- package/dist/web-components-library/p-6c6a655e.entry.js.map +0 -1
- package/dist/web-components-library/p-6c9cd6be.entry.js.map +0 -1
- package/dist/web-components-library/p-6d15da6f.entry.js +0 -2
- package/dist/web-components-library/p-6d15da6f.entry.js.map +0 -1
- package/dist/web-components-library/p-6e13aa8e.entry.js +0 -2
- package/dist/web-components-library/p-6e13aa8e.entry.js.map +0 -1
- package/dist/web-components-library/p-75c4a726.js +0 -3
- package/dist/web-components-library/p-75c4a726.js.map +0 -1
- package/dist/web-components-library/p-767b66ca.entry.js +0 -2
- package/dist/web-components-library/p-767b66ca.entry.js.map +0 -1
- package/dist/web-components-library/p-76d1d0e4.entry.js +0 -2
- package/dist/web-components-library/p-76d1d0e4.entry.js.map +0 -1
- package/dist/web-components-library/p-7a4f6a5b.entry.js +0 -2
- package/dist/web-components-library/p-7a4f6a5b.entry.js.map +0 -1
- package/dist/web-components-library/p-7b837e11.js +0 -2
- package/dist/web-components-library/p-7b837e11.js.map +0 -1
- package/dist/web-components-library/p-7d655f96.entry.js +0 -2
- package/dist/web-components-library/p-7d655f96.entry.js.map +0 -1
- package/dist/web-components-library/p-82eeea83.entry.js +0 -2
- package/dist/web-components-library/p-82eeea83.entry.js.map +0 -1
- package/dist/web-components-library/p-8503c87a.entry.js +0 -2
- package/dist/web-components-library/p-8503c87a.entry.js.map +0 -1
- package/dist/web-components-library/p-86618221.js +0 -2
- package/dist/web-components-library/p-86618221.js.map +0 -1
- package/dist/web-components-library/p-869295ce.entry.js +0 -2
- package/dist/web-components-library/p-869295ce.entry.js.map +0 -1
- package/dist/web-components-library/p-88a9865c.entry.js +0 -2
- package/dist/web-components-library/p-88a9865c.entry.js.map +0 -1
- package/dist/web-components-library/p-8988eee3.entry.js +0 -2
- package/dist/web-components-library/p-8988eee3.entry.js.map +0 -1
- package/dist/web-components-library/p-8b367393.js +0 -2
- package/dist/web-components-library/p-8b367393.js.map +0 -1
- package/dist/web-components-library/p-8c52635e.entry.js +0 -2
- package/dist/web-components-library/p-8c52635e.entry.js.map +0 -1
- package/dist/web-components-library/p-8fd50cc5.entry.js +0 -2
- package/dist/web-components-library/p-8fd50cc5.entry.js.map +0 -1
- package/dist/web-components-library/p-92f13701.entry.js +0 -2
- package/dist/web-components-library/p-92f13701.entry.js.map +0 -1
- package/dist/web-components-library/p-93d349ee.entry.js +0 -2
- package/dist/web-components-library/p-93d349ee.entry.js.map +0 -1
- package/dist/web-components-library/p-943db3a8.entry.js +0 -2
- package/dist/web-components-library/p-943db3a8.entry.js.map +0 -1
- package/dist/web-components-library/p-9814f864.entry.js +0 -2
- package/dist/web-components-library/p-9814f864.entry.js.map +0 -1
- package/dist/web-components-library/p-988a58dd.entry.js +0 -2
- package/dist/web-components-library/p-988a58dd.entry.js.map +0 -1
- package/dist/web-components-library/p-9ae0c0c6.entry.js +0 -2
- package/dist/web-components-library/p-9ae0c0c6.entry.js.map +0 -1
- package/dist/web-components-library/p-9c816a3b.js +0 -2
- package/dist/web-components-library/p-9c816a3b.js.map +0 -1
- package/dist/web-components-library/p-a2ee659d.entry.js +0 -2
- package/dist/web-components-library/p-a2ee659d.entry.js.map +0 -1
- package/dist/web-components-library/p-a3f9a5da.entry.js +0 -2
- package/dist/web-components-library/p-a3f9a5da.entry.js.map +0 -1
- package/dist/web-components-library/p-a4d2cf55.entry.js +0 -2
- package/dist/web-components-library/p-a4d2cf55.entry.js.map +0 -1
- package/dist/web-components-library/p-a8790237.entry.js +0 -2
- package/dist/web-components-library/p-a8790237.entry.js.map +0 -1
- package/dist/web-components-library/p-aaa96c12.entry.js +0 -17
- package/dist/web-components-library/p-aaa96c12.entry.js.map +0 -1
- package/dist/web-components-library/p-accbc381.entry.js +0 -2
- package/dist/web-components-library/p-accbc381.entry.js.map +0 -1
- package/dist/web-components-library/p-b0324c7d.entry.js +0 -2
- package/dist/web-components-library/p-b0324c7d.entry.js.map +0 -1
- package/dist/web-components-library/p-b391211f.entry.js +0 -2
- package/dist/web-components-library/p-b391211f.entry.js.map +0 -1
- package/dist/web-components-library/p-b421424f.entry.js +0 -2
- package/dist/web-components-library/p-b421424f.entry.js.map +0 -1
- package/dist/web-components-library/p-b54d923e.entry.js +0 -2
- package/dist/web-components-library/p-b54d923e.entry.js.map +0 -1
- package/dist/web-components-library/p-b7056859.entry.js +0 -2
- package/dist/web-components-library/p-b7056859.entry.js.map +0 -1
- package/dist/web-components-library/p-b71a3f69.entry.js +0 -2
- package/dist/web-components-library/p-b71a3f69.entry.js.map +0 -1
- package/dist/web-components-library/p-b7ec2cc4.entry.js +0 -2
- package/dist/web-components-library/p-b7ec2cc4.entry.js.map +0 -1
- package/dist/web-components-library/p-bd76ca35.entry.js +0 -2
- package/dist/web-components-library/p-bd76ca35.entry.js.map +0 -1
- package/dist/web-components-library/p-c3e03e41.entry.js +0 -2
- package/dist/web-components-library/p-c3e03e41.entry.js.map +0 -1
- package/dist/web-components-library/p-c811b0cf.entry.js +0 -2
- package/dist/web-components-library/p-c811b0cf.entry.js.map +0 -1
- package/dist/web-components-library/p-c89e1f4b.entry.js +0 -2
- package/dist/web-components-library/p-c89e1f4b.entry.js.map +0 -1
- package/dist/web-components-library/p-c9b81cab.entry.js +0 -2
- package/dist/web-components-library/p-c9b81cab.entry.js.map +0 -1
- package/dist/web-components-library/p-cb395500.js +0 -2
- package/dist/web-components-library/p-cb395500.js.map +0 -1
- package/dist/web-components-library/p-cbc09112.entry.js +0 -2
- package/dist/web-components-library/p-cbc09112.entry.js.map +0 -1
- package/dist/web-components-library/p-da3abb97.entry.js +0 -2
- package/dist/web-components-library/p-da3abb97.entry.js.map +0 -1
- package/dist/web-components-library/p-e1255160.js +0 -2
- package/dist/web-components-library/p-e1255160.js.map +0 -1
- package/dist/web-components-library/p-e8eacbeb.entry.js +0 -8
- package/dist/web-components-library/p-e8eacbeb.entry.js.map +0 -1
- package/dist/web-components-library/p-eb15536d.js.map +0 -1
- package/dist/web-components-library/p-ec1270db.entry.js +0 -2
- package/dist/web-components-library/p-ec1270db.entry.js.map +0 -1
- package/dist/web-components-library/p-efa6b991.entry.js +0 -2
- package/dist/web-components-library/p-efa6b991.entry.js.map +0 -1
- package/dist/web-components-library/p-f2c2ad04.entry.js +0 -2
- package/dist/web-components-library/p-f2c2ad04.entry.js.map +0 -1
- package/dist/web-components-library/p-f4b987ed.entry.js +0 -2
- package/dist/web-components-library/p-f4b987ed.entry.js.map +0 -1
- package/dist/web-components-library/p-f662e7ff.entry.js +0 -2
- package/dist/web-components-library/p-f662e7ff.entry.js.map +0 -1
- package/dist/web-components-library/p-f7e65eb0.entry.js +0 -2
- package/dist/web-components-library/p-f7e65eb0.entry.js.map +0 -1
- package/dist/web-components-library/p-f92e0c29.entry.js +0 -2
- package/dist/web-components-library/p-f92e0c29.entry.js.map +0 -1
- package/dist/web-components-library/p-fbce9614.entry.js +0 -2
- package/dist/web-components-library/p-fbce9614.entry.js.map +0 -1
- package/dist/web-components-library/p-ff89d630.entry.js +0 -2
- package/dist/web-components-library/p-ff89d630.entry.js.map +0 -1
- package/dist/web-components-library/web-components-library.esm.js.map +0 -1
- package/loader/package.json +0 -11
- package/react/components.js.map +0 -1
- package/react/index.js.map +0 -1
- package/react/react-component-lib/createComponent.js.map +0 -1
- package/react/react-component-lib/createOverlayComponent.js.map +0 -1
- package/react/react-component-lib/index.js.map +0 -1
- package/react/react-component-lib/interfaces.js.map +0 -1
- package/react/react-component-lib/utils/attachProps.js.map +0 -1
- package/react/react-component-lib/utils/case.js.map +0 -1
- package/react/react-component-lib/utils/dev.js.map +0 -1
- package/react/react-component-lib/utils/index.js.map +0 -1
- package/www/build/index.esm.js.map +0 -1
- package/www/build/p-05be939d.entry.js +0 -2
- package/www/build/p-05be939d.entry.js.map +0 -1
- package/www/build/p-061e28d6.js +0 -2
- package/www/build/p-061e28d6.js.map +0 -1
- package/www/build/p-0643d684.entry.js +0 -2
- package/www/build/p-0643d684.entry.js.map +0 -1
- package/www/build/p-0aed3ddc.entry.js +0 -2
- package/www/build/p-0aed3ddc.entry.js.map +0 -1
- package/www/build/p-0b03b0e3.js +0 -2
- package/www/build/p-0b03b0e3.js.map +0 -1
- package/www/build/p-1b972597.entry.js +0 -2
- package/www/build/p-1b972597.entry.js.map +0 -1
- package/www/build/p-252893a8.entry.js +0 -2
- package/www/build/p-252893a8.entry.js.map +0 -1
- package/www/build/p-30a78a06.entry.js +0 -2
- package/www/build/p-30a78a06.entry.js.map +0 -1
- package/www/build/p-31bd2a1c.entry.js +0 -2
- package/www/build/p-31bd2a1c.entry.js.map +0 -1
- package/www/build/p-32bc8a40.entry.js +0 -2
- package/www/build/p-32bc8a40.entry.js.map +0 -1
- package/www/build/p-35d73edf.entry.js +0 -2
- package/www/build/p-35d73edf.entry.js.map +0 -1
- package/www/build/p-3977b0ae.entry.js +0 -2
- package/www/build/p-3977b0ae.entry.js.map +0 -1
- package/www/build/p-41891d34.entry.js +0 -2
- package/www/build/p-41891d34.entry.js.map +0 -1
- package/www/build/p-42abfe3b.entry.js +0 -2
- package/www/build/p-42abfe3b.entry.js.map +0 -1
- package/www/build/p-43adca09.entry.js +0 -2
- package/www/build/p-43adca09.entry.js.map +0 -1
- package/www/build/p-447a6391.entry.js +0 -2
- package/www/build/p-447a6391.entry.js.map +0 -1
- package/www/build/p-4504375f.entry.js +0 -2
- package/www/build/p-4504375f.entry.js.map +0 -1
- package/www/build/p-4573c419.js +0 -2
- package/www/build/p-4573c419.js.map +0 -1
- package/www/build/p-47b59f05.entry.js +0 -2
- package/www/build/p-47b59f05.entry.js.map +0 -1
- package/www/build/p-4b38182a.js +0 -2
- package/www/build/p-5145a606.js +0 -2
- package/www/build/p-5145a606.js.map +0 -1
- package/www/build/p-565c1815.entry.js +0 -2
- package/www/build/p-565c1815.entry.js.map +0 -1
- package/www/build/p-5989465b.entry.js +0 -2
- package/www/build/p-5989465b.entry.js.map +0 -1
- package/www/build/p-6164feb9.entry.js +0 -2
- package/www/build/p-6164feb9.entry.js.map +0 -1
- package/www/build/p-623fdee4.js +0 -2
- package/www/build/p-623fdee4.js.map +0 -1
- package/www/build/p-66c0f993.entry.js +0 -2
- package/www/build/p-66c0f993.entry.js.map +0 -1
- package/www/build/p-68d91a93.js +0 -2
- package/www/build/p-68d91a93.js.map +0 -1
- package/www/build/p-6c6a655e.entry.js +0 -2
- package/www/build/p-6c6a655e.entry.js.map +0 -1
- package/www/build/p-6c9cd6be.entry.js.map +0 -1
- package/www/build/p-6d15da6f.entry.js +0 -2
- package/www/build/p-6d15da6f.entry.js.map +0 -1
- package/www/build/p-6e13aa8e.entry.js +0 -2
- package/www/build/p-6e13aa8e.entry.js.map +0 -1
- package/www/build/p-75c4a726.js +0 -3
- package/www/build/p-75c4a726.js.map +0 -1
- package/www/build/p-767b66ca.entry.js +0 -2
- package/www/build/p-767b66ca.entry.js.map +0 -1
- package/www/build/p-76d1d0e4.entry.js +0 -2
- package/www/build/p-76d1d0e4.entry.js.map +0 -1
- package/www/build/p-7a4f6a5b.entry.js +0 -2
- package/www/build/p-7a4f6a5b.entry.js.map +0 -1
- package/www/build/p-7b837e11.js +0 -2
- package/www/build/p-7b837e11.js.map +0 -1
- package/www/build/p-7d655f96.entry.js +0 -2
- package/www/build/p-7d655f96.entry.js.map +0 -1
- package/www/build/p-82eeea83.entry.js +0 -2
- package/www/build/p-82eeea83.entry.js.map +0 -1
- package/www/build/p-8503c87a.entry.js +0 -2
- package/www/build/p-8503c87a.entry.js.map +0 -1
- package/www/build/p-86618221.js +0 -2
- package/www/build/p-86618221.js.map +0 -1
- package/www/build/p-869295ce.entry.js +0 -2
- package/www/build/p-869295ce.entry.js.map +0 -1
- package/www/build/p-88a9865c.entry.js +0 -2
- package/www/build/p-88a9865c.entry.js.map +0 -1
- package/www/build/p-8988eee3.entry.js +0 -2
- package/www/build/p-8988eee3.entry.js.map +0 -1
- package/www/build/p-8b367393.js +0 -2
- package/www/build/p-8b367393.js.map +0 -1
- package/www/build/p-8c52635e.entry.js +0 -2
- package/www/build/p-8c52635e.entry.js.map +0 -1
- package/www/build/p-8fd50cc5.entry.js +0 -2
- package/www/build/p-8fd50cc5.entry.js.map +0 -1
- package/www/build/p-92f13701.entry.js +0 -2
- package/www/build/p-92f13701.entry.js.map +0 -1
- package/www/build/p-93d349ee.entry.js +0 -2
- package/www/build/p-93d349ee.entry.js.map +0 -1
- package/www/build/p-943db3a8.entry.js +0 -2
- package/www/build/p-943db3a8.entry.js.map +0 -1
- package/www/build/p-9814f864.entry.js +0 -2
- package/www/build/p-9814f864.entry.js.map +0 -1
- package/www/build/p-988a58dd.entry.js +0 -2
- package/www/build/p-988a58dd.entry.js.map +0 -1
- package/www/build/p-9ae0c0c6.entry.js +0 -2
- package/www/build/p-9ae0c0c6.entry.js.map +0 -1
- package/www/build/p-9c816a3b.js +0 -2
- package/www/build/p-9c816a3b.js.map +0 -1
- package/www/build/p-a2ee659d.entry.js +0 -2
- package/www/build/p-a2ee659d.entry.js.map +0 -1
- package/www/build/p-a3f9a5da.entry.js +0 -2
- package/www/build/p-a3f9a5da.entry.js.map +0 -1
- package/www/build/p-a4d2cf55.entry.js +0 -2
- package/www/build/p-a4d2cf55.entry.js.map +0 -1
- package/www/build/p-a8790237.entry.js +0 -2
- package/www/build/p-a8790237.entry.js.map +0 -1
- package/www/build/p-aaa96c12.entry.js +0 -17
- package/www/build/p-aaa96c12.entry.js.map +0 -1
- package/www/build/p-accbc381.entry.js +0 -2
- package/www/build/p-accbc381.entry.js.map +0 -1
- package/www/build/p-b0324c7d.entry.js +0 -2
- package/www/build/p-b0324c7d.entry.js.map +0 -1
- package/www/build/p-b391211f.entry.js +0 -2
- package/www/build/p-b391211f.entry.js.map +0 -1
- package/www/build/p-b421424f.entry.js +0 -2
- package/www/build/p-b421424f.entry.js.map +0 -1
- package/www/build/p-b54d923e.entry.js +0 -2
- package/www/build/p-b54d923e.entry.js.map +0 -1
- package/www/build/p-b7056859.entry.js +0 -2
- package/www/build/p-b7056859.entry.js.map +0 -1
- package/www/build/p-b71a3f69.entry.js +0 -2
- package/www/build/p-b71a3f69.entry.js.map +0 -1
- package/www/build/p-b7ec2cc4.entry.js +0 -2
- package/www/build/p-b7ec2cc4.entry.js.map +0 -1
- package/www/build/p-bd76ca35.entry.js +0 -2
- package/www/build/p-bd76ca35.entry.js.map +0 -1
- package/www/build/p-c3e03e41.entry.js +0 -2
- package/www/build/p-c3e03e41.entry.js.map +0 -1
- package/www/build/p-c811b0cf.entry.js +0 -2
- package/www/build/p-c811b0cf.entry.js.map +0 -1
- package/www/build/p-c89e1f4b.entry.js +0 -2
- package/www/build/p-c89e1f4b.entry.js.map +0 -1
- package/www/build/p-c9b81cab.entry.js +0 -2
- package/www/build/p-c9b81cab.entry.js.map +0 -1
- package/www/build/p-cb395500.js +0 -2
- package/www/build/p-cb395500.js.map +0 -1
- package/www/build/p-cbc09112.entry.js +0 -2
- package/www/build/p-cbc09112.entry.js.map +0 -1
- package/www/build/p-da3abb97.entry.js +0 -2
- package/www/build/p-da3abb97.entry.js.map +0 -1
- package/www/build/p-e1255160.js +0 -2
- package/www/build/p-e1255160.js.map +0 -1
- package/www/build/p-e8eacbeb.entry.js +0 -8
- package/www/build/p-e8eacbeb.entry.js.map +0 -1
- package/www/build/p-eb15536d.js.map +0 -1
- package/www/build/p-ec1270db.entry.js +0 -2
- package/www/build/p-ec1270db.entry.js.map +0 -1
- package/www/build/p-efa6b991.entry.js +0 -2
- package/www/build/p-efa6b991.entry.js.map +0 -1
- package/www/build/p-f2c2ad04.entry.js +0 -2
- package/www/build/p-f2c2ad04.entry.js.map +0 -1
- package/www/build/p-f4b987ed.entry.js +0 -2
- package/www/build/p-f4b987ed.entry.js.map +0 -1
- package/www/build/p-f662e7ff.entry.js +0 -2
- package/www/build/p-f662e7ff.entry.js.map +0 -1
- package/www/build/p-f7e65eb0.entry.js +0 -2
- package/www/build/p-f7e65eb0.entry.js.map +0 -1
- package/www/build/p-f92e0c29.entry.js +0 -2
- package/www/build/p-f92e0c29.entry.js.map +0 -1
- package/www/build/p-fbce9614.entry.js +0 -2
- package/www/build/p-fbce9614.entry.js.map +0 -1
- package/www/build/p-ff89d630.entry.js +0 -2
- package/www/build/p-ff89d630.entry.js.map +0 -1
- package/www/build/web-components-library.esm.js.map +0 -1
|
@@ -1,4228 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { r as ToastNotificationTransition, g as KeyboardCode } from './index2.js';
|
|
3
|
-
import { c as commonjsGlobal } from './_commonjsHelpers.js';
|
|
4
|
-
import { d as defineCustomElement$2 } from './index10.js';
|
|
5
|
-
|
|
6
|
-
var purify = {exports: {}};
|
|
7
|
-
|
|
8
|
-
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
|
9
|
-
|
|
10
|
-
(function (module, exports) {
|
|
11
|
-
(function (global, factory) {
|
|
12
|
-
module.exports = factory() ;
|
|
13
|
-
})(commonjsGlobal, (function () {
|
|
14
|
-
const {
|
|
15
|
-
entries,
|
|
16
|
-
setPrototypeOf,
|
|
17
|
-
isFrozen,
|
|
18
|
-
getPrototypeOf,
|
|
19
|
-
getOwnPropertyDescriptor
|
|
20
|
-
} = Object;
|
|
21
|
-
let {
|
|
22
|
-
freeze,
|
|
23
|
-
seal,
|
|
24
|
-
create
|
|
25
|
-
} = Object; // eslint-disable-line import/no-mutable-exports
|
|
26
|
-
let {
|
|
27
|
-
apply,
|
|
28
|
-
construct
|
|
29
|
-
} = typeof Reflect !== 'undefined' && Reflect;
|
|
30
|
-
if (!freeze) {
|
|
31
|
-
freeze = function freeze(x) {
|
|
32
|
-
return x;
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
if (!seal) {
|
|
36
|
-
seal = function seal(x) {
|
|
37
|
-
return x;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
if (!apply) {
|
|
41
|
-
apply = function apply(fun, thisValue, args) {
|
|
42
|
-
return fun.apply(thisValue, args);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
if (!construct) {
|
|
46
|
-
construct = function construct(Func, args) {
|
|
47
|
-
return new Func(...args);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
const arrayForEach = unapply(Array.prototype.forEach);
|
|
51
|
-
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
52
|
-
const arrayPop = unapply(Array.prototype.pop);
|
|
53
|
-
const arrayPush = unapply(Array.prototype.push);
|
|
54
|
-
const arraySplice = unapply(Array.prototype.splice);
|
|
55
|
-
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
56
|
-
const stringToString = unapply(String.prototype.toString);
|
|
57
|
-
const stringMatch = unapply(String.prototype.match);
|
|
58
|
-
const stringReplace = unapply(String.prototype.replace);
|
|
59
|
-
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
60
|
-
const stringTrim = unapply(String.prototype.trim);
|
|
61
|
-
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
62
|
-
const regExpTest = unapply(RegExp.prototype.test);
|
|
63
|
-
const typeErrorCreate = unconstruct(TypeError);
|
|
64
|
-
/**
|
|
65
|
-
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
66
|
-
*
|
|
67
|
-
* @param func - The function to be wrapped and called.
|
|
68
|
-
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
69
|
-
*/
|
|
70
|
-
function unapply(func) {
|
|
71
|
-
return function (thisArg) {
|
|
72
|
-
if (thisArg instanceof RegExp) {
|
|
73
|
-
thisArg.lastIndex = 0;
|
|
74
|
-
}
|
|
75
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
76
|
-
args[_key - 1] = arguments[_key];
|
|
77
|
-
}
|
|
78
|
-
return apply(func, thisArg, args);
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
83
|
-
*
|
|
84
|
-
* @param func - The constructor function to be wrapped and called.
|
|
85
|
-
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
86
|
-
*/
|
|
87
|
-
function unconstruct(func) {
|
|
88
|
-
return function () {
|
|
89
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
90
|
-
args[_key2] = arguments[_key2];
|
|
91
|
-
}
|
|
92
|
-
return construct(func, args);
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Add properties to a lookup table
|
|
97
|
-
*
|
|
98
|
-
* @param set - The set to which elements will be added.
|
|
99
|
-
* @param array - The array containing elements to be added to the set.
|
|
100
|
-
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
101
|
-
* @returns The modified set with added elements.
|
|
102
|
-
*/
|
|
103
|
-
function addToSet(set, array) {
|
|
104
|
-
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
|
105
|
-
if (setPrototypeOf) {
|
|
106
|
-
// Make 'in' and truthy checks like Boolean(set.constructor)
|
|
107
|
-
// independent of any properties defined on Object.prototype.
|
|
108
|
-
// Prevent prototype setters from intercepting set as a this value.
|
|
109
|
-
setPrototypeOf(set, null);
|
|
110
|
-
}
|
|
111
|
-
let l = array.length;
|
|
112
|
-
while (l--) {
|
|
113
|
-
let element = array[l];
|
|
114
|
-
if (typeof element === 'string') {
|
|
115
|
-
const lcElement = transformCaseFunc(element);
|
|
116
|
-
if (lcElement !== element) {
|
|
117
|
-
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
|
118
|
-
if (!isFrozen(array)) {
|
|
119
|
-
array[l] = lcElement;
|
|
120
|
-
}
|
|
121
|
-
element = lcElement;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
set[element] = true;
|
|
125
|
-
}
|
|
126
|
-
return set;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Clean up an array to harden against CSPP
|
|
130
|
-
*
|
|
131
|
-
* @param array - The array to be cleaned.
|
|
132
|
-
* @returns The cleaned version of the array
|
|
133
|
-
*/
|
|
134
|
-
function cleanArray(array) {
|
|
135
|
-
for (let index = 0; index < array.length; index++) {
|
|
136
|
-
const isPropertyExist = objectHasOwnProperty(array, index);
|
|
137
|
-
if (!isPropertyExist) {
|
|
138
|
-
array[index] = null;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return array;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Shallow clone an object
|
|
145
|
-
*
|
|
146
|
-
* @param object - The object to be cloned.
|
|
147
|
-
* @returns A new object that copies the original.
|
|
148
|
-
*/
|
|
149
|
-
function clone(object) {
|
|
150
|
-
const newObject = create(null);
|
|
151
|
-
for (const [property, value] of entries(object)) {
|
|
152
|
-
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
153
|
-
if (isPropertyExist) {
|
|
154
|
-
if (Array.isArray(value)) {
|
|
155
|
-
newObject[property] = cleanArray(value);
|
|
156
|
-
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
|
157
|
-
newObject[property] = clone(value);
|
|
158
|
-
} else {
|
|
159
|
-
newObject[property] = value;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
return newObject;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
167
|
-
*
|
|
168
|
-
* @param object - The object to look up the getter function in its prototype chain.
|
|
169
|
-
* @param prop - The property name for which to find the getter function.
|
|
170
|
-
* @returns The getter function found in the prototype chain or a fallback function.
|
|
171
|
-
*/
|
|
172
|
-
function lookupGetter(object, prop) {
|
|
173
|
-
while (object !== null) {
|
|
174
|
-
const desc = getOwnPropertyDescriptor(object, prop);
|
|
175
|
-
if (desc) {
|
|
176
|
-
if (desc.get) {
|
|
177
|
-
return unapply(desc.get);
|
|
178
|
-
}
|
|
179
|
-
if (typeof desc.value === 'function') {
|
|
180
|
-
return unapply(desc.value);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
object = getPrototypeOf(object);
|
|
184
|
-
}
|
|
185
|
-
function fallbackValue() {
|
|
186
|
-
return null;
|
|
187
|
-
}
|
|
188
|
-
return fallbackValue;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
|
192
|
-
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
|
193
|
-
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
|
194
|
-
// List of SVG elements that are disallowed by default.
|
|
195
|
-
// We still need to know them so that we can do namespace
|
|
196
|
-
// checks properly in case one wants to add them to
|
|
197
|
-
// allow-list.
|
|
198
|
-
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
|
199
|
-
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
|
200
|
-
// Similarly to SVG, we want to know all MathML elements,
|
|
201
|
-
// even those that we disallow by default.
|
|
202
|
-
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
203
|
-
const text = freeze(['#text']);
|
|
204
|
-
|
|
205
|
-
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
|
206
|
-
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
|
207
|
-
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
|
208
|
-
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
209
|
-
|
|
210
|
-
// eslint-disable-next-line unicorn/better-regex
|
|
211
|
-
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
212
|
-
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
213
|
-
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
214
|
-
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
215
|
-
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
216
|
-
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
|
217
|
-
);
|
|
218
|
-
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
219
|
-
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
220
|
-
);
|
|
221
|
-
const DOCTYPE_NAME = seal(/^html$/i);
|
|
222
|
-
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
223
|
-
|
|
224
|
-
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
225
|
-
__proto__: null,
|
|
226
|
-
ARIA_ATTR: ARIA_ATTR,
|
|
227
|
-
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
228
|
-
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
229
|
-
DATA_ATTR: DATA_ATTR,
|
|
230
|
-
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
231
|
-
ERB_EXPR: ERB_EXPR,
|
|
232
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
233
|
-
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
234
|
-
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
235
|
-
TMPLIT_EXPR: TMPLIT_EXPR
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
/* eslint-disable @typescript-eslint/indent */
|
|
239
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
240
|
-
const NODE_TYPE = {
|
|
241
|
-
element: 1,
|
|
242
|
-
attribute: 2,
|
|
243
|
-
text: 3,
|
|
244
|
-
cdataSection: 4,
|
|
245
|
-
entityReference: 5,
|
|
246
|
-
// Deprecated
|
|
247
|
-
entityNode: 6,
|
|
248
|
-
// Deprecated
|
|
249
|
-
progressingInstruction: 7,
|
|
250
|
-
comment: 8,
|
|
251
|
-
document: 9,
|
|
252
|
-
documentType: 10,
|
|
253
|
-
documentFragment: 11,
|
|
254
|
-
notation: 12 // Deprecated
|
|
255
|
-
};
|
|
256
|
-
const getGlobal = function getGlobal() {
|
|
257
|
-
return typeof window === 'undefined' ? null : window;
|
|
258
|
-
};
|
|
259
|
-
/**
|
|
260
|
-
* Creates a no-op policy for internal use only.
|
|
261
|
-
* Don't export this function outside this module!
|
|
262
|
-
* @param trustedTypes The policy factory.
|
|
263
|
-
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
264
|
-
* @return The policy created (or null, if Trusted Types
|
|
265
|
-
* are not supported or creating the policy failed).
|
|
266
|
-
*/
|
|
267
|
-
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
268
|
-
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
269
|
-
return null;
|
|
270
|
-
}
|
|
271
|
-
// Allow the callers to control the unique policy name
|
|
272
|
-
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
273
|
-
// Policy creation with duplicate names throws in Trusted Types.
|
|
274
|
-
let suffix = null;
|
|
275
|
-
const ATTR_NAME = 'data-tt-policy-suffix';
|
|
276
|
-
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
|
277
|
-
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
|
278
|
-
}
|
|
279
|
-
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
|
280
|
-
try {
|
|
281
|
-
return trustedTypes.createPolicy(policyName, {
|
|
282
|
-
createHTML(html) {
|
|
283
|
-
return html;
|
|
284
|
-
},
|
|
285
|
-
createScriptURL(scriptUrl) {
|
|
286
|
-
return scriptUrl;
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
|
-
} catch (_) {
|
|
290
|
-
// Policy creation failed (most likely another DOMPurify script has
|
|
291
|
-
// already run). Skip creating the policy, as this will only cause errors
|
|
292
|
-
// if TT are enforced.
|
|
293
|
-
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
|
294
|
-
return null;
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
const _createHooksMap = function _createHooksMap() {
|
|
298
|
-
return {
|
|
299
|
-
afterSanitizeAttributes: [],
|
|
300
|
-
afterSanitizeElements: [],
|
|
301
|
-
afterSanitizeShadowDOM: [],
|
|
302
|
-
beforeSanitizeAttributes: [],
|
|
303
|
-
beforeSanitizeElements: [],
|
|
304
|
-
beforeSanitizeShadowDOM: [],
|
|
305
|
-
uponSanitizeAttribute: [],
|
|
306
|
-
uponSanitizeElement: [],
|
|
307
|
-
uponSanitizeShadowNode: []
|
|
308
|
-
};
|
|
309
|
-
};
|
|
310
|
-
function createDOMPurify() {
|
|
311
|
-
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
312
|
-
const DOMPurify = root => createDOMPurify(root);
|
|
313
|
-
DOMPurify.version = '3.2.6';
|
|
314
|
-
DOMPurify.removed = [];
|
|
315
|
-
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
316
|
-
// Not running in a browser, provide a factory function
|
|
317
|
-
// so that you can pass your own Window
|
|
318
|
-
DOMPurify.isSupported = false;
|
|
319
|
-
return DOMPurify;
|
|
320
|
-
}
|
|
321
|
-
let {
|
|
322
|
-
document
|
|
323
|
-
} = window;
|
|
324
|
-
const originalDocument = document;
|
|
325
|
-
const currentScript = originalDocument.currentScript;
|
|
326
|
-
const {
|
|
327
|
-
DocumentFragment,
|
|
328
|
-
HTMLTemplateElement,
|
|
329
|
-
Node,
|
|
330
|
-
Element,
|
|
331
|
-
NodeFilter,
|
|
332
|
-
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
|
333
|
-
HTMLFormElement,
|
|
334
|
-
DOMParser,
|
|
335
|
-
trustedTypes
|
|
336
|
-
} = window;
|
|
337
|
-
const ElementPrototype = Element.prototype;
|
|
338
|
-
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
339
|
-
const remove = lookupGetter(ElementPrototype, 'remove');
|
|
340
|
-
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
341
|
-
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
342
|
-
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
343
|
-
// As per issue #47, the web-components registry is inherited by a
|
|
344
|
-
// new document created via createHTMLDocument. As per the spec
|
|
345
|
-
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
346
|
-
// a new empty registry is used when creating a template contents owner
|
|
347
|
-
// document, so we use that as our parent document to ensure nothing
|
|
348
|
-
// is inherited.
|
|
349
|
-
if (typeof HTMLTemplateElement === 'function') {
|
|
350
|
-
const template = document.createElement('template');
|
|
351
|
-
if (template.content && template.content.ownerDocument) {
|
|
352
|
-
document = template.content.ownerDocument;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
|
-
let trustedTypesPolicy;
|
|
356
|
-
let emptyHTML = '';
|
|
357
|
-
const {
|
|
358
|
-
implementation,
|
|
359
|
-
createNodeIterator,
|
|
360
|
-
createDocumentFragment,
|
|
361
|
-
getElementsByTagName
|
|
362
|
-
} = document;
|
|
363
|
-
const {
|
|
364
|
-
importNode
|
|
365
|
-
} = originalDocument;
|
|
366
|
-
let hooks = _createHooksMap();
|
|
367
|
-
/**
|
|
368
|
-
* Expose whether this browser supports running the full DOMPurify.
|
|
369
|
-
*/
|
|
370
|
-
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
|
371
|
-
const {
|
|
372
|
-
MUSTACHE_EXPR,
|
|
373
|
-
ERB_EXPR,
|
|
374
|
-
TMPLIT_EXPR,
|
|
375
|
-
DATA_ATTR,
|
|
376
|
-
ARIA_ATTR,
|
|
377
|
-
IS_SCRIPT_OR_DATA,
|
|
378
|
-
ATTR_WHITESPACE,
|
|
379
|
-
CUSTOM_ELEMENT
|
|
380
|
-
} = EXPRESSIONS;
|
|
381
|
-
let {
|
|
382
|
-
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
383
|
-
} = EXPRESSIONS;
|
|
384
|
-
/**
|
|
385
|
-
* We consider the elements and attributes below to be safe. Ideally
|
|
386
|
-
* don't add any new ones but feel free to remove unwanted ones.
|
|
387
|
-
*/
|
|
388
|
-
/* allowed element names */
|
|
389
|
-
let ALLOWED_TAGS = null;
|
|
390
|
-
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);
|
|
391
|
-
/* Allowed attribute names */
|
|
392
|
-
let ALLOWED_ATTR = null;
|
|
393
|
-
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
394
|
-
/*
|
|
395
|
-
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
|
396
|
-
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
397
|
-
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
|
398
|
-
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
399
|
-
*/
|
|
400
|
-
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
401
|
-
tagNameCheck: {
|
|
402
|
-
writable: true,
|
|
403
|
-
configurable: false,
|
|
404
|
-
enumerable: true,
|
|
405
|
-
value: null
|
|
406
|
-
},
|
|
407
|
-
attributeNameCheck: {
|
|
408
|
-
writable: true,
|
|
409
|
-
configurable: false,
|
|
410
|
-
enumerable: true,
|
|
411
|
-
value: null
|
|
412
|
-
},
|
|
413
|
-
allowCustomizedBuiltInElements: {
|
|
414
|
-
writable: true,
|
|
415
|
-
configurable: false,
|
|
416
|
-
enumerable: true,
|
|
417
|
-
value: false
|
|
418
|
-
}
|
|
419
|
-
}));
|
|
420
|
-
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
421
|
-
let FORBID_TAGS = null;
|
|
422
|
-
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
423
|
-
let FORBID_ATTR = null;
|
|
424
|
-
/* Decide if ARIA attributes are okay */
|
|
425
|
-
let ALLOW_ARIA_ATTR = true;
|
|
426
|
-
/* Decide if custom data attributes are okay */
|
|
427
|
-
let ALLOW_DATA_ATTR = true;
|
|
428
|
-
/* Decide if unknown protocols are okay */
|
|
429
|
-
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
430
|
-
/* Decide if self-closing tags in attributes are allowed.
|
|
431
|
-
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
432
|
-
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
433
|
-
/* Output should be safe for common template engines.
|
|
434
|
-
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
435
|
-
*/
|
|
436
|
-
let SAFE_FOR_TEMPLATES = false;
|
|
437
|
-
/* Output should be safe even for XML used within HTML and alike.
|
|
438
|
-
* This means, DOMPurify removes comments when containing risky content.
|
|
439
|
-
*/
|
|
440
|
-
let SAFE_FOR_XML = true;
|
|
441
|
-
/* Decide if document with <html>... should be returned */
|
|
442
|
-
let WHOLE_DOCUMENT = false;
|
|
443
|
-
/* Track whether config is already set on this instance of DOMPurify. */
|
|
444
|
-
let SET_CONFIG = false;
|
|
445
|
-
/* Decide if all elements (e.g. style, script) must be children of
|
|
446
|
-
* document.body. By default, browsers might move them to document.head */
|
|
447
|
-
let FORCE_BODY = false;
|
|
448
|
-
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
449
|
-
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
450
|
-
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
451
|
-
*/
|
|
452
|
-
let RETURN_DOM = false;
|
|
453
|
-
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
454
|
-
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
455
|
-
let RETURN_DOM_FRAGMENT = false;
|
|
456
|
-
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
457
|
-
* case Trusted Types are not supported */
|
|
458
|
-
let RETURN_TRUSTED_TYPE = false;
|
|
459
|
-
/* Output should be free from DOM clobbering attacks?
|
|
460
|
-
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
461
|
-
*/
|
|
462
|
-
let SANITIZE_DOM = true;
|
|
463
|
-
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
464
|
-
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
465
|
-
*
|
|
466
|
-
* HTML/DOM spec rules that enable DOM Clobbering:
|
|
467
|
-
* - Named Access on Window (§7.3.3)
|
|
468
|
-
* - DOM Tree Accessors (§3.1.5)
|
|
469
|
-
* - Form Element Parent-Child Relations (§4.10.3)
|
|
470
|
-
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
|
471
|
-
* - HTMLCollection (§4.2.10.2)
|
|
472
|
-
*
|
|
473
|
-
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
|
474
|
-
* with a constant string, i.e., `user-content-`
|
|
475
|
-
*/
|
|
476
|
-
let SANITIZE_NAMED_PROPS = false;
|
|
477
|
-
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
478
|
-
/* Keep element content when removing element? */
|
|
479
|
-
let KEEP_CONTENT = true;
|
|
480
|
-
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
481
|
-
* of importing it into a new Document and returning a sanitized copy */
|
|
482
|
-
let IN_PLACE = false;
|
|
483
|
-
/* Allow usage of profiles like html, svg and mathMl */
|
|
484
|
-
let USE_PROFILES = {};
|
|
485
|
-
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
486
|
-
let FORBID_CONTENTS = null;
|
|
487
|
-
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
|
488
|
-
/* Tags that are safe for data: URIs */
|
|
489
|
-
let DATA_URI_TAGS = null;
|
|
490
|
-
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
491
|
-
/* Attributes safe for values like "javascript:" */
|
|
492
|
-
let URI_SAFE_ATTRIBUTES = null;
|
|
493
|
-
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
494
|
-
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
495
|
-
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
496
|
-
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
497
|
-
/* Document namespace */
|
|
498
|
-
let NAMESPACE = HTML_NAMESPACE;
|
|
499
|
-
let IS_EMPTY_INPUT = false;
|
|
500
|
-
/* Allowed XHTML+XML namespaces */
|
|
501
|
-
let ALLOWED_NAMESPACES = null;
|
|
502
|
-
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
503
|
-
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
504
|
-
let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
505
|
-
// Certain elements are allowed in both SVG and HTML
|
|
506
|
-
// namespace. We need to specify them explicitly
|
|
507
|
-
// so that they don't get erroneously deleted from
|
|
508
|
-
// HTML namespace.
|
|
509
|
-
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
510
|
-
/* Parsing of strict XHTML documents */
|
|
511
|
-
let PARSER_MEDIA_TYPE = null;
|
|
512
|
-
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
513
|
-
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
514
|
-
let transformCaseFunc = null;
|
|
515
|
-
/* Keep a reference to config to pass to hooks */
|
|
516
|
-
let CONFIG = null;
|
|
517
|
-
/* Ideally, do not touch anything below this line */
|
|
518
|
-
/* ______________________________________________ */
|
|
519
|
-
const formElement = document.createElement('form');
|
|
520
|
-
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
521
|
-
return testValue instanceof RegExp || testValue instanceof Function;
|
|
522
|
-
};
|
|
523
|
-
/**
|
|
524
|
-
* _parseConfig
|
|
525
|
-
*
|
|
526
|
-
* @param cfg optional config literal
|
|
527
|
-
*/
|
|
528
|
-
// eslint-disable-next-line complexity
|
|
529
|
-
const _parseConfig = function _parseConfig() {
|
|
530
|
-
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
531
|
-
if (CONFIG && CONFIG === cfg) {
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
/* Shield configuration object from tampering */
|
|
535
|
-
if (!cfg || typeof cfg !== 'object') {
|
|
536
|
-
cfg = {};
|
|
537
|
-
}
|
|
538
|
-
/* Shield configuration object from prototype pollution */
|
|
539
|
-
cfg = clone(cfg);
|
|
540
|
-
PARSER_MEDIA_TYPE =
|
|
541
|
-
// eslint-disable-next-line unicorn/prefer-includes
|
|
542
|
-
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
543
|
-
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
544
|
-
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
545
|
-
/* Set configuration parameters */
|
|
546
|
-
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
547
|
-
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
548
|
-
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
549
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
550
|
-
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
551
|
-
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
552
|
-
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
|
553
|
-
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
|
554
|
-
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
|
|
555
|
-
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
556
|
-
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
557
|
-
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
558
|
-
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
|
559
|
-
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
|
560
|
-
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
|
|
561
|
-
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
|
562
|
-
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
|
563
|
-
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
|
564
|
-
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
|
565
|
-
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
|
566
|
-
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
|
567
|
-
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
|
568
|
-
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
|
569
|
-
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
570
|
-
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
571
|
-
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
572
|
-
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
573
|
-
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
574
|
-
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
575
|
-
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
576
|
-
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
577
|
-
}
|
|
578
|
-
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
|
579
|
-
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
|
580
|
-
}
|
|
581
|
-
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
|
|
582
|
-
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
|
583
|
-
}
|
|
584
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
585
|
-
ALLOW_DATA_ATTR = false;
|
|
586
|
-
}
|
|
587
|
-
if (RETURN_DOM_FRAGMENT) {
|
|
588
|
-
RETURN_DOM = true;
|
|
589
|
-
}
|
|
590
|
-
/* Parse profile info */
|
|
591
|
-
if (USE_PROFILES) {
|
|
592
|
-
ALLOWED_TAGS = addToSet({}, text);
|
|
593
|
-
ALLOWED_ATTR = [];
|
|
594
|
-
if (USE_PROFILES.html === true) {
|
|
595
|
-
addToSet(ALLOWED_TAGS, html$1);
|
|
596
|
-
addToSet(ALLOWED_ATTR, html);
|
|
597
|
-
}
|
|
598
|
-
if (USE_PROFILES.svg === true) {
|
|
599
|
-
addToSet(ALLOWED_TAGS, svg$1);
|
|
600
|
-
addToSet(ALLOWED_ATTR, svg);
|
|
601
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
602
|
-
}
|
|
603
|
-
if (USE_PROFILES.svgFilters === true) {
|
|
604
|
-
addToSet(ALLOWED_TAGS, svgFilters);
|
|
605
|
-
addToSet(ALLOWED_ATTR, svg);
|
|
606
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
607
|
-
}
|
|
608
|
-
if (USE_PROFILES.mathMl === true) {
|
|
609
|
-
addToSet(ALLOWED_TAGS, mathMl$1);
|
|
610
|
-
addToSet(ALLOWED_ATTR, mathMl);
|
|
611
|
-
addToSet(ALLOWED_ATTR, xml);
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
/* Merge configuration parameters */
|
|
615
|
-
if (cfg.ADD_TAGS) {
|
|
616
|
-
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
617
|
-
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
618
|
-
}
|
|
619
|
-
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
620
|
-
}
|
|
621
|
-
if (cfg.ADD_ATTR) {
|
|
622
|
-
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
623
|
-
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
624
|
-
}
|
|
625
|
-
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
626
|
-
}
|
|
627
|
-
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
628
|
-
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
629
|
-
}
|
|
630
|
-
if (cfg.FORBID_CONTENTS) {
|
|
631
|
-
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
632
|
-
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
633
|
-
}
|
|
634
|
-
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
635
|
-
}
|
|
636
|
-
/* Add #text in case KEEP_CONTENT is set to true */
|
|
637
|
-
if (KEEP_CONTENT) {
|
|
638
|
-
ALLOWED_TAGS['#text'] = true;
|
|
639
|
-
}
|
|
640
|
-
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
641
|
-
if (WHOLE_DOCUMENT) {
|
|
642
|
-
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
643
|
-
}
|
|
644
|
-
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
645
|
-
if (ALLOWED_TAGS.table) {
|
|
646
|
-
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
647
|
-
delete FORBID_TAGS.tbody;
|
|
648
|
-
}
|
|
649
|
-
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
650
|
-
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
651
|
-
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
652
|
-
}
|
|
653
|
-
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
654
|
-
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
655
|
-
}
|
|
656
|
-
// Overwrite existing TrustedTypes policy.
|
|
657
|
-
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
658
|
-
// Sign local variables required by `sanitize`.
|
|
659
|
-
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
660
|
-
} else {
|
|
661
|
-
// Uninitialized policy, attempt to initialize the internal dompurify policy.
|
|
662
|
-
if (trustedTypesPolicy === undefined) {
|
|
663
|
-
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
664
|
-
}
|
|
665
|
-
// If creating the internal policy succeeded sign internal variables.
|
|
666
|
-
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
|
667
|
-
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
668
|
-
}
|
|
669
|
-
}
|
|
670
|
-
// Prevent further manipulation of configuration.
|
|
671
|
-
// Not available in IE8, Safari 5, etc.
|
|
672
|
-
if (freeze) {
|
|
673
|
-
freeze(cfg);
|
|
674
|
-
}
|
|
675
|
-
CONFIG = cfg;
|
|
676
|
-
};
|
|
677
|
-
/* Keep track of all possible SVG and MathML tags
|
|
678
|
-
* so that we can perform the namespace checks
|
|
679
|
-
* correctly. */
|
|
680
|
-
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
681
|
-
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
682
|
-
/**
|
|
683
|
-
* @param element a DOM element whose namespace is being checked
|
|
684
|
-
* @returns Return false if the element has a
|
|
685
|
-
* namespace that a spec-compliant parser would never
|
|
686
|
-
* return. Return true otherwise.
|
|
687
|
-
*/
|
|
688
|
-
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
689
|
-
let parent = getParentNode(element);
|
|
690
|
-
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
691
|
-
// can be null. We just simulate parent in this case.
|
|
692
|
-
if (!parent || !parent.tagName) {
|
|
693
|
-
parent = {
|
|
694
|
-
namespaceURI: NAMESPACE,
|
|
695
|
-
tagName: 'template'
|
|
696
|
-
};
|
|
697
|
-
}
|
|
698
|
-
const tagName = stringToLowerCase(element.tagName);
|
|
699
|
-
const parentTagName = stringToLowerCase(parent.tagName);
|
|
700
|
-
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
701
|
-
return false;
|
|
702
|
-
}
|
|
703
|
-
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
704
|
-
// The only way to switch from HTML namespace to SVG
|
|
705
|
-
// is via <svg>. If it happens via any other tag, then
|
|
706
|
-
// it should be killed.
|
|
707
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
708
|
-
return tagName === 'svg';
|
|
709
|
-
}
|
|
710
|
-
// The only way to switch from MathML to SVG is via`
|
|
711
|
-
// svg if parent is either <annotation-xml> or MathML
|
|
712
|
-
// text integration points.
|
|
713
|
-
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
714
|
-
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
715
|
-
}
|
|
716
|
-
// We only allow elements that are defined in SVG
|
|
717
|
-
// spec. All others are disallowed in SVG namespace.
|
|
718
|
-
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
719
|
-
}
|
|
720
|
-
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
721
|
-
// The only way to switch from HTML namespace to MathML
|
|
722
|
-
// is via <math>. If it happens via any other tag, then
|
|
723
|
-
// it should be killed.
|
|
724
|
-
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
725
|
-
return tagName === 'math';
|
|
726
|
-
}
|
|
727
|
-
// The only way to switch from SVG to MathML is via
|
|
728
|
-
// <math> and HTML integration points
|
|
729
|
-
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
730
|
-
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
731
|
-
}
|
|
732
|
-
// We only allow elements that are defined in MathML
|
|
733
|
-
// spec. All others are disallowed in MathML namespace.
|
|
734
|
-
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
735
|
-
}
|
|
736
|
-
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
737
|
-
// The only way to switch from SVG to HTML is via
|
|
738
|
-
// HTML integration points, and from MathML to HTML
|
|
739
|
-
// is via MathML text integration points
|
|
740
|
-
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
741
|
-
return false;
|
|
742
|
-
}
|
|
743
|
-
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
// We disallow tags that are specific for MathML
|
|
747
|
-
// or SVG and should never appear in HTML namespace
|
|
748
|
-
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
749
|
-
}
|
|
750
|
-
// For XHTML and XML documents that support custom namespaces
|
|
751
|
-
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
752
|
-
return true;
|
|
753
|
-
}
|
|
754
|
-
// The code should never reach this place (this means
|
|
755
|
-
// that the element somehow got namespace that is not
|
|
756
|
-
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
|
757
|
-
// Return false just in case.
|
|
758
|
-
return false;
|
|
759
|
-
};
|
|
760
|
-
/**
|
|
761
|
-
* _forceRemove
|
|
762
|
-
*
|
|
763
|
-
* @param node a DOM node
|
|
764
|
-
*/
|
|
765
|
-
const _forceRemove = function _forceRemove(node) {
|
|
766
|
-
arrayPush(DOMPurify.removed, {
|
|
767
|
-
element: node
|
|
768
|
-
});
|
|
769
|
-
try {
|
|
770
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
771
|
-
getParentNode(node).removeChild(node);
|
|
772
|
-
} catch (_) {
|
|
773
|
-
remove(node);
|
|
774
|
-
}
|
|
775
|
-
};
|
|
776
|
-
/**
|
|
777
|
-
* _removeAttribute
|
|
778
|
-
*
|
|
779
|
-
* @param name an Attribute name
|
|
780
|
-
* @param element a DOM node
|
|
781
|
-
*/
|
|
782
|
-
const _removeAttribute = function _removeAttribute(name, element) {
|
|
783
|
-
try {
|
|
784
|
-
arrayPush(DOMPurify.removed, {
|
|
785
|
-
attribute: element.getAttributeNode(name),
|
|
786
|
-
from: element
|
|
787
|
-
});
|
|
788
|
-
} catch (_) {
|
|
789
|
-
arrayPush(DOMPurify.removed, {
|
|
790
|
-
attribute: null,
|
|
791
|
-
from: element
|
|
792
|
-
});
|
|
793
|
-
}
|
|
794
|
-
element.removeAttribute(name);
|
|
795
|
-
// We void attribute values for unremovable "is" attributes
|
|
796
|
-
if (name === 'is') {
|
|
797
|
-
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
798
|
-
try {
|
|
799
|
-
_forceRemove(element);
|
|
800
|
-
} catch (_) {}
|
|
801
|
-
} else {
|
|
802
|
-
try {
|
|
803
|
-
element.setAttribute(name, '');
|
|
804
|
-
} catch (_) {}
|
|
805
|
-
}
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
/**
|
|
809
|
-
* _initDocument
|
|
810
|
-
*
|
|
811
|
-
* @param dirty - a string of dirty markup
|
|
812
|
-
* @return a DOM, filled with the dirty markup
|
|
813
|
-
*/
|
|
814
|
-
const _initDocument = function _initDocument(dirty) {
|
|
815
|
-
/* Create a HTML document */
|
|
816
|
-
let doc = null;
|
|
817
|
-
let leadingWhitespace = null;
|
|
818
|
-
if (FORCE_BODY) {
|
|
819
|
-
dirty = '<remove></remove>' + dirty;
|
|
820
|
-
} else {
|
|
821
|
-
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
|
822
|
-
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
823
|
-
leadingWhitespace = matches && matches[0];
|
|
824
|
-
}
|
|
825
|
-
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
|
|
826
|
-
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
827
|
-
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
828
|
-
}
|
|
829
|
-
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
830
|
-
/*
|
|
831
|
-
* Use the DOMParser API by default, fallback later if needs be
|
|
832
|
-
* DOMParser not work for svg when has multiple root element.
|
|
833
|
-
*/
|
|
834
|
-
if (NAMESPACE === HTML_NAMESPACE) {
|
|
835
|
-
try {
|
|
836
|
-
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
837
|
-
} catch (_) {}
|
|
838
|
-
}
|
|
839
|
-
/* Use createHTMLDocument in case DOMParser is not available */
|
|
840
|
-
if (!doc || !doc.documentElement) {
|
|
841
|
-
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
842
|
-
try {
|
|
843
|
-
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
|
844
|
-
} catch (_) {
|
|
845
|
-
// Syntax error if dirtyPayload is invalid xml
|
|
846
|
-
}
|
|
847
|
-
}
|
|
848
|
-
const body = doc.body || doc.documentElement;
|
|
849
|
-
if (dirty && leadingWhitespace) {
|
|
850
|
-
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
851
|
-
}
|
|
852
|
-
/* Work on whole document or just its body */
|
|
853
|
-
if (NAMESPACE === HTML_NAMESPACE) {
|
|
854
|
-
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
|
855
|
-
}
|
|
856
|
-
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
857
|
-
};
|
|
858
|
-
/**
|
|
859
|
-
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
860
|
-
*
|
|
861
|
-
* @param root The root element or node to start traversing on.
|
|
862
|
-
* @return The created NodeIterator
|
|
863
|
-
*/
|
|
864
|
-
const _createNodeIterator = function _createNodeIterator(root) {
|
|
865
|
-
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
866
|
-
// eslint-disable-next-line no-bitwise
|
|
867
|
-
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
868
|
-
};
|
|
869
|
-
/**
|
|
870
|
-
* _isClobbered
|
|
871
|
-
*
|
|
872
|
-
* @param element element to check for clobbering attacks
|
|
873
|
-
* @return true if clobbered, false if safe
|
|
874
|
-
*/
|
|
875
|
-
const _isClobbered = function _isClobbered(element) {
|
|
876
|
-
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
|
877
|
-
};
|
|
878
|
-
/**
|
|
879
|
-
* Checks whether the given object is a DOM node.
|
|
880
|
-
*
|
|
881
|
-
* @param value object to check whether it's a DOM node
|
|
882
|
-
* @return true is object is a DOM node
|
|
883
|
-
*/
|
|
884
|
-
const _isNode = function _isNode(value) {
|
|
885
|
-
return typeof Node === 'function' && value instanceof Node;
|
|
886
|
-
};
|
|
887
|
-
function _executeHooks(hooks, currentNode, data) {
|
|
888
|
-
arrayForEach(hooks, hook => {
|
|
889
|
-
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
/**
|
|
893
|
-
* _sanitizeElements
|
|
894
|
-
*
|
|
895
|
-
* @protect nodeName
|
|
896
|
-
* @protect textContent
|
|
897
|
-
* @protect removeChild
|
|
898
|
-
* @param currentNode to check for permission to exist
|
|
899
|
-
* @return true if node was killed, false if left alive
|
|
900
|
-
*/
|
|
901
|
-
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
902
|
-
let content = null;
|
|
903
|
-
/* Execute a hook if present */
|
|
904
|
-
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
905
|
-
/* Check if element is clobbered or can clobber */
|
|
906
|
-
if (_isClobbered(currentNode)) {
|
|
907
|
-
_forceRemove(currentNode);
|
|
908
|
-
return true;
|
|
909
|
-
}
|
|
910
|
-
/* Now let's check the element's type and name */
|
|
911
|
-
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
912
|
-
/* Execute a hook if present */
|
|
913
|
-
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
914
|
-
tagName,
|
|
915
|
-
allowedTags: ALLOWED_TAGS
|
|
916
|
-
});
|
|
917
|
-
/* Detect mXSS attempts abusing namespace confusion */
|
|
918
|
-
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
919
|
-
_forceRemove(currentNode);
|
|
920
|
-
return true;
|
|
921
|
-
}
|
|
922
|
-
/* Remove any occurrence of processing instructions */
|
|
923
|
-
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
924
|
-
_forceRemove(currentNode);
|
|
925
|
-
return true;
|
|
926
|
-
}
|
|
927
|
-
/* Remove any kind of possibly harmful comments */
|
|
928
|
-
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
929
|
-
_forceRemove(currentNode);
|
|
930
|
-
return true;
|
|
931
|
-
}
|
|
932
|
-
/* Remove element if anything forbids its presence */
|
|
933
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
934
|
-
/* Check if we have a custom element to handle */
|
|
935
|
-
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
936
|
-
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
937
|
-
return false;
|
|
938
|
-
}
|
|
939
|
-
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
940
|
-
return false;
|
|
941
|
-
}
|
|
942
|
-
}
|
|
943
|
-
/* Keep content except for bad-listed elements */
|
|
944
|
-
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
945
|
-
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
946
|
-
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
947
|
-
if (childNodes && parentNode) {
|
|
948
|
-
const childCount = childNodes.length;
|
|
949
|
-
for (let i = childCount - 1; i >= 0; --i) {
|
|
950
|
-
const childClone = cloneNode(childNodes[i], true);
|
|
951
|
-
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
|
952
|
-
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
}
|
|
956
|
-
_forceRemove(currentNode);
|
|
957
|
-
return true;
|
|
958
|
-
}
|
|
959
|
-
/* Check whether element has a valid namespace */
|
|
960
|
-
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
961
|
-
_forceRemove(currentNode);
|
|
962
|
-
return true;
|
|
963
|
-
}
|
|
964
|
-
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
965
|
-
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
966
|
-
_forceRemove(currentNode);
|
|
967
|
-
return true;
|
|
968
|
-
}
|
|
969
|
-
/* Sanitize element content to be template-safe */
|
|
970
|
-
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
971
|
-
/* Get the element's text content */
|
|
972
|
-
content = currentNode.textContent;
|
|
973
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
974
|
-
content = stringReplace(content, expr, ' ');
|
|
975
|
-
});
|
|
976
|
-
if (currentNode.textContent !== content) {
|
|
977
|
-
arrayPush(DOMPurify.removed, {
|
|
978
|
-
element: currentNode.cloneNode()
|
|
979
|
-
});
|
|
980
|
-
currentNode.textContent = content;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
/* Execute a hook if present */
|
|
984
|
-
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
985
|
-
return false;
|
|
986
|
-
};
|
|
987
|
-
/**
|
|
988
|
-
* _isValidAttribute
|
|
989
|
-
*
|
|
990
|
-
* @param lcTag Lowercase tag name of containing element.
|
|
991
|
-
* @param lcName Lowercase attribute name.
|
|
992
|
-
* @param value Attribute value.
|
|
993
|
-
* @return Returns true if `value` is valid, otherwise false.
|
|
994
|
-
*/
|
|
995
|
-
// eslint-disable-next-line complexity
|
|
996
|
-
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
997
|
-
/* Make sure attribute cannot clobber */
|
|
998
|
-
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
999
|
-
return false;
|
|
1000
|
-
}
|
|
1001
|
-
/* Allow valid data-* attributes: At least one character after "-"
|
|
1002
|
-
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
1003
|
-
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
1004
|
-
We don't need to check the value; it's always URI safe. */
|
|
1005
|
-
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
|
1006
|
-
if (
|
|
1007
|
-
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
1008
|
-
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1009
|
-
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
1010
|
-
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
|
1011
|
-
// Alternative, second condition checks if it's an `is`-attribute, AND
|
|
1012
|
-
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
1013
|
-
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
|
1014
|
-
return false;
|
|
1015
|
-
}
|
|
1016
|
-
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
1017
|
-
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
|
1018
|
-
return false;
|
|
1019
|
-
} else ;
|
|
1020
|
-
return true;
|
|
1021
|
-
};
|
|
1022
|
-
/**
|
|
1023
|
-
* _isBasicCustomElement
|
|
1024
|
-
* checks if at least one dash is included in tagName, and it's not the first char
|
|
1025
|
-
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
1026
|
-
*
|
|
1027
|
-
* @param tagName name of the tag of the node to sanitize
|
|
1028
|
-
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
1029
|
-
*/
|
|
1030
|
-
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
1031
|
-
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
|
1032
|
-
};
|
|
1033
|
-
/**
|
|
1034
|
-
* _sanitizeAttributes
|
|
1035
|
-
*
|
|
1036
|
-
* @protect attributes
|
|
1037
|
-
* @protect nodeName
|
|
1038
|
-
* @protect removeAttribute
|
|
1039
|
-
* @protect setAttribute
|
|
1040
|
-
*
|
|
1041
|
-
* @param currentNode to sanitize
|
|
1042
|
-
*/
|
|
1043
|
-
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
1044
|
-
/* Execute a hook if present */
|
|
1045
|
-
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
1046
|
-
const {
|
|
1047
|
-
attributes
|
|
1048
|
-
} = currentNode;
|
|
1049
|
-
/* Check if we have attributes; if not we might have a text node */
|
|
1050
|
-
if (!attributes || _isClobbered(currentNode)) {
|
|
1051
|
-
return;
|
|
1052
|
-
}
|
|
1053
|
-
const hookEvent = {
|
|
1054
|
-
attrName: '',
|
|
1055
|
-
attrValue: '',
|
|
1056
|
-
keepAttr: true,
|
|
1057
|
-
allowedAttributes: ALLOWED_ATTR,
|
|
1058
|
-
forceKeepAttr: undefined
|
|
1059
|
-
};
|
|
1060
|
-
let l = attributes.length;
|
|
1061
|
-
/* Go backwards over all attributes; safely remove bad ones */
|
|
1062
|
-
while (l--) {
|
|
1063
|
-
const attr = attributes[l];
|
|
1064
|
-
const {
|
|
1065
|
-
name,
|
|
1066
|
-
namespaceURI,
|
|
1067
|
-
value: attrValue
|
|
1068
|
-
} = attr;
|
|
1069
|
-
const lcName = transformCaseFunc(name);
|
|
1070
|
-
const initValue = attrValue;
|
|
1071
|
-
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
1072
|
-
/* Execute a hook if present */
|
|
1073
|
-
hookEvent.attrName = lcName;
|
|
1074
|
-
hookEvent.attrValue = value;
|
|
1075
|
-
hookEvent.keepAttr = true;
|
|
1076
|
-
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
1077
|
-
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
1078
|
-
value = hookEvent.attrValue;
|
|
1079
|
-
/* Full DOM Clobbering protection via namespace isolation,
|
|
1080
|
-
* Prefix id and name attributes with `user-content-`
|
|
1081
|
-
*/
|
|
1082
|
-
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
1083
|
-
// Remove the attribute with this value
|
|
1084
|
-
_removeAttribute(name, currentNode);
|
|
1085
|
-
// Prefix the value and later re-create the attribute with the sanitized value
|
|
1086
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
1087
|
-
}
|
|
1088
|
-
/* Work around a security issue with comments inside attributes */
|
|
1089
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
1090
|
-
_removeAttribute(name, currentNode);
|
|
1091
|
-
continue;
|
|
1092
|
-
}
|
|
1093
|
-
/* Did the hooks approve of the attribute? */
|
|
1094
|
-
if (hookEvent.forceKeepAttr) {
|
|
1095
|
-
continue;
|
|
1096
|
-
}
|
|
1097
|
-
/* Did the hooks approve of the attribute? */
|
|
1098
|
-
if (!hookEvent.keepAttr) {
|
|
1099
|
-
_removeAttribute(name, currentNode);
|
|
1100
|
-
continue;
|
|
1101
|
-
}
|
|
1102
|
-
/* Work around a security issue in jQuery 3.0 */
|
|
1103
|
-
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
1104
|
-
_removeAttribute(name, currentNode);
|
|
1105
|
-
continue;
|
|
1106
|
-
}
|
|
1107
|
-
/* Sanitize attribute content to be template-safe */
|
|
1108
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
1109
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1110
|
-
value = stringReplace(value, expr, ' ');
|
|
1111
|
-
});
|
|
1112
|
-
}
|
|
1113
|
-
/* Is `value` valid for this attribute? */
|
|
1114
|
-
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
1115
|
-
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
1116
|
-
_removeAttribute(name, currentNode);
|
|
1117
|
-
continue;
|
|
1118
|
-
}
|
|
1119
|
-
/* Handle attributes that require Trusted Types */
|
|
1120
|
-
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
1121
|
-
if (namespaceURI) ; else {
|
|
1122
|
-
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
1123
|
-
case 'TrustedHTML':
|
|
1124
|
-
{
|
|
1125
|
-
value = trustedTypesPolicy.createHTML(value);
|
|
1126
|
-
break;
|
|
1127
|
-
}
|
|
1128
|
-
case 'TrustedScriptURL':
|
|
1129
|
-
{
|
|
1130
|
-
value = trustedTypesPolicy.createScriptURL(value);
|
|
1131
|
-
break;
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
/* Handle invalid data-* attribute set by try-catching it */
|
|
1137
|
-
if (value !== initValue) {
|
|
1138
|
-
try {
|
|
1139
|
-
if (namespaceURI) {
|
|
1140
|
-
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
1141
|
-
} else {
|
|
1142
|
-
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
1143
|
-
currentNode.setAttribute(name, value);
|
|
1144
|
-
}
|
|
1145
|
-
if (_isClobbered(currentNode)) {
|
|
1146
|
-
_forceRemove(currentNode);
|
|
1147
|
-
} else {
|
|
1148
|
-
arrayPop(DOMPurify.removed);
|
|
1149
|
-
}
|
|
1150
|
-
} catch (_) {
|
|
1151
|
-
_removeAttribute(name, currentNode);
|
|
1152
|
-
}
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
/* Execute a hook if present */
|
|
1156
|
-
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
1157
|
-
};
|
|
1158
|
-
/**
|
|
1159
|
-
* _sanitizeShadowDOM
|
|
1160
|
-
*
|
|
1161
|
-
* @param fragment to iterate over recursively
|
|
1162
|
-
*/
|
|
1163
|
-
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
1164
|
-
let shadowNode = null;
|
|
1165
|
-
const shadowIterator = _createNodeIterator(fragment);
|
|
1166
|
-
/* Execute a hook if present */
|
|
1167
|
-
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
1168
|
-
while (shadowNode = shadowIterator.nextNode()) {
|
|
1169
|
-
/* Execute a hook if present */
|
|
1170
|
-
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
1171
|
-
/* Sanitize tags and elements */
|
|
1172
|
-
_sanitizeElements(shadowNode);
|
|
1173
|
-
/* Check attributes next */
|
|
1174
|
-
_sanitizeAttributes(shadowNode);
|
|
1175
|
-
/* Deep shadow DOM detected */
|
|
1176
|
-
if (shadowNode.content instanceof DocumentFragment) {
|
|
1177
|
-
_sanitizeShadowDOM(shadowNode.content);
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
/* Execute a hook if present */
|
|
1181
|
-
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
1182
|
-
};
|
|
1183
|
-
// eslint-disable-next-line complexity
|
|
1184
|
-
DOMPurify.sanitize = function (dirty) {
|
|
1185
|
-
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1186
|
-
let body = null;
|
|
1187
|
-
let importedNode = null;
|
|
1188
|
-
let currentNode = null;
|
|
1189
|
-
let returnNode = null;
|
|
1190
|
-
/* Make sure we have a string to sanitize.
|
|
1191
|
-
DO NOT return early, as this will return the wrong type if
|
|
1192
|
-
the user has requested a DOM object rather than a string */
|
|
1193
|
-
IS_EMPTY_INPUT = !dirty;
|
|
1194
|
-
if (IS_EMPTY_INPUT) {
|
|
1195
|
-
dirty = '<!-->';
|
|
1196
|
-
}
|
|
1197
|
-
/* Stringify, in case dirty is an object */
|
|
1198
|
-
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
1199
|
-
if (typeof dirty.toString === 'function') {
|
|
1200
|
-
dirty = dirty.toString();
|
|
1201
|
-
if (typeof dirty !== 'string') {
|
|
1202
|
-
throw typeErrorCreate('dirty is not a string, aborting');
|
|
1203
|
-
}
|
|
1204
|
-
} else {
|
|
1205
|
-
throw typeErrorCreate('toString is not a function');
|
|
1206
|
-
}
|
|
1207
|
-
}
|
|
1208
|
-
/* Return dirty HTML if DOMPurify cannot run */
|
|
1209
|
-
if (!DOMPurify.isSupported) {
|
|
1210
|
-
return dirty;
|
|
1211
|
-
}
|
|
1212
|
-
/* Assign config vars */
|
|
1213
|
-
if (!SET_CONFIG) {
|
|
1214
|
-
_parseConfig(cfg);
|
|
1215
|
-
}
|
|
1216
|
-
/* Clean up removed elements */
|
|
1217
|
-
DOMPurify.removed = [];
|
|
1218
|
-
/* Check if dirty is correctly typed for IN_PLACE */
|
|
1219
|
-
if (typeof dirty === 'string') {
|
|
1220
|
-
IN_PLACE = false;
|
|
1221
|
-
}
|
|
1222
|
-
if (IN_PLACE) {
|
|
1223
|
-
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
|
1224
|
-
if (dirty.nodeName) {
|
|
1225
|
-
const tagName = transformCaseFunc(dirty.nodeName);
|
|
1226
|
-
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
1227
|
-
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
1228
|
-
}
|
|
1229
|
-
}
|
|
1230
|
-
} else if (dirty instanceof Node) {
|
|
1231
|
-
/* If dirty is a DOM element, append to an empty document to avoid
|
|
1232
|
-
elements being stripped by the parser */
|
|
1233
|
-
body = _initDocument('<!---->');
|
|
1234
|
-
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
1235
|
-
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
|
|
1236
|
-
/* Node is already a body, use as is */
|
|
1237
|
-
body = importedNode;
|
|
1238
|
-
} else if (importedNode.nodeName === 'HTML') {
|
|
1239
|
-
body = importedNode;
|
|
1240
|
-
} else {
|
|
1241
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1242
|
-
body.appendChild(importedNode);
|
|
1243
|
-
}
|
|
1244
|
-
} else {
|
|
1245
|
-
/* Exit directly if we have nothing to do */
|
|
1246
|
-
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
1247
|
-
// eslint-disable-next-line unicorn/prefer-includes
|
|
1248
|
-
dirty.indexOf('<') === -1) {
|
|
1249
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
1250
|
-
}
|
|
1251
|
-
/* Initialize the document to work on */
|
|
1252
|
-
body = _initDocument(dirty);
|
|
1253
|
-
/* Check we have a DOM node from the data */
|
|
1254
|
-
if (!body) {
|
|
1255
|
-
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
1259
|
-
if (body && FORCE_BODY) {
|
|
1260
|
-
_forceRemove(body.firstChild);
|
|
1261
|
-
}
|
|
1262
|
-
/* Get node iterator */
|
|
1263
|
-
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
1264
|
-
/* Now start iterating over the created document */
|
|
1265
|
-
while (currentNode = nodeIterator.nextNode()) {
|
|
1266
|
-
/* Sanitize tags and elements */
|
|
1267
|
-
_sanitizeElements(currentNode);
|
|
1268
|
-
/* Check attributes next */
|
|
1269
|
-
_sanitizeAttributes(currentNode);
|
|
1270
|
-
/* Shadow DOM detected, sanitize it */
|
|
1271
|
-
if (currentNode.content instanceof DocumentFragment) {
|
|
1272
|
-
_sanitizeShadowDOM(currentNode.content);
|
|
1273
|
-
}
|
|
1274
|
-
}
|
|
1275
|
-
/* If we sanitized `dirty` in-place, return it. */
|
|
1276
|
-
if (IN_PLACE) {
|
|
1277
|
-
return dirty;
|
|
1278
|
-
}
|
|
1279
|
-
/* Return sanitized string or DOM */
|
|
1280
|
-
if (RETURN_DOM) {
|
|
1281
|
-
if (RETURN_DOM_FRAGMENT) {
|
|
1282
|
-
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
1283
|
-
while (body.firstChild) {
|
|
1284
|
-
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
1285
|
-
returnNode.appendChild(body.firstChild);
|
|
1286
|
-
}
|
|
1287
|
-
} else {
|
|
1288
|
-
returnNode = body;
|
|
1289
|
-
}
|
|
1290
|
-
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
|
1291
|
-
/*
|
|
1292
|
-
AdoptNode() is not used because internal state is not reset
|
|
1293
|
-
(e.g. the past names map of a HTMLFormElement), this is safe
|
|
1294
|
-
in theory but we would rather not risk another attack vector.
|
|
1295
|
-
The state that is cloned by importNode() is explicitly defined
|
|
1296
|
-
by the specs.
|
|
1297
|
-
*/
|
|
1298
|
-
returnNode = importNode.call(originalDocument, returnNode, true);
|
|
1299
|
-
}
|
|
1300
|
-
return returnNode;
|
|
1301
|
-
}
|
|
1302
|
-
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
1303
|
-
/* Serialize doctype if allowed */
|
|
1304
|
-
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
1305
|
-
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
|
1306
|
-
}
|
|
1307
|
-
/* Sanitize final string template-safe */
|
|
1308
|
-
if (SAFE_FOR_TEMPLATES) {
|
|
1309
|
-
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
1310
|
-
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
1311
|
-
});
|
|
1312
|
-
}
|
|
1313
|
-
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
1314
|
-
};
|
|
1315
|
-
DOMPurify.setConfig = function () {
|
|
1316
|
-
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1317
|
-
_parseConfig(cfg);
|
|
1318
|
-
SET_CONFIG = true;
|
|
1319
|
-
};
|
|
1320
|
-
DOMPurify.clearConfig = function () {
|
|
1321
|
-
CONFIG = null;
|
|
1322
|
-
SET_CONFIG = false;
|
|
1323
|
-
};
|
|
1324
|
-
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
1325
|
-
/* Initialize shared config vars if necessary. */
|
|
1326
|
-
if (!CONFIG) {
|
|
1327
|
-
_parseConfig({});
|
|
1328
|
-
}
|
|
1329
|
-
const lcTag = transformCaseFunc(tag);
|
|
1330
|
-
const lcName = transformCaseFunc(attr);
|
|
1331
|
-
return _isValidAttribute(lcTag, lcName, value);
|
|
1332
|
-
};
|
|
1333
|
-
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
1334
|
-
if (typeof hookFunction !== 'function') {
|
|
1335
|
-
return;
|
|
1336
|
-
}
|
|
1337
|
-
arrayPush(hooks[entryPoint], hookFunction);
|
|
1338
|
-
};
|
|
1339
|
-
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
1340
|
-
if (hookFunction !== undefined) {
|
|
1341
|
-
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
1342
|
-
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
1343
|
-
}
|
|
1344
|
-
return arrayPop(hooks[entryPoint]);
|
|
1345
|
-
};
|
|
1346
|
-
DOMPurify.removeHooks = function (entryPoint) {
|
|
1347
|
-
hooks[entryPoint] = [];
|
|
1348
|
-
};
|
|
1349
|
-
DOMPurify.removeAllHooks = function () {
|
|
1350
|
-
hooks = _createHooksMap();
|
|
1351
|
-
};
|
|
1352
|
-
return DOMPurify;
|
|
1353
|
-
}
|
|
1354
|
-
var purify = createDOMPurify();
|
|
1355
|
-
|
|
1356
|
-
return purify;
|
|
1357
|
-
|
|
1358
|
-
}));
|
|
1359
|
-
|
|
1360
|
-
}(purify));
|
|
1361
|
-
|
|
1362
|
-
const DOMPurify = purify.exports;
|
|
1363
|
-
|
|
1364
|
-
var hammer = {exports: {}};
|
|
1365
|
-
|
|
1366
|
-
/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
1367
|
-
* http://hammerjs.github.io/
|
|
1368
|
-
*
|
|
1369
|
-
* Copyright (c) 2016 Jorik Tangelder;
|
|
1370
|
-
* Licensed under the MIT license */
|
|
1371
|
-
|
|
1372
|
-
(function (module) {
|
|
1373
|
-
(function(window, document, exportName, undefined$1) {
|
|
1374
|
-
|
|
1375
|
-
var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
|
|
1376
|
-
var TEST_ELEMENT = document.createElement('div');
|
|
1377
|
-
|
|
1378
|
-
var TYPE_FUNCTION = 'function';
|
|
1379
|
-
|
|
1380
|
-
var round = Math.round;
|
|
1381
|
-
var abs = Math.abs;
|
|
1382
|
-
var now = Date.now;
|
|
1383
|
-
|
|
1384
|
-
/**
|
|
1385
|
-
* set a timeout with a given scope
|
|
1386
|
-
* @param {Function} fn
|
|
1387
|
-
* @param {Number} timeout
|
|
1388
|
-
* @param {Object} context
|
|
1389
|
-
* @returns {number}
|
|
1390
|
-
*/
|
|
1391
|
-
function setTimeoutContext(fn, timeout, context) {
|
|
1392
|
-
return setTimeout(bindFn(fn, context), timeout);
|
|
1393
|
-
}
|
|
1394
|
-
|
|
1395
|
-
/**
|
|
1396
|
-
* if the argument is an array, we want to execute the fn on each entry
|
|
1397
|
-
* if it aint an array we don't want to do a thing.
|
|
1398
|
-
* this is used by all the methods that accept a single and array argument.
|
|
1399
|
-
* @param {*|Array} arg
|
|
1400
|
-
* @param {String} fn
|
|
1401
|
-
* @param {Object} [context]
|
|
1402
|
-
* @returns {Boolean}
|
|
1403
|
-
*/
|
|
1404
|
-
function invokeArrayArg(arg, fn, context) {
|
|
1405
|
-
if (Array.isArray(arg)) {
|
|
1406
|
-
each(arg, context[fn], context);
|
|
1407
|
-
return true;
|
|
1408
|
-
}
|
|
1409
|
-
return false;
|
|
1410
|
-
}
|
|
1411
|
-
|
|
1412
|
-
/**
|
|
1413
|
-
* walk objects and arrays
|
|
1414
|
-
* @param {Object} obj
|
|
1415
|
-
* @param {Function} iterator
|
|
1416
|
-
* @param {Object} context
|
|
1417
|
-
*/
|
|
1418
|
-
function each(obj, iterator, context) {
|
|
1419
|
-
var i;
|
|
1420
|
-
|
|
1421
|
-
if (!obj) {
|
|
1422
|
-
return;
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
if (obj.forEach) {
|
|
1426
|
-
obj.forEach(iterator, context);
|
|
1427
|
-
} else if (obj.length !== undefined$1) {
|
|
1428
|
-
i = 0;
|
|
1429
|
-
while (i < obj.length) {
|
|
1430
|
-
iterator.call(context, obj[i], i, obj);
|
|
1431
|
-
i++;
|
|
1432
|
-
}
|
|
1433
|
-
} else {
|
|
1434
|
-
for (i in obj) {
|
|
1435
|
-
obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
|
|
1436
|
-
}
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
|
|
1440
|
-
/**
|
|
1441
|
-
* wrap a method with a deprecation warning and stack trace
|
|
1442
|
-
* @param {Function} method
|
|
1443
|
-
* @param {String} name
|
|
1444
|
-
* @param {String} message
|
|
1445
|
-
* @returns {Function} A new function wrapping the supplied method.
|
|
1446
|
-
*/
|
|
1447
|
-
function deprecate(method, name, message) {
|
|
1448
|
-
var deprecationMessage = 'DEPRECATED METHOD: ' + name + '\n' + message + ' AT \n';
|
|
1449
|
-
return function() {
|
|
1450
|
-
var e = new Error('get-stack-trace');
|
|
1451
|
-
var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '')
|
|
1452
|
-
.replace(/^\s+at\s+/gm, '')
|
|
1453
|
-
.replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
|
|
1454
|
-
|
|
1455
|
-
var log = window.console && (window.console.warn || window.console.log);
|
|
1456
|
-
if (log) {
|
|
1457
|
-
log.call(window.console, deprecationMessage, stack);
|
|
1458
|
-
}
|
|
1459
|
-
return method.apply(this, arguments);
|
|
1460
|
-
};
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
/**
|
|
1464
|
-
* extend object.
|
|
1465
|
-
* means that properties in dest will be overwritten by the ones in src.
|
|
1466
|
-
* @param {Object} target
|
|
1467
|
-
* @param {...Object} objects_to_assign
|
|
1468
|
-
* @returns {Object} target
|
|
1469
|
-
*/
|
|
1470
|
-
var assign;
|
|
1471
|
-
if (typeof Object.assign !== 'function') {
|
|
1472
|
-
assign = function assign(target) {
|
|
1473
|
-
if (target === undefined$1 || target === null) {
|
|
1474
|
-
throw new TypeError('Cannot convert undefined or null to object');
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
var output = Object(target);
|
|
1478
|
-
for (var index = 1; index < arguments.length; index++) {
|
|
1479
|
-
var source = arguments[index];
|
|
1480
|
-
if (source !== undefined$1 && source !== null) {
|
|
1481
|
-
for (var nextKey in source) {
|
|
1482
|
-
if (source.hasOwnProperty(nextKey)) {
|
|
1483
|
-
output[nextKey] = source[nextKey];
|
|
1484
|
-
}
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
}
|
|
1488
|
-
return output;
|
|
1489
|
-
};
|
|
1490
|
-
} else {
|
|
1491
|
-
assign = Object.assign;
|
|
1492
|
-
}
|
|
1493
|
-
|
|
1494
|
-
/**
|
|
1495
|
-
* extend object.
|
|
1496
|
-
* means that properties in dest will be overwritten by the ones in src.
|
|
1497
|
-
* @param {Object} dest
|
|
1498
|
-
* @param {Object} src
|
|
1499
|
-
* @param {Boolean} [merge=false]
|
|
1500
|
-
* @returns {Object} dest
|
|
1501
|
-
*/
|
|
1502
|
-
var extend = deprecate(function extend(dest, src, merge) {
|
|
1503
|
-
var keys = Object.keys(src);
|
|
1504
|
-
var i = 0;
|
|
1505
|
-
while (i < keys.length) {
|
|
1506
|
-
if (!merge || (merge && dest[keys[i]] === undefined$1)) {
|
|
1507
|
-
dest[keys[i]] = src[keys[i]];
|
|
1508
|
-
}
|
|
1509
|
-
i++;
|
|
1510
|
-
}
|
|
1511
|
-
return dest;
|
|
1512
|
-
}, 'extend', 'Use `assign`.');
|
|
1513
|
-
|
|
1514
|
-
/**
|
|
1515
|
-
* merge the values from src in the dest.
|
|
1516
|
-
* means that properties that exist in dest will not be overwritten by src
|
|
1517
|
-
* @param {Object} dest
|
|
1518
|
-
* @param {Object} src
|
|
1519
|
-
* @returns {Object} dest
|
|
1520
|
-
*/
|
|
1521
|
-
var merge = deprecate(function merge(dest, src) {
|
|
1522
|
-
return extend(dest, src, true);
|
|
1523
|
-
}, 'merge', 'Use `assign`.');
|
|
1524
|
-
|
|
1525
|
-
/**
|
|
1526
|
-
* simple class inheritance
|
|
1527
|
-
* @param {Function} child
|
|
1528
|
-
* @param {Function} base
|
|
1529
|
-
* @param {Object} [properties]
|
|
1530
|
-
*/
|
|
1531
|
-
function inherit(child, base, properties) {
|
|
1532
|
-
var baseP = base.prototype,
|
|
1533
|
-
childP;
|
|
1534
|
-
|
|
1535
|
-
childP = child.prototype = Object.create(baseP);
|
|
1536
|
-
childP.constructor = child;
|
|
1537
|
-
childP._super = baseP;
|
|
1538
|
-
|
|
1539
|
-
if (properties) {
|
|
1540
|
-
assign(childP, properties);
|
|
1541
|
-
}
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
/**
|
|
1545
|
-
* simple function bind
|
|
1546
|
-
* @param {Function} fn
|
|
1547
|
-
* @param {Object} context
|
|
1548
|
-
* @returns {Function}
|
|
1549
|
-
*/
|
|
1550
|
-
function bindFn(fn, context) {
|
|
1551
|
-
return function boundFn() {
|
|
1552
|
-
return fn.apply(context, arguments);
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
/**
|
|
1557
|
-
* let a boolean value also be a function that must return a boolean
|
|
1558
|
-
* this first item in args will be used as the context
|
|
1559
|
-
* @param {Boolean|Function} val
|
|
1560
|
-
* @param {Array} [args]
|
|
1561
|
-
* @returns {Boolean}
|
|
1562
|
-
*/
|
|
1563
|
-
function boolOrFn(val, args) {
|
|
1564
|
-
if (typeof val == TYPE_FUNCTION) {
|
|
1565
|
-
return val.apply(args ? args[0] || undefined$1 : undefined$1, args);
|
|
1566
|
-
}
|
|
1567
|
-
return val;
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
|
-
/**
|
|
1571
|
-
* use the val2 when val1 is undefined
|
|
1572
|
-
* @param {*} val1
|
|
1573
|
-
* @param {*} val2
|
|
1574
|
-
* @returns {*}
|
|
1575
|
-
*/
|
|
1576
|
-
function ifUndefined(val1, val2) {
|
|
1577
|
-
return (val1 === undefined$1) ? val2 : val1;
|
|
1578
|
-
}
|
|
1579
|
-
|
|
1580
|
-
/**
|
|
1581
|
-
* addEventListener with multiple events at once
|
|
1582
|
-
* @param {EventTarget} target
|
|
1583
|
-
* @param {String} types
|
|
1584
|
-
* @param {Function} handler
|
|
1585
|
-
*/
|
|
1586
|
-
function addEventListeners(target, types, handler) {
|
|
1587
|
-
each(splitStr(types), function(type) {
|
|
1588
|
-
target.addEventListener(type, handler, false);
|
|
1589
|
-
});
|
|
1590
|
-
}
|
|
1591
|
-
|
|
1592
|
-
/**
|
|
1593
|
-
* removeEventListener with multiple events at once
|
|
1594
|
-
* @param {EventTarget} target
|
|
1595
|
-
* @param {String} types
|
|
1596
|
-
* @param {Function} handler
|
|
1597
|
-
*/
|
|
1598
|
-
function removeEventListeners(target, types, handler) {
|
|
1599
|
-
each(splitStr(types), function(type) {
|
|
1600
|
-
target.removeEventListener(type, handler, false);
|
|
1601
|
-
});
|
|
1602
|
-
}
|
|
1603
|
-
|
|
1604
|
-
/**
|
|
1605
|
-
* find if a node is in the given parent
|
|
1606
|
-
* @method hasParent
|
|
1607
|
-
* @param {HTMLElement} node
|
|
1608
|
-
* @param {HTMLElement} parent
|
|
1609
|
-
* @return {Boolean} found
|
|
1610
|
-
*/
|
|
1611
|
-
function hasParent(node, parent) {
|
|
1612
|
-
while (node) {
|
|
1613
|
-
if (node == parent) {
|
|
1614
|
-
return true;
|
|
1615
|
-
}
|
|
1616
|
-
node = node.parentNode;
|
|
1617
|
-
}
|
|
1618
|
-
return false;
|
|
1619
|
-
}
|
|
1620
|
-
|
|
1621
|
-
/**
|
|
1622
|
-
* small indexOf wrapper
|
|
1623
|
-
* @param {String} str
|
|
1624
|
-
* @param {String} find
|
|
1625
|
-
* @returns {Boolean} found
|
|
1626
|
-
*/
|
|
1627
|
-
function inStr(str, find) {
|
|
1628
|
-
return str.indexOf(find) > -1;
|
|
1629
|
-
}
|
|
1630
|
-
|
|
1631
|
-
/**
|
|
1632
|
-
* split string on whitespace
|
|
1633
|
-
* @param {String} str
|
|
1634
|
-
* @returns {Array} words
|
|
1635
|
-
*/
|
|
1636
|
-
function splitStr(str) {
|
|
1637
|
-
return str.trim().split(/\s+/g);
|
|
1638
|
-
}
|
|
1639
|
-
|
|
1640
|
-
/**
|
|
1641
|
-
* find if a array contains the object using indexOf or a simple polyFill
|
|
1642
|
-
* @param {Array} src
|
|
1643
|
-
* @param {String} find
|
|
1644
|
-
* @param {String} [findByKey]
|
|
1645
|
-
* @return {Boolean|Number} false when not found, or the index
|
|
1646
|
-
*/
|
|
1647
|
-
function inArray(src, find, findByKey) {
|
|
1648
|
-
if (src.indexOf && !findByKey) {
|
|
1649
|
-
return src.indexOf(find);
|
|
1650
|
-
} else {
|
|
1651
|
-
var i = 0;
|
|
1652
|
-
while (i < src.length) {
|
|
1653
|
-
if ((findByKey && src[i][findByKey] == find) || (!findByKey && src[i] === find)) {
|
|
1654
|
-
return i;
|
|
1655
|
-
}
|
|
1656
|
-
i++;
|
|
1657
|
-
}
|
|
1658
|
-
return -1;
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
|
|
1662
|
-
/**
|
|
1663
|
-
* convert array-like objects to real arrays
|
|
1664
|
-
* @param {Object} obj
|
|
1665
|
-
* @returns {Array}
|
|
1666
|
-
*/
|
|
1667
|
-
function toArray(obj) {
|
|
1668
|
-
return Array.prototype.slice.call(obj, 0);
|
|
1669
|
-
}
|
|
1670
|
-
|
|
1671
|
-
/**
|
|
1672
|
-
* unique array with objects based on a key (like 'id') or just by the array's value
|
|
1673
|
-
* @param {Array} src [{id:1},{id:2},{id:1}]
|
|
1674
|
-
* @param {String} [key]
|
|
1675
|
-
* @param {Boolean} [sort=False]
|
|
1676
|
-
* @returns {Array} [{id:1},{id:2}]
|
|
1677
|
-
*/
|
|
1678
|
-
function uniqueArray(src, key, sort) {
|
|
1679
|
-
var results = [];
|
|
1680
|
-
var values = [];
|
|
1681
|
-
var i = 0;
|
|
1682
|
-
|
|
1683
|
-
while (i < src.length) {
|
|
1684
|
-
var val = key ? src[i][key] : src[i];
|
|
1685
|
-
if (inArray(values, val) < 0) {
|
|
1686
|
-
results.push(src[i]);
|
|
1687
|
-
}
|
|
1688
|
-
values[i] = val;
|
|
1689
|
-
i++;
|
|
1690
|
-
}
|
|
1691
|
-
|
|
1692
|
-
if (sort) {
|
|
1693
|
-
if (!key) {
|
|
1694
|
-
results = results.sort();
|
|
1695
|
-
} else {
|
|
1696
|
-
results = results.sort(function sortUniqueArray(a, b) {
|
|
1697
|
-
return a[key] > b[key];
|
|
1698
|
-
});
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
return results;
|
|
1703
|
-
}
|
|
1704
|
-
|
|
1705
|
-
/**
|
|
1706
|
-
* get the prefixed property
|
|
1707
|
-
* @param {Object} obj
|
|
1708
|
-
* @param {String} property
|
|
1709
|
-
* @returns {String|Undefined} prefixed
|
|
1710
|
-
*/
|
|
1711
|
-
function prefixed(obj, property) {
|
|
1712
|
-
var prefix, prop;
|
|
1713
|
-
var camelProp = property[0].toUpperCase() + property.slice(1);
|
|
1714
|
-
|
|
1715
|
-
var i = 0;
|
|
1716
|
-
while (i < VENDOR_PREFIXES.length) {
|
|
1717
|
-
prefix = VENDOR_PREFIXES[i];
|
|
1718
|
-
prop = (prefix) ? prefix + camelProp : property;
|
|
1719
|
-
|
|
1720
|
-
if (prop in obj) {
|
|
1721
|
-
return prop;
|
|
1722
|
-
}
|
|
1723
|
-
i++;
|
|
1724
|
-
}
|
|
1725
|
-
return undefined$1;
|
|
1726
|
-
}
|
|
1727
|
-
|
|
1728
|
-
/**
|
|
1729
|
-
* get a unique id
|
|
1730
|
-
* @returns {number} uniqueId
|
|
1731
|
-
*/
|
|
1732
|
-
var _uniqueId = 1;
|
|
1733
|
-
function uniqueId() {
|
|
1734
|
-
return _uniqueId++;
|
|
1735
|
-
}
|
|
1736
|
-
|
|
1737
|
-
/**
|
|
1738
|
-
* get the window object of an element
|
|
1739
|
-
* @param {HTMLElement} element
|
|
1740
|
-
* @returns {DocumentView|Window}
|
|
1741
|
-
*/
|
|
1742
|
-
function getWindowForElement(element) {
|
|
1743
|
-
var doc = element.ownerDocument || element;
|
|
1744
|
-
return (doc.defaultView || doc.parentWindow || window);
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
|
1748
|
-
|
|
1749
|
-
var SUPPORT_TOUCH = ('ontouchstart' in window);
|
|
1750
|
-
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined$1;
|
|
1751
|
-
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
|
1752
|
-
|
|
1753
|
-
var INPUT_TYPE_TOUCH = 'touch';
|
|
1754
|
-
var INPUT_TYPE_PEN = 'pen';
|
|
1755
|
-
var INPUT_TYPE_MOUSE = 'mouse';
|
|
1756
|
-
var INPUT_TYPE_KINECT = 'kinect';
|
|
1757
|
-
|
|
1758
|
-
var COMPUTE_INTERVAL = 25;
|
|
1759
|
-
|
|
1760
|
-
var INPUT_START = 1;
|
|
1761
|
-
var INPUT_MOVE = 2;
|
|
1762
|
-
var INPUT_END = 4;
|
|
1763
|
-
var INPUT_CANCEL = 8;
|
|
1764
|
-
|
|
1765
|
-
var DIRECTION_NONE = 1;
|
|
1766
|
-
var DIRECTION_LEFT = 2;
|
|
1767
|
-
var DIRECTION_RIGHT = 4;
|
|
1768
|
-
var DIRECTION_UP = 8;
|
|
1769
|
-
var DIRECTION_DOWN = 16;
|
|
1770
|
-
|
|
1771
|
-
var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
|
|
1772
|
-
var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
|
|
1773
|
-
var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
|
|
1774
|
-
|
|
1775
|
-
var PROPS_XY = ['x', 'y'];
|
|
1776
|
-
var PROPS_CLIENT_XY = ['clientX', 'clientY'];
|
|
1777
|
-
|
|
1778
|
-
/**
|
|
1779
|
-
* create new input type manager
|
|
1780
|
-
* @param {Manager} manager
|
|
1781
|
-
* @param {Function} callback
|
|
1782
|
-
* @returns {Input}
|
|
1783
|
-
* @constructor
|
|
1784
|
-
*/
|
|
1785
|
-
function Input(manager, callback) {
|
|
1786
|
-
var self = this;
|
|
1787
|
-
this.manager = manager;
|
|
1788
|
-
this.callback = callback;
|
|
1789
|
-
this.element = manager.element;
|
|
1790
|
-
this.target = manager.options.inputTarget;
|
|
1791
|
-
|
|
1792
|
-
// smaller wrapper around the handler, for the scope and the enabled state of the manager,
|
|
1793
|
-
// so when disabled the input events are completely bypassed.
|
|
1794
|
-
this.domHandler = function(ev) {
|
|
1795
|
-
if (boolOrFn(manager.options.enable, [manager])) {
|
|
1796
|
-
self.handler(ev);
|
|
1797
|
-
}
|
|
1798
|
-
};
|
|
1799
|
-
|
|
1800
|
-
this.init();
|
|
1801
|
-
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
Input.prototype = {
|
|
1805
|
-
/**
|
|
1806
|
-
* should handle the inputEvent data and trigger the callback
|
|
1807
|
-
* @virtual
|
|
1808
|
-
*/
|
|
1809
|
-
handler: function() { },
|
|
1810
|
-
|
|
1811
|
-
/**
|
|
1812
|
-
* bind the events
|
|
1813
|
-
*/
|
|
1814
|
-
init: function() {
|
|
1815
|
-
this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
|
|
1816
|
-
this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
|
|
1817
|
-
this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
|
1818
|
-
},
|
|
1819
|
-
|
|
1820
|
-
/**
|
|
1821
|
-
* unbind the events
|
|
1822
|
-
*/
|
|
1823
|
-
destroy: function() {
|
|
1824
|
-
this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
|
|
1825
|
-
this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
|
|
1826
|
-
this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
|
1827
|
-
}
|
|
1828
|
-
};
|
|
1829
|
-
|
|
1830
|
-
/**
|
|
1831
|
-
* create new input type manager
|
|
1832
|
-
* called by the Manager constructor
|
|
1833
|
-
* @param {Hammer} manager
|
|
1834
|
-
* @returns {Input}
|
|
1835
|
-
*/
|
|
1836
|
-
function createInputInstance(manager) {
|
|
1837
|
-
var Type;
|
|
1838
|
-
var inputClass = manager.options.inputClass;
|
|
1839
|
-
|
|
1840
|
-
if (inputClass) {
|
|
1841
|
-
Type = inputClass;
|
|
1842
|
-
} else if (SUPPORT_POINTER_EVENTS) {
|
|
1843
|
-
Type = PointerEventInput;
|
|
1844
|
-
} else if (SUPPORT_ONLY_TOUCH) {
|
|
1845
|
-
Type = TouchInput;
|
|
1846
|
-
} else if (!SUPPORT_TOUCH) {
|
|
1847
|
-
Type = MouseInput;
|
|
1848
|
-
} else {
|
|
1849
|
-
Type = TouchMouseInput;
|
|
1850
|
-
}
|
|
1851
|
-
return new (Type)(manager, inputHandler);
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
/**
|
|
1855
|
-
* handle input events
|
|
1856
|
-
* @param {Manager} manager
|
|
1857
|
-
* @param {String} eventType
|
|
1858
|
-
* @param {Object} input
|
|
1859
|
-
*/
|
|
1860
|
-
function inputHandler(manager, eventType, input) {
|
|
1861
|
-
var pointersLen = input.pointers.length;
|
|
1862
|
-
var changedPointersLen = input.changedPointers.length;
|
|
1863
|
-
var isFirst = (eventType & INPUT_START && (pointersLen - changedPointersLen === 0));
|
|
1864
|
-
var isFinal = (eventType & (INPUT_END | INPUT_CANCEL) && (pointersLen - changedPointersLen === 0));
|
|
1865
|
-
|
|
1866
|
-
input.isFirst = !!isFirst;
|
|
1867
|
-
input.isFinal = !!isFinal;
|
|
1868
|
-
|
|
1869
|
-
if (isFirst) {
|
|
1870
|
-
manager.session = {};
|
|
1871
|
-
}
|
|
1872
|
-
|
|
1873
|
-
// source event is the normalized value of the domEvents
|
|
1874
|
-
// like 'touchstart, mouseup, pointerdown'
|
|
1875
|
-
input.eventType = eventType;
|
|
1876
|
-
|
|
1877
|
-
// compute scale, rotation etc
|
|
1878
|
-
computeInputData(manager, input);
|
|
1879
|
-
|
|
1880
|
-
// emit secret event
|
|
1881
|
-
manager.emit('hammer.input', input);
|
|
1882
|
-
|
|
1883
|
-
manager.recognize(input);
|
|
1884
|
-
manager.session.prevInput = input;
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
/**
|
|
1888
|
-
* extend the data with some usable properties like scale, rotate, velocity etc
|
|
1889
|
-
* @param {Object} manager
|
|
1890
|
-
* @param {Object} input
|
|
1891
|
-
*/
|
|
1892
|
-
function computeInputData(manager, input) {
|
|
1893
|
-
var session = manager.session;
|
|
1894
|
-
var pointers = input.pointers;
|
|
1895
|
-
var pointersLength = pointers.length;
|
|
1896
|
-
|
|
1897
|
-
// store the first input to calculate the distance and direction
|
|
1898
|
-
if (!session.firstInput) {
|
|
1899
|
-
session.firstInput = simpleCloneInputData(input);
|
|
1900
|
-
}
|
|
1901
|
-
|
|
1902
|
-
// to compute scale and rotation we need to store the multiple touches
|
|
1903
|
-
if (pointersLength > 1 && !session.firstMultiple) {
|
|
1904
|
-
session.firstMultiple = simpleCloneInputData(input);
|
|
1905
|
-
} else if (pointersLength === 1) {
|
|
1906
|
-
session.firstMultiple = false;
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
var firstInput = session.firstInput;
|
|
1910
|
-
var firstMultiple = session.firstMultiple;
|
|
1911
|
-
var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
|
|
1912
|
-
|
|
1913
|
-
var center = input.center = getCenter(pointers);
|
|
1914
|
-
input.timeStamp = now();
|
|
1915
|
-
input.deltaTime = input.timeStamp - firstInput.timeStamp;
|
|
1916
|
-
|
|
1917
|
-
input.angle = getAngle(offsetCenter, center);
|
|
1918
|
-
input.distance = getDistance(offsetCenter, center);
|
|
1919
|
-
|
|
1920
|
-
computeDeltaXY(session, input);
|
|
1921
|
-
input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
|
1922
|
-
|
|
1923
|
-
var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
|
|
1924
|
-
input.overallVelocityX = overallVelocity.x;
|
|
1925
|
-
input.overallVelocityY = overallVelocity.y;
|
|
1926
|
-
input.overallVelocity = (abs(overallVelocity.x) > abs(overallVelocity.y)) ? overallVelocity.x : overallVelocity.y;
|
|
1927
|
-
|
|
1928
|
-
input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
|
1929
|
-
input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
|
1930
|
-
|
|
1931
|
-
input.maxPointers = !session.prevInput ? input.pointers.length : ((input.pointers.length >
|
|
1932
|
-
session.prevInput.maxPointers) ? input.pointers.length : session.prevInput.maxPointers);
|
|
1933
|
-
|
|
1934
|
-
computeIntervalInputData(session, input);
|
|
1935
|
-
|
|
1936
|
-
// find the correct target
|
|
1937
|
-
var target = manager.element;
|
|
1938
|
-
if (hasParent(input.srcEvent.target, target)) {
|
|
1939
|
-
target = input.srcEvent.target;
|
|
1940
|
-
}
|
|
1941
|
-
input.target = target;
|
|
1942
|
-
}
|
|
1943
|
-
|
|
1944
|
-
function computeDeltaXY(session, input) {
|
|
1945
|
-
var center = input.center;
|
|
1946
|
-
var offset = session.offsetDelta || {};
|
|
1947
|
-
var prevDelta = session.prevDelta || {};
|
|
1948
|
-
var prevInput = session.prevInput || {};
|
|
1949
|
-
|
|
1950
|
-
if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
|
|
1951
|
-
prevDelta = session.prevDelta = {
|
|
1952
|
-
x: prevInput.deltaX || 0,
|
|
1953
|
-
y: prevInput.deltaY || 0
|
|
1954
|
-
};
|
|
1955
|
-
|
|
1956
|
-
offset = session.offsetDelta = {
|
|
1957
|
-
x: center.x,
|
|
1958
|
-
y: center.y
|
|
1959
|
-
};
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
input.deltaX = prevDelta.x + (center.x - offset.x);
|
|
1963
|
-
input.deltaY = prevDelta.y + (center.y - offset.y);
|
|
1964
|
-
}
|
|
1965
|
-
|
|
1966
|
-
/**
|
|
1967
|
-
* velocity is calculated every x ms
|
|
1968
|
-
* @param {Object} session
|
|
1969
|
-
* @param {Object} input
|
|
1970
|
-
*/
|
|
1971
|
-
function computeIntervalInputData(session, input) {
|
|
1972
|
-
var last = session.lastInterval || input,
|
|
1973
|
-
deltaTime = input.timeStamp - last.timeStamp,
|
|
1974
|
-
velocity, velocityX, velocityY, direction;
|
|
1975
|
-
|
|
1976
|
-
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined$1)) {
|
|
1977
|
-
var deltaX = input.deltaX - last.deltaX;
|
|
1978
|
-
var deltaY = input.deltaY - last.deltaY;
|
|
1979
|
-
|
|
1980
|
-
var v = getVelocity(deltaTime, deltaX, deltaY);
|
|
1981
|
-
velocityX = v.x;
|
|
1982
|
-
velocityY = v.y;
|
|
1983
|
-
velocity = (abs(v.x) > abs(v.y)) ? v.x : v.y;
|
|
1984
|
-
direction = getDirection(deltaX, deltaY);
|
|
1985
|
-
|
|
1986
|
-
session.lastInterval = input;
|
|
1987
|
-
} else {
|
|
1988
|
-
// use latest velocity info if it doesn't overtake a minimum period
|
|
1989
|
-
velocity = last.velocity;
|
|
1990
|
-
velocityX = last.velocityX;
|
|
1991
|
-
velocityY = last.velocityY;
|
|
1992
|
-
direction = last.direction;
|
|
1993
|
-
}
|
|
1994
|
-
|
|
1995
|
-
input.velocity = velocity;
|
|
1996
|
-
input.velocityX = velocityX;
|
|
1997
|
-
input.velocityY = velocityY;
|
|
1998
|
-
input.direction = direction;
|
|
1999
|
-
}
|
|
2000
|
-
|
|
2001
|
-
/**
|
|
2002
|
-
* create a simple clone from the input used for storage of firstInput and firstMultiple
|
|
2003
|
-
* @param {Object} input
|
|
2004
|
-
* @returns {Object} clonedInputData
|
|
2005
|
-
*/
|
|
2006
|
-
function simpleCloneInputData(input) {
|
|
2007
|
-
// make a simple copy of the pointers because we will get a reference if we don't
|
|
2008
|
-
// we only need clientXY for the calculations
|
|
2009
|
-
var pointers = [];
|
|
2010
|
-
var i = 0;
|
|
2011
|
-
while (i < input.pointers.length) {
|
|
2012
|
-
pointers[i] = {
|
|
2013
|
-
clientX: round(input.pointers[i].clientX),
|
|
2014
|
-
clientY: round(input.pointers[i].clientY)
|
|
2015
|
-
};
|
|
2016
|
-
i++;
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
return {
|
|
2020
|
-
timeStamp: now(),
|
|
2021
|
-
pointers: pointers,
|
|
2022
|
-
center: getCenter(pointers),
|
|
2023
|
-
deltaX: input.deltaX,
|
|
2024
|
-
deltaY: input.deltaY
|
|
2025
|
-
};
|
|
2026
|
-
}
|
|
2027
|
-
|
|
2028
|
-
/**
|
|
2029
|
-
* get the center of all the pointers
|
|
2030
|
-
* @param {Array} pointers
|
|
2031
|
-
* @return {Object} center contains `x` and `y` properties
|
|
2032
|
-
*/
|
|
2033
|
-
function getCenter(pointers) {
|
|
2034
|
-
var pointersLength = pointers.length;
|
|
2035
|
-
|
|
2036
|
-
// no need to loop when only one touch
|
|
2037
|
-
if (pointersLength === 1) {
|
|
2038
|
-
return {
|
|
2039
|
-
x: round(pointers[0].clientX),
|
|
2040
|
-
y: round(pointers[0].clientY)
|
|
2041
|
-
};
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2044
|
-
var x = 0, y = 0, i = 0;
|
|
2045
|
-
while (i < pointersLength) {
|
|
2046
|
-
x += pointers[i].clientX;
|
|
2047
|
-
y += pointers[i].clientY;
|
|
2048
|
-
i++;
|
|
2049
|
-
}
|
|
2050
|
-
|
|
2051
|
-
return {
|
|
2052
|
-
x: round(x / pointersLength),
|
|
2053
|
-
y: round(y / pointersLength)
|
|
2054
|
-
};
|
|
2055
|
-
}
|
|
2056
|
-
|
|
2057
|
-
/**
|
|
2058
|
-
* calculate the velocity between two points. unit is in px per ms.
|
|
2059
|
-
* @param {Number} deltaTime
|
|
2060
|
-
* @param {Number} x
|
|
2061
|
-
* @param {Number} y
|
|
2062
|
-
* @return {Object} velocity `x` and `y`
|
|
2063
|
-
*/
|
|
2064
|
-
function getVelocity(deltaTime, x, y) {
|
|
2065
|
-
return {
|
|
2066
|
-
x: x / deltaTime || 0,
|
|
2067
|
-
y: y / deltaTime || 0
|
|
2068
|
-
};
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
/**
|
|
2072
|
-
* get the direction between two points
|
|
2073
|
-
* @param {Number} x
|
|
2074
|
-
* @param {Number} y
|
|
2075
|
-
* @return {Number} direction
|
|
2076
|
-
*/
|
|
2077
|
-
function getDirection(x, y) {
|
|
2078
|
-
if (x === y) {
|
|
2079
|
-
return DIRECTION_NONE;
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2082
|
-
if (abs(x) >= abs(y)) {
|
|
2083
|
-
return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
|
2084
|
-
}
|
|
2085
|
-
return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
/**
|
|
2089
|
-
* calculate the absolute distance between two points
|
|
2090
|
-
* @param {Object} p1 {x, y}
|
|
2091
|
-
* @param {Object} p2 {x, y}
|
|
2092
|
-
* @param {Array} [props] containing x and y keys
|
|
2093
|
-
* @return {Number} distance
|
|
2094
|
-
*/
|
|
2095
|
-
function getDistance(p1, p2, props) {
|
|
2096
|
-
if (!props) {
|
|
2097
|
-
props = PROPS_XY;
|
|
2098
|
-
}
|
|
2099
|
-
var x = p2[props[0]] - p1[props[0]],
|
|
2100
|
-
y = p2[props[1]] - p1[props[1]];
|
|
2101
|
-
|
|
2102
|
-
return Math.sqrt((x * x) + (y * y));
|
|
2103
|
-
}
|
|
2104
|
-
|
|
2105
|
-
/**
|
|
2106
|
-
* calculate the angle between two coordinates
|
|
2107
|
-
* @param {Object} p1
|
|
2108
|
-
* @param {Object} p2
|
|
2109
|
-
* @param {Array} [props] containing x and y keys
|
|
2110
|
-
* @return {Number} angle
|
|
2111
|
-
*/
|
|
2112
|
-
function getAngle(p1, p2, props) {
|
|
2113
|
-
if (!props) {
|
|
2114
|
-
props = PROPS_XY;
|
|
2115
|
-
}
|
|
2116
|
-
var x = p2[props[0]] - p1[props[0]],
|
|
2117
|
-
y = p2[props[1]] - p1[props[1]];
|
|
2118
|
-
return Math.atan2(y, x) * 180 / Math.PI;
|
|
2119
|
-
}
|
|
2120
|
-
|
|
2121
|
-
/**
|
|
2122
|
-
* calculate the rotation degrees between two pointersets
|
|
2123
|
-
* @param {Array} start array of pointers
|
|
2124
|
-
* @param {Array} end array of pointers
|
|
2125
|
-
* @return {Number} rotation
|
|
2126
|
-
*/
|
|
2127
|
-
function getRotation(start, end) {
|
|
2128
|
-
return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
|
2129
|
-
}
|
|
2130
|
-
|
|
2131
|
-
/**
|
|
2132
|
-
* calculate the scale factor between two pointersets
|
|
2133
|
-
* no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
|
|
2134
|
-
* @param {Array} start array of pointers
|
|
2135
|
-
* @param {Array} end array of pointers
|
|
2136
|
-
* @return {Number} scale
|
|
2137
|
-
*/
|
|
2138
|
-
function getScale(start, end) {
|
|
2139
|
-
return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
var MOUSE_INPUT_MAP = {
|
|
2143
|
-
mousedown: INPUT_START,
|
|
2144
|
-
mousemove: INPUT_MOVE,
|
|
2145
|
-
mouseup: INPUT_END
|
|
2146
|
-
};
|
|
2147
|
-
|
|
2148
|
-
var MOUSE_ELEMENT_EVENTS = 'mousedown';
|
|
2149
|
-
var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
|
|
2150
|
-
|
|
2151
|
-
/**
|
|
2152
|
-
* Mouse events input
|
|
2153
|
-
* @constructor
|
|
2154
|
-
* @extends Input
|
|
2155
|
-
*/
|
|
2156
|
-
function MouseInput() {
|
|
2157
|
-
this.evEl = MOUSE_ELEMENT_EVENTS;
|
|
2158
|
-
this.evWin = MOUSE_WINDOW_EVENTS;
|
|
2159
|
-
|
|
2160
|
-
this.pressed = false; // mousedown state
|
|
2161
|
-
|
|
2162
|
-
Input.apply(this, arguments);
|
|
2163
|
-
}
|
|
2164
|
-
|
|
2165
|
-
inherit(MouseInput, Input, {
|
|
2166
|
-
/**
|
|
2167
|
-
* handle mouse events
|
|
2168
|
-
* @param {Object} ev
|
|
2169
|
-
*/
|
|
2170
|
-
handler: function MEhandler(ev) {
|
|
2171
|
-
var eventType = MOUSE_INPUT_MAP[ev.type];
|
|
2172
|
-
|
|
2173
|
-
// on start we want to have the left mouse button down
|
|
2174
|
-
if (eventType & INPUT_START && ev.button === 0) {
|
|
2175
|
-
this.pressed = true;
|
|
2176
|
-
}
|
|
2177
|
-
|
|
2178
|
-
if (eventType & INPUT_MOVE && ev.which !== 1) {
|
|
2179
|
-
eventType = INPUT_END;
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
// mouse must be down
|
|
2183
|
-
if (!this.pressed) {
|
|
2184
|
-
return;
|
|
2185
|
-
}
|
|
2186
|
-
|
|
2187
|
-
if (eventType & INPUT_END) {
|
|
2188
|
-
this.pressed = false;
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
this.callback(this.manager, eventType, {
|
|
2192
|
-
pointers: [ev],
|
|
2193
|
-
changedPointers: [ev],
|
|
2194
|
-
pointerType: INPUT_TYPE_MOUSE,
|
|
2195
|
-
srcEvent: ev
|
|
2196
|
-
});
|
|
2197
|
-
}
|
|
2198
|
-
});
|
|
2199
|
-
|
|
2200
|
-
var POINTER_INPUT_MAP = {
|
|
2201
|
-
pointerdown: INPUT_START,
|
|
2202
|
-
pointermove: INPUT_MOVE,
|
|
2203
|
-
pointerup: INPUT_END,
|
|
2204
|
-
pointercancel: INPUT_CANCEL,
|
|
2205
|
-
pointerout: INPUT_CANCEL
|
|
2206
|
-
};
|
|
2207
|
-
|
|
2208
|
-
// in IE10 the pointer types is defined as an enum
|
|
2209
|
-
var IE10_POINTER_TYPE_ENUM = {
|
|
2210
|
-
2: INPUT_TYPE_TOUCH,
|
|
2211
|
-
3: INPUT_TYPE_PEN,
|
|
2212
|
-
4: INPUT_TYPE_MOUSE,
|
|
2213
|
-
5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
|
|
2214
|
-
};
|
|
2215
|
-
|
|
2216
|
-
var POINTER_ELEMENT_EVENTS = 'pointerdown';
|
|
2217
|
-
var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel';
|
|
2218
|
-
|
|
2219
|
-
// IE10 has prefixed support, and case-sensitive
|
|
2220
|
-
if (window.MSPointerEvent && !window.PointerEvent) {
|
|
2221
|
-
POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
|
2222
|
-
POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
|
2223
|
-
}
|
|
2224
|
-
|
|
2225
|
-
/**
|
|
2226
|
-
* Pointer events input
|
|
2227
|
-
* @constructor
|
|
2228
|
-
* @extends Input
|
|
2229
|
-
*/
|
|
2230
|
-
function PointerEventInput() {
|
|
2231
|
-
this.evEl = POINTER_ELEMENT_EVENTS;
|
|
2232
|
-
this.evWin = POINTER_WINDOW_EVENTS;
|
|
2233
|
-
|
|
2234
|
-
Input.apply(this, arguments);
|
|
2235
|
-
|
|
2236
|
-
this.store = (this.manager.session.pointerEvents = []);
|
|
2237
|
-
}
|
|
2238
|
-
|
|
2239
|
-
inherit(PointerEventInput, Input, {
|
|
2240
|
-
/**
|
|
2241
|
-
* handle mouse events
|
|
2242
|
-
* @param {Object} ev
|
|
2243
|
-
*/
|
|
2244
|
-
handler: function PEhandler(ev) {
|
|
2245
|
-
var store = this.store;
|
|
2246
|
-
var removePointer = false;
|
|
2247
|
-
|
|
2248
|
-
var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
|
|
2249
|
-
var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
|
|
2250
|
-
var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
|
|
2251
|
-
|
|
2252
|
-
var isTouch = (pointerType == INPUT_TYPE_TOUCH);
|
|
2253
|
-
|
|
2254
|
-
// get index of the event in the store
|
|
2255
|
-
var storeIndex = inArray(store, ev.pointerId, 'pointerId');
|
|
2256
|
-
|
|
2257
|
-
// start and mouse must be down
|
|
2258
|
-
if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
|
|
2259
|
-
if (storeIndex < 0) {
|
|
2260
|
-
store.push(ev);
|
|
2261
|
-
storeIndex = store.length - 1;
|
|
2262
|
-
}
|
|
2263
|
-
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
|
2264
|
-
removePointer = true;
|
|
2265
|
-
}
|
|
2266
|
-
|
|
2267
|
-
// it not found, so the pointer hasn't been down (so it's probably a hover)
|
|
2268
|
-
if (storeIndex < 0) {
|
|
2269
|
-
return;
|
|
2270
|
-
}
|
|
2271
|
-
|
|
2272
|
-
// update the event in the store
|
|
2273
|
-
store[storeIndex] = ev;
|
|
2274
|
-
|
|
2275
|
-
this.callback(this.manager, eventType, {
|
|
2276
|
-
pointers: store,
|
|
2277
|
-
changedPointers: [ev],
|
|
2278
|
-
pointerType: pointerType,
|
|
2279
|
-
srcEvent: ev
|
|
2280
|
-
});
|
|
2281
|
-
|
|
2282
|
-
if (removePointer) {
|
|
2283
|
-
// remove from the store
|
|
2284
|
-
store.splice(storeIndex, 1);
|
|
2285
|
-
}
|
|
2286
|
-
}
|
|
2287
|
-
});
|
|
2288
|
-
|
|
2289
|
-
var SINGLE_TOUCH_INPUT_MAP = {
|
|
2290
|
-
touchstart: INPUT_START,
|
|
2291
|
-
touchmove: INPUT_MOVE,
|
|
2292
|
-
touchend: INPUT_END,
|
|
2293
|
-
touchcancel: INPUT_CANCEL
|
|
2294
|
-
};
|
|
2295
|
-
|
|
2296
|
-
var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
|
|
2297
|
-
var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
|
|
2298
|
-
|
|
2299
|
-
/**
|
|
2300
|
-
* Touch events input
|
|
2301
|
-
* @constructor
|
|
2302
|
-
* @extends Input
|
|
2303
|
-
*/
|
|
2304
|
-
function SingleTouchInput() {
|
|
2305
|
-
this.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
|
|
2306
|
-
this.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
|
|
2307
|
-
this.started = false;
|
|
2308
|
-
|
|
2309
|
-
Input.apply(this, arguments);
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
inherit(SingleTouchInput, Input, {
|
|
2313
|
-
handler: function TEhandler(ev) {
|
|
2314
|
-
var type = SINGLE_TOUCH_INPUT_MAP[ev.type];
|
|
2315
|
-
|
|
2316
|
-
// should we handle the touch events?
|
|
2317
|
-
if (type === INPUT_START) {
|
|
2318
|
-
this.started = true;
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
|
-
if (!this.started) {
|
|
2322
|
-
return;
|
|
2323
|
-
}
|
|
2324
|
-
|
|
2325
|
-
var touches = normalizeSingleTouches.call(this, ev, type);
|
|
2326
|
-
|
|
2327
|
-
// when done, reset the started state
|
|
2328
|
-
if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
|
|
2329
|
-
this.started = false;
|
|
2330
|
-
}
|
|
2331
|
-
|
|
2332
|
-
this.callback(this.manager, type, {
|
|
2333
|
-
pointers: touches[0],
|
|
2334
|
-
changedPointers: touches[1],
|
|
2335
|
-
pointerType: INPUT_TYPE_TOUCH,
|
|
2336
|
-
srcEvent: ev
|
|
2337
|
-
});
|
|
2338
|
-
}
|
|
2339
|
-
});
|
|
2340
|
-
|
|
2341
|
-
/**
|
|
2342
|
-
* @this {TouchInput}
|
|
2343
|
-
* @param {Object} ev
|
|
2344
|
-
* @param {Number} type flag
|
|
2345
|
-
* @returns {undefined|Array} [all, changed]
|
|
2346
|
-
*/
|
|
2347
|
-
function normalizeSingleTouches(ev, type) {
|
|
2348
|
-
var all = toArray(ev.touches);
|
|
2349
|
-
var changed = toArray(ev.changedTouches);
|
|
2350
|
-
|
|
2351
|
-
if (type & (INPUT_END | INPUT_CANCEL)) {
|
|
2352
|
-
all = uniqueArray(all.concat(changed), 'identifier', true);
|
|
2353
|
-
}
|
|
2354
|
-
|
|
2355
|
-
return [all, changed];
|
|
2356
|
-
}
|
|
2357
|
-
|
|
2358
|
-
var TOUCH_INPUT_MAP = {
|
|
2359
|
-
touchstart: INPUT_START,
|
|
2360
|
-
touchmove: INPUT_MOVE,
|
|
2361
|
-
touchend: INPUT_END,
|
|
2362
|
-
touchcancel: INPUT_CANCEL
|
|
2363
|
-
};
|
|
2364
|
-
|
|
2365
|
-
var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
|
|
2366
|
-
|
|
2367
|
-
/**
|
|
2368
|
-
* Multi-user touch events input
|
|
2369
|
-
* @constructor
|
|
2370
|
-
* @extends Input
|
|
2371
|
-
*/
|
|
2372
|
-
function TouchInput() {
|
|
2373
|
-
this.evTarget = TOUCH_TARGET_EVENTS;
|
|
2374
|
-
this.targetIds = {};
|
|
2375
|
-
|
|
2376
|
-
Input.apply(this, arguments);
|
|
2377
|
-
}
|
|
2378
|
-
|
|
2379
|
-
inherit(TouchInput, Input, {
|
|
2380
|
-
handler: function MTEhandler(ev) {
|
|
2381
|
-
var type = TOUCH_INPUT_MAP[ev.type];
|
|
2382
|
-
var touches = getTouches.call(this, ev, type);
|
|
2383
|
-
if (!touches) {
|
|
2384
|
-
return;
|
|
2385
|
-
}
|
|
2386
|
-
|
|
2387
|
-
this.callback(this.manager, type, {
|
|
2388
|
-
pointers: touches[0],
|
|
2389
|
-
changedPointers: touches[1],
|
|
2390
|
-
pointerType: INPUT_TYPE_TOUCH,
|
|
2391
|
-
srcEvent: ev
|
|
2392
|
-
});
|
|
2393
|
-
}
|
|
2394
|
-
});
|
|
2395
|
-
|
|
2396
|
-
/**
|
|
2397
|
-
* @this {TouchInput}
|
|
2398
|
-
* @param {Object} ev
|
|
2399
|
-
* @param {Number} type flag
|
|
2400
|
-
* @returns {undefined|Array} [all, changed]
|
|
2401
|
-
*/
|
|
2402
|
-
function getTouches(ev, type) {
|
|
2403
|
-
var allTouches = toArray(ev.touches);
|
|
2404
|
-
var targetIds = this.targetIds;
|
|
2405
|
-
|
|
2406
|
-
// when there is only one touch, the process can be simplified
|
|
2407
|
-
if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
|
|
2408
|
-
targetIds[allTouches[0].identifier] = true;
|
|
2409
|
-
return [allTouches, allTouches];
|
|
2410
|
-
}
|
|
2411
|
-
|
|
2412
|
-
var i,
|
|
2413
|
-
targetTouches,
|
|
2414
|
-
changedTouches = toArray(ev.changedTouches),
|
|
2415
|
-
changedTargetTouches = [],
|
|
2416
|
-
target = this.target;
|
|
2417
|
-
|
|
2418
|
-
// get target touches from touches
|
|
2419
|
-
targetTouches = allTouches.filter(function(touch) {
|
|
2420
|
-
return hasParent(touch.target, target);
|
|
2421
|
-
});
|
|
2422
|
-
|
|
2423
|
-
// collect touches
|
|
2424
|
-
if (type === INPUT_START) {
|
|
2425
|
-
i = 0;
|
|
2426
|
-
while (i < targetTouches.length) {
|
|
2427
|
-
targetIds[targetTouches[i].identifier] = true;
|
|
2428
|
-
i++;
|
|
2429
|
-
}
|
|
2430
|
-
}
|
|
2431
|
-
|
|
2432
|
-
// filter changed touches to only contain touches that exist in the collected target ids
|
|
2433
|
-
i = 0;
|
|
2434
|
-
while (i < changedTouches.length) {
|
|
2435
|
-
if (targetIds[changedTouches[i].identifier]) {
|
|
2436
|
-
changedTargetTouches.push(changedTouches[i]);
|
|
2437
|
-
}
|
|
2438
|
-
|
|
2439
|
-
// cleanup removed touches
|
|
2440
|
-
if (type & (INPUT_END | INPUT_CANCEL)) {
|
|
2441
|
-
delete targetIds[changedTouches[i].identifier];
|
|
2442
|
-
}
|
|
2443
|
-
i++;
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
|
-
if (!changedTargetTouches.length) {
|
|
2447
|
-
return;
|
|
2448
|
-
}
|
|
2449
|
-
|
|
2450
|
-
return [
|
|
2451
|
-
// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
|
2452
|
-
uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true),
|
|
2453
|
-
changedTargetTouches
|
|
2454
|
-
];
|
|
2455
|
-
}
|
|
2456
|
-
|
|
2457
|
-
/**
|
|
2458
|
-
* Combined touch and mouse input
|
|
2459
|
-
*
|
|
2460
|
-
* Touch has a higher priority then mouse, and while touching no mouse events are allowed.
|
|
2461
|
-
* This because touch devices also emit mouse events while doing a touch.
|
|
2462
|
-
*
|
|
2463
|
-
* @constructor
|
|
2464
|
-
* @extends Input
|
|
2465
|
-
*/
|
|
2466
|
-
|
|
2467
|
-
var DEDUP_TIMEOUT = 2500;
|
|
2468
|
-
var DEDUP_DISTANCE = 25;
|
|
2469
|
-
|
|
2470
|
-
function TouchMouseInput() {
|
|
2471
|
-
Input.apply(this, arguments);
|
|
2472
|
-
|
|
2473
|
-
var handler = bindFn(this.handler, this);
|
|
2474
|
-
this.touch = new TouchInput(this.manager, handler);
|
|
2475
|
-
this.mouse = new MouseInput(this.manager, handler);
|
|
2476
|
-
|
|
2477
|
-
this.primaryTouch = null;
|
|
2478
|
-
this.lastTouches = [];
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
inherit(TouchMouseInput, Input, {
|
|
2482
|
-
/**
|
|
2483
|
-
* handle mouse and touch events
|
|
2484
|
-
* @param {Hammer} manager
|
|
2485
|
-
* @param {String} inputEvent
|
|
2486
|
-
* @param {Object} inputData
|
|
2487
|
-
*/
|
|
2488
|
-
handler: function TMEhandler(manager, inputEvent, inputData) {
|
|
2489
|
-
var isTouch = (inputData.pointerType == INPUT_TYPE_TOUCH),
|
|
2490
|
-
isMouse = (inputData.pointerType == INPUT_TYPE_MOUSE);
|
|
2491
|
-
|
|
2492
|
-
if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
|
|
2493
|
-
return;
|
|
2494
|
-
}
|
|
2495
|
-
|
|
2496
|
-
// when we're in a touch event, record touches to de-dupe synthetic mouse event
|
|
2497
|
-
if (isTouch) {
|
|
2498
|
-
recordTouches.call(this, inputEvent, inputData);
|
|
2499
|
-
} else if (isMouse && isSyntheticEvent.call(this, inputData)) {
|
|
2500
|
-
return;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
this.callback(manager, inputEvent, inputData);
|
|
2504
|
-
},
|
|
2505
|
-
|
|
2506
|
-
/**
|
|
2507
|
-
* remove the event listeners
|
|
2508
|
-
*/
|
|
2509
|
-
destroy: function destroy() {
|
|
2510
|
-
this.touch.destroy();
|
|
2511
|
-
this.mouse.destroy();
|
|
2512
|
-
}
|
|
2513
|
-
});
|
|
2514
|
-
|
|
2515
|
-
function recordTouches(eventType, eventData) {
|
|
2516
|
-
if (eventType & INPUT_START) {
|
|
2517
|
-
this.primaryTouch = eventData.changedPointers[0].identifier;
|
|
2518
|
-
setLastTouch.call(this, eventData);
|
|
2519
|
-
} else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
|
2520
|
-
setLastTouch.call(this, eventData);
|
|
2521
|
-
}
|
|
2522
|
-
}
|
|
2523
|
-
|
|
2524
|
-
function setLastTouch(eventData) {
|
|
2525
|
-
var touch = eventData.changedPointers[0];
|
|
2526
|
-
|
|
2527
|
-
if (touch.identifier === this.primaryTouch) {
|
|
2528
|
-
var lastTouch = {x: touch.clientX, y: touch.clientY};
|
|
2529
|
-
this.lastTouches.push(lastTouch);
|
|
2530
|
-
var lts = this.lastTouches;
|
|
2531
|
-
var removeLastTouch = function() {
|
|
2532
|
-
var i = lts.indexOf(lastTouch);
|
|
2533
|
-
if (i > -1) {
|
|
2534
|
-
lts.splice(i, 1);
|
|
2535
|
-
}
|
|
2536
|
-
};
|
|
2537
|
-
setTimeout(removeLastTouch, DEDUP_TIMEOUT);
|
|
2538
|
-
}
|
|
2539
|
-
}
|
|
2540
|
-
|
|
2541
|
-
function isSyntheticEvent(eventData) {
|
|
2542
|
-
var x = eventData.srcEvent.clientX, y = eventData.srcEvent.clientY;
|
|
2543
|
-
for (var i = 0; i < this.lastTouches.length; i++) {
|
|
2544
|
-
var t = this.lastTouches[i];
|
|
2545
|
-
var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
|
|
2546
|
-
if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
|
|
2547
|
-
return true;
|
|
2548
|
-
}
|
|
2549
|
-
}
|
|
2550
|
-
return false;
|
|
2551
|
-
}
|
|
2552
|
-
|
|
2553
|
-
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
|
2554
|
-
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined$1;
|
|
2555
|
-
|
|
2556
|
-
// magical touchAction value
|
|
2557
|
-
var TOUCH_ACTION_COMPUTE = 'compute';
|
|
2558
|
-
var TOUCH_ACTION_AUTO = 'auto';
|
|
2559
|
-
var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
|
|
2560
|
-
var TOUCH_ACTION_NONE = 'none';
|
|
2561
|
-
var TOUCH_ACTION_PAN_X = 'pan-x';
|
|
2562
|
-
var TOUCH_ACTION_PAN_Y = 'pan-y';
|
|
2563
|
-
var TOUCH_ACTION_MAP = getTouchActionProps();
|
|
2564
|
-
|
|
2565
|
-
/**
|
|
2566
|
-
* Touch Action
|
|
2567
|
-
* sets the touchAction property or uses the js alternative
|
|
2568
|
-
* @param {Manager} manager
|
|
2569
|
-
* @param {String} value
|
|
2570
|
-
* @constructor
|
|
2571
|
-
*/
|
|
2572
|
-
function TouchAction(manager, value) {
|
|
2573
|
-
this.manager = manager;
|
|
2574
|
-
this.set(value);
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
TouchAction.prototype = {
|
|
2578
|
-
/**
|
|
2579
|
-
* set the touchAction value on the element or enable the polyfill
|
|
2580
|
-
* @param {String} value
|
|
2581
|
-
*/
|
|
2582
|
-
set: function(value) {
|
|
2583
|
-
// find out the touch-action by the event handlers
|
|
2584
|
-
if (value == TOUCH_ACTION_COMPUTE) {
|
|
2585
|
-
value = this.compute();
|
|
2586
|
-
}
|
|
2587
|
-
|
|
2588
|
-
if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
|
|
2589
|
-
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
|
2590
|
-
}
|
|
2591
|
-
this.actions = value.toLowerCase().trim();
|
|
2592
|
-
},
|
|
2593
|
-
|
|
2594
|
-
/**
|
|
2595
|
-
* just re-set the touchAction value
|
|
2596
|
-
*/
|
|
2597
|
-
update: function() {
|
|
2598
|
-
this.set(this.manager.options.touchAction);
|
|
2599
|
-
},
|
|
2600
|
-
|
|
2601
|
-
/**
|
|
2602
|
-
* compute the value for the touchAction property based on the recognizer's settings
|
|
2603
|
-
* @returns {String} value
|
|
2604
|
-
*/
|
|
2605
|
-
compute: function() {
|
|
2606
|
-
var actions = [];
|
|
2607
|
-
each(this.manager.recognizers, function(recognizer) {
|
|
2608
|
-
if (boolOrFn(recognizer.options.enable, [recognizer])) {
|
|
2609
|
-
actions = actions.concat(recognizer.getTouchAction());
|
|
2610
|
-
}
|
|
2611
|
-
});
|
|
2612
|
-
return cleanTouchActions(actions.join(' '));
|
|
2613
|
-
},
|
|
2614
|
-
|
|
2615
|
-
/**
|
|
2616
|
-
* this method is called on each input cycle and provides the preventing of the browser behavior
|
|
2617
|
-
* @param {Object} input
|
|
2618
|
-
*/
|
|
2619
|
-
preventDefaults: function(input) {
|
|
2620
|
-
var srcEvent = input.srcEvent;
|
|
2621
|
-
var direction = input.offsetDirection;
|
|
2622
|
-
|
|
2623
|
-
// if the touch action did prevented once this session
|
|
2624
|
-
if (this.manager.session.prevented) {
|
|
2625
|
-
srcEvent.preventDefault();
|
|
2626
|
-
return;
|
|
2627
|
-
}
|
|
2628
|
-
|
|
2629
|
-
var actions = this.actions;
|
|
2630
|
-
var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
|
|
2631
|
-
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
|
|
2632
|
-
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
|
|
2633
|
-
|
|
2634
|
-
if (hasNone) {
|
|
2635
|
-
//do not prevent defaults if this is a tap gesture
|
|
2636
|
-
|
|
2637
|
-
var isTapPointer = input.pointers.length === 1;
|
|
2638
|
-
var isTapMovement = input.distance < 2;
|
|
2639
|
-
var isTapTouchTime = input.deltaTime < 250;
|
|
2640
|
-
|
|
2641
|
-
if (isTapPointer && isTapMovement && isTapTouchTime) {
|
|
2642
|
-
return;
|
|
2643
|
-
}
|
|
2644
|
-
}
|
|
2645
|
-
|
|
2646
|
-
if (hasPanX && hasPanY) {
|
|
2647
|
-
// `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
|
|
2648
|
-
return;
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
if (hasNone ||
|
|
2652
|
-
(hasPanY && direction & DIRECTION_HORIZONTAL) ||
|
|
2653
|
-
(hasPanX && direction & DIRECTION_VERTICAL)) {
|
|
2654
|
-
return this.preventSrc(srcEvent);
|
|
2655
|
-
}
|
|
2656
|
-
},
|
|
2657
|
-
|
|
2658
|
-
/**
|
|
2659
|
-
* call preventDefault to prevent the browser's default behavior (scrolling in most cases)
|
|
2660
|
-
* @param {Object} srcEvent
|
|
2661
|
-
*/
|
|
2662
|
-
preventSrc: function(srcEvent) {
|
|
2663
|
-
this.manager.session.prevented = true;
|
|
2664
|
-
srcEvent.preventDefault();
|
|
2665
|
-
}
|
|
2666
|
-
};
|
|
2667
|
-
|
|
2668
|
-
/**
|
|
2669
|
-
* when the touchActions are collected they are not a valid value, so we need to clean things up. *
|
|
2670
|
-
* @param {String} actions
|
|
2671
|
-
* @returns {*}
|
|
2672
|
-
*/
|
|
2673
|
-
function cleanTouchActions(actions) {
|
|
2674
|
-
// none
|
|
2675
|
-
if (inStr(actions, TOUCH_ACTION_NONE)) {
|
|
2676
|
-
return TOUCH_ACTION_NONE;
|
|
2677
|
-
}
|
|
2678
|
-
|
|
2679
|
-
var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
|
2680
|
-
var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y);
|
|
2681
|
-
|
|
2682
|
-
// if both pan-x and pan-y are set (different recognizers
|
|
2683
|
-
// for different directions, e.g. horizontal pan but vertical swipe?)
|
|
2684
|
-
// we need none (as otherwise with pan-x pan-y combined none of these
|
|
2685
|
-
// recognizers will work, since the browser would handle all panning
|
|
2686
|
-
if (hasPanX && hasPanY) {
|
|
2687
|
-
return TOUCH_ACTION_NONE;
|
|
2688
|
-
}
|
|
2689
|
-
|
|
2690
|
-
// pan-x OR pan-y
|
|
2691
|
-
if (hasPanX || hasPanY) {
|
|
2692
|
-
return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
|
|
2693
|
-
}
|
|
2694
|
-
|
|
2695
|
-
// manipulation
|
|
2696
|
-
if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
|
|
2697
|
-
return TOUCH_ACTION_MANIPULATION;
|
|
2698
|
-
}
|
|
2699
|
-
|
|
2700
|
-
return TOUCH_ACTION_AUTO;
|
|
2701
|
-
}
|
|
2702
|
-
|
|
2703
|
-
function getTouchActionProps() {
|
|
2704
|
-
if (!NATIVE_TOUCH_ACTION) {
|
|
2705
|
-
return false;
|
|
2706
|
-
}
|
|
2707
|
-
var touchMap = {};
|
|
2708
|
-
var cssSupports = window.CSS && window.CSS.supports;
|
|
2709
|
-
['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function(val) {
|
|
2710
|
-
|
|
2711
|
-
// If css.supports is not supported but there is native touch-action assume it supports
|
|
2712
|
-
// all values. This is the case for IE 10 and 11.
|
|
2713
|
-
touchMap[val] = cssSupports ? window.CSS.supports('touch-action', val) : true;
|
|
2714
|
-
});
|
|
2715
|
-
return touchMap;
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
/**
|
|
2719
|
-
* Recognizer flow explained; *
|
|
2720
|
-
* All recognizers have the initial state of POSSIBLE when a input session starts.
|
|
2721
|
-
* The definition of a input session is from the first input until the last input, with all it's movement in it. *
|
|
2722
|
-
* Example session for mouse-input: mousedown -> mousemove -> mouseup
|
|
2723
|
-
*
|
|
2724
|
-
* On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
|
|
2725
|
-
* which determines with state it should be.
|
|
2726
|
-
*
|
|
2727
|
-
* If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
|
|
2728
|
-
* POSSIBLE to give it another change on the next cycle.
|
|
2729
|
-
*
|
|
2730
|
-
* Possible
|
|
2731
|
-
* |
|
|
2732
|
-
* +-----+---------------+
|
|
2733
|
-
* | |
|
|
2734
|
-
* +-----+-----+ |
|
|
2735
|
-
* | | |
|
|
2736
|
-
* Failed Cancelled |
|
|
2737
|
-
* +-------+------+
|
|
2738
|
-
* | |
|
|
2739
|
-
* Recognized Began
|
|
2740
|
-
* |
|
|
2741
|
-
* Changed
|
|
2742
|
-
* |
|
|
2743
|
-
* Ended/Recognized
|
|
2744
|
-
*/
|
|
2745
|
-
var STATE_POSSIBLE = 1;
|
|
2746
|
-
var STATE_BEGAN = 2;
|
|
2747
|
-
var STATE_CHANGED = 4;
|
|
2748
|
-
var STATE_ENDED = 8;
|
|
2749
|
-
var STATE_RECOGNIZED = STATE_ENDED;
|
|
2750
|
-
var STATE_CANCELLED = 16;
|
|
2751
|
-
var STATE_FAILED = 32;
|
|
2752
|
-
|
|
2753
|
-
/**
|
|
2754
|
-
* Recognizer
|
|
2755
|
-
* Every recognizer needs to extend from this class.
|
|
2756
|
-
* @constructor
|
|
2757
|
-
* @param {Object} options
|
|
2758
|
-
*/
|
|
2759
|
-
function Recognizer(options) {
|
|
2760
|
-
this.options = assign({}, this.defaults, options || {});
|
|
2761
|
-
|
|
2762
|
-
this.id = uniqueId();
|
|
2763
|
-
|
|
2764
|
-
this.manager = null;
|
|
2765
|
-
|
|
2766
|
-
// default is enable true
|
|
2767
|
-
this.options.enable = ifUndefined(this.options.enable, true);
|
|
2768
|
-
|
|
2769
|
-
this.state = STATE_POSSIBLE;
|
|
2770
|
-
|
|
2771
|
-
this.simultaneous = {};
|
|
2772
|
-
this.requireFail = [];
|
|
2773
|
-
}
|
|
2774
|
-
|
|
2775
|
-
Recognizer.prototype = {
|
|
2776
|
-
/**
|
|
2777
|
-
* @virtual
|
|
2778
|
-
* @type {Object}
|
|
2779
|
-
*/
|
|
2780
|
-
defaults: {},
|
|
2781
|
-
|
|
2782
|
-
/**
|
|
2783
|
-
* set options
|
|
2784
|
-
* @param {Object} options
|
|
2785
|
-
* @return {Recognizer}
|
|
2786
|
-
*/
|
|
2787
|
-
set: function(options) {
|
|
2788
|
-
assign(this.options, options);
|
|
2789
|
-
|
|
2790
|
-
// also update the touchAction, in case something changed about the directions/enabled state
|
|
2791
|
-
this.manager && this.manager.touchAction.update();
|
|
2792
|
-
return this;
|
|
2793
|
-
},
|
|
2794
|
-
|
|
2795
|
-
/**
|
|
2796
|
-
* recognize simultaneous with an other recognizer.
|
|
2797
|
-
* @param {Recognizer} otherRecognizer
|
|
2798
|
-
* @returns {Recognizer} this
|
|
2799
|
-
*/
|
|
2800
|
-
recognizeWith: function(otherRecognizer) {
|
|
2801
|
-
if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
|
|
2802
|
-
return this;
|
|
2803
|
-
}
|
|
2804
|
-
|
|
2805
|
-
var simultaneous = this.simultaneous;
|
|
2806
|
-
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
|
2807
|
-
if (!simultaneous[otherRecognizer.id]) {
|
|
2808
|
-
simultaneous[otherRecognizer.id] = otherRecognizer;
|
|
2809
|
-
otherRecognizer.recognizeWith(this);
|
|
2810
|
-
}
|
|
2811
|
-
return this;
|
|
2812
|
-
},
|
|
2813
|
-
|
|
2814
|
-
/**
|
|
2815
|
-
* drop the simultaneous link. it doesnt remove the link on the other recognizer.
|
|
2816
|
-
* @param {Recognizer} otherRecognizer
|
|
2817
|
-
* @returns {Recognizer} this
|
|
2818
|
-
*/
|
|
2819
|
-
dropRecognizeWith: function(otherRecognizer) {
|
|
2820
|
-
if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
|
|
2821
|
-
return this;
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
|
2825
|
-
delete this.simultaneous[otherRecognizer.id];
|
|
2826
|
-
return this;
|
|
2827
|
-
},
|
|
2828
|
-
|
|
2829
|
-
/**
|
|
2830
|
-
* recognizer can only run when an other is failing
|
|
2831
|
-
* @param {Recognizer} otherRecognizer
|
|
2832
|
-
* @returns {Recognizer} this
|
|
2833
|
-
*/
|
|
2834
|
-
requireFailure: function(otherRecognizer) {
|
|
2835
|
-
if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
|
|
2836
|
-
return this;
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2839
|
-
var requireFail = this.requireFail;
|
|
2840
|
-
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
|
2841
|
-
if (inArray(requireFail, otherRecognizer) === -1) {
|
|
2842
|
-
requireFail.push(otherRecognizer);
|
|
2843
|
-
otherRecognizer.requireFailure(this);
|
|
2844
|
-
}
|
|
2845
|
-
return this;
|
|
2846
|
-
},
|
|
2847
|
-
|
|
2848
|
-
/**
|
|
2849
|
-
* drop the requireFailure link. it does not remove the link on the other recognizer.
|
|
2850
|
-
* @param {Recognizer} otherRecognizer
|
|
2851
|
-
* @returns {Recognizer} this
|
|
2852
|
-
*/
|
|
2853
|
-
dropRequireFailure: function(otherRecognizer) {
|
|
2854
|
-
if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
|
|
2855
|
-
return this;
|
|
2856
|
-
}
|
|
2857
|
-
|
|
2858
|
-
otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
|
2859
|
-
var index = inArray(this.requireFail, otherRecognizer);
|
|
2860
|
-
if (index > -1) {
|
|
2861
|
-
this.requireFail.splice(index, 1);
|
|
2862
|
-
}
|
|
2863
|
-
return this;
|
|
2864
|
-
},
|
|
2865
|
-
|
|
2866
|
-
/**
|
|
2867
|
-
* has require failures boolean
|
|
2868
|
-
* @returns {boolean}
|
|
2869
|
-
*/
|
|
2870
|
-
hasRequireFailures: function() {
|
|
2871
|
-
return this.requireFail.length > 0;
|
|
2872
|
-
},
|
|
2873
|
-
|
|
2874
|
-
/**
|
|
2875
|
-
* if the recognizer can recognize simultaneous with an other recognizer
|
|
2876
|
-
* @param {Recognizer} otherRecognizer
|
|
2877
|
-
* @returns {Boolean}
|
|
2878
|
-
*/
|
|
2879
|
-
canRecognizeWith: function(otherRecognizer) {
|
|
2880
|
-
return !!this.simultaneous[otherRecognizer.id];
|
|
2881
|
-
},
|
|
2882
|
-
|
|
2883
|
-
/**
|
|
2884
|
-
* You should use `tryEmit` instead of `emit` directly to check
|
|
2885
|
-
* that all the needed recognizers has failed before emitting.
|
|
2886
|
-
* @param {Object} input
|
|
2887
|
-
*/
|
|
2888
|
-
emit: function(input) {
|
|
2889
|
-
var self = this;
|
|
2890
|
-
var state = this.state;
|
|
2891
|
-
|
|
2892
|
-
function emit(event) {
|
|
2893
|
-
self.manager.emit(event, input);
|
|
2894
|
-
}
|
|
2895
|
-
|
|
2896
|
-
// 'panstart' and 'panmove'
|
|
2897
|
-
if (state < STATE_ENDED) {
|
|
2898
|
-
emit(self.options.event + stateStr(state));
|
|
2899
|
-
}
|
|
2900
|
-
|
|
2901
|
-
emit(self.options.event); // simple 'eventName' events
|
|
2902
|
-
|
|
2903
|
-
if (input.additionalEvent) { // additional event(panleft, panright, pinchin, pinchout...)
|
|
2904
|
-
emit(input.additionalEvent);
|
|
2905
|
-
}
|
|
2906
|
-
|
|
2907
|
-
// panend and pancancel
|
|
2908
|
-
if (state >= STATE_ENDED) {
|
|
2909
|
-
emit(self.options.event + stateStr(state));
|
|
2910
|
-
}
|
|
2911
|
-
},
|
|
2912
|
-
|
|
2913
|
-
/**
|
|
2914
|
-
* Check that all the require failure recognizers has failed,
|
|
2915
|
-
* if true, it emits a gesture event,
|
|
2916
|
-
* otherwise, setup the state to FAILED.
|
|
2917
|
-
* @param {Object} input
|
|
2918
|
-
*/
|
|
2919
|
-
tryEmit: function(input) {
|
|
2920
|
-
if (this.canEmit()) {
|
|
2921
|
-
return this.emit(input);
|
|
2922
|
-
}
|
|
2923
|
-
// it's failing anyway
|
|
2924
|
-
this.state = STATE_FAILED;
|
|
2925
|
-
},
|
|
2926
|
-
|
|
2927
|
-
/**
|
|
2928
|
-
* can we emit?
|
|
2929
|
-
* @returns {boolean}
|
|
2930
|
-
*/
|
|
2931
|
-
canEmit: function() {
|
|
2932
|
-
var i = 0;
|
|
2933
|
-
while (i < this.requireFail.length) {
|
|
2934
|
-
if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
|
|
2935
|
-
return false;
|
|
2936
|
-
}
|
|
2937
|
-
i++;
|
|
2938
|
-
}
|
|
2939
|
-
return true;
|
|
2940
|
-
},
|
|
2941
|
-
|
|
2942
|
-
/**
|
|
2943
|
-
* update the recognizer
|
|
2944
|
-
* @param {Object} inputData
|
|
2945
|
-
*/
|
|
2946
|
-
recognize: function(inputData) {
|
|
2947
|
-
// make a new copy of the inputData
|
|
2948
|
-
// so we can change the inputData without messing up the other recognizers
|
|
2949
|
-
var inputDataClone = assign({}, inputData);
|
|
2950
|
-
|
|
2951
|
-
// is is enabled and allow recognizing?
|
|
2952
|
-
if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
|
|
2953
|
-
this.reset();
|
|
2954
|
-
this.state = STATE_FAILED;
|
|
2955
|
-
return;
|
|
2956
|
-
}
|
|
2957
|
-
|
|
2958
|
-
// reset when we've reached the end
|
|
2959
|
-
if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
|
|
2960
|
-
this.state = STATE_POSSIBLE;
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
this.state = this.process(inputDataClone);
|
|
2964
|
-
|
|
2965
|
-
// the recognizer has recognized a gesture
|
|
2966
|
-
// so trigger an event
|
|
2967
|
-
if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
|
|
2968
|
-
this.tryEmit(inputDataClone);
|
|
2969
|
-
}
|
|
2970
|
-
},
|
|
2971
|
-
|
|
2972
|
-
/**
|
|
2973
|
-
* return the state of the recognizer
|
|
2974
|
-
* the actual recognizing happens in this method
|
|
2975
|
-
* @virtual
|
|
2976
|
-
* @param {Object} inputData
|
|
2977
|
-
* @returns {Const} STATE
|
|
2978
|
-
*/
|
|
2979
|
-
process: function(inputData) { }, // jshint ignore:line
|
|
2980
|
-
|
|
2981
|
-
/**
|
|
2982
|
-
* return the preferred touch-action
|
|
2983
|
-
* @virtual
|
|
2984
|
-
* @returns {Array}
|
|
2985
|
-
*/
|
|
2986
|
-
getTouchAction: function() { },
|
|
2987
|
-
|
|
2988
|
-
/**
|
|
2989
|
-
* called when the gesture isn't allowed to recognize
|
|
2990
|
-
* like when another is being recognized or it is disabled
|
|
2991
|
-
* @virtual
|
|
2992
|
-
*/
|
|
2993
|
-
reset: function() { }
|
|
2994
|
-
};
|
|
2995
|
-
|
|
2996
|
-
/**
|
|
2997
|
-
* get a usable string, used as event postfix
|
|
2998
|
-
* @param {Const} state
|
|
2999
|
-
* @returns {String} state
|
|
3000
|
-
*/
|
|
3001
|
-
function stateStr(state) {
|
|
3002
|
-
if (state & STATE_CANCELLED) {
|
|
3003
|
-
return 'cancel';
|
|
3004
|
-
} else if (state & STATE_ENDED) {
|
|
3005
|
-
return 'end';
|
|
3006
|
-
} else if (state & STATE_CHANGED) {
|
|
3007
|
-
return 'move';
|
|
3008
|
-
} else if (state & STATE_BEGAN) {
|
|
3009
|
-
return 'start';
|
|
3010
|
-
}
|
|
3011
|
-
return '';
|
|
3012
|
-
}
|
|
3013
|
-
|
|
3014
|
-
/**
|
|
3015
|
-
* direction cons to string
|
|
3016
|
-
* @param {Const} direction
|
|
3017
|
-
* @returns {String}
|
|
3018
|
-
*/
|
|
3019
|
-
function directionStr(direction) {
|
|
3020
|
-
if (direction == DIRECTION_DOWN) {
|
|
3021
|
-
return 'down';
|
|
3022
|
-
} else if (direction == DIRECTION_UP) {
|
|
3023
|
-
return 'up';
|
|
3024
|
-
} else if (direction == DIRECTION_LEFT) {
|
|
3025
|
-
return 'left';
|
|
3026
|
-
} else if (direction == DIRECTION_RIGHT) {
|
|
3027
|
-
return 'right';
|
|
3028
|
-
}
|
|
3029
|
-
return '';
|
|
3030
|
-
}
|
|
3031
|
-
|
|
3032
|
-
/**
|
|
3033
|
-
* get a recognizer by name if it is bound to a manager
|
|
3034
|
-
* @param {Recognizer|String} otherRecognizer
|
|
3035
|
-
* @param {Recognizer} recognizer
|
|
3036
|
-
* @returns {Recognizer}
|
|
3037
|
-
*/
|
|
3038
|
-
function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
|
|
3039
|
-
var manager = recognizer.manager;
|
|
3040
|
-
if (manager) {
|
|
3041
|
-
return manager.get(otherRecognizer);
|
|
3042
|
-
}
|
|
3043
|
-
return otherRecognizer;
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
/**
|
|
3047
|
-
* This recognizer is just used as a base for the simple attribute recognizers.
|
|
3048
|
-
* @constructor
|
|
3049
|
-
* @extends Recognizer
|
|
3050
|
-
*/
|
|
3051
|
-
function AttrRecognizer() {
|
|
3052
|
-
Recognizer.apply(this, arguments);
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
inherit(AttrRecognizer, Recognizer, {
|
|
3056
|
-
/**
|
|
3057
|
-
* @namespace
|
|
3058
|
-
* @memberof AttrRecognizer
|
|
3059
|
-
*/
|
|
3060
|
-
defaults: {
|
|
3061
|
-
/**
|
|
3062
|
-
* @type {Number}
|
|
3063
|
-
* @default 1
|
|
3064
|
-
*/
|
|
3065
|
-
pointers: 1
|
|
3066
|
-
},
|
|
3067
|
-
|
|
3068
|
-
/**
|
|
3069
|
-
* Used to check if it the recognizer receives valid input, like input.distance > 10.
|
|
3070
|
-
* @memberof AttrRecognizer
|
|
3071
|
-
* @param {Object} input
|
|
3072
|
-
* @returns {Boolean} recognized
|
|
3073
|
-
*/
|
|
3074
|
-
attrTest: function(input) {
|
|
3075
|
-
var optionPointers = this.options.pointers;
|
|
3076
|
-
return optionPointers === 0 || input.pointers.length === optionPointers;
|
|
3077
|
-
},
|
|
3078
|
-
|
|
3079
|
-
/**
|
|
3080
|
-
* Process the input and return the state for the recognizer
|
|
3081
|
-
* @memberof AttrRecognizer
|
|
3082
|
-
* @param {Object} input
|
|
3083
|
-
* @returns {*} State
|
|
3084
|
-
*/
|
|
3085
|
-
process: function(input) {
|
|
3086
|
-
var state = this.state;
|
|
3087
|
-
var eventType = input.eventType;
|
|
3088
|
-
|
|
3089
|
-
var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
|
|
3090
|
-
var isValid = this.attrTest(input);
|
|
3091
|
-
|
|
3092
|
-
// on cancel input and we've recognized before, return STATE_CANCELLED
|
|
3093
|
-
if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
|
|
3094
|
-
return state | STATE_CANCELLED;
|
|
3095
|
-
} else if (isRecognized || isValid) {
|
|
3096
|
-
if (eventType & INPUT_END) {
|
|
3097
|
-
return state | STATE_ENDED;
|
|
3098
|
-
} else if (!(state & STATE_BEGAN)) {
|
|
3099
|
-
return STATE_BEGAN;
|
|
3100
|
-
}
|
|
3101
|
-
return state | STATE_CHANGED;
|
|
3102
|
-
}
|
|
3103
|
-
return STATE_FAILED;
|
|
3104
|
-
}
|
|
3105
|
-
});
|
|
3106
|
-
|
|
3107
|
-
/**
|
|
3108
|
-
* Pan
|
|
3109
|
-
* Recognized when the pointer is down and moved in the allowed direction.
|
|
3110
|
-
* @constructor
|
|
3111
|
-
* @extends AttrRecognizer
|
|
3112
|
-
*/
|
|
3113
|
-
function PanRecognizer() {
|
|
3114
|
-
AttrRecognizer.apply(this, arguments);
|
|
3115
|
-
|
|
3116
|
-
this.pX = null;
|
|
3117
|
-
this.pY = null;
|
|
3118
|
-
}
|
|
3119
|
-
|
|
3120
|
-
inherit(PanRecognizer, AttrRecognizer, {
|
|
3121
|
-
/**
|
|
3122
|
-
* @namespace
|
|
3123
|
-
* @memberof PanRecognizer
|
|
3124
|
-
*/
|
|
3125
|
-
defaults: {
|
|
3126
|
-
event: 'pan',
|
|
3127
|
-
threshold: 10,
|
|
3128
|
-
pointers: 1,
|
|
3129
|
-
direction: DIRECTION_ALL
|
|
3130
|
-
},
|
|
3131
|
-
|
|
3132
|
-
getTouchAction: function() {
|
|
3133
|
-
var direction = this.options.direction;
|
|
3134
|
-
var actions = [];
|
|
3135
|
-
if (direction & DIRECTION_HORIZONTAL) {
|
|
3136
|
-
actions.push(TOUCH_ACTION_PAN_Y);
|
|
3137
|
-
}
|
|
3138
|
-
if (direction & DIRECTION_VERTICAL) {
|
|
3139
|
-
actions.push(TOUCH_ACTION_PAN_X);
|
|
3140
|
-
}
|
|
3141
|
-
return actions;
|
|
3142
|
-
},
|
|
3143
|
-
|
|
3144
|
-
directionTest: function(input) {
|
|
3145
|
-
var options = this.options;
|
|
3146
|
-
var hasMoved = true;
|
|
3147
|
-
var distance = input.distance;
|
|
3148
|
-
var direction = input.direction;
|
|
3149
|
-
var x = input.deltaX;
|
|
3150
|
-
var y = input.deltaY;
|
|
3151
|
-
|
|
3152
|
-
// lock to axis?
|
|
3153
|
-
if (!(direction & options.direction)) {
|
|
3154
|
-
if (options.direction & DIRECTION_HORIZONTAL) {
|
|
3155
|
-
direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
|
3156
|
-
hasMoved = x != this.pX;
|
|
3157
|
-
distance = Math.abs(input.deltaX);
|
|
3158
|
-
} else {
|
|
3159
|
-
direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
|
|
3160
|
-
hasMoved = y != this.pY;
|
|
3161
|
-
distance = Math.abs(input.deltaY);
|
|
3162
|
-
}
|
|
3163
|
-
}
|
|
3164
|
-
input.direction = direction;
|
|
3165
|
-
return hasMoved && distance > options.threshold && direction & options.direction;
|
|
3166
|
-
},
|
|
3167
|
-
|
|
3168
|
-
attrTest: function(input) {
|
|
3169
|
-
return AttrRecognizer.prototype.attrTest.call(this, input) &&
|
|
3170
|
-
(this.state & STATE_BEGAN || (!(this.state & STATE_BEGAN) && this.directionTest(input)));
|
|
3171
|
-
},
|
|
3172
|
-
|
|
3173
|
-
emit: function(input) {
|
|
3174
|
-
|
|
3175
|
-
this.pX = input.deltaX;
|
|
3176
|
-
this.pY = input.deltaY;
|
|
3177
|
-
|
|
3178
|
-
var direction = directionStr(input.direction);
|
|
3179
|
-
|
|
3180
|
-
if (direction) {
|
|
3181
|
-
input.additionalEvent = this.options.event + direction;
|
|
3182
|
-
}
|
|
3183
|
-
this._super.emit.call(this, input);
|
|
3184
|
-
}
|
|
3185
|
-
});
|
|
3186
|
-
|
|
3187
|
-
/**
|
|
3188
|
-
* Pinch
|
|
3189
|
-
* Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
|
|
3190
|
-
* @constructor
|
|
3191
|
-
* @extends AttrRecognizer
|
|
3192
|
-
*/
|
|
3193
|
-
function PinchRecognizer() {
|
|
3194
|
-
AttrRecognizer.apply(this, arguments);
|
|
3195
|
-
}
|
|
3196
|
-
|
|
3197
|
-
inherit(PinchRecognizer, AttrRecognizer, {
|
|
3198
|
-
/**
|
|
3199
|
-
* @namespace
|
|
3200
|
-
* @memberof PinchRecognizer
|
|
3201
|
-
*/
|
|
3202
|
-
defaults: {
|
|
3203
|
-
event: 'pinch',
|
|
3204
|
-
threshold: 0,
|
|
3205
|
-
pointers: 2
|
|
3206
|
-
},
|
|
3207
|
-
|
|
3208
|
-
getTouchAction: function() {
|
|
3209
|
-
return [TOUCH_ACTION_NONE];
|
|
3210
|
-
},
|
|
3211
|
-
|
|
3212
|
-
attrTest: function(input) {
|
|
3213
|
-
return this._super.attrTest.call(this, input) &&
|
|
3214
|
-
(Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
|
|
3215
|
-
},
|
|
3216
|
-
|
|
3217
|
-
emit: function(input) {
|
|
3218
|
-
if (input.scale !== 1) {
|
|
3219
|
-
var inOut = input.scale < 1 ? 'in' : 'out';
|
|
3220
|
-
input.additionalEvent = this.options.event + inOut;
|
|
3221
|
-
}
|
|
3222
|
-
this._super.emit.call(this, input);
|
|
3223
|
-
}
|
|
3224
|
-
});
|
|
3225
|
-
|
|
3226
|
-
/**
|
|
3227
|
-
* Press
|
|
3228
|
-
* Recognized when the pointer is down for x ms without any movement.
|
|
3229
|
-
* @constructor
|
|
3230
|
-
* @extends Recognizer
|
|
3231
|
-
*/
|
|
3232
|
-
function PressRecognizer() {
|
|
3233
|
-
Recognizer.apply(this, arguments);
|
|
3234
|
-
|
|
3235
|
-
this._timer = null;
|
|
3236
|
-
this._input = null;
|
|
3237
|
-
}
|
|
3238
|
-
|
|
3239
|
-
inherit(PressRecognizer, Recognizer, {
|
|
3240
|
-
/**
|
|
3241
|
-
* @namespace
|
|
3242
|
-
* @memberof PressRecognizer
|
|
3243
|
-
*/
|
|
3244
|
-
defaults: {
|
|
3245
|
-
event: 'press',
|
|
3246
|
-
pointers: 1,
|
|
3247
|
-
time: 251, // minimal time of the pointer to be pressed
|
|
3248
|
-
threshold: 9 // a minimal movement is ok, but keep it low
|
|
3249
|
-
},
|
|
3250
|
-
|
|
3251
|
-
getTouchAction: function() {
|
|
3252
|
-
return [TOUCH_ACTION_AUTO];
|
|
3253
|
-
},
|
|
3254
|
-
|
|
3255
|
-
process: function(input) {
|
|
3256
|
-
var options = this.options;
|
|
3257
|
-
var validPointers = input.pointers.length === options.pointers;
|
|
3258
|
-
var validMovement = input.distance < options.threshold;
|
|
3259
|
-
var validTime = input.deltaTime > options.time;
|
|
3260
|
-
|
|
3261
|
-
this._input = input;
|
|
3262
|
-
|
|
3263
|
-
// we only allow little movement
|
|
3264
|
-
// and we've reached an end event, so a tap is possible
|
|
3265
|
-
if (!validMovement || !validPointers || (input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime)) {
|
|
3266
|
-
this.reset();
|
|
3267
|
-
} else if (input.eventType & INPUT_START) {
|
|
3268
|
-
this.reset();
|
|
3269
|
-
this._timer = setTimeoutContext(function() {
|
|
3270
|
-
this.state = STATE_RECOGNIZED;
|
|
3271
|
-
this.tryEmit();
|
|
3272
|
-
}, options.time, this);
|
|
3273
|
-
} else if (input.eventType & INPUT_END) {
|
|
3274
|
-
return STATE_RECOGNIZED;
|
|
3275
|
-
}
|
|
3276
|
-
return STATE_FAILED;
|
|
3277
|
-
},
|
|
3278
|
-
|
|
3279
|
-
reset: function() {
|
|
3280
|
-
clearTimeout(this._timer);
|
|
3281
|
-
},
|
|
3282
|
-
|
|
3283
|
-
emit: function(input) {
|
|
3284
|
-
if (this.state !== STATE_RECOGNIZED) {
|
|
3285
|
-
return;
|
|
3286
|
-
}
|
|
3287
|
-
|
|
3288
|
-
if (input && (input.eventType & INPUT_END)) {
|
|
3289
|
-
this.manager.emit(this.options.event + 'up', input);
|
|
3290
|
-
} else {
|
|
3291
|
-
this._input.timeStamp = now();
|
|
3292
|
-
this.manager.emit(this.options.event, this._input);
|
|
3293
|
-
}
|
|
3294
|
-
}
|
|
3295
|
-
});
|
|
3296
|
-
|
|
3297
|
-
/**
|
|
3298
|
-
* Rotate
|
|
3299
|
-
* Recognized when two or more pointer are moving in a circular motion.
|
|
3300
|
-
* @constructor
|
|
3301
|
-
* @extends AttrRecognizer
|
|
3302
|
-
*/
|
|
3303
|
-
function RotateRecognizer() {
|
|
3304
|
-
AttrRecognizer.apply(this, arguments);
|
|
3305
|
-
}
|
|
3306
|
-
|
|
3307
|
-
inherit(RotateRecognizer, AttrRecognizer, {
|
|
3308
|
-
/**
|
|
3309
|
-
* @namespace
|
|
3310
|
-
* @memberof RotateRecognizer
|
|
3311
|
-
*/
|
|
3312
|
-
defaults: {
|
|
3313
|
-
event: 'rotate',
|
|
3314
|
-
threshold: 0,
|
|
3315
|
-
pointers: 2
|
|
3316
|
-
},
|
|
3317
|
-
|
|
3318
|
-
getTouchAction: function() {
|
|
3319
|
-
return [TOUCH_ACTION_NONE];
|
|
3320
|
-
},
|
|
3321
|
-
|
|
3322
|
-
attrTest: function(input) {
|
|
3323
|
-
return this._super.attrTest.call(this, input) &&
|
|
3324
|
-
(Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
|
|
3325
|
-
}
|
|
3326
|
-
});
|
|
3327
|
-
|
|
3328
|
-
/**
|
|
3329
|
-
* Swipe
|
|
3330
|
-
* Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
|
|
3331
|
-
* @constructor
|
|
3332
|
-
* @extends AttrRecognizer
|
|
3333
|
-
*/
|
|
3334
|
-
function SwipeRecognizer() {
|
|
3335
|
-
AttrRecognizer.apply(this, arguments);
|
|
3336
|
-
}
|
|
3337
|
-
|
|
3338
|
-
inherit(SwipeRecognizer, AttrRecognizer, {
|
|
3339
|
-
/**
|
|
3340
|
-
* @namespace
|
|
3341
|
-
* @memberof SwipeRecognizer
|
|
3342
|
-
*/
|
|
3343
|
-
defaults: {
|
|
3344
|
-
event: 'swipe',
|
|
3345
|
-
threshold: 10,
|
|
3346
|
-
velocity: 0.3,
|
|
3347
|
-
direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
|
3348
|
-
pointers: 1
|
|
3349
|
-
},
|
|
3350
|
-
|
|
3351
|
-
getTouchAction: function() {
|
|
3352
|
-
return PanRecognizer.prototype.getTouchAction.call(this);
|
|
3353
|
-
},
|
|
3354
|
-
|
|
3355
|
-
attrTest: function(input) {
|
|
3356
|
-
var direction = this.options.direction;
|
|
3357
|
-
var velocity;
|
|
3358
|
-
|
|
3359
|
-
if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
|
3360
|
-
velocity = input.overallVelocity;
|
|
3361
|
-
} else if (direction & DIRECTION_HORIZONTAL) {
|
|
3362
|
-
velocity = input.overallVelocityX;
|
|
3363
|
-
} else if (direction & DIRECTION_VERTICAL) {
|
|
3364
|
-
velocity = input.overallVelocityY;
|
|
3365
|
-
}
|
|
3366
|
-
|
|
3367
|
-
return this._super.attrTest.call(this, input) &&
|
|
3368
|
-
direction & input.offsetDirection &&
|
|
3369
|
-
input.distance > this.options.threshold &&
|
|
3370
|
-
input.maxPointers == this.options.pointers &&
|
|
3371
|
-
abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
|
|
3372
|
-
},
|
|
3373
|
-
|
|
3374
|
-
emit: function(input) {
|
|
3375
|
-
var direction = directionStr(input.offsetDirection);
|
|
3376
|
-
if (direction) {
|
|
3377
|
-
this.manager.emit(this.options.event + direction, input);
|
|
3378
|
-
}
|
|
3379
|
-
|
|
3380
|
-
this.manager.emit(this.options.event, input);
|
|
3381
|
-
}
|
|
3382
|
-
});
|
|
3383
|
-
|
|
3384
|
-
/**
|
|
3385
|
-
* A tap is ecognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
|
|
3386
|
-
* between the given interval and position. The delay option can be used to recognize multi-taps without firing
|
|
3387
|
-
* a single tap.
|
|
3388
|
-
*
|
|
3389
|
-
* The eventData from the emitted event contains the property `tapCount`, which contains the amount of
|
|
3390
|
-
* multi-taps being recognized.
|
|
3391
|
-
* @constructor
|
|
3392
|
-
* @extends Recognizer
|
|
3393
|
-
*/
|
|
3394
|
-
function TapRecognizer() {
|
|
3395
|
-
Recognizer.apply(this, arguments);
|
|
3396
|
-
|
|
3397
|
-
// previous time and center,
|
|
3398
|
-
// used for tap counting
|
|
3399
|
-
this.pTime = false;
|
|
3400
|
-
this.pCenter = false;
|
|
3401
|
-
|
|
3402
|
-
this._timer = null;
|
|
3403
|
-
this._input = null;
|
|
3404
|
-
this.count = 0;
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
inherit(TapRecognizer, Recognizer, {
|
|
3408
|
-
/**
|
|
3409
|
-
* @namespace
|
|
3410
|
-
* @memberof PinchRecognizer
|
|
3411
|
-
*/
|
|
3412
|
-
defaults: {
|
|
3413
|
-
event: 'tap',
|
|
3414
|
-
pointers: 1,
|
|
3415
|
-
taps: 1,
|
|
3416
|
-
interval: 300, // max time between the multi-tap taps
|
|
3417
|
-
time: 250, // max time of the pointer to be down (like finger on the screen)
|
|
3418
|
-
threshold: 9, // a minimal movement is ok, but keep it low
|
|
3419
|
-
posThreshold: 10 // a multi-tap can be a bit off the initial position
|
|
3420
|
-
},
|
|
3421
|
-
|
|
3422
|
-
getTouchAction: function() {
|
|
3423
|
-
return [TOUCH_ACTION_MANIPULATION];
|
|
3424
|
-
},
|
|
3425
|
-
|
|
3426
|
-
process: function(input) {
|
|
3427
|
-
var options = this.options;
|
|
3428
|
-
|
|
3429
|
-
var validPointers = input.pointers.length === options.pointers;
|
|
3430
|
-
var validMovement = input.distance < options.threshold;
|
|
3431
|
-
var validTouchTime = input.deltaTime < options.time;
|
|
3432
|
-
|
|
3433
|
-
this.reset();
|
|
3434
|
-
|
|
3435
|
-
if ((input.eventType & INPUT_START) && (this.count === 0)) {
|
|
3436
|
-
return this.failTimeout();
|
|
3437
|
-
}
|
|
3438
|
-
|
|
3439
|
-
// we only allow little movement
|
|
3440
|
-
// and we've reached an end event, so a tap is possible
|
|
3441
|
-
if (validMovement && validTouchTime && validPointers) {
|
|
3442
|
-
if (input.eventType != INPUT_END) {
|
|
3443
|
-
return this.failTimeout();
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
var validInterval = this.pTime ? (input.timeStamp - this.pTime < options.interval) : true;
|
|
3447
|
-
var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
|
|
3448
|
-
|
|
3449
|
-
this.pTime = input.timeStamp;
|
|
3450
|
-
this.pCenter = input.center;
|
|
3451
|
-
|
|
3452
|
-
if (!validMultiTap || !validInterval) {
|
|
3453
|
-
this.count = 1;
|
|
3454
|
-
} else {
|
|
3455
|
-
this.count += 1;
|
|
3456
|
-
}
|
|
3457
|
-
|
|
3458
|
-
this._input = input;
|
|
3459
|
-
|
|
3460
|
-
// if tap count matches we have recognized it,
|
|
3461
|
-
// else it has began recognizing...
|
|
3462
|
-
var tapCount = this.count % options.taps;
|
|
3463
|
-
if (tapCount === 0) {
|
|
3464
|
-
// no failing requirements, immediately trigger the tap event
|
|
3465
|
-
// or wait as long as the multitap interval to trigger
|
|
3466
|
-
if (!this.hasRequireFailures()) {
|
|
3467
|
-
return STATE_RECOGNIZED;
|
|
3468
|
-
} else {
|
|
3469
|
-
this._timer = setTimeoutContext(function() {
|
|
3470
|
-
this.state = STATE_RECOGNIZED;
|
|
3471
|
-
this.tryEmit();
|
|
3472
|
-
}, options.interval, this);
|
|
3473
|
-
return STATE_BEGAN;
|
|
3474
|
-
}
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
return STATE_FAILED;
|
|
3478
|
-
},
|
|
3479
|
-
|
|
3480
|
-
failTimeout: function() {
|
|
3481
|
-
this._timer = setTimeoutContext(function() {
|
|
3482
|
-
this.state = STATE_FAILED;
|
|
3483
|
-
}, this.options.interval, this);
|
|
3484
|
-
return STATE_FAILED;
|
|
3485
|
-
},
|
|
3486
|
-
|
|
3487
|
-
reset: function() {
|
|
3488
|
-
clearTimeout(this._timer);
|
|
3489
|
-
},
|
|
3490
|
-
|
|
3491
|
-
emit: function() {
|
|
3492
|
-
if (this.state == STATE_RECOGNIZED) {
|
|
3493
|
-
this._input.tapCount = this.count;
|
|
3494
|
-
this.manager.emit(this.options.event, this._input);
|
|
3495
|
-
}
|
|
3496
|
-
}
|
|
3497
|
-
});
|
|
3498
|
-
|
|
3499
|
-
/**
|
|
3500
|
-
* Simple way to create a manager with a default set of recognizers.
|
|
3501
|
-
* @param {HTMLElement} element
|
|
3502
|
-
* @param {Object} [options]
|
|
3503
|
-
* @constructor
|
|
3504
|
-
*/
|
|
3505
|
-
function Hammer(element, options) {
|
|
3506
|
-
options = options || {};
|
|
3507
|
-
options.recognizers = ifUndefined(options.recognizers, Hammer.defaults.preset);
|
|
3508
|
-
return new Manager(element, options);
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
/**
|
|
3512
|
-
* @const {string}
|
|
3513
|
-
*/
|
|
3514
|
-
Hammer.VERSION = '2.0.7';
|
|
3515
|
-
|
|
3516
|
-
/**
|
|
3517
|
-
* default settings
|
|
3518
|
-
* @namespace
|
|
3519
|
-
*/
|
|
3520
|
-
Hammer.defaults = {
|
|
3521
|
-
/**
|
|
3522
|
-
* set if DOM events are being triggered.
|
|
3523
|
-
* But this is slower and unused by simple implementations, so disabled by default.
|
|
3524
|
-
* @type {Boolean}
|
|
3525
|
-
* @default false
|
|
3526
|
-
*/
|
|
3527
|
-
domEvents: false,
|
|
3528
|
-
|
|
3529
|
-
/**
|
|
3530
|
-
* The value for the touchAction property/fallback.
|
|
3531
|
-
* When set to `compute` it will magically set the correct value based on the added recognizers.
|
|
3532
|
-
* @type {String}
|
|
3533
|
-
* @default compute
|
|
3534
|
-
*/
|
|
3535
|
-
touchAction: TOUCH_ACTION_COMPUTE,
|
|
3536
|
-
|
|
3537
|
-
/**
|
|
3538
|
-
* @type {Boolean}
|
|
3539
|
-
* @default true
|
|
3540
|
-
*/
|
|
3541
|
-
enable: true,
|
|
3542
|
-
|
|
3543
|
-
/**
|
|
3544
|
-
* EXPERIMENTAL FEATURE -- can be removed/changed
|
|
3545
|
-
* Change the parent input target element.
|
|
3546
|
-
* If Null, then it is being set the to main element.
|
|
3547
|
-
* @type {Null|EventTarget}
|
|
3548
|
-
* @default null
|
|
3549
|
-
*/
|
|
3550
|
-
inputTarget: null,
|
|
3551
|
-
|
|
3552
|
-
/**
|
|
3553
|
-
* force an input class
|
|
3554
|
-
* @type {Null|Function}
|
|
3555
|
-
* @default null
|
|
3556
|
-
*/
|
|
3557
|
-
inputClass: null,
|
|
3558
|
-
|
|
3559
|
-
/**
|
|
3560
|
-
* Default recognizer setup when calling `Hammer()`
|
|
3561
|
-
* When creating a new Manager these will be skipped.
|
|
3562
|
-
* @type {Array}
|
|
3563
|
-
*/
|
|
3564
|
-
preset: [
|
|
3565
|
-
// RecognizerClass, options, [recognizeWith, ...], [requireFailure, ...]
|
|
3566
|
-
[RotateRecognizer, {enable: false}],
|
|
3567
|
-
[PinchRecognizer, {enable: false}, ['rotate']],
|
|
3568
|
-
[SwipeRecognizer, {direction: DIRECTION_HORIZONTAL}],
|
|
3569
|
-
[PanRecognizer, {direction: DIRECTION_HORIZONTAL}, ['swipe']],
|
|
3570
|
-
[TapRecognizer],
|
|
3571
|
-
[TapRecognizer, {event: 'doubletap', taps: 2}, ['tap']],
|
|
3572
|
-
[PressRecognizer]
|
|
3573
|
-
],
|
|
3574
|
-
|
|
3575
|
-
/**
|
|
3576
|
-
* Some CSS properties can be used to improve the working of Hammer.
|
|
3577
|
-
* Add them to this method and they will be set when creating a new Manager.
|
|
3578
|
-
* @namespace
|
|
3579
|
-
*/
|
|
3580
|
-
cssProps: {
|
|
3581
|
-
/**
|
|
3582
|
-
* Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
|
|
3583
|
-
* @type {String}
|
|
3584
|
-
* @default 'none'
|
|
3585
|
-
*/
|
|
3586
|
-
userSelect: 'none',
|
|
3587
|
-
|
|
3588
|
-
/**
|
|
3589
|
-
* Disable the Windows Phone grippers when pressing an element.
|
|
3590
|
-
* @type {String}
|
|
3591
|
-
* @default 'none'
|
|
3592
|
-
*/
|
|
3593
|
-
touchSelect: 'none',
|
|
3594
|
-
|
|
3595
|
-
/**
|
|
3596
|
-
* Disables the default callout shown when you touch and hold a touch target.
|
|
3597
|
-
* On iOS, when you touch and hold a touch target such as a link, Safari displays
|
|
3598
|
-
* a callout containing information about the link. This property allows you to disable that callout.
|
|
3599
|
-
* @type {String}
|
|
3600
|
-
* @default 'none'
|
|
3601
|
-
*/
|
|
3602
|
-
touchCallout: 'none',
|
|
3603
|
-
|
|
3604
|
-
/**
|
|
3605
|
-
* Specifies whether zooming is enabled. Used by IE10>
|
|
3606
|
-
* @type {String}
|
|
3607
|
-
* @default 'none'
|
|
3608
|
-
*/
|
|
3609
|
-
contentZooming: 'none',
|
|
3610
|
-
|
|
3611
|
-
/**
|
|
3612
|
-
* Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
|
|
3613
|
-
* @type {String}
|
|
3614
|
-
* @default 'none'
|
|
3615
|
-
*/
|
|
3616
|
-
userDrag: 'none',
|
|
3617
|
-
|
|
3618
|
-
/**
|
|
3619
|
-
* Overrides the highlight color shown when the user taps a link or a JavaScript
|
|
3620
|
-
* clickable element in iOS. This property obeys the alpha value, if specified.
|
|
3621
|
-
* @type {String}
|
|
3622
|
-
* @default 'rgba(0,0,0,0)'
|
|
3623
|
-
*/
|
|
3624
|
-
tapHighlightColor: 'rgba(0,0,0,0)'
|
|
3625
|
-
}
|
|
3626
|
-
};
|
|
3627
|
-
|
|
3628
|
-
var STOP = 1;
|
|
3629
|
-
var FORCED_STOP = 2;
|
|
3630
|
-
|
|
3631
|
-
/**
|
|
3632
|
-
* Manager
|
|
3633
|
-
* @param {HTMLElement} element
|
|
3634
|
-
* @param {Object} [options]
|
|
3635
|
-
* @constructor
|
|
3636
|
-
*/
|
|
3637
|
-
function Manager(element, options) {
|
|
3638
|
-
this.options = assign({}, Hammer.defaults, options || {});
|
|
3639
|
-
|
|
3640
|
-
this.options.inputTarget = this.options.inputTarget || element;
|
|
3641
|
-
|
|
3642
|
-
this.handlers = {};
|
|
3643
|
-
this.session = {};
|
|
3644
|
-
this.recognizers = [];
|
|
3645
|
-
this.oldCssProps = {};
|
|
3646
|
-
|
|
3647
|
-
this.element = element;
|
|
3648
|
-
this.input = createInputInstance(this);
|
|
3649
|
-
this.touchAction = new TouchAction(this, this.options.touchAction);
|
|
3650
|
-
|
|
3651
|
-
toggleCssProps(this, true);
|
|
3652
|
-
|
|
3653
|
-
each(this.options.recognizers, function(item) {
|
|
3654
|
-
var recognizer = this.add(new (item[0])(item[1]));
|
|
3655
|
-
item[2] && recognizer.recognizeWith(item[2]);
|
|
3656
|
-
item[3] && recognizer.requireFailure(item[3]);
|
|
3657
|
-
}, this);
|
|
3658
|
-
}
|
|
3659
|
-
|
|
3660
|
-
Manager.prototype = {
|
|
3661
|
-
/**
|
|
3662
|
-
* set options
|
|
3663
|
-
* @param {Object} options
|
|
3664
|
-
* @returns {Manager}
|
|
3665
|
-
*/
|
|
3666
|
-
set: function(options) {
|
|
3667
|
-
assign(this.options, options);
|
|
3668
|
-
|
|
3669
|
-
// Options that need a little more setup
|
|
3670
|
-
if (options.touchAction) {
|
|
3671
|
-
this.touchAction.update();
|
|
3672
|
-
}
|
|
3673
|
-
if (options.inputTarget) {
|
|
3674
|
-
// Clean up existing event listeners and reinitialize
|
|
3675
|
-
this.input.destroy();
|
|
3676
|
-
this.input.target = options.inputTarget;
|
|
3677
|
-
this.input.init();
|
|
3678
|
-
}
|
|
3679
|
-
return this;
|
|
3680
|
-
},
|
|
3681
|
-
|
|
3682
|
-
/**
|
|
3683
|
-
* stop recognizing for this session.
|
|
3684
|
-
* This session will be discarded, when a new [input]start event is fired.
|
|
3685
|
-
* When forced, the recognizer cycle is stopped immediately.
|
|
3686
|
-
* @param {Boolean} [force]
|
|
3687
|
-
*/
|
|
3688
|
-
stop: function(force) {
|
|
3689
|
-
this.session.stopped = force ? FORCED_STOP : STOP;
|
|
3690
|
-
},
|
|
3691
|
-
|
|
3692
|
-
/**
|
|
3693
|
-
* run the recognizers!
|
|
3694
|
-
* called by the inputHandler function on every movement of the pointers (touches)
|
|
3695
|
-
* it walks through all the recognizers and tries to detect the gesture that is being made
|
|
3696
|
-
* @param {Object} inputData
|
|
3697
|
-
*/
|
|
3698
|
-
recognize: function(inputData) {
|
|
3699
|
-
var session = this.session;
|
|
3700
|
-
if (session.stopped) {
|
|
3701
|
-
return;
|
|
3702
|
-
}
|
|
3703
|
-
|
|
3704
|
-
// run the touch-action polyfill
|
|
3705
|
-
this.touchAction.preventDefaults(inputData);
|
|
3706
|
-
|
|
3707
|
-
var recognizer;
|
|
3708
|
-
var recognizers = this.recognizers;
|
|
3709
|
-
|
|
3710
|
-
// this holds the recognizer that is being recognized.
|
|
3711
|
-
// so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
|
|
3712
|
-
// if no recognizer is detecting a thing, it is set to `null`
|
|
3713
|
-
var curRecognizer = session.curRecognizer;
|
|
3714
|
-
|
|
3715
|
-
// reset when the last recognizer is recognized
|
|
3716
|
-
// or when we're in a new session
|
|
3717
|
-
if (!curRecognizer || (curRecognizer && curRecognizer.state & STATE_RECOGNIZED)) {
|
|
3718
|
-
curRecognizer = session.curRecognizer = null;
|
|
3719
|
-
}
|
|
3720
|
-
|
|
3721
|
-
var i = 0;
|
|
3722
|
-
while (i < recognizers.length) {
|
|
3723
|
-
recognizer = recognizers[i];
|
|
3724
|
-
|
|
3725
|
-
// find out if we are allowed try to recognize the input for this one.
|
|
3726
|
-
// 1. allow if the session is NOT forced stopped (see the .stop() method)
|
|
3727
|
-
// 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
|
|
3728
|
-
// that is being recognized.
|
|
3729
|
-
// 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
|
|
3730
|
-
// this can be setup with the `recognizeWith()` method on the recognizer.
|
|
3731
|
-
if (session.stopped !== FORCED_STOP && ( // 1
|
|
3732
|
-
!curRecognizer || recognizer == curRecognizer || // 2
|
|
3733
|
-
recognizer.canRecognizeWith(curRecognizer))) { // 3
|
|
3734
|
-
recognizer.recognize(inputData);
|
|
3735
|
-
} else {
|
|
3736
|
-
recognizer.reset();
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
|
-
// if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
|
|
3740
|
-
// current active recognizer. but only if we don't already have an active recognizer
|
|
3741
|
-
if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
|
|
3742
|
-
curRecognizer = session.curRecognizer = recognizer;
|
|
3743
|
-
}
|
|
3744
|
-
i++;
|
|
3745
|
-
}
|
|
3746
|
-
},
|
|
3747
|
-
|
|
3748
|
-
/**
|
|
3749
|
-
* get a recognizer by its event name.
|
|
3750
|
-
* @param {Recognizer|String} recognizer
|
|
3751
|
-
* @returns {Recognizer|Null}
|
|
3752
|
-
*/
|
|
3753
|
-
get: function(recognizer) {
|
|
3754
|
-
if (recognizer instanceof Recognizer) {
|
|
3755
|
-
return recognizer;
|
|
3756
|
-
}
|
|
3757
|
-
|
|
3758
|
-
var recognizers = this.recognizers;
|
|
3759
|
-
for (var i = 0; i < recognizers.length; i++) {
|
|
3760
|
-
if (recognizers[i].options.event == recognizer) {
|
|
3761
|
-
return recognizers[i];
|
|
3762
|
-
}
|
|
3763
|
-
}
|
|
3764
|
-
return null;
|
|
3765
|
-
},
|
|
3766
|
-
|
|
3767
|
-
/**
|
|
3768
|
-
* add a recognizer to the manager
|
|
3769
|
-
* existing recognizers with the same event name will be removed
|
|
3770
|
-
* @param {Recognizer} recognizer
|
|
3771
|
-
* @returns {Recognizer|Manager}
|
|
3772
|
-
*/
|
|
3773
|
-
add: function(recognizer) {
|
|
3774
|
-
if (invokeArrayArg(recognizer, 'add', this)) {
|
|
3775
|
-
return this;
|
|
3776
|
-
}
|
|
3777
|
-
|
|
3778
|
-
// remove existing
|
|
3779
|
-
var existing = this.get(recognizer.options.event);
|
|
3780
|
-
if (existing) {
|
|
3781
|
-
this.remove(existing);
|
|
3782
|
-
}
|
|
3783
|
-
|
|
3784
|
-
this.recognizers.push(recognizer);
|
|
3785
|
-
recognizer.manager = this;
|
|
3786
|
-
|
|
3787
|
-
this.touchAction.update();
|
|
3788
|
-
return recognizer;
|
|
3789
|
-
},
|
|
3790
|
-
|
|
3791
|
-
/**
|
|
3792
|
-
* remove a recognizer by name or instance
|
|
3793
|
-
* @param {Recognizer|String} recognizer
|
|
3794
|
-
* @returns {Manager}
|
|
3795
|
-
*/
|
|
3796
|
-
remove: function(recognizer) {
|
|
3797
|
-
if (invokeArrayArg(recognizer, 'remove', this)) {
|
|
3798
|
-
return this;
|
|
3799
|
-
}
|
|
3800
|
-
|
|
3801
|
-
recognizer = this.get(recognizer);
|
|
3802
|
-
|
|
3803
|
-
// let's make sure this recognizer exists
|
|
3804
|
-
if (recognizer) {
|
|
3805
|
-
var recognizers = this.recognizers;
|
|
3806
|
-
var index = inArray(recognizers, recognizer);
|
|
3807
|
-
|
|
3808
|
-
if (index !== -1) {
|
|
3809
|
-
recognizers.splice(index, 1);
|
|
3810
|
-
this.touchAction.update();
|
|
3811
|
-
}
|
|
3812
|
-
}
|
|
3813
|
-
|
|
3814
|
-
return this;
|
|
3815
|
-
},
|
|
3816
|
-
|
|
3817
|
-
/**
|
|
3818
|
-
* bind event
|
|
3819
|
-
* @param {String} events
|
|
3820
|
-
* @param {Function} handler
|
|
3821
|
-
* @returns {EventEmitter} this
|
|
3822
|
-
*/
|
|
3823
|
-
on: function(events, handler) {
|
|
3824
|
-
if (events === undefined$1) {
|
|
3825
|
-
return;
|
|
3826
|
-
}
|
|
3827
|
-
if (handler === undefined$1) {
|
|
3828
|
-
return;
|
|
3829
|
-
}
|
|
3830
|
-
|
|
3831
|
-
var handlers = this.handlers;
|
|
3832
|
-
each(splitStr(events), function(event) {
|
|
3833
|
-
handlers[event] = handlers[event] || [];
|
|
3834
|
-
handlers[event].push(handler);
|
|
3835
|
-
});
|
|
3836
|
-
return this;
|
|
3837
|
-
},
|
|
3838
|
-
|
|
3839
|
-
/**
|
|
3840
|
-
* unbind event, leave emit blank to remove all handlers
|
|
3841
|
-
* @param {String} events
|
|
3842
|
-
* @param {Function} [handler]
|
|
3843
|
-
* @returns {EventEmitter} this
|
|
3844
|
-
*/
|
|
3845
|
-
off: function(events, handler) {
|
|
3846
|
-
if (events === undefined$1) {
|
|
3847
|
-
return;
|
|
3848
|
-
}
|
|
3849
|
-
|
|
3850
|
-
var handlers = this.handlers;
|
|
3851
|
-
each(splitStr(events), function(event) {
|
|
3852
|
-
if (!handler) {
|
|
3853
|
-
delete handlers[event];
|
|
3854
|
-
} else {
|
|
3855
|
-
handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
|
|
3856
|
-
}
|
|
3857
|
-
});
|
|
3858
|
-
return this;
|
|
3859
|
-
},
|
|
3860
|
-
|
|
3861
|
-
/**
|
|
3862
|
-
* emit event to the listeners
|
|
3863
|
-
* @param {String} event
|
|
3864
|
-
* @param {Object} data
|
|
3865
|
-
*/
|
|
3866
|
-
emit: function(event, data) {
|
|
3867
|
-
// we also want to trigger dom events
|
|
3868
|
-
if (this.options.domEvents) {
|
|
3869
|
-
triggerDomEvent(event, data);
|
|
3870
|
-
}
|
|
3871
|
-
|
|
3872
|
-
// no handlers, so skip it all
|
|
3873
|
-
var handlers = this.handlers[event] && this.handlers[event].slice();
|
|
3874
|
-
if (!handlers || !handlers.length) {
|
|
3875
|
-
return;
|
|
3876
|
-
}
|
|
3877
|
-
|
|
3878
|
-
data.type = event;
|
|
3879
|
-
data.preventDefault = function() {
|
|
3880
|
-
data.srcEvent.preventDefault();
|
|
3881
|
-
};
|
|
3882
|
-
|
|
3883
|
-
var i = 0;
|
|
3884
|
-
while (i < handlers.length) {
|
|
3885
|
-
handlers[i](data);
|
|
3886
|
-
i++;
|
|
3887
|
-
}
|
|
3888
|
-
},
|
|
3889
|
-
|
|
3890
|
-
/**
|
|
3891
|
-
* destroy the manager and unbinds all events
|
|
3892
|
-
* it doesn't unbind dom events, that is the user own responsibility
|
|
3893
|
-
*/
|
|
3894
|
-
destroy: function() {
|
|
3895
|
-
this.element && toggleCssProps(this, false);
|
|
3896
|
-
|
|
3897
|
-
this.handlers = {};
|
|
3898
|
-
this.session = {};
|
|
3899
|
-
this.input.destroy();
|
|
3900
|
-
this.element = null;
|
|
3901
|
-
}
|
|
3902
|
-
};
|
|
3903
|
-
|
|
3904
|
-
/**
|
|
3905
|
-
* add/remove the css properties as defined in manager.options.cssProps
|
|
3906
|
-
* @param {Manager} manager
|
|
3907
|
-
* @param {Boolean} add
|
|
3908
|
-
*/
|
|
3909
|
-
function toggleCssProps(manager, add) {
|
|
3910
|
-
var element = manager.element;
|
|
3911
|
-
if (!element.style) {
|
|
3912
|
-
return;
|
|
3913
|
-
}
|
|
3914
|
-
var prop;
|
|
3915
|
-
each(manager.options.cssProps, function(value, name) {
|
|
3916
|
-
prop = prefixed(element.style, name);
|
|
3917
|
-
if (add) {
|
|
3918
|
-
manager.oldCssProps[prop] = element.style[prop];
|
|
3919
|
-
element.style[prop] = value;
|
|
3920
|
-
} else {
|
|
3921
|
-
element.style[prop] = manager.oldCssProps[prop] || '';
|
|
3922
|
-
}
|
|
3923
|
-
});
|
|
3924
|
-
if (!add) {
|
|
3925
|
-
manager.oldCssProps = {};
|
|
3926
|
-
}
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
|
-
/**
|
|
3930
|
-
* trigger dom event
|
|
3931
|
-
* @param {String} event
|
|
3932
|
-
* @param {Object} data
|
|
3933
|
-
*/
|
|
3934
|
-
function triggerDomEvent(event, data) {
|
|
3935
|
-
var gestureEvent = document.createEvent('Event');
|
|
3936
|
-
gestureEvent.initEvent(event, true, true);
|
|
3937
|
-
gestureEvent.gesture = data;
|
|
3938
|
-
data.target.dispatchEvent(gestureEvent);
|
|
3939
|
-
}
|
|
3940
|
-
|
|
3941
|
-
assign(Hammer, {
|
|
3942
|
-
INPUT_START: INPUT_START,
|
|
3943
|
-
INPUT_MOVE: INPUT_MOVE,
|
|
3944
|
-
INPUT_END: INPUT_END,
|
|
3945
|
-
INPUT_CANCEL: INPUT_CANCEL,
|
|
3946
|
-
|
|
3947
|
-
STATE_POSSIBLE: STATE_POSSIBLE,
|
|
3948
|
-
STATE_BEGAN: STATE_BEGAN,
|
|
3949
|
-
STATE_CHANGED: STATE_CHANGED,
|
|
3950
|
-
STATE_ENDED: STATE_ENDED,
|
|
3951
|
-
STATE_RECOGNIZED: STATE_RECOGNIZED,
|
|
3952
|
-
STATE_CANCELLED: STATE_CANCELLED,
|
|
3953
|
-
STATE_FAILED: STATE_FAILED,
|
|
3954
|
-
|
|
3955
|
-
DIRECTION_NONE: DIRECTION_NONE,
|
|
3956
|
-
DIRECTION_LEFT: DIRECTION_LEFT,
|
|
3957
|
-
DIRECTION_RIGHT: DIRECTION_RIGHT,
|
|
3958
|
-
DIRECTION_UP: DIRECTION_UP,
|
|
3959
|
-
DIRECTION_DOWN: DIRECTION_DOWN,
|
|
3960
|
-
DIRECTION_HORIZONTAL: DIRECTION_HORIZONTAL,
|
|
3961
|
-
DIRECTION_VERTICAL: DIRECTION_VERTICAL,
|
|
3962
|
-
DIRECTION_ALL: DIRECTION_ALL,
|
|
3963
|
-
|
|
3964
|
-
Manager: Manager,
|
|
3965
|
-
Input: Input,
|
|
3966
|
-
TouchAction: TouchAction,
|
|
3967
|
-
|
|
3968
|
-
TouchInput: TouchInput,
|
|
3969
|
-
MouseInput: MouseInput,
|
|
3970
|
-
PointerEventInput: PointerEventInput,
|
|
3971
|
-
TouchMouseInput: TouchMouseInput,
|
|
3972
|
-
SingleTouchInput: SingleTouchInput,
|
|
3973
|
-
|
|
3974
|
-
Recognizer: Recognizer,
|
|
3975
|
-
AttrRecognizer: AttrRecognizer,
|
|
3976
|
-
Tap: TapRecognizer,
|
|
3977
|
-
Pan: PanRecognizer,
|
|
3978
|
-
Swipe: SwipeRecognizer,
|
|
3979
|
-
Pinch: PinchRecognizer,
|
|
3980
|
-
Rotate: RotateRecognizer,
|
|
3981
|
-
Press: PressRecognizer,
|
|
3982
|
-
|
|
3983
|
-
on: addEventListeners,
|
|
3984
|
-
off: removeEventListeners,
|
|
3985
|
-
each: each,
|
|
3986
|
-
merge: merge,
|
|
3987
|
-
extend: extend,
|
|
3988
|
-
assign: assign,
|
|
3989
|
-
inherit: inherit,
|
|
3990
|
-
bindFn: bindFn,
|
|
3991
|
-
prefixed: prefixed
|
|
3992
|
-
});
|
|
3993
|
-
|
|
3994
|
-
// this prevents errors when Hammer is loaded in the presence of an AMD
|
|
3995
|
-
// style loader but by script tag, not by the loader.
|
|
3996
|
-
var freeGlobal = (typeof window !== 'undefined' ? window : (typeof self !== 'undefined' ? self : {})); // jshint ignore:line
|
|
3997
|
-
freeGlobal.Hammer = Hammer;
|
|
3998
|
-
|
|
3999
|
-
if (typeof undefined$1 === 'function' && undefined$1.amd) {
|
|
4000
|
-
undefined$1(function() {
|
|
4001
|
-
return Hammer;
|
|
4002
|
-
});
|
|
4003
|
-
} else if (module.exports) {
|
|
4004
|
-
module.exports = Hammer;
|
|
4005
|
-
} else {
|
|
4006
|
-
window[exportName] = Hammer;
|
|
4007
|
-
}
|
|
4008
|
-
|
|
4009
|
-
})(window, document, 'Hammer');
|
|
4010
|
-
}(hammer));
|
|
4011
|
-
|
|
4012
|
-
const Hammer = hammer.exports;
|
|
4013
|
-
|
|
4014
|
-
const stylesCss = ":host{--percentuale:0;display:flex;width:100%;min-width:200px;max-width:100dvw;box-sizing:border-box;background:var(--color-surface01);border-radius:var(--border-size-large);box-shadow:var(--shadow-3);color:var(--color-default-text);fill:var(--color-primary01-icon);font-family:var(--font-family-sans);font-size:var(--font-size-2);font-weight:var(--font-rg)}:host(.slide-in-left){animation:slideinleft 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-right){animation:slideinright 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-down){animation:slideindown 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-up){animation:slideinup 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-left){animation:slideoutleft 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-right){animation:slideoutright 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-down){animation:slideoutdown 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-up){animation:slideoutup 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}.toast-notification-container{display:flex;width:100%;align-items:baseline;justify-content:space-between;padding:calc(var(--space-unit) * 2);border-radius:var(--border-radius);gap:calc(var(--space-unit) * 2)}.toast-notification-content{display:flex;width:100%;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:calc(var(--space-unit) * 2)}.toast-notification-content .toast-notification-text{color:inherit;letter-spacing:0.16px;line-height:1.25rem}.toast-notification-content .toast-notification-text .title{margin-right:calc(var(--space-unit) / 2);font-weight:var(--font-sb)}.close-button{height:1.125rem;padding:0;border:none;background-color:transparent;cursor:pointer}.close-button z-icon{--z-icon-width:1.125rem;--z-icon-height:1.125rem;display:inline-block;height:1.25rem}.close-button:focus:focus-visible{border-radius:50%;box-shadow:var(--shadow-focus-primary);outline:none}:host(.dark){background:var(--color-surface05);color:var(--color-text-inverse);fill:var(--color-inverse-icon)}:host(.dark) .close-button:focus:focus-visible{box-shadow:0 0 0 2px var(--gray900),\n 0 0 2px 5px var(--blue25)}:host(.accent){background:var(--color-primary01)}:host(.error){background:var(--color-default-error)}:host(.success){background:var(--color-default-success)}:host(.warning){background:var(--color-default-warning)}:host(.accent),:host(.error),:host(.success){color:var(--color-text-inverse);fill:var(--color-inverse-icon)}:host(.warning) .close-button{fill:var(--color-default-icon)}@media (min-width: 768px){:host{width:fit-content;max-width:50vw}.toast-notification-content{flex-wrap:nowrap}}@media (min-width: 1366px){:host{max-width:33vw}}@keyframes slideinleft{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes slideinright{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes slideinup{0%{opacity:0;transform:translateY(100%)}100%{opacity:1;transform:translateY(0)}}@keyframes slideindown{0%{opacity:0;transform:translateY(-100%)}100%{opacity:1;transform:translateY(0)}}@keyframes slideoutleft{0%{opacity:calc(100% - var(--percentuale));transform:translateX(var(--percentuale))}100%{opacity:0;transform:translateX(-100%)}}@keyframes slideoutright{0%{opacity:calc(100% - var(--percentuale));transform:translateX(var(--percentuale))}100%{opacity:0;transform:translateX(100%)}}@keyframes slideoutup{0%{opacity:1;transform:translateY(var(--percentuale))}100%{opacity:0;transform:translateY(-100%)}}@keyframes slideoutdown{0%{opacity:1;transform:translateY(var(--percentuale))}100%{opacity:0;transform:translateY(100%)}}";
|
|
4015
|
-
const ZToastNotificationStyle0 = stylesCss;
|
|
4016
|
-
|
|
4017
|
-
/** Map of slide-in transitions to their corresponding slide-out transitions */
|
|
4018
|
-
const SLIDE_OUT_TRANSITION_MAP = {
|
|
4019
|
-
[ToastNotificationTransition.SLIDE_IN_DOWN]: ToastNotificationTransition.SLIDE_OUT_UP,
|
|
4020
|
-
[ToastNotificationTransition.SLIDE_IN_UP]: ToastNotificationTransition.SLIDE_OUT_DOWN,
|
|
4021
|
-
[ToastNotificationTransition.SLIDE_IN_LEFT]: ToastNotificationTransition.SLIDE_OUT_RIGHT,
|
|
4022
|
-
[ToastNotificationTransition.SLIDE_IN_RIGHT]: ToastNotificationTransition.SLIDE_OUT_LEFT,
|
|
4023
|
-
};
|
|
4024
|
-
const ZToastNotification$1 = /*@__PURE__*/ proxyCustomElement(class ZToastNotification extends HTMLElement {
|
|
4025
|
-
constructor() {
|
|
4026
|
-
super();
|
|
4027
|
-
this.__registerHost();
|
|
4028
|
-
this.__attachShadow();
|
|
4029
|
-
this.toastClose = createEvent(this, "toastClose", 7);
|
|
4030
|
-
this.isCloseEventCalled = false;
|
|
4031
|
-
this.heading = undefined;
|
|
4032
|
-
this.message = undefined;
|
|
4033
|
-
this.closebutton = undefined;
|
|
4034
|
-
this.autoclose = undefined;
|
|
4035
|
-
this.pauseonfocusloss = true;
|
|
4036
|
-
this.type = undefined;
|
|
4037
|
-
this.isdraggable = true;
|
|
4038
|
-
this.draggablepercentage = 80;
|
|
4039
|
-
this.transition = undefined;
|
|
4040
|
-
this.percentage = undefined;
|
|
4041
|
-
this.hasSlottedButton = undefined;
|
|
4042
|
-
}
|
|
4043
|
-
watchPropIsdraggable(newValue) {
|
|
4044
|
-
if (newValue) {
|
|
4045
|
-
this.sliderManager.get("pan").set({ enable: true });
|
|
4046
|
-
}
|
|
4047
|
-
else {
|
|
4048
|
-
this.sliderManager.get("pan").set({ enable: false });
|
|
4049
|
-
}
|
|
4050
|
-
}
|
|
4051
|
-
watchPropAutoclose(newValue) {
|
|
4052
|
-
clearTimeout(this.timeoutHandle);
|
|
4053
|
-
this.startClosingTimeout(newValue);
|
|
4054
|
-
}
|
|
4055
|
-
watchPropPauseonfocusloss(newValue) {
|
|
4056
|
-
if (this.autoclose) {
|
|
4057
|
-
if (newValue) {
|
|
4058
|
-
document.addEventListener("visibilitychange", this.visibilityChangeEventHandler);
|
|
4059
|
-
}
|
|
4060
|
-
else {
|
|
4061
|
-
document.removeEventListener("visibilitychange", this.visibilityChangeEventHandler);
|
|
4062
|
-
}
|
|
4063
|
-
}
|
|
4064
|
-
}
|
|
4065
|
-
close(closingTransition, stopTimer) {
|
|
4066
|
-
if (stopTimer && this.timeoutHandle) {
|
|
4067
|
-
clearTimeout(this.timeoutHandle);
|
|
4068
|
-
}
|
|
4069
|
-
this.timeoutHandle = null;
|
|
4070
|
-
this.elapsedTime = null;
|
|
4071
|
-
this.toastClose.emit();
|
|
4072
|
-
if (closingTransition) {
|
|
4073
|
-
this.hostElement.classList.add(closingTransition);
|
|
4074
|
-
}
|
|
4075
|
-
else {
|
|
4076
|
-
this.hostElement.parentNode.removeChild(this.hostElement);
|
|
4077
|
-
}
|
|
4078
|
-
}
|
|
4079
|
-
visibilityChangeEventHandler() {
|
|
4080
|
-
if (document.visibilityState === "hidden") {
|
|
4081
|
-
this.timeoutHandle && this.onBlur();
|
|
4082
|
-
}
|
|
4083
|
-
else {
|
|
4084
|
-
this.elapsedTime && this.onFocus();
|
|
4085
|
-
}
|
|
4086
|
-
}
|
|
4087
|
-
validateAutoclose() {
|
|
4088
|
-
if (!this.autoclose && !this.closebutton) {
|
|
4089
|
-
console.error("At least one between autoclose and closebutton must be present");
|
|
4090
|
-
}
|
|
4091
|
-
}
|
|
4092
|
-
calculateDraggedPercentage(e) {
|
|
4093
|
-
const bounding = this.hostElement.getBoundingClientRect();
|
|
4094
|
-
return Math.round((100 * e.deltaX) / bounding.width);
|
|
4095
|
-
}
|
|
4096
|
-
handleSlideOutDragAnimation() {
|
|
4097
|
-
this.sliderManager = new Hammer(this.hostElement);
|
|
4098
|
-
this.sliderManager.get("pan").set({
|
|
4099
|
-
direction: Hammer.DIRECTION_HORIZONTAL,
|
|
4100
|
-
});
|
|
4101
|
-
this.sliderManager.on("pan", (e) => {
|
|
4102
|
-
this.percentage = this.calculateDraggedPercentage(e);
|
|
4103
|
-
this.hostElement.style.transition = "none";
|
|
4104
|
-
if (this.transition) {
|
|
4105
|
-
this.hostElement.classList.remove(this.transition);
|
|
4106
|
-
}
|
|
4107
|
-
const translateObj = {
|
|
4108
|
-
translate: `translateX(${this.percentage}%)`,
|
|
4109
|
-
translateBack: "translateX(0)",
|
|
4110
|
-
};
|
|
4111
|
-
this.hostElement.style.opacity = `${100 - Math.abs(this.percentage)}%`;
|
|
4112
|
-
if (e.eventType === Hammer.DIRECTION_LEFT || e.eventType === Hammer.DIRECTION_RIGHT) {
|
|
4113
|
-
this.hostElement.style.transform = translateObj.translate;
|
|
4114
|
-
if (Math.abs(this.percentage) > this.draggablepercentage && !this.isCloseEventCalled) {
|
|
4115
|
-
this.isCloseEventCalled = true;
|
|
4116
|
-
this.close(e.direction === Hammer.DIRECTION_LEFT
|
|
4117
|
-
? ToastNotificationTransition.SLIDE_OUT_LEFT
|
|
4118
|
-
: ToastNotificationTransition.SLIDE_OUT_RIGHT, true);
|
|
4119
|
-
}
|
|
4120
|
-
}
|
|
4121
|
-
if (e.isFinal && Math.abs(this.percentage) < this.draggablepercentage) {
|
|
4122
|
-
this.hostElement.style.transform = translateObj.translateBack;
|
|
4123
|
-
this.hostElement.style.transition = "all 1s";
|
|
4124
|
-
this.hostElement.style.opacity = "100%";
|
|
4125
|
-
this.percentage = 0;
|
|
4126
|
-
}
|
|
4127
|
-
});
|
|
4128
|
-
}
|
|
4129
|
-
onFocus() {
|
|
4130
|
-
let time = this.autoclose;
|
|
4131
|
-
if (this.elapsedTime) {
|
|
4132
|
-
time = this.autoclose - this.elapsedTime;
|
|
4133
|
-
}
|
|
4134
|
-
if (time > 0) {
|
|
4135
|
-
this.startClosingTimeout(time);
|
|
4136
|
-
}
|
|
4137
|
-
}
|
|
4138
|
-
onBlur() {
|
|
4139
|
-
this.elapsedTime = Date.now() - this.startTime;
|
|
4140
|
-
clearTimeout(this.timeoutHandle);
|
|
4141
|
-
}
|
|
4142
|
-
startClosingTimeout(time) {
|
|
4143
|
-
this.timeoutHandle = window.setTimeout(() => this.close(SLIDE_OUT_TRANSITION_MAP[this.transition], false), time);
|
|
4144
|
-
}
|
|
4145
|
-
checkSlottedButton() {
|
|
4146
|
-
this.hasSlottedButton = !!this.hostElement.querySelector("[slot='button']");
|
|
4147
|
-
}
|
|
4148
|
-
componentWillLoad() {
|
|
4149
|
-
this.validateAutoclose();
|
|
4150
|
-
this.checkSlottedButton();
|
|
4151
|
-
this.percentage = 0;
|
|
4152
|
-
}
|
|
4153
|
-
componentDidLoad() {
|
|
4154
|
-
this.startTime = Date.now();
|
|
4155
|
-
if (this.autoclose) {
|
|
4156
|
-
if (this.pauseonfocusloss) {
|
|
4157
|
-
document.addEventListener("visibilitychange", this.visibilityChangeEventHandler);
|
|
4158
|
-
}
|
|
4159
|
-
if (!this.transition) {
|
|
4160
|
-
this.startClosingTimeout(this.autoclose);
|
|
4161
|
-
}
|
|
4162
|
-
}
|
|
4163
|
-
this.isdraggable && this.handleSlideOutDragAnimation();
|
|
4164
|
-
}
|
|
4165
|
-
render() {
|
|
4166
|
-
return (h(Host, { key: '4dddb200f4671bbd69e8d1470d0d441678da3039', style: { "--percentuale": `${this.percentage}%` }, class: { [this.transition]: !!this.transition, [this.type]: !!this.type }, onAnimationEnd: (e) => {
|
|
4167
|
-
if (this.autoclose && e.animationName.includes("slidein")) {
|
|
4168
|
-
this.startClosingTimeout(this.autoclose);
|
|
4169
|
-
}
|
|
4170
|
-
if (e.animationName.includes("slideout")) {
|
|
4171
|
-
this.hostElement.parentNode.removeChild(this.hostElement);
|
|
4172
|
-
}
|
|
4173
|
-
} }, h("div", { key: '424761a172e8f139e35d9c1b2139a4093e5ac48d', class: "toast-notification-container" }, h("div", { key: 'f1f8f3b2cfb8dde84ba0e136ac94631b47993975', class: "toast-notification-content" }, h("div", { key: '75c17b6a15c05dea66744ddb08a9abfcda21be28', class: "toast-notification-text" }, this.heading && h("span", { key: '94eda50ee38a39cec7056ee113b9863b54ed1555', class: "title" }, this.heading), h("span", { key: 'def713dd54fac1d0332c82c12ec4878672dddf1f', class: "message" }, h("slot", { key: '30cd97c7a2381c5a25e1b184524cb2fce29a549c', name: "message" }, this.message && h("span", { key: 'fc4c5cf459f595cb3727d5328ecb12419d1ea405', innerHTML: DOMPurify.sanitize(this.message) })))), h("div", { key: '994505f881dbe43ab69eb42c449afb0dc4d46336', class: "button-container", hidden: !this.hasSlottedButton }, h("slot", { key: 'b4a78b86c8d3b98750bcafee88d43bb47712558c', name: "button", onSlotchange: () => this.checkSlottedButton() }))), this.closebutton && (h("button", { key: '6658b9fe87e402ad434afe3bc50d4bf99f19b7a4', class: "close-button", "aria-label": "Chiudi notifica", onClick: () => this.close(SLIDE_OUT_TRANSITION_MAP[this.transition], true), onKeyDown: (e) => {
|
|
4174
|
-
if (e.code == KeyboardCode.SPACE || e.code == KeyboardCode.ENTER) {
|
|
4175
|
-
e.preventDefault();
|
|
4176
|
-
this.close(SLIDE_OUT_TRANSITION_MAP[this.transition], true);
|
|
4177
|
-
}
|
|
4178
|
-
} }, h("z-icon", { key: '2edf589b7755c20c21217a8161736eeee5859cc9', name: "multiply-circled" }))))));
|
|
4179
|
-
}
|
|
4180
|
-
get hostElement() { return this; }
|
|
4181
|
-
static get watchers() { return {
|
|
4182
|
-
"isdraggable": ["watchPropIsdraggable"],
|
|
4183
|
-
"autoclose": ["watchPropAutoclose"],
|
|
4184
|
-
"pauseonfocusloss": ["watchPropPauseonfocusloss"]
|
|
4185
|
-
}; }
|
|
4186
|
-
static get style() { return ZToastNotificationStyle0; }
|
|
4187
|
-
}, [1, "z-toast-notification", {
|
|
4188
|
-
"heading": [1],
|
|
4189
|
-
"message": [1],
|
|
4190
|
-
"closebutton": [4],
|
|
4191
|
-
"autoclose": [2],
|
|
4192
|
-
"pauseonfocusloss": [4],
|
|
4193
|
-
"type": [1],
|
|
4194
|
-
"isdraggable": [4],
|
|
4195
|
-
"draggablepercentage": [2],
|
|
4196
|
-
"transition": [1],
|
|
4197
|
-
"percentage": [32],
|
|
4198
|
-
"hasSlottedButton": [32]
|
|
4199
|
-
}, undefined, {
|
|
4200
|
-
"isdraggable": ["watchPropIsdraggable"],
|
|
4201
|
-
"autoclose": ["watchPropAutoclose"],
|
|
4202
|
-
"pauseonfocusloss": ["watchPropPauseonfocusloss"]
|
|
4203
|
-
}]);
|
|
4204
|
-
function defineCustomElement$1() {
|
|
4205
|
-
if (typeof customElements === "undefined") {
|
|
4206
|
-
return;
|
|
4207
|
-
}
|
|
4208
|
-
const components = ["z-toast-notification", "z-icon"];
|
|
4209
|
-
components.forEach(tagName => { switch (tagName) {
|
|
4210
|
-
case "z-toast-notification":
|
|
4211
|
-
if (!customElements.get(tagName)) {
|
|
4212
|
-
customElements.define(tagName, ZToastNotification$1);
|
|
4213
|
-
}
|
|
4214
|
-
break;
|
|
4215
|
-
case "z-icon":
|
|
4216
|
-
if (!customElements.get(tagName)) {
|
|
4217
|
-
defineCustomElement$2();
|
|
4218
|
-
}
|
|
4219
|
-
break;
|
|
4220
|
-
} });
|
|
4221
|
-
}
|
|
4222
|
-
|
|
4223
|
-
const ZToastNotification = ZToastNotification$1;
|
|
4224
|
-
const defineCustomElement = defineCustomElement$1;
|
|
4225
|
-
|
|
4226
|
-
export { ZToastNotification, defineCustomElement };
|
|
4227
|
-
|
|
4228
|
-
//# sourceMappingURL=z-toast-notification.js.map
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as n,Host as o,transformTag as r}from"@stencil/core/internal/client";import{r as s,g as a}from"./index2.js";import{g as c}from"./_commonjsHelpers.js";import{d as u}from"./index3.js";
|
|
2
|
+
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:l,setPrototypeOf:h,isFrozen:f,getPrototypeOf:d,getOwnPropertyDescriptor:p}=Object;let{freeze:m,seal:g,create:v}=Object,{apply:b,construct:y}="undefined"!=typeof Reflect&&Reflect;m||(m=function(t){return t}),g||(g=function(t){return t}),b||(b=function(t,e,i){return t.apply(e,i)}),y||(y=function(t,e){return new t(...e)});const w=O(Array.prototype.forEach),T=O(Array.prototype.lastIndexOf),x=O(Array.prototype.pop),E=O(Array.prototype.push),k=O(Array.prototype.splice),A=O(String.prototype.toLowerCase),S=O(String.prototype.toString),R=O(String.prototype.match),z=O(String.prototype.replace),_=O(String.prototype.indexOf),D=O(String.prototype.trim),I=O(Object.prototype.hasOwnProperty),M=O(RegExp.prototype.test),P=function(t){return function(){for(var e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return y(t,i)}}(TypeError);function O(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var i=arguments.length,n=Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return b(t,e,n)}}function C(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:A;h&&h(t,null);let n=e.length;for(;n--;){let o=e[n];if("string"==typeof o){const t=i(o);t!==o&&(f(e)||(e[n]=t),o=t)}t[o]=!0}return t}function N(t){for(let e=0;e<t.length;e++)I(t,e)||(t[e]=null);return t}function L(t){const e=v(null);for(const[i,n]of l(t))I(t,i)&&(e[i]=Array.isArray(n)?N(n):n&&"object"==typeof n&&n.constructor===Object?L(n):n);return e}function F(t,e){for(;null!==t;){const i=p(t,e);if(i){if(i.get)return O(i.get);if("function"==typeof i.value)return O(i.value)}t=d(t)}return function(){return null}}const j=m(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),U=m(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),W=m(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),X=m(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),B=m(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),H=m(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Y=m(["#text"]),q=m(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),G=m(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$=m(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),V=m(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Z=g(/\{\{[\w\W]*|[\w\W]*\}\}/gm),K=g(/<%[\w\W]*|[\w\W]*%>/gm),J=g(/\$\{[\w\W]*/gm),Q=g(/^data-[\-\w.\u00B7-\uFFFF]+$/),tt=g(/^aria-[\-\w]+$/),et=g(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),it=g(/^(?:\w+script|data):/i),nt=g(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ot=g(/^html$/i),rt=g(/^[a-z][.\w]*(-[.\w]+)+$/i);var st=Object.freeze({__proto__:null,ARIA_ATTR:tt,ATTR_WHITESPACE:nt,CUSTOM_ELEMENT:rt,DATA_ATTR:Q,DOCTYPE_NAME:ot,ERB_EXPR:K,IS_ALLOWED_URI:et,IS_SCRIPT_OR_DATA:it,MUSTACHE_EXPR:Z,TMPLIT_EXPR:J});const at=function(){return"undefined"==typeof window?null:window};var ct,ut=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:at();const i=e=>t(e);if(i.version="3.2.6",i.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return i.isSupported=!1,i;let{document:n}=e;const o=n,r=o.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:c,Element:u,NodeFilter:h,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:d,DOMParser:p,trustedTypes:g}=e,b=u.prototype,y=F(b,"cloneNode"),O=F(b,"remove"),N=F(b,"nextSibling"),Z=F(b,"childNodes"),K=F(b,"parentNode");if("function"==typeof a){const t=n.createElement("template");t.content&&t.content.ownerDocument&&(n=t.content.ownerDocument)}let J,Q="";const{implementation:tt,createNodeIterator:it,createDocumentFragment:nt,getElementsByTagName:rt}=n,{importNode:ct}=o;let ut={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof l&&"function"==typeof K&&tt&&void 0!==tt.createHTMLDocument;const{MUSTACHE_EXPR:lt,ERB_EXPR:ht,TMPLIT_EXPR:ft,DATA_ATTR:dt,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:mt,ATTR_WHITESPACE:gt,CUSTOM_ELEMENT:vt}=st;let{IS_ALLOWED_URI:bt}=st,yt=null;const wt=C({},[...j,...U,...W,...B,...Y]);let Tt=null;const xt=C({},[...q,...G,...$,...V]);let Et=Object.seal(v(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),kt=null,At=null,St=!0,Rt=!0,zt=!1,_t=!0,Dt=!1,It=!0,Mt=!1,Pt=!1,Ot=!1,Ct=!1,Nt=!1,Lt=!1,Ft=!0,jt=!1,Ut=!0,Wt=!1,Xt={},Bt=null;const Ht=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Yt=null;const qt=C({},["audio","video","img","source","image","track"]);let Gt=null;const $t=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vt="http://www.w3.org/1998/Math/MathML",Zt="http://www.w3.org/2000/svg",Kt="http://www.w3.org/1999/xhtml";let Jt=Kt,Qt=!1,te=null;const ee=C({},[Vt,Zt,Kt],S);let ie=C({},["mi","mo","mn","ms","mtext"]),ne=C({},["annotation-xml"]);const oe=C({},["title","style","font","a","script"]);let re=null;const se=["application/xhtml+xml","text/html"];let ae=null,ce=null;const ue=n.createElement("form"),le=function(t){return t instanceof RegExp||t instanceof Function},he=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ce||ce!==t){if(t&&"object"==typeof t||(t={}),t=L(t),re=-1===se.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ae="application/xhtml+xml"===re?S:A,yt=I(t,"ALLOWED_TAGS")?C({},t.ALLOWED_TAGS,ae):wt,Tt=I(t,"ALLOWED_ATTR")?C({},t.ALLOWED_ATTR,ae):xt,te=I(t,"ALLOWED_NAMESPACES")?C({},t.ALLOWED_NAMESPACES,S):ee,Gt=I(t,"ADD_URI_SAFE_ATTR")?C(L($t),t.ADD_URI_SAFE_ATTR,ae):$t,Yt=I(t,"ADD_DATA_URI_TAGS")?C(L(qt),t.ADD_DATA_URI_TAGS,ae):qt,Bt=I(t,"FORBID_CONTENTS")?C({},t.FORBID_CONTENTS,ae):Ht,kt=I(t,"FORBID_TAGS")?C({},t.FORBID_TAGS,ae):L({}),At=I(t,"FORBID_ATTR")?C({},t.FORBID_ATTR,ae):L({}),Xt=!!I(t,"USE_PROFILES")&&t.USE_PROFILES,St=!1!==t.ALLOW_ARIA_ATTR,Rt=!1!==t.ALLOW_DATA_ATTR,zt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,_t=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Dt=t.SAFE_FOR_TEMPLATES||!1,It=!1!==t.SAFE_FOR_XML,Mt=t.WHOLE_DOCUMENT||!1,Ct=t.RETURN_DOM||!1,Nt=t.RETURN_DOM_FRAGMENT||!1,Lt=t.RETURN_TRUSTED_TYPE||!1,Ot=t.FORCE_BODY||!1,Ft=!1!==t.SANITIZE_DOM,jt=t.SANITIZE_NAMED_PROPS||!1,Ut=!1!==t.KEEP_CONTENT,Wt=t.IN_PLACE||!1,bt=t.ALLOWED_URI_REGEXP||et,Jt=t.NAMESPACE||Kt,ie=t.MATHML_TEXT_INTEGRATION_POINTS||ie,ne=t.HTML_INTEGRATION_POINTS||ne,Et=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&le(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Et.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&le(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Et.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Et.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Dt&&(Rt=!1),Nt&&(Ct=!0),Xt&&(yt=C({},Y),Tt=[],!0===Xt.html&&(C(yt,j),C(Tt,q)),!0===Xt.svg&&(C(yt,U),C(Tt,G),C(Tt,V)),!0===Xt.svgFilters&&(C(yt,W),C(Tt,G),C(Tt,V)),!0===Xt.mathMl&&(C(yt,B),C(Tt,$),C(Tt,V))),t.ADD_TAGS&&(yt===wt&&(yt=L(yt)),C(yt,t.ADD_TAGS,ae)),t.ADD_ATTR&&(Tt===xt&&(Tt=L(Tt)),C(Tt,t.ADD_ATTR,ae)),t.ADD_URI_SAFE_ATTR&&C(Gt,t.ADD_URI_SAFE_ATTR,ae),t.FORBID_CONTENTS&&(Bt===Ht&&(Bt=L(Bt)),C(Bt,t.FORBID_CONTENTS,ae)),Ut&&(yt["#text"]=!0),Mt&&C(yt,["html","head","body"]),yt.table&&(C(yt,["tbody"]),delete kt.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=t.TRUSTED_TYPES_POLICY,Q=J.createHTML("")}else void 0===J&&(J=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";e&&e.hasAttribute(n)&&(i=e.getAttribute(n));const o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(g,r)),null!==J&&"string"==typeof Q&&(Q=J.createHTML(""));m&&m(t),ce=t}},fe=C({},[...U,...W,...X]),de=C({},[...B,...H]),pe=function(t){E(i.removed,{element:t});try{K(t).removeChild(t)}catch(e){O(t)}},me=function(t,e){try{E(i.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){E(i.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(Ct||Nt)try{pe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},ge=function(t){let e=null,i=null;if(Ot)t="<remove></remove>"+t;else{const e=R(t,/^[\r\n\t ]+/);i=e&&e[0]}"application/xhtml+xml"===re&&Jt===Kt&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const o=J?J.createHTML(t):t;if(Jt===Kt)try{e=(new p).parseFromString(o,re)}catch(t){}if(!e||!e.documentElement){e=tt.createDocument(Jt,"template",null);try{e.documentElement.innerHTML=Qt?Q:o}catch(t){}}const r=e.body||e.documentElement;return t&&i&&r.insertBefore(n.createTextNode(i),r.childNodes[0]||null),Jt===Kt?rt.call(e,Mt?"html":"body")[0]:Mt?e.documentElement:r},ve=function(t){return it.call(t.ownerDocument||t,t,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},be=function(t){return t instanceof d&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof f)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},ye=function(t){return"function"==typeof c&&t instanceof c};function we(t,e,n){w(t,(t=>{t.call(i,e,n,ce)}))}const Te=function(t){let e=null;if(we(ut.beforeSanitizeElements,t,null),be(t))return pe(t),!0;const n=ae(t.nodeName);if(we(ut.uponSanitizeElement,t,{tagName:n,allowedTags:yt}),It&&t.hasChildNodes()&&!ye(t.firstElementChild)&&M(/<[/\w!]/g,t.innerHTML)&&M(/<[/\w!]/g,t.textContent))return pe(t),!0;if(7===t.nodeType)return pe(t),!0;if(It&&8===t.nodeType&&M(/<[/\w]/g,t.data))return pe(t),!0;if(!yt[n]||kt[n]){if(!kt[n]&&Ee(n)){if(Et.tagNameCheck instanceof RegExp&&M(Et.tagNameCheck,n))return!1;if(Et.tagNameCheck instanceof Function&&Et.tagNameCheck(n))return!1}if(Ut&&!Bt[n]){const e=K(t)||t.parentNode,i=Z(t)||t.childNodes;if(i&&e)for(let n=i.length-1;n>=0;--n){const o=y(i[n],!0);o.__removalCount=(t.__removalCount||0)+1,e.insertBefore(o,N(t))}}return pe(t),!0}return t instanceof u&&!function(t){let e=K(t);e&&e.tagName||(e={namespaceURI:Jt,tagName:"template"});const i=A(t.tagName),n=A(e.tagName);return!!te[t.namespaceURI]&&(t.namespaceURI===Zt?e.namespaceURI===Kt?"svg"===i:e.namespaceURI===Vt?"svg"===i&&("annotation-xml"===n||ie[n]):!!fe[i]:t.namespaceURI===Vt?e.namespaceURI===Kt?"math"===i:e.namespaceURI===Zt?"math"===i&&ne[n]:!!de[i]:t.namespaceURI===Kt?!(e.namespaceURI===Zt&&!ne[n])&&!(e.namespaceURI===Vt&&!ie[n])&&!de[i]&&(oe[i]||!fe[i]):!("application/xhtml+xml"!==re||!te[t.namespaceURI]))}(t)?(pe(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!M(/<\/no(script|embed|frames)/i,t.innerHTML)?(Dt&&3===t.nodeType&&(e=t.textContent,w([lt,ht,ft],(t=>{e=z(e,t," ")})),t.textContent!==e&&(E(i.removed,{element:t.cloneNode()}),t.textContent=e)),we(ut.afterSanitizeElements,t,null),!1):(pe(t),!0)},xe=function(t,e,i){if(Ft&&("id"===e||"name"===e)&&(i in n||i in ue))return!1;if(Rt&&!At[e]&&M(dt,e));else if(St&&M(pt,e));else if(!Tt[e]||At[e]){if(!(Ee(t)&&(Et.tagNameCheck instanceof RegExp&&M(Et.tagNameCheck,t)||Et.tagNameCheck instanceof Function&&Et.tagNameCheck(t))&&(Et.attributeNameCheck instanceof RegExp&&M(Et.attributeNameCheck,e)||Et.attributeNameCheck instanceof Function&&Et.attributeNameCheck(e))||"is"===e&&Et.allowCustomizedBuiltInElements&&(Et.tagNameCheck instanceof RegExp&&M(Et.tagNameCheck,i)||Et.tagNameCheck instanceof Function&&Et.tagNameCheck(i))))return!1}else if(Gt[e]);else if(M(bt,z(i,gt,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==_(i,"data:")||!Yt[t])if(zt&&!M(mt,z(i,gt,"")));else if(i)return!1;return!0},Ee=function(t){return"annotation-xml"!==t&&R(t,vt)},ke=function(t){we(ut.beforeSanitizeAttributes,t,null);const{attributes:e}=t;if(!e||be(t))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Tt,forceKeepAttr:void 0};let o=e.length;for(;o--;){const r=e[o],{name:s,namespaceURI:a,value:c}=r,u=ae(s),l=c;let h="value"===s?l:D(l);if(n.attrName=u,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,we(ut.uponSanitizeAttribute,t,n),h=n.attrValue,!jt||"id"!==u&&"name"!==u||(me(s,t),h="user-content-"+h),It&&M(/((--!?|])>)|<\/(style|title)/i,h)){me(s,t);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr){me(s,t);continue}if(!_t&&M(/\/>/i,h)){me(s,t);continue}Dt&&w([lt,ht,ft],(t=>{h=z(h,t," ")}));const f=ae(t.nodeName);if(xe(f,u,h)){if(J&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(a);else switch(g.getAttributeType(f,u)){case"TrustedHTML":h=J.createHTML(h);break;case"TrustedScriptURL":h=J.createScriptURL(h)}if(h!==l)try{a?t.setAttributeNS(a,s,h):t.setAttribute(s,h),be(t)?pe(t):x(i.removed)}catch(e){me(s,t)}}else me(s,t)}we(ut.afterSanitizeAttributes,t,null)},Ae=function t(e){let i=null;const n=ve(e);for(we(ut.beforeSanitizeShadowDOM,e,null);i=n.nextNode();)we(ut.uponSanitizeShadowNode,i,null),Te(i),ke(i),i.content instanceof s&&t(i.content);we(ut.afterSanitizeShadowDOM,e,null)};return i.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,a=null,u=null;if(Qt=!t,Qt&&(t="\x3c!--\x3e"),"string"!=typeof t&&!ye(t)){if("function"!=typeof t.toString)throw P("toString is not a function");if("string"!=typeof(t=""+t))throw P("dirty is not a string, aborting")}if(!i.isSupported)return t;if(Pt||he(e),i.removed=[],"string"==typeof t&&(Wt=!1),Wt){if(t.nodeName){const e=ae(t.nodeName);if(!yt[e]||kt[e])throw P("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof c)n=ge("\x3c!----\x3e"),r=n.ownerDocument.importNode(t,!0),1===r.nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!Ct&&!Dt&&!Mt&&-1===t.indexOf("<"))return J&&Lt?J.createHTML(t):t;if(n=ge(t),!n)return Ct?null:Lt?Q:""}n&&Ot&&pe(n.firstChild);const l=ve(Wt?t:n);for(;a=l.nextNode();)Te(a),ke(a),a.content instanceof s&&Ae(a.content);if(Wt)return t;if(Ct){if(Nt)for(u=nt.call(n.ownerDocument);n.firstChild;)u.appendChild(n.firstChild);else u=n;return(Tt.shadowroot||Tt.shadowrootmode)&&(u=ct.call(o,u,!0)),u}let h=Mt?n.outerHTML:n.innerHTML;return Mt&&yt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&M(ot,n.ownerDocument.doctype.name)&&(h="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+h),Dt&&w([lt,ht,ft],(t=>{h=z(h,t," ")})),J&&Lt?J.createHTML(h):h},i.setConfig=function(){he(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Pt=!0},i.clearConfig=function(){ce=null,Pt=!1},i.isValidAttribute=function(t,e,i){ce||he({});const n=ae(t),o=ae(e);return xe(n,o,i)},i.addHook=function(t,e){"function"==typeof e&&E(ut[t],e)},i.removeHook=function(t,e){if(void 0!==e){const i=T(ut[t],e);return-1===i?void 0:k(ut[t],i,1)[0]}return x(ut[t])},i.removeHooks=function(t){ut[t]=[]},i.removeAllHooks=function(){ut={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}(),lt={exports:{}},ht=(ct||(ct=1,function(t){!function(e,i,n,o){var r,s=["","webkit","Moz","MS","ms","o"],a=i.createElement("div"),c=Math.round,u=Math.abs,l=Date.now;function h(t,e,i){return setTimeout(b(t,i),e)}function f(t,e,i){return!!Array.isArray(t)&&(d(t,i[e],i),!0)}function d(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==o)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function p(t,i,n){var o="DEPRECATED METHOD: "+i+"\n"+n+" AT \n";return function(){var i=Error("get-stack-trace"),n=i&&i.stack?i.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,o,n),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===o||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==o&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign;var m=p((function(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;)(!i||i&&t[n[r]]===o)&&(t[n[r]]=e[n[r]]),r++;return t}),"extend","Use `assign`."),g=p((function(t,e){return m(t,e,!0)}),"merge","Use `assign`.");function v(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&r(n,i)}function b(t,e){return function(){return t.apply(e,arguments)}}function y(t,e){return"function"==typeof t?t.apply(e&&e[0]||o,e):t}function w(t,e){return t===o?e:t}function T(t,e,i){d(A(e),(function(e){t.addEventListener(e,i,!1)}))}function x(t,e,i){d(A(e),(function(e){t.removeEventListener(e,i,!1)}))}function E(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function k(t,e){return t.indexOf(e)>-1}function A(t){return t.trim().split(/\s+/g)}function S(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function R(t){return Array.prototype.slice.call(t,0)}function z(t,e){for(var i=[],n=[],o=0;o<t.length;){var r=t[o][e];S(n,r)<0&&i.push(t[o]),n[o]=r,o++}return i.sort((function(t,i){return t[e]>i[e]}))}function _(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),a=0;a<s.length;){if((n=(i=s[a])?i+r:e)in t)return n;a++}return o}var D=1;function I(t){var i=t.ownerDocument||t;return i.defaultView||i.parentWindow||e}var M="ontouchstart"in e,P=_(e,"PointerEvent")!==o,O=M&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),C="touch",N="mouse",L=["x","y"],F=["clientX","clientY"];function j(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){y(t.options.enable,[t])&&i.handler(e)},this.init()}function U(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,s=1&e&&n-r==0,a=12&e&&n-r==0;i.isFirst=!!s,i.isFinal=!!a,s&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=W(e)),r>1&&!i.firstMultiple?i.firstMultiple=W(e):1===r&&(i.firstMultiple=!1);var s=i.firstInput,a=i.firstMultiple,c=a?a.center:s.center,h=e.center=X(n);e.timeStamp=l(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=q(c,h),e.distance=Y(c,h),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},r=t.prevInput||{};1!==e.eventType&&4!==r.eventType||(o=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=H(e.deltaX,e.deltaY);var f=B(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=f.x,e.overallVelocityY=f.y,e.overallVelocity=u(f.x)>u(f.y)?f.x:f.y,e.scale=a?function(t,e){return Y(e[0],e[1],F)/Y(t[0],t[1],F)}(a.pointers,n):1,e.rotation=a?function(t,e){return q(e[1],e[0],F)+q(t[1],t[0],F)}(a.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,s,a=t.lastInterval||e,c=e.timeStamp-a.timeStamp;if(8!=e.eventType&&(c>25||a.velocity===o)){var l=e.deltaX-a.deltaX,h=e.deltaY-a.deltaY,f=B(c,l,h);n=f.x,r=f.y,i=u(f.x)>u(f.y)?f.x:f.y,s=H(l,h),t.lastInterval=e}else i=a.velocity,n=a.velocityX,r=a.velocityY,s=a.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=s}(i,e);var d=t.element;E(e.srcEvent.target,d)&&(d=e.srcEvent.target),e.target=d}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function W(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:c(t.pointers[i].clientX),clientY:c(t.pointers[i].clientY)},i++;return{timeStamp:l(),pointers:e,center:X(e),deltaX:t.deltaX,deltaY:t.deltaY}}function X(t){var e=t.length;if(1===e)return{x:c(t[0].clientX),y:c(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:c(i/e),y:c(n/e)}}function B(t,e,i){return{x:e/t||0,y:i/t||0}}function H(t,e){return t===e?1:u(t)>=u(e)?t<0?2:4:e<0?8:16}function Y(t,e,i){i||(i=L);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function q(t,e,i){return i||(i=L),180*Math.atan2(e[i[1]]-t[i[1]],e[i[0]]-t[i[0]])/Math.PI}j.prototype={handler:function(){},init:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(I(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&x(this.element,this.evEl,this.domHandler),this.evTarget&&x(this.target,this.evTarget,this.domHandler),this.evWin&&x(I(this.element),this.evWin,this.domHandler)}};var G={mousedown:1,mousemove:2,mouseup:4};function $(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,j.apply(this,arguments)}v($,j,{handler:function(t){var e=G[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:N,srcEvent:t}))}});var V={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},Z={2:C,3:"pen",4:N,5:"kinect"},K="pointerdown",J="pointermove pointerup pointercancel";function Q(){this.evEl=K,this.evWin=J,j.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}e.MSPointerEvent&&!e.PointerEvent&&(K="MSPointerDown",J="MSPointerMove MSPointerUp MSPointerCancel"),v(Q,j,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=V[n],r=Z[t.pointerType]||t.pointerType,s=r==C,a=S(e,t.pointerId,"pointerId");1&o&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):12&o&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))}});var tt={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function et(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,j.apply(this,arguments)}v(et,j,{handler:function(t){var e=tt[t.type];if(1===e&&(this.started=!0),this.started){var i=function(t,e){var i=R(t.touches),n=R(t.changedTouches);return 12&e&&(i=z(i.concat(n),"identifier")),[i,n]}(t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:t})}}});var it={touchstart:1,touchmove:2,touchend:4,touchcancel:8};function nt(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},j.apply(this,arguments)}function ot(t,e){var i=R(t.touches),n=this.targetIds;if(3&e&&1===i.length)return n[i[0].identifier]=!0,[i,i];var o,r,s=R(t.changedTouches),a=[],c=this.target;if(r=i.filter((function(t){return E(t.target,c)})),1===e)for(o=0;o<r.length;)n[r[o].identifier]=!0,o++;for(o=0;o<s.length;)n[s[o].identifier]&&a.push(s[o]),12&e&&delete n[s[o].identifier],o++;return a.length?[z(r.concat(a),"identifier"),a]:void 0}function rt(){j.apply(this,arguments);var t=b(this.handler,this);this.touch=new nt(this.manager,t),this.mouse=new $(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function st(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,at.call(this,e)):12&t&&at.call(this,e)}function at(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),2500)}}function ct(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n];if(Math.abs(e-o.x)<=25&&Math.abs(i-o.y)<=25)return!0}return!1}v(nt,j,{handler:function(t){var e=it[t.type],i=ot.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:C,srcEvent:t})}}),v(rt,j,{handler:function(t,e,i){var n=i.pointerType==N;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(i.pointerType==C)st.call(this,e,i);else if(n&&ct.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var ut=_(a.style,"touchAction"),lt=ut!==o,ht="compute",ft="auto",dt="manipulation",pt="none",mt="pan-x",gt="pan-y",vt=function(){if(!lt)return!1;var t={},i=e.CSS&&e.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(n){t[n]=!i||e.CSS.supports("touch-action",n)})),t}();function bt(t,e){this.manager=t,this.set(e)}bt.prototype={set:function(t){t==ht&&(t=this.compute()),lt&&this.manager.element.style&&vt[t]&&(this.manager.element.style[ut]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return d(this.manager.recognizers,(function(e){y(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(k(t,pt))return pt;var e=k(t,mt),i=k(t,gt);return e&&i?pt:e||i?e?mt:gt:k(t,dt)?dt:ft}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=k(n,pt)&&!vt[pt],r=k(n,gt)&&!vt[gt],s=k(n,mt)&&!vt[mt];if(o&&1===t.pointers.length&&t.distance<2&&t.deltaTime<250)return;if(!s||!r)return o||r&&6&i||s&&24&i?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var yt=32;function wt(t){this.options=r({},this.defaults,t||{}),this.id=D++,this.manager=null,this.options.enable=w(this.options.enable,!0),this.state=1,this.simultaneous={},this.requireFail=[]}function Tt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function xt(t){return 16==t?"down":8==t?"up":2==t?"left":4==t?"right":""}function Et(t,e){var i=e.manager;return i?i.get(t):t}function kt(){wt.apply(this,arguments)}function At(){kt.apply(this,arguments),this.pX=null,this.pY=null}function St(){kt.apply(this,arguments)}function Rt(){wt.apply(this,arguments),this._timer=null,this._input=null}function zt(){kt.apply(this,arguments)}function _t(){kt.apply(this,arguments)}function Dt(){wt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function It(t,e){return(e=e||{}).recognizers=w(e.recognizers,It.defaults.preset),new Mt(t,e)}function Mt(t,e){this.options=r({},It.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=function(t){return new(t.options.inputClass||(P?Q:O?nt:M?rt:$))(t,U)}(this),this.touchAction=new bt(this,this.options.touchAction),Pt(this,!0),d(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function Pt(t,e){var i,n=t.element;n.style&&(d(t.options.cssProps,(function(o,r){i=_(n.style,r),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}wt.prototype={defaults:{},set:function(t){return r(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(f(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Et(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return f(t,"dropRecognizeWith",this)||(t=Et(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(f(t,"requireFailure",this))return this;var e=this.requireFail;return-1===S(e,t=Et(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(f(t,"dropRequireFailure",this))return this;t=Et(t,this);var e=S(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+Tt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+Tt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=yt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},recognize:function(t){var e=r({},t);if(!y(this.options.enable,[this,e]))return this.reset(),void(this.state=yt);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(){},getTouchAction:function(){},reset:function(){}},v(kt,wt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,o=this.attrTest(t);return n&&(8&i||!o)?16|e:n||o?4&i?8|e:2&e?4|e:2:yt}}),v(At,kt,{defaults:{event:"pan",threshold:10,pointers:1,direction:30},getTouchAction:function(){var t=this.options.direction,e=[];return 6&t&&e.push(gt),24&t&&e.push(mt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,r=t.deltaX,s=t.deltaY;return o&e.direction||(6&e.direction?(o=0===r?1:r<0?2:4,i=r!=this.pX,n=Math.abs(t.deltaX)):(o=0===s?1:s<0?8:16,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},attrTest:function(t){return kt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=xt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),v(St,kt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){1!==t.scale&&(t.additionalEvent=this.options.event+(t.scale<1?"in":"out")),this._super.emit.call(this,t)}}),v(Rt,wt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[ft]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime>e.time;if(this._input=t,!n||!i||12&t.eventType&&!o)this.reset();else if(1&t.eventType)this.reset(),this._timer=h((function(){this.state=8,this.tryEmit()}),e.time,this);else if(4&t.eventType)return 8;return yt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=l(),this.manager.emit(this.options.event,this._input)))}}),v(zt,kt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[pt]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),v(_t,kt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},getTouchAction:function(){return At.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return 30&i?e=t.overallVelocity:6&i?e=t.overallVelocityX:24&i&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&u(e)>this.options.velocity&&4&t.eventType},emit:function(t){var e=xt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),v(Dt,wt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[dt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,o=t.deltaTime<e.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(n&&o&&i){if(4!=t.eventType)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||Y(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&r?this.count+=1:this.count=1,this._input=t,0==this.count%e.taps)return this.hasRequireFailures()?(this._timer=h((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return yt},failTimeout:function(){return this._timer=h((function(){this.state=yt}),this.options.interval,this),yt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),It.VERSION="2.0.7",It.defaults={domEvents:!1,touchAction:ht,enable:!0,inputTarget:null,inputClass:null,preset:[[zt,{enable:!1}],[St,{enable:!1},["rotate"]],[_t,{direction:6}],[At,{direction:6},["swipe"]],[Dt],[Dt,{event:"doubletap",taps:2},["tap"]],[Rt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Mt.prototype={set:function(t){return r(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(o=e.curRecognizer=null);for(var r=0;r<n.length;)i=n[r],2===e.stopped||o&&i!=o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&14&i.state&&(o=e.curRecognizer=i),r++}},get:function(t){if(t instanceof wt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(f(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(f(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=S(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==o&&e!==o){var i=this.handlers;return d(A(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==o){var i=this.handlers;return d(A(t),(function(t){e?i[t]&&i[t].splice(S(i[t],e),1):delete i[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var n=i.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var o=0;o<n.length;)n[o](e),o++}},destroy:function(){this.element&&Pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},r(It,{INPUT_START:1,INPUT_MOVE:2,INPUT_END:4,INPUT_CANCEL:8,STATE_POSSIBLE:1,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:yt,DIRECTION_NONE:1,DIRECTION_LEFT:2,DIRECTION_RIGHT:4,DIRECTION_UP:8,DIRECTION_DOWN:16,DIRECTION_HORIZONTAL:6,DIRECTION_VERTICAL:24,DIRECTION_ALL:30,Manager:Mt,Input:j,TouchAction:bt,TouchInput:nt,MouseInput:$,PointerEventInput:Q,TouchMouseInput:rt,SingleTouchInput:et,Recognizer:wt,AttrRecognizer:kt,Tap:Dt,Pan:At,Swipe:_t,Pinch:St,Rotate:zt,Press:Rt,on:T,off:x,each:d,merge:g,extend:m,assign:r,inherit:v,bindFn:b,prefixed:_}),(void 0!==e?e:"undefined"!=typeof self?self:{}).Hammer=It,t.exports?t.exports=It:e.Hammer=It}(window,document)}(lt)),lt.exports),ft=c(ht);const dt={[s.SLIDE_IN_DOWN]:s.SLIDE_OUT_UP,[s.SLIDE_IN_UP]:s.SLIDE_OUT_DOWN,[s.SLIDE_IN_LEFT]:s.SLIDE_OUT_RIGHT,[s.SLIDE_IN_RIGHT]:s.SLIDE_OUT_LEFT},pt=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.toastClose=i(this,"toastClose",7),this.pauseonfocusloss=!0,this.isdraggable=!0,this.draggablepercentage=80,this.isCloseEventCalled=!1}watchPropIsdraggable(t){t?this.sliderManager.get("pan").set({enable:!0}):this.sliderManager.get("pan").set({enable:!1})}watchPropAutoclose(t){clearTimeout(this.timeoutHandle),this.startClosingTimeout(t)}watchPropPauseonfocusloss(t){this.autoclose&&(t?document.addEventListener("visibilitychange",this.visibilityChangeEventHandler):document.removeEventListener("visibilitychange",this.visibilityChangeEventHandler))}close(t,e){e&&this.timeoutHandle&&clearTimeout(this.timeoutHandle),this.timeoutHandle=null,this.elapsedTime=null,this.toastClose.emit(),t?this.hostElement.classList.add(t):this.hostElement.parentNode.removeChild(this.hostElement)}visibilityChangeEventHandler(){"hidden"===document.visibilityState?this.timeoutHandle&&this.onBlur():this.elapsedTime&&this.onFocus()}validateAutoclose(){this.autoclose||this.closebutton||console.error("At least one between autoclose and closebutton must be present")}calculateDraggedPercentage(t){const e=this.hostElement.getBoundingClientRect();return Math.round(100*t.deltaX/e.width)}handleSlideOutDragAnimation(){this.sliderManager=new ft(this.hostElement),this.sliderManager.get("pan").set({direction:ft.DIRECTION_HORIZONTAL}),this.sliderManager.on("pan",(t=>{this.percentage=this.calculateDraggedPercentage(t),this.hostElement.style.transition="none",this.transition&&this.hostElement.classList.remove(this.transition);const e={translate:`translateX(${this.percentage}%)`,translateBack:"translateX(0)"};this.hostElement.style.opacity=100-Math.abs(this.percentage)+"%",t.eventType!==ft.DIRECTION_LEFT&&t.eventType!==ft.DIRECTION_RIGHT||(this.hostElement.style.transform=e.translate,Math.abs(this.percentage)>this.draggablepercentage&&!this.isCloseEventCalled&&(this.isCloseEventCalled=!0,this.close(t.direction===ft.DIRECTION_LEFT?s.SLIDE_OUT_LEFT:s.SLIDE_OUT_RIGHT,!0))),t.isFinal&&Math.abs(this.percentage)<this.draggablepercentage&&(this.hostElement.style.transform=e.translateBack,this.hostElement.style.transition="all 1s",this.hostElement.style.opacity="100%",this.percentage=0)}))}onFocus(){let t=this.autoclose;this.elapsedTime&&(t=this.autoclose-this.elapsedTime),t>0&&this.startClosingTimeout(t)}onBlur(){this.elapsedTime=Date.now()-this.startTime,clearTimeout(this.timeoutHandle)}startClosingTimeout(t){this.timeoutHandle=window.setTimeout((()=>this.close(dt[this.transition],!1)),t)}checkSlottedButton(){this.hasSlottedButton=!!this.hostElement.querySelector("[slot='button']")}componentWillLoad(){this.validateAutoclose(),this.checkSlottedButton(),this.percentage=0}componentDidLoad(){this.startTime=Date.now(),this.autoclose&&(this.pauseonfocusloss&&document.addEventListener("visibilitychange",this.visibilityChangeEventHandler),this.transition||this.startClosingTimeout(this.autoclose)),this.isdraggable&&this.handleSlideOutDragAnimation()}render(){return n(o,{key:"a49b625adab9d778f69c84e8bbe75ab565b894a1",style:{"--percentuale":this.percentage+"%"},class:{[this.transition]:!!this.transition,[this.type]:!!this.type},onAnimationEnd:t=>{this.autoclose&&t.animationName.includes("slidein")&&this.startClosingTimeout(this.autoclose),t.animationName.includes("slideout")&&this.hostElement.parentNode.removeChild(this.hostElement)}},n("div",{key:"a2677d79e89624c6043343f45d2d182fa957ced8",class:"toast-notification-container"},n("div",{key:"3abed7d27e3229a0ffb7136788bea5ff1f9b42ca",class:"toast-notification-content"},n("div",{key:"8360c7b1918dd43a6e20efbd8a7acc698114708e",class:"toast-notification-text"},this.heading&&n("span",{key:"6e90506018c059dba7c4c7dbf0a6b691554af361",class:"title"},this.heading),n("span",{key:"98808e38b56eef6f6fa7d1356a70e67727cefca8",class:"message"},n("slot",{key:"cd3c796108dcd61863aa2f6b675397226a7c597e",name:"message"},this.message&&n("span",{key:"b10e53ae700e37ea0725cb99d4e58fcf14b6b137",innerHTML:ut.sanitize(this.message)})))),n("div",{key:"d65f0c44ac30edf17510b2f046b6ebf1251122d3",class:"button-container",hidden:!this.hasSlottedButton},n("slot",{key:"cab7ecb2f6d03bf2b1e6f459db4dd00cf7fb9dc1",name:"button",onSlotchange:()=>this.checkSlottedButton()}))),this.closebutton&&n("button",{key:"aec76fdc32aa73389b7ecede4a082b9873422a04",class:"close-button","aria-label":"Chiudi notifica",onClick:()=>this.close(dt[this.transition],!0),onKeyDown:t=>{t.code!=a.SPACE&&t.code!=a.ENTER||(t.preventDefault(),this.close(dt[this.transition],!0))}},n("z-icon",{key:"9776de1410dbc02f319ae67a284da485949ab4c8",name:"multiply-circled"}))))}get hostElement(){return this}static get watchers(){return{isdraggable:[{watchPropIsdraggable:0}],autoclose:[{watchPropAutoclose:0}],pauseonfocusloss:[{watchPropPauseonfocusloss:0}]}}static get style(){return":host{--percentuale:0;display:flex;width:100%;min-width:200px;max-width:100dvw;box-sizing:border-box;background:var(--color-surface01);border-radius:var(--border-size-large);box-shadow:var(--shadow-3);color:var(--color-default-text);fill:var(--color-primary01-icon);font-family:var(--font-family-sans);font-size:var(--font-size-2);font-weight:var(--font-rg)}:host(.slide-in-left){animation:slideinleft 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-right){animation:slideinright 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-down){animation:slideindown 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-in-up){animation:slideinup 1s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-left){animation:slideoutleft 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-right){animation:slideoutright 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-down){animation:slideoutdown 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}:host(.slide-out-up){animation:slideoutup 0.5s cubic-bezier(0.25, 0.1, 0.25, 0.1);animation-fill-mode:forwards}.toast-notification-container{display:flex;width:100%;align-items:baseline;justify-content:space-between;padding:calc(var(--space-unit) * 2);border-radius:var(--border-radius);gap:calc(var(--space-unit) * 2)}.toast-notification-content{display:flex;width:100%;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:calc(var(--space-unit) * 2)}.toast-notification-content .toast-notification-text{color:inherit;letter-spacing:0.16px;line-height:1.25rem}.toast-notification-content .toast-notification-text .title{margin-right:calc(var(--space-unit) / 2);font-weight:var(--font-sb)}.close-button{height:1.125rem;padding:0;border:none;background-color:transparent;cursor:pointer}.close-button z-icon{--z-icon-width:1.125rem;--z-icon-height:1.125rem;display:inline-block;height:1.25rem}.close-button:focus:focus-visible{border-radius:50%;box-shadow:var(--shadow-focus-primary);outline:none}:host(.dark){background:var(--color-surface05);color:var(--color-text-inverse);fill:var(--color-inverse-icon)}:host(.dark) .close-button:focus:focus-visible{box-shadow:0 0 0 2px var(--gray900), 0 0 2px 5px var(--blue25)}:host(.accent){background:var(--color-primary01)}:host(.error){background:var(--color-default-error)}:host(.success){background:var(--color-default-success)}:host(.warning){background:var(--color-default-warning)}:host(.accent),:host(.error),:host(.success){color:var(--color-text-inverse);fill:var(--color-inverse-icon)}:host(.warning) .close-button{fill:var(--color-default-icon)}@media (min-width: 768px){:host{width:fit-content;max-width:50vw}.toast-notification-content{flex-wrap:nowrap}}@media (min-width: 1366px){:host{max-width:33vw}}@keyframes slideinleft{0%{transform:translateX(100%)}100%{transform:translateX(0)}}@keyframes slideinright{0%{transform:translateX(-100%)}100%{transform:translateX(0)}}@keyframes slideinup{0%{opacity:0;transform:translateY(100%)}100%{opacity:1;transform:translateY(0)}}@keyframes slideindown{0%{opacity:0;transform:translateY(-100%)}100%{opacity:1;transform:translateY(0)}}@keyframes slideoutleft{0%{opacity:calc(100% - var(--percentuale));transform:translateX(var(--percentuale))}100%{opacity:0;transform:translateX(-100%)}}@keyframes slideoutright{0%{opacity:calc(100% - var(--percentuale));transform:translateX(var(--percentuale))}100%{opacity:0;transform:translateX(100%)}}@keyframes slideoutup{0%{opacity:1;transform:translateY(var(--percentuale))}100%{opacity:0;transform:translateY(-100%)}}@keyframes slideoutdown{0%{opacity:1;transform:translateY(var(--percentuale))}100%{opacity:0;transform:translateY(100%)}}"}},[257,"z-toast-notification",{heading:[1],message:[1],closebutton:[4],autoclose:[2],pauseonfocusloss:[4],type:[1],isdraggable:[4],draggablepercentage:[2],transition:[1],percentage:[32],hasSlottedButton:[32]},void 0,{isdraggable:[{watchPropIsdraggable:0}],autoclose:[{watchPropAutoclose:0}],pauseonfocusloss:[{watchPropPauseonfocusloss:0}]}]),mt=pt,gt=function(){"undefined"!=typeof customElements&&["z-toast-notification","z-icon"].forEach((t=>{switch(t){case"z-toast-notification":customElements.get(r(t))||customElements.define(r(t),pt);break;case"z-icon":customElements.get(r(t))||u()}}))};export{mt as ZToastNotification,gt as defineCustomElement}
|