@fluid-topics/ft-reader-content 2.0.11 → 2.0.12
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.
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
47
47
|
</article>
|
|
48
48
|
`}registerComponent(e){e.stopPropagation();let r=e.composedPath()[0];this.register(r)}register(e){this.registeredComponents.push(e),e.tocNode=this.tocNode,e.disableContextInteractions=this.disableContextInteractions,e.headingLevelsShift=this.headingLevelsShift}update(e){super.update(e),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(r=>e.has(r))&&this.setTocNode(),e.has("tocNode")&&this.registeredComponents.forEach(r=>r.tocNode=this.tocNode)}async setTocNode(){var e;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((e=this.stateManager)===null||e===void 0?void 0:e.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};ae.styles=an;Me([(0,Gt.redux)({selector:o=>{var e;return(e=o.map)===null||e===void 0?void 0:e.id}})],ae.prototype,"mapId",void 0);Me([(0,Gt.redux)({selector:o=>o.translation.profileId})],ae.prototype,"translationProfileId",void 0);Me([(0,Gt.redux)({selector:o=>o.translation.destinationLanguage})],ae.prototype,"translationDestinationLanguage",void 0);Me([(0,tt.property)()],ae.prototype,"tocId",void 0);Me([(0,tt.property)({type:Boolean})],ae.prototype,"disableContextInteractions",void 0);Me([(0,tt.property)({type:Number})],ae.prototype,"headingLevelsShift",void 0);Me([(0,tt.state)()],ae.prototype,"tocNode",void 0);var cn=C(_());(0,cn.customElement)("ft-reader-topic-context")(ae);var ln=C(V());var dn=ln.css`
|
|
49
|
-
`;var kt=C(V()),$e=C(J()),G=C(_());var fe=C(_());var un=C(_()),gs={setTranslationDestinationLanguage:(o,e)=>{o.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(o,e)=>{o.translation.sourceLanguage=e.payload},setTranslationProfileId:(o,e)=>{o.translation.profileId=e.payload},setTranslationLoading:(o,e)=>{o.translation.isLoading=e.payload},setTranslationError:(o,e)=>{o.translation.isError=e.payload},setTopicsRating:(o,e)=>{for(let r in e.payload)o.topicsRating[r]=e.payload[r]}},pn=o=>un.FtReduxStore.get({name:"ft-reader-"+o,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,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},reducers:gs});var $r=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}}extractPagesToc(e,r,n){return e.flatMap(a=>{var s;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,r,n):[{tocId:a.tocId,title:(s=a.title)!==null&&s!==void 0?s:"",untranslatedTitle:a.untranslatedTitle,depth:r,children:this.extractPagesToc(a.children,r+1,a.tocId)}]})}convertNodes(e,r,n){return e.flatMap(a=>{var s,c,d;if(a.tocId==null)return[...this.convertSectionNodes((s=a.pageToc)!==null&&s!==void 0?s:[],r,a.tocId),...this.convertNodes(a.children,r,a.tocId)];let u=(c=a.prettyUrl)===null||c===void 0?void 0:c.replace(/^\//,""),p={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:u,depth:r,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((d=a.pageToc)!==null&&d!==void 0?d:[],r+1,a.tocId),g=this.convertNodes(a.children,r+1,p.tocId);return p.children=[...h,...g],[p]})}convertSectionNodes(e,r,n){return e.flatMap(a=>{var s;let c=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),d={...a,prettyUrl:c,depth:r,parentTocId:n,children:[]};return this.register(d),d.children=this.convertSectionNodes(a.children,r+1,a.tocId),[d]})}buildPage(e,r){var n,a,s,c,d,u;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(a=e.tocId)!==null&&a!==void 0?a:"root",toc:((s=e.pageToc)!==null&&s!==void 0?s:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},h=(m,v)=>(v?p.topics:p.hiddenTopics).push(m),g=(d=(c=e.pageConfiguration)===null||c===void 0?void 0:c.parentsVisibility)!==null&&d!==void 0?d:[];return p.breadcrumb.forEach((m,v)=>{h(m,g[v])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[])),p}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}},Wt=class{convertPaginatedToc(e,r){return new $r(e,r).build()}};var ms=C(hn(),1);var gn;(function(o){o.black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow"})(gn||(gn={}));var yn;(function(o){o.OFFICIAL="OFFICIAL",o.PERSONAL="PERSONAL",o.SHARED="SHARED"})(yn||(yn={}));var mn;(function(o){o.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",o.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",o.PERSONAL_BOOK="PERSONAL_BOOK",o.ATTACHMENT="ATTACHMENT",o.RESOURCE="RESOURCE",o.HTML_PACKAGE="HTML_PACKAGE"})(mn||(mn={}));var bn;(function(o){o.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",o.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",o.PERSONAL_BOOK="PERSONAL_BOOK",o.ATTACHMENT="ATTACHMENT",o.RESOURCE="RESOURCE",o.HTML_PACKAGE="HTML_PACKAGE"})(bn||(bn={}));var vn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR"})(vn||(vn={}));var xn;(function(o){o.VALUE="VALUE",o.DATE="DATE",o.RANGE="RANGE"})(xn||(xn={}));var Sn;(function(o){o.BOOKMARK__CREATE="BOOKMARK__CREATE",o.BOOKMARK__DELETE="BOOKMARK__DELETE",o.CASE_DEFLECTION__START="CASE_DEFLECTION__START",o.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",o.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",o.CHATBOT__RATE="CHATBOT__RATE",o.COLLECTION__CREATE="COLLECTION__CREATE",o.COLLECTION__UPDATE="COLLECTION__UPDATE",o.COLLECTION__DELETE="COLLECTION__DELETE",o.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",o.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",o.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",o.DOCUMENT__PRINT="DOCUMENT__PRINT",o.DOCUMENT__PROCESS="DOCUMENT__PROCESS",o.DOCUMENT__RATE="DOCUMENT__RATE",o.DOCUMENT__SEARCH="DOCUMENT__SEARCH",o.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",o.DOCUMENT__UNRATE="DOCUMENT__UNRATE",o.FEEDBACK__SEND="FEEDBACK__SEND",o.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",o.AI__RATE="AI__RATE",o.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",o.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",o.KHUB__PROCESS="KHUB__PROCESS",o.KHUB__SEARCH="KHUB__SEARCH",o.LABELS__DOWNLOAD="LABELS__DOWNLOAD",o.LINK__SHARE="LINK__SHARE",o.PAGE__DISPLAY="PAGE__DISPLAY",o.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",o.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",o.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",o.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",o.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",o.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",o.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",o.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",o.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",o.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",o.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",o.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",o.TOPIC__RATE="TOPIC__RATE",o.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",o.TOPIC__UNRATE="TOPIC__UNRATE",o.USER__LOGIN="USER__LOGIN",o.USER__LOGOUT="USER__LOGOUT",o.HEARTBEAT="HEARTBEAT"})(Sn||(Sn={}));var Cn;(function(o){o.THIRD_PARTY="THIRD_PARTY",o.OFF_THE_GRID="OFF_THE_GRID",o.CONTENT_PACKAGER="CONTENT_PACKAGER",o.PAGES="PAGES",o.DESIGNED_READER="DESIGNED_READER"})(Cn||(Cn={}));var On;(function(o){o.HOMEPAGE="HOMEPAGE",o.CUSTOM="CUSTOM",o.HEADER="HEADER",o.READER="READER",o.TOPIC_TEMPLATE="TOPIC_TEMPLATE",o.SEARCH="SEARCH",o.SEARCH_RESULT="SEARCH_RESULT",o.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",o.LINK_PREVIEW="LINK_PREVIEW",o.UD_VIEWER="UD_VIEWER",o.ASSET_VIEWER="ASSET_VIEWER"})(On||(On={}));var En;(function(o){o.CLASSIC="CLASSIC",o.CUSTOM="CUSTOM",o.DESIGNER="DESIGNER"})(En||(En={}));var An;(function(o){o.AND="AND",o.OR="OR",o.MONOVALUED="MONOVALUED"})(An||(An={}));var wn;(function(o){o.NONE="NONE",o.ALPHABET="ALPHABET",o.VERSION="VERSION"})(wn||(wn={}));var In;(function(o){o.STARS="STARS",o.LIKE="LIKE",o.DICHOTOMOUS="DICHOTOMOUS",o.NO_RATING="NO_RATING"})(In||(In={}));var Tn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR",o.CUSTOM="CUSTOM"})(Tn||(Tn={}));var Rn;(function(o){o.OPTIONAL="OPTIONAL",o.MANDATORY="MANDATORY"})(Rn||(Rn={}));var _n;(function(o){o.ASC="ASC",o.DESC="DESC"})(_n||(_n={}));var Nn;(function(o){o.ALPHA="ALPHA",o.NATURAL="NATURAL"})(Nn||(Nn={}));var Ln;(function(o){o.EVERYWHERE="EVERYWHERE",o.TITLE_ONLY="TITLE_ONLY",o.NONE="NONE"})(Ln||(Ln={}));var kn;(function(o){o.ARTICLE="ARTICLE",o.BOOK="BOOK",o.SHARED_BOOK="SHARED_BOOK",o.HTML_PACKAGE="HTML_PACKAGE"})(kn||(kn={}));var Pn;(function(o){o.FLUIDTOPICS="FLUIDTOPICS",o.EXTERNAL="EXTERNAL"})(Pn||(Pn={}));var Dn;(function(o){o.MAP="MAP",o.DOCUMENT="DOCUMENT",o.TOPIC="TOPIC",o.PERSONAL_BOOK="PERSONAL_BOOK",o.SHARED_BOOK="SHARED_BOOK",o.HTML_PACKAGE="HTML_PACKAGE"})(Dn||(Dn={}));var Fn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR"})(Fn||(Fn={}));var Mn;(function(o){o.MAP="MAP",o.DOCUMENT="DOCUMENT",o.TOPIC="TOPIC",o.HTML_PACKAGE="HTML_PACKAGE",o.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Mn||(Mn={}));var Un;(function(o){o.DEFAULT="DEFAULT",o.DOCUMENTS="DOCUMENTS",o.ALL_TOPICS="ALL_TOPICS",o.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Un||(Un={}));var Bn;(function(o){o.PLAIN_TEXT="PLAIN_TEXT",o.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",o.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Bn||(Bn={}));var k;(function(o){o.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",o.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",o.HTML_EXPORT_USER="HTML_EXPORT_USER",o.PDF_EXPORT_USER="PDF_EXPORT_USER",o.SAVED_SEARCH_USER="SAVED_SEARCH_USER",o.COLLECTION_USER="COLLECTION_USER",o.OFFLINE_USER="OFFLINE_USER",o.ANALYTICS_USER="ANALYTICS_USER",o.BETA_USER="BETA_USER",o.DEBUG_USER="DEBUG_USER",o.PRINT_USER="PRINT_USER",o.RATING_USER="RATING_USER",o.FEEDBACK_USER="FEEDBACK_USER",o.GENERATIVE_AI_USER="GENERATIVE_AI_USER",o.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",o.CONTENT_PUBLISHER="CONTENT_PUBLISHER",o.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",o.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",o.KHUB_ADMIN="KHUB_ADMIN",o.USERS_ADMIN="USERS_ADMIN",o.PORTAL_ADMIN="PORTAL_ADMIN",o.ADMIN="ADMIN"})(k||(k={}));var ie;(function(o){o.SEARCHES="SEARCHES",o.BOOKMARKS="BOOKMARKS",o.BOOKS="BOOKS",o.COLLECTIONS="COLLECTIONS"})(ie||(ie={}));var Hn;(function(o){o.UNAUTHENTICATED="UNAUTHENTICATED",o.USER_INCOMPLETE="USER_INCOMPLETE",o.MFA_REQUIRED="MFA_REQUIRED",o.AUTHENTICATED="AUTHENTICATED"})(Hn||(Hn={}));var zn;(function(o){o.VALID="VALID",o.INVALID="INVALID"})(zn||(zn={}));var Gn;(function(o){o.INACCURATE="INACCURATE",o.INCOMPLETE="INCOMPLETE",o.OFF_TOPIC="OFF_TOPIC",o.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",o.SUMMARY="SUMMARY",o.SEMANTIC_SEARCH="SEMANTIC_SEARCH",o.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",o.OTHER="OTHER"})(Gn||(Gn={}));var Wn;(function(o){o.INACCURATE="INACCURATE",o.INCOMPLETE="INCOMPLETE",o.OFF_TOPIC="OFF_TOPIC",o.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",o.SLOW="SLOW",o.OTHER="OTHER"})(Wn||(Wn={}));var $n;(function(o){o.JSON="JSON",o.TEXT="TEXT"})($n||($n={}));var jn;(function(o){o.USER="USER",o.ASSISTANT="ASSISTANT"})(jn||(jn={}));var Vn;(function(o){o.TEXT="TEXT",o.HTML="HTML"})(Vn||(Vn={}));var Kn;(function(o){o.HTML="HTML",o.MARKDOWN="MARKDOWN"})(Kn||(Kn={}));var Zn;(function(o){o.MAP="MAP",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Zn||(Zn={}));var ys={[k.PERSONAL_BOOK_SHARE_USER]:[k.PERSONAL_BOOK_USER],[k.HTML_EXPORT_USER]:[k.PERSONAL_BOOK_USER],[k.PDF_EXPORT_USER]:[k.PERSONAL_BOOK_USER],[k.KHUB_ADMIN]:[k.CONTENT_PUBLISHER],[k.ADMIN]:[k.KHUB_ADMIN,k.USERS_ADMIN,k.PORTAL_ADMIN,k.BEHAVIOR_DATA_USER],[k.GENERATIVE_AI_EXPORT_USER]:[k.GENERATIVE_AI_USER]};function qn(o,e){return o===e||(ys[o]??[]).some(r=>qn(r,e))}function xe(o,e){return o==null?!1:(Array.isArray(o)?o:Array.isArray(o.roles)?o.roles:Array.isArray(o.profile?.roles)?o.profile.roles:[]).some(n=>qn(n,e))}var yo=C(J());function bs(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let r,n,a;if(Array.isArray(o)){if(r=o.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Vt(o[n],e[n]))return!1;return!0}if(o instanceof Map&&e instanceof Map){if(o.size!==e.size)return!1;for(n of o.entries())if(!e.has(n[0]))return!1;for(n of o.entries())if(!Vt(n[1],e.get(n[0])))return!1;return!0}if(o instanceof Set&&e instanceof Set){if(o.size!==e.size)return!1;for(n of o.entries())if(!e.has(n[0]))return!1;return!0}if(o.constructor===RegExp)return o.source===e.source&&o.flags===e.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=s(o),r=a.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){let c=a[n];if(!Vt(o[c],e[c]))return!1}return!0}return o!==o&&e!==e||o==null&&e==null}function Vt(o,e){try{return bs(o,e)}catch{return!1}}function It(o,e){return!Vt(o,e)}function Yn(o){return typeof window.structuredClone=="function"?structuredClone(o):o!=null?JSON.parse(JSON.stringify(o)):o}function Kt(o,e){let r=n=>n[o]===!0;return n=>{if(r(n))return n;let a=e(n);return a[o]=!0,a}}var Qn=C(J(),1);var jr=o=>{let e=o??{};return(r,n)=>{var a;let s={hasChanged:It,attribute:!1,...e};(0,Qn.property)(s)(r,n);let c=r.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:d=>d[n],store:e.store})}};var Zt=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 Ue=C(J(),1);var Xn=C(J(),1);function Jn(o,e){let r=()=>JSON.parse(JSON.stringify(o));return(0,Xn.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:It,...e??{}})}var qt=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 a=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ta=C(V(),1);var Yt=globalThis,vs=Yt.ShadowRoot&&(Yt.ShadyCSS===void 0||Yt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vl=Symbol();var ea=(o,e)=>{if(vs)o.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),a=Yt.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=r.cssText,o.appendChild(n)}};var Qt=class extends ta.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([a,s])=>e.registry.define(a,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return ea(n,e.elementStyles),n}};function ra(o,e,...r){var n;let a=o.querySelector(e);for(let s of r)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var nt=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},ia,oa=Symbol("constructorPrototype"),na=Symbol("constructorName"),sa=Symbol("exportpartsDebouncer"),aa=Symbol("dynamicDependenciesLoaded"),ot=class o extends CustomEvent{constructor(){super(o.eventName,{bubbles:!0})}};ot.eventName="exportparts-updated";var ye=class extends Qt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ia]=new qt(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[sa].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[na]=this.constructor.name,this[oa]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[na]&&Object.setPrototypeOf(this,this[oa])}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[aa]||(r[aa]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(ot.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(ot.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 ot)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let s=[...a??[],n];r=ra(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,a;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,n,a,s,c,d;let u=m=>m!=null&&m.trim().length>0,p=e.filter(u).map(m=>m.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let m of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],b=(d=(c=m.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(w=>w.split(":")[1]))!==null&&d!==void 0?d:[],O=[...v,...b].filter(u).map(w=>w.trim());for(let w of O)h.add(w)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(m=>p.map(v=>`${m}:${v}--${m}`));this.exportparts=[...this.part,...g].join(", ")}};ia=sa;nt([(0,Ue.property)()],ye.prototype,"exportpartsPrefix",void 0);nt([Jn([])],ye.prototype,"exportpartsPrefixes",void 0);nt([(0,Ue.property)({reflect:!0})],ye.prototype,"exportparts",void 0);nt([(0,Ue.property)()],ye.prototype,"customStylesheet",void 0);nt([(0,Ue.property)()],ye.prototype,"elementToFocus",void 0);nt([(0,Ue.state)()],ye.prototype,"useAdoptedStyleSheets",void 0);function Xt(o){var e;return(e=o?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Tt=Symbol("internalReduxEventsUnsubscribers"),Ae=Symbol("internalStoresUnsubscribers"),Be=Symbol("internalStores"),xs=Kt(Symbol("withRedux"),function(o){var e,r,n;class a extends o{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[Be].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Be].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[Be].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[Be].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[Be].delete(d)}setupStores(){this.unsubscribeFromStores(),this[Be].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[Ae].has(c.store):this[Ae].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[Ae].set(c,d.subscribe(()=>this.updateFromStores())),this[Tt].set(c,[]),Xt(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let g=m=>this[h](m);d.addEventListener(p.eventName,g),this[Tt].get(c).push(()=>d.removeEventListener(p.eventName,g))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[Ae].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[Ae].has(c)&&this[Ae].get(c)(),this[Ae].delete(c),(d=this[Tt].get(c))===null||d===void 0||d.forEach(u=>u()),this[Tt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ae,r=Be,n=Tt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),ca=class extends xs(ye){};function se(o){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var a,s;throw Error("[Immer] minified error nr: "+o+(r.length?" "+r.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Se(o){return!!o&&!!o[M]}function ue(o){var e;return!!o&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Ts}(o)||Array.isArray(o)||!!o[ga]||!!(!((e=o.constructor)===null||e===void 0)&&e[ga])||eo(o)||to(o))}function He(o,e,r){r===void 0&&(r=!1),st(o)===0?(r?Object.keys:it)(o).forEach(function(n){r&&typeof n=="symbol"||e(n,o[n],o)}):o.forEach(function(n,a){return e(a,n,o)})}function st(o){var e=o[M];return e?e.i>3?e.i-4:e.i:Array.isArray(o)?1:eo(o)?2:to(o)?3:0}function at(o,e){return st(o)===2?o.has(e):Object.prototype.hasOwnProperty.call(o,e)}function Ss(o,e){return st(o)===2?o.get(e):o[e]}function ya(o,e,r){var n=st(o);n===2?o.set(e,r):n===3?o.add(r):o[e]=r}function ma(o,e){return o===e?o!==0||1/o==1/e:o!=o&&e!=e}function eo(o){return ws&&o instanceof Map}function to(o){return Is&&o instanceof Set}function we(o){return o.o||o.t}function ro(o){if(Array.isArray(o))return Array.prototype.slice.call(o);var e=xa(o);delete e[M];for(var r=it(e),n=0;n<r.length;n++){var a=r[n],s=e[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:o[a]})}return Object.create(Object.getPrototypeOf(o),e)}function oo(o,e){return e===void 0&&(e=!1),no(o)||Se(o)||!ue(o)||(st(o)>1&&(o.set=o.add=o.clear=o.delete=Cs),Object.freeze(o),e&&He(o,function(r,n){return oo(n,!0)},!0)),o}function Cs(){se(2)}function no(o){return o==null||typeof o!="object"||Object.isFrozen(o)}function me(o){var e=Jr[o];return e||se(18,o),e}function Os(o,e){Jr[o]||(Jr[o]=e)}function Yr(){return _t}function Vr(o,e){e&&(me("Patches"),o.u=[],o.s=[],o.v=e)}function Jt(o){Qr(o),o.p.forEach(Es),o.p=null}function Qr(o){o===_t&&(_t=o.l)}function la(o){return _t={p:[],l:_t,h:o,m:!0,_:0}}function Es(o){var e=o[M];e.i===0||e.i===1?e.j():e.g=!0}function Kr(o,e){e._=e.p.length;var r=e.p[0],n=o!==void 0&&o!==r;return e.h.O||me("ES5").S(e,o,n),n?(r[M].P&&(Jt(e),se(4)),ue(o)&&(o=er(e,o),e.l||tr(e,o)),e.u&&me("Patches").M(r[M].t,o,e.u,e.s)):o=er(e,r,[]),Jt(e),e.u&&e.v(e.u,e.s),o!==va?o:void 0}function er(o,e,r){if(no(e))return e;var n=e[M];if(!n)return He(e,function(d,u){return da(o,n,e,d,u,r)},!0),e;if(n.A!==o)return e;if(!n.P)return tr(o,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ro(n.k):n.o,s=a,c=!1;n.i===3&&(s=new Set(a),a.clear(),c=!0),He(s,function(d,u){return da(o,n,a,d,u,r,c)}),tr(o,a,!1),r&&o.u&&me("Patches").N(n,r,o.u,o.s)}return n.o}function da(o,e,r,n,a,s,c){if(Se(a)){var d=er(o,a,s&&e&&e.i!==3&&!at(e.R,n)?s.concat(n):void 0);if(ya(r,n,d),!Se(d))return;o.m=!1}else c&&r.add(a);if(ue(a)&&!no(a)){if(!o.h.D&&o._<1)return;er(o,a),e&&e.A.l||tr(o,a)}}function tr(o,e,r){r===void 0&&(r=!1),!o.l&&o.h.D&&o.m&&oo(e,r)}function Zr(o,e){var r=o[M];return(r?we(r):o)[e]}function ua(o,e){if(e in o)for(var r=Object.getPrototypeOf(o);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ie(o){o.P||(o.P=!0,o.l&&Ie(o.l))}function qr(o){o.o||(o.o=ro(o.t))}function Xr(o,e,r){var n=eo(e)?me("MapSet").F(e,r):to(e)?me("MapSet").T(e,r):o.O?function(a,s){var c=Array.isArray(a),d={i:c?1:0,A:s?s.A:Yr(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Nt;c&&(u=[d],p=Rt);var h=Proxy.revocable(u,p),g=h.revoke,m=h.proxy;return d.k=m,d.j=g,m}(e,r):me("ES5").J(e,r);return(r?r.A:Yr()).p.push(n),n}function As(o){return Se(o)||se(22,o),function e(r){if(!ue(r))return r;var n,a=r[M],s=st(r);if(a){if(!a.P&&(a.i<4||!me("ES5").K(a)))return a.t;a.I=!0,n=pa(r,s),a.I=!1}else n=pa(r,s);return He(n,function(c,d){a&&Ss(a.t,c)===d||ya(n,c,e(d))}),s===3?new Set(n):n}(o)}function pa(o,e){switch(e){case 2:return new Map(o);case 3:return Array.from(o)}return ro(o)}function ba(){function o(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[M];return Nt.get(p,c)},set:function(p){var h=this[M];Nt.set(h,c,p)}},u}function e(c){for(var d=c.length-1;d>=0;d--){var u=c[d][M];if(!u.P)switch(u.i){case 5:n(u)&&Ie(u);break;case 4:r(u)&&Ie(u)}}}function r(c){for(var d=c.t,u=c.k,p=it(u),h=p.length-1;h>=0;h--){var g=p[h];if(g!==M){var m=d[g];if(m===void 0&&!at(d,g))return!0;var v=u[g],b=v&&v[M];if(b?b.t!==m:!ma(v,m))return!0}}var O=!!d[M];return p.length!==it(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(c){c.g&&se(3,JSON.stringify(we(c)))}var s={};Os("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(g,m){if(g){for(var v=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(v,""+b,o(b,!0));return v}var O=xa(m);delete O[M];for(var w=it(O),I=0;I<w.length;I++){var T=w[I];O[T]=o(T,g||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(u,c),h={i:u?5:4,A:d?d.A:Yr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,M,{value:h,writable:!0}),p},S:function(c,d,u){u?Se(d)&&d[M].A===c&&e(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var g=h[M];if(g){var m=g.t,v=g.k,b=g.R,O=g.i;if(O===4)He(v,function(N){N!==M&&(m[N]!==void 0||at(m,N)?b[N]||p(v[N]):(b[N]=!0,Ie(g)))}),He(m,function(N){v[N]!==void 0||at(v,N)||(b[N]=!1,Ie(g))});else if(O===5){if(n(g)&&(Ie(g),b.length=!0),v.length<m.length)for(var w=v.length;w<m.length;w++)b[w]=!1;else for(var I=m.length;I<v.length;I++)b[I]=!0;for(var T=Math.min(v.length,m.length),P=0;P<T;P++)v.hasOwnProperty(P)||(b[P]=!0),b[P]===void 0&&p(v[P])}}}}(c.p[0]),e(c.p))},K:function(c){return c.i===4?r(c):n(c)}})}var fa,_t,ao=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ws=typeof Map<"u",Is=typeof Set<"u",ha=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",va=ao?Symbol.for("immer-nothing"):((fa={})["immer-nothing"]=!0,fa),ga=ao?Symbol.for("immer-draftable"):"__$immer_draftable",M=ao?Symbol.for("immer-state"):"__$immer_state";var Ts=""+Object.prototype.constructor,it=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:Object.getOwnPropertyNames,xa=Object.getOwnPropertyDescriptors||function(o){var e={};return it(o).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(o,r)}),e},Jr={},Nt={get:function(o,e){if(e===M)return o;var r=we(o);if(!at(r,e))return function(a,s,c){var d,u=ua(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(o,r,e);var n=r[e];return o.I||!ue(n)?n:n===Zr(o.t,e)?(qr(o),o.o[e]=Xr(o.A.h,n,o)):n},has:function(o,e){return e in we(o)},ownKeys:function(o){return Reflect.ownKeys(we(o))},set:function(o,e,r){var n=ua(we(o),e);if(n?.set)return n.set.call(o.k,r),!0;if(!o.P){var a=Zr(we(o),e),s=a?.[M];if(s&&s.t===r)return o.o[e]=r,o.R[e]=!1,!0;if(ma(r,a)&&(r!==void 0||at(o.t,e)))return!0;qr(o),Ie(o)}return o.o[e]===r&&(r!==void 0||e in o.o)||Number.isNaN(r)&&Number.isNaN(o.o[e])||(o.o[e]=r,o.R[e]=!0),!0},deleteProperty:function(o,e){return Zr(o.t,e)!==void 0||e in o.t?(o.R[e]=!1,qr(o),Ie(o)):delete o.R[e],o.o&&delete o.o[e],!0},getOwnPropertyDescriptor:function(o,e){var r=we(o),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:o.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){se(11)},getPrototypeOf:function(o){return Object.getPrototypeOf(o.t)},setPrototypeOf:function(){se(12)}},Rt={};He(Nt,function(o,e){Rt[o]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Rt.deleteProperty=function(o,e){return Rt.set.call(this,o,e,void 0)},Rt.set=function(o,e,r){return Nt.set.call(this,o[0],e,r,o[0])};var Rs=function(){function o(r){var n=this;this.O=ha,this.D=!0,this.produce=function(a,s,c){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(O){var w=this;O===void 0&&(O=d);for(var I=arguments.length,T=Array(I>1?I-1:0),P=1;P<I;P++)T[P-1]=arguments[P];return u.produce(O,function(N){var $;return($=s).call.apply($,[w,N].concat(T))})}}var p;if(typeof s!="function"&&se(6),c!==void 0&&typeof c!="function"&&se(7),ue(a)){var h=la(n),g=Xr(n,a,void 0),m=!0;try{p=s(g),m=!1}finally{m?Jt(h):Qr(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(O){return Vr(h,c),Kr(O,h)},function(O){throw Jt(h),O}):(Vr(h,c),Kr(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===va&&(p=void 0),n.D&&oo(p,!0),c){var v=[],b=[];me("Patches").M(a,p,v,b),c(v,b)}return p}se(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,g=Array(h>1?h-1:0),m=1;m<h;m++)g[m-1]=arguments[m];return n.produceWithPatches(p,function(v){return a.apply(void 0,[v].concat(g))})};var c,d,u=n.produce(a,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=o.prototype;return e.createDraft=function(r){ue(r)||se(8),Se(r)&&(r=As(r));var n=la(this),a=Xr(this,r,void 0);return a[M].C=!0,Qr(n),a},e.finishDraft=function(r,n){var a=r&&r[M],s=a.A;return Vr(s,n),Kr(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!ha&&se(20),this.O=r},e.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}a>-1&&(n=n.slice(a+1));var c=me("Patches").$;return Se(r)?c(r,n):this.produce(r,function(d){return c(d,n)})},o}(),re=new Rs,_s=re.produce,Pl=re.produceWithPatches.bind(re),Dl=re.setAutoFreeze.bind(re),Fl=re.setUseProxies.bind(re),Ml=re.applyPatches.bind(re),Ul=re.createDraft.bind(re),Bl=re.finishDraft.bind(re),rr=_s;function ze(o){"@babel/helpers - typeof";return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(o)}function Sa(o,e){if(ze(o)!="object"||!o)return o;var r=o[Symbol.toPrimitive];if(r!==void 0){var n=r.call(o,e||"default");if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Ca(o){var e=Sa(o,"string");return ze(e)=="symbol"?e:e+""}function Oa(o,e,r){return(e=Ca(e))in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}function Ea(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),r.push.apply(r,n)}return r}function io(o){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ea(Object(r),!0).forEach(function(n){Oa(o,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):Ea(Object(r)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(r,n))})}return o}function Y(o){return"Minified Redux error #"+o+"; visit https://redux.js.org/Errors?code="+o+" for the full message or use the non-minified dev environment for full errors. "}var Aa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),so=function(){return Math.random().toString(36).substring(7).split("").join(".")},or={INIT:"@@redux/INIT"+so(),REPLACE:"@@redux/REPLACE"+so(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+so()}};function Ns(o){if(typeof o!="object"||o===null)return!1;for(var e=o;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(o)===e}function co(o,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Y(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Y(1));return r(co)(o,e)}if(typeof o!="function")throw new Error(Y(2));var a=o,s=e,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(Y(3));return s}function g(O){if(typeof O!="function")throw new Error(Y(4));if(u)throw new Error(Y(5));var w=!0;return p(),d.push(O),function(){if(w){if(u)throw new Error(Y(6));w=!1,p();var T=d.indexOf(O);d.splice(T,1),c=null}}}function m(O){if(!Ns(O))throw new Error(Y(7));if(typeof O.type>"u")throw new Error(Y(8));if(u)throw new Error(Y(9));try{u=!0,s=a(s,O)}finally{u=!1}for(var w=c=d,I=0;I<w.length;I++){var T=w[I];T()}return O}function v(O){if(typeof O!="function")throw new Error(Y(10));a=O,m({type:or.REPLACE})}function b(){var O,w=g;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(Y(11));function P(){T.next&&T.next(h())}P();var N=w(P);return{unsubscribe:N}}},O[Aa]=function(){return this},O}return m({type:or.INIT}),n={dispatch:m,subscribe:g,getState:h,replaceReducer:v},n[Aa]=b,n}function Ls(o){Object.keys(o).forEach(function(e){var r=o[e],n=r(void 0,{type:or.INIT});if(typeof n>"u")throw new Error(Y(12));if(typeof r(void 0,{type:or.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Y(13))})}function wa(o){for(var e=Object.keys(o),r={},n=0;n<e.length;n++){var a=e[n];typeof o[a]=="function"&&(r[a]=o[a])}var s=Object.keys(r),c,d;try{Ls(r)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var g;for(var m=!1,v={},b=0;b<s.length;b++){var O=s[b],w=r[O],I=p[O],T=w(I,h);if(typeof T>"u"){var P=h&&h.type;throw new Error(Y(14))}v[O]=T,m=m||T!==I}return m=m||s.length!==Object.keys(p).length,m?v:p}}function ct(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Ia(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(Y(15))},c={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=e.map(function(u){return u(c)});return s=ct.apply(void 0,d)(a.dispatch),io(io({},a),{},{dispatch:s})}}}function Ta(o){var e=function(n){var a=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,s,o):c(d)}}};return e}var Ra=Ta();Ra.withExtraArgument=Ta;var lo=Ra;var Pa=function(){var o=function(e,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},o(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ks=function(o,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(o,r)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},lt=function(o,e){for(var r=0,n=e.length,a=o.length;r<n;r++,a++)o[a]=e[r];return o},Ps=Object.defineProperty,Ds=Object.defineProperties,Fs=Object.getOwnPropertyDescriptors,_a=Object.getOwnPropertySymbols,Ms=Object.prototype.hasOwnProperty,Us=Object.prototype.propertyIsEnumerable,Na=function(o,e,r){return e in o?Ps(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r},Te=function(o,e){for(var r in e||(e={}))Ms.call(e,r)&&Na(o,r,e[r]);if(_a)for(var n=0,a=_a(e);n<a.length;n++){var r=a[n];Us.call(e,r)&&Na(o,r,e[r])}return o},uo=function(o,e){return Ds(o,Fs(e))},Bs=function(o,e,r){return new Promise(function(n,a){var s=function(u){try{d(r.next(u))}catch(p){a(p)}},c=function(u){try{d(r.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((r=r.apply(o,e)).next())})};var Hs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ct:ct.apply(null,arguments)},od=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(o){return o}};function zs(o){if(typeof o!="object"||o===null)return!1;var e=Object.getPrototypeOf(o);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Gs=function(o){Pa(e,o);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o.apply(this,r)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,lt([void 0],r[0].concat(this)))):new(e.bind.apply(e,lt([void 0],r.concat(this))))},e}(Array),Ws=function(o){Pa(e,o);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o.apply(this,r)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,lt([void 0],r[0].concat(this)))):new(e.bind.apply(e,lt([void 0],r.concat(this))))},e}(Array);function ho(o){return ue(o)?rr(o,function(){}):o}function $s(o){return typeof o=="boolean"}function js(){return function(e){return Vs(e)}}function Vs(o){o===void 0&&(o={});var e=o.thunk,r=e===void 0?!0:e,n=o.immutableCheck,a=n===void 0?!0:n,s=o.serializableCheck,c=s===void 0?!0:s,d=new Gs;if(r&&($s(r)?d.push(lo):d.push(lo.withExtraArgument(r.extraArgument))),0){if(a)var u;if(c)var p}return d}var po=!0;function Da(o){var e=js(),r=o||{},n=r.reducer,a=n===void 0?void 0:n,s=r.middleware,c=s===void 0?e():s,d=r.devTools,u=d===void 0?!0:d,p=r.preloadedState,h=p===void 0?void 0:p,g=r.enhancers,m=g===void 0?void 0:g,v;if(typeof a=="function")v=a;else if(zs(a))v=wa(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var b=c;if(typeof b=="function"&&(b=b(e),!po&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!po&&b.some(function(N){return typeof N!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Ia.apply(void 0,b),w=ct;u&&(w=Hs(Te({trace:!po},typeof u=="object"&&u)));var I=new Ws(O),T=I;Array.isArray(m)?T=lt([O],m):typeof m=="function"&&(T=m(I));var P=w.apply(void 0,T);return co(v,h,P)}function Re(o,e){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Te(Te({type:o,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:o,payload:n[0]}}return r.toString=function(){return""+o},r.type=o,r.match=function(n){return n.type===o},r}function Fa(o){var e={},r=[],n,a={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[d]=c,a},addMatcher:function(s,c){return r.push({matcher:s,reducer:c}),a},addDefaultCase:function(s){return n=s,a}};return o(a),[e,r,n]}function Ks(o){return typeof o=="function"}function Zs(o,e,r,n){r===void 0&&(r=[]);var a=typeof e=="function"?Fa(e):[e,r,n],s=a[0],c=a[1],d=a[2],u;if(Ks(o))u=function(){return ho(o())};else{var p=ho(o);u=function(){return p}}function h(g,m){g===void 0&&(g=u());var v=lt([s[m.type]],c.filter(function(b){var O=b.matcher;return O(m)}).map(function(b){var O=b.reducer;return O}));return v.filter(function(b){return!!b}).length===0&&(v=[d]),v.reduce(function(b,O){if(O)if(Se(b)){var w=b,I=O(w,m);return I===void 0?b:I}else{if(ue(b))return rr(b,function(T){return O(T,m)});var I=O(b,m);if(I===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return b},g)}return h.getInitialState=u,h}function qs(o,e){return o+"/"+e}function Ma(o){var e=o.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof o.initialState=="function"?o.initialState:ho(o.initialState),n=o.reducers||{},a=Object.keys(n),s={},c={},d={};a.forEach(function(h){var g=n[h],m=qs(e,h),v,b;"reducer"in g?(v=g.reducer,b=g.prepare):v=g,s[h]=v,c[m]=v,d[h]=b?Re(m,b):Re(m)});function u(){var h=typeof o.extraReducers=="function"?Fa(o.extraReducers):[o.extraReducers],g=h[0],m=g===void 0?{}:g,v=h[1],b=v===void 0?[]:v,O=h[2],w=O===void 0?void 0:O,I=Te(Te({},m),c);return Zs(r,function(T){for(var P in I)T.addCase(P,I[P]);for(var N=0,$=b;N<$.length;N++){var de=$[N];T.addMatcher(de.matcher,de.reducer)}w&&T.addDefaultCase(w)})}var p;return{name:e,reducer:function(h,g){return p||(p=u()),p(h,g)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Ys="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qs=function(o){o===void 0&&(o=21);for(var e="",r=o;r--;)e+=Ys[Math.random()*64|0];return e},Xs=["name","message","stack","code"],fo=function(){function o(e,r){this.payload=e,this.meta=r}return o}(),La=function(){function o(e,r){this.payload=e,this.meta=r}return o}(),Js=function(o){if(typeof o=="object"&&o!==null){for(var e={},r=0,n=Xs;r<n.length;r++){var a=n[r];typeof o[a]=="string"&&(e[a]=o[a])}return e}return{message:String(o)}},sd=function(){function o(e,r,n){var a=Re(e+"/fulfilled",function(h,g,m,v){return{payload:h,meta:uo(Te({},v||{}),{arg:m,requestId:g,requestStatus:"fulfilled"})}}),s=Re(e+"/pending",function(h,g,m){return{payload:void 0,meta:uo(Te({},m||{}),{arg:g,requestId:h,requestStatus:"pending"})}}),c=Re(e+"/rejected",function(h,g,m,v,b){return{payload:v,error:(n&&n.serializeError||Js)(h||"Rejected"),meta:uo(Te({},b||{}),{arg:m,requestId:g,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(g,m,v){var b=n?.idGenerator?n.idGenerator(h):Qs(),O=new u,w,I=!1;function T(N){w=N,O.abort()}var P=function(){return Bs(this,null,function(){var N,$,de,ke,X,Pe,Qe;return ks(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),ke=(N=n?.condition)==null?void 0:N.call(n,h,{getState:m,extra:v}),tc(ke)?[4,ke]:[3,2];case 1:ke=f.sent(),f.label=2;case 2:if(ke===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,X=new Promise(function(y,A){return O.signal.addEventListener("abort",function(){return A({name:"AbortError",message:w||"Aborted"})})}),g(s(b,h,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:b,arg:h},{getState:m,extra:v}))),[4,Promise.race([X,Promise.resolve(r(h,{dispatch:g,getState:m,extra:v,requestId:b,signal:O.signal,abort:T,rejectWithValue:function(y,A){return new fo(y,A)},fulfillWithValue:function(y,A){return new La(y,A)}})).then(function(y){if(y instanceof fo)throw y;return y instanceof La?a(y.payload,b,h,y.meta):a(y,b,h)})])];case 3:return de=f.sent(),[3,5];case 4:return Pe=f.sent(),de=Pe instanceof fo?c(null,b,h,Pe.payload,Pe.meta):c(Pe,b,h),[3,5];case 5:return Qe=n&&!n.dispatchConditionRejection&&c.match(de)&&de.meta.condition,Qe||g(de),[2,de]}})})}();return Object.assign(P,{abort:T,requestId:b,arg:h,unwrap:function(){return P.then(ec)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:a,typePrefix:e})}return o.withTypes=function(){return o},o}();function ec(o){if(o.meta&&o.meta.rejectedWithValue)throw o.payload;if(o.error)throw o.error;return o.payload}function tc(o){return o!==null&&typeof o=="object"&&typeof o.then=="function"}var Ua="listener",Ba="completed",Ha="cancelled",cd="task-"+Ha,ld="task-"+Ba,dd=Ua+"-"+Ha,ud=Ua+"-"+Ba;var go="listenerMiddleware";var pd=Re(go+"/add"),fd=Re(go+"/removeAll"),hd=Re(go+"/remove");var ka,gd=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(o){return(ka||(ka=Promise.resolve())).then(o).catch(function(e){return setTimeout(function(){throw e},0)})},rc=function(o){return function(e){setTimeout(e,o)}},yd=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rc(10);ba();var oc=Kt(Symbol("withEventBus"),function(o,e){return class extends o{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,a){this.eventBus.addEventListener(r,n,a)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,a){this.eventBus.removeEventListener(r,n,a)}}}),nr=class extends oc(Object){};window.ftReduxStores||(window.ftReduxStores={});var za=class o extends nr{static get(e){var r;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(Xt(s))return s;if(a==null)return;let c=Ma({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),d=Da({reducer:(u,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=Yn(c.getInitialState());for(let g of p.keeping)h[g]=(u??h)[g];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...p.overwrites};return c.reducer(u,p)}});return window.ftReduxStores[a.name]=new o(c,d,a.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Zt;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let g=p(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{this.setState({[u]:a(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()}};var ar=class{static format(e,r,n,a){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,r,n,a)}static getMomentDateFormat(e,r){return e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,a){let s=typeof e=="string"?new Date(e):e,c=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(s);if(!a)return c;let d=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return`${c} ${d}`}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 ir=C(_()),nc="ft-app-info",be=class o extends CustomEvent{constructor(e){super(o.eventName,{detail:e})}};be.eventName="authentication-change";var ac={session:(o,e)=>{(0,ir.deepEqual)(o.session,e.payload)||(o.session=e.payload,setTimeout(()=>S.dispatchEvent(new be(e.payload)),0))}},S=ir.FtReduxStore.get({name:nc,reducers:ac,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Ga=C(_()),sr=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},$d=(0,Ga.applyMixinOnce)(Symbol("withDateFormat"),function(o){class e extends o{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(S)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>ar.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return sr([(0,yo.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),sr([(0,yo.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),sr([jr({store:S.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),sr([jr({store:S.name})],e.prototype,"uiLocale",void 0),e});var fr=C(_());var mo=C(_());var Ge=class o{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=S.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=o.get(e);if(n)r(n);else{let a=S.subscribe(()=>{n=o.get(e),n&&(a(),r(n))})}})}};var cr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ge.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ge.await()}};var Q=class extends cr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,c)=>typeof c!="object"||c==null||Array.isArray(c)?c:Object.fromEntries(Object.entries(c).sort(([d],[u])=>d.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new mo.CacheRegistry,this.cache=e?a.commonCache:new mo.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 lr=class extends Q{async listMySearches(){let{session:e}=S.getState();return xe(e,k.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var dr=class extends Q{async listMyBookmarks(){let e=S.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var ur=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=S.getState().session;return!!e?.sessionAuthenticated}};var pr=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=S.getState().session;return!!e?.sessionAuthenticated}};var ic="ft-user-assets",sc={setAssetCount:(o,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;o.assetCounts.allAsset[r]=n},clearAssetCount:o=>{Object.values(ie).forEach(e=>{o.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(o,e)=>{let r=e.payload.mapId;o.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:o=>{o.assetCounts.bookmarkByMap={}},addAsset:(o,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;vo(o,r,[...bo(o,r),a]),Wa(o,r,1,n),$a(o,a)},editAsset:(o,e)=>{let{assetType:r,asset:n}=e.payload;vo(o,r,bo(o,r).map(a=>a.id===n.id?n:a)),$a(o,n)},removeAsset:(o,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;vo(o,r,bo(o,r).filter(s=>s.id!==a)),Wa(o,r,-1,n)}},ja={[ie.SEARCHES]:"savedSearches",[ie.BOOKMARKS]:"bookmarks",[ie.BOOKS]:void 0,[ie.COLLECTIONS]:void 0},bo=(o,e)=>{var r;let n=ja[e];return n?(r=o[n])!==null&&r!==void 0?r:[]:[]},vo=(o,e,r)=>{let n=ja[e];n&&(o[n]=r)},Wa=(o,e,r,n)=>{let a=o.assetCounts.allAsset[e];if(a!==void 0&&(o.assetCounts.allAsset[e]=Math.max(0,a+r),e===ie.BOOKMARKS&&n)){let s=o.assetCounts.bookmarkByMap[n];o.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},$a=(o,e)=>{let r=o.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));o.assetLabels.push(...n)},oe=fr.FtReduxStore.get({name:ic,reducers:sc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ie).map(o=>[o,void 0])),bookmarkByMap:{}},assetLabels:[]}}),xo=class{constructor(e=new ur,r=new pr){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=S.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dr,this.savedSearchesService=new lr,S.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=S.getState();(0,fr.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(),oe.actions.clearAssetCount(),oe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),oe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),oe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();oe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();oe.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&oe.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&oe.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(oe.getState().assetCounts.bookmarkByMap).length!==0;e===ie.BOOKMARKS&&r&&oe.actions.clearBookmarkCountByMap(),oe.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;oe.actions.bookmarks(r)}}},So=new xo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=So);var Co=class{addCommand(e,r=!1){S.commands.add(e,r)}consumeCommand(e){return S.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Co;var ce=C(_());var Va,dt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},cc=Symbol("clearAfterUnitTest"),hr=class extends(0,ce.withEventBus)(Q){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Va]=()=>{this.defaultMessages={},this.cache=new ce.CacheRegistry,this.listeners={}},this.currentUiLocale=S.getState().uiLocale,S.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=S.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 a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,ce.deepEqual)(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,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 a;let s=e.toLowerCase(),c=this.resolveContext(s);return new ce.ParametrizedLabelResolver((a=this.defaultMessages[s])!==null&&a!==void 0?a:{},c).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(a){!(a instanceof ce.CanceledPromiseError)&&r&&console.error(a)}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 a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new dt({loadedContexts:e})),this.dispatchEvent(new dt({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new dt({loadedContexts:[e]})),this.dispatchEvent(new dt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,ce.delay)(0).then(()=>n()).catch(()=>null)))}};Va=cc;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends hr{constructor(){super(async(o,e)=>(await this.awaitApi).getFluidTopicsMessageContext(o,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends hr{constructor(){super(async(o,e)=>(await this.awaitApi).getCustomMessageContext(o,e))}});var Ka=window.FluidTopicsI18nService,Au=window.FluidTopicsCustomI18nService;var Za=C(_()),Oo=class{highlightHtml(e,r,n){(0,Za.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Oo;var qa=C(_());var Eo=class{isDate(e){var r,n,a,s;return(s=(a=((n=(r=S.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===e))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1}format(e,r){var n,a,s;if(e==null)return"";try{return qa.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:S.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new Eo;var Ya=C(_());var Lt=class{static get(e,r){var n,a;let s=S.getState(),{lang:c,region:d}=(a=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Ya.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${c}-${d}`)}};var gr=class extends Q{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 sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_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,a])=>Array.isArray(a)?[n,a.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,c)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(c.key):typeof s=="string"&&typeof c=="string"?s.localeCompare(c):String(s).localeCompare(String(c)))]:typeof a=="object"&&a!==null?[n,this.sortEventArrays(a)]:[n,a]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(a=>(console.info(r),console.debug(a),n)),1e3)}};var Ao=class{urlToSearchRequest(e){return Lt.get().parse(e)}searchRequestToUrl(e){return Lt.get().serialize(e)}};window.FluidTopicsUrlService=new Ao;var _e=C(_());var We=class o extends CustomEvent{constructor(e){super(o.eventName,{detail:{currentItem:e}})}};We.eventName="change";var wo=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))}},Qa=new wo;var yr=class o extends _e.WithEventBus{static build(){return new o(window.history,Qa,()=>window.location,!1)}constructor(e,r,n,a){var s,c;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(c=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&c!==void 0?c:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}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,_e.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new We(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[s,c,d])=>{let u=r(),p={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[p,c,d]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(We.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(We.eventName,e)}currentItem(){return(0,_e.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,_e.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,_e.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 a=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(a=s),s++;return a}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 a=r??this.currentState.majorStateId,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=yr.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:o=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(o),removeHistoryChangeListener:o=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(o)});var Xa=C(V());var Ja=Xa.css`
|
|
49
|
+
`;var kt=C(V()),$e=C(J()),G=C(_());var fe=C(_());var un=C(_()),gs={setTranslationDestinationLanguage:(o,e)=>{o.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(o,e)=>{o.translation.sourceLanguage=e.payload},setTranslationProfileId:(o,e)=>{o.translation.profileId=e.payload},setTranslationLoading:(o,e)=>{o.translation.isLoading=e.payload},setTranslationError:(o,e)=>{o.translation.isError=e.payload},setTopicsRating:(o,e)=>{for(let r in e.payload)o.topicsRating[r]=e.payload[r]}},pn=o=>un.FtReduxStore.get({name:"ft-reader-"+o,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,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},reducers:gs});var $r=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}}extractPagesToc(e,r,n){return e.flatMap(a=>{var s;return a.pageConfiguration&&this.registerPage(this.buildPage(a,n)),a.tocId==null?this.extractPagesToc(a.children,r,n):[{tocId:a.tocId,title:(s=a.title)!==null&&s!==void 0?s:"",untranslatedTitle:a.untranslatedTitle,depth:r,children:this.extractPagesToc(a.children,r+1,a.tocId)}]})}convertNodes(e,r,n){return e.flatMap(a=>{var s,c,d;if(a.tocId==null)return[...this.convertSectionNodes((s=a.pageToc)!==null&&s!==void 0?s:[],r,a.tocId),...this.convertNodes(a.children,r,a.tocId)];let u=(c=a.prettyUrl)===null||c===void 0?void 0:c.replace(/^\//,""),p={tocId:a.tocId,contentId:a.contentId,title:a.title,untranslatedTitle:a.untranslatedTitle,hasRating:a.hasRating,origin:a.origin,prettyUrl:u,depth:r,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((d=a.pageToc)!==null&&d!==void 0?d:[],r+1,a.tocId),g=this.convertNodes(a.children,r+1,p.tocId);return p.children=[...h,...g],[p]})}convertSectionNodes(e,r,n){return e.flatMap(a=>{var s;let c=(s=a.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),d={...a,prettyUrl:c,depth:r,parentTocId:n,children:[]};return this.register(d),d.children=this.convertSectionNodes(a.children,r+1,a.tocId),[d]})}buildPage(e,r){var n,a,s,c,d,u;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(a=e.tocId)!==null&&a!==void 0?a:"root",toc:((s=e.pageToc)!==null&&s!==void 0?s:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:r?this.buildBreadcrumb(this.nodeByTocId[r]):[]},h=(m,v)=>(v?p.topics:p.hiddenTopics).push(m),g=(d=(c=e.pageConfiguration)===null||c===void 0?void 0:c.parentsVisibility)!==null&&d!==void 0?d:[];return p.breadcrumb.forEach((m,v)=>{h(m,g[v])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((u=e.pageToc)!==null&&u!==void 0?u:[])),p}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}},Wt=class{convertPaginatedToc(e,r){return new $r(e,r).build()}};var ms=C(hn(),1);var gn;(function(o){o.black="black",o.green="green",o.blue="blue",o.purple="purple",o.red="red",o.orange="orange",o.yellow="yellow"})(gn||(gn={}));var yn;(function(o){o.OFFICIAL="OFFICIAL",o.PERSONAL="PERSONAL",o.SHARED="SHARED"})(yn||(yn={}));var mn;(function(o){o.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",o.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",o.PERSONAL_BOOK="PERSONAL_BOOK",o.ATTACHMENT="ATTACHMENT",o.RESOURCE="RESOURCE",o.HTML_PACKAGE="HTML_PACKAGE"})(mn||(mn={}));var bn;(function(o){o.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",o.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",o.PERSONAL_BOOK="PERSONAL_BOOK",o.ATTACHMENT="ATTACHMENT",o.RESOURCE="RESOURCE",o.HTML_PACKAGE="HTML_PACKAGE"})(bn||(bn={}));var vn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR"})(vn||(vn={}));var xn;(function(o){o.VALUE="VALUE",o.DATE="DATE",o.RANGE="RANGE"})(xn||(xn={}));var Sn;(function(o){o.BOOKMARK__CREATE="BOOKMARK__CREATE",o.BOOKMARK__DELETE="BOOKMARK__DELETE",o.CASE_DEFLECTION__START="CASE_DEFLECTION__START",o.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",o.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",o.CHATBOT__RATE="CHATBOT__RATE",o.COLLECTION__CREATE="COLLECTION__CREATE",o.COLLECTION__UPDATE="COLLECTION__UPDATE",o.COLLECTION__DELETE="COLLECTION__DELETE",o.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",o.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",o.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",o.DOCUMENT__PRINT="DOCUMENT__PRINT",o.DOCUMENT__PROCESS="DOCUMENT__PROCESS",o.DOCUMENT__RATE="DOCUMENT__RATE",o.DOCUMENT__SEARCH="DOCUMENT__SEARCH",o.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",o.DOCUMENT__UNRATE="DOCUMENT__UNRATE",o.FEEDBACK__SEND="FEEDBACK__SEND",o.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",o.AI__RATE="AI__RATE",o.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",o.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",o.KHUB__PROCESS="KHUB__PROCESS",o.KHUB__SEARCH="KHUB__SEARCH",o.LABELS__DOWNLOAD="LABELS__DOWNLOAD",o.LINK__SHARE="LINK__SHARE",o.PAGE__DISPLAY="PAGE__DISPLAY",o.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",o.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",o.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",o.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",o.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",o.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",o.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",o.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",o.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",o.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",o.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",o.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",o.TOPIC__RATE="TOPIC__RATE",o.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",o.TOPIC__UNRATE="TOPIC__UNRATE",o.USER__LOGIN="USER__LOGIN",o.USER__LOGOUT="USER__LOGOUT",o.HEARTBEAT="HEARTBEAT"})(Sn||(Sn={}));var Cn;(function(o){o.THIRD_PARTY="THIRD_PARTY",o.OFF_THE_GRID="OFF_THE_GRID",o.CONTENT_PACKAGER="CONTENT_PACKAGER",o.PAGES="PAGES",o.DESIGNED_READER="DESIGNED_READER"})(Cn||(Cn={}));var On;(function(o){o.HOMEPAGE="HOMEPAGE",o.CUSTOM="CUSTOM",o.HEADER="HEADER",o.READER="READER",o.TOPIC_TEMPLATE="TOPIC_TEMPLATE",o.SEARCH="SEARCH",o.SEARCH_RESULT="SEARCH_RESULT",o.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",o.LINK_PREVIEW="LINK_PREVIEW",o.UD_VIEWER="UD_VIEWER",o.ASSET_VIEWER="ASSET_VIEWER"})(On||(On={}));var En;(function(o){o.CLASSIC="CLASSIC",o.CUSTOM="CUSTOM",o.DESIGNER="DESIGNER"})(En||(En={}));var An;(function(o){o.AND="AND",o.OR="OR",o.MONOVALUED="MONOVALUED"})(An||(An={}));var wn;(function(o){o.NONE="NONE",o.ALPHABET="ALPHABET",o.VERSION="VERSION"})(wn||(wn={}));var In;(function(o){o.STARS="STARS",o.LIKE="LIKE",o.DICHOTOMOUS="DICHOTOMOUS",o.NO_RATING="NO_RATING"})(In||(In={}));var Tn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR",o.CUSTOM="CUSTOM"})(Tn||(Tn={}));var Rn;(function(o){o.OPTIONAL="OPTIONAL",o.MANDATORY="MANDATORY"})(Rn||(Rn={}));var _n;(function(o){o.ASC="ASC",o.DESC="DESC"})(_n||(_n={}));var Nn;(function(o){o.ALPHA="ALPHA",o.NATURAL="NATURAL"})(Nn||(Nn={}));var Ln;(function(o){o.EVERYWHERE="EVERYWHERE",o.TITLE_ONLY="TITLE_ONLY",o.NONE="NONE"})(Ln||(Ln={}));var kn;(function(o){o.ARTICLE="ARTICLE",o.BOOK="BOOK",o.SHARED_BOOK="SHARED_BOOK",o.HTML_PACKAGE="HTML_PACKAGE"})(kn||(kn={}));var Pn;(function(o){o.FLUIDTOPICS="FLUIDTOPICS",o.EXTERNAL="EXTERNAL"})(Pn||(Pn={}));var Dn;(function(o){o.MAP="MAP",o.DOCUMENT="DOCUMENT",o.TOPIC="TOPIC",o.PERSONAL_BOOK="PERSONAL_BOOK",o.SHARED_BOOK="SHARED_BOOK",o.HTML_PACKAGE="HTML_PACKAGE"})(Dn||(Dn={}));var Fn;(function(o){o.LAST_WEEK="LAST_WEEK",o.LAST_MONTH="LAST_MONTH",o.LAST_QUARTER="LAST_QUARTER",o.LAST_YEAR="LAST_YEAR"})(Fn||(Fn={}));var Mn;(function(o){o.MAP="MAP",o.DOCUMENT="DOCUMENT",o.TOPIC="TOPIC",o.HTML_PACKAGE="HTML_PACKAGE",o.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Mn||(Mn={}));var Un;(function(o){o.DEFAULT="DEFAULT",o.DOCUMENTS="DOCUMENTS",o.ALL_TOPICS="ALL_TOPICS",o.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Un||(Un={}));var Bn;(function(o){o.PLAIN_TEXT="PLAIN_TEXT",o.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",o.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Bn||(Bn={}));var k;(function(o){o.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",o.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",o.HTML_EXPORT_USER="HTML_EXPORT_USER",o.PDF_EXPORT_USER="PDF_EXPORT_USER",o.SAVED_SEARCH_USER="SAVED_SEARCH_USER",o.COLLECTION_USER="COLLECTION_USER",o.OFFLINE_USER="OFFLINE_USER",o.ANALYTICS_USER="ANALYTICS_USER",o.BETA_USER="BETA_USER",o.DEBUG_USER="DEBUG_USER",o.PRINT_USER="PRINT_USER",o.RATING_USER="RATING_USER",o.FEEDBACK_USER="FEEDBACK_USER",o.GENERATIVE_AI_USER="GENERATIVE_AI_USER",o.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",o.CONTENT_PUBLISHER="CONTENT_PUBLISHER",o.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",o.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",o.KHUB_ADMIN="KHUB_ADMIN",o.USERS_ADMIN="USERS_ADMIN",o.PORTAL_ADMIN="PORTAL_ADMIN",o.ADMIN="ADMIN"})(k||(k={}));var ie;(function(o){o.SEARCHES="SEARCHES",o.BOOKMARKS="BOOKMARKS",o.BOOKS="BOOKS",o.COLLECTIONS="COLLECTIONS"})(ie||(ie={}));var Hn;(function(o){o.UNAUTHENTICATED="UNAUTHENTICATED",o.USER_INCOMPLETE="USER_INCOMPLETE",o.MFA_REQUIRED="MFA_REQUIRED",o.AUTHENTICATED="AUTHENTICATED"})(Hn||(Hn={}));var zn;(function(o){o.VALID="VALID",o.INVALID="INVALID"})(zn||(zn={}));var Gn;(function(o){o.INACCURATE="INACCURATE",o.INCOMPLETE="INCOMPLETE",o.OFF_TOPIC="OFF_TOPIC",o.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",o.SUMMARY="SUMMARY",o.SEMANTIC_SEARCH="SEMANTIC_SEARCH",o.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",o.OTHER="OTHER"})(Gn||(Gn={}));var Wn;(function(o){o.INACCURATE="INACCURATE",o.INCOMPLETE="INCOMPLETE",o.OFF_TOPIC="OFF_TOPIC",o.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",o.SLOW="SLOW",o.OTHER="OTHER"})(Wn||(Wn={}));var $n;(function(o){o.JSON="JSON",o.TEXT="TEXT"})($n||($n={}));var jn;(function(o){o.USER="USER",o.ASSISTANT="ASSISTANT"})(jn||(jn={}));var Vn;(function(o){o.TEXT="TEXT",o.HTML="HTML"})(Vn||(Vn={}));var Kn;(function(o){o.HTML="HTML",o.MARKDOWN="MARKDOWN"})(Kn||(Kn={}));var Zn;(function(o){o.MAP="MAP",o.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Zn||(Zn={}));var ys={[k.PERSONAL_BOOK_SHARE_USER]:[k.PERSONAL_BOOK_USER],[k.HTML_EXPORT_USER]:[k.PERSONAL_BOOK_USER],[k.PDF_EXPORT_USER]:[k.PERSONAL_BOOK_USER],[k.KHUB_ADMIN]:[k.CONTENT_PUBLISHER],[k.ADMIN]:[k.KHUB_ADMIN,k.USERS_ADMIN,k.PORTAL_ADMIN,k.BEHAVIOR_DATA_USER],[k.GENERATIVE_AI_EXPORT_USER]:[k.GENERATIVE_AI_USER]};function qn(o,e){return o===e||(ys[o]??[]).some(r=>qn(r,e))}function xe(o,e){return o==null?!1:(Array.isArray(o)?o:Array.isArray(o.roles)?o.roles:Array.isArray(o.profile?.roles)?o.profile.roles:[]).some(n=>qn(n,e))}var yo=C(J());function bs(o,e){if(o===e)return!0;if(o&&e&&typeof o=="object"&&typeof e=="object"){if(o.constructor!==e.constructor)return!1;let r,n,a;if(Array.isArray(o)){if(r=o.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Vt(o[n],e[n]))return!1;return!0}if(o instanceof Map&&e instanceof Map){if(o.size!==e.size)return!1;for(n of o.entries())if(!e.has(n[0]))return!1;for(n of o.entries())if(!Vt(n[1],e.get(n[0])))return!1;return!0}if(o instanceof Set&&e instanceof Set){if(o.size!==e.size)return!1;for(n of o.entries())if(!e.has(n[0]))return!1;return!0}if(o.constructor===RegExp)return o.source===e.source&&o.flags===e.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===e.valueOf();let s=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=s(o),r=a.length,r!==s(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){let c=a[n];if(!Vt(o[c],e[c]))return!1}return!0}return o!==o&&e!==e||o==null&&e==null}function Vt(o,e){try{return bs(o,e)}catch{return!1}}function It(o,e){return!Vt(o,e)}function Yn(o){return typeof window.structuredClone=="function"?structuredClone(o):o!=null?JSON.parse(JSON.stringify(o)):o}function Kt(o,e){let r=n=>n[o]===!0;return n=>{if(r(n))return n;let a=e(n);return a[o]=!0,a}}var Qn=C(J(),1);var jr=o=>{let e=o??{};return(r,n)=>{var a;let s={hasChanged:It,attribute:!1,...e};(0,Qn.property)(s)(r,n);let c=r.constructor;c.reduxProperties=new Map(c.reduxProperties),c.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:d=>d[n],store:e.store})}};var Zt=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 Ue=C(J(),1);var Xn=C(J(),1);function Jn(o,e){let r=()=>JSON.parse(JSON.stringify(o));return(0,Xn.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return r();try{return JSON.parse(n)}catch{return r()}},toAttribute:n=>JSON.stringify(n)},hasChanged:It,...e??{}})}var qt=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 a=(e=this.rejectPromise)!==null&&e!==void 0?e:()=>null,s=(r=this.resolvePromise)!==null&&r!==void 0?r:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ta=C(V(),1);var Yt=globalThis,vs=Yt.ShadowRoot&&(Yt.ShadyCSS===void 0||Yt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,vl=Symbol();var ea=(o,e)=>{if(vs)o.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),a=Yt.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=r.cssText,o.appendChild(n)}};var Qt=class extends ta.LitElement{createRenderRoot(){let e=this.constructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,Object.entries(e.elementDefinitions).forEach(([a,s])=>e.registry.define(a,s)));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return ea(n,e.elementStyles),n}};function ra(o,e,...r){var n;let a=o.querySelector(e);for(let s of r)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var nt=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},ia,oa=Symbol("constructorPrototype"),na=Symbol("constructorName"),sa=Symbol("exportpartsDebouncer"),aa=Symbol("dynamicDependenciesLoaded"),ot=class o extends CustomEvent{constructor(){super(o.eventName,{bubbles:!0})}};ot.eventName="exportparts-updated";var ye=class extends Qt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ia]=new qt(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[sa].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[na]=this.constructor.name,this[oa]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[na]&&Object.setPrototypeOf(this,this[oa])}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[aa]||(r[aa]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(ot.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(ot.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 ot)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let s=[...a??[],n];r=ra(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,a;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,n,a,s,c,d;let u=m=>m!=null&&m.trim().length>0,p=e.filter(u).map(m=>m.trim());if(p.length===0){this.exportparts=void 0;return}let h=new Set;for(let m of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let v=(s=(a=m.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],b=(d=(c=m.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(w=>w.split(":")[1]))!==null&&d!==void 0?d:[],O=[...v,...b].filter(u).map(w=>w.trim());for(let w of O)h.add(w)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(m=>p.map(v=>`${m}:${v}--${m}`));this.exportparts=[...this.part,...g].join(", ")}};ia=sa;nt([(0,Ue.property)()],ye.prototype,"exportpartsPrefix",void 0);nt([Jn([])],ye.prototype,"exportpartsPrefixes",void 0);nt([(0,Ue.property)({reflect:!0})],ye.prototype,"exportparts",void 0);nt([(0,Ue.property)()],ye.prototype,"customStylesheet",void 0);nt([(0,Ue.property)()],ye.prototype,"elementToFocus",void 0);nt([(0,Ue.state)()],ye.prototype,"useAdoptedStyleSheets",void 0);function Xt(o){var e;return(e=o?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Tt=Symbol("internalReduxEventsUnsubscribers"),Ae=Symbol("internalStoresUnsubscribers"),Be=Symbol("internalStores"),xs=Kt(Symbol("withRedux"),function(o){var e,r,n;class a extends o{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(c){super.willUpdate(c),[...this.reduxConstructor.reduxReactiveProperties].some(d=>c.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[Be].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Be].values()][0]}getStore(c){return c==null?this.getUnnamedStore():this[Be].get(c)}addStore(c,d){var u;d=(u=d??c.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[Be].set(d,c),this.subscribeToStore(d,c),this.updateFromStores()}removeStore(c){let d=typeof c=="string"?c:c.name;this.unsubscribeFromStore(d),this[Be].delete(d)}setupStores(){this.unsubscribeFromStores(),this[Be].forEach((c,d)=>this.subscribeToStore(d,c)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((c,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(c.store);p&&(c.store?this[Ae].has(c.store):this[Ae].size>0)&&(this[d]=c.selector(p.getState(),this))}})}subscribeToStore(c,d){var u;this[Ae].set(c,d.subscribe(()=>this.updateFromStores())),this[Tt].set(c,[]),Xt(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let g=m=>this[h](m);d.addEventListener(p.eventName,g),this[Tt].get(c).push(()=>d.removeEventListener(p.eventName,g))}})),this.onStoreAvailable(c)}unsubscribeFromStores(){this[Ae].forEach((c,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(c){var d;this[Ae].has(c)&&this[Ae].get(c)(),this[Ae].delete(c),(d=this[Tt].get(c))===null||d===void 0||d.forEach(u=>u()),this[Tt].delete(c)}onStoreAvailable(c){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ae,r=Be,n=Tt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),ca=class extends xs(ye){};function se(o){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var a,s;throw Error("[Immer] minified error nr: "+o+(r.length?" "+r.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Se(o){return!!o&&!!o[M]}function ue(o){var e;return!!o&&(function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===Ts}(o)||Array.isArray(o)||!!o[ga]||!!(!((e=o.constructor)===null||e===void 0)&&e[ga])||eo(o)||to(o))}function He(o,e,r){r===void 0&&(r=!1),st(o)===0?(r?Object.keys:it)(o).forEach(function(n){r&&typeof n=="symbol"||e(n,o[n],o)}):o.forEach(function(n,a){return e(a,n,o)})}function st(o){var e=o[M];return e?e.i>3?e.i-4:e.i:Array.isArray(o)?1:eo(o)?2:to(o)?3:0}function at(o,e){return st(o)===2?o.has(e):Object.prototype.hasOwnProperty.call(o,e)}function Ss(o,e){return st(o)===2?o.get(e):o[e]}function ya(o,e,r){var n=st(o);n===2?o.set(e,r):n===3?o.add(r):o[e]=r}function ma(o,e){return o===e?o!==0||1/o==1/e:o!=o&&e!=e}function eo(o){return ws&&o instanceof Map}function to(o){return Is&&o instanceof Set}function we(o){return o.o||o.t}function ro(o){if(Array.isArray(o))return Array.prototype.slice.call(o);var e=xa(o);delete e[M];for(var r=it(e),n=0;n<r.length;n++){var a=r[n],s=e[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(e[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:o[a]})}return Object.create(Object.getPrototypeOf(o),e)}function oo(o,e){return e===void 0&&(e=!1),no(o)||Se(o)||!ue(o)||(st(o)>1&&(o.set=o.add=o.clear=o.delete=Cs),Object.freeze(o),e&&He(o,function(r,n){return oo(n,!0)},!0)),o}function Cs(){se(2)}function no(o){return o==null||typeof o!="object"||Object.isFrozen(o)}function me(o){var e=Jr[o];return e||se(18,o),e}function Os(o,e){Jr[o]||(Jr[o]=e)}function Yr(){return _t}function Vr(o,e){e&&(me("Patches"),o.u=[],o.s=[],o.v=e)}function Jt(o){Qr(o),o.p.forEach(Es),o.p=null}function Qr(o){o===_t&&(_t=o.l)}function la(o){return _t={p:[],l:_t,h:o,m:!0,_:0}}function Es(o){var e=o[M];e.i===0||e.i===1?e.j():e.g=!0}function Kr(o,e){e._=e.p.length;var r=e.p[0],n=o!==void 0&&o!==r;return e.h.O||me("ES5").S(e,o,n),n?(r[M].P&&(Jt(e),se(4)),ue(o)&&(o=er(e,o),e.l||tr(e,o)),e.u&&me("Patches").M(r[M].t,o,e.u,e.s)):o=er(e,r,[]),Jt(e),e.u&&e.v(e.u,e.s),o!==va?o:void 0}function er(o,e,r){if(no(e))return e;var n=e[M];if(!n)return He(e,function(d,u){return da(o,n,e,d,u,r)},!0),e;if(n.A!==o)return e;if(!n.P)return tr(o,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=ro(n.k):n.o,s=a,c=!1;n.i===3&&(s=new Set(a),a.clear(),c=!0),He(s,function(d,u){return da(o,n,a,d,u,r,c)}),tr(o,a,!1),r&&o.u&&me("Patches").N(n,r,o.u,o.s)}return n.o}function da(o,e,r,n,a,s,c){if(Se(a)){var d=er(o,a,s&&e&&e.i!==3&&!at(e.R,n)?s.concat(n):void 0);if(ya(r,n,d),!Se(d))return;o.m=!1}else c&&r.add(a);if(ue(a)&&!no(a)){if(!o.h.D&&o._<1)return;er(o,a),e&&e.A.l||tr(o,a)}}function tr(o,e,r){r===void 0&&(r=!1),!o.l&&o.h.D&&o.m&&oo(e,r)}function Zr(o,e){var r=o[M];return(r?we(r):o)[e]}function ua(o,e){if(e in o)for(var r=Object.getPrototypeOf(o);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function Ie(o){o.P||(o.P=!0,o.l&&Ie(o.l))}function qr(o){o.o||(o.o=ro(o.t))}function Xr(o,e,r){var n=eo(e)?me("MapSet").F(e,r):to(e)?me("MapSet").T(e,r):o.O?function(a,s){var c=Array.isArray(a),d={i:c?1:0,A:s?s.A:Yr(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Nt;c&&(u=[d],p=Rt);var h=Proxy.revocable(u,p),g=h.revoke,m=h.proxy;return d.k=m,d.j=g,m}(e,r):me("ES5").J(e,r);return(r?r.A:Yr()).p.push(n),n}function As(o){return Se(o)||se(22,o),function e(r){if(!ue(r))return r;var n,a=r[M],s=st(r);if(a){if(!a.P&&(a.i<4||!me("ES5").K(a)))return a.t;a.I=!0,n=pa(r,s),a.I=!1}else n=pa(r,s);return He(n,function(c,d){a&&Ss(a.t,c)===d||ya(n,c,e(d))}),s===3?new Set(n):n}(o)}function pa(o,e){switch(e){case 2:return new Map(o);case 3:return Array.from(o)}return ro(o)}function ba(){function o(c,d){var u=s[c];return u?u.enumerable=d:s[c]=u={configurable:!0,enumerable:d,get:function(){var p=this[M];return Nt.get(p,c)},set:function(p){var h=this[M];Nt.set(h,c,p)}},u}function e(c){for(var d=c.length-1;d>=0;d--){var u=c[d][M];if(!u.P)switch(u.i){case 5:n(u)&&Ie(u);break;case 4:r(u)&&Ie(u)}}}function r(c){for(var d=c.t,u=c.k,p=it(u),h=p.length-1;h>=0;h--){var g=p[h];if(g!==M){var m=d[g];if(m===void 0&&!at(d,g))return!0;var v=u[g],b=v&&v[M];if(b?b.t!==m:!ma(v,m))return!0}}var O=!!d[M];return p.length!==it(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(c){c.g&&se(3,JSON.stringify(we(c)))}var s={};Os("ES5",{J:function(c,d){var u=Array.isArray(c),p=function(g,m){if(g){for(var v=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(v,""+b,o(b,!0));return v}var O=xa(m);delete O[M];for(var w=it(O),I=0;I<w.length;I++){var T=w[I];O[T]=o(T,g||!!O[T].enumerable)}return Object.create(Object.getPrototypeOf(m),O)}(u,c),h={i:u?5:4,A:d?d.A:Yr(),P:!1,I:!1,R:{},l:d,t:c,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,M,{value:h,writable:!0}),p},S:function(c,d,u){u?Se(d)&&d[M].A===c&&e(c.p):(c.u&&function p(h){if(h&&typeof h=="object"){var g=h[M];if(g){var m=g.t,v=g.k,b=g.R,O=g.i;if(O===4)He(v,function(N){N!==M&&(m[N]!==void 0||at(m,N)?b[N]||p(v[N]):(b[N]=!0,Ie(g)))}),He(m,function(N){v[N]!==void 0||at(v,N)||(b[N]=!1,Ie(g))});else if(O===5){if(n(g)&&(Ie(g),b.length=!0),v.length<m.length)for(var w=v.length;w<m.length;w++)b[w]=!1;else for(var I=m.length;I<v.length;I++)b[I]=!0;for(var T=Math.min(v.length,m.length),P=0;P<T;P++)v.hasOwnProperty(P)||(b[P]=!0),b[P]===void 0&&p(v[P])}}}}(c.p[0]),e(c.p))},K:function(c){return c.i===4?r(c):n(c)}})}var fa,_t,ao=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ws=typeof Map<"u",Is=typeof Set<"u",ha=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",va=ao?Symbol.for("immer-nothing"):((fa={})["immer-nothing"]=!0,fa),ga=ao?Symbol.for("immer-draftable"):"__$immer_draftable",M=ao?Symbol.for("immer-state"):"__$immer_state";var Ts=""+Object.prototype.constructor,it=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(o){return Object.getOwnPropertyNames(o).concat(Object.getOwnPropertySymbols(o))}:Object.getOwnPropertyNames,xa=Object.getOwnPropertyDescriptors||function(o){var e={};return it(o).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(o,r)}),e},Jr={},Nt={get:function(o,e){if(e===M)return o;var r=we(o);if(!at(r,e))return function(a,s,c){var d,u=ua(s,c);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(o,r,e);var n=r[e];return o.I||!ue(n)?n:n===Zr(o.t,e)?(qr(o),o.o[e]=Xr(o.A.h,n,o)):n},has:function(o,e){return e in we(o)},ownKeys:function(o){return Reflect.ownKeys(we(o))},set:function(o,e,r){var n=ua(we(o),e);if(n?.set)return n.set.call(o.k,r),!0;if(!o.P){var a=Zr(we(o),e),s=a?.[M];if(s&&s.t===r)return o.o[e]=r,o.R[e]=!1,!0;if(ma(r,a)&&(r!==void 0||at(o.t,e)))return!0;qr(o),Ie(o)}return o.o[e]===r&&(r!==void 0||e in o.o)||Number.isNaN(r)&&Number.isNaN(o.o[e])||(o.o[e]=r,o.R[e]=!0),!0},deleteProperty:function(o,e){return Zr(o.t,e)!==void 0||e in o.t?(o.R[e]=!1,qr(o),Ie(o)):delete o.R[e],o.o&&delete o.o[e],!0},getOwnPropertyDescriptor:function(o,e){var r=we(o),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:o.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){se(11)},getPrototypeOf:function(o){return Object.getPrototypeOf(o.t)},setPrototypeOf:function(){se(12)}},Rt={};He(Nt,function(o,e){Rt[o]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Rt.deleteProperty=function(o,e){return Rt.set.call(this,o,e,void 0)},Rt.set=function(o,e,r){return Nt.set.call(this,o[0],e,r,o[0])};var Rs=function(){function o(r){var n=this;this.O=ha,this.D=!0,this.produce=function(a,s,c){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(O){var w=this;O===void 0&&(O=d);for(var I=arguments.length,T=Array(I>1?I-1:0),P=1;P<I;P++)T[P-1]=arguments[P];return u.produce(O,function(N){var $;return($=s).call.apply($,[w,N].concat(T))})}}var p;if(typeof s!="function"&&se(6),c!==void 0&&typeof c!="function"&&se(7),ue(a)){var h=la(n),g=Xr(n,a,void 0),m=!0;try{p=s(g),m=!1}finally{m?Jt(h):Qr(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(O){return Vr(h,c),Kr(O,h)},function(O){throw Jt(h),O}):(Vr(h,c),Kr(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===va&&(p=void 0),n.D&&oo(p,!0),c){var v=[],b=[];me("Patches").M(a,p,v,b),c(v,b)}return p}se(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,g=Array(h>1?h-1:0),m=1;m<h;m++)g[m-1]=arguments[m];return n.produceWithPatches(p,function(v){return a.apply(void 0,[v].concat(g))})};var c,d,u=n.produce(a,s,function(p,h){c=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,c,d]}):[u,c,d]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=o.prototype;return e.createDraft=function(r){ue(r)||se(8),Se(r)&&(r=As(r));var n=la(this),a=Xr(this,r,void 0);return a[M].C=!0,Qr(n),a},e.finishDraft=function(r,n){var a=r&&r[M],s=a.A;return Vr(s,n),Kr(void 0,s)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!ha&&se(20),this.O=r},e.applyPatches=function(r,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){r=s.value;break}}a>-1&&(n=n.slice(a+1));var c=me("Patches").$;return Se(r)?c(r,n):this.produce(r,function(d){return c(d,n)})},o}(),re=new Rs,_s=re.produce,Pl=re.produceWithPatches.bind(re),Dl=re.setAutoFreeze.bind(re),Fl=re.setUseProxies.bind(re),Ml=re.applyPatches.bind(re),Ul=re.createDraft.bind(re),Bl=re.finishDraft.bind(re),rr=_s;function ze(o){"@babel/helpers - typeof";return ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ze(o)}function Sa(o,e){if(ze(o)!="object"||!o)return o;var r=o[Symbol.toPrimitive];if(r!==void 0){var n=r.call(o,e||"default");if(ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(o)}function Ca(o){var e=Sa(o,"string");return ze(e)=="symbol"?e:e+""}function Oa(o,e,r){return(e=Ca(e))in o?Object.defineProperty(o,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):o[e]=r,o}function Ea(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(o);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(o,a).enumerable})),r.push.apply(r,n)}return r}function io(o){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ea(Object(r),!0).forEach(function(n){Oa(o,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):Ea(Object(r)).forEach(function(n){Object.defineProperty(o,n,Object.getOwnPropertyDescriptor(r,n))})}return o}function Y(o){return"Minified Redux error #"+o+"; visit https://redux.js.org/Errors?code="+o+" for the full message or use the non-minified dev environment for full errors. "}var Aa=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),so=function(){return Math.random().toString(36).substring(7).split("").join(".")},or={INIT:"@@redux/INIT"+so(),REPLACE:"@@redux/REPLACE"+so(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+so()}};function Ns(o){if(typeof o!="object"||o===null)return!1;for(var e=o;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(o)===e}function co(o,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Y(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Y(1));return r(co)(o,e)}if(typeof o!="function")throw new Error(Y(2));var a=o,s=e,c=[],d=c,u=!1;function p(){d===c&&(d=c.slice())}function h(){if(u)throw new Error(Y(3));return s}function g(O){if(typeof O!="function")throw new Error(Y(4));if(u)throw new Error(Y(5));var w=!0;return p(),d.push(O),function(){if(w){if(u)throw new Error(Y(6));w=!1,p();var T=d.indexOf(O);d.splice(T,1),c=null}}}function m(O){if(!Ns(O))throw new Error(Y(7));if(typeof O.type>"u")throw new Error(Y(8));if(u)throw new Error(Y(9));try{u=!0,s=a(s,O)}finally{u=!1}for(var w=c=d,I=0;I<w.length;I++){var T=w[I];T()}return O}function v(O){if(typeof O!="function")throw new Error(Y(10));a=O,m({type:or.REPLACE})}function b(){var O,w=g;return O={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(Y(11));function P(){T.next&&T.next(h())}P();var N=w(P);return{unsubscribe:N}}},O[Aa]=function(){return this},O}return m({type:or.INIT}),n={dispatch:m,subscribe:g,getState:h,replaceReducer:v},n[Aa]=b,n}function Ls(o){Object.keys(o).forEach(function(e){var r=o[e],n=r(void 0,{type:or.INIT});if(typeof n>"u")throw new Error(Y(12));if(typeof r(void 0,{type:or.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Y(13))})}function wa(o){for(var e=Object.keys(o),r={},n=0;n<e.length;n++){var a=e[n];typeof o[a]=="function"&&(r[a]=o[a])}var s=Object.keys(r),c,d;try{Ls(r)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var g;for(var m=!1,v={},b=0;b<s.length;b++){var O=s[b],w=r[O],I=p[O],T=w(I,h);if(typeof T>"u"){var P=h&&h.type;throw new Error(Y(14))}v[O]=T,m=m||T!==I}return m=m||s.length!==Object.keys(p).length,m?v:p}}function ct(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Ia(){for(var o=arguments.length,e=new Array(o),r=0;r<o;r++)e[r]=arguments[r];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(Y(15))},c={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=e.map(function(u){return u(c)});return s=ct.apply(void 0,d)(a.dispatch),io(io({},a),{},{dispatch:s})}}}function Ta(o){var e=function(n){var a=n.dispatch,s=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,s,o):c(d)}}};return e}var Ra=Ta();Ra.withExtraArgument=Ta;var lo=Ra;var Pa=function(){var o=function(e,r){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},o(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");o(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ks=function(o,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(p){return function(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(o,r)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},lt=function(o,e){for(var r=0,n=e.length,a=o.length;r<n;r++,a++)o[a]=e[r];return o},Ps=Object.defineProperty,Ds=Object.defineProperties,Fs=Object.getOwnPropertyDescriptors,_a=Object.getOwnPropertySymbols,Ms=Object.prototype.hasOwnProperty,Us=Object.prototype.propertyIsEnumerable,Na=function(o,e,r){return e in o?Ps(o,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[e]=r},Te=function(o,e){for(var r in e||(e={}))Ms.call(e,r)&&Na(o,r,e[r]);if(_a)for(var n=0,a=_a(e);n<a.length;n++){var r=a[n];Us.call(e,r)&&Na(o,r,e[r])}return o},uo=function(o,e){return Ds(o,Fs(e))},Bs=function(o,e,r){return new Promise(function(n,a){var s=function(u){try{d(r.next(u))}catch(p){a(p)}},c=function(u){try{d(r.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,c)};d((r=r.apply(o,e)).next())})};var Hs=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ct:ct.apply(null,arguments)},od=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(o){return o}};function zs(o){if(typeof o!="object"||o===null)return!1;var e=Object.getPrototypeOf(o);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}var Gs=function(o){Pa(e,o);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o.apply(this,r)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,lt([void 0],r[0].concat(this)))):new(e.bind.apply(e,lt([void 0],r.concat(this))))},e}(Array),Ws=function(o){Pa(e,o);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var a=o.apply(this,r)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,lt([void 0],r[0].concat(this)))):new(e.bind.apply(e,lt([void 0],r.concat(this))))},e}(Array);function ho(o){return ue(o)?rr(o,function(){}):o}function $s(o){return typeof o=="boolean"}function js(){return function(e){return Vs(e)}}function Vs(o){o===void 0&&(o={});var e=o.thunk,r=e===void 0?!0:e,n=o.immutableCheck,a=n===void 0?!0:n,s=o.serializableCheck,c=s===void 0?!0:s,d=new Gs;if(r&&($s(r)?d.push(lo):d.push(lo.withExtraArgument(r.extraArgument))),0){if(a)var u;if(c)var p}return d}var po=!0;function Da(o){var e=js(),r=o||{},n=r.reducer,a=n===void 0?void 0:n,s=r.middleware,c=s===void 0?e():s,d=r.devTools,u=d===void 0?!0:d,p=r.preloadedState,h=p===void 0?void 0:p,g=r.enhancers,m=g===void 0?void 0:g,v;if(typeof a=="function")v=a;else if(zs(a))v=wa(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var b=c;if(typeof b=="function"&&(b=b(e),!po&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!po&&b.some(function(N){return typeof N!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Ia.apply(void 0,b),w=ct;u&&(w=Hs(Te({trace:!po},typeof u=="object"&&u)));var I=new Ws(O),T=I;Array.isArray(m)?T=lt([O],m):typeof m=="function"&&(T=m(I));var P=w.apply(void 0,T);return co(v,h,P)}function Re(o,e){function r(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var s=e.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return Te(Te({type:o,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:o,payload:n[0]}}return r.toString=function(){return""+o},r.type=o,r.match=function(n){return n.type===o},r}function Fa(o){var e={},r=[],n,a={addCase:function(s,c){var d=typeof s=="string"?s:s.type;if(d in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[d]=c,a},addMatcher:function(s,c){return r.push({matcher:s,reducer:c}),a},addDefaultCase:function(s){return n=s,a}};return o(a),[e,r,n]}function Ks(o){return typeof o=="function"}function Zs(o,e,r,n){r===void 0&&(r=[]);var a=typeof e=="function"?Fa(e):[e,r,n],s=a[0],c=a[1],d=a[2],u;if(Ks(o))u=function(){return ho(o())};else{var p=ho(o);u=function(){return p}}function h(g,m){g===void 0&&(g=u());var v=lt([s[m.type]],c.filter(function(b){var O=b.matcher;return O(m)}).map(function(b){var O=b.reducer;return O}));return v.filter(function(b){return!!b}).length===0&&(v=[d]),v.reduce(function(b,O){if(O)if(Se(b)){var w=b,I=O(w,m);return I===void 0?b:I}else{if(ue(b))return rr(b,function(T){return O(T,m)});var I=O(b,m);if(I===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return b},g)}return h.getInitialState=u,h}function qs(o,e){return o+"/"+e}function Ma(o){var e=o.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof o.initialState=="function"?o.initialState:ho(o.initialState),n=o.reducers||{},a=Object.keys(n),s={},c={},d={};a.forEach(function(h){var g=n[h],m=qs(e,h),v,b;"reducer"in g?(v=g.reducer,b=g.prepare):v=g,s[h]=v,c[m]=v,d[h]=b?Re(m,b):Re(m)});function u(){var h=typeof o.extraReducers=="function"?Fa(o.extraReducers):[o.extraReducers],g=h[0],m=g===void 0?{}:g,v=h[1],b=v===void 0?[]:v,O=h[2],w=O===void 0?void 0:O,I=Te(Te({},m),c);return Zs(r,function(T){for(var P in I)T.addCase(P,I[P]);for(var N=0,$=b;N<$.length;N++){var de=$[N];T.addMatcher(de.matcher,de.reducer)}w&&T.addDefaultCase(w)})}var p;return{name:e,reducer:function(h,g){return p||(p=u()),p(h,g)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Ys="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Qs=function(o){o===void 0&&(o=21);for(var e="",r=o;r--;)e+=Ys[Math.random()*64|0];return e},Xs=["name","message","stack","code"],fo=function(){function o(e,r){this.payload=e,this.meta=r}return o}(),La=function(){function o(e,r){this.payload=e,this.meta=r}return o}(),Js=function(o){if(typeof o=="object"&&o!==null){for(var e={},r=0,n=Xs;r<n.length;r++){var a=n[r];typeof o[a]=="string"&&(e[a]=o[a])}return e}return{message:String(o)}},sd=function(){function o(e,r,n){var a=Re(e+"/fulfilled",function(h,g,m,v){return{payload:h,meta:uo(Te({},v||{}),{arg:m,requestId:g,requestStatus:"fulfilled"})}}),s=Re(e+"/pending",function(h,g,m){return{payload:void 0,meta:uo(Te({},m||{}),{arg:g,requestId:h,requestStatus:"pending"})}}),c=Re(e+"/rejected",function(h,g,m,v,b){return{payload:v,error:(n&&n.serializeError||Js)(h||"Rejected"),meta:uo(Te({},b||{}),{arg:m,requestId:g,rejectedWithValue:!!v,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(g,m,v){var b=n?.idGenerator?n.idGenerator(h):Qs(),O=new u,w,I=!1;function T(N){w=N,O.abort()}var P=function(){return Bs(this,null,function(){var N,$,de,ke,X,Pe,Qe;return ks(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),ke=(N=n?.condition)==null?void 0:N.call(n,h,{getState:m,extra:v}),tc(ke)?[4,ke]:[3,2];case 1:ke=f.sent(),f.label=2;case 2:if(ke===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,X=new Promise(function(y,A){return O.signal.addEventListener("abort",function(){return A({name:"AbortError",message:w||"Aborted"})})}),g(s(b,h,($=n?.getPendingMeta)==null?void 0:$.call(n,{requestId:b,arg:h},{getState:m,extra:v}))),[4,Promise.race([X,Promise.resolve(r(h,{dispatch:g,getState:m,extra:v,requestId:b,signal:O.signal,abort:T,rejectWithValue:function(y,A){return new fo(y,A)},fulfillWithValue:function(y,A){return new La(y,A)}})).then(function(y){if(y instanceof fo)throw y;return y instanceof La?a(y.payload,b,h,y.meta):a(y,b,h)})])];case 3:return de=f.sent(),[3,5];case 4:return Pe=f.sent(),de=Pe instanceof fo?c(null,b,h,Pe.payload,Pe.meta):c(Pe,b,h),[3,5];case 5:return Qe=n&&!n.dispatchConditionRejection&&c.match(de)&&de.meta.condition,Qe||g(de),[2,de]}})})}();return Object.assign(P,{abort:T,requestId:b,arg:h,unwrap:function(){return P.then(ec)}})}}return Object.assign(p,{pending:s,rejected:c,fulfilled:a,typePrefix:e})}return o.withTypes=function(){return o},o}();function ec(o){if(o.meta&&o.meta.rejectedWithValue)throw o.payload;if(o.error)throw o.error;return o.payload}function tc(o){return o!==null&&typeof o=="object"&&typeof o.then=="function"}var Ua="listener",Ba="completed",Ha="cancelled",cd="task-"+Ha,ld="task-"+Ba,dd=Ua+"-"+Ha,ud=Ua+"-"+Ba;var go="listenerMiddleware";var pd=Re(go+"/add"),fd=Re(go+"/removeAll"),hd=Re(go+"/remove");var ka,gd=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(o){return(ka||(ka=Promise.resolve())).then(o).catch(function(e){return setTimeout(function(){throw e},0)})},rc=function(o){return function(e){setTimeout(e,o)}},yd=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:rc(10);ba();var oc=Kt(Symbol("withEventBus"),function(o,e){return class extends o{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,a){this.eventBus.addEventListener(r,n,a)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,a){this.eventBus.removeEventListener(r,n,a)}}}),nr=class extends oc(Object){};window.ftReduxStores||(window.ftReduxStores={});var za=class o extends nr{static get(e){var r;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,s=window.ftReduxStores[n];if(Xt(s))return s;if(a==null)return;let c=Ma({...a,reducers:(r=a.reducers)!==null&&r!==void 0?r:{}}),d=Da({reducer:(u,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=Yn(c.getInitialState());for(let g of p.keeping)h[g]=(u??h)[g];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...u,...p.overwrites};return c.reducer(u,p)}});return window.ftReduxStores[a.name]=new o(c,d,a.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Zt;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,c,d)=>{let u=c,p=s[u];return p?(...h)=>{let g=p(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{this.setState({[u]:a(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()}};var ar=class{static format(e,r,n,a,s){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,a,!!s)):this.getIntlDateTime(e,r,n,a,!!s)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,a,s){let c=typeof e=="string"?new Date(e):e,d=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(c),u=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(c);return s?u:a?`${d} ${u}`:d}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 ir=C(_()),nc="ft-app-info",be=class o extends CustomEvent{constructor(e){super(o.eventName,{detail:e})}};be.eventName="authentication-change";var ac={session:(o,e)=>{(0,ir.deepEqual)(o.session,e.payload)||(o.session=e.payload,setTimeout(()=>S.dispatchEvent(new be(e.payload)),0))}},S=ir.FtReduxStore.get({name:nc,reducers:ac,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Ga=C(_()),sr=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},$d=(0,Ga.applyMixinOnce)(Symbol("withDateFormat"),function(o){class e extends o{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(S)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>ar.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return sr([(0,yo.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),sr([(0,yo.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),sr([jr({store:S.name,selector:r=>{var n,a;return(a=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],e.prototype,"metadataDescriptors",void 0),sr([jr({store:S.name})],e.prototype,"uiLocale",void 0),e});var fr=C(_());var mo=C(_());var Ge=class o{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=S.getState(),a=e??n;if(r&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,a,!0)}static await(e){return new Promise(r=>{let n=o.get(e);if(n)r(n);else{let a=S.subscribe(()=>{n=o.get(e),n&&(a(),r(n))})}})}};var cr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ge.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ge.await()}};var Q=class extends cr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(s,c)=>typeof c!="object"||c==null||Array.isArray(c)?c:Object.fromEntries(Object.entries(c).sort(([d],[u])=>d.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new mo.CacheRegistry,this.cache=e?a.commonCache:new mo.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 lr=class extends Q{async listMySearches(){let{session:e}=S.getState();return xe(e,k.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var dr=class extends Q{async listMyBookmarks(){let e=S.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var ur=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=S.getState().session;return!!e?.sessionAuthenticated}};var pr=class extends Q{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=S.getState().session;return!!e?.sessionAuthenticated}};var ic="ft-user-assets",sc={setAssetCount:(o,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;o.assetCounts.allAsset[r]=n},clearAssetCount:o=>{Object.values(ie).forEach(e=>{o.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(o,e)=>{let r=e.payload.mapId;o.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:o=>{o.assetCounts.bookmarkByMap={}},addAsset:(o,e)=>{let{assetType:r,mapId:n,asset:a}=e.payload;vo(o,r,[...bo(o,r),a]),Wa(o,r,1,n),$a(o,a)},editAsset:(o,e)=>{let{assetType:r,asset:n}=e.payload;vo(o,r,bo(o,r).map(a=>a.id===n.id?n:a)),$a(o,n)},removeAsset:(o,e)=>{let{assetType:r,mapId:n,assetId:a}=e.payload;vo(o,r,bo(o,r).filter(s=>s.id!==a)),Wa(o,r,-1,n)}},ja={[ie.SEARCHES]:"savedSearches",[ie.BOOKMARKS]:"bookmarks",[ie.BOOKS]:void 0,[ie.COLLECTIONS]:void 0},bo=(o,e)=>{var r;let n=ja[e];return n?(r=o[n])!==null&&r!==void 0?r:[]:[]},vo=(o,e,r)=>{let n=ja[e];n&&(o[n]=r)},Wa=(o,e,r,n)=>{let a=o.assetCounts.allAsset[e];if(a!==void 0&&(o.assetCounts.allAsset[e]=Math.max(0,a+r),e===ie.BOOKMARKS&&n)){let s=o.assetCounts.bookmarkByMap[n];o.assetCounts.bookmarkByMap[n]=Math.max(0,s+r)}},$a=(o,e)=>{let r=o.assetLabels.map(a=>a.title),n=e.labels.filter(a=>!r.includes(a)).map(a=>({title:a}));o.assetLabels.push(...n)},oe=fr.FtReduxStore.get({name:ic,reducers:sc,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ie).map(o=>[o,void 0])),bookmarkByMap:{}},assetLabels:[]}}),xo=class{constructor(e=new ur,r=new pr){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=S.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dr,this.savedSearchesService=new lr,S.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=S.getState();(0,fr.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(),oe.actions.clearAssetCount(),oe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),oe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),oe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();oe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();oe.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&oe.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&oe.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(oe.getState().assetCounts.bookmarkByMap).length!==0;e===ie.BOOKMARKS&&r&&oe.actions.clearBookmarkCountByMap(),oe.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;oe.actions.bookmarks(r)}}},So=new xo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=So);var Co=class{addCommand(e,r=!1){S.commands.add(e,r)}consumeCommand(e){return S.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Co;var ce=C(_());var Va,dt=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},cc=Symbol("clearAfterUnitTest"),hr=class extends(0,ce.withEventBus)(Q){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Va]=()=>{this.defaultMessages={},this.cache=new ce.CacheRegistry,this.listeners={}},this.currentUiLocale=S.getState().uiLocale,S.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=S.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 a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,ce.deepEqual)(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,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 a;let s=e.toLowerCase(),c=this.resolveContext(s);return new ce.ParametrizedLabelResolver((a=this.defaultMessages[s])!==null&&a!==void 0?a:{},c).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(a){!(a instanceof ce.CanceledPromiseError)&&r&&console.error(a)}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 a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new dt({loadedContexts:e})),this.dispatchEvent(new dt({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new dt({loadedContexts:[e]})),this.dispatchEvent(new dt({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,ce.delay)(0).then(()=>n()).catch(()=>null)))}};Va=cc;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends hr{constructor(){super(async(o,e)=>(await this.awaitApi).getFluidTopicsMessageContext(o,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends hr{constructor(){super(async(o,e)=>(await this.awaitApi).getCustomMessageContext(o,e))}});var Ka=window.FluidTopicsI18nService,Au=window.FluidTopicsCustomI18nService;var Za=C(_()),Oo=class{highlightHtml(e,r,n){(0,Za.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Oo;var qa=C(_());var Eo=class{isDate(e){var r,n,a,s;return(s=(a=((n=(r=S.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===e))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1}format(e,r){var n,a,s,c;if(e==null)return"";try{return qa.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:S.getState().uiLocale,(a=r?.longFormat)!==null&&a!==void 0?a:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(c=r?.onlyTime)!==null&&c!==void 0?c:!1)}catch(d){throw console.error(`Date ${JSON.stringify(e)} is not valid`,d),d}}};window.FluidTopicsDateService=new Eo;var Ya=C(_());var Lt=class{static get(e,r){var n,a;let s=S.getState(),{lang:c,region:d}=(a=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new Ya.SearchPlaceConverter(s.baseUrl,e??20,s.searchInAllLanguagesAllowed,r??`${c}-${d}`)}};var gr=class extends Q{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 sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_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,a])=>Array.isArray(a)?[n,a.map(s=>typeof s=="object"&&s!=null&&!Array.isArray(s)?this.sortEventArrays(s):s).sort((s,c)=>typeof s=="object"&&s!==null&&"key"in s?s.key.localeCompare(c.key):typeof s=="string"&&typeof c=="string"?s.localeCompare(c):String(s).localeCompare(String(c)))]:typeof a=="object"&&a!==null?[n,this.sortEventArrays(a)]:[n,a]);return Object.fromEntries(r)}sendEvents(e,r){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(a=>(console.info(r),console.debug(a),n)),1e3)}};var Ao=class{urlToSearchRequest(e){return Lt.get().parse(e)}searchRequestToUrl(e){return Lt.get().serialize(e)}};window.FluidTopicsUrlService=new Ao;var _e=C(_());var We=class o extends CustomEvent{constructor(e){super(o.eventName,{detail:{currentItem:e}})}};We.eventName="change";var wo=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))}},Qa=new wo;var yr=class o extends _e.WithEventBus{static build(){return new o(window.history,Qa,()=>window.location,!1)}constructor(e,r,n,a){var s,c;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(c=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&c!==void 0?c:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}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,_e.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new We(this.currentItem())),0)}installProxies(){let e=r=>(n,a,[s,c,d])=>{let u=r(),p={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[p,c,d]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(We.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(We.eventName,e)}currentItem(){return(0,_e.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,_e.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,_e.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 a=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(a=s),s++;return a}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 a=r??this.currentState.majorStateId,s=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=yr.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:o=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(o),removeHistoryChangeListener:o=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(o)});var Xa=C(V());var Ja=Xa.css`
|
|
50
50
|
`;var ti=C(V()),Z=C(J()),pe=C(_());function ei(o,e){let{authenticationRequired:r,session:n}=S.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):o()}var H=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},D=class extends pe.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Ge.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new pe.CacheRegistry,this.cleanSessionDebouncer=new pe.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return ti.html`
|
|
51
51
|
<slot></slot>
|
|
52
52
|
`}connectedCallback(){super.connectedCallback(),S.addEventListener(be.eventName,this.reloadConfiguration)}disconnectedCallback(){S.addEventListener(be.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var r,n,a,s,c,d,u;super.update(e),e.has("baseUrl")&&(S.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&S.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&S.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&S.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&S.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&S.actions.noCustom(this.noCustom),e.has("editorMode")&&S.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&S.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&S.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>Ka.addContext(p)),e.has("openExternalDocumentInNewTab")&&S.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&S.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&S.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(S.actions.defaultLocales((r=this.localesConfiguration)===null||r===void 0?void 0:r.defaultLocales),S.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),S.actions.searchInAllLanguagesAllowed((c=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),e.has("authenticationRequired")&&S.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&S.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>ei(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};D.elementDefinitions={};D.styles=Ja;H([(0,Z.property)()],D.prototype,"baseUrl",void 0);H([(0,Z.property)()],D.prototype,"apiIntegrationIdentifier",void 0);H([(0,Z.property)()],D.prototype,"apiIntegrationAppVersion",void 0);H([(0,Z.property)()],D.prototype,"uiLocale",void 0);H([(0,pe.jsonProperty)(null)],D.prototype,"availableUiLocales",void 0);H([(0,pe.jsonProperty)(null)],D.prototype,"metadataConfiguration",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"editorMode",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"noCustom",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);H([(0,Z.property)({converter:{fromAttribute(o){return o==="false"?!1:o==="true"||(o??!1)}}})],D.prototype,"noCustomComponent",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"withManualResources",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"navigatorOnline",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"forcedOffline",void 0);H([(0,Z.property)({type:Object})],D.prototype,"apiProvider",void 0);H([(0,Z.property)({type:Boolean})],D.prototype,"authenticationRequired",void 0);H([(0,pe.jsonProperty)([])],D.prototype,"messageContexts",void 0);H([(0,pe.jsonProperty)(void 0)],D.prototype,"session",void 0);H([(0,Z.state)()],D.prototype,"localesConfiguration",void 0);H([(0,Z.state)()],D.prototype,"availableContentLocales",void 0);var ri=C(_());(0,ri.customElement)("ft-app-context")(D);var mr=class extends Q{get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,r,n){super(!1,r),this.converter=e,this._mapId=n,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("enrichedToc",()=>this.withMapId(e=>this.fetchPages(e).then(r=>this.converter.convertPaginatedToc(e,r)))),this.cache.register("ratingSummary",()=>{var e,r;return xe((r=(e=S.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&r!==void 0?r:[],"RATING_USER")?this.withMapId(a=>this.fetchMapRating(a)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,r){return e+(r?"-destinationLanguage-"+r?.destinationLanguage:"")}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.fetchPages(this.mapId,e).then(r=>this.converter.convertPaginatedToc(this.mapId,r)))}getEnrichedTocNow(e){return this.cache.getNow(this.makeCacheKey("enrichedToc",e))}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 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,a;let s=this.getMapNow(r);return s?.prettyUrl==e||`${s?.id}/root`===e?(n=this.getEnrichedTocNow(r))===null||n===void 0?void 0:n.toc[0]:(a=this.getEnrichedTocNow(r))===null||a===void 0?void 0:a.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))}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){let a=this.getNavigationData(e,r,n),s=this.getReaderLinkPrefix()+(a.prettyUrl?a.prettyUrl:`${a.mapId}/${a.tocId}`),c=new URL(s,this.api.tenantBaseUrl);return a.page!=null&&c.searchParams.set("page",`${a.page}`),a.prettyUrlDuplicated&&c.searchParams.set("tocId",a.tocId),a.section!=null&&c.searchParams.set("section",a.section),c.href}getNavigationData(e,r,n,a){var s,c;e=e||"root";let d=this.getEnrichedTocNow(a),u=d?.pageByTocId[e],p=d?.nodeByTocId[e],h=p?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(s=p?.title)!==null&&s!==void 0?s:"",untranslatedTopicTitle:p?.untranslatedTitle,page:r&&u&&u.number!==r?r:void 0,prettyUrl:h?.replace(/^r\//,""),prettyUrlDuplicated:(c=d?.duplicatedPrettyUrls.has(h??""))!==null&&c!==void 0?c:!1,section:n}}async getAccurateNavigationData(e,r,n,a){return await this.getEnrichedToc(a),this.getNavigationData(e,r,n,a)}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(a=>a.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=S.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,r,n){return this.makeTopicFeedbackRequest(e,r,n)}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),a=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],s=this.getTocNodeNow(n.parentTocId,r);for(;s;)a.unshift({tocId:s.tocId,title:s.title,untranslatedTitle:s.untranslatedTitle}),s=this.getTocNodeNow(s.parentTocId,r);return a}isFeatureAccessible(e,{session:r}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case ve.FEEDBACK:return xe(r??[],k.FEEDBACK_USER);case ve.RATING:return xe(r??[],k.RATING_USER);case ve.PRINT:return xe(r??[],k.PRINT_USER);case ve.BOOKMARK:return!!r?.sessionAuthenticated;case ve.COLLECTIONS:return xe(r??[],k.COLLECTION_USER);case ve.PERSONAL_BOOKS:return xe(r??[],k.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var br=class o extends mr{static async build(e){return new o(new Wt,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){return await this.getMap(r),this.api.getPages(e,this.fingerprint,r)}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 a={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(a)}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){return this.api.sendTopicFeedback(this.mapId,e,r,n)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(e){return this.api.unrateTopic(this.mapId,e)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(e){return!0}};var vr=class o{static build(e,r){return new o(pn(e.trim()||"context"),r??br.build)}loaded(){return(0,fe.waitUntil)(()=>this._loaded)}constructor(e,r,n,a){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new fe.Debouncer(10),this.analyticsEventsService=a??new gr,this.initService(r)}async initService(e){return this.service=await e(),this.service.mapId=this.store.getState().mapId,this.reload()}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 awaitService(){return(0,fe.waitFor)(()=>this.service)}async navigateToTopic(e,r,n){await this.loaded();let a=await this.awaitService(),s=await(n!=null?a.getPage(n,this.getTranslationSettings()):a.getPageByTocId(e??"root",this.getTranslationSettings()));this.store.actions.currentPage(s);let c=this.resolveValidNonRootTocId(e,s);this.store.actions.scrollTarget({tocId:c,section:r}),this.store.getState().visibleTopics[0]!==c&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,r){var n,a,s;let c=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:r.rootTocId;return r.topics.includes(c)?c:(s=(a=r.topics[0])!==null&&a!==void 0?a:r.hiddenTopics[0])!==null&&s!==void 0?s:"root"}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(this.getTranslationSettings()))}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()}async fetchData(e){var r,n,a,s,c;try{e&&this.setTranslationLoading(!0);let d=u=>{throw e&&this.setTranslationError(!0),u};await Promise.all([this.loadConfiguration(),(r=this.service)===null||r===void 0?void 0:r.getMap(e).then(u=>this.store.actions.map(u)).catch(d),(n=this.service)===null||n===void 0?void 0:n.getToc(e).then(u=>this.store.actions.toc(u)).catch(d),(a=this.service)===null||a===void 0?void 0:a.getPagesToc(e).then(u=>this.store.actions.pagesToc(u)).catch(d),(s=this.service)===null||s===void 0?void 0:s.getPaginationConfiguration().then(u=>this.store.actions.paginationConfiguration(u)).catch(d),(c=this.service)===null||c===void 0?void 0:c.getTranslationError(e).then(u=>this.setTranslationError(u))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,e&&this.setTranslationLoading(!1)}catch(d){this.errorHandler&&!(d instanceof fe.CanceledPromiseError)&&this.errorHandler(d)}}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()}fetchRelatives(){var e,r;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(a=>{var s;return a.key==((s=this.store.getState().configuration)===null||s===void 0?void 0:s.relativePivotMetadata)}).flatMap(a=>a.values);n!==void 0&&n.length>0?(r=this.service)===null||r===void 0||r.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n).then(a=>{let s=a.results.flatMap(c=>c.entries);this.store.actions.relatives(s),this.updateClusteringHelper()}):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 a=n.find(c=>{var d;return((d=c.map)===null||d===void 0?void 0:d.mapId)==this.store.getState().mapId}),s=(r=(e=S.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&r!==void 0?r:[];return new fe.ClusteringHelper(n,a,this.metadataForSwitchToRelatives,s)}}async navigateToRelativeTopicIfFound(e){var r,n,a;await this.loaded();let s=await(0,fe.waitFor)(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),c=this.store.getState().mapId,u=await(await this.awaitService()).getRelativesForTopicInMap(c,s,[e]);if(!((a=(n=(r=u?.results)===null||r===void 0?void 0:r[0])===null||n===void 0?void 0:n.entries)===null||a===void 0)&&a[0]){let p=u.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!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(this.getTranslationSettings()))}async setTranslationSourceLanguage(e){this.store.actions.setTranslationSourceLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}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()}getAccurateNavigationData(e,r,n){return 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 a=this.getTranslationSettings();return a?(r=this.service)===null||r===void 0?void 0:r.getTranslatedTopicContent(e,a).then(s=>(s.isTranslationError&&this.setTranslationError(!0),s.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))}sendDocumentOnDemandTranslateEvent(e){let{editorMode:r,apiIntegrationIdentifier:n,apiIntegrationAppVersion:a}=S.getState(),s=this.store.getState(),c=s.map,d=s.translation.profileId;if(!(r||!c||!n||!a||!d))try{let u=this.analyticsEventsService.convertMapToAnalyticsDocument(c);this.analyticsEventsService.sendDocumentAiTranslateEvent({name:"DOCUMENT__ON_DEMAND_TRANSLATE",offline:!1,appName:n,appVersion:a,sourceLanguage:this.parseLanguageToAnalyticsFormat(c.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e.code),profileId:d,document:u})}catch(u){console.warn("Failed to send on-demand document 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 xr=class extends CustomEvent{constructor(e,r){super("ft-reader-map-loaded",{detail:{map:e,toc:r}})}},Sr=class extends CustomEvent{constructor(e,r){super("ft-reader-visible-topics-change",{detail:{visibleTopics:r}})}},Cr=class extends CustomEvent{constructor(e){super("ft-reader-navigation-done",{detail:e})}},Or=class extends CustomEvent{constructor(e){super("ft-reader-load-error",{detail:e})}},Er=class extends Event{constructor(){super("ft-reader-map-not-found")}},Ar=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},wr=class extends Event{constructor(){super("ft-reader-map-forbidden")}},Ir=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var te=function(o,e,r,n){var a=arguments.length,s=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(o,e,r,n);else for(var d=o.length-1;d>=0;d--)(c=o[d])&&(s=(a<3?c(s):a>3?c(e,r,s):c(e,r))||s);return a>3&&s&&Object.defineProperty(e,r,s),s},Io=class{constructor(e){this.stateManager=e}searchInDocument(e){this.stateManager.setSearchInDocumentQuery(e??"")}},z=class extends G.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.updateConfiguration=()=>{this.stateManager.reloadConfiguration()},this.scrollToTargetDebouncer=new G.Debouncer(5),this.navigationDebouncer=new G.Debouncer(10),this.mapLoadedEventDebouncer=new G.Debouncer(50),this.addStore(S)}render(){return kt.html`
|
|
@@ -45,7 +45,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
45
45
|
input::-webkit-search-results-decoration {
|
|
46
46
|
display: none;
|
|
47
47
|
}
|
|
48
|
-
`;var Ks={};var Ai={};F(Ai,{ParametrizedLabelResolver:()=>Hr});var Hr=class r{constructor(e,t){this.defaultLabels=e,this.labels=t}resolve(e,...t){var n,i;e=this.resolvePluralKey(e,t);let a=(i=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&i!==void 0?i:"";return r.replaceParameters(a,...t)}static replaceParameters(e,...t){return t.forEach((n,i)=>e=e.replace(new RegExp(`\\{${i}([^}]*)\\}`,"g"),(a,s)=>r.formatValue(n,s))),e}resolvePluralKey(e,t){for(let n of t)if(typeof n=="number"){let i=`${String(e)}[\\=${n}]`;if(i in this.labels||i in this.defaultLabels)return i}return e}static formatValue(e,t){return e instanceof Date?r.formatDate(e,t):e??""}static formatDate(e,t){let n=i=>t?.includes("date")?e.toLocaleDateString(i):t?.includes("time")?e.toLocaleTimeString(i):e.toLocaleString(i);try{return n(document.documentElement.lang)}catch{return n()}}};var Ji={};F(Ji,{FtCommandQueue:()=>zr,FtLitElementRedux:()=>Et,FtReduxStore:()=>We,FtStateManager:()=>Yi,ReduxWatcher:()=>Co,clearAllStores:()=>Lp,isFtReduxStore:()=>Kt,redux:()=>V,reduxEventListener:()=>qu,reduxReactive:()=>Zu,watch:()=>Np,withRedux:()=>Zs});var Zu=()=>(r,e)=>{var t;let n=r.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(t=n.reduxReactiveProperties)===null||t===void 0||t.add(e)},V=r=>{let e=r??{};return(t,n)=>{var i;let a={hasChanged:Ue,attribute:!1,...e};A(a)(t,n);let s=t.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}},qu=r=>(e,t)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(t,r)};var zr=class{constructor(){this.queue=[]}add(e,t=!1){t&&this.clear(e.type),this.queue.push(e)}consume(e){let t=this.queue.find(n=>n.type===e);return t&&(this.queue=this.queue.filter(n=>n!==t)),t}clear(e){typeof e=="string"?this.queue=this.queue.filter(t=>t.type!==e):this.queue=this.queue.filter(t=>!e.test(t.type))}};function Kt(r){var e;return(e=r?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Wr=Symbol("internalReduxEventsUnsubscribers"),et=Symbol("internalStoresUnsubscribers"),St=Symbol("internalStores"),Zs=te(Symbol("withRedux"),function(r){var e,t,n;class i extends r{constructor(){super(...arguments),this[e]=new Map,this[t]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[St].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[St].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[St].get(s)}addStore(s,c){var d;c=(d=c??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(c),this[St].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[St].delete(c)}setupStores(){this.unsubscribeFromStores(),this[St].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let d=this.constructor.getPropertyOptions(c);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:c)){let p=this.getStore(s.store);p&&(s.store?this[et].has(s.store):this[et].size>0)&&(this[c]=s.selector(p.getState(),this))}})}subscribeToStore(s,c){var d;this[et].set(s,c.subscribe(()=>this.updateFromStores())),this[Wr].set(s,[]),Kt(c)&&c.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||c.name===p.store)){let f=m=>this[h](m);c.addEventListener(p.eventName,f),this[Wr].get(s).push(()=>c.removeEventListener(p.eventName,f))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[et].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[et].has(s)&&this[et].get(s)(),this[et].delete(s),(c=this[Wr].get(s))===null||c===void 0||c.forEach(d=>d()),this[Wr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=et,t=St,n=Wr,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Et=class extends Zs(q){};function be(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+r+(t.length?" "+t.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ze(r){return!!r&&!!r[K]}function Ce(r){var e;return!!r&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===op}(r)||Array.isArray(r)||!!r[tc]||!!(!((e=r.constructor)===null||e===void 0)&&e[tc])||Mi(r)||Di(r))}function Ot(r,e,t){t===void 0&&(t=!1),Yt(r)===0?(t?Object.keys:qt)(r).forEach(function(n){t&&typeof n=="symbol"||e(n,r[n],r)}):r.forEach(function(n,i){return e(i,n,r)})}function Yt(r){var e=r[K];return e?e.i>3?e.i-4:e.i:Array.isArray(r)?1:Mi(r)?2:Di(r)?3:0}function Zt(r,e){return Yt(r)===2?r.has(e):Object.prototype.hasOwnProperty.call(r,e)}function Yu(r,e){return Yt(r)===2?r.get(e):r[e]}function rc(r,e,t){var n=Yt(r);n===2?r.set(e,t):n===3?r.add(t):r[e]=t}function oc(r,e){return r===e?r!==0||1/r==1/e:r!=r&&e!=e}function Mi(r){return tp&&r instanceof Map}function Di(r){return rp&&r instanceof Set}function tt(r){return r.o||r.t}function Fi(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var e=ac(r);delete e[K];for(var t=qt(e),n=0;n<t.length;n++){var i=t[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:r[i]})}return Object.create(Object.getPrototypeOf(r),e)}function Ui(r,e){return e===void 0&&(e=!1),Bi(r)||ze(r)||!Ce(r)||(Yt(r)>1&&(r.set=r.add=r.clear=r.delete=Ju),Object.freeze(r),e&&Ot(r,function(t,n){return Ui(n,!0)},!0)),r}function Ju(){be(2)}function Bi(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function Ne(r){var e=ki[r];return e||be(18,r),e}function Xu(r,e){ki[r]||(ki[r]=e)}function Pi(){return Gr}function Ri(r,e){e&&(Ne("Patches"),r.u=[],r.s=[],r.v=e)}function vo(r){Li(r),r.p.forEach(Qu),r.p=null}function Li(r){r===Gr&&(Gr=r.l)}function qs(r){return Gr={p:[],l:Gr,h:r,m:!0,_:0}}function Qu(r){var e=r[K];e.i===0||e.i===1?e.j():e.g=!0}function Ti(r,e){e._=e.p.length;var t=e.p[0],n=r!==void 0&&r!==t;return e.h.O||Ne("ES5").S(e,r,n),n?(t[K].P&&(vo(e),be(4)),Ce(r)&&(r=xo(e,r),e.l||So(e,r)),e.u&&Ne("Patches").M(t[K].t,r,e.u,e.s)):r=xo(e,t,[]),vo(e),e.u&&e.v(e.u,e.s),r!==ic?r:void 0}function xo(r,e,t){if(Bi(e))return e;var n=e[K];if(!n)return Ot(e,function(c,d){return Ys(r,n,e,c,d,t)},!0),e;if(n.A!==r)return e;if(!n.P)return So(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Fi(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),Ot(a,function(c,d){return Ys(r,n,i,c,d,t,s)}),So(r,i,!1),t&&r.u&&Ne("Patches").N(n,t,r.u,r.s)}return n.o}function Ys(r,e,t,n,i,a,s){if(ze(i)){var c=xo(r,i,a&&e&&e.i!==3&&!Zt(e.R,n)?a.concat(n):void 0);if(rc(t,n,c),!ze(c))return;r.m=!1}else s&&t.add(i);if(Ce(i)&&!Bi(i)){if(!r.h.D&&r._<1)return;xo(r,i),e&&e.A.l||So(r,i)}}function So(r,e,t){t===void 0&&(t=!1),!r.l&&r.h.D&&r.m&&Ui(e,t)}function Ii(r,e){var t=r[K];return(t?tt(t):r)[e]}function Js(r,e){if(e in r)for(var t=Object.getPrototypeOf(r);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function rt(r){r.P||(r.P=!0,r.l&&rt(r.l))}function _i(r){r.o||(r.o=Fi(r.t))}function Ni(r,e,t){var n=Mi(e)?Ne("MapSet").F(e,t):Di(e)?Ne("MapSet").T(e,t):r.O?function(i,a){var s=Array.isArray(i),c={i:s?1:0,A:a?a.A:Pi(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},d=c,p=Vr;s&&(d=[c],p=jr);var h=Proxy.revocable(d,p),f=h.revoke,m=h.proxy;return c.k=m,c.j=f,m}(e,t):Ne("ES5").J(e,t);return(t?t.A:Pi()).p.push(n),n}function ep(r){return ze(r)||be(22,r),function e(t){if(!Ce(t))return t;var n,i=t[K],a=Yt(t);if(i){if(!i.P&&(i.i<4||!Ne("ES5").K(i)))return i.t;i.I=!0,n=Xs(t,a),i.I=!1}else n=Xs(t,a);return Ot(n,function(s,c){i&&Yu(i.t,s)===c||rc(n,s,e(c))}),a===3?new Set(n):n}(r)}function Xs(r,e){switch(e){case 2:return new Map(r);case 3:return Array.from(r)}return Fi(r)}function nc(){function r(s,c){var d=a[s];return d?d.enumerable=c:a[s]=d={configurable:!0,enumerable:c,get:function(){var p=this[K];return Vr.get(p,s)},set:function(p){var h=this[K];Vr.set(h,s,p)}},d}function e(s){for(var c=s.length-1;c>=0;c--){var d=s[c][K];if(!d.P)switch(d.i){case 5:n(d)&&rt(d);break;case 4:t(d)&&rt(d)}}}function t(s){for(var c=s.t,d=s.k,p=qt(d),h=p.length-1;h>=0;h--){var f=p[h];if(f!==K){var m=c[f];if(m===void 0&&!Zt(c,f))return!0;var y=d[f],b=y&&y[K];if(b?b.t!==m:!oc(y,m))return!0}}var E=!!c[K];return p.length!==qt(c).length+(E?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(c,c.length-1);if(d&&!d.get)return!0;for(var p=0;p<c.length;p++)if(!c.hasOwnProperty(p))return!0;return!1}function i(s){s.g&&be(3,JSON.stringify(tt(s)))}var a={};Xu("ES5",{J:function(s,c){var d=Array.isArray(s),p=function(f,m){if(f){for(var y=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(y,""+b,r(b,!0));return y}var E=ac(m);delete E[K];for(var C=qt(E),w=0;w<C.length;w++){var T=C[w];E[T]=r(T,f||!!E[T].enumerable)}return Object.create(Object.getPrototypeOf(m),E)}(d,s),h={i:d?5:4,A:c?c.A:Pi(),P:!1,I:!1,R:{},l:c,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,K,{value:h,writable:!0}),p},S:function(s,c,d){d?ze(c)&&c[K].A===s&&e(s.p):(s.u&&function p(h){if(h&&typeof h=="object"){var f=h[K];if(f){var m=f.t,y=f.k,b=f.R,E=f.i;if(E===4)Ot(y,function(v){v!==K&&(m[v]!==void 0||Zt(m,v)?b[v]||p(y[v]):(b[v]=!0,rt(f)))}),Ot(m,function(v){y[v]!==void 0||Zt(y,v)||(b[v]=!1,rt(f))});else if(E===5){if(n(f)&&(rt(f),b.length=!0),y.length<m.length)for(var C=y.length;C<m.length;C++)b[C]=!1;else for(var w=m.length;w<y.length;w++)b[w]=!0;for(var T=Math.min(y.length,m.length),S=0;S<T;S++)y.hasOwnProperty(S)||(b[S]=!0),b[S]===void 0&&p(y[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?t(s):n(s)}})}var Qs,Gr,$i=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",tp=typeof Map<"u",rp=typeof Set<"u",ec=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ic=$i?Symbol.for("immer-nothing"):((Qs={})["immer-nothing"]=!0,Qs),tc=$i?Symbol.for("immer-draftable"):"__$immer_draftable",K=$i?Symbol.for("immer-state"):"__$immer_state";var op=""+Object.prototype.constructor,qt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,ac=Object.getOwnPropertyDescriptors||function(r){var e={};return qt(r).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(r,t)}),e},ki={},Vr={get:function(r,e){if(e===K)return r;var t=tt(r);if(!Zt(t,e))return function(i,a,s){var c,d=Js(a,s);return d?"value"in d?d.value:(c=d.get)===null||c===void 0?void 0:c.call(i.k):void 0}(r,t,e);var n=t[e];return r.I||!Ce(n)?n:n===Ii(r.t,e)?(_i(r),r.o[e]=Ni(r.A.h,n,r)):n},has:function(r,e){return e in tt(r)},ownKeys:function(r){return Reflect.ownKeys(tt(r))},set:function(r,e,t){var n=Js(tt(r),e);if(n?.set)return n.set.call(r.k,t),!0;if(!r.P){var i=Ii(tt(r),e),a=i?.[K];if(a&&a.t===t)return r.o[e]=t,r.R[e]=!1,!0;if(oc(t,i)&&(t!==void 0||Zt(r.t,e)))return!0;_i(r),rt(r)}return r.o[e]===t&&(t!==void 0||e in r.o)||Number.isNaN(t)&&Number.isNaN(r.o[e])||(r.o[e]=t,r.R[e]=!0),!0},deleteProperty:function(r,e){return Ii(r.t,e)!==void 0||e in r.t?(r.R[e]=!1,_i(r),rt(r)):delete r.R[e],r.o&&delete r.o[e],!0},getOwnPropertyDescriptor:function(r,e){var t=tt(r),n=Reflect.getOwnPropertyDescriptor(t,e);return n&&{writable:!0,configurable:r.i!==1||e!=="length",enumerable:n.enumerable,value:t[e]}},defineProperty:function(){be(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){be(12)}},jr={};Ot(Vr,function(r,e){jr[r]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),jr.deleteProperty=function(r,e){return jr.set.call(this,r,e,void 0)},jr.set=function(r,e,t){return Vr.set.call(this,r[0],e,t,r[0])};var np=function(){function r(t){var n=this;this.O=ec,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var d=n;return function(E){var C=this;E===void 0&&(E=c);for(var w=arguments.length,T=Array(w>1?w-1:0),S=1;S<w;S++)T[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=a).call.apply(O,[C,v].concat(T))})}}var p;if(typeof a!="function"&&be(6),s!==void 0&&typeof s!="function"&&be(7),Ce(i)){var h=qs(n),f=Ni(n,i,void 0),m=!0;try{p=a(f),m=!1}finally{m?vo(h):Li(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(E){return Ri(h,s),Ti(E,h)},function(E){throw vo(h),E}):(Ri(h,s),Ti(p,h))}if(!i||typeof i!="object"){if((p=a(i))===void 0&&(p=i),p===ic&&(p=void 0),n.D&&Ui(p,!0),s){var y=[],b=[];Ne("Patches").M(i,p,y,b),s(y,b)}return p}be(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(p){for(var h=arguments.length,f=Array(h>1?h-1:0),m=1;m<h;m++)f[m-1]=arguments[m];return n.produceWithPatches(p,function(y){return i.apply(void 0,[y].concat(f))})};var s,c,d=n.produce(i,a,function(p,h){s=p,c=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(p){return[p,s,c]}):[d,s,c]},typeof t?.useProxies=="boolean"&&this.setUseProxies(t.useProxies),typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=r.prototype;return e.createDraft=function(t){Ce(t)||be(8),ze(t)&&(t=ep(t));var n=qs(this),i=Ni(this,t,void 0);return i[K].C=!0,Li(n),i},e.finishDraft=function(t,n){var i=t&&t[K],a=i.A;return Ri(a,n),Ti(void 0,a)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!ec&&be(20),this.O=t},e.applyPatches=function(t,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}i>-1&&(n=n.slice(i+1));var s=Ne("Patches").$;return ze(t)?s(t,n):this.produce(t,function(c){return s(c,n)})},r}(),fe=new np,ip=fe.produce,zb=fe.produceWithPatches.bind(fe),Wb=fe.setAutoFreeze.bind(fe),jb=fe.setUseProxies.bind(fe),Gb=fe.applyPatches.bind(fe),Vb=fe.createDraft.bind(fe),Kb=fe.finishDraft.bind(fe),Eo=ip;function Ct(r){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(r)}function sc(r,e){if(Ct(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function cc(r){var e=sc(r,"string");return Ct(e)=="symbol"?e:e+""}function lc(r,e,t){return(e=cc(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Hi(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dc(Object(t),!0).forEach(function(n){lc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ae(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var uc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),zi=function(){return Math.random().toString(36).substring(7).split("").join(".")},Oo={INIT:"@@redux/INIT"+zi(),REPLACE:"@@redux/REPLACE"+zi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+zi()}};function ap(r){if(typeof r!="object"||r===null)return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function Wi(r,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ae(1));return t(Wi)(r,e)}if(typeof r!="function")throw new Error(ae(2));var i=r,a=e,s=[],c=s,d=!1;function p(){c===s&&(c=s.slice())}function h(){if(d)throw new Error(ae(3));return a}function f(E){if(typeof E!="function")throw new Error(ae(4));if(d)throw new Error(ae(5));var C=!0;return p(),c.push(E),function(){if(C){if(d)throw new Error(ae(6));C=!1,p();var T=c.indexOf(E);c.splice(T,1),s=null}}}function m(E){if(!ap(E))throw new Error(ae(7));if(typeof E.type>"u")throw new Error(ae(8));if(d)throw new Error(ae(9));try{d=!0,a=i(a,E)}finally{d=!1}for(var C=s=c,w=0;w<C.length;w++){var T=C[w];T()}return E}function y(E){if(typeof E!="function")throw new Error(ae(10));i=E,m({type:Oo.REPLACE})}function b(){var E,C=f;return E={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(ae(11));function S(){T.next&&T.next(h())}S();var v=C(S);return{unsubscribe:v}}},E[uc]=function(){return this},E}return m({type:Oo.INIT}),n={dispatch:m,subscribe:f,getState:h,replaceReducer:y},n[uc]=b,n}function sp(r){Object.keys(r).forEach(function(e){var t=r[e],n=t(void 0,{type:Oo.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof t(void 0,{type:Oo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function pc(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n];typeof r[i]=="function"&&(t[i]=r[i])}var a=Object.keys(t),s,c;try{sp(t)}catch(d){c=d}return function(p,h){if(p===void 0&&(p={}),c)throw c;if(0)var f;for(var m=!1,y={},b=0;b<a.length;b++){var E=a[b],C=t[E],w=p[E],T=C(w,h);if(typeof T>"u"){var S=h&&h.type;throw new Error(ae(14))}y[E]=T,m=m||T!==w}return m=m||a.length!==Object.keys(p).length,m?y:p}}function Jt(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function fc(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(ae(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(d){return d(s)});return a=Jt.apply(void 0,c)(i.dispatch),Hi(Hi({},i),{},{dispatch:a})}}}function hc(r){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(c){return typeof c=="function"?c(i,a,r):s(c)}}};return e}var mc=hc();mc.withExtraArgument=hc;var ji=mc;var xc=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),cp=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=p[0]&2?i.return:p[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,p[1])).done)return a;switch(i=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,i=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(h){p=[6,h],i=0}finally{n=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Xt=function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r},lp=Object.defineProperty,dp=Object.defineProperties,up=Object.getOwnPropertyDescriptors,gc=Object.getOwnPropertySymbols,pp=Object.prototype.hasOwnProperty,fp=Object.prototype.propertyIsEnumerable,yc=function(r,e,t){return e in r?lp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t},ot=function(r,e){for(var t in e||(e={}))pp.call(e,t)&&yc(r,t,e[t]);if(gc)for(var n=0,i=gc(e);n<i.length;n++){var t=i[n];fp.call(e,t)&&yc(r,t,e[t])}return r},Gi=function(r,e){return dp(r,up(e))},hp=function(r,e,t){return new Promise(function(n,i){var a=function(d){try{c(t.next(d))}catch(p){i(p)}},s=function(d){try{c(t.throw(d))}catch(p){i(p)}},c=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(a,s)};c((t=t.apply(r,e)).next())})};var mp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Jt:Jt.apply(null,arguments)},uv=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function gp(r){if(typeof r!="object"||r===null)return!1;var e=Object.getPrototypeOf(r);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var yp=function(r){xc(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,t)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,Xt([void 0],t[0].concat(this)))):new(e.bind.apply(e,Xt([void 0],t.concat(this))))},e}(Array),bp=function(r){xc(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,t)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,Xt([void 0],t[0].concat(this)))):new(e.bind.apply(e,Xt([void 0],t.concat(this))))},e}(Array);function Zi(r){return Ce(r)?Eo(r,function(){}):r}function vp(r){return typeof r=="boolean"}function xp(){return function(e){return Sp(e)}}function Sp(r){r===void 0&&(r={});var e=r.thunk,t=e===void 0?!0:e,n=r.immutableCheck,i=n===void 0?!0:n,a=r.serializableCheck,s=a===void 0?!0:a,c=new yp;if(t&&(vp(t)?c.push(ji):c.push(ji.withExtraArgument(t.extraArgument))),0){if(i)var d;if(s)var p}return c}var Vi=!0;function Sc(r){var e=xp(),t=r||{},n=t.reducer,i=n===void 0?void 0:n,a=t.middleware,s=a===void 0?e():a,c=t.devTools,d=c===void 0?!0:c,p=t.preloadedState,h=p===void 0?void 0:p,f=t.enhancers,m=f===void 0?void 0:f,y;if(typeof i=="function")y=i;else if(gp(i))y=pc(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var b=s;if(typeof b=="function"&&(b=b(e),!Vi&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Vi&&b.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=fc.apply(void 0,b),C=Jt;d&&(C=mp(ot({trace:!Vi},typeof d=="object"&&d)));var w=new bp(E),T=w;Array.isArray(m)?T=Xt([E],m):typeof m=="function"&&(T=m(w));var S=C.apply(void 0,T);return Wi(y,h,S)}function nt(r,e){function t(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ot(ot({type:r,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:r,payload:n[0]}}return t.toString=function(){return""+r},t.type=r,t.match=function(n){return n.type===r},t}function Ec(r){var e={},t=[],n,i={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,i},addMatcher:function(a,s){return t.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return r(i),[e,t,n]}function Ep(r){return typeof r=="function"}function Op(r,e,t,n){t===void 0&&(t=[]);var i=typeof e=="function"?Ec(e):[e,t,n],a=i[0],s=i[1],c=i[2],d;if(Ep(r))d=function(){return Zi(r())};else{var p=Zi(r);d=function(){return p}}function h(f,m){f===void 0&&(f=d());var y=Xt([a[m.type]],s.filter(function(b){var E=b.matcher;return E(m)}).map(function(b){var E=b.reducer;return E}));return y.filter(function(b){return!!b}).length===0&&(y=[c]),y.reduce(function(b,E){if(E)if(ze(b)){var C=b,w=E(C,m);return w===void 0?b:w}else{if(Ce(b))return Eo(b,function(T){return E(T,m)});var w=E(b,m);if(w===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return w}return b},f)}return h.getInitialState=d,h}function Cp(r,e){return r+"/"+e}function Oc(r){var e=r.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof r.initialState=="function"?r.initialState:Zi(r.initialState),n=r.reducers||{},i=Object.keys(n),a={},s={},c={};i.forEach(function(h){var f=n[h],m=Cp(e,h),y,b;"reducer"in f?(y=f.reducer,b=f.prepare):y=f,a[h]=y,s[m]=y,c[h]=b?nt(m,b):nt(m)});function d(){var h=typeof r.extraReducers=="function"?Ec(r.extraReducers):[r.extraReducers],f=h[0],m=f===void 0?{}:f,y=h[1],b=y===void 0?[]:y,E=h[2],C=E===void 0?void 0:E,w=ot(ot({},m),s);return Op(t,function(T){for(var S in w)T.addCase(S,w[S]);for(var v=0,O=b;v<O.length;v++){var I=O[v];T.addMatcher(I.matcher,I.reducer)}C&&T.addDefaultCase(C)})}var p;return{name:e,reducer:function(h,f){return p||(p=d()),p(h,f)},actions:c,caseReducers:a,getInitialState:function(){return p||(p=d()),p.getInitialState()}}}var wp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ap=function(r){r===void 0&&(r=21);for(var e="",t=r;t--;)e+=wp[Math.random()*64|0];return e},Rp=["name","message","stack","code"],Ki=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),bc=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Tp=function(r){if(typeof r=="object"&&r!==null){for(var e={},t=0,n=Rp;t<n.length;t++){var i=n[t];typeof r[i]=="string"&&(e[i]=r[i])}return e}return{message:String(r)}},mv=function(){function r(e,t,n){var i=nt(e+"/fulfilled",function(h,f,m,y){return{payload:h,meta:Gi(ot({},y||{}),{arg:m,requestId:f,requestStatus:"fulfilled"})}}),a=nt(e+"/pending",function(h,f,m){return{payload:void 0,meta:Gi(ot({},m||{}),{arg:f,requestId:h,requestStatus:"pending"})}}),s=nt(e+"/rejected",function(h,f,m,y,b){return{payload:y,error:(n&&n.serializeError||Tp)(h||"Rejected"),meta:Gi(ot({},b||{}),{arg:m,requestId:f,rejectedWithValue:!!y,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),c=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(f,m,y){var b=n?.idGenerator?n.idGenerator(h):Ap(),E=new d,C,w=!1;function T(v){C=v,E.abort()}var S=function(){return hp(this,null,function(){var v,O,I,k,U,M,P;return cp(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),k=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:y}),_p(k)?[4,k]:[3,2];case 1:k=g.sent(),g.label=2;case 2:if(k===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=!0,U=new Promise(function(x,_){return E.signal.addEventListener("abort",function(){return _({name:"AbortError",message:C||"Aborted"})})}),f(a(b,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:b,arg:h},{getState:m,extra:y}))),[4,Promise.race([U,Promise.resolve(t(h,{dispatch:f,getState:m,extra:y,requestId:b,signal:E.signal,abort:T,rejectWithValue:function(x,_){return new Ki(x,_)},fulfillWithValue:function(x,_){return new bc(x,_)}})).then(function(x){if(x instanceof Ki)throw x;return x instanceof bc?i(x.payload,b,h,x.meta):i(x,b,h)})])];case 3:return I=g.sent(),[3,5];case 4:return M=g.sent(),I=M instanceof Ki?s(null,b,h,M.payload,M.meta):s(M,b,h),[3,5];case 5:return P=n&&!n.dispatchConditionRejection&&s.match(I)&&I.meta.condition,P||f(I),[2,I]}})})}();return Object.assign(S,{abort:T,requestId:b,arg:h,unwrap:function(){return S.then(Ip)}})}}return Object.assign(p,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return r.withTypes=function(){return r},r}();function Ip(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function _p(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var Cc="listener",wc="completed",Ac="cancelled",gv="task-"+Ac,yv="task-"+wc,bv=Cc+"-"+Ac,vv=Cc+"-"+wc;var qi="listenerMiddleware";var xv=nt(qi+"/add"),Sv=nt(qi+"/removeAll"),Ev=nt(qi+"/remove");var vc,Ov=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(vc||(vc=Promise.resolve())).then(r).catch(function(e){return setTimeout(function(){throw e},0)})},Pp=function(r){return function(e){setTimeout(e,r)}},Cv=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pp(10);nc();window.ftReduxStores||(window.ftReduxStores={});var We=class r extends $e{static get(e){var t;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Kt(a))return a;if(i==null)return;let s=Oc({...i,reducers:(t=i.reducers)!==null&&t!==void 0?t:{}}),c=Sc({reducer:(d,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=ft(s.getInitialState());for(let f of p.keeping)h[f]=(d??h)[f];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...p.overwrites};return s.reducer(d,p)}});return window.ftReduxStores[i.name]=new r(s,c,i.eventBus)}constructor(e,t,n){super(),this.reduxSlice=e,this.reduxStore=t,this.isFtReduxStore=!0,this.commands=new zr;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let d=s,p=a[d];return p?(...h)=>{let f=p(...h.map(i));return this.reduxStore.dispatch(f),f}:h=>{this.setState({[d]: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()}};function Lp(){var r;for(let e of Object.values((r=window.ftReduxStores)!==null&&r!==void 0?r:{}))Kt(e)&&e.clear()}var Co=class{constructor(e,t,n){this.store=e,this.valueSelector=t,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),t=this.valueSelector(e);Ue(this.lastValue,t)&&(this.callback(t,e),this.lastValue=t)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function Np(r,e,t){return new Co(r,e,t).watch()}var Yi=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var t;return(t=this.requestConsumers.get(e))!==null&&t!==void 0?t:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var ea={};F(ea,{scrollHelper:()=>Qt});var Xi,wo=new Map,Qi=class{lock(e,t){if(t){let n=wo.get(t);if(n==null||n===e)return wo.set(t,e),t}}release(e,t){t&&wo.get(t)===e&&wo.delete(t)}findFirstScrollableParent(e){var t;let n,i;for(let a of On(e)){let s=a,c=this.elementCanScroll(s);if(c&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else c&&i==null&&(i=s)}return(t=n??i)!==null&&t!==void 0?t:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,t){var n,i;let a=0;for(;t&&t.offsetParent!==e.offsetParent;)a+=(n=t.offsetTop)!==null&&n!==void 0?n:0,t=t.offsetParent;return a+((i=t?.offsetTop)!==null&&i!==void 0?i:0)-e.offsetTop}computeTopOffsetRatio(e,t){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return t;default:return 0}}scrollIntoViewIfPossible(e,t){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let i=this.getAbsoluteScrollOffset(n,e),a=i-n.clientHeight+e.clientHeight,s=i,c=Be(0,(s-n.scrollTop)/(s-a),1),d=this.computeTopOffsetRatio(t?.position,c)*(a-s)+s;n.scrollTo({behavior:t?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(Xi=window.FluidTopicsScrollHelper)!==null&&Xi!==void 0?Xi:new Qi;var Qt=window.FluidTopicsScrollHelper;var ra={};F(ra,{SearchPlaceConverter:()=>or,SearchPlaceQueryParams:()=>H,isSearchPlaceQueryParams:()=>dl,serializeRequest:()=>Fp});var Mp=Ql(Tc(),1);var Ic;(function(r){r.black="black",r.green="green",r.blue="blue",r.purple="purple",r.red="red",r.orange="orange",r.yellow="yellow"})(Ic||(Ic={}));var _c;(function(r){r.OFFICIAL="OFFICIAL",r.PERSONAL="PERSONAL",r.SHARED="SHARED"})(_c||(_c={}));var Pc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(Pc||(Pc={}));var Lc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(Lc||(Lc={}));var Nc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(Nc||(Nc={}));var kc;(function(r){r.VALUE="VALUE",r.DATE="DATE",r.RANGE="RANGE"})(kc||(kc={}));var Mc;(function(r){r.BOOKMARK__CREATE="BOOKMARK__CREATE",r.BOOKMARK__DELETE="BOOKMARK__DELETE",r.CASE_DEFLECTION__START="CASE_DEFLECTION__START",r.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",r.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",r.CHATBOT__RATE="CHATBOT__RATE",r.COLLECTION__CREATE="COLLECTION__CREATE",r.COLLECTION__UPDATE="COLLECTION__UPDATE",r.COLLECTION__DELETE="COLLECTION__DELETE",r.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",r.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",r.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",r.DOCUMENT__PRINT="DOCUMENT__PRINT",r.DOCUMENT__PROCESS="DOCUMENT__PROCESS",r.DOCUMENT__RATE="DOCUMENT__RATE",r.DOCUMENT__SEARCH="DOCUMENT__SEARCH",r.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",r.DOCUMENT__UNRATE="DOCUMENT__UNRATE",r.FEEDBACK__SEND="FEEDBACK__SEND",r.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",r.AI__RATE="AI__RATE",r.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",r.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",r.KHUB__PROCESS="KHUB__PROCESS",r.KHUB__SEARCH="KHUB__SEARCH",r.LABELS__DOWNLOAD="LABELS__DOWNLOAD",r.LINK__SHARE="LINK__SHARE",r.PAGE__DISPLAY="PAGE__DISPLAY",r.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",r.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",r.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",r.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",r.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",r.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",r.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",r.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",r.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",r.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",r.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",r.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",r.TOPIC__RATE="TOPIC__RATE",r.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",r.TOPIC__UNRATE="TOPIC__UNRATE",r.USER__LOGIN="USER__LOGIN",r.USER__LOGOUT="USER__LOGOUT",r.HEARTBEAT="HEARTBEAT"})(Mc||(Mc={}));var Dc;(function(r){r.THIRD_PARTY="THIRD_PARTY",r.OFF_THE_GRID="OFF_THE_GRID",r.CONTENT_PACKAGER="CONTENT_PACKAGER",r.PAGES="PAGES",r.DESIGNED_READER="DESIGNED_READER"})(Dc||(Dc={}));var Fc;(function(r){r.HOMEPAGE="HOMEPAGE",r.CUSTOM="CUSTOM",r.HEADER="HEADER",r.READER="READER",r.TOPIC_TEMPLATE="TOPIC_TEMPLATE",r.SEARCH="SEARCH",r.SEARCH_RESULT="SEARCH_RESULT",r.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",r.LINK_PREVIEW="LINK_PREVIEW",r.UD_VIEWER="UD_VIEWER",r.ASSET_VIEWER="ASSET_VIEWER"})(Fc||(Fc={}));var Uc;(function(r){r.CLASSIC="CLASSIC",r.CUSTOM="CUSTOM",r.DESIGNER="DESIGNER"})(Uc||(Uc={}));var Bc;(function(r){r.AND="AND",r.OR="OR",r.MONOVALUED="MONOVALUED"})(Bc||(Bc={}));var $c;(function(r){r.NONE="NONE",r.ALPHABET="ALPHABET",r.VERSION="VERSION"})($c||($c={}));var Hc;(function(r){r.STARS="STARS",r.LIKE="LIKE",r.DICHOTOMOUS="DICHOTOMOUS",r.NO_RATING="NO_RATING"})(Hc||(Hc={}));var zc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR",r.CUSTOM="CUSTOM"})(zc||(zc={}));var tr;(function(r){r.OPTIONAL="OPTIONAL",r.MANDATORY="MANDATORY"})(tr||(tr={}));var Wc;(function(r){r.ASC="ASC",r.DESC="DESC"})(Wc||(Wc={}));var jc;(function(r){r.ALPHA="ALPHA",r.NATURAL="NATURAL"})(jc||(jc={}));var ta;(function(r){r.EVERYWHERE="EVERYWHERE",r.TITLE_ONLY="TITLE_ONLY",r.NONE="NONE"})(ta||(ta={}));var Xc=r=>Object.keys(ta).includes(r);var Gc;(function(r){r.ARTICLE="ARTICLE",r.BOOK="BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(Gc||(Gc={}));var Vc;(function(r){r.FLUIDTOPICS="FLUIDTOPICS",r.EXTERNAL="EXTERNAL"})(Vc||(Vc={}));var Kc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.PERSONAL_BOOK="PERSONAL_BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(Kc||(Kc={}));var rr;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(rr||(rr={}));var Qc=r=>Object.keys(rr).includes(r);var Zc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.HTML_PACKAGE="HTML_PACKAGE",r.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Zc||(Zc={}));var qc;(function(r){r.DEFAULT="DEFAULT",r.DOCUMENTS="DOCUMENTS",r.ALL_TOPICS="ALL_TOPICS",r.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(qc||(qc={}));var Yc;(function(r){r.PLAIN_TEXT="PLAIN_TEXT",r.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",r.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Yc||(Yc={}));var W;(function(r){r.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",r.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",r.HTML_EXPORT_USER="HTML_EXPORT_USER",r.PDF_EXPORT_USER="PDF_EXPORT_USER",r.SAVED_SEARCH_USER="SAVED_SEARCH_USER",r.COLLECTION_USER="COLLECTION_USER",r.OFFLINE_USER="OFFLINE_USER",r.ANALYTICS_USER="ANALYTICS_USER",r.BETA_USER="BETA_USER",r.DEBUG_USER="DEBUG_USER",r.PRINT_USER="PRINT_USER",r.RATING_USER="RATING_USER",r.FEEDBACK_USER="FEEDBACK_USER",r.GENERATIVE_AI_USER="GENERATIVE_AI_USER",r.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",r.CONTENT_PUBLISHER="CONTENT_PUBLISHER",r.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",r.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",r.KHUB_ADMIN="KHUB_ADMIN",r.USERS_ADMIN="USERS_ADMIN",r.PORTAL_ADMIN="PORTAL_ADMIN",r.ADMIN="ADMIN"})(W||(W={}));var ve;(function(r){r.SEARCHES="SEARCHES",r.BOOKMARKS="BOOKMARKS",r.BOOKS="BOOKS",r.COLLECTIONS="COLLECTIONS"})(ve||(ve={}));var Jc;(function(r){r.UNAUTHENTICATED="UNAUTHENTICATED",r.USER_INCOMPLETE="USER_INCOMPLETE",r.MFA_REQUIRED="MFA_REQUIRED",r.AUTHENTICATED="AUTHENTICATED"})(Jc||(Jc={}));var el;(function(r){r.VALID="VALID",r.INVALID="INVALID"})(el||(el={}));var tl;(function(r){r.INACCURATE="INACCURATE",r.INCOMPLETE="INCOMPLETE",r.OFF_TOPIC="OFF_TOPIC",r.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",r.SUMMARY="SUMMARY",r.SEMANTIC_SEARCH="SEMANTIC_SEARCH",r.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",r.OTHER="OTHER"})(tl||(tl={}));var rl;(function(r){r.INACCURATE="INACCURATE",r.INCOMPLETE="INCOMPLETE",r.OFF_TOPIC="OFF_TOPIC",r.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",r.SLOW="SLOW",r.OTHER="OTHER"})(rl||(rl={}));var ol;(function(r){r.JSON="JSON",r.TEXT="TEXT"})(ol||(ol={}));var nl;(function(r){r.USER="USER",r.ASSISTANT="ASSISTANT"})(nl||(nl={}));var il;(function(r){r.TEXT="TEXT",r.HTML="HTML"})(il||(il={}));var al;(function(r){r.HTML="HTML",r.MARKDOWN="MARKDOWN"})(al||(al={}));var sl;(function(r){r.MAP="MAP",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(sl||(sl={}));var kp={[W.PERSONAL_BOOK_SHARE_USER]:[W.PERSONAL_BOOK_USER],[W.HTML_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.PDF_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.KHUB_ADMIN]:[W.CONTENT_PUBLISHER],[W.ADMIN]:[W.KHUB_ADMIN,W.USERS_ADMIN,W.PORTAL_ADMIN,W.BEHAVIOR_DATA_USER],[W.GENERATIVE_AI_EXPORT_USER]:[W.GENERATIVE_AI_USER]};function cl(r,e){return r===e||(kp[r]??[]).some(t=>cl(t,e))}function je(r,e){return r==null?!1:(Array.isArray(r)?r:Array.isArray(r.roles)?r.roles:Array.isArray(r.profile?.roles)?r.profile.roles:[]).some(n=>cl(n,e))}function Dp(r){return`"${r}"`}function ll(r){return r.startsWith('"')&&r.endsWith('"')?r.replace(/(^"+)|("+$)/g,""):r}function Fp(r,e){return new or(r).serialize(e)}var H;(function(r){r.LOCALE="content-lang",r.QUERY="query",r.SCOPE="scope",r.FILTERS="filters",r.VIRTUAL_FIELD="virtual-field",r.PERIOD="period",r.VALUE_FILTERS="value-filters",r.DATE_FILTERS="date-filters",r.RANGE_FILTERS="range-filters",r.SORT="sort",r.PER_PAGE="per-page",r.KEYWORD_MATCH="keyword-match"})(H||(H={}));var Up=new Set(Object.values(H));function dl(r){return Up.has(r)}var or=class{constructor(e,t=20,n=!1,i="en-US"){this.baseUrl=e,this.defaultPerPage=t,this.allLanguagesAllowed=n,this.defaultContentLocale=i,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,t){return this.serializeToCurrentPageIfPossible(e,t??"/search")}serializeToCurrentPageIfPossible(e,t){let n=t==null||t.trim().length===0,i=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${t}`);return i.search=this.toURLSearchParams(e),i.toString()}toURLSearchParams(e,t=!1){var n,i,a,s,c,d,p,h,f,m,y;let b=new URLSearchParams;e.contentLocale?(!t||e.contentLocale!==this.defaultContentLocale)&&b.append(H.LOCALE,e.contentLocale):b.append(H.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&b.append(H.QUERY,e.query);let E=(a=(i=e.metadataFilters)===null||i===void 0?void 0:i.filter(v=>v.valueFilter&&!v.valueFilter.negative))!==null&&a!==void 0?a:[];if(E.length>0){let v=E.map(O=>{var I,k;let U=((k=(I=O.valueFilter)===null||I===void 0?void 0:I.values)!==null&&k!==void 0?k:[]).map(M=>this.escapeFilters(M)).map(M=>Dp(ll(M))).join("_");return`${O.key}~${U}`}).join("*");b.append(H.VALUE_FILTERS,v)}let C=(c=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&c!==void 0?c:[];if(C.length>0){let v=C.map(O=>{var I;return`${O.key}~${(I=O.dateFilter)===null||I===void 0?void 0:I.type.toLowerCase()}`}).join("*");b.append(H.DATE_FILTERS,v)}let w=(p=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&p!==void 0?p:[];if(w.length>0){let v=w.map(O=>{var I,k;return`${O.key}~${(I=O.rangeFilter)===null||I===void 0?void 0:I.from}_${(k=O.rangeFilter)===null||k===void 0?void 0:k.to}`}).join("*");b.append(H.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&b.append(H.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&b.append(H.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&b.append(H.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(f=e.paging)===null||f===void 0?void 0:f.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&b.append(H.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&b.append(H.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let T=(y=e.otherQueryParams)!==null&&y!==void 0?y:{};for(let v in T)b.append(v,T[v]);let S=new Array;return b.forEach((v,O)=>{S.push(this.encodeQueryString(O)+"="+this.encodeQueryString(v))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var t;let n=e.split("?"),i=this.fromURLSearchParams(n.slice(1).join("?")),a=n[0].split("/search/")[1];return a==null?i:{...i,scope:(t=this.scopeMapping[a])!==null&&t!==void 0?t:i.scope}}fromURLSearchParams(e){var t,n,i,a,s,c;try{e=decodeURI(e).replace(/%23/g,"#")}catch(w){console.warn("Could not decode search request query params, fallback on raw value",w)}let d=new URLSearchParams(e),p=d.get(H.LOCALE)==="all"?void 0:d.get(H.LOCALE),h=((t=d.get(H.VIRTUAL_FIELD))!==null&&t!==void 0?t:"EVERYWHERE").toUpperCase(),f=(n=d.get(H.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(i=d.get(H.SCOPE))!==null&&i!==void 0?i:"default",y=+((a=d.get(H.PER_PAGE))!==null&&a!==void 0?a:this.defaultPerPage),b=d.get(H.KEYWORD_MATCH),E=b?b.toUpperCase()===tr.MANDATORY?tr.MANDATORY:tr.OPTIONAL:void 0,C={};for(let w of d.keys())dl(w)||(C[w]=d.get(w));return{contentLocale:p??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(H.QUERY))!==null&&s!==void 0?s:"",scope:(c=this.scopeMapping[m])!==null&&c!==void 0?c:"DEFAULT",virtualField:Xc(h)?h:"EVERYWHERE",sortId:f,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:Be(1,isNaN(y)?this.defaultPerPage:y,1e3)},keywordMatch:E,otherQueryParams:C}}parseCompatFilters(e){var t,n,i,a,s,c;let d=[];return e.has(H.FILTERS)&&(d=this.parseValueFilters((t=e.get(H.FILTERS))!==null&&t!==void 0?t:"")),(n=e.has(H.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((i=e.get(H.PERIOD))!==null&&i!==void 0?i:"").toUpperCase())]),[...d,...this.parseValueFilters((a=e.get(H.VALUE_FILTERS))!==null&&a!==void 0?a:""),...this.parseDateFilters((s=e.get(H.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((c=e.get(H.RANGE_FILTERS))!==null&&c!==void 0?c:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(t=>t.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],valueFilter:{values:t[1].split("_").map(ll).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],dateFilter:{type:rr[t[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],rangeFilter:{from:t[1].split("_")[0],to:t[1].split("_")[1]}}))}escapeFilters(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replaceAll(t,n);return e}superEscapeFilters(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replaceAll(n,i);return e}unescapeFilterValue(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replace(i,t);return e}parseLegacyPeriodFilter(e){if(Qc(e))return[{key:"ft:lastEdition",dateFilter:{type:rr[e]}}];if(e.startsWith("CUSTOM_")){let[t,n,i]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:i}}]}return[]}};var na={};F(na,{toFtFormComponent:()=>Bp});var oa=Symbol("elementInternals"),Bp=te(Symbol("toFtFormComponent"),function(r){class e extends r{static get formAssociated(){return!0}get form(){return this[oa].form}constructor(...n){super(n),this[oa]=this.attachInternals()}setFormValue(n){this[oa].setFormValue(n)}}return e});var ia={};F(ia,{DateFormatter:()=>wt});var wt=class{static format(e,t,n,i){return window.moment?window.moment(e).locale(t).format(this.getMomentDateFormat(n,i)):this.getIntlDateTime(e,t,n,i)}static getMomentDateFormat(e,t){return e?t?"lll":"ll":t?"L LT":"L"}static getIntlDateTime(e,t,n,i){let a=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(t,{dateStyle:n?"medium":"short"}).format(a);if(!i)return s;let c=new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(a);return`${s} ${c}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),t=new Date().getTimezoneOffset();return`${t<0?"+":"-"}${e(Math.abs(t)/60)}:${e(Math.abs(t)%60)}`}};var sa={};F(sa,{ALL_KEYS_VALUE:()=>aa,SameWindowStorageEvent:()=>nr});var aa="__all__",nr=class extends CustomEvent{constructor(e,t,n){super("same-window-storage",{detail:{key:e,oldValue:t,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==aa}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new nr(t[0],n,t[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new nr(t[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(r,e,t){Reflect.apply(r,e,t),window.dispatchEvent(new nr(aa))}});var la={};F(la,{FocusMainContentEvent:()=>ca});var ca=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var ul={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function $p(r){(r.key==="Enter"||r.key===" "||r.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=r.key}function Hp(r){window.FluidTopicsA11yHints.isKeyboardNavigation=r.detail==0}document.addEventListener("keydown",$p);document.addEventListener("click",Hp);var pl=N`
|
|
48
|
+
`;var Ks={};var Ai={};F(Ai,{ParametrizedLabelResolver:()=>Hr});var Hr=class r{constructor(e,t){this.defaultLabels=e,this.labels=t}resolve(e,...t){var n,i;e=this.resolvePluralKey(e,t);let a=(i=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&i!==void 0?i:"";return r.replaceParameters(a,...t)}static replaceParameters(e,...t){return t.forEach((n,i)=>e=e.replace(new RegExp(`\\{${i}([^}]*)\\}`,"g"),(a,s)=>r.formatValue(n,s))),e}resolvePluralKey(e,t){for(let n of t)if(typeof n=="number"){let i=`${String(e)}[\\=${n}]`;if(i in this.labels||i in this.defaultLabels)return i}return e}static formatValue(e,t){return e instanceof Date?r.formatDate(e,t):e??""}static formatDate(e,t){let n=i=>t?.includes("date")?e.toLocaleDateString(i):t?.includes("time")?e.toLocaleTimeString(i):e.toLocaleString(i);try{return n(document.documentElement.lang)}catch{return n()}}};var Ji={};F(Ji,{FtCommandQueue:()=>zr,FtLitElementRedux:()=>Et,FtReduxStore:()=>We,FtStateManager:()=>Yi,ReduxWatcher:()=>Co,clearAllStores:()=>Lp,isFtReduxStore:()=>Kt,redux:()=>V,reduxEventListener:()=>qu,reduxReactive:()=>Zu,watch:()=>Np,withRedux:()=>Zs});var Zu=()=>(r,e)=>{var t;let n=r.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(t=n.reduxReactiveProperties)===null||t===void 0||t.add(e)},V=r=>{let e=r??{};return(t,n)=>{var i;let a={hasChanged:Ue,attribute:!1,...e};A(a)(t,n);let s=t.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:c=>c[n],store:e.store})}},qu=r=>(e,t)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(t,r)};var zr=class{constructor(){this.queue=[]}add(e,t=!1){t&&this.clear(e.type),this.queue.push(e)}consume(e){let t=this.queue.find(n=>n.type===e);return t&&(this.queue=this.queue.filter(n=>n!==t)),t}clear(e){typeof e=="string"?this.queue=this.queue.filter(t=>t.type!==e):this.queue=this.queue.filter(t=>!e.test(t.type))}};function Kt(r){var e;return(e=r?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Wr=Symbol("internalReduxEventsUnsubscribers"),et=Symbol("internalStoresUnsubscribers"),St=Symbol("internalStores"),Zs=te(Symbol("withRedux"),function(r){var e,t,n;class i extends r{constructor(){super(...arguments),this[e]=new Map,this[t]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(c=>s.has(c))&&this.updateFromStores()}getUnnamedStore(){if(this[St].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[St].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[St].get(s)}addStore(s,c){var d;c=(d=c??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(c),this[St].set(c,s),this.subscribeToStore(c,s),this.updateFromStores()}removeStore(s){let c=typeof s=="string"?s:s.name;this.unsubscribeFromStore(c),this[St].delete(c)}setupStores(){this.unsubscribeFromStores(),this[St].forEach((s,c)=>this.subscribeToStore(c,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,c)=>{let d=this.constructor.getPropertyOptions(c);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:c)){let p=this.getStore(s.store);p&&(s.store?this[et].has(s.store):this[et].size>0)&&(this[c]=s.selector(p.getState(),this))}})}subscribeToStore(s,c){var d;this[et].set(s,c.subscribe(()=>this.updateFromStores())),this[Wr].set(s,[]),Kt(c)&&c.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||c.name===p.store)){let f=m=>this[h](m);c.addEventListener(p.eventName,f),this[Wr].get(s).push(()=>c.removeEventListener(p.eventName,f))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[et].forEach((s,c)=>this.unsubscribeFromStore(c))}unsubscribeFromStore(s){var c;this[et].has(s)&&this[et].get(s)(),this[et].delete(s),(c=this[Wr].get(s))===null||c===void 0||c.forEach(d=>d()),this[Wr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=et,t=St,n=Wr,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Et=class extends Zs(q){};function be(r){for(var e=arguments.length,t=Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(0)var i,a;throw Error("[Immer] minified error nr: "+r+(t.length?" "+t.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ze(r){return!!r&&!!r[K]}function Ce(r){var e;return!!r&&(function(t){if(!t||typeof t!="object")return!1;var n=Object.getPrototypeOf(t);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===op}(r)||Array.isArray(r)||!!r[tc]||!!(!((e=r.constructor)===null||e===void 0)&&e[tc])||Mi(r)||Di(r))}function Ot(r,e,t){t===void 0&&(t=!1),Yt(r)===0?(t?Object.keys:qt)(r).forEach(function(n){t&&typeof n=="symbol"||e(n,r[n],r)}):r.forEach(function(n,i){return e(i,n,r)})}function Yt(r){var e=r[K];return e?e.i>3?e.i-4:e.i:Array.isArray(r)?1:Mi(r)?2:Di(r)?3:0}function Zt(r,e){return Yt(r)===2?r.has(e):Object.prototype.hasOwnProperty.call(r,e)}function Yu(r,e){return Yt(r)===2?r.get(e):r[e]}function rc(r,e,t){var n=Yt(r);n===2?r.set(e,t):n===3?r.add(t):r[e]=t}function oc(r,e){return r===e?r!==0||1/r==1/e:r!=r&&e!=e}function Mi(r){return tp&&r instanceof Map}function Di(r){return rp&&r instanceof Set}function tt(r){return r.o||r.t}function Fi(r){if(Array.isArray(r))return Array.prototype.slice.call(r);var e=ac(r);delete e[K];for(var t=qt(e),n=0;n<t.length;n++){var i=t[n],a=e[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(e[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:r[i]})}return Object.create(Object.getPrototypeOf(r),e)}function Ui(r,e){return e===void 0&&(e=!1),Bi(r)||ze(r)||!Ce(r)||(Yt(r)>1&&(r.set=r.add=r.clear=r.delete=Ju),Object.freeze(r),e&&Ot(r,function(t,n){return Ui(n,!0)},!0)),r}function Ju(){be(2)}function Bi(r){return r==null||typeof r!="object"||Object.isFrozen(r)}function Ne(r){var e=ki[r];return e||be(18,r),e}function Xu(r,e){ki[r]||(ki[r]=e)}function Pi(){return Gr}function Ri(r,e){e&&(Ne("Patches"),r.u=[],r.s=[],r.v=e)}function vo(r){Li(r),r.p.forEach(Qu),r.p=null}function Li(r){r===Gr&&(Gr=r.l)}function qs(r){return Gr={p:[],l:Gr,h:r,m:!0,_:0}}function Qu(r){var e=r[K];e.i===0||e.i===1?e.j():e.g=!0}function Ti(r,e){e._=e.p.length;var t=e.p[0],n=r!==void 0&&r!==t;return e.h.O||Ne("ES5").S(e,r,n),n?(t[K].P&&(vo(e),be(4)),Ce(r)&&(r=xo(e,r),e.l||So(e,r)),e.u&&Ne("Patches").M(t[K].t,r,e.u,e.s)):r=xo(e,t,[]),vo(e),e.u&&e.v(e.u,e.s),r!==ic?r:void 0}function xo(r,e,t){if(Bi(e))return e;var n=e[K];if(!n)return Ot(e,function(c,d){return Ys(r,n,e,c,d,t)},!0),e;if(n.A!==r)return e;if(!n.P)return So(r,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Fi(n.k):n.o,a=i,s=!1;n.i===3&&(a=new Set(i),i.clear(),s=!0),Ot(a,function(c,d){return Ys(r,n,i,c,d,t,s)}),So(r,i,!1),t&&r.u&&Ne("Patches").N(n,t,r.u,r.s)}return n.o}function Ys(r,e,t,n,i,a,s){if(ze(i)){var c=xo(r,i,a&&e&&e.i!==3&&!Zt(e.R,n)?a.concat(n):void 0);if(rc(t,n,c),!ze(c))return;r.m=!1}else s&&t.add(i);if(Ce(i)&&!Bi(i)){if(!r.h.D&&r._<1)return;xo(r,i),e&&e.A.l||So(r,i)}}function So(r,e,t){t===void 0&&(t=!1),!r.l&&r.h.D&&r.m&&Ui(e,t)}function Ii(r,e){var t=r[K];return(t?tt(t):r)[e]}function Js(r,e){if(e in r)for(var t=Object.getPrototypeOf(r);t;){var n=Object.getOwnPropertyDescriptor(t,e);if(n)return n;t=Object.getPrototypeOf(t)}}function rt(r){r.P||(r.P=!0,r.l&&rt(r.l))}function _i(r){r.o||(r.o=Fi(r.t))}function Ni(r,e,t){var n=Mi(e)?Ne("MapSet").F(e,t):Di(e)?Ne("MapSet").T(e,t):r.O?function(i,a){var s=Array.isArray(i),c={i:s?1:0,A:a?a.A:Pi(),P:!1,I:!1,R:{},l:a,t:i,k:null,o:null,j:null,C:!1},d=c,p=Vr;s&&(d=[c],p=jr);var h=Proxy.revocable(d,p),f=h.revoke,m=h.proxy;return c.k=m,c.j=f,m}(e,t):Ne("ES5").J(e,t);return(t?t.A:Pi()).p.push(n),n}function ep(r){return ze(r)||be(22,r),function e(t){if(!Ce(t))return t;var n,i=t[K],a=Yt(t);if(i){if(!i.P&&(i.i<4||!Ne("ES5").K(i)))return i.t;i.I=!0,n=Xs(t,a),i.I=!1}else n=Xs(t,a);return Ot(n,function(s,c){i&&Yu(i.t,s)===c||rc(n,s,e(c))}),a===3?new Set(n):n}(r)}function Xs(r,e){switch(e){case 2:return new Map(r);case 3:return Array.from(r)}return Fi(r)}function nc(){function r(s,c){var d=a[s];return d?d.enumerable=c:a[s]=d={configurable:!0,enumerable:c,get:function(){var p=this[K];return Vr.get(p,s)},set:function(p){var h=this[K];Vr.set(h,s,p)}},d}function e(s){for(var c=s.length-1;c>=0;c--){var d=s[c][K];if(!d.P)switch(d.i){case 5:n(d)&&rt(d);break;case 4:t(d)&&rt(d)}}}function t(s){for(var c=s.t,d=s.k,p=qt(d),h=p.length-1;h>=0;h--){var f=p[h];if(f!==K){var m=c[f];if(m===void 0&&!Zt(c,f))return!0;var y=d[f],b=y&&y[K];if(b?b.t!==m:!oc(y,m))return!0}}var E=!!c[K];return p.length!==qt(c).length+(E?0:1)}function n(s){var c=s.k;if(c.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(c,c.length-1);if(d&&!d.get)return!0;for(var p=0;p<c.length;p++)if(!c.hasOwnProperty(p))return!0;return!1}function i(s){s.g&&be(3,JSON.stringify(tt(s)))}var a={};Xu("ES5",{J:function(s,c){var d=Array.isArray(s),p=function(f,m){if(f){for(var y=Array(m.length),b=0;b<m.length;b++)Object.defineProperty(y,""+b,r(b,!0));return y}var E=ac(m);delete E[K];for(var C=qt(E),w=0;w<C.length;w++){var T=C[w];E[T]=r(T,f||!!E[T].enumerable)}return Object.create(Object.getPrototypeOf(m),E)}(d,s),h={i:d?5:4,A:c?c.A:Pi(),P:!1,I:!1,R:{},l:c,t:s,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,K,{value:h,writable:!0}),p},S:function(s,c,d){d?ze(c)&&c[K].A===s&&e(s.p):(s.u&&function p(h){if(h&&typeof h=="object"){var f=h[K];if(f){var m=f.t,y=f.k,b=f.R,E=f.i;if(E===4)Ot(y,function(v){v!==K&&(m[v]!==void 0||Zt(m,v)?b[v]||p(y[v]):(b[v]=!0,rt(f)))}),Ot(m,function(v){y[v]!==void 0||Zt(y,v)||(b[v]=!1,rt(f))});else if(E===5){if(n(f)&&(rt(f),b.length=!0),y.length<m.length)for(var C=y.length;C<m.length;C++)b[C]=!1;else for(var w=m.length;w<y.length;w++)b[w]=!0;for(var T=Math.min(y.length,m.length),S=0;S<T;S++)y.hasOwnProperty(S)||(b[S]=!0),b[S]===void 0&&p(y[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?t(s):n(s)}})}var Qs,Gr,$i=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",tp=typeof Map<"u",rp=typeof Set<"u",ec=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",ic=$i?Symbol.for("immer-nothing"):((Qs={})["immer-nothing"]=!0,Qs),tc=$i?Symbol.for("immer-draftable"):"__$immer_draftable",K=$i?Symbol.for("immer-state"):"__$immer_state";var op=""+Object.prototype.constructor,qt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(r){return Object.getOwnPropertyNames(r).concat(Object.getOwnPropertySymbols(r))}:Object.getOwnPropertyNames,ac=Object.getOwnPropertyDescriptors||function(r){var e={};return qt(r).forEach(function(t){e[t]=Object.getOwnPropertyDescriptor(r,t)}),e},ki={},Vr={get:function(r,e){if(e===K)return r;var t=tt(r);if(!Zt(t,e))return function(i,a,s){var c,d=Js(a,s);return d?"value"in d?d.value:(c=d.get)===null||c===void 0?void 0:c.call(i.k):void 0}(r,t,e);var n=t[e];return r.I||!Ce(n)?n:n===Ii(r.t,e)?(_i(r),r.o[e]=Ni(r.A.h,n,r)):n},has:function(r,e){return e in tt(r)},ownKeys:function(r){return Reflect.ownKeys(tt(r))},set:function(r,e,t){var n=Js(tt(r),e);if(n?.set)return n.set.call(r.k,t),!0;if(!r.P){var i=Ii(tt(r),e),a=i?.[K];if(a&&a.t===t)return r.o[e]=t,r.R[e]=!1,!0;if(oc(t,i)&&(t!==void 0||Zt(r.t,e)))return!0;_i(r),rt(r)}return r.o[e]===t&&(t!==void 0||e in r.o)||Number.isNaN(t)&&Number.isNaN(r.o[e])||(r.o[e]=t,r.R[e]=!0),!0},deleteProperty:function(r,e){return Ii(r.t,e)!==void 0||e in r.t?(r.R[e]=!1,_i(r),rt(r)):delete r.R[e],r.o&&delete r.o[e],!0},getOwnPropertyDescriptor:function(r,e){var t=tt(r),n=Reflect.getOwnPropertyDescriptor(t,e);return n&&{writable:!0,configurable:r.i!==1||e!=="length",enumerable:n.enumerable,value:t[e]}},defineProperty:function(){be(11)},getPrototypeOf:function(r){return Object.getPrototypeOf(r.t)},setPrototypeOf:function(){be(12)}},jr={};Ot(Vr,function(r,e){jr[r]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),jr.deleteProperty=function(r,e){return jr.set.call(this,r,e,void 0)},jr.set=function(r,e,t){return Vr.set.call(this,r[0],e,t,r[0])};var np=function(){function r(t){var n=this;this.O=ec,this.D=!0,this.produce=function(i,a,s){if(typeof i=="function"&&typeof a!="function"){var c=a;a=i;var d=n;return function(E){var C=this;E===void 0&&(E=c);for(var w=arguments.length,T=Array(w>1?w-1:0),S=1;S<w;S++)T[S-1]=arguments[S];return d.produce(E,function(v){var O;return(O=a).call.apply(O,[C,v].concat(T))})}}var p;if(typeof a!="function"&&be(6),s!==void 0&&typeof s!="function"&&be(7),Ce(i)){var h=qs(n),f=Ni(n,i,void 0),m=!0;try{p=a(f),m=!1}finally{m?vo(h):Li(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(E){return Ri(h,s),Ti(E,h)},function(E){throw vo(h),E}):(Ri(h,s),Ti(p,h))}if(!i||typeof i!="object"){if((p=a(i))===void 0&&(p=i),p===ic&&(p=void 0),n.D&&Ui(p,!0),s){var y=[],b=[];Ne("Patches").M(i,p,y,b),s(y,b)}return p}be(21,i)},this.produceWithPatches=function(i,a){if(typeof i=="function")return function(p){for(var h=arguments.length,f=Array(h>1?h-1:0),m=1;m<h;m++)f[m-1]=arguments[m];return n.produceWithPatches(p,function(y){return i.apply(void 0,[y].concat(f))})};var s,c,d=n.produce(i,a,function(p,h){s=p,c=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(p){return[p,s,c]}):[d,s,c]},typeof t?.useProxies=="boolean"&&this.setUseProxies(t.useProxies),typeof t?.autoFreeze=="boolean"&&this.setAutoFreeze(t.autoFreeze)}var e=r.prototype;return e.createDraft=function(t){Ce(t)||be(8),ze(t)&&(t=ep(t));var n=qs(this),i=Ni(this,t,void 0);return i[K].C=!0,Li(n),i},e.finishDraft=function(t,n){var i=t&&t[K],a=i.A;return Ri(a,n),Ti(void 0,a)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!ec&&be(20),this.O=t},e.applyPatches=function(t,n){var i;for(i=n.length-1;i>=0;i--){var a=n[i];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}i>-1&&(n=n.slice(i+1));var s=Ne("Patches").$;return ze(t)?s(t,n):this.produce(t,function(c){return s(c,n)})},r}(),fe=new np,ip=fe.produce,zb=fe.produceWithPatches.bind(fe),Wb=fe.setAutoFreeze.bind(fe),jb=fe.setUseProxies.bind(fe),Gb=fe.applyPatches.bind(fe),Vb=fe.createDraft.bind(fe),Kb=fe.finishDraft.bind(fe),Eo=ip;function Ct(r){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(r)}function sc(r,e){if(Ct(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function cc(r){var e=sc(r,"string");return Ct(e)=="symbol"?e:e+""}function lc(r,e,t){return(e=cc(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function dc(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Hi(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dc(Object(t),!0).forEach(function(n){lc(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):dc(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function ae(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var uc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),zi=function(){return Math.random().toString(36).substring(7).split("").join(".")},Oo={INIT:"@@redux/INIT"+zi(),REPLACE:"@@redux/REPLACE"+zi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+zi()}};function ap(r){if(typeof r!="object"||r===null)return!1;for(var e=r;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(r)===e}function Wi(r,e,t){var n;if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(ae(1));return t(Wi)(r,e)}if(typeof r!="function")throw new Error(ae(2));var i=r,a=e,s=[],c=s,d=!1;function p(){c===s&&(c=s.slice())}function h(){if(d)throw new Error(ae(3));return a}function f(E){if(typeof E!="function")throw new Error(ae(4));if(d)throw new Error(ae(5));var C=!0;return p(),c.push(E),function(){if(C){if(d)throw new Error(ae(6));C=!1,p();var T=c.indexOf(E);c.splice(T,1),s=null}}}function m(E){if(!ap(E))throw new Error(ae(7));if(typeof E.type>"u")throw new Error(ae(8));if(d)throw new Error(ae(9));try{d=!0,a=i(a,E)}finally{d=!1}for(var C=s=c,w=0;w<C.length;w++){var T=C[w];T()}return E}function y(E){if(typeof E!="function")throw new Error(ae(10));i=E,m({type:Oo.REPLACE})}function b(){var E,C=f;return E={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(ae(11));function S(){T.next&&T.next(h())}S();var v=C(S);return{unsubscribe:v}}},E[uc]=function(){return this},E}return m({type:Oo.INIT}),n={dispatch:m,subscribe:f,getState:h,replaceReducer:y},n[uc]=b,n}function sp(r){Object.keys(r).forEach(function(e){var t=r[e],n=t(void 0,{type:Oo.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof t(void 0,{type:Oo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function pc(r){for(var e=Object.keys(r),t={},n=0;n<e.length;n++){var i=e[n];typeof r[i]=="function"&&(t[i]=r[i])}var a=Object.keys(t),s,c;try{sp(t)}catch(d){c=d}return function(p,h){if(p===void 0&&(p={}),c)throw c;if(0)var f;for(var m=!1,y={},b=0;b<a.length;b++){var E=a[b],C=t[E],w=p[E],T=C(w,h);if(typeof T>"u"){var S=h&&h.type;throw new Error(ae(14))}y[E]=T,m=m||T!==w}return m=m||a.length!==Object.keys(p).length,m?y:p}}function Jt(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function fc(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(n){return function(){var i=n.apply(void 0,arguments),a=function(){throw new Error(ae(15))},s={getState:i.getState,dispatch:function(){return a.apply(void 0,arguments)}},c=e.map(function(d){return d(s)});return a=Jt.apply(void 0,c)(i.dispatch),Hi(Hi({},i),{},{dispatch:a})}}}function hc(r){var e=function(n){var i=n.dispatch,a=n.getState;return function(s){return function(c){return typeof c=="function"?c(i,a,r):s(c)}}};return e}var mc=hc();mc.withExtraArgument=hc;var ji=mc;var xc=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},r(e,t)};return function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}}(),cp=function(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(p){return function(h){return d([p,h])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=1,i&&(a=p[0]&2?i.return:p[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,p[1])).done)return a;switch(i=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,i=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(r,t)}catch(h){p=[6,h],i=0}finally{n=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Xt=function(r,e){for(var t=0,n=e.length,i=r.length;t<n;t++,i++)r[i]=e[t];return r},lp=Object.defineProperty,dp=Object.defineProperties,up=Object.getOwnPropertyDescriptors,gc=Object.getOwnPropertySymbols,pp=Object.prototype.hasOwnProperty,fp=Object.prototype.propertyIsEnumerable,yc=function(r,e,t){return e in r?lp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t},ot=function(r,e){for(var t in e||(e={}))pp.call(e,t)&&yc(r,t,e[t]);if(gc)for(var n=0,i=gc(e);n<i.length;n++){var t=i[n];fp.call(e,t)&&yc(r,t,e[t])}return r},Gi=function(r,e){return dp(r,up(e))},hp=function(r,e,t){return new Promise(function(n,i){var a=function(d){try{c(t.next(d))}catch(p){i(p)}},s=function(d){try{c(t.throw(d))}catch(p){i(p)}},c=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(a,s)};c((t=t.apply(r,e)).next())})};var mp=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Jt:Jt.apply(null,arguments)},uv=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(r){return r}};function gp(r){if(typeof r!="object"||r===null)return!1;var e=Object.getPrototypeOf(r);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}var yp=function(r){xc(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,t)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,Xt([void 0],t[0].concat(this)))):new(e.bind.apply(e,Xt([void 0],t.concat(this))))},e}(Array),bp=function(r){xc(e,r);function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r.apply(this,t)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return r.prototype.concat.apply(this,t)},e.prototype.prepend=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return t.length===1&&Array.isArray(t[0])?new(e.bind.apply(e,Xt([void 0],t[0].concat(this)))):new(e.bind.apply(e,Xt([void 0],t.concat(this))))},e}(Array);function Zi(r){return Ce(r)?Eo(r,function(){}):r}function vp(r){return typeof r=="boolean"}function xp(){return function(e){return Sp(e)}}function Sp(r){r===void 0&&(r={});var e=r.thunk,t=e===void 0?!0:e,n=r.immutableCheck,i=n===void 0?!0:n,a=r.serializableCheck,s=a===void 0?!0:a,c=new yp;if(t&&(vp(t)?c.push(ji):c.push(ji.withExtraArgument(t.extraArgument))),0){if(i)var d;if(s)var p}return c}var Vi=!0;function Sc(r){var e=xp(),t=r||{},n=t.reducer,i=n===void 0?void 0:n,a=t.middleware,s=a===void 0?e():a,c=t.devTools,d=c===void 0?!0:c,p=t.preloadedState,h=p===void 0?void 0:p,f=t.enhancers,m=f===void 0?void 0:f,y;if(typeof i=="function")y=i;else if(gp(i))y=pc(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var b=s;if(typeof b=="function"&&(b=b(e),!Vi&&!Array.isArray(b)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Vi&&b.some(function(v){return typeof v!="function"}))throw new Error("each middleware provided to configureStore must be a function");var E=fc.apply(void 0,b),C=Jt;d&&(C=mp(ot({trace:!Vi},typeof d=="object"&&d)));var w=new bp(E),T=w;Array.isArray(m)?T=Xt([E],m):typeof m=="function"&&(T=m(w));var S=C.apply(void 0,T);return Wi(y,h,S)}function nt(r,e){function t(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var a=e.apply(void 0,n);if(!a)throw new Error("prepareAction did not return an object");return ot(ot({type:r,payload:a.payload},"meta"in a&&{meta:a.meta}),"error"in a&&{error:a.error})}return{type:r,payload:n[0]}}return t.toString=function(){return""+r},t.type=r,t.match=function(n){return n.type===r},t}function Ec(r){var e={},t=[],n,i={addCase:function(a,s){var c=typeof a=="string"?a:a.type;if(c in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[c]=s,i},addMatcher:function(a,s){return t.push({matcher:a,reducer:s}),i},addDefaultCase:function(a){return n=a,i}};return r(i),[e,t,n]}function Ep(r){return typeof r=="function"}function Op(r,e,t,n){t===void 0&&(t=[]);var i=typeof e=="function"?Ec(e):[e,t,n],a=i[0],s=i[1],c=i[2],d;if(Ep(r))d=function(){return Zi(r())};else{var p=Zi(r);d=function(){return p}}function h(f,m){f===void 0&&(f=d());var y=Xt([a[m.type]],s.filter(function(b){var E=b.matcher;return E(m)}).map(function(b){var E=b.reducer;return E}));return y.filter(function(b){return!!b}).length===0&&(y=[c]),y.reduce(function(b,E){if(E)if(ze(b)){var C=b,w=E(C,m);return w===void 0?b:w}else{if(Ce(b))return Eo(b,function(T){return E(T,m)});var w=E(b,m);if(w===void 0){if(b===null)return b;throw Error("A case reducer on a non-draftable value must not return undefined")}return w}return b},f)}return h.getInitialState=d,h}function Cp(r,e){return r+"/"+e}function Oc(r){var e=r.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var t=typeof r.initialState=="function"?r.initialState:Zi(r.initialState),n=r.reducers||{},i=Object.keys(n),a={},s={},c={};i.forEach(function(h){var f=n[h],m=Cp(e,h),y,b;"reducer"in f?(y=f.reducer,b=f.prepare):y=f,a[h]=y,s[m]=y,c[h]=b?nt(m,b):nt(m)});function d(){var h=typeof r.extraReducers=="function"?Ec(r.extraReducers):[r.extraReducers],f=h[0],m=f===void 0?{}:f,y=h[1],b=y===void 0?[]:y,E=h[2],C=E===void 0?void 0:E,w=ot(ot({},m),s);return Op(t,function(T){for(var S in w)T.addCase(S,w[S]);for(var v=0,O=b;v<O.length;v++){var I=O[v];T.addMatcher(I.matcher,I.reducer)}C&&T.addDefaultCase(C)})}var p;return{name:e,reducer:function(h,f){return p||(p=d()),p(h,f)},actions:c,caseReducers:a,getInitialState:function(){return p||(p=d()),p.getInitialState()}}}var wp="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ap=function(r){r===void 0&&(r=21);for(var e="",t=r;t--;)e+=wp[Math.random()*64|0];return e},Rp=["name","message","stack","code"],Ki=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),bc=function(){function r(e,t){this.payload=e,this.meta=t}return r}(),Tp=function(r){if(typeof r=="object"&&r!==null){for(var e={},t=0,n=Rp;t<n.length;t++){var i=n[t];typeof r[i]=="string"&&(e[i]=r[i])}return e}return{message:String(r)}},mv=function(){function r(e,t,n){var i=nt(e+"/fulfilled",function(h,f,m,y){return{payload:h,meta:Gi(ot({},y||{}),{arg:m,requestId:f,requestStatus:"fulfilled"})}}),a=nt(e+"/pending",function(h,f,m){return{payload:void 0,meta:Gi(ot({},m||{}),{arg:f,requestId:h,requestStatus:"pending"})}}),s=nt(e+"/rejected",function(h,f,m,y,b){return{payload:y,error:(n&&n.serializeError||Tp)(h||"Rejected"),meta:Gi(ot({},b||{}),{arg:m,requestId:f,rejectedWithValue:!!y,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),c=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(f,m,y){var b=n?.idGenerator?n.idGenerator(h):Ap(),E=new d,C,w=!1;function T(v){C=v,E.abort()}var S=function(){return hp(this,null,function(){var v,O,I,k,U,M,P;return cp(this,function(g){switch(g.label){case 0:return g.trys.push([0,4,,5]),k=(v=n?.condition)==null?void 0:v.call(n,h,{getState:m,extra:y}),_p(k)?[4,k]:[3,2];case 1:k=g.sent(),g.label=2;case 2:if(k===!1||E.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=!0,U=new Promise(function(x,_){return E.signal.addEventListener("abort",function(){return _({name:"AbortError",message:C||"Aborted"})})}),f(a(b,h,(O=n?.getPendingMeta)==null?void 0:O.call(n,{requestId:b,arg:h},{getState:m,extra:y}))),[4,Promise.race([U,Promise.resolve(t(h,{dispatch:f,getState:m,extra:y,requestId:b,signal:E.signal,abort:T,rejectWithValue:function(x,_){return new Ki(x,_)},fulfillWithValue:function(x,_){return new bc(x,_)}})).then(function(x){if(x instanceof Ki)throw x;return x instanceof bc?i(x.payload,b,h,x.meta):i(x,b,h)})])];case 3:return I=g.sent(),[3,5];case 4:return M=g.sent(),I=M instanceof Ki?s(null,b,h,M.payload,M.meta):s(M,b,h),[3,5];case 5:return P=n&&!n.dispatchConditionRejection&&s.match(I)&&I.meta.condition,P||f(I),[2,I]}})})}();return Object.assign(S,{abort:T,requestId:b,arg:h,unwrap:function(){return S.then(Ip)}})}}return Object.assign(p,{pending:a,rejected:s,fulfilled:i,typePrefix:e})}return r.withTypes=function(){return r},r}();function Ip(r){if(r.meta&&r.meta.rejectedWithValue)throw r.payload;if(r.error)throw r.error;return r.payload}function _p(r){return r!==null&&typeof r=="object"&&typeof r.then=="function"}var Cc="listener",wc="completed",Ac="cancelled",gv="task-"+Ac,yv="task-"+wc,bv=Cc+"-"+Ac,vv=Cc+"-"+wc;var qi="listenerMiddleware";var xv=nt(qi+"/add"),Sv=nt(qi+"/removeAll"),Ev=nt(qi+"/remove");var vc,Ov=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(r){return(vc||(vc=Promise.resolve())).then(r).catch(function(e){return setTimeout(function(){throw e},0)})},Pp=function(r){return function(e){setTimeout(e,r)}},Cv=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pp(10);nc();window.ftReduxStores||(window.ftReduxStores={});var We=class r extends $e{static get(e){var t;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,a=window.ftReduxStores[n];if(Kt(a))return a;if(i==null)return;let s=Oc({...i,reducers:(t=i.reducers)!==null&&t!==void 0?t:{}}),c=Sc({reducer:(d,p)=>{if(p.type==="CLEAR_FT_REDUX_STORE"){let h=ft(s.getInitialState());for(let f of p.keeping)h[f]=(d??h)[f];return h}else if(typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...p.overwrites};return s.reducer(d,p)}});return window.ftReduxStores[i.name]=new r(s,c,i.eventBus)}constructor(e,t,n){super(),this.reduxSlice=e,this.reduxStore=t,this.isFtReduxStore=!0,this.commands=new zr;let i=a=>a!=null?JSON.parse(JSON.stringify(a)):a;this.actions=new Proxy(this.reduxSlice.actions,{get:(a,s,c)=>{let d=s,p=a[d];return p?(...h)=>{let f=p(...h.map(i));return this.reduxStore.dispatch(f),f}:h=>{this.setState({[d]: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()}};function Lp(){var r;for(let e of Object.values((r=window.ftReduxStores)!==null&&r!==void 0?r:{}))Kt(e)&&e.clear()}var Co=class{constructor(e,t,n){this.store=e,this.valueSelector=t,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),t=this.valueSelector(e);Ue(this.lastValue,t)&&(this.callback(t,e),this.lastValue=t)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function Np(r,e,t){return new Co(r,e,t).watch()}var Yi=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var t;return(t=this.requestConsumers.get(e))!==null&&t!==void 0?t:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,t){for(let n of t)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var ea={};F(ea,{scrollHelper:()=>Qt});var Xi,wo=new Map,Qi=class{lock(e,t){if(t){let n=wo.get(t);if(n==null||n===e)return wo.set(t,e),t}}release(e,t){t&&wo.get(t)===e&&wo.delete(t)}findFirstScrollableParent(e){var t;let n,i;for(let a of On(e)){let s=a,c=this.elementCanScroll(s);if(c&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else c&&i==null&&(i=s)}return(t=n??i)!==null&&t!==void 0?t:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,t){var n,i;let a=0;for(;t&&t.offsetParent!==e.offsetParent;)a+=(n=t.offsetTop)!==null&&n!==void 0?n:0,t=t.offsetParent;return a+((i=t?.offsetTop)!==null&&i!==void 0?i:0)-e.offsetTop}computeTopOffsetRatio(e,t){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return t;default:return 0}}scrollIntoViewIfPossible(e,t){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let i=this.getAbsoluteScrollOffset(n,e),a=i-n.clientHeight+e.clientHeight,s=i,c=Be(0,(s-n.scrollTop)/(s-a),1),d=this.computeTopOffsetRatio(t?.position,c)*(a-s)+s;n.scrollTo({behavior:t?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(Xi=window.FluidTopicsScrollHelper)!==null&&Xi!==void 0?Xi:new Qi;var Qt=window.FluidTopicsScrollHelper;var ra={};F(ra,{SearchPlaceConverter:()=>or,SearchPlaceQueryParams:()=>H,isSearchPlaceQueryParams:()=>dl,serializeRequest:()=>Fp});var Mp=Ql(Tc(),1);var Ic;(function(r){r.black="black",r.green="green",r.blue="blue",r.purple="purple",r.red="red",r.orange="orange",r.yellow="yellow"})(Ic||(Ic={}));var _c;(function(r){r.OFFICIAL="OFFICIAL",r.PERSONAL="PERSONAL",r.SHARED="SHARED"})(_c||(_c={}));var Pc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(Pc||(Pc={}));var Lc;(function(r){r.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",r.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",r.PERSONAL_BOOK="PERSONAL_BOOK",r.ATTACHMENT="ATTACHMENT",r.RESOURCE="RESOURCE",r.HTML_PACKAGE="HTML_PACKAGE"})(Lc||(Lc={}));var Nc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(Nc||(Nc={}));var kc;(function(r){r.VALUE="VALUE",r.DATE="DATE",r.RANGE="RANGE"})(kc||(kc={}));var Mc;(function(r){r.BOOKMARK__CREATE="BOOKMARK__CREATE",r.BOOKMARK__DELETE="BOOKMARK__DELETE",r.CASE_DEFLECTION__START="CASE_DEFLECTION__START",r.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",r.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",r.CHATBOT__RATE="CHATBOT__RATE",r.COLLECTION__CREATE="COLLECTION__CREATE",r.COLLECTION__UPDATE="COLLECTION__UPDATE",r.COLLECTION__DELETE="COLLECTION__DELETE",r.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",r.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",r.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",r.DOCUMENT__PRINT="DOCUMENT__PRINT",r.DOCUMENT__PROCESS="DOCUMENT__PROCESS",r.DOCUMENT__RATE="DOCUMENT__RATE",r.DOCUMENT__SEARCH="DOCUMENT__SEARCH",r.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",r.DOCUMENT__UNRATE="DOCUMENT__UNRATE",r.FEEDBACK__SEND="FEEDBACK__SEND",r.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",r.AI__RATE="AI__RATE",r.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",r.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",r.KHUB__PROCESS="KHUB__PROCESS",r.KHUB__SEARCH="KHUB__SEARCH",r.LABELS__DOWNLOAD="LABELS__DOWNLOAD",r.LINK__SHARE="LINK__SHARE",r.PAGE__DISPLAY="PAGE__DISPLAY",r.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",r.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",r.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",r.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",r.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",r.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",r.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",r.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",r.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",r.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",r.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",r.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",r.TOPIC__RATE="TOPIC__RATE",r.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",r.TOPIC__UNRATE="TOPIC__UNRATE",r.USER__LOGIN="USER__LOGIN",r.USER__LOGOUT="USER__LOGOUT",r.HEARTBEAT="HEARTBEAT"})(Mc||(Mc={}));var Dc;(function(r){r.THIRD_PARTY="THIRD_PARTY",r.OFF_THE_GRID="OFF_THE_GRID",r.CONTENT_PACKAGER="CONTENT_PACKAGER",r.PAGES="PAGES",r.DESIGNED_READER="DESIGNED_READER"})(Dc||(Dc={}));var Fc;(function(r){r.HOMEPAGE="HOMEPAGE",r.CUSTOM="CUSTOM",r.HEADER="HEADER",r.READER="READER",r.TOPIC_TEMPLATE="TOPIC_TEMPLATE",r.SEARCH="SEARCH",r.SEARCH_RESULT="SEARCH_RESULT",r.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",r.LINK_PREVIEW="LINK_PREVIEW",r.UD_VIEWER="UD_VIEWER",r.ASSET_VIEWER="ASSET_VIEWER"})(Fc||(Fc={}));var Uc;(function(r){r.CLASSIC="CLASSIC",r.CUSTOM="CUSTOM",r.DESIGNER="DESIGNER"})(Uc||(Uc={}));var Bc;(function(r){r.AND="AND",r.OR="OR",r.MONOVALUED="MONOVALUED"})(Bc||(Bc={}));var $c;(function(r){r.NONE="NONE",r.ALPHABET="ALPHABET",r.VERSION="VERSION"})($c||($c={}));var Hc;(function(r){r.STARS="STARS",r.LIKE="LIKE",r.DICHOTOMOUS="DICHOTOMOUS",r.NO_RATING="NO_RATING"})(Hc||(Hc={}));var zc;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR",r.CUSTOM="CUSTOM"})(zc||(zc={}));var tr;(function(r){r.OPTIONAL="OPTIONAL",r.MANDATORY="MANDATORY"})(tr||(tr={}));var Wc;(function(r){r.ASC="ASC",r.DESC="DESC"})(Wc||(Wc={}));var jc;(function(r){r.ALPHA="ALPHA",r.NATURAL="NATURAL"})(jc||(jc={}));var ta;(function(r){r.EVERYWHERE="EVERYWHERE",r.TITLE_ONLY="TITLE_ONLY",r.NONE="NONE"})(ta||(ta={}));var Xc=r=>Object.keys(ta).includes(r);var Gc;(function(r){r.ARTICLE="ARTICLE",r.BOOK="BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(Gc||(Gc={}));var Vc;(function(r){r.FLUIDTOPICS="FLUIDTOPICS",r.EXTERNAL="EXTERNAL"})(Vc||(Vc={}));var Kc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.PERSONAL_BOOK="PERSONAL_BOOK",r.SHARED_BOOK="SHARED_BOOK",r.HTML_PACKAGE="HTML_PACKAGE"})(Kc||(Kc={}));var rr;(function(r){r.LAST_WEEK="LAST_WEEK",r.LAST_MONTH="LAST_MONTH",r.LAST_QUARTER="LAST_QUARTER",r.LAST_YEAR="LAST_YEAR"})(rr||(rr={}));var Qc=r=>Object.keys(rr).includes(r);var Zc;(function(r){r.MAP="MAP",r.DOCUMENT="DOCUMENT",r.TOPIC="TOPIC",r.HTML_PACKAGE="HTML_PACKAGE",r.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Zc||(Zc={}));var qc;(function(r){r.DEFAULT="DEFAULT",r.DOCUMENTS="DOCUMENTS",r.ALL_TOPICS="ALL_TOPICS",r.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(qc||(qc={}));var Yc;(function(r){r.PLAIN_TEXT="PLAIN_TEXT",r.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",r.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Yc||(Yc={}));var W;(function(r){r.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",r.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",r.HTML_EXPORT_USER="HTML_EXPORT_USER",r.PDF_EXPORT_USER="PDF_EXPORT_USER",r.SAVED_SEARCH_USER="SAVED_SEARCH_USER",r.COLLECTION_USER="COLLECTION_USER",r.OFFLINE_USER="OFFLINE_USER",r.ANALYTICS_USER="ANALYTICS_USER",r.BETA_USER="BETA_USER",r.DEBUG_USER="DEBUG_USER",r.PRINT_USER="PRINT_USER",r.RATING_USER="RATING_USER",r.FEEDBACK_USER="FEEDBACK_USER",r.GENERATIVE_AI_USER="GENERATIVE_AI_USER",r.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",r.CONTENT_PUBLISHER="CONTENT_PUBLISHER",r.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",r.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",r.KHUB_ADMIN="KHUB_ADMIN",r.USERS_ADMIN="USERS_ADMIN",r.PORTAL_ADMIN="PORTAL_ADMIN",r.ADMIN="ADMIN"})(W||(W={}));var ve;(function(r){r.SEARCHES="SEARCHES",r.BOOKMARKS="BOOKMARKS",r.BOOKS="BOOKS",r.COLLECTIONS="COLLECTIONS"})(ve||(ve={}));var Jc;(function(r){r.UNAUTHENTICATED="UNAUTHENTICATED",r.USER_INCOMPLETE="USER_INCOMPLETE",r.MFA_REQUIRED="MFA_REQUIRED",r.AUTHENTICATED="AUTHENTICATED"})(Jc||(Jc={}));var el;(function(r){r.VALID="VALID",r.INVALID="INVALID"})(el||(el={}));var tl;(function(r){r.INACCURATE="INACCURATE",r.INCOMPLETE="INCOMPLETE",r.OFF_TOPIC="OFF_TOPIC",r.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",r.SUMMARY="SUMMARY",r.SEMANTIC_SEARCH="SEMANTIC_SEARCH",r.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",r.OTHER="OTHER"})(tl||(tl={}));var rl;(function(r){r.INACCURATE="INACCURATE",r.INCOMPLETE="INCOMPLETE",r.OFF_TOPIC="OFF_TOPIC",r.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",r.SLOW="SLOW",r.OTHER="OTHER"})(rl||(rl={}));var ol;(function(r){r.JSON="JSON",r.TEXT="TEXT"})(ol||(ol={}));var nl;(function(r){r.USER="USER",r.ASSISTANT="ASSISTANT"})(nl||(nl={}));var il;(function(r){r.TEXT="TEXT",r.HTML="HTML"})(il||(il={}));var al;(function(r){r.HTML="HTML",r.MARKDOWN="MARKDOWN"})(al||(al={}));var sl;(function(r){r.MAP="MAP",r.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(sl||(sl={}));var kp={[W.PERSONAL_BOOK_SHARE_USER]:[W.PERSONAL_BOOK_USER],[W.HTML_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.PDF_EXPORT_USER]:[W.PERSONAL_BOOK_USER],[W.KHUB_ADMIN]:[W.CONTENT_PUBLISHER],[W.ADMIN]:[W.KHUB_ADMIN,W.USERS_ADMIN,W.PORTAL_ADMIN,W.BEHAVIOR_DATA_USER],[W.GENERATIVE_AI_EXPORT_USER]:[W.GENERATIVE_AI_USER]};function cl(r,e){return r===e||(kp[r]??[]).some(t=>cl(t,e))}function je(r,e){return r==null?!1:(Array.isArray(r)?r:Array.isArray(r.roles)?r.roles:Array.isArray(r.profile?.roles)?r.profile.roles:[]).some(n=>cl(n,e))}function Dp(r){return`"${r}"`}function ll(r){return r.startsWith('"')&&r.endsWith('"')?r.replace(/(^"+)|("+$)/g,""):r}function Fp(r,e){return new or(r).serialize(e)}var H;(function(r){r.LOCALE="content-lang",r.QUERY="query",r.SCOPE="scope",r.FILTERS="filters",r.VIRTUAL_FIELD="virtual-field",r.PERIOD="period",r.VALUE_FILTERS="value-filters",r.DATE_FILTERS="date-filters",r.RANGE_FILTERS="range-filters",r.SORT="sort",r.PER_PAGE="per-page",r.KEYWORD_MATCH="keyword-match"})(H||(H={}));var Up=new Set(Object.values(H));function dl(r){return Up.has(r)}var or=class{constructor(e,t=20,n=!1,i="en-US"){this.baseUrl=e,this.defaultPerPage=t,this.allLanguagesAllowed=n,this.defaultContentLocale=i,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,t){return this.serializeToCurrentPageIfPossible(e,t??"/search")}serializeToCurrentPageIfPossible(e,t){let n=t==null||t.trim().length===0,i=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${t}`);return i.search=this.toURLSearchParams(e),i.toString()}toURLSearchParams(e,t=!1){var n,i,a,s,c,d,p,h,f,m,y;let b=new URLSearchParams;e.contentLocale?(!t||e.contentLocale!==this.defaultContentLocale)&&b.append(H.LOCALE,e.contentLocale):b.append(H.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&b.append(H.QUERY,e.query);let E=(a=(i=e.metadataFilters)===null||i===void 0?void 0:i.filter(v=>v.valueFilter&&!v.valueFilter.negative))!==null&&a!==void 0?a:[];if(E.length>0){let v=E.map(O=>{var I,k;let U=((k=(I=O.valueFilter)===null||I===void 0?void 0:I.values)!==null&&k!==void 0?k:[]).map(M=>this.escapeFilters(M)).map(M=>Dp(ll(M))).join("_");return`${O.key}~${U}`}).join("*");b.append(H.VALUE_FILTERS,v)}let C=(c=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(v=>v.dateFilter))!==null&&c!==void 0?c:[];if(C.length>0){let v=C.map(O=>{var I;return`${O.key}~${(I=O.dateFilter)===null||I===void 0?void 0:I.type.toLowerCase()}`}).join("*");b.append(H.DATE_FILTERS,v)}let w=(p=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(v=>v.rangeFilter))!==null&&p!==void 0?p:[];if(w.length>0){let v=w.map(O=>{var I,k;return`${O.key}~${(I=O.rangeFilter)===null||I===void 0?void 0:I.from}_${(k=O.rangeFilter)===null||k===void 0?void 0:k.to}`}).join("*");b.append(H.RANGE_FILTERS,v)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&b.append(H.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&b.append(H.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&b.append(H.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((m=(f=e.paging)===null||f===void 0?void 0:f.perPage)!==null&&m!==void 0?m:this.defaultPerPage)!=this.defaultPerPage&&b.append(H.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&b.append(H.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let T=(y=e.otherQueryParams)!==null&&y!==void 0?y:{};for(let v in T)b.append(v,T[v]);let S=new Array;return b.forEach((v,O)=>{S.push(this.encodeQueryString(O)+"="+this.encodeQueryString(v))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var t;let n=e.split("?"),i=this.fromURLSearchParams(n.slice(1).join("?")),a=n[0].split("/search/")[1];return a==null?i:{...i,scope:(t=this.scopeMapping[a])!==null&&t!==void 0?t:i.scope}}fromURLSearchParams(e){var t,n,i,a,s,c;try{e=decodeURI(e).replace(/%23/g,"#")}catch(w){console.warn("Could not decode search request query params, fallback on raw value",w)}let d=new URLSearchParams(e),p=d.get(H.LOCALE)==="all"?void 0:d.get(H.LOCALE),h=((t=d.get(H.VIRTUAL_FIELD))!==null&&t!==void 0?t:"EVERYWHERE").toUpperCase(),f=(n=d.get(H.SORT))===null||n===void 0?void 0:n.toLowerCase(),m=(i=d.get(H.SCOPE))!==null&&i!==void 0?i:"default",y=+((a=d.get(H.PER_PAGE))!==null&&a!==void 0?a:this.defaultPerPage),b=d.get(H.KEYWORD_MATCH),E=b?b.toUpperCase()===tr.MANDATORY?tr.MANDATORY:tr.OPTIONAL:void 0,C={};for(let w of d.keys())dl(w)||(C[w]=d.get(w));return{contentLocale:p??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(H.QUERY))!==null&&s!==void 0?s:"",scope:(c=this.scopeMapping[m])!==null&&c!==void 0?c:"DEFAULT",virtualField:Xc(h)?h:"EVERYWHERE",sortId:f,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:Be(1,isNaN(y)?this.defaultPerPage:y,1e3)},keywordMatch:E,otherQueryParams:C}}parseCompatFilters(e){var t,n,i,a,s,c;let d=[];return e.has(H.FILTERS)&&(d=this.parseValueFilters((t=e.get(H.FILTERS))!==null&&t!==void 0?t:"")),(n=e.has(H.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((i=e.get(H.PERIOD))!==null&&i!==void 0?i:"").toUpperCase())]),[...d,...this.parseValueFilters((a=e.get(H.VALUE_FILTERS))!==null&&a!==void 0?a:""),...this.parseDateFilters((s=e.get(H.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((c=e.get(H.RANGE_FILTERS))!==null&&c!==void 0?c:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(t=>t.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],valueFilter:{values:t[1].split("_").map(ll).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],dateFilter:{type:rr[t[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(t=>({key:t[0],rangeFilter:{from:t[1].split("_")[0],to:t[1].split("_")[1]}}))}escapeFilters(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replaceAll(t,n);return e}superEscapeFilters(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replaceAll(n,i);return e}unescapeFilterValue(e){for(let[t,n,i]of this.filtersEscapeMapping)e=e.replace(i,t);return e}parseLegacyPeriodFilter(e){if(Qc(e))return[{key:"ft:lastEdition",dateFilter:{type:rr[e]}}];if(e.startsWith("CUSTOM_")){let[t,n,i]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:i}}]}return[]}};var na={};F(na,{toFtFormComponent:()=>Bp});var oa=Symbol("elementInternals"),Bp=te(Symbol("toFtFormComponent"),function(r){class e extends r{static get formAssociated(){return!0}get form(){return this[oa].form}constructor(...n){super(n),this[oa]=this.attachInternals()}setFormValue(n){this[oa].setFormValue(n)}}return e});var ia={};F(ia,{DateFormatter:()=>wt});var wt=class{static format(e,t,n,i,a){return window.moment?window.moment(e).locale(t).format(this.getMomentDateFormat(n,i,!!a)):this.getIntlDateTime(e,t,n,i,!!a)}static getMomentDateFormat(e,t,n){return n?"LT":e?t?"lll":"ll":t?"L LT":"L"}static getIntlDateTime(e,t,n,i,a){let s=typeof e=="string"?new Date(e):e,c=new Intl.DateTimeFormat(t,{dateStyle:n?"medium":"short"}).format(s),d=new Intl.DateTimeFormat(t,{timeStyle:"short"}).format(s);return a?d:i?`${c} ${d}`:c}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),t=new Date().getTimezoneOffset();return`${t<0?"+":"-"}${e(Math.abs(t)/60)}:${e(Math.abs(t)%60)}`}};var sa={};F(sa,{ALL_KEYS_VALUE:()=>aa,SameWindowStorageEvent:()=>nr});var aa="__all__",nr=class extends CustomEvent{constructor(e,t,n){super("same-window-storage",{detail:{key:e,oldValue:t,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==aa}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new nr(t[0],n,t[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(r,e,t){let n=e.getItem(t[0]);Reflect.apply(r,e,t),window.dispatchEvent(new nr(t[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(r,e,t){Reflect.apply(r,e,t),window.dispatchEvent(new nr(aa))}});var la={};F(la,{FocusMainContentEvent:()=>ca});var ca=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var ul={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function $p(r){(r.key==="Enter"||r.key===" "||r.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=r.key}function Hp(r){window.FluidTopicsA11yHints.isKeyboardNavigation=r.detail==0}document.addEventListener("keydown",$p);document.addEventListener("click",Hp);var pl=N`
|
|
49
49
|
.sr-only {
|
|
50
50
|
position:absolute;
|
|
51
51
|
left:-10000px;
|
|
@@ -129,7 +129,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
|
|
|
129
129
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
130
130
|
</article>
|
|
131
131
|
`}registerComponent(e){e.stopPropagation();let t=e.composedPath()[0];this.register(t)}register(e){this.registeredComponents.push(e),e.tocNode=this.tocNode,e.disableContextInteractions=this.disableContextInteractions,e.headingLevelsShift=this.headingLevelsShift}update(e){super.update(e),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(t=>e.has(t))&&this.setTocNode(),e.has("tocNode")&&this.registeredComponents.forEach(t=>t.tocNode=this.tocNode)}async setTocNode(){var e;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((e=this.stateManager)===null||e===void 0?void 0:e.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};xe.styles=bl;It([V({selector:r=>{var e;return(e=r.map)===null||e===void 0?void 0:e.id}})],xe.prototype,"mapId",void 0);It([V({selector:r=>r.translation.profileId})],xe.prototype,"translationProfileId",void 0);It([V({selector:r=>r.translation.destinationLanguage})],xe.prototype,"translationDestinationLanguage",void 0);It([A()],xe.prototype,"tocId",void 0);It([A({type:Boolean})],xe.prototype,"disableContextInteractions",void 0);It([A({type:Number})],xe.prototype,"headingLevelsShift",void 0);It([Z()],xe.prototype,"tocNode",void 0);ie("ft-reader-topic-context")(xe);var vl=N`
|
|
132
|
-
`;var Qp={setTranslationDestinationLanguage:(r,e)=>{r.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(r,e)=>{r.translation.sourceLanguage=e.payload},setTranslationProfileId:(r,e)=>{r.translation.profileId=e.payload},setTranslationLoading:(r,e)=>{r.translation.isLoading=e.payload},setTranslationError:(r,e)=>{r.translation.isError=e.payload},setTopicsRating:(r,e)=>{for(let t in e.payload)r.topicsRating[t]=e.payload[t]}},xl=r=>We.get({name:"ft-reader-"+r,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,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},reducers:Qp});var Oa=class{constructor(e,t){this.mapId=e,this.paginatedToc=t,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}}extractPagesToc(e,t,n){return e.flatMap(i=>{var a;return i.pageConfiguration&&this.registerPage(this.buildPage(i,n)),i.tocId==null?this.extractPagesToc(i.children,t,n):[{tocId:i.tocId,title:(a=i.title)!==null&&a!==void 0?a:"",untranslatedTitle:i.untranslatedTitle,depth:t,children:this.extractPagesToc(i.children,t+1,i.tocId)}]})}convertNodes(e,t,n){return e.flatMap(i=>{var a,s,c;if(i.tocId==null)return[...this.convertSectionNodes((a=i.pageToc)!==null&&a!==void 0?a:[],t,i.tocId),...this.convertNodes(i.children,t,i.tocId)];let d=(s=i.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:i.tocId,contentId:i.contentId,title:i.title,untranslatedTitle:i.untranslatedTitle,hasRating:i.hasRating,origin:i.origin,prettyUrl:d,depth:t,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((c=i.pageToc)!==null&&c!==void 0?c:[],t+1,i.tocId),f=this.convertNodes(i.children,t+1,p.tocId);return p.children=[...h,...f],[p]})}convertSectionNodes(e,t,n){return e.flatMap(i=>{var a;let s=(a=i.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={...i,prettyUrl:s,depth:t,parentTocId:n,children:[]};return this.register(c),c.children=this.convertSectionNodes(i.children,t+1,i.tocId),[c]})}buildPage(e,t){var n,i,a,s,c,d;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(i=e.tocId)!==null&&i!==void 0?i:"root",toc:((a=e.pageToc)!==null&&a!==void 0?a:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:t?this.buildBreadcrumb(this.nodeByTocId[t]):[]},h=(m,y)=>(y?p.topics:p.hiddenTopics).push(m),f=(c=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&c!==void 0?c:[];return p.breadcrumb.forEach((m,y)=>{h(m,f[y])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),p}registerPage(e){for(let t of[...e.topics,...e.hiddenTopics])this.pageByTocId[t]||(this.pageByTocId[t]=e);this.pages.push(e)}tocIds(e){return e.flatMap(t=>[t.tocId,...this.tocIds(t.children)])}buildBreadcrumb(e){let t=[e.tocId];for(;e?.parentTocId;)t.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return t}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}},_o=class{convertPaginatedToc(e,t){return new Oa(e,t).build()}};var ef="ft-app-info",ke=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:e})}};ke.eventName="authentication-change";var tf={session:(r,e)=>{ce(r.session,e.payload)||(r.session=e.payload,setTimeout(()=>R.dispatchEvent(new ke(e.payload)),0))}},R=We.get({name:ef,reducers:tf,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Po=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},SS=te(Symbol("withDateFormat"),function(r){class e extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(R)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>wt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Po([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Po([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Po([V({store:R.name,selector:t=>{var n,i;return(i=(n=t.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Po([V({store:R.name})],e.prototype,"uiLocale",void 0),e});var _t=class r{static get(e){let{baseUrl:t,apiIntegrationIdentifier:n}=R.getState(),i=e??n;if(t&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(t,i,!0)}static await(e){return new Promise(t=>{let n=r.get(e);if(n)t(n);else{let i=R.subscribe(()=>{n=r.get(e),n&&(i(),t(n))})}})}};var Lo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:_t.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):_t.await()}};var se=class extends Lo{constructor(e=!0,t){var n;super(t),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Ie,this.cache=e?i.commonCache:new Ie}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((t,n)=>0|31*t+n.charCodeAt(0),0))}};var No=class extends se{async listMySearches(){let{session:e}=R.getState();return je(e,W.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ko=class extends se{async listMyBookmarks(){let e=R.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Mo=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=R.getState().session;return!!e?.sessionAuthenticated}};var Do=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=R.getState().session;return!!e?.sessionAuthenticated}};var rf="ft-user-assets",of={setAssetCount:(r,e)=>{let{userAssetType:t,count:n}=e.payload.assetCount;r.assetCounts.allAsset[t]=n},clearAssetCount:r=>{Object.values(ve).forEach(e=>{r.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(r,e)=>{let t=e.payload.mapId;r.assetCounts.bookmarkByMap[t]=e.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,e)=>{let{assetType:t,mapId:n,asset:i}=e.payload;wa(r,t,[...Ca(r,t),i]),Sl(r,t,1,n),El(r,i)},editAsset:(r,e)=>{let{assetType:t,asset:n}=e.payload;wa(r,t,Ca(r,t).map(i=>i.id===n.id?n:i)),El(r,n)},removeAsset:(r,e)=>{let{assetType:t,mapId:n,assetId:i}=e.payload;wa(r,t,Ca(r,t).filter(a=>a.id!==i)),Sl(r,t,-1,n)}},Ol={[ve.SEARCHES]:"savedSearches",[ve.BOOKMARKS]:"bookmarks",[ve.BOOKS]:void 0,[ve.COLLECTIONS]:void 0},Ca=(r,e)=>{var t;let n=Ol[e];return n?(t=r[n])!==null&&t!==void 0?t:[]:[]},wa=(r,e,t)=>{let n=Ol[e];n&&(r[n]=t)},Sl=(r,e,t,n)=>{let i=r.assetCounts.allAsset[e];if(i!==void 0&&(r.assetCounts.allAsset[e]=Math.max(0,i+t),e===ve.BOOKMARKS&&n)){let a=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,a+t)}},El=(r,e)=>{let t=r.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!t.includes(i)).map(i=>({title:i}));r.assetLabels.push(...n)},he=We.get({name:rf,reducers:of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ve).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Aa=class{constructor(e=new Mo,t=new Do){this.assetCountsService=e,this.assetLabelsService=t,this.currentSession=R.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ko,this.savedSearchesService=new No,R.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:t}=R.getState();ce((e=this.currentSession)===null||e===void 0?void 0:e.profile,t?.profile)||(this.currentSession=t,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),he.actions.clearAssetCount(),he.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),he.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),he.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();he.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();he.actions.assetLabels(e)}async loadAssetCount(e){let t=await this.assetCountsService.getUserAssetCount(e);t&&he.actions.setAssetCount({assetCount:t})}async loadBookmarkByMapId(e){let t=await this.assetCountsService.getUserBookmarkCountByMap(e);t&&he.actions.setBookmarkCountByMap({count:t.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let t=Object.keys(he.getState().assetCounts.bookmarkByMap).length!==0;e===ve.BOOKMARKS&&t&&he.actions.clearBookmarkCountByMap(),he.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 t=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;he.actions.bookmarks(t)}}},Ra=new Aa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ra);var Ta=class{addCommand(e,t=!1){R.commands.add(e,t)}consumeCommand(e){return R.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ta;var Cl,ar=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},nf=Symbol("clearAfterUnitTest"),Fo=class extends co(se){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Cl]=()=>{this.defaultMessages={},this.cache=new Ie,this.listeners={}},this.currentUiLocale=R.getState().uiLocale,R.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=R.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let t=e.name.toLowerCase();this.cache.setFinal(t,e),this.notify(t)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,t){var n;if(e=e.toLowerCase(),t&&Object.keys(t).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...t};ce(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var t,n;return this.fetchContext(e),(n=(t=this.cache.getNow(e))===null||t===void 0?void 0:t.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,t){let n=e.toLowerCase();return this.resolveContext(n)[t]}resolveMessage(e,t,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new Hr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(t,...n)}async fetchContext(e){let t=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),t&&await this.notify(e)}catch(i){!(i instanceof Fe)&&t&&console.error(i)}return n}subscribe(e,t){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(t),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(t)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new ar({loadedContexts:e})),this.dispatchEvent(new ar({loadedContexts:e})),await Promise.all(e.map(t=>this.notify(t,!1)))}async notify(e,t=!0){t&&(document.body.dispatchEvent(new ar({loadedContexts:[e]})),this.dispatchEvent(new ar({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>so(0).then(()=>n()).catch(()=>null)))}};Cl=nf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Fo{constructor(){super(async(r,e)=>(await this.awaitApi).getFluidTopicsMessageContext(r,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Fo{constructor(){super(async(r,e)=>(await this.awaitApi).getCustomMessageContext(r,e))}});var wl=window.FluidTopicsI18nService,iE=window.FluidTopicsCustomI18nService;var Ia=class{highlightHtml(e,t,n){Oi(e,t,n)}};window.FluidTopicsHighlightHtmlService=new Ia;var _a=class{isDate(e){var t,n,i,a;return(a=(i=((n=(t=R.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,t){var n,i,a;if(e==null)return"";try{return wt.format(e,(n=t?.locale)!==null&&n!==void 0?n:R.getState().uiLocale,(i=t?.longFormat)!==null&&i!==void 0?i:!1,(a=t?.withTime)!==null&&a!==void 0?a:!1)}catch(s){throw console.error(`Date ${JSON.stringify(e)} is not valid`,s),s}}};window.FluidTopicsDateService=new _a;var Zr=class{static get(e,t){var n,i;let a=R.getState(),{lang:s,region:c}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new or(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,t??`${s}-${c}`)}};var Uo=class extends se{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 sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let t;switch(e.editorialType){case"BOOK":t="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":t="SHARED_PERSONAL_BOOK";break;case"ARTICLE":t="RESOURCE";break;case"HTML_PACKAGE":t="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:t,metadata:e.metadata}}sortEventArrays(e){let t=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(a=>typeof a=="object"&&a!=null&&!Array.isArray(a)?this.sortEventArrays(a):a).sort((a,s)=>typeof a=="object"&&a!==null&&"key"in a?a.key.localeCompare(s.key):typeof a=="string"&&typeof s=="string"?a.localeCompare(s):String(a).localeCompare(String(s)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(t)}sendEvents(e,t){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(t),console.debug(i),n)),1e3)}};var Pa=class{urlToSearchRequest(e){return Zr.get().parse(e)}searchRequestToUrl(e){return Zr.get().serialize(e)}};window.FluidTopicsUrlService=new Pa;var Pt=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:{currentItem:e}})}};Pt.eventName="change";var La=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let t=sessionStorage.getItem(this.itemName(e));return t?JSON.parse(t):void 0}set(e,t){sessionStorage.setItem(this.itemName(e),JSON.stringify(t))}},Al=new La;var Bo=class r extends $e{static build(){return new r(window.history,Al,()=>window.location,!1)}constructor(e,t,n,i){var a,s;super(),this.history=e,this.historyStorage=t,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,t=!1){let n=t&&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),ce(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Pt(this.currentItem())),0)}installProxies(){let e=t=>(n,i,[a,s,c])=>{let d=t(),p={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[p,s,c]),this.setCurrentState(p,!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 t=this.history.length-1;t>=0;t--)e?this.states[t]=this.historyStorage.get(t):setTimeout(()=>this.states[t]=this.historyStorage.get(t),this.history.length-t)}updateCurrentState(e){var t;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(t=e?.title)!==null&&t!==void 0?t:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Pt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Pt.eventName,e)}currentItem(){return ft(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 ft(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return ft(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 t;let n=(t=this.states[e])===null||t===void 0?void 0:t.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,t;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(t=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,t){var n;if(!this.hasState(e))return!1;let i=t??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(r),removeHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(r)});var Rl=N`
|
|
132
|
+
`;var Qp={setTranslationDestinationLanguage:(r,e)=>{r.translation.destinationLanguage=e.payload},setTranslationSourceLanguage:(r,e)=>{r.translation.sourceLanguage=e.payload},setTranslationProfileId:(r,e)=>{r.translation.profileId=e.payload},setTranslationLoading:(r,e)=>{r.translation.isLoading=e.payload},setTranslationError:(r,e)=>{r.translation.isError=e.payload},setTopicsRating:(r,e)=>{for(let t in e.payload)r.topicsRating[t]=e.payload[t]}},xl=r=>We.get({name:"ft-reader-"+r,initialState:{mapId:void 0,renderedTopics:[],visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,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},reducers:Qp});var Oa=class{constructor(e,t){this.mapId=e,this.paginatedToc=t,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}}extractPagesToc(e,t,n){return e.flatMap(i=>{var a;return i.pageConfiguration&&this.registerPage(this.buildPage(i,n)),i.tocId==null?this.extractPagesToc(i.children,t,n):[{tocId:i.tocId,title:(a=i.title)!==null&&a!==void 0?a:"",untranslatedTitle:i.untranslatedTitle,depth:t,children:this.extractPagesToc(i.children,t+1,i.tocId)}]})}convertNodes(e,t,n){return e.flatMap(i=>{var a,s,c;if(i.tocId==null)return[...this.convertSectionNodes((a=i.pageToc)!==null&&a!==void 0?a:[],t,i.tocId),...this.convertNodes(i.children,t,i.tocId)];let d=(s=i.prettyUrl)===null||s===void 0?void 0:s.replace(/^\//,""),p={tocId:i.tocId,contentId:i.contentId,title:i.title,untranslatedTitle:i.untranslatedTitle,hasRating:i.hasRating,origin:i.origin,prettyUrl:d,depth:t,parentTocId:n,children:[]};this.register(p);let h=this.convertSectionNodes((c=i.pageToc)!==null&&c!==void 0?c:[],t+1,i.tocId),f=this.convertNodes(i.children,t+1,p.tocId);return p.children=[...h,...f],[p]})}convertSectionNodes(e,t,n){return e.flatMap(i=>{var a;let s=(a=i.prettyUrl)===null||a===void 0?void 0:a.replace(/^\//,""),c={...i,prettyUrl:s,depth:t,parentTocId:n,children:[]};return this.register(c),c.children=this.convertSectionNodes(i.children,t+1,i.tocId),[c]})}buildPage(e,t){var n,i,a,s,c,d;let p={number:this.pages.length+1,title:(n=e.title)!==null&&n!==void 0?n:"",untranslatedTitle:e.untranslatedTitle,rootTocId:(i=e.tocId)!==null&&i!==void 0?i:"root",toc:((a=e.pageToc)!==null&&a!==void 0?a:[]).map(m=>this.nodeByTocId[m.tocId]),topics:[],hiddenTopics:[],breadcrumb:t?this.buildBreadcrumb(this.nodeByTocId[t]):[]},h=(m,y)=>(y?p.topics:p.hiddenTopics).push(m),f=(c=(s=e.pageConfiguration)===null||s===void 0?void 0:s.parentsVisibility)!==null&&c!==void 0?c:[];return p.breadcrumb.forEach((m,y)=>{h(m,f[y])}),e.tocId&&h(e.tocId,e.pageConfiguration.isVisible),p.topics.push(...this.tocIds((d=e.pageToc)!==null&&d!==void 0?d:[])),p}registerPage(e){for(let t of[...e.topics,...e.hiddenTopics])this.pageByTocId[t]||(this.pageByTocId[t]=e);this.pages.push(e)}tocIds(e){return e.flatMap(t=>[t.tocId,...this.tocIds(t.children)])}buildBreadcrumb(e){let t=[e.tocId];for(;e?.parentTocId;)t.unshift(e.parentTocId),e=this.nodeByTocId[e.parentTocId];return t}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}},_o=class{convertPaginatedToc(e,t){return new Oa(e,t).build()}};var ef="ft-app-info",ke=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:e})}};ke.eventName="authentication-change";var tf={session:(r,e)=>{ce(r.session,e.payload)||(r.session=e.payload,setTimeout(()=>R.dispatchEvent(new ke(e.payload)),0))}},R=We.get({name:ef,reducers:tf,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var Po=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},SS=te(Symbol("withDateFormat"),function(r){class e extends r{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(R)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>wt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Po([A({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Po([A({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Po([V({store:R.name,selector:t=>{var n,i;return(i=(n=t.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),Po([V({store:R.name})],e.prototype,"uiLocale",void 0),e});var _t=class r{static get(e){let{baseUrl:t,apiIntegrationIdentifier:n}=R.getState(),i=e??n;if(t&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(t,i,!0)}static await(e){return new Promise(t=>{let n=r.get(e);if(n)t(n);else{let i=R.subscribe(()=>{n=r.get(e),n&&(i(),t(n))})}})}};var Lo=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:_t.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):_t.await()}};var se=class extends Lo{constructor(e=!0,t){var n;super(t),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Ie,this.cache=e?i.commonCache:new Ie}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((t,n)=>0|31*t+n.charCodeAt(0),0))}};var No=class extends se{async listMySearches(){let{session:e}=R.getState();return je(e,W.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var ko=class extends se{async listMyBookmarks(){let e=R.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var Mo=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=R.getState().session;return!!e?.sessionAuthenticated}};var Do=class extends se{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=R.getState().session;return!!e?.sessionAuthenticated}};var rf="ft-user-assets",of={setAssetCount:(r,e)=>{let{userAssetType:t,count:n}=e.payload.assetCount;r.assetCounts.allAsset[t]=n},clearAssetCount:r=>{Object.values(ve).forEach(e=>{r.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(r,e)=>{let t=e.payload.mapId;r.assetCounts.bookmarkByMap[t]=e.payload.count},clearBookmarkCountByMap:r=>{r.assetCounts.bookmarkByMap={}},addAsset:(r,e)=>{let{assetType:t,mapId:n,asset:i}=e.payload;wa(r,t,[...Ca(r,t),i]),Sl(r,t,1,n),El(r,i)},editAsset:(r,e)=>{let{assetType:t,asset:n}=e.payload;wa(r,t,Ca(r,t).map(i=>i.id===n.id?n:i)),El(r,n)},removeAsset:(r,e)=>{let{assetType:t,mapId:n,assetId:i}=e.payload;wa(r,t,Ca(r,t).filter(a=>a.id!==i)),Sl(r,t,-1,n)}},Ol={[ve.SEARCHES]:"savedSearches",[ve.BOOKMARKS]:"bookmarks",[ve.BOOKS]:void 0,[ve.COLLECTIONS]:void 0},Ca=(r,e)=>{var t;let n=Ol[e];return n?(t=r[n])!==null&&t!==void 0?t:[]:[]},wa=(r,e,t)=>{let n=Ol[e];n&&(r[n]=t)},Sl=(r,e,t,n)=>{let i=r.assetCounts.allAsset[e];if(i!==void 0&&(r.assetCounts.allAsset[e]=Math.max(0,i+t),e===ve.BOOKMARKS&&n)){let a=r.assetCounts.bookmarkByMap[n];r.assetCounts.bookmarkByMap[n]=Math.max(0,a+t)}},El=(r,e)=>{let t=r.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!t.includes(i)).map(i=>({title:i}));r.assetLabels.push(...n)},he=We.get({name:rf,reducers:of,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ve).map(r=>[r,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Aa=class{constructor(e=new Mo,t=new Do){this.assetCountsService=e,this.assetLabelsService=t,this.currentSession=R.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new ko,this.savedSearchesService=new No,R.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:t}=R.getState();ce((e=this.currentSession)===null||e===void 0?void 0:e.profile,t?.profile)||(this.currentSession=t,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),he.actions.clearAssetCount(),he.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),he.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),he.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();he.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();he.actions.assetLabels(e)}async loadAssetCount(e){let t=await this.assetCountsService.getUserAssetCount(e);t&&he.actions.setAssetCount({assetCount:t})}async loadBookmarkByMapId(e){let t=await this.assetCountsService.getUserBookmarkCountByMap(e);t&&he.actions.setBookmarkCountByMap({count:t.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let t=Object.keys(he.getState().assetCounts.bookmarkByMap).length!==0;e===ve.BOOKMARKS&&t&&he.actions.clearBookmarkCountByMap(),he.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 t=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;he.actions.bookmarks(t)}}},Ra=new Aa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ra);var Ta=class{addCommand(e,t=!1){R.commands.add(e,t)}consumeCommand(e){return R.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ta;var Cl,ar=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},nf=Symbol("clearAfterUnitTest"),Fo=class extends co(se){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Cl]=()=>{this.defaultMessages={},this.cache=new Ie,this.listeners={}},this.currentUiLocale=R.getState().uiLocale,R.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=R.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let t=e.name.toLowerCase();this.cache.setFinal(t,e),this.notify(t)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,t){var n;if(e=e.toLowerCase(),t&&Object.keys(t).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...t};ce(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var t,n;return this.fetchContext(e),(n=(t=this.cache.getNow(e))===null||t===void 0?void 0:t.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,t){let n=e.toLowerCase();return this.resolveContext(n)[t]}resolveMessage(e,t,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new Hr((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(t,...n)}async fetchContext(e){let t=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),t&&await this.notify(e)}catch(i){!(i instanceof Fe)&&t&&console.error(i)}return n}subscribe(e,t){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(t),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(t)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new ar({loadedContexts:e})),this.dispatchEvent(new ar({loadedContexts:e})),await Promise.all(e.map(t=>this.notify(t,!1)))}async notify(e,t=!0){t&&(document.body.dispatchEvent(new ar({loadedContexts:[e]})),this.dispatchEvent(new ar({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>so(0).then(()=>n()).catch(()=>null)))}};Cl=nf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Fo{constructor(){super(async(r,e)=>(await this.awaitApi).getFluidTopicsMessageContext(r,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Fo{constructor(){super(async(r,e)=>(await this.awaitApi).getCustomMessageContext(r,e))}});var wl=window.FluidTopicsI18nService,iE=window.FluidTopicsCustomI18nService;var Ia=class{highlightHtml(e,t,n){Oi(e,t,n)}};window.FluidTopicsHighlightHtmlService=new Ia;var _a=class{isDate(e){var t,n,i,a;return(a=(i=((n=(t=R.getState().metadataConfiguration)===null||t===void 0?void 0:t.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,t){var n,i,a,s;if(e==null)return"";try{return wt.format(e,(n=t?.locale)!==null&&n!==void 0?n:R.getState().uiLocale,(i=t?.longFormat)!==null&&i!==void 0?i:!1,(a=t?.withTime)!==null&&a!==void 0?a:!1,(s=t?.onlyTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new _a;var Zr=class{static get(e,t){var n,i;let a=R.getState(),{lang:s,region:c}=(i=(n=a.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new or(a.baseUrl,e??20,a.searchInAllLanguagesAllowed,t??`${s}-${c}`)}};var Uo=class extends se{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 sendDocumentAiTranslateEvent(e){return this.sendEvents([this.sortEventArrays(e)],"Failed to send document.on-demand_translate event")}convertMapToAnalyticsDocument(e){let t;switch(e.editorialType){case"BOOK":t="STRUCTURED_DOCUMENT";break;case"SHARED_BOOK":t="SHARED_PERSONAL_BOOK";break;case"ARTICLE":t="RESOURCE";break;case"HTML_PACKAGE":t="HTML_PACKAGE";break;default:throw new TypeError("Unknown editorial type for map : "+e.editorialType)}return{id:e.id,title:e.title,type:t,metadata:e.metadata}}sortEventArrays(e){let t=Object.entries(e).map(([n,i])=>Array.isArray(i)?[n,i.map(a=>typeof a=="object"&&a!=null&&!Array.isArray(a)?this.sortEventArrays(a):a).sort((a,s)=>typeof a=="object"&&a!==null&&"key"in a?a.key.localeCompare(s.key):typeof a=="string"&&typeof s=="string"?a.localeCompare(s):String(a).localeCompare(String(s)))]:typeof i=="object"&&i!==null?[n,this.sortEventArrays(i)]:[n,i]);return Object.fromEntries(t)}sendEvents(e,t){let n="anything not undefined";return this.cache.get("analytics-event-"+this.hash(e),async()=>(await this.awaitApi).sendEvents(e).then(()=>n).catch(i=>(console.info(t),console.debug(i),n)),1e3)}};var Pa=class{urlToSearchRequest(e){return Zr.get().parse(e)}searchRequestToUrl(e){return Zr.get().serialize(e)}};window.FluidTopicsUrlService=new Pa;var Pt=class r extends CustomEvent{constructor(e){super(r.eventName,{detail:{currentItem:e}})}};Pt.eventName="change";var La=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let t=sessionStorage.getItem(this.itemName(e));return t?JSON.parse(t):void 0}set(e,t){sessionStorage.setItem(this.itemName(e),JSON.stringify(t))}},Al=new La;var Bo=class r extends $e{static build(){return new r(window.history,Al,()=>window.location,!1)}constructor(e,t,n,i){var a,s;super(),this.history=e,this.historyStorage=t,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,t=!1){let n=t&&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),ce(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Pt(this.currentItem())),0)}installProxies(){let e=t=>(n,i,[a,s,c])=>{let d=t(),p={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[p,s,c]),this.setCurrentState(p,!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 t=this.history.length-1;t>=0;t--)e?this.states[t]=this.historyStorage.get(t):setTimeout(()=>this.states[t]=this.historyStorage.get(t),this.history.length-t)}updateCurrentState(e){var t;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(t=e?.title)!==null&&t!==void 0?t:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Pt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Pt.eventName,e)}currentItem(){return ft(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 ft(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return ft(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 t;let n=(t=this.states[e])===null||t===void 0?void 0:t.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,t;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(t=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,t){var n;if(!this.hasState(e))return!1;let i=t??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(r),removeHistoryChangeListener:r=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(r)});var Rl=N`
|
|
133
133
|
`;function Tl(r,e){let{authenticationRequired:t,session:n}=R.getState();return t&&!n?.sessionAuthenticated?Promise.resolve(e):r()}var X=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},G=class extends q{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>_t.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Ie,this.cleanSessionDebouncer=new Y,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return j`
|
|
134
134
|
<slot></slot>
|
|
135
135
|
`}connectedCallback(){super.connectedCallback(),R.addEventListener(ke.eventName,this.reloadConfiguration)}disconnectedCallback(){R.addEventListener(ke.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(e){var t,n,i,a,s,c,d;super.update(e),e.has("baseUrl")&&(R.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&R.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&R.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&R.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&R.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&R.actions.noCustom(this.noCustom),e.has("editorMode")&&R.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&R.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&R.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>wl.addContext(p)),e.has("openExternalDocumentInNewTab")&&R.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&R.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&R.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(R.actions.defaultLocales((t=this.localesConfiguration)===null||t===void 0?void 0:t.defaultLocales),R.actions.availableUiLocales((i=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&i!==void 0?i:[]),R.actions.searchInAllLanguagesAllowed((s=(a=this.localesConfiguration)===null||a===void 0?void 0:a.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),e.has("authenticationRequired")&&R.actions.authenticationRequired(this.authenticationRequired),e.has("availableContentLocales")&&R.actions.availableContentLocales((d=(c=this.availableContentLocales)===null||c===void 0?void 0:c.contentLocales)!==null&&d!==void 0?d:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Tl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};G.elementDefinitions={};G.styles=Rl;X([A()],G.prototype,"baseUrl",void 0);X([A()],G.prototype,"apiIntegrationIdentifier",void 0);X([A()],G.prototype,"apiIntegrationAppVersion",void 0);X([A()],G.prototype,"uiLocale",void 0);X([Je(null)],G.prototype,"availableUiLocales",void 0);X([Je(null)],G.prototype,"metadataConfiguration",void 0);X([A({type:Boolean})],G.prototype,"editorMode",void 0);X([A({type:Boolean})],G.prototype,"noCustom",void 0);X([A({type:Boolean})],G.prototype,"openExternalDocumentInNewTab",void 0);X([A({converter:{fromAttribute(r){return r==="false"?!1:r==="true"||(r??!1)}}})],G.prototype,"noCustomComponent",void 0);X([A({type:Boolean})],G.prototype,"withManualResources",void 0);X([A({type:Boolean})],G.prototype,"navigatorOnline",void 0);X([A({type:Boolean})],G.prototype,"forcedOffline",void 0);X([A({type:Object})],G.prototype,"apiProvider",void 0);X([A({type:Boolean})],G.prototype,"authenticationRequired",void 0);X([Je([])],G.prototype,"messageContexts",void 0);X([Je(void 0)],G.prototype,"session",void 0);X([Z()],G.prototype,"localesConfiguration",void 0);X([Z()],G.prototype,"availableContentLocales",void 0);ie("ft-app-context")(G);var $o=class extends se{get mapId(){return this._mapId}set mapId(e){e!==this._mapId&&this.clear(),this._mapId=e}constructor(e,t,n){super(!1,t),this.converter=e,this._mapId=n,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("enrichedToc",()=>this.withMapId(e=>this.fetchPages(e).then(t=>this.converter.convertPaginatedToc(e,t)))),this.cache.register("ratingSummary",()=>{var e,t;return je((t=(e=R.getState().session)===null||e===void 0?void 0:e.profile.roles)!==null&&t!==void 0?t:[],"RATING_USER")?this.withMapId(i=>this.fetchMapRating(i)):Promise.resolve()})}clear(){this.cache.clearMatching(e=>e!=="configuration")}makeCacheKey(e,t){return e+(t?"-destinationLanguage-"+t?.destinationLanguage:"")}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.fetchPages(this.mapId,e).then(t=>this.converter.convertPaginatedToc(this.mapId,t)))}getEnrichedTocNow(e){return this.cache.getNow(this.makeCacheKey("enrichedToc",e))}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 getTocNode(e,t){return(await this.getEnrichedToc(t)).nodeByTocId[e]}getTocNodeNow(e,t){var n;return(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.nodeByTocId[e]}getTocNodeNowByUrl(e,t){var n,i;let a=this.getMapNow(t);return a?.prettyUrl==e||`${a?.id}/root`===e?(n=this.getEnrichedTocNow(t))===null||n===void 0?void 0:n.toc[0]:(i=this.getEnrichedTocNow(t))===null||i===void 0?void 0:i.nodeByUrl[e]}async getPage(e,t){let n=await this.getEnrichedToc(t);return n.pages[e-1]||n.pages[0]}async getPageByTocId(e,t){let n=await this.getEnrichedToc(t);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,t){return this.cache.get(this.makeCacheKey("translated-topic-content-"+e.tocId,t),()=>this.fetchTranslatedTopicHTMLContent(e,t))}getAttachments(){return this.cache.get("map-attachments",()=>this.fetchAttachments())}clearMapAttachments(){this.cache.clear("map-attachments")}getRelativesForDocument(e,t){return this.cache.get("document-relatives-"+e+"-"+t.join("-"),()=>this.fetchRelativesForDocument(e,t))}getRelativesForTopicInMap(e,t,n){return this.cache.get("topic-relatives-"+[e,t,...n].join("-"),()=>this.fetchRelativesForTopicInMap(e,t,n))}getAttachmentDownloadLink(e){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(e).content}?download=true&locationValue=reader`)}getLink(e,t,n){let i=this.getNavigationData(e,t,n),a=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),s=new URL(a,this.api.tenantBaseUrl);return i.page!=null&&s.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&s.searchParams.set("tocId",i.tocId),i.section!=null&&s.searchParams.set("section",i.section),s.href}getNavigationData(e,t,n,i){var a,s;e=e||"root";let c=this.getEnrichedTocNow(i),d=c?.pageByTocId[e],p=c?.nodeByTocId[e],h=p?.prettyUrl;return{mapId:this.mapId,tocId:e,topicTitle:(a=p?.title)!==null&&a!==void 0?a:"",untranslatedTopicTitle:p?.untranslatedTitle,page:t&&d&&d.number!==t?t:void 0,prettyUrl:h?.replace(/^r\//,""),prettyUrlDuplicated:(s=c?.duplicatedPrettyUrls.has(h??""))!==null&&s!==void 0?s:!1,section:n}}async getAccurateNavigationData(e,t,n,i){return await this.getEnrichedToc(i),this.getNavigationData(e,t,n,i)}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(t=>{var n;return t?{type:t.topics.type,rating:(n=t.topics)===null||n===void 0?void 0:n.ratings.find(i=>i.tocId===e)}:void 0})}rateMap(e,t){return this.makeRateMapRequest(e,t).then(()=>this.clearRatingIfNecessary())}unrateMap(){return this.makeUnrateMapRequest().then(()=>this.clearRatingIfNecessary())}sendMapFeedback(e,t){return this.makeMapFeedbackRequest(e,t)}rateTopic(e,t,n){return this.makeRateTopicRequest(e,t,n).then(()=>this.clearRatingIfNecessary())}unrateTopic(e){return this.makeUnrateTopicRequest(e).then(()=>this.clearRatingIfNecessary())}async clearRatingIfNecessary(){let e=R.getState().session;e?.sessionAuthenticated&&this.cache.clear("ratingSummary")}sendTopicFeedback(e,t,n){return this.makeTopicFeedbackRequest(e,t,n)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(e,t){let n=this.getTocNodeNow(e,t),i=[{tocId:n.tocId,title:n.title,untranslatedTitle:n.untranslatedTitle}],a=this.getTocNodeNow(n.parentTocId,t);for(;a;)i.unshift({tocId:a.tocId,title:a.title,untranslatedTitle:a.untranslatedTitle}),a=this.getTocNodeNow(a.parentTocId,t);return i}isFeatureAccessible(e,{session:t}){var n;if(!this.isFeatureAvailable(e))return!1;switch(e){case Ge.FEEDBACK:return je(t??[],W.FEEDBACK_USER);case Ge.RATING:return je(t??[],W.RATING_USER);case Ge.PRINT:return je(t??[],W.PRINT_USER);case Ge.BOOKMARK:return!!t?.sessionAuthenticated;case Ge.COLLECTIONS:return je(t??[],W.COLLECTION_USER);case Ge.PERSONAL_BOOKS:return je(t??[],W.PERSONAL_BOOK_USER)&&!(!((n=this.getMapNow())===null||n===void 0)&&n.pbkConfidential);default:return!1}}makeAbsolute(e){return this.api.makeAbsolute(e)}};var Ho=class r extends $o{static async build(e){return new r(new _o,void 0,e)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(e,t){let n=await this.api.getMap(e,t);return this.fingerprint=n.fingerprint,n}fetchMapRating(e){return this.api.getMapRating(e)}async fetchPages(e,t){return await this.getMap(t),this.api.getPages(e,this.fingerprint,t)}fetchTopicHTMLContent(e){return this.api.getTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint)}fetchTranslatedTopicHTMLContent(e,t){return this.api.getTranslatedTopicHTMLContent(this.mapId,e.contentId,"DESIGNED_READER",this.fingerprint,t)}fetchTopicMetadata(e){return this.api.getTopic(this.mapId,e.contentId,this.fingerprint)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch(()=>[])}fetchRelativesForDocument(e,t){let n={query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",metadataFilters:[{key:e,valueFilter:{negative:!1,values:t}}],sort:[],facets:[]};return this.api.search(n)}fetchRelativesForTopicInMap(e,t,n){let i={query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",metadataFilters:[{key:t,valueFilter:{negative:!1,values:n}},{key:"ft:publicationId",valueFilter:{negative:!1,values:[e]}}],sort:[],facets:[]};return this.api.search(i)}makeMapFeedbackRequest(e,t){return this.api.sendMapFeedback(this.mapId,e,t)}makeRateMapRequest(e,t){return this.api.rateMap(this.mapId,e,t)}makeRateTopicRequest(e,t,n){return this.api.rateTopic(this.mapId,e,t,n)}makeTopicFeedbackRequest(e,t,n){return this.api.sendTopicFeedback(this.mapId,e,t,n)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(e){return this.api.unrateTopic(this.mapId,e)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(e){return!0}};var zo=class r{static build(e,t){return new r(xl(e.trim()||"context"),t??Ho.build)}loaded(){return Ir(()=>this._loaded)}constructor(e,t,n,i){this.store=e,this.clusteringHelperProvider=n,this.metadataForSwitchToRelatives=new Set,this._loaded=!1,this.loadDebouncer=new Y(10),this.analyticsEventsService=i??new Uo,this.initService(t)}async initService(e){return this.service=await e(),this.service.mapId=this.store.getState().mapId,this.reload()}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 awaitService(){return pt(()=>this.service)}async navigateToTopic(e,t,n){await this.loaded();let i=await this.awaitService(),a=await(n!=null?i.getPage(n,this.getTranslationSettings()):i.getPageByTocId(e??"root",this.getTranslationSettings()));this.store.actions.currentPage(a);let s=this.resolveValidNonRootTocId(e,a);this.store.actions.scrollTarget({tocId:s,section:t}),this.store.getState().visibleTopics[0]!==s&&this.store.actions.visibleTopics([])}resolveValidNonRootTocId(e,t){var n,i,a;let s=(n=e==="root"?void 0:e)!==null&&n!==void 0?n:t.rootTocId;return t.topics.includes(s)?s:(a=(i=t.topics[0])!==null&&i!==void 0?i:t.hiddenTopics[0])!==null&&a!==void 0?a:"root"}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(this.getTranslationSettings()))}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()}async fetchData(e){var t,n,i,a,s;try{e&&this.setTranslationLoading(!0);let c=d=>{throw e&&this.setTranslationError(!0),d};await Promise.all([this.loadConfiguration(),(t=this.service)===null||t===void 0?void 0:t.getMap(e).then(d=>this.store.actions.map(d)).catch(c),(n=this.service)===null||n===void 0?void 0:n.getToc(e).then(d=>this.store.actions.toc(d)).catch(c),(i=this.service)===null||i===void 0?void 0:i.getPagesToc(e).then(d=>this.store.actions.pagesToc(d)).catch(c),(a=this.service)===null||a===void 0?void 0:a.getPaginationConfiguration().then(d=>this.store.actions.paginationConfiguration(d)).catch(c),(s=this.service)===null||s===void 0?void 0:s.getTranslationError(e).then(d=>this.setTranslationError(d))]),this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives(),this._loaded=!0,e&&this.setTranslationLoading(!1)}catch(c){this.errorHandler&&!(c instanceof Fe)&&this.errorHandler(c)}}loadConfiguration(){var e;return(e=this.service)===null||e===void 0?void 0:e.getConfiguration().then(t=>this.store.actions.configuration(t))}reloadConfiguration(){var e;return(e=this.service)===null||e===void 0||e.clearConfiguration(),this.loadConfiguration()}fetchRelatives(){var e,t;let n=(e=this.store.getState().map)===null||e===void 0?void 0:e.metadata.filter(i=>{var a;return i.key==((a=this.store.getState().configuration)===null||a===void 0?void 0:a.relativePivotMetadata)}).flatMap(i=>i.values);n!==void 0&&n.length>0?(t=this.service)===null||t===void 0||t.getRelativesForDocument(this.store.getState().configuration.relativePivotMetadata,n).then(i=>{let a=i.results.flatMap(s=>s.entries);this.store.actions.relatives(a),this.updateClusteringHelper()}):this.updateClusteringHelper()}updateClusteringHelper(){this.clusteringHelper=this.createClusteringHelper(),this.clusteringHelper&&this.store.dispatchEvent(new Event(Tt.clusteringHelperCreated))}createClusteringHelper(){var e,t;if(this.clusteringHelperProvider)return this.clusteringHelperProvider();let n=this.store.getState().relatives;if(n){let i=n.find(s=>{var c;return((c=s.map)===null||c===void 0?void 0:c.mapId)==this.store.getState().mapId}),a=(t=(e=R.getState().metadataConfiguration)===null||e===void 0?void 0:e.descriptors)!==null&&t!==void 0?t:[];return new Lr(n,i,this.metadataForSwitchToRelatives,a)}}async navigateToRelativeTopicIfFound(e){var t,n,i;await this.loaded();let a=await pt(()=>{var p;return(p=this.store.getState().configuration)===null||p===void 0?void 0:p.relativeTopicPivotMetadata}),s=this.store.getState().mapId,d=await(await this.awaitService()).getRelativesForTopicInMap(s,a,[e]);if(!((i=(n=(t=d?.results)===null||t===void 0?void 0:t[0])===null||n===void 0?void 0:n.entries)===null||i===void 0)&&i[0]){let p=d.results[0].entries[0].topic.tocId;return await this.navigateToTopic(p),!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(this.getTranslationSettings()))}async setTranslationSourceLanguage(e){this.store.actions.setTranslationSourceLanguage(e),await this.loadDebouncer.run(()=>this.fetchData(this.getTranslationSettings()))}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 t=this.store.getState();return t.translation.profileId&&t.translation.destinationLanguage?{profileId:t.translation.profileId,destinationLanguage:t.translation.destinationLanguage.code,sourceLanguage:(e=t.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 t;let n=await((t=this.service)===null||t===void 0?void 0:t.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()}getAccurateNavigationData(e,t,n){return this.service.getAccurateNavigationData(e,t?.number,n?.section,this.getTranslationSettings())}buildBreadcrumb(e){var t;return(t=this.service)===null||t===void 0?void 0:t.buildBreadcrumb(e,this.getTranslationSettings())}fetchTopicContent(e){var t,n;let i=this.getTranslationSettings();return i?(t=this.service)===null||t===void 0?void 0:t.getTranslatedTopicContent(e,i).then(a=>(a.isTranslationError&&this.setTranslationError(!0),a.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(Tt.mapAttachmentsUpdate))}sendDocumentOnDemandTranslateEvent(e){let{editorMode:t,apiIntegrationIdentifier:n,apiIntegrationAppVersion:i}=R.getState(),a=this.store.getState(),s=a.map,c=a.translation.profileId;if(!(t||!s||!n||!i||!c))try{let d=this.analyticsEventsService.convertMapToAnalyticsDocument(s);this.analyticsEventsService.sendDocumentAiTranslateEvent({name:"DOCUMENT__ON_DEMAND_TRANSLATE",offline:!1,appName:n,appVersion:i,sourceLanguage:this.parseLanguageToAnalyticsFormat(s.lang),destinationLanguage:this.parseLanguageToAnalyticsFormat(e.code),profileId:c,document:d})}catch(d){console.warn("Failed to send on-demand document translate event:",d)}}parseLanguageToAnalyticsFormat(e){if(!e)return;let t=e.split("-");return t.length===2?{languageCode:t[0],countryCode:t[1]}:{languageCode:t[0],countryCode:""}}};var Wo=class extends CustomEvent{constructor(e,t){super("ft-reader-map-loaded",{detail:{map:e,toc:t}})}},jo=class extends CustomEvent{constructor(e,t){super("ft-reader-visible-topics-change",{detail:{visibleTopics:t}})}},Go=class extends CustomEvent{constructor(e){super("ft-reader-navigation-done",{detail:e})}},Vo=class extends CustomEvent{constructor(e){super("ft-reader-load-error",{detail:e})}},Ko=class extends Event{constructor(){super("ft-reader-map-not-found")}},Zo=class extends Event{constructor(){super("ft-reader-map-unauthorized")}},qo=class extends Event{constructor(){super("ft-reader-map-forbidden")}},Yo=class extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}};var pe=function(r,e,t,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(s=r[c])&&(a=(i<3?s(a):i>3?s(e,t,a):s(e,t))||a);return i>3&&a&&Object.defineProperty(e,t,a),a},Na=class{constructor(e){this.stateManager=e}searchInDocument(e){this.stateManager.setSearchInDocumentQuery(e??"")}},Q=class extends Et{constructor(){super(),this.visibleTopics=[],this.updateConfiguration=()=>{this.stateManager.reloadConfiguration()},this.scrollToTargetDebouncer=new Y(5),this.navigationDebouncer=new Y(10),this.mapLoadedEventDebouncer=new Y(50),this.addStore(R)}render(){return j`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-content-watermark": "2.0.
|
|
23
|
-
"@fluid-topics/ft-infinite-scroll": "2.0.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-content": "2.0.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-context": "2.0.
|
|
26
|
-
"@fluid-topics/ft-reader-topic-title": "2.0.
|
|
27
|
-
"@fluid-topics/ft-wc-utils": "2.0.
|
|
22
|
+
"@fluid-topics/ft-content-watermark": "2.0.12",
|
|
23
|
+
"@fluid-topics/ft-infinite-scroll": "2.0.12",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-content": "2.0.12",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-context": "2.0.12",
|
|
26
|
+
"@fluid-topics/ft-reader-topic-title": "2.0.12",
|
|
27
|
+
"@fluid-topics/ft-wc-utils": "2.0.12",
|
|
28
28
|
"lit": "3.1.0"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "4811b3ed72672d41022c271d4a0d1db15b458aca"
|
|
31
31
|
}
|