@fluid-topics/ft-filterable-table 2.2.40 → 2.2.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
label="${e.label}"
|
|
624
624
|
.value=${e.value}
|
|
625
625
|
></ft-select-option>
|
|
626
|
-
`}willUpdate(e){super.willUpdate(e),e.has("options")&&(this.selectedOption=this.options.filter(r=>r.selected)[0]),e.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(e){var r,i;if(super.contentAvailableCallback(e),e.has("focusOptions")&&this.focusOptions&&((r=(i=this.selectedOptionElement)!==null&&i!==void 0?i:this.firstOption)===null||r===void 0||r.focus(),this.focusOptions=!1),e.has("optionsDisplayed")&&(this.optionsDisplayed?document.addEventListener("click",this.hideOptions):document.removeEventListener("click",this.hideOptions)),e.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px";let n=["bottom","top"];(0,Le.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",n,"fixed",k.optionsHeight,0).then(({x:s,y:o})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${o}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(e){var r;e.stopPropagation(),this.isSlotEmpty=(0,Le.isSlotEmptyOrWithoutContent)(this.optionsSlot);let i=(r=this.optionsSlot)===null||r===void 0?void 0:r.assignedElements().map(n=>n);i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(e){switch(e.key===" "&&(e.preventDefault(),e.stopPropagation()),e.key){case" ":case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":e.preventDefault(),e.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(e){var r,i;let n,s=this.focusedOption?this.optionsList.indexOf(this.focusedOption):0;switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),this.onSelectOption(e),this.optionsDisplayed=!1,(r=this.mainPanel)===null||r===void 0||r.focus();break;case"Escape":this.optionsDisplayed=!1,(i=this.mainPanel)===null||i===void 0||i.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),n=this.optionsList[(s-1+this.optionsList.length)%this.optionsList.length];break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),n=this.optionsList[(s+1)%this.optionsList.length];break;default:if(e.key.length!=1)break;this.isKeyAlphanumeric(e.key)&&(n=this.handleAlphanumericPress(e.key));break}n?.focus()}isKeyAlphanumeric(e){let r=e.charCodeAt(0);return r>47&&r<58||r>64&&r<91||r>96&&r<123}handleAlphanumericPress(e){let r=new Date;r.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=e.toLowerCase();let i=this.options.find(n=>{var s;return((s=n.label)===null||s===void 0?void 0:s.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});return this.lastSearchInputDate=r,i&&this.optionsList.find(n=>n.value===i.value)}getOptionId(e){if(!e)return;let r=this.options.findIndex(i=>(0,Le.deepEqual)(i.value,e.value));if(r!==-1)return`option-${r}`}onSelectOption(e){e.stopPropagation(),this.setValue(e.target.value)}setValue(e,r=!0){let i=this.options.find(n=>(0,Le.deepEqual)(n.value,e));i&&this.selectOption(i,r)}selectOption(e,r=!0){var i,n;if(!(0,Le.deepEqual)((i=this.selectedOption)===null||i===void 0?void 0:i.value,e?.value)){this.selectedOption=e;for(let s of this.options)s.selected=s===e;r&&this.dispatchEvent(new CustomEvent("change",{detail:(n=this.selectedOption)===null||n===void 0?void 0:n.value}))}this.optionsDisplayed=!1}};W.elementDefinitions={"ft-input-label":Ce,"ft-typography":oe,"ft-ripple":U,"ft-icon":re,"ft-select-option":Ee};W.searchTimeoutMilliseconds=2e3;W.styles=[Kt,Po];le([(0,J.property)({type:String})],W.prototype,"label",void 0);le([(0,J.property)({type:String})],W.prototype,"ariaLabel",void 0);le([(0,J.property)({type:String})],W.prototype,"helper",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"outlined",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"disabled",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"error",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"fixedMenuPosition",void 0);le([(0,J.property)({type:Array})],W.prototype,"options",void 0);le([(0,J.state)()],W.prototype,"selectedOption",void 0);le([(0,J.state)()],W.prototype,"optionsDisplayed",void 0);le([(0,J.state)()],W.prototype,"focusOptions",void 0);le([(0,J.state)()],W.prototype,"currentSearch",void 0);le([(0,J.state)()],W.prototype,"lastSearchInputDate",void 0);le([(0,J.query)(".ft-select")],W.prototype,"container",void 0);le([(0,J.query)(".ft-select--options")],W.prototype,"optionsMenu",void 0);le([(0,J.query)(".ft-select--input-panel")],W.prototype,"mainPanel",void 0);le([(0,J.query)("slot:not([name])")],W.prototype,"optionsSlot",void 0);var Mo={"ft-select":W,"ft-select-option":Ee};(0,$o.customElements)(Mo);var Kc=f(S());var q=f(F()),L=f(Y()),zc=f(Yr()),jc=f(et());var ue=f(S());var Zn=f(Y());var Uo=f(Y(),1);var Pn=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},hu=t=>({fromAttribute:e=>{if(e==null)return Ar(t);try{return JSON.parse(e)}catch{return Ar(t)}},toAttribute:e=>JSON.stringify(e)});function Fo(t,e){return(0,Uo.property)({type:Object,converter:hu(t),hasChanged:_r,...e??{}})}function mu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(!Yt(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!Yt(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let n=o=>Object.keys(o).filter(a=>o[a]!=null),s=n(t);if(r=s.length,r!==n(e).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=r;i--!==0;){let o=s[i];if(!Yt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Yt(t,e){try{return mu(t,e)}catch{return!1}}function _r(t,e){return!Yt(t,e)}function Ar(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function ii(t,e){let r=i=>i[t]===!0;return i=>{if(r(i))return i;let n=e(i);return n[t]=!0,n}}var Bo=f(Y(),1);var Dn=t=>{let e=t??{};return(r,i)=>{var n;let s={hasChanged:_r,attribute:!1,...e};(0,Bo.property)(s)(r,i);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(i,{selector:(n=e.selector)!==null&&n!==void 0?n:(a=>a[i]),store:e.store})}};var ni=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(i=>i.type===e);return r&&(this.queue=this.queue.filter(i=>i!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var Ot=f(Y(),1);var si=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,i)=>{this.resolvePromise=r,this.rejectPromise=i})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let i=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),s=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of i)try{await o()}catch(a){n(a);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 ai=f(F(),1);var oi=class extends ai.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(r);return(0,ai.adoptStyles)(i,e.elementStyles),i}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,i])=>this.defineScopedElement(r,i))}static defineScopedElement(e,r){Pn(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function Ho(t,e,...r){var i;let n=t.querySelector(e);for(let s of r)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(s);return n}var Zt=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},Wo,Vo=Symbol("constructorPrototype"),zo=Symbol("constructorName"),Ko=Symbol("exportpartsDebouncer"),jo=Symbol("dynamicDependenciesLoaded"),Xt=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Xt.eventName="exportparts-updated";var Ge=class extends oi{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Wo]=new si(5),this.scheduleExportpartsUpdate=()=>{var e,r,i;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(i=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&i!==void 0&&i)&&this[Ko].run(()=>{var n,s;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[zo]=this.constructor.name,this[Vo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[zo]&&Object.setPrototypeOf(this,this[Vo])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(i){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",i)}let r=this.constructor;r[jo]||(r[jo]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new Xt)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let s=[...n??[],i];r=Ho(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,i,n;if(((i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&i!==void 0?i:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,i,n,s,o,a;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(s=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&s!==void 0?s:[]){let m=(o=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&o!==void 0?o:[],v=(a=(n=p.getAttribute("exportparts"))===null||n===void 0?void 0:n.split(",").map(x=>x.split(":")[1]))!==null&&a!==void 0?a:[],C=[...m,...v].filter(l).map(x=>x.trim());for(let x of C)u.add(x)}if(u.size===0){this.exportparts=void 0;return}let d=[...u.values()].flatMap(p=>c.map(m=>`${p}:${m}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};Wo=Ko;Zt([(0,Ot.property)()],Ge.prototype,"exportpartsPrefix",void 0);Zt([Fo([])],Ge.prototype,"exportpartsPrefixes",void 0);Zt([(0,Ot.property)({reflect:!0})],Ge.prototype,"exportparts",void 0);Zt([(0,Ot.property)()],Ge.prototype,"customStylesheet",void 0);Zt([(0,Ot.property)()],Ge.prototype,"elementToFocus",void 0);Zt([(0,Ot.state)()],Ge.prototype,"useAdoptedStyleSheets",void 0);function li(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Cr=Symbol("internalReduxEventsUnsubscribers"),ct=Symbol("internalStoresUnsubscribers"),Tt=Symbol("internalStores"),gu=ii(Symbol("withRedux"),function(t){var e,r,i;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[i]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Tt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Tt].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[Tt].get(o)}addStore(o,a){var l;a=(l=a??o.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Tt].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[Tt].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Tt].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let c=this.getStore(o.store);c&&(o.store?this[ct].has(o.store):this[ct].size>0)&&(this[a]=o.selector(c.getState(),this))}})}subscribeToStore(o,a){var l,c;this[ct].set(o,a.subscribe(()=>this.updateFromStores())),this[Cr].set(o,[]),li(a)&&(!((l=a.deprecatedKeys)===null||l===void 0)&&l.length&&this.reduxConstructor.reduxProperties.forEach((u,d)=>{this.getStore(u.store)===a&&a.deprecatedKeys.includes(d)&&console.warn("Element",this,"is subscribed to deprecated key",d,"in store",a.name)}),a.eventBus&&((c=this.reduxConstructor.reduxEventListeners)===null||c===void 0||c.forEach((u,d)=>{if(typeof this[d]=="function"&&(!u.store||a.name===u.store)){let p=m=>this[d](m);a.addEventListener(u.eventName,p),this[Cr].get(o).push(()=>a.removeEventListener(u.eventName,p))}}))),this.onStoreAvailable(o)}unsubscribeFromStores(){this[ct].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[ct].has(o)&&this[ct].get(o)(),this[ct].delete(o),(a=this[Cr].get(o))===null||a===void 0||a.forEach(l=>l()),this[Cr].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ct,r=Tt,i=Cr,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Go=class extends gu(Ge){};function ce(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 yu=typeof Symbol=="function"&&Symbol.observable||"@@observable",qo=yu,Ln=()=>Math.random().toString(36).substring(7).split("").join("."),xu={INIT:`@@redux/INIT${Ln()}`,REPLACE:`@@redux/REPLACE${Ln()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ln()}`},ci=xu;function ui(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function kn(t,e,r){if(typeof t!="function")throw new Error(ce(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ce(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ce(1));return r(kn)(t,e)}let i=t,n=e,s=new Map,o=s,a=0,l=!1;function c(){o===s&&(o=new Map,s.forEach((x,O)=>{o.set(O,x)}))}function u(){if(l)throw new Error(ce(3));return n}function d(x){if(typeof x!="function")throw new Error(ce(4));if(l)throw new Error(ce(5));let O=!0;c();let $=a++;return o.set($,x),function(){if(O){if(l)throw new Error(ce(6));O=!1,c(),o.delete($),s=null}}}function p(x){if(!ui(x))throw new Error(ce(7));if(typeof x.type>"u")throw new Error(ce(8));if(typeof x.type!="string")throw new Error(ce(17));if(l)throw new Error(ce(9));try{l=!0,n=i(n,x)}finally{l=!1}return(s=o).forEach($=>{$()}),x}function m(x){if(typeof x!="function")throw new Error(ce(10));i=x,p({type:ci.REPLACE})}function v(){let x=d;return{subscribe(O){if(typeof O!="object"||O===null)throw new Error(ce(11));function $(){let E=O;E.next&&E.next(u())}return $(),{unsubscribe:x($)}},[qo](){return this}}}return p({type:ci.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:m,[qo]:v}}function vu(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:ci.INIT})>"u")throw new Error(ce(12));if(typeof r(void 0,{type:ci.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ce(13))})}function Nn(t){let e=Object.keys(t),r={};for(let o=0;o<e.length;o++){let a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}let i=Object.keys(r),n,s;try{vu(r)}catch(o){s=o}return function(a={},l){if(s)throw s;let c=!1,u={};for(let d=0;d<i.length;d++){let p=i[d],m=r[p],v=a[p],C=m(v,l);if(typeof C>"u"){let x=l&&l.type;throw new Error(ce(14))}u[p]=C,c=c||C!==v}return c=c||i.length!==Object.keys(a).length,c?u:a}}function wr(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...i)=>e(r(...i)))}function Yo(...t){return e=>(r,i)=>{let n=e(r,i),s=()=>{throw new Error(ce(15))},o={getState:n.getState,dispatch:(l,...c)=>s(l,...c)},a=t.map(l=>l(o));return s=wr(...a)(n.dispatch),{...n,dispatch:s}}}function Xo(t){return ui(t)&&"type"in t&&typeof t.type=="string"}var sa=Symbol.for("immer-nothing"),Zo=Symbol.for("immer-draftable"),fe=Symbol.for("immer-state");function Be(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Oe=Object,Qt=Oe.getPrototypeOf,hi="constructor",bi="prototype",Un="configurable",mi="enumerable",pi="writable",Or="value",qe=t=>!!t&&!!t[fe];function Te(t){return t?oa(t)||Ei(t)||!!t[Zo]||!!t[hi]?.[Zo]||Ai(t)||Dr(t):!1}var bu=Oe[bi][hi].toString(),Jo=new WeakMap;function oa(t){if(!t||!Kn(t))return!1;let e=Qt(t);if(e===null||e===Oe[bi])return!0;let r=Oe.hasOwnProperty.call(e,hi)&&e[hi];if(r===Object)return!0;if(!Jt(r))return!1;let i=Jo.get(r);return i===void 0&&(i=Function.toString.call(r),Jo.set(r,i)),i===bu}function Si(t,e,r=!0){Pr(t)===0?(r?Reflect.ownKeys(t):Oe.keys(t)).forEach(n=>{e(n,t[n],t)}):t.forEach((i,n)=>e(n,i,t))}function Pr(t){let e=t[fe];return e?e.type_:Ei(t)?1:Ai(t)?2:Dr(t)?3:0}var In=(t,e,r=Pr(t))=>r===2?t.has(e):Oe[bi].hasOwnProperty.call(t,e),Fn=(t,e,r=Pr(t))=>r===2?t.get(e):t[e],gi=(t,e,r,i=Pr(t))=>{i===2?t.set(e,r):i===3?t.add(r):t[e]=r};function Su(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Ei=Array.isArray,Ai=t=>t instanceof Map,Dr=t=>t instanceof Set,Kn=t=>typeof t=="object",Jt=t=>typeof t=="function",Mn=t=>typeof t=="boolean";function Eu(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var rt=t=>t.copy_||t.base_;var Gn=t=>t.modified_?t.copy_:t.base_;function Bn(t,e){if(Ai(t))return new Map(t);if(Dr(t))return new Set(t);if(Ei(t))return Array[bi].slice.call(t);let r=oa(t);if(e===!0||e==="class_only"&&!r){let i=Oe.getOwnPropertyDescriptors(t);delete i[fe];let n=Reflect.ownKeys(i);for(let s=0;s<n.length;s++){let o=n[s],a=i[o];a[pi]===!1&&(a[pi]=!0,a[Un]=!0),(a.get||a.set)&&(i[o]={[Un]:!0,[pi]:!0,[mi]:a[mi],[Or]:t[o]})}return Oe.create(Qt(t),i)}else{let i=Qt(t);if(i!==null&&r)return{...t};let n=Oe.create(i);return Oe.assign(n,t)}}function _i(t,e=!1){return Ci(t)||qe(t)||!Te(t)||(Pr(t)>1&&Oe.defineProperties(t,{set:di,add:di,clear:di,delete:di}),Oe.freeze(t),e&&Si(t,(r,i)=>{_i(i,!0)},!1)),t}function Au(){Be(2)}var di={[Or]:Au};function Ci(t){return t===null||!Kn(t)?!0:Oe.isFrozen(t)}var yi="MapSet",Hn="Patches",Qo="ArrayMethods",aa={};function Rt(t){let e=aa[t];return e||Be(0,t),e}var ea=t=>!!aa[t];var Tr,la=()=>Tr,_u=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ea(yi)?Rt(yi):void 0,arrayMethodsPlugin_:ea(Qo)?Rt(Qo):void 0});function ta(t,e){e&&(t.patchPlugin_=Rt(Hn),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Vn(t){zn(t),t.drafts_.forEach(Cu),t.drafts_=null}function zn(t){t===Tr&&(Tr=t.parent_)}var ra=t=>Tr=_u(Tr,t);function Cu(t){let e=t[fe];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function ia(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[fe].modified_&&(Vn(e),Be(4)),Te(t)&&(t=na(e,t));let{patchPlugin_:n}=e;n&&n.generateReplacementPatches_(r[fe].base_,t,e)}else t=na(e,r);return wu(e,t,!0),Vn(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==sa?t:void 0}function na(t,e){if(Ci(e))return e;let r=e[fe];if(!r)return xi(e,t.handledSet_,t);if(!wi(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:i}=r;if(i)for(;i.length>0;)i.pop()(t);da(r,t)}return r.copy_}function wu(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&_i(e,r)}function ca(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var wi=(t,e)=>t.scope_===e,Ou=[];function ua(t,e,r,i){let n=rt(t),s=t.type_;if(i!==void 0&&Fn(n,i,s)===e){gi(n,i,r,s);return}if(!t.draftLocations_){let a=t.draftLocations_=new Map;Si(n,(l,c)=>{if(qe(c)){let u=a.get(c)||[];u.push(l),a.set(c,u)}})}let o=t.draftLocations_.get(e)??Ou;for(let a of o)gi(n,a,r,s)}function Tu(t,e,r){t.callbacks_.push(function(n){let s=e;if(!s||!wi(s,n))return;n.mapSetPlugin_?.fixSetContents(s);let o=Gn(s);ua(t,s.draft_??s,o,r),da(s,n)})}function da(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:i}=e;if(i){let n=i.getPath(t);n&&i.generatePatches_(t,n,e)}ca(t)}}function Ru(t,e,r){let{scope_:i}=t;if(qe(r)){let n=r[fe];wi(n,i)&&n.callbacks_.push(function(){fi(t);let o=Gn(n);ua(t,r,o,e)})}else Te(r)&&t.callbacks_.push(function(){let s=rt(t);t.type_===3?s.has(r)&&xi(r,i.handledSet_,i):Fn(s,e,t.type_)===r&&i.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&xi(Fn(t.copy_,e,t.type_),i.handledSet_,i)})}function xi(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||qe(t)||e.has(t)||!Te(t)||Ci(t)||(e.add(t),Si(t,(i,n)=>{if(qe(n)){let s=n[fe];if(wi(s,r)){let o=Gn(s);gi(t,i,o,t.type_),ca(s)}}else Te(n)&&xi(n,e,r)})),t}function Pu(t,e){let r=Ei(t),i={type_:r?1:0,scope_:e?e.scope_:la(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},n=i,s=vi;r&&(n=[i],s=Rr);let{revoke:o,proxy:a}=Proxy.revocable(n,s);return i.draft_=a,i.revoke_=o,[a,i]}var vi={get(t,e){if(e===fe)return t;let r=t.scope_.arrayMethodsPlugin_,i=t.type_===1&&typeof e=="string";if(i&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let n=rt(t);if(!In(n,e,t.type_))return Lu(t,n,e);let s=n[e];if(t.finalized_||!Te(s)||i&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Eu(e))return s;if(s===$n(t.base_,e)||Du(t,e,s)){fi(t);let o=t.type_===1?+e:e,a=Wn(t.scope_,s,t,o);return t.copy_[o]=a}return s},has(t,e){return e in rt(t)},ownKeys(t){return Reflect.ownKeys(rt(t))},set(t,e,r){let i=pa(rt(t),e);if(i?.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){let n=$n(rt(t),e),s=n?.[fe];if(s&&s.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Su(r,n)&&(r!==void 0||In(t.base_,e,t.type_)))return!0;fi(t),jn(t)}return t.copy_[e]===r&&(r!==void 0||In(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Ru(t,e,r)),!0},deleteProperty(t,e){return fi(t),$n(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),jn(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=rt(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{[pi]:!0,[Un]:t.type_!==1||e!=="length",[mi]:i[mi],[Or]:r[e]}},defineProperty(){Be(11)},getPrototypeOf(t){return Qt(t.base_)},setPrototypeOf(){Be(12)}},Rr={};for(let t in vi){let e=vi[t];Rr[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Rr.deleteProperty=function(t,e){return Rr.set.call(this,t,e,void 0)};Rr.set=function(t,e,r){return vi.set.call(this,t[0],e,r,t[0])};function $n(t,e){let r=t[fe];return(r?rt(r):t)[e]}function Du(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!Te(r)||r[fe]?!1:t.baseRefs_.has(r)}function Lu(t,e,r){let i=pa(e,r);return i?Or in i?i[Or]:i.get?.call(t.draft_):void 0}function pa(t,e){if(!(e in t))return;let r=Qt(t);for(;r;){let i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Qt(r)}}function jn(t){t.modified_||(t.modified_=!0,t.parent_&&jn(t.parent_))}function fi(t){t.copy_||(t.assigned_=new Map,t.copy_=Bn(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var ku=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,i)=>{if(Jt(e)&&!Jt(r)){let s=r;r=e;let o=this;return function(l=s,...c){return o.produce(l,u=>r.call(this,u,...c))}}Jt(r)||Be(6),i!==void 0&&!Jt(i)&&Be(7);let n;if(Te(e)){let s=ra(this),o=Wn(s,e,void 0),a=!0;try{n=r(o),a=!1}finally{a?Vn(s):zn(s)}return ta(s,i),ia(n,s)}else if(!e||!Kn(e)){if(n=r(e),n===void 0&&(n=e),n===sa&&(n=void 0),this.autoFreeze_&&_i(n,!0),i){let s=[],o=[];Rt(Hn).generateReplacementPatches_(e,n,{patches_:s,inversePatches_:o}),i(s,o)}return n}else Be(1,e)},this.produceWithPatches=(e,r)=>{if(Jt(e))return(o,...a)=>this.produceWithPatches(o,l=>e(l,...a));let i,n;return[this.produce(e,r,(o,a)=>{i=o,n=a}),i,n]},Mn(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Mn(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Mn(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Te(t)||Be(8),qe(t)&&(t=fa(t));let e=ra(this),r=Wn(e,t,void 0);return r[fe].isManual_=!0,zn(e),r}finishDraft(t,e){let r=t&&t[fe];(!r||!r.isManual_)&&Be(9);let{scope_:i}=r;return ta(i,e),ia(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let n=e[r];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}r>-1&&(e=e.slice(r+1));let i=Rt(Hn).applyPatches_;return qe(t)?i(t,e):this.produce(t,n=>i(n,e))}};function Wn(t,e,r,i){let[n,s]=Ai(e)?Rt(yi).proxyMap_(e,r):Dr(e)?Rt(yi).proxySet_(e,r):Pu(e,r);return(r?.scope_??la()).drafts_.push(n),s.callbacks_=r?.callbacks_??[],s.key_=i,r&&i!==void 0?Tu(r,s,i):s.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(s);let{patchPlugin_:c}=l;s.modified_&&c&&c.generatePatches_(s,[],l)}),n}function fa(t){return qe(t)||Be(10,t),ha(t)}function ha(t){if(!Te(t)||Ci(t))return t;let e=t[fe],r,i=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=Bn(t,e.scope_.immer_.useStrictShallowCopy_),i=e.scope_.immer_.shouldUseStrictIteration()}else r=Bn(t,!0);let n=r;return Dr(r)&&(r=new Set),Si(n,(s,o)=>{gi(r,s,ha(o))},i),e&&(e.finalized_=!1),r}var Nu=globalThis.Iterator,dh=typeof Nu?.from=="function";var Iu=new ku,qn=Iu.produce;function ma(t){return({dispatch:r,getState:i})=>n=>s=>typeof s=="function"?s(r,i,t):n(s)}var ga=ma(),ya=ma;var Mu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?wr:wr.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var $u=t=>t&&typeof t.match=="function";function ut(t,e){function r(...i){if(e){let n=e(...i);if(!n)throw new Error(Ye(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:i[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=i=>Xo(i)&&i.type===t,r}var Ea=class Lr extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Lr.prototype)}static get[Symbol.species](){return Lr}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Lr(...e[0].concat(this)):new Lr(...e.concat(this))}};function xa(t){return Te(t)?qn(t,()=>{}):t}function Oi(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function Uu(t){return typeof t=="boolean"}var Fu=()=>function(e){let{thunk:r=!0,immutableCheck:i=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{},o=new Ea;return r&&(Uu(r)?o.push(ga):o.push(ya(r.extraArgument))),o},Bu="RTK_autoBatch";var va=t=>e=>{setTimeout(e,t)},Hu=(t,e)=>r=>{let i=!1,n,s,o=()=>{i||(i=!0,cancelAnimationFrame(n),clearTimeout(s),r())};n=t(o),s=setTimeout(o,e)},Vu=(t={type:"raf"})=>e=>(...r)=>{let i=e(...r),n=!0,s=!1,o=!1,a=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Hu(window.requestAnimationFrame,100):va(10):t.type==="callback"?t.queueNotification:va(t.timeout),c=()=>{o=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},i,{subscribe(u){let d=()=>n&&u(),p=i.subscribe(d);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return n=!u?.meta?.[Bu],s=!n,s&&(o||(o=!0,l(c))),i.dispatch(u)}finally{n=!0}}})},zu=t=>function(r){let{autoBatch:i=!0}=r??{},n=new Ea(t);return i&&n.push(Vu(typeof i=="object"?i:void 0)),n};function Aa(t){let e=Fu(),{reducer:r=void 0,middleware:i,devTools:n=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o=void 0,enhancers:a=void 0}=t||{},l;if(typeof r=="function")l=r;else if(ui(r))l=Nn(r);else throw new Error(Ye(1));let c;typeof i=="function"?c=i(e):c=e();let u=wr;n&&(u=Mu({trace:!1,...typeof n=="object"&&n}));let d=Yo(...c),p=zu(d),m=typeof a=="function"?a(p):p(),v=u(...m);return kn(l,o,v)}function _a(t){let e={},r=[],i,n={addCase(s,o){let a=typeof s=="string"?s:s.type;if(!a)throw new Error(Ye(28));if(a in e)throw new Error(Ye(29));return e[a]=o,n},addAsyncThunk(s,o){return o.pending&&(e[s.pending.type]=o.pending),o.rejected&&(e[s.rejected.type]=o.rejected),o.fulfilled&&(e[s.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:s.settled,reducer:o.settled}),n},addMatcher(s,o){return r.push({matcher:s,reducer:o}),n},addDefaultCase(s){return i=s,n}};return t(n),[e,r,i]}function ju(t){return typeof t=="function"}function Wu(t,e){let[r,i,n]=_a(e),s;if(ju(t))s=()=>xa(t());else{let a=xa(t);s=()=>a}function o(a=s(),l){let c=[r[l.type],...i.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[n]),c.reduce((u,d)=>{if(d)if(qe(u)){let p=d(u,l);return p===void 0?u:p}else{if(Te(u))return qn(u,p=>d(p,l));{let p=d(u,l);if(p===void 0){if(u===null)return u;throw new Error(Ye(9))}return p}}return u},a)}return o.getInitialState=s,o}var Ku=(t,e)=>$u(t)?t.match(e):t(e);function Gu(...t){return e=>t.some(r=>Ku(r,e))}var qu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Yu=(t=21)=>{let e="",r=t;for(;r--;)e+=qu[Math.random()*64|0];return e},Xu=["name","message","stack","code"],Yn=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},ba=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},Zu=t=>{if(typeof t=="object"&&t!==null){let e={};for(let r of Xu)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},Sa="External signal was aborted",Ju=(()=>{function t(e,r,i){let n=ut(e+"/fulfilled",(l,c,u,d)=>({payload:l,meta:{...d||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),s=ut(e+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),o=ut(e+"/rejected",(l,c,u,d,p)=>({payload:d,error:(i&&i.serializeError||Zu)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:d!==void 0,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,d,p)=>{let m=i?.idGenerator?i.idGenerator(l):Yu(),v=new AbortController,C,x;function O(b){x=b,v.abort()}c&&(c.aborted?O(Sa):c.addEventListener("abort",()=>O(Sa),{once:!0}));let $=(async function(){let b;try{let E=i?.condition?.(l,{getState:d,extra:p});if(ed(E)&&(E=await E),E===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(v.signal.aborted)throw{name:"AbortError",message:x||"Aborted"};let H=new Promise((M,te)=>{C=()=>{te({name:"AbortError",message:x||"Aborted"})},v.signal.addEventListener("abort",C,{once:!0})});u(s(m,l,i?.getPendingMeta?.({requestId:m,arg:l},{getState:d,extra:p}))),b=await Promise.race([H,Promise.resolve(r(l,{dispatch:u,getState:d,extra:p,requestId:m,signal:v.signal,abort:O,rejectWithValue:((M,te)=>new Yn(M,te)),fulfillWithValue:((M,te)=>new ba(M,te))})).then(M=>{if(M instanceof Yn)throw M;return M instanceof ba?n(M.payload,m,l,M.meta):n(M,m,l)})])}catch(E){b=E instanceof Yn?o(null,m,l,E.payload,E.meta):o(E,m,l)}finally{C&&v.signal.removeEventListener("abort",C)}return i&&!i.dispatchConditionRejection&&o.match(b)&&b.meta.condition||u(b),b})();return Object.assign($,{abort:O,requestId:m,arg:l,unwrap(){return $.then(Qu)}})}}return Object.assign(a,{pending:s,rejected:o,fulfilled:n,settled:Gu(o,n),typePrefix:e})}return t.withTypes=()=>t,t})();function Qu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ed(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Ca=Symbol.for("rtk-slice-createasyncthunk"),vh={[Ca]:Ju};function td(t,e){return`${t}/${e}`}function rd({creators:t}={}){let e=t?.asyncThunk?.[Ca];return function(i){let{name:n,reducerPath:s=n}=i;if(!n)throw new Error(Ye(11));typeof process<"u";let o=(typeof i.reducers=="function"?i.reducers(nd()):i.reducers)||{},a=Object.keys(o),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(b,E){let H=typeof b=="string"?b:b.type;if(!H)throw new Error(Ye(12));if(H in l.sliceCaseReducersByType)throw new Error(Ye(13));return l.sliceCaseReducersByType[H]=E,c},addMatcher(b,E){return l.sliceMatchers.push({matcher:b,reducer:E}),c},exposeAction(b,E){return l.actionCreators[b]=E,c},exposeCaseReducer(b,E){return l.sliceCaseReducersByName[b]=E,c}};a.forEach(b=>{let E=o[b],H={reducerName:b,type:td(n,b),createNotation:typeof i.reducers=="function"};od(E)?ld(H,E,c,e):sd(H,E,c)});function u(){let[b={},E=[],H=void 0]=typeof i.extraReducers=="function"?_a(i.extraReducers):[i.extraReducers],M={...b,...l.sliceCaseReducersByType};return Wu(i.initialState,te=>{for(let de in M)te.addCase(de,M[de]);for(let de of l.sliceMatchers)te.addMatcher(de.matcher,de.reducer);for(let de of E)te.addMatcher(de.matcher,de.reducer);H&&te.addDefaultCase(H)})}let d=b=>b,p=new Map,m=new WeakMap,v;function C(b,E){return v||(v=u()),v(b,E)}function x(){return v||(v=u()),v.getInitialState()}function O(b,E=!1){function H(te){let de=te[b];return typeof de>"u"&&E&&(de=Oi(m,H,x)),de}function M(te=d){return Oi(Oi(p,E,()=>new WeakMap),te,()=>{let de={};for(let[qr,Pe]of Object.entries(i.selectors??{}))de[qr]=id(Pe,te,()=>Oi(m,te,x),E);return de})}return{reducerPath:b,getSelectors:M,get selectors(){return M(H)},selectSlice:H}}let $={name:n,reducer:C,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:x,...O(s),injectInto(b,{reducerPath:E,...H}={}){let M=E??s;return b.inject({reducerPath:M,reducer:C},H),{...$,...O(M,!0)}}};return $}}function id(t,e,r,i){function n(s,...o){let a=e(s);return typeof a>"u"&&i&&(a=r()),t(a,...o)}return n.unwrapped=t,n}var wa=rd();function nd(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function sd({type:t,reducerName:e,createNotation:r},i,n){let s,o;if("reducer"in i){if(r&&!ad(i))throw new Error(Ye(17));s=i.reducer,o=i.prepare}else s=i;n.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,o?ut(t,o):ut(t))}function od(t){return t._reducerDefinitionType==="asyncThunk"}function ad(t){return t._reducerDefinitionType==="reducerWithPrepare"}function ld({type:t,reducerName:e},r,i,n){if(!n)throw new Error(Ye(18));let{payloadCreator:s,fulfilled:o,pending:a,rejected:l,settled:c,options:u}=r,d=n(t,s,u);i.exposeAction(e,d),o&&i.addCase(d.fulfilled,o),a&&i.addCase(d.pending,a),l&&i.addCase(d.rejected,l),c&&i.addMatcher(d.settled,c),i.exposeCaseReducer(e,{fulfilled:o||Ti,pending:a||Ti,rejected:l||Ti,settled:c||Ti})}function Ti(){}var Oa="listener",Ta="completed",Ra="cancelled",bh=`task-${Ra}`,Sh=`task-${Ta}`,Eh=`${Oa}-${Ra}`,Ah=`${Oa}-${Ta}`;var{assign:Pa}=Object;var Xn="listenerMiddleware";var cd=Pa(ut(`${Xn}/add`),{withTypes:()=>cd}),_h=ut(`${Xn}/removeAll`),ud=Pa(ut(`${Xn}/remove`),{withTypes:()=>ud});function Ye(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var dd=ii(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,i,n){this.eventBus.addEventListener(r,i,n)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,i,n){this.eventBus.removeEventListener(r,i,n)}}}),Ri=class extends dd(Object){};window.ftReduxStores||(window.ftReduxStores={});var Da=class t extends Ri{static get(e){var r;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,s=window.ftReduxStores[i];if(li(s))return s;if(n==null)return;let o=wa({...n,reducers:(r=n.reducers)!==null&&r!==void 0?r:{}}),a=Aa({reducer:(l,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let u=Ar(o.getInitialState());for(let d of c.keeping)u[d]=(l??u)[d];return u}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...c.overwrites};return o.reducer(l,c)}});return window.ftReduxStores[n.name]=new t(o,a,n.eventBus,n.deprecatedKeys)}constructor(e,r,i,n){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=n,this.isFtReduxStore=!0,this.commands=new ni,this.injectInto=(o,a)=>this.reduxSlice.injectInto(o,a),this.selectSlice=o=>this.reduxSlice.selectSlice(o);let s=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,a,l)=>{let c=a,u=o[c];return u?(...d)=>{let p=u(...d.map(s));return this.reduxStore.dispatch(p),p}:d=>{let p=c,m=this.getState()[p];Yt(m,d)||this.setState({[p]:s(d)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Pi=class{static format(e,r,i,n,s){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(i,n,!!s)):this.getIntlDateTime(e,r,i,n,!!s)}static getMomentDateFormat(e,r,i){return i?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,i,n,s){let o=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:i?"medium":"short"}).format(o),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return s?l:n?`${a} ${l}`:a}static getTimezoneAsString(){let e=i=>String(Math.floor(i)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Di=f(S()),pd="ft-app-info",Pt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Pt.eventName="authentication-change";var kr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};kr.eventName="ui-locale-changed";var fd={session:(t,e)=>{(0,Di.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>D.dispatchEvent(new Pt(e.payload)),0))}},D=Di.FtReduxStore.get({name:pd,reducers:fd,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var La=f(S()),Li=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},em=(0,La.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(D)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,s;return((s=(n=this.metadataDescriptors.find(a=>a.key===i))===null||n===void 0?void 0:n.date)!==null&&s!==void 0?s:!1)?a=>Pi.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Li([(0,Zn.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Li([(0,Zn.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Li([Dn({store:D.name,selector:r=>{var i,n;return(n=(i=r.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),Li([Dn({store:D.name})],e.prototype,"uiLocale",void 0),e});var ka;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ka||(ka={}));var Na;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Na||(Na={}));var Ia;(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"})(Ia||(Ia={}));var Ma;(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"})(Ma||(Ma={}));var $a;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})($a||($a={}));var Ua;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ua||(Ua={}));var Fa;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(Fa||(Fa={}));var Ba;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Ba||(Ba={}));var Ha;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Ha||(Ha={}));var Va;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(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",t.DOC_DIFF="DOC_DIFF"})(za||(za={}));var ja;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(ja||(ja={}));var Wa;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Wa||(Wa={}));var Ka;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Ka||(Ka={}));var Ga;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Ga||(Ga={}));var qa;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(qa||(qa={}));var Ya;(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"})(Ya||(Ya={}));var Xa;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Xa||(Xa={}));var Za;(function(t){t.ASC="ASC",t.DESC="DESC"})(Za||(Za={}));var Ja;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ja||(Ja={}));var Qa;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Qa||(Qa={}));var el;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(el||(el={}));var tl;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(tl||(tl={}));var rl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(rl||(rl={}));var il;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(il||(il={}));var nl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(nl||(nl={}));var sl;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(sl||(sl={}));var ol;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(ol||(ol={}));var Q;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Q||(Q={}));var ke;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(ke||(ke={}));var al;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(al||(al={}));var ll;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(ll||(ll={}));var cl;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(cl||(cl={}));var ul;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(ul||(ul={}));var dl;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(dl||(dl={}));var pl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(pl||(pl={}));var fl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(fl||(fl={}));var hl;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(hl||(hl={}));var ml;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(ml||(ml={}));var gl;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(gl||(gl={}));var yl;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(yl||(yl={}));var xl;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(xl||(xl={}));var vl;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(vl||(vl={}));var hd={[Q.PERSONAL_BOOK_SHARE_USER]:[Q.PERSONAL_BOOK_USER],[Q.HTML_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.PDF_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.KHUB_ADMIN]:[Q.CONTENT_PUBLISHER],[Q.ADMIN]:[Q.KHUB_ADMIN,Q.USERS_ADMIN,Q.PORTAL_ADMIN,Q.BEHAVIOR_DATA_USER],[Q.GENERATIVE_AI_EXPORT_USER]:[Q.GENERATIVE_AI_USER]};function bl(t,e){return t===e||(hd[t]??[]).some(r=>bl(r,e))}function Jn(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(i=>bl(i,e))}function Sl(t,...e){return t==null?!1:e.some(r=>Jn(t,r))}var $i=f(S());var Qn=f(S());var Dt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=D.getState(),n=e??i;if(r&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,n,!0)}static await(e){return new Promise(r=>{let i=t.get(e);if(i)r(i);else{let n=D.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var er=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Dt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Dt.await()}};var Re=class extends er{constructor(e=!0,r){var i;super(r),this.sortObjectFields=(s,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[l])=>a.localeCompare(l)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Qn.CacheRegistry,this.cache=e?n.commonCache:new Qn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,i)=>0|31*r+i.charCodeAt(0),0))}};var ki=class extends Re{async listMySearches(){let{session:e}=D.getState();return Jn(e,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Ni=class extends Re{async listMyBookmarks(){let e=D.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Ii=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=D.getState().session;return!!e?.sessionAuthenticated}};var Mi=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=D.getState().session;return!!e?.sessionAuthenticated}};var md="ft-user-assets",gd={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(ke).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:i,asset:n}=e.payload;ts(t,r,[...es(t,r),n]),El(t,r,1,i),Al(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;ts(t,r,es(t,r).map(n=>n.id===i.id?i:n)),Al(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;ts(t,r,es(t,r).filter(s=>s.id!==n)),El(t,r,-1,i)}},_l={[ke.SEARCHES]:"savedSearches",[ke.BOOKMARKS]:"bookmarks",[ke.BOOKS]:void 0,[ke.COLLECTIONS]:void 0},es=(t,e)=>{var r;let i=_l[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},ts=(t,e,r)=>{let i=_l[e];i&&(t[i]=r)},El=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===ke.BOOKMARKS&&i)){let s=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,s+r)}},Al=(t,e)=>{let r=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!r.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},me=$i.FtReduxStore.get({name:md,reducers:gd,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ke).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),rs=class{constructor(e=new Ii,r=new Mi){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=D.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ni,this.savedSearchesService=new ki,D.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=D.getState();(0,$i.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),me.actions.clearAssetCount(),me.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),me.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),me.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();me.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();me.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&me.getState().assetCounts.allAsset[e]!==r.count&&me.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&me.getState().assetCounts.bookmarkByMap[e]!==r.count&&me.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(me.getState().assetCounts.bookmarkByMap).length!==0;e===ke.BOOKMARKS&&r&&me.actions.clearBookmarkCountByMap(),me.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;me.actions.bookmarks(r)}}},yd=new rs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=yd);var is=class{addCommand(e,r=!1){D.commands.add(e,r)}consumeCommand(e){return D.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new is;var Ne=f(S());var Cl,tr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},xd=Symbol("clearAfterUnitTest"),Ui=class extends(0,Ne.withEventBus)(Re){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Cl]=()=>{this.defaultMessages={},this.cache=new Ne.CacheRegistry,this.listeners={}},this.currentUiLocale=D.getState().uiLocale,D.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=D.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var i;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...r};(0,Ne.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,i;return this.fetchContext(e),(i=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,r){let i=e.toLowerCase();return this.resolveContext(i)[r]}resolveMessage(e,r,...i){var n;let s=e.toLowerCase(),o=this.resolveContext(s);return new Ne.ParametrizedLabelResolver((n=this.defaultMessages[s])!==null&&n!==void 0?n:{},o).resolve(r,...i)}async fetchContext(e){let r=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(n){!(n instanceof Ne.CanceledPromiseError)&&r&&console.error(n)}return i}subscribe(e,r){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(r),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new tr({loadedContexts:e})),this.dispatchEvent(new tr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new tr({loadedContexts:[e]})),this.dispatchEvent(new tr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,Ne.delay)(0).then(()=>i()).catch(()=>null)))}};Cl=xd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ui{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ui{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var rr=window.FluidTopicsI18nService,Fi=window.FluidTopicsCustomI18nService;var wl=f(S()),ns=class{highlightHtml(e,r,i){(0,wl.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new ns;var Ol=f(S());var ss=class{isDate(e){var r,i,n,s;return(s=(i=((n=(r=D.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var i,n,s,o;if(e==null)return"";try{return Ol.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:D.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new ss;var Tl=f(S());var Nr=class{static get(e,r,{baseUrl:i,localesConfiguration:n,availableContentLocales:s}=D.getState()){var o;if(!r||s.length>0&&!s.some(a=>a.lang===r)){let a=n?.defaultLocales.defaultContentLocale;r=a?`${a.lang}-${a.region}`:(o=s[0])===null||o===void 0?void 0:o.lang}return new Tl.SearchPlaceConverter(i,e??20,n?.allLanguagesAllowed,r,s)}};var os=class{urlToSearchRequest(e){return Nr.get().parse(e)}searchRequestToUrl(e){return Nr.get().serialize(e)}};window.FluidTopicsUrlService=new os;var it=f(S());var Lt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Lt.eventName="before-location-change";var kt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};kt.eventName="change";var as=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Rl=new as;var Bi=class t extends it.WithEventBus{static build(){return new t(window.history,Rl,()=>window.location,!1)}constructor(e,r,i,n){var s,o;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(o=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,r=!1){let i=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,it.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new kt(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[s,o,a])=>{let l=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),c=new Lt(l);this.dispatchEvent(c);let u=r(),d={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:c.detail.nextLocation.href};i.apply(n,[d,o,d.href]),this.setCurrentState(d,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(i)}addBeforeLocationChangeListener(e){this.addEventListener(Lt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Lt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(kt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(kt.eventName,e)}currentItem(){return(0,it.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,it.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(i=>!!i).filter(i=>i.index<this.currentIndex).reverse();return(0,it.deepCopy)(r.find(i=>e(i)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,it.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let i=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!i)return e;let n=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,i);)this.hasState(s)&&(n=s),s++;return n}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var i;if(!this.hasState(e))return!1;let n=r??this.currentState.majorStateId,s=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return s==null||s!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bi.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Pl=f(F());var Dl=Pl.css`
|
|
626
|
+
`}willUpdate(e){super.willUpdate(e),e.has("options")&&(this.selectedOption=this.options.filter(r=>r.selected)[0]),e.has("selectedOption")&&(this.optionsDisplayed=!1)}contentAvailableCallback(e){var r,i;if(super.contentAvailableCallback(e),e.has("focusOptions")&&this.focusOptions&&((r=(i=this.selectedOptionElement)!==null&&i!==void 0?i:this.firstOption)===null||r===void 0||r.focus(),this.focusOptions=!1),e.has("optionsDisplayed")&&(this.optionsDisplayed?document.addEventListener("click",this.hideOptions):document.removeEventListener("click",this.hideOptions)),e.has("optionsDisplayed")&&this.hasOptionsMenuOpen){this.optionsMenu.style.minWidth=this.mainPanel.getBoundingClientRect().width+"px";let n=["bottom","top"];(0,Le.computeOffsetAutoPosition)(this.mainPanel,this.optionsMenu,"bottom",n,"fixed",k.optionsHeight,0).then(({x:s,y:o})=>{this.optionsMenu.style.left=`${s}px`,this.optionsMenu.style.top=`${o}px`})}}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(e){var r;e.stopPropagation(),this.isSlotEmpty=(0,Le.isSlotEmptyOrWithoutContent)(this.optionsSlot);let i=(r=this.optionsSlot)===null||r===void 0?void 0:r.assignedElements().map(n=>n);i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(e){switch(e.key===" "&&(e.preventDefault(),e.stopPropagation()),e.key){case" ":case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":e.preventDefault(),e.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0;break}}onOptionsKeyDown(e){var r,i;let n,s=this.focusedOption?this.optionsList.indexOf(this.focusedOption):0;switch(e.key){case" ":case"Enter":e.preventDefault(),e.stopPropagation(),this.onSelectOption(e),this.optionsDisplayed=!1,(r=this.mainPanel)===null||r===void 0||r.focus();break;case"Escape":this.optionsDisplayed=!1,(i=this.mainPanel)===null||i===void 0||i.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),n=this.optionsList[(s-1+this.optionsList.length)%this.optionsList.length];break;case"ArrowDown":e.preventDefault(),e.stopPropagation(),n=this.optionsList[(s+1)%this.optionsList.length];break;default:if(e.key.length!=1)break;this.isKeyAlphanumeric(e.key)&&(n=this.handleAlphanumericPress(e.key));break}n?.focus()}isKeyAlphanumeric(e){let r=e.charCodeAt(0);return r>47&&r<58||r>64&&r<91||r>96&&r<123}handleAlphanumericPress(e){let r=new Date;r.getTime()-this.lastSearchInputDate.getTime()>t.searchTimeoutMilliseconds&&(this.currentSearch=""),this.currentSearch+=e.toLowerCase();let i=this.options.find(n=>{var s;return((s=n.label)===null||s===void 0?void 0:s.toLowerCase().substring(0,this.currentSearch.length))===this.currentSearch});return this.lastSearchInputDate=r,i&&this.optionsList.find(n=>n.value===i.value)}getOptionId(e){if(!e)return;let r=this.options.findIndex(i=>(0,Le.deepEqual)(i.value,e.value));if(r!==-1)return`option-${r}`}onSelectOption(e){e.stopPropagation(),this.setValue(e.target.value)}setValue(e,r=!0){let i=this.options.find(n=>(0,Le.deepEqual)(n.value,e));i&&this.selectOption(i,r)}selectOption(e,r=!0){var i,n;if(!(0,Le.deepEqual)((i=this.selectedOption)===null||i===void 0?void 0:i.value,e?.value)){this.selectedOption=e;for(let s of this.options)s.selected=s===e;r&&this.dispatchEvent(new CustomEvent("change",{detail:(n=this.selectedOption)===null||n===void 0?void 0:n.value}))}this.optionsDisplayed=!1}};W.elementDefinitions={"ft-input-label":Ce,"ft-typography":oe,"ft-ripple":U,"ft-icon":re,"ft-select-option":Ee};W.searchTimeoutMilliseconds=2e3;W.styles=[Kt,Po];le([(0,J.property)({type:String})],W.prototype,"label",void 0);le([(0,J.property)({type:String})],W.prototype,"ariaLabel",void 0);le([(0,J.property)({type:String})],W.prototype,"helper",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"outlined",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"disabled",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"error",void 0);le([(0,J.property)({type:Boolean})],W.prototype,"fixedMenuPosition",void 0);le([(0,J.property)({type:Array})],W.prototype,"options",void 0);le([(0,J.state)()],W.prototype,"selectedOption",void 0);le([(0,J.state)()],W.prototype,"optionsDisplayed",void 0);le([(0,J.state)()],W.prototype,"focusOptions",void 0);le([(0,J.state)()],W.prototype,"currentSearch",void 0);le([(0,J.state)()],W.prototype,"lastSearchInputDate",void 0);le([(0,J.query)(".ft-select")],W.prototype,"container",void 0);le([(0,J.query)(".ft-select--options")],W.prototype,"optionsMenu",void 0);le([(0,J.query)(".ft-select--input-panel")],W.prototype,"mainPanel",void 0);le([(0,J.query)("slot:not([name])")],W.prototype,"optionsSlot",void 0);var Mo={"ft-select":W,"ft-select-option":Ee};(0,$o.customElements)(Mo);var Kc=f(S());var q=f(F()),L=f(Y()),zc=f(Yr()),jc=f(et());var ue=f(S());var Zn=f(Y());var Uo=f(Y(),1);var Pn=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)},hu=t=>({fromAttribute:e=>{if(e==null)return Ar(t);try{return JSON.parse(e)}catch{return Ar(t)}},toAttribute:e=>JSON.stringify(e)});function Fo(t,e){return(0,Uo.property)({type:Object,converter:hu(t),hasChanged:_r,...e??{}})}function mu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(i=r;i--!==0;)if(!Yt(t[i],e[i]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;for(i of t.entries())if(!Yt(i[1],e.get(i[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i of t.entries())if(!e.has(i[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let n=o=>Object.keys(o).filter(a=>o[a]!=null),s=n(t);if(r=s.length,r!==n(e).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[i]))return!1;for(i=r;i--!==0;){let o=s[i];if(!Yt(t[o],e[o]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function Yt(t,e){try{return mu(t,e)}catch{return!1}}function _r(t,e){return!Yt(t,e)}function Ar(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function ii(t,e){let r=i=>i[t]===!0;return i=>{if(r(i))return i;let n=e(i);return n[t]=!0,n}}var Bo=f(Y(),1);var Dn=t=>{let e=t??{};return(r,i)=>{var n;let s={hasChanged:_r,attribute:!1,...e};(0,Bo.property)(s)(r,i);let o=r.constructor;o.reduxProperties=new Map(o.reduxProperties),o.reduxProperties.set(i,{selector:(n=e.selector)!==null&&n!==void 0?n:(a=>a[i]),store:e.store})}};var ni=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(i=>i.type===e);return r&&(this.queue=this.queue.filter(i=>i!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var Ot=f(Y(),1);var si=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,i)=>{this.resolvePromise=r,this.rejectPromise=i})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let i=[...this.callbacks];this.callbacks=[];let n=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),s=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let o of i)try{await o()}catch(a){n(a);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 ai=f(F(),1);var oi=class extends ai.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},i=this.renderOptions.creationScope=this.attachShadow(r);return(0,ai.adoptStyles)(i,e.elementStyles),i}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,i])=>this.defineScopedElement(r,i))}static defineScopedElement(e,r){Pn(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function Ho(t,e,...r){var i;let n=t.querySelector(e);for(let s of r)n=(i=n?.shadowRoot)===null||i===void 0?void 0:i.querySelector(s);return n}var Zt=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},Wo,Vo=Symbol("constructorPrototype"),zo=Symbol("constructorName"),Ko=Symbol("exportpartsDebouncer"),jo=Symbol("dynamicDependenciesLoaded"),Xt=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};Xt.eventName="exportparts-updated";var Ge=class extends oi{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Wo]=new si(5),this.scheduleExportpartsUpdate=()=>{var e,r,i;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(i=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&i!==void 0&&i)&&this[Ko].run(()=>{var n,s;!((n=this.exportpartsPrefix)===null||n===void 0)&&n.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((s=this.exportpartsPrefixes)===null||s===void 0?void 0:s.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[zo]=this.constructor.name,this[Vo]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[zo]&&Object.setPrototypeOf(this,this[Vo])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(i){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",i)}let r=this.constructor;r[jo]||(r[jo]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(Xt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new Xt)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:i,shadowPath:n}=this.elementToFocus;if(i!=null){let s=[...n??[],i];r=Ho(this.shadowRoot,...s)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,i,n;if(((i=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&i!==void 0?i:[]).forEach(s=>s.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((n=this.customStylesheet)!==null&&n!==void 0?n:"")}catch(s){console.error(s,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let s=document.createElement("style");s.classList.add("ft-lit-element--custom-stylesheet"),s.innerHTML=this.customStylesheet,this.shadowRoot.append(s)}}setExportpartsAttribute(e){var r,i,n,s,o,a;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(s=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&s!==void 0?s:[]){let m=(o=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&o!==void 0?o:[],v=(a=(n=p.getAttribute("exportparts"))===null||n===void 0?void 0:n.split(",").map(x=>x.split(":")[1]))!==null&&a!==void 0?a:[],C=[...m,...v].filter(l).map(x=>x.trim());for(let x of C)u.add(x)}if(u.size===0){this.exportparts=void 0;return}let d=[...u.values()].flatMap(p=>c.map(m=>`${p}:${m}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};Wo=Ko;Zt([(0,Ot.property)()],Ge.prototype,"exportpartsPrefix",void 0);Zt([Fo([])],Ge.prototype,"exportpartsPrefixes",void 0);Zt([(0,Ot.property)({reflect:!0})],Ge.prototype,"exportparts",void 0);Zt([(0,Ot.property)()],Ge.prototype,"customStylesheet",void 0);Zt([(0,Ot.property)()],Ge.prototype,"elementToFocus",void 0);Zt([(0,Ot.state)()],Ge.prototype,"useAdoptedStyleSheets",void 0);function li(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Cr=Symbol("internalReduxEventsUnsubscribers"),ct=Symbol("internalStoresUnsubscribers"),Tt=Symbol("internalStores"),gu=ii(Symbol("withRedux"),function(t){var e,r,i;class n extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[i]=new Map}get reduxConstructor(){return this.constructor}willUpdate(o){super.willUpdate(o),[...this.reduxConstructor.reduxReactiveProperties].some(a=>o.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Tt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Tt].values()][0]}getStore(o){return o==null?this.getUnnamedStore():this[Tt].get(o)}addStore(o,a){var l;a=(l=a??o.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Tt].set(a,o),this.subscribeToStore(a,o),this.updateFromStores()}removeStore(o){let a=typeof o=="string"?o:o.name;this.unsubscribeFromStore(a),this[Tt].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Tt].forEach((o,a)=>this.subscribeToStore(a,o)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((o,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let c=this.getStore(o.store);c&&(o.store?this[ct].has(o.store):this[ct].size>0)&&(this[a]=o.selector(c.getState(),this))}})}subscribeToStore(o,a){var l,c;this[ct].set(o,a.subscribe(()=>this.updateFromStores())),this[Cr].set(o,[]),li(a)&&(!((l=a.deprecatedKeys)===null||l===void 0)&&l.length&&this.reduxConstructor.reduxProperties.forEach((u,d)=>{this.getStore(u.store)===a&&a.deprecatedKeys.includes(d)&&console.warn("Element",this,"is subscribed to deprecated key",d,"in store",a.name)}),a.eventBus&&((c=this.reduxConstructor.reduxEventListeners)===null||c===void 0||c.forEach((u,d)=>{if(typeof this[d]=="function"&&(!u.store||a.name===u.store)){let p=m=>this[d](m);a.addEventListener(u.eventName,p),this[Cr].get(o).push(()=>a.removeEventListener(u.eventName,p))}}))),this.onStoreAvailable(o)}unsubscribeFromStores(){this[ct].forEach((o,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(o){var a;this[ct].has(o)&&this[ct].get(o)(),this[ct].delete(o),(a=this[Cr].get(o))===null||a===void 0||a.forEach(l=>l()),this[Cr].delete(o)}onStoreAvailable(o){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ct,r=Tt,i=Cr,n.reduxProperties=new Map,n.reduxReactiveProperties=new Set,n.reduxEventListeners=new Map,n}),Go=class extends gu(Ge){};function ce(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 yu=typeof Symbol=="function"&&Symbol.observable||"@@observable",qo=yu,Ln=()=>Math.random().toString(36).substring(7).split("").join("."),xu={INIT:`@@redux/INIT${Ln()}`,REPLACE:`@@redux/REPLACE${Ln()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ln()}`},ci=xu;function ui(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function kn(t,e,r){if(typeof t!="function")throw new Error(ce(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(ce(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(ce(1));return r(kn)(t,e)}let i=t,n=e,s=new Map,o=s,a=0,l=!1;function c(){o===s&&(o=new Map,s.forEach((x,O)=>{o.set(O,x)}))}function u(){if(l)throw new Error(ce(3));return n}function d(x){if(typeof x!="function")throw new Error(ce(4));if(l)throw new Error(ce(5));let O=!0;c();let $=a++;return o.set($,x),function(){if(O){if(l)throw new Error(ce(6));O=!1,c(),o.delete($),s=null}}}function p(x){if(!ui(x))throw new Error(ce(7));if(typeof x.type>"u")throw new Error(ce(8));if(typeof x.type!="string")throw new Error(ce(17));if(l)throw new Error(ce(9));try{l=!0,n=i(n,x)}finally{l=!1}return(s=o).forEach($=>{$()}),x}function m(x){if(typeof x!="function")throw new Error(ce(10));i=x,p({type:ci.REPLACE})}function v(){let x=d;return{subscribe(O){if(typeof O!="object"||O===null)throw new Error(ce(11));function $(){let E=O;E.next&&E.next(u())}return $(),{unsubscribe:x($)}},[qo](){return this}}}return p({type:ci.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:m,[qo]:v}}function vu(t){Object.keys(t).forEach(e=>{let r=t[e];if(typeof r(void 0,{type:ci.INIT})>"u")throw new Error(ce(12));if(typeof r(void 0,{type:ci.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ce(13))})}function Nn(t){let e=Object.keys(t),r={};for(let o=0;o<e.length;o++){let a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}let i=Object.keys(r),n,s;try{vu(r)}catch(o){s=o}return function(a={},l){if(s)throw s;let c=!1,u={};for(let d=0;d<i.length;d++){let p=i[d],m=r[p],v=a[p],C=m(v,l);if(typeof C>"u"){let x=l&&l.type;throw new Error(ce(14))}u[p]=C,c=c||C!==v}return c=c||i.length!==Object.keys(a).length,c?u:a}}function wr(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,r)=>(...i)=>e(r(...i)))}function Yo(...t){return e=>(r,i)=>{let n=e(r,i),s=()=>{throw new Error(ce(15))},o={getState:n.getState,dispatch:(l,...c)=>s(l,...c)},a=t.map(l=>l(o));return s=wr(...a)(n.dispatch),{...n,dispatch:s}}}function Xo(t){return ui(t)&&"type"in t&&typeof t.type=="string"}var sa=Symbol.for("immer-nothing"),Zo=Symbol.for("immer-draftable"),fe=Symbol.for("immer-state");function Be(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Oe=Object,Qt=Oe.getPrototypeOf,hi="constructor",bi="prototype",Un="configurable",mi="enumerable",pi="writable",Or="value",qe=t=>!!t&&!!t[fe];function Te(t){return t?oa(t)||Ei(t)||!!t[Zo]||!!t[hi]?.[Zo]||Ai(t)||Dr(t):!1}var bu=Oe[bi][hi].toString(),Jo=new WeakMap;function oa(t){if(!t||!Kn(t))return!1;let e=Qt(t);if(e===null||e===Oe[bi])return!0;let r=Oe.hasOwnProperty.call(e,hi)&&e[hi];if(r===Object)return!0;if(!Jt(r))return!1;let i=Jo.get(r);return i===void 0&&(i=Function.toString.call(r),Jo.set(r,i)),i===bu}function Si(t,e,r=!0){Pr(t)===0?(r?Reflect.ownKeys(t):Oe.keys(t)).forEach(n=>{e(n,t[n],t)}):t.forEach((i,n)=>e(n,i,t))}function Pr(t){let e=t[fe];return e?e.type_:Ei(t)?1:Ai(t)?2:Dr(t)?3:0}var In=(t,e,r=Pr(t))=>r===2?t.has(e):Oe[bi].hasOwnProperty.call(t,e),Fn=(t,e,r=Pr(t))=>r===2?t.get(e):t[e],gi=(t,e,r,i=Pr(t))=>{i===2?t.set(e,r):i===3?t.add(r):t[e]=r};function Su(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var Ei=Array.isArray,Ai=t=>t instanceof Map,Dr=t=>t instanceof Set,Kn=t=>typeof t=="object",Jt=t=>typeof t=="function",Mn=t=>typeof t=="boolean";function Eu(t){let e=+t;return Number.isInteger(e)&&String(e)===t}var rt=t=>t.copy_||t.base_;var Gn=t=>t.modified_?t.copy_:t.base_;function Bn(t,e){if(Ai(t))return new Map(t);if(Dr(t))return new Set(t);if(Ei(t))return Array[bi].slice.call(t);let r=oa(t);if(e===!0||e==="class_only"&&!r){let i=Oe.getOwnPropertyDescriptors(t);delete i[fe];let n=Reflect.ownKeys(i);for(let s=0;s<n.length;s++){let o=n[s],a=i[o];a[pi]===!1&&(a[pi]=!0,a[Un]=!0),(a.get||a.set)&&(i[o]={[Un]:!0,[pi]:!0,[mi]:a[mi],[Or]:t[o]})}return Oe.create(Qt(t),i)}else{let i=Qt(t);if(i!==null&&r)return{...t};let n=Oe.create(i);return Oe.assign(n,t)}}function _i(t,e=!1){return Ci(t)||qe(t)||!Te(t)||(Pr(t)>1&&Oe.defineProperties(t,{set:di,add:di,clear:di,delete:di}),Oe.freeze(t),e&&Si(t,(r,i)=>{_i(i,!0)},!1)),t}function Au(){Be(2)}var di={[Or]:Au};function Ci(t){return t===null||!Kn(t)?!0:Oe.isFrozen(t)}var yi="MapSet",Hn="Patches",Qo="ArrayMethods",aa={};function Rt(t){let e=aa[t];return e||Be(0,t),e}var ea=t=>!!aa[t];var Tr,la=()=>Tr,_u=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:ea(yi)?Rt(yi):void 0,arrayMethodsPlugin_:ea(Qo)?Rt(Qo):void 0});function ta(t,e){e&&(t.patchPlugin_=Rt(Hn),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function Vn(t){zn(t),t.drafts_.forEach(Cu),t.drafts_=null}function zn(t){t===Tr&&(Tr=t.parent_)}var ra=t=>Tr=_u(Tr,t);function Cu(t){let e=t[fe];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function ia(t,e){e.unfinalizedDrafts_=e.drafts_.length;let r=e.drafts_[0];if(t!==void 0&&t!==r){r[fe].modified_&&(Vn(e),Be(4)),Te(t)&&(t=na(e,t));let{patchPlugin_:n}=e;n&&n.generateReplacementPatches_(r[fe].base_,t,e)}else t=na(e,r);return wu(e,t,!0),Vn(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==sa?t:void 0}function na(t,e){if(Ci(e))return e;let r=e[fe];if(!r)return xi(e,t.handledSet_,t);if(!wi(r,t))return e;if(!r.modified_)return r.base_;if(!r.finalized_){let{callbacks_:i}=r;if(i)for(;i.length>0;)i.pop()(t);da(r,t)}return r.copy_}function wu(t,e,r=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&_i(e,r)}function ca(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var wi=(t,e)=>t.scope_===e,Ou=[];function ua(t,e,r,i){let n=rt(t),s=t.type_;if(i!==void 0&&Fn(n,i,s)===e){gi(n,i,r,s);return}if(!t.draftLocations_){let a=t.draftLocations_=new Map;Si(n,(l,c)=>{if(qe(c)){let u=a.get(c)||[];u.push(l),a.set(c,u)}})}let o=t.draftLocations_.get(e)??Ou;for(let a of o)gi(n,a,r,s)}function Tu(t,e,r){t.callbacks_.push(function(n){let s=e;if(!s||!wi(s,n))return;n.mapSetPlugin_?.fixSetContents(s);let o=Gn(s);ua(t,s.draft_??s,o,r),da(s,n)})}function da(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){let{patchPlugin_:i}=e;if(i){let n=i.getPath(t);n&&i.generatePatches_(t,n,e)}ca(t)}}function Ru(t,e,r){let{scope_:i}=t;if(qe(r)){let n=r[fe];wi(n,i)&&n.callbacks_.push(function(){fi(t);let o=Gn(n);ua(t,r,o,e)})}else Te(r)&&t.callbacks_.push(function(){let s=rt(t);t.type_===3?s.has(r)&&xi(r,i.handledSet_,i):Fn(s,e,t.type_)===r&&i.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&xi(Fn(t.copy_,e,t.type_),i.handledSet_,i)})}function xi(t,e,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||qe(t)||e.has(t)||!Te(t)||Ci(t)||(e.add(t),Si(t,(i,n)=>{if(qe(n)){let s=n[fe];if(wi(s,r)){let o=Gn(s);gi(t,i,o,t.type_),ca(s)}}else Te(n)&&xi(n,e,r)})),t}function Pu(t,e){let r=Ei(t),i={type_:r?1:0,scope_:e?e.scope_:la(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},n=i,s=vi;r&&(n=[i],s=Rr);let{revoke:o,proxy:a}=Proxy.revocable(n,s);return i.draft_=a,i.revoke_=o,[a,i]}var vi={get(t,e){if(e===fe)return t;let r=t.scope_.arrayMethodsPlugin_,i=t.type_===1&&typeof e=="string";if(i&&r?.isArrayOperationMethod(e))return r.createMethodInterceptor(t,e);let n=rt(t);if(!In(n,e,t.type_))return Lu(t,n,e);let s=n[e];if(t.finalized_||!Te(s)||i&&t.operationMethod&&r?.isMutatingArrayMethod(t.operationMethod)&&Eu(e))return s;if(s===$n(t.base_,e)||Du(t,e,s)){fi(t);let o=t.type_===1?+e:e,a=Wn(t.scope_,s,t,o);return t.copy_[o]=a}return s},has(t,e){return e in rt(t)},ownKeys(t){return Reflect.ownKeys(rt(t))},set(t,e,r){let i=pa(rt(t),e);if(i?.set)return i.set.call(t.draft_,r),!0;if(!t.modified_){let n=$n(rt(t),e),s=n?.[fe];if(s&&s.base_===r)return t.copy_[e]=r,t.assigned_.delete(e),!0;if(Su(r,n)&&(r!==void 0||In(t.base_,e,t.type_)))return!0;fi(t),jn(t)}return t.copy_[e]===r&&(r!==void 0||In(t.copy_,e,t.type_))||Number.isNaN(r)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=r,t.assigned_.set(e,!0),Ru(t,e,r)),!0},deleteProperty(t,e){return fi(t),$n(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),jn(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){let r=rt(t),i=Reflect.getOwnPropertyDescriptor(r,e);return i&&{[pi]:!0,[Un]:t.type_!==1||e!=="length",[mi]:i[mi],[Or]:r[e]}},defineProperty(){Be(11)},getPrototypeOf(t){return Qt(t.base_)},setPrototypeOf(){Be(12)}},Rr={};for(let t in vi){let e=vi[t];Rr[t]=function(){let r=arguments;return r[0]=r[0][0],e.apply(this,r)}}Rr.deleteProperty=function(t,e){return Rr.set.call(this,t,e,void 0)};Rr.set=function(t,e,r){return vi.set.call(this,t[0],e,r,t[0])};function $n(t,e){let r=t[fe];return(r?rt(r):t)[e]}function Du(t,e,r){return t.type_!==1||!t.allIndicesReassigned_||!Te(r)||r[fe]?!1:t.baseRefs_.has(r)}function Lu(t,e,r){let i=pa(e,r);return i?Or in i?i[Or]:i.get?.call(t.draft_):void 0}function pa(t,e){if(!(e in t))return;let r=Qt(t);for(;r;){let i=Object.getOwnPropertyDescriptor(r,e);if(i)return i;r=Qt(r)}}function jn(t){t.modified_||(t.modified_=!0,t.parent_&&jn(t.parent_))}function fi(t){t.copy_||(t.assigned_=new Map,t.copy_=Bn(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var ku=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,r,i)=>{if(Jt(e)&&!Jt(r)){let s=r;r=e;let o=this;return function(l=s,...c){return o.produce(l,u=>r.call(this,u,...c))}}Jt(r)||Be(6),i!==void 0&&!Jt(i)&&Be(7);let n;if(Te(e)){let s=ra(this),o=Wn(s,e,void 0),a=!0;try{n=r(o),a=!1}finally{a?Vn(s):zn(s)}return ta(s,i),ia(n,s)}else if(!e||!Kn(e)){if(n=r(e),n===void 0&&(n=e),n===sa&&(n=void 0),this.autoFreeze_&&_i(n,!0),i){let s=[],o=[];Rt(Hn).generateReplacementPatches_(e,n,{patches_:s,inversePatches_:o}),i(s,o)}return n}else Be(1,e)},this.produceWithPatches=(e,r)=>{if(Jt(e))return(o,...a)=>this.produceWithPatches(o,l=>e(l,...a));let i,n;return[this.produce(e,r,(o,a)=>{i=o,n=a}),i,n]},Mn(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Mn(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Mn(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Te(t)||Be(8),qe(t)&&(t=fa(t));let e=ra(this),r=Wn(e,t,void 0);return r[fe].isManual_=!0,zn(e),r}finishDraft(t,e){let r=t&&t[fe];(!r||!r.isManual_)&&Be(9);let{scope_:i}=r;return ta(i,e),ia(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let r;for(r=e.length-1;r>=0;r--){let n=e[r];if(n.path.length===0&&n.op==="replace"){t=n.value;break}}r>-1&&(e=e.slice(r+1));let i=Rt(Hn).applyPatches_;return qe(t)?i(t,e):this.produce(t,n=>i(n,e))}};function Wn(t,e,r,i){let[n,s]=Ai(e)?Rt(yi).proxyMap_(e,r):Dr(e)?Rt(yi).proxySet_(e,r):Pu(e,r);return(r?.scope_??la()).drafts_.push(n),s.callbacks_=r?.callbacks_??[],s.key_=i,r&&i!==void 0?Tu(r,s,i):s.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(s);let{patchPlugin_:c}=l;s.modified_&&c&&c.generatePatches_(s,[],l)}),n}function fa(t){return qe(t)||Be(10,t),ha(t)}function ha(t){if(!Te(t)||Ci(t))return t;let e=t[fe],r,i=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,r=Bn(t,e.scope_.immer_.useStrictShallowCopy_),i=e.scope_.immer_.shouldUseStrictIteration()}else r=Bn(t,!0);let n=r;return Dr(r)&&(r=new Set),Si(n,(s,o)=>{gi(r,s,ha(o))},i),e&&(e.finalized_=!1),r}var Nu=globalThis.Iterator,dh=typeof Nu?.from=="function";var Iu=new ku,qn=Iu.produce;function ma(t){return({dispatch:r,getState:i})=>n=>s=>typeof s=="function"?s(r,i,t):n(s)}var ga=ma(),ya=ma;var Mu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?wr:wr.apply(null,arguments)};typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var $u=t=>t&&typeof t.match=="function";function ut(t,e){function r(...i){if(e){let n=e(...i);if(!n)throw new Error(Ye(0));return{type:t,payload:n.payload,..."meta"in n&&{meta:n.meta},..."error"in n&&{error:n.error}}}return{type:t,payload:i[0]}}return r.toString=()=>`${t}`,r.type=t,r.match=i=>Xo(i)&&i.type===t,r}var Ea=class Lr extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Lr.prototype)}static get[Symbol.species](){return Lr}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Lr(...e[0].concat(this)):new Lr(...e.concat(this))}};function xa(t){return Te(t)?qn(t,()=>{}):t}function Oi(t,e,r){return t.has(e)?t.get(e):t.set(e,r(e)).get(e)}function Uu(t){return typeof t=="boolean"}var Fu=()=>function(e){let{thunk:r=!0,immutableCheck:i=!0,serializableCheck:n=!0,actionCreatorCheck:s=!0}=e??{},o=new Ea;return r&&(Uu(r)?o.push(ga):o.push(ya(r.extraArgument))),o},Bu="RTK_autoBatch";var va=t=>e=>{setTimeout(e,t)},Hu=(t,e)=>r=>{let i=!1,n,s,o=()=>{i||(i=!0,cancelAnimationFrame(n),clearTimeout(s),r())};n=t(o),s=setTimeout(o,e)},Vu=(t={type:"raf"})=>e=>(...r)=>{let i=e(...r),n=!0,s=!1,o=!1,a=new Set,l=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?Hu(window.requestAnimationFrame,100):va(10):t.type==="callback"?t.queueNotification:va(t.timeout),c=()=>{o=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},i,{subscribe(u){let d=()=>n&&u(),p=i.subscribe(d);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return n=!u?.meta?.[Bu],s=!n,s&&(o||(o=!0,l(c))),i.dispatch(u)}finally{n=!0}}})},zu=t=>function(r){let{autoBatch:i=!0}=r??{},n=new Ea(t);return i&&n.push(Vu(typeof i=="object"?i:void 0)),n};function Aa(t){let e=Fu(),{reducer:r=void 0,middleware:i,devTools:n=!0,duplicateMiddlewareCheck:s=!0,preloadedState:o=void 0,enhancers:a=void 0}=t||{},l;if(typeof r=="function")l=r;else if(ui(r))l=Nn(r);else throw new Error(Ye(1));let c;typeof i=="function"?c=i(e):c=e();let u=wr;n&&(u=Mu({trace:!1,...typeof n=="object"&&n}));let d=Yo(...c),p=zu(d),m=typeof a=="function"?a(p):p(),v=u(...m);return kn(l,o,v)}function _a(t){let e={},r=[],i,n={addCase(s,o){let a=typeof s=="string"?s:s.type;if(!a)throw new Error(Ye(28));if(a in e)throw new Error(Ye(29));return e[a]=o,n},addAsyncThunk(s,o){return o.pending&&(e[s.pending.type]=o.pending),o.rejected&&(e[s.rejected.type]=o.rejected),o.fulfilled&&(e[s.fulfilled.type]=o.fulfilled),o.settled&&r.push({matcher:s.settled,reducer:o.settled}),n},addMatcher(s,o){return r.push({matcher:s,reducer:o}),n},addDefaultCase(s){return i=s,n}};return t(n),[e,r,i]}function ju(t){return typeof t=="function"}function Wu(t,e){let[r,i,n]=_a(e),s;if(ju(t))s=()=>xa(t());else{let a=xa(t);s=()=>a}function o(a=s(),l){let c=[r[l.type],...i.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[n]),c.reduce((u,d)=>{if(d)if(qe(u)){let p=d(u,l);return p===void 0?u:p}else{if(Te(u))return qn(u,p=>d(p,l));{let p=d(u,l);if(p===void 0){if(u===null)return u;throw new Error(Ye(9))}return p}}return u},a)}return o.getInitialState=s,o}var Ku=(t,e)=>$u(t)?t.match(e):t(e);function Gu(...t){return e=>t.some(r=>Ku(r,e))}var qu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Yu=(t=21)=>{let e="",r=t;for(;r--;)e+=qu[Math.random()*64|0];return e},Xu=["name","message","stack","code"],Yn=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},ba=class{payload;meta;_type;constructor(t,e){this.payload=t,this.meta=e}},Zu=t=>{if(typeof t=="object"&&t!==null){let e={};for(let r of Xu)typeof t[r]=="string"&&(e[r]=t[r]);return e}return{message:String(t)}},Sa="External signal was aborted",Ju=(()=>{function t(e,r,i){let n=ut(e+"/fulfilled",(l,c,u,d)=>({payload:l,meta:{...d||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),s=ut(e+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),o=ut(e+"/rejected",(l,c,u,d,p)=>({payload:d,error:(i&&i.serializeError||Zu)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:d!==void 0,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,d,p)=>{let m=i?.idGenerator?i.idGenerator(l):Yu(),v=new AbortController,C,x;function O(b){x=b,v.abort()}c&&(c.aborted?O(Sa):c.addEventListener("abort",()=>O(Sa),{once:!0}));let $=(async function(){let b;try{let E=i?.condition?.(l,{getState:d,extra:p});if(ed(E)&&(E=await E),E===!1)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};if(v.signal.aborted)throw{name:"AbortError",message:x||"Aborted"};let H=new Promise((M,te)=>{C=()=>{te({name:"AbortError",message:x||"Aborted"})},v.signal.addEventListener("abort",C,{once:!0})});u(s(m,l,i?.getPendingMeta?.({requestId:m,arg:l},{getState:d,extra:p}))),b=await Promise.race([H,Promise.resolve(r(l,{dispatch:u,getState:d,extra:p,requestId:m,signal:v.signal,abort:O,rejectWithValue:((M,te)=>new Yn(M,te)),fulfillWithValue:((M,te)=>new ba(M,te))})).then(M=>{if(M instanceof Yn)throw M;return M instanceof ba?n(M.payload,m,l,M.meta):n(M,m,l)})])}catch(E){b=E instanceof Yn?o(null,m,l,E.payload,E.meta):o(E,m,l)}finally{C&&v.signal.removeEventListener("abort",C)}return i&&!i.dispatchConditionRejection&&o.match(b)&&b.meta.condition||u(b),b})();return Object.assign($,{abort:O,requestId:m,arg:l,unwrap(){return $.then(Qu)}})}}return Object.assign(a,{pending:s,rejected:o,fulfilled:n,settled:Gu(o,n),typePrefix:e})}return t.withTypes=()=>t,t})();function Qu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function ed(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var Ca=Symbol.for("rtk-slice-createasyncthunk"),vh={[Ca]:Ju};function td(t,e){return`${t}/${e}`}function rd({creators:t}={}){let e=t?.asyncThunk?.[Ca];return function(i){let{name:n,reducerPath:s=n}=i;if(!n)throw new Error(Ye(11));typeof process<"u";let o=(typeof i.reducers=="function"?i.reducers(nd()):i.reducers)||{},a=Object.keys(o),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(b,E){let H=typeof b=="string"?b:b.type;if(!H)throw new Error(Ye(12));if(H in l.sliceCaseReducersByType)throw new Error(Ye(13));return l.sliceCaseReducersByType[H]=E,c},addMatcher(b,E){return l.sliceMatchers.push({matcher:b,reducer:E}),c},exposeAction(b,E){return l.actionCreators[b]=E,c},exposeCaseReducer(b,E){return l.sliceCaseReducersByName[b]=E,c}};a.forEach(b=>{let E=o[b],H={reducerName:b,type:td(n,b),createNotation:typeof i.reducers=="function"};od(E)?ld(H,E,c,e):sd(H,E,c)});function u(){let[b={},E=[],H=void 0]=typeof i.extraReducers=="function"?_a(i.extraReducers):[i.extraReducers],M={...b,...l.sliceCaseReducersByType};return Wu(i.initialState,te=>{for(let de in M)te.addCase(de,M[de]);for(let de of l.sliceMatchers)te.addMatcher(de.matcher,de.reducer);for(let de of E)te.addMatcher(de.matcher,de.reducer);H&&te.addDefaultCase(H)})}let d=b=>b,p=new Map,m=new WeakMap,v;function C(b,E){return v||(v=u()),v(b,E)}function x(){return v||(v=u()),v.getInitialState()}function O(b,E=!1){function H(te){let de=te[b];return typeof de>"u"&&E&&(de=Oi(m,H,x)),de}function M(te=d){return Oi(Oi(p,E,()=>new WeakMap),te,()=>{let de={};for(let[qr,Pe]of Object.entries(i.selectors??{}))de[qr]=id(Pe,te,()=>Oi(m,te,x),E);return de})}return{reducerPath:b,getSelectors:M,get selectors(){return M(H)},selectSlice:H}}let $={name:n,reducer:C,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:x,...O(s),injectInto(b,{reducerPath:E,...H}={}){let M=E??s;return b.inject({reducerPath:M,reducer:C},H),{...$,...O(M,!0)}}};return $}}function id(t,e,r,i){function n(s,...o){let a=e(s);return typeof a>"u"&&i&&(a=r()),t(a,...o)}return n.unwrapped=t,n}var wa=rd();function nd(){function t(e,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...r}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...r){return e(...r)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:r}},asyncThunk:t}}function sd({type:t,reducerName:e,createNotation:r},i,n){let s,o;if("reducer"in i){if(r&&!ad(i))throw new Error(Ye(17));s=i.reducer,o=i.prepare}else s=i;n.addCase(t,s).exposeCaseReducer(e,s).exposeAction(e,o?ut(t,o):ut(t))}function od(t){return t._reducerDefinitionType==="asyncThunk"}function ad(t){return t._reducerDefinitionType==="reducerWithPrepare"}function ld({type:t,reducerName:e},r,i,n){if(!n)throw new Error(Ye(18));let{payloadCreator:s,fulfilled:o,pending:a,rejected:l,settled:c,options:u}=r,d=n(t,s,u);i.exposeAction(e,d),o&&i.addCase(d.fulfilled,o),a&&i.addCase(d.pending,a),l&&i.addCase(d.rejected,l),c&&i.addMatcher(d.settled,c),i.exposeCaseReducer(e,{fulfilled:o||Ti,pending:a||Ti,rejected:l||Ti,settled:c||Ti})}function Ti(){}var Oa="listener",Ta="completed",Ra="cancelled",bh=`task-${Ra}`,Sh=`task-${Ta}`,Eh=`${Oa}-${Ra}`,Ah=`${Oa}-${Ta}`;var{assign:Pa}=Object;var Xn="listenerMiddleware";var cd=Pa(ut(`${Xn}/add`),{withTypes:()=>cd}),_h=ut(`${Xn}/removeAll`),ud=Pa(ut(`${Xn}/remove`),{withTypes:()=>ud});function Ye(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var dd=ii(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,i,n){this.eventBus.addEventListener(r,i,n)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,i,n){this.eventBus.removeEventListener(r,i,n)}}}),Ri=class extends dd(Object){};window.ftReduxStores||(window.ftReduxStores={});var Da=class t extends Ri{static get(e){var r;let i=typeof e=="string"?e:e.name,n=typeof e=="string"?void 0:e,s=window.ftReduxStores[i];if(li(s))return s;if(n==null)return;let o=wa({...n,reducers:(r=n.reducers)!==null&&r!==void 0?r:{}}),a=Aa({reducer:(l,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let u=Ar(o.getInitialState());for(let d of c.keeping)u[d]=(l??u)[d];return u}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...c.overwrites};return o.reducer(l,c)}});return window.ftReduxStores[n.name]=new t(o,a,n.eventBus,n.deprecatedKeys)}constructor(e,r,i,n){super(),this.reduxSlice=e,this.reduxStore=r,this.deprecatedKeys=n,this.isFtReduxStore=!0,this.commands=new ni,this.injectInto=(o,a)=>this.reduxSlice.injectInto(o,a),this.selectSlice=o=>this.reduxSlice.selectSlice(o);let s=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,a,l)=>{let c=a,u=o[c];return u?(...d)=>{let p=u(...d.map(s));return this.reduxStore.dispatch(p),p}:d=>{let p=c,m=this.getState()[p];Yt(m,d)||this.setState({[p]:s(d)})}}}),this.eventBus=i??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var Pi=class{static format(e,r,i,n,s){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(i,n,!!s)):this.getIntlDateTime(e,r,i,n,!!s)}static getMomentDateFormat(e,r,i){return i?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,i,n,s){let o=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:i?"medium":"short"}).format(o),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(o);return s?l:n?`${a} ${l}`:a}static getTimezoneAsString(){let e=i=>String(Math.floor(i)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var Di=f(S()),pd="ft-app-info",Pt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Pt.eventName="authentication-change";var kr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};kr.eventName="ui-locale-changed";var fd={session:(t,e)=>{(0,Di.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>D.dispatchEvent(new Pt(e.payload)),0))}},D=Di.FtReduxStore.get({name:pd,reducers:fd,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var La=f(S()),Li=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},em=(0,La.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...i){super(i),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(D)}dateFormatOptionsChanged(i){return i.has("metadataDescriptors")||i.has("useLongDateFormat")||i.has("useDateTimeFormat")||i.has("uiLocale")}getDateFormatter(i){var n,s;return((s=(n=this.metadataDescriptors.find(a=>a.key===i))===null||n===void 0?void 0:n.date)!==null&&s!==void 0?s:!1)?a=>Pi.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Li([(0,Zn.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),Li([(0,Zn.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),Li([Dn({store:D.name,selector:r=>{var i,n;return(n=(i=r.metadataConfiguration)===null||i===void 0?void 0:i.descriptors)!==null&&n!==void 0?n:[]}})],e.prototype,"metadataDescriptors",void 0),Li([Dn({store:D.name})],e.prototype,"uiLocale",void 0),e});var ka;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ka||(ka={}));var Na;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(Na||(Na={}));var Ia;(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"})(Ia||(Ia={}));var Ma;(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"})(Ma||(Ma={}));var $a;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})($a||($a={}));var Ua;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ua||(Ua={}));var Fa;(function(t){t.PUBLISHED="PUBLISHED",t.AI="AI"})(Fa||(Fa={}));var Ba;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(Ba||(Ba={}));var Ha;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Ha||(Ha={}));var Va;(function(t){t.METADATA_FILTER="METADATA_FILTER",t.ACCESS_RIGHTS_FILTER="ACCESS_RIGHTS_FILTER"})(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",t.DOC_DIFF="DOC_DIFF"})(za||(za={}));var ja;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(ja||(ja={}));var Wa;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(Wa||(Wa={}));var Ka;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Ka||(Ka={}));var Ga;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(Ga||(Ga={}));var qa;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(qa||(qa={}));var Ya;(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"})(Ya||(Ya={}));var Xa;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Xa||(Xa={}));var Za;(function(t){t.ASC="ASC",t.DESC="DESC"})(Za||(Za={}));var Ja;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Ja||(Ja={}));var Qa;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Qa||(Qa={}));var el;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(el||(el={}));var tl;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(tl||(tl={}));var rl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(rl||(rl={}));var il;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(il||(il={}));var nl;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(nl||(nl={}));var sl;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(sl||(sl={}));var ol;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(ol||(ol={}));var Q;(function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(Q||(Q={}));var ke;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(ke||(ke={}));var al;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(al||(al={}));var ll;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(ll||(ll={}));var cl;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(cl||(cl={}));var ul;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(ul||(ul={}));var dl;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(dl||(dl={}));var pl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(pl||(pl={}));var fl;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(fl||(fl={}));var hl;(function(t){t.CHAT="CHAT",t.COMPLETION="COMPLETION",t.RAG="RAG",t.AGENT="AGENT"})(hl||(hl={}));var ml;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(ml||(ml={}));var gl;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(gl||(gl={}));var yl;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(yl||(yl={}));var xl;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(xl||(xl={}));var vl;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(vl||(vl={}));var hd={[Q.PERSONAL_BOOK_SHARE_USER]:[Q.PERSONAL_BOOK_USER],[Q.HTML_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.PDF_EXPORT_USER]:[Q.PERSONAL_BOOK_USER],[Q.KHUB_ADMIN]:[Q.CONTENT_PUBLISHER],[Q.ADMIN]:[Q.KHUB_ADMIN,Q.USERS_ADMIN,Q.PORTAL_ADMIN,Q.BEHAVIOR_DATA_USER],[Q.GENERATIVE_AI_EXPORT_USER]:[Q.GENERATIVE_AI_USER]};function bl(t,e){return t===e||(hd[t]??[]).some(r=>bl(r,e))}function Jn(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(i=>bl(i,e))}function Sl(t,...e){return t==null?!1:e.some(r=>Jn(t,r))}var $i=f(S());var Qn=f(S());var Dt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:i}=D.getState(),n=e??i;if(r&&n&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,n,!0)}static await(e){return new Promise(r=>{let i=t.get(e);if(i)r(i);else{let n=D.subscribe(()=>{i=t.get(e),i&&(n(),r(i))})}})}};var er=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Dt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Dt.await()}};var Re=class extends er{constructor(e=!0,r){var i;super(r),this.sortObjectFields=(s,o)=>typeof o!="object"||o==null||Array.isArray(o)?o:Object.fromEntries(Object.entries(o).sort(([a],[l])=>a.localeCompare(l)));let n=this.constructor;n.commonCache=(i=n.commonCache)!==null&&i!==void 0?i:new Qn.CacheRegistry,this.cache=e?n.commonCache:new Qn.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,i)=>0|31*r+i.charCodeAt(0),0))}};var ki=class extends Re{async listMySearches(){let{session:e}=D.getState();return Jn(e,Q.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var Ni=class extends Re{async listMyBookmarks(){let e=D.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Ii=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=D.getState().session;return!!e?.sessionAuthenticated}};var Mi=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=D.getState().session;return!!e?.sessionAuthenticated}};var md="ft-user-assets",gd={setAssetCount:(t,e)=>{let{userAssetType:r,count:i}=e.payload.assetCount;t.assetCounts.allAsset[r]=i},clearAssetCount:t=>{Object.values(ke).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:i,asset:n}=e.payload;ts(t,r,[...es(t,r),n]),El(t,r,1,i),Al(t,n)},editAsset:(t,e)=>{let{assetType:r,asset:i}=e.payload;ts(t,r,es(t,r).map(n=>n.id===i.id?i:n)),Al(t,i)},removeAsset:(t,e)=>{let{assetType:r,mapId:i,assetId:n}=e.payload;ts(t,r,es(t,r).filter(s=>s.id!==n)),El(t,r,-1,i)}},_l={[ke.SEARCHES]:"savedSearches",[ke.BOOKMARKS]:"bookmarks",[ke.BOOKS]:void 0,[ke.COLLECTIONS]:void 0},es=(t,e)=>{var r;let i=_l[e];return i?(r=t[i])!==null&&r!==void 0?r:[]:[]},ts=(t,e,r)=>{let i=_l[e];i&&(t[i]=r)},El=(t,e,r,i)=>{let n=t.assetCounts.allAsset[e];if(n!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,n+r),e===ke.BOOKMARKS&&i)){let s=t.assetCounts.bookmarkByMap[i];t.assetCounts.bookmarkByMap[i]=Math.max(0,s+r)}},Al=(t,e)=>{let r=t.assetLabels.map(n=>n.title),i=e.labels.filter(n=>!r.includes(n)).map(n=>({title:n}));t.assetLabels.push(...i)},me=$i.FtReduxStore.get({name:md,reducers:gd,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(ke).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),rs=class{constructor(e=new Ii,r=new Mi){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=D.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ni,this.savedSearchesService=new ki,D.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=D.getState();(0,$i.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),me.actions.clearAssetCount(),me.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),me.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),me.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();me.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();me.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&me.getState().assetCounts.allAsset[e]!==r.count&&me.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&me.getState().assetCounts.bookmarkByMap[e]!==r.count&&me.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(me.getState().assetCounts.bookmarkByMap).length!==0;e===ke.BOOKMARKS&&r&&me.actions.clearBookmarkCountByMap(),me.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;me.actions.bookmarks(r)}}},yd=new rs;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=yd);var is=class{addCommand(e,r=!1){D.commands.add(e,r)}consumeCommand(e){return D.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new is;var Ne=f(S());var Cl,tr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},xd=Symbol("clearAfterUnitTest"),Ui=class extends(0,Ne.withEventBus)(Re){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Cl]=()=>{this.defaultMessages={},this.cache=new Ne.CacheRegistry,this.listeners={}},this.currentUiLocale=D.getState().uiLocale,D.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=D.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var i;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let n={...(i=this.defaultMessages[e])!==null&&i!==void 0?i:{},...r};(0,Ne.deepEqual)(this.defaultMessages[e],n)||(this.defaultMessages[e]=n,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,i;return this.fetchContext(e),(i=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&i!==void 0?i:{}}resolveRawMessage(e,r){let i=e.toLowerCase();return this.resolveContext(i)[r]}resolveMessage(e,r,...i){var n;let s=e.toLowerCase(),o=this.resolveContext(s);return new Ne.ParametrizedLabelResolver((n=this.defaultMessages[s])!==null&&n!==void 0?n:{},o).resolve(r,...i)}async fetchContext(e){let r=!this.cache.has(e),i;try{i=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(n){!(n instanceof Ne.CanceledPromiseError)&&r&&console.error(n)}return i}subscribe(e,r){var i;return e=e.toLowerCase(),this.listeners[e]=(i=this.listeners[e])!==null&&i!==void 0?i:new Set,this.listeners[e].add(r),()=>{var n;return(n=this.listeners[e])===null||n===void 0?void 0:n.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new tr({loadedContexts:e})),this.dispatchEvent(new tr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new tr({loadedContexts:[e]})),this.dispatchEvent(new tr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(i=>(0,Ne.delay)(0).then(()=>i()).catch(()=>null)))}};Cl=xd;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Ui{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Ui{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var rr=window.FluidTopicsI18nService,Fi=window.FluidTopicsCustomI18nService;var wl=f(S()),ns=class{highlightHtml(e,r,i){(0,wl.highlightHtml)(e,r,i)}};window.FluidTopicsHighlightHtmlService=new ns;var Ol=f(S());var ss=class{isDate(e){var r,i,n,s;return(s=(i=((n=(r=D.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===e))===null||i===void 0?void 0:i.date)!==null&&s!==void 0?s:!1}format(e,r){var i,n,s,o;if(e==null)return"";try{return Ol.DateFormatter.format(e,(i=r?.locale)!==null&&i!==void 0?i:D.getState().uiLocale,(n=r?.longFormat)!==null&&n!==void 0?n:!1,(s=r?.withTime)!==null&&s!==void 0?s:!1,(o=r?.onlyTime)!==null&&o!==void 0?o:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new ss;var Tl=f(S());var Nr=class{static get(e,r,{baseUrl:i,localesConfiguration:n,availableContentLocales:s}=D.getState()){var o;if(r==="all"&&n?.allLanguagesAllowed)r=void 0;else if(!r||s.length>0&&!s.some(a=>a.lang===r)){let a=n?.defaultLocales.defaultContentLocale;r=a?`${a.lang}-${a.region}`:(o=s[0])===null||o===void 0?void 0:o.lang}return new Tl.SearchPlaceConverter(i,e??20,n?.allLanguagesAllowed,r,s)}};var os=class{urlToSearchRequest(e){return Nr.get().parse(e)}searchRequestToUrl(e){return Nr.get().serialize(e)}};window.FluidTopicsUrlService=new os;var it=f(S());var Lt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{nextLocation:e}})}};Lt.eventName="before-location-change";var kt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};kt.eventName="change";var as=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Rl=new as;var Bi=class t extends it.WithEventBus{static build(){return new t(window.history,Rl,()=>window.location,!1)}constructor(e,r,i,n){var s,o;super(),this.history=e,this.historyStorage=r,this.windowLocation=i,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(o=(s=e.state)===null||s===void 0?void 0:s.index)!==null&&o!==void 0?o:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(n)}setCurrentState(e,r=!1){let i=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,i&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,it.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new kt(this.currentItem())),0)}installProxies(){let e=r=>(i,n,[s,o,a])=>{let l=new URL(typeof a=="string"?a:(a??this.windowLocation()).href,window.location.origin!=="null"?window.location.origin:void 0),c=new Lt(l);this.dispatchEvent(c);let u=r(),d={...u===this.currentIndex?this.currentState:void 0,...s,index:u,href:c.detail.nextLocation.href};i.apply(n,[d,o,d.href]),this.setCurrentState(d,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let i={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(i)}addBeforeLocationChangeListener(e){this.addEventListener(Lt.eventName,e)}removeBeforeLocationChangeListener(e){this.removeEventListener(Lt.eventName,e)}addHistoryChangeListener(e){this.addEventListener(kt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(kt.eventName,e)}currentItem(){return(0,it.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,it.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(i=>!!i).filter(i=>i.index<this.currentIndex).reverse();return(0,it.deepCopy)(r.find(i=>e(i)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,it.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let i=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!i)return e;let n=e,s=e+1;for(;this.states.length>s&&!this.isDifferentMajorState(s,i);)this.hasState(s)&&(n=s),s++;return n}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var i;if(!this.hasState(e))return!1;let n=r??this.currentState.majorStateId,s=(i=this.states[e])===null||i===void 0?void 0:i.majorStateId;return s==null||s!=n}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=Bi.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t),addBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(t),removeBeforeLocationChangeListener:t=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(t)});var Pl=f(F());var Dl=Pl.css`
|
|
627
627
|
`;var Nl=f(F()),ge=f(Y()),It=f(S());var Xe=f(S());function Ll(t,e){let{authenticationRequired:r,session:i}=D.getState();return r&&!i?.sessionAuthenticated?Promise.resolve(e):t()}var Hi=class extends er{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var ls=class t extends Xe.FtStateManager{static build(e){return new t(D,e)}constructor(e,r){super(),this.store=e,this.cache=new Xe.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Hi,this.knownContexts=new Xe.AbstractRegistry,this.knownCustomComponents=new Xe.AbstractRegistry,this.cleanSessionDebouncer=new Xe.Debouncer,this.reloadConfiguration=()=>{var i;(i=this.cache)===null||i===void 0||i.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new Xe.Debouncer(500),this.apiProvider=r??(()=>Dt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}addListeners(){this.store.addEventListener(Pt.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(Pt.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Ll(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}setStickyFilters(e){this.store.actions.stickyFilters(e)}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(i=>{i.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new kr(i)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setNoCustomCode(e){this.store.actions.noCustomCode(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}userHasAnyRole(...e){return Sl(D.getState().session,...e)}},kl=ls.build();var Nt=class extends Event{constructor(e,r,i,n){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=i,this.subscribe=n??!1}};var Ir=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:i}=r;for(let{elementRef:n,callbackRef:s}of i){let o=n.deref(),a=s.deref();o===void 0||a===void 0||o.dispatchEvent(new Nt(e.context,o,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],i=e.callback,n=this.pendingContextRequests.get(e.context);n===void 0&&this.pendingContextRequests.set(e.context,n={callbacks:new WeakMap,requests:[]});let s=n.callbacks.get(r);s===void 0&&n.callbacks.set(r,s=new WeakSet),s.has(i)||(s.add(i),n.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(i)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var ne=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},K=class extends It.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=kl,this.contextRoot=new Ir}render(){return Nl.html`
|
|
628
628
|
<slot></slot>
|
|
629
629
|
`}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(i=>rr.addContext(i)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};K.elementDefinitions={};K.styles=Dl;ne([(0,ge.property)()],K.prototype,"baseUrl",void 0);ne([(0,ge.property)()],K.prototype,"tenantId",void 0);ne([(0,ge.property)()],K.prototype,"apiIntegrationIdentifier",void 0);ne([(0,ge.property)()],K.prototype,"apiIntegrationAppVersion",void 0);ne([(0,ge.property)()],K.prototype,"uiLocale",void 0);ne([(0,It.jsonProperty)(null)],K.prototype,"availableUiLocales",void 0);ne([(0,It.jsonProperty)(null)],K.prototype,"metadataConfiguration",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"editorMode",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"noCustom",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"openExternalDocumentInNewTab",void 0);ne([(0,ge.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomComponent",void 0);ne([(0,ge.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],K.prototype,"noCustomCode",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"withManualResources",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"navigatorOnline",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"forcedOffline",void 0);ne([(0,ge.property)({type:Boolean})],K.prototype,"authenticationRequired",void 0);ne([(0,It.jsonProperty)([])],K.prototype,"messageContexts",void 0);ne([(0,It.jsonProperty)(void 0)],K.prototype,"session",void 0);var Ml=f(S());var Il={"ft-app-context":K};(0,Ml.customElements)(Il);var Vi=class t{static build(e){return new t(e)}static buildCustom(e){return new t(e,!0)}static fromGwt(e){return new t(e)}get service(){return this.custom?Fi:rr}constructor(e,r=!1){this.name=e,this.custom=r,this.properties=new Proxy({},{get:(i,n)=>{let s=n;return o=>({context:this.name,key:s,custom:this.custom,args:typeof o=="function"?void 0:o,argsProvider:typeof o=="function"?o:void 0})}}),this.messages=new Proxy({},{get:(i,n)=>(...s)=>this.service.resolveMessage(this.name,n,...s)}),this.rawMessages=new Proxy({},{get:(i,n)=>this.service.resolveRawMessage(this.name,n)}),this.keys=new Proxy({},{get:(i,n)=>()=>n}),this.attributes=new Proxy({},{get:(i,n)=>()=>({context:this.name,key:n,message:this.service.resolveRawMessage(this.name,n)})})}};var nr=f(S());var $l=f(Y());var cs=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[r,i]=e.split(".");return{context:r,key:i,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},ir=new cs;var Sd=function(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(e,r,s):o(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s},$r=Symbol("i18nAttributes"),Ul=Symbol("i18nListAttributes"),Fl=Symbol("i18nProperties"),zi=Symbol("i18nContexts"),Mr=Symbol("i18nUnsubs"),Ki=(0,nr.applyMixinOnce)(Symbol("withI18n"),function(t){var e,r;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(s){return s??this.useCustomMessageContexts?Fi:rr}i18n(s){let{context:o,key:a,message:l}=s,{custom:c,args:u,argsProvider:d}=s;if(o&&a){this.hasI18nContext(o)||this.addI18nContext(o,void 0,c);let p=u??(d?d(this):[]);return this.getI18nService(c).resolveMessage(o,a,...p)}return l}async awaitI18n(s){let{context:o,custom:a}=s;return o&&await this.getI18nService(a).prepareContext(o),this.i18n(s)}customI18n(s,o){if(ir.isI18nKey(s)){let[a,l]=s.split(".");return this.i18n({custom:!0,context:a,key:l,...o})||s}return s}firstUpdated(s){super.firstUpdated(s),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(s){super.update(s),this.updateI18nAttributes((o,a,l)=>s.has(a)||typeof o.argsProvider=="function"),this.updateI18nProperties(o=>typeof o.argsProvider=="function")}onI18nUpdate(s){this.updateI18nAttributes((o,a,l)=>{var c;return((c=l?.context)===null||c===void 0?void 0:c.toLowerCase())===s}),this.updateI18nProperties(o=>o.context.toLowerCase()===s),this.requestUpdate()}updateI18nAttributes(s){var o,a;let l=this,c=(u,d,p)=>p?.context&&p.key&&s(u,d,p)?{...p,message:this.i18n({context:p.context,key:p.key,custom:p.custom,...u})}:p;(o=this[$r])===null||o===void 0||o.forEach((u,d)=>l[d]=c(u,d,l[d])),(a=this[Ul])===null||a===void 0||a.forEach((u,d)=>{var p;return l[d]=(p=l[d])===null||p===void 0?void 0:p.map(m=>c(u,d,m))})}updateI18nProperties(s){var o;(o=this[Fl])===null||o===void 0||o.forEach((a,l)=>{s(a,l)&&(this[l]=this.i18n(a))})}addI18nMessages(s,o,a){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(s,o,a)}addI18nContext(s,o,a){let l=(typeof s=="string"?s:s.name).toLowerCase();a=typeof s=="string"?a:s.custom,this[zi].set(l,{isCustomContext:a}),this[Mr].has(l)||this[Mr].set(l,this.getI18nService(a).subscribe(l,()=>this.onI18nUpdate(l))),this.getI18nService(a).prepareContext(l,o)}hasI18nContext(s){return this[zi].has(s.toLowerCase())}connectedCallback(){super.connectedCallback(),this[zi].forEach((s,o)=>this.addI18nContext(o,void 0,s.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Mr].forEach(s=>s()),this[Mr].clear()}}return e=zi,r=Mr,Sd([(0,$l.property)({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}),ji=class extends Ki(nr.FtLitElement){},Wi=class extends Ki(nr.FtLitElementRedux){};var Bl=f(F());var Hl=Bl.css`
|