@fluid-topics/ft-reader-page-title 1.1.24 → 1.1.26

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.
@@ -123,7 +123,7 @@ const T=Symbol.for(""),_=t=>{if(t?.r===T)return t?._$litStatic$},Y=t=>({_$litSta
123
123
  `}}wo.styles=[ho,yo,go,bo,uo,mo,Oo,No,So,Co,vo,...xo],Io([r.property()],wo.prototype,"element",void 0),Io([r.property()],wo.prototype,"variant",void 0),o.customElement("ft-typography")(wo);const Uo=e.css`
124
124
  `,Ro=o.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}});class Wo{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=Ro.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static get(t){var o;return null!=t?Wo.build(t):null!==(o=Wo.API)&&void 0!==o?o:Wo.API=Wo.build()}static await(t){return new Promise((o=>{let e=Wo.get(t);if(e)o(e);else{const r=Ro.subscribe((()=>{e=Wo.get(t),e&&(r(),o(e))}))}}))}}var Lo;const Eo=Symbol("clearAfterUnitTest");class Ko{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Lo]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=Ro.getState().uiLocale,Ro.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ro.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var r;if(t=t.toLowerCase(),Object.keys(e).length>0){const a={...null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},...e};o.deepEqual(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...r){var a,i,n;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(i=null===(a=this.cache.getNow(t))||void 0===a?void 0:a.messages)&&void 0!==i?i:{};return new o.ParametrizedLabelResolver(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},l).resolve(e,...r)}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,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}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=>o.delay(0).then((()=>t())).catch((()=>null)))))}}Lo=Eo,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Ko((async(t,o)=>(await Wo.await()).getFluidTopicsMessageContext(t,o)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Ko((async(t,o)=>(await Wo.await()).getCustomMessageContext(t,o))));const Zo=window.FluidTopicsI18nService,$o=window.FluidTopicsCustomI18nService;var ko=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class zo extends o.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Wo.get(),this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return e.html`
125
125
  <slot></slot>
126
- `}update(t){super.update(t),t.has("baseUrl")&&Ro.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Ro.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ro.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ro.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ro.actions.noCustom(this.noCustom),t.has("editorMode")&&Ro.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ro.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ro.actions.session(this.session),t.has("availableUiLocales")&&Ro.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Zo.addContext(t))),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()))}}zo.elementDefinitions={},zo.styles=Uo,ko([r.property()],zo.prototype,"baseUrl",void 0),ko([r.property()],zo.prototype,"apiIntegrationIdentifier",void 0),ko([r.property()],zo.prototype,"uiLocale",void 0),ko([o.jsonProperty(null)],zo.prototype,"availableUiLocales",void 0),ko([o.jsonProperty(null)],zo.prototype,"metadataConfiguration",void 0),ko([r.property({type:Boolean})],zo.prototype,"editorMode",void 0),ko([r.property({type:Boolean})],zo.prototype,"noCustom",void 0),ko([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],zo.prototype,"noCustomComponent",void 0),ko([r.property({type:Boolean})],zo.prototype,"withManualResources",void 0),ko([o.jsonProperty([])],zo.prototype,"messageContexts",void 0),ko([o.jsonProperty(void 0)],zo.prototype,"session",void 0),ko([r.property({type:Object})],zo.prototype,"apiProvider",void 0);class Fo{async listMySearches(){var t;return(null===(t=Ro.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Wo.await()).listMySearches(Ro.getState().session.profile.userId):[]}}const Do=new o.CacheRegistry;class Bo{async listMyBookmarks(){return Do.get("bookmarks",(async()=>(await Wo.await()).listMyBookmarks(Ro.getState().session.profile.userId)))}clearCache(){Do.clear("bookmarks")}}const Ao=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Ro.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Bo,Ro.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ro.getState();o.deepEqual(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(){Ao.actions.savedSearches(void 0)}clearMyBookmarks(){Ao.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Fo,o=await t.listMySearches();Ao.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Ao.actions.bookmarks(o)}}},o.customElement("ft-app-context")(zo);const Go=e.css`
126
+ `}update(t){super.update(t),t.has("baseUrl")&&(Ro.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ro.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ro.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ro.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ro.actions.noCustom(this.noCustom),t.has("editorMode")&&Ro.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ro.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ro.actions.session(this.session),t.has("availableUiLocales")&&Ro.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Zo.addContext(t))),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()))}}zo.elementDefinitions={},zo.styles=Uo,ko([r.property()],zo.prototype,"baseUrl",void 0),ko([r.property()],zo.prototype,"apiIntegrationIdentifier",void 0),ko([r.property()],zo.prototype,"uiLocale",void 0),ko([o.jsonProperty(null)],zo.prototype,"availableUiLocales",void 0),ko([o.jsonProperty(null)],zo.prototype,"metadataConfiguration",void 0),ko([r.property({type:Boolean})],zo.prototype,"editorMode",void 0),ko([r.property({type:Boolean})],zo.prototype,"noCustom",void 0),ko([r.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],zo.prototype,"noCustomComponent",void 0),ko([r.property({type:Boolean})],zo.prototype,"withManualResources",void 0),ko([o.jsonProperty([])],zo.prototype,"messageContexts",void 0),ko([o.jsonProperty(void 0)],zo.prototype,"session",void 0),ko([r.property({type:Object})],zo.prototype,"apiProvider",void 0);class Fo{async listMySearches(){var t;return(null===(t=Ro.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Wo.await()).listMySearches(Ro.getState().session.profile.userId):[]}}const Do=new o.CacheRegistry;class Bo{async listMyBookmarks(){return Do.get("bookmarks",(async()=>(await Wo.await()).listMyBookmarks(Ro.getState().session.profile.userId)))}clearCache(){Do.clear("bookmarks")}}const Ao=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Ro.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Bo,Ro.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ro.getState();o.deepEqual(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(){Ao.actions.savedSearches(void 0)}clearMyBookmarks(){Ao.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Fo,o=await t.listMySearches();Ao.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Ao.actions.bookmarks(o)}}},o.customElement("ft-app-context")(zo);const Go=e.css`
127
127
  `;var Ho=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};const Po=Symbol("i18nProperties"),Mo=Symbol("i18nUnsubs");function jo(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?$o:Zo}i18n(t,o,...e){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);const a=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...a)}onI18nUpdate(t){var o;null===(o=this[Po])||void 0===o||o.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Po])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Po]&&new Set([...this[Po].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Mo].has(t)||this[Mo].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Mo].forEach((t=>t())),this[Mo].clear()}}return o=Mo,Ho([r.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class To extends(jo(o.FtLitElement)){}class _o extends(jo(o.FtLitElementRedux)){}var Yo=function(t,o,e,r){for(var a,i=arguments.length,n=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,l=t.length-1;l>=0;l--)(a=t[l])&&(n=(i<3?a(n):i>3?a(o,e,n):a(o,e))||n);return i>3&&n&&Object.defineProperty(o,e,n),n};class Xo extends _o{constructor(){super(),this.editorMode=!1,this.addStore(Ro)}render(){return this.key&&this.context?e.html`
128
128
  <span class="ft-i18n">
129
129
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
@@ -221,7 +221,7 @@ let bo=class extends At{constructor(){super(...arguments),this.renderOptions={ho
221
221
  `}}bi.styles=[ni,ii,ai,si,ci,li,fi,hi,pi,ui,di,...yi],gi([U()],bi.prototype,"element",void 0),gi([U()],bi.prototype,"variant",void 0),W("ft-typography")(bi);const mi=Ot`
222
222
  `,Oi=Ar.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}});class vi{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=Oi.getState(),r=null!=t?t:e;if(o&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,r,!0)}static get(t){var o;return null!=t?vi.build(t):null!==(o=vi.API)&&void 0!==o?o:vi.API=vi.build()}static await(t){return new Promise((o=>{let e=vi.get(t);if(e)o(e);else{const r=Oi.subscribe((()=>{e=vi.get(t),e&&(r(),o(e))}))}}))}}var Si;const wi=Symbol("clearAfterUnitTest");class Ni{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new r,this.listeners={},this.currentUiLocale="",this[Si]=()=>{this.defaultMessages={},this.cache=new r,this.listeners={}},this.currentUiLocale=Oi.getState().uiLocale,Oi.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Oi.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,o){var e;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(e=this.defaultMessages[t])&&void 0!==e?e:{},...o};L(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...e){var r,n,i;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new Ao(null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},a).resolve(o,...e)}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,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}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(o=0,new Promise((t=>setTimeout(t,o)))).then((()=>t())).catch((()=>null));var o})))}}Si=wi,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Ni((async(t,o)=>(await vi.await()).getFluidTopicsMessageContext(t,o)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Ni((async(t,o)=>(await vi.await()).getCustomMessageContext(t,o))));const xi=window.FluidTopicsI18nService,Ci=window.FluidTopicsCustomI18nService;var Ei=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class Ri extends $o{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>vi.get(),this.cache=new r,this.cleanSessionDebouncer=new n}render(){return oo`
223
223
  <slot></slot>
224
- `}update(t){super.update(t),t.has("baseUrl")&&Oi.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Oi.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Oi.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Oi.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Oi.actions.noCustom(this.noCustom),t.has("editorMode")&&Oi.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Oi.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Oi.actions.session(this.session),t.has("availableUiLocales")&&Oi.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>xi.addContext(t))),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()))}}Ri.elementDefinitions={},Ri.styles=mi,Ei([U()],Ri.prototype,"baseUrl",void 0),Ei([U()],Ri.prototype,"apiIntegrationIdentifier",void 0),Ei([U()],Ri.prototype,"uiLocale",void 0),Ei([k(null)],Ri.prototype,"availableUiLocales",void 0),Ei([k(null)],Ri.prototype,"metadataConfiguration",void 0),Ei([U({type:Boolean})],Ri.prototype,"editorMode",void 0),Ei([U({type:Boolean})],Ri.prototype,"noCustom",void 0),Ei([U({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ri.prototype,"noCustomComponent",void 0),Ei([U({type:Boolean})],Ri.prototype,"withManualResources",void 0),Ei([k([])],Ri.prototype,"messageContexts",void 0),Ei([k(void 0)],Ri.prototype,"session",void 0),Ei([U({type:Object})],Ri.prototype,"apiProvider",void 0);class Ui{async listMySearches(){var t;return(null===(t=Oi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await vi.await()).listMySearches(Oi.getState().session.profile.userId):[]}}const Ii=new r;class Li{async listMyBookmarks(){return Ii.get("bookmarks",(async()=>(await vi.await()).listMyBookmarks(Oi.getState().session.profile.userId)))}clearCache(){Ii.clear("bookmarks")}}const Wi=Ar.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Oi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Li,Oi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Oi.getState();L(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(){Wi.actions.savedSearches(void 0)}clearMyBookmarks(){Wi.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ui,o=await t.listMySearches();Wi.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Wi.actions.bookmarks(o)}}},W("ft-app-context")(Ri);const ki=Ot`
224
+ `}update(t){super.update(t),t.has("baseUrl")&&(Oi.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Oi.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Oi.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Oi.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Oi.actions.noCustom(this.noCustom),t.has("editorMode")&&Oi.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Oi.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Oi.actions.session(this.session),t.has("availableUiLocales")&&Oi.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>xi.addContext(t))),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()))}}Ri.elementDefinitions={},Ri.styles=mi,Ei([U()],Ri.prototype,"baseUrl",void 0),Ei([U()],Ri.prototype,"apiIntegrationIdentifier",void 0),Ei([U()],Ri.prototype,"uiLocale",void 0),Ei([k(null)],Ri.prototype,"availableUiLocales",void 0),Ei([k(null)],Ri.prototype,"metadataConfiguration",void 0),Ei([U({type:Boolean})],Ri.prototype,"editorMode",void 0),Ei([U({type:Boolean})],Ri.prototype,"noCustom",void 0),Ei([U({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ri.prototype,"noCustomComponent",void 0),Ei([U({type:Boolean})],Ri.prototype,"withManualResources",void 0),Ei([k([])],Ri.prototype,"messageContexts",void 0),Ei([k(void 0)],Ri.prototype,"session",void 0),Ei([U({type:Object})],Ri.prototype,"apiProvider",void 0);class Ui{async listMySearches(){var t;return(null===(t=Oi.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await vi.await()).listMySearches(Oi.getState().session.profile.userId):[]}}const Ii=new r;class Li{async listMyBookmarks(){return Ii.get("bookmarks",(async()=>(await vi.await()).listMyBookmarks(Oi.getState().session.profile.userId)))}clearCache(){Ii.clear("bookmarks")}}const Wi=Ar.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=Oi.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Li,Oi.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Oi.getState();L(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(){Wi.actions.savedSearches(void 0)}clearMyBookmarks(){Wi.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Ui,o=await t.listMySearches();Wi.actions.savedSearches(o)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Wi.actions.bookmarks(o)}}},W("ft-app-context")(Ri);const ki=Ot`
225
225
  `;var $i=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};const Ki=Symbol("i18nProperties"),Ai=Symbol("i18nUnsubs");function ji(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?Ci:xi}i18n(t,o,...e){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);const n=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var o;null===(o=this[Ki])||void 0===o||o.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var o;super.update(t),null===(o=this[Ki])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Ki]&&new Set([...this[Ki].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[Ai].has(t)||this[Ai].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages(t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[Ai].forEach((t=>t())),this[Ai].clear()}}return o=Ai,$i([U({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class Fi extends(ji($o)){}class Mi extends(ji(To)){}var Zi=function(t,o,e,r){for(var n,i=arguments.length,a=i<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,e):r,s=t.length-1;s>=0;s--)(n=t[s])&&(a=(i<3?n(a):i>3?n(o,e,a):n(o,e))||a);return i>3&&a&&Object.defineProperty(o,e,a),a};class Pi extends Mi{constructor(){super(),this.editorMode=!1,this.addStore(Oi)}render(){return this.key&&this.context?oo`
226
226
  <span class="ft-i18n">
227
227
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-reader-page-title",
3
- "version": "1.1.24",
3
+ "version": "1.1.26",
4
4
  "description": "Displays the previous/current/next page title",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,10 +19,10 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-reader-context": "1.1.24",
23
- "@fluid-topics/ft-typography": "1.1.24",
24
- "@fluid-topics/ft-wc-utils": "1.1.24",
22
+ "@fluid-topics/ft-reader-context": "1.1.26",
23
+ "@fluid-topics/ft-typography": "1.1.26",
24
+ "@fluid-topics/ft-wc-utils": "1.1.26",
25
25
  "lit": "3.1.0"
26
26
  },
27
- "gitHead": "e645c69187d4f7a42d254a22be5a23144a3ea5d0"
27
+ "gitHead": "6734976f5a7f6b986917a085be0c38ca3ae562a0"
28
28
  }