@fluid-topics/ft-reader-feedback 1.1.67 → 1.1.68

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.
@@ -1306,9 +1306,9 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1306
1306
  }
1307
1307
  `,e.noTextSelect];var Si=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ni extends vi{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--secondary":this.secondary,"ft-button--tertiary":this.tertiary||!this.primary&&!this.secondary&&!this.neutral,"ft-button--neutral":this.neutral,"ft-button--large":!this.small,"ft-button--small":this.small,"ft-button--icon-only":!this.hasTextContent(),"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0,"ft-button--no-icon":!this.icon}}get typographyVariant(){return this.small?Ie.caption1medium:Ie.body2medium}}Ni.styles=[e.safariEllipsisFix,Oi],Si([i.property({type:Boolean})],Ni.prototype,"primary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"secondary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"tertiary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"neutral",void 0),Si([i.property({type:Boolean})],Ni.prototype,"small",void 0),e.customElement("ft-button")(wi),e.customElement("ftds-button")(Ni);const $i=o.css`
1308
1308
  `,Ii=o.css`
1309
- `,Ci=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class ki{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Ci.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static await(t){return new Promise((e=>{let o=ki.get(t);if(o)e(o);else{const i=Ci.subscribe((()=>{o=ki.get(t),o&&(i(),e(o))}))}}))}}class Ei{constructor(t=!0,o){var i;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new e.CacheRegistry,this.cache=t?r.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.await()}clearCache(){this.cache.clearAll()}}var Ri;const Ui=Symbol("clearAfterUnitTest");class Li extends Ei{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ri]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Ci.getState().uiLocale,Ci.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ci.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,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}Ri=Ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Wi=window.FluidTopicsI18nService,zi=window.FluidTopicsCustomI18nService;var Di=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ti extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>ki.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1309
+ `,Ci=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class ki{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Ci.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static await(t){return new Promise((e=>{let o=ki.get(t);if(o)e(o);else{const i=Ci.subscribe((()=>{o=ki.get(t),o&&(i(),e(o))}))}}))}}class Ei{constructor(t=!0,o){var i;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new e.CacheRegistry,this.cache=t?r.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.await()}clearCache(){this.cache.clearAll()}}var Ri;const Ui=Symbol("clearAfterUnitTest");class Li extends Ei{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ri]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Ci.getState().uiLocale,Ci.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ci.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,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}Ri=Ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Wi=window.FluidTopicsI18nService,zi=window.FluidTopicsCustomI18nService;var Di=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ti extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>ki.get(),this.messageContexts=[],this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1310
1310
  <slot></slot>
