@fluid-topics/ft-reader-attachments 1.2.46 → 1.2.48
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.
|
@@ -227,7 +227,7 @@
|
|
|
227
227
|
}
|
|
228
228
|
`;var go=S(A()),mo=S(G());var yo;(function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"})(yo||(yo={}));var Yn=function(t,r,o,a){var i=arguments.length,c=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,r,o,a);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(c=(i<3?l(c):i>3?l(r,o,c):l(r,o))||c);return i>3&&c&&Object.defineProperty(r,o,c),c},tr=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},er=Symbol("registerInterval");function qn(t){var r;class o extends t{constructor(){super(...arguments),this[r]=0}setReaderStateManager(i){this.clearStateManager(),this.stateManager=i,this.addStore(i.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var i;return(i=this.stateManager)===null||i===void 0?void 0:i.service}connectedCallback(){super.connectedCallback(),this[er]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[er]):this.dispatchEvent(new tr)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return r=er,Yn([(0,mo.state)()],o.prototype,"stateManager",void 0),o}var mt=class extends qn(go.FtLitElementRedux){};var zn=S(xo());var Oa=S(A());var Gt=S(U()),$t=S(G()),jt=S(A());var vo=S(U());var So=vo.css`
|
|
229
229
|
`;var zt=S(A());var xa=S(A());var Eo=S(U()),z=S(G()),X=S(A());var Oo=S(U());var Co=Oo.css`
|
|
230
|
-
`;var bt=S(A()),Xn="ft-app-info",rr=class extends CustomEvent{constructor(r){super("authentication-change",{detail:r})}},Jn={session:(t,r)=>{(0,bt.deepEqual)(t.session,r.payload)||(t.session=r.payload,setTimeout(()=>C.dispatchEvent(new rr(r.payload)),0))}},C=bt.FtReduxStore.get({name:Xn,reducers:Jn,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var re=S(A());var or=S(A());var Se=class t{static get(r){let{baseUrl:o,apiIntegrationIdentifier:a}=C.getState(),i=r??a;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(r){return new Promise(o=>{let a=t.get(r);if(a)o(a);else{let i=C.subscribe(()=>{a=t.get(r),a&&(i(),o(a))})}})}};var Qe=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:Se.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Se.await()}};var de=class extends Qe{constructor(r=!0,o){var a;super(o);let i=this.constructor;i.commonCache=(a=i.commonCache)!==null&&a!==void 0?a:new or.CacheRegistry,this.cache=r?i.commonCache:new or.CacheRegistry}clearCache(){this.cache.clearAll()}};var wo,Qn=Symbol("clearAfterUnitTest"),xt=class extends de{constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[wo]=()=>{this.defaultMessages={},this.cache=new re.CacheRegistry,this.listeners={}},this.currentUiLocale=C.getState().uiLocale,C.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:r}=C.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 a;if(r=r.toLowerCase(),Object.keys(o).length>0){let i={...(a=this.defaultMessages[r])!==null&&a!==void 0?a:{},...o};(0,re.deepEqual)(this.defaultMessages[r],i)||(this.defaultMessages[r]=i,await this.notify(r))}
|
|
230
|
+
`;var bt=S(A()),Xn="ft-app-info",rr=class extends CustomEvent{constructor(r){super("authentication-change",{detail:r})}},Jn={session:(t,r)=>{(0,bt.deepEqual)(t.session,r.payload)||(t.session=r.payload,setTimeout(()=>C.dispatchEvent(new rr(r.payload)),0))}},C=bt.FtReduxStore.get({name:Xn,reducers:Jn,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1}});var re=S(A());var or=S(A());var Se=class t{static get(r){let{baseUrl:o,apiIntegrationIdentifier:a}=C.getState(),i=r??a;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static await(r){return new Promise(o=>{let a=t.get(r);if(a)o(a);else{let i=C.subscribe(()=>{a=t.get(r),a&&(i(),o(a))})}})}};var Qe=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:Se.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Se.await()}};var de=class extends Qe{constructor(r=!0,o){var a;super(o);let i=this.constructor;i.commonCache=(a=i.commonCache)!==null&&a!==void 0?a:new or.CacheRegistry,this.cache=r?i.commonCache:new or.CacheRegistry}clearCache(){this.cache.clearAll()}};var wo,Qn=Symbol("clearAfterUnitTest"),xt=class extends de{constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[wo]=()=>{this.defaultMessages={},this.cache=new re.CacheRegistry,this.listeners={}},this.currentUiLocale=C.getState().uiLocale,C.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:r}=C.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 a;if(r=r.toLowerCase(),Object.keys(o).length>0){let i={...(a=this.defaultMessages[r])!==null&&a!==void 0?a:{},...o};(0,re.deepEqual)(this.defaultMessages[r],i)||(this.defaultMessages[r]=i,await this.notify(r))}return this.fetchContext(r)}resolveContext(r){var o,a;return this.fetchContext(r),(a=(o=this.cache.getNow(r))===null||o===void 0?void 0:o.messages)!==null&&a!==void 0?a:{}}resolveRawMessage(r,o){let a=r.toLowerCase();return this.resolveContext(a)[o]}resolveMessage(r,o,...a){var i;let c=r.toLowerCase(),l=this.resolveContext(c);return new re.ParametrizedLabelResolver((i=this.defaultMessages[c])!==null&&i!==void 0?i:{},l).resolve(o,...a)}async fetchContext(r){let o=!this.cache.has(r),a;try{a=await this.cache.get(r,()=>this.messageContextProvider(this.currentUiLocale,r))}catch(i){i instanceof re.CanceledPromiseError||console.error(i)}return o&&await this.notify(r),a}subscribe(r,o){var a;return r=r.toLowerCase(),this.listeners[r]=(a=this.listeners[r])!==null&&a!==void 0?a:new Set,this.listeners[r].add(o),()=>{var i;return(i=this.listeners[r])===null||i===void 0?void 0:i.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,re.delay)(0).then(()=>o()).catch(()=>null)))}};wo=Qn;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends xt{constructor(){super(async(t,r)=>(await this.awaitApi).getFluidTopicsMessageContext(t,r))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends xt{constructor(){super(async(t,r)=>(await this.awaitApi).getCustomMessageContext(t,r))}});var Pe=window.FluidTopicsI18nService,vt=window.FluidTopicsCustomI18nService;var D=function(t,r,o,a){var i=arguments.length,c=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,r,o,a);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(c=(i<3?l(c):i>3?l(r,o,c):l(r,o))||c);return i>3&&c&&Object.defineProperty(r,o,c),c},k=class extends X.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=()=>Se.get(),this.messageContexts=[],this.cache=new X.CacheRegistry,this.cleanSessionDebouncer=new X.Debouncer}render(){return Eo.html`
|
|
231
231
|
<slot></slot>
|
|
232
232
|
`}update(r){var o,a,i,c,l;super.update(r),r.has("baseUrl")&&(C.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&C.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("uiLocale")&&C.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&C.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&C.actions.noCustom(this.noCustom),r.has("editorMode")&&C.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&C.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&C.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(d=>Pe.addContext(d)),r.has("openExternalDocumentInNewTab")&&C.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&C.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&C.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(C.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),C.actions.availableUiLocales((i=(a=this.localesConfiguration)===null||a===void 0?void 0:a.availableUiLocales)!==null&&i!==void 0?i:[]),C.actions.searchInAllLanguagesAllowed((l=(c=this.localesConfiguration)===null||c===void 0?void 0:c.allLanguagesAllowed)!==null&&l!==void 0?l:!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())}};k.elementDefinitions={};k.styles=Co;D([(0,z.property)()],k.prototype,"baseUrl",void 0);D([(0,z.property)()],k.prototype,"apiIntegrationIdentifier",void 0);D([(0,z.property)()],k.prototype,"uiLocale",void 0);D([(0,X.jsonProperty)(null)],k.prototype,"availableUiLocales",void 0);D([(0,X.jsonProperty)(null)],k.prototype,"metadataConfiguration",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"editorMode",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"noCustom",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"openExternalDocumentInNewTab",void 0);D([(0,z.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],k.prototype,"noCustomComponent",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"withManualResources",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"navigatorOnline",void 0);D([(0,z.property)({type:Boolean})],k.prototype,"forcedOffline",void 0);D([(0,z.property)({type:Object})],k.prototype,"apiProvider",void 0);D([(0,X.jsonProperty)([])],k.prototype,"messageContexts",void 0);D([(0,X.jsonProperty)(void 0)],k.prototype,"session",void 0);D([(0,z.state)()],k.prototype,"localesConfiguration",void 0);var zi=S(G());function ei(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;var o,a,i;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(a=o;a--!==0;)if(!St(t[a],r[a]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;for(a of t.entries())if(!St(a[1],r.get(a[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(a of t.entries())if(!r.has(a[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();let c=l=>Object.keys(l).filter(d=>l[d]!=null);if(i=c(t),o=i.length,o!==c(r).length)return!1;for(a=o;a--!==0;)if(!Object.prototype.hasOwnProperty.call(r,i[a]))return!1;for(a=o;a--!==0;){let l=i[a];if(!St(t[l],r[l]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function St(t,r){try{return ei(t,r)}catch{return!1}}function Ot(t,r){return!St(t,r)}var ti=S(G(),1);var Ct=class{constructor(){this.queue=[]}add(r,o=!1){o&&(this.queue=this.queue.filter(a=>a.type!==r.type)),this.queue.push(r)}consume(r){let o=this.queue.find(a=>a.type===r);return o&&(this.queue=this.queue.filter(a=>a!==o)),o}};var et=S(G(),1);var No=S(G(),1);function Ao(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,No.property)({type:Object,converter:{fromAttribute:a=>{if(a==null)return o();try{return JSON.parse(a)}catch{return o()}},toAttribute:a=>JSON.stringify(a)},hasChanged:Ot,...r??{}})}var wt=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,a)=>{this.resolvePromise=o,this.rejectPromise=a})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),r??this.timeout),this.promise}async runCallbacks(){var r,o;let a=[...this.callbacks];this.callbacks=[];let i=(r=this.rejectPromise)!==null&&r!==void 0?r:()=>null,c=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of a)try{await l()}catch(d){i(d);return}c(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Io=S(U(),1);var Et=globalThis,ri=Et.ShadowRoot&&(Et.ShadyCSS===void 0||Et.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Bc=Symbol();var Ro=(t,r)=>{if(ri)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let a=document.createElement("style"),i=Et.litNonce;i!==void 0&&a.setAttribute("nonce",i),a.textContent=o.cssText,t.appendChild(a)}};var Nt=class extends Io.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([i,c])=>r.registry.define(i,c)));let o={...r.shadowRootOptions,customElements:r.registry},a=this.renderOptions.creationScope=this.attachShadow(o);return Ro(a,r.elementStyles),a}};var At=function(t,r,o,a){var i=arguments.length,c=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,r,o,a);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(c=(i<3?l(c):i>3?l(r,o,c):l(r,o))||c);return i>3&&c&&Object.defineProperty(r,o,c),c},_o,Lo=Symbol("constructorPrototype"),Po=Symbol("constructorName"),To=Symbol("exportpartsDebouncer"),ko=Symbol("dynamicDependenciesLoaded"),pe=class extends Nt{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[_o]=new wt(5),this[Po]=this.constructor.name,this[Lo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Po]&&Object.setPrototypeOf(this,this[Lo])}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[ko]||(r[ko]=!0,this.importDynamicDependencies())}importDynamicDependencies(){}updated(r){super.updated(r),this.updateComplete.then(()=>{this.contentAvailableCallback(r),this.applyCustomStylesheet(r),this.scheduleExportpartsUpdate()})}contentAvailableCallback(r){}applyCustomStylesheet(r){var o,a,i;if(((a=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&a!==void 0?a:[]).forEach(c=>c.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(c){console.error(c,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let c=document.createElement("style");c.classList.add("ft-lit-element--custom-stylesheet"),c.innerHTML=this.customStylesheet,this.shadowRoot.append(c)}}scheduleExportpartsUpdate(){var r,o,a;(!((r=this.exportpartsPrefix)===null||r===void 0)&&r.trim()||(a=(o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)!==null&&a!==void 0&&a)&&this[To].run(()=>{var i,c;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((c=this.exportpartsPrefixes)===null||c===void 0?void 0:c.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(r){var o,a,i,c,l,d;let f=y=>y!=null&&y.trim().length>0,p=r.filter(f).map(y=>y.trim());if(p.length===0){this.removeAttribute("exportparts");return}let u=new Set;for(let y of(a=(o=this.shadowRoot)===null||o===void 0?void 0:o.querySelectorAll("[part],[exportparts]"))!==null&&a!==void 0?a:[]){let x=(c=(i=y.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&c!==void 0?c:[],m=(d=(l=y.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(v=>v.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...x,...m).filter(f).map(v=>v.trim()).forEach(v=>u.add(v))}if(u.size===0){this.removeAttribute("exportparts");return}let h=[...u.values()].flatMap(y=>p.map(x=>`${y}:${x}--${y}`));this.setAttribute("exportparts",[...this.part,...h].join(", "))}};_o=To;At([(0,et.property)()],pe.prototype,"exportpartsPrefix",void 0);At([Ao([])],pe.prototype,"exportpartsPrefixes",void 0);At([(0,et.property)()],pe.prototype,"customStylesheet",void 0);At([(0,et.state)()],pe.prototype,"useAdoptedStyleSheets",void 0);function tt(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Wo,Bo,Do,rt=Symbol("internalReduxEventsUnsubscribers"),fe=Symbol("internalStoresUnsubscribers"),Oe=Symbol("internalStores"),ot=class extends pe{constructor(){super(...arguments),this[Wo]=new Map,this[Bo]=new Map,this[Do]=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[Oe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Oe].values()][0]}getStore(r){return r==null?this.getUnnamedStore():this[Oe].get(r)}addStore(r,o){var a;o=(a=o??(tt(r)?r.name:void 0))!==null&&a!==void 0?a:"default-store",this.unsubscribeFromStore(o),this[Oe].set(o,r),this.subscribeToStore(o,r),this.updateFromStores()}removeStore(r){let o=typeof r=="string"?r:r.name;this.unsubscribeFromStore(o),this[Oe].delete(o)}setupStores(){this.unsubscribeFromStores(),this[Oe].forEach((r,o)=>this.subscribeToStore(o,r)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((r,o)=>{let a=this.constructor.getPropertyOptions(o);if(!a?.attribute||!this.hasAttribute(typeof a?.attribute=="string"?a.attribute:o)){let i=this.getStore(r.store);i&&(r.store?this[fe].has(r.store):this[fe].size>0)&&(this[o]=r.selector(i.getState(),this))}})}subscribeToStore(r,o){var a;this[fe].set(r,o.subscribe(()=>this.updateFromStores())),this[rt].set(r,[]),tt(o)&&o.eventBus&&((a=this.reduxConstructor.reduxEventListeners)===null||a===void 0||a.forEach((i,c)=>{if(typeof this[c]=="function"&&(!i.store||o.name===i.store)){let l=d=>this[c](d);o.addEventListener(i.eventName,l),this[rt].get(r).push(()=>o.removeEventListener(i.eventName,l))}})),this.onStoreAvailable(r)}unsubscribeFromStores(){this[fe].forEach((r,o)=>this.unsubscribeFromStore(o))}unsubscribeFromStore(r){var o;this[fe].has(r)&&this[fe].get(r)(),this[fe].delete(r),(o=this[rt].get(r))===null||o===void 0||o.forEach(a=>a()),this[rt].delete(r)}onStoreAvailable(r){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}};Wo=fe,Bo=Oe,Do=rt;ot.reduxProperties=new Map;ot.reduxReactiveProperties=new Set;ot.reduxEventListeners=new Map;function F(t){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];if(0)var i,c;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(l){return"'"+l+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ne(t){return!!t&&!!t[L]}function J(t){var r;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var a=Object.getPrototypeOf(o);if(a===null)return!0;var i=Object.hasOwnProperty.call(a,"constructor")&&a.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===di}(t)||Array.isArray(t)||!!t[jo]||!!(!((r=t.constructor)===null||r===void 0)&&r[jo])||fr(t)||ur(t))}function Ce(t,r,o){o===void 0&&(o=!1),Te(t)===0?(o?Object.keys:_e)(t).forEach(function(a){o&&typeof a=="symbol"||r(a,t[a],t)}):t.forEach(function(a,i){return r(i,a,t)})}function Te(t){var r=t[L];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:fr(t)?2:ur(t)?3:0}function ke(t,r){return Te(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function oi(t,r){return Te(t)===2?t.get(r):t[r]}function Ko(t,r,o){var a=Te(t);a===2?t.set(r,o):a===3?t.add(o):t[r]=o}function Zo(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function fr(t){return li&&t instanceof Map}function ur(t){return si&&t instanceof Set}function ue(t){return t.o||t.t}function hr(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Yo(t);delete r[L];for(var o=_e(r),a=0;a<o.length;a++){var i=o[a],c=r[i];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[i]={configurable:!0,writable:!0,enumerable:c.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),r)}function yr(t,r){return r===void 0&&(r=!1),gr(t)||ne(t)||!J(t)||(Te(t)>1&&(t.set=t.add=t.clear=t.delete=ai),Object.freeze(t),r&&Ce(t,function(o,a){return yr(a,!0)},!0)),t}function ai(){F(2)}function gr(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function oe(t){var r=pr[t];return r||F(18,t),r}function ni(t,r){pr[t]||(pr[t]=r)}function lr(){return nt}function ar(t,r){r&&(oe("Patches"),t.u=[],t.s=[],t.v=r)}function Rt(t){sr(t),t.p.forEach(ii),t.p=null}function sr(t){t===nt&&(nt=t.l)}function Mo(t){return nt={p:[],l:nt,h:t,m:!0,_:0}}function ii(t){var r=t[L];r.i===0||r.i===1?r.j():r.g=!0}function nr(t,r){r._=r.p.length;var o=r.p[0],a=t!==void 0&&t!==o;return r.h.O||oe("ES5").S(r,t,a),a?(o[L].P&&(Rt(r),F(4)),J(t)&&(t=It(r,t),r.l||Lt(r,t)),r.u&&oe("Patches").M(o[L].t,t,r.u,r.s)):t=It(r,o,[]),Rt(r),r.u&&r.v(r.u,r.s),t!==Vo?t:void 0}function It(t,r,o){if(gr(r))return r;var a=r[L];if(!a)return Ce(r,function(d,f){return Uo(t,a,r,d,f,o)},!0),r;if(a.A!==t)return r;if(!a.P)return Lt(t,a.t,!0),a.t;if(!a.I){a.I=!0,a.A._--;var i=a.i===4||a.i===5?a.o=hr(a.k):a.o,c=i,l=!1;a.i===3&&(c=new Set(i),i.clear(),l=!0),Ce(c,function(d,f){return Uo(t,a,i,d,f,o,l)}),Lt(t,i,!1),o&&t.u&&oe("Patches").N(a,o,t.u,t.s)}return a.o}function Uo(t,r,o,a,i,c,l){if(ne(i)){var d=It(t,i,c&&r&&r.i!==3&&!ke(r.R,a)?c.concat(a):void 0);if(Ko(o,a,d),!ne(d))return;t.m=!1}else l&&o.add(i);if(J(i)&&!gr(i)){if(!t.h.D&&t._<1)return;It(t,i),r&&r.A.l||Lt(t,i)}}function Lt(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&yr(r,o)}function ir(t,r){var o=t[L];return(o?ue(o):t)[r]}function zo(t,r){if(r in t)for(var o=Object.getPrototypeOf(t);o;){var a=Object.getOwnPropertyDescriptor(o,r);if(a)return a;o=Object.getPrototypeOf(o)}}function he(t){t.P||(t.P=!0,t.l&&he(t.l))}function cr(t){t.o||(t.o=hr(t.t))}function dr(t,r,o){var a=fr(r)?oe("MapSet").F(r,o):ur(r)?oe("MapSet").T(r,o):t.O?function(i,c){var l=Array.isArray(i),d={i:l?1:0,A:c?c.A:lr(),P:!1,I:!1,R:{},l:c,t:i,k:null,o:null,j:null,C:!1},f=d,p=it;l&&(f=[d],p=at);var u=Proxy.revocable(f,p),h=u.revoke,y=u.proxy;return d.k=y,d.j=h,y}(r,o):oe("ES5").J(r,o);return(o?o.A:lr()).p.push(a),a}function ci(t){return ne(t)||F(22,t),function r(o){if(!J(o))return o;var a,i=o[L],c=Te(o);if(i){if(!i.P&&(i.i<4||!oe("ES5").K(i)))return i.t;i.I=!0,a=Ho(o,c),i.I=!1}else a=Ho(o,c);return Ce(a,function(l,d){i&&oi(i.t,l)===d||Ko(a,l,r(d))}),c===3?new Set(a):a}(t)}function Ho(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return hr(t)}function Fo(){function t(l,d){var f=c[l];return f?f.enumerable=d:c[l]=f={configurable:!0,enumerable:d,get:function(){var p=this[L];return it.get(p,l)},set:function(p){var u=this[L];it.set(u,l,p)}},f}function r(l){for(var d=l.length-1;d>=0;d--){var f=l[d][L];if(!f.P)switch(f.i){case 5:a(f)&&he(f);break;case 4:o(f)&&he(f)}}}function o(l){for(var d=l.t,f=l.k,p=_e(f),u=p.length-1;u>=0;u--){var h=p[u];if(h!==L){var y=d[h];if(y===void 0&&!ke(d,h))return!0;var x=f[h],m=x&&x[L];if(m?m.t!==y:!Zo(x,y))return!0}}var v=!!d[L];return p.length!==_e(d).length+(v?0:1)}function a(l){var d=l.k;if(d.length!==l.t.length)return!0;var f=Object.getOwnPropertyDescriptor(d,d.length-1);if(f&&!f.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function i(l){l.g&&F(3,JSON.stringify(ue(l)))}var c={};ni("ES5",{J:function(l,d){var f=Array.isArray(l),p=function(h,y){if(h){for(var x=Array(y.length),m=0;m<y.length;m++)Object.defineProperty(x,""+m,t(m,!0));return x}var v=Yo(y);delete v[L];for(var N=_e(v),w=0;w<N.length;w++){var E=N[w];v[E]=t(E,h||!!v[E].enumerable)}return Object.create(Object.getPrototypeOf(y),v)}(f,l),u={i:f?5:4,A:d?d.A:lr(),P:!1,I:!1,R:{},l:d,t:l,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,L,{value:u,writable:!0}),p},S:function(l,d,f){f?ne(d)&&d[L].A===l&&r(l.p):(l.u&&function p(u){if(u&&typeof u=="object"){var h=u[L];if(h){var y=h.t,x=h.k,m=h.R,v=h.i;if(v===4)Ce(x,function(R){R!==L&&(y[R]!==void 0||ke(y,R)?m[R]||p(x[R]):(m[R]=!0,he(h)))}),Ce(y,function(R){x[R]!==void 0||ke(x,R)||(m[R]=!1,he(h))});else if(v===5){if(a(h)&&(he(h),m.length=!0),x.length<y.length)for(var N=x.length;N<y.length;N++)m[N]=!1;else for(var w=y.length;w<x.length;w++)m[w]=!0;for(var E=Math.min(x.length,y.length),P=0;P<E;P++)x.hasOwnProperty(P)||(m[P]=!0),m[P]===void 0&&p(x[P])}}}}(l.p[0]),r(l.p))},K:function(l){return l.i===4?o(l):a(l)}})}var Go,nt,mr=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",li=typeof Map<"u",si=typeof Set<"u",$o=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Vo=mr?Symbol.for("immer-nothing"):((Go={})["immer-nothing"]=!0,Go),jo=mr?Symbol.for("immer-draftable"):"__$immer_draftable",L=mr?Symbol.for("immer-state"):"__$immer_state";var di=""+Object.prototype.constructor,_e=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Yo=Object.getOwnPropertyDescriptors||function(t){var r={};return _e(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},pr={},it={get:function(t,r){if(r===L)return t;var o=ue(t);if(!ke(o,r))return function(i,c,l){var d,f=zo(c,l);return f?"value"in f?f.value:(d=f.get)===null||d===void 0?void 0:d.call(i.k):void 0}(t,o,r);var a=o[r];return t.I||!J(a)?a:a===ir(t.t,r)?(cr(t),t.o[r]=dr(t.A.h,a,t)):a},has:function(t,r){return r in ue(t)},ownKeys:function(t){return Reflect.ownKeys(ue(t))},set:function(t,r,o){var a=zo(ue(t),r);if(a?.set)return a.set.call(t.k,o),!0;if(!t.P){var i=ir(ue(t),r),c=i?.[L];if(c&&c.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(Zo(o,i)&&(o!==void 0||ke(t.t,r)))return!0;cr(t),he(t)}return t.o[r]===o&&(o!==void 0||r in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[r])||(t.o[r]=o,t.R[r]=!0),!0},deleteProperty:function(t,r){return ir(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,cr(t),he(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=ue(t),a=Reflect.getOwnPropertyDescriptor(o,r);return a&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:a.enumerable,value:o[r]}},defineProperty:function(){F(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){F(12)}},at={};Ce(it,function(t,r){at[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),at.deleteProperty=function(t,r){return at.set.call(this,t,r,void 0)},at.set=function(t,r,o){return it.set.call(this,t[0],r,o,t[0])};var pi=function(){function t(o){var a=this;this.O=$o,this.D=!0,this.produce=function(i,c,l){if(typeof i=="function"&&typeof c!="function"){var d=c;c=i;var f=a;return function(v){var N=this;v===void 0&&(v=d);for(var w=arguments.length,E=Array(w>1?w-1:0),P=1;P<w;P++)E[P-1]=arguments[P];return f.produce(v,function(R){var se;return(se=c).call.apply(se,[N,R].concat(E))})}}var p;if(typeof c!="function"&&F(6),l!==void 0&&typeof l!="function"&&F(7),J(i)){var u=Mo(a),h=dr(a,i,void 0),y=!0;try{p=c(h),y=!1}finally{y?Rt(u):sr(u)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(v){return ar(u,l),nr(v,u)},function(v){throw Rt(u),v}):(ar(u,l),nr(p,u))}if(!i||typeof i!="object"){if((p=c(i))===void 0&&(p=i),p===Vo&&(p=void 0),a.D&&yr(p,!0),l){var x=[],m=[];oe("Patches").M(i,p,x,m),l(x,m)}return p}F(21,i)},this.produceWithPatches=function(i,c){if(typeof i=="function")return function(p){for(var u=arguments.length,h=Array(u>1?u-1:0),y=1;y<u;y++)h[y-1]=arguments[y];return a.produceWithPatches(p,function(x){return i.apply(void 0,[x].concat(h))})};var l,d,f=a.produce(i,c,function(p,u){l=p,d=u});return typeof Promise<"u"&&f instanceof Promise?f.then(function(p){return[p,l,d]}):[f,l,d]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var r=t.prototype;return r.createDraft=function(o){J(o)||F(8),ne(o)&&(o=ci(o));var a=Mo(this),i=dr(this,o,void 0);return i[L].C=!0,sr(a),i},r.finishDraft=function(o,a){var i=o&&o[L],c=i.A;return ar(c,a),nr(void 0,c)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!$o&&F(20),this.O=o},r.applyPatches=function(o,a){var i;for(i=a.length-1;i>=0;i--){var c=a[i];if(c.path.length===0&&c.op==="replace"){o=c.value;break}}i>-1&&(a=a.slice(i+1));var l=oe("Patches").$;return ne(o)?l(o,a):this.produce(o,function(d){return l(d,a)})},t}(),$=new pi,fi=$.produce,Vc=$.produceWithPatches.bind($),Yc=$.setAutoFreeze.bind($),qc=$.setUseProxies.bind($),Xc=$.applyPatches.bind($),Jc=$.createDraft.bind($),Qc=$.finishDraft.bind($),Pt=fi;function we(t){"@babel/helpers - typeof";return we=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},we(t)}function qo(t,r){if(we(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var a=o.call(t,r||"default");if(we(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Xo(t){var r=qo(t,"string");return we(r)=="symbol"?r:r+""}function Jo(t,r,o){return(r=Xo(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function Qo(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);r&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),o.push.apply(o,a)}return o}function br(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Qo(Object(o),!0).forEach(function(a){Jo(t,a,o[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Qo(Object(o)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(o,a))})}return t}function M(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ea=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),xr=function(){return Math.random().toString(36).substring(7).split("").join(".")},kt={INIT:"@@redux/INIT"+xr(),REPLACE:"@@redux/REPLACE"+xr(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+xr()}};function ui(t){if(typeof t!="object"||t===null)return!1;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(t)===r}function vr(t,r,o){var a;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(M(1));return o(vr)(t,r)}if(typeof t!="function")throw new Error(M(2));var i=t,c=r,l=[],d=l,f=!1;function p(){d===l&&(d=l.slice())}function u(){if(f)throw new Error(M(3));return c}function h(v){if(typeof v!="function")throw new Error(M(4));if(f)throw new Error(M(5));var N=!0;return p(),d.push(v),function(){if(N){if(f)throw new Error(M(6));N=!1,p();var E=d.indexOf(v);d.splice(E,1),l=null}}}function y(v){if(!ui(v))throw new Error(M(7));if(typeof v.type>"u")throw new Error(M(8));if(f)throw new Error(M(9));try{f=!0,c=i(c,v)}finally{f=!1}for(var N=l=d,w=0;w<N.length;w++){var E=N[w];E()}return v}function x(v){if(typeof v!="function")throw new Error(M(10));i=v,y({type:kt.REPLACE})}function m(){var v,N=h;return v={subscribe:function(E){if(typeof E!="object"||E===null)throw new Error(M(11));function P(){E.next&&E.next(u())}P();var R=N(P);return{unsubscribe:R}}},v[ea]=function(){return this},v}return y({type:kt.INIT}),a={dispatch:y,subscribe:h,getState:u,replaceReducer:x},a[ea]=m,a}function hi(t){Object.keys(t).forEach(function(r){var o=t[r],a=o(void 0,{type:kt.INIT});if(typeof a>"u")throw new Error(M(12));if(typeof o(void 0,{type:kt.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(M(13))})}function ta(t){for(var r=Object.keys(t),o={},a=0;a<r.length;a++){var i=r[a];typeof t[i]=="function"&&(o[i]=t[i])}var c=Object.keys(o),l,d;try{hi(o)}catch(f){d=f}return function(p,u){if(p===void 0&&(p={}),d)throw d;if(0)var h;for(var y=!1,x={},m=0;m<c.length;m++){var v=c[m],N=o[v],w=p[v],E=N(w,u);if(typeof E>"u"){var P=u&&u.type;throw new Error(M(14))}x[v]=E,y=y||E!==w}return y=y||c.length!==Object.keys(p).length,y?x:p}}function We(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return r.length===0?function(a){return a}:r.length===1?r[0]:r.reduce(function(a,i){return function(){return a(i.apply(void 0,arguments))}})}function ra(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(a){return function(){var i=a.apply(void 0,arguments),c=function(){throw new Error(M(15))},l={getState:i.getState,dispatch:function(){return c.apply(void 0,arguments)}},d=r.map(function(f){return f(l)});return c=We.apply(void 0,d)(i.dispatch),br(br({},i),{},{dispatch:c})}}}function oa(t){var r=function(a){var i=a.dispatch,c=a.getState;return function(l){return function(d){return typeof d=="function"?d(i,c,t):l(d)}}};return r}var aa=oa();aa.withExtraArgument=oa;var Sr=aa;var sa=function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,i){a.__proto__=i}||function(a,i){for(var c in i)Object.prototype.hasOwnProperty.call(i,c)&&(a[c]=i[c])},t(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");t(r,o);function a(){this.constructor=r}r.prototype=o===null?Object.create(o):(a.prototype=o.prototype,new a)}}(),yi=function(t,r){var o={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},a,i,c,l;return l={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(p){return function(u){return f([p,u])}}function f(p){if(a)throw new TypeError("Generator is already executing.");for(;o;)try{if(a=1,i&&(c=p[0]&2?i.return:p[0]?i.throw||((c=i.return)&&c.call(i),0):i.next)&&!(c=c.call(i,p[1])).done)return c;switch(i=0,c&&(p=[p[0]&2,c.value]),p[0]){case 0:case 1:c=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,i=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(c=o.trys,!(c=c.length>0&&c[c.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!c||p[1]>c[0]&&p[1]<c[3])){o.label=p[1];break}if(p[0]===6&&o.label<c[1]){o.label=c[1],c=p;break}if(c&&o.label<c[2]){o.label=c[2],o.ops.push(p);break}c[2]&&o.ops.pop(),o.trys.pop();continue}p=r.call(t,o)}catch(u){p=[6,u],i=0}finally{a=c=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Be=function(t,r){for(var o=0,a=r.length,i=t.length;o<a;o++,i++)t[i]=r[o];return t},gi=Object.defineProperty,mi=Object.defineProperties,bi=Object.getOwnPropertyDescriptors,na=Object.getOwnPropertySymbols,xi=Object.prototype.hasOwnProperty,vi=Object.prototype.propertyIsEnumerable,ia=function(t,r,o){return r in t?gi(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},ye=function(t,r){for(var o in r||(r={}))xi.call(r,o)&&ia(t,o,r[o]);if(na)for(var a=0,i=na(r);a<i.length;a++){var o=i[a];vi.call(r,o)&&ia(t,o,r[o])}return t},Or=function(t,r){return mi(t,bi(r))},Si=function(t,r,o){return new Promise(function(a,i){var c=function(f){try{d(o.next(f))}catch(p){i(p)}},l=function(f){try{d(o.throw(f))}catch(p){i(p)}},d=function(f){return f.done?a(f.value):Promise.resolve(f.value).then(c,l)};d((o=o.apply(t,r)).next())})};var Oi=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?We:We.apply(null,arguments)},ml=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ci(t){if(typeof t!="object"||t===null)return!1;var r=Object.getPrototypeOf(t);if(r===null)return!0;for(var o=r;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return r===o}var wi=function(t){sa(r,t);function r(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,r.prototype),i}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,Be([void 0],o[0].concat(this)))):new(r.bind.apply(r,Be([void 0],o.concat(this))))},r}(Array),Ei=function(t){sa(r,t);function r(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var i=t.apply(this,o)||this;return Object.setPrototypeOf(i,r.prototype),i}return Object.defineProperty(r,Symbol.species,{get:function(){return r},enumerable:!1,configurable:!0}),r.prototype.concat=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return t.prototype.concat.apply(this,o)},r.prototype.prepend=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return o.length===1&&Array.isArray(o[0])?new(r.bind.apply(r,Be([void 0],o[0].concat(this)))):new(r.bind.apply(r,Be([void 0],o.concat(this))))},r}(Array);function Er(t){return J(t)?Pt(t,function(){}):t}function Ni(t){return typeof t=="boolean"}function Ai(){return function(r){return Ri(r)}}function Ri(t){t===void 0&&(t={});var r=t.thunk,o=r===void 0?!0:r,a=t.immutableCheck,i=a===void 0?!0:a,c=t.serializableCheck,l=c===void 0?!0:c,d=new wi;if(o&&(Ni(o)?d.push(Sr):d.push(Sr.withExtraArgument(o.extraArgument))),0){if(i)var f;if(l)var p}return d}var Cr=!0;function da(t){var r=Ai(),o=t||{},a=o.reducer,i=a===void 0?void 0:a,c=o.middleware,l=c===void 0?r():c,d=o.devTools,f=d===void 0?!0:d,p=o.preloadedState,u=p===void 0?void 0:p,h=o.enhancers,y=h===void 0?void 0:h,x;if(typeof i=="function")x=i;else if(Ci(i))x=ta(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=l;if(typeof m=="function"&&(m=m(r),!Cr&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Cr&&m.some(function(R){return typeof R!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=ra.apply(void 0,m),N=We;f&&(N=Oi(ye({trace:!Cr},typeof f=="object"&&f)));var w=new Ei(v),E=w;Array.isArray(y)?E=Be([v],y):typeof y=="function"&&(E=y(w));var P=N.apply(void 0,E);return vr(x,u,P)}function ge(t,r){function o(){for(var a=[],i=0;i<arguments.length;i++)a[i]=arguments[i];if(r){var c=r.apply(void 0,a);if(!c)throw new Error("prepareAction did not return an object");return ye(ye({type:t,payload:c.payload},"meta"in c&&{meta:c.meta}),"error"in c&&{error:c.error})}return{type:t,payload:a[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(a){return a.type===t},o}function pa(t){var r={},o=[],a,i={addCase:function(c,l){var d=typeof c=="string"?c:c.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=l,i},addMatcher:function(c,l){return o.push({matcher:c,reducer:l}),i},addDefaultCase:function(c){return a=c,i}};return t(i),[r,o,a]}function Ii(t){return typeof t=="function"}function Li(t,r,o,a){o===void 0&&(o=[]);var i=typeof r=="function"?pa(r):[r,o,a],c=i[0],l=i[1],d=i[2],f;if(Ii(t))f=function(){return Er(t())};else{var p=Er(t);f=function(){return p}}function u(h,y){h===void 0&&(h=f());var x=Be([c[y.type]],l.filter(function(m){var v=m.matcher;return v(y)}).map(function(m){var v=m.reducer;return v}));return x.filter(function(m){return!!m}).length===0&&(x=[d]),x.reduce(function(m,v){if(v)if(ne(m)){var N=m,w=v(N,y);return w===void 0?m:w}else{if(J(m))return Pt(m,function(E){return v(E,y)});var w=v(m,y);if(w===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return w}return m},h)}return u.getInitialState=f,u}function Pi(t,r){return t+"/"+r}function fa(t){var r=t.name;if(!r)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:Er(t.initialState),a=t.reducers||{},i=Object.keys(a),c={},l={},d={};i.forEach(function(u){var h=a[u],y=Pi(r,u),x,m;"reducer"in h?(x=h.reducer,m=h.prepare):x=h,c[u]=x,l[y]=x,d[u]=m?ge(y,m):ge(y)});function f(){var u=typeof t.extraReducers=="function"?pa(t.extraReducers):[t.extraReducers],h=u[0],y=h===void 0?{}:h,x=u[1],m=x===void 0?[]:x,v=u[2],N=v===void 0?void 0:v,w=ye(ye({},y),l);return Li(o,function(E){for(var P in w)E.addCase(P,w[P]);for(var R=0,se=m;R<se.length;R++){var ae=se[R];E.addMatcher(ae.matcher,ae.reducer)}N&&E.addDefaultCase(N)})}var p;return{name:r,reducer:function(u,h){return p||(p=f()),p(u,h)},actions:d,caseReducers:c,getInitialState:function(){return p||(p=f()),p.getInitialState()}}}var ki="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",_i=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=ki[Math.random()*64|0];return r},Ti=["name","message","stack","code"],wr=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),ca=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Wi=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,a=Ti;o<a.length;o++){var i=a[o];typeof t[i]=="string"&&(r[i]=t[i])}return r}return{message:String(t)}},Sl=function(){function t(r,o,a){var i=ge(r+"/fulfilled",function(u,h,y,x){return{payload:u,meta:Or(ye({},x||{}),{arg:y,requestId:h,requestStatus:"fulfilled"})}}),c=ge(r+"/pending",function(u,h,y){return{payload:void 0,meta:Or(ye({},y||{}),{arg:h,requestId:u,requestStatus:"pending"})}}),l=ge(r+"/rejected",function(u,h,y,x,m){return{payload:x,error:(a&&a.serializeError||Wi)(u||"Rejected"),meta:Or(ye({},m||{}),{arg:y,requestId:h,rejectedWithValue:!!x,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"})}}),d=!1,f=typeof AbortController<"u"?AbortController:function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u}();function p(u){return function(h,y,x){var m=a?.idGenerator?a.idGenerator(u):_i(),v=new f,N,w=!1;function E(R){N=R,v.abort()}var P=function(){return Si(this,null,function(){var R,se,ae,qe,Xr,Xe,Jr;return yi(this,function(Ie){switch(Ie.label){case 0:return Ie.trys.push([0,4,,5]),qe=(R=a?.condition)==null?void 0:R.call(a,u,{getState:y,extra:x}),Di(qe)?[4,qe]:[3,2];case 1:qe=Ie.sent(),Ie.label=2;case 2:if(qe===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return w=!0,Xr=new Promise(function(Y,Je){return v.signal.addEventListener("abort",function(){return Je({name:"AbortError",message:N||"Aborted"})})}),h(c(m,u,(se=a?.getPendingMeta)==null?void 0:se.call(a,{requestId:m,arg:u},{getState:y,extra:x}))),[4,Promise.race([Xr,Promise.resolve(o(u,{dispatch:h,getState:y,extra:x,requestId:m,signal:v.signal,abort:E,rejectWithValue:function(Y,Je){return new wr(Y,Je)},fulfillWithValue:function(Y,Je){return new ca(Y,Je)}})).then(function(Y){if(Y instanceof wr)throw Y;return Y instanceof ca?i(Y.payload,m,u,Y.meta):i(Y,m,u)})])];case 3:return ae=Ie.sent(),[3,5];case 4:return Xe=Ie.sent(),ae=Xe instanceof wr?l(null,m,u,Xe.payload,Xe.meta):l(Xe,m,u),[3,5];case 5:return Jr=a&&!a.dispatchConditionRejection&&l.match(ae)&&ae.meta.condition,Jr||h(ae),[2,ae]}})})}();return Object.assign(P,{abort:E,requestId:m,arg:u,unwrap:function(){return P.then(Bi)}})}}return Object.assign(p,{pending:c,rejected:l,fulfilled:i,typePrefix:r})}return t.withTypes=function(){return t},t}();function Bi(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Di(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ua="listener",ha="completed",ya="cancelled",Ol="task-"+ya,Cl="task-"+ha,wl=ua+"-"+ya,El=ua+"-"+ha;var Nr="listenerMiddleware";var Nl=ge(Nr+"/add"),Al=ge(Nr+"/removeAll"),Rl=ge(Nr+"/remove");var la,Il=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(la||(la=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},Mi=function(t){return function(r){setTimeout(r,t)}},Ll=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Mi(10);Fo();function Ui(t,r){return class extends t{constructor(){super(...arguments),this.eventBus=r??document.createElement("span")}addEventListener(o,a,i){this.eventBus.addEventListener(o,a,i)}dispatchEvent(o){return this.eventBus.dispatchEvent(o)}removeEventListener(o,a,i){this.eventBus.removeEventListener(o,a,i)}}}var _t=class extends Ui(Object){};window.ftReduxStores||(window.ftReduxStores={});var ga=class t extends _t{static get(r){var o;let a=typeof r=="string"?r:r.name,i=typeof r=="string"?void 0:r,c=window.ftReduxStores[a];if(tt(c))return c;if(i==null)return;let l=fa({...i,reducers:(o=i.reducers)!==null&&o!==void 0?o:{}}),d=da({reducer:(f,p)=>p.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...f,...p.overwrites}:l.reducer(f,p)});return window.ftReduxStores[i.name]=new t(l,d,i.eventBus)}constructor(r,o,a){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Ct;let i=c=>c!=null?JSON.parse(JSON.stringify(c)):c;this.actions=new Proxy(this.reduxSlice.actions,{get:(c,l,d)=>{let f=l,p=c[f];return p?(...u)=>{let h=p(...u.map(i));return this.reduxStore.dispatch(h),h}:u=>{this.setState({[f]:i(u)})}}}),this.eventBus=a??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 Dt=S(A());var Tt=class extends de{async listMySearches(){let r=C.getState().session;return r?.sessionAuthenticated?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var Wt=class extends de{async listMyBookmarks(){let r=C.getState().session;return r?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(r.profile.userId),5*60*1e3):[]}};var Hi="ft-user-assets",Bt=Dt.FtReduxStore.get({name:Hi,initialState:{savedSearches:void 0,bookmarks:void 0}}),Ar=class{constructor(){this.currentSession=C.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Wt,this.savedSearchesService=new Tt,C.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=C.getState();(0,Dt.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(),Bt.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Bt.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();Bt.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;Bt.actions.bookmarks(o)}}},ps=new Ar;var Rr=class{addCommand(r,o=!1){C.commands.add(r,o)}consumeCommand(r){return C.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new Rr;var ma=S(A()),Ir=class{highlightHtml(r,o,a){(0,ma.highlightHtml)(r,o,a)}};window.FluidTopicsHighlightHtmlService=new Ir;var ba=S(A());var Lr=class{isDate(r){var o,a,i,c;return(c=(i=((a=(o=C.getState().metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]).find(d=>d.key===r))===null||i===void 0?void 0:i.date)!==null&&c!==void 0?c:!1}format(r,o){var a,i,c;return ba.DateFormatter.format(r,(a=o?.locale)!==null&&a!==void 0?a:C.getState().uiLocale,(i=o?.longFormat)!==null&&i!==void 0?i:!1,(c=o?.withTime)!==null&&c!==void 0?c:!1)}};window.FluidTopicsDateService=new Lr;var Gi=S(A());(0,xa.customElement)("ft-app-context")(k);var Sa=S(G()),$i=function(t,r,o,a){var i=arguments.length,c=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,r,o,a);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(c=(i<3?l(c):i>3?l(r,o,c):l(r,o))||c);return i>3&&c&&Object.defineProperty(r,o,c),c},Pr=Symbol("i18nAttributes"),kr=Symbol("i18nListAttributes"),Mt=Symbol("i18nProperties"),_r=Symbol("i18nManualContexts"),ct=Symbol("i18nUnsubs");function Ht(t){var r,o;class a extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(c){return c??this.useCustomMessageContexts?vt:Pe}i18n(c,l,...d){var f;if(typeof c=="string")return this.getI18nService().resolveMessage(c,l,...d);let p=(f=c.args)!==null&&f!==void 0?f:c.argsProvider?c.argsProvider(this):[];return this.getI18nService(c.custom).resolveMessage(c.context,c.key,...p)}onI18nUpdate(c){var l,d,f;(l=this[Pr])===null||l===void 0||l.forEach((p,u)=>{let h=this.getI18nAttributeValue(u);h&&(this[u]=this.getI18nAttributeMessage(h,p,c))}),(d=this[kr])===null||d===void 0||d.forEach((p,u)=>{let h=this.getI18nListAttributeValues(u);this[u]=h?.map(y=>this.getI18nAttributeMessage(y,p,c))}),(f=this[Mt])===null||f===void 0||f.forEach((p,u)=>{p.context.toLowerCase()===c.toLowerCase()&&(this[u]=this.i18n(p))}),setTimeout(()=>this.requestUpdate(),0)}getI18nAttributeMessage(c,l,d){var f;let p=!d||((f=c.context)===null||f===void 0?void 0:f.toLowerCase())===d.toLowerCase(),u=c.context&&c.key&&p?this.i18n({context:c.context,key:c.key,...l}):c.message;return{...c,message:u}}update(c){var l,d,f;super.update(c),(l=this[Pr])===null||l===void 0||l.forEach((p,u)=>{let h=this.getI18nAttributeValue(u);h?.context&&h.key&&(c.has(u)||p.argsProvider!=null)&&(this.addI18nContextIfNeeded(h,c,u),this[u]=this.getI18nAttributeMessage(h,p))}),(d=this[kr])===null||d===void 0||d.forEach((p,u)=>{let h=this.getI18nListAttributeValues(u);(c.has(u)||p.argsProvider!=null)&&(this[u]=h?.map(y=>(this.addI18nContextIfNeeded(y,c,u),this.getI18nAttributeMessage(y,p))))}),(f=this[Mt])===null||f===void 0||f.forEach((p,u)=>{p.argsProvider!=null&&(this[u]=this.i18n(p))})}getI18nAttributeValue(c){return this[c]}getI18nListAttributeValues(c){return this[c]}addI18nContextIfNeeded(c,l,d){c.context&&c.key&&l.has(d)&&this.addI18nContext(c.context)}addI18nMessagesAndSubscribe(c,l,d){c=c.toLowerCase(),this[ct].has(c)||this[ct].set(c,this.getI18nService(d).subscribe(c,()=>this.onI18nUpdate(c))),this.getI18nService(d).prepareContext(c,l??{}),this.onI18nUpdate(c)}connectedCallback(){var c,l,d,f,p,u;super.connectedCallback(),new Set([...(l=(c=this[Mt])===null||c===void 0?void 0:c.values())!==null&&l!==void 0?l:[],...[...(f=(d=this[Pr])===null||d===void 0?void 0:d.keys())!==null&&f!==void 0?f:[]].map(h=>this.getI18nAttributeValue(h)),...[...(u=(p=this[kr])===null||p===void 0?void 0:p.keys())!==null&&u!==void 0?u:[]].flatMap(h=>this.getI18nListAttributeValues(h))].map(h=>h?.context)).forEach(h=>h&&this.addI18nMessages(h)),this[_r].forEach((h,y)=>{this.addI18nMessagesAndSubscribe(y,h.defaultMessages,h.isCustomContext)})}addI18nMessages(c,l,d){this[_r].set(c,{defaultMessages:l,isCustomContext:d}),this.addI18nMessagesAndSubscribe(c,l,d)}addI18nContext(c,l,d){typeof c=="string"?this.addI18nMessages(c,l,d):this.addI18nMessages(c.name,l,c.custom)}disconnectedCallback(){super.disconnectedCallback(),this[ct].forEach(c=>c()),this[ct].clear()}}return r=_r,o=ct,$i([(0,Sa.property)({type:Boolean})],a.prototype,"useCustomMessageContexts",void 0),a}var va=class extends Ht(zt.FtLitElement){},Ut=class extends Ht(zt.FtLitElementRedux){};var lt=function(t,r,o,a){var i=arguments.length,c=i<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,o):a,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(t,r,o,a);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(c=(i<3?l(c):i>3?l(r,o,c):l(r,o))||c);return i>3&&c&&Object.defineProperty(r,o,c),c},Q=class extends Ut{constructor(){super(),this.editorMode=!1,this.addStore(C)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Gt.nothing:Gt.html`
|
|
233
233
|
<span class="ft-i18n">
|