@fluid-topics/ft-search-period-filter 1.1.66 → 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.
|
@@ -1523,9 +1523,9 @@ const ao=Symbol.for(""),lo=t=>{if(t?.r===ao)return t?._$litStatic$},so=t=>({_$li
|
|
|
1523
1523
|
|
|
1524
1524
|
`,tr=e.css`
|
|
1525
1525
|
`,or=e.css`
|
|
1526
|
-
`,er=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,openExternalDocumentInNewTab:!1}});class ir{static get(t){const{baseUrl:o,apiIntegrationIdentifier:e}=er.getState(),i=null!=t?t:e;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(t){return new Promise((o=>{let e=ir.get(t);if(e)o(e);else{const i=er.subscribe((()=>{e=ir.get(t),e&&(i(),o(e))}))}}))}}class rr{constructor(t=!0,e){var i;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new o.CacheRegistry,this.cache=t?r.commonCache:new o.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ir.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ir.await()}clearCache(){this.cache.clearAll()}}var nr;const ar=Symbol("clearAfterUnitTest");class lr extends rr{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[nr]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=er.getState().uiLocale,er.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=er.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 i;if(t=t.toLowerCase(),Object.keys(e).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};o.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new o.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},l).resolve(e,...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,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)))))}}nr=ar,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends lr{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends lr{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const sr=window.FluidTopicsI18nService,cr=window.FluidTopicsCustomI18nService;var fr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class pr extends o.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.
|
|
1526
|
+
`,er=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,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});class ir{static get(t){const{baseUrl:o,apiIntegrationIdentifier:e}=er.getState(),i=null!=t?t:e;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(t){return new Promise((o=>{let e=ir.get(t);if(e)o(e);else{const i=er.subscribe((()=>{e=ir.get(t),e&&(i(),o(e))}))}}))}}class rr{constructor(t=!0,e){var i;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new o.CacheRegistry,this.cache=t?r.commonCache:new o.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ir.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ir.await()}clearCache(){this.cache.clearAll()}}var nr;const ar=Symbol("clearAfterUnitTest");class lr extends rr{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[nr]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=er.getState().uiLocale,er.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=er.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 i;if(t=t.toLowerCase(),Object.keys(e).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};o.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new o.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},l).resolve(e,...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,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)))))}}nr=ar,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends lr{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends lr{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const sr=window.FluidTopicsI18nService,cr=window.FluidTopicsCustomI18nService;var fr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class pr extends o.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=()=>ir.get(),this.messageContexts=[],this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return e.html`
|
|
1527
1527
|
<slot></slot>
|
|
1528
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(er.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&er.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&er.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&er.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&er.actions.noCustom(this.noCustom),t.has("editorMode")&&er.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&er.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&er.actions.session(this.session),t.has("availableUiLocales")&&er.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>sr.addContext(t))),t.has("openExternalDocumentInNewTab")&&er.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()))}}pr.elementDefinitions={},pr.styles=or,fr([i.property()],pr.prototype,"baseUrl",void 0),fr([i.property()],pr.prototype,"apiIntegrationIdentifier",void 0),fr([i.property()],pr.prototype,"uiLocale",void 0),fr([o.jsonProperty(null)],pr.prototype,"availableUiLocales",void 0),fr([o.jsonProperty(null)],pr.prototype,"metadataConfiguration",void 0),fr([i.property({type:Boolean})],pr.prototype,"editorMode",void 0),fr([i.property({type:Boolean})],pr.prototype,"noCustom",void 0),fr([i.property({type:Boolean})],pr.prototype,"openExternalDocumentInNewTab",void 0),fr([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],pr.prototype,"noCustomComponent",void 0),fr([i.property({type:Boolean})],pr.prototype,"withManualResources",void 0),fr([
|
|
1528
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(er.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&er.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&er.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&er.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&er.actions.noCustom(this.noCustom),t.has("editorMode")&&er.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&er.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&er.actions.session(this.session),t.has("availableUiLocales")&&er.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>sr.addContext(t))),t.has("openExternalDocumentInNewTab")&&er.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&er.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&er.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()))}}pr.elementDefinitions={},pr.styles=or,fr([i.property()],pr.prototype,"baseUrl",void 0),fr([i.property()],pr.prototype,"apiIntegrationIdentifier",void 0),fr([i.property()],pr.prototype,"uiLocale",void 0),fr([o.jsonProperty(null)],pr.prototype,"availableUiLocales",void 0),fr([o.jsonProperty(null)],pr.prototype,"metadataConfiguration",void 0),fr([i.property({type:Boolean})],pr.prototype,"editorMode",void 0),fr([i.property({type:Boolean})],pr.prototype,"noCustom",void 0),fr([i.property({type:Boolean})],pr.prototype,"openExternalDocumentInNewTab",void 0),fr([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],pr.prototype,"noCustomComponent",void 0),fr([i.property({type:Boolean})],pr.prototype,"withManualResources",void 0),fr([i.property({type:Boolean})],pr.prototype,"navigatorOnline",void 0),fr([i.property({type:Boolean})],pr.prototype,"forcedOffline",void 0),fr([i.property({type:Object})],pr.prototype,"apiProvider",void 0),fr([o.jsonProperty([])],pr.prototype,"messageContexts",void 0),fr([o.jsonProperty(void 0)],pr.prototype,"session",void 0);class dr extends rr{async listMySearches(){let t=er.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class hr extends rr{async listMyBookmarks(){let t=er.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const ur=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=er.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new hr,this.savedSearchesService=new dr,er.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=er.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(){this.savedSearchesService.clearCache(),ur.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ur.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();ur.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 o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;ur.actions.bookmarks(o)}}},o.customElement("ft-app-context")(pr);var gr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};const yr=Symbol("i18nAttributes"),br=Symbol("i18nProperties"),mr=Symbol("i18nUnsubs");function xr(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?cr:sr}i18n(t,o,...e){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);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 o,e;null===(o=this[yr])||void 0===o||o.forEach(((o,e)=>{var i;const r=this.getI18nAttributeValue(e);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(e,r,o)})),null===(e=this[br])||void 0===e||e.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,o,e){this[t]={...o,message:this.i18n({context:o.context,key:o.key,...e})}}update(t){var o,e;super.update(t),null===(o=this[yr])||void 0===o||o.forEach(((o,e)=>{const i=this.getI18nAttributeValue(e);(null==i?void 0:i.context)&&i.key&&(t.has(e)||null!=o.argsProvider)&&(t.has(e)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(e,i,o))})),null===(e=this[br])||void 0===e||e.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,o,e,i;super.connectedCallback(),new Set([...null!==(o=null===(t=this[br])||void 0===t?void 0:t.values())&&void 0!==o?o:[],...[...null!==(i=null===(e=this[yr])||void 0===e?void 0:e.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,o){t=t.toLowerCase(),this[mr].has(t)||this[mr].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages("string"==typeof t?t:t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[mr].forEach((t=>t())),this[mr].clear()}}return o=mr,gr([i.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class vr extends(xr(o.FtLitElement)){}class Or extends(xr(o.FtLitElementRedux)){}var wr,Sr,Nr,$r,Cr,Er,Ir,kr,Rr,Ur,Lr,Wr,zr,Ar,Zr,Kr,Dr,Br,Fr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Tr extends Or{constructor(){super(),this.editorMode=!1,this.addStore(er)}render(){return this.key&&this.context?e.html`
|
|
1529
1529
|
<span class="ft-i18n">
|
|
1530
1530
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1531
1531
|
</span>
|
|
@@ -1691,9 +1691,9 @@ function Re(t){return(e,o)=>{const{slot:r,selector:i}=t??{},n="slot"+(r?`[name=$
|
|
|
1691
1691
|
|
|
1692
1692
|
`,mf=dt`
|
|
1693
1693
|
`,vf=dt`
|
|
1694
|
-
`,xf=os.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 Of{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=xf.getState(),r=null!=t?t:o;if(e&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,r,!0)}static await(t){return new Promise((e=>{let o=Of.get(t);if(o)e(o);else{const r=xf.subscribe((()=>{o=Of.get(t),o&&(r(),e(o))}))}}))}}class wf{constructor(t=!0,e){var o;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(o=r.commonCache)&&void 0!==o?o:new io,this.cache=t?r.commonCache:new io}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Of.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Of.await()}clearCache(){this.cache.clearAll()}}var Sf;const Cf=Symbol("clearAfterUnitTest");class Nf extends wf{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Sf]=()=>{this.defaultMessages={},this.cache=new io,this.listeners={}},this.currentUiLocale=xf.getState().uiLocale,xf.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=xf.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 r={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};yo(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var r,i,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(i=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==i?i:{};return new on(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=>fo(0).then((()=>t())).catch((()=>null)))))}}Sf=Cf,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Nf{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Nf{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Ef=window.FluidTopicsI18nService,$f=window.FluidTopicsCustomI18nService;var kf=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Rf extends Mi{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.
|
|
1694
|
+
`,xf=os.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 Of{static get(t){const{baseUrl:e,apiIntegrationIdentifier:o}=xf.getState(),r=null!=t?t:o;if(e&&r&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,r,!0)}static await(t){return new Promise((e=>{let o=Of.get(t);if(o)e(o);else{const r=xf.subscribe((()=>{o=Of.get(t),o&&(r(),e(o))}))}}))}}class wf{constructor(t=!0,e){var o;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(o=r.commonCache)&&void 0!==o?o:new io,this.cache=t?r.commonCache:new io}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Of.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Of.await()}clearCache(){this.cache.clearAll()}}var Sf;const Cf=Symbol("clearAfterUnitTest");class Nf extends wf{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Sf]=()=>{this.defaultMessages={},this.cache=new io,this.listeners={}},this.currentUiLocale=xf.getState().uiLocale,xf.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=xf.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 r={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};yo(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var r,i,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(i=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==i?i:{};return new on(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=>fo(0).then((()=>t())).catch((()=>null)))))}}Sf=Cf,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Nf{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Nf{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Ef=window.FluidTopicsI18nService,$f=window.FluidTopicsCustomI18nService;var kf=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Rf extends Mi{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=()=>Of.get(),this.messageContexts=[],this.cache=new io,this.cleanSessionDebouncer=new lo}render(){return Jt`
|
|
1695
1695
|
<slot></slot>
|
|
1696
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(xf.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&xf.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&xf.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&xf.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&xf.actions.noCustom(this.noCustom),t.has("editorMode")&&xf.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&xf.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&xf.actions.session(this.session),t.has("availableUiLocales")&&xf.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ef.addContext(t))),t.has("openExternalDocumentInNewTab")&&xf.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()))}}Rf.elementDefinitions={},Rf.styles=vf,kf([we()],Rf.prototype,"baseUrl",void 0),kf([we()],Rf.prototype,"apiIntegrationIdentifier",void 0),kf([we()],Rf.prototype,"uiLocale",void 0),kf([mo(null)],Rf.prototype,"availableUiLocales",void 0),kf([mo(null)],Rf.prototype,"metadataConfiguration",void 0),kf([we({type:Boolean})],Rf.prototype,"editorMode",void 0),kf([we({type:Boolean})],Rf.prototype,"noCustom",void 0),kf([we({type:Boolean})],Rf.prototype,"openExternalDocumentInNewTab",void 0),kf([we({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Rf.prototype,"noCustomComponent",void 0),kf([we({type:Boolean})],Rf.prototype,"withManualResources",void 0),kf([
|
|
1696
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(xf.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&xf.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&xf.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&xf.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&xf.actions.noCustom(this.noCustom),t.has("editorMode")&&xf.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&xf.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&xf.actions.session(this.session),t.has("availableUiLocales")&&xf.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ef.addContext(t))),t.has("openExternalDocumentInNewTab")&&xf.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&xf.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&xf.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()))}}Rf.elementDefinitions={},Rf.styles=vf,kf([we()],Rf.prototype,"baseUrl",void 0),kf([we()],Rf.prototype,"apiIntegrationIdentifier",void 0),kf([we()],Rf.prototype,"uiLocale",void 0),kf([mo(null)],Rf.prototype,"availableUiLocales",void 0),kf([mo(null)],Rf.prototype,"metadataConfiguration",void 0),kf([we({type:Boolean})],Rf.prototype,"editorMode",void 0),kf([we({type:Boolean})],Rf.prototype,"noCustom",void 0),kf([we({type:Boolean})],Rf.prototype,"openExternalDocumentInNewTab",void 0),kf([we({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Rf.prototype,"noCustomComponent",void 0),kf([we({type:Boolean})],Rf.prototype,"withManualResources",void 0),kf([we({type:Boolean})],Rf.prototype,"navigatorOnline",void 0),kf([we({type:Boolean})],Rf.prototype,"forcedOffline",void 0),kf([we({type:Object})],Rf.prototype,"apiProvider",void 0),kf([mo([])],Rf.prototype,"messageContexts",void 0),kf([mo(void 0)],Rf.prototype,"session",void 0);class If extends wf{async listMySearches(){let t=xf.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Lf extends wf{async listMyBookmarks(){let t=xf.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Uf=os.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=xf.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Lf,this.savedSearchesService=new If,xf.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=xf.getState();yo(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(),Uf.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Uf.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Uf.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;Uf.actions.bookmarks(e)}}},bo("ft-app-context")(Rf);var Af=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Wf=Symbol("i18nAttributes"),Bf=Symbol("i18nProperties"),zf=Symbol("i18nUnsubs");function Ff(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?$f:Ef}i18n(t,e,...o){var r;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const i=null!==(r=t.args)&&void 0!==r?r:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...i)}onI18nUpdate(t){var e,o;null===(e=this[Wf])||void 0===e||e.forEach(((e,o)=>{var r;const i=this.getI18nAttributeValue(o);(null===(r=null==i?void 0:i.context)||void 0===r?void 0:r.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,i,e)})),null===(o=this[Bf])||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[Wf])||void 0===e||e.forEach(((e,o)=>{const r=this.getI18nAttributeValue(o);(null==r?void 0:r.context)&&r.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(r.context),this.updateI18nAttributeMessage(o,r,e))})),null===(o=this[Bf])||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,r;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Bf])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(r=null===(o=this[Wf])||void 0===o?void 0:o.keys())&&void 0!==r?r:[]].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[zf].has(t)||this[zf].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[zf].forEach((t=>t())),this[zf].clear()}}return e=zf,Af([we({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class _f extends(Ff(Mi)){}class Pf extends(Ff(un)){}var jf,Df,Mf,Tf,Hf,Kf,Zf,Gf,Vf,qf,Yf,Jf,Xf,Qf,th,eh,oh,rh,ih=function(t,e,o,r){for(var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r,s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class nh extends Pf{constructor(){super(),this.editorMode=!1,this.addStore(xf)}render(){return this.key&&this.context?Jt`
|
|
1697
1697
|
<span class="ft-i18n">
|
|
1698
1698
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1699
1699
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-period-filter",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.68",
|
|
4
4
|
"description": "Search period filter for integrated fluid-topics search pages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,16 +19,16 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-filter": "1.1.
|
|
23
|
-
"@fluid-topics/ft-i18n": "1.1.
|
|
24
|
-
"@fluid-topics/ft-icon": "1.1.
|
|
25
|
-
"@fluid-topics/ft-search-context": "1.1.
|
|
26
|
-
"@fluid-topics/ft-tooltip": "1.1.
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-filter": "1.1.68",
|
|
23
|
+
"@fluid-topics/ft-i18n": "1.1.68",
|
|
24
|
+
"@fluid-topics/ft-icon": "1.1.68",
|
|
25
|
+
"@fluid-topics/ft-search-context": "1.1.68",
|
|
26
|
+
"@fluid-topics/ft-tooltip": "1.1.68",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "1.1.68",
|
|
28
28
|
"lit": "3.1.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@fluid-topics/public-api": "1.0.
|
|
31
|
+
"@fluid-topics/public-api": "1.0.67"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "d10171ba718cee726044d0cc44820ebbb1ab7cbc"
|
|
34
34
|
}
|