@fluid-topics/ft-reader-toc 1.2.73 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1214,7 +1214,7 @@ Also for action icons.`,s.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
|
|
|
1214
1214
|
`;var Eo=v(L());var rl=v(L());var Ts=v(H()),Se=v(te()),De=v(L());var As=v(H());var Rs=As.css`
|
|
1215
1215
|
`;var Qr=v(L()),ql="ft-app-info",cn=class extends CustomEvent{constructor(r){super("authentication-change",{detail:r})}},Yl={session:(e,r)=>{(0,Qr.deepEqual)(e.session,r.payload)||(e.session=r.payload,setTimeout(()=>P.dispatchEvent(new cn(r.payload)),0))}},P=Qr.FtReduxStore.get({name:ql,reducers:Yl,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var Ge=v(L());var ln=v(L());var Rt=class e{static get(r){let{baseUrl:o,apiIntegrationIdentifier:n}=P.getState(),a=r??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(r){return new Promise(o=>{let n=e.get(r);if(n)o(n);else{let a=P.subscribe(()=>{n=e.get(r),n&&(a(),o(n))})}})}};var Or=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:Rt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Rt.await()}};var dt=class extends Or{constructor(r=!0,o){var n;super(o);let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new ln.CacheRegistry,this.cache=r?a.commonCache:new ln.CacheRegistry}clearCache(){this.cache.clearAll()}};var Ns,Xl=Symbol("clearAfterUnitTest"),eo=class extends dt{constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ns]=()=>{this.defaultMessages={},this.cache=new Ge.CacheRegistry,this.listeners={}},this.currentUiLocale=P.getState().uiLocale,P.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:r}=P.getState();this.currentUiLocale!==r&&(this.currentUiLocale=r,this.cache.clearAll(),this.notifyAll())}addContext(r){let o=r.name.toLowerCase();this.cache.setFinal(o,r),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(r,o){var n;if(r=r.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[r])!==null&&n!==void 0?n:{},...o};(0,Ge.deepEqual)(this.defaultMessages[r],a)||(this.defaultMessages[r]=a,await this.notify(r))}return this.fetchContext(r)}resolveContext(r){var o,n;return this.fetchContext(r),(n=(o=this.cache.getNow(r))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(r,o){let n=r.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(r,o,...n){var a;let i=r.toLowerCase(),c=this.resolveContext(i);return new Ge.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},c).resolve(o,...n)}async fetchContext(r){let o=!this.cache.has(r),n;try{n=await this.cache.get(r,()=>this.messageContextProvider(this.currentUiLocale,r))}catch(a){!(a instanceof Ge.CanceledPromiseError)&&o&&console.error(a)}return o&&await this.notify(r),n}subscribe(r,o){var n;return r=r.toLowerCase(),this.listeners[r]=(n=this.listeners[r])!==null&&n!==void 0?n:new Set,this.listeners[r].add(o),()=>{var a;return(a=this.listeners[r])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(r=>this.notify(r)))}async notify(r){this.listeners[r]!=null&&await Promise.all([...this.listeners[r].values()].map(o=>(0,Ge.delay)(0).then(()=>o()).catch(()=>null)))}};Ns=Xl;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends eo{constructor(){super(async(e,r)=>(await this.awaitApi).getFluidTopicsMessageContext(e,r))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends eo{constructor(){super(async(e,r)=>(await this.awaitApi).getCustomMessageContext(e,r))}});var Yt=window.FluidTopicsI18nService,to=window.FluidTopicsCustomI18nService;var de=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},J=class extends De.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Rt.get(),this.messageContexts=[],this.cache=new De.CacheRegistry,this.cleanSessionDebouncer=new De.Debouncer}render(){return Ts.html`
|
|
1216
1216
|
<slot></slot>
|
|
1217
|
-
`}update(r){var o,n,a,i,c;super.update(r),r.has("baseUrl")&&(P.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&P.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("uiLocale")&&P.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&P.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&P.actions.noCustom(this.noCustom),r.has("editorMode")&&P.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&P.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&P.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(d=>Yt.addContext(d)),r.has("openExternalDocumentInNewTab")&&P.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&P.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&P.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(P.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),P.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),P.actions.searchInAllLanguagesAllowed((c=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},r.idleTimeoutInMillis),r})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};J.elementDefinitions={};J.styles=Rs;de([(0,Se.property)()],J.prototype,"baseUrl",void 0);de([(0,Se.property)()],J.prototype,"apiIntegrationIdentifier",void 0);de([(0,Se.property)()],J.prototype,"uiLocale",void 0);de([(0,De.jsonProperty)(null)],J.prototype,"availableUiLocales",void 0);de([(0,De.jsonProperty)(null)],J.prototype,"metadataConfiguration",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"editorMode",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"noCustom",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"openExternalDocumentInNewTab",void 0);de([(0,Se.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],J.prototype,"noCustomComponent",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"withManualResources",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"navigatorOnline",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"forcedOffline",void 0);de([(0,Se.property)({type:Object})],J.prototype,"apiProvider",void 0);de([(0,De.jsonProperty)([])],J.prototype,"messageContexts",void 0);de([(0,De.jsonProperty)(void 0)],J.prototype,"session",void 0);de([(0,Se.state)()],J.prototype,"localesConfiguration",void 0);var Md=v(te());function Jl(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,n,a;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!ro(e[n],r[n]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(n of e.entries())if(!r.has(n[0]))return!1;for(n of e.entries())if(!ro(n[1],r.get(n[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(n of e.entries())if(!r.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();let i=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=i(e),o=a.length,o!==i(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=o;n--!==0;){let c=a[n];if(!ro(e[c],r[c]))return!1}return!0}return e!==e&&r!==r||e==null&&r==null}function ro(e,r){try{return Jl(e,r)}catch{return!1}}function oo(e,r){return!ro(e,r)}var Ql=v(te(),1);var no=class{constructor(){this.queue=[]}add(r,o=!1){o&&this.clear(r.type),this.queue.push(r)}consume(r){let o=this.queue.find(n=>n.type===r);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(r){typeof r=="string"?this.queue=this.queue.filter(o=>o.type!==r):this.queue=this.queue.filter(o=>!r.test(o.type))}};var Xt=v(te(),1);var Is=v(te(),1);function Ls(e,r){let o=()=>JSON.parse(JSON.stringify(e));return(0,Is.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:oo,...r??{}})}var ao=class{constructor(r=0){this.timeout=r,this.callbacks=[]}run(r,o){return this.callbacks=[r],this.debounce(o)}queue(r,o){return this.callbacks.push(r),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(r){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),r??this.timeout),this.promise}async runCallbacks(){var r,o;let n=[...this.callbacks];this.callbacks=[];let a=(r=this.rejectPromise)!==null&&r!==void 0?r:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ps=v(H(),1);var io=globalThis,ed=io.ShadowRoot&&(io.ShadyCSS===void 0||io.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_b=Symbol();var _s=(e,r)=>{if(ed)e.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=io.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,e.appendChild(n)}};var so=class extends Ps.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,i])=>r.registry.define(a,i)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return _s(n,r.elementStyles),n}};function ks(e,r,...o){var n;let a=e.querySelector(r);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var Cr=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},Ms,Ds=Symbol("constructorPrototype"),Bs=Symbol("constructorName"),$s=Symbol("exportpartsDebouncer"),Us=Symbol("dynamicDependenciesLoaded"),Qe=class extends so{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ms]=new ao(5),this[Bs]=this.constructor.name,this[Ds]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Bs]&&Object.setPrototypeOf(this,this[Ds])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let r=this.constructor;r[Us]||(r[Us]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(r){super.updated(r),this.updateComplete.then(()=>{this.contentAvailableCallback(r),this.focusElementToFocus(r),this.applyCustomStylesheet(r),this.scheduleExportpartsUpdate()})}contentAvailableCallback(r){}focusElementToFocus(r){if(r.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=ks(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(r){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var r,o,n;(!((r=this.exportpartsPrefix)===null||r===void 0)&&r.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[$s].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(r){var o,n,a,i,c,d;let p=g=>g!=null&&g.trim().length>0,u=r.filter(p).map(g=>g.trim());if(u.length===0){this.removeAttribute("exportparts");return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],x=(d=(c=g.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(O=>O.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...S,...x).filter(p).map(O=>O.trim()).forEach(O=>m.add(O))}if(m.size===0){this.removeAttribute("exportparts");return}let h=[...m.values()].flatMap(g=>u.map(S=>`${g}:${S}--${g}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};Ms=$s;Cr([(0,Xt.property)()],Qe.prototype,"exportpartsPrefix",void 0);Cr([Ls([])],Qe.prototype,"exportpartsPrefixes",void 0);Cr([(0,Xt.property)()],Qe.prototype,"customStylesheet",void 0);Cr([(0,Xt.property)()],Qe.prototype,"elementToFocus",void 0);Cr([(0,Xt.state)()],Qe.prototype,"useAdoptedStyleSheets",void 0);function Er(e){var r;return(r=e?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Ws,Hs,Fs,wr=Symbol("internalReduxEventsUnsubscribers"),pt=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores"),Ar=class extends Qe{constructor(){super(...arguments),this[Ws]=new Map,this[Hs]=new Map,this[Fs]=new Map}get reduxConstructor(){return this.constructor}update(r){super.update(r),[...this.reduxConstructor.reduxReactiveProperties].some(o=>r.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(r){return r==null?this.getUnnamedStore():this[Nt].get(r)}addStore(r,o){var n;o=(n=o??(Er(r)?r.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(o),this[Nt].set(o,r),this.subscribeToStore(o,r),this.updateFromStores()}removeStore(r){let o=typeof r=="string"?r:r.name;this.unsubscribeFromStore(o),this[Nt].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach((r,o)=>this.subscribeToStore(o,r)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((r,o)=>{let n=this.constructor.getPropertyOptions(o);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:o)){let a=this.getStore(r.store);a&&(r.store?this[pt].has(r.store):this[pt].size>0)&&(this[o]=r.selector(a.getState(),this))}})}subscribeToStore(r,o){var n;this[pt].set(r,o.subscribe(()=>this.updateFromStores())),this[wr].set(r,[]),Er(o)&&o.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((a,i)=>{if(typeof this[i]=="function"&&(!a.store||o.name===a.store)){let c=d=>this[i](d);o.addEventListener(a.eventName,c),this[wr].get(r).push(()=>o.removeEventListener(a.eventName,c))}})),this.onStoreAvailable(r)}unsubscribeFromStores(){this[pt].forEach((r,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(r){var o;this[pt].has(r)&&this[pt].get(r)(),this[pt].delete(r),(o=this[wr].get(r))===null||o===void 0||o.forEach(n=>n()),this[wr].delete(r)}onStoreAvailable(r){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Ws=pt,Hs=Nt,Fs=wr;Ar.reduxProperties=new Map;Ar.reduxReactiveProperties=new Set;Ar.reduxEventListeners=new Map;function Te(e){for(var r=arguments.length,o=Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function et(e){return!!e&&!!e[Z]}function Be(e){var r;return!!e&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===cd}(e)||Array.isArray(e)||!!e[qs]||!!(!((r=e.constructor)===null||r===void 0)&&r[qs])||bn(e)||xn(e))}function Tt(e,r,o){o===void 0&&(o=!1),er(e)===0?(o?Object.keys:Qt)(e).forEach(function(n){o&&typeof n=="symbol"||r(n,e[n],e)}):e.forEach(function(n,a){return r(a,n,e)})}function er(e){var r=e[Z];return r?r.i>3?r.i-4:r.i:Array.isArray(e)?1:bn(e)?2:xn(e)?3:0}function Jt(e,r){return er(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function td(e,r){return er(e)===2?e.get(r):e[r]}function Ys(e,r,o){var n=er(e);n===2?e.set(r,o):n===3?e.add(o):e[r]=o}function Xs(e,r){return e===r?e!==0||1/e==1/r:e!=e&&r!=r}function bn(e){return id&&e instanceof Map}function xn(e){return sd&&e instanceof Set}function ut(e){return e.o||e.t}function vn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var r=ec(e);delete r[Z];for(var o=Qt(r),n=0;n<o.length;n++){var a=o[n],i=r[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),r)}function Sn(e,r){return r===void 0&&(r=!1),On(e)||et(e)||!Be(e)||(er(e)>1&&(e.set=e.add=e.clear=e.delete=rd),Object.freeze(e),r&&Tt(e,function(o,n){return Sn(n,!0)},!0)),e}function rd(){Te(2)}function On(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function je(e){var r=gn[e];return r||Te(18,e),r}function od(e,r){gn[e]||(gn[e]=r)}function hn(){return Nr}function dn(e,r){r&&(je("Patches"),e.u=[],e.s=[],e.v=r)}function co(e){yn(e),e.p.forEach(nd),e.p=null}function yn(e){e===Nr&&(Nr=e.l)}function zs(e){return Nr={p:[],l:Nr,h:e,m:!0,_:0}}function nd(e){var r=e[Z];r.i===0||r.i===1?r.j():r.g=!0}function pn(e,r){r._=r.p.length;var o=r.p[0],n=e!==void 0&&e!==o;return r.h.O||je("ES5").S(r,e,n),n?(o[Z].P&&(co(r),Te(4)),Be(e)&&(e=lo(r,e),r.l||po(r,e)),r.u&&je("Patches").M(o[Z].t,e,r.u,r.s)):e=lo(r,o,[]),co(r),r.u&&r.v(r.u,r.s),e!==Qs?e:void 0}function lo(e,r,o){if(On(r))return r;var n=r[Z];if(!n)return Tt(r,function(d,p){return Gs(e,n,r,d,p,o)},!0),r;if(n.A!==e)return r;if(!n.P)return po(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=vn(n.k):n.o,i=a,c=!1;n.i===3&&(i=new Set(a),a.clear(),c=!0),Tt(i,function(d,p){return Gs(e,n,a,d,p,o,c)}),po(e,a,!1),o&&e.u&&je("Patches").N(n,o,e.u,e.s)}return n.o}function Gs(e,r,o,n,a,i,c){if(et(a)){var d=lo(e,a,i&&r&&r.i!==3&&!Jt(r.R,n)?i.concat(n):void 0);if(Ys(o,n,d),!et(d))return;e.m=!1}else c&&o.add(a);if(Be(a)&&!On(a)){if(!e.h.D&&e._<1)return;lo(e,a),r&&r.A.l||po(e,a)}}function po(e,r,o){o===void 0&&(o=!1),!e.l&&e.h.D&&e.m&&Sn(r,o)}function un(e,r){var o=e[Z];return(o?ut(o):e)[r]}function js(e,r){if(r in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function ft(e){e.P||(e.P=!0,e.l&&ft(e.l))}function fn(e){e.o||(e.o=vn(e.t))}function mn(e,r,o){var n=bn(r)?je("MapSet").F(r,o):xn(r)?je("MapSet").T(r,o):e.O?function(a,i){var c=Array.isArray(a),d={i:c?1:0,A:i?i.A:hn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=d,u=Tr;c&&(p=[d],u=Rr);var m=Proxy.revocable(p,u),h=m.revoke,g=m.proxy;return d.k=g,d.j=h,g}(r,o):je("ES5").J(r,o);return(o?o.A:hn()).p.push(n),n}function ad(e){return et(e)||Te(22,e),function r(o){if(!Be(o))return o;var n,a=o[Z],i=er(o);if(a){if(!a.P&&(a.i<4||!je("ES5").K(a)))return a.t;a.I=!0,n=Vs(o,i),a.I=!1}else n=Vs(o,i);return Tt(n,function(c,d){a&&td(a.t,c)===d||Ys(n,c,r(d))}),i===3?new Set(n):n}(e)}function Vs(e,r){switch(r){case 2:return new Map(e);case 3:return Array.from(e)}return vn(e)}function Js(){function e(c,d){var p=i[c];return p?p.enumerable=d:i[c]=p={configurable:!0,enumerable:d,get:function(){var u=this[Z];return Tr.get(u,c)},set:function(u){var m=this[Z];Tr.set(m,c,u)}},p}function r(c){for(var d=c.length-1;d>=0;d--){var p=c[d][Z];if(!p.P)switch(p.i){case 5:n(p)&&ft(p);break;case 4:o(p)&&ft(p)}}}function o(c){for(var d=c.t,p=c.k,u=Qt(p),m=u.length-1;m>=0;m--){var h=u[m];if(h!==Z){var g=d[h];if(g===void 0&&!Jt(d,h))return!0;var S=p[h],x=S&&S[Z];if(x?x.t!==g:!Xs(S,g))return!0}}var O=!!d[Z];return u.length!==Qt(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var u=0;u<d.length;u++)if(!d.hasOwnProperty(u))return!0;return!1}function a(c){c.g&&Te(3,JSON.stringify(ut(c)))}var i={};od("ES5",{J:function(c,d){var p=Array.isArray(c),u=function(h,g){if(h){for(var S=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(S,""+x,e(x,!0));return S}var O=ec(g);delete O[Z];for(var I=Qt(O),R=0;R<I.length;R++){var N=I[R];O[N]=e(N,h||!!O[N].enumerable)}return Object.create(Object.getPrototypeOf(g),O)}(p,c),m={i:p?5:4,A:d?d.A:hn(),P:!1,I:!1,R:{},l:d,t:c,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Z,{value:m,writable:!0}),u},S:function(c,d,p){p?et(d)&&d[Z].A===c&&r(c.p):(c.u&&function u(m){if(m&&typeof m=="object"){var h=m[Z];if(h){var g=h.t,S=h.k,x=h.R,O=h.i;if(O===4)Tt(S,function(B){B!==Z&&(g[B]!==void 0||Jt(g,B)?x[B]||u(S[B]):(x[B]=!0,ft(h)))}),Tt(g,function(B){S[B]!==void 0||Jt(S,B)||(x[B]=!1,ft(h))});else if(O===5){if(n(h)&&(ft(h),x.length=!0),S.length<g.length)for(var I=S.length;I<g.length;I++)x[I]=!1;else for(var R=g.length;R<S.length;R++)x[R]=!0;for(var N=Math.min(S.length,g.length),k=0;k<N;k++)S.hasOwnProperty(k)||(x[k]=!0),x[k]===void 0&&u(S[k])}}}}(c.p[0]),r(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var Ks,Nr,Cn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",id=typeof Map<"u",sd=typeof Set<"u",Zs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Qs=Cn?Symbol.for("immer-nothing"):((Ks={})["immer-nothing"]=!0,Ks),qs=Cn?Symbol.for("immer-draftable"):"__$immer_draftable",Z=Cn?Symbol.for("immer-state"):"__$immer_state";var cd=""+Object.prototype.constructor,Qt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ec=Object.getOwnPropertyDescriptors||function(e){var r={};return Qt(e).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(e,o)}),r},gn={},Tr={get:function(e,r){if(r===Z)return e;var o=ut(e);if(!Jt(o,r))return function(a,i,c){var d,p=js(i,c);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(e,o,r);var n=o[r];return e.I||!Be(n)?n:n===un(e.t,r)?(fn(e),e.o[r]=mn(e.A.h,n,e)):n},has:function(e,r){return r in ut(e)},ownKeys:function(e){return Reflect.ownKeys(ut(e))},set:function(e,r,o){var n=js(ut(e),r);if(n?.set)return n.set.call(e.k,o),!0;if(!e.P){var a=un(ut(e),r),i=a?.[Z];if(i&&i.t===o)return e.o[r]=o,e.R[r]=!1,!0;if(Xs(o,a)&&(o!==void 0||Jt(e.t,r)))return!0;fn(e),ft(e)}return e.o[r]===o&&(o!==void 0||r in e.o)||Number.isNaN(o)&&Number.isNaN(e.o[r])||(e.o[r]=o,e.R[r]=!0),!0},deleteProperty:function(e,r){return un(e.t,r)!==void 0||r in e.t?(e.R[r]=!1,fn(e),ft(e)):delete e.R[r],e.o&&delete e.o[r],!0},getOwnPropertyDescriptor:function(e,r){var o=ut(e),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:e.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){Te(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Te(12)}},Rr={};Tt(Tr,function(e,r){Rr[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Rr.deleteProperty=function(e,r){return Rr.set.call(this,e,r,void 0)},Rr.set=function(e,r,o){return Tr.set.call(this,e[0],r,o,e[0])};var ld=function(){function e(o){var n=this;this.O=Zs,this.D=!0,this.produce=function(a,i,c){if(typeof a=="function"&&typeof i!="function"){var d=i;i=a;var p=n;return function(O){var I=this;O===void 0&&(O=d);for(var R=arguments.length,N=Array(R>1?R-1:0),k=1;k<R;k++)N[k-1]=arguments[k];return p.produce(O,function(B){var U;return(U=i).call.apply(U,[I,B].concat(N))})}}var u;if(typeof i!="function"&&Te(6),c!==void 0&&typeof c!="function"&&Te(7),Be(a)){var m=zs(n),h=mn(n,a,void 0),g=!0;try{u=i(h),g=!1}finally{g?co(m):yn(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return dn(m,c),pn(O,m)},function(O){throw co(m),O}):(dn(m,c),pn(u,m))}if(!a||typeof a!="object"){if((u=i(a))===void 0&&(u=a),u===Qs&&(u=void 0),n.D&&Sn(u,!0),c){var S=[],x=[];je("Patches").M(a,u,S,x),c(S,x)}return u}Te(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(u){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(u,function(S){return a.apply(void 0,[S].concat(h))})};var c,d,p=n.produce(a,i,function(u,m){c=u,d=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,c,d]}):[p,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var r=e.prototype;return r.createDraft=function(o){Be(o)||Te(8),et(o)&&(o=ad(o));var n=zs(this),a=mn(this,o,void 0);return a[Z].C=!0,yn(n),a},r.finishDraft=function(o,n){var a=o&&o[Z],i=a.A;return dn(i,n),pn(void 0,i)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Zs&&Te(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var c=je("Patches").$;return et(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},e}(),Re=new ld,dd=Re.produce,Vb=Re.produceWithPatches.bind(Re),Kb=Re.setAutoFreeze.bind(Re),Zb=Re.setUseProxies.bind(Re),qb=Re.applyPatches.bind(Re),Yb=Re.createDraft.bind(Re),Xb=Re.finishDraft.bind(Re),uo=dd;function It(e){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},It(e)}function tc(e,r){if(It(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,r||"default");if(It(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function rc(e){var r=tc(e,"string");return It(r)=="symbol"?r:r+""}function oc(e,r,o){return(r=rc(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function nc(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,n)}return o}function En(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?nc(Object(o),!0).forEach(function(n){oc(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):nc(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function pe(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ac=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),wn=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+wn(),REPLACE:"@@redux/REPLACE"+wn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+wn()}};function pd(e){if(typeof e!="object"||e===null)return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function An(e,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(pe(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(pe(1));return o(An)(e,r)}if(typeof e!="function")throw new Error(pe(2));var a=e,i=r,c=[],d=c,p=!1;function u(){d===c&&(d=c.slice())}function m(){if(p)throw new Error(pe(3));return i}function h(O){if(typeof O!="function")throw new Error(pe(4));if(p)throw new Error(pe(5));var I=!0;return u(),d.push(O),function(){if(I){if(p)throw new Error(pe(6));I=!1,u();var N=d.indexOf(O);d.splice(N,1),c=null}}}function g(O){if(!pd(O))throw new Error(pe(7));if(typeof O.type>"u")throw new Error(pe(8));if(p)throw new Error(pe(9));try{p=!0,i=a(i,O)}finally{p=!1}for(var I=c=d,R=0;R<I.length;R++){var N=I[R];N()}return O}function S(O){if(typeof O!="function")throw new Error(pe(10));a=O,g({type:fo.REPLACE})}function x(){var O,I=h;return O={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(pe(11));function k(){N.next&&N.next(m())}k();var B=I(k);return{unsubscribe:B}}},O[ac]=function(){return this},O}return g({type:fo.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[ac]=x,n}function ud(e){Object.keys(e).forEach(function(r){var o=e[r],n=o(void 0,{type:fo.INIT});if(typeof n>"u")throw new Error(pe(12));if(typeof o(void 0,{type:fo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pe(13))})}function ic(e){for(var r=Object.keys(e),o={},n=0;n<r.length;n++){var a=r[n];typeof e[a]=="function"&&(o[a]=e[a])}var i=Object.keys(o),c,d;try{ud(o)}catch(p){d=p}return function(u,m){if(u===void 0&&(u={}),d)throw d;if(0)var h;for(var g=!1,S={},x=0;x<i.length;x++){var O=i[x],I=o[O],R=u[O],N=I(R,m);if(typeof N>"u"){var k=m&&m.type;throw new Error(pe(14))}S[O]=N,g=g||N!==R}return g=g||i.length!==Object.keys(u).length,g?S:u}}function tr(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return r.length===0?function(n){return n}:r.length===1?r[0]:r.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function sc(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(pe(15))},c={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},d=r.map(function(p){return p(c)});return i=tr.apply(void 0,d)(a.dispatch),En(En({},a),{},{dispatch:i})}}}function cc(e){var r=function(n){var a=n.dispatch,i=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,i,e):c(d)}}};return r}var lc=cc();lc.withExtraArgument=cc;var Rn=lc;var hc=function(){var e=function(r,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(r,o);function n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),fd=function(e,r){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(u){return function(m){return p([u,m])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=r.call(e,o)}catch(m){u=[6,m],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rr=function(e,r){for(var o=0,n=r.length,a=e.length;o<n;o++,a++)e[a]=r[o];return e},hd=Object.defineProperty,yd=Object.defineProperties,md=Object.getOwnPropertyDescriptors,dc=Object.getOwnPropertySymbols,gd=Object.prototype.hasOwnProperty,bd=Object.prototype.propertyIsEnumerable,pc=function(e,r,o){return r in e?hd(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o},ht=function(e,r){for(var o in r||(r={}))gd.call(r,o)&&pc(e,o,r[o]);if(dc)for(var n=0,a=dc(r);n<a.length;n++){var o=a[n];bd.call(r,o)&&pc(e,o,r[o])}return e},Nn=function(e,r){return yd(e,md(r))},xd=function(e,r,o){return new Promise(function(n,a){var i=function(p){try{d(o.next(p))}catch(u){a(u)}},c=function(p){try{d(o.throw(p))}catch(u){a(u)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,c)};d((o=o.apply(e,r)).next())})};var vd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?tr:tr.apply(null,arguments)},yx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Sd(e){if(typeof e!="object"||e===null)return!1;var r=Object.getPrototypeOf(e);if(r===null)return!0;for(var o=r;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return r===o}var Od=function(e){hc(r,e);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,rr([void 0],o[0].concat(this)))):new(r.bind.apply(r,rr([void 0],o.concat(this))))},r}(Array),Cd=function(e){hc(r,e);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,rr([void 0],o[0].concat(this)))):new(r.bind.apply(r,rr([void 0],o.concat(this))))},r}(Array);function Ln(e){return Be(e)?uo(e,function(){}):e}function Ed(e){return typeof e=="boolean"}function wd(){return function(r){return Ad(r)}}function Ad(e){e===void 0&&(e={});var r=e.thunk,o=r===void 0?!0:r,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,c=i===void 0?!0:i,d=new Od;if(o&&(Ed(o)?d.push(Rn):d.push(Rn.withExtraArgument(o.extraArgument))),0){if(a)var p;if(c)var u}return d}var Tn=!0;function yc(e){var r=wd(),o=e||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,c=i===void 0?r():i,d=o.devTools,p=d===void 0?!0:d,u=o.preloadedState,m=u===void 0?void 0:u,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(Sd(a))S=ic(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 x=c;if(typeof x=="function"&&(x=x(r),!Tn&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Tn&&x.some(function(B){return typeof B!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=sc.apply(void 0,x),I=tr;p&&(I=vd(ht({trace:!Tn},typeof p=="object"&&p)));var R=new Cd(O),N=R;Array.isArray(g)?N=rr([O],g):typeof g=="function"&&(N=g(R));var k=I.apply(void 0,N);return An(S,m,k)}function yt(e,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var i=r.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return ht(ht({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return o.toString=function(){return""+e},o.type=e,o.match=function(n){return n.type===e},o}function mc(e){var r={},o=[],n,a={addCase:function(i,c){var d=typeof i=="string"?i:i.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=c,a},addMatcher:function(i,c){return o.push({matcher:i,reducer:c}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[r,o,n]}function Rd(e){return typeof e=="function"}function Nd(e,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?mc(r):[r,o,n],i=a[0],c=a[1],d=a[2],p;if(Rd(e))p=function(){return Ln(e())};else{var u=Ln(e);p=function(){return u}}function m(h,g){h===void 0&&(h=p());var S=rr([i[g.type]],c.filter(function(x){var O=x.matcher;return O(g)}).map(function(x){var O=x.reducer;return O}));return S.filter(function(x){return!!x}).length===0&&(S=[d]),S.reduce(function(x,O){if(O)if(et(x)){var I=x,R=O(I,g);return R===void 0?x:R}else{if(Be(x))return uo(x,function(N){return O(N,g)});var R=O(x,g);if(R===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}return x},h)}return m.getInitialState=p,m}function Td(e,r){return e+"/"+r}function gc(e){var r=e.name;if(!r)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof e.initialState=="function"?e.initialState:Ln(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},c={},d={};a.forEach(function(m){var h=n[m],g=Td(r,m),S,x;"reducer"in h?(S=h.reducer,x=h.prepare):S=h,i[m]=S,c[g]=S,d[m]=x?yt(g,x):yt(g)});function p(){var m=typeof e.extraReducers=="function"?mc(e.extraReducers):[e.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],x=S===void 0?[]:S,O=m[2],I=O===void 0?void 0:O,R=ht(ht({},g),c);return Nd(o,function(N){for(var k in R)N.addCase(k,R[k]);for(var B=0,U=x;B<U.length;B++){var ye=U[B];N.addMatcher(ye.matcher,ye.reducer)}I&&N.addDefaultCase(I)})}var u;return{name:r,reducer:function(m,h){return u||(u=p()),u(m,h)},actions:d,caseReducers:i,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Id="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ld=function(e){e===void 0&&(e=21);for(var r="",o=e;o--;)r+=Id[Math.random()*64|0];return r},_d=["name","message","stack","code"],In=function(){function e(r,o){this.payload=r,this.meta=o}return e}(),uc=function(){function e(r,o){this.payload=r,this.meta=o}return e}(),Pd=function(e){if(typeof e=="object"&&e!==null){for(var r={},o=0,n=_d;o<n.length;o++){var a=n[o];typeof e[a]=="string"&&(r[a]=e[a])}return r}return{message:String(e)}},xx=function(){function e(r,o,n){var a=yt(r+"/fulfilled",function(m,h,g,S){return{payload:m,meta:Nn(ht({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=yt(r+"/pending",function(m,h,g){return{payload:void 0,meta:Nn(ht({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),c=yt(r+"/rejected",function(m,h,g,S,x){return{payload:S,error:(n&&n.serializeError||Pd)(m||"Rejected"),meta:Nn(ht({},x||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),d=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(h,g,S){var x=n?.idGenerator?n.idGenerator(m):Ld(),O=new p,I,R=!1;function N(B){I=B,O.abort()}var k=function(){return xd(this,null,function(){var B,U,ye,$e,ue,We,ie;return fd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),$e=(B=n?.condition)==null?void 0:B.call(n,m,{getState:g,extra:S}),Dd($e)?[4,$e]:[3,2];case 1:$e=y.sent(),y.label=2;case 2:if($e===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return R=!0,ue=new Promise(function(b,_){return O.signal.addEventListener("abort",function(){return _({name:"AbortError",message:I||"Aborted"})})}),h(i(x,m,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:x,arg:m},{getState:g,extra:S}))),[4,Promise.race([ue,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:x,signal:O.signal,abort:N,rejectWithValue:function(b,_){return new In(b,_)},fulfillWithValue:function(b,_){return new uc(b,_)}})).then(function(b){if(b instanceof In)throw b;return b instanceof uc?a(b.payload,x,m,b.meta):a(b,x,m)})])];case 3:return ye=y.sent(),[3,5];case 4:return We=y.sent(),ye=We instanceof In?c(null,x,m,We.payload,We.meta):c(We,x,m),[3,5];case 5:return ie=n&&!n.dispatchConditionRejection&&c.match(ye)&&ye.meta.condition,ie||h(ye),[2,ye]}})})}();return Object.assign(k,{abort:N,requestId:x,arg:m,unwrap:function(){return k.then(kd)}})}}return Object.assign(u,{pending:i,rejected:c,fulfilled:a,typePrefix:r})}return e.withTypes=function(){return e},e}();function kd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Dd(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var bc="listener",xc="completed",vc="cancelled",vx="task-"+vc,Sx="task-"+xc,Ox=bc+"-"+vc,Cx=bc+"-"+xc;var _n="listenerMiddleware";var Ex=yt(_n+"/add"),wx=yt(_n+"/removeAll"),Ax=yt(_n+"/remove");var fc,Rx=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(fc||(fc=Promise.resolve())).then(e).catch(function(r){return setTimeout(function(){throw r},0)})},Bd=function(e){return function(r){setTimeout(r,e)}},Nx=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Bd(10);Js();function Ud(e,r){return class extends e{constructor(){super(...arguments),this.eventBus=r??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}var ho=class extends Ud(Object){};window.ftReduxStores||(window.ftReduxStores={});var Sc=class e extends ho{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,i=window.ftReduxStores[n];if(Er(i))return i;if(a==null)return;let c=gc({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=yc({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:c.reducer(p,u)});return window.ftReduxStores[a.name]=new e(c,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new no;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,c,d)=>{let p=c,u=i[p];return u?(...m)=>{let h=u(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[p]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(r){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(r).join("_"),overwrites:r})}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(r){throw new Error("Not implemented yet.")}subscribe(r){return this.reduxStore.subscribe(r)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var vo=v(L());var Wd=v(Cc(),1);var Ec;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Ec||(Ec={}));var wc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(wc||(wc={}));var Ac;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.MAP_ATTACHMENT="MAP_ATTACHMENT",e.RESOURCE="RESOURCE"})(Ac||(Ac={}));var Rc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.MAP_ATTACHMENT="MAP_ATTACHMENT",e.RESOURCE="RESOURCE"})(Rc||(Rc={}));var Nc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Nc||(Nc={}));var Tc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Tc||(Tc={}));var Ic;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",e.GEN_AI__RATE="GEN_AI__RATE",e.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",e.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__DISPLAY="TOPIC__DISPLAY",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(Ic||(Ic={}));var Lc;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(Lc||(Lc={}));var _c;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT"})(_c||(_c={}));var Pc;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Pc||(Pc={}));var kc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(kc||(kc={}));var Dc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Dc||(Dc={}));var Bc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Bc||(Bc={}));var Uc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Uc||(Uc={}));var Mc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Mc||(Mc={}));var $c;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($c||($c={}));var Wc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Wc||(Wc={}));var Hc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Hc||(Hc={}));var Fc;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Fc||(Fc={}));var zc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK"})(zc||(zc={}));var Gc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Gc||(Gc={}));var jc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC"})(jc||(jc={}));var Vc;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Vc||(Vc={}));var ne;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(ne||(ne={}));var Kc;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Kc||(Kc={}));var Zc;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Zc||(Zc={}));var qc;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(qc||(qc={}));var $d={[ne.PERSONAL_BOOK_SHARE_USER]:[ne.PERSONAL_BOOK_USER],[ne.HTML_EXPORT_USER]:[ne.PERSONAL_BOOK_USER],[ne.PDF_EXPORT_USER]:[ne.PERSONAL_BOOK_USER],[ne.KHUB_ADMIN]:[ne.CONTENT_PUBLISHER],[ne.ADMIN]:[ne.KHUB_ADMIN,ne.USERS_ADMIN,ne.PORTAL_ADMIN],[ne.GENERATIVE_AI_EXPORT_USER]:[ne.GENERATIVE_AI_USER]};function Yc(e,r){return e===r||($d[e]??[]).some(o=>Yc(o,r))}function Xc(e,r){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>Yc(n,r))}var go=class extends dt{async listMySearches(){let{session:r}=P.getState();return Xc(r,ne.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var bo=class extends dt{async listMyBookmarks(){let r=P.getState().session;return r?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(r.profile.userId),5*60*1e3):[]}};var Hd="ft-user-assets",xo=vo.FtReduxStore.get({name:Hd,initialState:{savedSearches:void 0,bookmarks:void 0}}),Pn=class{constructor(){this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new bo,this.savedSearchesService=new go,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=P.getState();(0,vo.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),xo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),xo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();xo.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var r;if(this.bookmarksAreUsed){let o=!((r=this.currentSession)===null||r===void 0)&&r.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;xo.actions.bookmarks(o)}}},Ev=new Pn;var kn=class{addCommand(r,o=!1){P.commands.add(r,o)}consumeCommand(r){return P.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new kn;var Jc=v(L()),Dn=class{highlightHtml(r,o,n){(0,Jc.highlightHtml)(r,o,n)}};window.FluidTopicsHighlightHtmlService=new Dn;var Qc=v(L());var Bn=class{isDate(r){var o,n,a,i;return(i=(a=((n=(o=P.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===r))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(r,o){var n,a,i;return Qc.DateFormatter.format(r,(n=o?.locale)!==null&&n!==void 0?n:P.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Bn;var el=v(L());var Ir=class{static get(r,o){var n,a,i,c;let d=P.getState(),{lang:p,region:u}=(a=(n=d.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new el.SearchPlaceConverter(d.baseUrl,(c=(i=window.FluidTopicsClientConfiguration)===null||i===void 0?void 0:i.predefinedSorts)!==null&&c!==void 0?c:{},r??20,d.searchInAllLanguagesAllowed,o??`${p}-${u}`)}};var Un=class{urlToSearchRequest(r){return Ir.get().parse(r)}searchRequestToUrl(r){return Ir.get().serialize(r)}};window.FluidTopicsUrlService=new Un;var gt=v(L());var Lt=class e extends CustomEvent{constructor(r){super(e.eventName,{detail:{currentItem:r}})}};Lt.eventName="change";var Mn=class{itemName(r){return`fluid-topics-history-item-${r}`}get(r){let o=sessionStorage.getItem(this.itemName(r));return o?JSON.parse(o):void 0}set(r,o){sessionStorage.setItem(this.itemName(r),JSON.stringify(o))}},tl=new Mn;var So=class e extends gt.WithEventBus{static build(){return new e(window.history,tl,()=>window.location,!1)}constructor(r,o,n,a){var i,c;super(),this.history=r,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=r.pushState,this.realReplaceState=r.replaceState,this.initialIndex=(c=(i=r.state)===null||i===void 0?void 0:i.index)!==null&&c!==void 0?c:r.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(r,o=!1){let n=o&&this.currentIndex===r.index-1;this.currentState={...this.buildCurrentState(),...r},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,gt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Lt(this.currentItem())),0)}installProxies(){let r=o=>(n,a,[i,c,d])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...i,index:p,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[u,c,d]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:r(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:r(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",r=>this.setCurrentState(r.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(r){for(let o=this.history.length-1;o>=0;o--)r?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(r,o=!1){var n,a,i;let c={...this.buildCurrentState(),...r,index:this.currentIndex,title:(n=r?.title)!==null&&n!==void 0?n:this.currentState.title},d=o?(a=r?.majorState)!==null&&a!==void 0?a:this.currentState.majorState:(i=this.currentState.majorState)!==null&&i!==void 0?i:r?.majorState;d!=null&&(c.majorState=d),this.setCurrentState(c)}addHistoryChangeListener(r){this.addEventListener(Lt.eventName,r)}removeHistoryChangeListener(r){this.removeEventListener(Lt.eventName,r)}currentItem(){return(0,gt.deepCopy)(this.currentState)}back(){let r=this.previousMajorPosition();r>=0?this.history.go(r-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,gt.deepCopy)(this.states[this.previousMajorPosition()])}previousMajorPosition(){let r=this.currentIndex;for(;r>0&&!this.isMajorState(r);)r--;return this.previousExistingPosition(r)}forward(){let r=this.nextMajorPosition();r<this.states.length?this.history.go(r-this.currentIndex):this.history.forward()}forwardItem(){return(0,gt.deepCopy)(this.states[this.nextMajorPosition()])}nextMajorPosition(){let r=this.currentIndex;do r++;while(r<this.states.length&&!this.isMajorState(r));do r++;while(r<this.states.length&&!this.isMajorState(r));return this.previousExistingPosition(r)}previousExistingPosition(r){let o=r;do o--;while(o>0&&!this.hasState(o));return o}buildCurrentState(){var r,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(r=this.history.state)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:document.title}}hasState(r){return this.states[r]!=null}isMajorState(r){var o,n;return this.hasState(r)&&((n=(o=this.states[r])===null||o===void 0?void 0:o.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=So.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});(0,rl.customElement)("ft-app-context")(J);var sl=v(te());var Fd=v(L());function ol(e){return e.match(/^[\w-]+\.[\w-]+$/)}var zd=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},nl=Symbol("i18nAttributes"),al=Symbol("i18nListAttributes"),cl=Symbol("i18nProperties"),Oo=Symbol("i18nContexts"),Lr=Symbol("i18nUnsubs");function wo(e){var r,o;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?to:Yt}i18n(i){var c;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let d=(c=i.args)!==null&&c!==void 0?c:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...d)}customI18n(i,c){if(ol(i)){let[d,p]=i.split(".");return this.i18n({custom:!0,context:d,key:p,...c})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((c,d,p)=>i.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((c,d,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(c=>c.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var c,d;let p=this,u=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,...m})}:g;(c=this[nl])===null||c===void 0||c.forEach((m,h)=>p[h]=u(m,h,p[h])),(d=this[al])===null||d===void 0||d.forEach((m,h)=>{var g;return p[h]=(g=p[h])===null||g===void 0?void 0:g.map(S=>u(m,h,S))})}updateI18nProperties(i){var c;(c=this[cl])===null||c===void 0||c.forEach((d,p)=>{i(d,p)&&(this[p]=this.i18n(d))})}addI18nMessages(i,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,c,d)}addI18nContext(i,c,d){let p=(typeof i=="string"?i:i.name).toLowerCase();d=typeof i=="string"?d:i.custom,this[Oo].set(p,{isCustomContext:d}),this[Lr].has(p)||this[Lr].set(p,this.getI18nService(d).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(d).prepareContext(p,c)}hasI18nContext(i){return this[Oo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Oo].forEach((i,c)=>this.addI18nContext(c,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Lr].forEach(i=>i()),this[Lr].clear()}}return r=Oo,o=Lr,zd([(0,sl.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var il=class extends wo(Eo.FtLitElement){},Co=class extends wo(Eo.FtLitElementRedux){};var _r=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},Ue=class extends Co{constructor(){super(),this.editorMode=!1,this.addStore(P)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Ao.nothing:Ao.html`
|
|
1217
|
+
`}update(r){var o,n,a,i,c;super.update(r),r.has("baseUrl")&&(P.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&P.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("uiLocale")&&P.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&P.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&P.actions.noCustom(this.noCustom),r.has("editorMode")&&P.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&P.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&P.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(d=>Yt.addContext(d)),r.has("openExternalDocumentInNewTab")&&P.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&P.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&P.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(P.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),P.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),P.actions.searchInAllLanguagesAllowed((c=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&c!==void 0?c:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},r.idleTimeoutInMillis),r})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};J.elementDefinitions={};J.styles=Rs;de([(0,Se.property)()],J.prototype,"baseUrl",void 0);de([(0,Se.property)()],J.prototype,"apiIntegrationIdentifier",void 0);de([(0,Se.property)()],J.prototype,"uiLocale",void 0);de([(0,De.jsonProperty)(null)],J.prototype,"availableUiLocales",void 0);de([(0,De.jsonProperty)(null)],J.prototype,"metadataConfiguration",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"editorMode",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"noCustom",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"openExternalDocumentInNewTab",void 0);de([(0,Se.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],J.prototype,"noCustomComponent",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"withManualResources",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"navigatorOnline",void 0);de([(0,Se.property)({type:Boolean})],J.prototype,"forcedOffline",void 0);de([(0,Se.property)({type:Object})],J.prototype,"apiProvider",void 0);de([(0,De.jsonProperty)([])],J.prototype,"messageContexts",void 0);de([(0,De.jsonProperty)(void 0)],J.prototype,"session",void 0);de([(0,Se.state)()],J.prototype,"localesConfiguration",void 0);var Md=v(te());function Jl(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,n,a;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!ro(e[n],r[n]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(n of e.entries())if(!r.has(n[0]))return!1;for(n of e.entries())if(!ro(n[1],r.get(n[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(n of e.entries())if(!r.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();let i=c=>Object.keys(c).filter(d=>c[d]!=null);if(a=i(e),o=a.length,o!==i(r).length)return!1;for(n=o;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=o;n--!==0;){let c=a[n];if(!ro(e[c],r[c]))return!1}return!0}return e!==e&&r!==r||e==null&&r==null}function ro(e,r){try{return Jl(e,r)}catch{return!1}}function oo(e,r){return!ro(e,r)}var Ql=v(te(),1);var no=class{constructor(){this.queue=[]}add(r,o=!1){o&&this.clear(r.type),this.queue.push(r)}consume(r){let o=this.queue.find(n=>n.type===r);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(r){typeof r=="string"?this.queue=this.queue.filter(o=>o.type!==r):this.queue=this.queue.filter(o=>!r.test(o.type))}};var Xt=v(te(),1);var Is=v(te(),1);function Ls(e,r){let o=()=>JSON.parse(JSON.stringify(e));return(0,Is.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return o();try{return JSON.parse(n)}catch{return o()}},toAttribute:n=>JSON.stringify(n)},hasChanged:oo,...r??{}})}var ao=class{constructor(r=0){this.timeout=r,this.callbacks=[]}run(r,o){return this.callbacks=[r],this.debounce(o)}queue(r,o){return this.callbacks.push(r),this.debounce(o)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(r){return this.promise==null&&(this.promise=new Promise((o,n)=>{this.resolvePromise=o,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),r??this.timeout),this.promise}async runCallbacks(){var r,o;let n=[...this.callbacks];this.callbacks=[];let a=(r=this.rejectPromise)!==null&&r!==void 0?r:()=>null,i=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let c of n)try{await c()}catch(d){a(d);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ps=v(H(),1);var io=globalThis,ed=io.ShadowRoot&&(io.ShadyCSS===void 0||io.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,_b=Symbol();var _s=(e,r)=>{if(ed)e.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=io.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,e.appendChild(n)}};var so=class extends Ps.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,i])=>r.registry.define(a,i)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return _s(n,r.elementStyles),n}};function ks(e,r,...o){var n;let a=e.querySelector(r);for(let i of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(i);return a}var Cr=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},Ms,Ds=Symbol("constructorPrototype"),Bs=Symbol("constructorName"),$s=Symbol("exportpartsDebouncer"),Us=Symbol("dynamicDependenciesLoaded"),Qe=class extends so{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ms]=new ao(5),this[Bs]=this.constructor.name,this[Ds]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Bs]&&Object.setPrototypeOf(this,this[Ds])}connectedCallback(){super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let r=this.constructor;r[Us]||(r[Us]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(r){super.updated(r),this.updateComplete.then(()=>{this.contentAvailableCallback(r),this.focusElementToFocus(r),this.applyCustomStylesheet(r),this.scheduleExportpartsUpdate()})}contentAvailableCallback(r){}focusElementToFocus(r){if(r.has("elementToFocus")&&this.elementToFocus!=null){let{element:o,selector:n,shadowPath:a}=this.elementToFocus;if(n!=null){let i=[...a??[],n];o=ks(this.shadowRoot,...i)}o?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||o?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(r){var o,n,a;if(((n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}scheduleExportpartsUpdate(){var r,o,n;(!((r=this.exportpartsPrefix)===null||r===void 0)&&r.trim()||(n=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&n!==void 0&&n)&&this[$s].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(r){var o,n,a,i,c,d;let p=g=>g!=null&&g.trim().length>0,u=r.filter(p).map(g=>g.trim());if(u.length===0){this.removeAttribute("exportparts");return}let m=new Set;for(let g of(n=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let S=(i=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],x=(d=(c=g.getAttribute("exportparts"))===null||c===void 0?void 0:c.split(",").map(O=>O.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...S,...x).filter(p).map(O=>O.trim()).forEach(O=>m.add(O))}if(m.size===0){this.removeAttribute("exportparts");return}let h=[...m.values()].flatMap(g=>u.map(S=>`${g}:${S}--${g}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};Ms=$s;Cr([(0,Xt.property)()],Qe.prototype,"exportpartsPrefix",void 0);Cr([Ls([])],Qe.prototype,"exportpartsPrefixes",void 0);Cr([(0,Xt.property)()],Qe.prototype,"customStylesheet",void 0);Cr([(0,Xt.property)()],Qe.prototype,"elementToFocus",void 0);Cr([(0,Xt.state)()],Qe.prototype,"useAdoptedStyleSheets",void 0);function Er(e){var r;return(r=e?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Ws,Hs,Fs,wr=Symbol("internalReduxEventsUnsubscribers"),pt=Symbol("internalStoresUnsubscribers"),Nt=Symbol("internalStores"),Ar=class extends Qe{constructor(){super(...arguments),this[Ws]=new Map,this[Hs]=new Map,this[Fs]=new Map}get reduxConstructor(){return this.constructor}update(r){super.update(r),[...this.reduxConstructor.reduxReactiveProperties].some(o=>r.has(o))&&this.updateFromStores()}getUnnamedStore(){if(this[Nt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Nt].values()][0]}getStore(r){return r==null?this.getUnnamedStore():this[Nt].get(r)}addStore(r,o){var n;o=(n=o??(Er(r)?r.name:void 0))!==null&&n!==void 0?n:"default-store",this.unsubscribeFromStore(o),this[Nt].set(o,r),this.subscribeToStore(o,r),this.updateFromStores()}removeStore(r){let o=typeof r=="string"?r:r.name;this.unsubscribeFromStore(o),this[Nt].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Nt].forEach((r,o)=>this.subscribeToStore(o,r)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((r,o)=>{let n=this.constructor.getPropertyOptions(o);if(!n?.attribute||!this.hasAttribute(typeof n?.attribute=="string"?n.attribute:o)){let a=this.getStore(r.store);a&&(r.store?this[pt].has(r.store):this[pt].size>0)&&(this[o]=r.selector(a.getState(),this))}})}subscribeToStore(r,o){var n;this[pt].set(r,o.subscribe(()=>this.updateFromStores())),this[wr].set(r,[]),Er(o)&&o.eventBus&&((n=this.reduxConstructor.reduxEventListeners)===null||n===void 0||n.forEach((a,i)=>{if(typeof this[i]=="function"&&(!a.store||o.name===a.store)){let c=d=>this[i](d);o.addEventListener(a.eventName,c),this[wr].get(r).push(()=>o.removeEventListener(a.eventName,c))}})),this.onStoreAvailable(r)}unsubscribeFromStores(){this[pt].forEach((r,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(r){var o;this[pt].has(r)&&this[pt].get(r)(),this[pt].delete(r),(o=this[wr].get(r))===null||o===void 0||o.forEach(n=>n()),this[wr].delete(r)}onStoreAvailable(r){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Ws=pt,Hs=Nt,Fs=wr;Ar.reduxProperties=new Map;Ar.reduxReactiveProperties=new Set;Ar.reduxEventListeners=new Map;function Te(e){for(var r=arguments.length,o=Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+e+(o.length?" "+o.map(function(c){return"'"+c+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function et(e){return!!e&&!!e[Z]}function Be(e){var r;return!!e&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===cd}(e)||Array.isArray(e)||!!e[qs]||!!(!((r=e.constructor)===null||r===void 0)&&r[qs])||bn(e)||xn(e))}function Tt(e,r,o){o===void 0&&(o=!1),er(e)===0?(o?Object.keys:Qt)(e).forEach(function(n){o&&typeof n=="symbol"||r(n,e[n],e)}):e.forEach(function(n,a){return r(a,n,e)})}function er(e){var r=e[Z];return r?r.i>3?r.i-4:r.i:Array.isArray(e)?1:bn(e)?2:xn(e)?3:0}function Jt(e,r){return er(e)===2?e.has(r):Object.prototype.hasOwnProperty.call(e,r)}function td(e,r){return er(e)===2?e.get(r):e[r]}function Ys(e,r,o){var n=er(e);n===2?e.set(r,o):n===3?e.add(o):e[r]=o}function Xs(e,r){return e===r?e!==0||1/e==1/r:e!=e&&r!=r}function bn(e){return id&&e instanceof Map}function xn(e){return sd&&e instanceof Set}function ut(e){return e.o||e.t}function vn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var r=ec(e);delete r[Z];for(var o=Qt(r),n=0;n<o.length;n++){var a=o[n],i=r[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[a]})}return Object.create(Object.getPrototypeOf(e),r)}function Sn(e,r){return r===void 0&&(r=!1),On(e)||et(e)||!Be(e)||(er(e)>1&&(e.set=e.add=e.clear=e.delete=rd),Object.freeze(e),r&&Tt(e,function(o,n){return Sn(n,!0)},!0)),e}function rd(){Te(2)}function On(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function je(e){var r=gn[e];return r||Te(18,e),r}function od(e,r){gn[e]||(gn[e]=r)}function hn(){return Nr}function dn(e,r){r&&(je("Patches"),e.u=[],e.s=[],e.v=r)}function co(e){yn(e),e.p.forEach(nd),e.p=null}function yn(e){e===Nr&&(Nr=e.l)}function zs(e){return Nr={p:[],l:Nr,h:e,m:!0,_:0}}function nd(e){var r=e[Z];r.i===0||r.i===1?r.j():r.g=!0}function pn(e,r){r._=r.p.length;var o=r.p[0],n=e!==void 0&&e!==o;return r.h.O||je("ES5").S(r,e,n),n?(o[Z].P&&(co(r),Te(4)),Be(e)&&(e=lo(r,e),r.l||po(r,e)),r.u&&je("Patches").M(o[Z].t,e,r.u,r.s)):e=lo(r,o,[]),co(r),r.u&&r.v(r.u,r.s),e!==Qs?e:void 0}function lo(e,r,o){if(On(r))return r;var n=r[Z];if(!n)return Tt(r,function(d,p){return Gs(e,n,r,d,p,o)},!0),r;if(n.A!==e)return r;if(!n.P)return po(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=vn(n.k):n.o,i=a,c=!1;n.i===3&&(i=new Set(a),a.clear(),c=!0),Tt(i,function(d,p){return Gs(e,n,a,d,p,o,c)}),po(e,a,!1),o&&e.u&&je("Patches").N(n,o,e.u,e.s)}return n.o}function Gs(e,r,o,n,a,i,c){if(et(a)){var d=lo(e,a,i&&r&&r.i!==3&&!Jt(r.R,n)?i.concat(n):void 0);if(Ys(o,n,d),!et(d))return;e.m=!1}else c&&o.add(a);if(Be(a)&&!On(a)){if(!e.h.D&&e._<1)return;lo(e,a),r&&r.A.l||po(e,a)}}function po(e,r,o){o===void 0&&(o=!1),!e.l&&e.h.D&&e.m&&Sn(r,o)}function un(e,r){var o=e[Z];return(o?ut(o):e)[r]}function js(e,r){if(r in e)for(var o=Object.getPrototypeOf(e);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function ft(e){e.P||(e.P=!0,e.l&&ft(e.l))}function fn(e){e.o||(e.o=vn(e.t))}function mn(e,r,o){var n=bn(r)?je("MapSet").F(r,o):xn(r)?je("MapSet").T(r,o):e.O?function(a,i){var c=Array.isArray(a),d={i:c?1:0,A:i?i.A:hn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},p=d,u=Tr;c&&(p=[d],u=Rr);var m=Proxy.revocable(p,u),h=m.revoke,g=m.proxy;return d.k=g,d.j=h,g}(r,o):je("ES5").J(r,o);return(o?o.A:hn()).p.push(n),n}function ad(e){return et(e)||Te(22,e),function r(o){if(!Be(o))return o;var n,a=o[Z],i=er(o);if(a){if(!a.P&&(a.i<4||!je("ES5").K(a)))return a.t;a.I=!0,n=Vs(o,i),a.I=!1}else n=Vs(o,i);return Tt(n,function(c,d){a&&td(a.t,c)===d||Ys(n,c,r(d))}),i===3?new Set(n):n}(e)}function Vs(e,r){switch(r){case 2:return new Map(e);case 3:return Array.from(e)}return vn(e)}function Js(){function e(c,d){var p=i[c];return p?p.enumerable=d:i[c]=p={configurable:!0,enumerable:d,get:function(){var u=this[Z];return Tr.get(u,c)},set:function(u){var m=this[Z];Tr.set(m,c,u)}},p}function r(c){for(var d=c.length-1;d>=0;d--){var p=c[d][Z];if(!p.P)switch(p.i){case 5:n(p)&&ft(p);break;case 4:o(p)&&ft(p)}}}function o(c){for(var d=c.t,p=c.k,u=Qt(p),m=u.length-1;m>=0;m--){var h=u[m];if(h!==Z){var g=d[h];if(g===void 0&&!Jt(d,h))return!0;var S=p[h],x=S&&S[Z];if(x?x.t!==g:!Xs(S,g))return!0}}var O=!!d[Z];return u.length!==Qt(d).length+(O?0:1)}function n(c){var d=c.k;if(d.length!==c.t.length)return!0;var p=Object.getOwnPropertyDescriptor(d,d.length-1);if(p&&!p.get)return!0;for(var u=0;u<d.length;u++)if(!d.hasOwnProperty(u))return!0;return!1}function a(c){c.g&&Te(3,JSON.stringify(ut(c)))}var i={};od("ES5",{J:function(c,d){var p=Array.isArray(c),u=function(h,g){if(h){for(var S=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(S,""+x,e(x,!0));return S}var O=ec(g);delete O[Z];for(var I=Qt(O),R=0;R<I.length;R++){var N=I[R];O[N]=e(N,h||!!O[N].enumerable)}return Object.create(Object.getPrototypeOf(g),O)}(p,c),m={i:p?5:4,A:d?d.A:hn(),P:!1,I:!1,R:{},l:d,t:c,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Z,{value:m,writable:!0}),u},S:function(c,d,p){p?et(d)&&d[Z].A===c&&r(c.p):(c.u&&function u(m){if(m&&typeof m=="object"){var h=m[Z];if(h){var g=h.t,S=h.k,x=h.R,O=h.i;if(O===4)Tt(S,function(B){B!==Z&&(g[B]!==void 0||Jt(g,B)?x[B]||u(S[B]):(x[B]=!0,ft(h)))}),Tt(g,function(B){S[B]!==void 0||Jt(S,B)||(x[B]=!1,ft(h))});else if(O===5){if(n(h)&&(ft(h),x.length=!0),S.length<g.length)for(var I=S.length;I<g.length;I++)x[I]=!1;else for(var R=g.length;R<S.length;R++)x[R]=!0;for(var N=Math.min(S.length,g.length),k=0;k<N;k++)S.hasOwnProperty(k)||(x[k]=!0),x[k]===void 0&&u(S[k])}}}}(c.p[0]),r(c.p))},K:function(c){return c.i===4?o(c):n(c)}})}var Ks,Nr,Cn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",id=typeof Map<"u",sd=typeof Set<"u",Zs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Qs=Cn?Symbol.for("immer-nothing"):((Ks={})["immer-nothing"]=!0,Ks),qs=Cn?Symbol.for("immer-draftable"):"__$immer_draftable",Z=Cn?Symbol.for("immer-state"):"__$immer_state";var cd=""+Object.prototype.constructor,Qt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ec=Object.getOwnPropertyDescriptors||function(e){var r={};return Qt(e).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(e,o)}),r},gn={},Tr={get:function(e,r){if(r===Z)return e;var o=ut(e);if(!Jt(o,r))return function(a,i,c){var d,p=js(i,c);return p?"value"in p?p.value:(d=p.get)===null||d===void 0?void 0:d.call(a.k):void 0}(e,o,r);var n=o[r];return e.I||!Be(n)?n:n===un(e.t,r)?(fn(e),e.o[r]=mn(e.A.h,n,e)):n},has:function(e,r){return r in ut(e)},ownKeys:function(e){return Reflect.ownKeys(ut(e))},set:function(e,r,o){var n=js(ut(e),r);if(n?.set)return n.set.call(e.k,o),!0;if(!e.P){var a=un(ut(e),r),i=a?.[Z];if(i&&i.t===o)return e.o[r]=o,e.R[r]=!1,!0;if(Xs(o,a)&&(o!==void 0||Jt(e.t,r)))return!0;fn(e),ft(e)}return e.o[r]===o&&(o!==void 0||r in e.o)||Number.isNaN(o)&&Number.isNaN(e.o[r])||(e.o[r]=o,e.R[r]=!0),!0},deleteProperty:function(e,r){return un(e.t,r)!==void 0||r in e.t?(e.R[r]=!1,fn(e),ft(e)):delete e.R[r],e.o&&delete e.o[r],!0},getOwnPropertyDescriptor:function(e,r){var o=ut(e),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:e.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){Te(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Te(12)}},Rr={};Tt(Tr,function(e,r){Rr[e]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Rr.deleteProperty=function(e,r){return Rr.set.call(this,e,r,void 0)},Rr.set=function(e,r,o){return Tr.set.call(this,e[0],r,o,e[0])};var ld=function(){function e(o){var n=this;this.O=Zs,this.D=!0,this.produce=function(a,i,c){if(typeof a=="function"&&typeof i!="function"){var d=i;i=a;var p=n;return function(O){var I=this;O===void 0&&(O=d);for(var R=arguments.length,N=Array(R>1?R-1:0),k=1;k<R;k++)N[k-1]=arguments[k];return p.produce(O,function(B){var U;return(U=i).call.apply(U,[I,B].concat(N))})}}var u;if(typeof i!="function"&&Te(6),c!==void 0&&typeof c!="function"&&Te(7),Be(a)){var m=zs(n),h=mn(n,a,void 0),g=!0;try{u=i(h),g=!1}finally{g?co(m):yn(m)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(O){return dn(m,c),pn(O,m)},function(O){throw co(m),O}):(dn(m,c),pn(u,m))}if(!a||typeof a!="object"){if((u=i(a))===void 0&&(u=a),u===Qs&&(u=void 0),n.D&&Sn(u,!0),c){var S=[],x=[];je("Patches").M(a,u,S,x),c(S,x)}return u}Te(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(u){for(var m=arguments.length,h=Array(m>1?m-1:0),g=1;g<m;g++)h[g-1]=arguments[g];return n.produceWithPatches(u,function(S){return a.apply(void 0,[S].concat(h))})};var c,d,p=n.produce(a,i,function(u,m){c=u,d=m});return typeof Promise<"u"&&p instanceof Promise?p.then(function(u){return[u,c,d]}):[p,c,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var r=e.prototype;return r.createDraft=function(o){Be(o)||Te(8),et(o)&&(o=ad(o));var n=zs(this),a=mn(this,o,void 0);return a[Z].C=!0,yn(n),a},r.finishDraft=function(o,n){var a=o&&o[Z],i=a.A;return dn(i,n),pn(void 0,i)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Zs&&Te(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var c=je("Patches").$;return et(o)?c(o,n):this.produce(o,function(d){return c(d,n)})},e}(),Re=new ld,dd=Re.produce,Vb=Re.produceWithPatches.bind(Re),Kb=Re.setAutoFreeze.bind(Re),Zb=Re.setUseProxies.bind(Re),qb=Re.applyPatches.bind(Re),Yb=Re.createDraft.bind(Re),Xb=Re.finishDraft.bind(Re),uo=dd;function It(e){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},It(e)}function tc(e,r){if(It(e)!="object"||!e)return e;var o=e[Symbol.toPrimitive];if(o!==void 0){var n=o.call(e,r||"default");if(It(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function rc(e){var r=tc(e,"string");return It(r)=="symbol"?r:r+""}function oc(e,r,o){return(r=rc(r))in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function nc(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,n)}return o}function En(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?nc(Object(o),!0).forEach(function(n){oc(e,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):nc(Object(o)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))})}return e}function pe(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ac=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),wn=function(){return Math.random().toString(36).substring(7).split("").join(".")},fo={INIT:"@@redux/INIT"+wn(),REPLACE:"@@redux/REPLACE"+wn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+wn()}};function pd(e){if(typeof e!="object"||e===null)return!1;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function An(e,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(pe(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(pe(1));return o(An)(e,r)}if(typeof e!="function")throw new Error(pe(2));var a=e,i=r,c=[],d=c,p=!1;function u(){d===c&&(d=c.slice())}function m(){if(p)throw new Error(pe(3));return i}function h(O){if(typeof O!="function")throw new Error(pe(4));if(p)throw new Error(pe(5));var I=!0;return u(),d.push(O),function(){if(I){if(p)throw new Error(pe(6));I=!1,u();var N=d.indexOf(O);d.splice(N,1),c=null}}}function g(O){if(!pd(O))throw new Error(pe(7));if(typeof O.type>"u")throw new Error(pe(8));if(p)throw new Error(pe(9));try{p=!0,i=a(i,O)}finally{p=!1}for(var I=c=d,R=0;R<I.length;R++){var N=I[R];N()}return O}function S(O){if(typeof O!="function")throw new Error(pe(10));a=O,g({type:fo.REPLACE})}function x(){var O,I=h;return O={subscribe:function(N){if(typeof N!="object"||N===null)throw new Error(pe(11));function k(){N.next&&N.next(m())}k();var B=I(k);return{unsubscribe:B}}},O[ac]=function(){return this},O}return g({type:fo.INIT}),n={dispatch:g,subscribe:h,getState:m,replaceReducer:S},n[ac]=x,n}function ud(e){Object.keys(e).forEach(function(r){var o=e[r],n=o(void 0,{type:fo.INIT});if(typeof n>"u")throw new Error(pe(12));if(typeof o(void 0,{type:fo.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(pe(13))})}function ic(e){for(var r=Object.keys(e),o={},n=0;n<r.length;n++){var a=r[n];typeof e[a]=="function"&&(o[a]=e[a])}var i=Object.keys(o),c,d;try{ud(o)}catch(p){d=p}return function(u,m){if(u===void 0&&(u={}),d)throw d;if(0)var h;for(var g=!1,S={},x=0;x<i.length;x++){var O=i[x],I=o[O],R=u[O],N=I(R,m);if(typeof N>"u"){var k=m&&m.type;throw new Error(pe(14))}S[O]=N,g=g||N!==R}return g=g||i.length!==Object.keys(u).length,g?S:u}}function tr(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return r.length===0?function(n){return n}:r.length===1?r[0]:r.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function sc(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(pe(15))},c={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},d=r.map(function(p){return p(c)});return i=tr.apply(void 0,d)(a.dispatch),En(En({},a),{},{dispatch:i})}}}function cc(e){var r=function(n){var a=n.dispatch,i=n.getState;return function(c){return function(d){return typeof d=="function"?d(a,i,e):c(d)}}};return r}var lc=cc();lc.withExtraArgument=cc;var Rn=lc;var hc=function(){var e=function(r,o){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},e(r,o)};return function(r,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(r,o);function n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),fd=function(e,r){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,c;return c={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function d(u){return function(m){return p([u,m])}}function p(u){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=u[0]&2?a.return:u[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,u[1])).done)return i;switch(a=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,a=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){o=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(u[0]===6&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=r.call(e,o)}catch(m){u=[6,m],a=0}finally{n=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},rr=function(e,r){for(var o=0,n=r.length,a=e.length;o<n;o++,a++)e[a]=r[o];return e},hd=Object.defineProperty,yd=Object.defineProperties,md=Object.getOwnPropertyDescriptors,dc=Object.getOwnPropertySymbols,gd=Object.prototype.hasOwnProperty,bd=Object.prototype.propertyIsEnumerable,pc=function(e,r,o){return r in e?hd(e,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[r]=o},ht=function(e,r){for(var o in r||(r={}))gd.call(r,o)&&pc(e,o,r[o]);if(dc)for(var n=0,a=dc(r);n<a.length;n++){var o=a[n];bd.call(r,o)&&pc(e,o,r[o])}return e},Nn=function(e,r){return yd(e,md(r))},xd=function(e,r,o){return new Promise(function(n,a){var i=function(p){try{d(o.next(p))}catch(u){a(u)}},c=function(p){try{d(o.throw(p))}catch(u){a(u)}},d=function(p){return p.done?n(p.value):Promise.resolve(p.value).then(i,c)};d((o=o.apply(e,r)).next())})};var vd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?tr:tr.apply(null,arguments)},yx=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Sd(e){if(typeof e!="object"||e===null)return!1;var r=Object.getPrototypeOf(e);if(r===null)return!0;for(var o=r;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return r===o}var Od=function(e){hc(r,e);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,rr([void 0],o[0].concat(this)))):new(r.bind.apply(r,rr([void 0],o.concat(this))))},r}(Array),Cd=function(e){hc(r,e);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=e.apply(this,o)||this;return Object.setPrototypeOf(a,r.prototype),a}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return e.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,rr([void 0],o[0].concat(this)))):new(r.bind.apply(r,rr([void 0],o.concat(this))))},r}(Array);function Ln(e){return Be(e)?uo(e,function(){}):e}function Ed(e){return typeof e=="boolean"}function wd(){return function(r){return Ad(r)}}function Ad(e){e===void 0&&(e={});var r=e.thunk,o=r===void 0?!0:r,n=e.immutableCheck,a=n===void 0?!0:n,i=e.serializableCheck,c=i===void 0?!0:i,d=new Od;if(o&&(Ed(o)?d.push(Rn):d.push(Rn.withExtraArgument(o.extraArgument))),0){if(a)var p;if(c)var u}return d}var Tn=!0;function yc(e){var r=wd(),o=e||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,c=i===void 0?r():i,d=o.devTools,p=d===void 0?!0:d,u=o.preloadedState,m=u===void 0?void 0:u,h=o.enhancers,g=h===void 0?void 0:h,S;if(typeof a=="function")S=a;else if(Sd(a))S=ic(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 x=c;if(typeof x=="function"&&(x=x(r),!Tn&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Tn&&x.some(function(B){return typeof B!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=sc.apply(void 0,x),I=tr;p&&(I=vd(ht({trace:!Tn},typeof p=="object"&&p)));var R=new Cd(O),N=R;Array.isArray(g)?N=rr([O],g):typeof g=="function"&&(N=g(R));var k=I.apply(void 0,N);return An(S,m,k)}function yt(e,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var i=r.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return ht(ht({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:n[0]}}return o.toString=function(){return""+e},o.type=e,o.match=function(n){return n.type===e},o}function mc(e){var r={},o=[],n,a={addCase:function(i,c){var d=typeof i=="string"?i:i.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=c,a},addMatcher:function(i,c){return o.push({matcher:i,reducer:c}),a},addDefaultCase:function(i){return n=i,a}};return e(a),[r,o,n]}function Rd(e){return typeof e=="function"}function Nd(e,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?mc(r):[r,o,n],i=a[0],c=a[1],d=a[2],p;if(Rd(e))p=function(){return Ln(e())};else{var u=Ln(e);p=function(){return u}}function m(h,g){h===void 0&&(h=p());var S=rr([i[g.type]],c.filter(function(x){var O=x.matcher;return O(g)}).map(function(x){var O=x.reducer;return O}));return S.filter(function(x){return!!x}).length===0&&(S=[d]),S.reduce(function(x,O){if(O)if(et(x)){var I=x,R=O(I,g);return R===void 0?x:R}else{if(Be(x))return uo(x,function(N){return O(N,g)});var R=O(x,g);if(R===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return R}return x},h)}return m.getInitialState=p,m}function Td(e,r){return e+"/"+r}function gc(e){var r=e.name;if(!r)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof e.initialState=="function"?e.initialState:Ln(e.initialState),n=e.reducers||{},a=Object.keys(n),i={},c={},d={};a.forEach(function(m){var h=n[m],g=Td(r,m),S,x;"reducer"in h?(S=h.reducer,x=h.prepare):S=h,i[m]=S,c[g]=S,d[m]=x?yt(g,x):yt(g)});function p(){var m=typeof e.extraReducers=="function"?mc(e.extraReducers):[e.extraReducers],h=m[0],g=h===void 0?{}:h,S=m[1],x=S===void 0?[]:S,O=m[2],I=O===void 0?void 0:O,R=ht(ht({},g),c);return Nd(o,function(N){for(var k in R)N.addCase(k,R[k]);for(var B=0,U=x;B<U.length;B++){var ye=U[B];N.addMatcher(ye.matcher,ye.reducer)}I&&N.addDefaultCase(I)})}var u;return{name:r,reducer:function(m,h){return u||(u=p()),u(m,h)},actions:d,caseReducers:i,getInitialState:function(){return u||(u=p()),u.getInitialState()}}}var Id="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ld=function(e){e===void 0&&(e=21);for(var r="",o=e;o--;)r+=Id[Math.random()*64|0];return r},_d=["name","message","stack","code"],In=function(){function e(r,o){this.payload=r,this.meta=o}return e}(),uc=function(){function e(r,o){this.payload=r,this.meta=o}return e}(),Pd=function(e){if(typeof e=="object"&&e!==null){for(var r={},o=0,n=_d;o<n.length;o++){var a=n[o];typeof e[a]=="string"&&(r[a]=e[a])}return r}return{message:String(e)}},xx=function(){function e(r,o,n){var a=yt(r+"/fulfilled",function(m,h,g,S){return{payload:m,meta:Nn(ht({},S||{}),{arg:g,requestId:h,requestStatus:"fulfilled"})}}),i=yt(r+"/pending",function(m,h,g){return{payload:void 0,meta:Nn(ht({},g||{}),{arg:h,requestId:m,requestStatus:"pending"})}}),c=yt(r+"/rejected",function(m,h,g,S,x){return{payload:S,error:(n&&n.serializeError||Pd)(m||"Rejected"),meta:Nn(ht({},x||{}),{arg:g,requestId:h,rejectedWithValue:!!S,requestStatus:"rejected",aborted:m?.name==="AbortError",condition:m?.name==="ConditionError"})}}),d=!1,p=typeof AbortController<"u"?AbortController:function(){function m(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return m.prototype.abort=function(){},m}();function u(m){return function(h,g,S){var x=n?.idGenerator?n.idGenerator(m):Ld(),O=new p,I,R=!1;function N(B){I=B,O.abort()}var k=function(){return xd(this,null,function(){var B,U,ye,$e,ue,We,ie;return fd(this,function(y){switch(y.label){case 0:return y.trys.push([0,4,,5]),$e=(B=n?.condition)==null?void 0:B.call(n,m,{getState:g,extra:S}),Dd($e)?[4,$e]:[3,2];case 1:$e=y.sent(),y.label=2;case 2:if($e===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return R=!0,ue=new Promise(function(b,_){return O.signal.addEventListener("abort",function(){return _({name:"AbortError",message:I||"Aborted"})})}),h(i(x,m,(U=n?.getPendingMeta)==null?void 0:U.call(n,{requestId:x,arg:m},{getState:g,extra:S}))),[4,Promise.race([ue,Promise.resolve(o(m,{dispatch:h,getState:g,extra:S,requestId:x,signal:O.signal,abort:N,rejectWithValue:function(b,_){return new In(b,_)},fulfillWithValue:function(b,_){return new uc(b,_)}})).then(function(b){if(b instanceof In)throw b;return b instanceof uc?a(b.payload,x,m,b.meta):a(b,x,m)})])];case 3:return ye=y.sent(),[3,5];case 4:return We=y.sent(),ye=We instanceof In?c(null,x,m,We.payload,We.meta):c(We,x,m),[3,5];case 5:return ie=n&&!n.dispatchConditionRejection&&c.match(ye)&&ye.meta.condition,ie||h(ye),[2,ye]}})})}();return Object.assign(k,{abort:N,requestId:x,arg:m,unwrap:function(){return k.then(kd)}})}}return Object.assign(u,{pending:i,rejected:c,fulfilled:a,typePrefix:r})}return e.withTypes=function(){return e},e}();function kd(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function Dd(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var bc="listener",xc="completed",vc="cancelled",vx="task-"+vc,Sx="task-"+xc,Ox=bc+"-"+vc,Cx=bc+"-"+xc;var _n="listenerMiddleware";var Ex=yt(_n+"/add"),wx=yt(_n+"/removeAll"),Ax=yt(_n+"/remove");var fc,Rx=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(fc||(fc=Promise.resolve())).then(e).catch(function(r){return setTimeout(function(){throw r},0)})},Bd=function(e){return function(r){setTimeout(r,e)}},Nx=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Bd(10);Js();function Ud(e,r){return class extends e{constructor(){super(...arguments),this.eventBus=r??document.createElement("span")}addEventListener(o,n,a){this.eventBus.addEventListener(o,n,a)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,n,a){this.eventBus.removeEventListener(o,n,a)}}}var ho=class extends Ud(Object){};window.ftReduxStores||(window.ftReduxStores={});var Sc=class e extends ho{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,i=window.ftReduxStores[n];if(Er(i))return i;if(a==null)return;let c=gc({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=yc({reducer:(p,u)=>u.type==="CLEAR_FT_REDUX_STORE"?c.getInitialState():typeof u.type=="string"&&u.type.startsWith("DEFAULT_VALUE_SETTER__")?{...p,...u.overwrites}:c.reducer(p,u)});return window.ftReduxStores[a.name]=new e(c,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new no;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,c,d)=>{let p=c,u=i[p];return u?(...m)=>{let h=u(...m.map(a));return this.reduxStore.dispatch(h),h}:m=>{this.setState({[p]:a(m)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(r){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(r).join("_"),overwrites:r})}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(r){throw new Error("Not implemented yet.")}subscribe(r){return this.reduxStore.subscribe(r)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var vo=v(L());var Wd=v(Cc(),1);var Ec;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Ec||(Ec={}));var wc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(wc||(wc={}));var Ac;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.MAP_ATTACHMENT="MAP_ATTACHMENT",e.RESOURCE="RESOURCE"})(Ac||(Ac={}));var Rc;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.MAP_ATTACHMENT="MAP_ATTACHMENT",e.RESOURCE="RESOURCE"})(Rc||(Rc={}));var Nc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Nc||(Nc={}));var Tc;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Tc||(Tc={}));var Ic;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",e.GEN_AI__RATE="GEN_AI__RATE",e.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",e.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__DISPLAY="TOPIC__DISPLAY",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(Ic||(Ic={}));var Lc;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(Lc||(Lc={}));var _c;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT"})(_c||(_c={}));var Pc;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Pc||(Pc={}));var kc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(kc||(kc={}));var Dc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Dc||(Dc={}));var Bc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Bc||(Bc={}));var Uc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(Uc||(Uc={}));var Mc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Mc||(Mc={}));var $c;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($c||($c={}));var Wc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Wc||(Wc={}));var Hc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK"})(Hc||(Hc={}));var Fc;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Fc||(Fc={}));var zc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK"})(zc||(zc={}));var Gc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Gc||(Gc={}));var jc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC"})(jc||(jc={}));var Vc;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Vc||(Vc={}));var ne;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(ne||(ne={}));var Kc;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Kc||(Kc={}));var Zc;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Zc||(Zc={}));var qc;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(qc||(qc={}));var $d={[ne.PERSONAL_BOOK_SHARE_USER]:[ne.PERSONAL_BOOK_USER],[ne.HTML_EXPORT_USER]:[ne.PERSONAL_BOOK_USER],[ne.PDF_EXPORT_USER]:[ne.PERSONAL_BOOK_USER],[ne.KHUB_ADMIN]:[ne.CONTENT_PUBLISHER],[ne.ADMIN]:[ne.KHUB_ADMIN,ne.USERS_ADMIN,ne.PORTAL_ADMIN],[ne.GENERATIVE_AI_EXPORT_USER]:[ne.GENERATIVE_AI_USER]};function Yc(e,r){return e===r||($d[e]??[]).some(o=>Yc(o,r))}function Xc(e,r){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>Yc(n,r))}var go=class extends dt{async listMySearches(){let{session:r}=P.getState();return Xc(r,ne.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var bo=class extends dt{async listMyBookmarks(){let r=P.getState().session;return r?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(r.profile.userId),5*60*1e3):[]}};var Hd="ft-user-assets",xo=vo.FtReduxStore.get({name:Hd,initialState:{savedSearches:void 0,bookmarks:void 0}}),Pn=class{constructor(){this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new bo,this.savedSearchesService=new go,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=P.getState();(0,vo.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),xo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),xo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();xo.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var r;if(this.bookmarksAreUsed){let o=!((r=this.currentSession)===null||r===void 0)&&r.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;xo.actions.bookmarks(o)}}},Ev=new Pn;var kn=class{addCommand(r,o=!1){P.commands.add(r,o)}consumeCommand(r){return P.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new kn;var Jc=v(L()),Dn=class{highlightHtml(r,o,n){(0,Jc.highlightHtml)(r,o,n)}};window.FluidTopicsHighlightHtmlService=new Dn;var Qc=v(L());var Bn=class{isDate(r){var o,n,a,i;return(i=(a=((n=(o=P.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(d=>d.key===r))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(r,o){var n,a,i;return Qc.DateFormatter.format(r,(n=o?.locale)!==null&&n!==void 0?n:P.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Bn;var el=v(L());var Ir=class{static get(r,o){var n,a,i,c;let d=P.getState(),{lang:p,region:u}=(a=(n=d.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new el.SearchPlaceConverter(d.baseUrl,(c=(i=window.FluidTopicsClientConfiguration)===null||i===void 0?void 0:i.predefinedSorts)!==null&&c!==void 0?c:{},r??20,d.searchInAllLanguagesAllowed,o??`${p}-${u}`)}};var Un=class{urlToSearchRequest(r){return Ir.get().parse(r)}searchRequestToUrl(r){return Ir.get().serialize(r)}};window.FluidTopicsUrlService=new Un;var gt=v(L());var Lt=class e extends CustomEvent{constructor(r){super(e.eventName,{detail:{currentItem:r}})}};Lt.eventName="change";var Mn=class{itemName(r){return`fluid-topics-history-item-${r}`}get(r){let o=sessionStorage.getItem(this.itemName(r));return o?JSON.parse(o):void 0}set(r,o){sessionStorage.setItem(this.itemName(r),JSON.stringify(o))}},tl=new Mn;var So=class e extends gt.WithEventBus{static build(){return new e(window.history,tl,()=>window.location,!1)}constructor(r,o,n,a){var i,c;super(),this.history=r,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=r.pushState,this.realReplaceState=r.replaceState,this.initialIndex=(c=(i=r.state)===null||i===void 0?void 0:i.index)!==null&&c!==void 0?c:r.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(r,o=!1){let n=o&&this.currentIndex===r.index-1;this.currentState={...this.buildCurrentState(),...r},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,gt.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Lt(this.currentItem())),0)}installProxies(){let r=o=>(n,a,[i,c,d])=>{let p=o(),u={...p===this.currentIndex?this.currentState:void 0,...i,index:p,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[u,c,d]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:r(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:r(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",r=>this.setCurrentState(r.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(r){for(let o=this.history.length-1;o>=0;o--)r?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(r){var o;let n={...this.buildCurrentState(),...r,index:this.currentIndex,title:(o=r?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(r){this.addEventListener(Lt.eventName,r)}removeHistoryChangeListener(r){this.removeEventListener(Lt.eventName,r)}currentItem(){return(0,gt.deepCopy)(this.currentState)}back(){let r=this.previousDifferentMajorPosition();r>=0?this.history.go(r-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,gt.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let r=this.currentIndex>0?this.currentIndex-1:0;for(;r>0&&!this.isDifferentMajorState(r);)r--;return r}forward(){let r=this.nextMajorPosition();r&&r<this.states.length?this.history.go(r-this.currentIndex):this.history.forward()}forwardItem(){let r=this.nextMajorPosition();if(r)return(0,gt.deepCopy)(this.states[r])}nextMajorPosition(){let r=this.currentIndex;if(!(r>=this.states.length)){do r++;while(r<this.states.length&&!this.isDifferentMajorState(r));return this.getHigherPositionInTheSameState(r)}}getHigherPositionInTheSameState(r){var o;let n=(o=this.states[r])===null||o===void 0?void 0:o.majorStateId;if(!n)return r;let a=r,i=r+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var r,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(r=this.history.state)===null||r===void 0?void 0:r.title)!==null&&o!==void 0?o:document.title}}hasState(r){return this.states[r]!=null}isDifferentMajorState(r,o){var n;if(!this.hasState(r))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[r])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=So.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});(0,rl.customElement)("ft-app-context")(J);var sl=v(te());var Fd=v(L());function ol(e){return e.match(/^[\w-]+\.[\w-]+$/)}var zd=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},nl=Symbol("i18nAttributes"),al=Symbol("i18nListAttributes"),cl=Symbol("i18nProperties"),Oo=Symbol("i18nContexts"),Lr=Symbol("i18nUnsubs");function wo(e){var r,o;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?to:Yt}i18n(i){var c;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let d=(c=i.args)!==null&&c!==void 0?c:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...d)}customI18n(i,c){if(ol(i)){let[d,p]=i.split(".");return this.i18n({custom:!0,context:d,key:p,...c})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((c,d,p)=>i.has(d)||typeof c.argsProvider=="function"),this.updateI18nProperties(c=>typeof c.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((c,d,p)=>{var u;return((u=p?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(c=>c.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var c,d;let p=this,u=(m,h,g)=>g?.context&&g.key&&i(m,h,g)?{...g,message:this.i18n({context:g.context,key:g.key,...m})}:g;(c=this[nl])===null||c===void 0||c.forEach((m,h)=>p[h]=u(m,h,p[h])),(d=this[al])===null||d===void 0||d.forEach((m,h)=>{var g;return p[h]=(g=p[h])===null||g===void 0?void 0:g.map(S=>u(m,h,S))})}updateI18nProperties(i){var c;(c=this[cl])===null||c===void 0||c.forEach((d,p)=>{i(d,p)&&(this[p]=this.i18n(d))})}addI18nMessages(i,c,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,c,d)}addI18nContext(i,c,d){let p=(typeof i=="string"?i:i.name).toLowerCase();d=typeof i=="string"?d:i.custom,this[Oo].set(p,{isCustomContext:d}),this[Lr].has(p)||this[Lr].set(p,this.getI18nService(d).subscribe(p,()=>this.onI18nUpdate(p))),this.getI18nService(d).prepareContext(p,c)}hasI18nContext(i){return this[Oo].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Oo].forEach((i,c)=>this.addI18nContext(c,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Lr].forEach(i=>i()),this[Lr].clear()}}return r=Oo,o=Lr,zd([(0,sl.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var il=class extends wo(Eo.FtLitElement){},Co=class extends wo(Eo.FtLitElementRedux){};var _r=function(e,r,o,n){var a=arguments.length,i=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,r,o,n);else for(var d=e.length-1;d>=0;d--)(c=e[d])&&(i=(a<3?c(i):a>3?c(r,o,i):c(r,o))||i);return a>3&&i&&Object.defineProperty(r,o,i),i},Ue=class extends Co{constructor(){super(),this.editorMode=!1,this.addStore(P)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Ao.nothing:Ao.html`
|
|
1218
1218
|
<span class="ft-i18n">
|
|
1219
1219
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
1220
1220
|
</span>
|
|
@@ -1281,7 +1281,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:r.extend("--ft-conte
|
|
|
1281
1281
|
`;var Mc=D`
|
|
1282
1282
|
`;var Ru="ft-app-info",Ri=class extends CustomEvent{constructor(e){super("authentication-change",{detail:e})}},Nu={session:(t,e)=>{Ce(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>B.dispatchEvent(new Ri(e.payload)),0))}},B=Bt.get({name:Ru,reducers:Nu,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var Ft=class t{static get(e){let{baseUrl:o,apiIntegrationIdentifier:n}=B.getState(),a=e??n;if(o&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,a,!0)}static await(e){return new Promise(o=>{let n=t.get(e);if(n)o(n);else{let a=B.subscribe(()=>{n=t.get(e),n&&(a(),o(n))})}})}};var Xr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Ft.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Ft.await()}};var xt=class extends Xr{constructor(e=!0,o){var n;super(o);let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new Fe,this.cache=e?a.commonCache:new Fe}clearCache(){this.cache.clearAll()}};var $c,Tu=Symbol("clearAfterUnitTest"),Mo=class extends xt{constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[$c]=()=>{this.defaultMessages={},this.cache=new Fe,this.listeners={}},this.currentUiLocale=B.getState().uiLocale,B.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=B.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let o=e.name.toLowerCase();this.cache.setFinal(o,e),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,o){var n;if(e=e.toLowerCase(),o&&Object.keys(o).length>0){let a={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...o};Ce(this.defaultMessages[e],a)||(this.defaultMessages[e]=a,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var o,n;return this.fetchContext(e),(n=(o=this.cache.getNow(e))===null||o===void 0?void 0:o.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,o){let n=e.toLowerCase();return this.resolveContext(n)[o]}resolveMessage(e,o,...n){var a;let i=e.toLowerCase(),s=this.resolveContext(i);return new zr((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(o,...n)}async fetchContext(e){let o=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e))}catch(a){!(a instanceof Nt)&&o&&console.error(a)}return o&&await this.notify(e),n}subscribe(e,o){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(o),()=>{var a;return(a=this.listeners[e])===null||a===void 0?void 0:a.delete(o)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map(e=>this.notify(e)))}async notify(e){this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(o=>ho(0).then(()=>o()).catch(()=>null)))}};$c=Tu;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Mo{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Mo{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Or=window.FluidTopicsI18nService,$o=window.FluidTopicsCustomI18nService;var he=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},ie=class extends V{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>Ft.get(),this.messageContexts=[],this.cache=new Fe,this.cleanSessionDebouncer=new ye}render(){return U`
|
|
1283
1283
|
<slot></slot>
|
|
1284
|
-
`}update(e){var o,n,a,i,s;super.update(e),e.has("baseUrl")&&(B.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&B.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&B.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&B.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&B.actions.noCustom(this.noCustom),e.has("editorMode")&&B.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&B.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&B.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>Or.addContext(c)),e.has("openExternalDocumentInNewTab")&&B.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&B.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&B.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(B.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),B.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),B.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};ie.elementDefinitions={};ie.styles=Mc;he([w()],ie.prototype,"baseUrl",void 0);he([w()],ie.prototype,"apiIntegrationIdentifier",void 0);he([w()],ie.prototype,"uiLocale",void 0);he([We(null)],ie.prototype,"availableUiLocales",void 0);he([We(null)],ie.prototype,"metadataConfiguration",void 0);he([w({type:Boolean})],ie.prototype,"editorMode",void 0);he([w({type:Boolean})],ie.prototype,"noCustom",void 0);he([w({type:Boolean})],ie.prototype,"openExternalDocumentInNewTab",void 0);he([w({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],ie.prototype,"noCustomComponent",void 0);he([w({type:Boolean})],ie.prototype,"withManualResources",void 0);he([w({type:Boolean})],ie.prototype,"navigatorOnline",void 0);he([w({type:Boolean})],ie.prototype,"forcedOffline",void 0);he([w({type:Object})],ie.prototype,"apiProvider",void 0);he([We([])],ie.prototype,"messageContexts",void 0);he([We(void 0)],ie.prototype,"session",void 0);he([Q()],ie.prototype,"localesConfiguration",void 0);var Bo=class extends xt{async listMySearches(){let{session:e}=B.getState();return Gl(e,se.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Uo=class extends xt{async listMyBookmarks(){let e=B.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var _u="ft-user-assets",Fo=Bt.get({name:_u,initialState:{savedSearches:void 0,bookmarks:void 0}}),Ni=class{constructor(){this.currentSession=B.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Uo,this.savedSearchesService=new Bo,B.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=B.getState();Ce((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Fo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Fo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Fo.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Fo.actions.bookmarks(o)}}},aE=new Ni;var Ti=class{addCommand(e,o=!1){B.commands.add(e,o)}consumeCommand(e){return B.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ti;var _i=class{highlightHtml(e,o,n){Ra(e,o,n)}};window.FluidTopicsHighlightHtmlService=new _i;var Li=class{isDate(e){var o,n,a,i;return(i=(a=((n=(o=B.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,o){var n,a,i;return cr.format(e,(n=o?.locale)!==null&&n!==void 0?n:B.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Li;var Jr=class{static get(e,o){var n,a,i,s;let c=B.getState(),{lang:d,region:u}=(a=(n=c.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new lr(c.baseUrl,(s=(i=window.FluidTopicsClientConfiguration)===null||i===void 0?void 0:i.predefinedSorts)!==null&&s!==void 0?s:{},e??20,c.searchInAllLanguagesAllowed,o??`${d}-${u}`)}};var Ii=class{urlToSearchRequest(e){return Jr.get().parse(e)}searchRequestToUrl(e){return Jr.get().serialize(e)}};window.FluidTopicsUrlService=new Ii;var Wt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Wt.eventName="change";var Pi=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},Bc=new Pi;var Wo=class t extends Ye{static build(){return new t(window.history,Bc,()=>window.location,!1)}constructor(e,o,n,a){var i,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Ce(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Wt(this.currentItem())),0)}installProxies(){let e=o=>(n,a,[i,s,c])=>{let d=o(),u={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e,o=!1){var n,a,i;let s={...this.buildCurrentState(),...e,index:this.currentIndex,title:(n=e?.title)!==null&&n!==void 0?n:this.currentState.title},c=o?(a=e?.majorState)!==null&&a!==void 0?a:this.currentState.majorState:(i=this.currentState.majorState)!==null&&i!==void 0?i:e?.majorState;c!=null&&(s.majorState=c),this.setCurrentState(s)}addHistoryChangeListener(e){this.addEventListener(Wt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Wt.eventName,e)}currentItem(){return Pr(this.currentState)}back(){let e=this.previousMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Pr(this.states[this.previousMajorPosition()])}previousMajorPosition(){let e=this.currentIndex;for(;e>0&&!this.isMajorState(e);)e--;return this.previousExistingPosition(e)}forward(){let e=this.nextMajorPosition();e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){return Pr(this.states[this.nextMajorPosition()])}nextMajorPosition(){let e=this.currentIndex;do e++;while(e<this.states.length&&!this.isMajorState(e));do e++;while(e<this.states.length&&!this.isMajorState(e));return this.previousExistingPosition(e)}previousExistingPosition(e){let o=e;do o--;while(o>0&&!this.hasState(o));return o}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isMajorState(e){var o,n;return this.hasState(e)&&((n=(o=this.states[e])===null||o===void 0?void 0:o.majorState)!==null&&n!==void 0?n:!0)}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Wo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});J("ft-app-context")(ie);function Uc(t){return t.match(/^[\w-]+\.[\w-]+$/)}var Lu=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Fc=Symbol("i18nAttributes"),Wc=Symbol("i18nListAttributes"),zc=Symbol("i18nProperties"),Ho=Symbol("i18nContexts"),Qr=Symbol("i18nUnsubs");function jo(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?$o:Or}i18n(i){var s;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let c=(s=i.args)!==null&&s!==void 0?s:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...c)}customI18n(i,s){if(Uc(i)){let[c,d]=i.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,d)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let d=this,u=(h,f,m)=>m?.context&&m.key&&i(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,...h})}:m;(s=this[Fc])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(c=this[Wc])===null||c===void 0||c.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(b=>u(h,f,b))})}updateI18nProperties(i){var s;(s=this[zc])===null||s===void 0||s.forEach((c,d)=>{i(c,d)&&(this[d]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let d=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[Ho].set(d,{isCustomContext:c}),this[Qr].has(d)||this[Qr].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(i){return this[Ho].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ho].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Qr].forEach(i=>i()),this[Qr].clear()}}return e=Ho,o=Qr,Lu([w({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var Hc=class extends jo(V){},zo=class extends jo(je){};var eo=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Me=class extends zo{constructor(){super(),this.editorMode=!1,this.addStore(B)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":j:U`
|
|
1284
|
+
`}update(e){var o,n,a,i,s;super.update(e),e.has("baseUrl")&&(B.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),e.has("apiIntegrationIdentifier")&&B.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("uiLocale")&&B.actions.uiLocale(this.uiLocale),e.has("metadataConfiguration")&&B.actions.metadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&B.actions.noCustom(this.noCustom),e.has("editorMode")&&B.actions.editorMode(this.editorMode),e.has("noCustomComponent")&&B.actions.noCustomComponent(this.noCustomComponent),e.has("session")&&B.actions.session(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(c=>Or.addContext(c)),e.has("openExternalDocumentInNewTab")&&B.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&B.actions.navigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&B.actions.forcedOffline(this.forcedOffline),e.has("localesConfiguration")&&(B.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),B.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),B.actions.searchInAllLanguagesAllowed((s=(i=this.localesConfiguration)===null||i===void 0?void 0:i.allLanguagesAllowed)!==null&&s!==void 0?s:!1)),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration())}async updateSession(){this.session=await this.cache.get("session",async()=>{let e=await this.apiProvider().getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},e.idleTimeoutInMillis),e})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}};ie.elementDefinitions={};ie.styles=Mc;he([w()],ie.prototype,"baseUrl",void 0);he([w()],ie.prototype,"apiIntegrationIdentifier",void 0);he([w()],ie.prototype,"uiLocale",void 0);he([We(null)],ie.prototype,"availableUiLocales",void 0);he([We(null)],ie.prototype,"metadataConfiguration",void 0);he([w({type:Boolean})],ie.prototype,"editorMode",void 0);he([w({type:Boolean})],ie.prototype,"noCustom",void 0);he([w({type:Boolean})],ie.prototype,"openExternalDocumentInNewTab",void 0);he([w({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],ie.prototype,"noCustomComponent",void 0);he([w({type:Boolean})],ie.prototype,"withManualResources",void 0);he([w({type:Boolean})],ie.prototype,"navigatorOnline",void 0);he([w({type:Boolean})],ie.prototype,"forcedOffline",void 0);he([w({type:Object})],ie.prototype,"apiProvider",void 0);he([We([])],ie.prototype,"messageContexts",void 0);he([We(void 0)],ie.prototype,"session",void 0);he([Q()],ie.prototype,"localesConfiguration",void 0);var Bo=class extends xt{async listMySearches(){let{session:e}=B.getState();return Gl(e,se.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),5*60*1e3):[]}};var Uo=class extends xt{async listMyBookmarks(){let e=B.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),5*60*1e3):[]}};var _u="ft-user-assets",Fo=Bt.get({name:_u,initialState:{savedSearches:void 0,bookmarks:void 0}}),Ni=class{constructor(){this.currentSession=B.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Uo,this.savedSearchesService=new Bo,B.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:o}=B.getState();Ce((e=this.currentSession)===null||e===void 0?void 0:e.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Fo.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Fo.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();Fo.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let o=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Fo.actions.bookmarks(o)}}},aE=new Ni;var Ti=class{addCommand(e,o=!1){B.commands.add(e,o)}consumeCommand(e){return B.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ti;var _i=class{highlightHtml(e,o,n){Ra(e,o,n)}};window.FluidTopicsHighlightHtmlService=new _i;var Li=class{isDate(e){var o,n,a,i;return(i=(a=((n=(o=B.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(e,o){var n,a,i;return cr.format(e,(n=o?.locale)!==null&&n!==void 0?n:B.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(i=o?.withTime)!==null&&i!==void 0?i:!1)}};window.FluidTopicsDateService=new Li;var Jr=class{static get(e,o){var n,a,i,s;let c=B.getState(),{lang:d,region:u}=(a=(n=c.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new lr(c.baseUrl,(s=(i=window.FluidTopicsClientConfiguration)===null||i===void 0?void 0:i.predefinedSorts)!==null&&s!==void 0?s:{},e??20,c.searchInAllLanguagesAllowed,o??`${d}-${u}`)}};var Ii=class{urlToSearchRequest(e){return Jr.get().parse(e)}searchRequestToUrl(e){return Jr.get().serialize(e)}};window.FluidTopicsUrlService=new Ii;var Wt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Wt.eventName="change";var Pi=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let o=sessionStorage.getItem(this.itemName(e));return o?JSON.parse(o):void 0}set(e,o){sessionStorage.setItem(this.itemName(e),JSON.stringify(o))}},Bc=new Pi;var Wo=class t extends Ye{static build(){return new t(window.history,Bc,()=>window.location,!1)}constructor(e,o,n,a){var i,s;super(),this.history=e,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(i=e.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(e,o=!1){let n=o&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),Ce(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Wt(this.currentItem())),0)}installProxies(){let e=o=>(n,a,[i,s,c])=>{let d=o(),u={...d===this.currentIndex?this.currentState:void 0,...i,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(a,[u,s,c]),this.setCurrentState(u,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let o=this.history.length-1;o>=0;o--)e?this.states[o]=this.historyStorage.get(o):setTimeout(()=>this.states[o]=this.historyStorage.get(o),this.history.length-o)}updateCurrentState(e){var o;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(o=e?.title)!==null&&o!==void 0?o:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Wt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Wt.eventName,e)}currentItem(){return Pr(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 Pr(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 Pr(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var o;let n=(o=this.states[e])===null||o===void 0?void 0:o.majorStateId;if(!n)return e;let a=e,i=e+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,n);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var e,o;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(o=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&o!==void 0?o:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,o){var n;if(!this.hasState(e))return!1;let a=o??this.currentState.majorStateId,i=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Wo.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});J("ft-app-context")(ie);function Uc(t){return t.match(/^[\w-]+\.[\w-]+$/)}var Lu=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Fc=Symbol("i18nAttributes"),Wc=Symbol("i18nListAttributes"),zc=Symbol("i18nProperties"),Ho=Symbol("i18nContexts"),Qr=Symbol("i18nUnsubs");function jo(t){var e,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[o]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?$o:Or}i18n(i){var s;this.hasI18nContext(i.context)||this.addI18nContext(i.context,void 0,i.custom);let c=(s=i.args)!==null&&s!==void 0?s:i.argsProvider?i.argsProvider(this):[];return this.getI18nService(i.custom).resolveMessage(i.context,i.key,...c)}customI18n(i,s){if(Uc(i)){let[c,d]=i.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,c,d)=>i.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,c,d)=>{var u;return((u=d?.context)===null||u===void 0?void 0:u.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,c;let d=this,u=(h,f,m)=>m?.context&&m.key&&i(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,...h})}:m;(s=this[Fc])===null||s===void 0||s.forEach((h,f)=>d[f]=u(h,f,d[f])),(c=this[Wc])===null||c===void 0||c.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(b=>u(h,f,b))})}updateI18nProperties(i){var s;(s=this[zc])===null||s===void 0||s.forEach((c,d)=>{i(c,d)&&(this[d]=this.i18n(c))})}addI18nMessages(i,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,c)}addI18nContext(i,s,c){let d=(typeof i=="string"?i:i.name).toLowerCase();c=typeof i=="string"?c:i.custom,this[Ho].set(d,{isCustomContext:c}),this[Qr].has(d)||this[Qr].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(i){return this[Ho].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ho].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Qr].forEach(i=>i()),this[Qr].clear()}}return e=Ho,o=Qr,Lu([w({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}var Hc=class extends jo(V){},zo=class extends jo(je){};var eo=function(t,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,o,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},Me=class extends zo{constructor(){super(),this.editorMode=!1,this.addStore(B)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":j:U`
|
|
1285
1285
|
<span class="ft-i18n">
|
|
1286
1286
|
${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}
|
|
1287
1287
|
</span>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-toc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Main table of content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-icon": "1.
|
|
23
|
-
"@fluid-topics/ft-reader-context": "1.
|
|
24
|
-
"@fluid-topics/ft-size-watcher": "1.
|
|
25
|
-
"@fluid-topics/ft-typography": "1.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "1.
|
|
22
|
+
"@fluid-topics/ft-icon": "1.3.0",
|
|
23
|
+
"@fluid-topics/ft-reader-context": "1.3.0",
|
|
24
|
+
"@fluid-topics/ft-size-watcher": "1.3.0",
|
|
25
|
+
"@fluid-topics/ft-typography": "1.3.0",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "1.3.0",
|
|
27
27
|
"lit": "3.1.0"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "cc982effbf27c0483e03961ad450fd2057a108b2"
|
|
30
30
|
}
|