@fluid-topics/ft-search-context 0.3.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/build/ft-search-context.css.d.ts +3 -0
- package/build/ft-search-context.css.js +6 -0
- package/build/ft-search-context.d.ts +32 -0
- package/build/ft-search-context.js +102 -0
- package/build/ft-search-context.light.js +7 -0
- package/build/ft-search-context.min.js +103 -0
- package/build/ft-search-context.properties.d.ts +8 -0
- package/build/ft-search-context.properties.js +2 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +7 -0
- package/build/registration.d.ts +20 -0
- package/build/registration.js +64 -0
- package/build/store/FtSearchStateManager.d.ts +28 -0
- package/build/store/FtSearchStateManager.js +119 -0
- package/build/store/model.d.ts +14 -0
- package/build/store/model.js +2 -0
- package/build/store/redux.d.ts +30 -0
- package/build/store/redux.js +59 -0
- package/build/store/utils/FtSearchService.d.ts +16 -0
- package/build/store/utils/FtSearchService.js +20 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Context block for integrated search components
|
|
2
|
+
|
|
3
|
+
## Install
|
|
4
|
+
|
|
5
|
+
```shell
|
|
6
|
+
npm install @fluid-topics/ft-search-context
|
|
7
|
+
yarn add @fluid-topics/ft-search-context
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { html } from "lit"
|
|
14
|
+
import "@fluid-topics/ft-search-context"
|
|
15
|
+
|
|
16
|
+
function render() {
|
|
17
|
+
return html` <ft-search-context query="foo"></ft-search-context> `
|
|
18
|
+
}
|
|
19
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { PropertyValues } from "lit";
|
|
2
|
+
import { ElementDefinitionsMap, FtLitElementRedux } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtSearchContextProperties } from "./ft-search-context.properties";
|
|
4
|
+
import { FtSearchComponentInterface } from "./registration";
|
|
5
|
+
import { FtSearchFilter, FtSearchRequest, FtSearchSortCriterion } from "@fluid-topics/public-api";
|
|
6
|
+
export declare class LoadErrorEvent extends CustomEvent<Error> {
|
|
7
|
+
constructor(e: Error);
|
|
8
|
+
}
|
|
9
|
+
export declare class SearchRequestChangeEvent extends CustomEvent<FtSearchRequest> {
|
|
10
|
+
constructor(request: FtSearchRequest);
|
|
11
|
+
}
|
|
12
|
+
export declare class FtSearchContext extends FtLitElementRedux implements FtSearchContextProperties {
|
|
13
|
+
static elementDefinitions: ElementDefinitionsMap;
|
|
14
|
+
static styles: import("lit").CSSResult;
|
|
15
|
+
constructor();
|
|
16
|
+
query?: string;
|
|
17
|
+
contentLocale?: string;
|
|
18
|
+
filters?: FtSearchFilter[];
|
|
19
|
+
sort?: FtSearchSortCriterion[];
|
|
20
|
+
private baseUrl;
|
|
21
|
+
private apiIntegrationIdentifier;
|
|
22
|
+
private request?;
|
|
23
|
+
private _stateManager?;
|
|
24
|
+
private get stateManager();
|
|
25
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
26
|
+
protected updated(props: PropertyValues): void;
|
|
27
|
+
protected contentAvailableCallback(props: PropertyValues): void;
|
|
28
|
+
private registerComponent;
|
|
29
|
+
register(component: FtSearchComponentInterface): void;
|
|
30
|
+
private handleLoadError;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ft-search-context.d.ts.map
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { html } from "lit";
|
|
8
|
+
import { property } from "lit/decorators.js";
|
|
9
|
+
import { FtLitElementRedux, jsonProperty, redux } from "@fluid-topics/ft-wc-utils";
|
|
10
|
+
import { styles } from "./ft-search-context.css";
|
|
11
|
+
import { FtSearchStateManager } from "./registration";
|
|
12
|
+
import { ftAppInfoStore } from "@fluid-topics/ft-app-context";
|
|
13
|
+
export class LoadErrorEvent extends CustomEvent {
|
|
14
|
+
constructor(e) {
|
|
15
|
+
super("ft-search-load-error", { detail: e });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class SearchRequestChangeEvent extends CustomEvent {
|
|
19
|
+
constructor(request) {
|
|
20
|
+
super("ft-search-request-change", { detail: request });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export class FtSearchContext extends FtLitElementRedux {
|
|
24
|
+
constructor() {
|
|
25
|
+
super();
|
|
26
|
+
this.baseUrl = "";
|
|
27
|
+
this.apiIntegrationIdentifier = "ft-search";
|
|
28
|
+
this.addStore(ftAppInfoStore);
|
|
29
|
+
}
|
|
30
|
+
get stateManager() {
|
|
31
|
+
if (this._stateManager == null) {
|
|
32
|
+
this._stateManager = FtSearchStateManager.build(this.id || ("" + Math.round(Math.random() * 999000)).padStart(6, "0"));
|
|
33
|
+
this._stateManager.errorHandler = (e) => this.handleLoadError(e);
|
|
34
|
+
this.addStore(this.stateManager.store, "search");
|
|
35
|
+
}
|
|
36
|
+
return this._stateManager;
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
return html `
|
|
40
|
+
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
41
|
+
`;
|
|
42
|
+
}
|
|
43
|
+
updated(props) {
|
|
44
|
+
super.updated(props);
|
|
45
|
+
if (props.has("baseUrl") || props.has("apiIntegrationIdentifier")) {
|
|
46
|
+
this.stateManager.initService(this.baseUrl, this.apiIntegrationIdentifier);
|
|
47
|
+
}
|
|
48
|
+
if (props.has("query") && this.query) {
|
|
49
|
+
this.stateManager.setQuery(this.query);
|
|
50
|
+
}
|
|
51
|
+
if (props.has("contentLocale") && this.contentLocale) {
|
|
52
|
+
this.stateManager.setContentLocale(this.contentLocale);
|
|
53
|
+
}
|
|
54
|
+
if (props.has("filters") && this.filters) {
|
|
55
|
+
this.stateManager.setFilters(this.filters);
|
|
56
|
+
}
|
|
57
|
+
if (props.has("sort") && this.sort) {
|
|
58
|
+
this.stateManager.setSort(this.sort);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
contentAvailableCallback(props) {
|
|
62
|
+
super.contentAvailableCallback(props);
|
|
63
|
+
if (props.has("request") && this.request) {
|
|
64
|
+
this.dispatchEvent(new SearchRequestChangeEvent(this.request));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
registerComponent(e) {
|
|
68
|
+
e.stopPropagation();
|
|
69
|
+
const component = e.composedPath()[0];
|
|
70
|
+
this.register(component);
|
|
71
|
+
}
|
|
72
|
+
register(component) {
|
|
73
|
+
component.setSearchStateManager(this.stateManager);
|
|
74
|
+
}
|
|
75
|
+
handleLoadError(e) {
|
|
76
|
+
this.dispatchEvent(new LoadErrorEvent(e));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
FtSearchContext.elementDefinitions = {};
|
|
80
|
+
FtSearchContext.styles = styles;
|
|
81
|
+
__decorate([
|
|
82
|
+
property()
|
|
83
|
+
], FtSearchContext.prototype, "query", void 0);
|
|
84
|
+
__decorate([
|
|
85
|
+
property()
|
|
86
|
+
], FtSearchContext.prototype, "contentLocale", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
jsonProperty([])
|
|
89
|
+
], FtSearchContext.prototype, "filters", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
jsonProperty([])
|
|
92
|
+
], FtSearchContext.prototype, "sort", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
redux({ store: ftAppInfoStore.name })
|
|
95
|
+
], FtSearchContext.prototype, "baseUrl", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
redux({ store: ftAppInfoStore.name })
|
|
98
|
+
], FtSearchContext.prototype, "apiIntegrationIdentifier", void 0);
|
|
99
|
+
__decorate([
|
|
100
|
+
redux({ store: "search" })
|
|
101
|
+
], FtSearchContext.prototype, "request", void 0);
|
|
102
|
+
//# sourceMappingURL=ft-search-context.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
!function(t,s,e,i){const n=e.css`
|
|
2
|
+
`,o={setRequestQuery:(t,s)=>{t.request.query=s.payload},setRequestContentLocale:(t,s)=>{t.request.contentLocale=s.payload},setRequestSort:(t,s)=>{t.request.sort=s.payload},setRequestFilters:(t,s)=>{t.request.filters=s.payload},setRequestFacets:(t,s)=>{t.request.facets=s.payload},setResults:(t,s)=>{t.results=s.payload},setFacets:(t,s)=>{t.facets=s.payload},setPaging:(t,s)=>{t.paging=s.payload},setLiveQuery:(t,s)=>{t.liveQuery=s.payload},setSuggestResults:(t,s)=>{t.suggestResults=s.payload}};class a{constructor(t){this.api=t}static build(t,s){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");const e=new window.fluidtopics.FluidTopicsApi(t,s,!0);return new a(e)}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}}class r{constructor(t){this.store=t,this.searchDebouncer=new s.Debouncer(10),this.suggestDebouncer=new s.Debouncer(300)}static build(t){return new r((t=>s.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:10}},results:[],facets:[],paging:{totalResultsCount:0,totalClustersCount:0,isLastPage:!1},liveQuery:"",suggestResults:[]},reducers:o}))(t.trim()||"context"))}setQuery(t){this.store.actions.setRequestQuery(t),this.launchSearch()}setContentLocale(t){this.store.actions.setRequestContentLocale(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.launchSearch()}addFacet(t){let s={id:t},e=Array.from(new Set([...this.store.getState().request.facets,s]));this.store.actions.setRequestFacets(e),this.launchSearch()}replaceFacet(t,s){let e=this.store.getState().request.facets.filter((s=>s.id!=t));if(s){let t={id:s};e=Array.from(new Set([...this.store.getState().request.facets,t]))}this.store.actions.setRequestFacets(e),this.launchSearch()}setFilter(t,s){let e=this.store.getState().request.filters,i={key:t,values:s,negative:!1},n=[...e.filter((s=>s.key!==t)),i];this.setFilters(n)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async initService(t,s){this.service=t&&s?a.build(t,s):void 0,await this.launchSearch()}async launchSearch(){this.service&&this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){this.service&&this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){try{let t=await this.service.launchSearch(this.store.getState().request);if(1==t.paging.currentPage)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.lastPage});else{let s=this.store.getState().results.concat(t.results);this.store.actions.setResults(s),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.lastPage})}}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},s=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(s.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var h=function(t,s,e,i){for(var n,o=arguments.length,a=o<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,r=t.length-1;r>=0;r--)(n=t[r])&&(a=(o<3?n(a):o>3?n(s,e,a):n(s,e))||a);return o>3&&a&&Object.defineProperty(s,e,a),a};class l extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const c=Symbol("registerInterval");class u extends(function(t){var s;class e extends t{constructor(){super(...arguments),this[s]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[c]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[c]):this.dispatchEvent(new l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return s=c,h([i.state()],e.prototype,"stateManager",void 0),e}(s.FtLitElementRedux)){}const d=e.css`
|
|
3
|
+
`,v=s.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,s)=>{t.baseUrl=s.payload},setApiIntegrationIdentifier:(t,s)=>{t.apiIntegrationIdentifier=s.payload},setUiLocale:(t,s)=>{t.uiLocale=s.payload},setAvailableUiLocales:(t,s)=>{t.availableUiLocales=s.payload},setEditorMode:(t,s)=>{t.editorMode=s.payload},setNoCustom:(t,s)=>{t.noCustom=s.payload},setNoCustomComponent:(t,s)=>{t.noCustomComponent=s.payload},setSession:(t,s)=>{t.session=s.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class w{static build(t){const{baseUrl:s,apiIntegrationIdentifier:e}=v.getState(),i=null!=t?t:e;if(s&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(s,i,!0)}static get(t){var s;return null!=t?w.build(t):null!==(s=w.API)&&void 0!==s?s:w.API=w.build()}static await(t){return new Promise((s=>{let e=w.get(t);if(e)s(e);else{const i=v.subscribe((()=>{e=w.get(t),e&&(i(),s(e))}))}}))}}var p;const f=Symbol("clearAfterUnitTest");class g{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new s.CacheRegistry,this.listeners={},this.currentUiLocale="",this[p]=()=>{this.defaultMessages={},this.cache=new s.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=v.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const s=t.name.toLowerCase();this.cache.setFinal(s,t),this.notify(s)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var i;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};s.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var n,o,a;t=t.toLowerCase(),this.fetchContext(t);const r=null!==(o=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==o?o:{};return new s.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},r).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var s;return await(null===(s=this.apiProvider())||void 0===s?void 0:s.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,s){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(s),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(s)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>s.delay(0).then((()=>t())).catch((()=>null)))))}}p=f,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new g(w.get));const b=window.FluidTopicsI18nService;var y=function(t,s,e,i){for(var n,o=arguments.length,a=o<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,r=t.length-1;r>=0;r--)(n=t[r])&&(a=(o<3?n(a):o>3?n(s,e,a):n(s,e))||a);return o>3&&a&&Object.defineProperty(s,e,a),a};class C extends s.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>w.get(),this.cache=new s.CacheRegistry,this.cleanSessionDebouncer=new s.Debouncer}render(){return e.html`
|
|
4
|
+
<slot></slot>
|
|
5
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&v.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&v.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&v.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&v.actions.setNoCustom(this.noCustom),t.has("editorMode")&&v.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&v.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&v.actions.setSession(this.session),t.has("availableUiLocales")&&v.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>b.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const s=await t.getCurrentSession();return s.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),s.idleTimeoutInMillis),s}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}C.elementDefinitions={},C.styles=d,y([i.property()],C.prototype,"baseUrl",void 0),y([i.property()],C.prototype,"apiIntegrationIdentifier",void 0),y([i.property()],C.prototype,"uiLocale",void 0),y([s.jsonProperty([])],C.prototype,"availableUiLocales",void 0),y([i.property({type:Boolean})],C.prototype,"editorMode",void 0),y([i.property({type:Boolean})],C.prototype,"noCustom",void 0),y([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],C.prototype,"noCustomComponent",void 0),y([i.property({type:Boolean})],C.prototype,"withManualResources",void 0),y([s.jsonProperty([])],C.prototype,"messageContexts",void 0),y([s.jsonProperty(void 0)],C.prototype,"session",void 0),y([i.property({type:Object})],C.prototype,"apiProvider",void 0),s.customElement("ft-app-context")(C);var m=function(t,s,e,i){for(var n,o=arguments.length,a=o<3?s:null===i?i=Object.getOwnPropertyDescriptor(s,e):i,r=t.length-1;r>=0;r--)(n=t[r])&&(a=(o<3?n(a):o>3?n(s,e,a):n(s,e))||a);return o>3&&a&&Object.defineProperty(s,e,a),a};class S extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class L extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class x extends s.FtLitElementRedux{constructor(){super(),this.baseUrl="",this.apiIntegrationIdentifier="ft-search",this.addStore(v)}get stateManager(){return null==this._stateManager&&(this._stateManager=r.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}render(){return e.html`
|
|
6
|
+
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
7
|
+
`}updated(t){super.updated(t),(t.has("baseUrl")||t.has("apiIntegrationIdentifier"))&&this.stateManager.initService(this.baseUrl,this.apiIntegrationIdentifier),t.has("query")&&this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("filters")&&this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&this.sort&&this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new L(this.request))}registerComponent(t){t.stopPropagation();const s=t.composedPath()[0];this.register(s)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new S(t))}}x.elementDefinitions={},x.styles=n,m([i.property()],x.prototype,"query",void 0),m([i.property()],x.prototype,"contentLocale",void 0),m([s.jsonProperty([])],x.prototype,"filters",void 0),m([s.jsonProperty([])],x.prototype,"sort",void 0),m([s.redux({store:v.name})],x.prototype,"baseUrl",void 0),m([s.redux({store:v.name})],x.prototype,"apiIntegrationIdentifier",void 0),m([s.redux({store:"search"})],x.prototype,"request",void 0),s.customElement("ft-search-context")(x),t.FtSearchContext=x,t.FtSearchContextCssVariables={},t.LoadErrorEvent=S,t.SearchRequestChangeEvent=L,t.styles=n,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators);
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
!function(t){
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
|
|
5
|
+
* This code may only be used under the BSD style license found at
|
|
6
|
+
* http://polymer.github.io/LICENSE.txt
|
|
7
|
+
* The complete set of authors may be found at
|
|
8
|
+
* http://polymer.github.io/AUTHORS.txt
|
|
9
|
+
* The complete set of contributors may be found at
|
|
10
|
+
* http://polymer.github.io/CONTRIBUTORS.txt
|
|
11
|
+
* Code distributed by Google as part of the polymer project is also
|
|
12
|
+
* subject to an additional IP rights grant found at
|
|
13
|
+
* http://polymer.github.io/PATENTS.txt
|
|
14
|
+
*
|
|
15
|
+
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
|
+
*/
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,n=window.customElements,r=new WeakMap,o=new WeakMap,s=new WeakMap,u=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const u=r.prototype.attributeChangedCallback,a=new Set(r.observedAttributes||[]);f(r,a,u);const c={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:u,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,c),this._definitionsByClass.set(r,c);let l=i.call(n,t);l||(l=h(t),e.call(n,t,l)),this===window.customElements&&(s.set(r,c),c.standInClass=l);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)o.delete(t),v(t,c,!0)}const p=this._whenDefinedPromises.get(t);return void 0!==p&&(p.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){b.push(this),n.upgrade.apply(n,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let n=this._awaitingUpgrade.get(e);n||this._awaitingUpgrade.set(e,n=new Set),i?n.add(t):n.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const i=s.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),r.set(e,i),e},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,l=t=>{let e=t.getRootNode();if(!c(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),c(e)||(e=u.get(e)?.getRootNode()||document)}return e.customElements},h=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const n=l(i)||window.customElements,r=n._getDefinition(e);return r?v(i,r):o.set(i,n),i}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){r.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},f=(t,e,i)=>{if(0===e.size||void 0===i)return;const n=t.prototype.setAttribute;n&&(t.prototype.setAttribute=function(t,r){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);n.call(this,o,r),i.call(this,o,t,r)}else n.call(this,o,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);r.call(this,n),i.call(this,n,t,null)}else r.call(this,n)})},d=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(i)},v=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),a=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},p=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=p.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const w=(t,e,i)=>{const n=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=n.apply(i||this,arguments);return void 0!==t&&u.set(t,this),b.pop(),t}};w(ShadowRoot,"createElement",document),w(ShadowRoot,"importNode",document),w(Element,"insertAdjacentHTML");const y=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){b.push(this),i.set.call(this,t),b.pop()}})};if(y(Element,"innerHTML"),y(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const n=e.call(this,...i);return t.set(n,this),n},i.forEach((e=>{const i=window.ElementInternals.prototype,n=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==r.get(i).formAssociated)throw new DOMException(`Failed to execute ${n} on 'ElementInternals': The target element is not a form-associated custom element.`);n?.call(this,...e)}}));class n extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class o{constructor(t){const e=new Map;t.forEach(((t,i)=>{const n=t.getAttribute("name"),r=e.get(n)||[];this[+i]=t,r.push(t),e.set(n,r)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new n(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),e=[];for(const i of t){const t=r.get(i);t&&!0!==t.formAssociated||e.push(i)}return new o(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,i,n)=>{try{e.bind(window.customElements)(t,i,n)}catch(e){console.info(t,i,n,e)}}}class e extends Promise{constructor(t){super(((e,i)=>t((t=>{this.isCanceled?i(new Error("Promise has been canceled")):e(t)}),(t=>{this.isCanceled?i(new Error("Promise has been canceled")):i(t)})))),this.isCanceled=!1}cancel(){this.isCanceled=!0}}class i{constructor(){this.loaders={},this.content={},this.finalContent=new Set}register(t,e){this.loaders[t]=e,this.finalContent.delete(t)}registerFinal(t,e){this.loaders[t]=e,this.finalContent.add(t)}clearAll(){for(let t in this.content)this.clear(t)}clear(t){this.finalContent.has(t)||this.forceClear(t)}forceClear(t){this.content[t]instanceof e&&this.content[t].cancel(),delete this.content[t]}set(t,e){this.forceClear(t),this.register(t,(async()=>e)),this.content[t]=e}setFinal(t,e){this.forceClear(t),this.registerFinal(t,(async()=>e)),this.content[t]=e}async get(t,i){if(void 0===this.content[t]){if(null==(i=null!=i?i:this.loaders[t]))throw new Error("Unknown cache key "+t);const r=(n=i(),new e(((t,e)=>n.then(t).catch(e))));return this.content[t]=r,r.then((e=>(this.content[t]=e,e)))}var n;if(this.content[t]instanceof Error)throw this.content[t];return this.content[t]}isResolvedValue(t){return!(null==t||t instanceof Promise||t instanceof Error)}getNow(t){if(this.isResolvedValue(this.content[t]))return this.content[t]}has(t){return null!=this.content[t]}resolvedKeys(){return Object.keys(this.content).filter((t=>this.isResolvedValue(this.content[t])))}resolvedValues(){return Object.values(this.content).filter((t=>this.isResolvedValue(t)))}keys(){return Object.keys(this.content)}values(){return Object.values(this.content)}}class n{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){return this.callbacks=[t],this.debounce(e)}queue(t,e){return this.callbacks.push(t),this.debounce(e)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,e)=>{this.resolvePromise=t,this.rejectPromise=e}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,e;const i=[...this.callbacks];this.callbacks=[];const n=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,r=null!==(e=this.resolvePromise)&&void 0!==e?e:()=>null;this.clearPromise();for(let t of i)try{await t()}catch(t){return void n(t)}r(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
|
|
18
|
+
/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/const r=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):r(t,e)
|
|
23
|
+
/**
|
|
24
|
+
* @license
|
|
25
|
+
* Copyright 2017 Google LLC
|
|
26
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
+
*/}function s(t){return o({...t,state:!0})}
|
|
28
|
+
/**
|
|
29
|
+
* @license
|
|
30
|
+
* Copyright 2021 Google LLC
|
|
31
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
32
|
+
*/var u;function a(t,e){try{return function(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var i,n,r;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(n=i;0!=n--;)if(!a(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!a(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((i=(r=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(e,r[n]))return!1;for(n=i;0!=n--;){var o=r[n];if(!a(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}null===(u=window.HTMLSlotElement)||void 0===u||u.prototype.assignedElements;const c=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function l(t,e){const i=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!a(t,e),...null!=e?e:{}})}const h=window,f=h.ShadowRoot&&(void 0===h.ShadyCSS||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,d=Symbol(),v=new WeakMap;
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2019 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
|
+
*/class p{constructor(t,e,i){if(this._$cssResult$=!0,i!==d)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(f&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=v.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&v.set(e,t))}return t}toString(){return this.cssText}}const b=t=>new p("string"==typeof t?t:t+"",void 0,d),w=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new p(i,t,d)},y=(t,e)=>{f?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),n=h.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,t.appendChild(i)}))},m=f?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return b(e)})(t):t
|
|
38
|
+
/**
|
|
39
|
+
* @license
|
|
40
|
+
* Copyright 2017 Google LLC
|
|
41
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
42
|
+
*/;var g;const x=window,O=x.trustedTypes,S=O?O.emptyScript:"",j=x.reactiveElementPolyfillSupport,C={toAttribute(t,e){switch(e){case Boolean:t=t?S:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>e!==t&&(e==e||t==t),R={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:E};class N extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=R){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||R}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return y(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=R){var n;const r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){const o=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){const t=n.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=r,this[r]=o.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||E)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2017 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/
|
|
48
|
+
var M;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==j||j({ReactiveElement:N}),(null!==(g=x.reactiveElementVersions)&&void 0!==g?g:x.reactiveElementVersions=[]).push("1.4.1");const A=window,U=A.trustedTypes,k=U?U.createPolicy("lit-html",{createHTML:t=>t}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,L="?"+$,F=`<${L}>`,P=document,_=(t="")=>P.createComment(t),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,T=Array.isArray,B=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,K=/>/g,D=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),q=/'/g,H=/"/g,z=/^(?:script|style|textarea|title)$/i,V=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),J=Symbol.for("lit-noChange"),Z=Symbol.for("lit-nothing"),Q=new WeakMap,X=P.createTreeWalker(P,129,null,!1);class Y{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,o=0;const s=t.length-1,u=this.parts,[a,c]=((t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"<svg>":"",s=B;for(let e=0;e<i;e++){const i=t[e];let u,a,c=-1,l=0;for(;l<i.length&&(s.lastIndex=l,a=s.exec(i),null!==a);)l=s.lastIndex,s===B?"!--"===a[1]?s=W:void 0!==a[1]?s=K:void 0!==a[2]?(z.test(a[2])&&(r=RegExp("</"+a[2],"g")),s=D):void 0!==a[3]&&(s=D):s===D?">"===a[0]?(s=null!=r?r:B,c=-1):void 0===a[1]?c=-2:(c=s.lastIndex-a[2].length,u=a[1],s=void 0===a[3]?D:'"'===a[3]?H:q):s===H||s===q?s=D:s===W||s===K?s=B:(s=D,r=void 0);const h=s===D&&t[e+1].startsWith("/>")?" ":"";o+=s===B?i+F:c>=0?(n.push(u),i.slice(0,c)+"$lit$"+i.slice(c)+$+h):i+$+(-2===c?(n.push(void 0),e):h)}const u=o+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(u):u,n]})(t,e);if(this.el=Y.createElement(a,i),X.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=X.nextNode())&&u.length<s;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith($)){const i=c[o++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split($),e=/([.?@])?(.*)/.exec(i);u.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?nt:"?"===e[1]?ot:"@"===e[1]?st:it})}else u.push({type:6,index:r})}for(const e of t)n.removeAttribute(e)}if(z.test(n.tagName)){const t=n.textContent.split($),e=t.length-1;if(e>0){n.textContent=U?U.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],_()),X.nextNode(),u.push({type:2,index:++r});n.append(t[e],_())}}}else if(8===n.nodeType)if(n.data===L)u.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf($,t+1));)u.push({type:7,index:r}),t+=$.length-1}r++}}static createElement(t,e){const i=P.createElement("template");return i.innerHTML=t,i}}function G(t,e,i=t,n){var r,o,s,u;if(e===J)return e;let a=void 0!==n?null===(r=i._$Co)||void 0===r?void 0:r[n]:i._$Cl;const c=I(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==c&&(null===(o=null==a?void 0:a._$AO)||void 0===o||o.call(a,!1),void 0===c?a=void 0:(a=new c(t),a._$AT(t,i,n)),void 0!==n?(null!==(s=(u=i)._$Co)&&void 0!==s?s:u._$Co=[])[n]=a:i._$Cl=a),void 0!==a&&(e=G(t,a._$AS(t,e.values),a,n)),e}class tt{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,r=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:P).importNode(i,!0);X.currentNode=r;let o=X.nextNode(),s=0,u=0,a=n[0];for(;void 0!==a;){if(s===a.index){let e;2===a.type?e=new et(o,o.nextSibling,this,t):1===a.type?e=new a.ctor(o,a.name,a.strings,this,t):6===a.type&&(e=new ut(o,this,t)),this.u.push(e),a=n[++u]}s!==(null==a?void 0:a.index)&&(o=X.nextNode(),s++)}return r}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,n){var r;this.type=2,this._$AH=Z,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cm=null===(r=null==n?void 0:n.isConnected)||void 0===r||r}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=G(this,t,e),I(t)?t===Z||null==t||""===t?(this._$AH!==Z&&this._$AR(),this._$AH=Z):t!==this._$AH&&t!==J&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>T(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==Z&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Y.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===r)this._$AH.p(i);else{const t=new tt(r,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=Q.get(t.strings);return void 0===e&&Q.set(t.strings,e=new Y(t)),e}k(t){T(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new et(this.O(_()),this.O(_()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,n,r){this.type=1,this._$AH=Z,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Z}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=G(this,t,e,0),o=!I(t)||t!==this._$AH&&t!==J,o&&(this._$AH=t);else{const n=t;let s,u;for(t=r[0],s=0;s<r.length-1;s++)u=G(this,n[i+s],e,s),u===J&&(u=this._$AH[s]),o||(o=!I(u)||u!==this._$AH[s]),u===Z?t=Z:t!==Z&&(t+=(null!=u?u:"")+r[s+1]),this._$AH[s]=u}o&&!n&&this.j(t)}j(t){t===Z?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class nt extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===Z?void 0:t}}const rt=U?U.emptyScript:"";class ot extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==Z?this.element.setAttribute(this.name,rt):this.element.removeAttribute(this.name)}}class st extends it{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=G(this,t,e,0))&&void 0!==i?i:Z)===J)return;const n=this._$AH,r=t===Z&&n!==Z||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,o=t!==Z&&(n===Z||r);r&&this.element.removeEventListener(this.name,this,n),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class ut{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){G(this,t)}}const at=A.litHtmlPolyfillSupport;null==at||at(Y,et),(null!==(M=A.litHtmlVersions)&&void 0!==M?M:A.litHtmlVersions=[]).push("2.4.0");
|
|
49
|
+
/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright 2017 Google LLC
|
|
52
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
+
*/
|
|
54
|
+
var ct,lt;class ht extends N{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,r;const o=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let s=o._$litPart$;if(void 0===s){const t=null!==(r=null==i?void 0:i.renderBefore)&&void 0!==r?r:null;o._$litPart$=s=new et(e.insertBefore(_(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return J}}ht.finalized=!0,ht._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:ht});const ft=globalThis.litElementPolyfillSupport;null==ft||ft({LitElement:ht}),(null!==(lt=globalThis.litElementVersions)&&void 0!==lt?lt:globalThis.litElementVersions=[]).push("3.2.2");class dt{static create(t,e,i){let n=t=>b(null!=t?t:i),r=w`var(${b(t)}, ${n(i)})`;return r.name=t,r.category=e,r.defaultValue=i,r.defaultCssValue=n,r.get=e=>w`var(${b(t)}, ${n(e)})`,r.breadcrumb=()=>[],r.lastResortDefaultValue=()=>i,r}static extend(t,e,i){let n=t=>e.get(null!=t?t:i),r=w`var(${b(t)}, ${n(i)})`;return r.name=t,r.category=e.category,r.fallbackVariable=e,r.defaultValue=i,r.defaultCssValue=n,r.get=e=>w`var(${b(t)}, ${n(e)})`,r.breadcrumb=()=>[e.name,...e.breadcrumb()],r.lastResortDefaultValue=()=>i,r}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):b(null!=e?e:t.defaultValue),n=w`var(${b(t.name)}, ${i(t.defaultValue)})`;return n.name=t.name,n.category=t.category,n.fallbackVariable=t.fallbackVariable,n.defaultValue=t.defaultValue,n.context=e,n.defaultCssValue=i,n.get=e=>w`var(${b(t.name)}, ${i(e)})`,n.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],n.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},n}}dt.create("--ft-color-primary","COLOR","#2196F3"),dt.create("--ft-color-primary-variant","COLOR","#1976D2"),dt.create("--ft-color-secondary","COLOR","#FFCC80"),dt.create("--ft-color-secondary-variant","COLOR","#F57C00"),dt.create("--ft-color-surface","COLOR","#FFFFFF"),dt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),dt.create("--ft-color-error","COLOR","#B00020"),dt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),dt.create("--ft-color-opacity-high","NUMBER","1"),dt.create("--ft-color-opacity-medium","NUMBER","0.74"),dt.create("--ft-color-opacity-disabled","NUMBER","0.38"),dt.create("--ft-color-on-primary","COLOR","#FFFFFF"),dt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),dt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),dt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),dt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),dt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),dt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),dt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),dt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),dt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),dt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),dt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),dt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),dt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),dt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),dt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),dt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),dt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),dt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),dt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),dt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),dt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),dt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),dt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),dt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),dt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),dt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),dt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),dt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),dt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),dt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),dt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),dt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),dt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),dt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),dt.create("--ft-border-radius-S","SIZE","4px"),dt.create("--ft-border-radius-M","SIZE","8px"),dt.create("--ft-border-radius-L","SIZE","12px"),dt.create("--ft-border-radius-XL","SIZE","16px"),dt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),dt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),dt.create("--ft-transition-duration","UNKNOWN","250ms"),dt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");var vt=function(t,e,i,n){for(var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class pt extends(
|
|
55
|
+
/**
|
|
56
|
+
* @license
|
|
57
|
+
* Copyright 2021 Google LLC
|
|
58
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
+
*/
|
|
60
|
+
function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:n}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,i])=>t.registry.define(e,i))));const r=this.renderOptions.creationScope=this.attachShadow({...n,customElements:t.registry});return y(r,this.constructor.elementStyles),r}}}(ht)){constructor(){super(),this.exportpartsDebouncer=new n(5),this.constructorName=this.constructor.name,this.constructorPrototype=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this.constructorName&&Object.setPrototypeOf(this,this.constructorPrototype)}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),V`
|
|
61
|
+
${t.map((t=>V`
|
|
62
|
+
<style>${t}</style>
|
|
63
|
+
`))}
|
|
64
|
+
${this.getTemplate()}
|
|
65
|
+
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,n,r,o,s;const u=t=>null!=t&&t.trim().length>0,a=t.filter(u).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const c=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(r=null===(n=t.getAttribute("part"))||void 0===n?void 0:n.split(" "))&&void 0!==r?r:[],i=null!==(s=null===(o=t.getAttribute("exportparts"))||void 0===o?void 0:o.split(",").map((t=>t.split(":")[1])))&&void 0!==s?s:[];new Array(...e,...i).filter(u).map((t=>t.trim())).forEach((t=>c.add(t)))}if(0===c.size)return void this.removeAttribute("exportparts");const l=[...c.values()].flatMap((t=>a.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...l].join(", "))}}vt([o()],pt.prototype,"exportpartsPrefix",void 0),vt([l([])],pt.prototype,"exportpartsPrefixes",void 0),vt([o()],pt.prototype,"customStylesheet",void 0),w`
|
|
66
|
+
.ft-no-text-select {
|
|
67
|
+
-webkit-touch-callout: none;
|
|
68
|
+
-webkit-user-select: none;
|
|
69
|
+
-khtml-user-select: none;
|
|
70
|
+
-moz-user-select: none;
|
|
71
|
+
-ms-user-select: none;
|
|
72
|
+
user-select: none;
|
|
73
|
+
}
|
|
74
|
+
`,w`
|
|
75
|
+
.ft-word-wrap {
|
|
76
|
+
white-space: normal;
|
|
77
|
+
word-wrap: break-word;
|
|
78
|
+
-ms-word-break: break-all;
|
|
79
|
+
word-break: break-all;
|
|
80
|
+
word-break: break-word;
|
|
81
|
+
-ms-hyphens: auto;
|
|
82
|
+
-moz-hyphens: auto;
|
|
83
|
+
-webkit-hyphens: auto;
|
|
84
|
+
hyphens: auto
|
|
85
|
+
}
|
|
86
|
+
`,w`
|
|
87
|
+
.ft-safari-ellipsis-fix {
|
|
88
|
+
margin-right: 0;
|
|
89
|
+
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ft-safari-ellipsis-fix:after {
|
|
93
|
+
content: "\\0000a0";
|
|
94
|
+
display: inline-block;
|
|
95
|
+
width: 0;
|
|
96
|
+
}
|
|
97
|
+
`;class bt{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,n;t=this.resolvePluralKey(t,e);let r=null!==(n=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==n?n:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,i)=>this.formatValue(t,i))))),r}resolvePluralKey(t,e){for(let i of e)if("number"==typeof i){const e=`${t}[\\=${i}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const i=i=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(i):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(i):t.toLocaleString(i);try{return i(document.documentElement.lang)}catch(t){return i()}}}function wt(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(i.length?" "+i.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function yt(t){return!!t&&!!t[re]}function mt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===oe}(t)||Array.isArray(t)||!!t[ne]||!!t.constructor[ne]||Ct(t)||Et(t))}function gt(t,e,i){void 0===i&&(i=!1),0===xt(t)?(i?Object.keys:se)(t).forEach((function(n){i&&"symbol"==typeof n||e(n,t[n],t)})):t.forEach((function(i,n){return e(n,i,t)}))}function xt(t){var e=t[re];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Ct(t)?2:Et(t)?3:0}function Ot(t,e){return 2===xt(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function St(t,e,i){var n=xt(t);2===n?t.set(e,i):3===n?(t.delete(e),t.add(i)):t[e]=i}function jt(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function Ct(t){return Gt&&t instanceof Map}function Et(t){return te&&t instanceof Set}function Rt(t){return t.o||t.t}function Nt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=ue(t);delete e[re];for(var i=se(e),n=0;n<i.length;n++){var r=i[n],o=e[r];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[r]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function Mt(t,e){return void 0===e&&(e=!1),Ut(t)||yt(t)||!mt(t)||(xt(t)>1&&(t.set=t.add=t.clear=t.delete=At),Object.freeze(t),e&>(t,(function(t,e){return Mt(e,!0)}),!0)),t}function At(){wt(2)}function Ut(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function kt(t){var e=ae[t];return e||wt(18,t),e}function $t(){return Xt}function Lt(t,e){e&&(kt("Patches"),t.u=[],t.s=[],t.v=e)}function Ft(t){Pt(t),t.p.forEach(It),t.p=null}function Pt(t){t===Xt&&(Xt=t.l)}function _t(t){return Xt={p:[],l:Xt,h:t,m:!0,_:0}}function It(t){var e=t[re];0===e.i||1===e.i?e.j():e.O=!0}function Tt(t,e){e._=e.p.length;var i=e.p[0],n=void 0!==t&&t!==i;return e.h.g||kt("ES5").S(e,t,n),n?(i[re].P&&(Ft(e),wt(4)),mt(t)&&(t=Bt(e,t),e.l||Kt(e,t)),e.u&&kt("Patches").M(i[re].t,t,e.u,e.s)):t=Bt(e,i,[]),Ft(e),e.u&&e.v(e.u,e.s),t!==ie?t:void 0}function Bt(t,e,i){if(Ut(e))return e;var n=e[re];if(!n)return gt(e,(function(r,o){return Wt(t,n,e,r,o,i)}),!0),e;if(n.A!==t)return e;if(!n.P)return Kt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var r=4===n.i||5===n.i?n.o=Nt(n.k):n.o;gt(3===n.i?new Set(r):r,(function(e,o){return Wt(t,n,r,e,o,i)})),Kt(t,r,!1),i&&t.u&&kt("Patches").R(n,i,t.u,t.s)}return n.o}function Wt(t,e,i,n,r,o){if(yt(r)){var s=Bt(t,r,o&&e&&3!==e.i&&!Ot(e.D,n)?o.concat(n):void 0);if(St(i,n,s),!yt(s))return;t.m=!1}if(mt(r)&&!Ut(r)){if(!t.h.F&&t._<1)return;Bt(t,r),e&&e.A.l||Kt(t,r)}}function Kt(t,e,i){void 0===i&&(i=!1),t.h.F&&t.m&&Mt(e,i)}function Dt(t,e){var i=t[re];return(i?Rt(i):t)[e]}function qt(t,e){if(e in t)for(var i=Object.getPrototypeOf(t);i;){var n=Object.getOwnPropertyDescriptor(i,e);if(n)return n;i=Object.getPrototypeOf(i)}}function Ht(t){t.P||(t.P=!0,t.l&&Ht(t.l))}function zt(t){t.o||(t.o=Nt(t.t))}function Vt(t,e,i){var n=Ct(e)?kt("MapSet").N(e,i):Et(e)?kt("MapSet").T(e,i):t.g?function(t,e){var i=Array.isArray(t),n={i:i?1:0,A:e?e.A:$t(),P:!1,I:!1,D:{},l:e,t,k:null,o:null,j:null,C:!1},r=n,o=ce;i&&(r=[n],o=le);var s=Proxy.revocable(r,o),u=s.revoke,a=s.proxy;return n.k=a,n.j=u,a}(e,i):kt("ES5").J(e,i);return(i?i.A:$t()).p.push(n),n}function Jt(t){return yt(t)||wt(22,t),function t(e){if(!mt(e))return e;var i,n=e[re],r=xt(e);if(n){if(!n.P&&(n.i<4||!kt("ES5").K(n)))return n.t;n.I=!0,i=Zt(e,r),n.I=!1}else i=Zt(e,r);return gt(i,(function(e,r){n&&function(t,e){return 2===xt(t)?t.get(e):t[e]}(n.t,e)===r||St(i,e,t(r))})),3===r?new Set(i):i}(t)}function Zt(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Nt(t)}var Qt,Xt,Yt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Gt="undefined"!=typeof Map,te="undefined"!=typeof Set,ee="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,ie=Yt?Symbol.for("immer-nothing"):((Qt={})["immer-nothing"]=!0,Qt),ne=Yt?Symbol.for("immer-draftable"):"__$immer_draftable",re=Yt?Symbol.for("immer-state"):"__$immer_state",oe=""+Object.prototype.constructor,se="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,ue=Object.getOwnPropertyDescriptors||function(t){var e={};return se(t).forEach((function(i){e[i]=Object.getOwnPropertyDescriptor(t,i)})),e},ae={},ce={get:function(t,e){if(e===re)return t;var i=Rt(t);if(!Ot(i,e))return function(t,e,i){var n,r=qt(e,i);return r?"value"in r?r.value:null===(n=r.get)||void 0===n?void 0:n.call(t.k):void 0}(t,i,e);var n=i[e];return t.I||!mt(n)?n:n===Dt(t.t,e)?(zt(t),t.o[e]=Vt(t.A.h,n,t)):n},has:function(t,e){return e in Rt(t)},ownKeys:function(t){return Reflect.ownKeys(Rt(t))},set:function(t,e,i){var n=qt(Rt(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,i),!0;if(!t.P){var r=Dt(Rt(t),e),o=null==r?void 0:r[re];if(o&&o.t===i)return t.o[e]=i,t.D[e]=!1,!0;if(jt(i,r)&&(void 0!==i||Ot(t.t,e)))return!0;zt(t),Ht(t)}return t.o[e]===i&&"number"!=typeof i&&(void 0!==i||e in t.o)||(t.o[e]=i,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==Dt(t.t,e)||e in t.t?(t.D[e]=!1,zt(t),Ht(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var i=Rt(t),n=Reflect.getOwnPropertyDescriptor(i,e);return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:i[e]}:n},defineProperty:function(){wt(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){wt(12)}},le={};gt(ce,(function(t,e){le[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),le.deleteProperty=function(t,e){return le.set.call(this,t,e,void 0)},le.set=function(t,e,i){return ce.set.call(this,t[0],e,i,t[0])};var he=function(){function t(t){var e=this;this.g=ee,this.F=!0,this.produce=function(t,i,n){if("function"==typeof t&&"function"!=typeof i){var r=i;i=t;var o=e;return function(t){var e=this;void 0===t&&(t=r);for(var n=arguments.length,s=Array(n>1?n-1:0),u=1;u<n;u++)s[u-1]=arguments[u];return o.produce(t,(function(t){var n;return(n=i).call.apply(n,[e,t].concat(s))}))}}var s;if("function"!=typeof i&&wt(6),void 0!==n&&"function"!=typeof n&&wt(7),mt(t)){var u=_t(e),a=Vt(e,t,void 0),c=!0;try{s=i(a),c=!1}finally{c?Ft(u):Pt(u)}return"undefined"!=typeof Promise&&s instanceof Promise?s.then((function(t){return Lt(u,n),Tt(t,u)}),(function(t){throw Ft(u),t})):(Lt(u,n),Tt(s,u))}if(!t||"object"!=typeof t){if(void 0===(s=i(t))&&(s=t),s===ie&&(s=void 0),e.F&&Mt(s,!0),n){var l=[],h=[];kt("Patches").M(t,s,l,h),n(l,h)}return s}wt(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return e.produceWithPatches(i,(function(e){return t.apply(void 0,[e].concat(r))}))};var n,r,o=e.produce(t,i,(function(t,e){n=t,r=e}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(t){return[t,n,r]})):[o,n,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){mt(t)||wt(8),yt(t)&&(t=Jt(t));var e=_t(this),i=Vt(this,t,void 0);return i[re].C=!0,Pt(e),i},e.finishDraft=function(t,e){var i=(t&&t[re]).A;return Lt(i,e),Tt(void 0,i)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!ee&&wt(20),this.g=t},e.applyPatches=function(t,e){var i;for(i=e.length-1;i>=0;i--){var n=e[i];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}i>-1&&(e=e.slice(i+1));var r=kt("Patches").$;return yt(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),fe=new he,de=fe.produce;fe.produceWithPatches.bind(fe),fe.setAutoFreeze.bind(fe),fe.setUseProxies.bind(fe),fe.applyPatches.bind(fe),fe.createDraft.bind(fe),fe.finishDraft.bind(fe);var ve=de;function pe(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function be(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function we(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?be(Object(i),!0).forEach((function(e){pe(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):be(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function ye(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var me="function"==typeof Symbol&&Symbol.observable||"@@observable",ge=function(){return Math.random().toString(36).substring(7).split("").join(".")},xe={INIT:"@@redux/INIT"+ge(),REPLACE:"@@redux/REPLACE"+ge(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ge()}};function Oe(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Se(t,e,i){var n;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(ye(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(ye(1));return i(Se)(t,e)}if("function"!=typeof t)throw new Error(ye(2));var r=t,o=e,s=[],u=s,a=!1;function c(){u===s&&(u=s.slice())}function l(){if(a)throw new Error(ye(3));return o}function h(t){if("function"!=typeof t)throw new Error(ye(4));if(a)throw new Error(ye(5));var e=!0;return c(),u.push(t),function(){if(e){if(a)throw new Error(ye(6));e=!1,c();var i=u.indexOf(t);u.splice(i,1),s=null}}}function f(t){if(!Oe(t))throw new Error(ye(7));if(void 0===t.type)throw new Error(ye(8));if(a)throw new Error(ye(9));try{a=!0,o=r(o,t)}finally{a=!1}for(var e=s=u,i=0;i<e.length;i++){(0,e[i])()}return t}function d(t){if("function"!=typeof t)throw new Error(ye(10));r=t,f({type:xe.REPLACE})}function v(){var t,e=h;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(ye(11));function i(){t.next&&t.next(l())}return i(),{unsubscribe:e(i)}}})[me]=function(){return this},t}return f({type:xe.INIT}),(n={dispatch:f,subscribe:h,getState:l,replaceReducer:d})[me]=v,n}function je(t){for(var e=Object.keys(t),i={},n=0;n<e.length;n++){var r=e[n];"function"==typeof t[r]&&(i[r]=t[r])}var o,s=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:xe.INIT}))throw new Error(ye(12));if(void 0===i(void 0,{type:xe.PROBE_UNKNOWN_ACTION()}))throw new Error(ye(13))}))}(i)}catch(t){o=t}return function(t,e){if(void 0===t&&(t={}),o)throw o;for(var n=!1,r={},u=0;u<s.length;u++){var a=s[u],c=i[a],l=t[a],h=c(l,e);if(void 0===h)throw e&&e.type,new Error(ye(14));r[a]=h,n=n||h!==l}return(n=n||s.length!==Object.keys(t).length)?r:t}}function Ce(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function Ee(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),n=function(){throw new Error(ye(15))},r={getState:i.getState,dispatch:function(){return n.apply(void 0,arguments)}},o=e.map((function(t){return t(r)}));return n=Ce.apply(void 0,o)(i.dispatch),we(we({},i),{},{dispatch:n})}}}function Re(t){return function(e){var i=e.dispatch,n=e.getState;return function(e){return function(r){return"function"==typeof r?r(i,n,t):e(r)}}}}var Ne=Re();Ne.withExtraArgument=Re;var Me,Ae=Ne,Ue=(Me=function(t,e){return Me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},Me(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}Me(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),ke=function(t,e){for(var i=0,n=e.length,r=t.length;i<n;i++,r++)t[r]=e[i];return t},$e=Object.defineProperty,Le=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,_e=function(t,e,i){return e in t?$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},Ie=function(t,e){for(var i in e||(e={}))Fe.call(e,i)&&_e(t,i,e[i]);if(Le)for(var n=0,r=Le(e);n<r.length;n++){i=r[n];Pe.call(e,i)&&_e(t,i,e[i])}return t},Te="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Ce:Ce.apply(null,arguments)};var Be=function(t){function e(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];var r=t.apply(this,i)||this;return Object.setPrototypeOf(r,e.prototype),r}return Ue(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,ke([void 0],t[0].concat(this)))):new(e.bind.apply(e,ke([void 0],t.concat(this))))},e}(Array);function We(t){return mt(t)?ve(t,(function(){})):t}function Ke(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,i=void 0===e||e;t.immutableCheck,t.serializableCheck;var n=new Be;i&&(!function(t){return"boolean"==typeof t}(i)?n.push(Ae.withExtraArgument(i.extraArgument)):n.push(Ae));return n}(t)}}function De(t){var e,i=Ke(),n=t||{},r=n.reducer,o=void 0===r?void 0:r,s=n.middleware,u=void 0===s?i():s,a=n.devTools,c=void 0===a||a,l=n.preloadedState,h=void 0===l?void 0:l,f=n.enhancers,d=void 0===f?void 0:f;if("function"==typeof o)e=o;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var i=e;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return e===i}(o))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=je(o)}var v=u;"function"==typeof v&&(v=v(i));var p=Ee.apply(void 0,v),b=Ce;c&&(b=Te(Ie({trace:!1},"object"==typeof c&&c)));var w=[p];return Array.isArray(d)?w=ke([p],d):"function"==typeof d&&(w=d(w)),Se(e,h,b.apply(void 0,w))}function qe(t,e){function i(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];if(e){var r=e.apply(void 0,i);if(!r)throw new Error("prepareAction did not return an object");return Ie(Ie({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(e){return e.type===t},i}function He(t){var e,i={},n=[],r={addCase:function(t,e){var n="string"==typeof t?t:t.type;if(n in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[n]=e,r},addMatcher:function(t,e){return n.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[i,n,e]}function ze(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var i,n="function"==typeof t.initialState?t.initialState:We(t.initialState),r=t.reducers||{},o=Object.keys(r),s={},u={},a={};function c(){var e="function"==typeof t.extraReducers?He(t.extraReducers):[t.extraReducers],i=e[0],r=void 0===i?{}:i,o=e[1],s=void 0===o?[]:o,a=e[2],c=void 0===a?void 0:a,l=Ie(Ie({},r),u);return function(t,e,i,n){void 0===i&&(i=[]);var r,o="function"==typeof e?He(e):[e,i,n],s=o[0],u=o[1],a=o[2];if(function(t){return"function"==typeof t}(t))r=function(){return We(t())};else{var c=We(t);r=function(){return c}}function l(t,e){void 0===t&&(t=r());var i=ke([s[e.type]],u.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[a]),i.reduce((function(t,i){if(i){var n;if(yt(t))return void 0===(n=i(t,e))?t:n;if(mt(t))return ve(t,(function(t){return i(t,e)}));if(void 0===(n=i(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return t}),t)}return l.getInitialState=r,l}(n,l,s,c)}return o.forEach((function(t){var i,n,o=r[t],c=e+"/"+t;"reducer"in o?(i=o.reducer,n=o.prepare):i=o,s[t]=i,u[c]=i,a[t]=n?qe(c,n):qe(c)})),{name:e,reducer:function(t,e){return i||(i=c()),i(t,e)},actions:a,caseReducers:s,getInitialState:function(){return i||(i=c()),i.getInitialState()}}}var Ve="listenerMiddleware";qe(Ve+"/add"),qe(Ve+"/removeAll"),qe(Ve+"/remove"),function(){function t(t,e){var i=r[t];return i?i.enumerable=e:r[t]=i={configurable:!0,enumerable:e,get:function(){var e=this[re];return ce.get(e,t)},set:function(e){var i=this[re];ce.set(i,t,e)}},i}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][re];if(!r.P)switch(r.i){case 5:n(r)&&Ht(r);break;case 4:i(r)&&Ht(r)}}}function i(t){for(var e=t.t,i=t.k,n=se(i),r=n.length-1;r>=0;r--){var o=n[r];if(o!==re){var s=e[o];if(void 0===s&&!Ot(e,o))return!0;var u=i[o],a=u&&u[re];if(a?a.t!==s:!jt(u,s))return!0}}var c=!!e[re];return n.length!==se(e).length+(c?0:1)}function n(t){var e=t.k;if(e.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(e,e.length-1);if(i&&!i.get)return!0;for(var n=0;n<e.length;n++)if(!e.hasOwnProperty(n))return!0;return!1}var r={};!function(t,e){ae[t]||(ae[t]=e)}("ES5",{J:function(e,i){var n=Array.isArray(e),r=function(e,i){if(e){for(var n=Array(i.length),r=0;r<i.length;r++)Object.defineProperty(n,""+r,t(r,!0));return n}var o=ue(i);delete o[re];for(var s=se(o),u=0;u<s.length;u++){var a=s[u];o[a]=t(a,e||!!o[a].enumerable)}return Object.create(Object.getPrototypeOf(i),o)}(n,e),o={i:n?5:4,A:i?i.A:$t(),P:!1,I:!1,D:{},l:i,t:e,k:r,o:null,O:!1,C:!1};return Object.defineProperty(r,re,{value:o,writable:!0}),r},S:function(t,i,r){r?yt(i)&&i[re].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var i=e[re];if(i){var r=i.t,o=i.k,s=i.D,u=i.i;if(4===u)gt(o,(function(e){e!==re&&(void 0!==r[e]||Ot(r,e)?s[e]||t(o[e]):(s[e]=!0,Ht(i)))})),gt(r,(function(t){void 0!==o[t]||Ot(o,t)||(s[t]=!1,Ht(i))}));else if(5===u){if(n(i)&&(Ht(i),s.length=!0),o.length<r.length)for(var a=o.length;a<r.length;a++)s[a]=!1;else for(var c=r.length;c<o.length;c++)s[c]=!0;for(var l=Math.min(o.length,r.length),h=0;h<l;h++)o.hasOwnProperty(h)||(s[h]=!0),void 0===s[h]&&t(o[h])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?i(t):n(t)}})}();const Je=t=>"object"==typeof t&&(0===Object.keys(t).length||"string"==typeof t.store||null!=t.selector||"function"==typeof t.hasChanged||null!=t.attribute),Ze=(t,e)=>{var i;const n=Je(t)?t:{};return e=null!==(i=null!=e?e:n.hasChanged)&&void 0!==i?i:(t,e)=>!a(t,e),(i,r)=>{var o,s;i.constructor.createProperty(r,{hasChanged:e,attribute:null!==(o=n.attribute)&&void 0!==o&&o});const u=i;u.reduxProperties=u.reduxProperties||new Map;const a=null!==(s=Je(t)?n.selector:t)&&void 0!==s?s:t=>t[r];u.reduxProperties.set(r,{selector:a,store:n.store})}};class Qe extends pt{constructor(){super(...arguments),this.internalStoresUnsubscribers=new Map,this.internalStores=new Map}getUnnamedStore(){if(this.internalStores.size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this.internalStores.values()][0]}get store(){return this.getUnnamedStore()}set store(t){this.unsubscribeFromStores(),this.internalStores.clear(),t&&this.addStore(t)}getStore(t){var e;return null==t?null!==(e=this.getUnnamedStore())&&void 0!==e?e:this.store:this.internalStores.get(t)}addStore(t,e){e=null!=e?e:Xe(t)?t.name:"ft-lit-element-redux-default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:Xe(t)?t.name:"ft-lit-element-redux-default-store";this.unsubscribeFromStore(e),this.internalStores.delete(e)}setupStore(t,e){this.internalStores.set(t,e),this.updateFromStores(),this.subscribeToStore(t,e)}setupStores(){this.unsubscribeFromStores(),0===this.internalStores.size&&null!=this.store?this.addStore(this.store):(this.updateFromStores(),this.internalStores.forEach(((t,e)=>this.subscribeToStore(e,t))))}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){this.internalStoresUnsubscribers.set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this.internalStoresUnsubscribers).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this.internalStoresUnsubscribers.has(t)&&this.internalStoresUnsubscribers.get(t)(),this.internalStoresUnsubscribers.delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}function Xe(t){var e;return null===(e=t)||void 0===e?void 0:e.isFtReduxStore}class Ye{constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,i)=>{const n=t[e];if(n)return(...t)=>{const e=n(...t);return this.reduxStore.dispatch(e),e}}})}static get(t){window.ftReduxStores||(window.ftReduxStores={});const e="string"==typeof t?t:t.name,i="string"==typeof t?void 0:t,n=window.ftReduxStores[e];if(Xe(n))return n;if(null==i)return;const r=ze(i);if(n)return new Ye(r,n);const o=De({reducer:r.reducer});return window.ftReduxStores[i.name]=new Ye(r,o)}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}var Ge,ti;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(ti=null===(Ge=window.safari)||void 0===Ge?void 0:Ge.pushNotification)||void 0===ti||ti.toString());const ei=w`
|
|
98
|
+
`,ii={setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.filters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setResults:(t,e)=>{t.results=e.payload},setFacets:(t,e)=>{t.facets=e.payload},setPaging:(t,e)=>{t.paging=e.payload},setLiveQuery:(t,e)=>{t.liveQuery=e.payload},setSuggestResults:(t,e)=>{t.suggestResults=e.payload}};class ni{constructor(t){this.api=t}static build(t,e){if(null==window.fluidtopics)throw console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api"),new Error("Fluid Topics public API not found");const i=new window.fluidtopics.FluidTopicsApi(t,e,!0);return new ni(i)}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}}class ri{constructor(t){this.store=t,this.searchDebouncer=new n(10),this.suggestDebouncer=new n(300)}static build(t){return new ri((t=>Ye.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:10}},results:[],facets:[],paging:{totalResultsCount:0,totalClustersCount:0,isLastPage:!1},liveQuery:"",suggestResults:[]},reducers:ii}))(t.trim()||"context"))}setQuery(t){this.store.actions.setRequestQuery(t),this.launchSearch()}setContentLocale(t){this.store.actions.setRequestContentLocale(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.launchSearch()}setFilters(t){this.store.actions.setRequestFilters(t),this.launchSearch()}addFacet(t){let e={id:t},i=Array.from(new Set([...this.store.getState().request.facets,e]));this.store.actions.setRequestFacets(i),this.launchSearch()}replaceFacet(t,e){let i=this.store.getState().request.facets.filter((e=>e.id!=t));if(e){let t={id:e};i=Array.from(new Set([...this.store.getState().request.facets,t]))}this.store.actions.setRequestFacets(i),this.launchSearch()}setFilter(t,e){let i=this.store.getState().request.filters,n={key:t,values:e,negative:!1},r=[...i.filter((e=>e.key!==t)),n];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}async initService(t,e){this.service=t&&e?ni.build(t,e):void 0,await this.launchSearch()}async launchSearch(){this.service&&this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){this.service&&this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){try{let t=await this.service.launchSearch(this.store.getState().request);if(1==t.paging.currentPage)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.lastPage});else{let e=this.store.getState().results.concat(t.results);this.store.actions.setResults(e),this.store.actions.setPaging({totalResultsCount:t.paging.totalResultsCount,totalClustersCount:t.paging.totalClustersCount,isLastPage:t.paging.lastPage})}}catch(t){this.errorHandler&&this.errorHandler(t)}}async fetchSuggestData(){try{let t={input:this.store.getState().liveQuery,filters:this.store.getState().request.filters,sort:this.store.getState().request.sort,contentLocale:this.store.getState().request.contentLocale},e=await this.service.launchSuggest(t);this.store.actions.setSuggestResults(e.suggestions)}catch(t){this.errorHandler&&this.errorHandler(t)}}}var oi=function(t,e,i,n){for(var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class si extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const ui=Symbol("registerInterval");class ai extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[ui]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[ui]):this.dispatchEvent(new si)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=ui,oi([s()],i.prototype,"stateManager",void 0),i}(Qe)){}const ci=w`
|
|
99
|
+
`,li=Ye.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class hi{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=li.getState(),n=null!=t?t:i;if(e&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,n,!0)}static get(t){var e;return null!=t?hi.build(t):null!==(e=hi.API)&&void 0!==e?e:hi.API=hi.build()}static await(t){return new Promise((e=>{let i=hi.get(t);if(i)e(i);else{const n=li.subscribe((()=>{i=hi.get(t),i&&(n(),e(i))}))}}))}}var fi;const di=Symbol("clearAfterUnitTest");class vi{constructor(t){this.apiProvider=t,this.defaultMessages={},this.cache=new i,this.listeners={},this.currentUiLocale="",this[fi]=()=>{this.defaultMessages={},this.cache=new i,this.listeners={}},this.currentUiLocale=li.getState().uiLocale,li.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=li.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var i;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};a(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var n,r,o;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(r=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==r?r:{};return new bt(null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},s).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(async()=>{var e;return await(null===(e=this.apiProvider())||void 0===e?void 0:e.getFluidTopicsMessageContext(this.currentUiLocale,t))})),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>{return(e=0,new Promise((t=>setTimeout(t,e)))).then((()=>t())).catch((()=>null));var e})))}}fi=di,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new vi(hi.get));const pi=window.FluidTopicsI18nService;var bi=function(t,e,i,n){for(var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class wi extends pt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>hi.get(),this.cache=new i,this.cleanSessionDebouncer=new n}render(){return V`
|
|
100
|
+
<slot></slot>
|
|
101
|
+
`}updated(t){super.updated(t),t.has("baseUrl")&&li.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&li.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&li.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&li.actions.setNoCustom(this.noCustom),t.has("editorMode")&&li.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&li.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&li.actions.setSession(this.session),t.has("availableUiLocales")&&li.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>pi.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}wi.elementDefinitions={},wi.styles=ci,bi([o()],wi.prototype,"baseUrl",void 0),bi([o()],wi.prototype,"apiIntegrationIdentifier",void 0),bi([o()],wi.prototype,"uiLocale",void 0),bi([l([])],wi.prototype,"availableUiLocales",void 0),bi([o({type:Boolean})],wi.prototype,"editorMode",void 0),bi([o({type:Boolean})],wi.prototype,"noCustom",void 0),bi([o({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],wi.prototype,"noCustomComponent",void 0),bi([o({type:Boolean})],wi.prototype,"withManualResources",void 0),bi([l([])],wi.prototype,"messageContexts",void 0),bi([l(void 0)],wi.prototype,"session",void 0),bi([o({type:Object})],wi.prototype,"apiProvider",void 0),c("ft-app-context")(wi);var yi=function(t,e,i,n){for(var r,o=arguments.length,s=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n,u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,i,s):r(e,i))||s);return o>3&&s&&Object.defineProperty(e,i,s),s};class mi extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class gi extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class xi extends Qe{constructor(){super(),this.baseUrl="",this.apiIntegrationIdentifier="ft-search",this.addStore(li)}get stateManager(){return null==this._stateManager&&(this._stateManager=ri.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0")),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")),this._stateManager}render(){return V`
|
|
102
|
+
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
103
|
+
`}updated(t){super.updated(t),(t.has("baseUrl")||t.has("apiIntegrationIdentifier"))&&this.stateManager.initService(this.baseUrl,this.apiIntegrationIdentifier),t.has("query")&&this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("filters")&&this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&this.sort&&this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new gi(this.request))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new mi(t))}}xi.elementDefinitions={},xi.styles=ei,yi([o()],xi.prototype,"query",void 0),yi([o()],xi.prototype,"contentLocale",void 0),yi([l([])],xi.prototype,"filters",void 0),yi([l([])],xi.prototype,"sort",void 0),yi([Ze({store:li.name})],xi.prototype,"baseUrl",void 0),yi([Ze({store:li.name})],xi.prototype,"apiIntegrationIdentifier",void 0),yi([Ze({store:"search"})],xi.prototype,"request",void 0),c("ft-search-context")(xi),t.FtSearchContext=xi,t.FtSearchContextCssVariables={},t.LoadErrorEvent=mi,t.SearchRequestChangeEvent=gi,t.styles=ei,Object.defineProperty(t,"U",{value:!0})}({});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FtSearchFilter, FtSearchSortCriterion } from "@fluid-topics/public-api";
|
|
2
|
+
export interface FtSearchContextProperties {
|
|
3
|
+
query?: string;
|
|
4
|
+
contentLocale?: string;
|
|
5
|
+
filters?: FtSearchFilter[];
|
|
6
|
+
sort?: FtSearchSortCriterion[];
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=ft-search-context.properties.d.ts.map
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { FtSearchContext } from "./ft-search-context";
|
|
3
|
+
export * from "./ft-search-context.css";
|
|
4
|
+
export * from "./ft-search-context.properties";
|
|
5
|
+
export * from "./ft-search-context";
|
|
6
|
+
customElement("ft-search-context")(FtSearchContext);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FtLitElementRedux } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import type { FtSearchService } from "./store/utils/FtSearchService";
|
|
3
|
+
import { FtSearchStateManager } from "./store/FtSearchStateManager";
|
|
4
|
+
export * from "./store/model";
|
|
5
|
+
export { FtSearchStateManager } from "./store/FtSearchStateManager";
|
|
6
|
+
export declare class RegisterSearchComponentEvent extends Event {
|
|
7
|
+
constructor();
|
|
8
|
+
}
|
|
9
|
+
export declare type FtSearchComponentInterface = {
|
|
10
|
+
stateManager?: FtSearchStateManager;
|
|
11
|
+
service: FtSearchService | undefined;
|
|
12
|
+
setSearchStateManager(stateManager: FtSearchStateManager): void;
|
|
13
|
+
};
|
|
14
|
+
declare type Constructor<T> = new (...args: any[]) => T;
|
|
15
|
+
export declare type FtSearchComponentType<T extends Constructor<FtLitElementRedux>> = T & Constructor<FtSearchComponentInterface>;
|
|
16
|
+
export declare function toFtSearchComponent<T extends Constructor<FtLitElementRedux>>(ReduxClass: T): FtSearchComponentType<T>;
|
|
17
|
+
declare const FtSearchComponent_base: FtSearchComponentType<typeof FtLitElementRedux>;
|
|
18
|
+
export declare class FtSearchComponent extends FtSearchComponent_base {
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=registration.d.ts.map
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { FtLitElementRedux } from "@fluid-topics/ft-wc-utils";
|
|
8
|
+
import { state } from "lit/decorators.js";
|
|
9
|
+
export * from "./store/model";
|
|
10
|
+
export { FtSearchStateManager } from "./store/FtSearchStateManager";
|
|
11
|
+
export class RegisterSearchComponentEvent extends Event {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("register-ft-search-component", { bubbles: true, composed: true });
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const registerInterval = Symbol("registerInterval");
|
|
17
|
+
export function toFtSearchComponent(ReduxClass) {
|
|
18
|
+
var _a;
|
|
19
|
+
class FtSearchComponentClass extends ReduxClass {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this[_a] = 0;
|
|
23
|
+
}
|
|
24
|
+
setSearchStateManager(stateManager) {
|
|
25
|
+
this.clearStateManager();
|
|
26
|
+
this.stateManager = stateManager;
|
|
27
|
+
this.addStore(stateManager.store, "search");
|
|
28
|
+
}
|
|
29
|
+
clearStateManager() {
|
|
30
|
+
if (this.stateManager) {
|
|
31
|
+
this.removeStore(this.stateManager.store);
|
|
32
|
+
this.stateManager = undefined;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
get service() {
|
|
36
|
+
var _b;
|
|
37
|
+
return (_b = this.stateManager) === null || _b === void 0 ? void 0 : _b.service;
|
|
38
|
+
}
|
|
39
|
+
connectedCallback() {
|
|
40
|
+
super.connectedCallback();
|
|
41
|
+
this[registerInterval] = window.setInterval(() => this.tryToRegisterToContext(), 50);
|
|
42
|
+
}
|
|
43
|
+
tryToRegisterToContext() {
|
|
44
|
+
if (this.stateManager != null) {
|
|
45
|
+
window.clearInterval(this[registerInterval]);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
this.dispatchEvent(new RegisterSearchComponentEvent());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
disconnectedCallback() {
|
|
52
|
+
super.disconnectedCallback();
|
|
53
|
+
this.clearStateManager();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
_a = registerInterval;
|
|
57
|
+
__decorate([
|
|
58
|
+
state()
|
|
59
|
+
], FtSearchComponentClass.prototype, "stateManager", void 0);
|
|
60
|
+
return FtSearchComponentClass;
|
|
61
|
+
}
|
|
62
|
+
export class FtSearchComponent extends toFtSearchComponent(FtLitElementRedux) {
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=registration.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FtSearchPageState } from "./model";
|
|
2
|
+
import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtSearchPageStateReducers } from "./redux";
|
|
4
|
+
import { FtSearchService } from "./utils/FtSearchService";
|
|
5
|
+
import { FtSearchFilter, FtSearchSortCriterion } from "@fluid-topics/public-api";
|
|
6
|
+
export declare class FtSearchStateManager {
|
|
7
|
+
store: FtReduxStore<FtSearchPageState, FtSearchPageStateReducers>;
|
|
8
|
+
static build(id: string): FtSearchStateManager;
|
|
9
|
+
service?: FtSearchService;
|
|
10
|
+
errorHandler?: (e: Error) => void;
|
|
11
|
+
constructor(store: FtReduxStore<FtSearchPageState, FtSearchPageStateReducers>);
|
|
12
|
+
setQuery(query: string): void;
|
|
13
|
+
setContentLocale(contentLocale: string): void;
|
|
14
|
+
setSort(sort: FtSearchSortCriterion[]): void;
|
|
15
|
+
setFilters(filters: FtSearchFilter[]): void;
|
|
16
|
+
addFacet(id: string): void;
|
|
17
|
+
replaceFacet(oldId: string, newId?: string): void;
|
|
18
|
+
setFilter(key: string, values: string[]): void;
|
|
19
|
+
setLiveQuery(query: string): void;
|
|
20
|
+
initService(baseUrl?: string, apiIntegrationIdentifier?: string): Promise<void>;
|
|
21
|
+
private searchDebouncer;
|
|
22
|
+
launchSearch(): Promise<void>;
|
|
23
|
+
private suggestDebouncer;
|
|
24
|
+
launchSuggest(): Promise<void>;
|
|
25
|
+
private fetchSearchData;
|
|
26
|
+
private fetchSuggestData;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=FtSearchStateManager.d.ts.map
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { Debouncer } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { createSearchPageStore } from "./redux";
|
|
3
|
+
import { FtSearchService } from "./utils/FtSearchService";
|
|
4
|
+
export class FtSearchStateManager {
|
|
5
|
+
constructor(store) {
|
|
6
|
+
this.store = store;
|
|
7
|
+
this.searchDebouncer = new Debouncer(10);
|
|
8
|
+
this.suggestDebouncer = new Debouncer(300);
|
|
9
|
+
}
|
|
10
|
+
static build(id) {
|
|
11
|
+
return new FtSearchStateManager(createSearchPageStore(id.trim() || "context"));
|
|
12
|
+
}
|
|
13
|
+
setQuery(query) {
|
|
14
|
+
this.store.actions.setRequestQuery(query);
|
|
15
|
+
this.launchSearch();
|
|
16
|
+
}
|
|
17
|
+
setContentLocale(contentLocale) {
|
|
18
|
+
this.store.actions.setRequestContentLocale(contentLocale);
|
|
19
|
+
this.launchSearch();
|
|
20
|
+
}
|
|
21
|
+
setSort(sort) {
|
|
22
|
+
this.store.actions.setRequestSort(sort);
|
|
23
|
+
this.launchSearch();
|
|
24
|
+
}
|
|
25
|
+
setFilters(filters) {
|
|
26
|
+
this.store.actions.setRequestFilters(filters);
|
|
27
|
+
this.launchSearch();
|
|
28
|
+
}
|
|
29
|
+
addFacet(id) {
|
|
30
|
+
let facetConf = { id };
|
|
31
|
+
let facetIds = Array.from(new Set([...this.store.getState().request.facets, facetConf]));
|
|
32
|
+
this.store.actions.setRequestFacets(facetIds);
|
|
33
|
+
this.launchSearch();
|
|
34
|
+
}
|
|
35
|
+
replaceFacet(oldId, newId) {
|
|
36
|
+
let facetIds = this.store.getState().request.facets.filter(f => f.id != oldId);
|
|
37
|
+
if (newId) {
|
|
38
|
+
let facetConf = { id: newId };
|
|
39
|
+
facetIds = Array.from(new Set([...this.store.getState().request.facets, facetConf]));
|
|
40
|
+
}
|
|
41
|
+
this.store.actions.setRequestFacets(facetIds);
|
|
42
|
+
this.launchSearch();
|
|
43
|
+
}
|
|
44
|
+
setFilter(key, values) {
|
|
45
|
+
let existingFilters = this.store.getState().request.filters;
|
|
46
|
+
let newFilter = { key: key, values: values, negative: false };
|
|
47
|
+
let filters = [...existingFilters.filter(filter => filter.key !== key), newFilter];
|
|
48
|
+
this.setFilters(filters);
|
|
49
|
+
}
|
|
50
|
+
setLiveQuery(query) {
|
|
51
|
+
this.store.actions.setLiveQuery(query);
|
|
52
|
+
this.launchSuggest();
|
|
53
|
+
}
|
|
54
|
+
async initService(baseUrl, apiIntegrationIdentifier) {
|
|
55
|
+
if (baseUrl && apiIntegrationIdentifier) {
|
|
56
|
+
this.service = FtSearchService.build(baseUrl, apiIntegrationIdentifier);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this.service = undefined;
|
|
60
|
+
}
|
|
61
|
+
await this.launchSearch();
|
|
62
|
+
}
|
|
63
|
+
async launchSearch() {
|
|
64
|
+
if (this.service) {
|
|
65
|
+
this.searchDebouncer.run(() => this.fetchSearchData());
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
async launchSuggest() {
|
|
69
|
+
if (this.service) {
|
|
70
|
+
this.suggestDebouncer.run(() => this.fetchSuggestData());
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
async fetchSearchData() {
|
|
74
|
+
try {
|
|
75
|
+
let results = await this.service.launchSearch(this.store.getState().request);
|
|
76
|
+
if (results.paging.currentPage == 1) {
|
|
77
|
+
this.store.actions.setResults(results.results);
|
|
78
|
+
this.store.actions.setFacets(results.facets);
|
|
79
|
+
this.store.actions.setPaging({
|
|
80
|
+
totalResultsCount: results.paging.totalResultsCount,
|
|
81
|
+
totalClustersCount: results.paging.totalClustersCount,
|
|
82
|
+
isLastPage: results.paging.lastPage,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
let newResults = this.store.getState().results.concat(results.results);
|
|
87
|
+
this.store.actions.setResults(newResults);
|
|
88
|
+
this.store.actions.setPaging({
|
|
89
|
+
totalResultsCount: results.paging.totalResultsCount,
|
|
90
|
+
totalClustersCount: results.paging.totalClustersCount,
|
|
91
|
+
isLastPage: results.paging.lastPage,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
if (this.errorHandler) {
|
|
97
|
+
this.errorHandler(e);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async fetchSuggestData() {
|
|
102
|
+
try {
|
|
103
|
+
let request = {
|
|
104
|
+
input: this.store.getState().liveQuery,
|
|
105
|
+
filters: this.store.getState().request.filters,
|
|
106
|
+
sort: this.store.getState().request.sort,
|
|
107
|
+
contentLocale: this.store.getState().request.contentLocale,
|
|
108
|
+
};
|
|
109
|
+
let results = await this.service.launchSuggest(request);
|
|
110
|
+
this.store.actions.setSuggestResults(results.suggestions);
|
|
111
|
+
}
|
|
112
|
+
catch (e) {
|
|
113
|
+
if (this.errorHandler) {
|
|
114
|
+
this.errorHandler(e);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=FtSearchStateManager.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FtSearchFacet, FtSearchRequest, FtSearchResultCluster, FtSuggestResult } from "@fluid-topics/public-api";
|
|
2
|
+
export interface FtSearchPageState {
|
|
3
|
+
request: FtSearchRequest;
|
|
4
|
+
results: Array<FtSearchResultCluster>;
|
|
5
|
+
facets: Array<FtSearchFacet>;
|
|
6
|
+
paging: {
|
|
7
|
+
totalResultsCount: number;
|
|
8
|
+
totalClustersCount: number;
|
|
9
|
+
isLastPage: boolean;
|
|
10
|
+
};
|
|
11
|
+
liveQuery: string;
|
|
12
|
+
suggestResults: Array<FtSuggestResult>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=model.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { PayloadAction } from "@reduxjs/toolkit";
|
|
2
|
+
import { FtSearchPageState } from "./model";
|
|
3
|
+
import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
4
|
+
declare const searchPageStateReducers: {
|
|
5
|
+
setRequestQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["query"]>) => void;
|
|
6
|
+
setRequestContentLocale: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["contentLocale"]>) => void;
|
|
7
|
+
setRequestSort: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["sort"]>) => void;
|
|
8
|
+
setRequestFilters: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["filters"]>) => void;
|
|
9
|
+
setRequestFacets: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["facets"]>) => void;
|
|
10
|
+
setResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["results"]>) => void;
|
|
11
|
+
setFacets: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["facets"]>) => void;
|
|
12
|
+
setPaging: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["paging"]>) => void;
|
|
13
|
+
setLiveQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["liveQuery"]>) => void;
|
|
14
|
+
setSuggestResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["suggestResults"]>) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare type FtSearchPageStateReducers = typeof searchPageStateReducers;
|
|
17
|
+
export declare const createSearchPageStore: (id: string) => FtReduxStore<FtSearchPageState, {
|
|
18
|
+
setRequestQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["query"]>) => void;
|
|
19
|
+
setRequestContentLocale: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["contentLocale"]>) => void;
|
|
20
|
+
setRequestSort: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["sort"]>) => void;
|
|
21
|
+
setRequestFilters: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["filters"]>) => void;
|
|
22
|
+
setRequestFacets: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["request"]["facets"]>) => void;
|
|
23
|
+
setResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["results"]>) => void;
|
|
24
|
+
setFacets: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["facets"]>) => void;
|
|
25
|
+
setPaging: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["paging"]>) => void;
|
|
26
|
+
setLiveQuery: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["liveQuery"]>) => void;
|
|
27
|
+
setSuggestResults: (state: FtSearchPageState, action: PayloadAction<FtSearchPageState["suggestResults"]>) => void;
|
|
28
|
+
}, import("redux").AnyAction>;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=redux.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FtReduxStore } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
const searchPageStateReducers = {
|
|
3
|
+
setRequestQuery: (state, action) => {
|
|
4
|
+
state.request.query = action.payload;
|
|
5
|
+
},
|
|
6
|
+
setRequestContentLocale: (state, action) => {
|
|
7
|
+
state.request.contentLocale = action.payload;
|
|
8
|
+
},
|
|
9
|
+
setRequestSort: (state, action) => {
|
|
10
|
+
state.request.sort = action.payload;
|
|
11
|
+
},
|
|
12
|
+
setRequestFilters: (state, action) => {
|
|
13
|
+
state.request.filters = action.payload;
|
|
14
|
+
},
|
|
15
|
+
setRequestFacets: (state, action) => {
|
|
16
|
+
state.request.facets = action.payload;
|
|
17
|
+
},
|
|
18
|
+
setResults: (state, action) => {
|
|
19
|
+
state.results = action.payload;
|
|
20
|
+
},
|
|
21
|
+
setFacets: (state, action) => {
|
|
22
|
+
state.facets = action.payload;
|
|
23
|
+
},
|
|
24
|
+
setPaging: (state, action) => {
|
|
25
|
+
state.paging = action.payload;
|
|
26
|
+
},
|
|
27
|
+
setLiveQuery: (state, action) => {
|
|
28
|
+
state.liveQuery = action.payload;
|
|
29
|
+
},
|
|
30
|
+
setSuggestResults: (state, action) => {
|
|
31
|
+
state.suggestResults = action.payload;
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const createSearchPageStore = (id) => FtReduxStore.get({
|
|
35
|
+
name: "ft-search-" + id,
|
|
36
|
+
initialState: {
|
|
37
|
+
request: {
|
|
38
|
+
query: "",
|
|
39
|
+
filters: [],
|
|
40
|
+
facets: [],
|
|
41
|
+
sort: [],
|
|
42
|
+
paging: {
|
|
43
|
+
page: 1,
|
|
44
|
+
perPage: 10,
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
results: [],
|
|
48
|
+
facets: [],
|
|
49
|
+
paging: {
|
|
50
|
+
totalResultsCount: 0,
|
|
51
|
+
totalClustersCount: 0,
|
|
52
|
+
isLastPage: false,
|
|
53
|
+
},
|
|
54
|
+
liveQuery: "",
|
|
55
|
+
suggestResults: [],
|
|
56
|
+
},
|
|
57
|
+
reducers: searchPageStateReducers
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=redux.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { FluidTopicsApi, FtSearchRequest, FtSearchResults, FtSuggestRequest, FtSuggestResults } from "@fluid-topics/public-api";
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
fluidtopics?: {
|
|
5
|
+
FluidTopicsApi: new (tenantBaseUrl: string, integrationIdentifier: string, overrideIdentifierIfOnTenant?: boolean) => FluidTopicsApi;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare class FtSearchService {
|
|
10
|
+
private api;
|
|
11
|
+
static build(baseUrl: string, apiIntegrationIdentifier: string): FtSearchService;
|
|
12
|
+
constructor(api: FluidTopicsApi);
|
|
13
|
+
launchSearch(request: FtSearchRequest): Promise<FtSearchResults>;
|
|
14
|
+
launchSuggest(request: FtSuggestRequest): Promise<FtSuggestResults>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=FtSearchService.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class FtSearchService {
|
|
2
|
+
constructor(api) {
|
|
3
|
+
this.api = api;
|
|
4
|
+
}
|
|
5
|
+
static build(baseUrl, apiIntegrationIdentifier) {
|
|
6
|
+
if (window.fluidtopics == null) {
|
|
7
|
+
console.error("Fluid Topics public API was not found. You can find it here: https://www.npmjs.com/package/@fluid-topics/public-api");
|
|
8
|
+
throw new Error("Fluid Topics public API not found");
|
|
9
|
+
}
|
|
10
|
+
const api = new window.fluidtopics.FluidTopicsApi(baseUrl, apiIntegrationIdentifier, true);
|
|
11
|
+
return new FtSearchService(api);
|
|
12
|
+
}
|
|
13
|
+
async launchSearch(request) {
|
|
14
|
+
return this.api.search(request);
|
|
15
|
+
}
|
|
16
|
+
async launchSuggest(request) {
|
|
17
|
+
return this.api.getSuggestions(request);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=FtSearchService.js.map
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-topics/ft-search-context",
|
|
3
|
+
"version": "0.3.62",
|
|
4
|
+
"description": "Context block for integrated search components",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ft-search-context.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.js",
|
|
15
|
+
"build/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-app-context": "0.3.62",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "0.3.62",
|
|
24
|
+
"lit": "2.2.8"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@fluid-topics/public-api": "1.0.32"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@fluid-topics/public-api": "1.0.32"
|
|
31
|
+
},
|
|
32
|
+
"gitHead": "801f5c7705e58471510eca9ccb943d558e42e3fb"
|
|
33
|
+
}
|