1311
- `}update(t){super.update(t),t.has("baseUrl")&&(Ci.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ci.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ci.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ci.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ci.actions.noCustom(this.noCustom),t.has("editorMode")&&Ci.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ci.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ci.actions.session(this.session),t.has("availableUiLocales")&&Ci.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Wi.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ci.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Ti.elementDefinitions={},Ti.styles=Ii,Di([i.property()],Ti.prototype,"baseUrl",void 0),Di([i.property()],Ti.prototype,"apiIntegrationIdentifier",void 0),Di([i.property()],Ti.prototype,"uiLocale",void 0),Di([e.jsonProperty(null)],Ti.prototype,"availableUiLocales",void 0),Di([e.jsonProperty(null)],Ti.prototype,"metadataConfiguration",void 0),Di([i.property({type:Boolean})],Ti.prototype,"editorMode",void 0),Di([i.property({type:Boolean})],Ti.prototype,"noCustom",void 0),Di([i.property({type:Boolean})],Ti.prototype,"openExternalDocumentInNewTab",void 0),Di([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ti.prototype,"noCustomComponent",void 0),Di([i.property({type:Boolean})],Ti.prototype,"withManualResources",void 0),Di([e.jsonProperty([])],Ti.prototype,"messageContexts",void 0),Di([e.jsonProperty(void 0)],Ti.prototype,"session",void 0),Di([i.property({type:Object})],Ti.prototype,"apiProvider",void 0);class Ai extends Ei{async listMySearches(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class _i extends Ei{async listMyBookmarks(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Zi=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Fi=new class{constructor(){this.currentSession=Ci.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new _i,this.savedSearchesService=new Ai,Ci.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Ci.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Zi.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Zi.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Zi.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Zi.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Ti);var Bi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Ki=Symbol("i18nAttributes"),Mi=Symbol("i18nProperties"),Pi=Symbol("i18nUnsubs");function Hi(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?zi:Wi}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[Mi])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[Mi])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Mi])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[Ki])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Pi].has(t)||this[Pi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Pi].forEach((t=>t())),this[Pi].clear()}}return e=Pi,Bi([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class ji extends(Hi(e.FtLitElement)){}class Gi extends(Hi(e.FtLitElementRedux)){}var Vi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Yi extends Gi{constructor(){super(),this.editorMode=!1,this.addStore(Ci)}render(){return this.key&&this.context?o.html`
1311
+ `}update(t){super.update(t),t.has("baseUrl")&&(Ci.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ci.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ci.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ci.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ci.actions.noCustom(this.noCustom),t.has("editorMode")&&Ci.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ci.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ci.actions.session(this.session),t.has("availableUiLocales")&&Ci.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Wi.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ci.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&Ci.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&Ci.actions.forcedOffline(this.forcedOffline),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Ti.elementDefinitions={},Ti.styles=Ii,Di([i.property()],Ti.prototype,"baseUrl",void 0),Di([i.property()],Ti.prototype,"apiIntegrationIdentifier",void 0),Di([i.property()],Ti.prototype,"uiLocale",void 0),Di([e.jsonProperty(null)],Ti.prototype,"availableUiLocales",void 0),Di([e.jsonProperty(null)],Ti.prototype,"metadataConfiguration",void 0),Di([i.property({type:Boolean})],Ti.prototype,"editorMode",void 0),Di([i.property({type:Boolean})],Ti.prototype,"noCustom",void 0),Di([i.property({type:Boolean})],Ti.prototype,"openExternalDocumentInNewTab",void 0),Di([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ti.prototype,"noCustomComponent",void 0),Di([i.property({type:Boolean})],Ti.prototype,"withManualResources",void 0),Di([i.property({type:Boolean})],Ti.prototype,"navigatorOnline",void 0),Di([i.property({type:Boolean})],Ti.prototype,"forcedOffline",void 0),Di([i.property({type:Object})],Ti.prototype,"apiProvider",void 0),Di([e.jsonProperty([])],Ti.prototype,"messageContexts",void 0),Di([e.jsonProperty(void 0)],Ti.prototype,"session",void 0);class Ai extends Ei{async listMySearches(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class _i extends Ei{async listMyBookmarks(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Zi=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Fi=new class{constructor(){this.currentSession=Ci.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new _i,this.savedSearchesService=new Ai,Ci.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Ci.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Zi.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Zi.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Zi.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Zi.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Ti);var Bi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Ki=Symbol("i18nAttributes"),Mi=Symbol("i18nProperties"),Pi=Symbol("i18nUnsubs");function Hi(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?zi:Wi}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[Mi])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[Mi])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Mi])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[Ki])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Pi].has(t)||this[Pi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Pi].forEach((t=>t())),this[Pi].clear()}}return e=Pi,Bi([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class ji extends(Hi(e.FtLitElement)){}class Gi extends(Hi(e.FtLitElementRedux)){}var Vi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Yi extends Gi{constructor(){super(),this.editorMode=!1,this.addStore(Ci)}render(){return this.key&&this.context?o.html`
1312
1312
  <span class="ft-i18n">
1313
1313
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1314
1314
  </span>
@@ -1474,9 +1474,9 @@ function ke(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=$
1474
1474
  }
1475
1475
  `,qr];var Tc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Fc extends Ac{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--secondary":this.secondary,"ft-button--tertiary":this.tertiary||!this.primary&&!this.secondary&&!this.neutral,"ft-button--neutral":this.neutral,"ft-button--large":!this.small,"ft-button--small":this.small,"ft-button--icon-only":!this.hasTextContent(),"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0,"ft-button--no-icon":!this.icon}}get typographyVariant(){return this.small?Zl.caption1medium:Zl.body2medium}}Fc.styles=[Jr,zc],Tc([Oe({type:Boolean})],Fc.prototype,"primary",void 0),Tc([Oe({type:Boolean})],Fc.prototype,"secondary",void 0),Tc([Oe({type:Boolean})],Fc.prototype,"tertiary",void 0),Tc([Oe({type:Boolean})],Fc.prototype,"neutral",void 0),Tc([Oe({type:Boolean})],Fc.prototype,"small",void 0),go("ft-button")(Wc),go("ftds-button")(Fc);const Dc=ft`
