@internetarchive/collection-browser 0.3.3 → 0.3.5-alpha.1
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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +26 -26
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +43 -43
- package/dist/src/app-root.js +233 -233
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/collection-browser.d.ts +245 -247
- package/dist/src/collection-browser.js +1359 -1396
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -0
- package/dist/src/collection-facets/facet-tombstone-row.js +43 -0
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -0
- package/dist/src/collection-facets/facets-template.d.ts +16 -16
- package/dist/src/collection-facets/facets-template.js +125 -125
- package/dist/src/collection-facets/more-facets-content.d.ts +76 -76
- package/dist/src/collection-facets/more-facets-content.js +353 -349
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +192 -192
- package/dist/src/collection-facets.d.ts +77 -75
- package/dist/src/collection-facets.js +551 -518
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +11 -11
- package/dist/src/empty-placeholder.js +42 -42
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +85 -85
- package/dist/src/models.d.ts +102 -97
- package/dist/src/models.js +117 -100
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +45 -45
- package/dist/src/restoration-state-handler.js +220 -220
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +9 -9
- package/dist/src/sort-filter-bar/alpha-bar.js +41 -41
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +107 -107
- package/dist/src/sort-filter-bar/sort-filter-bar.js +423 -423
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +10 -9
- package/dist/src/styles/item-image-styles.js.map +1 -1
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/grid/account-tile.d.ts +8 -8
- package/dist/src/tiles/grid/account-tile.js +20 -20
- package/dist/src/tiles/grid/collection-tile.d.ts +7 -7
- package/dist/src/tiles/grid/collection-tile.js +23 -23
- package/dist/src/tiles/grid/item-tile.d.ts +24 -24
- package/dist/src/tiles/grid/item-tile.js +87 -87
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -10
- package/dist/src/tiles/grid/tile-stats.js +35 -35
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +69 -69
- package/dist/src/tiles/item-image.d.ts +31 -31
- package/dist/src/tiles/item-image.js +103 -103
- package/dist/src/tiles/list/account-label.d.ts +1 -1
- package/dist/src/tiles/list/account-label.js +6 -6
- package/dist/src/tiles/list/date-label.d.ts +1 -1
- package/dist/src/tiles/list/date-label.js +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.js +41 -41
- package/dist/src/tiles/list/tile-list-compact.d.ts +20 -20
- package/dist/src/tiles/list/tile-list-compact.js +87 -87
- package/dist/src/tiles/list/tile-list.d.ts +50 -50
- package/dist/src/tiles/list/tile-list.js +269 -264
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/overlay/icon-overlay.d.ts +7 -7
- package/dist/src/tiles/overlay/icon-overlay.js +30 -30
- package/dist/src/tiles/overlay/text-overlay.d.ts +8 -8
- package/dist/src/tiles/overlay/text-overlay.js +31 -31
- package/dist/src/tiles/text-snippet-block.d.ts +29 -29
- package/dist/src/tiles/text-snippet-block.js +81 -81
- package/dist/src/tiles/tile-dispatcher.d.ts +36 -36
- package/dist/src/tiles/tile-dispatcher.js +128 -128
- package/dist/src/utils/analytics-events.d.ts +22 -22
- package/dist/src/utils/analytics-events.js +24 -24
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +23 -23
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +415 -359
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +62 -62
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +114 -114
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +498 -469
- package/dist/test/collection-facets.test.js.map +1 -1
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +33 -33
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +56 -56
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-collection-name-cache.d.ts +7 -7
- package/dist/test/mocks/mock-collection-name-cache.js +13 -13
- package/dist/test/mocks/mock-search-responses.d.ts +8 -5
- package/dist/test/mocks/mock-search-responses.js +198 -103
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.d.ts +13 -13
- package/dist/test/mocks/mock-search-service.js +32 -25
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +117 -117
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +113 -113
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +41 -41
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +33 -33
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +107 -107
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +26 -26
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +53 -36
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- package/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +115 -115
- package/renovate.json +6 -6
- package/src/collection-browser.ts +1488 -1523
- package/src/collection-facets/facet-tombstone-row.ts +40 -0
- package/src/collection-facets/more-facets-content.ts +8 -4
- package/src/collection-facets.ts +635 -597
- package/src/models.ts +18 -0
- package/src/styles/item-image-styles.ts +1 -0
- package/src/tiles/list/tile-list.ts +14 -10
- package/test/collection-browser.test.ts +599 -513
- package/test/collection-facets.test.ts +39 -0
- package/test/mocks/mock-search-responses.ts +226 -119
- package/test/mocks/mock-search-service.ts +61 -53
- package/test/tiles/list/tile-list.test.ts +21 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -1,1397 +1,1360 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
/* eslint-disable import/no-duplicates */
|
|
3
|
-
import { html, css, LitElement, nothing, } from 'lit';
|
|
4
|
-
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
5
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
-
import { SearchType, } from '@internetarchive/search-service';
|
|
7
|
-
import '@internetarchive/infinite-scroller';
|
|
8
|
-
import './tiles/tile-dispatcher';
|
|
9
|
-
import './tiles/collection-browser-loading-tile';
|
|
10
|
-
import './sort-filter-bar/sort-filter-bar';
|
|
11
|
-
import './collection-facets';
|
|
12
|
-
import './circular-activity-indicator';
|
|
13
|
-
import './sort-filter-bar/sort-filter-bar';
|
|
14
|
-
import { SortField, SortFieldToMetadataField, defaultSelectedFacets, } from './models';
|
|
15
|
-
import { RestorationStateHandler, } from './restoration-state-handler';
|
|
16
|
-
import chevronIcon from './assets/img/icons/chevron';
|
|
17
|
-
import { LanguageCodeHandler } from './language-code-handler/language-code-handler';
|
|
18
|
-
import './empty-placeholder';
|
|
19
|
-
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
20
|
-
let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.baseImageUrl = 'https://archive.org';
|
|
24
|
-
this.searchType = SearchType.METADATA;
|
|
25
|
-
this.sortParam = null;
|
|
26
|
-
this.selectedSort = SortField.relevance;
|
|
27
|
-
this.selectedTitleFilter = null;
|
|
28
|
-
this.selectedCreatorFilter = null;
|
|
29
|
-
this.sortDirection = null;
|
|
30
|
-
this.pageSize = 50;
|
|
31
|
-
this.showHistogramDatePicker = false;
|
|
32
|
-
/** describes where this component is being used */
|
|
33
|
-
this.searchContext = analyticsCategories.default;
|
|
34
|
-
this.pageContext = 'search';
|
|
35
|
-
this.restorationStateHandler = new RestorationStateHandler({
|
|
36
|
-
context: this.pageContext,
|
|
37
|
-
});
|
|
38
|
-
this.mobileBreakpoint = 600;
|
|
39
|
-
this.loggedIn = false;
|
|
40
|
-
this.modalManager = undefined;
|
|
41
|
-
/**
|
|
42
|
-
* If item management UI active
|
|
43
|
-
*/
|
|
44
|
-
this.isManageView = false;
|
|
45
|
-
/**
|
|
46
|
-
* The page that the consumer wants to load.
|
|
47
|
-
*/
|
|
48
|
-
this.initialPageNumber = 1;
|
|
49
|
-
/**
|
|
50
|
-
* This the the number of pages that we want to show.
|
|
51
|
-
*
|
|
52
|
-
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
53
|
-
* know how many cells we should render.
|
|
54
|
-
*/
|
|
55
|
-
this.pagesToRender = this.initialPageNumber;
|
|
56
|
-
this.searchResultsLoading = false;
|
|
57
|
-
this.facetsLoading = false;
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
*
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
*
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
//
|
|
88
|
-
|
|
89
|
-
this.
|
|
90
|
-
this
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
//
|
|
117
|
-
//
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
this.
|
|
140
|
-
this.
|
|
141
|
-
this.
|
|
142
|
-
this.
|
|
143
|
-
this.
|
|
144
|
-
this.
|
|
145
|
-
this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
this.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
this.placeholderType = 'null-result';
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
get emptyPlaceholderTemplate() {
|
|
178
|
-
return html `
|
|
179
|
-
<empty-placeholder
|
|
180
|
-
.placeholderType=${this.placeholderType}
|
|
181
|
-
?isMobileView=${this.mobileView}
|
|
182
|
-
></empty-placeholder>
|
|
183
|
-
`;
|
|
184
|
-
}
|
|
185
|
-
get collectionBrowserTemplate() {
|
|
186
|
-
return html `<div
|
|
187
|
-
id="left-column"
|
|
188
|
-
class="column${this.isResizeToMobile ? ' preload' : ''}"
|
|
189
|
-
>
|
|
190
|
-
<div id="mobile-header-container">
|
|
191
|
-
${this.mobileView ? this.mobileFacetsTemplate : nothing}
|
|
192
|
-
<div id="results-total">
|
|
193
|
-
<span id="big-results-count">
|
|
194
|
-
${this.totalResults !== undefined
|
|
195
|
-
? this.totalResults.toLocaleString()
|
|
196
|
-
: '-'}
|
|
197
|
-
</span>
|
|
198
|
-
<span id="big-results-label">
|
|
199
|
-
${this.totalResults === 1 ? 'Result' : 'Results'}
|
|
200
|
-
</span>
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
<div
|
|
204
|
-
id="facets-container"
|
|
205
|
-
class=${!this.mobileView || this.mobileFacetsVisible
|
|
206
|
-
? 'expanded'
|
|
207
|
-
: ''}
|
|
208
|
-
>
|
|
209
|
-
${this.facetsTemplate}
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
<div id="right-column" class="column">
|
|
213
|
-
${this.
|
|
214
|
-
${this.
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
.
|
|
225
|
-
|
|
226
|
-
@
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.
|
|
234
|
-
.
|
|
235
|
-
.
|
|
236
|
-
.
|
|
237
|
-
.
|
|
238
|
-
|
|
239
|
-
@
|
|
240
|
-
@
|
|
241
|
-
@
|
|
242
|
-
|
|
243
|
-
>
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
this.
|
|
251
|
-
this.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
this.displayMode
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
*
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
*
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
this.
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
this.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
this.
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
.
|
|
372
|
-
.
|
|
373
|
-
.
|
|
374
|
-
.
|
|
375
|
-
.
|
|
376
|
-
.
|
|
377
|
-
.
|
|
378
|
-
.
|
|
379
|
-
.
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
.
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<li>
|
|
420
|
-
<li>
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
changed.has('
|
|
461
|
-
changed.has('
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
changed.
|
|
466
|
-
this.
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
this.
|
|
471
|
-
this.
|
|
472
|
-
}
|
|
473
|
-
if (changed.has('
|
|
474
|
-
this.
|
|
475
|
-
this.
|
|
476
|
-
}
|
|
477
|
-
if (changed.has('
|
|
478
|
-
this.
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
*
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
this.
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
this.
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
this.
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
this.
|
|
575
|
-
this.
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
this.
|
|
597
|
-
this.
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
this.
|
|
603
|
-
this.
|
|
604
|
-
this.
|
|
605
|
-
this.
|
|
606
|
-
this.
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
let
|
|
647
|
-
const {
|
|
648
|
-
if (
|
|
649
|
-
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
const
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
//
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
if (
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
const
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
.
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
(
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
this.
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
.
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
width:
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
--
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
__decorate([
|
|
1361
|
-
state()
|
|
1362
|
-
], CollectionBrowser.prototype, "fullYearAggregationLoading", void 0);
|
|
1363
|
-
__decorate([
|
|
1364
|
-
state()
|
|
1365
|
-
], CollectionBrowser.prototype, "aggregations", void 0);
|
|
1366
|
-
__decorate([
|
|
1367
|
-
state()
|
|
1368
|
-
], CollectionBrowser.prototype, "fullYearsHistogramAggregation", void 0);
|
|
1369
|
-
__decorate([
|
|
1370
|
-
state()
|
|
1371
|
-
], CollectionBrowser.prototype, "previousSearchType", void 0);
|
|
1372
|
-
__decorate([
|
|
1373
|
-
state()
|
|
1374
|
-
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
1375
|
-
__decorate([
|
|
1376
|
-
state()
|
|
1377
|
-
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
1378
|
-
__decorate([
|
|
1379
|
-
state()
|
|
1380
|
-
], CollectionBrowser.prototype, "mobileFacetsVisible", void 0);
|
|
1381
|
-
__decorate([
|
|
1382
|
-
state()
|
|
1383
|
-
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
1384
|
-
__decorate([
|
|
1385
|
-
query('#content-container')
|
|
1386
|
-
], CollectionBrowser.prototype, "contentContainer", void 0);
|
|
1387
|
-
__decorate([
|
|
1388
|
-
property({ type: Object, attribute: false })
|
|
1389
|
-
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|
|
1390
|
-
__decorate([
|
|
1391
|
-
query('infinite-scroller')
|
|
1392
|
-
], CollectionBrowser.prototype, "infiniteScroller", void 0);
|
|
1393
|
-
CollectionBrowser = __decorate([
|
|
1394
|
-
customElement('collection-browser')
|
|
1395
|
-
], CollectionBrowser);
|
|
1396
|
-
export { CollectionBrowser };
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
/* eslint-disable import/no-duplicates */
|
|
3
|
+
import { html, css, LitElement, nothing, } from 'lit';
|
|
4
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
5
|
+
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
|
+
import { SearchType, } from '@internetarchive/search-service';
|
|
7
|
+
import '@internetarchive/infinite-scroller';
|
|
8
|
+
import './tiles/tile-dispatcher';
|
|
9
|
+
import './tiles/collection-browser-loading-tile';
|
|
10
|
+
import './sort-filter-bar/sort-filter-bar';
|
|
11
|
+
import './collection-facets';
|
|
12
|
+
import './circular-activity-indicator';
|
|
13
|
+
import './sort-filter-bar/sort-filter-bar';
|
|
14
|
+
import { SortField, SortFieldToMetadataField, defaultSelectedFacets, } from './models';
|
|
15
|
+
import { RestorationStateHandler, } from './restoration-state-handler';
|
|
16
|
+
import chevronIcon from './assets/img/icons/chevron';
|
|
17
|
+
import { LanguageCodeHandler } from './language-code-handler/language-code-handler';
|
|
18
|
+
import './empty-placeholder';
|
|
19
|
+
import { analyticsActions, analyticsCategories, } from './utils/analytics-events';
|
|
20
|
+
let CollectionBrowser = class CollectionBrowser extends LitElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super(...arguments);
|
|
23
|
+
this.baseImageUrl = 'https://archive.org';
|
|
24
|
+
this.searchType = SearchType.METADATA;
|
|
25
|
+
this.sortParam = null;
|
|
26
|
+
this.selectedSort = SortField.relevance;
|
|
27
|
+
this.selectedTitleFilter = null;
|
|
28
|
+
this.selectedCreatorFilter = null;
|
|
29
|
+
this.sortDirection = null;
|
|
30
|
+
this.pageSize = 50;
|
|
31
|
+
this.showHistogramDatePicker = false;
|
|
32
|
+
/** describes where this component is being used */
|
|
33
|
+
this.searchContext = analyticsCategories.default;
|
|
34
|
+
this.pageContext = 'search';
|
|
35
|
+
this.restorationStateHandler = new RestorationStateHandler({
|
|
36
|
+
context: this.pageContext,
|
|
37
|
+
});
|
|
38
|
+
this.mobileBreakpoint = 600;
|
|
39
|
+
this.loggedIn = false;
|
|
40
|
+
this.modalManager = undefined;
|
|
41
|
+
/**
|
|
42
|
+
* If item management UI active
|
|
43
|
+
*/
|
|
44
|
+
this.isManageView = false;
|
|
45
|
+
/**
|
|
46
|
+
* The page that the consumer wants to load.
|
|
47
|
+
*/
|
|
48
|
+
this.initialPageNumber = 1;
|
|
49
|
+
/**
|
|
50
|
+
* This the the number of pages that we want to show.
|
|
51
|
+
*
|
|
52
|
+
* The data isn't necessarily loaded for all of the pages, but this lets us
|
|
53
|
+
* know how many cells we should render.
|
|
54
|
+
*/
|
|
55
|
+
this.pagesToRender = this.initialPageNumber;
|
|
56
|
+
this.searchResultsLoading = false;
|
|
57
|
+
this.facetsLoading = false;
|
|
58
|
+
this.fullYearAggregationLoading = false;
|
|
59
|
+
this.mobileView = false;
|
|
60
|
+
this.mobileFacetsVisible = false;
|
|
61
|
+
this.placeholderType = null;
|
|
62
|
+
this.languageCodeHandler = new LanguageCodeHandler();
|
|
63
|
+
/**
|
|
64
|
+
* When we're animated scrolling to the page, we don't want to fetch
|
|
65
|
+
* all of the pages as it scrolls so this lets us know if we're scrolling
|
|
66
|
+
*/
|
|
67
|
+
this.isScrollingToCell = false;
|
|
68
|
+
/**
|
|
69
|
+
* When we've reached the end of the data, stop trying to fetch more
|
|
70
|
+
*/
|
|
71
|
+
this.endOfDataReached = false;
|
|
72
|
+
/**
|
|
73
|
+
* When page width resizes from desktop to mobile, set true to
|
|
74
|
+
* disable expand/collapse transition when loading.
|
|
75
|
+
*/
|
|
76
|
+
this.isResizeToMobile = false;
|
|
77
|
+
this.placeholderCellTemplate = html `<collection-browser-loading-tile></collection-browser-loading-tile>`;
|
|
78
|
+
/**
|
|
79
|
+
* The results per page so we can paginate.
|
|
80
|
+
*
|
|
81
|
+
* This allows us to start in the middle of the search results and
|
|
82
|
+
* fetch data before or after the current page. If we don't have a key
|
|
83
|
+
* for the previous/next page, we'll fetch the next/previous page to populate it
|
|
84
|
+
*/
|
|
85
|
+
this.dataSource = {};
|
|
86
|
+
// we only want to scroll on the very first query change
|
|
87
|
+
// so this keeps track of whether we've already set the initial query
|
|
88
|
+
this.initialQueryChangeHappened = false;
|
|
89
|
+
this.historyPopOccurred = false;
|
|
90
|
+
// this maps the query to the pages being fetched for that query
|
|
91
|
+
this.pageFetchesInProgress = {};
|
|
92
|
+
}
|
|
93
|
+
tileModelAtCellIndex(index) {
|
|
94
|
+
var _a;
|
|
95
|
+
const pageNumber = Math.floor(index / this.pageSize) + 1;
|
|
96
|
+
const itemIndex = index % this.pageSize;
|
|
97
|
+
const model = (_a = this.dataSource[pageNumber]) === null || _a === void 0 ? void 0 : _a[itemIndex];
|
|
98
|
+
/**
|
|
99
|
+
* If we encounter a model we don't have yet and we're not in the middle of an
|
|
100
|
+
* automated scroll, fetch the page and just return undefined.
|
|
101
|
+
* The datasource will be updated once the page is loaded and the cell will be rendered.
|
|
102
|
+
*
|
|
103
|
+
* We disable it during the automated scroll since we may fetch pages for cells the
|
|
104
|
+
* user may never see.
|
|
105
|
+
*/
|
|
106
|
+
if (!model && !this.isScrollingToCell) {
|
|
107
|
+
this.fetchPage(pageNumber);
|
|
108
|
+
}
|
|
109
|
+
return model;
|
|
110
|
+
}
|
|
111
|
+
get sortFilterQueries() {
|
|
112
|
+
const queries = [this.titleQuery, this.creatorQuery];
|
|
113
|
+
return queries.filter(q => q).join(' AND ');
|
|
114
|
+
}
|
|
115
|
+
// this is the total number of tiles we expect if
|
|
116
|
+
// the data returned is a full page worth
|
|
117
|
+
// this is useful for putting in placeholders for the expected number of tiles
|
|
118
|
+
get estimatedTileCount() {
|
|
119
|
+
return this.pagesToRender * this.pageSize;
|
|
120
|
+
}
|
|
121
|
+
// this is the actual number of tiles in the datasource,
|
|
122
|
+
// which is useful for removing excess placeholder tiles
|
|
123
|
+
// once we reached the end of the data
|
|
124
|
+
get actualTileCount() {
|
|
125
|
+
return Object.keys(this.dataSource).reduce((acc, page) => acc + this.dataSource[page].length, 0);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Go to the given page of results
|
|
129
|
+
*
|
|
130
|
+
* @param pageNumber
|
|
131
|
+
*/
|
|
132
|
+
goToPage(pageNumber) {
|
|
133
|
+
this.initialPageNumber = pageNumber;
|
|
134
|
+
this.pagesToRender = pageNumber;
|
|
135
|
+
this.scrollToPage(pageNumber);
|
|
136
|
+
}
|
|
137
|
+
clearFilters() {
|
|
138
|
+
this.selectedFacets = defaultSelectedFacets;
|
|
139
|
+
this.sortParam = null;
|
|
140
|
+
this.selectedTitleFilter = null;
|
|
141
|
+
this.selectedCreatorFilter = null;
|
|
142
|
+
this.titleQuery = undefined;
|
|
143
|
+
this.creatorQuery = undefined;
|
|
144
|
+
this.selectedSort = SortField.relevance;
|
|
145
|
+
this.sortDirection = null;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Manually requests to perform a search, which will only be executed if one of
|
|
149
|
+
* the query, the search type, or the sort has changed.
|
|
150
|
+
*/
|
|
151
|
+
requestSearch() {
|
|
152
|
+
this.handleQueryChange();
|
|
153
|
+
}
|
|
154
|
+
render() {
|
|
155
|
+
this.setPlaceholderType();
|
|
156
|
+
return html `
|
|
157
|
+
<div
|
|
158
|
+
id="content-container"
|
|
159
|
+
class=${this.mobileView ? 'mobile' : 'desktop'}
|
|
160
|
+
>
|
|
161
|
+
${this.placeholderType
|
|
162
|
+
? this.emptyPlaceholderTemplate
|
|
163
|
+
: this.collectionBrowserTemplate}
|
|
164
|
+
</div>
|
|
165
|
+
`;
|
|
166
|
+
}
|
|
167
|
+
setPlaceholderType() {
|
|
168
|
+
this.placeholderType = null;
|
|
169
|
+
if (!this.baseQuery) {
|
|
170
|
+
this.placeholderType = 'empty-query';
|
|
171
|
+
}
|
|
172
|
+
if ((!this.searchResultsLoading && this.totalResults === 0) ||
|
|
173
|
+
!this.searchService) {
|
|
174
|
+
this.placeholderType = 'null-result';
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
get emptyPlaceholderTemplate() {
|
|
178
|
+
return html `
|
|
179
|
+
<empty-placeholder
|
|
180
|
+
.placeholderType=${this.placeholderType}
|
|
181
|
+
?isMobileView=${this.mobileView}
|
|
182
|
+
></empty-placeholder>
|
|
183
|
+
`;
|
|
184
|
+
}
|
|
185
|
+
get collectionBrowserTemplate() {
|
|
186
|
+
return html `<div
|
|
187
|
+
id="left-column"
|
|
188
|
+
class="column${this.isResizeToMobile ? ' preload' : ''}"
|
|
189
|
+
>
|
|
190
|
+
<div id="mobile-header-container">
|
|
191
|
+
${this.mobileView ? this.mobileFacetsTemplate : nothing}
|
|
192
|
+
<div id="results-total">
|
|
193
|
+
<span id="big-results-count">
|
|
194
|
+
${this.totalResults !== undefined
|
|
195
|
+
? this.totalResults.toLocaleString()
|
|
196
|
+
: '-'}
|
|
197
|
+
</span>
|
|
198
|
+
<span id="big-results-label">
|
|
199
|
+
${this.totalResults === 1 ? 'Result' : 'Results'}
|
|
200
|
+
</span>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
<div
|
|
204
|
+
id="facets-container"
|
|
205
|
+
class=${!this.mobileView || this.mobileFacetsVisible
|
|
206
|
+
? 'expanded'
|
|
207
|
+
: ''}
|
|
208
|
+
>
|
|
209
|
+
${this.facetsTemplate}
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
<div id="right-column" class="column">
|
|
213
|
+
${this.sortFilterBarTemplate}
|
|
214
|
+
${this.displayMode === `list-compact`
|
|
215
|
+
? this.listHeaderTemplate
|
|
216
|
+
: nothing}
|
|
217
|
+
${this.infiniteScrollerTemplate}
|
|
218
|
+
</div>`;
|
|
219
|
+
}
|
|
220
|
+
get infiniteScrollerTemplate() {
|
|
221
|
+
return html `<infinite-scroller
|
|
222
|
+
class="${ifDefined(this.displayMode)}"
|
|
223
|
+
.cellProvider=${this}
|
|
224
|
+
.placeholderCellTemplate=${this.placeholderCellTemplate}
|
|
225
|
+
@scrollThresholdReached=${this.scrollThresholdReached}
|
|
226
|
+
@visibleCellsChanged=${this.visibleCellsChanged}
|
|
227
|
+
></infinite-scroller>`;
|
|
228
|
+
}
|
|
229
|
+
get sortFilterBarTemplate() {
|
|
230
|
+
return html `
|
|
231
|
+
<sort-filter-bar
|
|
232
|
+
.selectedSort=${this.selectedSort}
|
|
233
|
+
.sortDirection=${this.sortDirection}
|
|
234
|
+
.displayMode=${this.displayMode}
|
|
235
|
+
.selectedTitleFilter=${this.selectedTitleFilter}
|
|
236
|
+
.selectedCreatorFilter=${this.selectedCreatorFilter}
|
|
237
|
+
.resizeObserver=${this.resizeObserver}
|
|
238
|
+
@sortChanged=${this.userChangedSort}
|
|
239
|
+
@displayModeChanged=${this.displayModeChanged}
|
|
240
|
+
@titleLetterChanged=${this.titleLetterSelected}
|
|
241
|
+
@creatorLetterChanged=${this.creatorLetterSelected}
|
|
242
|
+
>
|
|
243
|
+
</sort-filter-bar>
|
|
244
|
+
`;
|
|
245
|
+
}
|
|
246
|
+
userChangedSort(e) {
|
|
247
|
+
var _a;
|
|
248
|
+
const { selectedSort, sortDirection } = e.detail;
|
|
249
|
+
this.selectedSort = selectedSort;
|
|
250
|
+
this.sortDirection = sortDirection;
|
|
251
|
+
if (((_a = this.currentPage) !== null && _a !== void 0 ? _a : 1) > 1) {
|
|
252
|
+
this.goToPage(1);
|
|
253
|
+
}
|
|
254
|
+
this.currentPage = 1;
|
|
255
|
+
}
|
|
256
|
+
sendSortByAnalytics(prevSortDirection) {
|
|
257
|
+
var _a;
|
|
258
|
+
const directionCleared = prevSortDirection && !this.sortDirection;
|
|
259
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
260
|
+
category: this.searchContext,
|
|
261
|
+
action: analyticsActions.sortBy,
|
|
262
|
+
label: `${this.selectedSort}${this.sortDirection || directionCleared ? `-${this.sortDirection}` : ''}`,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
selectedSortChanged() {
|
|
266
|
+
if (this.selectedSort === 'relevance' || this.sortDirection === null) {
|
|
267
|
+
this.sortParam = null;
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const sortField = SortFieldToMetadataField[this.selectedSort];
|
|
271
|
+
if (!sortField)
|
|
272
|
+
return;
|
|
273
|
+
this.sortParam = { field: sortField, direction: this.sortDirection };
|
|
274
|
+
}
|
|
275
|
+
displayModeChanged(e) {
|
|
276
|
+
var _a;
|
|
277
|
+
this.displayMode = e.detail.displayMode;
|
|
278
|
+
if (this.displayMode) {
|
|
279
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
280
|
+
category: this.searchContext,
|
|
281
|
+
action: analyticsActions.displayMode,
|
|
282
|
+
label: this.displayMode,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
/** Send Analytics when sorting by title's first letter
|
|
287
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
288
|
+
* */
|
|
289
|
+
sendFilterByTitleAnalytics(prevSelectedLetter) {
|
|
290
|
+
var _a;
|
|
291
|
+
if (!prevSelectedLetter && !this.selectedTitleFilter) {
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
const cleared = prevSelectedLetter && this.selectedTitleFilter === null;
|
|
295
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
296
|
+
category: this.searchContext,
|
|
297
|
+
action: analyticsActions.filterByTitle,
|
|
298
|
+
label: cleared
|
|
299
|
+
? `clear-${prevSelectedLetter}`
|
|
300
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedTitleFilter}`,
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
selectedTitleLetterChanged() {
|
|
304
|
+
this.titleQuery = this.selectedTitleFilter
|
|
305
|
+
? `firstTitle:${this.selectedTitleFilter}`
|
|
306
|
+
: undefined;
|
|
307
|
+
}
|
|
308
|
+
/** Send Analytics when filtering by creator's first letter
|
|
309
|
+
* labels: 'start-<ToLetter>' | 'clear-<FromLetter>' | '<FromLetter>-<ToLetter>'
|
|
310
|
+
* */
|
|
311
|
+
sendFilterByCreatorAnalytics(prevSelectedLetter) {
|
|
312
|
+
var _a;
|
|
313
|
+
if (!prevSelectedLetter && !this.selectedCreatorFilter) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const cleared = prevSelectedLetter && this.selectedCreatorFilter === null;
|
|
317
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
318
|
+
category: this.searchContext,
|
|
319
|
+
action: analyticsActions.filterByCreator,
|
|
320
|
+
label: cleared
|
|
321
|
+
? `clear-${prevSelectedLetter}`
|
|
322
|
+
: `${prevSelectedLetter || 'start'}-${this.selectedCreatorFilter}`,
|
|
323
|
+
});
|
|
324
|
+
}
|
|
325
|
+
selectedCreatorLetterChanged() {
|
|
326
|
+
this.creatorQuery = this.selectedCreatorFilter
|
|
327
|
+
? `firstCreator:${this.selectedCreatorFilter}`
|
|
328
|
+
: undefined;
|
|
329
|
+
}
|
|
330
|
+
titleLetterSelected(e) {
|
|
331
|
+
this.selectedCreatorFilter = null;
|
|
332
|
+
this.selectedTitleFilter = e.detail.selectedLetter;
|
|
333
|
+
}
|
|
334
|
+
creatorLetterSelected(e) {
|
|
335
|
+
this.selectedTitleFilter = null;
|
|
336
|
+
this.selectedCreatorFilter = e.detail.selectedLetter;
|
|
337
|
+
}
|
|
338
|
+
get facetDataLoading() {
|
|
339
|
+
return this.facetsLoading || this.fullYearAggregationLoading;
|
|
340
|
+
}
|
|
341
|
+
get mobileFacetsTemplate() {
|
|
342
|
+
return html `
|
|
343
|
+
<div id="mobile-filter-collapse">
|
|
344
|
+
<h1
|
|
345
|
+
@click=${() => {
|
|
346
|
+
this.isResizeToMobile = false;
|
|
347
|
+
this.mobileFacetsVisible = !this.mobileFacetsVisible;
|
|
348
|
+
}}
|
|
349
|
+
@keyup=${() => {
|
|
350
|
+
this.isResizeToMobile = false;
|
|
351
|
+
this.mobileFacetsVisible = !this.mobileFacetsVisible;
|
|
352
|
+
}}
|
|
353
|
+
>
|
|
354
|
+
<span class="collapser ${this.mobileFacetsVisible ? 'open' : ''}">
|
|
355
|
+
${chevronIcon}
|
|
356
|
+
</span>
|
|
357
|
+
Filters
|
|
358
|
+
</h1>
|
|
359
|
+
</div>
|
|
360
|
+
`;
|
|
361
|
+
}
|
|
362
|
+
get facetsTemplate() {
|
|
363
|
+
return html `
|
|
364
|
+
<collection-facets
|
|
365
|
+
@facetsChanged=${this.facetsChanged}
|
|
366
|
+
@histogramDateRangeUpdated=${this.histogramDateRangeUpdated}
|
|
367
|
+
.searchService=${this.searchService}
|
|
368
|
+
.searchType=${this.searchType}
|
|
369
|
+
.aggregations=${this.aggregations}
|
|
370
|
+
.fullYearsHistogramAggregation=${this.fullYearsHistogramAggregation}
|
|
371
|
+
.moreLinksVisible=${this.previousSearchType !== SearchType.FULLTEXT}
|
|
372
|
+
.minSelectedDate=${this.minSelectedDate}
|
|
373
|
+
.maxSelectedDate=${this.maxSelectedDate}
|
|
374
|
+
.selectedFacets=${this.selectedFacets}
|
|
375
|
+
.collectionNameCache=${this.collectionNameCache}
|
|
376
|
+
.languageCodeHandler=${this.languageCodeHandler}
|
|
377
|
+
.showHistogramDatePicker=${this.showHistogramDatePicker}
|
|
378
|
+
.fullQuery=${this.fullQuery}
|
|
379
|
+
.modalManager=${this.modalManager}
|
|
380
|
+
?collapsableFacets=${this.mobileView}
|
|
381
|
+
?facetsLoading=${this.facetDataLoading}
|
|
382
|
+
?fullYearAggregationLoading=${this.fullYearAggregationLoading}
|
|
383
|
+
.onFacetClick=${this.facetClickHandler}
|
|
384
|
+
.analyticsHandler=${this.analyticsHandler}
|
|
385
|
+
>
|
|
386
|
+
</collection-facets>
|
|
387
|
+
`;
|
|
388
|
+
}
|
|
389
|
+
get loadingTemplate() {
|
|
390
|
+
return html `
|
|
391
|
+
<div class="loading-cover">
|
|
392
|
+
<circular-activity-indicator></circular-activity-indicator>
|
|
393
|
+
</div>
|
|
394
|
+
`;
|
|
395
|
+
}
|
|
396
|
+
get listHeaderTemplate() {
|
|
397
|
+
return html `
|
|
398
|
+
<div id="list-header">
|
|
399
|
+
<tile-dispatcher
|
|
400
|
+
.tileDisplayMode=${'list-header'}
|
|
401
|
+
.resizeObserver=${this.resizeObserver}
|
|
402
|
+
.sortParam=${this.sortParam}
|
|
403
|
+
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
404
|
+
.loggedIn=${this.loggedIn}
|
|
405
|
+
>
|
|
406
|
+
</tile-dispatcher>
|
|
407
|
+
</div>
|
|
408
|
+
`;
|
|
409
|
+
}
|
|
410
|
+
get queryDebuggingTemplate() {
|
|
411
|
+
var _a, _b;
|
|
412
|
+
return html `
|
|
413
|
+
<div>
|
|
414
|
+
<ul>
|
|
415
|
+
<li>Base Query: ${this.baseQuery}</li>
|
|
416
|
+
<li>Facet Query: ${this.facetQuery}</li>
|
|
417
|
+
<li>Sort Filter Query: ${this.sortFilterQueries}</li>
|
|
418
|
+
<li>Date Range Query: ${this.dateRangeQueryClause}</li>
|
|
419
|
+
<li>Sort: ${(_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field} ${(_b = this.sortParam) === null || _b === void 0 ? void 0 : _b.direction}</li>
|
|
420
|
+
<li>Full Query: ${this.fullQuery}</li>
|
|
421
|
+
</ul>
|
|
422
|
+
</div>
|
|
423
|
+
`;
|
|
424
|
+
}
|
|
425
|
+
histogramDateRangeUpdated(e) {
|
|
426
|
+
var _a;
|
|
427
|
+
const { minDate, maxDate } = e.detail;
|
|
428
|
+
this.dateRangeQueryClause = `year:[${minDate} TO ${maxDate}]`;
|
|
429
|
+
if (this.dateRangeQueryClause) {
|
|
430
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
431
|
+
category: this.searchContext,
|
|
432
|
+
action: analyticsActions.histogramChanged,
|
|
433
|
+
label: this.dateRangeQueryClause,
|
|
434
|
+
});
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
firstUpdated() {
|
|
438
|
+
this.setupStateRestorationObserver();
|
|
439
|
+
this.restoreState();
|
|
440
|
+
}
|
|
441
|
+
updated(changed) {
|
|
442
|
+
var _a;
|
|
443
|
+
if (changed.has('displayMode') ||
|
|
444
|
+
changed.has('baseNavigationUrl') ||
|
|
445
|
+
changed.has('baseImageUrl') ||
|
|
446
|
+
changed.has('loggedIn')) {
|
|
447
|
+
(_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.reload();
|
|
448
|
+
}
|
|
449
|
+
if (changed.has('baseQuery')) {
|
|
450
|
+
this.emitBaseQueryChanged();
|
|
451
|
+
}
|
|
452
|
+
if (changed.has('currentPage') || changed.has('displayMode')) {
|
|
453
|
+
this.persistState();
|
|
454
|
+
}
|
|
455
|
+
if (changed.has('baseQuery') ||
|
|
456
|
+
changed.has('titleQuery') ||
|
|
457
|
+
changed.has('creatorQuery') ||
|
|
458
|
+
changed.has('dateRangeQueryClause') ||
|
|
459
|
+
changed.has('sortParam') ||
|
|
460
|
+
changed.has('selectedFacets') ||
|
|
461
|
+
changed.has('searchService')) {
|
|
462
|
+
this.handleQueryChange();
|
|
463
|
+
}
|
|
464
|
+
if (changed.has('selectedSort') || changed.has('sortDirection')) {
|
|
465
|
+
const prevSortDirection = changed.get('sortDirection');
|
|
466
|
+
this.sendSortByAnalytics(prevSortDirection);
|
|
467
|
+
this.selectedSortChanged();
|
|
468
|
+
}
|
|
469
|
+
if (changed.has('selectedTitleFilter')) {
|
|
470
|
+
this.sendFilterByTitleAnalytics(changed.get('selectedTitleFilter'));
|
|
471
|
+
this.selectedTitleLetterChanged();
|
|
472
|
+
}
|
|
473
|
+
if (changed.has('selectedCreatorFilter')) {
|
|
474
|
+
this.sendFilterByCreatorAnalytics(changed.get('selectedCreatorFilter'));
|
|
475
|
+
this.selectedCreatorLetterChanged();
|
|
476
|
+
}
|
|
477
|
+
if (changed.has('pagesToRender')) {
|
|
478
|
+
if (!this.endOfDataReached && this.infiniteScroller) {
|
|
479
|
+
this.infiniteScroller.itemCount = this.estimatedTileCount;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
if (changed.has('resizeObserver')) {
|
|
483
|
+
const oldObserver = changed.get('resizeObserver');
|
|
484
|
+
if (oldObserver)
|
|
485
|
+
this.disconnectResizeObserver(oldObserver);
|
|
486
|
+
this.setupResizeObserver();
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
disconnectedCallback() {
|
|
490
|
+
if (this.resizeObserver) {
|
|
491
|
+
this.disconnectResizeObserver(this.resizeObserver);
|
|
492
|
+
}
|
|
493
|
+
if (this.boundNavigationHandler) {
|
|
494
|
+
window.removeEventListener('popstate', this.boundNavigationHandler);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
handleResize(entry) {
|
|
498
|
+
const previousView = this.mobileView;
|
|
499
|
+
if (entry.target === this.contentContainer) {
|
|
500
|
+
this.mobileView = entry.contentRect.width < this.mobileBreakpoint;
|
|
501
|
+
// If changing from desktop to mobile disable transition
|
|
502
|
+
if (this.mobileView && !previousView) {
|
|
503
|
+
this.isResizeToMobile = true;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
emitBaseQueryChanged() {
|
|
508
|
+
this.dispatchEvent(new CustomEvent('baseQueryChanged', {
|
|
509
|
+
detail: {
|
|
510
|
+
baseQuery: this.baseQuery,
|
|
511
|
+
},
|
|
512
|
+
}));
|
|
513
|
+
}
|
|
514
|
+
disconnectResizeObserver(resizeObserver) {
|
|
515
|
+
resizeObserver.removeObserver({
|
|
516
|
+
target: this.contentContainer,
|
|
517
|
+
handler: this,
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
setupResizeObserver() {
|
|
521
|
+
if (!this.resizeObserver)
|
|
522
|
+
return;
|
|
523
|
+
this.resizeObserver.addObserver({
|
|
524
|
+
target: this.contentContainer,
|
|
525
|
+
handler: this,
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* When the visible cells change from the infinite scroller, we want to emit
|
|
530
|
+
* which page is currently visible so the consumer can update its UI or the URL
|
|
531
|
+
*
|
|
532
|
+
* @param e
|
|
533
|
+
* @returns
|
|
534
|
+
*/
|
|
535
|
+
visibleCellsChanged(e) {
|
|
536
|
+
if (this.isScrollingToCell)
|
|
537
|
+
return;
|
|
538
|
+
const { visibleCellIndices } = e.detail;
|
|
539
|
+
if (visibleCellIndices.length === 0)
|
|
540
|
+
return;
|
|
541
|
+
const lastVisibleCellIndex = visibleCellIndices[visibleCellIndices.length - 1];
|
|
542
|
+
const lastVisibleCellPage = Math.floor(lastVisibleCellIndex / this.pageSize) + 1;
|
|
543
|
+
if (this.currentPage !== lastVisibleCellPage) {
|
|
544
|
+
this.currentPage = lastVisibleCellPage;
|
|
545
|
+
}
|
|
546
|
+
const event = new CustomEvent('visiblePageChanged', {
|
|
547
|
+
detail: {
|
|
548
|
+
pageNumber: lastVisibleCellPage,
|
|
549
|
+
},
|
|
550
|
+
});
|
|
551
|
+
this.dispatchEvent(event);
|
|
552
|
+
}
|
|
553
|
+
async handleQueryChange() {
|
|
554
|
+
// only reset if the query has actually changed
|
|
555
|
+
if (!this.searchService || this.pageFetchQueryKey === this.previousQueryKey)
|
|
556
|
+
return;
|
|
557
|
+
this.previousQueryKey = this.pageFetchQueryKey;
|
|
558
|
+
this.dataSource = {};
|
|
559
|
+
this.pageFetchesInProgress = {};
|
|
560
|
+
this.endOfDataReached = false;
|
|
561
|
+
this.pagesToRender = this.initialPageNumber;
|
|
562
|
+
if (!this.initialQueryChangeHappened && this.initialPageNumber > 1) {
|
|
563
|
+
this.scrollToPage(this.initialPageNumber);
|
|
564
|
+
}
|
|
565
|
+
this.initialQueryChangeHappened = true;
|
|
566
|
+
// if the query changed as part of a window.history pop event, we don't want to
|
|
567
|
+
// persist the state because it overwrites the forward history
|
|
568
|
+
if (!this.historyPopOccurred) {
|
|
569
|
+
this.persistState();
|
|
570
|
+
this.historyPopOccurred = false;
|
|
571
|
+
}
|
|
572
|
+
await Promise.all([
|
|
573
|
+
this.doInitialPageFetch(),
|
|
574
|
+
this.fetchFacets(),
|
|
575
|
+
this.fetchFullYearHistogram(),
|
|
576
|
+
]);
|
|
577
|
+
}
|
|
578
|
+
setupStateRestorationObserver() {
|
|
579
|
+
if (this.boundNavigationHandler)
|
|
580
|
+
return;
|
|
581
|
+
this.boundNavigationHandler = this.historyNavigationHandler.bind(this);
|
|
582
|
+
// when the user navigates back, we want to update the UI to match the URL
|
|
583
|
+
window.addEventListener('popstate', this.boundNavigationHandler);
|
|
584
|
+
}
|
|
585
|
+
historyNavigationHandler() {
|
|
586
|
+
this.historyPopOccurred = true;
|
|
587
|
+
this.restoreState();
|
|
588
|
+
}
|
|
589
|
+
restoreState() {
|
|
590
|
+
var _a, _b, _c, _d, _e, _f;
|
|
591
|
+
const restorationState = this.restorationStateHandler.getRestorationState();
|
|
592
|
+
this.displayMode = restorationState.displayMode;
|
|
593
|
+
this.selectedSort = (_a = restorationState.selectedSort) !== null && _a !== void 0 ? _a : SortField.relevance;
|
|
594
|
+
this.sortDirection = (_b = restorationState.sortDirection) !== null && _b !== void 0 ? _b : null;
|
|
595
|
+
this.selectedTitleFilter = (_c = restorationState.selectedTitleFilter) !== null && _c !== void 0 ? _c : null;
|
|
596
|
+
this.selectedCreatorFilter = (_d = restorationState.selectedCreatorFilter) !== null && _d !== void 0 ? _d : null;
|
|
597
|
+
this.selectedFacets = restorationState.selectedFacets;
|
|
598
|
+
this.baseQuery = restorationState.baseQuery;
|
|
599
|
+
this.titleQuery = restorationState.titleQuery;
|
|
600
|
+
this.creatorQuery = restorationState.creatorQuery;
|
|
601
|
+
this.dateRangeQueryClause = restorationState.dateRangeQueryClause;
|
|
602
|
+
this.sortParam = (_e = restorationState.sortParam) !== null && _e !== void 0 ? _e : null;
|
|
603
|
+
this.currentPage = (_f = restorationState.currentPage) !== null && _f !== void 0 ? _f : 1;
|
|
604
|
+
this.minSelectedDate = restorationState.minSelectedDate;
|
|
605
|
+
this.maxSelectedDate = restorationState.maxSelectedDate;
|
|
606
|
+
if (this.currentPage > 1) {
|
|
607
|
+
this.goToPage(this.currentPage);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
persistState() {
|
|
611
|
+
var _a, _b, _c, _d, _e;
|
|
612
|
+
const restorationState = {
|
|
613
|
+
displayMode: this.displayMode,
|
|
614
|
+
sortParam: (_a = this.sortParam) !== null && _a !== void 0 ? _a : undefined,
|
|
615
|
+
selectedSort: this.selectedSort,
|
|
616
|
+
sortDirection: (_b = this.sortDirection) !== null && _b !== void 0 ? _b : undefined,
|
|
617
|
+
selectedFacets: (_c = this.selectedFacets) !== null && _c !== void 0 ? _c : defaultSelectedFacets,
|
|
618
|
+
baseQuery: this.baseQuery,
|
|
619
|
+
currentPage: this.currentPage,
|
|
620
|
+
dateRangeQueryClause: this.dateRangeQueryClause,
|
|
621
|
+
titleQuery: this.titleQuery,
|
|
622
|
+
creatorQuery: this.creatorQuery,
|
|
623
|
+
minSelectedDate: this.minSelectedDate,
|
|
624
|
+
maxSelectedDate: this.maxSelectedDate,
|
|
625
|
+
selectedTitleFilter: (_d = this.selectedTitleFilter) !== null && _d !== void 0 ? _d : undefined,
|
|
626
|
+
selectedCreatorFilter: (_e = this.selectedCreatorFilter) !== null && _e !== void 0 ? _e : undefined,
|
|
627
|
+
};
|
|
628
|
+
this.restorationStateHandler.persistState(restorationState);
|
|
629
|
+
}
|
|
630
|
+
async doInitialPageFetch() {
|
|
631
|
+
this.searchResultsLoading = true;
|
|
632
|
+
await this.fetchPage(this.initialPageNumber);
|
|
633
|
+
this.searchResultsLoading = false;
|
|
634
|
+
}
|
|
635
|
+
get fullQuery() {
|
|
636
|
+
let { fullQueryWithoutDate } = this;
|
|
637
|
+
const { dateRangeQueryClause } = this;
|
|
638
|
+
if (dateRangeQueryClause) {
|
|
639
|
+
fullQueryWithoutDate += ` AND ${dateRangeQueryClause}`;
|
|
640
|
+
}
|
|
641
|
+
return fullQueryWithoutDate;
|
|
642
|
+
}
|
|
643
|
+
get fullQueryWithoutDate() {
|
|
644
|
+
if (!this.baseQuery)
|
|
645
|
+
return undefined;
|
|
646
|
+
let fullQuery = this.baseQuery;
|
|
647
|
+
const { facetQuery, sortFilterQueries } = this;
|
|
648
|
+
if (facetQuery) {
|
|
649
|
+
fullQuery += ` AND ${facetQuery}`;
|
|
650
|
+
}
|
|
651
|
+
if (sortFilterQueries) {
|
|
652
|
+
fullQuery += ` AND ${sortFilterQueries}`;
|
|
653
|
+
}
|
|
654
|
+
return fullQuery;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Generates a query string for the given facets
|
|
658
|
+
*
|
|
659
|
+
* Example: `mediatype:("collection" OR "audio" OR -"etree") AND year:("2000" OR "2001")`
|
|
660
|
+
*/
|
|
661
|
+
get facetQuery() {
|
|
662
|
+
if (!this.selectedFacets)
|
|
663
|
+
return undefined;
|
|
664
|
+
const facetQuery = [];
|
|
665
|
+
for (const [facetName, facetValues] of Object.entries(this.selectedFacets)) {
|
|
666
|
+
const facetEntries = Object.entries(facetValues);
|
|
667
|
+
const facetQueryName = facetName === 'lending' ? 'lending___status' : facetName;
|
|
668
|
+
// eslint-disable-next-line no-continue
|
|
669
|
+
if (facetEntries.length === 0)
|
|
670
|
+
continue;
|
|
671
|
+
const facetValuesArray = [];
|
|
672
|
+
for (const [key, facetData] of facetEntries) {
|
|
673
|
+
const plusMinusPrefix = facetData.state === 'hidden' ? '-' : '';
|
|
674
|
+
if (facetName === 'language') {
|
|
675
|
+
const languages = this.languageCodeHandler.getCodeArrayFromCodeString(key);
|
|
676
|
+
for (const language of languages) {
|
|
677
|
+
facetValuesArray.push(`${plusMinusPrefix}"${language}"`);
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
facetValuesArray.push(`${plusMinusPrefix}"${key}"`);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
const valueQuery = facetValuesArray.join(` OR `);
|
|
685
|
+
facetQuery.push(`${facetQueryName}:(${valueQuery})`);
|
|
686
|
+
}
|
|
687
|
+
return facetQuery.length > 0 ? `(${facetQuery.join(' AND ')})` : undefined;
|
|
688
|
+
}
|
|
689
|
+
facetsChanged(e) {
|
|
690
|
+
this.selectedFacets = e.detail;
|
|
691
|
+
}
|
|
692
|
+
facetClickHandler(name, facetSelected, negative) {
|
|
693
|
+
var _a, _b;
|
|
694
|
+
if (negative) {
|
|
695
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
696
|
+
category: this.searchContext,
|
|
697
|
+
action: facetSelected
|
|
698
|
+
? analyticsActions.facetNegativeSelected
|
|
699
|
+
: analyticsActions.facetNegativeDeselected,
|
|
700
|
+
label: name,
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
else {
|
|
704
|
+
(_b = this.analyticsHandler) === null || _b === void 0 ? void 0 : _b.sendEventNoSampling({
|
|
705
|
+
category: this.searchContext,
|
|
706
|
+
action: facetSelected
|
|
707
|
+
? analyticsActions.facetSelected
|
|
708
|
+
: analyticsActions.facetDeselected,
|
|
709
|
+
label: name,
|
|
710
|
+
});
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
async fetchFacets() {
|
|
714
|
+
var _a, _b;
|
|
715
|
+
if (!this.fullQuery)
|
|
716
|
+
return;
|
|
717
|
+
const params = {
|
|
718
|
+
query: this.fullQuery,
|
|
719
|
+
rows: 0,
|
|
720
|
+
// Fetch a few extra buckets beyond the 6 we show, in case some get suppressed
|
|
721
|
+
aggregationsSize: 10,
|
|
722
|
+
// Note: we don't need an aggregations param to fetch the default aggregations from the PPS.
|
|
723
|
+
// The default aggregations for the search_results page type should be what we need here.
|
|
724
|
+
};
|
|
725
|
+
this.facetsLoading = true;
|
|
726
|
+
this.previousSearchType = this.searchType;
|
|
727
|
+
const results = await ((_a = this.searchService) === null || _a === void 0 ? void 0 : _a.search(params, this.searchType));
|
|
728
|
+
this.facetsLoading = false;
|
|
729
|
+
this.aggregations = (_b = results === null || results === void 0 ? void 0 : results.success) === null || _b === void 0 ? void 0 : _b.response.aggregations;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* The query key is a string that uniquely identifies the current query
|
|
733
|
+
* without the date range.
|
|
734
|
+
*
|
|
735
|
+
* If this doesn't change, we don't need to re-fetch the histogram date range
|
|
736
|
+
*/
|
|
737
|
+
get fullQueryNoDateKey() {
|
|
738
|
+
var _a, _b;
|
|
739
|
+
return `${this.fullQueryWithoutDate}-${this.searchType}-${(_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field}-${(_b = this.sortParam) === null || _b === void 0 ? void 0 : _b.direction}`;
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* This method is similar to fetching the facets above,
|
|
743
|
+
* but only fetching the year histogram. There is a subtle difference
|
|
744
|
+
* in how you have to fetch the year histogram where you can't use the
|
|
745
|
+
* advanced JSON syntax like the other aggregations. It's a special
|
|
746
|
+
* case that @ximm put it place.
|
|
747
|
+
*/
|
|
748
|
+
async fetchFullYearHistogram() {
|
|
749
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
750
|
+
const { fullQueryNoDateKey } = this;
|
|
751
|
+
if (!this.fullQueryWithoutDate ||
|
|
752
|
+
fullQueryNoDateKey === this.previousFullQueryNoDate)
|
|
753
|
+
return;
|
|
754
|
+
this.previousFullQueryNoDate = fullQueryNoDateKey;
|
|
755
|
+
const aggregations = {
|
|
756
|
+
simpleParams: ['year'],
|
|
757
|
+
};
|
|
758
|
+
const params = {
|
|
759
|
+
query: this.fullQueryWithoutDate,
|
|
760
|
+
aggregations,
|
|
761
|
+
rows: 0,
|
|
762
|
+
};
|
|
763
|
+
this.fullYearAggregationLoading = true;
|
|
764
|
+
const results = await ((_a = this.searchService) === null || _a === void 0 ? void 0 : _a.search(params, this.searchType));
|
|
765
|
+
this.fullYearAggregationLoading = false;
|
|
766
|
+
this.fullYearsHistogramAggregation =
|
|
767
|
+
(_e = (_d = (_c = (_b = results === null || results === void 0 ? void 0 : results.success) === null || _b === void 0 ? void 0 : _b.response) === null || _c === void 0 ? void 0 : _c.aggregations) === null || _d === void 0 ? void 0 : _d.year_histogram) !== null && _e !== void 0 ? _e : (_h = (_g = (_f = results === null || results === void 0 ? void 0 : results.success) === null || _f === void 0 ? void 0 : _f.response) === null || _g === void 0 ? void 0 : _g.aggregations) === null || _h === void 0 ? void 0 : _h['year-histogram']; // Temp fix until PPS FTS key is fixed to use underscore
|
|
768
|
+
}
|
|
769
|
+
scrollToPage(pageNumber) {
|
|
770
|
+
const cellIndexToScrollTo = this.pageSize * (pageNumber - 1);
|
|
771
|
+
// without this setTimeout, Safari just pauses until the `fetchPage` is complete
|
|
772
|
+
// then scrolls to the cell
|
|
773
|
+
setTimeout(() => {
|
|
774
|
+
this.isScrollingToCell = true;
|
|
775
|
+
this.infiniteScroller.scrollToCell(cellIndexToScrollTo, true);
|
|
776
|
+
// This timeout is to give the scroll animation time to finish
|
|
777
|
+
// then updating the infinite scroller once we're done scrolling
|
|
778
|
+
// There's no scroll animation completion callback so we're
|
|
779
|
+
// giving it 0.5s to finish.
|
|
780
|
+
setTimeout(() => {
|
|
781
|
+
this.isScrollingToCell = false;
|
|
782
|
+
this.infiniteScroller.reload();
|
|
783
|
+
}, 500);
|
|
784
|
+
}, 0);
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* The query key is a string that uniquely identifies the current query
|
|
788
|
+
*
|
|
789
|
+
* This lets us keep track of queries so we don't persist data that's
|
|
790
|
+
* no longer relevant.
|
|
791
|
+
*/
|
|
792
|
+
get pageFetchQueryKey() {
|
|
793
|
+
var _a, _b;
|
|
794
|
+
return `${this.fullQuery}-${this.searchType}-${(_a = this.sortParam) === null || _a === void 0 ? void 0 : _a.field}-${(_b = this.sortParam) === null || _b === void 0 ? void 0 : _b.direction}`;
|
|
795
|
+
}
|
|
796
|
+
async fetchPage(pageNumber) {
|
|
797
|
+
var _a, _b, _c, _d, _e;
|
|
798
|
+
if (!this.fullQuery)
|
|
799
|
+
return;
|
|
800
|
+
// if we already have data, don't fetch again
|
|
801
|
+
if (this.dataSource[pageNumber])
|
|
802
|
+
return;
|
|
803
|
+
if (this.endOfDataReached)
|
|
804
|
+
return;
|
|
805
|
+
// if a fetch is already in progress for this query and page, don't fetch again
|
|
806
|
+
const { pageFetchQueryKey } = this;
|
|
807
|
+
const pageFetches = (_a = this.pageFetchesInProgress[pageFetchQueryKey]) !== null && _a !== void 0 ? _a : new Set();
|
|
808
|
+
if (pageFetches.has(pageNumber))
|
|
809
|
+
return;
|
|
810
|
+
pageFetches.add(pageNumber);
|
|
811
|
+
this.pageFetchesInProgress[pageFetchQueryKey] = pageFetches;
|
|
812
|
+
const sortParams = this.sortParam ? [this.sortParam] : [];
|
|
813
|
+
const params = {
|
|
814
|
+
query: this.fullQuery,
|
|
815
|
+
page: pageNumber,
|
|
816
|
+
rows: this.pageSize,
|
|
817
|
+
sort: sortParams,
|
|
818
|
+
aggregations: { omit: true },
|
|
819
|
+
};
|
|
820
|
+
const searchResponse = await ((_b = this.searchService) === null || _b === void 0 ? void 0 : _b.search(params, this.searchType));
|
|
821
|
+
const success = searchResponse === null || searchResponse === void 0 ? void 0 : searchResponse.success;
|
|
822
|
+
if (!success)
|
|
823
|
+
return;
|
|
824
|
+
this.totalResults = success.response.totalResults;
|
|
825
|
+
// this is checking to see if the query has changed since the data was fetched
|
|
826
|
+
// if so, we just want to discard the data since there should be a new query
|
|
827
|
+
// right behind it
|
|
828
|
+
const searchQuery = success.request.clientParameters.user_query;
|
|
829
|
+
const searchSort = success.request.clientParameters.sort;
|
|
830
|
+
let sortChanged = false;
|
|
831
|
+
if (!searchSort || searchSort.length === 0) {
|
|
832
|
+
// if we went from no sort to sort, the sort has changed
|
|
833
|
+
if (this.sortParam) {
|
|
834
|
+
sortChanged = true;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
else {
|
|
838
|
+
// check if the sort has changed
|
|
839
|
+
for (const sortType of searchSort) {
|
|
840
|
+
const [field, direction] = sortType.split(':');
|
|
841
|
+
if (field !== ((_c = this.sortParam) === null || _c === void 0 ? void 0 : _c.field) ||
|
|
842
|
+
direction !== ((_d = this.sortParam) === null || _d === void 0 ? void 0 : _d.direction)) {
|
|
843
|
+
sortChanged = true;
|
|
844
|
+
break;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
const queryChangedSinceFetch = searchQuery !== this.fullQuery || sortChanged;
|
|
849
|
+
if (queryChangedSinceFetch)
|
|
850
|
+
return;
|
|
851
|
+
const { results } = success.response;
|
|
852
|
+
if (results && results.length > 0) {
|
|
853
|
+
this.preloadCollectionNames(results);
|
|
854
|
+
this.updateDataSource(pageNumber, results);
|
|
855
|
+
}
|
|
856
|
+
if (results.length < this.pageSize) {
|
|
857
|
+
this.endOfDataReached = true;
|
|
858
|
+
// this updates the infinite scroller to show the actual size
|
|
859
|
+
if (this.infiniteScroller) {
|
|
860
|
+
this.infiniteScroller.itemCount = this.actualTileCount;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
(_e = this.pageFetchesInProgress[pageFetchQueryKey]) === null || _e === void 0 ? void 0 : _e.delete(pageNumber);
|
|
864
|
+
this.searchResultsLoading = false;
|
|
865
|
+
}
|
|
866
|
+
preloadCollectionNames(results) {
|
|
867
|
+
var _a;
|
|
868
|
+
const collectionIds = results
|
|
869
|
+
.map(result => { var _a; return (_a = result.collection) === null || _a === void 0 ? void 0 : _a.values; })
|
|
870
|
+
.flat();
|
|
871
|
+
const collectionIdsArray = Array.from(new Set(collectionIds));
|
|
872
|
+
(_a = this.collectionNameCache) === null || _a === void 0 ? void 0 : _a.preloadIdentifiers(collectionIdsArray);
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* This is useful for determining whether we need to reload the scroller.
|
|
876
|
+
*
|
|
877
|
+
* When the fetch completes, we need to reload the scroller if the cells for that
|
|
878
|
+
* page are visible, but if the page is not currenlty visible, we don't need to reload
|
|
879
|
+
*/
|
|
880
|
+
get currentVisiblePageNumbers() {
|
|
881
|
+
var _a, _b;
|
|
882
|
+
const visibleCells = (_b = (_a = this.infiniteScroller) === null || _a === void 0 ? void 0 : _a.getVisibleCellIndices()) !== null && _b !== void 0 ? _b : [];
|
|
883
|
+
const visiblePages = new Set();
|
|
884
|
+
visibleCells.forEach(cellIndex => {
|
|
885
|
+
const visiblePage = Math.floor(cellIndex / this.pageSize) + 1;
|
|
886
|
+
visiblePages.add(visiblePage);
|
|
887
|
+
});
|
|
888
|
+
return Array.from(visiblePages);
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* Update the datasource from the fetch response
|
|
892
|
+
*
|
|
893
|
+
* @param pageNumber
|
|
894
|
+
* @param results
|
|
895
|
+
*/
|
|
896
|
+
updateDataSource(pageNumber, results) {
|
|
897
|
+
// copy our existing datasource so when we set it below, it gets set
|
|
898
|
+
// instead of modifying the existing dataSource since object changes
|
|
899
|
+
// don't trigger a re-render
|
|
900
|
+
const datasource = { ...this.dataSource };
|
|
901
|
+
const tiles = [];
|
|
902
|
+
results === null || results === void 0 ? void 0 : results.forEach(result => {
|
|
903
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
|
|
904
|
+
if (!result.identifier)
|
|
905
|
+
return;
|
|
906
|
+
let loginRequired = false;
|
|
907
|
+
let contentWarning = false;
|
|
908
|
+
// Check if item and item in "modifying" collection, setting above flags
|
|
909
|
+
if (((_a = result.collection) === null || _a === void 0 ? void 0 : _a.values.length) &&
|
|
910
|
+
((_b = result.mediatype) === null || _b === void 0 ? void 0 : _b.value) !== 'collection') {
|
|
911
|
+
for (const collection of (_d = (_c = result.collection) === null || _c === void 0 ? void 0 : _c.values) !== null && _d !== void 0 ? _d : []) {
|
|
912
|
+
if (collection === 'loggedin') {
|
|
913
|
+
loginRequired = true;
|
|
914
|
+
if (contentWarning)
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
if (collection === 'no-preview') {
|
|
918
|
+
contentWarning = true;
|
|
919
|
+
if (loginRequired)
|
|
920
|
+
break;
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
tiles.push({
|
|
925
|
+
averageRating: (_e = result.avg_rating) === null || _e === void 0 ? void 0 : _e.value,
|
|
926
|
+
collections: (_g = (_f = result.collection) === null || _f === void 0 ? void 0 : _f.values) !== null && _g !== void 0 ? _g : [],
|
|
927
|
+
commentCount: (_j = (_h = result.num_reviews) === null || _h === void 0 ? void 0 : _h.value) !== null && _j !== void 0 ? _j : 0,
|
|
928
|
+
creator: (_k = result.creator) === null || _k === void 0 ? void 0 : _k.value,
|
|
929
|
+
creators: (_m = (_l = result.creator) === null || _l === void 0 ? void 0 : _l.values) !== null && _m !== void 0 ? _m : [],
|
|
930
|
+
dateAdded: (_o = result.addeddate) === null || _o === void 0 ? void 0 : _o.value,
|
|
931
|
+
dateArchived: (_p = result.publicdate) === null || _p === void 0 ? void 0 : _p.value,
|
|
932
|
+
datePublished: (_q = result.date) === null || _q === void 0 ? void 0 : _q.value,
|
|
933
|
+
dateReviewed: (_r = result.reviewdate) === null || _r === void 0 ? void 0 : _r.value,
|
|
934
|
+
description: (_s = result.description) === null || _s === void 0 ? void 0 : _s.value,
|
|
935
|
+
favCount: (_u = (_t = result.num_favorites) === null || _t === void 0 ? void 0 : _t.value) !== null && _u !== void 0 ? _u : 0,
|
|
936
|
+
identifier: result.identifier,
|
|
937
|
+
issue: (_v = result.issue) === null || _v === void 0 ? void 0 : _v.value,
|
|
938
|
+
itemCount: (_x = (_w = result.item_count) === null || _w === void 0 ? void 0 : _w.value) !== null && _x !== void 0 ? _x : 0,
|
|
939
|
+
mediatype: (_z = (_y = result.mediatype) === null || _y === void 0 ? void 0 : _y.value) !== null && _z !== void 0 ? _z : 'data',
|
|
940
|
+
snippets: (_1 = (_0 = result.highlight) === null || _0 === void 0 ? void 0 : _0.values) !== null && _1 !== void 0 ? _1 : [],
|
|
941
|
+
source: (_2 = result.source) === null || _2 === void 0 ? void 0 : _2.value,
|
|
942
|
+
subjects: (_4 = (_3 = result.subject) === null || _3 === void 0 ? void 0 : _3.values) !== null && _4 !== void 0 ? _4 : [],
|
|
943
|
+
title: this.etreeTitle((_5 = result.title) === null || _5 === void 0 ? void 0 : _5.value, (_6 = result.mediatype) === null || _6 === void 0 ? void 0 : _6.value, (_7 = result.collection) === null || _7 === void 0 ? void 0 : _7.values),
|
|
944
|
+
volume: (_8 = result.volume) === null || _8 === void 0 ? void 0 : _8.value,
|
|
945
|
+
viewCount: (_10 = (_9 = result.downloads) === null || _9 === void 0 ? void 0 : _9.value) !== null && _10 !== void 0 ? _10 : 0,
|
|
946
|
+
loginRequired,
|
|
947
|
+
contentWarning,
|
|
948
|
+
});
|
|
949
|
+
});
|
|
950
|
+
datasource[pageNumber] = tiles;
|
|
951
|
+
this.dataSource = datasource;
|
|
952
|
+
const visiblePages = this.currentVisiblePageNumbers;
|
|
953
|
+
const needsReload = visiblePages.includes(pageNumber);
|
|
954
|
+
if (needsReload) {
|
|
955
|
+
this.infiniteScroller.reload();
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
/*
|
|
959
|
+
* Convert etree titles
|
|
960
|
+
* "[Creator] Live at [Place] on [Date]" => "[Date]: [Place]"
|
|
961
|
+
*
|
|
962
|
+
* Todo: Check collection(s) for etree, need to get as array.
|
|
963
|
+
* Current search-service only returns first collection as string.
|
|
964
|
+
*/
|
|
965
|
+
etreeTitle(title, mediatype, collections) {
|
|
966
|
+
if (mediatype === 'etree' || (collections === null || collections === void 0 ? void 0 : collections.includes('etree'))) {
|
|
967
|
+
const regex = /^(.*) Live at (.*) on (\d\d\d\d-\d\d-\d\d)$/;
|
|
968
|
+
const newTitle = title === null || title === void 0 ? void 0 : title.replace(regex, '$3: $2');
|
|
969
|
+
if (newTitle) {
|
|
970
|
+
return `${newTitle}`;
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
return title !== null && title !== void 0 ? title : '';
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Callback when a result is selected
|
|
977
|
+
*/
|
|
978
|
+
resultSelected(event) {
|
|
979
|
+
var _a, _b;
|
|
980
|
+
(_a = this.analyticsHandler) === null || _a === void 0 ? void 0 : _a.sendEventNoSampling({
|
|
981
|
+
category: this.searchContext,
|
|
982
|
+
action: analyticsActions.resultSelected,
|
|
983
|
+
label: event.detail.mediatype,
|
|
984
|
+
});
|
|
985
|
+
(_b = this.analyticsHandler) === null || _b === void 0 ? void 0 : _b.sendEventNoSampling({
|
|
986
|
+
category: this.searchContext,
|
|
987
|
+
action: analyticsActions.resultSelected,
|
|
988
|
+
label: `page-${this.currentPage}`,
|
|
989
|
+
});
|
|
990
|
+
}
|
|
991
|
+
cellForIndex(index) {
|
|
992
|
+
const model = this.tileModelAtCellIndex(index);
|
|
993
|
+
if (!model)
|
|
994
|
+
return undefined;
|
|
995
|
+
return html `
|
|
996
|
+
<tile-dispatcher
|
|
997
|
+
.baseNavigationUrl=${this.baseNavigationUrl}
|
|
998
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
999
|
+
.model=${model}
|
|
1000
|
+
.tileDisplayMode=${this.displayMode}
|
|
1001
|
+
.resizeObserver=${this.resizeObserver}
|
|
1002
|
+
.collectionNameCache=${this.collectionNameCache}
|
|
1003
|
+
.sortParam=${this.sortParam}
|
|
1004
|
+
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
1005
|
+
.loggedIn=${this.loggedIn}
|
|
1006
|
+
@resultSelected=${(e) => this.resultSelected(e)}
|
|
1007
|
+
>
|
|
1008
|
+
</tile-dispatcher>
|
|
1009
|
+
`;
|
|
1010
|
+
}
|
|
1011
|
+
/**
|
|
1012
|
+
* When the user scrolls near to the bottom of the page, fetch the next page
|
|
1013
|
+
* increase the number of pages to render and start fetching data for the new page
|
|
1014
|
+
*/
|
|
1015
|
+
scrollThresholdReached() {
|
|
1016
|
+
this.pagesToRender += 1;
|
|
1017
|
+
this.fetchPage(this.pagesToRender);
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
CollectionBrowser.styles = css `
|
|
1021
|
+
:host {
|
|
1022
|
+
display: block;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
/**
|
|
1026
|
+
* When page width resizes from desktop to mobile, use this class to
|
|
1027
|
+
* disable expand/collapse transition when loading.
|
|
1028
|
+
*/
|
|
1029
|
+
.preload * {
|
|
1030
|
+
transition: none !important;
|
|
1031
|
+
-webkit-transition: none !important;
|
|
1032
|
+
-moz-transition: none !important;
|
|
1033
|
+
-ms-transition: none !important;
|
|
1034
|
+
-o-transition: none !important;
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
#content-container {
|
|
1038
|
+
display: flex;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
.collapser {
|
|
1042
|
+
display: inline-block;
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
.collapser svg {
|
|
1046
|
+
width: 10px;
|
|
1047
|
+
height: 10px;
|
|
1048
|
+
transition: transform 0.2s ease-out;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
.collapser.open svg {
|
|
1052
|
+
transform: rotate(90deg);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
#mobile-filter-collapse h1 {
|
|
1056
|
+
cursor: pointer;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
#content-container.mobile {
|
|
1060
|
+
display: block;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
.column {
|
|
1064
|
+
padding-top: 2rem;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
#right-column {
|
|
1068
|
+
flex: 1;
|
|
1069
|
+
position: relative;
|
|
1070
|
+
border-left: 1px solid rgb(232, 232, 232);
|
|
1071
|
+
padding-left: 1rem;
|
|
1072
|
+
}
|
|
1073
|
+
|
|
1074
|
+
.mobile #right-column {
|
|
1075
|
+
border-left: none;
|
|
1076
|
+
padding: 0;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
#left-column {
|
|
1080
|
+
width: 18rem;
|
|
1081
|
+
min-width: 18rem; /* Prevents Safari from shrinking col at first draw */
|
|
1082
|
+
padding-right: 12px;
|
|
1083
|
+
padding-right: 2.5rem;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
.desktop #left-column::-webkit-scrollbar {
|
|
1087
|
+
display: none;
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
.mobile #left-column {
|
|
1091
|
+
width: 100%;
|
|
1092
|
+
padding: 0;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
.desktop #left-column {
|
|
1096
|
+
top: 0;
|
|
1097
|
+
position: sticky;
|
|
1098
|
+
max-height: 100vh;
|
|
1099
|
+
overflow: scroll;
|
|
1100
|
+
-ms-overflow-style: none; /* hide scrollbar IE and Edge */
|
|
1101
|
+
scrollbar-width: none; /* hide scrollbar Firefox */
|
|
1102
|
+
}
|
|
1103
|
+
|
|
1104
|
+
#mobile-header-container {
|
|
1105
|
+
display: flex;
|
|
1106
|
+
justify-content: space-between;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
#facets-container {
|
|
1110
|
+
position: relative;
|
|
1111
|
+
max-height: 0;
|
|
1112
|
+
transition: max-height 0.2s ease-in-out;
|
|
1113
|
+
z-index: 1;
|
|
1114
|
+
padding-bottom: 2rem;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
.mobile #facets-container {
|
|
1118
|
+
overflow: hidden;
|
|
1119
|
+
padding-bottom: 0;
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
#facets-container.expanded {
|
|
1123
|
+
max-height: 2000px;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
#results-total {
|
|
1127
|
+
display: flex;
|
|
1128
|
+
align-items: center;
|
|
1129
|
+
margin-bottom: 5rem;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
.mobile #results-total {
|
|
1133
|
+
margin-bottom: 0;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
#big-results-count {
|
|
1137
|
+
font-size: 2.4rem;
|
|
1138
|
+
font-weight: 500;
|
|
1139
|
+
margin-right: 5px;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
#big-results-label {
|
|
1143
|
+
font-size: 1rem;
|
|
1144
|
+
font-weight: 200;
|
|
1145
|
+
text-transform: uppercase;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
#list-header {
|
|
1149
|
+
max-height: 4.2rem;
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
.loading-cover {
|
|
1153
|
+
position: absolute;
|
|
1154
|
+
top: 0;
|
|
1155
|
+
left: 0;
|
|
1156
|
+
width: 100%;
|
|
1157
|
+
height: 100%;
|
|
1158
|
+
display: flex;
|
|
1159
|
+
justify-content: center;
|
|
1160
|
+
z-index: 1;
|
|
1161
|
+
padding-top: 50px;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
circular-activity-indicator {
|
|
1165
|
+
width: 30px;
|
|
1166
|
+
height: 30px;
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
sort-filter-bar {
|
|
1170
|
+
display: block;
|
|
1171
|
+
margin-bottom: 4rem;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
infinite-scroller {
|
|
1175
|
+
display: block;
|
|
1176
|
+
--infiniteScrollerRowGap: var(--collectionBrowserRowGap, 1.7rem);
|
|
1177
|
+
--infiniteScrollerColGap: var(--collectionBrowserColGap, 1.7rem);
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
infinite-scroller.list-compact {
|
|
1181
|
+
--infiniteScrollerCellMinWidth: var(
|
|
1182
|
+
--collectionBrowserCellMinWidth,
|
|
1183
|
+
100%
|
|
1184
|
+
);
|
|
1185
|
+
--infiniteScrollerCellMinHeight: 34px; /* override infinite scroller component */
|
|
1186
|
+
--infiniteScrollerCellMaxHeight: 56px;
|
|
1187
|
+
--infiniteScrollerRowGap: 0px;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
infinite-scroller.list-detail {
|
|
1191
|
+
--infiniteScrollerCellMinWidth: var(
|
|
1192
|
+
--collectionBrowserCellMinWidth,
|
|
1193
|
+
100%
|
|
1194
|
+
);
|
|
1195
|
+
--infiniteScrollerCellMinHeight: var(
|
|
1196
|
+
--collectionBrowserCellMinHeight,
|
|
1197
|
+
5rem
|
|
1198
|
+
);
|
|
1199
|
+
/*
|
|
1200
|
+
30px in spec, compensating for a -4px margin
|
|
1201
|
+
to align title with top of item image
|
|
1202
|
+
src/tiles/list/tile-list.ts
|
|
1203
|
+
*/
|
|
1204
|
+
--infiniteScrollerRowGap: 34px;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
.mobile infinite-scroller.list-detail {
|
|
1208
|
+
--infiniteScrollerRowGap: 24px;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
infinite-scroller.grid {
|
|
1212
|
+
--infiniteScrollerCellMinWidth: var(
|
|
1213
|
+
--collectionBrowserCellMinWidth,
|
|
1214
|
+
18rem
|
|
1215
|
+
);
|
|
1216
|
+
--infiniteScrollerCellMaxWidth: var(--collectionBrowserCellMaxWidth, 1fr);
|
|
1217
|
+
--infiniteScrollerCellMinHeight: var(
|
|
1218
|
+
--collectionBrowserCellMinHeight,
|
|
1219
|
+
29rem
|
|
1220
|
+
);
|
|
1221
|
+
--infiniteScrollerCellMaxHeight: var(
|
|
1222
|
+
--collectionBrowserCellMaxHeight,
|
|
1223
|
+
29rem
|
|
1224
|
+
);
|
|
1225
|
+
}
|
|
1226
|
+
`;
|
|
1227
|
+
__decorate([
|
|
1228
|
+
property({ type: String })
|
|
1229
|
+
], CollectionBrowser.prototype, "baseNavigationUrl", void 0);
|
|
1230
|
+
__decorate([
|
|
1231
|
+
property({ type: String })
|
|
1232
|
+
], CollectionBrowser.prototype, "baseImageUrl", void 0);
|
|
1233
|
+
__decorate([
|
|
1234
|
+
property({ type: Object })
|
|
1235
|
+
], CollectionBrowser.prototype, "searchService", void 0);
|
|
1236
|
+
__decorate([
|
|
1237
|
+
property({ type: String })
|
|
1238
|
+
], CollectionBrowser.prototype, "searchType", void 0);
|
|
1239
|
+
__decorate([
|
|
1240
|
+
property({ type: String })
|
|
1241
|
+
], CollectionBrowser.prototype, "baseQuery", void 0);
|
|
1242
|
+
__decorate([
|
|
1243
|
+
property({ type: String })
|
|
1244
|
+
], CollectionBrowser.prototype, "displayMode", void 0);
|
|
1245
|
+
__decorate([
|
|
1246
|
+
property({ type: Object })
|
|
1247
|
+
], CollectionBrowser.prototype, "sortParam", void 0);
|
|
1248
|
+
__decorate([
|
|
1249
|
+
property({ type: String })
|
|
1250
|
+
], CollectionBrowser.prototype, "selectedSort", void 0);
|
|
1251
|
+
__decorate([
|
|
1252
|
+
property({ type: String })
|
|
1253
|
+
], CollectionBrowser.prototype, "selectedTitleFilter", void 0);
|
|
1254
|
+
__decorate([
|
|
1255
|
+
property({ type: String })
|
|
1256
|
+
], CollectionBrowser.prototype, "selectedCreatorFilter", void 0);
|
|
1257
|
+
__decorate([
|
|
1258
|
+
property({ type: String })
|
|
1259
|
+
], CollectionBrowser.prototype, "sortDirection", void 0);
|
|
1260
|
+
__decorate([
|
|
1261
|
+
property({ type: String })
|
|
1262
|
+
], CollectionBrowser.prototype, "dateRangeQueryClause", void 0);
|
|
1263
|
+
__decorate([
|
|
1264
|
+
property({ type: Number })
|
|
1265
|
+
], CollectionBrowser.prototype, "pageSize", void 0);
|
|
1266
|
+
__decorate([
|
|
1267
|
+
property({ type: Object })
|
|
1268
|
+
], CollectionBrowser.prototype, "resizeObserver", void 0);
|
|
1269
|
+
__decorate([
|
|
1270
|
+
property({ type: String })
|
|
1271
|
+
], CollectionBrowser.prototype, "titleQuery", void 0);
|
|
1272
|
+
__decorate([
|
|
1273
|
+
property({ type: String })
|
|
1274
|
+
], CollectionBrowser.prototype, "creatorQuery", void 0);
|
|
1275
|
+
__decorate([
|
|
1276
|
+
property({ type: Number })
|
|
1277
|
+
], CollectionBrowser.prototype, "currentPage", void 0);
|
|
1278
|
+
__decorate([
|
|
1279
|
+
property({ type: String })
|
|
1280
|
+
], CollectionBrowser.prototype, "minSelectedDate", void 0);
|
|
1281
|
+
__decorate([
|
|
1282
|
+
property({ type: String })
|
|
1283
|
+
], CollectionBrowser.prototype, "maxSelectedDate", void 0);
|
|
1284
|
+
__decorate([
|
|
1285
|
+
property({ type: Object })
|
|
1286
|
+
], CollectionBrowser.prototype, "selectedFacets", void 0);
|
|
1287
|
+
__decorate([
|
|
1288
|
+
property({ type: Boolean })
|
|
1289
|
+
], CollectionBrowser.prototype, "showHistogramDatePicker", void 0);
|
|
1290
|
+
__decorate([
|
|
1291
|
+
property({ type: String, reflect: true })
|
|
1292
|
+
], CollectionBrowser.prototype, "searchContext", void 0);
|
|
1293
|
+
__decorate([
|
|
1294
|
+
property({ type: Object })
|
|
1295
|
+
], CollectionBrowser.prototype, "collectionNameCache", void 0);
|
|
1296
|
+
__decorate([
|
|
1297
|
+
property({ type: String })
|
|
1298
|
+
], CollectionBrowser.prototype, "pageContext", void 0);
|
|
1299
|
+
__decorate([
|
|
1300
|
+
property({ type: Object })
|
|
1301
|
+
], CollectionBrowser.prototype, "restorationStateHandler", void 0);
|
|
1302
|
+
__decorate([
|
|
1303
|
+
property({ type: Number })
|
|
1304
|
+
], CollectionBrowser.prototype, "mobileBreakpoint", void 0);
|
|
1305
|
+
__decorate([
|
|
1306
|
+
property({ type: Boolean })
|
|
1307
|
+
], CollectionBrowser.prototype, "loggedIn", void 0);
|
|
1308
|
+
__decorate([
|
|
1309
|
+
property({ type: Object })
|
|
1310
|
+
], CollectionBrowser.prototype, "modalManager", void 0);
|
|
1311
|
+
__decorate([
|
|
1312
|
+
property({ type: Boolean })
|
|
1313
|
+
], CollectionBrowser.prototype, "isManageView", void 0);
|
|
1314
|
+
__decorate([
|
|
1315
|
+
state()
|
|
1316
|
+
], CollectionBrowser.prototype, "pagesToRender", void 0);
|
|
1317
|
+
__decorate([
|
|
1318
|
+
state()
|
|
1319
|
+
], CollectionBrowser.prototype, "searchResultsLoading", void 0);
|
|
1320
|
+
__decorate([
|
|
1321
|
+
state()
|
|
1322
|
+
], CollectionBrowser.prototype, "facetsLoading", void 0);
|
|
1323
|
+
__decorate([
|
|
1324
|
+
state()
|
|
1325
|
+
], CollectionBrowser.prototype, "fullYearAggregationLoading", void 0);
|
|
1326
|
+
__decorate([
|
|
1327
|
+
state()
|
|
1328
|
+
], CollectionBrowser.prototype, "aggregations", void 0);
|
|
1329
|
+
__decorate([
|
|
1330
|
+
state()
|
|
1331
|
+
], CollectionBrowser.prototype, "fullYearsHistogramAggregation", void 0);
|
|
1332
|
+
__decorate([
|
|
1333
|
+
state()
|
|
1334
|
+
], CollectionBrowser.prototype, "previousSearchType", void 0);
|
|
1335
|
+
__decorate([
|
|
1336
|
+
state()
|
|
1337
|
+
], CollectionBrowser.prototype, "totalResults", void 0);
|
|
1338
|
+
__decorate([
|
|
1339
|
+
state()
|
|
1340
|
+
], CollectionBrowser.prototype, "mobileView", void 0);
|
|
1341
|
+
__decorate([
|
|
1342
|
+
state()
|
|
1343
|
+
], CollectionBrowser.prototype, "mobileFacetsVisible", void 0);
|
|
1344
|
+
__decorate([
|
|
1345
|
+
state()
|
|
1346
|
+
], CollectionBrowser.prototype, "placeholderType", void 0);
|
|
1347
|
+
__decorate([
|
|
1348
|
+
query('#content-container')
|
|
1349
|
+
], CollectionBrowser.prototype, "contentContainer", void 0);
|
|
1350
|
+
__decorate([
|
|
1351
|
+
property({ type: Object, attribute: false })
|
|
1352
|
+
], CollectionBrowser.prototype, "analyticsHandler", void 0);
|
|
1353
|
+
__decorate([
|
|
1354
|
+
query('infinite-scroller')
|
|
1355
|
+
], CollectionBrowser.prototype, "infiniteScroller", void 0);
|
|
1356
|
+
CollectionBrowser = __decorate([
|
|
1357
|
+
customElement('collection-browser')
|
|
1358
|
+
], CollectionBrowser);
|
|
1359
|
+
export { CollectionBrowser };
|
|
1397
1360
|
//# sourceMappingURL=collection-browser.js.map
|