@fluid-topics/ft-search-language-filter 1.3.30 → 1.3.32

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.
@@ -714,7 +714,7 @@ Also for action icons.`,i.colorGray200),contentGlobalSubtle:e.extend("--ft-conte
714
714
  `}willUpdate(r){super.willUpdate(r),r.has("options")&&(this.selectedOption=this.options.filter(o=>o.selected)[0]),r.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(r){var o,n;if(super.contentAvailableCallback(r),r.has("focusOptions")&&this.focusOptions&&((n=(o=this.selectedOptionElement)!==null&&o!==void 0?o:this.firstOption)===null||n===void 0||n.focus(),this.focusOptions=!1),r.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px";let a=["bottom","top"];(0,Fe.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",a,"fixed",L.optionsHeight,0).then(({x:s,y:l})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${l}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(r){var o;r.stopPropagation();let n=(o=this.optionsSlot)===null||o===void 0?void 0:o.assignedElements().map(a=>a);n&&n.length>0&&(this.options=n)}onMainPanelKeyDown(r){switch(r.key){case" ":r.preventDefault(),r.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":r.preventDefault(),r.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(r){var o,n,a,s,l;let d;switch(r.key){case"Escape":this.optionsDisplayed=!1,(o=this.mainPanel)===null||o===void 0||o.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),d=(a=(n=this.focusedOption)===null||n===void 0?void 0:n.previousElementSibling)!==null&&a!==void 0?a:this.lastOption;break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),d=(l=(s=this.focusedOption)===null||s===void 0?void 0:s.nextElementSibling)!==null&&l!==void 0?l:this.firstOption;break;default:if(r.key.length!=1)break;this.isKeyAlphanumeric(r.key)&&(d=this.handleAlphanumericPress(r.key));break}d?.focus()}isKeyAlphanumeric(r){let o=r.charCodeAt(0);return o>47&&o<58||o>64&&o<91||o>96&&o<123}handleAlphanumericPress(r){var o,n;let a=new Date;a.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=r.toLowerCase();let s=this.options.find(d=>{var u;return((u=d.label)===null||u===void 0?void 0:u.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});if(s===void 0){this.lastSearchInputDate=a;return}let l=(n=(o=this.optionsMenu)===null||o===void 0?void 0:o.querySelector(`[data-value="${s.value}"]`))!==null&&n!==void 0?n:void 0;return this.lastSearchInputDate=a,l}onOptionKeyDown(r,o){var n;(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),this.selectOption(o),this.optionsDisplayed=!1,(n=this.mainPanel)===null||n===void 0||n.focus())}getOptionId(r){if(!r)return;let o=this.options.findIndex(n=>(0,Fe.deepEqual)(n.value,r.value));if(o!==-1)return`option-${o}`}selectOption(r){var o,n;if(!(0,Fe.deepEqual)((o=this.selectedOption)===null||o===void 0?void 0:o.value,r.value)){this.selectedOption=r;for(let a of this.options)a.selected=a===r;this.dispatchEvent(new CustomEvent("change",{detail:(n=this.selectedOption)===null||n===void 0?void 0:n.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}};D.elementDefinitions={"ft-input-label":me,"ft-typography":Ie,"ft-ripple":j,"ft-icon":ce};D.searchTimeoutMilliseconds=2e3;D.styles=[nr,Ue,Ua];W([(0,B.property)({type:String})],D.prototype,"label",void 0);W([(0,B.property)({type:String})],D.prototype,"ariaLabel",void 0);W([(0,B.property)({type:String})],D.prototype,"helper",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"outlined",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"disabled",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"error",void 0);W([(0,B.property)({type:Boolean})],D.prototype,"fixedMenuPosition",void 0);W([(0,B.property)({type:Array})],D.prototype,"options",void 0);W([(0,B.state)()],D.prototype,"selectedOption",void 0);W([(0,B.state)()],D.prototype,"optionsDisplayed",void 0);W([(0,B.state)()],D.prototype,"focusOptions",void 0);W([(0,B.state)()],D.prototype,"currentSearch",void 0);W([(0,B.state)()],D.prototype,"lastSearchInputDate",void 0);W([(0,B.query)(".ft-select")],D.prototype,"container",void 0);W([(0,B.query)(".ft-select--options")],D.prototype,"optionsMenu",void 0);W([(0,B.query)(".ft-select--input-panel")],D.prototype,"mainPanel",void 0);W([(0,B.query)(".ft-select--option:first-child")],D.prototype,"firstOption",void 0);W([(0,B.query)(".ft-select--option:focus")],D.prototype,"focusedOption",void 0);W([(0,B.query)(".ft-select--option.ft-select--option-selected")],D.prototype,"selectedOptionElement",void 0);W([(0,B.query)(".ft-select--option:last-child")],D.prototype,"lastOption",void 0);W([(0,B.query)("slot:not([name])")],D.prototype,"optionsSlot",void 0);(0,uo.customElement)("ft-select")(D);(0,uo.customElement)("ft-select-option")(Ee);var Dr=b(_()),xs=b(oe());var Pr=b(_());var Ba=b(_());var js=b(Ha(),1);var za;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(za||(za={}));var Wa;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Wa||(Wa={}));var $a;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})($a||($a={}));var Ga;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Ga||(Ga={}));var ja;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ja||(ja={}));var Ka;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ka||(Ka={}));var Va;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Va||(Va={}));var Za;(function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"})(Za||(Za={}));var qa;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT"})(qa||(qa={}));var Ya;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Ya||(Ya={}));var Xa;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Xa||(Xa={}));var Qa;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Qa||(Qa={}));var Ja;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Ja||(Ja={}));var ei;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(ei||(ei={}));var ti;(function(t){t.ASC="ASC",t.DESC="DESC"})(ti||(ti={}));var ri;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(ri||(ri={}));var po;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(po||(po={}));var oi;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(oi||(oi={}));var ni;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ni||(ni={}));var ai;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"})(ai||(ai={}));var ii;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(ii||(ii={}));var si;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"})(si||(si={}));var fo;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(fo||(fo={}));var li;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(li||(li={}));var Y;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Y||(Y={}));var de;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(de||(de={}));var ci;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(ci||(ci={}));var di;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(di||(di={}));var ui;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(ui||(ui={}));var pi;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(pi||(pi={}));var Gs={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function fi(t,r){return t===r||(Gs[t]??[]).some(o=>fi(o,r))}function hi(t,r){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>fi(n,r))}var ms=b(_());var Ei=b(K()),re=b(oe()),Se=b(_());var yi=b(K());var gi=yi.css`
715
715
  `;var lr=b(_()),Ks="ft-app-info",nt=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:r})}};nt.eventName="authentication-change";var Vs={session:(t,r)=>{(0,lr.deepEqual)(t.session,r.payload)||(t.session=r.payload,setTimeout(()=>E.dispatchEvent(new nt(r.payload)),0))}},E=lr.FtReduxStore.get({name:Ks,reducers:Vs,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var ho=b(_());var at=class t{static get(r){let{baseUrl:o,apiIntegrationIdentifier:n}=E.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=t.get(r);if(n)o(n);else{let a=E.subscribe(()=>{n=t.get(r),n&&(a(),o(n))})}})}};var cr=class{constructor(r){this.overrideApi=r}get api(){var r;return(r=this.overrideApi)!==null&&r!==void 0?r:at.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):at.await()}};var le=class extends cr{constructor(r=!0,o){var n;super(o),this.sortObjectFields=(s,l)=>typeof l!="object"||l==null||Array.isArray(l)?l:Object.fromEntries(Object.entries(l).sort(([d],[u])=>d.localeCompare(u)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new ho.CacheRegistry,this.cache=r?a.commonCache:new ho.CacheRegistry}clearCache(){this.cache.clearAll()}hash(r){return String(Array.from(JSON.stringify(r,this.sortObjectFields)).reduce((o,n)=>0|31*o+n.charCodeAt(0),0))}};var dr=class extends le{async listMyBookmarks(){let r=E.getState().session;return r?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(r.profile.userId),5*60*1e3):[]}};var yo=class{addCommand(r,o=!1){E.commands.add(r,o)}consumeCommand(r){return E.commands.consume(r)}};window.FluidTopicsAppInfoStoreService=new yo;var he=b(_());var mi,Et=class extends CustomEvent{constructor(r){super("ft-i18n-context-loaded",{detail:r})}},Zs=Symbol("clearAfterUnitTest"),ur=class extends(0,he.withEventBus)(le){constructor(r){super(),this.messageContextProvider=r,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[mi]=()=>{this.defaultMessages={},this.cache=new he.CacheRegistry,this.listeners={}},this.currentUiLocale=E.getState().uiLocale,E.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:r}=E.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,he.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 s=r.toLowerCase(),l=this.resolveContext(s);return new he.ParametrizedLabelResolver((a=this.defaultMessages[s])!==null&&a!==void 0?a:{},l).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)),o&&await this.notify(r)}catch(a){!(a instanceof he.CanceledPromiseError)&&o&&console.error(a)}return 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(){let r=Object.keys(this.listeners);document.body.dispatchEvent(new Et({loadedContexts:r})),this.dispatchEvent(new Et({loadedContexts:r})),await Promise.all(r.map(o=>this.notify(o,!1)))}async notify(r,o=!0){o&&(document.body.dispatchEvent(new Et({loadedContexts:[r]})),this.dispatchEvent(new Et({loadedContexts:[r]}))),this.listeners[r]!=null&&await Promise.all([...this.listeners[r].values()].map(n=>(0,he.delay)(0).then(()=>n()).catch(()=>null)))}};mi=Zs;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends ur{constructor(){super(async(t,r)=>(await this.awaitApi).getFluidTopicsMessageContext(t,r))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends ur{constructor(){super(async(t,r)=>(await this.awaitApi).getCustomMessageContext(t,r))}});var At=window.FluidTopicsI18nService,pr=window.FluidTopicsCustomI18nService;var bi=b(_()),go=class{highlightHtml(r,o,n){(0,bi.highlightHtml)(r,o,n)}};window.FluidTopicsHighlightHtmlService=new go;var fr=class extends le{async listMySearches(){let{session:r}=E.getState();return hi(r,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(r.profile.userId),5*60*1e3):[]}};var xi=b(_());var mo=class{isDate(r){var o,n,a,s;return(s=(a=((n=(o=E.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&&s!==void 0?s:!1}format(r,o){var n,a,s;return xi.DateFormatter.format(r,(n=o?.locale)!==null&&n!==void 0?n:E.getState().uiLocale,(a=o?.longFormat)!==null&&a!==void 0?a:!1,(s=o?.withTime)!==null&&s!==void 0?s:!1)}};window.FluidTopicsDateService=new mo;var vi=b(_());var zt=class{static get(r,o){var n,a;let s=E.getState(),{lang:l,region:d}=(a=(n=s.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new vi.SearchPlaceConverter(s.baseUrl,r??20,s.searchInAllLanguagesAllowed,o??`${l}-${d}`)}};var bo=class{urlToSearchRequest(r){return zt.get().parse(r)}searchRequestToUrl(r){return zt.get().serialize(r)}};window.FluidTopicsUrlService=new bo;var ze=b(_());var it=class t extends CustomEvent{constructor(r){super(t.eventName,{detail:{currentItem:r}})}};it.eventName="change";var xo=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))}},Si=new xo;var hr=class t extends ze.WithEventBus{static build(){return new t(window.history,Si,()=>window.location,!1)}constructor(r,o,n,a){var s,l;super(),this.history=r,this.historyStorage=o,this.windowLocation=n,this.states=[],this.realPushState=r.pushState,this.realReplaceState=r.replaceState,this.initialIndex=(l=(s=r.state)===null||s===void 0?void 0:s.index)!==null&&l!==void 0?l: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,ze.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new it(this.currentItem())),0)}installProxies(){let r=o=>(n,a,[s,l,d])=>{let u=o(),p={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:typeof d=="string"?d:(d??this.windowLocation()).href};n.apply(a,[p,l,d]),this.setCurrentState(p,!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(it.eventName,r)}removeHistoryChangeListener(r){this.removeEventListener(it.eventName,r)}currentItem(){return(0,ze.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,ze.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,ze.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,s=r+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,n);)this.hasState(s)&&(a=s),s++;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,s=(n=this.states[r])===null||n===void 0?void 0:n.majorStateId;return s==null||s!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=hr.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)});var Oi=E;function Ci(t,r){var o;return Oi.getState().authenticationRequired&&!(!((o=Oi.getState().session)===null||o===void 0)&&o.sessionAuthenticated)?Promise.resolve(r):t()}var X=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},z=class extends Se.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>at.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new Se.CacheRegistry,this.cleanSessionDebouncer=new Se.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return Ei.html`
716
716
  <slot></slot>
717
- `}connectedCallback(){super.connectedCallback(),E.addEventListener(nt.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(nt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,l,d,u;super.update(r),r.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("apiIntegrationAppVersion")&&E.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),r.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&E.actions.noCustom(this.noCustom),r.has("editorMode")&&E.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&E.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>At.addContext(p)),r.has("openExternalDocumentInNewTab")&&E.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&E.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&E.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(E.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),E.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),E.actions.searchInAllLanguagesAllowed((l=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Ci(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=gi;X([(0,re.property)()],z.prototype,"baseUrl",void 0);X([(0,re.property)()],z.prototype,"apiIntegrationIdentifier",void 0);X([(0,re.property)()],z.prototype,"apiIntegrationAppVersion",void 0);X([(0,re.property)()],z.prototype,"uiLocale",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"availableUiLocales",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"metadataConfiguration",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"editorMode",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"noCustom",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);X([(0,re.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"withManualResources",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"navigatorOnline",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"forcedOffline",void 0);X([(0,re.property)({type:Object})],z.prototype,"apiProvider",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"authenticationRequired",void 0);X([(0,Se.jsonProperty)([])],z.prototype,"messageContexts",void 0);X([(0,Se.jsonProperty)(void 0)],z.prototype,"session",void 0);X([(0,re.state)()],z.prototype,"localesConfiguration",void 0);X([(0,re.state)()],z.prototype,"availableContentLocales",void 0);var Go=b(oe());function qs(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let o,n,a;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!yr(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!yr(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[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 s=l=>Object.keys(l).filter(d=>l[d]!=null);if(a=s(t),o=a.length,o!==s(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 l=a[n];if(!yr(t[l],r[l]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function yr(t,r){try{return qs(t,r)}catch{return!1}}function Wt(t,r){return!yr(t,r)}function gr(t,r){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let a=r(n);return a[t]=!0,a}}var Ai=b(oe(),1);var vo=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Wt,attribute:!1,...r};(0,Ai.property)(s)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var mr=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 wt=b(oe(),1);var wi=b(oe(),1);function Ri(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,wi.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:Wt,...r??{}})}var br=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,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ii=b(K(),1);var xr=globalThis,Ys=xr.ShadowRoot&&(xr.ShadyCSS===void 0||xr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lg=Symbol();var Ni=(t,r)=>{if(Ys)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=xr.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var vr=class extends Ii.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,s])=>r.registry.define(a,s)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Ni(n,r.elementStyles),n}};function Ti(t,r,...o){var n;let a=t.querySelector(r);for(let s of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var $t=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},ki,_i=Symbol("constructorPrototype"),Li=Symbol("constructorName"),Di=Symbol("exportpartsDebouncer"),Pi=Symbol("dynamicDependenciesLoaded"),_e=class extends vr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ki]=new br(5),this[Li]=this.constructor.name,this[_i]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Li]&&Object.setPrototypeOf(this,this[_i])}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[Pi]||(r[Pi]=!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 s=[...a??[],n];o=Ti(this.shadowRoot,...s)}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(s=>s.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}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[Di].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(r){var o,n,a,s,l,d;let u=g=>g!=null&&g.trim().length>0,p=r.filter(u).map(g=>g.trim());if(p.length===0){this.removeAttribute("exportparts");return}let h=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 O=(s=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(C=>C.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...O,...x).filter(u).map(C=>C.trim()).forEach(C=>h.add(C))}if(h.size===0){this.removeAttribute("exportparts");return}let y=[...h.values()].flatMap(g=>p.map(O=>`${g}:${O}--${g}`));this.setAttribute("exportparts",[...this.part,...y].join(", "))}};ki=Di;$t([(0,wt.property)()],_e.prototype,"exportpartsPrefix",void 0);$t([Ri([])],_e.prototype,"exportpartsPrefixes",void 0);$t([(0,wt.property)()],_e.prototype,"customStylesheet",void 0);$t([(0,wt.property)()],_e.prototype,"elementToFocus",void 0);$t([(0,wt.state)()],_e.prototype,"useAdoptedStyleSheets",void 0);function Sr(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Gt=Symbol("internalReduxEventsUnsubscribers"),We=Symbol("internalStoresUnsubscribers"),st=Symbol("internalStores"),Xs=gr(Symbol("withRedux"),function(t){var r,o,n;class a extends t{constructor(){super(...arguments),this[r]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(d=>l.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[st].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[st].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[st].get(l)}addStore(l,d){var u;d=(u=d??l.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[st].set(d,l),this.subscribeToStore(d,l),this.updateFromStores()}removeStore(l){let d=typeof l=="string"?l:l.name;this.unsubscribeFromStore(d),this[st].delete(d)}setupStores(){this.unsubscribeFromStores(),this[st].forEach((l,d)=>this.subscribeToStore(d,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(l.store);p&&(l.store?this[We].has(l.store):this[We].size>0)&&(this[d]=l.selector(p.getState(),this))}})}subscribeToStore(l,d){var u;this[We].set(l,d.subscribe(()=>this.updateFromStores())),this[Gt].set(l,[]),Sr(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=g=>this[h](g);d.addEventListener(p.eventName,y),this[Gt].get(l).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[We].forEach((l,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(l){var d;this[We].has(l)&&this[We].get(l)(),this[We].delete(l),(d=this[Gt].get(l))===null||d===void 0||d.forEach(u=>u()),this[Gt].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=We,o=st,n=Gt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ui=class extends Xs(_e){};function ye(t){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,s;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 Le(t){return!!t&&!!t[$]}function Oe(t){var r;return!!t&&(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)===al}(t)||Array.isArray(t)||!!t[$i]||!!(!((r=t.constructor)===null||r===void 0)&&r[$i])||Io(t)||To(t))}function lt(t,r,o){o===void 0&&(o=!1),It(t)===0?(o?Object.keys:Nt)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function It(t){var r=t[$];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:Io(t)?2:To(t)?3:0}function Rt(t,r){return It(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Qs(t,r){return It(t)===2?t.get(r):t[r]}function Gi(t,r,o){var n=It(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function ji(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function Io(t){return ol&&t instanceof Map}function To(t){return nl&&t instanceof Set}function $e(t){return t.o||t.t}function _o(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Zi(t);delete r[$];for(var o=Nt(r),n=0;n<o.length;n++){var a=o[n],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),r)}function Lo(t,r){return r===void 0&&(r=!1),Po(t)||Le(t)||!Oe(t)||(It(t)>1&&(t.set=t.add=t.clear=t.delete=Js),Object.freeze(t),r&&lt(t,function(o,n){return Lo(n,!0)},!0)),t}function Js(){ye(2)}function Po(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Ae(t){var r=No[t];return r||ye(18,t),r}function el(t,r){No[t]||(No[t]=r)}function Ao(){return Kt}function So(t,r){r&&(Ae("Patches"),t.u=[],t.s=[],t.v=r)}function Or(t){wo(t),t.p.forEach(tl),t.p=null}function wo(t){t===Kt&&(Kt=t.l)}function Mi(t){return Kt={p:[],l:Kt,h:t,m:!0,_:0}}function tl(t){var r=t[$];r.i===0||r.i===1?r.j():r.g=!0}function Oo(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||Ae("ES5").S(r,t,n),n?(o[$].P&&(Or(r),ye(4)),Oe(t)&&(t=Cr(r,t),r.l||Er(r,t)),r.u&&Ae("Patches").M(o[$].t,t,r.u,r.s)):t=Cr(r,o,[]),Or(r),r.u&&r.v(r.u,r.s),t!==Vi?t:void 0}function Cr(t,r,o){if(Po(r))return r;var n=r[$];if(!n)return lt(r,function(d,u){return Bi(t,n,r,d,u,o)},!0),r;if(n.A!==t)return r;if(!n.P)return Er(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=_o(n.k):n.o,s=a,l=!1;n.i===3&&(s=new Set(a),a.clear(),l=!0),lt(s,function(d,u){return Bi(t,n,a,d,u,o,l)}),Er(t,a,!1),o&&t.u&&Ae("Patches").N(n,o,t.u,t.s)}return n.o}function Bi(t,r,o,n,a,s,l){if(Le(a)){var d=Cr(t,a,s&&r&&r.i!==3&&!Rt(r.R,n)?s.concat(n):void 0);if(Gi(o,n,d),!Le(d))return;t.m=!1}else l&&o.add(a);if(Oe(a)&&!Po(a)){if(!t.h.D&&t._<1)return;Cr(t,a),r&&r.A.l||Er(t,a)}}function Er(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Lo(r,o)}function Co(t,r){var o=t[$];return(o?$e(o):t)[r]}function Fi(t,r){if(r in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function Ge(t){t.P||(t.P=!0,t.l&&Ge(t.l))}function Eo(t){t.o||(t.o=_o(t.t))}function Ro(t,r,o){var n=Io(r)?Ae("MapSet").F(r,o):To(r)?Ae("MapSet").T(r,o):t.O?function(a,s){var l=Array.isArray(a),d={i:l?1:0,A:s?s.A:Ao(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Vt;l&&(u=[d],p=jt);var h=Proxy.revocable(u,p),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(r,o):Ae("ES5").J(r,o);return(o?o.A:Ao()).p.push(n),n}function rl(t){return Le(t)||ye(22,t),function r(o){if(!Oe(o))return o;var n,a=o[$],s=It(o);if(a){if(!a.P&&(a.i<4||!Ae("ES5").K(a)))return a.t;a.I=!0,n=Hi(o,s),a.I=!1}else n=Hi(o,s);return lt(n,function(l,d){a&&Qs(a.t,l)===d||Gi(n,l,r(d))}),s===3?new Set(n):n}(t)}function Hi(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return _o(t)}function Ki(){function t(l,d){var u=s[l];return u?u.enumerable=d:s[l]=u={configurable:!0,enumerable:d,get:function(){var p=this[$];return Vt.get(p,l)},set:function(p){var h=this[$];Vt.set(h,l,p)}},u}function r(l){for(var d=l.length-1;d>=0;d--){var u=l[d][$];if(!u.P)switch(u.i){case 5:n(u)&&Ge(u);break;case 4:o(u)&&Ge(u)}}}function o(l){for(var d=l.t,u=l.k,p=Nt(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==$){var g=d[y];if(g===void 0&&!Rt(d,y))return!0;var O=u[y],x=O&&O[$];if(x?x.t!==g:!ji(O,g))return!0}}var C=!!d[$];return p.length!==Nt(d).length+(C?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(l){l.g&&ye(3,JSON.stringify($e(l)))}var s={};el("ES5",{J:function(l,d){var u=Array.isArray(l),p=function(y,g){if(y){for(var O=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(O,""+x,t(x,!0));return O}var C=Zi(g);delete C[$];for(var k=Nt(C),I=0;I<k.length;I++){var T=k[I];C[T]=t(T,y||!!C[T].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(u,l),h={i:u?5:4,A:d?d.A:Ao(),P:!1,I:!1,R:{},l:d,t:l,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,$,{value:h,writable:!0}),p},S:function(l,d,u){u?Le(d)&&d[$].A===l&&r(l.p):(l.u&&function p(h){if(h&&typeof h=="object"){var y=h[$];if(y){var g=y.t,O=y.k,x=y.R,C=y.i;if(C===4)lt(O,function(U){U!==$&&(g[U]!==void 0||Rt(g,U)?x[U]||p(O[U]):(x[U]=!0,Ge(y)))}),lt(g,function(U){O[U]!==void 0||Rt(O,U)||(x[U]=!1,Ge(y))});else if(C===5){if(n(y)&&(Ge(y),x.length=!0),O.length<g.length)for(var k=O.length;k<g.length;k++)x[k]=!1;else for(var I=g.length;I<O.length;I++)x[I]=!0;for(var T=Math.min(O.length,g.length),F=0;F<T;F++)O.hasOwnProperty(F)||(x[F]=!0),x[F]===void 0&&p(O[F])}}}}(l.p[0]),r(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var zi,Kt,ko=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ol=typeof Map<"u",nl=typeof Set<"u",Wi=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Vi=ko?Symbol.for("immer-nothing"):((zi={})["immer-nothing"]=!0,zi),$i=ko?Symbol.for("immer-draftable"):"__$immer_draftable",$=ko?Symbol.for("immer-state"):"__$immer_state";var al=""+Object.prototype.constructor,Nt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Zi=Object.getOwnPropertyDescriptors||function(t){var r={};return Nt(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},No={},Vt={get:function(t,r){if(r===$)return t;var o=$e(t);if(!Rt(o,r))return function(a,s,l){var d,u=Fi(s,l);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!Oe(n)?n:n===Co(t.t,r)?(Eo(t),t.o[r]=Ro(t.A.h,n,t)):n},has:function(t,r){return r in $e(t)},ownKeys:function(t){return Reflect.ownKeys($e(t))},set:function(t,r,o){var n=Fi($e(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=Co($e(t),r),s=a?.[$];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(ji(o,a)&&(o!==void 0||Rt(t.t,r)))return!0;Eo(t),Ge(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 Co(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,Eo(t),Ge(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=$e(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){ye(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ye(12)}},jt={};lt(Vt,function(t,r){jt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),jt.deleteProperty=function(t,r){return jt.set.call(this,t,r,void 0)},jt.set=function(t,r,o){return Vt.set.call(this,t[0],r,o,t[0])};var il=function(){function t(o){var n=this;this.O=Wi,this.D=!0,this.produce=function(a,s,l){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(C){var k=this;C===void 0&&(C=d);for(var I=arguments.length,T=Array(I>1?I-1:0),F=1;F<I;F++)T[F-1]=arguments[F];return u.produce(C,function(U){var J;return(J=s).call.apply(J,[k,U].concat(T))})}}var p;if(typeof s!="function"&&ye(6),l!==void 0&&typeof l!="function"&&ye(7),Oe(a)){var h=Mi(n),y=Ro(n,a,void 0),g=!0;try{p=s(y),g=!1}finally{g?Or(h):wo(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(C){return So(h,l),Oo(C,h)},function(C){throw Or(h),C}):(So(h,l),Oo(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===Vi&&(p=void 0),n.D&&Lo(p,!0),l){var O=[],x=[];Ae("Patches").M(a,p,O,x),l(O,x)}return p}ye(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(p,function(O){return a.apply(void 0,[O].concat(y))})};var l,d,u=n.produce(a,s,function(p,h){l=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,l,d]}):[u,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){Oe(o)||ye(8),Le(o)&&(o=rl(o));var n=Mi(this),a=Ro(this,o,void 0);return a[$].C=!0,wo(n),a},r.finishDraft=function(o,n){var a=o&&o[$],s=a.A;return So(s,n),Oo(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Wi&&ye(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}a>-1&&(n=n.slice(a+1));var l=Ae("Patches").$;return Le(o)?l(o,n):this.produce(o,function(d){return l(d,n)})},t}(),ue=new il,sl=ue.produce,Vg=ue.produceWithPatches.bind(ue),Zg=ue.setAutoFreeze.bind(ue),qg=ue.setUseProxies.bind(ue),Yg=ue.applyPatches.bind(ue),Xg=ue.createDraft.bind(ue),Qg=ue.finishDraft.bind(ue),Ar=sl;function ct(t){"@babel/helpers - typeof";return ct=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},ct(t)}function qi(t,r){if(ct(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Yi(t){var r=qi(t,"string");return ct(r)=="symbol"?r:r+""}function Xi(t,r,o){return(r=Yi(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function Qi(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function Do(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Qi(Object(o),!0).forEach(function(n){Xi(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Qi(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ae(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 Ji=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Uo=function(){return Math.random().toString(36).substring(7).split("").join(".")},wr={INIT:"@@redux/INIT"+Uo(),REPLACE:"@@redux/REPLACE"+Uo(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Uo()}};function ll(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 Mo(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ae(1));return o(Mo)(t,r)}if(typeof t!="function")throw new Error(ae(2));var a=t,s=r,l=[],d=l,u=!1;function p(){d===l&&(d=l.slice())}function h(){if(u)throw new Error(ae(3));return s}function y(C){if(typeof C!="function")throw new Error(ae(4));if(u)throw new Error(ae(5));var k=!0;return p(),d.push(C),function(){if(k){if(u)throw new Error(ae(6));k=!1,p();var T=d.indexOf(C);d.splice(T,1),l=null}}}function g(C){if(!ll(C))throw new Error(ae(7));if(typeof C.type>"u")throw new Error(ae(8));if(u)throw new Error(ae(9));try{u=!0,s=a(s,C)}finally{u=!1}for(var k=l=d,I=0;I<k.length;I++){var T=k[I];T()}return C}function O(C){if(typeof C!="function")throw new Error(ae(10));a=C,g({type:wr.REPLACE})}function x(){var C,k=y;return C={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(ae(11));function F(){T.next&&T.next(h())}F();var U=k(F);return{unsubscribe:U}}},C[Ji]=function(){return this},C}return g({type:wr.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:O},n[Ji]=x,n}function cl(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:wr.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof o(void 0,{type:wr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function es(t){for(var r=Object.keys(t),o={},n=0;n<r.length;n++){var a=r[n];typeof t[a]=="function"&&(o[a]=t[a])}var s=Object.keys(o),l,d;try{cl(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var g=!1,O={},x=0;x<s.length;x++){var C=s[x],k=o[C],I=p[C],T=k(I,h);if(typeof T>"u"){var F=h&&h.type;throw new Error(ae(14))}O[C]=T,g=g||T!==I}return g=g||s.length!==Object.keys(p).length,g?O:p}}function Tt(){for(var t=arguments.length,r=new Array(t),o=0;o<t;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 ts(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(ae(15))},l={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(u){return u(l)});return s=Tt.apply(void 0,d)(a.dispatch),Do(Do({},a),{},{dispatch:s})}}}function rs(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,s,t):l(d)}}};return r}var os=rs();os.withExtraArgument=rs;var Bo=os;var ls=function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},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 n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),dl=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,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(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=r.call(t,o)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},_t=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},ul=Object.defineProperty,pl=Object.defineProperties,fl=Object.getOwnPropertyDescriptors,ns=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable,as=function(t,r,o){return r in t?ul(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},je=function(t,r){for(var o in r||(r={}))hl.call(r,o)&&as(t,o,r[o]);if(ns)for(var n=0,a=ns(r);n<a.length;n++){var o=a[n];yl.call(r,o)&&as(t,o,r[o])}return t},Fo=function(t,r){return pl(t,fl(r))},gl=function(t,r,o){return new Promise(function(n,a){var s=function(u){try{d(o.next(u))}catch(p){a(p)}},l=function(u){try{d(o.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,l)};d((o=o.apply(t,r)).next())})};var ml=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tt:Tt.apply(null,arguments)},gm=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function bl(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 xl=function(t){ls(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.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 t.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,_t([void 0],o[0].concat(this)))):new(r.bind.apply(r,_t([void 0],o.concat(this))))},r}(Array),vl=function(t){ls(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.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 t.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,_t([void 0],o[0].concat(this)))):new(r.bind.apply(r,_t([void 0],o.concat(this))))},r}(Array);function Wo(t){return Oe(t)?Ar(t,function(){}):t}function Sl(t){return typeof t=="boolean"}function Ol(){return function(r){return Cl(r)}}function Cl(t){t===void 0&&(t={});var r=t.thunk,o=r===void 0?!0:r,n=t.immutableCheck,a=n===void 0?!0:n,s=t.serializableCheck,l=s===void 0?!0:s,d=new xl;if(o&&(Sl(o)?d.push(Bo):d.push(Bo.withExtraArgument(o.extraArgument))),0){if(a)var u;if(l)var p}return d}var Ho=!0;function cs(t){var r=Ol(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,l=s===void 0?r():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,g=y===void 0?void 0:y,O;if(typeof a=="function")O=a;else if(bl(a))O=es(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=l;if(typeof x=="function"&&(x=x(r),!Ho&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ho&&x.some(function(U){return typeof U!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=ts.apply(void 0,x),k=Tt;u&&(k=ml(je({trace:!Ho},typeof u=="object"&&u)));var I=new vl(C),T=I;Array.isArray(g)?T=_t([C],g):typeof g=="function"&&(T=g(I));var F=k.apply(void 0,T);return Mo(O,h,F)}function Ke(t,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var s=r.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return je(je({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function ds(t){var r={},o=[],n,a={addCase:function(s,l){var d=typeof s=="string"?s:s.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=l,a},addMatcher:function(s,l){return o.push({matcher:s,reducer:l}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function El(t){return typeof t=="function"}function Al(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?ds(r):[r,o,n],s=a[0],l=a[1],d=a[2],u;if(El(t))u=function(){return Wo(t())};else{var p=Wo(t);u=function(){return p}}function h(y,g){y===void 0&&(y=u());var O=_t([s[g.type]],l.filter(function(x){var C=x.matcher;return C(g)}).map(function(x){var C=x.reducer;return C}));return O.filter(function(x){return!!x}).length===0&&(O=[d]),O.reduce(function(x,C){if(C)if(Le(x)){var k=x,I=C(k,g);return I===void 0?x:I}else{if(Oe(x))return Ar(x,function(T){return C(T,g)});var I=C(x,g);if(I===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return x},y)}return h.getInitialState=u,h}function wl(t,r){return t+"/"+r}function us(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:Wo(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},l={},d={};a.forEach(function(h){var y=n[h],g=wl(r,h),O,x;"reducer"in y?(O=y.reducer,x=y.prepare):O=y,s[h]=O,l[g]=O,d[h]=x?Ke(g,x):Ke(g)});function u(){var h=typeof t.extraReducers=="function"?ds(t.extraReducers):[t.extraReducers],y=h[0],g=y===void 0?{}:y,O=h[1],x=O===void 0?[]:O,C=h[2],k=C===void 0?void 0:C,I=je(je({},g),l);return Al(o,function(T){for(var F in I)T.addCase(F,I[F]);for(var U=0,J=x;U<J.length;U++){var ge=J[U];T.addMatcher(ge.matcher,ge.reducer)}k&&T.addDefaultCase(k)})}var p;return{name:r,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Rl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Nl=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=Rl[Math.random()*64|0];return r},Il=["name","message","stack","code"],zo=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),is=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Tl=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=Il;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},vm=function(){function t(r,o,n){var a=Ke(r+"/fulfilled",function(h,y,g,O){return{payload:h,meta:Fo(je({},O||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=Ke(r+"/pending",function(h,y,g){return{payload:void 0,meta:Fo(je({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),l=Ke(r+"/rejected",function(h,y,g,O,x){return{payload:O,error:(n&&n.serializeError||Tl)(h||"Rejected"),meta:Fo(je({},x||{}),{arg:g,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,g,O){var x=n?.idGenerator?n.idGenerator(h):Nl(),C=new u,k,I=!1;function T(U){k=U,C.abort()}var F=function(){return gl(this,null,function(){var U,J,ge,Ve,ie,Ze,dt;return dl(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Ve=(U=n?.condition)==null?void 0:U.call(n,h,{getState:g,extra:O}),Ll(Ve)?[4,Ve]:[3,2];case 1:Ve=f.sent(),f.label=2;case 2:if(Ve===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,ie=new Promise(function(m,w){return C.signal.addEventListener("abort",function(){return w({name:"AbortError",message:k||"Aborted"})})}),y(s(x,h,(J=n?.getPendingMeta)==null?void 0:J.call(n,{requestId:x,arg:h},{getState:g,extra:O}))),[4,Promise.race([ie,Promise.resolve(o(h,{dispatch:y,getState:g,extra:O,requestId:x,signal:C.signal,abort:T,rejectWithValue:function(m,w){return new zo(m,w)},fulfillWithValue:function(m,w){return new is(m,w)}})).then(function(m){if(m instanceof zo)throw m;return m instanceof is?a(m.payload,x,h,m.meta):a(m,x,h)})])];case 3:return ge=f.sent(),[3,5];case 4:return Ze=f.sent(),ge=Ze instanceof zo?l(null,x,h,Ze.payload,Ze.meta):l(Ze,x,h),[3,5];case 5:return dt=n&&!n.dispatchConditionRejection&&l.match(ge)&&ge.meta.condition,dt||y(ge),[2,ge]}})})}();return Object.assign(F,{abort:T,requestId:x,arg:h,unwrap:function(){return F.then(_l)}})}}return Object.assign(p,{pending:s,rejected:l,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function _l(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Ll(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ps="listener",fs="completed",hs="cancelled",Sm="task-"+hs,Om="task-"+fs,Cm=ps+"-"+hs,Em=ps+"-"+fs;var $o="listenerMiddleware";var Am=Ke($o+"/add"),wm=Ke($o+"/removeAll"),Rm=Ke($o+"/remove");var ss,Nm=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ss||(ss=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},Pl=function(t){return function(r){setTimeout(r,t)}},Im=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pl(10);Ki();var kl=gr(Symbol("withEventBus"),function(t,r){return class extends t{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)}}}),Rr=class extends kl(Object){};window.ftReduxStores||(window.ftReduxStores={});var ys=class t extends Rr{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,s=window.ftReduxStores[n];if(Sr(s))return s;if(a==null)return;let l=us({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=cs({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:l.reducer(u,p)});return window.ftReduxStores[a.name]=new t(l,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new mr;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,d)=>{let u=l,p=s[u];return p?(...h)=>{let y=p(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:a(h)})}}}),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 Nr=class{static format(r,o,n,a){return window.moment?window.moment(r).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(r,o,n,a)}static getMomentDateFormat(r,o){return r?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(r,o,n,a){let s=typeof r=="string"?new Date(r):r,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return l;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${l} ${d}`}};var gs=b(_()),Ir=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Jm=(0,gs.applyMixinOnce)(Symbol("withDateFormat"),function(t){class r extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(E)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>Nr.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Ir([(0,Go.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),Ir([(0,Go.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),Ir([vo({store:E.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],r.prototype,"metadataDescriptors",void 0),Ir([vo({store:E.name})],r.prototype,"uiLocale",void 0),r});var Lr=b(_());var Tr=class extends le{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(r){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${r}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(r){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${r}`),this.CACHE_DURATION)}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var _r=class extends le{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var Dl="ft-user-assets",Ul={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(de).forEach(r=>{t.assetCounts.allAsset[r]=void 0})},setBookmarkCountByMap:(t,r)=>{let o=r.payload.mapId;t.assetCounts.bookmarkByMap[o]=r.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,r)=>{let{assetType:o,mapId:n,asset:a}=r.payload;switch(o){case de.BOOKMARKS:t.bookmarks?t.bookmarks.push(a):t.bookmarks=[a];break;case de.SEARCHES:t.savedSearches?t.savedSearches.push(a):t.savedSearches=[a];break}let s=t.assetCounts.allAsset[o];if(s!==void 0&&(t.assetCounts.allAsset[o]=s+1),o===de.BOOKMARKS&&n!==void 0){let l=t.assetCounts.bookmarkByMap[n];l!==void 0&&(t.assetCounts.bookmarkByMap[n]=l+1)}},removeAsset:(t,r)=>{var o,n;let{assetType:a,mapId:s,assetId:l}=r.payload;switch(a){case de.BOOKMARKS:t.bookmarks=(o=t.bookmarks)===null||o===void 0?void 0:o.filter(u=>u.id!==l);break;case de.SEARCHES:t.savedSearches=(n=t.savedSearches)===null||n===void 0?void 0:n.filter(u=>u.id!==l);break}let d=t.assetCounts.allAsset[a];if(d!==void 0&&d>0&&(t.assetCounts.allAsset[a]=d-1),a===de.BOOKMARKS&&s!==void 0){let u=t.assetCounts.bookmarkByMap[s];u!==void 0&&u>0&&(t.assetCounts.bookmarkByMap[s]=u-1)}}},pe=Lr.FtReduxStore.get({name:Dl,reducers:Ul,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(de).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),jo=class{constructor(r=new Tr,o=new _r){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dr,this.savedSearchesService=new fr,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,Lr.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),pe.actions.clearAssetCount(),pe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();pe.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();pe.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&pe.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&pe.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(pe.getState().assetCounts.bookmarkByMap).length!==0;r===de.BOOKMARKS&&o&&pe.actions.clearBookmarkCountByMap(),pe.getState().assetCounts.allAsset[r]!==void 0&&await this.loadAssetCount(r)}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;pe.actions.bookmarks(o)}}},Ml=new jo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ml);(0,ms.customElement)("ft-app-context")(z);var Ko=class t extends Event{constructor(){super(t.eventName)}};Ko.eventName="search-context-clear-all-filters";var Bl=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Zo=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},bs=Symbol("registerInterval"),Vo=Symbol("registerAttempts"),Fl=40,Hl=(0,Dr.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class r extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Vo]=0,this[bs]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Vo]>Fl?window.clearInterval(this[bs]):(this[Vo]++,this.dispatchEvent(new Zo))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Bl([(0,xs.state)()],r.prototype,"stateManager",void 0),r}),kr=class extends Hl(Dr.FtLitElementRedux){};var ws=b(_());var Fr=b(K()),Hr=b(oe()),zr=b(_());var vs=b(K());var Ss=vs.css`
717
+ `}connectedCallback(){super.connectedCallback(),E.addEventListener(nt.eventName,this.reloadConfiguration)}disconnectedCallback(){E.addEventListener(nt.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(r){var o,n,a,s,l,d,u;super.update(r),r.has("baseUrl")&&(E.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),r.has("apiIntegrationIdentifier")&&E.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),r.has("apiIntegrationAppVersion")&&E.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),r.has("uiLocale")&&E.actions.uiLocale(this.uiLocale),r.has("metadataConfiguration")&&E.actions.metadataConfiguration(this.metadataConfiguration),r.has("noCustom")&&E.actions.noCustom(this.noCustom),r.has("editorMode")&&E.actions.editorMode(this.editorMode),r.has("noCustomComponent")&&E.actions.noCustomComponent(this.noCustomComponent),r.has("session")&&E.actions.session(this.session),r.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(p=>At.addContext(p)),r.has("openExternalDocumentInNewTab")&&E.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),r.has("navigatorOnline")&&E.actions.navigatorOnline(this.navigatorOnline),r.has("forcedOffline")&&E.actions.forcedOffline(this.forcedOffline),r.has("localesConfiguration")&&(E.actions.defaultLocales((o=this.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales),E.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),E.actions.searchInAllLanguagesAllowed((l=(s=this.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed)!==null&&l!==void 0?l:!1)),r.has("authenticationRequired")&&E.actions.authenticationRequired(this.authenticationRequired),r.has("availableContentLocales")&&E.actions.availableContentLocales((u=(d=this.availableContentLocales)===null||d===void 0?void 0:d.contentLocales)!==null&&u!==void 0?u:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let 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())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>Ci(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};z.elementDefinitions={};z.styles=gi;X([(0,re.property)()],z.prototype,"baseUrl",void 0);X([(0,re.property)()],z.prototype,"apiIntegrationIdentifier",void 0);X([(0,re.property)()],z.prototype,"apiIntegrationAppVersion",void 0);X([(0,re.property)()],z.prototype,"uiLocale",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"availableUiLocales",void 0);X([(0,Se.jsonProperty)(null)],z.prototype,"metadataConfiguration",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"editorMode",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"noCustom",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"openExternalDocumentInNewTab",void 0);X([(0,re.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],z.prototype,"noCustomComponent",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"withManualResources",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"navigatorOnline",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"forcedOffline",void 0);X([(0,re.property)({type:Object})],z.prototype,"apiProvider",void 0);X([(0,re.property)({type:Boolean})],z.prototype,"authenticationRequired",void 0);X([(0,Se.jsonProperty)([])],z.prototype,"messageContexts",void 0);X([(0,Se.jsonProperty)(void 0)],z.prototype,"session",void 0);X([(0,re.state)()],z.prototype,"localesConfiguration",void 0);X([(0,re.state)()],z.prototype,"availableContentLocales",void 0);var Go=b(oe());function qs(t,r){if(t===r)return!0;if(t&&r&&typeof t=="object"&&typeof r=="object"){if(t.constructor!==r.constructor)return!1;let o,n,a;if(Array.isArray(t)){if(o=t.length,o!=r.length)return!1;for(n=o;n--!==0;)if(!yr(t[n],r[n]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[0]))return!1;for(n of t.entries())if(!yr(n[1],r.get(n[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(n of t.entries())if(!r.has(n[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 s=l=>Object.keys(l).filter(d=>l[d]!=null);if(a=s(t),o=a.length,o!==s(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 l=a[n];if(!yr(t[l],r[l]))return!1}return!0}return t!==t&&r!==r||t==null&&r==null}function yr(t,r){try{return qs(t,r)}catch{return!1}}function Wt(t,r){return!yr(t,r)}function gr(t,r){let o=n=>n[t]===!0;return n=>{if(o(n))return n;let a=r(n);return a[t]=!0,a}}var Ai=b(oe(),1);var vo=t=>{let r=t??{};return(o,n)=>{var a;let s={hasChanged:Wt,attribute:!1,...r};(0,Ai.property)(s)(o,n);let l=o.constructor;l.reduxProperties=new Map(l.reduxProperties),l.reduxProperties.set(n,{selector:(a=r.selector)!==null&&a!==void 0?a:d=>d[n],store:r.store})}};var mr=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 wt=b(oe(),1);var wi=b(oe(),1);function Ri(t,r){let o=()=>JSON.parse(JSON.stringify(t));return(0,wi.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:Wt,...r??{}})}var br=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,s=(o=this.resolvePromise)!==null&&o!==void 0?o:()=>null;this.clearPromise();for(let l of n)try{await l()}catch(d){a(d);return}s(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ii=b(K(),1);var xr=globalThis,Ys=xr.ShadowRoot&&(xr.ShadyCSS===void 0||xr.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lg=Symbol();var Ni=(t,r)=>{if(Ys)t.adoptedStyleSheets=r.map(o=>o instanceof CSSStyleSheet?o:o.styleSheet);else for(let o of r){let n=document.createElement("style"),a=xr.litNonce;a!==void 0&&n.setAttribute("nonce",a),n.textContent=o.cssText,t.appendChild(n)}};var vr=class extends Ii.LitElement{createRenderRoot(){let r=this.constructor;r.elementDefinitions&&!r.registry&&(r.registry=new CustomElementRegistry,Object.entries(r.elementDefinitions).forEach(([a,s])=>r.registry.define(a,s)));let o={...r.shadowRootOptions,customElements:r.registry},n=this.renderOptions.creationScope=this.attachShadow(o);return Ni(n,r.elementStyles),n}};function Ti(t,r,...o){var n;let a=t.querySelector(r);for(let s of o)a=(n=a?.shadowRoot)===null||n===void 0?void 0:n.querySelector(s);return a}var $t=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},ki,_i=Symbol("constructorPrototype"),Li=Symbol("constructorName"),Di=Symbol("exportpartsDebouncer"),Pi=Symbol("dynamicDependenciesLoaded"),_e=class extends vr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ki]=new br(5),this[Li]=this.constructor.name,this[_i]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Li]&&Object.setPrototypeOf(this,this[_i])}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[Pi]||(r[Pi]=!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 s=[...a??[],n];o=Ti(this.shadowRoot,...s)}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(s=>s.remove()),this.useAdoptedStyleSheets){if(r.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}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[Di].run(()=>{var a,s;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})}setExportpartsAttribute(r){var o,n,a,s,l,d;let u=g=>g!=null&&g.trim().length>0,p=r.filter(u).map(g=>g.trim());if(p.length===0){this.removeAttribute("exportparts");return}let h=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 O=(s=(a=g.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&s!==void 0?s:[],x=(d=(l=g.getAttribute("exportparts"))===null||l===void 0?void 0:l.split(",").map(C=>C.split(":")[1]))!==null&&d!==void 0?d:[];new Array(...O,...x).filter(u).map(C=>C.trim()).forEach(C=>h.add(C))}if(h.size===0){this.removeAttribute("exportparts");return}let y=[...h.values()].flatMap(g=>p.map(O=>`${g}:${O}--${g}`));this.setAttribute("exportparts",[...this.part,...y].join(", "))}};ki=Di;$t([(0,wt.property)()],_e.prototype,"exportpartsPrefix",void 0);$t([Ri([])],_e.prototype,"exportpartsPrefixes",void 0);$t([(0,wt.property)()],_e.prototype,"customStylesheet",void 0);$t([(0,wt.property)()],_e.prototype,"elementToFocus",void 0);$t([(0,wt.state)()],_e.prototype,"useAdoptedStyleSheets",void 0);function Sr(t){var r;return(r=t?.isFtReduxStore)!==null&&r!==void 0?r:!1}var Gt=Symbol("internalReduxEventsUnsubscribers"),We=Symbol("internalStoresUnsubscribers"),st=Symbol("internalStores"),Xs=gr(Symbol("withRedux"),function(t){var r,o,n;class a extends t{constructor(){super(...arguments),this[r]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(l){super.willUpdate(l),[...this.reduxConstructor.reduxReactiveProperties].some(d=>l.has(d))&&this.updateFromStores()}getUnnamedStore(){if(this[st].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[st].values()][0]}getStore(l){return l==null?this.getUnnamedStore():this[st].get(l)}addStore(l,d){var u;d=(u=d??l.name)!==null&&u!==void 0?u:"default-store",this.unsubscribeFromStore(d),this[st].set(d,l),this.subscribeToStore(d,l),this.updateFromStores()}removeStore(l){let d=typeof l=="string"?l:l.name;this.unsubscribeFromStore(d),this[st].delete(d)}setupStores(){this.unsubscribeFromStores(),this[st].forEach((l,d)=>this.subscribeToStore(d,l)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((l,d)=>{let u=this.constructor.getPropertyOptions(d);if(!u?.attribute||!this.hasAttribute(typeof u?.attribute=="string"?u.attribute:d)){let p=this.getStore(l.store);p&&(l.store?this[We].has(l.store):this[We].size>0)&&(this[d]=l.selector(p.getState(),this))}})}subscribeToStore(l,d){var u;this[We].set(l,d.subscribe(()=>this.updateFromStores())),this[Gt].set(l,[]),Sr(d)&&d.eventBus&&((u=this.reduxConstructor.reduxEventListeners)===null||u===void 0||u.forEach((p,h)=>{if(typeof this[h]=="function"&&(!p.store||d.name===p.store)){let y=g=>this[h](g);d.addEventListener(p.eventName,y),this[Gt].get(l).push(()=>d.removeEventListener(p.eventName,y))}})),this.onStoreAvailable(l)}unsubscribeFromStores(){this[We].forEach((l,d)=>this.unsubscribeFromStore(d))}unsubscribeFromStore(l){var d;this[We].has(l)&&this[We].get(l)(),this[We].delete(l),(d=this[Gt].get(l))===null||d===void 0||d.forEach(u=>u()),this[Gt].delete(l)}onStoreAvailable(l){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return r=We,o=st,n=Gt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ui=class extends Xs(_e){};function ye(t){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,s;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 Le(t){return!!t&&!!t[$]}function Oe(t){var r;return!!t&&(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)===al}(t)||Array.isArray(t)||!!t[$i]||!!(!((r=t.constructor)===null||r===void 0)&&r[$i])||Io(t)||To(t))}function lt(t,r,o){o===void 0&&(o=!1),It(t)===0?(o?Object.keys:Nt)(t).forEach(function(n){o&&typeof n=="symbol"||r(n,t[n],t)}):t.forEach(function(n,a){return r(a,n,t)})}function It(t){var r=t[$];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:Io(t)?2:To(t)?3:0}function Rt(t,r){return It(t)===2?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function Qs(t,r){return It(t)===2?t.get(r):t[r]}function Gi(t,r,o){var n=It(t);n===2?t.set(r,o):n===3?t.add(o):t[r]=o}function ji(t,r){return t===r?t!==0||1/t==1/r:t!=t&&r!=r}function Io(t){return ol&&t instanceof Map}function To(t){return nl&&t instanceof Set}function $e(t){return t.o||t.t}function _o(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Zi(t);delete r[$];for(var o=Nt(r),n=0;n<o.length;n++){var a=o[n],s=r[a];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(r[a]={configurable:!0,writable:!0,enumerable:s.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),r)}function Lo(t,r){return r===void 0&&(r=!1),Po(t)||Le(t)||!Oe(t)||(It(t)>1&&(t.set=t.add=t.clear=t.delete=Js),Object.freeze(t),r&&lt(t,function(o,n){return Lo(n,!0)},!0)),t}function Js(){ye(2)}function Po(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Ae(t){var r=No[t];return r||ye(18,t),r}function el(t,r){No[t]||(No[t]=r)}function Ao(){return Kt}function So(t,r){r&&(Ae("Patches"),t.u=[],t.s=[],t.v=r)}function Or(t){wo(t),t.p.forEach(tl),t.p=null}function wo(t){t===Kt&&(Kt=t.l)}function Mi(t){return Kt={p:[],l:Kt,h:t,m:!0,_:0}}function tl(t){var r=t[$];r.i===0||r.i===1?r.j():r.g=!0}function Oo(t,r){r._=r.p.length;var o=r.p[0],n=t!==void 0&&t!==o;return r.h.O||Ae("ES5").S(r,t,n),n?(o[$].P&&(Or(r),ye(4)),Oe(t)&&(t=Cr(r,t),r.l||Er(r,t)),r.u&&Ae("Patches").M(o[$].t,t,r.u,r.s)):t=Cr(r,o,[]),Or(r),r.u&&r.v(r.u,r.s),t!==Vi?t:void 0}function Cr(t,r,o){if(Po(r))return r;var n=r[$];if(!n)return lt(r,function(d,u){return Bi(t,n,r,d,u,o)},!0),r;if(n.A!==t)return r;if(!n.P)return Er(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=_o(n.k):n.o,s=a,l=!1;n.i===3&&(s=new Set(a),a.clear(),l=!0),lt(s,function(d,u){return Bi(t,n,a,d,u,o,l)}),Er(t,a,!1),o&&t.u&&Ae("Patches").N(n,o,t.u,t.s)}return n.o}function Bi(t,r,o,n,a,s,l){if(Le(a)){var d=Cr(t,a,s&&r&&r.i!==3&&!Rt(r.R,n)?s.concat(n):void 0);if(Gi(o,n,d),!Le(d))return;t.m=!1}else l&&o.add(a);if(Oe(a)&&!Po(a)){if(!t.h.D&&t._<1)return;Cr(t,a),r&&r.A.l||Er(t,a)}}function Er(t,r,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&Lo(r,o)}function Co(t,r){var o=t[$];return(o?$e(o):t)[r]}function Fi(t,r){if(r in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,r);if(n)return n;o=Object.getPrototypeOf(o)}}function Ge(t){t.P||(t.P=!0,t.l&&Ge(t.l))}function Eo(t){t.o||(t.o=_o(t.t))}function Ro(t,r,o){var n=Io(r)?Ae("MapSet").F(r,o):To(r)?Ae("MapSet").T(r,o):t.O?function(a,s){var l=Array.isArray(a),d={i:l?1:0,A:s?s.A:Ao(),P:!1,I:!1,R:{},l:s,t:a,k:null,o:null,j:null,C:!1},u=d,p=Vt;l&&(u=[d],p=jt);var h=Proxy.revocable(u,p),y=h.revoke,g=h.proxy;return d.k=g,d.j=y,g}(r,o):Ae("ES5").J(r,o);return(o?o.A:Ao()).p.push(n),n}function rl(t){return Le(t)||ye(22,t),function r(o){if(!Oe(o))return o;var n,a=o[$],s=It(o);if(a){if(!a.P&&(a.i<4||!Ae("ES5").K(a)))return a.t;a.I=!0,n=Hi(o,s),a.I=!1}else n=Hi(o,s);return lt(n,function(l,d){a&&Qs(a.t,l)===d||Gi(n,l,r(d))}),s===3?new Set(n):n}(t)}function Hi(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return _o(t)}function Ki(){function t(l,d){var u=s[l];return u?u.enumerable=d:s[l]=u={configurable:!0,enumerable:d,get:function(){var p=this[$];return Vt.get(p,l)},set:function(p){var h=this[$];Vt.set(h,l,p)}},u}function r(l){for(var d=l.length-1;d>=0;d--){var u=l[d][$];if(!u.P)switch(u.i){case 5:n(u)&&Ge(u);break;case 4:o(u)&&Ge(u)}}}function o(l){for(var d=l.t,u=l.k,p=Nt(u),h=p.length-1;h>=0;h--){var y=p[h];if(y!==$){var g=d[y];if(g===void 0&&!Rt(d,y))return!0;var O=u[y],x=O&&O[$];if(x?x.t!==g:!ji(O,g))return!0}}var C=!!d[$];return p.length!==Nt(d).length+(C?0:1)}function n(l){var d=l.k;if(d.length!==l.t.length)return!0;var u=Object.getOwnPropertyDescriptor(d,d.length-1);if(u&&!u.get)return!0;for(var p=0;p<d.length;p++)if(!d.hasOwnProperty(p))return!0;return!1}function a(l){l.g&&ye(3,JSON.stringify($e(l)))}var s={};el("ES5",{J:function(l,d){var u=Array.isArray(l),p=function(y,g){if(y){for(var O=Array(g.length),x=0;x<g.length;x++)Object.defineProperty(O,""+x,t(x,!0));return O}var C=Zi(g);delete C[$];for(var k=Nt(C),I=0;I<k.length;I++){var T=k[I];C[T]=t(T,y||!!C[T].enumerable)}return Object.create(Object.getPrototypeOf(g),C)}(u,l),h={i:u?5:4,A:d?d.A:Ao(),P:!1,I:!1,R:{},l:d,t:l,k:p,o:null,g:!1,C:!1};return Object.defineProperty(p,$,{value:h,writable:!0}),p},S:function(l,d,u){u?Le(d)&&d[$].A===l&&r(l.p):(l.u&&function p(h){if(h&&typeof h=="object"){var y=h[$];if(y){var g=y.t,O=y.k,x=y.R,C=y.i;if(C===4)lt(O,function(U){U!==$&&(g[U]!==void 0||Rt(g,U)?x[U]||p(O[U]):(x[U]=!0,Ge(y)))}),lt(g,function(U){O[U]!==void 0||Rt(O,U)||(x[U]=!1,Ge(y))});else if(C===5){if(n(y)&&(Ge(y),x.length=!0),O.length<g.length)for(var k=O.length;k<g.length;k++)x[k]=!1;else for(var I=g.length;I<O.length;I++)x[I]=!0;for(var T=Math.min(O.length,g.length),F=0;F<T;F++)O.hasOwnProperty(F)||(x[F]=!0),x[F]===void 0&&p(O[F])}}}}(l.p[0]),r(l.p))},K:function(l){return l.i===4?o(l):n(l)}})}var zi,Kt,ko=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ol=typeof Map<"u",nl=typeof Set<"u",Wi=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Vi=ko?Symbol.for("immer-nothing"):((zi={})["immer-nothing"]=!0,zi),$i=ko?Symbol.for("immer-draftable"):"__$immer_draftable",$=ko?Symbol.for("immer-state"):"__$immer_state";var al=""+Object.prototype.constructor,Nt=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Zi=Object.getOwnPropertyDescriptors||function(t){var r={};return Nt(t).forEach(function(o){r[o]=Object.getOwnPropertyDescriptor(t,o)}),r},No={},Vt={get:function(t,r){if(r===$)return t;var o=$e(t);if(!Rt(o,r))return function(a,s,l){var d,u=Fi(s,l);return u?"value"in u?u.value:(d=u.get)===null||d===void 0?void 0:d.call(a.k):void 0}(t,o,r);var n=o[r];return t.I||!Oe(n)?n:n===Co(t.t,r)?(Eo(t),t.o[r]=Ro(t.A.h,n,t)):n},has:function(t,r){return r in $e(t)},ownKeys:function(t){return Reflect.ownKeys($e(t))},set:function(t,r,o){var n=Fi($e(t),r);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=Co($e(t),r),s=a?.[$];if(s&&s.t===o)return t.o[r]=o,t.R[r]=!1,!0;if(ji(o,a)&&(o!==void 0||Rt(t.t,r)))return!0;Eo(t),Ge(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 Co(t.t,r)!==void 0||r in t.t?(t.R[r]=!1,Eo(t),Ge(t)):delete t.R[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var o=$e(t),n=Reflect.getOwnPropertyDescriptor(o,r);return n&&{writable:!0,configurable:t.i!==1||r!=="length",enumerable:n.enumerable,value:o[r]}},defineProperty:function(){ye(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ye(12)}},jt={};lt(Vt,function(t,r){jt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),jt.deleteProperty=function(t,r){return jt.set.call(this,t,r,void 0)},jt.set=function(t,r,o){return Vt.set.call(this,t[0],r,o,t[0])};var il=function(){function t(o){var n=this;this.O=Wi,this.D=!0,this.produce=function(a,s,l){if(typeof a=="function"&&typeof s!="function"){var d=s;s=a;var u=n;return function(C){var k=this;C===void 0&&(C=d);for(var I=arguments.length,T=Array(I>1?I-1:0),F=1;F<I;F++)T[F-1]=arguments[F];return u.produce(C,function(U){var J;return(J=s).call.apply(J,[k,U].concat(T))})}}var p;if(typeof s!="function"&&ye(6),l!==void 0&&typeof l!="function"&&ye(7),Oe(a)){var h=Mi(n),y=Ro(n,a,void 0),g=!0;try{p=s(y),g=!1}finally{g?Or(h):wo(h)}return typeof Promise<"u"&&p instanceof Promise?p.then(function(C){return So(h,l),Oo(C,h)},function(C){throw Or(h),C}):(So(h,l),Oo(p,h))}if(!a||typeof a!="object"){if((p=s(a))===void 0&&(p=a),p===Vi&&(p=void 0),n.D&&Lo(p,!0),l){var O=[],x=[];Ae("Patches").M(a,p,O,x),l(O,x)}return p}ye(21,a)},this.produceWithPatches=function(a,s){if(typeof a=="function")return function(p){for(var h=arguments.length,y=Array(h>1?h-1:0),g=1;g<h;g++)y[g-1]=arguments[g];return n.produceWithPatches(p,function(O){return a.apply(void 0,[O].concat(y))})};var l,d,u=n.produce(a,s,function(p,h){l=p,d=h});return typeof Promise<"u"&&u instanceof Promise?u.then(function(p){return[p,l,d]}):[u,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){Oe(o)||ye(8),Le(o)&&(o=rl(o));var n=Mi(this),a=Ro(this,o,void 0);return a[$].C=!0,wo(n),a},r.finishDraft=function(o,n){var a=o&&o[$],s=a.A;return So(s,n),Oo(void 0,s)},r.setAutoFreeze=function(o){this.D=o},r.setUseProxies=function(o){o&&!Wi&&ye(20),this.O=o},r.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var s=n[a];if(s.path.length===0&&s.op==="replace"){o=s.value;break}}a>-1&&(n=n.slice(a+1));var l=Ae("Patches").$;return Le(o)?l(o,n):this.produce(o,function(d){return l(d,n)})},t}(),ue=new il,sl=ue.produce,Vg=ue.produceWithPatches.bind(ue),Zg=ue.setAutoFreeze.bind(ue),qg=ue.setUseProxies.bind(ue),Yg=ue.applyPatches.bind(ue),Xg=ue.createDraft.bind(ue),Qg=ue.finishDraft.bind(ue),Ar=sl;function ct(t){"@babel/helpers - typeof";return ct=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},ct(t)}function qi(t,r){if(ct(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,r||"default");if(ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}function Yi(t){var r=qi(t,"string");return ct(r)=="symbol"?r:r+""}function Xi(t,r,o){return(r=Yi(r))in t?Object.defineProperty(t,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[r]=o,t}function Qi(t,r){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function Do(t){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?Qi(Object(o),!0).forEach(function(n){Xi(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Qi(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function ae(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 Ji=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Uo=function(){return Math.random().toString(36).substring(7).split("").join(".")},wr={INIT:"@@redux/INIT"+Uo(),REPLACE:"@@redux/REPLACE"+Uo(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Uo()}};function ll(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 Mo(t,r,o){var n;if(typeof r=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(ae(0));if(typeof r=="function"&&typeof o>"u"&&(o=r,r=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(ae(1));return o(Mo)(t,r)}if(typeof t!="function")throw new Error(ae(2));var a=t,s=r,l=[],d=l,u=!1;function p(){d===l&&(d=l.slice())}function h(){if(u)throw new Error(ae(3));return s}function y(C){if(typeof C!="function")throw new Error(ae(4));if(u)throw new Error(ae(5));var k=!0;return p(),d.push(C),function(){if(k){if(u)throw new Error(ae(6));k=!1,p();var T=d.indexOf(C);d.splice(T,1),l=null}}}function g(C){if(!ll(C))throw new Error(ae(7));if(typeof C.type>"u")throw new Error(ae(8));if(u)throw new Error(ae(9));try{u=!0,s=a(s,C)}finally{u=!1}for(var k=l=d,I=0;I<k.length;I++){var T=k[I];T()}return C}function O(C){if(typeof C!="function")throw new Error(ae(10));a=C,g({type:wr.REPLACE})}function x(){var C,k=y;return C={subscribe:function(T){if(typeof T!="object"||T===null)throw new Error(ae(11));function F(){T.next&&T.next(h())}F();var U=k(F);return{unsubscribe:U}}},C[Ji]=function(){return this},C}return g({type:wr.INIT}),n={dispatch:g,subscribe:y,getState:h,replaceReducer:O},n[Ji]=x,n}function cl(t){Object.keys(t).forEach(function(r){var o=t[r],n=o(void 0,{type:wr.INIT});if(typeof n>"u")throw new Error(ae(12));if(typeof o(void 0,{type:wr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ae(13))})}function es(t){for(var r=Object.keys(t),o={},n=0;n<r.length;n++){var a=r[n];typeof t[a]=="function"&&(o[a]=t[a])}var s=Object.keys(o),l,d;try{cl(o)}catch(u){d=u}return function(p,h){if(p===void 0&&(p={}),d)throw d;if(0)var y;for(var g=!1,O={},x=0;x<s.length;x++){var C=s[x],k=o[C],I=p[C],T=k(I,h);if(typeof T>"u"){var F=h&&h.type;throw new Error(ae(14))}O[C]=T,g=g||T!==I}return g=g||s.length!==Object.keys(p).length,g?O:p}}function Tt(){for(var t=arguments.length,r=new Array(t),o=0;o<t;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 ts(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),s=function(){throw new Error(ae(15))},l={getState:a.getState,dispatch:function(){return s.apply(void 0,arguments)}},d=r.map(function(u){return u(l)});return s=Tt.apply(void 0,d)(a.dispatch),Do(Do({},a),{},{dispatch:s})}}}function rs(t){var r=function(n){var a=n.dispatch,s=n.getState;return function(l){return function(d){return typeof d=="function"?d(a,s,t):l(d)}}};return r}var os=rs();os.withExtraArgument=rs;var Bo=os;var ls=function(){var t=function(r,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(n[s]=a[s])},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 n(){this.constructor=r}r.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),dl=function(t,r){var o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,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(h){return u([p,h])}}function u(p){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return o.label++,{value:p[1],done:!1};case 5:o.label++,a=p[1],p=[0];continue;case 7:p=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){o=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){o.label=p[1];break}if(p[0]===6&&o.label<s[1]){o.label=s[1],s=p;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(p);break}s[2]&&o.ops.pop(),o.trys.pop();continue}p=r.call(t,o)}catch(h){p=[6,h],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},_t=function(t,r){for(var o=0,n=r.length,a=t.length;o<n;o++,a++)t[a]=r[o];return t},ul=Object.defineProperty,pl=Object.defineProperties,fl=Object.getOwnPropertyDescriptors,ns=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable,as=function(t,r,o){return r in t?ul(t,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[r]=o},je=function(t,r){for(var o in r||(r={}))hl.call(r,o)&&as(t,o,r[o]);if(ns)for(var n=0,a=ns(r);n<a.length;n++){var o=a[n];yl.call(r,o)&&as(t,o,r[o])}return t},Fo=function(t,r){return pl(t,fl(r))},gl=function(t,r,o){return new Promise(function(n,a){var s=function(u){try{d(o.next(u))}catch(p){a(p)}},l=function(u){try{d(o.throw(u))}catch(p){a(p)}},d=function(u){return u.done?n(u.value):Promise.resolve(u.value).then(s,l)};d((o=o.apply(t,r)).next())})};var ml=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Tt:Tt.apply(null,arguments)},gm=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function bl(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 xl=function(t){ls(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.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 t.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,_t([void 0],o[0].concat(this)))):new(r.bind.apply(r,_t([void 0],o.concat(this))))},r}(Array),vl=function(t){ls(r,t);function r(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.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 t.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,_t([void 0],o[0].concat(this)))):new(r.bind.apply(r,_t([void 0],o.concat(this))))},r}(Array);function Wo(t){return Oe(t)?Ar(t,function(){}):t}function Sl(t){return typeof t=="boolean"}function Ol(){return function(r){return Cl(r)}}function Cl(t){t===void 0&&(t={});var r=t.thunk,o=r===void 0?!0:r,n=t.immutableCheck,a=n===void 0?!0:n,s=t.serializableCheck,l=s===void 0?!0:s,d=new xl;if(o&&(Sl(o)?d.push(Bo):d.push(Bo.withExtraArgument(o.extraArgument))),0){if(a)var u;if(l)var p}return d}var Ho=!0;function cs(t){var r=Ol(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,s=o.middleware,l=s===void 0?r():s,d=o.devTools,u=d===void 0?!0:d,p=o.preloadedState,h=p===void 0?void 0:p,y=o.enhancers,g=y===void 0?void 0:y,O;if(typeof a=="function")O=a;else if(bl(a))O=es(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=l;if(typeof x=="function"&&(x=x(r),!Ho&&!Array.isArray(x)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ho&&x.some(function(U){return typeof U!="function"}))throw new Error("each middleware provided to configureStore must be a function");var C=ts.apply(void 0,x),k=Tt;u&&(k=ml(je({trace:!Ho},typeof u=="object"&&u)));var I=new vl(C),T=I;Array.isArray(g)?T=_t([C],g):typeof g=="function"&&(T=g(I));var F=k.apply(void 0,T);return Mo(O,h,F)}function Ke(t,r){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r){var s=r.apply(void 0,n);if(!s)throw new Error("prepareAction did not return an object");return je(je({type:t,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function ds(t){var r={},o=[],n,a={addCase:function(s,l){var d=typeof s=="string"?s:s.type;if(d in r)throw new Error("addCase cannot be called with two reducers for the same action type");return r[d]=l,a},addMatcher:function(s,l){return o.push({matcher:s,reducer:l}),a},addDefaultCase:function(s){return n=s,a}};return t(a),[r,o,n]}function El(t){return typeof t=="function"}function Al(t,r,o,n){o===void 0&&(o=[]);var a=typeof r=="function"?ds(r):[r,o,n],s=a[0],l=a[1],d=a[2],u;if(El(t))u=function(){return Wo(t())};else{var p=Wo(t);u=function(){return p}}function h(y,g){y===void 0&&(y=u());var O=_t([s[g.type]],l.filter(function(x){var C=x.matcher;return C(g)}).map(function(x){var C=x.reducer;return C}));return O.filter(function(x){return!!x}).length===0&&(O=[d]),O.reduce(function(x,C){if(C)if(Le(x)){var k=x,I=C(k,g);return I===void 0?x:I}else{if(Oe(x))return Ar(x,function(T){return C(T,g)});var I=C(x,g);if(I===void 0){if(x===null)return x;throw Error("A case reducer on a non-draftable value must not return undefined")}return I}return x},y)}return h.getInitialState=u,h}function wl(t,r){return t+"/"+r}function us(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:Wo(t.initialState),n=t.reducers||{},a=Object.keys(n),s={},l={},d={};a.forEach(function(h){var y=n[h],g=wl(r,h),O,x;"reducer"in y?(O=y.reducer,x=y.prepare):O=y,s[h]=O,l[g]=O,d[h]=x?Ke(g,x):Ke(g)});function u(){var h=typeof t.extraReducers=="function"?ds(t.extraReducers):[t.extraReducers],y=h[0],g=y===void 0?{}:y,O=h[1],x=O===void 0?[]:O,C=h[2],k=C===void 0?void 0:C,I=je(je({},g),l);return Al(o,function(T){for(var F in I)T.addCase(F,I[F]);for(var U=0,J=x;U<J.length;U++){var ge=J[U];T.addMatcher(ge.matcher,ge.reducer)}k&&T.addDefaultCase(k)})}var p;return{name:r,reducer:function(h,y){return p||(p=u()),p(h,y)},actions:d,caseReducers:s,getInitialState:function(){return p||(p=u()),p.getInitialState()}}}var Rl="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Nl=function(t){t===void 0&&(t=21);for(var r="",o=t;o--;)r+=Rl[Math.random()*64|0];return r},Il=["name","message","stack","code"],zo=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),is=function(){function t(r,o){this.payload=r,this.meta=o}return t}(),Tl=function(t){if(typeof t=="object"&&t!==null){for(var r={},o=0,n=Il;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(r[a]=t[a])}return r}return{message:String(t)}},vm=function(){function t(r,o,n){var a=Ke(r+"/fulfilled",function(h,y,g,O){return{payload:h,meta:Fo(je({},O||{}),{arg:g,requestId:y,requestStatus:"fulfilled"})}}),s=Ke(r+"/pending",function(h,y,g){return{payload:void 0,meta:Fo(je({},g||{}),{arg:y,requestId:h,requestStatus:"pending"})}}),l=Ke(r+"/rejected",function(h,y,g,O,x){return{payload:O,error:(n&&n.serializeError||Tl)(h||"Rejected"),meta:Fo(je({},x||{}),{arg:g,requestId:y,rejectedWithValue:!!O,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),d=!1,u=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function p(h){return function(y,g,O){var x=n?.idGenerator?n.idGenerator(h):Nl(),C=new u,k,I=!1;function T(U){k=U,C.abort()}var F=function(){return gl(this,null,function(){var U,J,ge,Ve,ie,Ze,dt;return dl(this,function(f){switch(f.label){case 0:return f.trys.push([0,4,,5]),Ve=(U=n?.condition)==null?void 0:U.call(n,h,{getState:g,extra:O}),Ll(Ve)?[4,Ve]:[3,2];case 1:Ve=f.sent(),f.label=2;case 2:if(Ve===!1||C.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return I=!0,ie=new Promise(function(m,w){return C.signal.addEventListener("abort",function(){return w({name:"AbortError",message:k||"Aborted"})})}),y(s(x,h,(J=n?.getPendingMeta)==null?void 0:J.call(n,{requestId:x,arg:h},{getState:g,extra:O}))),[4,Promise.race([ie,Promise.resolve(o(h,{dispatch:y,getState:g,extra:O,requestId:x,signal:C.signal,abort:T,rejectWithValue:function(m,w){return new zo(m,w)},fulfillWithValue:function(m,w){return new is(m,w)}})).then(function(m){if(m instanceof zo)throw m;return m instanceof is?a(m.payload,x,h,m.meta):a(m,x,h)})])];case 3:return ge=f.sent(),[3,5];case 4:return Ze=f.sent(),ge=Ze instanceof zo?l(null,x,h,Ze.payload,Ze.meta):l(Ze,x,h),[3,5];case 5:return dt=n&&!n.dispatchConditionRejection&&l.match(ge)&&ge.meta.condition,dt||y(ge),[2,ge]}})})}();return Object.assign(F,{abort:T,requestId:x,arg:h,unwrap:function(){return F.then(_l)}})}}return Object.assign(p,{pending:s,rejected:l,fulfilled:a,typePrefix:r})}return t.withTypes=function(){return t},t}();function _l(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Ll(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ps="listener",fs="completed",hs="cancelled",Sm="task-"+hs,Om="task-"+fs,Cm=ps+"-"+hs,Em=ps+"-"+fs;var $o="listenerMiddleware";var Am=Ke($o+"/add"),wm=Ke($o+"/removeAll"),Rm=Ke($o+"/remove");var ss,Nm=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ss||(ss=Promise.resolve())).then(t).catch(function(r){return setTimeout(function(){throw r},0)})},Pl=function(t){return function(r){setTimeout(r,t)}},Im=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Pl(10);Ki();var kl=gr(Symbol("withEventBus"),function(t,r){return class extends t{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)}}}),Rr=class extends kl(Object){};window.ftReduxStores||(window.ftReduxStores={});var ys=class t extends Rr{static get(r){var o;let n=typeof r=="string"?r:r.name,a=typeof r=="string"?void 0:r,s=window.ftReduxStores[n];if(Sr(s))return s;if(a==null)return;let l=us({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),d=cs({reducer:(u,p)=>p.type==="CLEAR_FT_REDUX_STORE"?l.getInitialState():typeof p.type=="string"&&p.type.startsWith("DEFAULT_VALUE_SETTER__")?{...u,...p.overwrites}:l.reducer(u,p)});return window.ftReduxStores[a.name]=new t(l,d,a.eventBus)}constructor(r,o,n){super(),this.reduxSlice=r,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new mr;let a=s=>s!=null?JSON.parse(JSON.stringify(s)):s;this.actions=new Proxy(this.reduxSlice.actions,{get:(s,l,d)=>{let u=l,p=s[u];return p?(...h)=>{let y=p(...h.map(a));return this.reduxStore.dispatch(y),y}:h=>{this.setState({[u]:a(h)})}}}),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 Nr=class{static format(r,o,n,a){return window.moment?window.moment(r).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(r,o,n,a)}static getMomentDateFormat(r,o){return r?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(r,o,n,a){let s=typeof r=="string"?new Date(r):r,l=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(s);if(!a)return l;let d=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(s);return`${l} ${d}`}static getTimezoneAsString(){let r=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${r(Math.abs(o)/60)}:${r(Math.abs(o)%60)}`}};var gs=b(_()),Ir=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Jm=(0,gs.applyMixinOnce)(Symbol("withDateFormat"),function(t){class r extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(E)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var a,s;return((s=(a=this.metadataDescriptors.find(d=>d.key===n))===null||a===void 0?void 0:a.date)!==null&&s!==void 0?s:!1)?d=>Nr.format(d,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Ir([(0,Go.property)({type:Boolean})],r.prototype,"useLongDateFormat",void 0),Ir([(0,Go.property)({type:Boolean})],r.prototype,"useDateTimeFormat",void 0),Ir([vo({store:E.name,selector:o=>{var n,a;return(a=(n=o.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&a!==void 0?a:[]}})],r.prototype,"metadataDescriptors",void 0),Ir([vo({store:E.name})],r.prototype,"uiLocale",void 0),r});var Lr=b(_());var Tr=class extends le{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetCount(r){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${r}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(r){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${r}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${r}`),this.CACHE_DURATION)}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var _r=class extends le{constructor(){super(...arguments),this.CACHE_DURATION=3*60*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let r=E.getState().session;return!!r?.sessionAuthenticated}};var Dl="ft-user-assets",Ul={setAssetCount:(t,r)=>{let{userAssetType:o,count:n}=r.payload.assetCount;t.assetCounts.allAsset[o]=n},clearAssetCount:t=>{Object.values(de).forEach(r=>{t.assetCounts.allAsset[r]=void 0})},setBookmarkCountByMap:(t,r)=>{let o=r.payload.mapId;t.assetCounts.bookmarkByMap[o]=r.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,r)=>{let{assetType:o,mapId:n,asset:a}=r.payload;switch(o){case de.BOOKMARKS:t.bookmarks?t.bookmarks.push(a):t.bookmarks=[a];break;case de.SEARCHES:t.savedSearches?t.savedSearches.push(a):t.savedSearches=[a];break}let s=t.assetCounts.allAsset[o];if(s!==void 0&&(t.assetCounts.allAsset[o]=s+1),o===de.BOOKMARKS&&n!==void 0){let l=t.assetCounts.bookmarkByMap[n];l!==void 0&&(t.assetCounts.bookmarkByMap[n]=l+1)}},removeAsset:(t,r)=>{var o,n;let{assetType:a,mapId:s,assetId:l}=r.payload;switch(a){case de.BOOKMARKS:t.bookmarks=(o=t.bookmarks)===null||o===void 0?void 0:o.filter(u=>u.id!==l);break;case de.SEARCHES:t.savedSearches=(n=t.savedSearches)===null||n===void 0?void 0:n.filter(u=>u.id!==l);break}let d=t.assetCounts.allAsset[a];if(d!==void 0&&d>0&&(t.assetCounts.allAsset[a]=d-1),a===de.BOOKMARKS&&s!==void 0){let u=t.assetCounts.bookmarkByMap[s];u!==void 0&&u>0&&(t.assetCounts.bookmarkByMap[s]=u-1)}}},pe=Lr.FtReduxStore.get({name:Dl,reducers:Ul,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(de).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),jo=class{constructor(r=new Tr,o=new _r){this.assetCountsService=r,this.assetLabelsService=o,this.currentSession=E.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new dr,this.savedSearchesService=new fr,E.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var r;let{session:o}=E.getState();(0,Lr.deepEqual)((r=this.currentSession)===null||r===void 0?void 0:r.profile,o?.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),pe.actions.clearAssetCount(),pe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),pe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),pe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let r=await this.savedSearchesService.listMySearches();pe.actions.savedSearches(r)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let r=await this.assetLabelsService.getUserAssetLabels();pe.actions.assetLabels(r)}async loadAssetCount(r){let o=await this.assetCountsService.getUserAssetCount(r);o&&pe.actions.setAssetCount({assetCount:o})}async loadBookmarkByMapId(r){let o=await this.assetCountsService.getUserBookmarkCountByMap(r);o&&pe.actions.setBookmarkCountByMap({count:o.count,mapId:r})}async reloadAssetCount(r){this.assetCountsService.clearCache();let o=Object.keys(pe.getState().assetCounts.bookmarkByMap).length!==0;r===de.BOOKMARKS&&o&&pe.actions.clearBookmarkCountByMap(),pe.getState().assetCounts.allAsset[r]!==void 0&&await this.loadAssetCount(r)}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;pe.actions.bookmarks(o)}}},Ml=new jo;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Ml);(0,ms.customElement)("ft-app-context")(z);var Ko=class t extends Event{constructor(){super(t.eventName)}};Ko.eventName="search-context-clear-all-filters";var Bl=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Zo=class extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}},bs=Symbol("registerInterval"),Vo=Symbol("registerAttempts"),Fl=40,Hl=(0,Dr.applyMixinOnce)(Symbol("toFtSearchComponent"),function(t){class r extends t{setSearchStateManager(n){this.clearStateManager(),this.stateManager=n,this.addStore(n.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Vo]=0,this[bs]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null||this[Vo]>Fl?window.clearInterval(this[bs]):(this[Vo]++,this.dispatchEvent(new Zo))}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Bl([(0,xs.state)()],r.prototype,"stateManager",void 0),r}),kr=class extends Hl(Dr.FtLitElementRedux){};var ws=b(_());var Fr=b(K()),Hr=b(oe()),zr=b(_());var vs=b(K());var Ss=vs.css`
718
718
  `;var Lt=b(_());var Es=b(oe());var qo=class{fromLocalizableLabel(r){return r.type=="PLAIN_TEXT"?{message:r.text}:{key:r.key,custom:r.type=="LOCALIZED_CUSTOM",context:r.context,message:r.key}}fromAttribute(r){if(r!=null)try{return JSON.parse(r)}catch{if(this.isI18nKey(r)){let[n,a]=r.split(".");return{context:n,key:a,message:""}}return{message:r}}}toAttribute(r){if(r!=null)return JSON.stringify(r)}isI18nKey(r){return r.match(/^[\w-]+\.[\w-]+$/)}},Os=new qo;var zl=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Wl=Symbol("i18nAttributes"),$l=Symbol("i18nListAttributes"),As=Symbol("i18nProperties"),Ur=Symbol("i18nContexts"),Zt=Symbol("i18nUnsubs"),Br=(0,Lt.applyMixinOnce)(Symbol("withI18n"),function(t){var r,o;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[r]=new Map,this[o]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?pr:At}i18n(s){let{context:l,key:d,message:u}=s,{custom:p,args:h,argsProvider:y}=s;if(l&&d){this.hasI18nContext(l)||this.addI18nContext(l,void 0,p);let g=h??(y?y(this):[]);return this.getI18nService(p).resolveMessage(l,d,...g)}return u}async awaitI18n(s){let{context:l,custom:d}=s;return l&&await this.getI18nService(d).prepareContext(l),this.i18n(s)}customI18n(s,l){if(Os.isI18nKey(s)){let[d,u]=s.split(".");return this.i18n({custom:!0,context:d,key:u,...l})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((l,d,u)=>s.has(d)||typeof l.argsProvider=="function"),this.updateI18nProperties(l=>typeof l.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((l,d,u)=>{var p;return((p=u?.context)===null||p===void 0?void 0:p.toLowerCase())===s}),this.updateI18nProperties(l=>l.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var l,d;let u=this,p=(h,y,g)=>g?.context&&g.key&&s(h,y,g)?{...g,message:this.i18n({context:g.context,key:g.key,custom:g.custom,...h})}:g;(l=this[Wl])===null||l===void 0||l.forEach((h,y)=>u[y]=p(h,y,u[y])),(d=this[$l])===null||d===void 0||d.forEach((h,y)=>{var g;return u[y]=(g=u[y])===null||g===void 0?void 0:g.map(O=>p(h,y,O))})}updateI18nProperties(s){var l;(l=this[As])===null||l===void 0||l.forEach((d,u)=>{s(d,u)&&(this[u]=this.i18n(d))})}addI18nMessages(s,l,d){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,l,d)}addI18nContext(s,l,d){let u=(typeof s=="string"?s:s.name).toLowerCase();d=typeof s=="string"?d:s.custom,this[Ur].set(u,{isCustomContext:d}),this[Zt].has(u)||this[Zt].set(u,this.getI18nService(d).subscribe(u,()=>this.onI18nUpdate(u))),this.getI18nService(d).prepareContext(u,l)}hasI18nContext(s){return this[Ur].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ur].forEach((s,l)=>this.addI18nContext(l,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Zt].forEach(s=>s()),this[Zt].clear()}}return r=Ur,o=Zt,zl([(0,Es.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Cs=class extends Br(Lt.FtLitElement){},Mr=class extends Br(Lt.FtLitElementRedux){};var qt=function(t,r,o,n){var a=arguments.length,s=a<3?r:n===null?n=Object.getOwnPropertyDescriptor(r,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,o,n);else for(var d=t.length-1;d>=0;d--)(l=t[d])&&(s=(a<3?l(s):a>3?l(r,o,s):l(r,o))||s);return a>3&&s&&Object.defineProperty(r,o,s),s},Ce=class extends Mr{constructor(){super(),this.editorMode=!1,this.addStore(E)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Fr.nothing:Fr.html`
719
719
  <span class="ft-i18n">
720
720
  ${this.i18n({context:this.context,key:this.key,args:Array.isArray(this.args)?this.args:[]})}