1476
1476
  `,Pc=ft`
1477
- `,Mc=es.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class jc{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Mc.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static await(t){return new Promise((e=>{let o=jc.get(t);if(o)e(o);else{const i=Mc.subscribe((()=>{o=jc.get(t),o&&(i(),e(o))}))}}))}}class Zc{constructor(t=!0,e){var o;this.overrideApi=e;let i=this.constructor;i.commonCache=null!==(o=i.commonCache)&&void 0!==o?o:new io,this.cache=t?i.commonCache:new io}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:jc.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:jc.await()}clearCache(){this.cache.clearAll()}}var Hc;const Kc=Symbol("clearAfterUnitTest");class Gc extends Zc{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Hc]=()=>{this.defaultMessages={},this.cache=new io,this.listeners={}},this.currentUiLocale=Mc.getState().uiLocale,Mc.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Mc.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 o;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};uo(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var i,r,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new tn(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>co(0).then((()=>t())).catch((()=>null)))))}}Hc=Kc,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Gc{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Gc{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Vc=window.FluidTopicsI18nService,qc=window.FluidTopicsCustomI18nService;var Yc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Jc extends Dr{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>jc.get(),this.cache=new io,this.cleanSessionDebouncer=new so}render(){return Jt`
1477
+ `,Mc=es.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class jc{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Mc.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static await(t){return new Promise((e=>{let o=jc.get(t);if(o)e(o);else{const i=Mc.subscribe((()=>{o=jc.get(t),o&&(i(),e(o))}))}}))}}class Zc{constructor(t=!0,e){var o;this.overrideApi=e;let i=this.constructor;i.commonCache=null!==(o=i.commonCache)&&void 0!==o?o:new io,this.cache=t?i.commonCache:new io}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:jc.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:jc.await()}clearCache(){this.cache.clearAll()}}var Hc;const Kc=Symbol("clearAfterUnitTest");class Gc extends Zc{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Hc]=()=>{this.defaultMessages={},this.cache=new io,this.listeners={}},this.currentUiLocale=Mc.getState().uiLocale,Mc.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Mc.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 o;if(t=t.toLowerCase(),Object.keys(e).length>0){const i={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};uo(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var i,r,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(r=null===(i=this.cache.getNow(t))||void 0===i?void 0:i.messages)&&void 0!==r?r:{};return new tn(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>co(0).then((()=>t())).catch((()=>null)))))}}Hc=Kc,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Gc{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Gc{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Vc=window.FluidTopicsI18nService,qc=window.FluidTopicsCustomI18nService;var Yc=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Jc extends Dr{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>jc.get(),this.messageContexts=[],this.cache=new io,this.cleanSessionDebouncer=new so}render(){return Jt`
1478
1478
  <slot></slot>
