@internetarchive/elements 1.11.0-webdev-9043.0 → 1.11.1-webdev-10162.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -43
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js +39 -42
- package/dist/src/elements/ia-book-actions/assets/styles/collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js +21 -27
- package/dist/src/elements/ia-book-actions/assets/styles/ia-button.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js +1 -2
- package/dist/src/elements/ia-book-actions/ia-book-actions-collapsible-action-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js +21 -25
- package/dist/src/elements/ia-book-actions/ia-book-actions-info-icon.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js +16 -20
- package/dist/src/elements/ia-book-actions/ia-book-actions-text-group.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js +26 -30
- package/dist/src/elements/ia-book-actions/ia-book-actions-timer-countdown.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js +29 -33
- package/dist/src/elements/ia-book-actions/ia-book-actions-title-bar.js.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.d.ts.map +1 -1
- package/dist/src/elements/ia-book-actions/ia-book-actions.js +22 -28
- package/dist/src/elements/ia-book-actions/ia-book-actions.js.map +1 -1
- package/dist/src/elements/ia-button/ia-button.d.ts +34 -21
- package/dist/src/elements/ia-button/ia-button.d.ts.map +1 -1
- package/dist/src/elements/ia-button/ia-button.js +176 -277
- package/dist/src/elements/ia-button/ia-button.js.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.d.ts +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.d.ts.map +1 -1
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js +102 -131
- package/dist/src/elements/ia-clearable-text-input/ia-clearable-text-input.js.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.d.ts.map +1 -1
- package/dist/src/elements/ia-combo-box/ia-combo-box.js +20 -40
- package/dist/src/elements/ia-combo-box/ia-combo-box.js.map +1 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js +3 -9
- package/dist/src/elements/ia-donation-form/flow-handlers/donation-flow-modal-manager.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js +5 -10
- package/dist/src/elements/ia-donation-form/form-elements/contact-form/ia-donation-contact-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js +4 -4
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-badged-input.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js +3 -11
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-credit-card-fields.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js +16 -19
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-edit-donation.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js +11 -12
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-payment-selector.js.map +1 -1
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js +5 -5
- package/dist/src/elements/ia-donation-form/form-elements/ia-donation-section.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts +0 -5
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js +6 -14
- package/dist/src/elements/ia-donation-form/ia-donation-form-controller.js.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.d.ts.map +1 -1
- package/dist/src/elements/ia-donation-form/ia-donation-form.js +4 -6
- package/dist/src/elements/ia-donation-form/ia-donation-form.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js +4 -4
- package/dist/src/elements/ia-donation-form/modals/ia-donation-confirm-modal.js.map +1 -1
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js +10 -10
- package/dist/src/elements/ia-donation-form/modals/ia-donation-upsell-modal-content.js.map +1 -1
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js +13 -13
- package/dist/src/elements/ia-donation-thermometer/ia-donation-thermometer.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-dropdown.js +27 -113
- package/dist/src/elements/ia-dropdown/ia-dropdown.js.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown/ia-icon-label.js +5 -11
- package/dist/src/elements/ia-dropdown/ia-icon-label.js.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js +35 -79
- package/dist/src/elements/ia-dropdown-search-bar/ia-dropdown-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js +141 -156
- package/dist/src/elements/ia-expandable-search-bar/ia-expandable-search-bar.js.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.d.ts.map +1 -1
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js +43 -47
- package/dist/src/elements/ia-expandable-search-bar/ia-quick-search.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js +34 -39
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-comment.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js +112 -118
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey-vote.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js +42 -45
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback-survey.js.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.d.ts.map +1 -1
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js +239 -245
- package/dist/src/elements/ia-feature-feedback/ia-feature-feedback.js.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.d.ts.map +1 -1
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js +17 -24
- package/dist/src/elements/ia-histogram-date-range/ia-histogram-date-range.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js +1 -1
- package/dist/src/elements/ia-image-viewer/ia-image-viewer.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.d.ts.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js +7 -8
- package/dist/src/elements/ia-image-viewer/ia-imgview-controls.js.map +1 -1
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js +7 -7
- package/dist/src/elements/ia-image-viewer/ia-imgview-slide.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.d.ts.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js +65 -72
- package/dist/src/elements/ia-infinite-scroller/ia-infinite-scroller.js.map +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js +1 -1
- package/dist/src/elements/ia-infinite-scroller/story-support/ia-infinite-scroller-demo-tile.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js +5 -8
- package/dist/src/elements/ia-item-navigator/ia-item-navigator.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js +5 -5
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js +6 -6
- package/dist/src/elements/ia-item-navigator/ia-itemnav-menu-slider.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.d.ts.map +1 -1
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js +4 -5
- package/dist/src/elements/ia-item-navigator/ia-itemnav-no-theater-available.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js +13 -13
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-share-panel.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-sort-files-button.js.map +1 -1
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js +11 -11
- package/dist/src/elements/ia-item-navigator/menus/ia-itemnav-viewable-files-panel.js.map +1 -1
- package/dist/src/elements/ia-otp-form/ia-otp-form.js +4 -4
- package/dist/src/elements/ia-otp-form/ia-otp-form.js.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.d.ts.map +1 -1
- package/dist/src/elements/ia-otp-input/ia-otp-input.js +4 -21
- package/dist/src/elements/ia-otp-input/ia-otp-input.js.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.d.ts.map +1 -1
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js +81 -85
- package/dist/src/elements/ia-playback-controls/ia-playback-controls.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.d.ts.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-radio-player.js +140 -146
- package/dist/src/elements/ia-radio-player/ia-radio-player.js.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.d.ts.map +1 -1
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js +30 -37
- package/dist/src/elements/ia-radio-player/ia-search-results-switcher.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review-form.js +21 -28
- package/dist/src/elements/ia-reviews/ia-review-form.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-review.js +66 -70
- package/dist/src/elements/ia-reviews/ia-review.js.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.d.ts.map +1 -1
- package/dist/src/elements/ia-reviews/ia-reviews.js +12 -24
- package/dist/src/elements/ia-reviews/ia-reviews.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.d.ts.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js +132 -155
- package/dist/src/elements/ia-scrubber-bar/ia-scrubber-bar.js.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.d.ts.map +1 -1
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js +56 -63
- package/dist/src/elements/ia-scrubber-bar/ia-section-marker.js.map +1 -1
- package/dist/src/elements/ia-topnav/dropdown-menu.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/dropdown-menu.js +10 -41
- package/dist/src/elements/ia-topnav/dropdown-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js +2 -3
- package/dist/src/elements/ia-topnav/ia-topnav-desktop-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts +2 -2
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js +10 -23
- package/dist/src/elements/ia-topnav/ia-topnav-icon-hamburger.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js +4 -2
- package/dist/src/elements/ia-topnav/ia-topnav-login-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js +12 -18
- package/dist/src/elements/ia-topnav/ia-topnav-media-button.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js +4 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-menu.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-media-subnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-more-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js +13 -12
- package/dist/src/elements/ia-topnav/ia-topnav-primary-nav.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js +0 -2
- package/dist/src/elements/ia-topnav/ia-topnav-save-page-form.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js +3 -10
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-search.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js +2 -2
- package/dist/src/elements/ia-topnav/ia-topnav-wayback-slider.js.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/ia-topnav.js +42 -45
- package/dist/src/elements/ia-topnav/ia-topnav.js.map +1 -1
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.d.ts +25 -13
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.js +32 -17
- package/dist/src/elements/ia-topnav/lib/register-topnav-unit.js.map +1 -1
- package/dist/src/elements/ia-topnav/subnav-list-styles.d.ts.map +1 -1
- package/dist/src/elements/ia-topnav/subnav-list-styles.js +1 -8
- package/dist/src/elements/ia-topnav/subnav-list-styles.js.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.d.ts.map +1 -1
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js +173 -192
- package/dist/src/elements/ia-transcript-view/ia-transcript-view.js.map +1 -1
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.d.ts +70 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.js +314 -0
- package/dist/src/elements/ia-userlist-settings/ia-userlist-settings.js.map +1 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.d.ts +37 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.js +71 -0
- package/dist/src/elements/ia-userlist-settings/mocks/mock-userlist-service.js.map +1 -0
- package/dist/src/elements/ia-userlist-settings/models.d.ts +10 -0
- package/dist/src/elements/ia-userlist-settings/models.d.ts.map +1 -0
- package/dist/src/elements/ia-userlist-settings/models.js +2 -0
- package/dist/src/elements/ia-userlist-settings/models.js.map +1 -0
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.d.ts.map +1 -1
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js +47 -56
- package/dist/src/elements/ia-waveform-progress/ia-waveform-progress.js.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.d.ts.map +1 -1
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js +27 -46
- package/dist/src/elements/ia-wayback-search-form/ia-wayback-search-form.js.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.d.ts.map +1 -1
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js +48 -66
- package/dist/src/elements/modal-manager/ia-modal-manager-template.js.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.d.ts.map +1 -1
- package/dist/src/elements/modal-manager/modal-manager.js +2 -7
- package/dist/src/elements/modal-manager/modal-manager.js.map +1 -1
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.d.ts +29 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.d.ts.map +1 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.js +173 -0
- package/dist/src/services/userlist-service/mocks/sample-lists-backend.js.map +1 -0
- package/dist/src/services/userlist-service/userlist-service.d.ts +13 -3
- package/dist/src/services/userlist-service/userlist-service.d.ts.map +1 -1
- package/dist/src/services/userlist-service/userlist-service.js +25 -3
- package/dist/src/services/userlist-service/userlist-service.js.map +1 -1
- package/dist/src/themes/theme-styles.d.ts.map +1 -1
- package/dist/src/themes/theme-styles.js +50 -98
- package/dist/src/themes/theme-styles.js.map +1 -1
- package/package.json +5 -23
- package/dist/src/elements/ia-topnav/focus-styles.d.ts +0 -11
- package/dist/src/elements/ia-topnav/focus-styles.d.ts.map +0 -1
- package/dist/src/elements/ia-topnav/focus-styles.js +0 -22
- package/dist/src/elements/ia-topnav/focus-styles.js.map +0 -1
- package/dist/src/themes/tokens.d.ts +0 -14
- package/dist/src/themes/tokens.d.ts.map +0 -1
- package/dist/src/themes/tokens.js +0 -267
- package/dist/src/themes/tokens.js.map +0 -1
- package/dist/src/themes/unit.d.ts +0 -16
- package/dist/src/themes/unit.d.ts.map +0 -1
- package/dist/src/themes/unit.js +0 -70
- package/dist/src/themes/unit.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-book-actions.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EACL,oBAAoB,GAErB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,4CAA4C,CAAC;AACpD,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AACrC,OAAO,mCAAmC,CAAC;AAE3C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAUnD,OAAO,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EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;yDAA2C;AAE1C;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uDAAyC;AAG5C;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAwC;AAEnC;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDAAuC;AAEzC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;yDAA4B;AAG5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAkB;AAEjB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA4B;AAG3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAC4B;AAG3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAyB;AAOpB;IAA/B,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;mDAAsC;AAMzC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0DAIzB;AAK0B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sDAKzB;AAnES,aAAa;IADzB,aAAa,CAAC,iBAAiB,CAAC;GACpB,aAAa,CA6uCzB;;AAQD,eAAe,aAAa,CAAC","sourcesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { msg } from '@lit/localize';\nimport { customElement } from '@src/utils/custom-element';\nimport { tokenStyles } from '@src/themes/tokens';\n\nimport {\n SharedResizeObserver,\n type SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport { LocalCache } from '@internetarchive/local-cache';\n\nimport { ModalConfig } from '../modal-manager/modal-config';\n\nimport './ia-book-actions-collapsible-action-group';\nimport './ia-book-actions-title-bar';\nimport './ia-book-actions-text-group';\nimport './ia-book-actions-info-icon';\nimport './ia-book-actions-timer-countdown';\nimport type { IABookActionsTimerCountdown } from './ia-book-actions-timer-countdown';\nimport './core/config/ia-lending-intervals';\n\nimport { GetLendingActions } from './core/services/get-lending-actions';\nimport { mobileContainerWidth } from './core/config/constants';\nimport { sentryLogs } from './core/config/sentry-events';\nimport { LoanTokenPoller } from './core/services/loan-token-poller';\nimport { LoanRenewHelper } from './core/services/loan-renew-helper';\nimport { createLogger } from './core/services/logger';\nimport { sentryCaptureMessage } from './core/services/sentry-report';\nimport { URLHelper } from './core/config/url-helper';\nimport type { FetchHandlerInterface } from '@src/services/fetch-handler/fetch-handler-interface';\nimport { infoIcon } from './assets/data/info-icon';\nimport type {\n ActionConfig,\n BorrowType,\n LendingActionErrorEventLike,\n LendingStatus,\n LoanAutoRenewedEventLike,\n LoanRenewResult,\n LoanRenewTimeConfig,\n} from './models';\nimport './globals';\n\nconst log = createLogger('bar');\n\n/**\n * Registers elements' `modal-manager` once the page has finished loading, and\n * only when the page hasn't registered one of its own. Pages register their\n * modal manager while their scripts load, and a second registration of the\n * same tag from `@internetarchive/modal-manager` throws, so the bar waits for\n * the page and then defers to whatever it finds. Every modal the bar shows\n * waits on this first, so it never calls into a `modal-manager` element that\n * hasn't been upgraded yet.\n */\nlet modalManagerReady: Promise<void> | undefined;\n\nfunction ensureModalManager(): Promise<void> {\n modalManagerReady ??= (async () => {\n if (document.readyState !== 'complete') {\n await new Promise<void>((resolve) => {\n window.addEventListener('load', () => resolve(), { once: true });\n });\n }\n if (customElements.get('modal-manager')) return;\n await import('../modal-manager/modal-manager');\n })().catch((error) => {\n log.error('could not register modal-manager', error);\n });\n return modalManagerReady;\n}\n\n/**\n * How many create_token refreshes in a row may fail without an answer from\n * the service before the patron is shown the error modal. Each successful\n * refresh mints an access token good for 10 minutes (petabox\n * LendingConfig::BOOKREADER_AUTH_SECONDS) and refreshes run every 2 minutes\n * (tokenDelay), so the 3rd failure in a row (~6 minutes on) still shows the\n * modal before that token runs out and pages stop loading.\n */\nexport const MAX_SILENT_TOKEN_REFRESH_FAILURES = 2;\n\nexport const events = {\n browseExpired: 'IABookReader:BrowsingHasExpired',\n} as const;\n\n/**\n * custom styling for modal-manager buttons\n * TODO: lets allow modal-manager to know ia-button classes\n */\n// Inline styles in the page's modal-manager, which may be the page's own\n// (@internetarchive/modal-manager) and so have no token aliases: no tokens.\nexport const modalButtonStyle = {\n iaButton:\n 'min-height:calc(35 * var(--ia-unit, 1px));cursor:pointer;color:white;border-radius:4px;border:1px solid #c5d1df;padding:4px 8px;width:auto;user-select:none;',\n renew: 'background:#194880;width:110px;',\n return: 'background:#d9534f;width:120px;',\n loaderIcon:\n 'display:inline-block;width:20px;height:20px;margin-top:2px;color:white;--activityIndicatorLoadingRingColor:#fff;--activityIndicatorLoadingDotColor:#fff;',\n refresh:\n 'background:none;font-size:inherit;border:0;padding:0;color:#0000ee;cursor:pointer;text-decoration:underline',\n} as const;\n\n/** Seconds from now until `loanTime`, or NaN when there is no loan time. */\nfunction secondsUntil(loanTime: unknown): number {\n return Math.round((Number(loanTime) - Date.now()) / 1000);\n}\n\n@customElement('ia-book-actions')\nexport class IABookActions\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) userid = '';\n\n @property({ type: String }) identifier = '';\n\n @property({ type: String }) bookTitle = '';\n\n @property({ type: String }) returnUrl = '';\n\n /** very important as components feed from this */\n @property({ type: Object }) lendingStatus: LendingStatus = {};\n\n @property({ type: Number }) width = 0;\n\n @property({ type: String }) bwbPurchaseUrl = '';\n\n @property({ attribute: false }) lendingBarPostInit: () => void = () => {};\n\n @property({ attribute: false }) reloadPageImages: () => void = () => {};\n\n /** 'title'|'action' */\n @property({ type: String }) barType: 'title' | 'action' = 'action';\n\n @property({ attribute: false }) sharedObserver?: SharedResizeObserver;\n\n @property({ type: Boolean }) disableActionGroup = false;\n\n /** seconds between create_token calls */\n @property({ type: Number }) tokenDelay = 120;\n\n @property({ type: Number }) timerExecutionSeconds = 30;\n\n /** The image shown while an action is in progress. */\n @property({ type: String }) loaderIcon =\n 'https://archive.org/upload/images/tree/loading.gif';\n\n /** Created in `firstUpdated`, used for auto-loan-renew. */\n @property({ type: Object }) localCache!: LocalCache;\n\n /**\n * Makes the lending service requests. Loan actions are sent once with no\n * retries. Defaults to a plain `FetchHandler`; pass another to stub the\n * service, as the demo does.\n */\n @property({ attribute: false }) fetchHandler?: FetchHandlerInterface;\n\n /**\n * contains one hour auto-loan-renew time configuration\n * defaults to 1 hour config\n */\n @property({ type: Object }) loanRenewTimeConfig: LoanRenewTimeConfig = {\n loanTotalTime: 3600, // 1 hour\n loanRenewAtLast: 660, // 11 minutes\n pageChangedInLast: 900, // 15 minutes\n };\n\n /**\n * contains one hour auto-loan-renew response\n */\n @property({ type: Object }) loanRenewResult: LoanRenewResult = {\n texts: '',\n renewNow: false,\n secondsLeft: 0,\n renewType: '',\n };\n\n // private props\n postInitComplete = false;\n\n primaryActions: ActionConfig[] = [];\n\n primaryTitle = '';\n\n primaryColor: string | undefined = 'primary';\n\n secondaryActions: ActionConfig[] = [];\n\n lendingOptions?: GetLendingActions;\n\n /** 'browsed'|'borrowed'|'adminBorrowed' */\n borrowType: BorrowType | null = null;\n\n timeWhenTimerStart?: Date;\n\n loanRenewHelper?: LoanRenewHelper;\n\n tokenPoller?: LoanTokenPoller;\n\n /** Bound by bindLoanRenewEvents(), removed by unbindLoanRenewEvents(). */\n private userActionHandler?: (event: Event) => void;\n\n private pollerStartTimeout?: ReturnType<typeof setTimeout>;\n\n private renewNowTimeout?: ReturnType<typeof setTimeout>;\n\n /** True from autoRenewExpiredLoan() until its deferred renewNow fires. */\n private renewNowScheduled = false;\n\n private visibilityChangeHandler?: () => Promise<void>;\n\n loanRenewInProgress = false;\n\n /**\n * True while recovering from a loan that genuinely lapsed (set by\n * autoRenewExpiredLoan), as opposed to a routine pre-expiry top-up.\n * Only the recovery case needs BookReader re-initialized. See\n * handleLoanAutoRenewed.\n */\n recoveringFromLoanExpiry = false;\n\n /**\n * True once a create_token failure has torn the session down (see\n * handleLendingActionError), until a renewal confirms access again. The\n * teardown's lendingStatus change re-runs setupLendingToolbarActions(),\n * which would otherwise start a fresh poller straight away. For a\n * borrowed loan (user_has_borrowed is left as is) that poller's initial\n * create_token fails the same way, tearing down again, in a tight loop.\n */\n tokenAccessLost = false;\n\n /**\n * True right after a confirmed renewal (any kind), until the token\n * poller restarts. renew_loan's own response already carries a valid\n * access token, so that restart should skip its normal immediate\n * create_token call. See handleLoanAutoRenewed/\n * setupLendingToolbarActions.\n */\n skipNextInitialTokenCall = false;\n\n warningModalOpen = false;\n\n /** Once dismissed, don't re-show the warning modal every tick. Only\n * a real renewal (handleLoanAutoRenewed) re-arms it. */\n warningModalDismissed = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n // First connect binds in firstUpdated(). A reconnect re-binds here.\n if (this.hasUpdated) this.bindLoanRenewEvents();\n void ensureModalManager();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.unbindLoanRenewEvents();\n clearTimeout(this.pollerStartTimeout);\n clearTimeout(this.renewNowTimeout);\n if (this.renewNowScheduled) {\n // The deferred renewNow will never fire, so the guards\n // autoRenewExpiredLoan() set would stay up for good and every later\n // renewal check would return early after a reconnect.\n this.renewNowScheduled = false;\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n }\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.sentryCaptureMsg(sentryLogs.disconnectedCallback);\n this.disconnectResizeObserver();\n }\n\n /**\n * send log messages to sentry, tagged with this book's identifier\n *\n * @param message\n * @param action the lending action involved, if any\n * @param extra\n */\n sentryCaptureMsg(\n message: string,\n action?: string,\n extra?: Record<string, unknown>,\n ): void {\n sentryCaptureMessage(message, {\n identifier: this.identifier,\n action,\n extra,\n });\n }\n\n firstUpdated(): void {\n // bind auto loan renew events\n this.bindLoanRenewEvents();\n\n // localCache used for auto-loan-renew\n this.localCache = new LocalCache({\n namespace: 'loanRenew',\n });\n\n if (!this.sharedObserver) {\n this.sharedObserver = new SharedResizeObserver();\n this.setupResizeObserver();\n }\n }\n\n updated(changed: PropertyValues<this>): void {\n if (changed.has('lendingStatus') || changed.has('bwbPurchaseUrl')) {\n log.debug('lendingStatus changed', {\n identifier: this.identifier,\n lendingStatus: this.lendingStatus,\n });\n this.setupLendingToolbarActions();\n }\n\n if (changed.has('sharedObserver')) {\n this.disconnectResizeObserver();\n this.setupResizeObserver();\n }\n\n if (changed.has('loanRenewResult') && this.loanRenewResult.renewNow) {\n // Pause the countdown for the renew_loan round-trip, for every\n // renewal path. Cleared by handleLoanAutoRenewed().\n this.loanRenewInProgress = true;\n window.IALendingIntervals.clearAll();\n }\n }\n\n /** SharedObserver resize handler */\n handleResize(entry: ResizeObserverEntry): void {\n // if you are observing multiple targets,\n // you can distinguish them through `entry.target`\n const { target } = entry;\n if (target !== this) return;\n\n const { contentRect } = entry;\n // configure your view, ie:\n\n this.width = Math.round(contentRect.width);\n }\n\n /** Removes observer */\n disconnectResizeObserver(): void {\n this.sharedObserver?.removeObserver({\n handler: this,\n target: this,\n });\n }\n\n // observe the shadowRoot's viewport and\n // make this component the handler of changes\n setupResizeObserver(): void {\n if (!this.shadowRoot) return;\n this.sharedObserver?.addObserver({\n handler: this,\n target: this,\n });\n }\n /** End SharedObserver resize handler */\n\n /**\n * Recompute the action bar (title, buttons, colors, borrowType) from the\n * current lendingStatus.\n *\n * @returns false when there are no actions to apply, in which\n * case callers should bail out rather than continue with stale state.\n */\n applyLendingActions(): boolean {\n this.lendingOptions = new GetLendingActions(\n this.userid,\n this.identifier,\n this.lendingStatus,\n this.bwbPurchaseUrl,\n );\n const actions = this.lendingOptions.getCurrentLendingActions();\n\n if (!actions) return false;\n\n const present = (action: ActionConfig | null): action is ActionConfig =>\n action != null;\n\n this.primaryTitle = actions.primaryTitle;\n this.primaryActions = actions.primaryActions?.filter(present);\n this.primaryColor = actions.primaryColor;\n this.secondaryActions = actions.secondaryActions?.filter(present);\n\n this.borrowType = actions.borrowType ? actions.borrowType : null;\n\n return true;\n }\n\n async setupLendingToolbarActions(): Promise<void> {\n const hasExpired =\n 'browsingExpired' in this.lendingStatus &&\n this.lendingStatus?.browsingExpired;\n if (hasExpired) {\n // Auto-return must not visibly change the bar, unless nothing's\n // rendered yet (fresh load of an already-expired loan).\n if (this.primaryActions?.length) {\n log.debug('browsing expired — leaving action bar untouched');\n } else {\n log.debug('browsing expired on first render — populating action bar');\n this.applyLendingActions();\n }\n\n if (!this.tokenPoller) {\n this.sentryCaptureMsg(sentryLogs.bookWasExpired);\n }\n window?.IALendingIntervals?.clearAll();\n\n /** Global event - always fire */\n this.dispatchEvent(\n new Event(events.browseExpired, {\n bubbles: true,\n cancelable: false,\n composed: true,\n }),\n );\n\n // early return if book is already expired\n return;\n }\n\n if (!this.applyLendingActions()) return;\n\n // primaryActions/borrowType/etc are plain fields, not reactive\n // properties, so nothing pushes them to the rendered template (and\n // from there to <ia-book-actions-collapsible-action-group>) on its own.\n // Do that now, unconditionally. The early returns below (not borrowed,\n // title bar) must not skip it, or the action bar visibly goes stale\n // (e.g. a create_token failure resetting to Borrow never actually\n // shows it).\n this.requestUpdate();\n\n // Don't (re)start the countdown mid-renewal. secondsLeftOnLoan could\n // still be stale until handleLoanAutoRenewed() confirms it.\n if (this.borrowType === 'browsed' && !this.loanRenewInProgress) {\n await this.startTimerCountdown();\n await this.startBrowseTimer();\n }\n\n // early return if not borrowed or no action-bar\n if (!this.borrowType || this.barType === 'title') {\n this.lendingBarPostInit();\n return;\n }\n\n // Wait until any in-flight renewal is confirmed before (re)starting the\n // poller, so create_token isn't called against a not-yet-renewed loan.\n clearTimeout(this.pollerStartTimeout);\n this.pollerStartTimeout = setTimeout(() => {\n if (\n !hasExpired &&\n !this.loanRenewInProgress &&\n !this.tokenAccessLost &&\n !window.IALendingIntervals.tokenPoller\n ) {\n // Any confirmed renewal's response already minted a valid access\n // token (see handleLoanAutoRenewed), so the poller only needs to\n // start its recurring check, not fire an immediate confirming\n // create_token call too.\n const skipInitialCall = this.skipNextInitialTokenCall;\n this.skipNextInitialTokenCall = false;\n this.recoveringFromLoanExpiry = false;\n this.startLoanTokenPoller(skipInitialCall);\n }\n }, 100);\n }\n\n /**\n * Is this BookReader's own init-time jump to the last-read page, rather\n * than a real patron interaction (which fires the identical event)? Only\n * an explicit `false` counts; a missing flag must be treated as real.\n * @param event the BookReader:userAction event\n */\n isBookReaderInitAction(event?: Event): boolean {\n const detail = (\n event as\n | CustomEvent<{ props?: { init?: { initComplete?: boolean } } }>\n | undefined\n )?.detail;\n return detail?.props?.init?.initComplete === false;\n }\n\n /**\n * Bind 1 hour loan auto renew event,\n * There are two events we want to use,\n * 1. BookReader:userAction - dispatched from bookreader side\n * 2. IABookActions:loanRenew - dispatched from ia-book-actions-timer-countdown component\n */\n bindLoanRenewEvents(): void {\n // Safe to call repeatedly: drop any existing listeners before adding.\n this.unbindLoanRenewEvents();\n\n /**\n * dispatched this event from bookreader page changed\n */\n this.userActionHandler = (event: Event) => {\n if (this.isBookReaderInitAction(event)) {\n log.debug('BookReader:userAction ignored — fired by BookReader init');\n return;\n }\n\n // Capture before autoRenewExpiredLoan() runs. It optimistically\n // flips browsingExpired to false, which would otherwise also let\n // autoLoanRenewChecker() run and clobber the in-flight renewal.\n const wasExpired = this.lendingStatus.browsingExpired;\n\n log.debug('BookReader:userAction received', {\n borrowType: this.borrowType,\n browsingExpired: wasExpired,\n });\n\n if (wasExpired) {\n this.autoRenewExpiredLoan();\n }\n\n if (this.borrowType === 'browsed' && !wasExpired) {\n this.autoLoanRenewChecker(true);\n }\n };\n window.addEventListener('BookReader:userAction', this.userActionHandler);\n\n // A tab in the background can have its intervals throttled/paused, so\n // re-check status when the patron comes back to it.\n this.visibilityChangeHandler = async () => {\n if (document.hidden) {\n log.debug('visibilitychange: tab backgrounded');\n return;\n }\n\n log.debug('visibilitychange: tab foregrounded', this.borrowType);\n\n try {\n // Loan already expired while tab was hidden, so try to silently renew\n if (this.lendingStatus.browsingExpired === true) {\n this.autoRenewExpiredLoan();\n return;\n }\n\n if (this.borrowType !== 'browsed') return;\n\n if (this.lendingStatus.browsingExpired === false) {\n const loanTime = await this.localCache.get(\n `${this.identifier}-loanTime`,\n );\n\n // number of seconds left in current loan\n const secondsLeft = secondsUntil(loanTime);\n\n if (secondsLeft >= this.timerExecutionSeconds) {\n this.loanStatusCheckInterval(Number(secondsLeft));\n } else {\n // Loan expired while away, so silently renew. Only clear\n // intervals; disconnectedCallback() would drop the resize\n // observer for a session that's still continuing.\n window?.IALendingIntervals?.clearAll();\n this.autoRenewExpiredLoan();\n }\n }\n } catch (error) {\n // Surface localCache failures instead of an unhandled rejection.\n log.error('visibilitychange handler failed', {\n identifier: this.identifier,\n error,\n });\n this.sentryCaptureMsg('visibilitychange handler failed', undefined, {\n error: String(error),\n });\n }\n };\n document.addEventListener('visibilitychange', this.visibilityChangeHandler);\n }\n\n /** Remove the listeners added by bindLoanRenewEvents(). */\n unbindLoanRenewEvents(): void {\n if (this.userActionHandler) {\n window.removeEventListener(\n 'BookReader:userAction',\n this.userActionHandler,\n );\n this.userActionHandler = undefined;\n }\n if (this.visibilityChangeHandler) {\n document.removeEventListener(\n 'visibilitychange',\n this.visibilityChangeHandler,\n );\n this.visibilityChangeHandler = undefined;\n }\n }\n\n /**\n * To determine if need to be renewed browsed book\n * @see LoanRenewHelper\n *\n * @param hasPageChanged\n */\n async autoLoanRenewChecker(hasPageChanged = false): Promise<void> {\n // Re-entrancy guard against rapid BookReader:userAction events (e.g. a\n // single scroll firing several in quick succession).\n if (this.loanRenewInProgress) return;\n\n this.loanRenewHelper = new LoanRenewHelper(\n hasPageChanged,\n this.identifier,\n this.localCache,\n this.loanRenewTimeConfig,\n );\n\n await this.loanRenewHelper.handleLoanRenew();\n this.loanRenewResult = this.loanRenewHelper.result;\n }\n\n /**\n * Silently attempt to renew a browse loan that has expired, on\n * visibilitychange or a page turn. handleLoanAutoRenewed()/\n * handleLendingActionError() handle the outcome either way.\n */\n autoRenewExpiredLoan(): void {\n if (this.loanRenewInProgress) {\n log.debug('autoRenewExpiredLoan: skipped, renewal already in progress', {\n identifier: this.identifier,\n });\n return;\n }\n log.debug('autoRenewExpiredLoan: starting silent renewal', {\n identifier: this.identifier,\n });\n this.loanRenewInProgress = true;\n this.recoveringFromLoanExpiry = true;\n\n this.modal?.closeModal();\n\n // Optimistically flip browsingExpired so the bar stays in the reading\n // state during the renew_loan round-trip, instead of showing \"Borrow\".\n this.lendingStatus = {\n ...this.lendingStatus,\n browsingExpired: false,\n };\n\n // Defer renewNow until after lendingStatus timer setup completes.\n clearTimeout(this.renewNowTimeout);\n this.renewNowScheduled = true;\n this.renewNowTimeout = setTimeout(() => {\n this.renewNowScheduled = false;\n this.loanRenewResult = { texts: '', renewNow: true, renewType: 'auto' };\n }, 0);\n }\n\n /**\n * Required as sibling on page\n */\n get modal() {\n const modalOnDom = document.body.querySelector('modal-manager');\n\n modalOnDom?.setAttribute('id', 'action-bar-modal');\n return modalOnDom;\n }\n\n /**\n * Show the informational modal warning the patron their loan will expire\n * soon. This is acknowledgement-only, closing it does not renew the loan.\n * Only interacting with the book itself (e.g. turning a page) renews it.\n */\n async showWarningModal(): Promise<void> {\n if (this.warningModalOpen) return;\n this.warningModalOpen = true;\n\n log.debug('showWarningModal');\n await ensureModalManager();\n\n const { texts: warningTexts, secondsLeft: rawSecondsLeft } =\n this.loanRenewResult;\n let secondsLeft = rawSecondsLeft;\n if (secondsLeft === undefined || secondsLeft <= 0) {\n secondsLeft = this.lendingStatus.secondsLeftOnLoan;\n } else {\n secondsLeft = secondsLeft > 60 ? secondsLeft : 60;\n }\n\n this.modal!.customModalContent = undefined;\n this.modal?.closeModal();\n this.loanRenewResult = { texts: '', renewNow: false };\n\n const config = new ModalConfig({\n headline: html`${msg('Are you still there?')}`,\n headerColor: '#194880',\n showCloseButton: false,\n closeOnBackdropClick: false,\n message: html`<span>\n ${this.loanRenewHelper?.getMessageTexts(\n warningTexts,\n Number(secondsLeft),\n )}\n <a\n href=\"https://help.archive.org/help/borrowing-from-the-lending-library\"\n target=\"_blank\"\n title=${msg('Get more info on borrowing from The Lending Library')}\n data-event-click-tracking=\"BookReader|BrowsableMoreInfo\"\n style=\"display:inline-block;vertical-align:middle;line-height:0;margin-left:4px;\"\n >\n ${infoIcon}\n </a>\n </span>`,\n });\n\n const customModalContent = html`\n <div\n id=\"book-action-bar-custom-buttons\"\n style=\"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;margin-top:10px;\"\n >\n <button\n style=\"${modalButtonStyle.iaButton} ${modalButtonStyle.renew}\"\n @click=${() => this.dismissWarningModal()}\n >\n ${msg('Okay')}\n </button>\n </div>\n `;\n\n this.modal!.setAttribute('aria-live', 'assertive');\n await this.modal?.showModal({ config, customModalContent });\n }\n\n /** Acknowledges the warning modal, closing it without renewing the loan */\n dismissWarningModal(): void {\n this.modal?.closeModal();\n this.warningModalOpen = false;\n this.warningModalDismissed = true;\n }\n\n /**\n * Execute when loan is expired\n */\n async browseHasExpired(): Promise<void> {\n log.debug('browseHasExpired', {\n identifier: this.identifier,\n loanRenewInProgress: this.loanRenewInProgress,\n });\n window?.IALendingIntervals?.clearAll();\n\n const currStatus = {\n ...this.lendingStatus,\n browsingExpired: true,\n secondsLeftOnLoan: 0,\n };\n this.lendingStatus = currStatus;\n\n // remove respected key:value for loan-renew\n await this.localCache.delete(`${this.identifier}-loanTime`);\n await this.localCache.delete(`${this.identifier}-pageChangedTime`);\n log.debug('browseHasExpired: cleared loanTime/pageChangedTime cache', {\n identifier: this.identifier,\n });\n\n // show message after browsed book is expired.\n this.loanRenewResult.renewNow = false;\n this.loanRenewResult.texts = msg(\n 'This book has been returned due to inactivity.',\n );\n\n this.modal?.closeModal();\n // Release the warning-modal re-entrancy guard, or it stays latched for\n // the life of the component.\n this.warningModalOpen = false;\n\n this.sentryCaptureMsg(sentryLogs.browseHasExpired);\n }\n\n /**\n * Show modal when the book can no longer be automatically renewed\n * because another patron has checked it out.\n */\n async showLoanUnavailableModal(errorMsg?: string): Promise<void> {\n await ensureModalManager();\n const config = new ModalConfig({\n showCloseButton: false,\n closeOnBackdropClick: false,\n headerColor: '#d9534f',\n message: html`${errorMsg ||\n msg(\n 'Due to inactivity, this book was returned, and someone else has now borrowed it. Please try again later.',\n )}`,\n });\n\n const customModalContent = html`<br />\n <div style=\"text-align: center\">\n <button\n style=\"${modalButtonStyle.iaButton} ${modalButtonStyle.return}\"\n @click=${() => URLHelper.goToUrl(this.returnUrl, true)}\n >\n ${msg('Okay')}\n </button>\n </div>`;\n\n await this.modal?.showModal({ config, customModalContent });\n }\n\n async startBrowseTimer(): Promise<void> {\n window?.IALendingIntervals?.clearBrowseExpireTimeout();\n\n const { browsingExpired, user_has_browsed, secondsLeftOnLoan } =\n this.lendingStatus;\n\n if (!user_has_browsed || browsingExpired) {\n return;\n }\n\n window.IALendingIntervals.browseExpireTimeout = setTimeout(\n () => {\n this.browseHasExpired();\n },\n Number(secondsLeftOnLoan) * 1000,\n );\n }\n\n render() {\n if (this.barType === 'title') {\n return html`<section class=\"lending-wrapper\">\n ${this.bookTitleBar}\n </section>`;\n }\n\n return html`<section class=\"lending-wrapper\">\n ${this.bookActionBar}\n </section>`;\n }\n\n get bookTitleBar() {\n return html`<ia-book-actions-title-bar\n .identifier=${this.identifier}\n .bookTitle=${this.bookTitle}\n ></ia-book-actions-title-bar>`;\n }\n\n get timerCountdownEl(): IABookActionsTimerCountdown | null | undefined {\n return this.shadowRoot?.querySelector('ia-book-actions-timer-countdown');\n }\n\n get bookActionBar() {\n return html`\n <ia-book-actions-collapsible-action-group\n .userid=${this.userid}\n .identifier=${this.identifier}\n .primaryColor=${this.primaryColor}\n .primaryActions=${this.primaryActions}\n .secondaryActions=${this.secondaryActions}\n .width=${this.width}\n .borrowType=${this.borrowType}\n .returnUrl=${this.returnUrl}\n .localCache=${this.localCache}\n .fetchHandler=${this.fetchHandler}\n .loanTotalTime=${this.loanRenewTimeConfig.loanTotalTime}\n .loanRenewType=${this.loanRenewResult.renewType}\n .loaderIcon=${this.loaderIcon}\n ?hasAdminAccess=${this.hasAdminAccess}\n ?disabled=${this.disableActionGroup}\n ?autoRenew=${this.loanRenewResult.renewNow}\n ?autoReturn=${this.lendingStatus.browsingExpired}\n @loanAutoRenewed=${this.handleLoanAutoRenewed}\n @lendingActionError=${this.handleLendingActionError}\n @toggleActionGroup=${this.handleToggleActionGroup}\n >\n </ia-book-actions-collapsible-action-group>\n ${this.textGroupTemplate} ${this.infoIconTemplate}\n <ia-book-actions-timer-countdown\n .secondsLeftOnLoan=${Math.round(\n Number(this.lendingStatus.secondsLeftOnLoan),\n )}\n ></ia-book-actions-timer-countdown>\n `;\n }\n\n /**\n * Runs after a loan renewal completes (successfully or not): shows the\n * outcome, updates the remaining time, and resets renewal-in-flight state.\n * @param event\n */\n async handleLoanAutoRenewed({\n detail,\n }: LoanAutoRenewedEventLike): Promise<void> {\n const activeLoan = detail?.data?.loan;\n\n // Treat anything but a confirmed renewal as a failure, or\n // loanRenewInProgress stays latched forever (autoLoanRenewChecker/\n // autoRenewExpiredLoan both no-op on it).\n if (!activeLoan?.renewal) {\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n this.warningModalOpen = false;\n\n // dispatchActionError() has already reported this and shown the\n // relevant modal; don't stack a second one on top.\n log.warn('handleLoanAutoRenewed: not a confirmed renewal', {\n identifier: this.identifier,\n activeLoan,\n });\n return;\n }\n\n if (this.loanRenewResult.renewNow) {\n const loanTime = await this.localCache.get(`${this.identifier}-loanTime`);\n\n // number of seconds left in current loan\n const rawSecondsLeft = secondsUntil(loanTime);\n // Guard against a stale/missing loanTime read producing NaN, which\n // would get the loan stuck \"active\" with a countdown that never moves.\n const secondsLeft =\n Number.isFinite(rawSecondsLeft) && rawSecondsLeft > 0\n ? rawSecondsLeft\n : this.loanRenewTimeConfig.loanTotalTime;\n log.debug('handleLoanAutoRenewed', {\n secondsLeft,\n rawSecondsLeft,\n ajaxResponse: detail?.data,\n });\n\n // BookLoanService::attempt_to_renew_loan() mints a valid access\n // token as part of EVERY renew_loan response, not just a recovery\n // from expiry, so the poller restart below never needs to fire a\n // redundant confirming create_token call, regardless of which path\n // triggered this renewal.\n this.skipNextInitialTokenCall = true;\n this.tokenAccessLost = false;\n\n // A page image requested in the gap between expiry and this renewal\n // landing can come back broken, and browsers don't retry a failed\n // <img> on their own. Retry once, right when access is confirmed good\n // again.\n this.reloadPageImages();\n\n if (this.recoveringFromLoanExpiry) {\n // Only now is it safe to re-initialize BookReader, not for a\n // routine top-up, where that would be disruptive. Call it\n // directly rather than waiting on a confirming create_token\n // success: BookLoanService::attempt_to_renew_loan() already\n // minted a valid access token as part of this renew_loan\n // response, so there's nothing left to confirm.\n this.lendingBarPostInit();\n this.postInitComplete = true;\n }\n\n const currStatus = {\n ...this.lendingStatus,\n user_has_browsed: true,\n browsingExpired: false,\n secondsLeftOnLoan: secondsLeft,\n };\n this.lendingStatus = currStatus;\n\n // close the modal\n this.modal?.closeModal();\n if (this.modal) {\n this.modal.removeAttribute('id');\n this.modal.customModalContent = undefined;\n }\n this.sentryCaptureMsg(sentryLogs.bookHasRenewed, 'renew_loan');\n this.warningModalDismissed = false;\n }\n\n this.warningModalOpen = false;\n this.loanRenewInProgress = false;\n }\n\n /** Start the countdown interval; ticks read the live secondsLeftOnLoan\n * each time rather than a value frozen at start, so drift can't compound\n * across ticks (see loanStatusCheckInterval). */\n async startTimerCountdown(): Promise<void> {\n window?.IALendingIntervals?.clearTimerCountdown();\n this.timeWhenTimerStart = new Date();\n\n window.IALendingIntervals.timerCountdown = setInterval(async () => {\n await this.loanStatusCheckInterval(\n Number(this.lendingStatus.secondsLeftOnLoan),\n );\n }, this.timerExecutionSeconds * 1000);\n }\n\n /**\n * Runs on every countdown tick: resyncs against wall-clock time, attempts\n * a renewal near expiry, and clears the timers once the loan expires.\n * @param secondsLeftOnLoan\n */\n async loanStatusCheckInterval(secondsLeftOnLoan: number): Promise<void> {\n let secondsLeft = secondsLeftOnLoan;\n secondsLeft -= this.timerExecutionSeconds;\n secondsLeft = Math.round(secondsLeft);\n\n const resyncd = this.reSyncTimerIfGoneOff(secondsLeft);\n if (resyncd.hasSynced) {\n secondsLeft = resyncd.whatShouldLeft;\n log.debug('timer: timer re-synced', { secondsLeft });\n }\n\n log.debug('timer', {\n whatShouldLeft: resyncd.whatShouldLeft,\n whatIsleft: secondsLeft,\n });\n\n // Re-anchor every tick so drift from wall-clock time can't compound\n // across ticks that don't happen to trigger a resync above.\n this.timeWhenTimerStart = new Date();\n this.lendingStatus = {\n ...this.lendingStatus,\n secondsLeftOnLoan: secondsLeft,\n };\n\n // 10 minutes out: start checking for a renewal. 0: show the \"about to\n // auto-return\" warning. @see IABookActions::bindLoanRenewEvents\n if (secondsLeft <= this.loanRenewTimeConfig.loanRenewAtLast) {\n await this.loanRenewAttempt(secondsLeft);\n }\n\n if (secondsLeft <= this.timerExecutionSeconds) {\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.sentryCaptureMsg(sentryLogs.clearOneHourTimer);\n }\n }\n\n /**\n * helper function to determine if timer is not in sync properly\n *\n * @param timerSecondsLeft actual seconds left get from setInterval\n * @returns { hasSynced: [boolean], whatShouldLeft: [number] }\n */\n reSyncTimerIfGoneOff(timerSecondsLeft: number): {\n hasSynced: boolean;\n whatShouldLeft: number;\n } {\n const currentTime = new Date();\n\n // No prior anchor to compare against -- e.g. visibilitychange calling\n // loanStatusCheckInterval() directly before startTimerCountdown() ever\n // ran, which setupLendingToolbarActions() skips while a renewal is\n // in flight. Nothing to resync yet; anchor now and report no drift.\n if (!this.timeWhenTimerStart) {\n this.timeWhenTimerStart = currentTime;\n return { hasSynced: false, whatShouldLeft: Math.round(timerSecondsLeft) };\n }\n\n // current time - loan time\n const diffInSeconds =\n currentTime.getTime() / 1000 - this.timeWhenTimerStart.getTime() / 1000;\n\n const secondsShouldLeft =\n Number(this.lendingStatus.secondsLeftOnLoan) - diffInSeconds;\n\n // convert in minutes\n const whatIsleft = Math.round(timerSecondsLeft);\n const whatShouldLeft = Math.round(secondsShouldLeft);\n const timerElSeconds = this.timerCountdownEl!.secondsLeftOnLoan || 0;\n\n if (timerElSeconds !== whatShouldLeft || whatIsleft !== whatShouldLeft) {\n // set lending status with new time to update decrementor\n const currStatus = {\n ...this.lendingStatus,\n secondsLeftOnLoan: whatShouldLeft,\n };\n this.lendingStatus = currStatus;\n }\n\n if (whatIsleft !== whatShouldLeft) {\n log.debug(\n `reSyncTimerIfGoneOff ${whatIsleft} - ${whatShouldLeft}: re-syncing timer`,\n );\n return { hasSynced: true, whatShouldLeft };\n }\n\n return { hasSynced: false, whatShouldLeft };\n }\n\n /**\n * attmept to loan renew from\n * - timer countdown\n * - onclick on [keep reading] button\n *\n * @param secondsLeft\n */\n async loanRenewAttempt(secondsLeft: number): Promise<void> {\n let loanSecondsLeft = secondsLeft;\n // Under 50s left there isn't enough time for the renew_loan round-trip\n // and create_token to load images, so just expire the loan.\n if (loanSecondsLeft < 50) {\n log.debug('loanRenewAttempt: < 50s left, expiring loan');\n await this.browseHasExpired();\n return;\n }\n\n await this.autoLoanRenewChecker(false);\n\n // Once dismissed, don't re-show the warning on every subsequent tick.\n // Only an actual renewal (handleLoanAutoRenewed) re-arms it.\n if (\n this.loanRenewResult.renewNow === false &&\n !this.warningModalDismissed\n ) {\n // Compensate for the 50s buffer above by warning a minute early.\n loanSecondsLeft -= 60;\n this.loanRenewResult.secondsLeft = loanSecondsLeft;\n\n this.showWarningModal();\n }\n }\n\n /**\n * enable access of borrowed/browsed books\n * @param skipInitialCall see LoanTokenPoller's constructor doc\n * @see LoanTokenPoller\n */\n startLoanTokenPoller(skipInitialCall = false): void {\n const successCallback = () => {\n if (!this.postInitComplete) {\n this.lendingBarPostInit();\n }\n this.postInitComplete = true;\n };\n const errorCallback = (eventObj: LendingActionErrorEventLike) => {\n this.handleLendingActionError(eventObj);\n };\n\n // Tear down any previous poller first, so only one is ever controlling\n // window.IALendingIntervals.tokenPoller at a time.\n this.tokenPoller?.disconnectedCallback();\n this.tokenPoller = new LoanTokenPoller({\n identifier: this.identifier,\n borrowType: this.borrowType,\n successCallback,\n errorCallback,\n pollerDelay: this.tokenDelay, // in seconds\n skipInitialCall,\n fetchHandler: this.fetchHandler,\n });\n }\n\n /*\n * custom event handler to toggle action group visibility\n *\n * @event IABookActions#toggleActionGroup\n */\n handleToggleActionGroup(): void {\n this.disableActionGroup = !this.disableActionGroup;\n }\n\n /**\n * Handles lending errors from any action (browse_book, borrow_book,\n * create_token, renew_loan, etc).\n * @event IABookActions#lendingActionError\n * @param event\n * @param event.detail.action\n * @param event.detail.data.error\n */\n handleLendingActionError(event?: LendingActionErrorEventLike): void {\n this.disableActionGroup = false;\n\n const action = event?.detail?.action;\n // handleLoanRenewNow's failure path sets `.error` to a boolean flag and\n // puts the real text in `.message`. Only take `.error` when it's\n // actually a string, or the modal renders the literal word \"true\".\n const rawErrorMsg = event?.detail?.data?.error;\n const errorMsg = typeof rawErrorMsg === 'string' ? rawErrorMsg : undefined;\n const isInitial = event?.detail?.isInitial === true;\n const eventData = event?.detail?.data;\n const consecutiveFailures = event?.detail?.consecutiveFailures ?? 1;\n\n log.warn('handleLendingActionError', {\n identifier: this.identifier,\n action,\n errorMsg,\n isInitial,\n loanRenewInProgress: this.loanRenewInProgress,\n recoveringFromLoanExpiry: this.recoveringFromLoanExpiry,\n });\n\n if (\n action === 'create_token' &&\n !isInitial &&\n (eventData?.nonJsonResponse === true ||\n eventData?.networkFailure === true) &&\n consecutiveFailures <= MAX_SILENT_TOKEN_REFRESH_FAILURES\n ) {\n // The service never answered this routine refresh: something in\n // front of it did (the WAF's /about/400.html, an outage page), or the\n // request never got through. That says nothing about the loan, so\n // no modal and no session teardown. It's already reported to Sentry\n // (ActionsHandlerService/LoanTokenPoller), the current access token\n // keeps the book readable, and the poll interval is left running, so\n // the next tick tries again. The service's own answer (e.g. \"You do\n // not currently have this book borrowed.\") still falls through below.\n //\n // Not for the initial call: its success is what runs\n // lendingBarPostInit() and opens the book (see startLoanTokenPoller),\n // so suppressing it would leave a reader that never loads, silently.\n //\n // And not forever: past MAX_SILENT_TOKEN_REFRESH_FAILURES in a row,\n // the last good access token is about to expire, so fall through to\n // the modal rather than let the reader break with nothing shown.\n log.warn(\n 'create_token routine refresh got no answer from the service, no modal',\n {\n identifier: this.identifier,\n status: eventData?.status,\n errorMsg,\n },\n );\n return;\n }\n\n if (action === 'create_token') {\n // Any other create_token failure (initial, or a routine refresh the\n // service itself answered) means access can no longer be confirmed (e.g. a stale loan-record\n // cache on some other node can make this request fail even though\n // the loan is fine, or the loan may genuinely have just been\n // returned via BookReaderImages.php's revokeAccess()). Don't retry\n // and don't stay silent either way: reset the bar to Borrow and the\n // timer to 0 rather than leaving a stale countdown for a session\n // that isn't accessible.\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.tokenAccessLost = true;\n this.lendingStatus = {\n ...this.lendingStatus,\n user_has_browsed: false,\n available_to_browse: true,\n secondsLeftOnLoan: 0,\n };\n\n // showErrorModal has dedicated create_token messaging (refresh\n // button + support email) and shows regardless of whether a\n // specific error string came back.\n this.showErrorModal(errorMsg, action);\n } else if (action === 'renew_loan') {\n window?.IALendingIntervals?.clearAll();\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n\n // The loan was NOT renewed, so reflect that immediately (show Borrow,\n // clear the stale timer) instead of leaving a frozen \"Return now\".\n this.lendingStatus = {\n ...this.lendingStatus,\n user_has_browsed: false,\n available_to_browse: true,\n secondsLeftOnLoan: 0,\n };\n\n // Refresh the page on dismissal so the client picks up whatever the\n // server now authoritatively considers true (any error message).\n this.showLoanUnavailableModal(errorMsg);\n } else {\n // Every other action failure genuinely affects loan state.\n window?.IALendingIntervals?.clearAll();\n\n if (!errorMsg) return;\n\n this.showErrorModal(errorMsg, action);\n\n // update action bar state if book is not available to browse or borrow.\n if (errorMsg.match(/not available to borrow/gm)) {\n if (action === 'browse_book') {\n this.lendingStatus = {\n ...this.lendingStatus,\n available_to_browse: false,\n };\n } else if (action === 'borrow_book') {\n this.lendingStatus = {\n ...this.lendingStatus,\n available_to_borrow: false,\n };\n }\n }\n }\n }\n\n /* show error message if something went wrong */\n async showErrorModal(errorMsg?: string, action?: string): Promise<void> {\n await ensureModalManager();\n const modalConfig = new ModalConfig({\n title: html`${msg('Lending error')}`,\n message: errorMsg ? html`${errorMsg}` : undefined,\n headerColor: '#d9534f',\n showCloseButton: true,\n });\n\n if (action === 'create_token') {\n const refreshButton = html`<button\n style=\"${modalButtonStyle.refresh}\"\n @click=${() =>\n // Firefox's non-standard `forceGet` argument skips the cache\n (\n window.location as Location & { reload(forceGet?: boolean): void }\n ).reload(true)}\n >\n refresh\n </button>`;\n\n modalConfig.message = html` Uh oh, something went wrong trying to access\n this book.<br />\n Please ${refreshButton} to try again or send us an email to\n <a\n href=\"mailto:info@archive.org?subject=Help: cannot access my borrowed book: ${this\n .identifier}\"\n >info@archive.org</a\n ><br /><br />\n ${errorMsg ? html`<code>errorLog: ${errorMsg}</code>` : nothing}`;\n }\n\n await this.modal?.showModal({\n config: modalConfig,\n });\n }\n\n get iconClass(): 'mobile' | 'desktop' {\n return this.width <= mobileContainerWidth ? 'mobile' : 'desktop';\n }\n\n get textClass(): 'visible' | 'hidden' {\n return this.width >= mobileContainerWidth ? 'visible' : 'hidden';\n }\n\n get infoIconTemplate(): TemplateResult {\n return html`<ia-book-actions-info-icon\n iconClass=${this.iconClass}\n ></ia-book-actions-info-icon>`;\n }\n\n get textGroupTemplate(): TemplateResult | typeof nothing {\n return this.primaryTitle\n ? html`<ia-book-actions-text-group\n textClass=${this.textClass}\n .texts=${this.primaryTitle}\n >\n </ia-book-actions-text-group>`\n : nothing;\n }\n\n get hasAdminAccess(): boolean | undefined {\n return !this.lendingStatus.userHasBorrowed && this.lendingStatus.isAdmin;\n }\n\n static get styles(): CSSResultGroup {\n return [\n tokenStyles,\n css`\n :host {\n display: block;\n }\n\n .hide {\n display: none;\n }\n\n .lending-wrapper {\n width: 100%;\n margin: 0 auto;\n background: var(--primaryBGColor, var(--ia-color-surface-theater--));\n color: var(--primaryTextColor, var(--ia-color-text-inverse--));\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n }\n\n #action-bar-modal {\n --modalWidth: calc(360 * var(--ia-unit, 1px));\n }\n `,\n ];\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions': IABookActions;\n }\n}\n\nexport default IABookActions;\n"]}
|
|
1
|
+
{"version":3,"file":"ia-book-actions.js","sourceRoot":"","sources":["../../../../src/elements/ia-book-actions/ia-book-actions.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,IAAI,EACJ,UAAU,EACV,OAAO,GAIR,MAAM,KAAK,CAAC;AACb,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EACL,oBAAoB,GAErB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAE5D,OAAO,4CAA4C,CAAC;AACpD,OAAO,6BAA6B,CAAC;AACrC,OAAO,8BAA8B,CAAC;AACtC,OAAO,6BAA6B,CAAC;AACrC,OAAO,mCAAmC,CAAC;AAE3C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAA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cesContent":["import {\n css,\n html,\n LitElement,\n nothing,\n type CSSResultGroup,\n type PropertyValues,\n type TemplateResult,\n} from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { msg } from '@lit/localize';\nimport { customElement } from '@src/utils/custom-element';\n\nimport {\n SharedResizeObserver,\n type SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport { LocalCache } from '@internetarchive/local-cache';\n\nimport { ModalConfig } from '../modal-manager/modal-config';\n\nimport './ia-book-actions-collapsible-action-group';\nimport './ia-book-actions-title-bar';\nimport './ia-book-actions-text-group';\nimport './ia-book-actions-info-icon';\nimport './ia-book-actions-timer-countdown';\nimport type { IABookActionsTimerCountdown } from './ia-book-actions-timer-countdown';\nimport './core/config/ia-lending-intervals';\n\nimport { GetLendingActions } from './core/services/get-lending-actions';\nimport { mobileContainerWidth } from './core/config/constants';\nimport { sentryLogs } from './core/config/sentry-events';\nimport { LoanTokenPoller } from './core/services/loan-token-poller';\nimport { LoanRenewHelper } from './core/services/loan-renew-helper';\nimport { createLogger } from './core/services/logger';\nimport { sentryCaptureMessage } from './core/services/sentry-report';\nimport { URLHelper } from './core/config/url-helper';\nimport type { FetchHandlerInterface } from '@src/services/fetch-handler/fetch-handler-interface';\nimport { infoIcon } from './assets/data/info-icon';\nimport type {\n ActionConfig,\n BorrowType,\n LendingActionErrorEventLike,\n LendingStatus,\n LoanAutoRenewedEventLike,\n LoanRenewResult,\n LoanRenewTimeConfig,\n} from './models';\nimport './globals';\n\nconst log = createLogger('bar');\n\n/**\n * Registers elements' `modal-manager` once the page has finished loading, and\n * only when the page hasn't registered one of its own. Pages register their\n * modal manager while their scripts load, and a second registration of the\n * same tag from `@internetarchive/modal-manager` throws, so the bar waits for\n * the page and then defers to whatever it finds. Every modal the bar shows\n * waits on this first, so it never calls into a `modal-manager` element that\n * hasn't been upgraded yet.\n */\nlet modalManagerReady: Promise<void> | undefined;\n\nfunction ensureModalManager(): Promise<void> {\n modalManagerReady ??= (async () => {\n if (document.readyState !== 'complete') {\n await new Promise<void>((resolve) => {\n window.addEventListener('load', () => resolve(), { once: true });\n });\n }\n if (customElements.get('modal-manager')) return;\n await import('../modal-manager/modal-manager');\n })().catch((error) => {\n log.error('could not register modal-manager', error);\n });\n return modalManagerReady;\n}\n\n/**\n * How many create_token refreshes in a row may fail without an answer from\n * the service before the patron is shown the error modal. Each successful\n * refresh mints an access token good for 10 minutes (petabox\n * LendingConfig::BOOKREADER_AUTH_SECONDS) and refreshes run every 2 minutes\n * (tokenDelay), so the 3rd failure in a row (~6 minutes on) still shows the\n * modal before that token runs out and pages stop loading.\n */\nexport const MAX_SILENT_TOKEN_REFRESH_FAILURES = 2;\n\nexport const events = {\n browseExpired: 'IABookReader:BrowsingHasExpired',\n} as const;\n\n/**\n * custom styling for modal-manager buttons\n * TODO: lets allow modal-manager to know ia-button classes\n */\nexport const modalButtonStyle = {\n iaButton:\n 'min-height:3.5rem;cursor:pointer;color:white;border-radius:0.4rem;border:1px solid #c5d1df;padding:4px 8px;width:auto;user-select:none;',\n renew: 'background:#194880;width:110px;',\n return: 'background:#d9534f;width:120px;',\n loaderIcon:\n 'display:inline-block;width:20px;height:20px;margin-top:2px;color:white;--activityIndicatorLoadingRingColor:#fff;--activityIndicatorLoadingDotColor:#fff;',\n refresh:\n 'background:none;font-size:inherit;border:0;padding:0;color:#0000ee;cursor:pointer;text-decoration:underline',\n} as const;\n\n/** Seconds from now until `loanTime`, or NaN when there is no loan time. */\nfunction secondsUntil(loanTime: unknown): number {\n return Math.round((Number(loanTime) - Date.now()) / 1000);\n}\n\n@customElement('ia-book-actions')\nexport class IABookActions\n extends LitElement\n implements SharedResizeObserverResizeHandlerInterface\n{\n @property({ type: String }) userid = '';\n\n @property({ type: String }) identifier = '';\n\n @property({ type: String }) bookTitle = '';\n\n @property({ type: String }) returnUrl = '';\n\n /** very important as components feed from this */\n @property({ type: Object }) lendingStatus: LendingStatus = {};\n\n @property({ type: Number }) width = 0;\n\n @property({ type: String }) bwbPurchaseUrl = '';\n\n @property({ attribute: false }) lendingBarPostInit: () => void = () => {};\n\n @property({ attribute: false }) reloadPageImages: () => void = () => {};\n\n /** 'title'|'action' */\n @property({ type: String }) barType: 'title' | 'action' = 'action';\n\n @property({ attribute: false }) sharedObserver?: SharedResizeObserver;\n\n @property({ type: Boolean }) disableActionGroup = false;\n\n /** seconds between create_token calls */\n @property({ type: Number }) tokenDelay = 120;\n\n @property({ type: Number }) timerExecutionSeconds = 30;\n\n /** The image shown while an action is in progress. */\n @property({ type: String }) loaderIcon =\n 'https://archive.org/upload/images/tree/loading.gif';\n\n /** Created in `firstUpdated`, used for auto-loan-renew. */\n @property({ type: Object }) localCache!: LocalCache;\n\n /**\n * Makes the lending service requests. Loan actions are sent once with no\n * retries. Defaults to a plain `FetchHandler`; pass another to stub the\n * service, as the demo does.\n */\n @property({ attribute: false }) fetchHandler?: FetchHandlerInterface;\n\n /**\n * contains one hour auto-loan-renew time configuration\n * defaults to 1 hour config\n */\n @property({ type: Object }) loanRenewTimeConfig: LoanRenewTimeConfig = {\n loanTotalTime: 3600, // 1 hour\n loanRenewAtLast: 660, // 11 minutes\n pageChangedInLast: 900, // 15 minutes\n };\n\n /**\n * contains one hour auto-loan-renew response\n */\n @property({ type: Object }) loanRenewResult: LoanRenewResult = {\n texts: '',\n renewNow: false,\n secondsLeft: 0,\n renewType: '',\n };\n\n // private props\n postInitComplete = false;\n\n primaryActions: ActionConfig[] = [];\n\n primaryTitle = '';\n\n primaryColor: string | undefined = 'primary';\n\n secondaryActions: ActionConfig[] = [];\n\n lendingOptions?: GetLendingActions;\n\n /** 'browsed'|'borrowed'|'adminBorrowed' */\n borrowType: BorrowType | null = null;\n\n timeWhenTimerStart?: Date;\n\n loanRenewHelper?: LoanRenewHelper;\n\n tokenPoller?: LoanTokenPoller;\n\n /** Bound by bindLoanRenewEvents(), removed by unbindLoanRenewEvents(). */\n private userActionHandler?: (event: Event) => void;\n\n private pollerStartTimeout?: ReturnType<typeof setTimeout>;\n\n private renewNowTimeout?: ReturnType<typeof setTimeout>;\n\n /** True from autoRenewExpiredLoan() until its deferred renewNow fires. */\n private renewNowScheduled = false;\n\n private visibilityChangeHandler?: () => Promise<void>;\n\n loanRenewInProgress = false;\n\n /**\n * True while recovering from a loan that genuinely lapsed (set by\n * autoRenewExpiredLoan), as opposed to a routine pre-expiry top-up.\n * Only the recovery case needs BookReader re-initialized. See\n * handleLoanAutoRenewed.\n */\n recoveringFromLoanExpiry = false;\n\n /**\n * True once a create_token failure has torn the session down (see\n * handleLendingActionError), until a renewal confirms access again. The\n * teardown's lendingStatus change re-runs setupLendingToolbarActions(),\n * which would otherwise start a fresh poller straight away. For a\n * borrowed loan (user_has_borrowed is left as is) that poller's initial\n * create_token fails the same way, tearing down again, in a tight loop.\n */\n tokenAccessLost = false;\n\n /**\n * True right after a confirmed renewal (any kind), until the token\n * poller restarts. renew_loan's own response already carries a valid\n * access token, so that restart should skip its normal immediate\n * create_token call. See handleLoanAutoRenewed/\n * setupLendingToolbarActions.\n */\n skipNextInitialTokenCall = false;\n\n warningModalOpen = false;\n\n /** Once dismissed, don't re-show the warning modal every tick. Only\n * a real renewal (handleLoanAutoRenewed) re-arms it. */\n warningModalDismissed = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n // First connect binds in firstUpdated(). A reconnect re-binds here.\n if (this.hasUpdated) this.bindLoanRenewEvents();\n void ensureModalManager();\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.unbindLoanRenewEvents();\n clearTimeout(this.pollerStartTimeout);\n clearTimeout(this.renewNowTimeout);\n if (this.renewNowScheduled) {\n // The deferred renewNow will never fire, so the guards\n // autoRenewExpiredLoan() set would stay up for good and every later\n // renewal check would return early after a reconnect.\n this.renewNowScheduled = false;\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n }\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.sentryCaptureMsg(sentryLogs.disconnectedCallback);\n this.disconnectResizeObserver();\n }\n\n /**\n * send log messages to sentry, tagged with this book's identifier\n *\n * @param message\n * @param action the lending action involved, if any\n * @param extra\n */\n sentryCaptureMsg(\n message: string,\n action?: string,\n extra?: Record<string, unknown>,\n ): void {\n sentryCaptureMessage(message, {\n identifier: this.identifier,\n action,\n extra,\n });\n }\n\n firstUpdated(): void {\n // bind auto loan renew events\n this.bindLoanRenewEvents();\n\n // localCache used for auto-loan-renew\n this.localCache = new LocalCache({\n namespace: 'loanRenew',\n });\n\n if (!this.sharedObserver) {\n this.sharedObserver = new SharedResizeObserver();\n this.setupResizeObserver();\n }\n }\n\n updated(changed: PropertyValues<this>): void {\n if (changed.has('lendingStatus') || changed.has('bwbPurchaseUrl')) {\n log.debug('lendingStatus changed', {\n identifier: this.identifier,\n lendingStatus: this.lendingStatus,\n });\n this.setupLendingToolbarActions();\n }\n\n if (changed.has('sharedObserver')) {\n this.disconnectResizeObserver();\n this.setupResizeObserver();\n }\n\n if (changed.has('loanRenewResult') && this.loanRenewResult.renewNow) {\n // Pause the countdown for the renew_loan round-trip, for every\n // renewal path. Cleared by handleLoanAutoRenewed().\n this.loanRenewInProgress = true;\n window.IALendingIntervals.clearAll();\n }\n }\n\n /** SharedObserver resize handler */\n handleResize(entry: ResizeObserverEntry): void {\n // if you are observing multiple targets,\n // you can distinguish them through `entry.target`\n const { target } = entry;\n if (target !== this) return;\n\n const { contentRect } = entry;\n // configure your view, ie:\n\n this.width = Math.round(contentRect.width);\n }\n\n /** Removes observer */\n disconnectResizeObserver(): void {\n this.sharedObserver?.removeObserver({\n handler: this,\n target: this,\n });\n }\n\n // observe the shadowRoot's viewport and\n // make this component the handler of changes\n setupResizeObserver(): void {\n if (!this.shadowRoot) return;\n this.sharedObserver?.addObserver({\n handler: this,\n target: this,\n });\n }\n /** End SharedObserver resize handler */\n\n /**\n * Recompute the action bar (title, buttons, colors, borrowType) from the\n * current lendingStatus.\n *\n * @returns false when there are no actions to apply, in which\n * case callers should bail out rather than continue with stale state.\n */\n applyLendingActions(): boolean {\n this.lendingOptions = new GetLendingActions(\n this.userid,\n this.identifier,\n this.lendingStatus,\n this.bwbPurchaseUrl,\n );\n const actions = this.lendingOptions.getCurrentLendingActions();\n\n if (!actions) return false;\n\n const present = (action: ActionConfig | null): action is ActionConfig =>\n action != null;\n\n this.primaryTitle = actions.primaryTitle;\n this.primaryActions = actions.primaryActions?.filter(present);\n this.primaryColor = actions.primaryColor;\n this.secondaryActions = actions.secondaryActions?.filter(present);\n\n this.borrowType = actions.borrowType ? actions.borrowType : null;\n\n return true;\n }\n\n async setupLendingToolbarActions(): Promise<void> {\n const hasExpired =\n 'browsingExpired' in this.lendingStatus &&\n this.lendingStatus?.browsingExpired;\n if (hasExpired) {\n // Auto-return must not visibly change the bar, unless nothing's\n // rendered yet (fresh load of an already-expired loan).\n if (this.primaryActions?.length) {\n log.debug('browsing expired — leaving action bar untouched');\n } else {\n log.debug('browsing expired on first render — populating action bar');\n this.applyLendingActions();\n }\n\n if (!this.tokenPoller) {\n this.sentryCaptureMsg(sentryLogs.bookWasExpired);\n }\n window?.IALendingIntervals?.clearAll();\n\n /** Global event - always fire */\n this.dispatchEvent(\n new Event(events.browseExpired, {\n bubbles: true,\n cancelable: false,\n composed: true,\n }),\n );\n\n // early return if book is already expired\n return;\n }\n\n if (!this.applyLendingActions()) return;\n\n // primaryActions/borrowType/etc are plain fields, not reactive\n // properties, so nothing pushes them to the rendered template (and\n // from there to <ia-book-actions-collapsible-action-group>) on its own.\n // Do that now, unconditionally. The early returns below (not borrowed,\n // title bar) must not skip it, or the action bar visibly goes stale\n // (e.g. a create_token failure resetting to Borrow never actually\n // shows it).\n this.requestUpdate();\n\n // Don't (re)start the countdown mid-renewal. secondsLeftOnLoan could\n // still be stale until handleLoanAutoRenewed() confirms it.\n if (this.borrowType === 'browsed' && !this.loanRenewInProgress) {\n await this.startTimerCountdown();\n await this.startBrowseTimer();\n }\n\n // early return if not borrowed or no action-bar\n if (!this.borrowType || this.barType === 'title') {\n this.lendingBarPostInit();\n return;\n }\n\n // Wait until any in-flight renewal is confirmed before (re)starting the\n // poller, so create_token isn't called against a not-yet-renewed loan.\n clearTimeout(this.pollerStartTimeout);\n this.pollerStartTimeout = setTimeout(() => {\n if (\n !hasExpired &&\n !this.loanRenewInProgress &&\n !this.tokenAccessLost &&\n !window.IALendingIntervals.tokenPoller\n ) {\n // Any confirmed renewal's response already minted a valid access\n // token (see handleLoanAutoRenewed), so the poller only needs to\n // start its recurring check, not fire an immediate confirming\n // create_token call too.\n const skipInitialCall = this.skipNextInitialTokenCall;\n this.skipNextInitialTokenCall = false;\n this.recoveringFromLoanExpiry = false;\n this.startLoanTokenPoller(skipInitialCall);\n }\n }, 100);\n }\n\n /**\n * Is this BookReader's own init-time jump to the last-read page, rather\n * than a real patron interaction (which fires the identical event)? Only\n * an explicit `false` counts; a missing flag must be treated as real.\n * @param event the BookReader:userAction event\n */\n isBookReaderInitAction(event?: Event): boolean {\n const detail = (\n event as\n | CustomEvent<{ props?: { init?: { initComplete?: boolean } } }>\n | undefined\n )?.detail;\n return detail?.props?.init?.initComplete === false;\n }\n\n /**\n * Bind 1 hour loan auto renew event,\n * There are two events we want to use,\n * 1. BookReader:userAction - dispatched from bookreader side\n * 2. IABookActions:loanRenew - dispatched from ia-book-actions-timer-countdown component\n */\n bindLoanRenewEvents(): void {\n // Safe to call repeatedly: drop any existing listeners before adding.\n this.unbindLoanRenewEvents();\n\n /**\n * dispatched this event from bookreader page changed\n */\n this.userActionHandler = (event: Event) => {\n if (this.isBookReaderInitAction(event)) {\n log.debug('BookReader:userAction ignored — fired by BookReader init');\n return;\n }\n\n // Capture before autoRenewExpiredLoan() runs. It optimistically\n // flips browsingExpired to false, which would otherwise also let\n // autoLoanRenewChecker() run and clobber the in-flight renewal.\n const wasExpired = this.lendingStatus.browsingExpired;\n\n log.debug('BookReader:userAction received', {\n borrowType: this.borrowType,\n browsingExpired: wasExpired,\n });\n\n if (wasExpired) {\n this.autoRenewExpiredLoan();\n }\n\n if (this.borrowType === 'browsed' && !wasExpired) {\n this.autoLoanRenewChecker(true);\n }\n };\n window.addEventListener('BookReader:userAction', this.userActionHandler);\n\n // A tab in the background can have its intervals throttled/paused, so\n // re-check status when the patron comes back to it.\n this.visibilityChangeHandler = async () => {\n if (document.hidden) {\n log.debug('visibilitychange: tab backgrounded');\n return;\n }\n\n log.debug('visibilitychange: tab foregrounded', this.borrowType);\n\n try {\n // Loan already expired while tab was hidden, so try to silently renew\n if (this.lendingStatus.browsingExpired === true) {\n this.autoRenewExpiredLoan();\n return;\n }\n\n if (this.borrowType !== 'browsed') return;\n\n if (this.lendingStatus.browsingExpired === false) {\n const loanTime = await this.localCache.get(\n `${this.identifier}-loanTime`,\n );\n\n // number of seconds left in current loan\n const secondsLeft = secondsUntil(loanTime);\n\n if (secondsLeft >= this.timerExecutionSeconds) {\n this.loanStatusCheckInterval(Number(secondsLeft));\n } else {\n // Loan expired while away, so silently renew. Only clear\n // intervals; disconnectedCallback() would drop the resize\n // observer for a session that's still continuing.\n window?.IALendingIntervals?.clearAll();\n this.autoRenewExpiredLoan();\n }\n }\n } catch (error) {\n // Surface localCache failures instead of an unhandled rejection.\n log.error('visibilitychange handler failed', {\n identifier: this.identifier,\n error,\n });\n this.sentryCaptureMsg('visibilitychange handler failed', undefined, {\n error: String(error),\n });\n }\n };\n document.addEventListener('visibilitychange', this.visibilityChangeHandler);\n }\n\n /** Remove the listeners added by bindLoanRenewEvents(). */\n unbindLoanRenewEvents(): void {\n if (this.userActionHandler) {\n window.removeEventListener(\n 'BookReader:userAction',\n this.userActionHandler,\n );\n this.userActionHandler = undefined;\n }\n if (this.visibilityChangeHandler) {\n document.removeEventListener(\n 'visibilitychange',\n this.visibilityChangeHandler,\n );\n this.visibilityChangeHandler = undefined;\n }\n }\n\n /**\n * To determine if need to be renewed browsed book\n * @see LoanRenewHelper\n *\n * @param hasPageChanged\n */\n async autoLoanRenewChecker(hasPageChanged = false): Promise<void> {\n // Re-entrancy guard against rapid BookReader:userAction events (e.g. a\n // single scroll firing several in quick succession).\n if (this.loanRenewInProgress) return;\n\n this.loanRenewHelper = new LoanRenewHelper(\n hasPageChanged,\n this.identifier,\n this.localCache,\n this.loanRenewTimeConfig,\n );\n\n await this.loanRenewHelper.handleLoanRenew();\n this.loanRenewResult = this.loanRenewHelper.result;\n }\n\n /**\n * Silently attempt to renew a browse loan that has expired, on\n * visibilitychange or a page turn. handleLoanAutoRenewed()/\n * handleLendingActionError() handle the outcome either way.\n */\n autoRenewExpiredLoan(): void {\n if (this.loanRenewInProgress) {\n log.debug('autoRenewExpiredLoan: skipped, renewal already in progress', {\n identifier: this.identifier,\n });\n return;\n }\n log.debug('autoRenewExpiredLoan: starting silent renewal', {\n identifier: this.identifier,\n });\n this.loanRenewInProgress = true;\n this.recoveringFromLoanExpiry = true;\n\n this.modal?.closeModal();\n\n // Optimistically flip browsingExpired so the bar stays in the reading\n // state during the renew_loan round-trip, instead of showing \"Borrow\".\n this.lendingStatus = {\n ...this.lendingStatus,\n browsingExpired: false,\n };\n\n // Defer renewNow until after lendingStatus timer setup completes.\n clearTimeout(this.renewNowTimeout);\n this.renewNowScheduled = true;\n this.renewNowTimeout = setTimeout(() => {\n this.renewNowScheduled = false;\n this.loanRenewResult = { texts: '', renewNow: true, renewType: 'auto' };\n }, 0);\n }\n\n /**\n * Required as sibling on page\n */\n get modal() {\n const modalOnDom = document.body.querySelector('modal-manager');\n\n modalOnDom?.setAttribute('id', 'action-bar-modal');\n return modalOnDom;\n }\n\n /**\n * Show the informational modal warning the patron their loan will expire\n * soon. This is acknowledgement-only, closing it does not renew the loan.\n * Only interacting with the book itself (e.g. turning a page) renews it.\n */\n async showWarningModal(): Promise<void> {\n if (this.warningModalOpen) return;\n this.warningModalOpen = true;\n\n log.debug('showWarningModal');\n await ensureModalManager();\n\n const { texts: warningTexts, secondsLeft: rawSecondsLeft } =\n this.loanRenewResult;\n let secondsLeft = rawSecondsLeft;\n if (secondsLeft === undefined || secondsLeft <= 0) {\n secondsLeft = this.lendingStatus.secondsLeftOnLoan;\n } else {\n secondsLeft = secondsLeft > 60 ? secondsLeft : 60;\n }\n\n this.modal!.customModalContent = undefined;\n this.modal?.closeModal();\n this.loanRenewResult = { texts: '', renewNow: false };\n\n const config = new ModalConfig({\n headline: html`${msg('Are you still there?')}`,\n headerColor: '#194880',\n showCloseButton: false,\n closeOnBackdropClick: false,\n message: html`<span>\n ${this.loanRenewHelper?.getMessageTexts(\n warningTexts,\n Number(secondsLeft),\n )}\n <a\n href=\"https://help.archive.org/help/borrowing-from-the-lending-library\"\n target=\"_blank\"\n title=${msg('Get more info on borrowing from The Lending Library')}\n data-event-click-tracking=\"BookReader|BrowsableMoreInfo\"\n style=\"display:inline-block;vertical-align:middle;line-height:0;margin-left:4px;\"\n >\n ${infoIcon}\n </a>\n </span>`,\n });\n\n const customModalContent = html`\n <div\n id=\"book-action-bar-custom-buttons\"\n style=\"display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;margin-top:10px;\"\n >\n <button\n style=\"${modalButtonStyle.iaButton} ${modalButtonStyle.renew}\"\n @click=${() => this.dismissWarningModal()}\n >\n ${msg('Okay')}\n </button>\n </div>\n `;\n\n this.modal!.setAttribute('aria-live', 'assertive');\n await this.modal?.showModal({ config, customModalContent });\n }\n\n /** Acknowledges the warning modal, closing it without renewing the loan */\n dismissWarningModal(): void {\n this.modal?.closeModal();\n this.warningModalOpen = false;\n this.warningModalDismissed = true;\n }\n\n /**\n * Execute when loan is expired\n */\n async browseHasExpired(): Promise<void> {\n log.debug('browseHasExpired', {\n identifier: this.identifier,\n loanRenewInProgress: this.loanRenewInProgress,\n });\n window?.IALendingIntervals?.clearAll();\n\n const currStatus = {\n ...this.lendingStatus,\n browsingExpired: true,\n secondsLeftOnLoan: 0,\n };\n this.lendingStatus = currStatus;\n\n // remove respected key:value for loan-renew\n await this.localCache.delete(`${this.identifier}-loanTime`);\n await this.localCache.delete(`${this.identifier}-pageChangedTime`);\n log.debug('browseHasExpired: cleared loanTime/pageChangedTime cache', {\n identifier: this.identifier,\n });\n\n // show message after browsed book is expired.\n this.loanRenewResult.renewNow = false;\n this.loanRenewResult.texts = msg(\n 'This book has been returned due to inactivity.',\n );\n\n this.modal?.closeModal();\n // Release the warning-modal re-entrancy guard, or it stays latched for\n // the life of the component.\n this.warningModalOpen = false;\n\n this.sentryCaptureMsg(sentryLogs.browseHasExpired);\n }\n\n /**\n * Show modal when the book can no longer be automatically renewed\n * because another patron has checked it out.\n */\n async showLoanUnavailableModal(errorMsg?: string): Promise<void> {\n await ensureModalManager();\n const config = new ModalConfig({\n showCloseButton: false,\n closeOnBackdropClick: false,\n headerColor: '#d9534f',\n message: html`${errorMsg ||\n msg(\n 'Due to inactivity, this book was returned, and someone else has now borrowed it. Please try again later.',\n )}`,\n });\n\n const customModalContent = html`<br />\n <div style=\"text-align: center\">\n <button\n style=\"${modalButtonStyle.iaButton} ${modalButtonStyle.return}\"\n @click=${() => URLHelper.goToUrl(this.returnUrl, true)}\n >\n ${msg('Okay')}\n </button>\n </div>`;\n\n await this.modal?.showModal({ config, customModalContent });\n }\n\n async startBrowseTimer(): Promise<void> {\n window?.IALendingIntervals?.clearBrowseExpireTimeout();\n\n const { browsingExpired, user_has_browsed, secondsLeftOnLoan } =\n this.lendingStatus;\n\n if (!user_has_browsed || browsingExpired) {\n return;\n }\n\n window.IALendingIntervals.browseExpireTimeout = setTimeout(\n () => {\n this.browseHasExpired();\n },\n Number(secondsLeftOnLoan) * 1000,\n );\n }\n\n render() {\n if (this.barType === 'title') {\n return html`<section class=\"lending-wrapper\">\n ${this.bookTitleBar}\n </section>`;\n }\n\n return html`<section class=\"lending-wrapper\">\n ${this.bookActionBar}\n </section>`;\n }\n\n get bookTitleBar() {\n return html`<ia-book-actions-title-bar\n .identifier=${this.identifier}\n .bookTitle=${this.bookTitle}\n ></ia-book-actions-title-bar>`;\n }\n\n get timerCountdownEl(): IABookActionsTimerCountdown | null | undefined {\n return this.shadowRoot?.querySelector('ia-book-actions-timer-countdown');\n }\n\n get bookActionBar() {\n return html`\n <ia-book-actions-collapsible-action-group\n .userid=${this.userid}\n .identifier=${this.identifier}\n .primaryColor=${this.primaryColor}\n .primaryActions=${this.primaryActions}\n .secondaryActions=${this.secondaryActions}\n .width=${this.width}\n .borrowType=${this.borrowType}\n .returnUrl=${this.returnUrl}\n .localCache=${this.localCache}\n .fetchHandler=${this.fetchHandler}\n .loanTotalTime=${this.loanRenewTimeConfig.loanTotalTime}\n .loanRenewType=${this.loanRenewResult.renewType}\n .loaderIcon=${this.loaderIcon}\n ?hasAdminAccess=${this.hasAdminAccess}\n ?disabled=${this.disableActionGroup}\n ?autoRenew=${this.loanRenewResult.renewNow}\n ?autoReturn=${this.lendingStatus.browsingExpired}\n @loanAutoRenewed=${this.handleLoanAutoRenewed}\n @lendingActionError=${this.handleLendingActionError}\n @toggleActionGroup=${this.handleToggleActionGroup}\n >\n </ia-book-actions-collapsible-action-group>\n ${this.textGroupTemplate} ${this.infoIconTemplate}\n <ia-book-actions-timer-countdown\n .secondsLeftOnLoan=${Math.round(\n Number(this.lendingStatus.secondsLeftOnLoan),\n )}\n ></ia-book-actions-timer-countdown>\n `;\n }\n\n /**\n * Runs after a loan renewal completes (successfully or not): shows the\n * outcome, updates the remaining time, and resets renewal-in-flight state.\n * @param event\n */\n async handleLoanAutoRenewed({\n detail,\n }: LoanAutoRenewedEventLike): Promise<void> {\n const activeLoan = detail?.data?.loan;\n\n // Treat anything but a confirmed renewal as a failure, or\n // loanRenewInProgress stays latched forever (autoLoanRenewChecker/\n // autoRenewExpiredLoan both no-op on it).\n if (!activeLoan?.renewal) {\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n this.warningModalOpen = false;\n\n // dispatchActionError() has already reported this and shown the\n // relevant modal; don't stack a second one on top.\n log.warn('handleLoanAutoRenewed: not a confirmed renewal', {\n identifier: this.identifier,\n activeLoan,\n });\n return;\n }\n\n if (this.loanRenewResult.renewNow) {\n const loanTime = await this.localCache.get(`${this.identifier}-loanTime`);\n\n // number of seconds left in current loan\n const rawSecondsLeft = secondsUntil(loanTime);\n // Guard against a stale/missing loanTime read producing NaN, which\n // would get the loan stuck \"active\" with a countdown that never moves.\n const secondsLeft =\n Number.isFinite(rawSecondsLeft) && rawSecondsLeft > 0\n ? rawSecondsLeft\n : this.loanRenewTimeConfig.loanTotalTime;\n log.debug('handleLoanAutoRenewed', {\n secondsLeft,\n rawSecondsLeft,\n ajaxResponse: detail?.data,\n });\n\n // BookLoanService::attempt_to_renew_loan() mints a valid access\n // token as part of EVERY renew_loan response, not just a recovery\n // from expiry, so the poller restart below never needs to fire a\n // redundant confirming create_token call, regardless of which path\n // triggered this renewal.\n this.skipNextInitialTokenCall = true;\n this.tokenAccessLost = false;\n\n // A page image requested in the gap between expiry and this renewal\n // landing can come back broken, and browsers don't retry a failed\n // <img> on their own. Retry once, right when access is confirmed good\n // again.\n this.reloadPageImages();\n\n if (this.recoveringFromLoanExpiry) {\n // Only now is it safe to re-initialize BookReader, not for a\n // routine top-up, where that would be disruptive. Call it\n // directly rather than waiting on a confirming create_token\n // success: BookLoanService::attempt_to_renew_loan() already\n // minted a valid access token as part of this renew_loan\n // response, so there's nothing left to confirm.\n this.lendingBarPostInit();\n this.postInitComplete = true;\n }\n\n const currStatus = {\n ...this.lendingStatus,\n user_has_browsed: true,\n browsingExpired: false,\n secondsLeftOnLoan: secondsLeft,\n };\n this.lendingStatus = currStatus;\n\n // close the modal\n this.modal?.closeModal();\n if (this.modal) {\n this.modal.removeAttribute('id');\n this.modal.customModalContent = undefined;\n }\n this.sentryCaptureMsg(sentryLogs.bookHasRenewed, 'renew_loan');\n this.warningModalDismissed = false;\n }\n\n this.warningModalOpen = false;\n this.loanRenewInProgress = false;\n }\n\n /** Start the countdown interval; ticks read the live secondsLeftOnLoan\n * each time rather than a value frozen at start, so drift can't compound\n * across ticks (see loanStatusCheckInterval). */\n async startTimerCountdown(): Promise<void> {\n window?.IALendingIntervals?.clearTimerCountdown();\n this.timeWhenTimerStart = new Date();\n\n window.IALendingIntervals.timerCountdown = setInterval(async () => {\n await this.loanStatusCheckInterval(\n Number(this.lendingStatus.secondsLeftOnLoan),\n );\n }, this.timerExecutionSeconds * 1000);\n }\n\n /**\n * Runs on every countdown tick: resyncs against wall-clock time, attempts\n * a renewal near expiry, and clears the timers once the loan expires.\n * @param secondsLeftOnLoan\n */\n async loanStatusCheckInterval(secondsLeftOnLoan: number): Promise<void> {\n let secondsLeft = secondsLeftOnLoan;\n secondsLeft -= this.timerExecutionSeconds;\n secondsLeft = Math.round(secondsLeft);\n\n const resyncd = this.reSyncTimerIfGoneOff(secondsLeft);\n if (resyncd.hasSynced) {\n secondsLeft = resyncd.whatShouldLeft;\n log.debug('timer: timer re-synced', { secondsLeft });\n }\n\n log.debug('timer', {\n whatShouldLeft: resyncd.whatShouldLeft,\n whatIsleft: secondsLeft,\n });\n\n // Re-anchor every tick so drift from wall-clock time can't compound\n // across ticks that don't happen to trigger a resync above.\n this.timeWhenTimerStart = new Date();\n this.lendingStatus = {\n ...this.lendingStatus,\n secondsLeftOnLoan: secondsLeft,\n };\n\n // 10 minutes out: start checking for a renewal. 0: show the \"about to\n // auto-return\" warning. @see IABookActions::bindLoanRenewEvents\n if (secondsLeft <= this.loanRenewTimeConfig.loanRenewAtLast) {\n await this.loanRenewAttempt(secondsLeft);\n }\n\n if (secondsLeft <= this.timerExecutionSeconds) {\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.sentryCaptureMsg(sentryLogs.clearOneHourTimer);\n }\n }\n\n /**\n * helper function to determine if timer is not in sync properly\n *\n * @param timerSecondsLeft actual seconds left get from setInterval\n * @returns { hasSynced: [boolean], whatShouldLeft: [number] }\n */\n reSyncTimerIfGoneOff(timerSecondsLeft: number): {\n hasSynced: boolean;\n whatShouldLeft: number;\n } {\n const currentTime = new Date();\n\n // No prior anchor to compare against -- e.g. visibilitychange calling\n // loanStatusCheckInterval() directly before startTimerCountdown() ever\n // ran, which setupLendingToolbarActions() skips while a renewal is\n // in flight. Nothing to resync yet; anchor now and report no drift.\n if (!this.timeWhenTimerStart) {\n this.timeWhenTimerStart = currentTime;\n return { hasSynced: false, whatShouldLeft: Math.round(timerSecondsLeft) };\n }\n\n // current time - loan time\n const diffInSeconds =\n currentTime.getTime() / 1000 - this.timeWhenTimerStart.getTime() / 1000;\n\n const secondsShouldLeft =\n Number(this.lendingStatus.secondsLeftOnLoan) - diffInSeconds;\n\n // convert in minutes\n const whatIsleft = Math.round(timerSecondsLeft);\n const whatShouldLeft = Math.round(secondsShouldLeft);\n const timerElSeconds = this.timerCountdownEl!.secondsLeftOnLoan || 0;\n\n if (timerElSeconds !== whatShouldLeft || whatIsleft !== whatShouldLeft) {\n // set lending status with new time to update decrementor\n const currStatus = {\n ...this.lendingStatus,\n secondsLeftOnLoan: whatShouldLeft,\n };\n this.lendingStatus = currStatus;\n }\n\n if (whatIsleft !== whatShouldLeft) {\n log.debug(\n `reSyncTimerIfGoneOff ${whatIsleft} - ${whatShouldLeft}: re-syncing timer`,\n );\n return { hasSynced: true, whatShouldLeft };\n }\n\n return { hasSynced: false, whatShouldLeft };\n }\n\n /**\n * attmept to loan renew from\n * - timer countdown\n * - onclick on [keep reading] button\n *\n * @param secondsLeft\n */\n async loanRenewAttempt(secondsLeft: number): Promise<void> {\n let loanSecondsLeft = secondsLeft;\n // Under 50s left there isn't enough time for the renew_loan round-trip\n // and create_token to load images, so just expire the loan.\n if (loanSecondsLeft < 50) {\n log.debug('loanRenewAttempt: < 50s left, expiring loan');\n await this.browseHasExpired();\n return;\n }\n\n await this.autoLoanRenewChecker(false);\n\n // Once dismissed, don't re-show the warning on every subsequent tick.\n // Only an actual renewal (handleLoanAutoRenewed) re-arms it.\n if (\n this.loanRenewResult.renewNow === false &&\n !this.warningModalDismissed\n ) {\n // Compensate for the 50s buffer above by warning a minute early.\n loanSecondsLeft -= 60;\n this.loanRenewResult.secondsLeft = loanSecondsLeft;\n\n this.showWarningModal();\n }\n }\n\n /**\n * enable access of borrowed/browsed books\n * @param skipInitialCall see LoanTokenPoller's constructor doc\n * @see LoanTokenPoller\n */\n startLoanTokenPoller(skipInitialCall = false): void {\n const successCallback = () => {\n if (!this.postInitComplete) {\n this.lendingBarPostInit();\n }\n this.postInitComplete = true;\n };\n const errorCallback = (eventObj: LendingActionErrorEventLike) => {\n this.handleLendingActionError(eventObj);\n };\n\n // Tear down any previous poller first, so only one is ever controlling\n // window.IALendingIntervals.tokenPoller at a time.\n this.tokenPoller?.disconnectedCallback();\n this.tokenPoller = new LoanTokenPoller({\n identifier: this.identifier,\n borrowType: this.borrowType,\n successCallback,\n errorCallback,\n pollerDelay: this.tokenDelay, // in seconds\n skipInitialCall,\n fetchHandler: this.fetchHandler,\n });\n }\n\n /*\n * custom event handler to toggle action group visibility\n *\n * @event IABookActions#toggleActionGroup\n */\n handleToggleActionGroup(): void {\n this.disableActionGroup = !this.disableActionGroup;\n }\n\n /**\n * Handles lending errors from any action (browse_book, borrow_book,\n * create_token, renew_loan, etc).\n * @event IABookActions#lendingActionError\n * @param event\n * @param event.detail.action\n * @param event.detail.data.error\n */\n handleLendingActionError(event?: LendingActionErrorEventLike): void {\n this.disableActionGroup = false;\n\n const action = event?.detail?.action;\n // handleLoanRenewNow's failure path sets `.error` to a boolean flag and\n // puts the real text in `.message`. Only take `.error` when it's\n // actually a string, or the modal renders the literal word \"true\".\n const rawErrorMsg = event?.detail?.data?.error;\n const errorMsg = typeof rawErrorMsg === 'string' ? rawErrorMsg : undefined;\n const isInitial = event?.detail?.isInitial === true;\n const eventData = event?.detail?.data;\n const consecutiveFailures = event?.detail?.consecutiveFailures ?? 1;\n\n log.warn('handleLendingActionError', {\n identifier: this.identifier,\n action,\n errorMsg,\n isInitial,\n loanRenewInProgress: this.loanRenewInProgress,\n recoveringFromLoanExpiry: this.recoveringFromLoanExpiry,\n });\n\n if (\n action === 'create_token' &&\n !isInitial &&\n (eventData?.nonJsonResponse === true ||\n eventData?.networkFailure === true) &&\n consecutiveFailures <= MAX_SILENT_TOKEN_REFRESH_FAILURES\n ) {\n // The service never answered this routine refresh: something in\n // front of it did (the WAF's /about/400.html, an outage page), or the\n // request never got through. That says nothing about the loan, so\n // no modal and no session teardown. It's already reported to Sentry\n // (ActionsHandlerService/LoanTokenPoller), the current access token\n // keeps the book readable, and the poll interval is left running, so\n // the next tick tries again. The service's own answer (e.g. \"You do\n // not currently have this book borrowed.\") still falls through below.\n //\n // Not for the initial call: its success is what runs\n // lendingBarPostInit() and opens the book (see startLoanTokenPoller),\n // so suppressing it would leave a reader that never loads, silently.\n //\n // And not forever: past MAX_SILENT_TOKEN_REFRESH_FAILURES in a row,\n // the last good access token is about to expire, so fall through to\n // the modal rather than let the reader break with nothing shown.\n log.warn(\n 'create_token routine refresh got no answer from the service, no modal',\n {\n identifier: this.identifier,\n status: eventData?.status,\n errorMsg,\n },\n );\n return;\n }\n\n if (action === 'create_token') {\n // Any other create_token failure (initial, or a routine refresh the\n // service itself answered) means access can no longer be confirmed (e.g. a stale loan-record\n // cache on some other node can make this request fail even though\n // the loan is fine, or the loan may genuinely have just been\n // returned via BookReaderImages.php's revokeAccess()). Don't retry\n // and don't stay silent either way: reset the bar to Borrow and the\n // timer to 0 rather than leaving a stale countdown for a session\n // that isn't accessible.\n window?.IALendingIntervals?.clearAll();\n this.tokenPoller?.disconnectedCallback();\n this.tokenAccessLost = true;\n this.lendingStatus = {\n ...this.lendingStatus,\n user_has_browsed: false,\n available_to_browse: true,\n secondsLeftOnLoan: 0,\n };\n\n // showErrorModal has dedicated create_token messaging (refresh\n // button + support email) and shows regardless of whether a\n // specific error string came back.\n this.showErrorModal(errorMsg, action);\n } else if (action === 'renew_loan') {\n window?.IALendingIntervals?.clearAll();\n this.loanRenewInProgress = false;\n this.recoveringFromLoanExpiry = false;\n\n // The loan was NOT renewed, so reflect that immediately (show Borrow,\n // clear the stale timer) instead of leaving a frozen \"Return now\".\n this.lendingStatus = {\n ...this.lendingStatus,\n user_has_browsed: false,\n available_to_browse: true,\n secondsLeftOnLoan: 0,\n };\n\n // Refresh the page on dismissal so the client picks up whatever the\n // server now authoritatively considers true (any error message).\n this.showLoanUnavailableModal(errorMsg);\n } else {\n // Every other action failure genuinely affects loan state.\n window?.IALendingIntervals?.clearAll();\n\n if (!errorMsg) return;\n\n this.showErrorModal(errorMsg, action);\n\n // update action bar state if book is not available to browse or borrow.\n if (errorMsg.match(/not available to borrow/gm)) {\n if (action === 'browse_book') {\n this.lendingStatus = {\n ...this.lendingStatus,\n available_to_browse: false,\n };\n } else if (action === 'borrow_book') {\n this.lendingStatus = {\n ...this.lendingStatus,\n available_to_borrow: false,\n };\n }\n }\n }\n }\n\n /* show error message if something went wrong */\n async showErrorModal(errorMsg?: string, action?: string): Promise<void> {\n await ensureModalManager();\n const modalConfig = new ModalConfig({\n title: html`${msg('Lending error')}`,\n message: errorMsg ? html`${errorMsg}` : undefined,\n headerColor: '#d9534f',\n showCloseButton: true,\n });\n\n if (action === 'create_token') {\n const refreshButton = html`<button\n style=\"${modalButtonStyle.refresh}\"\n @click=${() =>\n // Firefox's non-standard `forceGet` argument skips the cache\n (\n window.location as Location & { reload(forceGet?: boolean): void }\n ).reload(true)}\n >\n refresh\n </button>`;\n\n modalConfig.message = html` Uh oh, something went wrong trying to access\n this book.<br />\n Please ${refreshButton} to try again or send us an email to\n <a\n href=\"mailto:info@archive.org?subject=Help: cannot access my borrowed book: ${this\n .identifier}\"\n >info@archive.org</a\n ><br /><br />\n ${errorMsg ? html`<code>errorLog: ${errorMsg}</code>` : nothing}`;\n }\n\n await this.modal?.showModal({\n config: modalConfig,\n });\n }\n\n get iconClass(): 'mobile' | 'desktop' {\n return this.width <= mobileContainerWidth ? 'mobile' : 'desktop';\n }\n\n get textClass(): 'visible' | 'hidden' {\n return this.width >= mobileContainerWidth ? 'visible' : 'hidden';\n }\n\n get infoIconTemplate(): TemplateResult {\n return html`<ia-book-actions-info-icon\n iconClass=${this.iconClass}\n ></ia-book-actions-info-icon>`;\n }\n\n get textGroupTemplate(): TemplateResult | typeof nothing {\n return this.primaryTitle\n ? html`<ia-book-actions-text-group\n textClass=${this.textClass}\n .texts=${this.primaryTitle}\n >\n </ia-book-actions-text-group>`\n : nothing;\n }\n\n get hasAdminAccess(): boolean | undefined {\n return !this.lendingStatus.userHasBorrowed && this.lendingStatus.isAdmin;\n }\n\n static get styles(): CSSResultGroup {\n return css`\n :host {\n display: block;\n }\n\n .hide {\n display: none;\n }\n\n .lending-wrapper {\n width: 100%;\n margin: 0 auto;\n background: var(--primaryBGColor, #000);\n color: var(--primaryTextColor, #fff);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex-wrap: wrap;\n }\n\n #action-bar-modal {\n --modalWidth: 36rem;\n }\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'ia-book-actions': IABookActions;\n }\n}\n\nexport default IABookActions;\n"]}
|
|
@@ -3,44 +3,57 @@ import '../ia-status-indicator/ia-status-indicator.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Renders a standardized button built off the ia-button styling and the activity indicator, with the option to show
|
|
5
5
|
* a loading indicator instead of the text or to customize the text, and the ability to pass in any
|
|
6
|
-
* function to run on click.
|
|
7
|
-
*
|
|
8
|
-
* A disabled or loading button stays in the tab order (`aria-disabled`)
|
|
9
|
-
* and swallows its own clicks, so neither a listener on the element nor a
|
|
10
|
-
* form submission sees them. With `href`, it renders a link styled as a button.
|
|
6
|
+
* function to run on click.
|
|
11
7
|
*
|
|
12
8
|
* Designed to behave exactly like a native type="submit" or type="reset" button if either type is supplied,
|
|
13
9
|
* i.e. for an <ia-button type="submit" @click=${doSideEffects}></ia-button>,
|
|
14
10
|
* whether the form is submitted via enter or by clicking the button directly, the button will always
|
|
15
11
|
* run doSideEffects() and then submit the form.
|
|
12
|
+
*
|
|
13
|
+
* The inner `<button>` takes focus, so that's where its role and ARIA state
|
|
14
|
+
* belong. Set them with the `role`, `ariaChecked`, `ariaDisabled`,
|
|
15
|
+
* `ariaHasPopup`, `ariaExpanded` and `ariaBusy` properties, e.g.
|
|
16
|
+
* `<ia-button .role=${'menuitemcheckbox'} .ariaChecked=${'false'}>`. These
|
|
17
|
+
* shadow the native ARIA reflection properties, so nothing lands on the host
|
|
18
|
+
* and a screen reader hears the role or state once. `null`, `undefined` and
|
|
19
|
+
* `''` leave an attribute off; anything else, `false` included, is set as a
|
|
20
|
+
* string. Note:
|
|
21
|
+
* - A `role` or `aria-*` *attribute* written on `<ia-button>` stays on the
|
|
22
|
+
* host, as before, and these properties don't read it back: with
|
|
23
|
+
* `<ia-button aria-disabled="true">`, `ariaDisabled` is `null`.
|
|
24
|
+
* - Set them once `ia-button` is defined. Before that, the native setter
|
|
25
|
+
* writes the attribute onto the host instead.
|
|
26
|
+
*
|
|
27
|
+
* `description` becomes the inner button's accessible description, e.g.
|
|
28
|
+
* "List full". It isn't part of the button's name.
|
|
29
|
+
*
|
|
30
|
+
* Focus is delegated, so `focus()` on `<ia-button>` focuses the inner button.
|
|
31
|
+
* With `href`, the wrapping link is the first thing that can take focus, so
|
|
32
|
+
* it takes it instead; the ARIA properties and description stay on the
|
|
33
|
+
* button.
|
|
16
34
|
*/
|
|
17
35
|
export declare class IAButton extends LitElement {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
* use `'ghost'`. It still renders as `'ghost'`, and logs a console warning
|
|
21
|
-
* once per page.
|
|
22
|
-
*/
|
|
23
|
-
mode: 'primary' | 'secondary' | 'danger' | 'warning' | 'donate' | 'disabled' | 'ghost' | 'transparent' | 'custom' | 'link' | 'danger-link';
|
|
24
|
-
size: 'sm' | 'md' | 'lg';
|
|
36
|
+
static shadowRootOptions: ShadowRootInit;
|
|
37
|
+
mode: 'primary' | 'secondary' | 'danger' | 'warning' | 'disabled' | 'transparent' | 'custom' | 'link' | 'danger-link';
|
|
25
38
|
loading: boolean;
|
|
26
39
|
disabled: boolean;
|
|
27
40
|
loadingText: string;
|
|
28
41
|
type: 'button' | 'submit' | 'reset';
|
|
29
42
|
href?: string;
|
|
30
43
|
openLinksNewTab: boolean;
|
|
44
|
+
role: string | null;
|
|
45
|
+
ariaChecked: string | null;
|
|
46
|
+
ariaDisabled: string | null;
|
|
47
|
+
ariaHasPopup: string | null;
|
|
48
|
+
ariaExpanded: string | null;
|
|
49
|
+
ariaBusy: string | null;
|
|
50
|
+
description: string;
|
|
31
51
|
render(): TemplateResult;
|
|
32
52
|
protected willUpdate(changed: PropertyValues): void;
|
|
33
|
-
private get inactive();
|
|
34
|
-
private get classes();
|
|
35
53
|
private get buttonTemplate();
|
|
36
|
-
private get
|
|
37
|
-
private get
|
|
54
|
+
private get descriptionTemplate();
|
|
55
|
+
private get buttonTextTemplate();
|
|
38
56
|
private get loadingStateTemplate();
|
|
39
|
-
/**
|
|
40
|
-
* A disabled or loading button stays focusable, so it gets clicks. Stopped
|
|
41
|
-
* here, they never reach a listener on the element or the form.
|
|
42
|
-
*/
|
|
43
|
-
private handleInactiveClick;
|
|
44
57
|
/** Sets up or removes button type emulation as needed */
|
|
45
58
|
private setButtonTypeEmulation;
|
|
46
59
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ia-button.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-button/ia-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,
|
|
1
|
+
{"version":3,"file":"ia-button.d.ts","sourceRoot":"","sources":["../../../../src/elements/ia-button/ia-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,cAAc,EACd,cAAc,EAGd,cAAc,EAEf,MAAM,KAAK,CAAC;AAKb,OAAO,4CAA4C,CAAC;AAapD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,MAAM,CAAC,iBAAiB,EAAE,cAAc,CAGtC;IAG0B,IAAI,EAC5B,SAAS,GACT,WAAW,GACX,QAAQ,GACR,SAAS,GAC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