@fluid-topics/ft-search-context 1.2.67 → 1.2.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,12 @@
1
- "use strict";(()=>{var Vn=Object.create;var er=Object.defineProperty;var Hn=Object.getOwnPropertyDescriptor;var Kn=Object.getOwnPropertyNames;var zn=Object.getPrototypeOf,Gn=Object.prototype.hasOwnProperty;var He=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var $n=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Kn(e))!Gn.call(t,i)&&i!==r&&er(t,i,{get:()=>e[i],enumerable:!(n=Hn(e,i))||n.enumerable});return t};var x=(t,e,r)=>(r=t!=null?Vn(zn(t)):{},$n(e||!t||!t.__esModule?er(r,"default",{value:t,enumerable:!0}):r,t));var M=He(($i,tr)=>{tr.exports=ftGlobals.wcUtils});var be=He((Wi,rr)=>{rr.exports=ftGlobals.lit});var ee=He((Qi,nr)=>{nr.exports=ftGlobals.litDecorators});var ur=He((te,or)=>{var ze=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Ge=function(){function t(){this.fetch=!1,this.DOMException=ze.DOMException}return t.prototype=ze,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 v(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=v(d);return d.readAsArrayBuffer(u),b}function m(u){var d=new FileReader,b=v(d),T=/charset=([A-Za-z0-9_-]+)/.exec(u.type),R=T?T[1]:"utf-8";return d.readAsText(u,R),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(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function O(u){var d=u.toUpperCase();return _.indexOf(d)>-1?d:u}function N(u,d){if(!(this instanceof N))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 N){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=O(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 R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function z(u){var d=new FormData;return u.trim().split("&").forEach(function(b){if(b){var T=b.split("="),R=T.shift().replace(/\+/g," "),A=T.join("=").replace(/\+/g," ");d.append(decodeURIComponent(R),decodeURIComponent(A))}}),d}function ce(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 R=T.split(":"),A=R.shift().trim();if(A){var Ve=R.join(":").trim();try{d.append(A,Ve)}catch(mt){console.warn("Response "+mt.message)}}}),d}E.call(N.prototype);function j(u,d){if(!(this instanceof j))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(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},j.error=function(){var u=new j(null,{status:200,statusText:""});return u.ok=!1,u.status=0,u.type="error",u};var le=[301,302,303,307,308];j.redirect=function(u,d){if(le.indexOf(d)===-1)throw new RangeError("Invalid status code");return new j(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 ge(u,d){return new Promise(function(b,T){var R=new N(u,d);if(R.signal&&R.signal.aborted)return T(new r.DOMException("Aborted","AbortError"));var A=new XMLHttpRequest;function Ve(){A.abort()}A.onload=function(){var k={statusText:A.statusText,headers:ce(A.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(A.status<200||A.status>599)?k.status=200:k.status=A.status,k.url="responseURL"in A?A.responseURL:k.headers.get("X-Request-URL");var de="response"in A?A.response:A.responseText;setTimeout(function(){b(new j(de,k))},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 mt(k){try{return k===""&&n.location.href?n.location.href:k}catch{return k}}if(A.open(R.method,mt(R.url),!0),R.credentials==="include"?A.withCredentials=!0:R.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 Zt=[];Object.getOwnPropertyNames(d.headers).forEach(function(k){Zt.push(l(k)),A.setRequestHeader(k,c(d.headers[k]))}),R.headers.forEach(function(k,de){Zt.indexOf(de)===-1&&A.setRequestHeader(de,k)})}else R.headers.forEach(function(k,de){A.setRequestHeader(de,k)});R.signal&&(R.signal.addEventListener("abort",Ve),A.onreadystatechange=function(){A.readyState===4&&R.signal.removeEventListener("abort",Ve)}),A.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return ge.polyfill=!0,n.fetch||(n.fetch=ge,n.Headers=h,n.Request=N,n.Response=j),r.Headers=h,r.Request=N,r.Response=j,r.fetch=ge,r}({})})(Ge);Ge.fetch.ponyfill=!0;delete Ge.fetch.polyfill;var Se=ze.fetch?ze:Ge;te=Se.fetch;te.default=Se.fetch;te.fetch=Se.fetch;te.Headers=Se.Headers;te.Request=Se.Request;te.Response=Se.Response;or.exports=te});var qn=x(M());var Bn=x(be()),Z=x(ee()),K=x(M());var ir=x(be()),Yi={},sr=ir.css`
3
- `;var Fn=x(M()),Un=x(ee());var V=x(M());var Ke=x(M()),Wn={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},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:[]}},ar=t=>Ke.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,suggestResults:void 0},reducers:Wn});var Yn=x(ur(),1);var cr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(cr||(cr={}));var lr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(lr||(lr={}));var Ee;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(Ee||(Ee={}));var dr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(dr||(dr={}));var fr;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(fr||(fr={}));var fe;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",t.GEN_AI__RATE="GEN_AI__RATE",t.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",t.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(fe||(fe={}));var hr;(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"})(hr||(hr={}));var pr;(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"})(pr||(pr={}));var yr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(yr||(yr={}));var mr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(mr||(mr={}));var vr;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(vr||(vr={}));var gr;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(gr||(gr={}));var br;(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"})(br||(br={}));var Sr;(function(t){t.ASC="ASC",t.DESC="DESC"})(Sr||(Sr={}));var Er;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Er||(Er={}));var Ae;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Ae||(Ae={}));var Ar;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Ar||(Ar={}));var wr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(wr||(wr={}));var xr;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(xr||(xr={}));var Or;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Or||(Or={}));var re;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(re||(re={}));var we;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(we||(we={}));var D;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(D||(D={}));var Tr;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Tr||(Tr={}));var _r;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(_r||(_r={}));var Cr;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Cr||(Cr={}));var Qn={[D.PERSONAL_BOOK_SHARE_USER]:[D.PERSONAL_BOOK_USER],[D.HTML_EXPORT_USER]:[D.PERSONAL_BOOK_USER],[D.PDF_EXPORT_USER]:[D.PERSONAL_BOOK_USER],[D.KHUB_ADMIN]:[D.CONTENT_PUBLISHER],[D.ADMIN]:[D.KHUB_ADMIN,D.USERS_ADMIN,D.PORTAL_ADMIN],[D.GENERATIVE_AI_EXPORT_USER]:[D.GENERATIVE_AI_USER]};function Rr(t,e){return t===e||(Qn[t]??[]).some(r=>Rr(r,e))}function Pr(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=>Rr(n,e))}var kn=x(M());var Mr=x(be()),B=x(ee()),G=x(M());var Ir=x(be());var Dr=Ir.css`
4
- `;var $e=x(M()),Xn="ft-app-info",vt=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},Jn={session:(t,e)=>{(0,$e.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>g.dispatchEvent(new vt(e.payload)),0))}},g=$e.FtReduxStore.get({name:Xn,reducers:Jn,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var Q=x(M());var gt=x(M());var he=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 xe=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:he.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):he.await()}};var W=class extends xe{constructor(e=!0,r){var n;super(r);let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new gt.CacheRegistry,this.cache=e?i.commonCache:new gt.CacheRegistry}clearCache(){this.cache.clearAll()}};var Nr,Zn=Symbol("clearAfterUnitTest"),We=class extends W{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Nr]=()=>{this.defaultMessages={},this.cache=new Q.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,Q.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 Q.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))}catch(i){!(i instanceof Q.CanceledPromiseError)&&r&&console.error(i)}return r&&await this.notify(e),n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>(0,Q.delay)(0).then(()=>r()).catch(()=>null)))}};Nr=Zn;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends We{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends We{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var kr=window.FluidTopicsI18nService,ws=window.FluidTopicsCustomI18nService;var L=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},P=class extends G.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>he.get(),this.messageContexts=[],this.cache=new G.CacheRegistry,this.cleanSessionDebouncer=new G.Debouncer}render(){return Mr.html`
1
+ "use strict";(()=>{var Hn=Object.create;var er=Object.defineProperty;var Kn=Object.getOwnPropertyDescriptor;var zn=Object.getOwnPropertyNames;var Gn=Object.getPrototypeOf,$n=Object.prototype.hasOwnProperty;var He=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Wn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of zn(e))!$n.call(t,i)&&i!==r&&er(t,i,{get:()=>e[i],enumerable:!(n=Kn(e,i))||n.enumerable});return t};var x=(t,e,r)=>(r=t!=null?Hn(Gn(t)):{},Wn(e||!t||!t.__esModule?er(r,"default",{value:t,enumerable:!0}):r,t));var k=He((Wi,tr)=>{tr.exports=ftGlobals.wcUtils});var be=He((Qi,rr)=>{rr.exports=ftGlobals.lit});var ee=He((Yi,nr)=>{nr.exports=ftGlobals.litDecorators});var ur=He((te,or)=>{var ze=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,Ge=function(){function t(){this.fetch=!1,this.DOMException=ze.DOMException}return t.prototype=ze,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 v(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=v(d);return d.readAsArrayBuffer(u),b}function m(u){var d=new FileReader,b=v(d),T=/charset=([A-Za-z0-9_-]+)/.exec(u.type),C=T?T[1]:"utf-8";return d.readAsText(u,C),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(z)}),this.json=function(){return this.text().then(JSON.parse)},this}var _=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function O(u){var d=u.toUpperCase();return _.indexOf(d)>-1?d:u}function N(u,d){if(!(this instanceof N))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 N){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=O(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 C=/\?/;this.url+=(C.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function z(u){var d=new FormData;return u.trim().split("&").forEach(function(b){if(b){var T=b.split("="),C=T.shift().replace(/\+/g," "),A=T.join("=").replace(/\+/g," ");d.append(decodeURIComponent(C),decodeURIComponent(A))}}),d}function ce(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 C=T.split(":"),A=C.shift().trim();if(A){var Ve=C.join(":").trim();try{d.append(A,Ve)}catch(mt){console.warn("Response "+mt.message)}}}),d}E.call(N.prototype);function j(u,d){if(!(this instanceof j))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(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},j.error=function(){var u=new j(null,{status:200,statusText:""});return u.ok=!1,u.status=0,u.type="error",u};var le=[301,302,303,307,308];j.redirect=function(u,d){if(le.indexOf(d)===-1)throw new RangeError("Invalid status code");return new j(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 ge(u,d){return new Promise(function(b,T){var C=new N(u,d);if(C.signal&&C.signal.aborted)return T(new r.DOMException("Aborted","AbortError"));var A=new XMLHttpRequest;function Ve(){A.abort()}A.onload=function(){var M={statusText:A.statusText,headers:ce(A.getAllResponseHeaders()||"")};C.url.indexOf("file://")===0&&(A.status<200||A.status>599)?M.status=200:M.status=A.status,M.url="responseURL"in A?A.responseURL:M.headers.get("X-Request-URL");var de="response"in A?A.response:A.responseText;setTimeout(function(){b(new j(de,M))},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 mt(M){try{return M===""&&n.location.href?n.location.href:M}catch{return M}}if(A.open(C.method,mt(C.url),!0),C.credentials==="include"?A.withCredentials=!0:C.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 Zt=[];Object.getOwnPropertyNames(d.headers).forEach(function(M){Zt.push(l(M)),A.setRequestHeader(M,c(d.headers[M]))}),C.headers.forEach(function(M,de){Zt.indexOf(de)===-1&&A.setRequestHeader(de,M)})}else C.headers.forEach(function(M,de){A.setRequestHeader(de,M)});C.signal&&(C.signal.addEventListener("abort",Ve),A.onreadystatechange=function(){A.readyState===4&&C.signal.removeEventListener("abort",Ve)}),A.send(typeof C._bodyInit>"u"?null:C._bodyInit)})}return ge.polyfill=!0,n.fetch||(n.fetch=ge,n.Headers=h,n.Request=N,n.Response=j),r.Headers=h,r.Request=N,r.Response=j,r.fetch=ge,r}({})})(Ge);Ge.fetch.ponyfill=!0;delete Ge.fetch.polyfill;var Se=ze.fetch?ze:Ge;te=Se.fetch;te.default=Se.fetch;te.fetch=Se.fetch;te.Headers=Se.Headers;te.Request=Se.Request;te.Response=Se.Response;or.exports=te});var Vn=x(k());var qn=x(be()),Z=x(ee()),K=x(k());var ir=x(be()),Xi={},sr=ir.css`
3
+ `;var Un=x(k()),jn=x(ee());var V=x(k());var Ke=x(k()),Qn={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},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:[]}},ar=t=>Ke.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",clusterSortCriterions:[],metadataFilters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:"",paging:void 0,facets:void 0,spellcheck:void 0,locales:[],results:void 0,suggestResults:void 0},reducers:Qn});var Xn=x(ur(),1);var cr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(cr||(cr={}));var lr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(lr||(lr={}));var dr;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(dr||(dr={}));var Ee;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.MAP_ATTACHMENT="MAP_ATTACHMENT",t.RESOURCE="RESOURCE"})(Ee||(Ee={}));var fr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(fr||(fr={}));var hr;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(hr||(hr={}));var fe;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",t.GEN_AI__RATE="GEN_AI__RATE",t.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",t.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(fe||(fe={}));var pr;(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"})(pr||(pr={}));var yr;(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"})(yr||(yr={}));var mr;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(mr||(mr={}));var vr;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(vr||(vr={}));var gr;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(gr||(gr={}));var br;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(br||(br={}));var Sr;(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"})(Sr||(Sr={}));var Er;(function(t){t.ASC="ASC",t.DESC="DESC"})(Er||(Er={}));var Ar;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ar||(Ar={}));var Ae;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Ae||(Ae={}));var wr;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"})(wr||(wr={}));var xr;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(xr||(xr={}));var Or;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(Or||(Or={}));var Tr;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Tr||(Tr={}));var re;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(re||(re={}));var we;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(we||(we={}));var D;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(D||(D={}));var _r;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(_r||(_r={}));var Rr;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Rr||(Rr={}));var Cr;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Cr||(Cr={}));var Yn={[D.PERSONAL_BOOK_SHARE_USER]:[D.PERSONAL_BOOK_USER],[D.HTML_EXPORT_USER]:[D.PERSONAL_BOOK_USER],[D.PDF_EXPORT_USER]:[D.PERSONAL_BOOK_USER],[D.KHUB_ADMIN]:[D.CONTENT_PUBLISHER],[D.ADMIN]:[D.KHUB_ADMIN,D.USERS_ADMIN,D.PORTAL_ADMIN],[D.GENERATIVE_AI_EXPORT_USER]:[D.GENERATIVE_AI_USER]};function Pr(t,e){return t===e||(Yn[t]??[]).some(r=>Pr(r,e))}function Ir(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=>Pr(n,e))}var kn=x(k());var Lr=x(be()),B=x(ee()),G=x(k());var Dr=x(be());var Nr=Dr.css`
4
+ `;var $e=x(k()),Jn="ft-app-info",vt=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},Zn={session:(t,e)=>{(0,$e.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>g.dispatchEvent(new vt(e.payload)),0))}},g=$e.FtReduxStore.get({name:Jn,reducers:Zn,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var Q=x(k());var gt=x(k());var he=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 xe=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:he.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):he.await()}};var W=class extends xe{constructor(e=!0,r){var n;super(r);let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new gt.CacheRegistry,this.cache=e?i.commonCache:new gt.CacheRegistry}clearCache(){this.cache.clearAll()}};var Mr,ei=Symbol("clearAfterUnitTest"),We=class extends W{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Mr]=()=>{this.defaultMessages={},this.cache=new Q.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,Q.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 Q.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))}catch(i){!(i instanceof Q.CanceledPromiseError)&&r&&console.error(i)}return r&&await this.notify(e),n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(r=>(0,Q.delay)(0).then(()=>r()).catch(()=>null)))}};Mr=ei;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends We{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends We{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var kr=window.FluidTopicsI18nService,xs=window.FluidTopicsCustomI18nService;var L=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},P=class extends G.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>he.get(),this.messageContexts=[],this.cache=new G.CacheRegistry,this.cleanSessionDebouncer=new G.Debouncer}render(){return Lr.html`
5
5
  <slot></slot>