1479
- `}update(t){super.update(t),t.has("baseUrl")&&(Mc.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Mc.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Mc.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Mc.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Mc.actions.noCustom(this.noCustom),t.has("editorMode")&&Mc.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Mc.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Mc.actions.session(this.session),t.has("availableUiLocales")&&Mc.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Vc.addContext(t))),t.has("openExternalDocumentInNewTab")&&Mc.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Jc.elementDefinitions={},Jc.styles=Pc,Yc([Oe()],Jc.prototype,"baseUrl",void 0),Yc([Oe()],Jc.prototype,"apiIntegrationIdentifier",void 0),Yc([Oe()],Jc.prototype,"uiLocale",void 0),Yc([yo(null)],Jc.prototype,"availableUiLocales",void 0),Yc([yo(null)],Jc.prototype,"metadataConfiguration",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"editorMode",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"noCustom",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"openExternalDocumentInNewTab",void 0),Yc([Oe({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Jc.prototype,"noCustomComponent",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"withManualResources",void 0),Yc([yo([])],Jc.prototype,"messageContexts",void 0),Yc([yo(void 0)],Jc.prototype,"session",void 0),Yc([Oe({type:Object})],Jc.prototype,"apiProvider",void 0);class Xc extends Zc{async listMySearches(){let t=Mc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Qc extends Zc{async listMyBookmarks(){let t=Mc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const td=es.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const ed=new class{constructor(){this.currentSession=Mc.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Qc,this.savedSearchesService=new Xc,Mc.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Mc.getState();uo(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),td.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),td.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();td.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;td.actions.bookmarks(e)}}};go("ft-app-context")(Jc);var od=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const id=Symbol("i18nAttributes"),rd=Symbol("i18nProperties"),nd=Symbol("i18nUnsubs");function ad(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?qc:Vc}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[id])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[rd])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[id])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[rd])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[rd])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[id])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[nd].has(t)||this[nd].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[nd].forEach((t=>t())),this[nd].clear()}}return e=nd,od([Oe({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class sd extends(ad(Dr)){}class ld extends(ad(un)){}var cd=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dd extends ld{constructor(){super(),this.editorMode=!1,this.addStore(Mc)}render(){return this.key&&this.context?Jt`
1479
+ `}update(t){super.update(t),t.has("baseUrl")&&(Mc.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Mc.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Mc.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Mc.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Mc.actions.noCustom(this.noCustom),t.has("editorMode")&&Mc.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Mc.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Mc.actions.session(this.session),t.has("availableUiLocales")&&Mc.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Vc.addContext(t))),t.has("openExternalDocumentInNewTab")&&Mc.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&Mc.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&Mc.actions.forcedOffline(this.forcedOffline),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Jc.elementDefinitions={},Jc.styles=Pc,Yc([Oe()],Jc.prototype,"baseUrl",void 0),Yc([Oe()],Jc.prototype,"apiIntegrationIdentifier",void 0),Yc([Oe()],Jc.prototype,"uiLocale",void 0),Yc([yo(null)],Jc.prototype,"availableUiLocales",void 0),Yc([yo(null)],Jc.prototype,"metadataConfiguration",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"editorMode",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"noCustom",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"openExternalDocumentInNewTab",void 0),Yc([Oe({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Jc.prototype,"noCustomComponent",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"withManualResources",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"navigatorOnline",void 0),Yc([Oe({type:Boolean})],Jc.prototype,"forcedOffline",void 0),Yc([Oe({type:Object})],Jc.prototype,"apiProvider",void 0),Yc([yo([])],Jc.prototype,"messageContexts",void 0),Yc([yo(void 0)],Jc.prototype,"session",void 0);class Xc extends Zc{async listMySearches(){let t=Mc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Qc extends Zc{async listMyBookmarks(){let t=Mc.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const td=es.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const ed=new class{constructor(){this.currentSession=Mc.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Qc,this.savedSearchesService=new Xc,Mc.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Mc.getState();uo(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),td.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),td.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();td.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;td.actions.bookmarks(e)}}};go("ft-app-context")(Jc);var od=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const id=Symbol("i18nAttributes"),rd=Symbol("i18nProperties"),nd=Symbol("i18nUnsubs");function ad(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?qc:Vc}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[id])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[rd])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[id])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[rd])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[rd])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[id])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[nd].has(t)||this[nd].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[nd].forEach((t=>t())),this[nd].clear()}}return e=nd,od([Oe({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class sd extends(ad(Dr)){}class ld extends(ad(un)){}var cd=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dd extends ld{constructor(){super(),this.editorMode=!1,this.addStore(Mc)}render(){return this.key&&this.context?Jt`
1480
1480
  <span class="ft-i18n">
1481
1481
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1482
1482
  </span>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-feedback",
3
- "version": "1.1.67",
3
+ "version": "1.1.68",
4
4
  "description": "Feedback forms for a map and its topics in an integrated reader",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,13 +19,13 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-app-context": "1.1.67",
23
- "@fluid-topics/ft-reader-context": "1.1.67",
24
- "@fluid-topics/ft-wc-utils": "1.1.67",
22
+ "@fluid-topics/ft-app-context": "1.1.68",
23
+ "@fluid-topics/ft-reader-context": "1.1.68",
24
+ "@fluid-topics/ft-wc-utils": "1.1.68",
25
25
  "lit": "3.1.0"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@fluid-topics/public-api": "1.0.67"
29
29
  },
30
- "gitHead": "8cda0812a8caec5b6d25c11e3dd416c005aca66a"
30
+ "gitHead": "d10171ba718cee726044d0cc44820ebbb1ab7cbc"
31
31
  }