@fluid-topics/ft-search-result-metadata 1.1.25 → 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.
@@ -13,7 +13,7 @@
13
13
  `;var s,c,f,p,h,d,u,g,y,b,m,v,x,O,N,w,S,C;!function(t){!function(o){var e={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(e.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function r(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function l(t){var o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function s(t){this.map={},t instanceof s?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function p(t){var o=new FileReader,e=f(o);return o.readAsArrayBuffer(t),e}function h(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||n(t))?this._bodyArrayBuffer=h(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(p)}),this.text=function(){var t,o,e,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=f(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),i=0;i<o.length;i++)e[i]=String.fromCharCode(o[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}s.prototype.append=function(t,o){t=r(t),o=a(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},s.prototype.delete=function(t){delete this.map[r(t)]},s.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},s.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},s.prototype.set=function(t,o){this.map[r(t)]=a(o)},s.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},s.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),l(t)},s.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),l(t)},s.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),l(t)},e.iterable&&(s.prototype[Symbol.iterator]=s.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,o){var e,i,n=(o=o||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.headers||(this.headers=new s(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,n||null==t._bodyInit||(n=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new s(o.headers)),this.method=(e=o.method||this.method||"GET",i=e.toUpperCase(),u.indexOf(i)>-1?i:e),this.mode=o.mode||this.mode||null,this.signal=o.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function y(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),n=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(i),decodeURIComponent(n))}})),o}function b(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new s(o.headers),this.url=o.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},d.call(g.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new s(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new b(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function v(t,i){return new Promise((function(n,r){var a=new g(t,i);if(a.signal&&a.signal.aborted)return r(new o.DOMException("Aborted","AbortError"));var l=new XMLHttpRequest;function c(){l.abort()}l.onload=function(){var t,o,e={status:l.status,statusText:l.statusText,headers:(t=l.getAllResponseHeaders()||"",o=new s,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),i=e.shift().trim();if(i){var n=e.join(":").trim();o.append(i,n)}})),o)};e.url="responseURL"in l?l.responseURL:e.headers.get("X-Request-URL");var i="response"in l?l.response:l.responseText;n(new b(i,e))},l.onerror=function(){r(new TypeError("Network request failed"))},l.ontimeout=function(){r(new TypeError("Network request failed"))},l.onabort=function(){r(new o.DOMException("Aborted","AbortError"))},l.open(a.method,a.url,!0),"include"===a.credentials?l.withCredentials=!0:"omit"===a.credentials&&(l.withCredentials=!1),"responseType"in l&&e.blob&&(l.responseType="blob"),a.headers.forEach((function(t,o){l.setRequestHeader(o,t)})),a.signal&&(a.signal.addEventListener("abort",c),l.onreadystatechange=function(){4===l.readyState&&a.signal.removeEventListener("abort",c)}),l.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=s,t.Request=g,t.Response=b),o.Headers=s,o.Request=g,o.Response=b,o.fetch=v,Object.defineProperty(o,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(s||(s={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(c||(c={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(f||(f={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(p||(p={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(h||(h={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(d||(d={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(u||(u={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(g||(g={})),function(t){t.ASC="ASC",t.DESC="DESC"}(y||(y={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(b||(b={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(m||(m={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(v||(v={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(x||(x={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(O||(O={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(N||(N={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(w||(w={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(S||(S={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(C||(C={})),S.PERSONAL_BOOK_SHARE_USER,S.PERSONAL_BOOK_USER,S.HTML_EXPORT_USER,S.PERSONAL_BOOK_USER,S.PDF_EXPORT_USER,S.PERSONAL_BOOK_USER,S.KHUB_ADMIN,S.CONTENT_PUBLISHER,S.ADMIN,S.KHUB_ADMIN,S.USERS_ADMIN,S.PORTAL_ADMIN,S.DEVELOPER,S.BETA_USER,S.DEBUG_USER;const $=e.css`
14
14
  `,I=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 E{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=I.getState(),i=null!=t?t:e;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static get(t){var o;return null!=t?E.build(t):null!==(o=E.API)&&void 0!==o?o:E.API=E.build()}static await(t){return new Promise((o=>{let e=E.get(t);if(e)o(e);else{const i=I.subscribe((()=>{e=E.get(t),e&&(i(),o(e))}))}}))}}var R;const k=Symbol("clearAfterUnitTest");class U{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={},this.currentUiLocale="",this[R]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=I.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 n={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};o.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var n,r,a;t=t.toLowerCase(),this.fetchContext(t);const l=null!==(r=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==r?r:{};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)))))}}R=k,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new U((async(t,o)=>(await E.await()).getFluidTopicsMessageContext(t,o)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new U((async(t,o)=>(await E.await()).getCustomMessageContext(t,o))));const L=window.FluidTopicsI18nService,W=window.FluidTopicsCustomI18nService;var z=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class A 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=()=>E.get(),this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return e.html`
