@fluid-topics/ft-reader-context 2.2.40 → 2.2.41

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,4 +1,4 @@
1
- "use strict";(()=>{var ai=Object.create;var $r=Object.defineProperty;var oi=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var ar=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var di=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ci(e))!ui.call(t,s)&&s!==r&&$r(t,s,{get:()=>e[s],enumerable:!(n=oi(e,s))||n.enumerable});return t};var f=(t,e,r)=>(r=t!=null?ai(li(t)):{},di(e||!t||!t.__esModule?$r(r,"default",{value:t,enumerable:!0}):r,t));var T=ar((wa,zr)=>{zr.exports=ftGlobals.wcUtils});var le=ar((xa,Gr)=>{Gr.exports=ftGlobals.lit});var ie=ar((Ia,Wr)=>{Wr.exports=ftGlobals.litDecorators});var ni=f(T());var Je=f(le()),se=f(ie()),R=f(T());var fe;(function(t){t.clusteringHelperCreated="clustering-helper-created",t.mapAttachmentsUpdate="map-attachments-update",t.visibleTopicChange="visible-topic-change",t.requestedTopicNotFound="requested-topic-not-found",t.requestedTopicFiltered="requested-topic-filtered"})(fe||(fe={}));var Ze=class extends CustomEvent{constructor(e){super(fe.requestedTopicFiltered,{detail:e})}},ae;(function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"})(ae||(ae={}));var k=f(T());var Qr=f(T()),hi={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Yr=t=>Qr.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,filteredTocNodes:{},paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0,mapRating:void 0,topicsRating:{},translation:{sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1},linkPreviewDialogId:void 0,metadataFilters:[],applyStickyFilters:!1},reducers:hi});var or=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId,translationError:this.paginatedToc.translationError,filteredTocNodes:this.paginatedToc.filteredTocNodes}}extractPagesToc(e,r,n){return e.flatMap(s=>{var i;return s.pageConfiguration&&this.registerPage(this.buildPage(s,n)),s.tocId==null?this.extractPagesToc(s.children,r,n):[{tocId:s.tocId,title:(i=s.title)!==null&&i!==void 0?i:"",contentTag:s.contentTag,contentClass:s.contentClass,untranslatedTitle:s.untranslatedTitle,depth:r,children:this.extractPagesToc(s.children,r+1,s.tocId)}]})}convertNodes(e,r,n){return e.flatMap(s=>{var i,a,o;if(s.tocId==null)return[...this.convertSectionNodes((a=s.pageToc)!==null&&a!==void 0?a:[],r,s.tocId),...this.convertNodes(s.children,r,s.tocId)];let c=(i=s.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),l={tocId:s.tocId,contentId:s.contentId,title:s.title,contentTag:s.contentTag,contentClass:s.contentClass,untranslatedTitle:s.untranslatedTitle,hasRating:s.hasRating,origin:s.origin,prettyUrl:c,depth:r,parentTocId:n,children:[]};this.register(l);let u=this.convertSectionNodes((o=s.pageToc)!==null&&o!==void 0?o:[],r+1,s.tocId),h=this.convertNodes(s.children,r+1,l.tocId);return l.children=[...u,...h],[l]})}convertSectionNodes(e,r,n){return e.flatMap(s=>{var i;let a=(i=s.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),o={...s,prettyUrl:a,depth:r,parentTocId:n,children:[]};return this.register(o),o.children=this.convertSectionNodes(s.children,r+1,s.tocId),[o]})}buildPage(e,r){var n,s,i,a,o,c,l,u;let h=(a=e.tocId)!==null&&a!==void 0?a:(s=(n=e.pageToc)===null||n===void 0?void 0:n[0])===null||s===void 0?void 0:s.tocId,p={number:this.pages.length+1,title:(o=e.title)!==null&&o!==void 0?o:"",untranslatedTitle:e.untranslatedTitle,rootTocId:h??"root",toc:((c=e.pageToc)!==null&&c!==void 0?c:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],rootDepth:h?this.nodeByTocId[h].depth:1,breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},v=(m,I)=>(I?p.topics:p.hiddenTopics).push(m),S=(l=(i=e.pageConfiguration)===null||i===void 0?void 0:i.parentsVisibility)!==null&&l!==void 0?l:[];p.breadcrumb.forEach((m,I)=>{v(m,S[I])}),e.tocId&&v(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[]));let _=this.resolveOverridenRootTocIdByParentForcedByPagination(p.breadcrumb,S);return p.rootTocId=_??p.rootTocId,p.rootDepth=_?this.nodeByTocId[_].depth:p.rootDepth,p}resolveOverridenRootTocIdByParentForcedByPagination(e,r){for(let n=0;n<e.length;n++)if(r[n])return e[n]}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}register(e){e.prettyUrl&&(this.nodeByUrl[e.prettyUrl]==null?this.nodeByUrl[e.prettyUrl]=e:this.duplicatedPrettyUrls.add(e.prettyUrl)),this.nodeByUrl[`${this.mapId}/${e.tocId}`]=e,this.nodeByTocId[e.tocId]=e}},et=class{convertPaginatedToc(e,r){return new or(e,r).build()}};var Xr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Xr||(Xr={}));var Jr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Jr||(Jr={}));var Zr;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Zr||(Zr={}));var ue;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(ue||(ue={}));var en;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(en||(en={}));var tn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(tn||(tn={}));var tt;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(tt||(tt={}));var me;(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.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",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"})(me||(me={}));var rn;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(rn||(rn={}));var nn;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(nn||(nn={}));var sn;(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",t.DOC_DIFF="DOC_DIFF"})(sn||(sn={}));var an;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(an||(an={}));var on;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(on||(on={}));var cn;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(cn||(cn={}));var ln;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(ln||(ln={}));var un;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(un||(un={}));var dn;(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"})(dn||(dn={}));var rt;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(rt||(rt={}));var hn;(function(t){t.ASC="ASC",t.DESC="DESC"})(hn||(hn={}));var pn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(pn||(pn={}));var _e;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(_e||(_e={}));var fn;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(fn||(fn={}));var mn;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(mn||(mn={}));var gn;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(gn||(gn={}));var yn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(yn||(yn={}));var J;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(J||(J={}));var Ce;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ce||(Ce={}));var vn;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(vn||(vn={}));var A;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(A||(A={}));var W;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(W||(W={}));var En;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(En||(En={}));var Sn;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Sn||(Sn={}));var An;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(An||(An={}));var Tn;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Tn||(Tn={}));var bn;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(bn||(bn={}));var _n;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(_n||(_n={}));var Cn;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Cn||(Cn={}));var wn;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(wn||(wn={}));var xn;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(xn||(xn={}));var In;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(In||(In={}));var Rn;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Rn||(Rn={}));var On;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(On||(On={}));var kn;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(kn||(kn={}));var pi={[A.PERSONAL_BOOK_SHARE_USER]:[A.PERSONAL_BOOK_USER],[A.HTML_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.PDF_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.KHUB_ADMIN]:[A.CONTENT_PUBLISHER],[A.ADMIN]:[A.KHUB_ADMIN,A.USERS_ADMIN,A.PORTAL_ADMIN,A.BEHAVIOR_DATA_USER],[A.GENERATIVE_AI_EXPORT_USER]:[A.GENERATIVE_AI_USER]};function Mn(t,e){return t===e||(pi[t]??[]).some(r=>Mn(r,e))}function Q(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=>Mn(n,e))}function Nn(t,...e){return t==null?!1:e.some(r=>Q(t,r))}var Rr=f(ie());var Dn=f(ie(),1);var cr=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},fi=t=>({fromAttribute:e=>{if(e==null)return De(t);try{return JSON.parse(e)}catch{return De(t)}},toAttribute:e=>JSON.stringify(e)});function Fn(t,e){return(0,Dn.property)({type:Object,converter:fi(t),hasChanged:Fe,...e??{}})}function mi(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!we(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(!we(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),i=s(t);if(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(!we(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function we(t,e){try{return mi(t,e)}catch{return!1}}function Fe(t,e){return!we(t,e)}function De(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function nt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var Pn=f(ie(),1);var lr=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:Fe,attribute:!1,...e};(0,Pn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var st=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 ge=f(ie(),1);var it=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 s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ot=f(le(),1);var at=class extends ot.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,ot.adoptStyles)(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){cr(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function Ln(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Ie=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},qn,Un=Symbol("constructorPrototype"),Bn=Symbol("constructorName"),jn=Symbol("exportpartsDebouncer"),Vn=Symbol("dynamicDependenciesLoaded"),xe=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};xe.eventName="exportparts-updated";var Z=class extends at{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[qn]=new it(5),this.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[jn].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Bn]=this.constructor.name,this[Un]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Bn]&&Object.setPrototypeOf(this,this[Un])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Vn]||(r[Vn]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(xe.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(xe.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new xe)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=Ln(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(e){var r,n,s,i,a,o;let c=p=>p!=null&&p.trim().length>0,l=e.filter(c).map(p=>p.trim());if(l.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let v=(a=(n=p.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],S=(o=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(m=>m.split(":")[1]))!==null&&o!==void 0?o:[],_=[...v,...S].filter(c).map(m=>m.trim());for(let m of _)u.add(m)}if(u.size===0){this.exportparts=void 0;return}let h=[...u.values()].flatMap(p=>l.map(v=>`${p}:${v}--${p}`));this.exportparts=[...this.part,...h].join(", ")}};qn=jn;Ie([(0,ge.property)()],Z.prototype,"exportpartsPrefix",void 0);Ie([Fn([])],Z.prototype,"exportpartsPrefixes",void 0);Ie([(0,ge.property)({reflect:!0})],Z.prototype,"exportparts",void 0);Ie([(0,ge.property)()],Z.prototype,"customStylesheet",void 0);Ie([(0,ge.property)()],Z.prototype,"elementToFocus",void 0);Ie([(0,ge.state)()],Z.prototype,"useAdoptedStyleSheets",void 0);function ct(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Pe=Symbol("internalReduxEventsUnsubscribers"),de=Symbol("internalStoresUnsubscribers"),ye=Symbol("internalStores"),gi=nt(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ye].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ye].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ye].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ye].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ye].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ye].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let l=this.getStore(a.store);l&&(a.store?this[de].has(a.store):this[de].size>0)&&(this[o]=a.selector(l.getState(),this))}})}subscribeToStore(a,o){var c,l;this[de].set(a,o.subscribe(()=>this.updateFromStores())),this[Pe].set(a,[]),ct(o)&&(!((c=o.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((u,h)=>{this.getStore(u.store)===o&&o.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",o.name)}),o.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((u,h)=>{if(typeof this[h]=="function"&&(!u.store||o.name===u.store)){let p=v=>this[h](v);o.addEventListener(u.eventName,p),this[Pe].get(a).push(()=>o.removeEventListener(u.eventName,p))}}))),this.onStoreAvailable(a)}unsubscribeFromStores(){this[de].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[de].has(a)&&this[de].get(a)(),this[de].delete(a),(o=this[Pe].get(a))===null||o===void 0||o.forEach(c=>c()),this[Pe].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=de,r=ye,n=Pe,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),Hn=class extends gi(Z){};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 yi=typeof Symbol=="function"&&Symbol.observable||"@@observable",Kn=yi,ur=()=>Math.random().toString(36).substring(7).split("").join("."),vi={INIT:`@@redux/INIT${ur()}`,REPLACE:`@@redux/REPLACE${ur()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ur()}`},lt=vi;function ut(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function dr(t,e,r){if(typeof t!="function")throw new Error(F(2));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(dr)(t,e)}let n=t,s=e,i=new Map,a=i,o=0,c=!1;function l(){a===i&&(a=new Map,i.forEach((m,I)=>{a.set(I,m)}))}function u(){if(c)throw new Error(F(3));return s}function h(m){if(typeof m!="function")throw new Error(F(4));if(c)throw new Error(F(5));let I=!0;l();let H=o++;return a.set(H,m),function(){if(I){if(c)throw new Error(F(6));I=!1,l(),a.delete(H),i=null}}}function p(m){if(!ut(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(typeof m.type!="string")throw new Error(F(17));if(c)throw new Error(F(9));try{c=!0,s=n(s,m)}finally{c=!1}return(i=a).forEach(H=>{H()}),m}function v(m){if(typeof m!="function")throw new Error(F(10));n=m,p({type:lt.REPLACE})}function S(){let m=h;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(F(11));function H(){let y=I;y.next&&y.next(u())}return H(),{unsubscribe:m(H)}},[Kn](){return this}}}return p({type:lt.INIT}),{dispatch:p,subscribe:h,getState:u,replaceReducer:v,[Kn]:S}}function Ei(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:lt.INIT})>"u")throw new Error(F(12));if(typeof r(void 0,{type:lt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function hr(t){let e=Object.keys(t),r={};for(let a=0;a<e.length;a++){let o=e[a];typeof t[o]=="function"&&(r[o]=t[o])}let n=Object.keys(r),s,i;try{Ei(r)}catch(a){i=a}return function(o={},c){if(i)throw i;let l=!1,u={};for(let h=0;h<n.length;h++){let p=n[h],v=r[p],S=o[p],_=v(S,c);if(typeof _>"u"){let m=c&&c.type;throw new Error(F(14))}u[p]=_,l=l||_!==S}return l=l||n.length!==Object.keys(o).length,l?u:o}}function Le(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function $n(...t){return e=>(r,n)=>{let s=e(r,n),i=()=>{throw new Error(F(15))},a={getState:s.getState,dispatch:(c,...l)=>i(c,...l)},o=t.map(c=>c(a));return i=Le(...o)(s.dispatch),{...s,dispatch:i}}}function zn(t){return ut(t)&&"type"in t&&typeof t.type=="string"}var ts=Symbol.for("immer-nothing"),Gn=Symbol.for("immer-draftable"),U=Symbol.for("immer-state");function X(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var K=Object,Oe=K.getPrototypeOf,ft="constructor",St="prototype",gr="configurable",mt="enumerable",ht="writable",Ue="value",ee=t=>!!t&&!!t[U];function $(t){return t?rs(t)||Tt(t)||!!t[Gn]||!!t[ft]?.[Gn]||bt(t)||je(t):!1}var Si=K[St][ft].toString(),Wn=new WeakMap;function rs(t){if(!t||!_r(t))return!1;let e=Oe(t);if(e===null||e===K[St])return!0;let r=K.hasOwnProperty.call(e,ft)&&e[ft];if(r===Object)return!0;if(!Re(r))return!1;let n=Wn.get(r);return n===void 0&&(n=Function.toString.call(r),Wn.set(r,n)),n===Si}function At(t,e,r=!0){qe(t)===0?(r?Reflect.ownKeys(t):K.keys(t)).forEach(s=>{e(s,t[s],t)}):t.forEach((n,s)=>e(s,n,t))}function qe(t){let e=t[U];return e?e.type_:Tt(t)?1:bt(t)?2:je(t)?3:0}var pr=(t,e,r=qe(t))=>r===2?t.has(e):K[St].hasOwnProperty.call(t,e),yr=(t,e,r=qe(t))=>r===2?t.get(e):t[e],gt=(t,e,r,n=qe(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function Ai(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Tt=Array.isArray,bt=t=>t instanceof Map,je=t=>t instanceof Set,_r=t=>typeof t=="object",Re=t=>typeof t=="function",fr=t=>typeof t=="boolean";function Ti(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var oe=t=>t.copy_||t.base_;var Cr=t=>t.modified_?t.copy_:t.base_;function vr(t,e){if(bt(t))return new Map(t);if(je(t))return new Set(t);if(Tt(t))return Array[St].slice.call(t);let r=rs(t);if(e===!0||e==="class_only"&&!r){let n=K.getOwnPropertyDescriptors(t);delete n[U];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let a=s[i],o=n[a];o[ht]===!1&&(o[ht]=!0,o[gr]=!0),(o.get||o.set)&&(n[a]={[gr]:!0,[ht]:!0,[mt]:o[mt],[Ue]:t[a]})}return K.create(Oe(t),n)}else{let n=Oe(t);if(n!==null&&r)return{...t};let s=K.create(n);return K.assign(s,t)}}function _t(t,e=!1){return Ct(t)||ee(t)||!$(t)||(qe(t)>1&&K.defineProperties(t,{set:dt,add:dt,clear:dt,delete:dt}),K.freeze(t),e&&At(t,(r,n)=>{_t(n,!0)},!1)),t}function bi(){X(2)}var dt={[Ue]:bi};function Ct(t){return t===null||!_r(t)?!0:K.isFrozen(t)}var yt="MapSet",Er="Patches",Qn="ArrayMethods",ns={};function ve(t){let e=ns[t];return e||X(0,t),e}var Yn=t=>!!ns[t];var Be,ss=()=>Be,_i=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Yn(yt)?ve(yt):void 0,arrayMethodsPlugin_:Yn(Qn)?ve(Qn):void 0});function Xn(t,e){e&&(t.patchPlugin_=ve(Er),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Sr(t){Ar(t),t.drafts_.forEach(Ci),t.drafts_=null}function Ar(t){t===Be&&(Be=t.parent_)}var Jn=t=>Be=_i(Be,t);function Ci(t){let e=t[U];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Zn(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[U].modified_&&(Sr(e),X(4)),$(t)&&(t=es(e,t));let{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(r[U].base_,t,e)}else t=es(e,r);return wi(e,t,!0),Sr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==ts?t:void 0}function es(t,e){if(Ct(e))return e;let r=e[U];if(!r)return vt(e,t.handledSet_,t);if(!wt(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);os(r,t)}return r.copy_}function wi(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&_t(e,r)}function is(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var wt=(t,e)=>t.scope_===e,xi=[];function as(t,e,r,n){let s=oe(t),i=t.type_;if(n!==void 0&&yr(s,n,i)===e){gt(s,n,r,i);return}if(!t.draftLocations_){let o=t.draftLocations_=new Map;At(s,(c,l)=>{if(ee(l)){let u=o.get(l)||[];u.push(c),o.set(l,u)}})}let a=t.draftLocations_.get(e)??xi;for(let o of a)gt(s,o,r,i)}function Ii(t,e,r){t.callbacks_.push(function(s){let i=e;if(!i||!wt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let a=Cr(i);as(t,i.draft_??i,a,r),os(i,s)})}function os(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:n}=e;if(n){let s=n.getPath(t);s&&n.generatePatches_(t,s,e)}is(t)}}function Ri(t,e,r){let{scope_:n}=t;if(ee(r)){let s=r[U];wt(s,n)&&s.callbacks_.push(function(){pt(t);let a=Cr(s);as(t,r,a,e)})}else $(r)&&t.callbacks_.push(function(){let i=oe(t);t.type_===3?i.has(r)&&vt(r,n.handledSet_,n):yr(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&vt(yr(t.copy_,e,t.type_),n.handledSet_,n)})}function vt(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ee(t)||e.has(t)||!$(t)||Ct(t)||(e.add(t),At(t,(n,s)=>{if(ee(s)){let i=s[U];if(wt(i,r)){let a=Cr(i);gt(t,n,a,t.type_),is(i)}}else $(s)&&vt(s,e,r)})),t}function Oi(t,e){let r=Tt(t),n={type_:r?1:0,scope_:e?e.scope_:ss(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=Et;r&&(s=[n],i=Ve);let{revoke:a,proxy:o}=Proxy.revocable(s,i);return n.draft_=o,n.revoke_=a,[o,n]}var Et={get(t,e){if(e===U)return t;let r=t.scope_.arrayMethodsPlugin_,n=t.type_===1&&typeof e=="string";if(n&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let s=oe(t);if(!pr(s,e,t.type_))return Mi(t,s,e);let i=s[e];if(t.finalized_||!$(i)||n&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Ti(e))return i;if(i===mr(t.base_,e)||ki(t,e,i)){pt(t);let a=t.type_===1?+e:e,o=br(t.scope_,i,t,a);return t.copy_[a]=o}return i},has(t,e){return e in oe(t)},ownKeys(t){return Reflect.ownKeys(oe(t))},set(t,e,r){let n=cs(oe(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let s=mr(oe(t),e),i=s?.[U];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Ai(r,s)&&(r!==void 0||pr(t.base_,e,t.type_)))return!0;pt(t),Tr(t)}return t.copy_[e]===r&&(r!==void 0||pr(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Ri(t,e,r)),!0},deleteProperty(t,e){return pt(t),mr(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),Tr(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=oe(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[ht]:!0,[gr]:t.type_!==1||e!=="length",[mt]:n[mt],[Ue]:r[e]}},defineProperty(){X(11)},getPrototypeOf(t){return Oe(t.base_)},setPrototypeOf(){X(12)}},Ve={};for(let t in Et){let e=Et[t];Ve[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Ve.deleteProperty=function(t,e){return Ve.set.call(this,t,e,void 0)};Ve.set=function(t,e,r){return Et.set.call(this,t[0],e,r,t[0])};function mr(t,e){let r=t[U];return(r?oe(r):t)[e]}function ki(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!$(r)||r[U]?!1:t.baseRefs_.has(r)}function Mi(t,e,r){let n=cs(e,r);return n?Ue in n?n[Ue]:n.get?.call(t.draft_):void 0}function cs(t,e){if(!(e in t))return;let r=Oe(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Oe(r)}}function Tr(t){t.modified_||(t.modified_=!0,t.parent_&&Tr(t.parent_))}function pt(t){t.copy_||(t.assigned_=new Map,t.copy_=vr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Ni=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,n)=>{if(Re(e)&&!Re(r)){let i=r;r=e;let a=this;return function(c=i,...l){return a.produce(c,u=>r.call(this,u,...l))}}Re(r)||X(6),n!==void 0&&!Re(n)&&X(7);let s;if($(e)){let i=Jn(this),a=br(i,e,void 0),o=!0;try{s=r(a),o=!1}finally{o?Sr(i):Ar(i)}return Xn(i,n),Zn(s,i)}else if(!e||!_r(e)){if(s=r(e),s===void 0&&(s=e),s===ts&&(s=void 0),this.autoFreeze_&&_t(s,!0),n){let i=[],a=[];ve(Er).generateReplacementPatches_(e,s,{patches_:i,inversePatches_:a}),n(i,a)}return s}else X(1,e)},this.produceWithPatches=(e,r)=>{if(Re(e))return(a,...o)=>this.produceWithPatches(a,c=>e(c,...o));let n,s;return[this.produce(e,r,(a,o)=>{n=a,s=o}),n,s]},fr(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),fr(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),fr(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){$(t)||X(8),ee(t)&&(t=ls(t));let e=Jn(this),r=br(e,t,void 0);return r[U].isManual_=!0,Ar(e),r}finishDraft(t,e){let r=t&&t[U];(!r||!r.isManual_)&&X(9);let{scope_:n}=r;return Xn(n,e),Zn(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let s=e[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(e=e.slice(r+1));let n=ve(Er).applyPatches_;return ee(t)?n(t,e):this.produce(t,s=>n(s,e))}};function br(t,e,r,n){let[s,i]=bt(e)?ve(yt).proxyMap_(e,r):je(e)?ve(yt).proxySet_(e,r):Oi(e,r);return(r?.scope_??ss()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Ii(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:l}=c;i.modified_&&l&&l.generatePatches_(i,[],c)}),s}function ls(t){return ee(t)||X(10,t),us(t)}function us(t){if(!$(t)||Ct(t))return t;let e=t[U],r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=vr(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=vr(t,!0);let s=r;return je(r)&&(r=new Set),At(s,(i,a)=>{gt(r,i,us(a))},n),e&&(e.finalized_=!1),r}var Di=globalThis.Iterator,vo=typeof Di?.from=="function";var Fi=new Ni,wr=Fi.produce;function ds(t){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,t):s(i)}var hs=ds(),ps=ds;var Pi=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Le:Le.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Li=t=>t&&typeof t.match=="function";function he(t,e){function r(...n){if(e){let s=e(...n);if(!s)throw new Error(te(0));return{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=()=>`${t}`,r.type=t,r.match=n=>zn(n)&&n.type===t,r}var vs=class He extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,He.prototype)}static get[Symbol.species](){return He}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new He(...e[0].concat(this)):new He(...e.concat(this))}};function fs(t){return $(t)?wr(t,()=>{}):t}function xt(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function Ui(t){return typeof t=="boolean"}var Bi=()=>function(e){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=e??{},a=new vs;return r&&(Ui(r)?a.push(hs):a.push(ps(r.extraArgument))),a},Vi="RTK_autoBatch";var ms=t=>e=>{setTimeout(e,t)},qi=(t,e)=>r=>{let n=!1,s,i,a=()=>{n||(n=!0,cancelAnimationFrame(s),clearTimeout(i),r())};s=t(a),i=setTimeout(a,e)},ji=(t={type:"raf"})=>e=>(...r)=>{let n=e(...r),s=!0,i=!1,a=!1,o=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?qi(window.requestAnimationFrame,100):ms(10):t.type==="callback"?t.queueNotification:ms(t.timeout),l=()=>{a=!1,i&&(i=!1,o.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){let h=()=>s&&u(),p=n.subscribe(h);return o.add(u),()=>{p(),o.delete(u)}},dispatch(u){try{return s=!u?.meta?.[Vi],i=!s,i&&(a||(a=!0,c(l))),n.dispatch(u)}finally{s=!0}}})},Hi=t=>function(r){let{autoBatch:n=!0}=r??{},s=new vs(t);return n&&s.push(ji(typeof n=="object"?n:void 0)),s};function Es(t){let e=Bi(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=t||{},c;if(typeof r=="function")c=r;else if(ut(r))c=hr(r);else throw new Error(te(1));let l;typeof n=="function"?l=n(e):l=e();let u=Le;s&&(u=Pi({trace:!1,...typeof s=="object"&&s}));let h=$n(...l),p=Hi(h),v=typeof o=="function"?o(p):p(),S=u(...v);return dr(c,a,S)}function Ss(t){let e={},r=[],n,s={addCase(i,a){let o=typeof i=="string"?i:i.type;if(!o)throw new Error(te(28));if(o in e)throw new Error(te(29));return e[o]=a,s},addAsyncThunk(i,a){return a.pending&&(e[i.pending.type]=a.pending),a.rejected&&(e[i.rejected.type]=a.rejected),a.fulfilled&&(e[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){return n=i,s}};return t(s),[e,r,n]}function Ki(t){return typeof t=="function"}function $i(t,e){let[r,n,s]=Ss(e),i;if(Ki(t))i=()=>fs(t());else{let o=fs(t);i=()=>o}function a(o=i(),c){let l=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[s]),l.reduce((u,h)=>{if(h)if(ee(u)){let p=h(u,c);return p===void 0?u:p}else{if($(u))return wr(u,p=>h(p,c));{let p=h(u,c);if(p===void 0){if(u===null)return u;throw new Error(te(9))}return p}}return u},o)}return a.getInitialState=i,a}var zi=(t,e)=>Li(t)?t.match(e):t(e);function Gi(...t){return e=>t.some(r=>zi(r,e))}var Wi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qi=(t=21)=>{let e="",r=t;for(;r--;)e+=Wi[Math.random()*64|0];return e},Yi=["name","message","stack","code"],xr=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},gs=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},Xi=t=>{if(typeof t=="object"&&t!==null){let e={};for(let r of Yi)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},ys="External signal was aborted",Ji=(()=>{function t(e,r,n){let s=he(e+"/fulfilled",(c,l,u,h)=>({payload:c,meta:{...h||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),i=he(e+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),a=he(e+"/rejected",(c,l,u,h,p)=>({payload:h,error:(n&&n.serializeError||Xi)(c||"Rejected"),meta:{...p||{},arg:u,requestId:l,rejectedWithValue:h!==void 0,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function o(c,{signal:l}={}){return(u,h,p)=>{let v=n?.idGenerator?n.idGenerator(c):Qi(),S=new AbortController,_,m;function I(g){m=g,S.abort()}l&&(l.aborted?I(ys):l.addEventListener("abort",()=>I(ys),{once:!0}));let H=(async function(){let g;try{let y=n?.condition?.(c,{getState:h,extra:p});if(ea(y)&&(y=await y),y===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(S.signal.aborted)throw{name:"AbortError",message:m||"Aborted"};let D=new Promise((O,L)=>{_=()=>{L({name:"AbortError",message:m||"Aborted"})},S.signal.addEventListener("abort",_,{once:!0})});u(i(v,c,n?.getPendingMeta?.({requestId:v,arg:c},{getState:h,extra:p}))),g=await Promise.race([D,Promise.resolve(r(c,{dispatch:u,getState:h,extra:p,requestId:v,signal:S.signal,abort:I,rejectWithValue:((O,L)=>new xr(O,L)),fulfillWithValue:((O,L)=>new gs(O,L))})).then(O=>{if(O instanceof xr)throw O;return O instanceof gs?s(O.payload,v,c,O.meta):s(O,v,c)})])}catch(y){g=y instanceof xr?a(null,v,c,y.payload,y.meta):a(y,v,c)}finally{_&&S.signal.removeEventListener("abort",_)}return n&&!n.dispatchConditionRejection&&a.match(g)&&g.meta.condition||u(g),g})();return Object.assign(H,{abort:I,requestId:v,arg:c,unwrap(){return H.then(Zi)}})}}return Object.assign(o,{pending:i,rejected:a,fulfilled:s,settled:Gi(a,s),typePrefix:e})}return t.withTypes=()=>t,t})();function Zi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ea(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var As=Symbol.for("rtk-slice-createasyncthunk"),wo={[As]:Ji};function ta(t,e){return`${t}/${e}`}function ra({creators:t}={}){let e=t?.asyncThunk?.[As];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(te(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(sa()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(g,y){let D=typeof g=="string"?g:g.type;if(!D)throw new Error(te(12));if(D in c.sliceCaseReducersByType)throw new Error(te(13));return c.sliceCaseReducersByType[D]=y,l},addMatcher(g,y){return c.sliceMatchers.push({matcher:g,reducer:y}),l},exposeAction(g,y){return c.actionCreators[g]=y,l},exposeCaseReducer(g,y){return c.sliceCaseReducersByName[g]=y,l}};o.forEach(g=>{let y=a[g],D={reducerName:g,type:ta(s,g),createNotation:typeof n.reducers=="function"};aa(y)?ca(D,y,l,e):ia(D,y,l)});function u(){let[g={},y=[],D=void 0]=typeof n.extraReducers=="function"?Ss(n.extraReducers):[n.extraReducers],O={...g,...c.sliceCaseReducersByType};return $i(n.initialState,L=>{for(let B in O)L.addCase(B,O[B]);for(let B of c.sliceMatchers)L.addMatcher(B.matcher,B.reducer);for(let B of y)L.addMatcher(B.matcher,B.reducer);D&&L.addDefaultCase(D)})}let h=g=>g,p=new Map,v=new WeakMap,S;function _(g,y){return S||(S=u()),S(g,y)}function m(){return S||(S=u()),S.getInitialState()}function I(g,y=!1){function D(L){let B=L[g];return typeof B>"u"&&y&&(B=xt(v,D,m)),B}function O(L=h){return xt(xt(p,y,()=>new WeakMap),L,()=>{let B={};for(let[si,ii]of Object.entries(n.selectors??{}))B[si]=na(ii,L,()=>xt(v,L,m),y);return B})}return{reducerPath:g,getSelectors:O,get selectors(){return O(D)},selectSlice:D}}let H={name:s,reducer:_,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:m,...I(i),injectInto(g,{reducerPath:y,...D}={}){let O=y??i;return g.inject({reducerPath:O,reducer:_},D),{...H,...I(O,!0)}}};return H}}function na(t,e,r,n){function s(i,...a){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...a)}return s.unwrapped=t,s}var Ts=ra();function sa(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function ia({type:t,reducerName:e,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!oa(n))throw new Error(te(17));i=n.reducer,a=n.prepare}else i=n;s.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,a?he(t,a):he(t))}function aa(t){return t._reducerDefinitionType==="asyncThunk"}function oa(t){return t._reducerDefinitionType==="reducerWithPrepare"}function ca({type:t,reducerName:e},r,n,s){if(!s)throw new Error(te(18));let{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:l,options:u}=r,h=s(t,i,u);n.exposeAction(e,h),a&&n.addCase(h.fulfilled,a),o&&n.addCase(h.pending,o),c&&n.addCase(h.rejected,c),l&&n.addMatcher(h.settled,l),n.exposeCaseReducer(e,{fulfilled:a||It,pending:o||It,rejected:c||It,settled:l||It})}function It(){}var bs="listener",_s="completed",Cs="cancelled",xo=`task-${Cs}`,Io=`task-${_s}`,Ro=`${bs}-${Cs}`,Oo=`${bs}-${_s}`;var{assign:ws}=Object;var Ir="listenerMiddleware";var la=ws(he(`${Ir}/add`),{withTypes:()=>la}),ko=he(`${Ir}/removeAll`),ua=ws(he(`${Ir}/remove`),{withTypes:()=>ua});function te(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var da=nt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),Rt=class extends da(Object){};window.ftReduxStores||(window.ftReduxStores={});var xs=class t extends Rt{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(ct(i))return i;if(s==null)return;let a=Ts({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=Es({reducer:(c,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let u=De(a.getInitialState());for(let h of l.keeping)u[h]=(c??u)[h];return u}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...l.overwrites};return a.reducer(c,l)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus,s.deprecatedKeys)}constructor(e,r,n,s){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new st,this.injectInto=(a,o)=>this.reduxSlice.injectInto(a,o),this.selectSlice=a=>this.reduxSlice.selectSlice(a);let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,o,c)=>{let l=o,u=a[l];return u?(...h)=>{let p=u(...h.map(i));return this.reduxStore.dispatch(p),p}:h=>{let p=l,v=this.getState()[p];we(v,h)||this.setState({[p]:i(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Ot=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var kt=f(T()),ha="ft-app-info",z=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};z.eventName="authentication-change";var Ke=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ke.eventName="ui-locale-changed";var pa={session:(t,e)=>{(0,kt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>d.dispatchEvent(new z(e.payload)),0))}},d=kt.FtReduxStore.get({name:ha,reducers:pa,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Is=f(T()),Mt=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},oc=(0,Is.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(d)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>Ot.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Mt([(0,Rr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Mt([(0,Rr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Mt([lr({store:d.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),Mt([lr({store:d.name})],e.prototype,"uiLocale",void 0),e});var Lt=f(T());var Or=f(T());var Ee=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=d.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=d.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var ke=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ee.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ee.await()}};var M=class extends ke{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Or.CacheRegistry,this.cache=e?s.commonCache:new Or.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Nt=class extends M{async listMySearches(){let{session:e}=d.getState();return Q(e,A.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Dt=class extends M{async listMyBookmarks(){let e=d.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Ft=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var Pt=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var fa="ft-user-assets",ma={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(W).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:s}=e.payload;Mr(t,r,[...kr(t,r),s]),Rs(t,r,1,n),Os(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;Mr(t,r,kr(t,r).map(s=>s.id===n.id?n:s)),Os(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;Mr(t,r,kr(t,r).filter(i=>i.id!==s)),Rs(t,r,-1,n)}},ks={[W.SEARCHES]:"savedSearches",[W.BOOKMARKS]:"bookmarks",[W.BOOKS]:void 0,[W.COLLECTIONS]:void 0},kr=(t,e)=>{var r;let n=ks[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},Mr=(t,e,r)=>{let n=ks[e];n&&(t[n]=r)},Rs=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===W.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Os=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},V=Lt.FtReduxStore.get({name:fa,reducers:ma,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(W).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Nr=class{constructor(e=new Ft,r=new Pt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=d.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Dt,this.savedSearchesService=new Nt,d.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=d.getState();(0,Lt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),V.actions.clearAssetCount(),V.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),V.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),V.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();V.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();V.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&V.getState().assetCounts.allAsset[e]!==r.count&&V.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&V.getState().assetCounts.bookmarkByMap[e]!==r.count&&V.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(V.getState().assetCounts.bookmarkByMap).length!==0;e===W.BOOKMARKS&&r&&V.actions.clearBookmarkCountByMap(),V.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;V.actions.bookmarks(r)}}},Dr=new Nr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Dr);var Fr=class{addCommand(e,r=!1){d.commands.add(e,r)}consumeCommand(e){return d.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Fr;var Y=f(T());var Ms,Me=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ga=Symbol("clearAfterUnitTest"),Ut=class extends(0,Y.withEventBus)(M){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ms]=()=>{this.defaultMessages={},this.cache=new Y.CacheRegistry,this.listeners={}},this.currentUiLocale=d.getState().uiLocale,d.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=d.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 s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,Y.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,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 s;let i=e.toLowerCase(),a=this.resolveContext(i);return new Y.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof Y.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Me({loadedContexts:e})),this.dispatchEvent(new Me({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Me({loadedContexts:[e]})),this.dispatchEvent(new Me({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,Y.delay)(0).then(()=>n()).catch(()=>null)))}};Ms=ga;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Ns=window.FluidTopicsI18nService,jc=window.FluidTopicsCustomI18nService;var Ds=f(T()),Pr=class{highlightHtml(e,r,n){(0,Ds.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Pr;var Fs=f(T());var Lr=class{isDate(e){var r,n,s,i;return(i=(n=((s=(r=d.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(o=>o.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return Fs.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:d.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new Lr;var Ps=f(T());var $e=class{static get(e,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=d.getState()){var a;if(!r||i.length>0&&!i.some(o=>o.lang===r)){let o=s?.defaultLocales.defaultContentLocale;r=o?`${o.lang}-${o.region}`:(a=i[0])===null||a===void 0?void 0:a.lang}return new Ps.SearchPlaceConverter(n,e??20,s?.allLanguagesAllowed,r,i)}};var Ne=class extends M{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return document.dispatchEvent(new CustomEvent("ft:analytics:userevents",{detail:e})),this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var Ur=class{urlToSearchRequest(e){return $e.get().parse(e)}searchRequestToUrl(e){return $e.get().serialize(e)}};window.FluidTopicsUrlService=new Ur;var ce=f(T());var Se=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Se.eventName="before-location-change";var Ae=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Ae.eventName="change";var Br=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))}},Ls=new Br;var Bt=class t extends ce.WithEventBus{static build(){return new t(window.history,Ls,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}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,ce.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Ae(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=new URL(typeof o=="string"?o:(o??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),l=new Se(c);this.dispatchEvent(l);let u=r(),h={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:l.detail.nextLocation.href};n.apply(s,[h,a,h.href]),this.setCurrentState(h,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(Se.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Se.eventName,e)}addHistoryChangeListener(e){this.addEventListener(Ae.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ae.eventName,e)}currentItem(){return(0,ce.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ce.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,ce.deepCopy)(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,ce.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Us=f(le());var Bs=Us.css`
1
+ "use strict";(()=>{var ai=Object.create;var $r=Object.defineProperty;var oi=Object.getOwnPropertyDescriptor;var ci=Object.getOwnPropertyNames;var li=Object.getPrototypeOf,ui=Object.prototype.hasOwnProperty;var ar=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}};var di=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of ci(e))!ui.call(t,s)&&s!==r&&$r(t,s,{get:()=>e[s],enumerable:!(n=oi(e,s))||n.enumerable});return t};var f=(t,e,r)=>(r=t!=null?ai(li(t)):{},di(e||!t||!t.__esModule?$r(r,"default",{value:t,enumerable:!0}):r,t));var T=ar((wa,zr)=>{zr.exports=ftGlobals.wcUtils});var le=ar((xa,Gr)=>{Gr.exports=ftGlobals.lit});var ie=ar((Ia,Wr)=>{Wr.exports=ftGlobals.litDecorators});var ni=f(T());var Je=f(le()),se=f(ie()),R=f(T());var fe;(function(t){t.clusteringHelperCreated="clustering-helper-created",t.mapAttachmentsUpdate="map-attachments-update",t.visibleTopicChange="visible-topic-change",t.requestedTopicNotFound="requested-topic-not-found",t.requestedTopicFiltered="requested-topic-filtered"})(fe||(fe={}));var Ze=class extends CustomEvent{constructor(e){super(fe.requestedTopicFiltered,{detail:e})}},ae;(function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"})(ae||(ae={}));var k=f(T());var Qr=f(T()),hi={setTranslationDestinationLanguage:(t,e)=>{t.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(t,e)=>{t.translation.sourceLanguage=e.payload},setTranslationProfileId:(t,e)=>{t.translation.profileId=e.payload},setTranslationLoading:(t,e)=>{t.translation.isLoading=e.payload},setTranslationError:(t,e)=>{t.translation.isError=e.payload},setTopicsRating:(t,e)=>{for(let r in e.payload)t.topicsRating[r]=e.payload[r]}},Yr=t=>Qr.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,filteredTocNodes:{},paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0,mapRating:void 0,topicsRating:{},translation:{sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1},linkPreviewDialogId:void 0,metadataFilters:[],applyStickyFilters:!1},reducers:hi});var or=class{constructor(e,r){this.mapId=e,this.paginatedToc=r,this.nodeByTocId={},this.nodeByUrl={},this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,nodeByUrl:this.nodeByUrl,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId,translationError:this.paginatedToc.translationError,filteredTocNodes:this.paginatedToc.filteredTocNodes}}extractPagesToc(e,r,n){return e.flatMap(s=>{var i;return s.pageConfiguration&&this.registerPage(this.buildPage(s,n)),s.tocId==null?this.extractPagesToc(s.children,r,n):[{tocId:s.tocId,title:(i=s.title)!==null&&i!==void 0?i:"",contentTag:s.contentTag,contentClass:s.contentClass,untranslatedTitle:s.untranslatedTitle,depth:r,children:this.extractPagesToc(s.children,r+1,s.tocId)}]})}convertNodes(e,r,n){return e.flatMap(s=>{var i,a,o;if(s.tocId==null)return[...this.convertSectionNodes((a=s.pageToc)!==null&&a!==void 0?a:[],r,s.tocId),...this.convertNodes(s.children,r,s.tocId)];let c=(i=s.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),l={tocId:s.tocId,contentId:s.contentId,title:s.title,contentTag:s.contentTag,contentClass:s.contentClass,untranslatedTitle:s.untranslatedTitle,hasRating:s.hasRating,origin:s.origin,prettyUrl:c,depth:r,parentTocId:n,children:[]};this.register(l);let u=this.convertSectionNodes((o=s.pageToc)!==null&&o!==void 0?o:[],r+1,s.tocId),h=this.convertNodes(s.children,r+1,l.tocId);return l.children=[...u,...h],[l]})}convertSectionNodes(e,r,n){return e.flatMap(s=>{var i;let a=(i=s.prettyUrl)===null||i===void 0?void 0:i.replace(/^\//,""),o={...s,prettyUrl:a,depth:r,parentTocId:n,children:[]};return this.register(o),o.children=this.convertSectionNodes(s.children,r+1,s.tocId),[o]})}buildPage(e,r){var n,s,i,a,o,c,l,u;let h=(a=e.tocId)!==null&&a!==void 0?a:(s=(n=e.pageToc)===null||n===void 0?void 0:n[0])===null||s===void 0?void 0:s.tocId,p={number:this.pages.length+1,title:(o=e.title)!==null&&o!==void 0?o:"",untranslatedTitle:e.untranslatedTitle,rootTocId:h??"root",toc:((c=e.pageToc)!==null&&c!==void 0?c:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],rootDepth:h?this.nodeByTocId[h].depth:1,breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},v=(m,I)=>(I?p.topics:p.hiddenTopics).push(m),S=(l=(i=e.pageConfiguration)===null||i===void 0?void 0:i.parentsVisibility)!==null&&l!==void 0?l:[];p.breadcrumb.forEach((m,I)=>{v(m,S[I])}),e.tocId&&v(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[]));let _=this.resolveOverridenRootTocIdByParentForcedByPagination(p.breadcrumb,S);return p.rootTocId=_??p.rootTocId,p.rootDepth=_?this.nodeByTocId[_].depth:p.rootDepth,p}resolveOverridenRootTocIdByParentForcedByPagination(e,r){for(let n=0;n<e.length;n++)if(r[n])return e[n]}registerPage(e){for(let r of[...e.topics,...e.hiddenTopics])this.pageByTocId[r]||(this.pageByTocId[r]=e);this.pages.push(e)}tocIds(e){return e.flatMap(r=>[r.tocId,...this.tocIds(r.children)])}buildBreadcrumb(e){let r=[e.tocId];for(;e?.parentTocId;)r.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return r}register(e){e.prettyUrl&&(this.nodeByUrl[e.prettyUrl]==null?this.nodeByUrl[e.prettyUrl]=e:this.duplicatedPrettyUrls.add(e.prettyUrl)),this.nodeByUrl[`${this.mapId}/${e.tocId}`]=e,this.nodeByTocId[e.tocId]=e}},et=class{convertPaginatedToc(e,r){return new or(e,r).build()}};var Xr;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(Xr||(Xr={}));var Jr;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Jr||(Jr={}));var Zr;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Zr||(Zr={}));var ue;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(ue||(ue={}));var en;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(en||(en={}));var tn;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(tn||(tn={}));var tt;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(tt||(tt={}));var me;(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.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",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"})(me||(me={}));var rn;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(rn||(rn={}));var nn;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(nn||(nn={}));var sn;(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",t.DOC_DIFF="DOC_DIFF"})(sn||(sn={}));var an;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(an||(an={}));var on;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(on||(on={}));var cn;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(cn||(cn={}));var ln;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(ln||(ln={}));var un;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(un||(un={}));var dn;(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"})(dn||(dn={}));var rt;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(rt||(rt={}));var hn;(function(t){t.ASC="ASC",t.DESC="DESC"})(hn||(hn={}));var pn;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(pn||(pn={}));var _e;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(_e||(_e={}));var fn;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(fn||(fn={}));var mn;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(mn||(mn={}));var gn;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(gn||(gn={}));var yn;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(yn||(yn={}));var J;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(J||(J={}));var Ce;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ce||(Ce={}));var vn;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(vn||(vn={}));var A;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(A||(A={}));var W;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(W||(W={}));var En;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(En||(En={}));var Sn;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Sn||(Sn={}));var An;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(An||(An={}));var Tn;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Tn||(Tn={}));var bn;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(bn||(bn={}));var _n;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(_n||(_n={}));var Cn;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Cn||(Cn={}));var wn;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(wn||(wn={}));var xn;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(xn||(xn={}));var In;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(In||(In={}));var Rn;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Rn||(Rn={}));var On;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(On||(On={}));var kn;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(kn||(kn={}));var pi={[A.PERSONAL_BOOK_SHARE_USER]:[A.PERSONAL_BOOK_USER],[A.HTML_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.PDF_EXPORT_USER]:[A.PERSONAL_BOOK_USER],[A.KHUB_ADMIN]:[A.CONTENT_PUBLISHER],[A.ADMIN]:[A.KHUB_ADMIN,A.USERS_ADMIN,A.PORTAL_ADMIN,A.BEHAVIOR_DATA_USER],[A.GENERATIVE_AI_EXPORT_USER]:[A.GENERATIVE_AI_USER]};function Mn(t,e){return t===e||(pi[t]??[]).some(r=>Mn(r,e))}function Q(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=>Mn(n,e))}function Nn(t,...e){return t==null?!1:e.some(r=>Q(t,r))}var Rr=f(ie());var Dn=f(ie(),1);var cr=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},fi=t=>({fromAttribute:e=>{if(e==null)return De(t);try{return JSON.parse(e)}catch{return De(t)}},toAttribute:e=>JSON.stringify(e)});function Fn(t,e){return(0,Dn.property)({type:Object,converter:fi(t),hasChanged:Fe,...e??{}})}function mi(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!we(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(!we(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),i=s(t);if(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(!we(t[a],e[a]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function we(t,e){try{return mi(t,e)}catch{return!1}}function Fe(t,e){return!we(t,e)}function De(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function nt(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let s=e(n);return s[t]=!0,s}}var Pn=f(ie(),1);var lr=t=>{let e=t??{};return(r,n)=>{var s;let i={hasChanged:Fe,attribute:!1,...e};(0,Pn.property)(i)(r,n);let a=r.constructor;a.reduxProperties=new Map(a.reduxProperties),a.reduxProperties.set(n,{selector:(s=e.selector)!==null&&s!==void 0?s:(o=>o[n]),store:e.store})}};var st=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 ge=f(ie(),1);var it=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 s=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),i=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let a of n)try{await a()}catch(o){s(o);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ot=f(le(),1);var at=class extends ot.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return(0,ot.adoptStyles)(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){cr(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function Ln(t,e,...r){var n;let s=t.querySelector(e);for(let i of r)s=(n=s?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return s}var Ie=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},qn,Un=Symbol("constructorPrototype"),Bn=Symbol("constructorName"),jn=Symbol("exportpartsDebouncer"),Vn=Symbol("dynamicDependenciesLoaded"),xe=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};xe.eventName="exportparts-updated";var Z=class extends at{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[qn]=new it(5),this.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[jn].run(()=>{var s,i;!((s=this.exportpartsPrefix)===null||s===void 0)&&s.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Bn]=this.constructor.name,this[Un]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Bn]&&Object.setPrototypeOf(this,this[Un])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Vn]||(r[Vn]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(xe.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(xe.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new xe)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:s}=this.elementToFocus;if(n!=null){let i=[...s??[],n];r=Ln(this.shadowRoot,...i)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,s;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((s=this.customStylesheet)!==null&&s!==void 0?s:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(e){var r,n,s,i,a,o;let c=p=>p!=null&&p.trim().length>0,l=e.filter(c).map(p=>p.trim());if(l.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&i!==void 0?i:[]){let v=(a=(n=p.getAttribute("part"))===null||n===void 0?void 0:n.split(" "))!==null&&a!==void 0?a:[],S=(o=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(m=>m.split(":")[1]))!==null&&o!==void 0?o:[],_=[...v,...S].filter(c).map(m=>m.trim());for(let m of _)u.add(m)}if(u.size===0){this.exportparts=void 0;return}let h=[...u.values()].flatMap(p=>l.map(v=>`${p}:${v}--${p}`));this.exportparts=[...this.part,...h].join(", ")}};qn=jn;Ie([(0,ge.property)()],Z.prototype,"exportpartsPrefix",void 0);Ie([Fn([])],Z.prototype,"exportpartsPrefixes",void 0);Ie([(0,ge.property)({reflect:!0})],Z.prototype,"exportparts",void 0);Ie([(0,ge.property)()],Z.prototype,"customStylesheet",void 0);Ie([(0,ge.property)()],Z.prototype,"elementToFocus",void 0);Ie([(0,ge.state)()],Z.prototype,"useAdoptedStyleSheets",void 0);function ct(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Pe=Symbol("internalReduxEventsUnsubscribers"),de=Symbol("internalStoresUnsubscribers"),ye=Symbol("internalStores"),gi=nt(Symbol("withRedux"),function(t){var e,r,n;class s extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(a){super.willUpdate(a),[...this.reduxConstructor.reduxReactiveProperties].some(o=>a.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[ye].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[ye].values()][0]}getStore(a){return a==null?this.getUnnamedStore():this[ye].get(a)}addStore(a,o){var c;o=(c=o??a.name)!==null&&c!==void 0?c:"default-store",this.unsubscribeFromStore(o),this[ye].set(o,a),this.subscribeToStore(o,a),this.updateFromStores()}removeStore(a){let o=typeof a=="string"?a:a.name;this.unsubscribeFromStore(o),this[ye].delete(o)}setupStores(){this.unsubscribeFromStores(),this[ye].forEach((a,o)=>this.subscribeToStore(o,a)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((a,o)=>{let c=this.constructor.getPropertyOptions(o);if(!c?.attribute||!this.hasAttribute(typeof c?.attribute=="string"?c.attribute:o)){let l=this.getStore(a.store);l&&(a.store?this[de].has(a.store):this[de].size>0)&&(this[o]=a.selector(l.getState(),this))}})}subscribeToStore(a,o){var c,l;this[de].set(a,o.subscribe(()=>this.updateFromStores())),this[Pe].set(a,[]),ct(o)&&(!((c=o.deprecatedKeys)===null||c===void 0)&&c.length&&this.reduxConstructor.reduxProperties.forEach((u,h)=>{this.getStore(u.store)===o&&o.deprecatedKeys.includes(h)&&console.warn("Element",this,"is subscribed to deprecated key",h,"in store",o.name)}),o.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((u,h)=>{if(typeof this[h]=="function"&&(!u.store||o.name===u.store)){let p=v=>this[h](v);o.addEventListener(u.eventName,p),this[Pe].get(a).push(()=>o.removeEventListener(u.eventName,p))}}))),this.onStoreAvailable(a)}unsubscribeFromStores(){this[de].forEach((a,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(a){var o;this[de].has(a)&&this[de].get(a)(),this[de].delete(a),(o=this[Pe].get(a))===null||o===void 0||o.forEach(c=>c()),this[Pe].delete(a)}onStoreAvailable(a){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=de,r=ye,n=Pe,s.reduxProperties=new Map,s.reduxReactiveProperties=new Set,s.reduxEventListeners=new Map,s}),Hn=class extends gi(Z){};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 yi=typeof Symbol=="function"&&Symbol.observable||"@@observable",Kn=yi,ur=()=>Math.random().toString(36).substring(7).split("").join("."),vi={INIT:`@@redux/INIT${ur()}`,REPLACE:`@@redux/REPLACE${ur()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ur()}`},lt=vi;function ut(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function dr(t,e,r){if(typeof t!="function")throw new Error(F(2));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(dr)(t,e)}let n=t,s=e,i=new Map,a=i,o=0,c=!1;function l(){a===i&&(a=new Map,i.forEach((m,I)=>{a.set(I,m)}))}function u(){if(c)throw new Error(F(3));return s}function h(m){if(typeof m!="function")throw new Error(F(4));if(c)throw new Error(F(5));let I=!0;l();let H=o++;return a.set(H,m),function(){if(I){if(c)throw new Error(F(6));I=!1,l(),a.delete(H),i=null}}}function p(m){if(!ut(m))throw new Error(F(7));if(typeof m.type>"u")throw new Error(F(8));if(typeof m.type!="string")throw new Error(F(17));if(c)throw new Error(F(9));try{c=!0,s=n(s,m)}finally{c=!1}return(i=a).forEach(H=>{H()}),m}function v(m){if(typeof m!="function")throw new Error(F(10));n=m,p({type:lt.REPLACE})}function S(){let m=h;return{subscribe(I){if(typeof I!="object"||I===null)throw new Error(F(11));function H(){let y=I;y.next&&y.next(u())}return H(),{unsubscribe:m(H)}},[Kn](){return this}}}return p({type:lt.INIT}),{dispatch:p,subscribe:h,getState:u,replaceReducer:v,[Kn]:S}}function Ei(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:lt.INIT})>"u")throw new Error(F(12));if(typeof r(void 0,{type:lt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(F(13))})}function hr(t){let e=Object.keys(t),r={};for(let a=0;a<e.length;a++){let o=e[a];typeof t[o]=="function"&&(r[o]=t[o])}let n=Object.keys(r),s,i;try{Ei(r)}catch(a){i=a}return function(o={},c){if(i)throw i;let l=!1,u={};for(let h=0;h<n.length;h++){let p=n[h],v=r[p],S=o[p],_=v(S,c);if(typeof _>"u"){let m=c&&c.type;throw new Error(F(14))}u[p]=_,l=l||_!==S}return l=l||n.length!==Object.keys(o).length,l?u:o}}function Le(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...n)=>e(r(...n)))}function $n(...t){return e=>(r,n)=>{let s=e(r,n),i=()=>{throw new Error(F(15))},a={getState:s.getState,dispatch:(c,...l)=>i(c,...l)},o=t.map(c=>c(a));return i=Le(...o)(s.dispatch),{...s,dispatch:i}}}function zn(t){return ut(t)&&"type"in t&&typeof t.type=="string"}var ts=Symbol.for("immer-nothing"),Gn=Symbol.for("immer-draftable"),U=Symbol.for("immer-state");function X(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var K=Object,Oe=K.getPrototypeOf,ft="constructor",St="prototype",gr="configurable",mt="enumerable",ht="writable",Ue="value",ee=t=>!!t&&!!t[U];function $(t){return t?rs(t)||Tt(t)||!!t[Gn]||!!t[ft]?.[Gn]||bt(t)||je(t):!1}var Si=K[St][ft].toString(),Wn=new WeakMap;function rs(t){if(!t||!_r(t))return!1;let e=Oe(t);if(e===null||e===K[St])return!0;let r=K.hasOwnProperty.call(e,ft)&&e[ft];if(r===Object)return!0;if(!Re(r))return!1;let n=Wn.get(r);return n===void 0&&(n=Function.toString.call(r),Wn.set(r,n)),n===Si}function At(t,e,r=!0){qe(t)===0?(r?Reflect.ownKeys(t):K.keys(t)).forEach(s=>{e(s,t[s],t)}):t.forEach((n,s)=>e(s,n,t))}function qe(t){let e=t[U];return e?e.type_:Tt(t)?1:bt(t)?2:je(t)?3:0}var pr=(t,e,r=qe(t))=>r===2?t.has(e):K[St].hasOwnProperty.call(t,e),yr=(t,e,r=qe(t))=>r===2?t.get(e):t[e],gt=(t,e,r,n=qe(t))=>{n===2?t.set(e,r):n===3?t.add(r):t[e]=r};function Ai(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Tt=Array.isArray,bt=t=>t instanceof Map,je=t=>t instanceof Set,_r=t=>typeof t=="object",Re=t=>typeof t=="function",fr=t=>typeof t=="boolean";function Ti(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var oe=t=>t.copy_||t.base_;var Cr=t=>t.modified_?t.copy_:t.base_;function vr(t,e){if(bt(t))return new Map(t);if(je(t))return new Set(t);if(Tt(t))return Array[St].slice.call(t);let r=rs(t);if(e===!0||e==="class_only"&&!r){let n=K.getOwnPropertyDescriptors(t);delete n[U];let s=Reflect.ownKeys(n);for(let i=0;i<s.length;i++){let a=s[i],o=n[a];o[ht]===!1&&(o[ht]=!0,o[gr]=!0),(o.get||o.set)&&(n[a]={[gr]:!0,[ht]:!0,[mt]:o[mt],[Ue]:t[a]})}return K.create(Oe(t),n)}else{let n=Oe(t);if(n!==null&&r)return{...t};let s=K.create(n);return K.assign(s,t)}}function _t(t,e=!1){return Ct(t)||ee(t)||!$(t)||(qe(t)>1&&K.defineProperties(t,{set:dt,add:dt,clear:dt,delete:dt}),K.freeze(t),e&&At(t,(r,n)=>{_t(n,!0)},!1)),t}function bi(){X(2)}var dt={[Ue]:bi};function Ct(t){return t===null||!_r(t)?!0:K.isFrozen(t)}var yt="MapSet",Er="Patches",Qn="ArrayMethods",ns={};function ve(t){let e=ns[t];return e||X(0,t),e}var Yn=t=>!!ns[t];var Be,ss=()=>Be,_i=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Yn(yt)?ve(yt):void 0,arrayMethodsPlugin_:Yn(Qn)?ve(Qn):void 0});function Xn(t,e){e&&(t.patchPlugin_=ve(Er),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Sr(t){Ar(t),t.drafts_.forEach(Ci),t.drafts_=null}function Ar(t){t===Be&&(Be=t.parent_)}var Jn=t=>Be=_i(Be,t);function Ci(t){let e=t[U];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function Zn(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[U].modified_&&(Sr(e),X(4)),$(t)&&(t=es(e,t));let{patchPlugin_:s}=e;s&&s.generateReplacementPatches_(r[U].base_,t,e)}else t=es(e,r);return wi(e,t,!0),Sr(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==ts?t:void 0}function es(t,e){if(Ct(e))return e;let r=e[U];if(!r)return vt(e,t.handledSet_,t);if(!wt(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(t);os(r,t)}return r.copy_}function wi(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&_t(e,r)}function is(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var wt=(t,e)=>t.scope_===e,xi=[];function as(t,e,r,n){let s=oe(t),i=t.type_;if(n!==void 0&&yr(s,n,i)===e){gt(s,n,r,i);return}if(!t.draftLocations_){let o=t.draftLocations_=new Map;At(s,(c,l)=>{if(ee(l)){let u=o.get(l)||[];u.push(c),o.set(l,u)}})}let a=t.draftLocations_.get(e)??xi;for(let o of a)gt(s,o,r,i)}function Ii(t,e,r){t.callbacks_.push(function(s){let i=e;if(!i||!wt(i,s))return;s.mapSetPlugin_?.fixSetContents(i);let a=Cr(i);as(t,i.draft_??i,a,r),os(i,s)})}function os(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:n}=e;if(n){let s=n.getPath(t);s&&n.generatePatches_(t,s,e)}is(t)}}function Ri(t,e,r){let{scope_:n}=t;if(ee(r)){let s=r[U];wt(s,n)&&s.callbacks_.push(function(){pt(t);let a=Cr(s);as(t,r,a,e)})}else $(r)&&t.callbacks_.push(function(){let i=oe(t);t.type_===3?i.has(r)&&vt(r,n.handledSet_,n):yr(i,e,t.type_)===r&&n.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&vt(yr(t.copy_,e,t.type_),n.handledSet_,n)})}function vt(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ee(t)||e.has(t)||!$(t)||Ct(t)||(e.add(t),At(t,(n,s)=>{if(ee(s)){let i=s[U];if(wt(i,r)){let a=Cr(i);gt(t,n,a,t.type_),is(i)}}else $(s)&&vt(s,e,r)})),t}function Oi(t,e){let r=Tt(t),n={type_:r?1:0,scope_:e?e.scope_:ss(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},s=n,i=Et;r&&(s=[n],i=Ve);let{revoke:a,proxy:o}=Proxy.revocable(s,i);return n.draft_=o,n.revoke_=a,[o,n]}var Et={get(t,e){if(e===U)return t;let r=t.scope_.arrayMethodsPlugin_,n=t.type_===1&&typeof e=="string";if(n&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let s=oe(t);if(!pr(s,e,t.type_))return Mi(t,s,e);let i=s[e];if(t.finalized_||!$(i)||n&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Ti(e))return i;if(i===mr(t.base_,e)||ki(t,e,i)){pt(t);let a=t.type_===1?+e:e,o=br(t.scope_,i,t,a);return t.copy_[a]=o}return i},has(t,e){return e in oe(t)},ownKeys(t){return Reflect.ownKeys(oe(t))},set(t,e,r){let n=cs(oe(t),e);if(n?.set)return n.set.call(t.draft_,r),!0;if(!t.modified_){let s=mr(oe(t),e),i=s?.[U];if(i&&i.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Ai(r,s)&&(r!==void 0||pr(t.base_,e,t.type_)))return!0;pt(t),Tr(t)}return t.copy_[e]===r&&(r!==void 0||pr(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Ri(t,e,r)),!0},deleteProperty(t,e){return pt(t),mr(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),Tr(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=oe(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{[ht]:!0,[gr]:t.type_!==1||e!=="length",[mt]:n[mt],[Ue]:r[e]}},defineProperty(){X(11)},getPrototypeOf(t){return Oe(t.base_)},setPrototypeOf(){X(12)}},Ve={};for(let t in Et){let e=Et[t];Ve[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Ve.deleteProperty=function(t,e){return Ve.set.call(this,t,e,void 0)};Ve.set=function(t,e,r){return Et.set.call(this,t[0],e,r,t[0])};function mr(t,e){let r=t[U];return(r?oe(r):t)[e]}function ki(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!$(r)||r[U]?!1:t.baseRefs_.has(r)}function Mi(t,e,r){let n=cs(e,r);return n?Ue in n?n[Ue]:n.get?.call(t.draft_):void 0}function cs(t,e){if(!(e in t))return;let r=Oe(t);for(;r;){let n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Oe(r)}}function Tr(t){t.modified_||(t.modified_=!0,t.parent_&&Tr(t.parent_))}function pt(t){t.copy_||(t.assigned_=new Map,t.copy_=vr(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var Ni=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,n)=>{if(Re(e)&&!Re(r)){let i=r;r=e;let a=this;return function(c=i,...l){return a.produce(c,u=>r.call(this,u,...l))}}Re(r)||X(6),n!==void 0&&!Re(n)&&X(7);let s;if($(e)){let i=Jn(this),a=br(i,e,void 0),o=!0;try{s=r(a),o=!1}finally{o?Sr(i):Ar(i)}return Xn(i,n),Zn(s,i)}else if(!e||!_r(e)){if(s=r(e),s===void 0&&(s=e),s===ts&&(s=void 0),this.autoFreeze_&&_t(s,!0),n){let i=[],a=[];ve(Er).generateReplacementPatches_(e,s,{patches_:i,inversePatches_:a}),n(i,a)}return s}else X(1,e)},this.produceWithPatches=(e,r)=>{if(Re(e))return(a,...o)=>this.produceWithPatches(a,c=>e(c,...o));let n,s;return[this.produce(e,r,(a,o)=>{n=a,s=o}),n,s]},fr(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),fr(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),fr(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){$(t)||X(8),ee(t)&&(t=ls(t));let e=Jn(this),r=br(e,t,void 0);return r[U].isManual_=!0,Ar(e),r}finishDraft(t,e){let r=t&&t[U];(!r||!r.isManual_)&&X(9);let{scope_:n}=r;return Xn(n,e),Zn(void 0,n)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let s=e[r];if(s.path.length===0&&s.op==="replace"){t=s.value;break}}r>-1&&(e=e.slice(r+1));let n=ve(Er).applyPatches_;return ee(t)?n(t,e):this.produce(t,s=>n(s,e))}};function br(t,e,r,n){let[s,i]=bt(e)?ve(yt).proxyMap_(e,r):je(e)?ve(yt).proxySet_(e,r):Oi(e,r);return(r?.scope_??ss()).drafts_.push(s),i.callbacks_=r?.callbacks_??[],i.key_=n,r&&n!==void 0?Ii(r,i,n):i.callbacks_.push(function(c){c.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:l}=c;i.modified_&&l&&l.generatePatches_(i,[],c)}),s}function ls(t){return ee(t)||X(10,t),us(t)}function us(t){if(!$(t)||Ct(t))return t;let e=t[U],r,n=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=vr(t,e.scope_.immer_.useStrictShallowCopy_),n=e.scope_.immer_.shouldUseStrictIteration()}else r=vr(t,!0);let s=r;return je(r)&&(r=new Set),At(s,(i,a)=>{gt(r,i,us(a))},n),e&&(e.finalized_=!1),r}var Di=globalThis.Iterator,vo=typeof Di?.from=="function";var Fi=new Ni,wr=Fi.produce;function ds(t){return({dispatch:r,getState:n})=>s=>i=>typeof i=="function"?i(r,n,t):s(i)}var hs=ds(),ps=ds;var Pi=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Le:Le.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Li=t=>t&&typeof t.match=="function";function he(t,e){function r(...n){if(e){let s=e(...n);if(!s)throw new Error(te(0));return{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=()=>`${t}`,r.type=t,r.match=n=>zn(n)&&n.type===t,r}var vs=class He extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,He.prototype)}static get[Symbol.species](){return He}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new He(...e[0].concat(this)):new He(...e.concat(this))}};function fs(t){return $(t)?wr(t,()=>{}):t}function xt(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function Ui(t){return typeof t=="boolean"}var Bi=()=>function(e){let{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=e??{},a=new vs;return r&&(Ui(r)?a.push(hs):a.push(ps(r.extraArgument))),a},Vi="RTK_autoBatch";var ms=t=>e=>{setTimeout(e,t)},qi=(t,e)=>r=>{let n=!1,s,i,a=()=>{n||(n=!0,cancelAnimationFrame(s),clearTimeout(i),r())};s=t(a),i=setTimeout(a,e)},ji=(t={type:"raf"})=>e=>(...r)=>{let n=e(...r),s=!0,i=!1,a=!1,o=new Set,c=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?qi(window.requestAnimationFrame,100):ms(10):t.type==="callback"?t.queueNotification:ms(t.timeout),l=()=>{a=!1,i&&(i=!1,o.forEach(u=>u()))};return Object.assign({},n,{subscribe(u){let h=()=>s&&u(),p=n.subscribe(h);return o.add(u),()=>{p(),o.delete(u)}},dispatch(u){try{return s=!u?.meta?.[Vi],i=!s,i&&(a||(a=!0,c(l))),n.dispatch(u)}finally{s=!0}}})},Hi=t=>function(r){let{autoBatch:n=!0}=r??{},s=new vs(t);return n&&s.push(ji(typeof n=="object"?n:void 0)),s};function Es(t){let e=Bi(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=t||{},c;if(typeof r=="function")c=r;else if(ut(r))c=hr(r);else throw new Error(te(1));let l;typeof n=="function"?l=n(e):l=e();let u=Le;s&&(u=Pi({trace:!1,...typeof s=="object"&&s}));let h=$n(...l),p=Hi(h),v=typeof o=="function"?o(p):p(),S=u(...v);return dr(c,a,S)}function Ss(t){let e={},r=[],n,s={addCase(i,a){let o=typeof i=="string"?i:i.type;if(!o)throw new Error(te(28));if(o in e)throw new Error(te(29));return e[o]=a,s},addAsyncThunk(i,a){return a.pending&&(e[i.pending.type]=a.pending),a.rejected&&(e[i.rejected.type]=a.rejected),a.fulfilled&&(e[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){return n=i,s}};return t(s),[e,r,n]}function Ki(t){return typeof t=="function"}function $i(t,e){let[r,n,s]=Ss(e),i;if(Ki(t))i=()=>fs(t());else{let o=fs(t);i=()=>o}function a(o=i(),c){let l=[r[c.type],...n.filter(({matcher:u})=>u(c)).map(({reducer:u})=>u)];return l.filter(u=>!!u).length===0&&(l=[s]),l.reduce((u,h)=>{if(h)if(ee(u)){let p=h(u,c);return p===void 0?u:p}else{if($(u))return wr(u,p=>h(p,c));{let p=h(u,c);if(p===void 0){if(u===null)return u;throw new Error(te(9))}return p}}return u},o)}return a.getInitialState=i,a}var zi=(t,e)=>Li(t)?t.match(e):t(e);function Gi(...t){return e=>t.some(r=>zi(r,e))}var Wi="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qi=(t=21)=>{let e="",r=t;for(;r--;)e+=Wi[Math.random()*64|0];return e},Yi=["name","message","stack","code"],xr=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},gs=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},Xi=t=>{if(typeof t=="object"&&t!==null){let e={};for(let r of Yi)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},ys="External signal was aborted",Ji=(()=>{function t(e,r,n){let s=he(e+"/fulfilled",(c,l,u,h)=>({payload:c,meta:{...h||{},arg:u,requestId:l,requestStatus:"fulfilled"}})),i=he(e+"/pending",(c,l,u)=>({payload:void 0,meta:{...u||{},arg:l,requestId:c,requestStatus:"pending"}})),a=he(e+"/rejected",(c,l,u,h,p)=>({payload:h,error:(n&&n.serializeError||Xi)(c||"Rejected"),meta:{...p||{},arg:u,requestId:l,rejectedWithValue:h!==void 0,requestStatus:"rejected",aborted:c?.name==="AbortError",condition:c?.name==="ConditionError"}}));function o(c,{signal:l}={}){return(u,h,p)=>{let v=n?.idGenerator?n.idGenerator(c):Qi(),S=new AbortController,_,m;function I(g){m=g,S.abort()}l&&(l.aborted?I(ys):l.addEventListener("abort",()=>I(ys),{once:!0}));let H=(async function(){let g;try{let y=n?.condition?.(c,{getState:h,extra:p});if(ea(y)&&(y=await y),y===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(S.signal.aborted)throw{name:"AbortError",message:m||"Aborted"};let D=new Promise((O,L)=>{_=()=>{L({name:"AbortError",message:m||"Aborted"})},S.signal.addEventListener("abort",_,{once:!0})});u(i(v,c,n?.getPendingMeta?.({requestId:v,arg:c},{getState:h,extra:p}))),g=await Promise.race([D,Promise.resolve(r(c,{dispatch:u,getState:h,extra:p,requestId:v,signal:S.signal,abort:I,rejectWithValue:((O,L)=>new xr(O,L)),fulfillWithValue:((O,L)=>new gs(O,L))})).then(O=>{if(O instanceof xr)throw O;return O instanceof gs?s(O.payload,v,c,O.meta):s(O,v,c)})])}catch(y){g=y instanceof xr?a(null,v,c,y.payload,y.meta):a(y,v,c)}finally{_&&S.signal.removeEventListener("abort",_)}return n&&!n.dispatchConditionRejection&&a.match(g)&&g.meta.condition||u(g),g})();return Object.assign(H,{abort:I,requestId:v,arg:c,unwrap(){return H.then(Zi)}})}}return Object.assign(o,{pending:i,rejected:a,fulfilled:s,settled:Gi(a,s),typePrefix:e})}return t.withTypes=()=>t,t})();function Zi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ea(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var As=Symbol.for("rtk-slice-createasyncthunk"),wo={[As]:Ji};function ta(t,e){return`${t}/${e}`}function ra({creators:t}={}){let e=t?.asyncThunk?.[As];return function(n){let{name:s,reducerPath:i=s}=n;if(!s)throw new Error(te(11));typeof process<"u";let a=(typeof n.reducers=="function"?n.reducers(sa()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},l={addCase(g,y){let D=typeof g=="string"?g:g.type;if(!D)throw new Error(te(12));if(D in c.sliceCaseReducersByType)throw new Error(te(13));return c.sliceCaseReducersByType[D]=y,l},addMatcher(g,y){return c.sliceMatchers.push({matcher:g,reducer:y}),l},exposeAction(g,y){return c.actionCreators[g]=y,l},exposeCaseReducer(g,y){return c.sliceCaseReducersByName[g]=y,l}};o.forEach(g=>{let y=a[g],D={reducerName:g,type:ta(s,g),createNotation:typeof n.reducers=="function"};aa(y)?ca(D,y,l,e):ia(D,y,l)});function u(){let[g={},y=[],D=void 0]=typeof n.extraReducers=="function"?Ss(n.extraReducers):[n.extraReducers],O={...g,...c.sliceCaseReducersByType};return $i(n.initialState,L=>{for(let B in O)L.addCase(B,O[B]);for(let B of c.sliceMatchers)L.addMatcher(B.matcher,B.reducer);for(let B of y)L.addMatcher(B.matcher,B.reducer);D&&L.addDefaultCase(D)})}let h=g=>g,p=new Map,v=new WeakMap,S;function _(g,y){return S||(S=u()),S(g,y)}function m(){return S||(S=u()),S.getInitialState()}function I(g,y=!1){function D(L){let B=L[g];return typeof B>"u"&&y&&(B=xt(v,D,m)),B}function O(L=h){return xt(xt(p,y,()=>new WeakMap),L,()=>{let B={};for(let[si,ii]of Object.entries(n.selectors??{}))B[si]=na(ii,L,()=>xt(v,L,m),y);return B})}return{reducerPath:g,getSelectors:O,get selectors(){return O(D)},selectSlice:D}}let H={name:s,reducer:_,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:m,...I(i),injectInto(g,{reducerPath:y,...D}={}){let O=y??i;return g.inject({reducerPath:O,reducer:_},D),{...H,...I(O,!0)}}};return H}}function na(t,e,r,n){function s(i,...a){let o=e(i);return typeof o>"u"&&n&&(o=r()),t(o,...a)}return s.unwrapped=t,s}var Ts=ra();function sa(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function ia({type:t,reducerName:e,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!oa(n))throw new Error(te(17));i=n.reducer,a=n.prepare}else i=n;s.addCase(t,i).exposeCaseReducer(e,i).exposeAction(e,a?he(t,a):he(t))}function aa(t){return t._reducerDefinitionType==="asyncThunk"}function oa(t){return t._reducerDefinitionType==="reducerWithPrepare"}function ca({type:t,reducerName:e},r,n,s){if(!s)throw new Error(te(18));let{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:l,options:u}=r,h=s(t,i,u);n.exposeAction(e,h),a&&n.addCase(h.fulfilled,a),o&&n.addCase(h.pending,o),c&&n.addCase(h.rejected,c),l&&n.addMatcher(h.settled,l),n.exposeCaseReducer(e,{fulfilled:a||It,pending:o||It,rejected:c||It,settled:l||It})}function It(){}var bs="listener",_s="completed",Cs="cancelled",xo=`task-${Cs}`,Io=`task-${_s}`,Ro=`${bs}-${Cs}`,Oo=`${bs}-${_s}`;var{assign:ws}=Object;var Ir="listenerMiddleware";var la=ws(he(`${Ir}/add`),{withTypes:()=>la}),ko=he(`${Ir}/removeAll`),ua=ws(he(`${Ir}/remove`),{withTypes:()=>ua});function te(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var da=nt(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,s){this.eventBus.addEventListener(r,n,s)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,s){this.eventBus.removeEventListener(r,n,s)}}}),Rt=class extends da(Object){};window.ftReduxStores||(window.ftReduxStores={});var xs=class t extends Rt{static get(e){var r;let n=typeof e=="string"?e:e.name,s=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(ct(i))return i;if(s==null)return;let a=Ts({...s,reducers:(r=s.reducers)!==null&&r!==void 0?r:{}}),o=Es({reducer:(c,l)=>{if(l.type==="CLEAR_FT_REDUX_STORE"){let u=De(a.getInitialState());for(let h of l.keeping)u[h]=(c??u)[h];return u}else if(typeof l.type=="string"&&l.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...c,...l.overwrites};return a.reducer(c,l)}});return window.ftReduxStores[s.name]=new t(a,o,s.eventBus,s.deprecatedKeys)}constructor(e,r,n,s){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=s,this.isFtReduxStore=!0,this.commands=new st,this.injectInto=(a,o)=>this.reduxSlice.injectInto(a,o),this.selectSlice=a=>this.reduxSlice.selectSlice(a);let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,o,c)=>{let l=o,u=a[l];return u?(...h)=>{let p=u(...h.map(i));return this.reduxStore.dispatch(p),p}:h=>{let p=l,v=this.getState()[p];we(v,h)||this.setState({[p]:i(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Ot=class{static format(e,r,n,s,i){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,s,!!i)):this.getIntlDateTime(e,r,n,s,!!i)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,s,i){let a=typeof e=="string"?new Date(e):e,o=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(a),c=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(a);return i?c:s?`${o} ${c}`:o}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var kt=f(T()),ha="ft-app-info",z=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};z.eventName="authentication-change";var Ke=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ke.eventName="ui-locale-changed";var pa={session:(t,e)=>{(0,kt.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>d.dispatchEvent(new z(e.payload)),0))}},d=kt.FtReduxStore.get({name:ha,reducers:pa,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Is=f(T()),Mt=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},oc=(0,Is.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(d)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var s,i;return((i=(s=this.metadataDescriptors.find(o=>o.key===n))===null||s===void 0?void 0:s.date)!==null&&i!==void 0?i:!1)?o=>Ot.format(o,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Mt([(0,Rr.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Mt([(0,Rr.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Mt([lr({store:d.name,selector:r=>{var n,s;return(s=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&s!==void 0?s:[]}})],e.prototype,"metadataDescriptors",void 0),Mt([lr({store:d.name})],e.prototype,"uiLocale",void 0),e});var Lt=f(T());var Or=f(T());var Ee=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=d.getState(),s=e??n;if(r&&s&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,s,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let s=d.subscribe(()=>{n=t.get(e),n&&(s(),r(n))})}})}};var ke=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ee.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ee.await()}};var M=class extends ke{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(i,a)=>typeof a!="object"||a==null||Array.isArray(a)?a:Object.fromEntries(Object.entries(a).sort(([o],[c])=>o.localeCompare(c)));let s=this.constructor;s.commonCache=(n=s.commonCache)!==null&&n!==void 0?n:new Or.CacheRegistry,this.cache=e?s.commonCache:new Or.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Nt=class extends M{async listMySearches(){let{session:e}=d.getState();return Q(e,A.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Dt=class extends M{async listMyBookmarks(){let e=d.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Ft=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var Pt=class extends M{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=d.getState().session;return!!e?.sessionAuthenticated}};var fa="ft-user-assets",ma={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(W).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:s}=e.payload;Mr(t,r,[...kr(t,r),s]),Rs(t,r,1,n),Os(t,s)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;Mr(t,r,kr(t,r).map(s=>s.id===n.id?n:s)),Os(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:s}=e.payload;Mr(t,r,kr(t,r).filter(i=>i.id!==s)),Rs(t,r,-1,n)}},ks={[W.SEARCHES]:"savedSearches",[W.BOOKMARKS]:"bookmarks",[W.BOOKS]:void 0,[W.COLLECTIONS]:void 0},kr=(t,e)=>{var r;let n=ks[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},Mr=(t,e,r)=>{let n=ks[e];n&&(t[n]=r)},Rs=(t,e,r,n)=>{let s=t.assetCounts.allAsset[e];if(s!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,s+r),e===W.BOOKMARKS&&n)){let i=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,i+r)}},Os=(t,e)=>{let r=t.assetLabels.map(s=>s.title),n=e.labels.filter(s=>!r.includes(s)).map(s=>({title:s}));t.assetLabels.push(...n)},V=Lt.FtReduxStore.get({name:fa,reducers:ma,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(W).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Nr=class{constructor(e=new Ft,r=new Pt){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=d.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Dt,this.savedSearchesService=new Nt,d.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=d.getState();(0,Lt.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),V.actions.clearAssetCount(),V.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),V.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),V.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();V.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();V.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&V.getState().assetCounts.allAsset[e]!==r.count&&V.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&V.getState().assetCounts.bookmarkByMap[e]!==r.count&&V.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(V.getState().assetCounts.bookmarkByMap).length!==0;e===W.BOOKMARKS&&r&&V.actions.clearBookmarkCountByMap(),V.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;V.actions.bookmarks(r)}}},Dr=new Nr;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Dr);var Fr=class{addCommand(e,r=!1){d.commands.add(e,r)}consumeCommand(e){return d.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Fr;var Y=f(T());var Ms,Me=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ga=Symbol("clearAfterUnitTest"),Ut=class extends(0,Y.withEventBus)(M){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ms]=()=>{this.defaultMessages={},this.cache=new Y.CacheRegistry,this.listeners={}},this.currentUiLocale=d.getState().uiLocale,d.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=d.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 s={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,Y.deepEqual)(this.defaultMessages[e],s)||(this.defaultMessages[e]=s,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 s;let i=e.toLowerCase(),a=this.resolveContext(i);return new Y.ParametrizedLabelResolver((s=this.defaultMessages[i])!==null&&s!==void 0?s:{},a).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(s){!(s instanceof Y.CanceledPromiseError)&&r&&console.error(s)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var s;return(s=this.listeners[e])===null||s===void 0?void 0:s.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new Me({loadedContexts:e})),this.dispatchEvent(new Me({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new Me({loadedContexts:[e]})),this.dispatchEvent(new Me({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,Y.delay)(0).then(()=>n()).catch(()=>null)))}};Ms=ga;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ut{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Ns=window.FluidTopicsI18nService,jc=window.FluidTopicsCustomI18nService;var Ds=f(T()),Pr=class{highlightHtml(e,r,n){(0,Ds.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Pr;var Fs=f(T());var Lr=class{isDate(e){var r,n,s,i;return(i=(n=((s=(r=d.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&s!==void 0?s:[]).find(o=>o.key===e))===null||n===void 0?void 0:n.date)!==null&&i!==void 0?i:!1}format(e,r){var n,s,i,a;if(e==null)return"";try{return Fs.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:d.getState().uiLocale,(s=r?.longFormat)!==null&&s!==void 0?s:!1,(i=r?.withTime)!==null&&i!==void 0?i:!1,(a=r?.onlyTime)!==null&&a!==void 0?a:!1)}catch(o){throw console.error(`Date ${JSON.stringify(e)} is not valid`,o),o}}};window.FluidTopicsDateService=new Lr;var Ps=f(T());var $e=class{static get(e,r,{baseUrl:n,localesConfiguration:s,availableContentLocales:i}=d.getState()){var a;if(r==="all"&&s?.allLanguagesAllowed)r=void 0;else if(!r||i.length>0&&!i.some(o=>o.lang===r)){let o=s?.defaultLocales.defaultContentLocale;r=o?`${o.lang}-${o.region}`:(a=i[0])===null||a===void 0?void 0:a.lang}return new Ps.SearchPlaceConverter(n,e??20,s?.allLanguagesAllowed,r,i)}};var Ne=class extends M{async sendDocumentStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.start_display event")}async sendTopicStartDisplayEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.start_display event")}async sendKhubSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send khub.search event")}async sendDocumentSearchEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.search event")}async sendSearchPageSelectEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_page.select event")}async sendSearchResultOpenContextMenuEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send search_result.open_context_menu event")}async sendDocumentOnDemandTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on_demand_translate event")}async sendTopicAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send topic.ai_translate event")}convertMapToAnalyticsDocument(e){let r;switch(e.editorialType){case"BOOK":r="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":r="SHARED_PERSONAL_BOOK";break;case"ARTICLE":r="RESOURCE";break;case"HTML_PACKAGE":r="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:r,metadata:e.metadata}}sortEventArrays(e){let r=Object.entries(e).map(([n,s])=>Array.isArray(s)?[n,s.map(i=>typeof i=="object"&&i!=null&&!Array.isArray(i)?this.sortEventArrays(i):i).sort((i,a)=>typeof i=="object"&&i!==null&&"key"in i?i.key.localeCompare(a.key):typeof i=="string"&&typeof a=="string"?i.localeCompare(a):String(i).localeCompare(String(a)))]:typeof s=="object"&&s!==null?[n,this.sortEventArrays(s)]:[n,s]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return document.dispatchEvent(new CustomEvent("ft:analytics:userevents",{detail:e})),this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(s=>(console.info(r),console.debug(s),n)),1e3)}};var Ur=class{urlToSearchRequest(e){return $e.get().parse(e)}searchRequestToUrl(e){return $e.get().serialize(e)}};window.FluidTopicsUrlService=new Ur;var ce=f(T());var Se=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Se.eventName="before-location-change";var Ae=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Ae.eventName="change";var Br=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))}},Ls=new Br;var Bt=class t extends ce.WithEventBus{static build(){return new t(window.history,Ls,()=>window.location,!1)}constructor(e,r,n,s){var i,a;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(a=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&a!==void 0?a:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(s)}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,ce.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new Ae(this.currentItem())),0)}installProxies(){let e=r=>(n,s,[i,a,o])=>{let c=new URL(typeof o=="string"?o:(o??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),l=new Se(c);this.dispatchEvent(l);let u=r(),h={...u===this.currentIndex?this.currentState:void 0,...i,index:u,href:l.detail.nextLocation.href};n.apply(s,[h,a,h.href]),this.setCurrentState(h,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addBeforeLocationChangeListener(e){this.addEventListener(Se.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Se.eventName,e)}addHistoryChangeListener(e){this.addEventListener(Ae.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Ae.eventName,e)}currentItem(){return(0,ce.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ce.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,ce.deepCopy)(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,ce.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let s=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(s=i),i++;return s}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let s=r??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=s}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bt.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Us=f(le());var Bs=Us.css`
2
2
  `;var qs=f(le()),q=f(ie()),be=f(T());var re=f(T());function Vs(t,e){let{authenticationRequired:r,session:n}=d.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Vt=class extends ke{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Vr=class t extends re.FtStateManager{static build(e){return new t(d,e)}constructor(e,r){super(),this.store=e,this.cache=new re.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Vt,this.knownContexts=new re.AbstractRegistry,this.knownCustomComponents=new re.AbstractRegistry,this.cleanSessionDebouncer=new re.Debouncer,this.reloadConfiguration=()=>{var n;(n=this.cache)===null||n===void 0||n.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new re.Debouncer(500),this.apiProvider=r??(()=>Ee.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(z.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(z.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Vs(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ke(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Nn(d.getState().session,...e)}},ne=Vr.build();var Te=class extends Event{constructor(e,r,n,s){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=s??!1}};var ze=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:s,callbackRef:i}of n){let a=s.deref(),o=i.deref();a===void 0||o===void 0||a.dispatchEvent(new Te(e.context,a,o,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,s=this.pendingContextRequests.get(e.context);s===void 0&&this.pendingContextRequests.set(e.context,s={callbacks:new WeakMap,requests:[]});let i=s.callbacks.get(r);i===void 0&&s.callbacks.set(r,i=new WeakSet),i.has(n)||(i.add(n),s.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var N=function(t,e,r,n){var s=arguments.length,i=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(i=(s<3?a(i):s>3?a(e,r,i):a(e,r))||i);return s>3&&i&&Object.defineProperty(e,r,i),i},b=class extends be.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=ne,this.contextRoot=new ze}render(){return qs.html`
3
3
  <slot></slot>
4
4
  `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Ns.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};b.elementDefinitions={};b.styles=Bs;N([(0,q.property)()],b.prototype,"baseUrl",void 0);N([(0,q.property)()],b.prototype,"tenantId",void 0);N([(0,q.property)()],b.prototype,"apiIntegrationIdentifier",void 0);N([(0,q.property)()],b.prototype,"apiIntegrationAppVersion",void 0);N([(0,q.property)()],b.prototype,"uiLocale",void 0);N([(0,be.jsonProperty)(null)],b.prototype,"availableUiLocales",void 0);N([(0,be.jsonProperty)(null)],b.prototype,"metadataConfiguration",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"editorMode",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"noCustom",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"openExternalDocumentInNewTab",void 0);N([(0,q.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],b.prototype,"noCustomComponent",void 0);N([(0,q.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],b.prototype,"noCustomCode",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"withManualResources",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"navigatorOnline",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"forcedOffline",void 0);N([(0,q.property)({type:Boolean})],b.prototype,"authenticationRequired",void 0);N([(0,be.jsonProperty)([])],b.prototype,"messageContexts",void 0);N([(0,be.jsonProperty)(void 0)],b.prototype,"session",void 0);var Hs=f(T());var js={"ft-app-context":b};(0,Hs.customElements)(js);var Ge=f(T()),qt=class extends M{get metadataFilters(){return this._metadataFilters}set metadataFilters(e){this._metadataFilters=e}get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,r,n,s){super(!1,r),this.converter=e,this._mapId=n,this._metadataFilters=s,this.initCache()}async withMapId(e){return this._mapId?e(this._mapId):void 0}initCache(){this.cache.register("configuration",()=>this.api.getReaderConfiguration()),this.cache.register("map",()=>this.withMapId(e=>this.fetchMap(e))),this.cache.register(this.makeCacheKey("enrichedToc",void 0,this.metadataFilters,this.stickyFiltersId),()=>this.withMapId(e=>this.fetchPages(e,this._metadataFilters,this.stickyFiltersId).then(r=>this.converter.convertPaginatedToc(e,r)))),this.cache.register("ratingSummary",()=>{var e,r;return Q((r=(e=d.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&r!==void 0?r:[],"RATING_USER")?this.withMapId(s=>this.fetchMapRating(s)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,r,n,s){return e+(r?"-destinationLanguage-"+r?.destinationLanguage:"")+(!n||n.length==0?"":"-metadataFilters-"+this.hash(n))+(s?"-stickyFilters-"+s:"")}getMap(e){return this.cache.get(this.makeCacheKey("map",e),()=>this.fetchMap(this.mapId,e))}getMapNow(e){return this.cache.getNow(this.makeCacheKey("map",e))}getConfiguration(){return this.cache.get("configuration")}clearConfiguration(){this.cache.clear("configuration")}getEnrichedToc(e){return this.cache.get(this.makeCacheKey("enrichedToc",e,this.metadataFilters,this.stickyFiltersId),()=>this.fetchPages(this.mapId,this.metadataFilters,this.stickyFiltersId,e).then(r=>this.converter.convertPaginatedToc(this.mapId,r)))}getEnrichedTocNow(e){return this.cache.getNow(this.makeCacheKey("enrichedToc",e,this.metadataFilters,this.stickyFiltersId))}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(e){return(await this.getEnrichedToc(e)).toc}async getPagesToc(e){return(await this.getEnrichedToc(e)).pagesToc}async getTranslationError(e){return(await this.getEnrichedToc(e)).translationError}async getFilteredTocNodes(e){var r;return(r=(await this.getEnrichedToc(e)).filteredTocNodes)!==null&&r!==void 0?r:{}}async getTocNode(e,r){return(await this.getEnrichedToc(r)).nodeByTocId[e]}getTocNodeNow(e,r){var n;return(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,r){var n,s;let i=this.getMapNow(r);return i?.prettyUrl==e||`${i?.id}/root`===e?(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.toc[0]:(s=this.getEnrichedTocNow(r))===null||s===void 0?void 0:s.nodeByUrl[e]}async getPage(e,r){let n=await this.getEnrichedToc(r);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,r){let n=await this.getEnrichedToc(r);return n.pageByTocId[e]||n.pages[0]}getTopicInfo(e){return this.cache.get("topic-"+e.tocId,()=>this.fetchTopicMetadata(e))}getTopicContent(e){return this.cache.get("topic-content-"+e.tocId,()=>this.fetchTopicHTMLContent(e))}getTranslatedTopicContent(e,r){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,r),()=>this.fetchTranslatedTopicHTMLContent(e,r))}async getTopicMetadataValue(e,r){let n=this.getTocNodeNow(e);if(!n)return;let s=await this.getTopicInfo(n);return s?.metadata.find(i=>i.key==r)}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,r){return this.cache.get("document-relatives-"+e+"-"+r.join("-"),()=>this.fetchRelativesForDocument(e,r))}getRelativesForTopicInMap(e,r,n){return this.cache.get("topic-relatives-"+[e,r,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,r,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,r,n,s,i){let a;typeof e=="object"?(a=e.tocId,r=e.pageNumber,n=e.section,s=e.withMetadataFilter,i=e.withStickyFilters):a=e;let o=this.getNavigationData(a,r,n),c=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),l=new URL(c,this.api.tenantBaseUrl);if(o.page!=null&&l.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&l.searchParams.set("tocId",o.tocId),o.section!=null&&l.searchParams.set("section",o.section),s&&o.metadataFilters){let u=Ge.SearchPlaceConverter.serializeValueFilters(o.metadataFilters);u&&l.searchParams.set(Ge.SearchPlaceQueryParams.VALUE_FILTERS,u)}return i&&this.stickyFiltersId&&l.searchParams.set(Ge.SearchPlaceQueryParams.STICKY_FILTER,this.stickyFiltersId),l.href}getLinkWithFilter(e,r,n){return this.getLink(e,r,n,!0)}getNavigationData(e,r,n,s){var i,a;e=e||"root";let o=this.getEnrichedTocNow(s),c=o?.pageByTocId[e],l=o?.nodeByTocId[e],u=l?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(i=l?.title)!==null&&i!==void 0?i:"",untranslatedTopicTitle:l?.untranslatedTitle,page:r&&c&&c.number!==r?r:void 0,prettyUrl:u?.replace(/^r\//,""),prettyUrlDuplicated:(a=o?.duplicatedPrettyUrls.has(u??""))!==null&&a!==void 0?a:!1,section:n,metadataFilters:this.metadataFilters}}async getAccurateNavigationData(e,r,n,s){return await this.getEnrichedToc(s),this.getNavigationData(e,r,n,s)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then(e=>e?.publication)}getTopicRating(e){return this.getRatingSummary().then(r=>{var n;return r?{type:r.topics.type,rating:(n=r.topics)===null||n===void 0?void 0:n.ratings.find(s=>s.tocId===e)}:void 0})}rateMap(e,r){return this.makeRateMapRequest(e,r).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,r){return this.makeMapFeedbackRequest(e,r)}rateTopic(e,r,n){return this.makeRateTopicRequest(e,r,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=d.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,r,n,s,i){return this.makeTopicFeedbackRequest(e,r,n,s,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,r){let n=this.getTocNodeNow(e,r);if(!n)return[];let s=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],i=this.getTocNodeNow(n.parentTocId,r);for(;i;)s.unshift({tocId:i.tocId,title:i.title,untranslatedTitle:i.untranslatedTitle}),i=this.getTocNodeNow(i.parentTocId,r);return s}isFeatureAccessible(e,{session:r}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case ae.FEEDBACK:return Q(r??[],A.FEEDBACK_USER);case ae.RATING:return Q(r??[],A.RATING_USER);case ae.PRINT:return Q(r??[],A.PRINT_USER);case ae.BOOKMARK:return!!r?.sessionAuthenticated;case ae.COLLECTIONS:return Q(r??[],A.COLLECTION_USER);case ae.PERSONAL_BOOKS:return Q(r??[],A.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var jt=class t extends qt{static async build(e){return new t(new et,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,r){let n=await this.api.getMap(e,r);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,r,n,s){return await this.getMap(s),r?.length||n?this.api.getFilteredPages(e,s,r,n):this.api.getPages(e,this.fingerprint,s)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,r){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,r)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,r){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:r}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,r,n){let s={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:r,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(s)}makeMapFeedbackRequest(e,r){return this.api.sendMapFeedback(this.mapId,e,r)}makeRateMapRequest(e,r){return this.api.rateMap(this.mapId,e,r)}makeRateTopicRequest(e,r,n){return this.api.rateTopic(this.mapId,e,r,n)}makeTopicFeedbackRequest(e,r,n,s,i){return this.api.sendTopicFeedback(this.mapId,e,r,n,s,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(e){return this.api.unrateTopic(this.mapId,e)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(e){return!0}};var Ea="topicPivot";function Ks(t,e){let r=new URL(t);return e?.values.forEach(n=>{r.searchParams.append(Ea,n)}),r.href}var Ht=class t{static build(e,r){return new t(Yr(e.trim()||"context"),r??jt.build)}loaded(){return(0,k.waitUntil)(()=>this._loaded)}constructor(e,r,n,s){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new k.Debouncer(10),this.analyticsEventsService=s??new Ne,this.initService(r),this.stickyFiltersIdWatcher=new k.ReduxWatcher(d,i=>{var a;return(a=i.stickyFilters)===null||a===void 0?void 0:a.id},()=>this.reloadFromSticky())}async initService(e){var r;this.service=await e();let{mapId:n,metadataFilters:s,applyStickyFilters:i}=this.store.getState();return this.service.mapId=n,this.service.metadataFilters=s,this.service.stickyFiltersId=i?(r=d.getState().stickyFilters)===null||r===void 0?void 0:r.id:void 0,this.reload()}removeListeners(){this.stickyFiltersIdWatcher.stop()}async setMapId(e){e!==this.store.getState().mapId&&(this.store.actions.mapId(e),this.service&&(this.service.mapId=e),await this.reload())}setRenderedTopics(e){this.store.actions.renderedTopics(e)}setVisibleTopics(e){this.store.actions.visibleTopics(e)}async setApplyStickyFilters(e){e?this.stickyFiltersIdWatcher.watch():this.stickyFiltersIdWatcher.stop(),e!=this.store.getState().applyStickyFilters&&(this.store.actions.applyStickyFilters(e),await this.reloadFromSticky())}async setFilters(e){(0,k.deepEqual)(e,this.store.getState().metadataFilters)||(this.store.actions.metadataFilters(e),this.service&&(this.service.metadataFilters=e))}async awaitService(){return(0,k.waitFor)(()=>this.service)}async navigateToTopic(e,r,n){await this.loaded();let s=await this.resolvePage(e,n);this.store.actions.currentPage(s);let i=this.resolveValidNonRootTocId(e,s);this.store.actions.scrollTarget({tocId:i,section:r}),this.store.getState().visibleTopics[0]!==i&&this.store.actions.visibleTopics([]),e&&!r&&(this.store.commands.clear(/^focus-topic-/),this.store.commands.add({type:`focus-topic-${e}`}))}async resolvePage(e,r){var n,s,i;let a=await this.awaitService();if(r)return a.getPage(r,this.getTranslationSettings());if(!e)return a.getPageByTocId("root",this.getTranslationSettings());let o=(n=this.store.getState().filteredTocNodes)===null||n===void 0?void 0:n[e],c=((s=this.service)===null||s===void 0?void 0:s.getTocNodeNow(e))!=null;return o&&o.reason!=="ACCESS_RIGHTS_FILTER"&&!c?a.getPageByTocId((i=o.closestParent)!==null&&i!==void 0?i:"root",this.getTranslationSettings()):a.getPageByTocId(e,this.getTranslationSettings())}resolveValidNonRootTocId(e,r){var n,s,i,a,o;let c=(s=e==="root"?void 0:e)!==null&&s!==void 0?s:r.rootTocId;if(!r.topics.includes(c)){if(e!="root"&&!r.hiddenTopics.includes(c)){let l=this.store.getState().filteredTocNodes[c];if(l){this.store.dispatchEvent(new Ze(l));let u=((n=this.service)===null||n===void 0?void 0:n.getTocNodeNow(l.tocId))!=null;return l.reason==="ACCESS_RIGHTS_FILTER"||u?l.tocId:(i=l.closestParent)!==null&&i!==void 0?i:"root"}this.store.dispatchEvent(new CustomEvent(fe.requestedTopicNotFound))}return(o=(a=r.topics[0])!==null&&a!==void 0?a:r.hiddenTopics[0])!==null&&o!==void 0?o:"root"}return c}async navigateToPage(e){await this.loaded();let n=await(await this.awaitService()).getPage(e,this.getTranslationSettings());this.store.actions.currentPage(n)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var e;!((e=this.service)===null||e===void 0)&&e.mapId&&this.store.getState().map==null&&await this.loadDebouncer.run(()=>this.fetchData())}clear(){var e;this._loaded=!1,this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),this.store.actions.relatives(void 0),this.store.actions.renderedTopics([]),this.store.actions.visibleTopics([]),this.store.actions.translation({sourceLanguage:void 0,destinationLanguage:void 0,profileId:void 0,isLoading:!1,isError:!1}),this.store.actions.mapRating(void 0),(e=this.service)===null||e===void 0||e.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}clearFromFilter(){this._loaded=!1,this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0)}async reloadFromSticky(){var e;let{scrollTarget:r,applyStickyFilters:n,currentPage:s}=this.store.getState(),i=n?(e=d.getState().stickyFilters)===null||e===void 0?void 0:e.id:void 0;this.service&&this.service.stickyFiltersId!=i&&(this.service.stickyFiltersId=i,await this.reloadFromFilter(r?.section,s?.number))}async reloadFromFilter(e,r){var n,s,i;this.clearFromFilter();let{scrollTarget:a,visibleTopics:o,currentPage:c}=this.store.getState(),l=(i=(s=(n=a?.tocId)!==null&&n!==void 0?n:o?.[0])!==null&&s!==void 0?s:c?.rootTocId)!==null&&i!==void 0?i:"root";await this.fetchDataFromFilter(),this.navigateToTopic(l,e,r)}async fetchDataFromFilter(){var e,r,n,s;let i=this.getTranslationSettings();try{await Promise.all([(e=this.service)===null||e===void 0?void 0:e.getToc(i).then(a=>this.store.actions.toc(a)),(r=this.service)===null||r===void 0?void 0:r.getPagesToc(i).then(a=>this.store.actions.pagesToc(a)),(n=this.service)===null||n===void 0?void 0:n.getFilteredTocNodes(i).then(a=>this.store.actions.filteredTocNodes(a))]),this._loaded=!0}catch(a){if(!(a instanceof k.CanceledPromiseError))throw i&&this.setTranslationError(!0),(s=this.errorHandler)===null||s===void 0||s.call(this,a),a}}async fetchData(){var e,r,n,s,i,a,o;let c=this.getTranslationSettings();try{c&&this.setTranslationLoading(!0),await Promise.all([this.loadConfiguration(),(e=this.service)===null||e===void 0?void 0:e.getMap(c).then(l=>this.store.actions.map(l)),(r=this.service)===null||r===void 0?void 0:r.getToc(c).then(l=>this.store.actions.toc(l)),(n=this.service)===null||n===void 0?void 0:n.getPagesToc(c).then(l=>this.store.actions.pagesToc(l)),(s=this.service)===null||s===void 0?void 0:s.getPaginationConfiguration().then(l=>this.store.actions.paginationConfiguration(l)),(i=this.service)===null||i===void 0?void 0:i.getFilteredTocNodes(c).then(l=>this.store.actions.filteredTocNodes(l)),(a=this.service)===null||a===void 0?void 0:a.getTranslationError(c).then(l=>this.setTranslationError(l))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,c&&this.setTranslationLoading(!1)}catch(l){if(!(l instanceof k.CanceledPromiseError))throw c&&this.setTranslationError(!0),(o=this.errorHandler)===null||o===void 0||o.call(this,l),l}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(r=>this.store.actions.configuration(r))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}async fetchRelatives(){var e,r;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(s=>{var i;return s.key==((i=this.store.getState().configuration)===null||i===void 0?void 0:i.relativePivotMetadata)}).flatMap(s=>s.values);if(n!==void 0&&n.length>0){let s=await((r=this.service)===null||r===void 0?void 0:r.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n)),i=s?.results.flatMap(a=>a.entries);this.store.actions.relatives(i)}this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new Event(fe.clusteringHelperCreated))}createClusteringHelper(){var e,r;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let n=this.store.getState().relatives;if(n){let s=n.find(a=>{var o;return((o=a.map)===null||o===void 0?void 0:o.mapId)==this.store.getState().mapId}),i=(r=(e=d.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&r!==void 0?r:[];return new k.ClusteringHelper(n,s,this.metadataForSwitchToRelatives,i)}}async navigateToRelativeTopicIfFound(e){var r,n,s;await this.loaded();let i=await(0,k.waitFor)(()=>{var l;return(l=this.store.getState().configuration)===null||l===void 0?void 0:l.relativeTopicPivotMetadata}),a=this.store.getState().mapId,c=await(await this.awaitService()).getRelativesForTopicInMap(a,i,[e]);if(!((s=(n=(r=c?.results)===null||r===void 0?void 0:r[0])===null||n===void 0?void 0:n.entries)===null||s===void 0)&&s[0]){let l=c.results[0].entries[0].topic.tocId;return await this.navigateToTopic(l),!0}else return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(e){this.store.actions.searchInDocumentQuery(e)}async setTranslationDestinationLanguage(e){this.store.actions.setTranslationDestinationLanguage(e),e&&this.sendDocumentOnDemandTranslateEvent(e),await this.loadDebouncer.run(()=>this.fetchData())}async setTranslationSourceLanguage(e){this.store.actions.setTranslationSourceLanguage(e),await this.loadDebouncer.run(()=>this.fetchData())}async setTranslationProfileId(e){this.store.actions.setTranslationProfileId(e)}async setTranslationLoading(e){this.store.actions.setTranslationLoading(e)}async setTranslationError(e){this.store.actions.setTranslationError(e)}getTranslationSettings(){var e;let r=this.store.getState();return r.translation.profileId&&r.translation.destinationLanguage?{profileId:r.translation.profileId,destinationLanguage:r.translation.destinationLanguage.code,sourceLanguage:(e=r.map)===null||e===void 0?void 0:e.lang}:void 0}setLinkPreviewDialogId(e){this.store.actions.linkPreviewDialogId(e)}async fetchMapRating(){var e;this.store.actions.mapRating(await((e=this.service)===null||e===void 0?void 0:e.getMapRating()))}async fetchTopicRating(e){var r;let n=await((r=this.service)===null||r===void 0?void 0:r.getTopicRating(e));n&&this.store.actions.setTopicsRating({[e]:n})}registerMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.add(e),this.store.getState().relatives==null?this.fetchRelatives():this.updateClusteringHelper()}unregisterMetadataForSwitchToRelatives(e){this.metadataForSwitchToRelatives.delete(e),this.updateClusteringHelper()}async getAccurateNavigationData(e,r,n){return await this.awaitService(),this.service.getAccurateNavigationData(e,r?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var r;return(r=this.service)===null||r===void 0?void 0:r.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var r,n;let s=this.getTranslationSettings();return s?(this.sendTopicAiTranslateEvent(s.destinationLanguage,e),(r=this.service)===null||r===void 0?void 0:r.getTranslatedTopicContent(e,s).then(i=>(i.isTranslationError&&this.setTranslationError(!0),i.content))):(n=this.service)===null||n===void 0?void 0:n.getTopicContent(e)}getTocNode(e){return this.service.getTocNode(e,this.getTranslationSettings())}getPage(e){return this.service.getPage(e,this.getTranslationSettings())}onMapAttachmentsUpdate(){var e;(e=this.service)===null||e===void 0||e.clearMapAttachments(),this.store.dispatchEvent(new Event(fe.mapAttachmentsUpdate))}async getRelativeDocumentUrlForLocale(e){var r,n,s;this.store.getState().relatives==null&&await this.fetchRelatives();let i=k.ClusteringHelper.findResultWithMetadataValue((s=this.store.getState().relatives)!==null&&s!==void 0?s:[],"ft:locale",e),a=(0,k.accessResultUrl)(i);if(a){let o=this.store.getState().visibleTopics[0],c=(r=this.store.getState().configuration)===null||r===void 0?void 0:r.relativeTopicPivotMetadata;if(c&&o){let l=await((n=this.service)===null||n===void 0?void 0:n.getTopicMetadataValue(o,c));a=Ks(a,l)}}return a}sendDocumentOnDemandTranslateEvent(e){var r;let{editorMode:n,apiIntegrationIdentifier:s,apiIntegrationAppVersion:i}=d.getState(),a=this.store.getState(),o=a.map,c=a.translation.profileId;if(!(n||!o||!s||!i||!c))try{let u={...this.analyticsEventsService.convertMapToAnalyticsDocument(o),title:(r=o.untranslatedTitle)!==null&&r!==void 0?r:o.title};this.analyticsEventsService.sendDocumentOnDemandTranslateEvent({name:"DOCUMENT__ON_DEMAND_TRANSLATE",offline:!1,appName:s,appVersion:i,sourceLanguage:this.parseLanguageToAnalyticsFormat(o.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e.code),profileId:c,document:u,translationOrigin:tt.AI})}catch(l){console.warn("Failed to send on-demand document translate event:",l)}}sendTopicAiTranslateEvent(e,r){var n;let{editorMode:s,apiIntegrationIdentifier:i,apiIntegrationAppVersion:a}=d.getState(),o=this.store.getState(),c=o.map,l=o.translation.profileId;if(!(s||!c||!i||!a||!l))try{let u=this.buildBreadcrumb(r.tocId);if(!u){console.warn("Failed to build breadcrumb for topic ai translate event");return}let p={...this.analyticsEventsService.convertMapToAnalyticsDocument(c),title:(n=c.untranslatedTitle)!==null&&n!==void 0?n:c.title};this.analyticsEventsService.sendTopicAiTranslateEvent({name:"TOPIC__AI_TRANSLATE",offline:!1,appName:i,appVersion:a,sourceLanguage:this.parseLanguageToAnalyticsFormat(c.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e),breadcrumb:u.map(v=>{var S;return{tocId:v.tocId,title:(S=v.untranslatedTitle)!==null&&S!==void 0?S:v.title}}),document:p,profileId:l})}catch(u){console.warn("Failed to send topic ai translate event:",u)}}parseLanguageToAnalyticsFormat(e){if(!e)return;let r=e.split("-");return r.length===2?{languageCode:r[0],countryCode:r[1]}:{languageCode:r[0],countryCode:""}}};var $s=f(le());var zs=$s.css`