@fluid-topics/ft-search-selected-facets 1.2.73 → 1.3.0
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.
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
`;var ol=h(A()),nl=h(G());var Ke=h(A());var Ho=h(A()),wp={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{var o;let n=+((o=e.payload)!==null&&o!==void 0?o:20);t.request.paging.perPage=isNaN(n)?20:(0,Ho.minmax)(1,n,1e3)},setPageNumber:(t,e)=>{t.request.paging.page=isNaN(e.payload)?1:Math.max(1,e.payload)},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.metadataFilters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setOtherQueryParams:(t,e)=>{t.request.otherQueryParams=e.payload},setRequestClusterSortCriterion:(t,e)=>{var o;t.request.clusterSortCriterions=(o=e.payload)!==null&&o!==void 0?o:[]}},Ra=t=>Ho.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,suggestResults:void 0},reducers:wp});var Rp=h(La(),1);var Na;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Na||(Na={}));var Ia;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Ia||(Ia={}));var _a;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(_a||(_a={}));var Ir;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(Ir||(Ir={}));var Pa;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Pa||(Pa={}));var ka;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(ka||(ka={}));var pr;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",t.GEN_AI__RATE="GEN_AI__RATE",t.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",t.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(pr||(pr={}));var Da;(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"})(Da||(Da={}));var $a;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT"})($a||($a={}));var Ba;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Ba||(Ba={}));var Fa;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Fa||(Fa={}));var Ma;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Ma||(Ma={}));var Ua;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ua||(Ua={}));var za;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(za||(za={}));var Ha;(function(t){t.ASC="ASC",t.DESC="DESC"})(Ha||(Ha={}));var Wa;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Wa||(Wa={}));var _r;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(_r||(_r={}));var Va;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Va||(Va={}));var Ga;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Ga||(Ga={}));var ja;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(ja||(ja={}));var Go;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Go||(Go={}));var Ft;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(Ft||(Ft={}));var Pr;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Pr||(Pr={}));var ce;(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.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_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.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(ce||(ce={}));var Ka;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Ka||(Ka={}));var Za;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Za||(Za={}));var qa;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(qa||(qa={}));var Ap={[ce.PERSONAL_BOOK_SHARE_USER]:[ce.PERSONAL_BOOK_USER],[ce.HTML_EXPORT_USER]:[ce.PERSONAL_BOOK_USER],[ce.PDF_EXPORT_USER]:[ce.PERSONAL_BOOK_USER],[ce.KHUB_ADMIN]:[ce.CONTENT_PUBLISHER],[ce.ADMIN]:[ce.KHUB_ADMIN,ce.USERS_ADMIN,ce.PORTAL_ADMIN],[ce.GENERATIVE_AI_EXPORT_USER]:[ce.GENERATIVE_AI_USER]};function Ya(t,e){return t===e||(Ap[t]??[]).some(o=>Ya(o,e))}function Qa(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>Ya(n,e))}var tl=h(A());var ts=h(k()),$e=h(G()),at=h(A());var Xa=h(k());var Ja=Xa.css`
|
|
13
13
|
`;var jo=h(A()),Tp="ft-app-info",Xn=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},Lp={session:(t,e)=>{(0,jo.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>I.dispatchEvent(new Xn(e.payload)),0))}},I=jo.FtReduxStore.get({name:Tp,reducers:Lp,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var xt=h(A());var Jn=h(A());var ur=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=I.getState(),i=e??n;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let i=I.subscribe(()=>{n=t.get(e),n&&(i(),o(n))})}})}};var kr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:ur.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):ur.await()}};var bt=class extends kr{constructor(e=!0,o){var n;super(o);let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Jn.CacheRegistry,this.cache=e?i.commonCache:new Jn.CacheRegistry}clearCache(){this.cache.clearAll()}};var es,Np=Symbol("clearAfterUnitTest"),Ko=class extends bt{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[es]=()=>{this.defaultMessages={},this.cache=new xt.CacheRegistry,this.listeners={}},this.currentUiLocale=I.getState().uiLocale,I.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=I.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};(0,xt.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new xt.ParametrizedLabelResolver((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e))}catch(i){!(i instanceof xt.CanceledPromiseError)&&o&&console.error(i)}return o&&await this.notify(e),n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(o=>(0,xt.delay)(0).then(()=>o()).catch(()=>null)))}};es=Np;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ko{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ko{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Dr=window.FluidTopicsI18nService,Zo=window.FluidTopicsCustomI18nService;var Ee=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},oe=class extends at.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=()=>ur.get(),this.messageContexts=[],this.cache=new at.CacheRegistry,this.cleanSessionDebouncer=new at.Debouncer}render(){return ts.html`
|
|
14
14
|
<slot></slot>
|
|
15
|
-
`}update(e){var o,n,i,a,s;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>Dr.addContext(c)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),I.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};oe.elementDefinitions={};oe.styles=Ja;Ee([(0,$e.property)()],oe.prototype,"baseUrl",void 0);Ee([(0,$e.property)()],oe.prototype,"apiIntegrationIdentifier",void 0);Ee([(0,$e.property)()],oe.prototype,"uiLocale",void 0);Ee([(0,at.jsonProperty)(null)],oe.prototype,"availableUiLocales",void 0);Ee([(0,at.jsonProperty)(null)],oe.prototype,"metadataConfiguration",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"editorMode",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"noCustom",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);Ee([(0,$e.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"withManualResources",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"navigatorOnline",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"forcedOffline",void 0);Ee([(0,$e.property)({type:Object})],oe.prototype,"apiProvider",void 0);Ee([(0,at.jsonProperty)([])],oe.prototype,"messageContexts",void 0);Ee([(0,at.jsonProperty)(void 0)],oe.prototype,"session",void 0);Ee([(0,$e.state)()],oe.prototype,"localesConfiguration",void 0);var Ei=h(G());function Ip(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!qo(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!qo(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(c=>s[c]!=null);if(i=a(t),o=i.length,o!==a(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=o;n--!==0;){let s=i[n];if(!qo(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function qo(t,e){try{return Ip(t,e)}catch{return!1}}function lo(t,e){return!qo(t,e)}var rs=h(G(),1);var ei=t=>{let e=t??{};return(o,n)=>{var i;let a={hasChanged:lo,attribute:!1,...e};(0,rs.property)(a)(o,n);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}};var Yo=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var $r=h(G(),1);var os=h(G(),1);function ns(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,os.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:lo,...e??{}})}var Qo=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(c){i(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var as=h(k(),1);var Xo=globalThis,_p=Xo.ShadowRoot&&(Xo.ShadyCSS===void 0||Xo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hf=Symbol();var is=(t,e)=>{if(_p)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),i=Xo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,t.appendChild(n)}};var Jo=class extends as.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return is(n,e.elementStyles),n}};function ss(t,e,...o){var n;let i=t.querySelector(e);for(let a of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(a);return i}var co=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ps,ls=Symbol("constructorPrototype"),cs=Symbol("constructorName"),us=Symbol("exportpartsDebouncer"),ds=Symbol("dynamicDependenciesLoaded"),At=class extends Jo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ps]=new Qo(5),this[cs]=this.constructor.name,this[ls]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[cs]&&Object.setPrototypeOf(this,this[ls])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let e=this.constructor;e[ds]||(e[ds]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let a=[...i??[],n];o=ss(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,i;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}scheduleExportpartsUpdate(){var e,o,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[us].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var o,n,i,a,s,c;let p=b=>b!=null&&b.trim().length>0,u=e.filter(p).map(b=>b.trim());if(u.length===0){this.removeAttribute("exportparts");return}let g=new Set;for(let b of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(a=(i=b.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],S=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(O=>O.split(":")[1]))!==null&&c!==void 0?c:[];new Array(...v,...S).filter(p).map(O=>O.trim()).forEach(O=>g.add(O))}if(g.size===0){this.removeAttribute("exportparts");return}let y=[...g.values()].flatMap(b=>u.map(v=>`${b}:${v}--${b}`));this.setAttribute("exportparts",[...this.part,...y].join(", "))}};ps=us;co([(0,$r.property)()],At.prototype,"exportpartsPrefix",void 0);co([ns([])],At.prototype,"exportpartsPrefixes",void 0);co([(0,$r.property)()],At.prototype,"customStylesheet",void 0);co([(0,$r.property)()],At.prototype,"elementToFocus",void 0);co([(0,$r.state)()],At.prototype,"useAdoptedStyleSheets",void 0);function po(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var fs,hs,ys,uo=Symbol("internalReduxEventsUnsubscribers"),Mt=Symbol("internalStoresUnsubscribers"),fr=Symbol("internalStores"),fo=class extends At{constructor(){super(...arguments),this[fs]=new Map,this[hs]=new Map,this[ys]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(o=>e.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[fr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[fr].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[fr].get(e)}addStore(e,o){var n;o=(n=o??(po(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(o),this[fr].set(o,e),this.subscribeToStore(o,e),this.updateFromStores()}removeStore(e){let o=typeof e=="string"?e:e.name;this.unsubscribeFromStore(o),this[fr].delete(o)}setupStores(){this.unsubscribeFromStores(),this[fr].forEach((e,o)=>this.subscribeToStore(o,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,o)=>{let n=this.constructor.getPropertyOptions(o);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:o)){let i=this.getStore(e.store);i&&(e.store?this[Mt].has(e.store):this[Mt].size>0)&&(this[o]=e.selector(i.getState(),this))}})}subscribeToStore(e,o){var n;this[Mt].set(e,o.subscribe(()=>this.updateFromStores())),this[uo].set(e,[]),po(o)&&o.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,a)=>{if(typeof this[a]=="function"&&(!i.store||o.name===i.store)){let s=c=>this[a](c);o.addEventListener(i.eventName,s),this[uo].get(e).push(()=>o.removeEventListener(i.eventName,s))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[Mt].forEach((e,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(e){var o;this[Mt].has(e)&&this[Mt].get(e)(),this[Mt].delete(e),(o=this[uo].get(e))===null||o===void 0||o.forEach(n=>n()),this[uo].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};fs=Mt,hs=fr,ys=uo;fo.reduxProperties=new Map;fo.reduxReactiveProperties=new Set;fo.reduxEventListeners=new Map;function et(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(t){return!!t&&!!t[Q]}function st(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Up}(t)||Array.isArray(t)||!!t[Os]||!!(!((e=t.constructor)===null||e===void 0)&&e[Os])||ci(t)||di(t))}function hr(t,e,o){o===void 0&&(o=!1),Mr(t)===0?(o?Object.keys:Fr)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Mr(t){var e=t[Q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ci(t)?2:di(t)?3:0}function Br(t,e){return Mr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Pp(t,e){return Mr(t)===2?t.get(e):t[e]}function Cs(t,e,o){var n=Mr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Es(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ci(t){return Fp&&t instanceof Map}function di(t){return Mp&&t instanceof Set}function Ut(t){return t.o||t.t}function pi(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Rs(t);delete e[Q];for(var o=Fr(e),n=0;n<o.length;n++){var i=o[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function ui(t,e){return e===void 0&&(e=!1),fi(t)||Rt(t)||!st(t)||(Mr(t)>1&&(t.set=t.add=t.clear=t.delete=kp),Object.freeze(t),e&&hr(t,function(o,n){return ui(n,!0)},!0)),t}function kp(){et(2)}function fi(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function vt(t){var e=li[t];return e||et(18,t),e}function Dp(t,e){li[t]||(li[t]=e)}function ii(){return yo}function ti(t,e){e&&(vt("Patches"),t.u=[],t.s=[],t.v=e)}function en(t){ai(t),t.p.forEach($p),t.p=null}function ai(t){t===yo&&(yo=t.l)}function ms(t){return yo={p:[],l:yo,h:t,m:!0,_:0}}function $p(t){var e=t[Q];e.i===0||e.i===1?e.j():e.g=!0}function ri(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||vt("ES5").S(e,t,n),n?(o[Q].P&&(en(e),et(4)),st(t)&&(t=tn(e,t),e.l||rn(e,t)),e.u&&vt("Patches").M(o[Q].t,t,e.u,e.s)):t=tn(e,o,[]),en(e),e.u&&e.v(e.u,e.s),t!==As?t:void 0}function tn(t,e,o){if(fi(e))return e;var n=e[Q];if(!n)return hr(e,function(c,p){return gs(t,n,e,c,p,o)},!0),e;if(n.A!==t)return e;if(!n.P)return rn(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=pi(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),hr(a,function(c,p){return gs(t,n,i,c,p,o,s)}),rn(t,i,!1),o&&t.u&&vt("Patches").N(n,o,t.u,t.s)}return n.o}function gs(t,e,o,n,i,a,s){if(Rt(i)){var c=tn(t,i,a&&e&&e.i!==3&&!Br(e.R,n)?a.concat(n):void 0);if(Cs(o,n,c),!Rt(c))return;t.m=!1}else s&&o.add(i);if(st(i)&&!fi(i)){if(!t.h.D&&t._<1)return;tn(t,i),e&&e.A.l||rn(t,i)}}function rn(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&ui(e,o)}function oi(t,e){var o=t[Q];return(o?Ut(o):t)[e]}function bs(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function zt(t){t.P||(t.P=!0,t.l&&zt(t.l))}function ni(t){t.o||(t.o=pi(t.t))}function si(t,e,o){var n=ci(e)?vt("MapSet").F(e,o):di(e)?vt("MapSet").T(e,o):t.O?function(i,a){var s=Array.isArray(i),c={i:s?1:0,A:a?a.A:ii(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=c,u=mo;s&&(p=[c],u=ho);var g=Proxy.revocable(p,u),y=g.revoke,b=g.proxy;return c.k=b,c.j=y,b}(e,o):vt("ES5").J(e,o);return(o?o.A:ii()).p.push(n),n}function Bp(t){return Rt(t)||et(22,t),function e(o){if(!st(o))return o;var n,i=o[Q],a=Mr(o);if(i){if(!i.P&&(i.i<4||!vt("ES5").K(i)))return i.t;i.I=!0,n=xs(o,a),i.I=!1}else n=xs(o,a);return hr(n,function(s,c){i&&Pp(i.t,s)===c||Cs(n,s,e(c))}),a===3?new Set(n):n}(t)}function xs(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return pi(t)}function ws(){function t(s,c){var p=a[s];return p?p.enumerable=c:a[s]=p={configurable:!0,enumerable:c,get:function(){var u=this[Q];return mo.get(u,s)},set:function(u){var g=this[Q];mo.set(g,s,u)}},p}function e(s){for(var c=s.length-1;c>=0;c--){var p=s[c][Q];if(!p.P)switch(p.i){case 5:n(p)&&zt(p);break;case 4:o(p)&&zt(p)}}}function o(s){for(var c=s.t,p=s.k,u=Fr(p),g=u.length-1;g>=0;g--){var y=u[g];if(y!==Q){var b=c[y];if(b===void 0&&!Br(c,y))return!0;var v=p[y],S=v&&v[Q];if(S?S.t!==b:!Es(v,b))return!0}}var O=!!c[Q];return u.length!==Fr(c).length+(O?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function i(s){s.g&&et(3,JSON.stringify(Ut(s)))}var a={};Dp("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(y,b){if(y){for(var v=Array(b.length),S=0;S<b.length;S++)Object.defineProperty(v,""+S,t(S,!0));return v}var O=Rs(b);delete O[Q];for(var _=Fr(O),L=0;L<_.length;L++){var N=_[L];O[N]=t(N,y||!!O[N].enumerable)}return Object.create(Object.getPrototypeOf(b),O)}(p,s),g={i:p?5:4,A:c?c.A:ii(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Q,{value:g,writable:!0}),u},S:function(s,c,p){p?Rt(c)&&c[Q].A===s&&e(s.p):(s.u&&function u(g){if(g&&typeof g=="object"){var y=g[Q];if(y){var b=y.t,v=y.k,S=y.R,O=y.i;if(O===4)hr(v,function(F){F!==Q&&(b[F]!==void 0||Br(b,F)?S[F]||u(v[F]):(S[F]=!0,zt(y)))}),hr(b,function(F){v[F]!==void 0||Br(v,F)||(S[F]=!1,zt(y))});else if(O===5){if(n(y)&&(zt(y),S.length=!0),v.length<b.length)for(var _=v.length;_<b.length;_++)S[_]=!1;else for(var L=b.length;L<v.length;L++)S[L]=!0;for(var N=Math.min(v.length,b.length),D=0;D<N;D++)v.hasOwnProperty(D)||(S[D]=!0),S[D]===void 0&&u(v[D])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var vs,yo,hi=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Fp=typeof Map<"u",Mp=typeof Set<"u",Ss=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",As=hi?Symbol.for("immer-nothing"):((vs={})["immer-nothing"]=!0,vs),Os=hi?Symbol.for("immer-draftable"):"__$immer_draftable",Q=hi?Symbol.for("immer-state"):"__$immer_state";var Up=""+Object.prototype.constructor,Fr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Rs=Object.getOwnPropertyDescriptors||function(t){var e={};return Fr(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},li={},mo={get:function(t,e){if(e===Q)return t;var o=Ut(t);if(!Br(o,e))return function(i,a,s){var c,p=bs(a,s);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(i.k):void 0}(t,o,e);var n=o[e];return t.I||!st(n)?n:n===oi(t.t,e)?(ni(t),t.o[e]=si(t.A.h,n,t)):n},has:function(t,e){return e in Ut(t)},ownKeys:function(t){return Reflect.ownKeys(Ut(t))},set:function(t,e,o){var n=bs(Ut(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var i=oi(Ut(t),e),a=i?.[Q];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Es(o,i)&&(o!==void 0||Br(t.t,e)))return!0;ni(t),zt(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return oi(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,ni(t),zt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Ut(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){et(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){et(12)}},ho={};hr(mo,function(t,e){ho[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),ho.deleteProperty=function(t,e){return ho.set.call(this,t,e,void 0)},ho.set=function(t,e,o){return mo.set.call(this,t[0],e,o,t[0])};var zp=function(){function t(o){var n=this;this.O=Ss,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var p=n;return function(O){var _=this;O===void 0&&(O=c);for(var L=arguments.length,N=Array(L>1?L-1:0),D=1;D<L;D++)N[D-1]=arguments[D];return p.produce(O,function(F){var U;return(U=a).call.apply(U,[_,F].concat(N))})}}var u;if(typeof a!="function"&&et(6),s!==void 0&&typeof s!="function"&&et(7),st(i)){var g=ms(n),y=si(n,i,void 0),b=!0;try{u=a(y),b=!1}finally{b?en(g):ai(g)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return ti(g,s),ri(O,g)},function(O){throw en(g),O}):(ti(g,s),ri(u,g))}if(!i||typeof i!="object"){if((u=a(i))===void 0&&(u=i),u===As&&(u=void 0),n.D&&ui(u,!0),s){var v=[],S=[];vt("Patches").M(i,u,v,S),s(v,S)}return u}et(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(u){for(var g=arguments.length,y=Array(g>1?g-1:0),b=1;b<g;b++)y[b-1]=arguments[b];return n.produceWithPatches(u,function(v){return i.apply(void 0,[v].concat(y))})};var s,c,p=n.produce(i,a,function(u,g){s=u,c=g});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,s,c]}):[p,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){st(o)||et(8),Rt(o)&&(o=Bp(o));var n=ms(this),i=si(this,o,void 0);return i[Q].C=!0,ai(n),i},e.finishDraft=function(o,n){var i=o&&o[Q],a=i.A;return ti(a,n),ri(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!Ss&&et(20),this.O=o},e.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}i>-1&&(n=n.slice(i+1));var s=vt("Patches").$;return Rt(o)?s(o,n):this.produce(o,function(c){return s(c,n)})},t}(),je=new zp,Hp=je.produce,rh=je.produceWithPatches.bind(je),oh=je.setAutoFreeze.bind(je),nh=je.setUseProxies.bind(je),ih=je.applyPatches.bind(je),ah=je.createDraft.bind(je),sh=je.finishDraft.bind(je),on=Hp;function yr(t){"@babel/helpers - typeof";return yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(t)}function Ts(t,e){if(yr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(yr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ls(t){var e=Ts(t,"string");return yr(e)=="symbol"?e:e+""}function Ns(t,e,o){return(e=Ls(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Is(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function yi(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Is(Object(o),!0).forEach(function(n){Ns(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Is(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function we(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var _s=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),mi=function(){return Math.random().toString(36).substring(7).split("").join(".")},nn={INIT:"@@redux/INIT"+mi(),REPLACE:"@@redux/REPLACE"+mi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+mi()}};function Wp(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function gi(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(we(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(we(1));return o(gi)(t,e)}if(typeof t!="function")throw new Error(we(2));var i=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function g(){if(p)throw new Error(we(3));return a}function y(O){if(typeof O!="function")throw new Error(we(4));if(p)throw new Error(we(5));var _=!0;return u(),c.push(O),function(){if(_){if(p)throw new Error(we(6));_=!1,u();var N=c.indexOf(O);c.splice(N,1),s=null}}}function b(O){if(!Wp(O))throw new Error(we(7));if(typeof O.type>"u")throw new Error(we(8));if(p)throw new Error(we(9));try{p=!0,a=i(a,O)}finally{p=!1}for(var _=s=c,L=0;L<_.length;L++){var N=_[L];N()}return O}function v(O){if(typeof O!="function")throw new Error(we(10));i=O,b({type:nn.REPLACE})}function S(){var O,_=y;return O={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(we(11));function D(){N.next&&N.next(g())}D();var F=_(D);return{unsubscribe:F}}},O[_s]=function(){return this},O}return b({type:nn.INIT}),n={dispatch:b,subscribe:y,getState:g,replaceReducer:v},n[_s]=S,n}function Vp(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:nn.INIT});if(typeof n>"u")throw new Error(we(12));if(typeof o(void 0,{type:nn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(we(13))})}function Ps(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(o[i]=t[i])}var a=Object.keys(o),s,c;try{Vp(o)}catch(p){c=p}return function(u,g){if(u===void 0&&(u={}),c)throw c;if(0)var y;for(var b=!1,v={},S=0;S<a.length;S++){var O=a[S],_=o[O],L=u[O],N=_(L,g);if(typeof N>"u"){var D=g&&g.type;throw new Error(we(14))}v[O]=N,b=b||N!==L}return b=b||a.length!==Object.keys(u).length,b?v:u}}function Ur(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function ks(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(we(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=Ur.apply(void 0,c)(i.dispatch),yi(yi({},i),{},{dispatch:a})}}}function Ds(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(c){return typeof c=="function"?c(i,a,t):s(c)}}};return e}var $s=Ds();$s.withExtraArgument=Ds;var bi=$s;var zs=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Gp=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(g){return p([u,g])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(g){u=[6,g],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},zr=function(t,e){for(var o=0,n=e.length,i=t.length;o<n;o++,i++)t[i]=e[o];return t},jp=Object.defineProperty,Kp=Object.defineProperties,Zp=Object.getOwnPropertyDescriptors,Bs=Object.getOwnPropertySymbols,qp=Object.prototype.hasOwnProperty,Yp=Object.prototype.propertyIsEnumerable,Fs=function(t,e,o){return e in t?jp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Ht=function(t,e){for(var o in e||(e={}))qp.call(e,o)&&Fs(t,o,e[o]);if(Bs)for(var n=0,i=Bs(e);n<i.length;n++){var o=i[n];Yp.call(e,o)&&Fs(t,o,e[o])}return t},xi=function(t,e){return Kp(t,Zp(e))},Qp=function(t,e,o){return new Promise(function(n,i){var a=function(p){try{c(o.next(p))}catch(u){i(u)}},s=function(p){try{c(o.throw(p))}catch(u){i(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,s)};c((o=o.apply(t,e)).next())})};var Xp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ur:Ur.apply(null,arguments)},wh=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Jp(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var eu=function(t){zs(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,zr([void 0],o[0].concat(this)))):new(e.bind.apply(e,zr([void 0],o.concat(this))))},e}(Array),tu=function(t){zs(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,zr([void 0],o[0].concat(this)))):new(e.bind.apply(e,zr([void 0],o.concat(this))))},e}(Array);function Oi(t){return st(t)?on(t,function(){}):t}function ru(t){return typeof t=="boolean"}function ou(){return function(e){return nu(e)}}function nu(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,s=a===void 0?!0:a,c=new eu;if(o&&(ru(o)?c.push(bi):c.push(bi.withExtraArgument(o.extraArgument))),0){if(i)var p;if(s)var u}return c}var vi=!0;function Hs(t){var e=ou(),o=t||{},n=o.reducer,i=n===void 0?void 0:n,a=o.middleware,s=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,g=u===void 0?void 0:u,y=o.enhancers,b=y===void 0?void 0:y,v;if(typeof i=="function")v=i;else if(Jp(i))v=Ps(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var S=s;if(typeof S=="function"&&(S=S(e),!vi&&!Array.isArray(S)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!vi&&S.some(function(F){return typeof F!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=ks.apply(void 0,S),_=Ur;p&&(_=Xp(Ht({trace:!vi},typeof p=="object"&&p)));var L=new tu(O),N=L;Array.isArray(b)?N=zr([O],b):typeof b=="function"&&(N=b(L));var D=_.apply(void 0,N);return gi(v,g,D)}function Wt(t,e){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return Ht(Ht({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function Ws(t){var e={},o=[],n,i={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,i},addMatcher:function(a,s){return o.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,o,n]}function iu(t){return typeof t=="function"}function au(t,e,o,n){o===void 0&&(o=[]);var i=typeof e=="function"?Ws(e):[e,o,n],a=i[0],s=i[1],c=i[2],p;if(iu(t))p=function(){return Oi(t())};else{var u=Oi(t);p=function(){return u}}function g(y,b){y===void 0&&(y=p());var v=zr([a[b.type]],s.filter(function(S){var O=S.matcher;return O(b)}).map(function(S){var O=S.reducer;return O}));return v.filter(function(S){return!!S}).length===0&&(v=[c]),v.reduce(function(S,O){if(O)if(Rt(S)){var _=S,L=O(_,b);return L===void 0?S:L}else{if(st(S))return on(S,function(N){return O(N,b)});var L=O(S,b);if(L===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return L}return S},y)}return g.getInitialState=p,g}function su(t,e){return t+"/"+e}function Vs(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:Oi(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},s={},c={};i.forEach(function(g){var y=n[g],b=su(e,g),v,S;"reducer"in y?(v=y.reducer,S=y.prepare):v=y,a[g]=v,s[b]=v,c[g]=S?Wt(b,S):Wt(b)});function p(){var g=typeof t.extraReducers=="function"?Ws(t.extraReducers):[t.extraReducers],y=g[0],b=y===void 0?{}:y,v=g[1],S=v===void 0?[]:v,O=g[2],_=O===void 0?void 0:O,L=Ht(Ht({},b),s);return au(o,function(N){for(var D in L)N.addCase(D,L[D]);for(var F=0,U=S;F<U.length;F++){var De=U[F];N.addMatcher(De.matcher,De.reducer)}_&&N.addDefaultCase(_)})}var u;return{name:e,reducer:function(g,y){return u||(u=p()),u(g,y)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var lu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",cu=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=lu[Math.random()*64|0];return e},du=["name","message","stack","code"],Si=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Ms=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),pu=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=du;o<n.length;o++){var i=n[o];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},Lh=function(){function t(e,o,n){var i=Wt(e+"/fulfilled",function(g,y,b,v){return{payload:g,meta:xi(Ht({},v||{}),{arg:b,requestId:y,requestStatus:"fulfilled"})}}),a=Wt(e+"/pending",function(g,y,b){return{payload:void 0,meta:xi(Ht({},b||{}),{arg:y,requestId:g,requestStatus:"pending"})}}),s=Wt(e+"/rejected",function(g,y,b,v,S){return{payload:v,error:(n&&n.serializeError||pu)(g||"Rejected"),meta:xi(Ht({},S||{}),{arg:b,requestId:y,rejectedWithValue:!!v,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function g(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return g.prototype.abort=function(){},g}();function u(g){return function(y,b,v){var S=n?.idGenerator?n.idGenerator(g):cu(),O=new p,_,L=!1;function N(F){_=F,O.abort()}var D=function(){return Qp(this,null,function(){var F,U,De,mt,Ie,gt,be;return Gp(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),mt=(F=n?.condition)==null?void 0:F.call(n,g,{getState:b,extra:v}),fu(mt)?[4,mt]:[3,2];case 1:mt=m.sent(),m.label=2;case 2:if(mt===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return L=!0,Ie=new Promise(function(x,P){return O.signal.addEventListener("abort",function(){return P({name:"AbortError",message:_||"Aborted"})})}),y(a(S,g,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:S,arg:g},{getState:b,extra:v}))),[4,Promise.race([Ie,Promise.resolve(o(g,{dispatch:y,getState:b,extra:v,requestId:S,signal:O.signal,abort:N,rejectWithValue:function(x,P){return new Si(x,P)},fulfillWithValue:function(x,P){return new Ms(x,P)}})).then(function(x){if(x instanceof Si)throw x;return x instanceof Ms?i(x.payload,S,g,x.meta):i(x,S,g)})])];case 3:return De=m.sent(),[3,5];case 4:return gt=m.sent(),De=gt instanceof Si?s(null,S,g,gt.payload,gt.meta):s(gt,S,g),[3,5];case 5:return be=n&&!n.dispatchConditionRejection&&s.match(De)&&De.meta.condition,be||y(De),[2,De]}})})}();return Object.assign(D,{abort:N,requestId:S,arg:g,unwrap:function(){return D.then(uu)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function uu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function fu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Gs="listener",js="completed",Ks="cancelled",Nh="task-"+Ks,Ih="task-"+js,_h=Gs+"-"+Ks,Ph=Gs+"-"+js;var Ci="listenerMiddleware";var kh=Wt(Ci+"/add"),Dh=Wt(Ci+"/removeAll"),$h=Wt(Ci+"/remove");var Us,Bh=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Us||(Us=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},hu=function(t){return function(e){setTimeout(e,t)}},Fh=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:hu(10);ws();function yu(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,i){this.eventBus.addEventListener(o,n,i)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,i){this.eventBus.removeEventListener(o,n,i)}}}var an=class extends yu(Object){};window.ftReduxStores||(window.ftReduxStores={});var Zs=class t extends an{static get(e){var o;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(po(a))return a;if(i==null)return;let s=Vs({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),c=Hs({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:s.reducer(p,u)});return window.ftReduxStores[i.name]=new t(s,c,i.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Yo;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let p=s,u=a[p];return u?(...g)=>{let y=u(...g.map(i));return this.reduxStore.dispatch(y),y}:g=>{this.setState({[p]:i(g)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var sn=class{static format(e,o,n,i){return window.moment?window.moment(e).locale(o).format(this.getDateFormat(n,i)):e}static getDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}};var ln=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};function qs(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>sn.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ln([(0,Ei.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ln([(0,Ei.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ln([ei({store:I.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),ln([ei({store:I.name})],e.prototype,"uiLocale",void 0),e}var un=h(A());var cn=class extends bt{async listMySearches(){let{session:e}=I.getState();return Qa(e,ce.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var dn=class extends bt{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var mu="ft-user-assets",pn=un.FtReduxStore.get({name:mu,initialState:{savedSearches:void 0,bookmarks:void 0}}),wi=class{constructor(){this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dn,this.savedSearchesService=new cn,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,un.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pn.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pn.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();pn.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;pn.actions.bookmarks(o)}}},Ys=new wi;var Ai=class{addCommand(e,o=!1){I.commands.add(e,o)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ai;var Qs=h(A()),Ri=class{highlightHtml(e,o,n){(0,Qs.highlightHtml)(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Ri;var Xs=h(A());var Ti=class{isDate(e){var o,n,i,a;return(a=(i=((n=(o=I.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a;return Xs.DateFormatter.format(e,(n=o?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ti;var Js=h(A());var go=class{static get(e,o){var n,i,a,s;let c=I.getState(),{lang:p,region:u}=(i=(n=c.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Js.SearchPlaceConverter(c.baseUrl,(s=(a=window.FluidTopicsClientConfiguration)===null||a===void 0?void 0:a.predefinedSorts)!==null&&s!==void 0?s:{},e??20,c.searchInAllLanguagesAllowed,o??`${p}-${u}`)}};var fn=class extends kr{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send document.start_display event"),console.debug(o)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send topic.start_display event"),console.debug(o)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send khub.search event"),console.debug(o)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send document.search event"),console.debug(o)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send search_page.select event"),console.debug(o)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(o)})}};var Li=class{urlToSearchRequest(e){return go.get().parse(e)}searchRequestToUrl(e){return go.get().serialize(e)}};window.FluidTopicsUrlService=new Li;var Vt=h(A());var mr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};mr.eventName="change";var Ni=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},el=new Ni;var hn=class t extends Vt.WithEventBus{static build(){return new t(window.history,el,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Vt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new mr(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,c])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e,o=!1){var n,i,a;let s={...this.buildCurrentState(),...e,index:this.currentIndex,title:(n=e?.title)!==null&&n!==void 0?n:this.currentState.title},c=o?(i=e?.majorState)!==null&&i!==void 0?i:this.currentState.majorState:(a=this.currentState.majorState)!==null&&a!==void 0?a:e?.majorState;c!=null&&(s.majorState=c),this.setCurrentState(s)}addHistoryChangeListener(e){this.addEventListener(mr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(mr.eventName,e)}currentItem(){return(0,Vt.deepCopy)(this.currentState)}back(){let e=this.previousMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Vt.deepCopy)(this.states[this.previousMajorPosition()])}previousMajorPosition(){let e=this.currentIndex;for(;e>0&&!this.isMajorState(e);)e--;return this.previousExistingPosition(e)}forward(){let e=this.nextMajorPosition();e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){return(0,Vt.deepCopy)(this.states[this.nextMajorPosition()])}nextMajorPosition(){let e=this.currentIndex;do e++;while(e<this.states.length&&!this.isMajorState(e));do e++;while(e<this.states.length&&!this.isMajorState(e));return this.previousExistingPosition(e)}previousExistingPosition(e){let o=e;do o--;while(o>0&&!this.hasState(o));return o}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isMajorState(e){var o,n;return this.hasState(e)&&((n=(o=this.states[e])===null||o===void 0?void 0:o.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=hn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});(0,tl.customElement)("ft-app-context")(oe);var yn=class extends bt{constructor(e){super(!0,e),this.sortObjectFields=(o,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let o={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(o),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let o={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(o),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(o=>o.valueFilter==null?o:{...o,valueFilter:{...o.valueFilter,values:[...o.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((o,n)=>o.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var xo=t=>t.request.virtualField===_r.TITLE_ONLY&&t.request.scope===Pr.DOCUMENTS,mn=class t extends Event{constructor(){super(t.eventName)}};mn.eventName="search-context-clear-all-filters";var bo=class t{static build(e,o){return new t(Ra(e.trim()||"context"),o)}constructor(e,o){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new Ke.Debouncer(10),this.searchDebouncer=new Ke.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new Ke.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=o??new yn,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,Ke.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,Ke.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var o;let n=(o=this.store.getState().locales)!==null&&o!==void 0?o:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(c=>c.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let o=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(o),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(_r.TITLE_ONLY),this.store.actions.setRequestScope(Pr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(_r.EVERYWHERE),this.store.actions.setRequestScope(Pr.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return xo(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new mn)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,o){let n=this.facetIds.filter(i=>i!=e);o&&n.push(o),this.facetIds=n}get facetIds(){var e;let o=this.store.getState().request;return[...new Set([...o.facets.map(n=>n.id),...((e=o.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,o){this.setValueFilter(e,o)}setValueFilter(e,o){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:o,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,o){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:o}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let o=this.store.getState().request.metadataFilters,n=[...o.filter(i=>!i.dateFilter),...o.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,o,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:o,to:n}},s=[...i.filter(c=>!c.rangeFilter),...i.filter(c=>c.rangeFilter&&c.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let o=this.store.getState().request.metadataFilters,n=[...o.filter(i=>!i.rangeFilter),...o.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var o,n,i,a;try{if((o=this.cancelableSearch)===null||o===void 0||o.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,Ke.cancelable)(this.service.launchSearch(e));let s=await this.cancelableSearch;if(s.paging.currentPage<=1)this.store.actions.results(s.results),this.store.actions.facets(s.facets),this.store.actions.spellcheck(s.spellcheck);else{let c=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(s.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(s.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(s.paging)}}catch(s){s instanceof Ke.CanceledPromiseError||(console.error(s),(a=this.errorHandler)===null||a===void 0||a.call(this,s))}}async fetchSuggestData(e){var o;try{(o=this.cancelableSuggest)===null||o===void 0||o.cancel(),this.cancelableSuggest=(0,Ke.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof Ke.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var gu=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},_i=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},rl=Symbol("registerInterval"),Ii=Symbol("registerAttempts"),bu=40;function xu(t){class e extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Ii]=0,this[rl]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Ii]>bu?window.clearInterval(this[rl]):(this[Ii]++,this.dispatchEvent(new _i))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return gu([(0,nl.state)()],e.prototype,"stateManager",void 0),e}var Gt=class extends xu(ol.FtLitElementRedux){};var ca=h(A());var kn=h(k()),Ae=h(G()),md=h(jt()),no=h(A());var yl=h(A());var fl=h(k()),ve=h(G()),hl=h(jt()),vo=h(A());var pl=h(k()),se=h(A()),al=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorContent),E={color:al,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",al),opacityContentOnSurfacePressed:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:se.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},sl=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorPrimary),ll={color:sl,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",sl)},cl=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorSecondary),dl={color:cl,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",cl)},ul=pl.css`
|
|
15
|
+
`}update(e){var o,n,i,a,s;super.update(e),e.has("baseUrl")&&(I.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&I.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&I.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&I.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&I.actions.noCustom(this.noCustom),e.has("editorMode")&&I.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&I.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&I.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>Dr.addContext(c)),e.has("openExternalDocumentInNewTab")&&I.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&I.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&I.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(I.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),I.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),I.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};oe.elementDefinitions={};oe.styles=Ja;Ee([(0,$e.property)()],oe.prototype,"baseUrl",void 0);Ee([(0,$e.property)()],oe.prototype,"apiIntegrationIdentifier",void 0);Ee([(0,$e.property)()],oe.prototype,"uiLocale",void 0);Ee([(0,at.jsonProperty)(null)],oe.prototype,"availableUiLocales",void 0);Ee([(0,at.jsonProperty)(null)],oe.prototype,"metadataConfiguration",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"editorMode",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"noCustom",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"openExternalDocumentInNewTab",void 0);Ee([(0,$e.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],oe.prototype,"noCustomComponent",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"withManualResources",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"navigatorOnline",void 0);Ee([(0,$e.property)({type:Boolean})],oe.prototype,"forcedOffline",void 0);Ee([(0,$e.property)({type:Object})],oe.prototype,"apiProvider",void 0);Ee([(0,at.jsonProperty)([])],oe.prototype,"messageContexts",void 0);Ee([(0,at.jsonProperty)(void 0)],oe.prototype,"session",void 0);Ee([(0,$e.state)()],oe.prototype,"localesConfiguration",void 0);var Ei=h(G());function Ip(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var o,n,i;if(Array.isArray(t)){if(o=t.length,o!=e.length)return!1;for(n=o;n--!==0;)if(!qo(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!qo(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let a=s=>Object.keys(s).filter(c=>s[c]!=null);if(i=a(t),o=i.length,o!==a(e).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=o;n--!==0;){let s=i[n];if(!qo(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function qo(t,e){try{return Ip(t,e)}catch{return!1}}function lo(t,e){return!qo(t,e)}var rs=h(G(),1);var ei=t=>{let e=t??{};return(o,n)=>{var i;let a={hasChanged:lo,attribute:!1,...e};(0,rs.property)(a)(o,n);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}};var Yo=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};var $r=h(G(),1);var os=h(G(),1);function ns(t,e){let o=()=>JSON.parse(JSON.stringify(t));return(0,os.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:lo,...e??{}})}var Qo=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,o){return this.callbacks=[e],this.debounce(o)}queue(e,o){return this.callbacks.push(e),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,o;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,a=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let s of n)try{await s()}catch(c){i(c);return}a(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var as=h(k(),1);var Xo=globalThis,_p=Xo.ShadowRoot&&(Xo.ShadyCSS===void 0||Xo.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Hf=Symbol();var is=(t,e)=>{if(_p)t.adoptedStyleSheets=e.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of e){let n=document.createElement("style"),i=Xo.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=o.cssText,t.appendChild(n)}};var Jo=class extends as.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,a])=>e.registry.define(i,a)));let o={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return is(n,e.elementStyles),n}};function ss(t,e,...o){var n;let i=t.querySelector(e);for(let a of o)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(a);return i}var co=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},ps,ls=Symbol("constructorPrototype"),cs=Symbol("constructorName"),us=Symbol("exportpartsDebouncer"),ds=Symbol("dynamicDependenciesLoaded"),At=class extends Jo{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ps]=new Qo(5),this[cs]=this.constructor.name,this[ls]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[cs]&&Object.setPrototypeOf(this,this[ls])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let e=this.constructor;e[ds]||(e[ds]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate()})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let a=[...i??[],n];o=ss(this.shadowRoot,...a)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var o,n,i;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(a=>a.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(a){console.error(a,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let a=document.createElement("style");a.classList.add("ft-lit-element--custom-stylesheet"),a.innerHTML=this.customStylesheet,this.shadowRoot.append(a)}}scheduleExportpartsUpdate(){var e,o,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[us].run(()=>{var i,a;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((a=this.exportpartsPrefixes)===null||a===void 0?void 0:a.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var o,n,i,a,s,c;let p=b=>b!=null&&b.trim().length>0,u=e.filter(p).map(b=>b.trim());if(u.length===0){this.removeAttribute("exportparts");return}let g=new Set;for(let b of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(a=(i=b.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&a!==void 0?a:[],S=(c=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(O=>O.split(":")[1]))!==null&&c!==void 0?c:[];new Array(...v,...S).filter(p).map(O=>O.trim()).forEach(O=>g.add(O))}if(g.size===0){this.removeAttribute("exportparts");return}let y=[...g.values()].flatMap(b=>u.map(v=>`${b}:${v}--${b}`));this.setAttribute("exportparts",[...this.part,...y].join(", "))}};ps=us;co([(0,$r.property)()],At.prototype,"exportpartsPrefix",void 0);co([ns([])],At.prototype,"exportpartsPrefixes",void 0);co([(0,$r.property)()],At.prototype,"customStylesheet",void 0);co([(0,$r.property)()],At.prototype,"elementToFocus",void 0);co([(0,$r.state)()],At.prototype,"useAdoptedStyleSheets",void 0);function po(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var fs,hs,ys,uo=Symbol("internalReduxEventsUnsubscribers"),Mt=Symbol("internalStoresUnsubscribers"),fr=Symbol("internalStores"),fo=class extends At{constructor(){super(...arguments),this[fs]=new Map,this[hs]=new Map,this[ys]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(o=>e.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[fr].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[fr].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[fr].get(e)}addStore(e,o){var n;o=(n=o??(po(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(o),this[fr].set(o,e),this.subscribeToStore(o,e),this.updateFromStores()}removeStore(e){let o=typeof e=="string"?e:e.name;this.unsubscribeFromStore(o),this[fr].delete(o)}setupStores(){this.unsubscribeFromStores(),this[fr].forEach((e,o)=>this.subscribeToStore(o,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,o)=>{let n=this.constructor.getPropertyOptions(o);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:o)){let i=this.getStore(e.store);i&&(e.store?this[Mt].has(e.store):this[Mt].size>0)&&(this[o]=e.selector(i.getState(),this))}})}subscribeToStore(e,o){var n;this[Mt].set(e,o.subscribe(()=>this.updateFromStores())),this[uo].set(e,[]),po(o)&&o.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,a)=>{if(typeof this[a]=="function"&&(!i.store||o.name===i.store)){let s=c=>this[a](c);o.addEventListener(i.eventName,s),this[uo].get(e).push(()=>o.removeEventListener(i.eventName,s))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[Mt].forEach((e,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(e){var o;this[Mt].has(e)&&this[Mt].get(e)(),this[Mt].delete(e),(o=this[uo].get(e))===null||o===void 0||o.forEach(n=>n()),this[uo].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};fs=Mt,hs=fr,ys=uo;fo.reduxProperties=new Map;fo.reduxReactiveProperties=new Set;fo.reduxEventListeners=new Map;function et(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Rt(t){return!!t&&!!t[Q]}function st(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===Up}(t)||Array.isArray(t)||!!t[Os]||!!(!((e=t.constructor)===null||e===void 0)&&e[Os])||ci(t)||di(t))}function hr(t,e,o){o===void 0&&(o=!1),Mr(t)===0?(o?Object.keys:Fr)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Mr(t){var e=t[Q];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ci(t)?2:di(t)?3:0}function Br(t,e){return Mr(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function Pp(t,e){return Mr(t)===2?t.get(e):t[e]}function Cs(t,e,o){var n=Mr(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Es(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ci(t){return Fp&&t instanceof Map}function di(t){return Mp&&t instanceof Set}function Ut(t){return t.o||t.t}function pi(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Rs(t);delete e[Q];for(var o=Fr(e),n=0;n<o.length;n++){var i=o[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function ui(t,e){return e===void 0&&(e=!1),fi(t)||Rt(t)||!st(t)||(Mr(t)>1&&(t.set=t.add=t.clear=t.delete=kp),Object.freeze(t),e&&hr(t,function(o,n){return ui(n,!0)},!0)),t}function kp(){et(2)}function fi(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function vt(t){var e=li[t];return e||et(18,t),e}function Dp(t,e){li[t]||(li[t]=e)}function ii(){return yo}function ti(t,e){e&&(vt("Patches"),t.u=[],t.s=[],t.v=e)}function en(t){ai(t),t.p.forEach($p),t.p=null}function ai(t){t===yo&&(yo=t.l)}function ms(t){return yo={p:[],l:yo,h:t,m:!0,_:0}}function $p(t){var e=t[Q];e.i===0||e.i===1?e.j():e.g=!0}function ri(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||vt("ES5").S(e,t,n),n?(o[Q].P&&(en(e),et(4)),st(t)&&(t=tn(e,t),e.l||rn(e,t)),e.u&&vt("Patches").M(o[Q].t,t,e.u,e.s)):t=tn(e,o,[]),en(e),e.u&&e.v(e.u,e.s),t!==As?t:void 0}function tn(t,e,o){if(fi(e))return e;var n=e[Q];if(!n)return hr(e,function(c,p){return gs(t,n,e,c,p,o)},!0),e;if(n.A!==t)return e;if(!n.P)return rn(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=pi(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),hr(a,function(c,p){return gs(t,n,i,c,p,o,s)}),rn(t,i,!1),o&&t.u&&vt("Patches").N(n,o,t.u,t.s)}return n.o}function gs(t,e,o,n,i,a,s){if(Rt(i)){var c=tn(t,i,a&&e&&e.i!==3&&!Br(e.R,n)?a.concat(n):void 0);if(Cs(o,n,c),!Rt(c))return;t.m=!1}else s&&o.add(i);if(st(i)&&!fi(i)){if(!t.h.D&&t._<1)return;tn(t,i),e&&e.A.l||rn(t,i)}}function rn(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&ui(e,o)}function oi(t,e){var o=t[Q];return(o?Ut(o):t)[e]}function bs(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function zt(t){t.P||(t.P=!0,t.l&&zt(t.l))}function ni(t){t.o||(t.o=pi(t.t))}function si(t,e,o){var n=ci(e)?vt("MapSet").F(e,o):di(e)?vt("MapSet").T(e,o):t.O?function(i,a){var s=Array.isArray(i),c={i:s?1:0,A:a?a.A:ii(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},p=c,u=mo;s&&(p=[c],u=ho);var g=Proxy.revocable(p,u),y=g.revoke,b=g.proxy;return c.k=b,c.j=y,b}(e,o):vt("ES5").J(e,o);return(o?o.A:ii()).p.push(n),n}function Bp(t){return Rt(t)||et(22,t),function e(o){if(!st(o))return o;var n,i=o[Q],a=Mr(o);if(i){if(!i.P&&(i.i<4||!vt("ES5").K(i)))return i.t;i.I=!0,n=xs(o,a),i.I=!1}else n=xs(o,a);return hr(n,function(s,c){i&&Pp(i.t,s)===c||Cs(n,s,e(c))}),a===3?new Set(n):n}(t)}function xs(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return pi(t)}function ws(){function t(s,c){var p=a[s];return p?p.enumerable=c:a[s]=p={configurable:!0,enumerable:c,get:function(){var u=this[Q];return mo.get(u,s)},set:function(u){var g=this[Q];mo.set(g,s,u)}},p}function e(s){for(var c=s.length-1;c>=0;c--){var p=s[c][Q];if(!p.P)switch(p.i){case 5:n(p)&&zt(p);break;case 4:o(p)&&zt(p)}}}function o(s){for(var c=s.t,p=s.k,u=Fr(p),g=u.length-1;g>=0;g--){var y=u[g];if(y!==Q){var b=c[y];if(b===void 0&&!Br(c,y))return!0;var v=p[y],S=v&&v[Q];if(S?S.t!==b:!Es(v,b))return!0}}var O=!!c[Q];return u.length!==Fr(c).length+(O?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var p=Object.getOwnPropertyDescriptor(c,c.length-1);if(p&&!p.get)return!0;for(var u=0;u<c.length;u++)if(!c.hasOwnProperty(u))return!0;return!1}function i(s){s.g&&et(3,JSON.stringify(Ut(s)))}var a={};Dp("ES5",{J:function(s,c){var p=Array.isArray(s),u=function(y,b){if(y){for(var v=Array(b.length),S=0;S<b.length;S++)Object.defineProperty(v,""+S,t(S,!0));return v}var O=Rs(b);delete O[Q];for(var _=Fr(O),L=0;L<_.length;L++){var N=_[L];O[N]=t(N,y||!!O[N].enumerable)}return Object.create(Object.getPrototypeOf(b),O)}(p,s),g={i:p?5:4,A:c?c.A:ii(),P:!1,I:!1,R:{},l:c,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Q,{value:g,writable:!0}),u},S:function(s,c,p){p?Rt(c)&&c[Q].A===s&&e(s.p):(s.u&&function u(g){if(g&&typeof g=="object"){var y=g[Q];if(y){var b=y.t,v=y.k,S=y.R,O=y.i;if(O===4)hr(v,function(F){F!==Q&&(b[F]!==void 0||Br(b,F)?S[F]||u(v[F]):(S[F]=!0,zt(y)))}),hr(b,function(F){v[F]!==void 0||Br(v,F)||(S[F]=!1,zt(y))});else if(O===5){if(n(y)&&(zt(y),S.length=!0),v.length<b.length)for(var _=v.length;_<b.length;_++)S[_]=!1;else for(var L=b.length;L<v.length;L++)S[L]=!0;for(var N=Math.min(v.length,b.length),D=0;D<N;D++)v.hasOwnProperty(D)||(S[D]=!0),S[D]===void 0&&u(v[D])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var vs,yo,hi=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Fp=typeof Map<"u",Mp=typeof Set<"u",Ss=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",As=hi?Symbol.for("immer-nothing"):((vs={})["immer-nothing"]=!0,vs),Os=hi?Symbol.for("immer-draftable"):"__$immer_draftable",Q=hi?Symbol.for("immer-state"):"__$immer_state";var Up=""+Object.prototype.constructor,Fr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Rs=Object.getOwnPropertyDescriptors||function(t){var e={};return Fr(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},li={},mo={get:function(t,e){if(e===Q)return t;var o=Ut(t);if(!Br(o,e))return function(i,a,s){var c,p=bs(a,s);return p?"value"in p?p.value:(c=p.get)===null||c===void 0?void 0:c.call(i.k):void 0}(t,o,e);var n=o[e];return t.I||!st(n)?n:n===oi(t.t,e)?(ni(t),t.o[e]=si(t.A.h,n,t)):n},has:function(t,e){return e in Ut(t)},ownKeys:function(t){return Reflect.ownKeys(Ut(t))},set:function(t,e,o){var n=bs(Ut(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var i=oi(Ut(t),e),a=i?.[Q];if(a&&a.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Es(o,i)&&(o!==void 0||Br(t.t,e)))return!0;ni(t),zt(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return oi(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,ni(t),zt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=Ut(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){et(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){et(12)}},ho={};hr(mo,function(t,e){ho[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),ho.deleteProperty=function(t,e){return ho.set.call(this,t,e,void 0)},ho.set=function(t,e,o){return mo.set.call(this,t[0],e,o,t[0])};var zp=function(){function t(o){var n=this;this.O=Ss,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var p=n;return function(O){var _=this;O===void 0&&(O=c);for(var L=arguments.length,N=Array(L>1?L-1:0),D=1;D<L;D++)N[D-1]=arguments[D];return p.produce(O,function(F){var U;return(U=a).call.apply(U,[_,F].concat(N))})}}var u;if(typeof a!="function"&&et(6),s!==void 0&&typeof s!="function"&&et(7),st(i)){var g=ms(n),y=si(n,i,void 0),b=!0;try{u=a(y),b=!1}finally{b?en(g):ai(g)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return ti(g,s),ri(O,g)},function(O){throw en(g),O}):(ti(g,s),ri(u,g))}if(!i||typeof i!="object"){if((u=a(i))===void 0&&(u=i),u===As&&(u=void 0),n.D&&ui(u,!0),s){var v=[],S=[];vt("Patches").M(i,u,v,S),s(v,S)}return u}et(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(u){for(var g=arguments.length,y=Array(g>1?g-1:0),b=1;b<g;b++)y[b-1]=arguments[b];return n.produceWithPatches(u,function(v){return i.apply(void 0,[v].concat(y))})};var s,c,p=n.produce(i,a,function(u,g){s=u,c=g});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,s,c]}):[p,s,c]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){st(o)||et(8),Rt(o)&&(o=Bp(o));var n=ms(this),i=si(this,o,void 0);return i[Q].C=!0,ai(n),i},e.finishDraft=function(o,n){var i=o&&o[Q],a=i.A;return ti(a,n),ri(void 0,a)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!Ss&&et(20),this.O=o},e.applyPatches=function(o,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){o=a.value;break}}i>-1&&(n=n.slice(i+1));var s=vt("Patches").$;return Rt(o)?s(o,n):this.produce(o,function(c){return s(c,n)})},t}(),je=new zp,Hp=je.produce,rh=je.produceWithPatches.bind(je),oh=je.setAutoFreeze.bind(je),nh=je.setUseProxies.bind(je),ih=je.applyPatches.bind(je),ah=je.createDraft.bind(je),sh=je.finishDraft.bind(je),on=Hp;function yr(t){"@babel/helpers - typeof";return yr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(t)}function Ts(t,e){if(yr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(yr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Ls(t){var e=Ts(t,"string");return yr(e)=="symbol"?e:e+""}function Ns(t,e,o){return(e=Ls(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Is(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,n)}return o}function yi(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Is(Object(o),!0).forEach(function(n){Ns(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Is(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function we(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var _s=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),mi=function(){return Math.random().toString(36).substring(7).split("").join(".")},nn={INIT:"@@redux/INIT"+mi(),REPLACE:"@@redux/REPLACE"+mi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+mi()}};function Wp(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function gi(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(we(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(we(1));return o(gi)(t,e)}if(typeof t!="function")throw new Error(we(2));var i=t,a=e,s=[],c=s,p=!1;function u(){c===s&&(c=s.slice())}function g(){if(p)throw new Error(we(3));return a}function y(O){if(typeof O!="function")throw new Error(we(4));if(p)throw new Error(we(5));var _=!0;return u(),c.push(O),function(){if(_){if(p)throw new Error(we(6));_=!1,u();var N=c.indexOf(O);c.splice(N,1),s=null}}}function b(O){if(!Wp(O))throw new Error(we(7));if(typeof O.type>"u")throw new Error(we(8));if(p)throw new Error(we(9));try{p=!0,a=i(a,O)}finally{p=!1}for(var _=s=c,L=0;L<_.length;L++){var N=_[L];N()}return O}function v(O){if(typeof O!="function")throw new Error(we(10));i=O,b({type:nn.REPLACE})}function S(){var O,_=y;return O={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(we(11));function D(){N.next&&N.next(g())}D();var F=_(D);return{unsubscribe:F}}},O[_s]=function(){return this},O}return b({type:nn.INIT}),n={dispatch:b,subscribe:y,getState:g,replaceReducer:v},n[_s]=S,n}function Vp(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:nn.INIT});if(typeof n>"u")throw new Error(we(12));if(typeof o(void 0,{type:nn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(we(13))})}function Ps(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(o[i]=t[i])}var a=Object.keys(o),s,c;try{Vp(o)}catch(p){c=p}return function(u,g){if(u===void 0&&(u={}),c)throw c;if(0)var y;for(var b=!1,v={},S=0;S<a.length;S++){var O=a[S],_=o[O],L=u[O],N=_(L,g);if(typeof N>"u"){var D=g&&g.type;throw new Error(we(14))}v[O]=N,b=b||N!==L}return b=b||a.length!==Object.keys(u).length,b?v:u}}function Ur(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function ks(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(we(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(p){return p(s)});return a=Ur.apply(void 0,c)(i.dispatch),yi(yi({},i),{},{dispatch:a})}}}function Ds(t){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(c){return typeof c=="function"?c(i,a,t):s(c)}}};return e}var $s=Ds();$s.withExtraArgument=Ds;var bi=$s;var zs=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),Gp=function(t,e){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(u){return function(g){return p([u,g])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,i&&(a=u[0]&2?i.return:u[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;switch(i=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,i=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){o.label=u[1];break}if(u[0]===6&&o.label<a[1]){o.label=a[1],a=u;break}if(a&&o.label<a[2]){o.label=a[2],o.ops.push(u);break}a[2]&&o.ops.pop(),o.trys.pop();continue}u=e.call(t,o)}catch(g){u=[6,g],i=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},zr=function(t,e){for(var o=0,n=e.length,i=t.length;o<n;o++,i++)t[i]=e[o];return t},jp=Object.defineProperty,Kp=Object.defineProperties,Zp=Object.getOwnPropertyDescriptors,Bs=Object.getOwnPropertySymbols,qp=Object.prototype.hasOwnProperty,Yp=Object.prototype.propertyIsEnumerable,Fs=function(t,e,o){return e in t?jp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Ht=function(t,e){for(var o in e||(e={}))qp.call(e,o)&&Fs(t,o,e[o]);if(Bs)for(var n=0,i=Bs(e);n<i.length;n++){var o=i[n];Yp.call(e,o)&&Fs(t,o,e[o])}return t},xi=function(t,e){return Kp(t,Zp(e))},Qp=function(t,e,o){return new Promise(function(n,i){var a=function(p){try{c(o.next(p))}catch(u){i(u)}},s=function(p){try{c(o.throw(p))}catch(u){i(u)}},c=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(a,s)};c((o=o.apply(t,e)).next())})};var Xp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ur:Ur.apply(null,arguments)},wh=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Jp(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var eu=function(t){zs(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,zr([void 0],o[0].concat(this)))):new(e.bind.apply(e,zr([void 0],o.concat(this))))},e}(Array),tu=function(t){zs(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,zr([void 0],o[0].concat(this)))):new(e.bind.apply(e,zr([void 0],o.concat(this))))},e}(Array);function Oi(t){return st(t)?on(t,function(){}):t}function ru(t){return typeof t=="boolean"}function ou(){return function(e){return nu(e)}}function nu(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,a=t.serializableCheck,s=a===void 0?!0:a,c=new eu;if(o&&(ru(o)?c.push(bi):c.push(bi.withExtraArgument(o.extraArgument))),0){if(i)var p;if(s)var u}return c}var vi=!0;function Hs(t){var e=ou(),o=t||{},n=o.reducer,i=n===void 0?void 0:n,a=o.middleware,s=a===void 0?e():a,c=o.devTools,p=c===void 0?!0:c,u=o.preloadedState,g=u===void 0?void 0:u,y=o.enhancers,b=y===void 0?void 0:y,v;if(typeof i=="function")v=i;else if(Jp(i))v=Ps(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var S=s;if(typeof S=="function"&&(S=S(e),!vi&&!Array.isArray(S)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!vi&&S.some(function(F){return typeof F!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=ks.apply(void 0,S),_=Ur;p&&(_=Xp(Ht({trace:!vi},typeof p=="object"&&p)));var L=new tu(O),N=L;Array.isArray(b)?N=zr([O],b):typeof b=="function"&&(N=b(L));var D=_.apply(void 0,N);return gi(v,g,D)}function Wt(t,e){function o(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return Ht(Ht({type:t,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function Ws(t){var e={},o=[],n,i={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,i},addMatcher:function(a,s){return o.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return t(i),[e,o,n]}function iu(t){return typeof t=="function"}function au(t,e,o,n){o===void 0&&(o=[]);var i=typeof e=="function"?Ws(e):[e,o,n],a=i[0],s=i[1],c=i[2],p;if(iu(t))p=function(){return Oi(t())};else{var u=Oi(t);p=function(){return u}}function g(y,b){y===void 0&&(y=p());var v=zr([a[b.type]],s.filter(function(S){var O=S.matcher;return O(b)}).map(function(S){var O=S.reducer;return O}));return v.filter(function(S){return!!S}).length===0&&(v=[c]),v.reduce(function(S,O){if(O)if(Rt(S)){var _=S,L=O(_,b);return L===void 0?S:L}else{if(st(S))return on(S,function(N){return O(N,b)});var L=O(S,b);if(L===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return L}return S},y)}return g.getInitialState=p,g}function su(t,e){return t+"/"+e}function Vs(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:Oi(t.initialState),n=t.reducers||{},i=Object.keys(n),a={},s={},c={};i.forEach(function(g){var y=n[g],b=su(e,g),v,S;"reducer"in y?(v=y.reducer,S=y.prepare):v=y,a[g]=v,s[b]=v,c[g]=S?Wt(b,S):Wt(b)});function p(){var g=typeof t.extraReducers=="function"?Ws(t.extraReducers):[t.extraReducers],y=g[0],b=y===void 0?{}:y,v=g[1],S=v===void 0?[]:v,O=g[2],_=O===void 0?void 0:O,L=Ht(Ht({},b),s);return au(o,function(N){for(var D in L)N.addCase(D,L[D]);for(var F=0,U=S;F<U.length;F++){var De=U[F];N.addMatcher(De.matcher,De.reducer)}_&&N.addDefaultCase(_)})}var u;return{name:e,reducer:function(g,y){return u||(u=p()),u(g,y)},actions:c,caseReducers:a,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var lu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",cu=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=lu[Math.random()*64|0];return e},du=["name","message","stack","code"],Si=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Ms=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),pu=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=du;o<n.length;o++){var i=n[o];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},Lh=function(){function t(e,o,n){var i=Wt(e+"/fulfilled",function(g,y,b,v){return{payload:g,meta:xi(Ht({},v||{}),{arg:b,requestId:y,requestStatus:"fulfilled"})}}),a=Wt(e+"/pending",function(g,y,b){return{payload:void 0,meta:xi(Ht({},b||{}),{arg:y,requestId:g,requestStatus:"pending"})}}),s=Wt(e+"/rejected",function(g,y,b,v,S){return{payload:v,error:(n&&n.serializeError||pu)(g||"Rejected"),meta:xi(Ht({},S||{}),{arg:b,requestId:y,rejectedWithValue:!!v,requestStatus:"rejected",aborted:g?.name==="AbortError",condition:g?.name==="ConditionError"})}}),c=!1,p=typeof AbortController<"u"?AbortController:function(){function g(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return g.prototype.abort=function(){},g}();function u(g){return function(y,b,v){var S=n?.idGenerator?n.idGenerator(g):cu(),O=new p,_,L=!1;function N(F){_=F,O.abort()}var D=function(){return Qp(this,null,function(){var F,U,De,mt,Ie,gt,be;return Gp(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),mt=(F=n?.condition)==null?void 0:F.call(n,g,{getState:b,extra:v}),fu(mt)?[4,mt]:[3,2];case 1:mt=m.sent(),m.label=2;case 2:if(mt===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return L=!0,Ie=new Promise(function(x,P){return O.signal.addEventListener("abort",function(){return P({name:"AbortError",message:_||"Aborted"})})}),y(a(S,g,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:S,arg:g},{getState:b,extra:v}))),[4,Promise.race([Ie,Promise.resolve(o(g,{dispatch:y,getState:b,extra:v,requestId:S,signal:O.signal,abort:N,rejectWithValue:function(x,P){return new Si(x,P)},fulfillWithValue:function(x,P){return new Ms(x,P)}})).then(function(x){if(x instanceof Si)throw x;return x instanceof Ms?i(x.payload,S,g,x.meta):i(x,S,g)})])];case 3:return De=m.sent(),[3,5];case 4:return gt=m.sent(),De=gt instanceof Si?s(null,S,g,gt.payload,gt.meta):s(gt,S,g),[3,5];case 5:return be=n&&!n.dispatchConditionRejection&&s.match(De)&&De.meta.condition,be||y(De),[2,De]}})})}();return Object.assign(D,{abort:N,requestId:S,arg:g,unwrap:function(){return D.then(uu)}})}}return Object.assign(u,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function uu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function fu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Gs="listener",js="completed",Ks="cancelled",Nh="task-"+Ks,Ih="task-"+js,_h=Gs+"-"+Ks,Ph=Gs+"-"+js;var Ci="listenerMiddleware";var kh=Wt(Ci+"/add"),Dh=Wt(Ci+"/removeAll"),$h=Wt(Ci+"/remove");var Us,Bh=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Us||(Us=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},hu=function(t){return function(e){setTimeout(e,t)}},Fh=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:hu(10);ws();function yu(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(o,n,i){this.eventBus.addEventListener(o,n,i)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,i){this.eventBus.removeEventListener(o,n,i)}}}var an=class extends yu(Object){};window.ftReduxStores||(window.ftReduxStores={});var Zs=class t extends an{static get(e){var o;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(po(a))return a;if(i==null)return;let s=Vs({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),c=Hs({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?s.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:s.reducer(p,u)});return window.ftReduxStores[i.name]=new t(s,c,i.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Yo;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let p=s,u=a[p];return u?(...g)=>{let y=u(...g.map(i));return this.reduxStore.dispatch(y),y}:g=>{this.setState({[p]:i(g)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var sn=class{static format(e,o,n,i){return window.moment?window.moment(e).locale(o).format(this.getDateFormat(n,i)):e}static getDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}};var ln=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a};function qs(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(I)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>sn.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return ln([(0,Ei.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),ln([(0,Ei.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),ln([ei({store:I.name,selector:o=>{var n,i;return(i=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),ln([ei({store:I.name})],e.prototype,"uiLocale",void 0),e}var un=h(A());var cn=class extends bt{async listMySearches(){let{session:e}=I.getState();return Qa(e,ce.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var dn=class extends bt{async listMyBookmarks(){let e=I.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var mu="ft-user-assets",pn=un.FtReduxStore.get({name:mu,initialState:{savedSearches:void 0,bookmarks:void 0}}),wi=class{constructor(){this.currentSession=I.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dn,this.savedSearchesService=new cn,I.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=I.getState();(0,un.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pn.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pn.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();pn.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;pn.actions.bookmarks(o)}}},Ys=new wi;var Ai=class{addCommand(e,o=!1){I.commands.add(e,o)}consumeCommand(e){return I.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ai;var Qs=h(A()),Ri=class{highlightHtml(e,o,n){(0,Qs.highlightHtml)(e,o,n)}};window.FluidTopicsHighlightHtmlService=new Ri;var Xs=h(A());var Ti=class{isDate(e){var o,n,i,a;return(a=(i=((n=(o=I.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,o){var n,i,a;return Xs.DateFormatter.format(e,(n=o?.locale)!==null&&n!==void 0?n:I.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(a=o?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new Ti;var Js=h(A());var go=class{static get(e,o){var n,i,a,s;let c=I.getState(),{lang:p,region:u}=(i=(n=c.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Js.SearchPlaceConverter(c.baseUrl,(s=(a=window.FluidTopicsClientConfiguration)===null||a===void 0?void 0:a.predefinedSorts)!==null&&s!==void 0?s:{},e??20,c.searchInAllLanguagesAllowed,o??`${p}-${u}`)}};var fn=class extends kr{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send document.start_display event"),console.debug(o)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send topic.start_display event"),console.debug(o)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send khub.search event"),console.debug(o)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send document.search event"),console.debug(o)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send search_page.select event"),console.debug(o)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(o=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(o)})}};var Li=class{urlToSearchRequest(e){return go.get().parse(e)}searchRequestToUrl(e){return go.get().serialize(e)}};window.FluidTopicsUrlService=new Li;var Vt=h(A());var mr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};mr.eventName="change";var Ni=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},el=new Ni;var hn=class t extends Vt.WithEventBus{static build(){return new t(window.history,el,()=>window.location,!1)}constructor(e,o,n,i){var a,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Vt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new mr(this.currentItem())),0)}installProxies(){let e=o=>(n,i,[a,s,c])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...a,index:p,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(mr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(mr.eventName,e)}currentItem(){return(0,Vt.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,Vt.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,Vt.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let i=o??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=hn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});(0,tl.customElement)("ft-app-context")(oe);var yn=class extends bt{constructor(e){super(!0,e),this.sortObjectFields=(o,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let o={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(o),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let o={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(o),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(o=>o.valueFilter==null?o:{...o,valueFilter:{...o.valueFilter,values:[...o.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((o,n)=>o.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var xo=t=>t.request.virtualField===_r.TITLE_ONLY&&t.request.scope===Pr.DOCUMENTS,mn=class t extends Event{constructor(){super(t.eventName)}};mn.eventName="search-context-clear-all-filters";var bo=class t{static build(e,o){return new t(Ra(e.trim()||"context"),o)}constructor(e,o){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new Ke.Debouncer(10),this.searchDebouncer=new Ke.Debouncer(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new Ke.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=o??new yn,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,Ke.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,Ke.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var o;let n=(o=this.store.getState().locales)!==null&&o!==void 0?o:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(c=>c.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let o=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(o),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(_r.TITLE_ONLY),this.store.actions.setRequestScope(Pr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(_r.EVERYWHERE),this.store.actions.setRequestScope(Pr.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return xo(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new mn)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,o){let n=this.facetIds.filter(i=>i!=e);o&&n.push(o),this.facetIds=n}get facetIds(){var e;let o=this.store.getState().request;return[...new Set([...o.facets.map(n=>n.id),...((e=o.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,o){this.setValueFilter(e,o)}setValueFilter(e,o){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:o,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,o){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:o}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let o=this.store.getState().request.metadataFilters,n=[...o.filter(i=>!i.dateFilter),...o.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,o,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:o,to:n}},s=[...i.filter(c=>!c.rangeFilter),...i.filter(c=>c.rangeFilter&&c.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let o=this.store.getState().request.metadataFilters,n=[...o.filter(i=>!i.rangeFilter),...o.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var o,n,i,a;try{if((o=this.cancelableSearch)===null||o===void 0||o.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,Ke.cancelable)(this.service.launchSearch(e));let s=await this.cancelableSearch;if(s.paging.currentPage<=1)this.store.actions.results(s.results),this.store.actions.facets(s.facets),this.store.actions.spellcheck(s.spellcheck);else{let c=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(s.results);this.store.actions.results(c),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(s.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(s.paging)}}catch(s){s instanceof Ke.CanceledPromiseError||(console.error(s),(a=this.errorHandler)===null||a===void 0||a.call(this,s))}}async fetchSuggestData(e){var o;try{(o=this.cancelableSuggest)===null||o===void 0||o.cancel(),this.cancelableSuggest=(0,Ke.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof Ke.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var gu=function(t,e,o,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,o,a):s(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},_i=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},rl=Symbol("registerInterval"),Ii=Symbol("registerAttempts"),bu=40;function xu(t){class e extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Ii]=0,this[rl]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Ii]>bu?window.clearInterval(this[rl]):(this[Ii]++,this.dispatchEvent(new _i))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return gu([(0,nl.state)()],e.prototype,"stateManager",void 0),e}var Gt=class extends xu(ol.FtLitElementRedux){};var ca=h(A());var kn=h(k()),Ae=h(G()),md=h(jt()),no=h(A());var yl=h(A());var fl=h(k()),ve=h(G()),hl=h(jt()),vo=h(A());var pl=h(k()),se=h(A()),al=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorContent),E={color:al,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",al),opacityContentOnSurfacePressed:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:se.FtCssVariableFactory.external(se.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:se.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},sl=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorPrimary),ll={color:sl,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",sl)},cl=se.FtCssVariableFactory.extend("--ft-ripple-color","",se.designSystemVariables.colorSecondary),dl={color:cl,backgroundColor:se.FtCssVariableFactory.extend("--ft-ripple-background-color","",cl)},ul=pl.css`
|
|
16
16
|
:host {
|
|
17
17
|
display: contents;
|
|
18
18
|
}
|
|
@@ -82,7 +82,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:o.extend("--ft-conte
|
|
|
82
82
|
`;var Af={setRequest:(t,e)=>{t.request=e.payload},setRequestQuery:(t,e)=>{t.request.query=e.payload},setRequestContentLocale:(t,e)=>{t.request.contentLocale=e.payload},setPageSize:(t,e)=>{var r;let n=+((r=e.payload)!==null&&r!==void 0?r:20);t.request.paging.perPage=isNaN(n)?20:ar(1,n,1e3)},setPageNumber:(t,e)=>{t.request.paging.page=isNaN(e.payload)?1:Math.max(1,e.payload)},setRequestSort:(t,e)=>{t.request.sort=e.payload},setRequestFilters:(t,e)=>{t.request.metadataFilters=e.payload},setRequestFacets:(t,e)=>{t.request.facets=e.payload},setRequestVirtualField:(t,e)=>{t.request.virtualField=e.payload},setRequestScope:(t,e)=>{t.request.scope=e.payload},setOtherQueryParams:(t,e)=>{t.request.otherQueryParams=e.payload},setRequestClusterSortCriterion:(t,e)=>{var r;t.request.clusterSortCriterions=(r=e.payload)!==null&&r!==void 0?r:[]}},Kc=t=>Rt.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,suggestResults:void 0},reducers:Af});var Zc=I`
|
|
83
83
|
`;var Rf="ft-app-info",fs=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},Tf={session:(t,e)=>{Pe(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>B.dispatchEvent(new fs(e.payload)),0))}},B=Rt.get({name:Rf,reducers:Tf,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var br=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=B.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=B.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var qr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:br.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):br.await()}};var pt=class extends qr{constructor(e=!0,r){var n;super(r);let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new st,this.cache=e?i.commonCache:new st}clearCache(){this.cache.clearAll()}};var qc,_f=Symbol("clearAfterUnitTest"),En=class extends pt{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[qc]=()=>{this.defaultMessages={},this.cache=new st,this.listeners={}},this.currentUiLocale=B.getState().uiLocale,B.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=B.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};Pe(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new Po((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e))}catch(i){!(i instanceof at)&&r&&console.error(i)}return r&&await this.notify(e),n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>sn(0).then(()=>r()).catch(()=>null)))}};qc=_f;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends En{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends En{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Yr=window.FluidTopicsI18nService,wn=window.FluidTopicsCustomI18nService;var _e=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},pe=class extends H{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=()=>br.get(),this.messageContexts=[],this.cache=new st,this.cleanSessionDebouncer=new ce}render(){return _`
|
|
84
84
|
<slot></slot>
|
|
85
|
-
`}update(e){var r,n,i,a,s;super.update(e),e.has("baseUrl")&&(B.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&B.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&B.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&B.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&B.actions.noCustom(this.noCustom),e.has("editorMode")&&B.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&B.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&B.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(l=>Yr.addContext(l)),e.has("openExternalDocumentInNewTab")&&B.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&B.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&B.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(B.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),B.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),B.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};pe.elementDefinitions={};pe.styles=Zc;_e([g()],pe.prototype,"baseUrl",void 0);_e([g()],pe.prototype,"apiIntegrationIdentifier",void 0);_e([g()],pe.prototype,"uiLocale",void 0);_e([ve(null)],pe.prototype,"availableUiLocales",void 0);_e([ve(null)],pe.prototype,"metadataConfiguration",void 0);_e([g({type:Boolean})],pe.prototype,"editorMode",void 0);_e([g({type:Boolean})],pe.prototype,"noCustom",void 0);_e([g({type:Boolean})],pe.prototype,"openExternalDocumentInNewTab",void 0);_e([g({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],pe.prototype,"noCustomComponent",void 0);_e([g({type:Boolean})],pe.prototype,"withManualResources",void 0);_e([g({type:Boolean})],pe.prototype,"navigatorOnline",void 0);_e([g({type:Boolean})],pe.prototype,"forcedOffline",void 0);_e([g({type:Object})],pe.prototype,"apiProvider",void 0);_e([ve([])],pe.prototype,"messageContexts",void 0);_e([ve(void 0)],pe.prototype,"session",void 0);_e([G()],pe.prototype,"localesConfiguration",void 0);var An=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};function Yc(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(B)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>yr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return An([g({type:Boolean})],e.prototype,"useLongDateFormat",void 0),An([g({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),An([de({store:B.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),An([de({store:B.name})],e.prototype,"uiLocale",void 0),e}var Rn=class extends pt{async listMySearches(){let{session:e}=B.getState();return Bc(e,ye.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Tn=class extends pt{async listMyBookmarks(){let e=B.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Lf="ft-user-assets",_n=Rt.get({name:Lf,initialState:{savedSearches:void 0,bookmarks:void 0}}),hs=class{constructor(){this.currentSession=B.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Tn,this.savedSearchesService=new Rn,B.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=B.getState();Pe((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),_n.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),_n.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();_n.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;_n.actions.bookmarks(r)}}},Qc=new hs;var ms=class{addCommand(e,r=!1){B.commands.add(e,r)}consumeCommand(e){return B.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ms;var ys=class{highlightHtml(e,r,n){Ca(e,r,n)}};window.FluidTopicsHighlightHtmlService=new ys;var gs=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=B.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a;return yr.format(e,(n=r?.locale)!==null&&n!==void 0?n:B.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new gs;var Uo=class{static get(e,r){var n,i,a,s;let l=B.getState(),{lang:d,region:u}=(i=(n=l.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Kr(l.baseUrl,(s=(a=window.FluidTopicsClientConfiguration)===null||a===void 0?void 0:a.predefinedSorts)!==null&&s!==void 0?s:{},e??20,l.searchInAllLanguagesAllowed,r??`${d}-${u}`)}};var Ln=class extends qr{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(r)})}};var bs=class{urlToSearchRequest(e){return Uo.get().parse(e)}searchRequestToUrl(e){return Uo.get().serialize(e)}};window.FluidTopicsUrlService=new bs;var xr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};xr.eventName="change";var xs=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Xc=new xs;var Nn=class t extends bt{static build(){return new t(window.history,Xc,()=>window.location,!1)}constructor(e,r,n,i){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Pe(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new xr(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[a,s,l])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(i,[u,s,l]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e,r=!1){var n,i,a;let s={...this.buildCurrentState(),...e,index:this.currentIndex,title:(n=e?.title)!==null&&n!==void 0?n:this.currentState.title},l=r?(i=e?.majorState)!==null&&i!==void 0?i:this.currentState.majorState:(a=this.currentState.majorState)!==null&&a!==void 0?a:e?.majorState;l!=null&&(s.majorState=l),this.setCurrentState(s)}addHistoryChangeListener(e){this.addEventListener(xr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(xr.eventName,e)}currentItem(){return Oo(this.currentState)}back(){let e=this.previousMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Oo(this.states[this.previousMajorPosition()])}previousMajorPosition(){let e=this.currentIndex;for(;e>0&&!this.isMajorState(e);)e--;return this.previousExistingPosition(e)}forward(){let e=this.nextMajorPosition();e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){return Oo(this.states[this.nextMajorPosition()])}nextMajorPosition(){let e=this.currentIndex;do e++;while(e<this.states.length&&!this.isMajorState(e));do e++;while(e<this.states.length&&!this.isMajorState(e));return this.previousExistingPosition(e)}previousExistingPosition(e){let r=e;do r--;while(r>0&&!this.hasState(r));return r}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isMajorState(e){var r,n;return this.hasState(e)&&((n=(r=this.states[e])===null||r===void 0?void 0:r.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Nn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});V("ft-app-context")(pe);var In=class extends pt{constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Ho=t=>t.request.virtualField===mr.TITLE_ONLY&&t.request.scope===Gr.DOCUMENTS,Pn=class t extends Event{constructor(){super(t.eventName)}};Pn.eventName="search-context-clear-all-filters";var zo=class t{static build(e,r){return new t(Kc(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new ce(10),this.searchDebouncer=new ce(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new ce(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new In,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=Wr(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=Wr(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var r;let n=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(l=>l.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(mr.TITLE_ONLY),this.store.actions.setRequestScope(Gr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(mr.EVERYWHERE),this.store.actions.setRequestScope(Gr.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Ho(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new Pn)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(i=>i!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:r,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.dateFilter),...r.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:r,to:n}},s=[...i.filter(l=>!l.rangeFilter),...i.filter(l=>l.rangeFilter&&l.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.rangeFilter),...r.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,i,a;try{if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=Lr(this.service.launchSearch(e));let s=await this.cancelableSearch;if(s.paging.currentPage<=1)this.store.actions.results(s.results),this.store.actions.facets(s.facets),this.store.actions.spellcheck(s.spellcheck);else{let l=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(s.results);this.store.actions.results(l),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(s.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(s.paging)}}catch(s){s instanceof at||(console.error(s),(a=this.errorHandler)===null||a===void 0||a.call(this,s))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=Lr(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof at)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Nf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ss=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Jc=Symbol("registerInterval"),vs=Symbol("registerAttempts"),If=40;function Pf(t){class e extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[vs]=0,this[Jc]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[vs]>If?window.clearInterval(this[Jc]):(this[vs]++,this.dispatchEvent(new Ss))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Nf([G()],e.prototype,"stateManager",void 0),e}var Vt=class extends Pf(Ke){};var ed=o.extend("--ft-ripple-color","",P.colorContent),R={color:ed,backgroundColor:o.extend("--ft-ripple-background-color","",ed),opacityContentOnSurfacePressed:o.external(P.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:o.external(P.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:o.external(P.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:o.external(P.opacityContentOnSurfaceSelected,"Design system"),borderRadius:o.create("--ft-ripple-border-radius","","SIZE","0px")},td=o.extend("--ft-ripple-color","",P.colorPrimary),rd={color:td,backgroundColor:o.extend("--ft-ripple-background-color","",td)},od=o.extend("--ft-ripple-color","",P.colorSecondary),nd={color:od,backgroundColor:o.extend("--ft-ripple-background-color","",od)},id=I`
|
|
85
|
+
`}update(e){var r,n,i,a,s;super.update(e),e.has("baseUrl")&&(B.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&B.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&B.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&B.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&B.actions.noCustom(this.noCustom),e.has("editorMode")&&B.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&B.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&B.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(l=>Yr.addContext(l)),e.has("openExternalDocumentInNewTab")&&B.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&B.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&B.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(B.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),B.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),B.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};pe.elementDefinitions={};pe.styles=Zc;_e([g()],pe.prototype,"baseUrl",void 0);_e([g()],pe.prototype,"apiIntegrationIdentifier",void 0);_e([g()],pe.prototype,"uiLocale",void 0);_e([ve(null)],pe.prototype,"availableUiLocales",void 0);_e([ve(null)],pe.prototype,"metadataConfiguration",void 0);_e([g({type:Boolean})],pe.prototype,"editorMode",void 0);_e([g({type:Boolean})],pe.prototype,"noCustom",void 0);_e([g({type:Boolean})],pe.prototype,"openExternalDocumentInNewTab",void 0);_e([g({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],pe.prototype,"noCustomComponent",void 0);_e([g({type:Boolean})],pe.prototype,"withManualResources",void 0);_e([g({type:Boolean})],pe.prototype,"navigatorOnline",void 0);_e([g({type:Boolean})],pe.prototype,"forcedOffline",void 0);_e([g({type:Object})],pe.prototype,"apiProvider",void 0);_e([ve([])],pe.prototype,"messageContexts",void 0);_e([ve(void 0)],pe.prototype,"session",void 0);_e([G()],pe.prototype,"localesConfiguration",void 0);var An=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};function Yc(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(B)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(l=>l.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?l=>yr.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return An([g({type:Boolean})],e.prototype,"useLongDateFormat",void 0),An([g({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),An([de({store:B.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),An([de({store:B.name})],e.prototype,"uiLocale",void 0),e}var Rn=class extends pt{async listMySearches(){let{session:e}=B.getState();return Bc(e,ye.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Tn=class extends pt{async listMyBookmarks(){let e=B.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Lf="ft-user-assets",_n=Rt.get({name:Lf,initialState:{savedSearches:void 0,bookmarks:void 0}}),hs=class{constructor(){this.currentSession=B.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Tn,this.savedSearchesService=new Rn,B.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=B.getState();Pe((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),_n.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),_n.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();_n.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;_n.actions.bookmarks(r)}}},Qc=new hs;var ms=class{addCommand(e,r=!1){B.commands.add(e,r)}consumeCommand(e){return B.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new ms;var ys=class{highlightHtml(e,r,n){Ca(e,r,n)}};window.FluidTopicsHighlightHtmlService=new ys;var gs=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=B.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(l=>l.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a;return yr.format(e,(n=r?.locale)!==null&&n!==void 0?n:B.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1)}};window.FluidTopicsDateService=new gs;var Uo=class{static get(e,r){var n,i,a,s;let l=B.getState(),{lang:d,region:u}=(i=(n=l.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Kr(l.baseUrl,(s=(a=window.FluidTopicsClientConfiguration)===null||a===void 0?void 0:a.predefinedSorts)!==null&&s!==void 0?s:{},e??20,l.searchInAllLanguagesAllowed,r??`${d}-${u}`)}};var Ln=class extends qr{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(r)})}};var bs=class{urlToSearchRequest(e){return Uo.get().parse(e)}searchRequestToUrl(e){return Uo.get().serialize(e)}};window.FluidTopicsUrlService=new bs;var xr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};xr.eventName="change";var xs=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Xc=new xs;var Nn=class t extends bt{static build(){return new t(window.history,Xc,()=>window.location,!1)}constructor(e,r,n,i){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Pe(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new xr(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[a,s,l])=>{let d=r(),u={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof l=="string"?l:(l??this.windowLocation()).href};n.apply(i,[u,s,l]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(xr.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(xr.eventName,e)}currentItem(){return Oo(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Oo(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return Oo(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Nn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});V("ft-app-context")(pe);var In=class extends pt{constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[a])=>i.localeCompare(a)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Ho=t=>t.request.virtualField===mr.TITLE_ONLY&&t.request.scope===Gr.DOCUMENTS,Pn=class t extends Event{constructor(){super(t.eventName)}};Pn.eventName="search-context-clear-all-filters";var zo=class t{static build(e,r){return new t(Kc(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new ce(10),this.searchDebouncer=new ce(100),this.launchSearch=n=>this.searchDebouncer.run(()=>this.fetchSearchData(n??this.buildSearchRequest(this.store.getState()))),this.buildSearchRequest=n=>({...n.request,facets:this.facetIds.map(i=>({id:i}))}),this.suggestDebouncer=new ce(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new In,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=Wr(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=Wr(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var r;let n=(r=this.store.getState().locales)!==null&&r!==void 0?r:[],i=this.store.getState().request.contentLocale;if(e!=i){if(n.length>0){let a=s=>n.some(l=>l.lang==s);a(e)||(e=a(i)?i:n[0].lang)}this.store.actions.setRequestContentLocale(e),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([])}return e}forceContentLocale(e){this.store.actions.setRequestContentLocale(e)}setPageSize(e){this.store.actions.setPageSize(e)}setPageNumber(e){this.store.actions.setPageNumber(e)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(mr.TITLE_ONLY),this.store.actions.setRequestScope(Gr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(mr.EVERYWHERE),this.store.actions.setRequestScope(Gr.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Ho(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new Pn)}addFacet(e){this.facetIds=[...this.facetIds,e]}replaceFacet(e,r){let n=this.facetIds.filter(i=>i!=e);r&&n.push(r),this.facetIds=n}get facetIds(){var e;let r=this.store.getState().request;return[...new Set([...r.facets.map(n=>n.id),...((e=r.metadataFilters)!==null&&e!==void 0?e:[]).map(n=>n.key)])]}set facetIds(e){let n=[...new Set(e)].map(i=>({id:i}));this.store.actions.setRequestFacets(n)}setFilter(e,r){this.setValueFilter(e,r)}setValueFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,valueFilter:{values:r,negative:!1}},a=[...n.filter(s=>!s.valueFilter),...n.filter(s=>s.valueFilter&&s.key!==i.key),i];this.setFilters(a)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},a=[...n.filter(s=>!s.dateFilter),...n.filter(s=>s.dateFilter&&s.key!==i.key),i];this.setFilters(a)}removeDateFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.dateFilter),...r.filter(i=>i.dateFilter&&i.key!==e)];this.setFilters(n)}setRangeFilter(e,r,n){let i=this.store.getState().request.metadataFilters,a={key:e,rangeFilter:{from:r,to:n}},s=[...i.filter(l=>!l.rangeFilter),...i.filter(l=>l.rangeFilter&&l.key!==a.key),a];this.setFilters(s)}removeRangeFilter(e){let r=this.store.getState().request.metadataFilters,n=[...r.filter(i=>!i.rangeFilter),...r.filter(i=>i.rangeFilter&&i.key!==e)];this.setFilters(n)}setLiveQuery(e){this.store.actions.liveQuery(e)}setRequest(e){this.store.actions.setRequest({...e,facets:this.store.getState().request.facets}),this.store.actions.liveQuery(e.query),this.store.actions.setPageNumber(1)}setScope(e){this.store.actions.setRequestScope(e)}setOtherQueryParams(e){this.store.actions.setOtherQueryParams(e)}setIgnoreEmptyQuery(e){this.ignoreEmptyQuery=e}setOpenExternalDocumentInNewTab(e){this.openExternalDocumentInNewTab=e}updateLocales(){return this.localesDebouncer.run(async()=>this.store.actions.locales((await this.service.getAvailableSearchLocales()).contentLocales))}async fetchSearchData(e){var r,n,i,a;try{if((r=this.cancelableSearch)===null||r===void 0||r.cancel(),this.store.actions.paging(void 0),this.ignoreEmptyQuery&&e.query.length==0)this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=Lr(this.service.launchSearch(e));let s=await this.cancelableSearch;if(s.paging.currentPage<=1)this.store.actions.results(s.results),this.store.actions.facets(s.facets),this.store.actions.spellcheck(s.spellcheck);else{let l=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(s.results);this.store.actions.results(l),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(s.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(s.paging)}}catch(s){s instanceof at||(console.error(s),(a=this.errorHandler)===null||a===void 0||a.call(this,s))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=Lr(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof at)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Nf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Ss=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Jc=Symbol("registerInterval"),vs=Symbol("registerAttempts"),If=40;function Pf(t){class e extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[vs]=0,this[Jc]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[vs]>If?window.clearInterval(this[Jc]):(this[vs]++,this.dispatchEvent(new Ss))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Nf([G()],e.prototype,"stateManager",void 0),e}var Vt=class extends Pf(Ke){};var ed=o.extend("--ft-ripple-color","",P.colorContent),R={color:ed,backgroundColor:o.extend("--ft-ripple-background-color","",ed),opacityContentOnSurfacePressed:o.external(P.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:o.external(P.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:o.external(P.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:o.external(P.opacityContentOnSurfaceSelected,"Design system"),borderRadius:o.create("--ft-ripple-border-radius","","SIZE","0px")},td=o.extend("--ft-ripple-color","",P.colorPrimary),rd={color:td,backgroundColor:o.extend("--ft-ripple-background-color","",td)},od=o.extend("--ft-ripple-color","",P.colorSecondary),nd={color:od,backgroundColor:o.extend("--ft-ripple-background-color","",od)},id=I`
|
|
86
86
|
:host {
|
|
87
87
|
display: contents;
|
|
88
88
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-selected-facets",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "List of selected facets in a designed search page context",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-chip": "1.
|
|
23
|
-
"@fluid-topics/ft-search-context": "1.
|
|
24
|
-
"@fluid-topics/ft-search-period-filter": "1.
|
|
25
|
-
"@fluid-topics/ft-search-type": "1.
|
|
26
|
-
"@fluid-topics/ft-tooltip": "1.
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "1.
|
|
22
|
+
"@fluid-topics/ft-chip": "1.3.0",
|
|
23
|
+
"@fluid-topics/ft-search-context": "1.3.0",
|
|
24
|
+
"@fluid-topics/ft-search-period-filter": "1.3.0",
|
|
25
|
+
"@fluid-topics/ft-search-type": "1.3.0",
|
|
26
|
+
"@fluid-topics/ft-tooltip": "1.3.0",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "1.3.0",
|
|
28
28
|
"lit": "3.1.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "cc982effbf27c0483e03961ad450fd2057a108b2"
|
|
31
31
|
}
|