15
15
  <slot></slot>
16
- `}update(t){super.update(t),t.has("baseUrl")&&I.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&I.actions.noCustom(this.noCustom),t.has("editorMode")&&I.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&I.actions.session(this.session),t.has("availableUiLocales")&&I.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>L.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()))}}A.elementDefinitions={},A.styles=$,z([i.property()],A.prototype,"baseUrl",void 0),z([i.property()],A.prototype,"apiIntegrationIdentifier",void 0),z([i.property()],A.prototype,"uiLocale",void 0),z([o.jsonProperty(null)],A.prototype,"availableUiLocales",void 0),z([o.jsonProperty(null)],A.prototype,"metadataConfiguration",void 0),z([i.property({type:Boolean})],A.prototype,"editorMode",void 0),z([i.property({type:Boolean})],A.prototype,"noCustom",void 0),z([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],A.prototype,"noCustomComponent",void 0),z([i.property({type:Boolean})],A.prototype,"withManualResources",void 0),z([o.jsonProperty([])],A.prototype,"messageContexts",void 0),z([o.jsonProperty(void 0)],A.prototype,"session",void 0),z([i.property({type:Object})],A.prototype,"apiProvider",void 0);class K{async listMySearches(){var t;return(null===(t=I.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await E.await()).listMySearches(I.getState().session.profile.userId):[]}}const Z=new o.CacheRegistry;class B{async listMyBookmarks(){return Z.get("bookmarks",(async()=>(await E.await()).listMyBookmarks(I.getState().session.profile.userId)))}clearCache(){Z.clear("bookmarks")}}const D=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new B,I.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=I.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(){D.actions.savedSearches(void 0)}clearMyBookmarks(){D.actions.bookmarks(void 0)}async reloadMySearches(){const t=new K,o=await t.listMySearches();D.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;D.actions.bookmarks(o)}}},o.customElement("ft-app-context")(A);class F extends Event{constructor(){super(F.eventName)}}F.eventName="search-context-clear-all-filters";var T=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class P extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const M=Symbol("registerInterval");class H extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[M]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[M]):this.dispatchEvent(new P)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=M,T([i.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}var j=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class G extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const _=Symbol("registerInterval");class V extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[_]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[_]):this.dispatchEvent(new G)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return o=_,j([i.property({attribute:!1})],e.prototype,"cluster",void 0),j([i.property({attribute:!1})],e.prototype,"result",void 0),j([i.property({attribute:!1,type:Number})],e.prototype,"rank",void 0),e}(H)){}const Y=e.css`
16
+ `}update(t){super.update(t),t.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&I.actions.noCustom(this.noCustom),t.has("editorMode")&&I.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&I.actions.session(this.session),t.has("availableUiLocales")&&I.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>L.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()))}}A.elementDefinitions={},A.styles=$,z([i.property()],A.prototype,"baseUrl",void 0),z([i.property()],A.prototype,"apiIntegrationIdentifier",void 0),z([i.property()],A.prototype,"uiLocale",void 0),z([o.jsonProperty(null)],A.prototype,"availableUiLocales",void 0),z([o.jsonProperty(null)],A.prototype,"metadataConfiguration",void 0),z([i.property({type:Boolean})],A.prototype,"editorMode",void 0),z([i.property({type:Boolean})],A.prototype,"noCustom",void 0),z([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],A.prototype,"noCustomComponent",void 0),z([i.property({type:Boolean})],A.prototype,"withManualResources",void 0),z([o.jsonProperty([])],A.prototype,"messageContexts",void 0),z([o.jsonProperty(void 0)],A.prototype,"session",void 0),z([i.property({type:Object})],A.prototype,"apiProvider",void 0);class K{async listMySearches(){var t;return(null===(t=I.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await E.await()).listMySearches(I.getState().session.profile.userId):[]}}const Z=new o.CacheRegistry;class B{async listMyBookmarks(){return Z.get("bookmarks",(async()=>(await E.await()).listMyBookmarks(I.getState().session.profile.userId)))}clearCache(){Z.clear("bookmarks")}}const D=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new B,I.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=I.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(){D.actions.savedSearches(void 0)}clearMyBookmarks(){D.actions.bookmarks(void 0)}async reloadMySearches(){const t=new K,o=await t.listMySearches();D.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;D.actions.bookmarks(o)}}},o.customElement("ft-app-context")(A);class F extends Event{constructor(){super(F.eventName)}}F.eventName="search-context-clear-all-filters";var T=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class P extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const M=Symbol("registerInterval");class H extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[M]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[M]):this.dispatchEvent(new P)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=M,T([i.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}var j=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class G extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const _=Symbol("registerInterval");class V extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[_]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[_]):this.dispatchEvent(new G)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return o=_,j([i.property({attribute:!1})],e.prototype,"cluster",void 0),j([i.property({attribute:!1})],e.prototype,"result",void 0),j([i.property({attribute:!1,type:Number})],e.prototype,"rank",void 0),e}(H)){}const Y=e.css`
17
17
  `;var q=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};const X=Symbol("i18nProperties"),J=Symbol("i18nUnsubs");function Q(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?W:L}i18n(t,o,...e){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);const n=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var o;null===(o=this[X])||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[X])||void 0===o||o.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[X]&&new Set([...this[X].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,o){t=t.toLowerCase(),this[J].has(t)||this[J].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[J].forEach((t=>t())),this[J].clear()}}return o=J,q([i.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class tt extends(Q(o.FtLitElement)){}class ot extends(Q(o.FtLitElementRedux)){}var et=function(t,o,e,i){for(var n,r=arguments.length,a=r<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,l=t.length-1;l>=0;l--)(n=t[l])&&(a=(r<3?n(a):r>3?n(o,e,a):n(o,e))||a);return r>3&&a&&Object.defineProperty(o,e,a),a};class it extends ot{constructor(){super(),this.editorMode=!1,this.addStore(I)}render(){return this.key&&this.context?e.html`