6
- `}update(e){var r,n,i,s,a;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("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(o=>kr.addContext(o)),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)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};P.elementDefinitions={};P.styles=Dr;L([(0,B.property)()],P.prototype,"baseUrl",void 0);L([(0,B.property)()],P.prototype,"apiIntegrationIdentifier",void 0);L([(0,B.property)()],P.prototype,"uiLocale",void 0);L([(0,G.jsonProperty)(null)],P.prototype,"availableUiLocales",void 0);L([(0,G.jsonProperty)(null)],P.prototype,"metadataConfiguration",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"editorMode",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"noCustom",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0);L([(0,B.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],P.prototype,"noCustomComponent",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"withManualResources",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"navigatorOnline",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"forcedOffline",void 0);L([(0,B.property)({type:Object})],P.prototype,"apiProvider",void 0);L([(0,G.jsonProperty)([])],P.prototype,"messageContexts",void 0);L([(0,G.jsonProperty)(void 0)],P.prototype,"session",void 0);L([(0,B.state)()],P.prototype,"localesConfiguration",void 0);var Bi=x(ee());function ei(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(!Qe(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(!Qe(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(!Qe(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Qe(t,e){try{return ei(t,e)}catch{return!1}}function Ye(t,e){return!Qe(t,e)}var ti=x(ee(),1);var Xe=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 Oe=x(ee(),1);var Lr=x(ee(),1);function Fr(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Lr.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:Ye,...e??{}})}var Je=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 jr=x(be(),1);var Ze=globalThis,ri=Ze.ShadowRoot&&(Ze.ShadyCSS===void 0||Ze.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,js=Symbol();var Ur=(t,e)=>{if(ri)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=Ze.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var et=class extends jr.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 Ur(n,e.elementStyles),n}};function Br(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 Ie=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},Kr,qr=Symbol("constructorPrototype"),Vr=Symbol("constructorName"),zr=Symbol("exportpartsDebouncer"),Hr=Symbol("dynamicDependenciesLoaded"),X=class extends et{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Kr]=new Je(5),this[Vr]=this.constructor.name,this[qr]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Vr]&&Object.setPrototypeOf(this,this[qr])}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[Hr]||(e[Hr]=!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=Br(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[zr].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(", "))}};Kr=zr;Ie([(0,Oe.property)()],X.prototype,"exportpartsPrefix",void 0);Ie([Fr([])],X.prototype,"exportpartsPrefixes",void 0);Ie([(0,Oe.property)()],X.prototype,"customStylesheet",void 0);Ie([(0,Oe.property)()],X.prototype,"elementToFocus",void 0);Ie([(0,Oe.state)()],X.prototype,"useAdoptedStyleSheets",void 0);function De(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Gr,$r,Wr,Ne=Symbol("internalReduxEventsUnsubscribers"),ne=Symbol("internalStoresUnsubscribers"),pe=Symbol("internalStores"),ke=class extends X{constructor(){super(...arguments),this[Gr]=new Map,this[$r]=new Map,this[Wr]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(r=>e.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[pe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pe].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[pe].get(e)}addStore(e,r){var n;r=(n=r??(De(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[pe].set(r,e),this.subscribeToStore(r,e),this.updateFromStores()}removeStore(e){let r=typeof e=="string"?e:e.name;this.unsubscribeFromStore(r),this[pe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[pe].forEach((e,r)=>this.subscribeToStore(r,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let i=this.getStore(e.store);i&&(e.store?this[ne].has(e.store):this[ne].size>0)&&(this[r]=e.selector(i.getState(),this))}})}subscribeToStore(e,r){var n;this[ne].set(e,r.subscribe(()=>this.updateFromStores())),this[Ne].set(e,[]),De(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,s)=>{if(typeof this[s]=="function"&&(!i.store||r.name===i.store)){let a=o=>this[s](o);r.addEventListener(i.eventName,a),this[Ne].get(e).push(()=>r.removeEventListener(i.eventName,a))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[ne].forEach((e,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(e){var r;this[ne].has(e)&&this[ne].get(e)(),this[ne].delete(e),(r=this[Ne].get(e))===null||r===void 0||r.forEach(n=>n()),this[Ne].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Gr=ne,$r=pe,Wr=Ne;ke.reduxProperties=new Map;ke.reduxReactiveProperties=new Set;ke.reduxEventListeners=new Map;function H(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 J(t){return!!t&&!!t[C]}function $(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)===li}(t)||Array.isArray(t)||!!t[tn]||!!(!((e=t.constructor)===null||e===void 0)&&e[tn])||_t(t)||Ct(t))}function ye(t,e,r){r===void 0&&(r=!1),Ce(t)===0?(r?Object.keys:_e)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Ce(t){var e=t[C];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:_t(t)?2:Ct(t)?3:0}function Te(t,e){return Ce(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function ni(t,e){return Ce(t)===2?t.get(e):t[e]}function rn(t,e,r){var n=Ce(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function nn(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function _t(t){return ui&&t instanceof Map}function Ct(t){return ci&&t instanceof Set}function ie(t){return t.o||t.t}function Rt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=on(t);delete e[C];for(var r=_e(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 Pt(t,e){return e===void 0&&(e=!1),It(t)||J(t)||!$(t)||(Ce(t)>1&&(t.set=t.add=t.clear=t.delete=ii),Object.freeze(t),e&&ye(t,function(r,n){return Pt(n,!0)},!0)),t}function ii(){H(2)}function It(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Y(t){var e=Tt[t];return e||H(18,t),e}function si(t,e){Tt[t]||(Tt[t]=e)}function wt(){return Le}function bt(t,e){e&&(Y("Patches"),t.u=[],t.s=[],t.v=e)}function tt(t){xt(t),t.p.forEach(ai),t.p=null}function xt(t){t===Le&&(Le=t.l)}function Qr(t){return Le={p:[],l:Le,h:t,m:!0,_:0}}function ai(t){var e=t[C];e.i===0||e.i===1?e.j():e.g=!0}function St(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Y("ES5").S(e,t,n),n?(r[C].P&&(tt(e),H(4)),$(t)&&(t=rt(e,t),e.l||nt(e,t)),e.u&&Y("Patches").M(r[C].t,t,e.u,e.s)):t=rt(e,r,[]),tt(e),e.u&&e.v(e.u,e.s),t!==an?t:void 0}function rt(t,e,r){if(It(e))return e;var n=e[C];if(!n)return ye(e,function(o,l){return Yr(t,n,e,o,l,r)},!0),e;if(n.A!==t)return e;if(!n.P)return nt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Rt(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),ye(s,function(o,l){return Yr(t,n,i,o,l,r,a)}),nt(t,i,!1),r&&t.u&&Y("Patches").N(n,r,t.u,t.s)}return n.o}function Yr(t,e,r,n,i,s,a){if(J(i)){var o=rt(t,i,s&&e&&e.i!==3&&!Te(e.R,n)?s.concat(n):void 0);if(rn(r,n,o),!J(o))return;t.m=!1}else a&&r.add(i);if($(i)&&!It(i)){if(!t.h.D&&t._<1)return;rt(t,i),e&&e.A.l||nt(t,i)}}function nt(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Pt(e,r)}function Et(t,e){var r=t[C];return(r?ie(r):t)[e]}function Xr(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 se(t){t.P||(t.P=!0,t.l&&se(t.l))}function At(t){t.o||(t.o=Rt(t.t))}function Ot(t,e,r){var n=_t(e)?Y("MapSet").F(e,r):Ct(e)?Y("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:wt(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=o,c=Fe;a&&(l=[o],c=Me);var f=Proxy.revocable(l,c),h=f.revoke,p=f.proxy;return o.k=p,o.j=h,p}(e,r):Y("ES5").J(e,r);return(r?r.A:wt()).p.push(n),n}function oi(t){return J(t)||H(22,t),function e(r){if(!$(r))return r;var n,i=r[C],s=Ce(r);if(i){if(!i.P&&(i.i<4||!Y("ES5").K(i)))return i.t;i.I=!0,n=Jr(r,s),i.I=!1}else n=Jr(r,s);return ye(n,function(a,o){i&&ni(i.t,a)===o||rn(n,a,e(o))}),s===3?new Set(n):n}(t)}function Jr(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Rt(t)}function sn(){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[C];return Fe.get(c,a)},set:function(c){var f=this[C];Fe.set(f,a,c)}},l}function e(a){for(var o=a.length-1;o>=0;o--){var l=a[o][C];if(!l.P)switch(l.i){case 5:n(l)&&se(l);break;case 4:r(l)&&se(l)}}}function r(a){for(var o=a.t,l=a.k,c=_e(l),f=c.length-1;f>=0;f--){var h=c[f];if(h!==C){var p=o[h];if(p===void 0&&!Te(o,h))return!0;var v=l[h],y=v&&v[C];if(y?y.t!==p:!nn(v,p))return!0}}var m=!!o[C];return c.length!==_e(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&&H(3,JSON.stringify(ie(a)))}var s={};si("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=on(p);delete m[C];for(var w=_e(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:wt(),P:!1,I:!1,R:{},l:o,t:a,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,C,{value:f,writable:!0}),c},S:function(a,o,l){l?J(o)&&o[C].A===a&&e(a.p):(a.u&&function c(f){if(f&&typeof f=="object"){var h=f[C];if(h){var p=h.t,v=h.k,y=h.R,m=h.i;if(m===4)ye(v,function(O){O!==C&&(p[O]!==void 0||Te(p,O)?y[O]||c(v[O]):(y[O]=!0,se(h)))}),ye(p,function(O){v[O]!==void 0||Te(v,O)||(y[O]=!1,se(h))});else if(m===5){if(n(h)&&(se(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),_=0;_<E;_++)v.hasOwnProperty(_)||(y[_]=!0),y[_]===void 0&&c(v[_])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var Zr,Le,Dt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ui=typeof Map<"u",ci=typeof Set<"u",en=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",an=Dt?Symbol.for("immer-nothing"):((Zr={})["immer-nothing"]=!0,Zr),tn=Dt?Symbol.for("immer-draftable"):"__$immer_draftable",C=Dt?Symbol.for("immer-state"):"__$immer_state";var li=""+Object.prototype.constructor,_e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,on=Object.getOwnPropertyDescriptors||function(t){var e={};return _e(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},Tt={},Fe={get:function(t,e){if(e===C)return t;var r=ie(t);if(!Te(r,e))return function(i,s,a){var o,l=Xr(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||!$(n)?n:n===Et(t.t,e)?(At(t),t.o[e]=Ot(t.A.h,n,t)):n},has:function(t,e){return e in ie(t)},ownKeys:function(t){return Reflect.ownKeys(ie(t))},set:function(t,e,r){var n=Xr(ie(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=Et(ie(t),e),s=i?.[C];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(nn(r,i)&&(r!==void 0||Te(t.t,e)))return!0;At(t),se(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 Et(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,At(t),se(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ie(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){H(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){H(12)}},Me={};ye(Fe,function(t,e){Me[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Me.deleteProperty=function(t,e){return Me.set.call(this,t,e,void 0)},Me.set=function(t,e,r){return Fe.set.call(this,t[0],e,r,t[0])};var di=function(){function t(r){var n=this;this.O=en,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),_=1;_<S;_++)E[_-1]=arguments[_];return l.produce(m,function(O){var N;return(N=s).call.apply(N,[w,O].concat(E))})}}var c;if(typeof s!="function"&&H(6),a!==void 0&&typeof a!="function"&&H(7),$(i)){var f=Qr(n),h=Ot(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?tt(f):xt(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return bt(f,a),St(m,f)},function(m){throw tt(f),m}):(bt(f,a),St(c,f))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===an&&(c=void 0),n.D&&Pt(c,!0),a){var v=[],y=[];Y("Patches").M(i,c,v,y),a(v,y)}return c}H(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){$(r)||H(8),J(r)&&(r=oi(r));var n=Qr(this),i=Ot(this,r,void 0);return i[C].C=!0,xt(n),i},e.finishDraft=function(r,n){var i=r&&r[C],s=i.A;return bt(s,n),St(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!en&&H(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=Y("Patches").$;return J(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),q=new di,fi=q.produce,Zs=q.produceWithPatches.bind(q),ea=q.setAutoFreeze.bind(q),ta=q.setUseProxies.bind(q),ra=q.applyPatches.bind(q),na=q.createDraft.bind(q),ia=q.finishDraft.bind(q),it=fi;function me(t){"@babel/helpers - typeof";return me=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},me(t)}function un(t,e){if(me(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function cn(t){var e=un(t,"string");return me(e)=="symbol"?e:e+""}function ln(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 dn(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 Nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dn(Object(r),!0).forEach(function(n){ln(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F(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 fn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),kt=function(){return Math.random().toString(36).substring(7).split("").join(".")},st={INIT:"@@redux/INIT"+kt(),REPLACE:"@@redux/REPLACE"+kt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+kt()}};function hi(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 Mt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(F(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(F(1));return r(Mt)(t,e)}if(typeof t!="function")throw new Error(F(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(F(3));return s}function h(m){if(typeof m!="function")throw new Error(F(4));if(l)throw new Error(F(5));var w=!0;return c(),o.push(m),function(){if(w){if(l)throw new Error(F(6));w=!1,c();var E=o.indexOf(m);o.splice(E,1),a=null}}}function p(m){if(!hi(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(l)throw new Error(F(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(F(10));i=m,p({type:st.REPLACE})}function y(){var m,w=h;return m={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(F(11));function _(){E.next&&E.next(f())}_();var O=w(_);return{unsubscribe:O}}},m[fn]=function(){return this},m}return p({type:st.INIT}),n={dispatch:p,subscribe:h,getState:f,replaceReducer:v},n[fn]=y,n}function pi(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:st.INIT});if(typeof n>"u")throw new Error(F(12));if(typeof r(void 0,{type:st.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function hn(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{pi(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 _=f&&f.type;throw new Error(F(14))}v[m]=E,p=p||E!==S}return p=p||s.length!==Object.keys(c).length,p?v:c}}function Re(){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(F(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(l){return l(a)});return s=Re.apply(void 0,o)(i.dispatch),Nt(Nt({},i),{},{dispatch:s})}}}function yn(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 mn=yn();mn.withExtraArgument=yn;var Lt=mn;var En=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)}}(),yi=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}}},Pe=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},mi=Object.defineProperty,vi=Object.defineProperties,gi=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,bi=Object.prototype.hasOwnProperty,Si=Object.prototype.propertyIsEnumerable,gn=function(t,e,r){return e in t?mi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ae=function(t,e){for(var r in e||(e={}))bi.call(e,r)&&gn(t,r,e[r]);if(vn)for(var n=0,i=vn(e);n<i.length;n++){var r=i[n];Si.call(e,r)&&gn(t,r,e[r])}return t},Ft=function(t,e){return vi(t,gi(e))},Ei=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 Ai=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Re:Re.apply(null,arguments)},Aa=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function wi(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 xi=function(t){En(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,Pe([void 0],r[0].concat(this)))):new(e.bind.apply(e,Pe([void 0],r.concat(this))))},e}(Array),Oi=function(t){En(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,Pe([void 0],r[0].concat(this)))):new(e.bind.apply(e,Pe([void 0],r.concat(this))))},e}(Array);function Bt(t){return $(t)?it(t,function(){}):t}function Ti(t){return typeof t=="boolean"}function _i(){return function(e){return Ci(e)}}function Ci(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 xi;if(r&&(Ti(r)?o.push(Lt):o.push(Lt.withExtraArgument(r.extraArgument))),0){if(i)var l;if(a)var c}return o}var Ut=!0;function An(t){var e=_i(),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(wi(i))v=hn(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),!Ut&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ut&&y.some(function(O){return typeof O!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=pn.apply(void 0,y),w=Re;l&&(w=Ai(ae({trace:!Ut},typeof l=="object"&&l)));var S=new Oi(m),E=S;Array.isArray(p)?E=Pe([m],p):typeof p=="function"&&(E=p(S));var _=w.apply(void 0,E);return Mt(v,f,_)}function oe(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 ae(ae({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 wn(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 Ri(t){return typeof t=="function"}function Pi(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?wn(e):[e,r,n],s=i[0],a=i[1],o=i[2],l;if(Ri(t))l=function(){return Bt(t())};else{var c=Bt(t);l=function(){return c}}function f(h,p){h===void 0&&(h=l());var v=Pe([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(J(y)){var w=y,S=m(w,p);return S===void 0?y:S}else{if($(y))return it(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 Ii(t,e){return t+"/"+e}function xn(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:Bt(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(f){var h=n[f],p=Ii(e,f),v,y;"reducer"in h?(v=h.reducer,y=h.prepare):v=h,s[f]=v,a[p]=v,o[f]=y?oe(p,y):oe(p)});function l(){var f=typeof t.extraReducers=="function"?wn(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=ae(ae({},p),a);return Pi(r,function(E){for(var _ in S)E.addCase(_,S[_]);for(var O=0,N=y;O<N.length;O++){var z=N[O];E.addMatcher(z.matcher,z.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 Di="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ni=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Di[Math.random()*64|0];return e},ki=["name","message","stack","code"],jt=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),bn=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Mi=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=ki;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},Ta=function(){function t(e,r,n){var i=oe(e+"/fulfilled",function(f,h,p,v){return{payload:f,meta:Ft(ae({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=oe(e+"/pending",function(f,h,p){return{payload:void 0,meta:Ft(ae({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),a=oe(e+"/rejected",function(f,h,p,v,y){return{payload:v,error:(n&&n.serializeError||Mi)(f||"Rejected"),meta:Ft(ae({},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):Ni(),m=new l,w,S=!1;function E(O){w=O,m.abort()}var _=function(){return Ei(this,null,function(){var O,N,z,ce,j,le,ge;return yi(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),ce=(O=n?.condition)==null?void 0:O.call(n,f,{getState:p,extra:v}),Fi(ce)?[4,ce]:[3,2];case 1:ce=u.sent(),u.label=2;case 2:if(ce===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,j=new Promise(function(d,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),h(s(y,f,(N=n?.getPendingMeta)==null?void 0:N.call(n,{requestId:y,arg:f},{getState:p,extra:v}))),[4,Promise.race([j,Promise.resolve(r(f,{dispatch:h,getState:p,extra:v,requestId:y,signal:m.signal,abort:E,rejectWithValue:function(d,b){return new jt(d,b)},fulfillWithValue:function(d,b){return new bn(d,b)}})).then(function(d){if(d instanceof jt)throw d;return d instanceof bn?i(d.payload,y,f,d.meta):i(d,y,f)})])];case 3:return z=u.sent(),[3,5];case 4:return le=u.sent(),z=le instanceof jt?a(null,y,f,le.payload,le.meta):a(le,y,f),[3,5];case 5:return ge=n&&!n.dispatchConditionRejection&&a.match(z)&&z.meta.condition,ge||h(z),[2,z]}})})}();return Object.assign(_,{abort:E,requestId:y,arg:f,unwrap:function(){return _.then(Li)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Li(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Fi(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var On="listener",Tn="completed",_n="cancelled",_a="task-"+_n,Ca="task-"+Tn,Ra=On+"-"+_n,Pa=On+"-"+Tn;var qt="listenerMiddleware";var Ia=oe(qt+"/add"),Da=oe(qt+"/removeAll"),Na=oe(qt+"/remove");var Sn,ka=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Sn||(Sn=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ui=function(t){return function(e){setTimeout(e,t)}},Ma=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ui(10);sn();function ji(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 at=class extends ji(Object){};window.ftReduxStores||(window.ftReduxStores={});var Cn=class t extends at{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(De(s))return s;if(i==null)return;let a=xn({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=An({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 Xe;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 lt=x(M());var ot=class extends W{async listMySearches(){let{session:e}=g.getState();return Pr(e,D.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ut=class extends W{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 qi="ft-user-assets",ct=lt.FtReduxStore.get({name:qi,initialState:{savedSearches:void 0,bookmarks:void 0}}),Vt=class{constructor(){this.currentSession=g.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ut,this.savedSearchesService=new ot,g.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=g.getState();(0,lt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ct.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ct.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ct.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ct.actions.bookmarks(r)}}},Rn=new Vt;var Ht=class{addCommand(e,r=!1){g.commands.add(e,r)}consumeCommand(e){return g.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ht;var Pn=x(M()),Kt=class{highlightHtml(e,r,n){(0,Pn.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Kt;var In=x(M());var zt=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 In.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 zt;var Dn=x(M());var Ue=class{static get(e,r){var n,i,s,a;let o=g.getState(),{lang:l,region:c}=(i=(n=o.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Dn.SearchPlaceConverter(o.baseUrl,(a=(s=window.FluidTopicsClientConfiguration)===null||s===void 0?void 0:s.predefinedSorts)!==null&&a!==void 0?a:{},e??20,o.searchInAllLanguagesAllowed,r??`${l}-${c}`)}};var dt=class extends xe{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(r)})}};var Gt=class{urlToSearchRequest(e){return Ue.get().parse(e)}searchRequestToUrl(e){return Ue.get().serialize(e)}};window.FluidTopicsUrlService=new Gt;var ue=x(M());var ve=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ve.eventName="change";var $t=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))}},Nn=new $t;var ft=class t extends ue.WithEventBus{static build(){return new t(window.history,Nn,()=>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,ue.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,r=!1){var n,i,s;let a={...this.buildCurrentState(),...e,index:this.currentIndex,title:(n=e?.title)!==null&&n!==void 0?n:this.currentState.title},o=r?(i=e?.majorState)!==null&&i!==void 0?i:this.currentState.majorState:(s=this.currentState.majorState)!==null&&s!==void 0?s:e?.majorState;o!=null&&(a.majorState=o),this.setCurrentState(a)}addHistoryChangeListener(e){this.addEventListener(ve.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ve.eventName,e)}currentItem(){return(0,ue.deepCopy)(this.currentState)}back(){let e=this.previousMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ue.deepCopy)(this.states[this.previousMajorPosition()])}previousMajorPosition(){let e=this.currentIndex;for(;e>0&&!this.isMajorState(e);)e--;return this.previousExistingPosition(e)}forward(){let e=this.nextMajorPosition();e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){return(0,ue.deepCopy)(this.states[this.nextMajorPosition()])}nextMajorPosition(){let e=this.currentIndex;do e++;while(e<this.states.length&&!this.isMajorState(e));do e++;while(e<this.states.length&&!this.isMajorState(e));return this.previousExistingPosition(e)}previousExistingPosition(e){let r=e;do r--;while(r>0&&!this.hasState(r));return r}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isMajorState(e){var r,n;return this.hasState(e)&&((n=(r=this.states[e])===null||r===void 0?void 0:r.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=ft.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});(0,kn.customElement)("ft-app-context")(P);var ht=class extends W{constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[s])=>i.localeCompare(s)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Vi=t=>t.request.virtualField===Ae.TITLE_ONLY&&t.request.scope===we.DOCUMENTS,pt=class t extends Event{constructor(){super(t.eventName)}};pt.eventName="search-context-clear-all-filters";var je=class t{static build(e,r){return new t(ar(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new V.Debouncer(10),this.searchDebouncer=new V.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 V.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new ht,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,V.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,V.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var 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)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(Ae.TITLE_ONLY),this.store.actions.setRequestScope(we.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Ae.EVERYWHERE),this.store.actions.setRequestScope(we.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Vi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new pt)}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.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,V.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(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 V.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,V.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof V.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Hi=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},Qt=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Mn=Symbol("registerInterval"),Wt=Symbol("registerAttempts"),Ki=40;function zi(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[Wt]=0,this[Mn]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Wt]>Ki?window.clearInterval(this[Mn]):(this[Wt]++,this.dispatchEvent(new Qt))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Hi([(0,Un.state)()],e.prototype,"stateManager",void 0),e}var Ln=class extends zi(Fn.FtLitElementRedux){};var jn=x(M());function Be(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function qe(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 yt=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.publication=void 0,this.sendEvent=n=>{if(!this.canSendEvent()||!n)return;let i=this.store.getState().request;this.publication==null?this.sendKhubSearchEvent(i,n):this.sendDocumentSearchEvent(i,n)},this.eventsService=r??new dt,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.publication=e}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:fe.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Be(e.metadataFilters),facets:e.metadataFilters.map(i=>qe(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Be(e.metadataFilters),facets:e.metadataFilters.map(i=>qe(i))},publication:this.publication};this.eventsService.sendDocumentSearchEvent(n)}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==re.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Be(n.metadataFilters),facets:n.metadataFilters.map(a=>qe(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==re.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Be(n.metadataFilters),facets:n.metadataFilters.map(a=>qe(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 re.MAP:return{id:e.map.mapId,title:e.map.title,type:Ee.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case re.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:Ee.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case re.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:Ee.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},Yt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},Xt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},Jt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},I=class extends K.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=je.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 yt(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 Bn.html`
6
+ `}update(e){var r,n,i,s,a;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("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(o=>kr.addContext(o)),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)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};P.elementDefinitions={};P.styles=Nr;L([(0,B.property)()],P.prototype,"baseUrl",void 0);L([(0,B.property)()],P.prototype,"apiIntegrationIdentifier",void 0);L([(0,B.property)()],P.prototype,"uiLocale",void 0);L([(0,G.jsonProperty)(null)],P.prototype,"availableUiLocales",void 0);L([(0,G.jsonProperty)(null)],P.prototype,"metadataConfiguration",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"editorMode",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"noCustom",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"openExternalDocumentInNewTab",void 0);L([(0,B.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],P.prototype,"noCustomComponent",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"withManualResources",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"navigatorOnline",void 0);L([(0,B.property)({type:Boolean})],P.prototype,"forcedOffline",void 0);L([(0,B.property)({type:Object})],P.prototype,"apiProvider",void 0);L([(0,G.jsonProperty)([])],P.prototype,"messageContexts",void 0);L([(0,G.jsonProperty)(void 0)],P.prototype,"session",void 0);L([(0,B.state)()],P.prototype,"localesConfiguration",void 0);var qi=x(ee());function ti(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(!Qe(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(!Qe(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(!Qe(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Qe(t,e){try{return ti(t,e)}catch{return!1}}function Ye(t,e){return!Qe(t,e)}var ri=x(ee(),1);var Xe=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 Oe=x(ee(),1);var Fr=x(ee(),1);function Ur(t,e){let r=()=>JSON.parse(JSON.stringify(t));return(0,Fr.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:Ye,...e??{}})}var Je=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 Br=x(be(),1);var Ze=globalThis,ni=Ze.ShadowRoot&&(Ze.ShadyCSS===void 0||Ze.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bs=Symbol();var jr=(t,e)=>{if(ni)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=Ze.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var et=class extends Br.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 jr(n,e.elementStyles),n}};function qr(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 Ie=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},zr,Vr=Symbol("constructorPrototype"),Hr=Symbol("constructorName"),Gr=Symbol("exportpartsDebouncer"),Kr=Symbol("dynamicDependenciesLoaded"),X=class extends et{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[zr]=new Je(5),this[Hr]=this.constructor.name,this[Vr]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Hr]&&Object.setPrototypeOf(this,this[Vr])}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[Kr]||(e[Kr]=!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=qr(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[Gr].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(", "))}};zr=Gr;Ie([(0,Oe.property)()],X.prototype,"exportpartsPrefix",void 0);Ie([Ur([])],X.prototype,"exportpartsPrefixes",void 0);Ie([(0,Oe.property)()],X.prototype,"customStylesheet",void 0);Ie([(0,Oe.property)()],X.prototype,"elementToFocus",void 0);Ie([(0,Oe.state)()],X.prototype,"useAdoptedStyleSheets",void 0);function De(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var $r,Wr,Qr,Ne=Symbol("internalReduxEventsUnsubscribers"),ne=Symbol("internalStoresUnsubscribers"),pe=Symbol("internalStores"),Me=class extends X{constructor(){super(...arguments),this[$r]=new Map,this[Wr]=new Map,this[Qr]=new Map}get reduxConstructor(){return this.constructor}update(e){super.update(e),[...this.reduxConstructor.reduxReactiveProperties].some(r=>e.has(r))&&this.updateFromStores()}getUnnamedStore(){if(this[pe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[pe].values()][0]}getStore(e){return e==null?this.getUnnamedStore():this[pe].get(e)}addStore(e,r){var n;r=(n=r??(De(e)?e.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(r),this[pe].set(r,e),this.subscribeToStore(r,e),this.updateFromStores()}removeStore(e){let r=typeof e=="string"?e:e.name;this.unsubscribeFromStore(r),this[pe].delete(r)}setupStores(){this.unsubscribeFromStores(),this[pe].forEach((e,r)=>this.subscribeToStore(r,e)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((e,r)=>{let n=this.constructor.getPropertyOptions(r);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:r)){let i=this.getStore(e.store);i&&(e.store?this[ne].has(e.store):this[ne].size>0)&&(this[r]=e.selector(i.getState(),this))}})}subscribeToStore(e,r){var n;this[ne].set(e,r.subscribe(()=>this.updateFromStores())),this[Ne].set(e,[]),De(r)&&r.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((i,s)=>{if(typeof this[s]=="function"&&(!i.store||r.name===i.store)){let a=o=>this[s](o);r.addEventListener(i.eventName,a),this[Ne].get(e).push(()=>r.removeEventListener(i.eventName,a))}})),this.onStoreAvailable(e)}unsubscribeFromStores(){this[ne].forEach((e,r)=>this.unsubscribeFromStore(r))}unsubscribeFromStore(e){var r;this[ne].has(e)&&this[ne].get(e)(),this[ne].delete(e),(r=this[Ne].get(e))===null||r===void 0||r.forEach(n=>n()),this[Ne].delete(e)}onStoreAvailable(e){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};$r=ne,Wr=pe,Qr=Ne;Me.reduxProperties=new Map;Me.reduxReactiveProperties=new Set;Me.reduxEventListeners=new Map;function H(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 J(t){return!!t&&!!t[R]}function $(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)===di}(t)||Array.isArray(t)||!!t[rn]||!!(!((e=t.constructor)===null||e===void 0)&&e[rn])||_t(t)||Rt(t))}function ye(t,e,r){r===void 0&&(r=!1),Re(t)===0?(r?Object.keys:_e)(t).forEach(function(n){r&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,i){return e(i,n,t)})}function Re(t){var e=t[R];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:_t(t)?2:Rt(t)?3:0}function Te(t,e){return Re(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function ii(t,e){return Re(t)===2?t.get(e):t[e]}function nn(t,e,r){var n=Re(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function sn(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function _t(t){return ci&&t instanceof Map}function Rt(t){return li&&t instanceof Set}function ie(t){return t.o||t.t}function Ct(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=un(t);delete e[R];for(var r=_e(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 Pt(t,e){return e===void 0&&(e=!1),It(t)||J(t)||!$(t)||(Re(t)>1&&(t.set=t.add=t.clear=t.delete=si),Object.freeze(t),e&&ye(t,function(r,n){return Pt(n,!0)},!0)),t}function si(){H(2)}function It(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Y(t){var e=Tt[t];return e||H(18,t),e}function ai(t,e){Tt[t]||(Tt[t]=e)}function wt(){return Le}function bt(t,e){e&&(Y("Patches"),t.u=[],t.s=[],t.v=e)}function tt(t){xt(t),t.p.forEach(oi),t.p=null}function xt(t){t===Le&&(Le=t.l)}function Yr(t){return Le={p:[],l:Le,h:t,m:!0,_:0}}function oi(t){var e=t[R];e.i===0||e.i===1?e.j():e.g=!0}function St(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Y("ES5").S(e,t,n),n?(r[R].P&&(tt(e),H(4)),$(t)&&(t=rt(e,t),e.l||nt(e,t)),e.u&&Y("Patches").M(r[R].t,t,e.u,e.s)):t=rt(e,r,[]),tt(e),e.u&&e.v(e.u,e.s),t!==on?t:void 0}function rt(t,e,r){if(It(e))return e;var n=e[R];if(!n)return ye(e,function(o,l){return Xr(t,n,e,o,l,r)},!0),e;if(n.A!==t)return e;if(!n.P)return nt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ct(n.k):n.o,s=i,a=!1;n.i===3&&(s=new Set(i),i.clear(),a=!0),ye(s,function(o,l){return Xr(t,n,i,o,l,r,a)}),nt(t,i,!1),r&&t.u&&Y("Patches").N(n,r,t.u,t.s)}return n.o}function Xr(t,e,r,n,i,s,a){if(J(i)){var o=rt(t,i,s&&e&&e.i!==3&&!Te(e.R,n)?s.concat(n):void 0);if(nn(r,n,o),!J(o))return;t.m=!1}else a&&r.add(i);if($(i)&&!It(i)){if(!t.h.D&&t._<1)return;rt(t,i),e&&e.A.l||nt(t,i)}}function nt(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Pt(e,r)}function Et(t,e){var r=t[R];return(r?ie(r):t)[e]}function Jr(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 se(t){t.P||(t.P=!0,t.l&&se(t.l))}function At(t){t.o||(t.o=Ct(t.t))}function Ot(t,e,r){var n=_t(e)?Y("MapSet").F(e,r):Rt(e)?Y("MapSet").T(e,r):t.O?function(i,s){var a=Array.isArray(i),o={i:a?1:0,A:s?s.A:wt(),P:!1,I:!1,R:{},l:s,t:i,k:null,o:null,j:null,C:!1},l=o,c=Fe;a&&(l=[o],c=ke);var f=Proxy.revocable(l,c),h=f.revoke,p=f.proxy;return o.k=p,o.j=h,p}(e,r):Y("ES5").J(e,r);return(r?r.A:wt()).p.push(n),n}function ui(t){return J(t)||H(22,t),function e(r){if(!$(r))return r;var n,i=r[R],s=Re(r);if(i){if(!i.P&&(i.i<4||!Y("ES5").K(i)))return i.t;i.I=!0,n=Zr(r,s),i.I=!1}else n=Zr(r,s);return ye(n,function(a,o){i&&ii(i.t,a)===o||nn(n,a,e(o))}),s===3?new Set(n):n}(t)}function Zr(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ct(t)}function an(){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 Fe.get(c,a)},set:function(c){var f=this[R];Fe.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)&&se(l);break;case 4:r(l)&&se(l)}}}function r(a){for(var o=a.t,l=a.k,c=_e(l),f=c.length-1;f>=0;f--){var h=c[f];if(h!==R){var p=o[h];if(p===void 0&&!Te(o,h))return!0;var v=l[h],y=v&&v[R];if(y?y.t!==p:!sn(v,p))return!0}}var m=!!o[R];return c.length!==_e(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&&H(3,JSON.stringify(ie(a)))}var s={};ai("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=un(p);delete m[R];for(var w=_e(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:wt(),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?J(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)ye(v,function(O){O!==R&&(p[O]!==void 0||Te(p,O)?y[O]||c(v[O]):(y[O]=!0,se(h)))}),ye(p,function(O){v[O]!==void 0||Te(v,O)||(y[O]=!1,se(h))});else if(m===5){if(n(h)&&(se(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),_=0;_<E;_++)v.hasOwnProperty(_)||(y[_]=!0),y[_]===void 0&&c(v[_])}}}}(a.p[0]),e(a.p))},K:function(a){return a.i===4?r(a):n(a)}})}var en,Le,Dt=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ci=typeof Map<"u",li=typeof Set<"u",tn=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",on=Dt?Symbol.for("immer-nothing"):((en={})["immer-nothing"]=!0,en),rn=Dt?Symbol.for("immer-draftable"):"__$immer_draftable",R=Dt?Symbol.for("immer-state"):"__$immer_state";var di=""+Object.prototype.constructor,_e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,un=Object.getOwnPropertyDescriptors||function(t){var e={};return _e(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)}),e},Tt={},Fe={get:function(t,e){if(e===R)return t;var r=ie(t);if(!Te(r,e))return function(i,s,a){var o,l=Jr(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||!$(n)?n:n===Et(t.t,e)?(At(t),t.o[e]=Ot(t.A.h,n,t)):n},has:function(t,e){return e in ie(t)},ownKeys:function(t){return Reflect.ownKeys(ie(t))},set:function(t,e,r){var n=Jr(ie(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=Et(ie(t),e),s=i?.[R];if(s&&s.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(sn(r,i)&&(r!==void 0||Te(t.t,e)))return!0;At(t),se(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 Et(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,At(t),se(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ie(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){H(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){H(12)}},ke={};ye(Fe,function(t,e){ke[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),ke.deleteProperty=function(t,e){return ke.set.call(this,t,e,void 0)},ke.set=function(t,e,r){return Fe.set.call(this,t[0],e,r,t[0])};var fi=function(){function t(r){var n=this;this.O=tn,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),_=1;_<S;_++)E[_-1]=arguments[_];return l.produce(m,function(O){var N;return(N=s).call.apply(N,[w,O].concat(E))})}}var c;if(typeof s!="function"&&H(6),a!==void 0&&typeof a!="function"&&H(7),$(i)){var f=Yr(n),h=Ot(n,i,void 0),p=!0;try{c=s(h),p=!1}finally{p?tt(f):xt(f)}return typeof Promise<"u"&&c instanceof Promise?c.then(function(m){return bt(f,a),St(m,f)},function(m){throw tt(f),m}):(bt(f,a),St(c,f))}if(!i||typeof i!="object"){if((c=s(i))===void 0&&(c=i),c===on&&(c=void 0),n.D&&Pt(c,!0),a){var v=[],y=[];Y("Patches").M(i,c,v,y),a(v,y)}return c}H(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){$(r)||H(8),J(r)&&(r=ui(r));var n=Yr(this),i=Ot(this,r,void 0);return i[R].C=!0,xt(n),i},e.finishDraft=function(r,n){var i=r&&r[R],s=i.A;return bt(s,n),St(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!tn&&H(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=Y("Patches").$;return J(r)?a(r,n):this.produce(r,function(o){return a(o,n)})},t}(),q=new fi,hi=q.produce,ea=q.produceWithPatches.bind(q),ta=q.setAutoFreeze.bind(q),ra=q.setUseProxies.bind(q),na=q.applyPatches.bind(q),ia=q.createDraft.bind(q),sa=q.finishDraft.bind(q),it=hi;function me(t){"@babel/helpers - typeof";return me=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},me(t)}function cn(t,e){if(me(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(me(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ln(t){var e=cn(t,"string");return me(e)=="symbol"?e:e+""}function dn(t,e,r){return(e=ln(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fn(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 Nt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fn(Object(r),!0).forEach(function(n){dn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fn(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F(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 hn=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Mt=function(){return Math.random().toString(36).substring(7).split("").join(".")},st={INIT:"@@redux/INIT"+Mt(),REPLACE:"@@redux/REPLACE"+Mt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Mt()}};function pi(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 kt(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(F(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(F(1));return r(kt)(t,e)}if(typeof t!="function")throw new Error(F(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(F(3));return s}function h(m){if(typeof m!="function")throw new Error(F(4));if(l)throw new Error(F(5));var w=!0;return c(),o.push(m),function(){if(w){if(l)throw new Error(F(6));w=!1,c();var E=o.indexOf(m);o.splice(E,1),a=null}}}function p(m){if(!pi(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(l)throw new Error(F(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(F(10));i=m,p({type:st.REPLACE})}function y(){var m,w=h;return m={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(F(11));function _(){E.next&&E.next(f())}_();var O=w(_);return{unsubscribe:O}}},m[hn]=function(){return this},m}return p({type:st.INIT}),n={dispatch:p,subscribe:h,getState:f,replaceReducer:v},n[hn]=y,n}function yi(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:st.INIT});if(typeof n>"u")throw new Error(F(12));if(typeof r(void 0,{type:st.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function pn(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{yi(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 _=f&&f.type;throw new Error(F(14))}v[m]=E,p=p||E!==S}return p=p||s.length!==Object.keys(c).length,p?v:c}}function Ce(){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 yn(){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(F(15))},a={getState:i.getState,dispatch:function(){return s.apply(void 0,arguments)}},o=e.map(function(l){return l(a)});return s=Ce.apply(void 0,o)(i.dispatch),Nt(Nt({},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 vn=mn();vn.withExtraArgument=mn;var Lt=vn;var An=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)}}(),mi=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}}},Pe=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},vi=Object.defineProperty,gi=Object.defineProperties,bi=Object.getOwnPropertyDescriptors,gn=Object.getOwnPropertySymbols,Si=Object.prototype.hasOwnProperty,Ei=Object.prototype.propertyIsEnumerable,bn=function(t,e,r){return e in t?vi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},ae=function(t,e){for(var r in e||(e={}))Si.call(e,r)&&bn(t,r,e[r]);if(gn)for(var n=0,i=gn(e);n<i.length;n++){var r=i[n];Ei.call(e,r)&&bn(t,r,e[r])}return t},Ft=function(t,e){return gi(t,bi(e))},Ai=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 wi=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ce:Ce.apply(null,arguments)},wa=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function xi(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 Oi=function(t){An(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,Pe([void 0],r[0].concat(this)))):new(e.bind.apply(e,Pe([void 0],r.concat(this))))},e}(Array),Ti=function(t){An(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,Pe([void 0],r[0].concat(this)))):new(e.bind.apply(e,Pe([void 0],r.concat(this))))},e}(Array);function Bt(t){return $(t)?it(t,function(){}):t}function _i(t){return typeof t=="boolean"}function Ri(){return function(e){return Ci(e)}}function Ci(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 Oi;if(r&&(_i(r)?o.push(Lt):o.push(Lt.withExtraArgument(r.extraArgument))),0){if(i)var l;if(a)var c}return o}var Ut=!0;function wn(t){var e=Ri(),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(xi(i))v=pn(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),!Ut&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ut&&y.some(function(O){return typeof O!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=yn.apply(void 0,y),w=Ce;l&&(w=wi(ae({trace:!Ut},typeof l=="object"&&l)));var S=new Ti(m),E=S;Array.isArray(p)?E=Pe([m],p):typeof p=="function"&&(E=p(S));var _=w.apply(void 0,E);return kt(v,f,_)}function oe(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 ae(ae({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 xn(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 Pi(t){return typeof t=="function"}function Ii(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?xn(e):[e,r,n],s=i[0],a=i[1],o=i[2],l;if(Pi(t))l=function(){return Bt(t())};else{var c=Bt(t);l=function(){return c}}function f(h,p){h===void 0&&(h=l());var v=Pe([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(J(y)){var w=y,S=m(w,p);return S===void 0?y:S}else{if($(y))return it(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 Di(t,e){return t+"/"+e}function On(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:Bt(t.initialState),n=t.reducers||{},i=Object.keys(n),s={},a={},o={};i.forEach(function(f){var h=n[f],p=Di(e,f),v,y;"reducer"in h?(v=h.reducer,y=h.prepare):v=h,s[f]=v,a[p]=v,o[f]=y?oe(p,y):oe(p)});function l(){var f=typeof t.extraReducers=="function"?xn(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=ae(ae({},p),a);return Ii(r,function(E){for(var _ in S)E.addCase(_,S[_]);for(var O=0,N=y;O<N.length;O++){var z=N[O];E.addMatcher(z.matcher,z.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 Ni="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Mi=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Ni[Math.random()*64|0];return e},ki=["name","message","stack","code"],jt=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Sn=function(){function t(e,r){this.payload=e,this.meta=r}return t}(),Li=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=ki;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},_a=function(){function t(e,r,n){var i=oe(e+"/fulfilled",function(f,h,p,v){return{payload:f,meta:Ft(ae({},v||{}),{arg:p,requestId:h,requestStatus:"fulfilled"})}}),s=oe(e+"/pending",function(f,h,p){return{payload:void 0,meta:Ft(ae({},p||{}),{arg:h,requestId:f,requestStatus:"pending"})}}),a=oe(e+"/rejected",function(f,h,p,v,y){return{payload:v,error:(n&&n.serializeError||Li)(f||"Rejected"),meta:Ft(ae({},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):Mi(),m=new l,w,S=!1;function E(O){w=O,m.abort()}var _=function(){return Ai(this,null,function(){var O,N,z,ce,j,le,ge;return mi(this,function(u){switch(u.label){case 0:return u.trys.push([0,4,,5]),ce=(O=n?.condition)==null?void 0:O.call(n,f,{getState:p,extra:v}),Ui(ce)?[4,ce]:[3,2];case 1:ce=u.sent(),u.label=2;case 2:if(ce===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return S=!0,j=new Promise(function(d,b){return m.signal.addEventListener("abort",function(){return b({name:"AbortError",message:w||"Aborted"})})}),h(s(y,f,(N=n?.getPendingMeta)==null?void 0:N.call(n,{requestId:y,arg:f},{getState:p,extra:v}))),[4,Promise.race([j,Promise.resolve(r(f,{dispatch:h,getState:p,extra:v,requestId:y,signal:m.signal,abort:E,rejectWithValue:function(d,b){return new jt(d,b)},fulfillWithValue:function(d,b){return new Sn(d,b)}})).then(function(d){if(d instanceof jt)throw d;return d instanceof Sn?i(d.payload,y,f,d.meta):i(d,y,f)})])];case 3:return z=u.sent(),[3,5];case 4:return le=u.sent(),z=le instanceof jt?a(null,y,f,le.payload,le.meta):a(le,y,f),[3,5];case 5:return ge=n&&!n.dispatchConditionRejection&&a.match(z)&&z.meta.condition,ge||h(z),[2,z]}})})}();return Object.assign(_,{abort:E,requestId:y,arg:f,unwrap:function(){return _.then(Fi)}})}}return Object.assign(c,{pending:s,rejected:a,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t}();function Fi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Ui(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Tn="listener",_n="completed",Rn="cancelled",Ra="task-"+Rn,Ca="task-"+_n,Pa=Tn+"-"+Rn,Ia=Tn+"-"+_n;var qt="listenerMiddleware";var Da=oe(qt+"/add"),Na=oe(qt+"/removeAll"),Ma=oe(qt+"/remove");var En,ka=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(En||(En=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},ji=function(t){return function(e){setTimeout(e,t)}},La=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:ji(10);an();function Bi(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 at=class extends Bi(Object){};window.ftReduxStores||(window.ftReduxStores={});var Cn=class t extends at{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(De(s))return s;if(i==null)return;let a=On({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),o=wn({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 Xe;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 lt=x(k());var ot=class extends W{async listMySearches(){let{session:e}=g.getState();return Ir(e,D.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ut=class extends W{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 Vi="ft-user-assets",ct=lt.FtReduxStore.get({name:Vi,initialState:{savedSearches:void 0,bookmarks:void 0}}),Vt=class{constructor(){this.currentSession=g.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ut,this.savedSearchesService=new ot,g.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=g.getState();(0,lt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ct.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ct.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ct.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ct.actions.bookmarks(r)}}},Pn=new Vt;var Ht=class{addCommand(e,r=!1){g.commands.add(e,r)}consumeCommand(e){return g.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ht;var In=x(k()),Kt=class{highlightHtml(e,r,n){(0,In.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Kt;var Dn=x(k());var zt=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 Dn.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 zt;var Nn=x(k());var Ue=class{static get(e,r){var n,i,s,a;let o=g.getState(),{lang:l,region:c}=(i=(n=o.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new Nn.SearchPlaceConverter(o.baseUrl,(a=(s=window.FluidTopicsClientConfiguration)===null||s===void 0?void 0:s.predefinedSorts)!==null&&a!==void 0?a:{},e??20,o.searchInAllLanguagesAllowed,r??`${l}-${c}`)}};var dt=class extends xe{async sendDocumentStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.start_display event"),console.debug(r)})}async sendTopicStartDisplayEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send topic.start_display event"),console.debug(r)})}async sendKhubSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send khub.search event"),console.debug(r)})}async sendDocumentSearchEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send document.search event"),console.debug(r)})}async sendSearchPageSelectEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_page.select event"),console.debug(r)})}async sendSearchResultOpenContextMenuEvent(e){return(await this.awaitApi).sendEvents([e]).catch(r=>{console.info("Failed to send search_result.open_context_menu event"),console.debug(r)})}};var Gt=class{urlToSearchRequest(e){return Ue.get().parse(e)}searchRequestToUrl(e){return Ue.get().serialize(e)}};window.FluidTopicsUrlService=new Gt;var ue=x(k());var ve=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};ve.eventName="change";var $t=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))}},Mn=new $t;var ft=class t extends ue.WithEventBus{static build(){return new t(window.history,Mn,()=>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,ue.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,r=!1){var n,i,s;let a={...this.buildCurrentState(),...e,index:this.currentIndex,title:(n=e?.title)!==null&&n!==void 0?n:this.currentState.title},o=r?(i=e?.majorState)!==null&&i!==void 0?i:this.currentState.majorState:(s=this.currentState.majorState)!==null&&s!==void 0?s:e?.majorState;o!=null&&(a.majorState=o),this.setCurrentState(a)}addHistoryChangeListener(e){this.addEventListener(ve.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(ve.eventName,e)}currentItem(){return(0,ue.deepCopy)(this.currentState)}back(){let e=this.previousMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ue.deepCopy)(this.states[this.previousMajorPosition()])}previousMajorPosition(){let e=this.currentIndex;for(;e>0&&!this.isMajorState(e);)e--;return this.previousExistingPosition(e)}forward(){let e=this.nextMajorPosition();e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){return(0,ue.deepCopy)(this.states[this.nextMajorPosition()])}nextMajorPosition(){let e=this.currentIndex;do e++;while(e<this.states.length&&!this.isMajorState(e));do e++;while(e<this.states.length&&!this.isMajorState(e));return this.previousExistingPosition(e)}previousExistingPosition(e){let r=e;do r--;while(r>0&&!this.hasState(r));return r}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isMajorState(e){var r,n;return this.hasState(e)&&((n=(r=this.states[e])===null||r===void 0?void 0:r.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=ft.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});(0,kn.customElement)("ft-app-context")(P);var ht=class extends W{constructor(e){super(!0,e),this.sortObjectFields=(r,n)=>typeof n!="object"||n==null||Array.isArray(n)?n:Object.fromEntries(Object.entries(n).sort(([i],[s])=>i.localeCompare(s)))}async launchSearch(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters),facets:[...e.facets].sort((n,i)=>n.id.localeCompare(i.id))};return this.cache.get("search-"+this.hash(r),async()=>(await this.awaitApi).search(e),2*60*1e3)}async launchSuggest(e){let r={...e,metadataFilters:this.sortFilters(e.metadataFilters)};return this.cache.get("suggest-"+this.hash(r),async()=>(await this.awaitApi).getSuggestions(e),2*60*1e3)}async getAvailableSearchLocales(){return this.cache.get("available-locales",async()=>(await this.awaitApi).getAvailableSearchLocales())}sortFilters(e){return e.map(r=>r.valueFilter==null?r:{...r,valueFilter:{...r.valueFilter,values:[...r.valueFilter.values].sort((n,i)=>n.localeCompare(i))}}).sort((r,n)=>r.key.localeCompare(n.key))}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Hi=t=>t.request.virtualField===Ae.TITLE_ONLY&&t.request.scope===we.DOCUMENTS,pt=class t extends Event{constructor(){super(t.eventName)}};pt.eventName="search-context-clear-all-filters";var je=class t{static build(e,r){return new t(ar(e.trim()||"context"),r)}constructor(e,r){this.store=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.localesDebouncer=new V.Debouncer(10),this.searchDebouncer=new V.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 V.Debouncer(300),this.launchSuggest=n=>this.suggestDebouncer.run(()=>this.fetchSuggestData(n??this.buildSuggestRequest(this.store.getState()))),this.buildSuggestRequest=n=>({input:n.liveQuery,metadataFilters:n.request.metadataFilters,sort:n.request.sort,contentLocale:n.request.contentLocale,scope:n.request.scope}),this.service=r??new ht,this.service.cache.addEventListener("clear-cache",n=>{n.detail.clearedKeys.includes("available-locales")&&this.updateLocales()}),this.searchWatcher=(0,V.watch)(e,this.buildSearchRequest,this.launchSearch),this.suggestWatcher=(0,V.watch)(e,this.buildSuggestRequest,this.launchSuggest)}async initService(){return this.updateLocales(),this.launchSearch()}setQuery(e){this.store.actions.setRequestQuery(e),this.store.actions.liveQuery(e),this.store.actions.setPageNumber(1)}setContentLocale(e){var 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)}setSort(e){this.store.actions.setRequestSort(e),this.store.actions.setPageNumber(1)}setFilters(e){let r=e.filter(n=>!n.valueFilter||n.valueFilter.values.length>0);this.store.actions.setRequestFilters(r),this.store.actions.setPageNumber(1)}setClusterSortCriterion(e){this.store.actions.setRequestClusterSortCriterion(e)}setSearchInDocumentTitlesOnly(e){e?(this.store.actions.setRequestVirtualField(Ae.TITLE_ONLY),this.store.actions.setRequestScope(we.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Ae.EVERYWHERE),this.store.actions.setRequestScope(we.DEFAULT))}setVirtualField(e){this.store.actions.setRequestVirtualField(e)}get searchInDocumentTitlesOnly(){return Hi(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.dispatchEvent(new pt)}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.facets(void 0),this.store.actions.spellcheck(void 0);else{this.cancelableSearch=(0,V.cancelable)(this.service.launchSearch(e));let a=await this.cancelableSearch;if(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 V.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,V.cancelable)(this.service.launchSuggest(e));let n=await this.cancelableSuggest;this.store.actions.suggestResults(n.suggestions)}catch(n){!(n instanceof V.CanceledPromiseError)&&this.errorHandler&&this.errorHandler(n)}}clear(){this.store.clear()}clearResults(){this.store.actions.paging(void 0),this.store.actions.results(void 0),this.store.actions.facets(void 0),this.store.actions.spellcheck(void 0)}};var Ki=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},Qt=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},Ln=Symbol("registerInterval"),Wt=Symbol("registerAttempts"),zi=40;function Gi(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[Wt]=0,this[Ln]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Wt]>zi?window.clearInterval(this[Ln]):(this[Wt]++,this.dispatchEvent(new Qt))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Ki([(0,jn.state)()],e.prototype,"stateManager",void 0),e}var Fn=class extends Gi(Un.FtLitElementRedux){};var Bn=x(k());function Be(t){return t.filter(e=>e.key==="ft:lastEdition").filter(e=>!e.valueFilter).map(e=>e.dateFilter?e.dateFilter.type:"CUSTOM").shift()}function qe(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 yt=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 dt,this.resultsWatcher=(0,Bn.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}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:fe.KHUB__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Be(e.metadataFilters),facets:e.metadataFilters.map(i=>qe(i))}};this.eventsService.sendKhubSearchEvent(n)}sendDocumentSearchEvent(e,r){let n={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.DOCUMENT__SEARCH,searchResponse:{autocorrect:this.store.getState().spellcheck!=null,nbResults:r.length},searchQuery:{terms:e.query,searchType:e.virtualField,lastUpdate:Be(e.metadataFilters),facets:e.metadataFilters.map(i=>qe(i))},document:this.document};this.eventsService.sendDocumentSearchEvent(n)}sendResultClickedEvent(e,r){if(!this.canSendEvent())return;let n=this.store.getState().request,i;e.type==re.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.SEARCH_PAGE__SELECT,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Be(n.metadataFilters),facets:n.metadataFilters.map(a=>qe(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==re.TOPIC&&(i={tocId:e.topic.tocId,title:e.topic.title});let s={offline:!1,appVersion:this.appVersion,appName:this.appName,name:fe.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU,searchQuery:{terms:n.query,searchType:n.virtualField,lastUpdate:Be(n.metadataFilters),facets:n.metadataFilters.map(a=>qe(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 re.MAP:return{id:e.map.mapId,title:e.map.title,type:Ee.STRUCTURED_DOCUMENT,metadata:e.map.metadata};case re.TOPIC:return{id:e.topic.mapId,title:e.topic.mapTitle,type:Ee.STRUCTURED_DOCUMENT,metadata:e.topic.metadata};case re.DOCUMENT:return{id:e.document.documentId,title:e.document.title,type:Ee.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},Yt=class extends CustomEvent{constructor(e){super("ft-search-load-error",{detail:e})}},Xt=class extends CustomEvent{constructor(e){super("ft-search-request-change",{detail:e})}},Jt=class extends CustomEvent{constructor(e,r,n){super("ft-search-results-change",{detail:{request:e,paging:r,spellcheck:n}})}},I=class extends K.FtLitElementRedux{get stateManager(){if(this._stateManager==null){let e=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=je.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 yt(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 qn.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
- `}update(e){super.update(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("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.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 Xt(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Jt(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 Yt(e))}reloadSavedSearches(){Rn.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)}};I.elementDefinitions={};I.styles=sr;U([(0,K.redux)({store:g.name})],I.prototype,"session",void 0);U([(0,Z.property)()],I.prototype,"query",void 0);U([(0,Z.property)()],I.prototype,"contentLocale",void 0);U([(0,Z.property)({type:Number})],I.prototype,"pageSize",void 0);U([(0,Z.property)({type:Boolean})],I.prototype,"searchInDocumentTitlesOnly",void 0);U([(0,Z.property)()],I.prototype,"scope",void 0);U([(0,Z.property)()],I.prototype,"virtualField",void 0);U([(0,Z.property)({type:Boolean})],I.prototype,"ignoreEmptyQuery",void 0);U([(0,K.redux)({store:g.name})],I.prototype,"openExternalDocumentInNewTab",void 0);U([(0,K.jsonProperty)([])],I.prototype,"filters",void 0);U([(0,K.jsonProperty)([])],I.prototype,"sort",void 0);U([(0,K.jsonProperty)({})],I.prototype,"otherQueryParams",void 0);U([(0,K.redux)({store:"search"})],I.prototype,"request",void 0);U([(0,K.redux)({store:"search"})],I.prototype,"paging",void 0);U([(0,K.redux)({store:"search",selector:t=>t.spellcheck})],I.prototype,"autocorrect",void 0);U([(0,Z.property)({attribute:!1})],I.prototype,"searchServiceProvider",void 0);(0,qn.customElement)("ft-search-context")(I);})();
9
+ `}update(e){super.update(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("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.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 Xt(this.request)),e.has("paging")&&this.paging!==void 0&&this.dispatchEvent(new Jt(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 Yt(e))}reloadSavedSearches(){Pn.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)}};I.elementDefinitions={};I.styles=sr;U([(0,K.redux)({store:g.name})],I.prototype,"session",void 0);U([(0,Z.property)()],I.prototype,"query",void 0);U([(0,Z.property)()],I.prototype,"contentLocale",void 0);U([(0,Z.property)({type:Number})],I.prototype,"pageSize",void 0);U([(0,Z.property)({type:Boolean})],I.prototype,"searchInDocumentTitlesOnly",void 0);U([(0,Z.property)()],I.prototype,"scope",void 0);U([(0,Z.property)()],I.prototype,"virtualField",void 0);U([(0,Z.property)({type:Boolean})],I.prototype,"ignoreEmptyQuery",void 0);U([(0,K.redux)({store:g.name})],I.prototype,"openExternalDocumentInNewTab",void 0);U([(0,K.jsonProperty)([])],I.prototype,"filters",void 0);U([(0,K.jsonProperty)([])],I.prototype,"sort",void 0);U([(0,K.jsonProperty)({})],I.prototype,"otherQueryParams",void 0);U([(0,K.redux)({store:"search"})],I.prototype,"request",void 0);U([(0,K.redux)({store:"search"})],I.prototype,"paging",void 0);U([(0,K.redux)({store:"search",selector:t=>t.spellcheck})],I.prototype,"autocorrect",void 0);U([(0,Z.property)({attribute:!1})],I.prototype,"searchServiceProvider",void 0);(0,Vn.customElement)("ft-search-context")(I);})();
10
10
  /*! Bundled license information:
11
11
 
12
12
  @lit/reactive-element/css-tag.js: