@fluid-topics/ft-search-context 1.3.26 → 1.3.28
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.
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`)===0?T.substr(1,T.length):T}).forEach(function(T){var I=T.split(":"),A=I.shift().trim();if(A){var
|
|
3
|
-
`;var
|
|
4
|
-
`;var Ge=O(N()),ri="ft-app-info",ye=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ye.eventName="authentication-change";var ni={session:(t,e)=>{(0,Ge.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>g.dispatchEvent(new ye(e.payload)),0))}},g=Ge.FtReduxStore.get({name:ri,reducers:ni,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],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,authenticationRequired:!1}});var Et=O(N());var me=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=g.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=g.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var $e=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:me.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):me.await()}};var j=class extends $e{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[l])=>o.localeCompare(l)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Et.CacheRegistry,this.cache=e?i.commonCache:new Et.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var We=class extends j{async listMyBookmarks(){let e=g.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var At=class{addCommand(e,r=!1){g.commands.add(e,r)}consumeCommand(e){return g.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new At;var z=O(N());var jr,Ce=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ii=Symbol("clearAfterUnitTest"),Qe=class extends(0,z.withEventBus)(j){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[jr]=()=>{this.defaultMessages={},this.cache=new z.CacheRegistry,this.listeners={}},this.currentUiLocale=g.getState().uiLocale,g.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=g.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};(0,z.deepEqual)(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 s=e.toLowerCase(),a=this.resolveContext(s);return new z.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).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)),r&&await this.notify(e)}catch(i){!(i instanceof z.CanceledPromiseError)&&r&&console.error(i)}return 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(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ce({loadedContexts:e})),this.dispatchEvent(new Ce({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ce({loadedContexts:[e]})),this.dispatchEvent(new Ce({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,z.delay)(0).then(()=>n()).catch(()=>null)))}};jr=ii;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Qe{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Qe{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Br=window.FluidTopicsI18nService,Ls=window.FluidTopicsCustomI18nService;var qr=O(N()),wt=class{highlightHtml(e,r,n){(0,qr.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new wt;var Ye=class extends j{async listMySearches(){let{session:e}=g.getState();return Nr(e,P.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Hr=O(N());var Ot=class{isDate(e){var r,n,i,s;return(s=(i=((n=(r=g.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var n,i,s;return Hr.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:g.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1)}};window.FluidTopicsDateService=new Ot;var Vr=O(N());var ke=class{static get(e,r){var n,i;let s=g.getState(),{lang:a,region:o}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Vr.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${a}-${o}`)}};var Xe=class extends j{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}sortEventArrays(e){let r=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,a)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(a.key):typeof s=="string"&&typeof a=="string"?s.localeCompare(a):String(s).localeCompare(String(a)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(r),console.debug(i),n)),1e3)}};var xt=class{urlToSearchRequest(e){return ke.get().parse(e)}searchRequestToUrl(e){return ke.get().serialize(e)}};window.FluidTopicsUrlService=new xt;var ie=O(N());var ve=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ve.eventName="change";var Tt=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))}},Kr=new Tt;var Je=class t extends ie.WithEventBus{static build(){return new t(window.history,Kr,()=>window.location,!1)}constructor(e,r,n,i){var s,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a: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),(0,ie.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ve(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[s,a,o])=>{let l=r(),c={...l===this.currentIndex?this.currentState:void 0,...s,index:l,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[c,a,o]),this.setCurrentState(c,!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(ve.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ve.eventName,e)}currentItem(){return(0,ie.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,ie.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,ie.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 r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;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,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Je.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)});var zr=g;function Gr(t,e){var r;return zr.getState().authenticationRequired&&!(!((r=zr.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var M=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},_=class extends Q.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",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=()=>me.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Q.CacheRegistry,this.cleanSessionDebouncer=new Q.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return $r.html`
|
|
1
|
+
"use strict";(()=>{var ti=Object.create;var lr=Object.defineProperty;var ri=Object.getOwnPropertyDescriptor;var ni=Object.getOwnPropertyNames;var ii=Object.getPrototypeOf,si=Object.prototype.hasOwnProperty;var Ve=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var ai=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ni(e))!si.call(t,i)&&i!==r&&lr(t,i,{get:()=>e[i],enumerable:!(n=ri(e,i))||n.enumerable});return t};var O=(t,e,r)=>(r=t!=null?ti(ii(t)):{},ai(e||!t||!t.__esModule?lr(r,"default",{value:t,enumerable:!0}):r,t));var k=Ve((as,dr)=>{dr.exports=ftGlobals.wcUtils});var Ae=Ve((os,fr)=>{fr.exports=ftGlobals.lit});var te=Ve((us,hr)=>{hr.exports=ftGlobals.litDecorators});var gr=Ve((re,vr)=>{var Ge=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,ze=function(){function t(){this.fetch=!1,this.DOMException=Ge.DOMException}return t.prototype=Ge,new t}();(function(t){var e=function(r){var n=typeof t<"u"&&t||typeof self<"u"&&self||typeof global<"u"&&global||{},i={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function s(u){return u&&DataView.prototype.isPrototypeOf(u)}if(i.arrayBuffer)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],o=ArrayBuffer.isView||function(u){return u&&a.indexOf(Object.prototype.toString.call(u))>-1};function l(u){if(typeof u!="string"&&(u=String(u)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(u)||u==="")throw new TypeError('Invalid character in header field name: "'+u+'"');return u.toLowerCase()}function c(u){return typeof u!="string"&&(u=String(u)),u}function f(u){var d={next:function(){var b=u.shift();return{done:b===void 0,value:b}}};return i.iterable&&(d[Symbol.iterator]=function(){return d}),d}function h(u){this.map={},u instanceof h?u.forEach(function(d,b){this.append(b,d)},this):Array.isArray(u)?u.forEach(function(d){if(d.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+d.length);this.append(d[0],d[1])},this):u&&Object.getOwnPropertyNames(u).forEach(function(d){this.append(d,u[d])},this)}h.prototype.append=function(u,d){u=l(u),d=c(d);var b=this.map[u];this.map[u]=b?b+", "+d:d},h.prototype.delete=function(u){delete this.map[l(u)]},h.prototype.get=function(u){return u=l(u),this.has(u)?this.map[u]:null},h.prototype.has=function(u){return this.map.hasOwnProperty(l(u))},h.prototype.set=function(u,d){this.map[l(u)]=c(d)},h.prototype.forEach=function(u,d){for(var b in this.map)this.map.hasOwnProperty(b)&&u.call(d,this.map[b],b,this)},h.prototype.keys=function(){var u=[];return this.forEach(function(d,b){u.push(b)}),f(u)},h.prototype.values=function(){var u=[];return this.forEach(function(d){u.push(d)}),f(u)},h.prototype.entries=function(){var u=[];return this.forEach(function(d,b){u.push([b,d])}),f(u)},i.iterable&&(h.prototype[Symbol.iterator]=h.prototype.entries);function p(u){if(!u._noBody){if(u.bodyUsed)return Promise.reject(new TypeError("Already read"));u.bodyUsed=!0}}function g(u){return new Promise(function(d,b){u.onload=function(){d(u.result)},u.onerror=function(){b(u.error)}})}function y(u){var d=new FileReader,b=g(d);return d.readAsArrayBuffer(u),b}function m(u){var d=new FileReader,b=g(d),T=/charset=([A-Za-z0-9_-]+)/.exec(u.type),I=T?T[1]:"utf-8";return d.readAsText(u,I),b}function w(u){for(var d=new Uint8Array(u),b=new Array(d.length),T=0;T<d.length;T++)b[T]=String.fromCharCode(d[T]);return b.join("")}function S(u){if(u.slice)return u.slice(0);var d=new Uint8Array(u.byteLength);return d.set(new Uint8Array(u)),d.buffer}function E(){return this.bodyUsed=!1,this._initBody=function(u){this.bodyUsed=this.bodyUsed,this._bodyInit=u,u?typeof u=="string"?this._bodyText=u:i.blob&&Blob.prototype.isPrototypeOf(u)?this._bodyBlob=u:i.formData&&FormData.prototype.isPrototypeOf(u)?this._bodyFormData=u:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(u)?this._bodyText=u.toString():i.arrayBuffer&&i.blob&&s(u)?(this._bodyArrayBuffer=S(u.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(u)||o(u))?this._bodyArrayBuffer=S(u):this._bodyText=u=Object.prototype.toString.call(u):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof u=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(u)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var u=p(this);if(u)return u;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var u=p(this);return u||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(i.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var u=p(this);if(u)return u;if(this._bodyBlob)return m(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(w(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(W)}),this.json=function(){return this.text().then(JSON.parse)},this}var C=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function x(u){var d=u.toUpperCase();return C.indexOf(d)>-1?d:u}function L(u,d){if(!(this instanceof L))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');d=d||{};var b=d.body;if(u instanceof L){if(u.bodyUsed)throw new TypeError("Already read");this.url=u.url,this.credentials=u.credentials,d.headers||(this.headers=new h(u.headers)),this.method=u.method,this.mode=u.mode,this.signal=u.signal,!b&&u._bodyInit!=null&&(b=u._bodyInit,u.bodyUsed=!0)}else this.url=String(u);if(this.credentials=d.credentials||this.credentials||"same-origin",(d.headers||!this.headers)&&(this.headers=new h(d.headers)),this.method=x(d.method||this.method||"GET"),this.mode=d.mode||this.mode||null,this.signal=d.signal||this.signal||function(){if("AbortController"in n){var A=new AbortController;return A.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&b)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(b),(this.method==="GET"||this.method==="HEAD")&&(d.cache==="no-store"||d.cache==="no-cache")){var T=/([?&])_=[^&]*/;if(T.test(this.url))this.url=this.url.replace(T,"$1_="+new Date().getTime());else{var I=/\?/;this.url+=(I.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}L.prototype.clone=function(){return new L(this,{body:this._bodyInit})};function W(u){var d=new FormData;return u.trim().split("&").forEach(function(b){if(b){var T=b.split("="),I=T.shift().replace(/\+/g," "),A=T.join("=").replace(/\+/g," ");d.append(decodeURIComponent(I),decodeURIComponent(A))}}),d}function le(u){var d=new h,b=u.replace(/\r?\n[\t ]+/g," ");return b.split("\r").map(function(T){return T.indexOf(`
|
|
2
|
+
`)===0?T.substr(1,T.length):T}).forEach(function(T){var I=T.split(":"),A=I.shift().trim();if(A){var He=I.join(":").trim();try{d.append(A,He)}catch(Ot){console.warn("Response "+Ot.message)}}}),d}E.call(L.prototype);function q(u,d){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(d||(d={}),this.type="default",this.status=d.status===void 0?200:d.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=d.statusText===void 0?"":""+d.statusText,this.headers=new h(d.headers),this.url=d.url||"",this._initBody(u)}E.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},q.error=function(){var u=new q(null,{status:200,statusText:""});return u.ok=!1,u.status=0,u.type="error",u};var de=[301,302,303,307,308];q.redirect=function(u,d){if(de.indexOf(d)===-1)throw new RangeError("Invalid status code");return new q(null,{status:d,headers:{location:u}})},r.DOMException=n.DOMException;try{new r.DOMException}catch{r.DOMException=function(d,b){this.message=d,this.name=b;var T=Error(d);this.stack=T.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function Ee(u,d){return new Promise(function(b,T){var I=new L(u,d);if(I.signal&&I.signal.aborted)return T(new r.DOMException("Aborted","AbortError"));var A=new XMLHttpRequest;function He(){A.abort()}A.onload=function(){var N={statusText:A.statusText,headers:le(A.getAllResponseHeaders()||"")};I.url.indexOf("file://")===0&&(A.status<200||A.status>599)?N.status=200:N.status=A.status,N.url="responseURL"in A?A.responseURL:N.headers.get("X-Request-URL");var fe="response"in A?A.response:A.responseText;setTimeout(function(){b(new q(fe,N))},0)},A.onerror=function(){setTimeout(function(){T(new TypeError("Network request failed"))},0)},A.ontimeout=function(){setTimeout(function(){T(new TypeError("Network request timed out"))},0)},A.onabort=function(){setTimeout(function(){T(new r.DOMException("Aborted","AbortError"))},0)};function Ot(N){try{return N===""&&n.location.href?n.location.href:N}catch{return N}}if(A.open(I.method,Ot(I.url),!0),I.credentials==="include"?A.withCredentials=!0:I.credentials==="omit"&&(A.withCredentials=!1),"responseType"in A&&(i.blob?A.responseType="blob":i.arrayBuffer&&(A.responseType="arraybuffer")),d&&typeof d.headers=="object"&&!(d.headers instanceof h||n.Headers&&d.headers instanceof n.Headers)){var cr=[];Object.getOwnPropertyNames(d.headers).forEach(function(N){cr.push(l(N)),A.setRequestHeader(N,c(d.headers[N]))}),I.headers.forEach(function(N,fe){cr.indexOf(fe)===-1&&A.setRequestHeader(fe,N)})}else I.headers.forEach(function(N,fe){A.setRequestHeader(fe,N)});I.signal&&(I.signal.addEventListener("abort",He),A.onreadystatechange=function(){A.readyState===4&&I.signal.removeEventListener("abort",He)}),A.send(typeof I._bodyInit>"u"?null:I._bodyInit)})}return Ee.polyfill=!0,n.fetch||(n.fetch=Ee,n.Headers=h,n.Request=L,n.Response=q),r.Headers=h,r.Request=L,r.Response=q,r.fetch=Ee,r}({})})(ze);ze.fetch.ponyfill=!0;delete ze.fetch.polyfill;var we=Ge.fetch?Ge:ze;re=we.fetch;re.default=we.fetch;re.fetch=we.fetch;re.Headers=we.Headers;re.Request=we.Request;re.Response=we.Response;vr.exports=re});var ei=O(k());var Zn=O(Ae()),J=O(te()),$=O(k());var pr=O(Ae()),cs={},yr=pr.css`
|
|
3
|
+
`;var St=O(k()),Xn=O(te());var K=O(k());var Ke=O(k()),oi={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:(0,Ke.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},setRequestSortId:(t,e)=>{t.request.sortId=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:[]}},mr=t=>Ke.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],sortId:void 0,paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,announcements:void 0,suggestResults:void 0,configuration:void 0},reducers:oi});var ci=O(gr(),1);var br;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(br||(br={}));var Sr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Sr||(Sr={}));var Er;(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.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Er||(Er={}));var Oe;(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.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Oe||(Oe={}));var Ar;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Ar||(Ar={}));var wr;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(wr||(wr={}));var he;(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.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",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.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_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"})(he||(he={}));var Or;(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"})(Or||(Or={}));var xr;(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",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT"})(xr||(xr={}));var Tr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Tr||(Tr={}));var Cr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Cr||(Cr={}));var _r;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(_r||(_r={}));var Rr;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Rr||(Rr={}));var Ir;(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"})(Ir||(Ir={}));var Dr;(function(t){t.ASC="ASC",t.DESC="DESC"})(Dr||(Dr={}));var Pr;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Pr||(Pr={}));var xe;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(xe||(xe={}));var Mr;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Mr||(Mr={}));var kr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(kr||(kr={}));var Lr;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Lr||(Lr={}));var Nr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Nr||(Nr={}));var ne;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(ne||(ne={}));var Te;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Te||(Te={}));var Fr;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Fr||(Fr={}));var P;(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.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(P||(P={}));var pe;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(pe||(pe={}));var Ur;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Ur||(Ur={}));var jr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(jr||(jr={}));var Br;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Br||(Br={}));var qr;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(qr||(qr={}));var ui={[P.PERSONAL_BOOK_SHARE_USER]:[P.PERSONAL_BOOK_USER],[P.HTML_EXPORT_USER]:[P.PERSONAL_BOOK_USER],[P.PDF_EXPORT_USER]:[P.PERSONAL_BOOK_USER],[P.KHUB_ADMIN]:[P.CONTENT_PUBLISHER],[P.ADMIN]:[P.KHUB_ADMIN,P.USERS_ADMIN,P.PORTAL_ADMIN],[P.GENERATIVE_AI_EXPORT_USER]:[P.GENERATIVE_AI_USER]};function Hr(t,e){return t===e||(ui[t]??[]).some(r=>Hr(r,e))}function Vr(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=>Hr(n,e))}var Wn=O(k());var en=O(Ae()),F=O(te()),Q=O(k());var Kr=O(Ae());var Gr=Kr.css`
|
|
4
|
+
`;var $e=O(k()),li="ft-app-info",ye=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ye.eventName="authentication-change";var di={session:(t,e)=>{(0,$e.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>v.dispatchEvent(new ye(e.payload)),0))}},v=$e.FtReduxStore.get({name:li,reducers:di,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],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,authenticationRequired:!1}});var xt=O(k());var me=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=v.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=v.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var We=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:me.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):me.await()}};var j=class extends We{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[l])=>o.localeCompare(l)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new xt.CacheRegistry,this.cache=e?i.commonCache:new xt.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Qe=class extends j{async listMyBookmarks(){let e=v.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Tt=class{addCommand(e,r=!1){v.commands.add(e,r)}consumeCommand(e){return v.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Tt;var G=O(k());var zr,Ce=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},fi=Symbol("clearAfterUnitTest"),Ye=class extends(0,G.withEventBus)(j){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[zr]=()=>{this.defaultMessages={},this.cache=new G.CacheRegistry,this.listeners={}},this.currentUiLocale=v.getState().uiLocale,v.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=v.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};(0,G.deepEqual)(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 s=e.toLowerCase(),a=this.resolveContext(s);return new G.ParametrizedLabelResolver((i=this.defaultMessages[s])!==null&&i!==void 0?i:{},a).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)),r&&await this.notify(e)}catch(i){!(i instanceof G.CanceledPromiseError)&&r&&console.error(i)}return 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(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Ce({loadedContexts:e})),this.dispatchEvent(new Ce({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Ce({loadedContexts:[e]})),this.dispatchEvent(new Ce({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,G.delay)(0).then(()=>n()).catch(()=>null)))}};zr=fi;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ye{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ye{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var $r=window.FluidTopicsI18nService,qs=window.FluidTopicsCustomI18nService;var Wr=O(k()),Ct=class{highlightHtml(e,r,n){(0,Wr.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Ct;var Xe=class extends j{async listMySearches(){let{session:e}=v.getState();return Vr(e,P.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Qr=O(k());var _t=class{isDate(e){var r,n,i,s;return(s=(i=((n=(r=v.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(o=>o.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var n,i,s;return Qr.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:v.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1)}};window.FluidTopicsDateService=new _t;var Yr=O(k());var ke=class{static get(e,r){var n,i;let s=v.getState(),{lang:a,region:o}=(i=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Yr.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${a}-${o}`)}};var Je=class extends j{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}sortEventArrays(e){let r=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,a)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(a.key):typeof s=="string"&&typeof a=="string"?s.localeCompare(a):String(s).localeCompare(String(a)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(r),console.debug(i),n)),1e3)}};var Rt=class{urlToSearchRequest(e){return ke.get().parse(e)}searchRequestToUrl(e){return ke.get().serialize(e)}};window.FluidTopicsUrlService=new Rt;var ie=O(k());var ve=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ve.eventName="change";var It=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))}},Xr=new It;var Ze=class t extends ie.WithEventBus{static build(){return new t(window.history,Xr,()=>window.location,!1)}constructor(e,r,n,i){var s,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&a!==void 0?a: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),(0,ie.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new ve(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[s,a,o])=>{let l=r(),c={...l===this.currentIndex?this.currentState:void 0,...s,index:l,href:typeof o=="string"?o:(o??this.windowLocation()).href};n.apply(i,[c,a,o]),this.setCurrentState(c,!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(ve.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ve.eventName,e)}currentItem(){return(0,ie.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,ie.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,ie.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 r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(i=s),s++;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,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Ze.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)});var Jr=v;function Zr(t,e){var r;return Jr.getState().authenticationRequired&&!(!((r=Jr.getState().session)===null||r===void 0)&&r.sessionAuthenticated)?Promise.resolve(e):t()}var M=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},_=class extends Q.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",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=()=>me.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Q.CacheRegistry,this.cleanSessionDebouncer=new Q.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return en.html`
|
|
5
5
|
<slot></slot>
|
|
6
|
-
`}connectedCallback(){super.connectedCallback(),g.addEventListener(ye.eventName,this.reloadConfiguration)}disconnectedCallback(){g.addEventListener(ye.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,i,s,a,o,l;super.update(e),e.has("baseUrl")&&(g.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&g.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&g.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&g.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&g.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&g.actions.noCustom(this.noCustom),e.has("editorMode")&&g.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&g.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&g.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>Br.addContext(c)),e.has("openExternalDocumentInNewTab")&&g.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&g.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&g.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(g.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),g.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),g.actions.searchInAllLanguagesAllowed((a=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&a!==void 0?a:!1)),e.has("authenticationRequired")&&g.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&g.actions.availableContentLocales((l=(o=this.availableContentLocales)===null||o===void 0?void 0:o.contentLocales)!==null&&l!==void 0?l:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}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())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Gr(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};_.elementDefinitions={};_.styles=Ur;M([(0,F.property)()],_.prototype,"baseUrl",void 0);M([(0,F.property)()],_.prototype,"apiIntegrationIdentifier",void 0);M([(0,F.property)()],_.prototype,"apiIntegrationAppVersion",void 0);M([(0,F.property)()],_.prototype,"uiLocale",void 0);M([(0,Q.jsonProperty)(null)],_.prototype,"availableUiLocales",void 0);M([(0,Q.jsonProperty)(null)],_.prototype,"metadataConfiguration",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"editorMode",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"noCustom",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"openExternalDocumentInNewTab",void 0);M([(0,F.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],_.prototype,"noCustomComponent",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"withManualResources",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"navigatorOnline",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"forcedOffline",void 0);M([(0,F.property)({type:Object})],_.prototype,"apiProvider",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"authenticationRequired",void 0);M([(0,Q.jsonProperty)([])],_.prototype,"messageContexts",void 0);M([(0,Q.jsonProperty)(void 0)],_.prototype,"session",void 0);M([(0,F.state)()],_.prototype,"localesConfiguration",void 0);M([(0,F.state)()],_.prototype,"availableContentLocales",void 0);var Gi=O(te());function si(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Ze(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(!Ze(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 s=a=>Object.keys(a).filter(o=>a[o]!=null);if(i=s(t),r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!Ze(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Ze(t,e){try{return si(t,e)}catch{return!1}}function et(t,e){return!Ze(t,e)}var ai=O(te(),1);var tt=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var _e=O(te(),1);var Wr=O(te(),1);function Qr(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Wr.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:et,...e??{}})}var rt=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let a of n)try{await a()}catch(o){i(o);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Xr=O(Ae(),1);var nt=globalThis,oi=nt.ShadowRoot&&(nt.ShadyCSS===void 0||nt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ka=Symbol();var Yr=(t,e)=>{if(oi)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=nt.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var it=class extends Xr.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,s])=>e.registry.define(i,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Yr(n,e.elementStyles),n}};function Jr(t,e,...r){var n;let i=t.querySelector(e);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var Le=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},rn,Zr=Symbol("constructorPrototype"),en=Symbol("constructorName"),nn=Symbol("exportpartsDebouncer"),tn=Symbol("dynamicDependenciesLoaded"),Z=class extends it{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[rn]=new rt(5),this[en]=this.constructor.name,this[Zr]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[en]&&Object.setPrototypeOf(this,this[Zr])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let e=this.constructor;e[tn]||(e[tn]=!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:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=Jr(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}scheduleExportpartsUpdate(){var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[nn].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var r,n,i,s,a,o;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.removeAttribute("exportparts");return}let f=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],y=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(m=>m.split(":")[1]))!==null&&o!==void 0?o:[];new Array(...v,...y).filter(l).map(m=>m.trim()).forEach(m=>f.add(m))}if(f.size===0){this.removeAttribute("exportparts");return}let h=[...f.values()].flatMap(p=>c.map(v=>`${p}:${v}--${p}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};rn=nn;Le([(0,_e.property)()],Z.prototype,"exportpartsPrefix",void 0);Le([Qr([])],Z.prototype,"exportpartsPrefixes",void 0);Le([(0,_e.property)()],Z.prototype,"customStylesheet",void 0);Le([(0,_e.property)()],Z.prototype,"elementToFocus",void 0);Le([(0,_e.state)()],Z.prototype,"useAdoptedStyleSheets",void 0);function st(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Ne=Symbol("internalReduxEventsUnsubscribers"),se=Symbol("internalStoresUnsubscribers"),ge=Symbol("internalStores");function ui(t){var e,r,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ge].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ge].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ge].get(a)}addStore(a,o){var l;o=(l=o??a.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(o),this[ge].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ge].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ge].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let l=this.constructor.getPropertyOptions(o);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:o)){let c=this.getStore(a.store);c&&(a.store?this[se].has(a.store):this[se].size>0)&&(this[o]=a.selector(c.getState(),this))}})}subscribeToStore(a,o){var l;this[se].set(a,o.subscribe(()=>this.updateFromStores())),this[Ne].set(a,[]),st(o)&&o.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((c,f)=>{if(typeof this[f]=="function"&&(!c.store||o.name===c.store)){let h=p=>this[f](p);o.addEventListener(c.eventName,h),this[Ne].get(a).push(()=>o.removeEventListener(c.eventName,h))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[se].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[se].has(a)&&this[se].get(a)(),this[se].delete(a),(o=this[Ne].get(a))===null||o===void 0||o.forEach(l=>l()),this[Ne].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=se,r=ge,n=Ne,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}var sn=class extends ui(Z){};function G(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ee(t){return!!t&&!!t[R]}function Y(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===mi}(t)||Array.isArray(t)||!!t[fn]||!!(!((e=t.constructor)===null||e===void 0)&&e[fn])||Lt(t)||Nt(t))}function be(t,e,r){r===void 0&&(r=!1),De(t)===0?(r?Object.keys:Ie)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function De(t){var e=t[R];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Lt(t)?2:Nt(t)?3:0}function Re(t,e){return De(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function ci(t,e){return De(t)===2?t.get(e):t[e]}function hn(t,e,r){var n=De(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function pn(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Lt(t){return pi&&t instanceof Map}function Nt(t){return yi&&t instanceof Set}function ae(t){return t.o||t.t}function Ft(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=vn(t);delete e[R];for(var r=Ie(e),n=0;n<r.length;n++){var i=r[n],s=e[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Ut(t,e){return e===void 0&&(e=!1),jt(t)||ee(t)||!Y(t)||(De(t)>1&&(t.set=t.add=t.clear=t.delete=li),Object.freeze(t),e&&be(t,function(r,n){return Ut(n,!0)},!0)),t}function li(){G(2)}function jt(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function X(t){var e=kt[t];return e||G(18,t),e}function di(t,e){kt[t]||(kt[t]=e)}function Dt(){return Ue}function Ct(t,e){e&&(X("Patches"),t.u=[],t.s=[],t.v=e)}function at(t){Pt(t),t.p.forEach(fi),t.p=null}function Pt(t){t===Ue&&(Ue=t.l)}function an(t){return Ue={p:[],l:Ue,h:t,m:!0,_:0}}function fi(t){var e=t[R];e.i===0||e.i===1?e.j():e.g=!0}function _t(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||X("ES5").S(e,t,n),n?(r[R].P&&(at(e),G(4)),Y(t)&&(t=ot(e,t),e.l||ut(e,t)),e.u&&X("Patches").M(r[R].t,t,e.u,e.s)):t=ot(e,r,[]),at(e),e.u&&e.v(e.u,e.s),t!==mn?t:void 0}function ot(t,e,r){if(jt(e))return e;var n=e[R];if(!n)return be(e,function(o,l){return on(t,n,e,o,l,r)},!0),e;if(n.A!==t)return e;if(!n.P)return ut(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ft(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),be(s,function(o,l){return on(t,n,i,o,l,r,a)}),ut(t,i,!1),r&&t.u&&X("Patches").N(n,r,t.u,t.s)}return n.o}function on(t,e,r,n,i,s,a){if(ee(i)){var o=ot(t,i,s&&e&&e.i!==3&&!Re(e.R,n)?s.concat(n):void 0);if(hn(r,n,o),!ee(o))return;t.m=!1}else a&&r.add(i);if(Y(i)&&!jt(i)){if(!t.h.D&&t._<1)return;ot(t,i),e&&e.A.l||ut(t,i)}}function ut(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Ut(e,r)}function Rt(t,e){var r=t[R];return(r?ae(r):t)[e]}function un(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function oe(t){t.P||(t.P=!0,t.l&&oe(t.l))}function It(t){t.o||(t.o=Ft(t.t))}function Mt(t,e,r){var n=Lt(e)?X("MapSet").F(e,r):Nt(e)?X("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:Dt(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=o,c=je;a&&(l=[o],c=Fe);var f=Proxy.revocable(l,c),h=f.revoke,p=f.proxy;return o.k=p,o.j=h,p}(e,r):X("ES5").J(e,r);return(r?r.A:Dt()).p.push(n),n}function hi(t){return ee(t)||G(22,t),function e(r){if(!Y(r))return r;var n,i=r[R],s=De(r);if(i){if(!i.P&&(i.i<4||!X("ES5").K(i)))return i.t;i.I=!0,n=cn(r,s),i.I=!1}else n=cn(r,s);return be(n,function(a,o){i&&ci(i.t,a)===o||hn(n,a,e(o))}),s===3?new Set(n):n}(t)}function cn(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ft(t)}function yn(){function t(a,o){var l=s[a];return l?l.enumerable=o:s[a]=l={configurable:!0,enumerable:o,get:function(){var c=this[R];return je.get(c,a)},set:function(c){var f=this[R];je.set(f,a,c)}},l}function e(a){for(var o=a.length-1;o>=0;o--){var l=a[o][R];if(!l.P)switch(l.i){case 5:n(l)&&oe(l);break;case 4:r(l)&&oe(l)}}}function r(a){for(var o=a.t,l=a.k,c=Ie(l),f=c.length-1;f>=0;f--){var h=c[f];if(h!==R){var p=o[h];if(p===void 0&&!Re(o,h))return!0;var v=l[h],y=v&&v[R];if(y?y.t!==p:!pn(v,p))return!0}}var m=!!o[R];return c.length!==Ie(o).length+(m?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var l=Object.getOwnPropertyDescriptor(o,o.length-1);if(l&&!l.get)return!0;for(var c=0;c<o.length;c++)if(!o.hasOwnProperty(c))return!0;return!1}function i(a){a.g&&G(3,JSON.stringify(ae(a)))}var s={};di("ES5",{J:function(a,o){var l=Array.isArray(a),c=function(h,p){if(h){for(var v=Array(p.length),y=0;y<p.length;y++)Object.defineProperty(v,""+y,t(y,!0));return v}var m=vn(p);delete m[R];for(var w=Ie(m),S=0;S<w.length;S++){var E=w[S];m[E]=t(E,h||!!m[E].enumerable)}return Object.create(Object.getPrototypeOf(p),m)}(l,a),f={i:l?5:4,A:o?o.A:Dt(),P:!1,I:!1,R:{},l:o,t:a,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,R,{value:f,writable:!0}),c},S:function(a,o,l){l?ee(o)&&o[R].A===a&&e(a.p):(a.u&&function c(f){if(f&&typeof f=="object"){var h=f[R];if(h){var p=h.t,v=h.k,y=h.R,m=h.i;if(m===4)be(v,function(x){x!==R&&(p[x]!==void 0||Re(p,x)?y[x]||c(v[x]):(y[x]=!0,oe(h)))}),be(p,function(x){v[x]!==void 0||Re(v,x)||(y[x]=!1,oe(h))});else if(m===5){if(n(h)&&(oe(h),y.length=!0),v.length<p.length)for(var w=v.length;w<p.length;w++)y[w]=!1;else for(var S=p.length;S<v.length;S++)y[S]=!0;for(var E=Math.min(v.length,p.length),C=0;C<E;C++)v.hasOwnProperty(C)||(y[C]=!0),y[C]===void 0&&c(v[C])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var ln,Ue,Bt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",pi=typeof Map<"u",yi=typeof Set<"u",dn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",mn=Bt?Symbol.for("immer-nothing"):((ln={})["immer-nothing"]=!0,ln),fn=Bt?Symbol.for("immer-draftable"):"__$immer_draftable",R=Bt?Symbol.for("immer-state"):"__$immer_state";var mi=""+Object.prototype.constructor,Ie=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,vn=Object.getOwnPropertyDescriptors||function(t){var e={};return Ie(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},kt={},je={get:function(t,e){if(e===R)return t;var r=ae(t);if(!Re(r,e))return function(i,s,a){var o,l=un(s,a);return l?"value"in l?l.value:(o=l.get)===null||o===void 0?void 0:o.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!Y(n)?n:n===Rt(t.t,e)?(It(t),t.o[e]=Mt(t.A.h,n,t)):n},has:function(t,e){return e in ae(t)},ownKeys:function(t){return Reflect.ownKeys(ae(t))},set:function(t,e,r){var n=un(ae(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=Rt(ae(t),e),s=i?.[R];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(pn(r,i)&&(r!==void 0||Re(t.t,e)))return!0;It(t),oe(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return Rt(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,It(t),oe(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ae(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){G(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){G(12)}},Fe={};be(je,function(t,e){Fe[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Fe.deleteProperty=function(t,e){return Fe.set.call(this,t,e,void 0)},Fe.set=function(t,e,r){return je.set.call(this,t[0],e,r,t[0])};var vi=function(){function t(r){var n=this;this.O=dn,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var l=n;return function(m){var w=this;m===void 0&&(m=o);for(var S=arguments.length,E=Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];return l.produce(m,function(x){var k;return(k=s).call.apply(k,[w,x].concat(E))})}}var c;if(typeof s!="function"&&G(6),a!==void 0&&typeof a!="function"&&G(7),Y(i)){var f=an(n),h=Mt(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?at(f):Pt(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return Ct(f,a),_t(m,f)},function(m){throw at(f),m}):(Ct(f,a),_t(c,f))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===mn&&(c=void 0),n.D&&Ut(c,!0),a){var v=[],y=[];X("Patches").M(i,c,v,y),a(v,y)}return c}G(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(c){for(var f=arguments.length,h=Array(f>1?f-1:0),p=1;p<f;p++)h[p-1]=arguments[p];return n.produceWithPatches(c,function(v){return i.apply(void 0,[v].concat(h))})};var a,o,l=n.produce(i,s,function(c,f){a=c,o=f});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,a,o]}):[l,a,o]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){Y(r)||G(8),ee(r)&&(r=hi(r));var n=an(this),i=Mt(this,r,void 0);return i[R].C=!0,Pt(n),i},e.finishDraft=function(r,n){var i=r&&r[R],s=i.A;return Ct(s,n),_t(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!dn&&G(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var a=X("Patches").$;return ee(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),H=new vi,gi=H.produce,Wa=H.produceWithPatches.bind(H),Qa=H.setAutoFreeze.bind(H),Ya=H.setUseProxies.bind(H),Xa=H.applyPatches.bind(H),Ja=H.createDraft.bind(H),Za=H.finishDraft.bind(H),ct=gi;function Se(t){"@babel/helpers - typeof";return Se=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},Se(t)}function gn(t,e){if(Se(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Se(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function bn(t){var e=gn(t,"string");return Se(e)=="symbol"?e:e+""}function Sn(t,e,r){return(e=bn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function En(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function qt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?En(Object(r),!0).forEach(function(n){Sn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):En(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B(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 An=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Ht=function(){return Math.random().toString(36).substring(7).split("").join(".")},lt={INIT:"@@redux/INIT"+Ht(),REPLACE:"@@redux/REPLACE"+Ht(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ht()}};function bi(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 Vt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(B(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(B(1));return r(Vt)(t,e)}if(typeof t!="function")throw new Error(B(2));var i=t,s=e,a=[],o=a,l=!1;function c(){o===a&&(o=a.slice())}function f(){if(l)throw new Error(B(3));return s}function h(m){if(typeof m!="function")throw new Error(B(4));if(l)throw new Error(B(5));var w=!0;return c(),o.push(m),function(){if(w){if(l)throw new Error(B(6));w=!1,c();var E=o.indexOf(m);o.splice(E,1),a=null}}}function p(m){if(!bi(m))throw new Error(B(7));if(typeof m.type>"u")throw new Error(B(8));if(l)throw new Error(B(9));try{l=!0,s=i(s,m)}finally{l=!1}for(var w=a=o,S=0;S<w.length;S++){var E=w[S];E()}return m}function v(m){if(typeof m!="function")throw new Error(B(10));i=m,p({type:lt.REPLACE})}function y(){var m,w=h;return m={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(B(11));function C(){E.next&&E.next(f())}C();var x=w(C);return{unsubscribe:x}}},m[An]=function(){return this},m}return p({type:lt.INIT}),n={dispatch:p,subscribe:h,getState:f,replaceReducer:v},n[An]=y,n}function Si(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:lt.INIT});if(typeof n>"u")throw new Error(B(12));if(typeof r(void 0,{type:lt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(B(13))})}function wn(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var s=Object.keys(r),a,o;try{Si(r)}catch(l){o=l}return function(c,f){if(c===void 0&&(c={}),o)throw o;if(0)var h;for(var p=!1,v={},y=0;y<s.length;y++){var m=s[y],w=r[m],S=c[m],E=w(S,f);if(typeof E>"u"){var C=f&&f.type;throw new Error(B(14))}v[m]=E,p=p||E!==S}return p=p||s.length!==Object.keys(c).length,p?v:c}}function Pe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];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 On(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(B(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(l){return l(a)});return s=Pe.apply(void 0,o)(i.dispatch),qt(qt({},i),{},{dispatch:s})}}}function xn(t){var e=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,t):a(o)}}};return e}var Tn=xn();Tn.withExtraArgument=xn;var Kt=Tn;var Dn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ei=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(f){return l([c,f])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(f){c=[6,f],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Me=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},Ai=Object.defineProperty,wi=Object.defineProperties,Oi=Object.getOwnPropertyDescriptors,Cn=Object.getOwnPropertySymbols,xi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,_n=function(t,e,r){return e in t?Ai(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ue=function(t,e){for(var r in e||(e={}))xi.call(e,r)&&_n(t,r,e[r]);if(Cn)for(var n=0,i=Cn(e);n<i.length;n++){var r=i[n];Ti.call(e,r)&&_n(t,r,e[r])}return t},zt=function(t,e){return wi(t,Oi(e))},Ci=function(t,e,r){return new Promise(function(n,i){var s=function(l){try{o(r.next(l))}catch(c){i(c)}},a=function(l){try{o(r.throw(l))}catch(c){i(c)}},o=function(l){return l.done?n(l.value):Promise.resolve(l.value).then(s,a)};o((r=r.apply(t,e)).next())})};var _i=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pe:Pe.apply(null,arguments)},go=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ri(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Ii=function(t){Dn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Me([void 0],r[0].concat(this)))):new(e.bind.apply(e,Me([void 0],r.concat(this))))},e}(Array),Di=function(t){Dn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Me([void 0],r[0].concat(this)))):new(e.bind.apply(e,Me([void 0],r.concat(this))))},e}(Array);function Wt(t){return Y(t)?ct(t,function(){}):t}function Pi(t){return typeof t=="boolean"}function Mi(){return function(e){return ki(e)}}function ki(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,s=t.serializableCheck,a=s===void 0?!0:s,o=new Ii;if(r&&(Pi(r)?o.push(Kt):o.push(Kt.withExtraArgument(r.extraArgument))),0){if(i)var l;if(a)var c}return o}var Gt=!0;function Pn(t){var e=Mi(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?e():s,o=r.devTools,l=o===void 0?!0:o,c=r.preloadedState,f=c===void 0?void 0:c,h=r.enhancers,p=h===void 0?void 0:h,v;if(typeof i=="function")v=i;else if(Ri(i))v=wn(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 y=a;if(typeof y=="function"&&(y=y(e),!Gt&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Gt&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=On.apply(void 0,y),w=Pe;l&&(w=_i(ue({trace:!Gt},typeof l=="object"&&l)));var S=new Di(m),E=S;Array.isArray(p)?E=Me([m],p):typeof p=="function"&&(E=p(S));var C=w.apply(void 0,E);return Vt(v,f,C)}function ce(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ue(ue({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function Mn(t){var e={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(o in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return t(i),[e,r,n]}function Li(t){return typeof t=="function"}function Ni(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?Mn(e):[e,r,n],s=i[0],a=i[1],o=i[2],l;if(Li(t))l=function(){return Wt(t())};else{var c=Wt(t);l=function(){return c}}function f(h,p){h===void 0&&(h=l());var v=Me([s[p.type]],a.filter(function(y){var m=y.matcher;return m(p)}).map(function(y){var m=y.reducer;return m}));return v.filter(function(y){return!!y}).length===0&&(v=[o]),v.reduce(function(y,m){if(m)if(ee(y)){var w=y,S=m(w,p);return S===void 0?y:S}else{if(Y(y))return ct(y,function(E){return m(E,p)});var S=m(y,p);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}return y},h)}return f.getInitialState=l,f}function Fi(t,e){return t+"/"+e}function kn(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:Wt(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(f){var h=n[f],p=Fi(e,f),v,y;"reducer"in h?(v=h.reducer,y=h.prepare):v=h,s[f]=v,a[p]=v,o[f]=y?ce(p,y):ce(p)});function l(){var f=typeof t.extraReducers=="function"?Mn(t.extraReducers):[t.extraReducers],h=f[0],p=h===void 0?{}:h,v=f[1],y=v===void 0?[]:v,m=f[2],w=m===void 0?void 0:m,S=ue(ue({},p),a);return Ni(r,function(E){for(var C in S)E.addCase(C,S[C]);for(var x=0,k=y;x<k.length;x++){var W=k[x];E.addMatcher(W.matcher,W.reducer)}w&&E.addDefaultCase(w)})}var c;return{name:e,reducer:function(f,h){return c||(c=l()),c(f,h)},actions:o,caseReducers:s,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var Ui="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ji=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Ui[Math.random()*64|0];return e},Bi=["name","message","stack","code"],$t=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Rn=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),qi=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Bi;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},Ao=function(){function t(e,r,n){var i=ce(e+"/fulfilled",function(f,h,p,v){return{payload:f,meta:zt(ue({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=ce(e+"/pending",function(f,h,p){return{payload:void 0,meta:zt(ue({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),a=ce(e+"/rejected",function(f,h,p,v,y){return{payload:v,error:(n&&n.serializeError||qi)(f||"Rejected"),meta:zt(ue({},y||{}),{arg:p,requestId:h,rejectedWithValue:!!v,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"})}}),o=!1,l=typeof AbortController<"u"?AbortController:function(){function f(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return f.prototype.abort=function(){},f}();function c(f){return function(h,p,v){var y=n?.idGenerator?n.idGenerator(f):ji(),m=new l,w,S=!1;function E(x){w=x,m.abort()}var C=function(){return Ci(this,null,function(){var x,k,W,le,q,de,Ee;return Ei(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),le=(x=n?.condition)==null?void 0:x.call(n,f,{getState:p,extra:v}),Vi(le)?[4,le]:[3,2];case 1:le=u.sent(),u.label=2;case 2:if(le===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,q=new Promise(function(d,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),h(s(y,f,(k=n?.getPendingMeta)==null?void 0:k.call(n,{requestId:y,arg:f},{getState:p,extra:v}))),[4,Promise.race([q,Promise.resolve(r(f,{dispatch:h,getState:p,extra:v,requestId:y,signal:m.signal,abort:E,rejectWithValue:function(d,b){return new $t(d,b)},fulfillWithValue:function(d,b){return new Rn(d,b)}})).then(function(d){if(d instanceof $t)throw d;return d instanceof Rn?i(d.payload,y,f,d.meta):i(d,y,f)})])];case 3:return W=u.sent(),[3,5];case 4:return de=u.sent(),W=de instanceof $t?a(null,y,f,de.payload,de.meta):a(de,y,f),[3,5];case 5:return Ee=n&&!n.dispatchConditionRejection&&a.match(W)&&W.meta.condition,Ee||h(W),[2,W]}})})}();return Object.assign(C,{abort:E,requestId:y,arg:f,unwrap:function(){return C.then(Hi)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Hi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Vi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Ln="listener",Nn="completed",Fn="cancelled",wo="task-"+Fn,Oo="task-"+Nn,xo=Ln+"-"+Fn,To=Ln+"-"+Nn;var Qt="listenerMiddleware";var Co=ce(Qt+"/add"),_o=ce(Qt+"/removeAll"),Ro=ce(Qt+"/remove");var In,Io=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(In||(In=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ki=function(t){return function(e){setTimeout(e,t)}},Do=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ki(10);yn();function zi(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}var dt=class extends zi(Object){};window.ftReduxStores||(window.ftReduxStores={});var Un=class t extends dt{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(st(s))return s;if(i==null)return;let a=kn({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=Pn({reducer:(l,c)=>c.type==="CLEAR_FT_REDUX_STORE"?a.getInitialState():typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__")?{...l,...c.overwrites}:a.reducer(l,c)});return window.ftReduxStores[i.name]=new t(a,o,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new tt;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let l=a,c=s[l];return c?(...f)=>{let h=c(...f.map(i));return this.reduxStore.dispatch(h),h}:f=>{this.setState({[l]:i(f)})}}}),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 pt=O(N());var ft=class extends j{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=g.getState().session;return!!e?.sessionAuthenticated}};var ht=class extends j{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=g.getState().session;return!!e?.sessionAuthenticated}};var $i="ft-user-assets",Wi={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(pe).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}}},V=pt.FtReduxStore.get({name:$i,reducers:Wi,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(pe).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Yt=class{constructor(e=new ft,r=new ht){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=g.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new We,this.savedSearchesService=new Ye,g.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=g.getState();(0,pt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),V.actions.clearAssetCount(),V.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),V.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),V.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();V.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();V.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&V.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&V.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(V.getState().assetCounts.bookmarkByMap).length!==0;e===pe.BOOKMARKS&&r&&V.actions.clearBookmarkCountByMap(),V.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}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;V.actions.bookmarks(r)}}},Xt=new Yt;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Xt);(0,jn.customElement)("ft-app-context")(_);var yt=class extends j{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}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())}async getConfiguration(){return this.cache.get("search-configuration")}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))}};var Qi=t=>t.request.virtualField===xe.TITLE_ONLY&&t.request.scope===Te.DOCUMENTS,mt=class t extends Event{constructor(){super(t.eventName)}};mt.eventName="search-context-clear-all-filters";var Be=class t{static build(e,r){return new t(lr(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new K.Debouncer(10),this.searchDebouncer=new K.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 K.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>{var i;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(i=n.request.sort)!==null&&i!==void 0?i:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope}},this.service=r??new yt,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,K.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,K.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>this.store.actions.configuration(e)),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 s=a=>n.some(o=>o.lang==a);s(e)||(e=s(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)}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setSortId(e){var r;if(this.store.actions.setPageNumber(1),e==null||this.sortOptions.length==0)return this.store.actions.setRequestSortId(e),e;let n=(r=this.sortOptions.find(i=>i.id==e))!==null&&r!==void 0?r:this.sortOptions[0];return this.store.actions.setRequestSortId(n.id),n.id}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(xe.TITLE_ONLY),this.store.actions.setRequestScope(Te.DOCUMENTS)):(this.store.actions.setRequestVirtualField(xe.EVERYWHERE),this.store.actions.setRequestScope(Te.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Qi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new mt)}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}},s=[...n.filter(a=>!a.valueFilter),...n.filter(a=>a.valueFilter&&a.key!==i.key),i];this.setFilters(s)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},s=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==i.key),i];this.setFilters(s)}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,s={key:e,rangeFilter:{from:r,to:n}},a=[...i.filter(o=>!o.rangeFilter),...i.filter(o=>o.rangeFilter&&o.key!==s.key),s];this.setFilters(a)}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,s;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.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,K.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(this.store.actions.announcements(a.announcements),a.paging.currentPage<=1)this.store.actions.results(a.results),this.store.actions.facets(a.facets),this.store.actions.spellcheck(a.spellcheck);else{let o=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(a.results);this.store.actions.results(o),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(a.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(a.paging)}}catch(a){a instanceof K.CanceledPromiseError||(console.error(a),(s=this.errorHandler)===null||s===void 0||s.call(this,a))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=(0,K.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof K.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.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Yi=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},Zt=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Bn=Symbol("registerInterval"),Jt=Symbol("registerAttempts"),Xi=40;function Ji(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[Jt]=0,this[Bn]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Jt]>Xi?window.clearInterval(this[Bn]):(this[Jt]++,this.dispatchEvent(new Zt))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Yi([(0,Vn.state)()],e.prototype,"stateManager",void 0),e}var qn=class extends Ji(Hn.FtLitElementRedux){};var Kn=O(N());function vt(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function gt(t){var e;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values}}var bt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=n=>{if(!this.canSendEvent()||!n)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n):this.sendDocumentSearchEvent(i,n)},this.eventsService=r??new Xe,this.resultsWatcher=(0,Kn.watch)(e,n=>n.results,this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.convertToAnalyticsMap(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=g.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}convertToAnalyticsMap(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=g.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:vt(e.metadataFilters),facets:e.metadataFilters.map(i=>gt(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){if(e.metadataFilters.find(i=>{var s;return i.key==="ft:publicationId"&&((s=i.valueFilter)===null||s===void 0?void 0:s.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==ne.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:vt(n.metadataFilters),facets:n.metadataFilters.map(a=>gt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(s)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==ne.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:vt(n.metadataFilters),facets:n.metadataFilters.map(a=>gt(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(s)}convertDocument(e){switch(e.type){case ne.MAP:return{id:e.map.mapId,title:e.map.title,type:Oe.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case ne.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:Oe.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case ne.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:Oe.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r,n,i,s,a;return(s=(n=(r=e.map)===null||r===void 0?void 0:r.originUrl)!==null&&n!==void 0?n:(i=e.topic)===null||i===void 0?void 0:i.originUrl)!==null&&s!==void 0?s:(a=e.document)===null||a===void 0?void 0:a.originUrl}};var U=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},er=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},tr=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},rr=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},D=class extends $.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Be.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new bt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this.addStore(g)}render(){return zn.html`
|
|
6
|
+
`}connectedCallback(){super.connectedCallback(),v.addEventListener(ye.eventName,this.reloadConfiguration)}disconnectedCallback(){v.addEventListener(ye.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,i,s,a,o,l;super.update(e),e.has("baseUrl")&&(v.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&v.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&v.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&v.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&v.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&v.actions.noCustom(this.noCustom),e.has("editorMode")&&v.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&v.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&v.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>$r.addContext(c)),e.has("openExternalDocumentInNewTab")&&v.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&v.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&v.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(v.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),v.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),v.actions.searchInAllLanguagesAllowed((a=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&a!==void 0?a:!1)),e.has("authenticationRequired")&&v.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&v.actions.availableContentLocales((l=(o=this.availableContentLocales)===null||o===void 0?void 0:o.contentLocales)!==null&&l!==void 0?l:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}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())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Zr(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};_.elementDefinitions={};_.styles=Gr;M([(0,F.property)()],_.prototype,"baseUrl",void 0);M([(0,F.property)()],_.prototype,"apiIntegrationIdentifier",void 0);M([(0,F.property)()],_.prototype,"apiIntegrationAppVersion",void 0);M([(0,F.property)()],_.prototype,"uiLocale",void 0);M([(0,Q.jsonProperty)(null)],_.prototype,"availableUiLocales",void 0);M([(0,Q.jsonProperty)(null)],_.prototype,"metadataConfiguration",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"editorMode",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"noCustom",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"openExternalDocumentInNewTab",void 0);M([(0,F.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],_.prototype,"noCustomComponent",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"withManualResources",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"navigatorOnline",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"forcedOffline",void 0);M([(0,F.property)({type:Object})],_.prototype,"apiProvider",void 0);M([(0,F.property)({type:Boolean})],_.prototype,"authenticationRequired",void 0);M([(0,Q.jsonProperty)([])],_.prototype,"messageContexts",void 0);M([(0,Q.jsonProperty)(void 0)],_.prototype,"session",void 0);M([(0,F.state)()],_.prototype,"localesConfiguration",void 0);M([(0,F.state)()],_.prototype,"availableContentLocales",void 0);var tr=O(te());function hi(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!et(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(!et(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 s=a=>Object.keys(a).filter(o=>a[o]!=null);if(i=s(t),r=i.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;for(n=r;n--!==0;){let a=i[n];if(!et(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function et(t,e){try{return hi(t,e)}catch{return!1}}function Le(t,e){return!et(t,e)}function tt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let i=e(n);return i[t]=!0,i}}var tn=O(te(),1);var Dt=t=>{let e=t??{};return(r,n)=>{var i;let s={hasChanged:Le,attribute:!1,...e};(0,tn.property)(s)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:o=>o[n],store:e.store})}};var rt=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var _e=O(te(),1);var rn=O(te(),1);function nn(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,rn.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:Le,...e??{}})}var nt=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let a of n)try{await a()}catch(o){i(o);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var an=O(Ae(),1);var it=globalThis,pi=it.ShadowRoot&&(it.ShadyCSS===void 0||it.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ba=Symbol();var sn=(t,e)=>{if(pi)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=it.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var st=class extends an.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([i,s])=>e.registry.define(i,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return sn(n,e.elementStyles),n}};function on(t,e,...r){var n;let i=t.querySelector(e);for(let s of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return i}var Ne=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},dn,un=Symbol("constructorPrototype"),cn=Symbol("constructorName"),fn=Symbol("exportpartsDebouncer"),ln=Symbol("dynamicDependenciesLoaded"),Z=class extends st{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[dn]=new nt(5),this[cn]=this.constructor.name,this[un]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[cn]&&Object.setPrototypeOf(this,this[un])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(r){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",r)}let e=this.constructor;e[ln]||(e[ln]=!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:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let s=[...i??[],n];r=on(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}scheduleExportpartsUpdate(){var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[fn].run(()=>{var i,s;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(e){var r,n,i,s,a,o;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.removeAttribute("exportparts");return}let f=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let g=(s=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&s!==void 0?s:[],y=(o=(a=p.getAttribute("exportparts"))===null||a===void 0?void 0:a.split(",").map(m=>m.split(":")[1]))!==null&&o!==void 0?o:[];new Array(...g,...y).filter(l).map(m=>m.trim()).forEach(m=>f.add(m))}if(f.size===0){this.removeAttribute("exportparts");return}let h=[...f.values()].flatMap(p=>c.map(g=>`${p}:${g}--${p}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};dn=fn;Ne([(0,_e.property)()],Z.prototype,"exportpartsPrefix",void 0);Ne([nn([])],Z.prototype,"exportpartsPrefixes",void 0);Ne([(0,_e.property)()],Z.prototype,"customStylesheet",void 0);Ne([(0,_e.property)()],Z.prototype,"elementToFocus",void 0);Ne([(0,_e.state)()],Z.prototype,"useAdoptedStyleSheets",void 0);function at(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Fe=Symbol("internalReduxEventsUnsubscribers"),se=Symbol("internalStoresUnsubscribers"),ge=Symbol("internalStores"),yi=tt(Symbol("withRedux"),function(t){var e,r,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ge].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ge].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ge].get(a)}addStore(a,o){var l;o=(l=o??a.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(o),this[ge].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ge].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ge].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let l=this.constructor.getPropertyOptions(o);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:o)){let c=this.getStore(a.store);c&&(a.store?this[se].has(a.store):this[se].size>0)&&(this[o]=a.selector(c.getState(),this))}})}subscribeToStore(a,o){var l;this[se].set(a,o.subscribe(()=>this.updateFromStores())),this[Fe].set(a,[]),at(o)&&o.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((c,f)=>{if(typeof this[f]=="function"&&(!c.store||o.name===c.store)){let h=p=>this[f](p);o.addEventListener(c.eventName,h),this[Fe].get(a).push(()=>o.removeEventListener(c.eventName,h))}})),this.onStoreAvailable(a)}unsubscribeFromStores(){this[se].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[se].has(a)&&this[se].get(a)(),this[se].delete(a),(o=this[Fe].get(a))===null||o===void 0||o.forEach(l=>l()),this[Fe].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=se,r=ge,n=Fe,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),hn=class extends yi(Z){};function z(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,s;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map(function(a){return"'"+a+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ee(t){return!!t&&!!t[R]}function Y(t){var e;return!!t&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===wi}(t)||Array.isArray(t)||!!t[Sn]||!!(!((e=t.constructor)===null||e===void 0)&&e[Sn])||Bt(t)||qt(t))}function be(t,e,r){r===void 0&&(r=!1),De(t)===0?(r?Object.keys:Ie)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function De(t){var e=t[R];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:Bt(t)?2:qt(t)?3:0}function Re(t,e){return De(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function mi(t,e){return De(t)===2?t.get(e):t[e]}function En(t,e,r){var n=De(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function An(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function Bt(t){return Ei&&t instanceof Map}function qt(t){return Ai&&t instanceof Set}function ae(t){return t.o||t.t}function Ht(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=xn(t);delete e[R];for(var r=Ie(e),n=0;n<r.length;n++){var i=r[n],s=e[i];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[i]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Vt(t,e){return e===void 0&&(e=!1),Kt(t)||ee(t)||!Y(t)||(De(t)>1&&(t.set=t.add=t.clear=t.delete=vi),Object.freeze(t),e&&be(t,function(r,n){return Vt(n,!0)},!0)),t}function vi(){z(2)}function Kt(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function X(t){var e=jt[t];return e||z(18,t),e}function gi(t,e){jt[t]||(jt[t]=e)}function Nt(){return je}function Pt(t,e){e&&(X("Patches"),t.u=[],t.s=[],t.v=e)}function ot(t){Ft(t),t.p.forEach(bi),t.p=null}function Ft(t){t===je&&(je=t.l)}function pn(t){return je={p:[],l:je,h:t,m:!0,_:0}}function bi(t){var e=t[R];e.i===0||e.i===1?e.j():e.g=!0}function Mt(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||X("ES5").S(e,t,n),n?(r[R].P&&(ot(e),z(4)),Y(t)&&(t=ut(e,t),e.l||ct(e,t)),e.u&&X("Patches").M(r[R].t,t,e.u,e.s)):t=ut(e,r,[]),ot(e),e.u&&e.v(e.u,e.s),t!==On?t:void 0}function ut(t,e,r){if(Kt(e))return e;var n=e[R];if(!n)return be(e,function(o,l){return yn(t,n,e,o,l,r)},!0),e;if(n.A!==t)return e;if(!n.P)return ct(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ht(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),be(s,function(o,l){return yn(t,n,i,o,l,r,a)}),ct(t,i,!1),r&&t.u&&X("Patches").N(n,r,t.u,t.s)}return n.o}function yn(t,e,r,n,i,s,a){if(ee(i)){var o=ut(t,i,s&&e&&e.i!==3&&!Re(e.R,n)?s.concat(n):void 0);if(En(r,n,o),!ee(o))return;t.m=!1}else a&&r.add(i);if(Y(i)&&!Kt(i)){if(!t.h.D&&t._<1)return;ut(t,i),e&&e.A.l||ct(t,i)}}function ct(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Vt(e,r)}function kt(t,e){var r=t[R];return(r?ae(r):t)[e]}function mn(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function oe(t){t.P||(t.P=!0,t.l&&oe(t.l))}function Lt(t){t.o||(t.o=Ht(t.t))}function Ut(t,e,r){var n=Bt(e)?X("MapSet").F(e,r):qt(e)?X("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:Nt(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=o,c=Be;a&&(l=[o],c=Ue);var f=Proxy.revocable(l,c),h=f.revoke,p=f.proxy;return o.k=p,o.j=h,p}(e,r):X("ES5").J(e,r);return(r?r.A:Nt()).p.push(n),n}function Si(t){return ee(t)||z(22,t),function e(r){if(!Y(r))return r;var n,i=r[R],s=De(r);if(i){if(!i.P&&(i.i<4||!X("ES5").K(i)))return i.t;i.I=!0,n=vn(r,s),i.I=!1}else n=vn(r,s);return be(n,function(a,o){i&&mi(i.t,a)===o||En(n,a,e(o))}),s===3?new Set(n):n}(t)}function vn(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ht(t)}function wn(){function t(a,o){var l=s[a];return l?l.enumerable=o:s[a]=l={configurable:!0,enumerable:o,get:function(){var c=this[R];return Be.get(c,a)},set:function(c){var f=this[R];Be.set(f,a,c)}},l}function e(a){for(var o=a.length-1;o>=0;o--){var l=a[o][R];if(!l.P)switch(l.i){case 5:n(l)&&oe(l);break;case 4:r(l)&&oe(l)}}}function r(a){for(var o=a.t,l=a.k,c=Ie(l),f=c.length-1;f>=0;f--){var h=c[f];if(h!==R){var p=o[h];if(p===void 0&&!Re(o,h))return!0;var g=l[h],y=g&&g[R];if(y?y.t!==p:!An(g,p))return!0}}var m=!!o[R];return c.length!==Ie(o).length+(m?0:1)}function n(a){var o=a.k;if(o.length!==a.t.length)return!0;var l=Object.getOwnPropertyDescriptor(o,o.length-1);if(l&&!l.get)return!0;for(var c=0;c<o.length;c++)if(!o.hasOwnProperty(c))return!0;return!1}function i(a){a.g&&z(3,JSON.stringify(ae(a)))}var s={};gi("ES5",{J:function(a,o){var l=Array.isArray(a),c=function(h,p){if(h){for(var g=Array(p.length),y=0;y<p.length;y++)Object.defineProperty(g,""+y,t(y,!0));return g}var m=xn(p);delete m[R];for(var w=Ie(m),S=0;S<w.length;S++){var E=w[S];m[E]=t(E,h||!!m[E].enumerable)}return Object.create(Object.getPrototypeOf(p),m)}(l,a),f={i:l?5:4,A:o?o.A:Nt(),P:!1,I:!1,R:{},l:o,t:a,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,R,{value:f,writable:!0}),c},S:function(a,o,l){l?ee(o)&&o[R].A===a&&e(a.p):(a.u&&function c(f){if(f&&typeof f=="object"){var h=f[R];if(h){var p=h.t,g=h.k,y=h.R,m=h.i;if(m===4)be(g,function(x){x!==R&&(p[x]!==void 0||Re(p,x)?y[x]||c(g[x]):(y[x]=!0,oe(h)))}),be(p,function(x){g[x]!==void 0||Re(g,x)||(y[x]=!1,oe(h))});else if(m===5){if(n(h)&&(oe(h),y.length=!0),g.length<p.length)for(var w=g.length;w<p.length;w++)y[w]=!1;else for(var S=p.length;S<g.length;S++)y[S]=!0;for(var E=Math.min(g.length,p.length),C=0;C<E;C++)g.hasOwnProperty(C)||(y[C]=!0),y[C]===void 0&&c(g[C])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var gn,je,Gt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Ei=typeof Map<"u",Ai=typeof Set<"u",bn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",On=Gt?Symbol.for("immer-nothing"):((gn={})["immer-nothing"]=!0,gn),Sn=Gt?Symbol.for("immer-draftable"):"__$immer_draftable",R=Gt?Symbol.for("immer-state"):"__$immer_state";var wi=""+Object.prototype.constructor,Ie=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,xn=Object.getOwnPropertyDescriptors||function(t){var e={};return Ie(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},jt={},Be={get:function(t,e){if(e===R)return t;var r=ae(t);if(!Re(r,e))return function(i,s,a){var o,l=mn(s,a);return l?"value"in l?l.value:(o=l.get)===null||o===void 0?void 0:o.call(i.k):void 0}(t,r,e);var n=r[e];return t.I||!Y(n)?n:n===kt(t.t,e)?(Lt(t),t.o[e]=Ut(t.A.h,n,t)):n},has:function(t,e){return e in ae(t)},ownKeys:function(t){return Reflect.ownKeys(ae(t))},set:function(t,e,r){var n=mn(ae(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=kt(ae(t),e),s=i?.[R];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(An(r,i)&&(r!==void 0||Re(t.t,e)))return!0;Lt(t),oe(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return kt(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,Lt(t),oe(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ae(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){z(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){z(12)}},Ue={};be(Be,function(t,e){Ue[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Ue.deleteProperty=function(t,e){return Ue.set.call(this,t,e,void 0)},Ue.set=function(t,e,r){return Be.set.call(this,t[0],e,r,t[0])};var Oi=function(){function t(r){var n=this;this.O=bn,this.D=!0,this.produce=function(i,s,a){if(typeof i=="function"&&typeof s!="function"){var o=s;s=i;var l=n;return function(m){var w=this;m===void 0&&(m=o);for(var S=arguments.length,E=Array(S>1?S-1:0),C=1;C<S;C++)E[C-1]=arguments[C];return l.produce(m,function(x){var L;return(L=s).call.apply(L,[w,x].concat(E))})}}var c;if(typeof s!="function"&&z(6),a!==void 0&&typeof a!="function"&&z(7),Y(i)){var f=pn(n),h=Ut(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?ot(f):Ft(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return Pt(f,a),Mt(m,f)},function(m){throw ot(f),m}):(Pt(f,a),Mt(c,f))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===On&&(c=void 0),n.D&&Vt(c,!0),a){var g=[],y=[];X("Patches").M(i,c,g,y),a(g,y)}return c}z(21,i)},this.produceWithPatches=function(i,s){if(typeof i=="function")return function(c){for(var f=arguments.length,h=Array(f>1?f-1:0),p=1;p<f;p++)h[p-1]=arguments[p];return n.produceWithPatches(c,function(g){return i.apply(void 0,[g].concat(h))})};var a,o,l=n.produce(i,s,function(c,f){a=c,o=f});return typeof Promise<"u"&&l instanceof Promise?l.then(function(c){return[c,a,o]}):[l,a,o]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){Y(r)||z(8),ee(r)&&(r=Si(r));var n=pn(this),i=Ut(this,r,void 0);return i[R].C=!0,Ft(n),i},e.finishDraft=function(r,n){var i=r&&r[R],s=i.A;return Pt(s,n),Mt(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!bn&&z(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var s=n[i];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}i>-1&&(n=n.slice(i+1));var a=X("Patches").$;return ee(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),H=new Oi,xi=H.produce,to=H.produceWithPatches.bind(H),ro=H.setAutoFreeze.bind(H),no=H.setUseProxies.bind(H),io=H.applyPatches.bind(H),so=H.createDraft.bind(H),ao=H.finishDraft.bind(H),lt=xi;function Se(t){"@babel/helpers - typeof";return Se=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},Se(t)}function Tn(t,e){if(Se(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Se(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Cn(t){var e=Tn(t,"string");return Se(e)=="symbol"?e:e+""}function _n(t,e,r){return(e=Cn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function zt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Rn(Object(r),!0).forEach(function(n){_n(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Rn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B(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 In=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),$t=function(){return Math.random().toString(36).substring(7).split("").join(".")},dt={INIT:"@@redux/INIT"+$t(),REPLACE:"@@redux/REPLACE"+$t(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+$t()}};function Ti(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 Wt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(B(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(B(1));return r(Wt)(t,e)}if(typeof t!="function")throw new Error(B(2));var i=t,s=e,a=[],o=a,l=!1;function c(){o===a&&(o=a.slice())}function f(){if(l)throw new Error(B(3));return s}function h(m){if(typeof m!="function")throw new Error(B(4));if(l)throw new Error(B(5));var w=!0;return c(),o.push(m),function(){if(w){if(l)throw new Error(B(6));w=!1,c();var E=o.indexOf(m);o.splice(E,1),a=null}}}function p(m){if(!Ti(m))throw new Error(B(7));if(typeof m.type>"u")throw new Error(B(8));if(l)throw new Error(B(9));try{l=!0,s=i(s,m)}finally{l=!1}for(var w=a=o,S=0;S<w.length;S++){var E=w[S];E()}return m}function g(m){if(typeof m!="function")throw new Error(B(10));i=m,p({type:dt.REPLACE})}function y(){var m,w=h;return m={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(B(11));function C(){E.next&&E.next(f())}C();var x=w(C);return{unsubscribe:x}}},m[In]=function(){return this},m}return p({type:dt.INIT}),n={dispatch:p,subscribe:h,getState:f,replaceReducer:g},n[In]=y,n}function Ci(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:dt.INIT});if(typeof n>"u")throw new Error(B(12));if(typeof r(void 0,{type:dt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(B(13))})}function Dn(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var s=Object.keys(r),a,o;try{Ci(r)}catch(l){o=l}return function(c,f){if(c===void 0&&(c={}),o)throw o;if(0)var h;for(var p=!1,g={},y=0;y<s.length;y++){var m=s[y],w=r[m],S=c[m],E=w(S,f);if(typeof E>"u"){var C=f&&f.type;throw new Error(B(14))}g[m]=E,p=p||E!==S}return p=p||s.length!==Object.keys(c).length,p?g:c}}function Pe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];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 Pn(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),s=function(){throw new Error(B(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(l){return l(a)});return s=Pe.apply(void 0,o)(i.dispatch),zt(zt({},i),{},{dispatch:s})}}}function Mn(t){var e=function(n){var i=n.dispatch,s=n.getState;return function(a){return function(o){return typeof o=="function"?o(i,s,t):a(o)}}};return e}var kn=Mn();kn.withExtraArgument=Mn;var Qt=kn;var jn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(n[s]=i[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),_i=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,a;return a={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(f){return l([c,f])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){r.label=c[1];break}if(c[0]===6&&r.label<s[1]){r.label=s[1],s=c;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(c);break}s[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(f){c=[6,f],i=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Me=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},Ri=Object.defineProperty,Ii=Object.defineProperties,Di=Object.getOwnPropertyDescriptors,Ln=Object.getOwnPropertySymbols,Pi=Object.prototype.hasOwnProperty,Mi=Object.prototype.propertyIsEnumerable,Nn=function(t,e,r){return e in t?Ri(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ue=function(t,e){for(var r in e||(e={}))Pi.call(e,r)&&Nn(t,r,e[r]);if(Ln)for(var n=0,i=Ln(e);n<i.length;n++){var r=i[n];Mi.call(e,r)&&Nn(t,r,e[r])}return t},Yt=function(t,e){return Ii(t,Di(e))},ki=function(t,e,r){return new Promise(function(n,i){var s=function(l){try{o(r.next(l))}catch(c){i(c)}},a=function(l){try{o(r.throw(l))}catch(c){i(c)}},o=function(l){return l.done?n(l.value):Promise.resolve(l.value).then(s,a)};o((r=r.apply(t,e)).next())})};var Li=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Pe:Pe.apply(null,arguments)},xo=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ni(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Fi=function(t){jn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Me([void 0],r[0].concat(this)))):new(e.bind.apply(e,Me([void 0],r.concat(this))))},e}(Array),Ui=function(t){jn(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||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 r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,Me([void 0],r[0].concat(this)))):new(e.bind.apply(e,Me([void 0],r.concat(this))))},e}(Array);function Zt(t){return Y(t)?lt(t,function(){}):t}function ji(t){return typeof t=="boolean"}function Bi(){return function(e){return qi(e)}}function qi(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,s=t.serializableCheck,a=s===void 0?!0:s,o=new Fi;if(r&&(ji(r)?o.push(Qt):o.push(Qt.withExtraArgument(r.extraArgument))),0){if(i)var l;if(a)var c}return o}var Xt=!0;function Bn(t){var e=Bi(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,s=r.middleware,a=s===void 0?e():s,o=r.devTools,l=o===void 0?!0:o,c=r.preloadedState,f=c===void 0?void 0:c,h=r.enhancers,p=h===void 0?void 0:h,g;if(typeof i=="function")g=i;else if(Ni(i))g=Dn(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 y=a;if(typeof y=="function"&&(y=y(e),!Xt&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Xt&&y.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=Pn.apply(void 0,y),w=Pe;l&&(w=Li(ue({trace:!Xt},typeof l=="object"&&l)));var S=new Ui(m),E=S;Array.isArray(p)?E=Me([m],p):typeof p=="function"&&(E=p(S));var C=w.apply(void 0,E);return Wt(g,f,C)}function ce(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return ue(ue({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}function qn(t){var e={},r=[],n,i={addCase:function(s,a){var o=typeof s=="string"?s:s.type;if(o in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[o]=a,i},addMatcher:function(s,a){return r.push({matcher:s,reducer:a}),i},addDefaultCase:function(s){return n=s,i}};return t(i),[e,r,n]}function Hi(t){return typeof t=="function"}function Vi(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?qn(e):[e,r,n],s=i[0],a=i[1],o=i[2],l;if(Hi(t))l=function(){return Zt(t())};else{var c=Zt(t);l=function(){return c}}function f(h,p){h===void 0&&(h=l());var g=Me([s[p.type]],a.filter(function(y){var m=y.matcher;return m(p)}).map(function(y){var m=y.reducer;return m}));return g.filter(function(y){return!!y}).length===0&&(g=[o]),g.reduce(function(y,m){if(m)if(ee(y)){var w=y,S=m(w,p);return S===void 0?y:S}else{if(Y(y))return lt(y,function(E){return m(E,p)});var S=m(y,p);if(S===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return S}return y},h)}return f.getInitialState=l,f}function Ki(t,e){return t+"/"+e}function Hn(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:Zt(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(f){var h=n[f],p=Ki(e,f),g,y;"reducer"in h?(g=h.reducer,y=h.prepare):g=h,s[f]=g,a[p]=g,o[f]=y?ce(p,y):ce(p)});function l(){var f=typeof t.extraReducers=="function"?qn(t.extraReducers):[t.extraReducers],h=f[0],p=h===void 0?{}:h,g=f[1],y=g===void 0?[]:g,m=f[2],w=m===void 0?void 0:m,S=ue(ue({},p),a);return Vi(r,function(E){for(var C in S)E.addCase(C,S[C]);for(var x=0,L=y;x<L.length;x++){var W=L[x];E.addMatcher(W.matcher,W.reducer)}w&&E.addDefaultCase(w)})}var c;return{name:e,reducer:function(f,h){return c||(c=l()),c(f,h)},actions:o,caseReducers:s,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var Gi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zi=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Gi[Math.random()*64|0];return e},$i=["name","message","stack","code"],Jt=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Fn=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Wi=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=$i;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},Ro=function(){function t(e,r,n){var i=ce(e+"/fulfilled",function(f,h,p,g){return{payload:f,meta:Yt(ue({},g||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=ce(e+"/pending",function(f,h,p){return{payload:void 0,meta:Yt(ue({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),a=ce(e+"/rejected",function(f,h,p,g,y){return{payload:g,error:(n&&n.serializeError||Wi)(f||"Rejected"),meta:Yt(ue({},y||{}),{arg:p,requestId:h,rejectedWithValue:!!g,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"})}}),o=!1,l=typeof AbortController<"u"?AbortController:function(){function f(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return f.prototype.abort=function(){},f}();function c(f){return function(h,p,g){var y=n?.idGenerator?n.idGenerator(f):zi(),m=new l,w,S=!1;function E(x){w=x,m.abort()}var C=function(){return ki(this,null,function(){var x,L,W,le,q,de,Ee;return _i(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),le=(x=n?.condition)==null?void 0:x.call(n,f,{getState:p,extra:g}),Yi(le)?[4,le]:[3,2];case 1:le=u.sent(),u.label=2;case 2:if(le===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,q=new Promise(function(d,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),h(s(y,f,(L=n?.getPendingMeta)==null?void 0:L.call(n,{requestId:y,arg:f},{getState:p,extra:g}))),[4,Promise.race([q,Promise.resolve(r(f,{dispatch:h,getState:p,extra:g,requestId:y,signal:m.signal,abort:E,rejectWithValue:function(d,b){return new Jt(d,b)},fulfillWithValue:function(d,b){return new Fn(d,b)}})).then(function(d){if(d instanceof Jt)throw d;return d instanceof Fn?i(d.payload,y,f,d.meta):i(d,y,f)})])];case 3:return W=u.sent(),[3,5];case 4:return de=u.sent(),W=de instanceof Jt?a(null,y,f,de.payload,de.meta):a(de,y,f),[3,5];case 5:return Ee=n&&!n.dispatchConditionRejection&&a.match(W)&&W.meta.condition,Ee||h(W),[2,W]}})})}();return Object.assign(C,{abort:E,requestId:y,arg:f,unwrap:function(){return C.then(Qi)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Qi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Yi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Vn="listener",Kn="completed",Gn="cancelled",Io="task-"+Gn,Do="task-"+Kn,Po=Vn+"-"+Gn,Mo=Vn+"-"+Kn;var er="listenerMiddleware";var ko=ce(er+"/add"),Lo=ce(er+"/removeAll"),No=ce(er+"/remove");var Un,Fo=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Un||(Un=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Xi=function(t){return function(e){setTimeout(e,t)}},Uo=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Xi(10);wn();var Ji=tt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),ft=class extends Ji(Object){};window.ftReduxStores||(window.ftReduxStores={});var zn=class t extends ft{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(at(s))return s;if(i==null)return;let a=Hn({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=Bn({reducer:(l,c)=>c.type==="CLEAR_FT_REDUX_STORE"?a.getInitialState():typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__")?{...l,...c.overwrites}:a.reducer(l,c)});return window.ftReduxStores[i.name]=new t(a,o,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new rt;let i=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,a,o)=>{let l=a,c=s[l];return c?(...f)=>{let h=c(...f.map(i));return this.reduxStore.dispatch(h),h}:f=>{this.setState({[l]:i(f)})}}}),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 ht=class{static format(e,r,n,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(e,r,n,i)}static getMomentDateFormat(e,r){return e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,i){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(s);if(!i)return a;let o=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return`${a} ${o}`}};var $n=O(k()),pt=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},uu=(0,$n.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(v)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,s;return((s=(i=this.metadataDescriptors.find(o=>o.key===n))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1)?o=>ht.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return pt([(0,tr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),pt([(0,tr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),pt([Dt({store:v.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),pt([Dt({store:v.name})],e.prototype,"uiLocale",void 0),e});var vt=O(k());var yt=class extends j{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var mt=class extends j{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=v.getState().session;return!!e?.sessionAuthenticated}};var Zi="ft-user-assets",es={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(pe).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}}},V=vt.FtReduxStore.get({name:Zi,reducers:es,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(pe).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),rr=class{constructor(e=new yt,r=new mt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=v.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Qe,this.savedSearchesService=new Xe,v.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=v.getState();(0,vt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),V.actions.clearAssetCount(),V.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),V.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),V.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();V.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();V.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&V.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&V.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(V.getState().assetCounts.bookmarkByMap).length!==0;e===pe.BOOKMARKS&&r&&V.actions.clearBookmarkCountByMap(),V.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}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;V.actions.bookmarks(r)}}},nr=new rr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=nr);(0,Wn.customElement)("ft-app-context")(_);var gt=class extends j{constructor(e){super(!0,e),this.cache.registerFinal("search-configuration",async()=>(await this.awaitApi).getSearchConfiguration())}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())}async getConfiguration(){return this.cache.get("search-configuration")}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))}};var ts=t=>t.request.virtualField===xe.TITLE_ONLY&&t.request.scope===Te.DOCUMENTS,bt=class t extends Event{constructor(){super(t.eventName)}};bt.eventName="search-context-clear-all-filters";var qe=class t{static build(e,r){return new t(mr(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new K.Debouncer(10),this.searchDebouncer=new K.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 K.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>{var i;return{input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:(i=n.request.sort)!==null&&i!==void 0?i:[],sortId:n.request.sortId,contentLocale:n.request.contentLocale,scope:n.request.scope}},this.service=r??new gt,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,K.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,K.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.service.getConfiguration().then(e=>{this.store.actions.configuration(e),this.setSortId(this.store.getState().request.sortId)}),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 s=a=>n.some(o=>o.lang==a);s(e)||(e=s(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)}get sortOptions(){var e,r;return(r=(e=this.store.getState().configuration)===null||e===void 0?void 0:e.sortOptions)!==null&&r!==void 0?r:[]}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setSortId(e){var r;if(this.store.actions.setPageNumber(1),e==null||this.sortOptions.length==0)return this.store.actions.setRequestSortId(e),e;let n=(r=this.sortOptions.find(i=>i.id==e))!==null&&r!==void 0?r:this.sortOptions[0];return this.store.actions.setRequestSortId(n.id),n.id}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(xe.TITLE_ONLY),this.store.actions.setRequestScope(Te.DOCUMENTS)):(this.store.actions.setRequestVirtualField(xe.EVERYWHERE),this.store.actions.setRequestScope(Te.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return ts(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new bt)}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}},s=[...n.filter(a=>!a.valueFilter),...n.filter(a=>a.valueFilter&&a.key!==i.key),i];this.setFilters(s)}setDateFilter(e,r){let n=this.store.getState().request.metadataFilters,i={key:e,dateFilter:{type:r}},s=[...n.filter(a=>!a.dateFilter),...n.filter(a=>a.dateFilter&&a.key!==i.key),i];this.setFilters(s)}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,s={key:e,rangeFilter:{from:r,to:n}},a=[...i.filter(o=>!o.rangeFilter),...i.filter(o=>o.rangeFilter&&o.key!==s.key),s];this.setFilters(a)}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,s;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.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,K.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(this.store.actions.announcements(a.announcements),a.paging.currentPage<=1)this.store.actions.results(a.results),this.store.actions.facets(a.facets),this.store.actions.spellcheck(a.spellcheck);else{let o=((n=this.store.getState().results)!==null&&n!==void 0?n:[]).concat(a.results);this.store.actions.results(o),this.store.commands.clear(/^focus-result-/),this.store.commands.add({type:`focus-result-${(a.paging.currentPage-1)*((i=e.paging.perPage)!==null&&i!==void 0?i:20)+1}`})}this.store.actions.paging(a.paging)}}catch(a){a instanceof K.CanceledPromiseError||(console.error(a),(s=this.errorHandler)===null||s===void 0||s.call(this,a))}}async fetchSuggestData(e){var r;try{(r=this.cancelableSuggest)===null||r===void 0||r.cancel(),this.cancelableSuggest=(0,K.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof K.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.announcements(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var rs=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},sr=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Qn=Symbol("registerInterval"),ir=Symbol("registerAttempts"),ns=40,is=(0,St.applyMixinOnce)(Symbol("toFtSearchComponent"),function(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[ir]=0,this[Qn]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[ir]>ns?window.clearInterval(this[Qn]):(this[ir]++,this.dispatchEvent(new sr))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return rs([(0,Xn.state)()],e.prototype,"stateManager",void 0),e}),Yn=class extends is(St.FtLitElementRedux){};var Jn=O(k());function Et(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function At(t){var e;return t.dateFilter?{key:t.key,type:"DATE",dateValue:t.dateFilter.type}:t.rangeFilter?{key:t.key,type:"RANGE",from:t.rangeFilter.from,to:t.rangeFilter.to}:{key:t.key,values:(e=t.valueFilter)===null||e===void 0?void 0:e.values}}var wt=class{constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.enableAnalyticsEvents=!0,this.appName=void 0,this.appVersion=void 0,this.document=void 0,this.sendEvent=n=>{if(!this.canSendEvent()||!n)return;let i=this.store.getState().request;this.document==null?this.sendKhubSearchEvent(i,n):this.sendDocumentSearchEvent(i,n)},this.eventsService=r??new Je,this.resultsWatcher=(0,Jn.watch)(e,n=>n.results,this.sendEvent)}setEnableAnalyticsEvents(e){this.enableAnalyticsEvents=e}setAppName(e){this.appName=e}setAppVersion(e){this.appVersion=e}setDocumentSearch(e){this.document=e}setDocumentSearchFromMap(e){this.setDocumentSearch(this.convertToAnalyticsMap(e))}initAppInfo(){let{apiIntegrationIdentifier:e,apiIntegrationAppVersion:r}=v.getState();this.setAppName(e??"unknown"),this.setAppVersion(r??"unknown")}convertToAnalyticsMap(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}canSendEvent(){if(this.appName==null||this.appVersion==null)return console.debug("ft-search-context.eventManager is not initialized. No events will be sent!"),!1;let{editorMode:e}=v.getState();return this.enableAnalyticsEvents&&!e}sendKhubSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Et(e.metadataFilters),facets:e.metadataFilters.map(i=>At(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){if(e.metadataFilters.find(i=>{var s;return i.key==="ft:publicationId"&&((s=i.valueFilter)===null||s===void 0?void 0:s.values[0])===this.document.id})!==void 0){let i={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query},document:this.document};this.eventsService.sendDocumentSearchEvent(i)}}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==ne.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Et(n.metadataFilters),facets:n.metadataFilters.map(a=>At(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchPageSelectEvent(s)}sendResultContextMenuOpenedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==ne.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:he.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Et(n.metadataFilters),facets:n.metadataFilters.map(a=>At(a))},searchResult:{rank:r,type:e.type,document:this.convertDocument(e),topic:i},externalLink:this.convertExternalLink(e)};this.eventsService.sendSearchResultOpenContextMenuEvent(s)}convertDocument(e){switch(e.type){case ne.MAP:return{id:e.map.mapId,title:e.map.title,type:Oe.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case ne.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:Oe.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case ne.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:Oe.UNSTRUCTURED_DOCUMENT,metadata:e.document.metadata,mimeType:e.document.mimeType};default:throw new TypeError("Unknown type "+e.type)}}convertExternalLink(e){var r,n,i,s,a;return(s=(n=(r=e.map)===null||r===void 0?void 0:r.originUrl)!==null&&n!==void 0?n:(i=e.topic)===null||i===void 0?void 0:i.originUrl)!==null&&s!==void 0?s:(a=e.document)===null||a===void 0?void 0:a.originUrl}};var U=function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(s=(i<3?a(s):i>3?a(e,r,s):a(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},ar=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},or=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},ur=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},D=class extends $.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=qe.build(this.id||(""+Math.round(Math.random()*999e3)).padStart(6,"0"),e),this._stateManager.errorHandler=r=>this.handleLoadError(r),this.addStore(this.stateManager.store,"search")}return this._stateManager}get eventManager(){return this._eventManager==null&&(this._eventManager=new wt(this.stateManager.store)),this._eventManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.otherQueryParams={},this.addStore(v)}render(){return Zn.html`
|
|
7
7
|
<slot @register-ft-search-component="${this.registerComponent}" @ft-search-result-click="${this.onResultClicked}"
|
|
8
8
|
@ft-search-result-open-context-menu="${this.onResultContextMenuOpened}"></slot>
|
|
9
|
-
`}willUpdate(e){super.willUpdate(e),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSortId(this.sortId),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new
|
|
9
|
+
`}willUpdate(e){super.willUpdate(e),e.has("query")&&this.query!==void 0&&this.stateManager.setQuery(this.query),e.has("contentLocale")&&this.contentLocale!==void 0&&this.stateManager.forceContentLocale(this.contentLocale),e.has("filters")&&this.filters!==void 0&&this.stateManager.setFilters(this.filters),e.has("sortId")&&this.stateManager.setSortId(this.sortId),e.has("sort")&&this.sort!==void 0&&this.stateManager.setSort(this.sort),e.has("pageSize")&&this.pageSize!==void 0&&this.stateManager.setPageSize(this.pageSize),e.has("searchInDocumentTitlesOnly")&&this.searchInDocumentTitlesOnly!==void 0&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),e.has("scope")&&this.scope!==void 0&&this.stateManager.setScope(this.scope),e.has("virtualField")&&this.virtualField!==void 0&&this.stateManager.setVirtualField(this.virtualField),e.has("ignoreEmptyQuery")&&this.ignoreEmptyQuery!==void 0&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),e.has("openExternalDocumentInNewTab")&&this.openExternalDocumentInNewTab!==void 0&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("otherQueryParams")&&this.otherQueryParams!==void 0&&this.stateManager.setOtherQueryParams(this.otherQueryParams),e.has("session")&&this.session!==void 0&&e.get("session")!=null&&(this.stateManager.service.clearCache(),this.stateManager.initService())}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.stateManager.clearResults(),this.stateManager.setQuery(this.query),this.stateManager.forceContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSortId(this.sortId),this.stateManager.setSort(this.sort),this.stateManager.setOtherQueryParams(this.otherQueryParams)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.clearResults()}contentAvailableCallback(e){super.contentAvailableCallback(e),e.has("request")&&this.request&&this.dispatchEvent(new or(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new ur(this.request,this.paging,this.autocorrect))}registerComponent(e){e.stopPropagation();let r=e.composedPath()[0];this.register(r)}register(e){e.setSearchStateManager(this.stateManager)}handleLoadError(e){this.dispatchEvent(new ar(e))}reloadSavedSearches(){nr.clearMySearches()}clear(){this.stateManager.clear()}onResultClicked(e){this.eventManager.sendResultClickedEvent(e.detail.result,e.detail.rank)}onResultContextMenuOpened(e){this.eventManager.sendResultContextMenuOpenedEvent(e.detail.result,e.detail.rank)}};D.elementDefinitions={};D.styles=yr;U([(0,$.redux)({store:v.name})],D.prototype,"session",void 0);U([(0,J.property)()],D.prototype,"query",void 0);U([(0,J.property)()],D.prototype,"contentLocale",void 0);U([(0,J.property)({type:Number})],D.prototype,"pageSize",void 0);U([(0,J.property)({type:Boolean})],D.prototype,"searchInDocumentTitlesOnly",void 0);U([(0,J.property)()],D.prototype,"scope",void 0);U([(0,J.property)()],D.prototype,"virtualField",void 0);U([(0,J.property)({type:Boolean})],D.prototype,"ignoreEmptyQuery",void 0);U([(0,$.redux)({store:v.name})],D.prototype,"openExternalDocumentInNewTab",void 0);U([(0,$.jsonProperty)([])],D.prototype,"filters",void 0);U([(0,J.property)()],D.prototype,"sortId",void 0);U([(0,$.jsonProperty)([])],D.prototype,"sort",void 0);U([(0,$.jsonProperty)({})],D.prototype,"otherQueryParams",void 0);U([(0,$.redux)({store:"search"})],D.prototype,"request",void 0);U([(0,$.redux)({store:"search"})],D.prototype,"paging",void 0);U([(0,$.redux)({store:"search",selector:t=>t.spellcheck})],D.prototype,"autocorrect",void 0);U([(0,J.property)({attribute:!1})],D.prototype,"searchServiceProvider",void 0);(0,ei.customElement)("ft-search-context")(D);})();
|
|
10
10
|
/*! Bundled license information:
|
|
11
11
|
|
|
12
12
|
@lit/reactive-element/css-tag.js:
|