18
18
  <span class="ft-i18n">
19
19
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
@@ -137,7 +137,7 @@ let Se=class extends zt{constructor(){super(...arguments),this.renderOptions={ho
137
137
  `;var Qr,tn,en,on,rn,nn,an,sn,ln,cn,fn,hn,un,pn,dn,yn,gn,bn;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function f(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function h(t){var e=new FileReader,o=f(e);return e.readAsArrayBuffer(t),o}function u(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=u(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=u(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return function(t){var e=new FileReader,o=f(e);return e.readAsText(t),o}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),i=0;i<e.length;i++)o[i]=String.fromCharCode(e[i]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var o,i,r=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",i=o.toUpperCase(),d.indexOf(i)>-1?i:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function g(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),i=o.shift().replace(/\+/g," "),r=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function b(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new b(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,i){return new Promise((function(r,n){var a=new y(t,i);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),i=o.shift().trim();if(i){var r=o.join(":").trim();e.append(i,r)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new b(i,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=y,t.Response=b),e.Headers=l,e.Request=y,e.Response=b,e.fetch=v,Object.defineProperty(e,"W",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(Qr||(Qr={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(tn||(tn={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(en||(en={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(on||(on={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(rn||(rn={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(nn||(nn={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(an||(an={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(sn||(sn={})),function(t){t.ASC="ASC",t.DESC="DESC"}(ln||(ln={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(cn||(cn={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(fn||(fn={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(hn||(hn={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(un||(un={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(pn||(pn={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(dn||(dn={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(yn||(yn={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(gn||(gn={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(bn||(bn={})),gn.PERSONAL_BOOK_SHARE_USER,gn.PERSONAL_BOOK_USER,gn.HTML_EXPORT_USER,gn.PERSONAL_BOOK_USER,gn.PDF_EXPORT_USER,gn.PERSONAL_BOOK_USER,gn.KHUB_ADMIN,gn.CONTENT_PUBLISHER,gn.ADMIN,gn.KHUB_ADMIN,gn.USERS_ADMIN,gn.PORTAL_ADMIN,gn.DEVELOPER,gn.BETA_USER,gn.DEBUG_USER;const mn=Et`
138
138
  `,vn=Hr.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 xn{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=vn.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?xn.build(t):null!==(e=xn.API)&&void 0!==e?e:xn.API=xn.build()}static await(t){return new Promise((e=>{let o=xn.get(t);if(o)e(o);else{const i=vn.subscribe((()=>{o=xn.get(t),o&&(i(),e(o))}))}}))}}var On;const wn=Symbol("clearAfterUnitTest");class Sn{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i,this.listeners={},this.currentUiLocale="",this[On]=()=>{this.defaultMessages={},this.cache=new i,this.listeners={}},this.currentUiLocale=vn.getState().uiLocale,vn.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=vn.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};A(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 Vo(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=>{return(e=0,new Promise((t=>setTimeout(t,e)))).then((()=>t())).catch((()=>null));var e})))}}On=wn,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new Sn((async(t,e)=>(await xn.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new Sn((async(t,e)=>(await xn.await()).getCustomMessageContext(t,e))));const Nn=window.FluidTopicsI18nService,Cn=window.FluidTopicsCustomI18nService;var En=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 $n extends Zo{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=()=>xn.get(),this.cache=new i,this.cleanSessionDebouncer=new r}render(){return le`
139
139
  <slot></slot>
140
- `}update(t){super.update(t),t.has("baseUrl")&&vn.actions.baseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&vn.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&vn.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&vn.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&vn.actions.noCustom(this.noCustom),t.has("editorMode")&&vn.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&vn.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&vn.actions.session(this.session),t.has("availableUiLocales")&&vn.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Nn.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()))}}$n.elementDefinitions={},$n.styles=mn,En([R()],$n.prototype,"baseUrl",void 0),En([R()],$n.prototype,"apiIntegrationIdentifier",void 0),En([R()],$n.prototype,"uiLocale",void 0),En([j(null)],$n.prototype,"availableUiLocales",void 0),En([j(null)],$n.prototype,"metadataConfiguration",void 0),En([R({type:Boolean})],$n.prototype,"editorMode",void 0),En([R({type:Boolean})],$n.prototype,"noCustom",void 0),En([R({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],$n.prototype,"noCustomComponent",void 0),En([R({type:Boolean})],$n.prototype,"withManualResources",void 0),En([j([])],$n.prototype,"messageContexts",void 0),En([j(void 0)],$n.prototype,"session",void 0),En([R({type:Object})],$n.prototype,"apiProvider",void 0);class Rn{async listMySearches(){var t;return(null===(t=vn.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await xn.await()).listMySearches(vn.getState().session.profile.userId):[]}}const kn=new i;class Un{async listMyBookmarks(){return kn.get("bookmarks",(async()=>(await xn.await()).listMyBookmarks(vn.getState().session.profile.userId)))}clearCache(){kn.clear("bookmarks")}}const In=Hr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=vn.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Un,vn.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=vn.getState();A(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(){In.actions.savedSearches(void 0)}clearMyBookmarks(){In.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Rn,e=await t.listMySearches();In.actions.savedSearches(e)}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;In.actions.bookmarks(e)}}},W("ft-app-context")($n);class Ln extends Event{constructor(){super(Ln.eventName)}}Ln.eventName="search-context-clear-all-filters";var An=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 Wn extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const jn=Symbol("registerInterval");class Mn extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[jn]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[jn]):this.dispatchEvent(new Wn)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=jn,An([k()],o.prototype,"stateManager",void 0),o}(ri)){}var Pn=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 Fn extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const Kn=Symbol("registerInterval");class Bn extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Kn]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[Kn]):this.dispatchEvent(new Fn)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return e=Kn,Pn([R({attribute:!1})],o.prototype,"cluster",void 0),Pn([R({attribute:!1})],o.prototype,"result",void 0),Pn([R({attribute:!1,type:Number})],o.prototype,"rank",void 0),o}(Mn)){}const Dn=Et`
140
+ `}update(t){super.update(t),t.has("baseUrl")&&(vn.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&vn.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&vn.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&vn.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&vn.actions.noCustom(this.noCustom),t.has("editorMode")&&vn.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&vn.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&vn.actions.session(this.session),t.has("availableUiLocales")&&vn.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Nn.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()))}}$n.elementDefinitions={},$n.styles=mn,En([R()],$n.prototype,"baseUrl",void 0),En([R()],$n.prototype,"apiIntegrationIdentifier",void 0),En([R()],$n.prototype,"uiLocale",void 0),En([j(null)],$n.prototype,"availableUiLocales",void 0),En([j(null)],$n.prototype,"metadataConfiguration",void 0),En([R({type:Boolean})],$n.prototype,"editorMode",void 0),En([R({type:Boolean})],$n.prototype,"noCustom",void 0),En([R({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],$n.prototype,"noCustomComponent",void 0),En([R({type:Boolean})],$n.prototype,"withManualResources",void 0),En([j([])],$n.prototype,"messageContexts",void 0),En([j(void 0)],$n.prototype,"session",void 0),En([R({type:Object})],$n.prototype,"apiProvider",void 0);class Rn{async listMySearches(){var t;return(null===(t=vn.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await xn.await()).listMySearches(vn.getState().session.profile.userId):[]}}const kn=new i;class Un{async listMyBookmarks(){return kn.get("bookmarks",(async()=>(await xn.await()).listMyBookmarks(vn.getState().session.profile.userId)))}clearCache(){kn.clear("bookmarks")}}const In=Hr.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});new class{constructor(){this.currentSession=vn.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Un,vn.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=vn.getState();A(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(){In.actions.savedSearches(void 0)}clearMyBookmarks(){In.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Rn,e=await t.listMySearches();In.actions.savedSearches(e)}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;In.actions.bookmarks(e)}}},W("ft-app-context")($n);class Ln extends Event{constructor(){super(Ln.eventName)}}Ln.eventName="search-context-clear-all-filters";var An=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 Wn extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const jn=Symbol("registerInterval");class Mn extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[jn]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[jn]):this.dispatchEvent(new Wn)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=jn,An([k()],o.prototype,"stateManager",void 0),o}(ri)){}var Pn=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 Fn extends Event{constructor(){super("register-ft-search-result-component",{bubbles:!0,composed:!0})}}const Kn=Symbol("registerInterval");class Bn extends(function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setResultStateManager(t){this.resultStateManager=t}unregisterResultStateManager(){this.resultStateManager&&(this.resultStateManager.unregisterComponent(this),this.resultStateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Kn]=window.setInterval((()=>this.tryToRegisterToResultContext()),50)}tryToRegisterToResultContext(){null!=this.result?window.clearInterval(this[Kn]):this.dispatchEvent(new Fn)}disconnectedCallback(){super.disconnectedCallback(),this.unregisterResultStateManager()}}return e=Kn,Pn([R({attribute:!1})],o.prototype,"cluster",void 0),Pn([R({attribute:!1})],o.prototype,"result",void 0),Pn([R({attribute:!1,type:Number})],o.prototype,"rank",void 0),o}(Mn)){}const Dn=Et`
141
141
  `;var zn=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 Tn=Symbol("i18nProperties"),Zn=Symbol("i18nUnsubs");function _n(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?Cn:Nn}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;null===(e=this[Tn])||void 0===e||e.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[Tn])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Tn]&&new Set([...this[Tn].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Zn].has(t)||this[Zn].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Zn].forEach((t=>t())),this[Zn].clear()}}return e=Zn,zn([R({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Hn extends(_n(Zo)){}class Gn extends(_n(ri)){}var Vn=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 qn extends Gn{constructor(){super(),this.editorMode=!1,this.addStore(vn)}render(){return this.key&&this.context?le`
142
142
  <span class="ft-i18n">
143
143
  ${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-search-result-metadata",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "Search result metadata for integrated search component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,15 +19,15 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-chip": "1.1.25",
23
- "@fluid-topics/ft-floating-menu": "1.1.25",
24
- "@fluid-topics/ft-search-result-context": "1.1.25",
25
- "@fluid-topics/ft-tooltip": "1.1.25",
26
- "@fluid-topics/ft-wc-utils": "1.1.25",
22
+ "@fluid-topics/ft-chip": "1.1.26",
23
+ "@fluid-topics/ft-floating-menu": "1.1.26",
24
+ "@fluid-topics/ft-search-result-context": "1.1.26",
25
+ "@fluid-topics/ft-tooltip": "1.1.26",
26
+ "@fluid-topics/ft-wc-utils": "1.1.26",
27
27
  "lit": "3.1.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@fluid-topics/public-api": "1.0.55"
30
+ "@fluid-topics/public-api": "1.0.56"
31
31
  },
32
- "gitHead": "d09eebf7a9bd09694505b987bc2645eee91b47a6"
32
+ "gitHead": "6734976f5a7f6b986917a085be0c38ca3ae562a0"
33
33
  }