@fluid-topics/ft-app-context 2.0.9 → 2.0.11

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.
@@ -1,5 +1,5 @@
1
- "use strict";(()=>{var yt=Object.create;var oe=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var mt=Object.getOwnPropertyNames;var Et=Object.getPrototypeOf,Tt=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var gt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of mt(t))!Tt.call(e,a)&&a!==s&&oe(e,a,{get:()=>t[a],enumerable:!(n=At(t,a))||n.enumerable});return e};var _=(e,t,s)=>(s=e!=null?yt(Et(e)):{},gt(t||!e||!e.__esModule?oe(s,"default",{value:e,enumerable:!0}):s,e));var R=B((Rt,ue)=>{ue.exports=ftGlobals.wcUtils});var X=B((bt,ce)=>{ce.exports=ftGlobals.lit});var pe=B((Ot,de)=>{de.exports=ftGlobals.litDecorators});var Te=B((x,Ee)=>{var V=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,q=function(){function e(){this.fetch=!1,this.DOMException=V.DOMException}return e.prototype=V,new e}();(function(e){var t=function(s){var n=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function l(r){return r&&DataView.prototype.isPrototypeOf(r)}if(a.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(r){return r&&d.indexOf(Object.prototype.toString.call(r))>-1};function S(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function b(r){return typeof r!="string"&&(r=String(r)),r}function Y(r){var i={next:function(){var u=r.shift();return{done:u===void 0,value:u}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function A(r){this.map={},r instanceof A?r.forEach(function(i,u){this.append(u,i)},this):Array.isArray(r)?r.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(i){this.append(i,r[i])},this)}A.prototype.append=function(r,i){r=S(r),i=b(i);var u=this.map[r];this.map[r]=u?u+", "+i:i},A.prototype.delete=function(r){delete this.map[S(r)]},A.prototype.get=function(r){return r=S(r),this.has(r)?this.map[r]:null},A.prototype.has=function(r){return this.map.hasOwnProperty(S(r))},A.prototype.set=function(r,i){this.map[S(r)]=b(i)},A.prototype.forEach=function(r,i){for(var u in this.map)this.map.hasOwnProperty(u)&&r.call(i,this.map[u],u,this)},A.prototype.keys=function(){var r=[];return this.forEach(function(i,u){r.push(u)}),Y(r)},A.prototype.values=function(){var r=[];return this.forEach(function(i){r.push(i)}),Y(r)},A.prototype.entries=function(){var r=[];return this.forEach(function(i,u){r.push([u,i])}),Y(r)},a.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function z(r){if(!r._noBody){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}}function ne(r){return new Promise(function(i,u){r.onload=function(){i(r.result)},r.onerror=function(){u(r.error)}})}function lt(r){var i=new FileReader,u=ne(i);return i.readAsArrayBuffer(r),u}function ot(r){var i=new FileReader,u=ne(i),p=/charset=([A-Za-z0-9_-]+)/.exec(r.type),f=p?p[1]:"utf-8";return i.readAsText(r,f),u}function ut(r){for(var i=new Uint8Array(r),u=new Array(i.length),p=0;p<i.length;p++)u[p]=String.fromCharCode(i[p]);return u.join("")}function ie(r){if(r.slice)return r.slice(0);var i=new Uint8Array(r.byteLength);return i.set(new Uint8Array(r)),i.buffer}function ae(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:a.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:a.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():a.arrayBuffer&&a.blob&&l(r)?(this._bodyArrayBuffer=ie(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||y(r))?this._bodyArrayBuffer=ie(r):this._bodyText=r=Object.prototype.toString.call(r):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var r=z(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=z(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(lt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var r=z(this);if(r)return r;if(this._bodyBlob)return ot(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ut(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(pt)}),this.json=function(){return this.text().then(JSON.parse)},this}var ct=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function dt(r){var i=r.toUpperCase();return ct.indexOf(i)>-1?i:r}function O(r,i){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var u=i.body;if(r instanceof O){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,i.headers||(this.headers=new A(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!u&&r._bodyInit!=null&&(u=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new A(i.headers)),this.method=dt(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in n){var c=new AbortController;return c.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&u)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(u),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var p=/([?&])_=[^&]*/;if(p.test(this.url))this.url=this.url.replace(p,"$1_="+new Date().getTime());else{var f=/\?/;this.url+=(f.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}O.prototype.clone=function(){return new O(this,{body:this._bodyInit})};function pt(r){var i=new FormData;return r.trim().split("&").forEach(function(u){if(u){var p=u.split("="),f=p.shift().replace(/\+/g," "),c=p.join("=").replace(/\+/g," ");i.append(decodeURIComponent(f),decodeURIComponent(c))}}),i}function ht(r){var i=new A,u=r.replace(/\r?\n[\t ]+/g," ");return u.split("\r").map(function(p){return p.indexOf(`
2
- `)===0?p.substr(1,p.length):p}).forEach(function(p){var f=p.split(":"),c=f.shift().trim();if(c){var H=f.join(":").trim();try{i.append(c,H)}catch(Q){console.warn("Response "+Q.message)}}}),i}ae.call(O.prototype);function C(r,i){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new A(i.headers),this.url=i.url||"",this._initBody(r)}ae.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},C.error=function(){var r=new C(null,{status:200,statusText:""});return r.ok=!1,r.status=0,r.type="error",r};var ft=[301,302,303,307,308];C.redirect=function(r,i){if(ft.indexOf(i)===-1)throw new RangeError("Invalid status code");return new C(null,{status:i,headers:{location:r}})},s.DOMException=n.DOMException;try{new s.DOMException}catch{s.DOMException=function(i,u){this.message=i,this.name=u;var p=Error(i);this.stack=p.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function W(r,i){return new Promise(function(u,p){var f=new O(r,i);if(f.signal&&f.signal.aborted)return p(new s.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function H(){c.abort()}c.onload=function(){var T={statusText:c.statusText,headers:ht(c.getAllResponseHeaders()||"")};f.url.indexOf("file://")===0&&(c.status<200||c.status>599)?T.status=200:T.status=c.status,T.url="responseURL"in c?c.responseURL:T.headers.get("X-Request-URL");var D="response"in c?c.response:c.responseText;setTimeout(function(){u(new C(D,T))},0)},c.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){p(new s.DOMException("Aborted","AbortError"))},0)};function Q(T){try{return T===""&&n.location.href?n.location.href:T}catch{return T}}if(c.open(f.method,Q(f.url),!0),f.credentials==="include"?c.withCredentials=!0:f.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(a.blob?c.responseType="blob":a.arrayBuffer&&(c.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof A||n.Headers&&i.headers instanceof n.Headers)){var le=[];Object.getOwnPropertyNames(i.headers).forEach(function(T){le.push(S(T)),c.setRequestHeader(T,b(i.headers[T]))}),f.headers.forEach(function(T,D){le.indexOf(D)===-1&&c.setRequestHeader(D,T)})}else f.headers.forEach(function(T,D){c.setRequestHeader(D,T)});f.signal&&(f.signal.addEventListener("abort",H),c.onreadystatechange=function(){c.readyState===4&&f.signal.removeEventListener("abort",H)}),c.send(typeof f._bodyInit>"u"?null:f._bodyInit)})}return W.polyfill=!0,n.fetch||(n.fetch=W,n.Headers=A,n.Request=O,n.Response=C),s.Headers=A,s.Request=O,s.Response=C,s.fetch=W,s}({})})(q);q.fetch.ponyfill=!0;delete q.fetch.polyfill;var F=V.fetch?V:q;x=F.fetch;x.default=F.fetch;x.fetch=F.fetch;x.Headers=F.Headers;x.Request=F.Request;x.Response=F.Response;Ee.exports=x});var at=_(R());var it=_(X()),g=_(pe()),I=_(R());var he=_(X());var fe=he.css`
3
- `;var j=_(R()),St="ft-app-info",U=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};U.eventName="authentication-change";var _t={session:(e,t)=>{(0,j.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>o.dispatchEvent(new U(t.payload)),0))}},o=j.FtReduxStore.get({name:St,reducers:_t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var J=_(R());var w=class e{static get(t){let{baseUrl:s,apiIntegrationIdentifier:n}=o.getState(),a=t??n;if(s&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(s,a,!0)}static await(t){return new Promise(s=>{let n=e.get(t);if(n)s(n);else{let a=o.subscribe(()=>{n=e.get(t),n&&(a(),s(n))})}})}};var K=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:w.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):w.await()}};var P=class extends K{constructor(t=!0,s){var n;super(s),this.sortObjectFields=(l,d)=>typeof d!="object"||d==null||Array.isArray(d)?d:Object.fromEntries(Object.entries(d).sort(([y],[S])=>y.localeCompare(S)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new J.CacheRegistry,this.cache=t?a.commonCache:new J.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((s,n)=>0|31*s+n.charCodeAt(0),0))}};var Z=class{addCommand(t,s=!1){o.commands.add(t,s)}consumeCommand(t){return o.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Z;var v=_(R());var ye,M=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},vt=Symbol("clearAfterUnitTest"),G=class extends(0,v.withEventBus)(P){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ye]=()=>{this.defaultMessages={},this.cache=new v.CacheRegistry,this.listeners={}},this.currentUiLocale=o.getState().uiLocale,o.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=o.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let s=t.name.toLowerCase();this.cache.setFinal(s,t),this.notify(s)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var n;if(t=t.toLowerCase(),s&&Object.keys(s).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...s};(0,v.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var s,n;return this.fetchContext(t),(n=(s=this.cache.getNow(t))===null||s===void 0?void 0:s.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,s){let n=t.toLowerCase();return this.resolveContext(n)[s]}resolveMessage(t,s,...n){var a;let l=t.toLowerCase(),d=this.resolveContext(l);return new v.ParametrizedLabelResolver((a=this.defaultMessages[l])!==null&&a!==void 0?a:{},d).resolve(s,...n)}async fetchContext(t){let s=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),s&&await this.notify(t)}catch(a){!(a instanceof v.CanceledPromiseError)&&s&&console.error(a)}return n}subscribe(t,s){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(s),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(s)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new M({loadedContexts:t})),this.dispatchEvent(new M({loadedContexts:t})),await Promise.all(t.map(s=>this.notify(s,!1)))}async notify(t,s=!0){s&&(document.body.dispatchEvent(new M({loadedContexts:[t]})),this.dispatchEvent(new M({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,v.delay)(0).then(()=>n()).catch(()=>null)))}};ye=vt;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Ae=window.FluidTopicsI18nService,Vt=window.FluidTopicsCustomI18nService;var me=_(R()),ee=class{highlightHtml(t,s,n){(0,me.highlightHtml)(t,s,n)}};window.FluidTopicsHighlightHtmlService=new ee;var Ct=_(Te(),1);var ge;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(ge||(ge={}));var Se;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Se||(Se={}));var _e;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(_e||(_e={}));var ve;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ve||(ve={}));var Ce;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ce||(Ce={}));var Ie;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Ie||(Ie={}));var Re;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",e.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__DISPLAY="TOPIC__DISPLAY",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(Re||(Re={}));var be;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(be||(be={}));var Oe;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(Oe||(Oe={}));var xe;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(xe||(xe={}));var Le;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Le||(Le={}));var De;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(De||(De={}));var Ue;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ue||(Ue={}));var we;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(we||(we={}));var Pe;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Pe||(Pe={}));var Ne;(function(e){e.ASC="ASC",e.DESC="DESC"})(Ne||(Ne={}));var Me;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Me||(Me={}));var Fe;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Fe||(Fe={}));var ke;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ke||(ke={}));var He;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(He||(He={}));var Be;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Be||(Be={}));var je;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(je||(je={}));var Ke;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ke||(Ke={}));var Ge;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ge||(Ge={}));var Ve;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ve||(Ve={}));var m;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(m||(m={}));var qe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(qe||(qe={}));var $e;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})($e||($e={}));var Ye;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Ye||(Ye={}));var ze;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.OTHER="OTHER"})(ze||(ze={}));var We;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(We||(We={}));var Qe;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Qe||(Qe={}));var Xe;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(Xe||(Xe={}));var Je;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Je||(Je={}));var Ze;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Ze||(Ze={}));var et;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(et||(et={}));var rr={[m.PERSONAL_BOOK_SHARE_USER]:[m.PERSONAL_BOOK_USER],[m.HTML_EXPORT_USER]:[m.PERSONAL_BOOK_USER],[m.PDF_EXPORT_USER]:[m.PERSONAL_BOOK_USER],[m.KHUB_ADMIN]:[m.CONTENT_PUBLISHER],[m.ADMIN]:[m.KHUB_ADMIN,m.USERS_ADMIN,m.PORTAL_ADMIN,m.BEHAVIOR_DATA_USER],[m.GENERATIVE_AI_EXPORT_USER]:[m.GENERATIVE_AI_USER]};var tt=_(R());var te=class{isDate(t){var s,n,a,l;return(l=(a=((n=(s=o.getState().metadataConfiguration)===null||s===void 0?void 0:s.descriptors)!==null&&n!==void 0?n:[]).find(y=>y.key===t))===null||a===void 0?void 0:a.date)!==null&&l!==void 0?l:!1}format(t,s){var n,a,l;if(t==null)return"";try{return tt.DateFormatter.format(t,(n=s?.locale)!==null&&n!==void 0?n:o.getState().uiLocale,(a=s?.longFormat)!==null&&a!==void 0?a:!1,(l=s?.withTime)!==null&&l!==void 0?l:!1)}catch(d){throw console.error(`Date ${JSON.stringify(t)} is not valid`,d),d}}};window.FluidTopicsDateService=new te;var rt=_(R());var k=class{static get(t,s){var n,a;let l=o.getState(),{lang:d,region:y}=(a=(n=l.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new rt.SearchPlaceConverter(l.baseUrl,t??20,l.searchInAllLanguagesAllowed,s??`${d}-${y}`)}};var re=class{urlToSearchRequest(t){return k.get().parse(t)}searchRequestToUrl(t){return k.get().serialize(t)}};window.FluidTopicsUrlService=new re;var L=_(R());var N=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};N.eventName="change";var se=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let s=sessionStorage.getItem(this.itemName(t));return s?JSON.parse(s):void 0}set(t,s){sessionStorage.setItem(this.itemName(t),JSON.stringify(s))}},st=new se;var $=class e extends L.WithEventBus{static build(){return new e(window.history,st,()=>window.location,!1)}constructor(t,s,n,a){var l,d;super(),this.history=t,this.historyStorage=s,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(d=(l=t.state)===null||l===void 0?void 0:l.index)!==null&&d!==void 0?d:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,s=!1){let n=s&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,L.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new N(this.currentItem())),0)}installProxies(){let t=s=>(n,a,[l,d,y])=>{let S=s(),b={...S===this.currentIndex?this.currentState:void 0,...l,index:S,href:typeof y=="string"?y:(y??this.windowLocation()).href};n.apply(a,[b,d,y]),this.setCurrentState(b,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.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(t){for(let s=this.history.length-1;s>=0;s--)t?this.states[s]=this.historyStorage.get(s):setTimeout(()=>this.states[s]=this.historyStorage.get(s),this.history.length-s)}updateCurrentState(t){var s;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(s=t?.title)!==null&&s!==void 0?s:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(N.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(N.eventName,t)}currentItem(){return(0,L.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,L.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,L.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var s;let n=(s=this.states[t])===null||s===void 0?void 0:s.majorStateId;if(!n)return t;let a=t,l=t+1;for(;this.states.length>l&&!this.isDifferentMajorState(l,n);)this.hasState(l)&&(a=l),l++;return a}buildCurrentState(){var t,s;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(s=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&s!==void 0?s:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,s){var n;if(!this.hasState(t))return!1;let a=s??this.currentState.majorStateId,l=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return l==null||l!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});function nt(e,t){let{authenticationRequired:s,session:n}=o.getState();return s&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var E=function(e,t,s,n){var a=arguments.length,l=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,s):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,s,n);else for(var y=e.length-1;y>=0;y--)(d=e[y])&&(l=(a<3?d(l):a>3?d(t,s,l):d(t,s))||l);return a>3&&l&&Object.defineProperty(t,s,l),l},h=class extends I.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>w.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new I.CacheRegistry,this.cleanSessionDebouncer=new I.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return it.html`
1
+ "use strict";(()=>{var yt=Object.create;var oe=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Et=Object.getOwnPropertyNames;var mt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Tt=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Et(t))!gt.call(e,a)&&a!==s&&oe(e,a,{get:()=>t[a],enumerable:!(n=At(t,a))||n.enumerable});return e};var _=(e,t,s)=>(s=e!=null?yt(mt(e)):{},Tt(t||!e||!e.__esModule?oe(s,"default",{value:e,enumerable:!0}):s,e));var b=B((bt,ue)=>{ue.exports=ftGlobals.wcUtils});var X=B((Ot,ce)=>{ce.exports=ftGlobals.lit});var pe=B((It,de)=>{de.exports=ftGlobals.litDecorators});var ge=B((x,me)=>{var V=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,q=function(){function e(){this.fetch=!1,this.DOMException=V.DOMException}return e.prototype=V,new e}();(function(e){var t=function(s){var n=typeof e<"u"&&e||typeof self<"u"&&self||typeof global<"u"&&global||{},a={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};function l(r){return r&&DataView.prototype.isPrototypeOf(r)}if(a.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(r){return r&&d.indexOf(Object.prototype.toString.call(r))>-1};function S(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function O(r){return typeof r!="string"&&(r=String(r)),r}function z(r){var i={next:function(){var u=r.shift();return{done:u===void 0,value:u}}};return a.iterable&&(i[Symbol.iterator]=function(){return i}),i}function A(r){this.map={},r instanceof A?r.forEach(function(i,u){this.append(u,i)},this):Array.isArray(r)?r.forEach(function(i){if(i.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+i.length);this.append(i[0],i[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(i){this.append(i,r[i])},this)}A.prototype.append=function(r,i){r=S(r),i=O(i);var u=this.map[r];this.map[r]=u?u+", "+i:i},A.prototype.delete=function(r){delete this.map[S(r)]},A.prototype.get=function(r){return r=S(r),this.has(r)?this.map[r]:null},A.prototype.has=function(r){return this.map.hasOwnProperty(S(r))},A.prototype.set=function(r,i){this.map[S(r)]=O(i)},A.prototype.forEach=function(r,i){for(var u in this.map)this.map.hasOwnProperty(u)&&r.call(i,this.map[u],u,this)},A.prototype.keys=function(){var r=[];return this.forEach(function(i,u){r.push(u)}),z(r)},A.prototype.values=function(){var r=[];return this.forEach(function(i){r.push(i)}),z(r)},A.prototype.entries=function(){var r=[];return this.forEach(function(i,u){r.push([u,i])}),z(r)},a.iterable&&(A.prototype[Symbol.iterator]=A.prototype.entries);function W(r){if(!r._noBody){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}}function ne(r){return new Promise(function(i,u){r.onload=function(){i(r.result)},r.onerror=function(){u(r.error)}})}function lt(r){var i=new FileReader,u=ne(i);return i.readAsArrayBuffer(r),u}function ot(r){var i=new FileReader,u=ne(i),p=/charset=([A-Za-z0-9_-]+)/.exec(r.type),f=p?p[1]:"utf-8";return i.readAsText(r,f),u}function ut(r){for(var i=new Uint8Array(r),u=new Array(i.length),p=0;p<i.length;p++)u[p]=String.fromCharCode(i[p]);return u.join("")}function ie(r){if(r.slice)return r.slice(0);var i=new Uint8Array(r.byteLength);return i.set(new Uint8Array(r)),i.buffer}function ae(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:a.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:a.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():a.arrayBuffer&&a.blob&&l(r)?(this._bodyArrayBuffer=ie(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||y(r))?this._bodyArrayBuffer=ie(r):this._bodyText=r=Object.prototype.toString.call(r):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var r=W(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=W(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(a.blob)return this.blob().then(lt);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var r=W(this);if(r)return r;if(this._bodyBlob)return ot(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ut(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(pt)}),this.json=function(){return this.text().then(JSON.parse)},this}var ct=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function dt(r){var i=r.toUpperCase();return ct.indexOf(i)>-1?i:r}function I(r,i){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');i=i||{};var u=i.body;if(r instanceof I){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,i.headers||(this.headers=new A(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!u&&r._bodyInit!=null&&(u=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=i.credentials||this.credentials||"same-origin",(i.headers||!this.headers)&&(this.headers=new A(i.headers)),this.method=dt(i.method||this.method||"GET"),this.mode=i.mode||this.mode||null,this.signal=i.signal||this.signal||function(){if("AbortController"in n){var c=new AbortController;return c.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&u)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(u),(this.method==="GET"||this.method==="HEAD")&&(i.cache==="no-store"||i.cache==="no-cache")){var p=/([?&])_=[^&]*/;if(p.test(this.url))this.url=this.url.replace(p,"$1_="+new Date().getTime());else{var f=/\?/;this.url+=(f.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})};function pt(r){var i=new FormData;return r.trim().split("&").forEach(function(u){if(u){var p=u.split("="),f=p.shift().replace(/\+/g," "),c=p.join("=").replace(/\+/g," ");i.append(decodeURIComponent(f),decodeURIComponent(c))}}),i}function ht(r){var i=new A,u=r.replace(/\r?\n[\t ]+/g," ");return u.split("\r").map(function(p){return p.indexOf(`
2
+ `)===0?p.substr(1,p.length):p}).forEach(function(p){var f=p.split(":"),c=f.shift().trim();if(c){var H=f.join(":").trim();try{i.append(c,H)}catch(Q){console.warn("Response "+Q.message)}}}),i}ae.call(I.prototype);function C(r,i){if(!(this instanceof C))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(i||(i={}),this.type="default",this.status=i.status===void 0?200:i.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=i.statusText===void 0?"":""+i.statusText,this.headers=new A(i.headers),this.url=i.url||"",this._initBody(r)}ae.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new A(this.headers),url:this.url})},C.error=function(){var r=new C(null,{status:200,statusText:""});return r.ok=!1,r.status=0,r.type="error",r};var ft=[301,302,303,307,308];C.redirect=function(r,i){if(ft.indexOf(i)===-1)throw new RangeError("Invalid status code");return new C(null,{status:i,headers:{location:r}})},s.DOMException=n.DOMException;try{new s.DOMException}catch{s.DOMException=function(i,u){this.message=i,this.name=u;var p=Error(i);this.stack=p.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function Y(r,i){return new Promise(function(u,p){var f=new I(r,i);if(f.signal&&f.signal.aborted)return p(new s.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function H(){c.abort()}c.onload=function(){var g={statusText:c.statusText,headers:ht(c.getAllResponseHeaders()||"")};f.url.indexOf("file://")===0&&(c.status<200||c.status>599)?g.status=200:g.status=c.status,g.url="responseURL"in c?c.responseURL:g.headers.get("X-Request-URL");var D="response"in c?c.response:c.responseText;setTimeout(function(){u(new C(D,g))},0)},c.onerror=function(){setTimeout(function(){p(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){p(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){p(new s.DOMException("Aborted","AbortError"))},0)};function Q(g){try{return g===""&&n.location.href?n.location.href:g}catch{return g}}if(c.open(f.method,Q(f.url),!0),f.credentials==="include"?c.withCredentials=!0:f.credentials==="omit"&&(c.withCredentials=!1),"responseType"in c&&(a.blob?c.responseType="blob":a.arrayBuffer&&(c.responseType="arraybuffer")),i&&typeof i.headers=="object"&&!(i.headers instanceof A||n.Headers&&i.headers instanceof n.Headers)){var le=[];Object.getOwnPropertyNames(i.headers).forEach(function(g){le.push(S(g)),c.setRequestHeader(g,O(i.headers[g]))}),f.headers.forEach(function(g,D){le.indexOf(D)===-1&&c.setRequestHeader(D,g)})}else f.headers.forEach(function(g,D){c.setRequestHeader(D,g)});f.signal&&(f.signal.addEventListener("abort",H),c.onreadystatechange=function(){c.readyState===4&&f.signal.removeEventListener("abort",H)}),c.send(typeof f._bodyInit>"u"?null:f._bodyInit)})}return Y.polyfill=!0,n.fetch||(n.fetch=Y,n.Headers=A,n.Request=I,n.Response=C),s.Headers=A,s.Request=I,s.Response=C,s.fetch=Y,s}({})})(q);q.fetch.ponyfill=!0;delete q.fetch.polyfill;var F=V.fetch?V:q;x=F.fetch;x.default=F.fetch;x.fetch=F.fetch;x.Headers=F.Headers;x.Request=F.Request;x.Response=F.Response;me.exports=x});var at=_(b());var it=_(X()),T=_(pe()),R=_(b());var he=_(X());var fe=he.css`
3
+ `;var j=_(b()),St="ft-app-info",U=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};U.eventName="authentication-change";var _t={session:(e,t)=>{(0,j.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>o.dispatchEvent(new U(t.payload)),0))}},o=j.FtReduxStore.get({name:St,reducers:_t,initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],availableContentLocales:[],defaultLocales:void 0,searchInAllLanguagesAllowed:!1,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var J=_(b());var w=class e{static get(t){let{baseUrl:s,apiIntegrationIdentifier:n}=o.getState(),a=t??n;if(s&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(s,a,!0)}static await(t){return new Promise(s=>{let n=e.get(t);if(n)s(n);else{let a=o.subscribe(()=>{n=e.get(t),n&&(a(),s(n))})}})}};var K=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:w.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):w.await()}};var P=class extends K{constructor(t=!0,s){var n;super(s),this.sortObjectFields=(l,d)=>typeof d!="object"||d==null||Array.isArray(d)?d:Object.fromEntries(Object.entries(d).sort(([y],[S])=>y.localeCompare(S)));let a=this.constructor;a.commonCache=(n=a.commonCache)!==null&&n!==void 0?n:new J.CacheRegistry,this.cache=t?a.commonCache:new J.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((s,n)=>0|31*s+n.charCodeAt(0),0))}};var Z=class{addCommand(t,s=!1){o.commands.add(t,s)}consumeCommand(t){return o.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new Z;var v=_(b());var ye,M=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},vt=Symbol("clearAfterUnitTest"),G=class extends(0,v.withEventBus)(P){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[ye]=()=>{this.defaultMessages={},this.cache=new v.CacheRegistry,this.listeners={}},this.currentUiLocale=o.getState().uiLocale,o.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=o.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let s=t.name.toLowerCase();this.cache.setFinal(s,t),this.notify(s)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,s){var n;if(t=t.toLowerCase(),s&&Object.keys(s).length>0){let a={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...s};(0,v.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var s,n;return this.fetchContext(t),(n=(s=this.cache.getNow(t))===null||s===void 0?void 0:s.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,s){let n=t.toLowerCase();return this.resolveContext(n)[s]}resolveMessage(t,s,...n){var a;let l=t.toLowerCase(),d=this.resolveContext(l);return new v.ParametrizedLabelResolver((a=this.defaultMessages[l])!==null&&a!==void 0?a:{},d).resolve(s,...n)}async fetchContext(t){let s=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),s&&await this.notify(t)}catch(a){!(a instanceof v.CanceledPromiseError)&&s&&console.error(a)}return n}subscribe(t,s){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(s),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(s)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new M({loadedContexts:t})),this.dispatchEvent(new M({loadedContexts:t})),await Promise.all(t.map(s=>this.notify(s,!1)))}async notify(t,s=!0){s&&(document.body.dispatchEvent(new M({loadedContexts:[t]})),this.dispatchEvent(new M({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,v.delay)(0).then(()=>n()).catch(()=>null)))}};ye=vt;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends G{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var Ae=window.FluidTopicsI18nService,Vt=window.FluidTopicsCustomI18nService;var Ee=_(b()),ee=class{highlightHtml(t,s,n){(0,Ee.highlightHtml)(t,s,n)}};window.FluidTopicsHighlightHtmlService=new ee;var Ct=_(ge(),1);var Te;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Te||(Te={}));var Se;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Se||(Se={}));var _e;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(_e||(_e={}));var ve;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ve||(ve={}));var Ce;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Ce||(Ce={}));var Re;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(Re||(Re={}));var be;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(be||(be={}));var Oe;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(Oe||(Oe={}));var Ie;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(Ie||(Ie={}));var xe;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(xe||(xe={}));var Le;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Le||(Le={}));var De;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(De||(De={}));var Ue;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Ue||(Ue={}));var we;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(we||(we={}));var Pe;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Pe||(Pe={}));var Ne;(function(e){e.ASC="ASC",e.DESC="DESC"})(Ne||(Ne={}));var Me;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(Me||(Me={}));var Fe;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Fe||(Fe={}));var ke;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(ke||(ke={}));var He;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(He||(He={}));var Be;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Be||(Be={}));var je;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(je||(je={}));var Ke;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ke||(Ke={}));var Ge;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Ge||(Ge={}));var Ve;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ve||(Ve={}));var E;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(E||(E={}));var qe;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(qe||(qe={}));var $e;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})($e||($e={}));var ze;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(ze||(ze={}));var We;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.OTHER="OTHER"})(We||(We={}));var Ye;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ye||(Ye={}));var Qe;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Qe||(Qe={}));var Xe;(function(e){e.USER="USER",e.ASSISTANT="ASSISTANT"})(Xe||(Xe={}));var Je;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Je||(Je={}));var Ze;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Ze||(Ze={}));var et;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(et||(et={}));var rr={[E.PERSONAL_BOOK_SHARE_USER]:[E.PERSONAL_BOOK_USER],[E.HTML_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.PDF_EXPORT_USER]:[E.PERSONAL_BOOK_USER],[E.KHUB_ADMIN]:[E.CONTENT_PUBLISHER],[E.ADMIN]:[E.KHUB_ADMIN,E.USERS_ADMIN,E.PORTAL_ADMIN,E.BEHAVIOR_DATA_USER],[E.GENERATIVE_AI_EXPORT_USER]:[E.GENERATIVE_AI_USER]};var tt=_(b());var te=class{isDate(t){var s,n,a,l;return(l=(a=((n=(s=o.getState().metadataConfiguration)===null||s===void 0?void 0:s.descriptors)!==null&&n!==void 0?n:[]).find(y=>y.key===t))===null||a===void 0?void 0:a.date)!==null&&l!==void 0?l:!1}format(t,s){var n,a,l;if(t==null)return"";try{return tt.DateFormatter.format(t,(n=s?.locale)!==null&&n!==void 0?n:o.getState().uiLocale,(a=s?.longFormat)!==null&&a!==void 0?a:!1,(l=s?.withTime)!==null&&l!==void 0?l:!1)}catch(d){throw console.error(`Date ${JSON.stringify(t)} is not valid`,d),d}}};window.FluidTopicsDateService=new te;var rt=_(b());var k=class{static get(t,s){var n,a;let l=o.getState(),{lang:d,region:y}=(a=(n=l.defaultLocales)===null||n===void 0?void 0:n.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new rt.SearchPlaceConverter(l.baseUrl,t??20,l.searchInAllLanguagesAllowed,s??`${d}-${y}`)}};var re=class{urlToSearchRequest(t){return k.get().parse(t)}searchRequestToUrl(t){return k.get().serialize(t)}};window.FluidTopicsUrlService=new re;var L=_(b());var N=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};N.eventName="change";var se=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let s=sessionStorage.getItem(this.itemName(t));return s?JSON.parse(s):void 0}set(t,s){sessionStorage.setItem(this.itemName(t),JSON.stringify(s))}},st=new se;var $=class e extends L.WithEventBus{static build(){return new e(window.history,st,()=>window.location,!1)}constructor(t,s,n,a){var l,d;super(),this.history=t,this.historyStorage=s,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(d=(l=t.state)===null||l===void 0?void 0:l.index)!==null&&d!==void 0?d:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,s=!1){let n=s&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,L.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new N(this.currentItem())),0)}installProxies(){let t=s=>(n,a,[l,d,y])=>{let S=s(),O={...S===this.currentIndex?this.currentState:void 0,...l,index:S,href:typeof y=="string"?y:(y??this.windowLocation()).href};n.apply(a,[O,d,y]),this.setCurrentState(O,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.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(t){for(let s=this.history.length-1;s>=0;s--)t?this.states[s]=this.historyStorage.get(s):setTimeout(()=>this.states[s]=this.historyStorage.get(s),this.history.length-s)}updateCurrentState(t){var s;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(s=t?.title)!==null&&s!==void 0?s:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(N.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(N.eventName,t)}currentItem(){return(0,L.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,L.deepCopy)(this.states[this.previousDifferentMajorPosition()])}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,L.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var s;let n=(s=this.states[t])===null||s===void 0?void 0:s.majorStateId;if(!n)return t;let a=t,l=t+1;for(;this.states.length>l&&!this.isDifferentMajorState(l,n);)this.hasState(l)&&(a=l),l++;return a}buildCurrentState(){var t,s;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(s=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&s!==void 0?s:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,s){var n;if(!this.hasState(t))return!1;let a=s??this.currentState.majorStateId,l=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return l==null||l!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});function nt(e,t){let{authenticationRequired:s,session:n}=o.getState();return s&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var m=function(e,t,s,n){var a=arguments.length,l=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,s):n,d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(e,t,s,n);else for(var y=e.length-1;y>=0;y--)(d=e[y])&&(l=(a<3?d(l):a>3?d(t,s,l):d(t,s))||l);return a>3&&l&&Object.defineProperty(t,s,l),l},h=class extends R.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.apiProvider=()=>w.get(),this.authenticationRequired=!1,this.messageContexts=[],this.cache=new R.CacheRegistry,this.cleanSessionDebouncer=new R.Debouncer,this.reloadConfiguration=()=>{this.cache.clear("availableContentLocales"),this.updateAvailableContentLocales()}}render(){return it.html`
4
4
  <slot></slot>
5
- `}connectedCallback(){super.connectedCallback(),o.addEventListener(U.eventName,this.reloadConfiguration)}disconnectedCallback(){o.addEventListener(U.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var s,n,a,l,d,y,S;super.update(t),t.has("baseUrl")&&(o.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&o.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&o.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&o.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&o.actions.noCustom(this.noCustom),t.has("editorMode")&&o.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(b=>Ae.addContext(b)),t.has("openExternalDocumentInNewTab")&&o.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&o.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&o.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(o.actions.defaultLocales((s=this.localesConfiguration)===null||s===void 0?void 0:s.defaultLocales),o.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),o.actions.searchInAllLanguagesAllowed((d=(l=this.localesConfiguration)===null||l===void 0?void 0:l.allLanguagesAllowed)!==null&&d!==void 0?d:!1)),t.has("authenticationRequired")&&o.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&o.actions.availableContentLocales((S=(y=this.availableContentLocales)===null||y===void 0?void 0:y.contentLocales)!==null&&S!==void 0?S:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>nt(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};h.elementDefinitions={};h.styles=fe;E([(0,g.property)()],h.prototype,"baseUrl",void 0);E([(0,g.property)()],h.prototype,"apiIntegrationIdentifier",void 0);E([(0,g.property)()],h.prototype,"apiIntegrationAppVersion",void 0);E([(0,g.property)()],h.prototype,"uiLocale",void 0);E([(0,I.jsonProperty)(null)],h.prototype,"availableUiLocales",void 0);E([(0,I.jsonProperty)(null)],h.prototype,"metadataConfiguration",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"editorMode",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"noCustom",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"openExternalDocumentInNewTab",void 0);E([(0,g.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],h.prototype,"noCustomComponent",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"withManualResources",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"navigatorOnline",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"forcedOffline",void 0);E([(0,g.property)({type:Object})],h.prototype,"apiProvider",void 0);E([(0,g.property)({type:Boolean})],h.prototype,"authenticationRequired",void 0);E([(0,I.jsonProperty)([])],h.prototype,"messageContexts",void 0);E([(0,I.jsonProperty)(void 0)],h.prototype,"session",void 0);E([(0,g.state)()],h.prototype,"localesConfiguration",void 0);E([(0,g.state)()],h.prototype,"availableContentLocales",void 0);(0,at.customElement)("ft-app-context")(h);})();
5
+ `}connectedCallback(){super.connectedCallback(),o.addEventListener(U.eventName,this.reloadConfiguration)}disconnectedCallback(){o.addEventListener(U.eventName,this.reloadConfiguration),super.disconnectedCallback()}update(t){var s,n,a,l,d,y,S;super.update(t),t.has("baseUrl")&&(o.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&o.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&o.actions.apiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&o.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&o.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&o.actions.noCustom(this.noCustom),t.has("editorMode")&&o.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&o.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&o.actions.session(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(O=>Ae.addContext(O)),t.has("openExternalDocumentInNewTab")&&o.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&o.actions.navigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&o.actions.forcedOffline(this.forcedOffline),t.has("localesConfiguration")&&(o.actions.defaultLocales((s=this.localesConfiguration)===null||s===void 0?void 0:s.defaultLocales),o.actions.availableUiLocales((a=(n=this.localesConfiguration)===null||n===void 0?void 0:n.availableUiLocales)!==null&&a!==void 0?a:[]),o.actions.searchInAllLanguagesAllowed((d=(l=this.localesConfiguration)===null||l===void 0?void 0:l.allLanguagesAllowed)!==null&&d!==void 0?d:!1)),t.has("authenticationRequired")&&o.actions.authenticationRequired(this.authenticationRequired),t.has("availableContentLocales")&&o.actions.availableContentLocales((S=(y=this.availableContentLocales)===null||y===void 0?void 0:y.contentLocales)!==null&&S!==void 0?S:[]),setTimeout(()=>this.updateIfNeeded())}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.session==null&&this.updateSession(),this.metadataConfiguration==null&&this.updateMetadataConfiguration()),this.localesConfiguration==null&&this.updateLocalesConfiguration(),this.availableContentLocales==null&&this.updateAvailableContentLocales())}async updateSession(){this.session=await this.cache.get("session",async()=>{let t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.session=void 0},t.idleTimeoutInMillis),t})}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration())}async updateLocalesConfiguration(){this.localesConfiguration=await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration())}async updateAvailableContentLocales(){this.availableContentLocales=await this.cache.get("availableContentLocales",()=>nt(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}))}};h.elementDefinitions={};h.styles=fe;m([(0,T.property)()],h.prototype,"baseUrl",void 0);m([(0,T.property)()],h.prototype,"apiIntegrationIdentifier",void 0);m([(0,T.property)()],h.prototype,"apiIntegrationAppVersion",void 0);m([(0,T.property)()],h.prototype,"uiLocale",void 0);m([(0,R.jsonProperty)(null)],h.prototype,"availableUiLocales",void 0);m([(0,R.jsonProperty)(null)],h.prototype,"metadataConfiguration",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"editorMode",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"noCustom",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"openExternalDocumentInNewTab",void 0);m([(0,T.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],h.prototype,"noCustomComponent",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"withManualResources",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"navigatorOnline",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"forcedOffline",void 0);m([(0,T.property)({type:Object})],h.prototype,"apiProvider",void 0);m([(0,T.property)({type:Boolean})],h.prototype,"authenticationRequired",void 0);m([(0,R.jsonProperty)([])],h.prototype,"messageContexts",void 0);m([(0,R.jsonProperty)(void 0)],h.prototype,"session",void 0);m([(0,T.state)()],h.prototype,"localesConfiguration",void 0);m([(0,T.state)()],h.prototype,"availableContentLocales",void 0);(0,at.customElement)("ft-app-context")(h);})();
@@ -45,7 +45,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
45
45
  input::-webkit-search-results-decoration {
46
46
  display: none;
47
47
  }
48
- `;var Ci={};var Xo={};D(Xo,{ParametrizedLabelResolver:()=>Yt});var Yt=class t{constructor(e,o){this.defaultLabels=e,this.labels=o}resolve(e,...o){var n,a;e=this.resolvePluralKey(e,o);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return t.replaceParameters(i,...o)}static replaceParameters(e,...o){return o.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>t.formatValue(n,s))),e}resolvePluralKey(e,o){for(let n of o)if(typeof n=="number"){let a=`${String(e)}[\\=${n}]`;if(a in this.labels||a in this.defaultLabels)return a}return e}static formatValue(e,o){return e instanceof Date?t.formatDate(e,o):e??""}static formatDate(e,o){let n=a=>o?.includes("date")?e.toLocaleDateString(a):o?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var Cn={};D(Cn,{FtCommandQueue:()=>Jt,FtLitElementRedux:()=>Qo,FtReduxStore:()=>rr,FtStateManager:()=>wn,ReduxWatcher:()=>Nr,clearAllStores:()=>Zd,isFtReduxStore:()=>xt,redux:()=>dd,reduxEventListener:()=>ud,reduxReactive:()=>ld,watch:()=>qd,withRedux:()=>Ai});var ld=()=>(t,e)=>{var o;let n=t.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(o=n.reduxReactiveProperties)===null||o===void 0||o.add(e)},dd=t=>{let e=t??{};return(o,n)=>{var a;let i={hasChanged:$e,attribute:!1,...e};T(i)(o,n);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:l=>l[n],store:e.store})}},ud=t=>(e,o)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(o,t)};var Jt=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};function xt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Xt=Symbol("internalReduxEventsUnsubscribers"),Ie=Symbol("internalStoresUnsubscribers"),Xe=Symbol("internalStores"),Ai=ee(Symbol("withRedux"),function(t){var e,o,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Xe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Xe].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Xe].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[Xe].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Xe].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Xe].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let d=this.constructor.getPropertyOptions(l);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:l)){let f=this.getStore(s.store);f&&(s.store?this[Ie].has(s.store):this[Ie].size>0)&&(this[l]=s.selector(f.getState(),this))}})}subscribeToStore(s,l){var d;this[Ie].set(s,l.subscribe(()=>this.updateFromStores())),this[Xt].set(s,[]),xt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((f,h)=>{if(typeof this[h]=="function"&&(!f.store||l.name===f.store)){let p=y=>this[h](y);l.addEventListener(f.eventName,p),this[Xt].get(s).push(()=>l.removeEventListener(f.eventName,p))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ie].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ie].has(s)&&this[Ie].get(s)(),this[Ie].delete(s),(l=this[Xt].get(s))===null||l===void 0||l.forEach(d=>d()),this[Xt].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ie,o=Xe,n=Xt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Qo=class extends Ai(Y){};function ae(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Oe(t){return!!t&&!!t[z]}function de(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===xd}(t)||Array.isArray(t)||!!t[Ni]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ni])||ln(t)||dn(t))}function Qe(t,e,o){o===void 0&&(o=!1),Ot(t)===0?(o?Object.keys:St)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Ot(t){var e=t[z];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ln(t)?2:dn(t)?3:0}function vt(t,e){return Ot(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function fd(t,e){return Ot(t)===2?t.get(e):t[e]}function ki(t,e,o){var n=Ot(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Di(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ln(t){return gd&&t instanceof Map}function dn(t){return bd&&t instanceof Set}function _e(t){return t.o||t.t}function un(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Ui(t);delete e[z];for(var o=St(e),n=0;n<o.length;n++){var a=o[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function fn(t,e){return e===void 0&&(e=!1),pn(t)||Oe(t)||!de(t)||(Ot(t)>1&&(t.set=t.add=t.clear=t.delete=pd),Object.freeze(t),e&&Qe(t,function(o,n){return fn(n,!0)},!0)),t}function pd(){ae(2)}function pn(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ge(t){var e=cn[t];return e||ae(18,t),e}function hd(t,e){cn[t]||(cn[t]=e)}function nn(){return er}function en(t,e){e&&(ge("Patches"),t.u=[],t.s=[],t.v=e)}function Ir(t){an(t),t.p.forEach(md),t.p=null}function an(t){t===er&&(er=t.l)}function Ri(t){return er={p:[],l:er,h:t,m:!0,_:0}}function md(t){var e=t[z];e.i===0||e.i===1?e.j():e.g=!0}function tn(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||ge("ES5").S(e,t,n),n?(o[z].P&&(Ir(e),ae(4)),de(t)&&(t=_r(e,t),e.l||Tr(e,t)),e.u&&ge("Patches").M(o[z].t,t,e.u,e.s)):t=_r(e,o,[]),Ir(e),e.u&&e.v(e.u,e.s),t!==Fi?t:void 0}function _r(t,e,o){if(pn(e))return e;var n=e[z];if(!n)return Qe(e,function(l,d){return Ii(t,n,e,l,d,o)},!0),e;if(n.A!==t)return e;if(!n.P)return Tr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=un(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),Qe(i,function(l,d){return Ii(t,n,a,l,d,o,s)}),Tr(t,a,!1),o&&t.u&&ge("Patches").N(n,o,t.u,t.s)}return n.o}function Ii(t,e,o,n,a,i,s){if(Oe(a)){var l=_r(t,a,i&&e&&e.i!==3&&!vt(e.R,n)?i.concat(n):void 0);if(ki(o,n,l),!Oe(l))return;t.m=!1}else s&&o.add(a);if(de(a)&&!pn(a)){if(!t.h.D&&t._<1)return;_r(t,a),e&&e.A.l||Tr(t,a)}}function Tr(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&fn(e,o)}function rn(t,e){var o=t[z];return(o?_e(o):t)[e]}function _i(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function Te(t){t.P||(t.P=!0,t.l&&Te(t.l))}function on(t){t.o||(t.o=un(t.t))}function sn(t,e,o){var n=ln(e)?ge("MapSet").F(e,o):dn(e)?ge("MapSet").T(e,o):t.O?function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:nn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},d=l,f=tr;s&&(d=[l],f=Qt);var h=Proxy.revocable(d,f),p=h.revoke,y=h.proxy;return l.k=y,l.j=p,y}(e,o):ge("ES5").J(e,o);return(o?o.A:nn()).p.push(n),n}function yd(t){return Oe(t)||ae(22,t),function e(o){if(!de(o))return o;var n,a=o[z],i=Ot(o);if(a){if(!a.P&&(a.i<4||!ge("ES5").K(a)))return a.t;a.I=!0,n=Ti(o,i),a.I=!1}else n=Ti(o,i);return Qe(n,function(s,l){a&&fd(a.t,s)===l||ki(n,s,e(l))}),i===3?new Set(n):n}(t)}function Ti(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return un(t)}function Mi(){function t(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var f=this[z];return tr.get(f,s)},set:function(f){var h=this[z];tr.set(h,s,f)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][z];if(!d.P)switch(d.i){case 5:n(d)&&Te(d);break;case 4:o(d)&&Te(d)}}}function o(s){for(var l=s.t,d=s.k,f=St(d),h=f.length-1;h>=0;h--){var p=f[h];if(p!==z){var y=l[p];if(y===void 0&&!vt(l,p))return!0;var b=d[p],g=b&&b[z];if(g?g.t!==y:!Di(b,y))return!0}}var O=!!l[z];return f.length!==St(l).length+(O?0:1)}function n(s){var l=s.k;if(l.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(l,l.length-1);if(d&&!d.get)return!0;for(var f=0;f<l.length;f++)if(!l.hasOwnProperty(f))return!0;return!1}function a(s){s.g&&ae(3,JSON.stringify(_e(s)))}var i={};hd("ES5",{J:function(s,l){var d=Array.isArray(s),f=function(p,y){if(p){for(var b=Array(y.length),g=0;g<y.length;g++)Object.defineProperty(b,""+g,t(g,!0));return b}var O=Ui(y);delete O[z];for(var w=St(O),C=0;C<w.length;C++){var A=w[C];O[A]=t(A,p||!!O[A].enumerable)}return Object.create(Object.getPrototypeOf(y),O)}(d,s),h={i:d?5:4,A:l?l.A:nn(),P:!1,I:!1,R:{},l,t:s,k:f,o:null,g:!1,C:!1};return Object.defineProperty(f,z,{value:h,writable:!0}),f},S:function(s,l,d){d?Oe(l)&&l[z].A===s&&e(s.p):(s.u&&function f(h){if(h&&typeof h=="object"){var p=h[z];if(p){var y=p.t,b=p.k,g=p.R,O=p.i;if(O===4)Qe(b,function(x){x!==z&&(y[x]!==void 0||vt(y,x)?g[x]||f(b[x]):(g[x]=!0,Te(p)))}),Qe(y,function(x){b[x]!==void 0||vt(b,x)||(g[x]=!1,Te(p))});else if(O===5){if(n(p)&&(Te(p),g.length=!0),b.length<y.length)for(var w=b.length;w<y.length;w++)g[w]=!1;else for(var C=y.length;C<b.length;C++)g[C]=!0;for(var A=Math.min(b.length,y.length),S=0;S<A;S++)b.hasOwnProperty(S)||(g[S]=!0),g[S]===void 0&&f(b[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var Pi,er,hn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",gd=typeof Map<"u",bd=typeof Set<"u",Li=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Fi=hn?Symbol.for("immer-nothing"):((Pi={})["immer-nothing"]=!0,Pi),Ni=hn?Symbol.for("immer-draftable"):"__$immer_draftable",z=hn?Symbol.for("immer-state"):"__$immer_state";var xd=""+Object.prototype.constructor,St=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Ui=Object.getOwnPropertyDescriptors||function(t){var e={};return St(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},cn={},tr={get:function(t,e){if(e===z)return t;var o=_e(t);if(!vt(o,e))return function(a,i,s){var l,d=_i(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(t,o,e);var n=o[e];return t.I||!de(n)?n:n===rn(t.t,e)?(on(t),t.o[e]=sn(t.A.h,n,t)):n},has:function(t,e){return e in _e(t)},ownKeys:function(t){return Reflect.ownKeys(_e(t))},set:function(t,e,o){var n=_i(_e(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=rn(_e(t),e),i=a?.[z];if(i&&i.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Di(o,a)&&(o!==void 0||vt(t.t,e)))return!0;on(t),Te(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return rn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,on(t),Te(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=_e(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){ae(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ae(12)}},Qt={};Qe(tr,function(t,e){Qt[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Qt.deleteProperty=function(t,e){return Qt.set.call(this,t,e,void 0)},Qt.set=function(t,e,o){return tr.set.call(this,t[0],e,o,t[0])};var vd=function(){function t(o){var n=this;this.O=Li,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var d=n;return function(O){var w=this;O===void 0&&(O=l);for(var C=arguments.length,A=Array(C>1?C-1:0),S=1;S<C;S++)A[S-1]=arguments[S];return d.produce(O,function(x){var E;return(E=i).call.apply(E,[w,x].concat(A))})}}var f;if(typeof i!="function"&&ae(6),s!==void 0&&typeof s!="function"&&ae(7),de(a)){var h=Ri(n),p=sn(n,a,void 0),y=!0;try{f=i(p),y=!1}finally{y?Ir(h):an(h)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(O){return en(h,s),tn(O,h)},function(O){throw Ir(h),O}):(en(h,s),tn(f,h))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===Fi&&(f=void 0),n.D&&fn(f,!0),s){var b=[],g=[];ge("Patches").M(a,f,b,g),s(b,g)}return f}ae(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var h=arguments.length,p=Array(h>1?h-1:0),y=1;y<h;y++)p[y-1]=arguments[y];return n.produceWithPatches(f,function(b){return a.apply(void 0,[b].concat(p))})};var s,l,d=n.produce(a,i,function(f,h){s=f,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(f){return[f,s,l]}):[d,s,l]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){de(o)||ae(8),Oe(o)&&(o=yd(o));var n=Ri(this),a=sn(this,o,void 0);return a[z].C=!0,an(n),a},e.finishDraft=function(o,n){var a=o&&o[z],i=a.A;return en(i,n),tn(void 0,i)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!Li&&ae(20),this.O=o},e.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var s=ge("Patches").$;return Oe(o)?s(o,n):this.produce(o,function(l){return s(l,n)})},t}(),te=new vd,Sd=te.produce,qy=te.produceWithPatches.bind(te),Yy=te.setAutoFreeze.bind(te),Jy=te.setUseProxies.bind(te),Xy=te.applyPatches.bind(te),Qy=te.createDraft.bind(te),eg=te.finishDraft.bind(te),Pr=Sd;function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}function Bi(t,e){if(et(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(et(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hi(t){var e=Bi(t,"string");return et(e)=="symbol"?e:e+""}function $i(t,e,o){return(e=Hi(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function zi(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function mn(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(o),!0).forEach(function(n){$i(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):zi(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function q(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 Wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),yn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Lr={INIT:"@@redux/INIT"+yn(),REPLACE:"@@redux/REPLACE"+yn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+yn()}};function Od(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function gn(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(q(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(q(1));return o(gn)(t,e)}if(typeof t!="function")throw new Error(q(2));var a=t,i=e,s=[],l=s,d=!1;function f(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(q(3));return i}function p(O){if(typeof O!="function")throw new Error(q(4));if(d)throw new Error(q(5));var w=!0;return f(),l.push(O),function(){if(w){if(d)throw new Error(q(6));w=!1,f();var A=l.indexOf(O);l.splice(A,1),s=null}}}function y(O){if(!Od(O))throw new Error(q(7));if(typeof O.type>"u")throw new Error(q(8));if(d)throw new Error(q(9));try{d=!0,i=a(i,O)}finally{d=!1}for(var w=s=l,C=0;C<w.length;C++){var A=w[C];A()}return O}function b(O){if(typeof O!="function")throw new Error(q(10));a=O,y({type:Lr.REPLACE})}function g(){var O,w=p;return O={subscribe:function(A){if(typeof A!="object"||A===null)throw new Error(q(11));function S(){A.next&&A.next(h())}S();var x=w(S);return{unsubscribe:x}}},O[Wi]=function(){return this},O}return y({type:Lr.INIT}),n={dispatch:y,subscribe:p,getState:h,replaceReducer:b},n[Wi]=g,n}function Ed(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:Lr.INIT});if(typeof n>"u")throw new Error(q(12));if(typeof o(void 0,{type:Lr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(q(13))})}function ji(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(o[a]=t[a])}var i=Object.keys(o),s,l;try{Ed(o)}catch(d){l=d}return function(f,h){if(f===void 0&&(f={}),l)throw l;if(0)var p;for(var y=!1,b={},g=0;g<i.length;g++){var O=i[g],w=o[O],C=f[O],A=w(C,h);if(typeof A>"u"){var S=h&&h.type;throw new Error(q(14))}b[O]=A,y=y||A!==C}return y=y||i.length!==Object.keys(f).length,y?b:f}}function Et(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Gi(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(q(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=Et.apply(void 0,l)(a.dispatch),mn(mn({},a),{},{dispatch:i})}}}function Vi(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,t):s(l)}}};return e}var Ki=Vi();Ki.withExtraArgument=Vi;var bn=Ki;var Xi=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),wd=function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(f){return function(h){return d([f,h])}}function d(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,a=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(f[0]===6&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=e.call(t,o)}catch(h){f=[6,h],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},wt=function(t,e){for(var o=0,n=e.length,a=t.length;o<n;o++,a++)t[a]=e[o];return t},Cd=Object.defineProperty,Ad=Object.defineProperties,Rd=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertySymbols,Id=Object.prototype.hasOwnProperty,_d=Object.prototype.propertyIsEnumerable,qi=function(t,e,o){return e in t?Cd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Pe=function(t,e){for(var o in e||(e={}))Id.call(e,o)&&qi(t,o,e[o]);if(Zi)for(var n=0,a=Zi(e);n<a.length;n++){var o=a[n];_d.call(e,o)&&qi(t,o,e[o])}return t},xn=function(t,e){return Ad(t,Rd(e))},Td=function(t,e,o){return new Promise(function(n,a){var i=function(d){try{l(o.next(d))}catch(f){a(f)}},s=function(d){try{l(o.throw(d))}catch(f){a(f)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((o=o.apply(t,e)).next())})};var Pd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Et:Et.apply(null,arguments)},bg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ld(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var Nd=function(t){Xi(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,wt([void 0],o[0].concat(this)))):new(e.bind.apply(e,wt([void 0],o.concat(this))))},e}(Array),kd=function(t){Xi(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,wt([void 0],o[0].concat(this)))):new(e.bind.apply(e,wt([void 0],o.concat(this))))},e}(Array);function On(t){return de(t)?Pr(t,function(){}):t}function Dd(t){return typeof t=="boolean"}function Md(){return function(e){return Fd(e)}}function Fd(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,l=new Nd;if(o&&(Dd(o)?l.push(bn):l.push(bn.withExtraArgument(o.extraArgument))),0){if(a)var d;if(s)var f}return l}var vn=!0;function Qi(t){var e=Md(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,s=i===void 0?e():i,l=o.devTools,d=l===void 0?!0:l,f=o.preloadedState,h=f===void 0?void 0:f,p=o.enhancers,y=p===void 0?void 0:p,b;if(typeof a=="function")b=a;else if(Ld(a))b=ji(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=s;if(typeof g=="function"&&(g=g(e),!vn&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!vn&&g.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Gi.apply(void 0,g),w=Et;d&&(w=Pd(Pe({trace:!vn},typeof d=="object"&&d)));var C=new kd(O),A=C;Array.isArray(y)?A=wt([O],y):typeof y=="function"&&(A=y(C));var S=w.apply(void 0,A);return gn(b,h,S)}function Le(t,e){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Pe(Pe({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function es(t){var e={},o=[],n,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(l in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[l]=s,a},addMatcher:function(i,s){return o.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,o,n]}function Ud(t){return typeof t=="function"}function Bd(t,e,o,n){o===void 0&&(o=[]);var a=typeof e=="function"?es(e):[e,o,n],i=a[0],s=a[1],l=a[2],d;if(Ud(t))d=function(){return On(t())};else{var f=On(t);d=function(){return f}}function h(p,y){p===void 0&&(p=d());var b=wt([i[y.type]],s.filter(function(g){var O=g.matcher;return O(y)}).map(function(g){var O=g.reducer;return O}));return b.filter(function(g){return!!g}).length===0&&(b=[l]),b.reduce(function(g,O){if(O)if(Oe(g)){var w=g,C=O(w,y);return C===void 0?g:C}else{if(de(g))return Pr(g,function(A){return O(A,y)});var C=O(g,y);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}return g},p)}return h.getInitialState=d,h}function Hd(t,e){return t+"/"+e}function ts(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:On(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var p=n[h],y=Hd(e,h),b,g;"reducer"in p?(b=p.reducer,g=p.prepare):b=p,i[h]=b,s[y]=b,l[h]=g?Le(y,g):Le(y)});function d(){var h=typeof t.extraReducers=="function"?es(t.extraReducers):[t.extraReducers],p=h[0],y=p===void 0?{}:p,b=h[1],g=b===void 0?[]:b,O=h[2],w=O===void 0?void 0:O,C=Pe(Pe({},y),s);return Bd(o,function(A){for(var S in C)A.addCase(S,C[S]);for(var x=0,E=g;x<E.length;x++){var R=E[x];A.addMatcher(R.matcher,R.reducer)}w&&A.addDefaultCase(w)})}var f;return{name:e,reducer:function(h,p){return f||(f=d()),f(h,p)},actions:l,caseReducers:i,getInitialState:function(){return f||(f=d()),f.getInitialState()}}}var $d="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zd=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=$d[Math.random()*64|0];return e},Wd=["name","message","stack","code"],Sn=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Yi=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),jd=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=Wd;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},Og=function(){function t(e,o,n){var a=Le(e+"/fulfilled",function(h,p,y,b){return{payload:h,meta:xn(Pe({},b||{}),{arg:y,requestId:p,requestStatus:"fulfilled"})}}),i=Le(e+"/pending",function(h,p,y){return{payload:void 0,meta:xn(Pe({},y||{}),{arg:p,requestId:h,requestStatus:"pending"})}}),s=Le(e+"/rejected",function(h,p,y,b,g){return{payload:b,error:(n&&n.serializeError||jd)(h||"Rejected"),meta:xn(Pe({},g||{}),{arg:y,requestId:p,rejectedWithValue:!!b,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function f(h){return function(p,y,b){var g=n?.idGenerator?n.idGenerator(h):zd(),O=new d,w,C=!1;function A(x){w=x,O.abort()}var S=function(){return Td(this,null,function(){var x,E,R,P,M,N,_;return wd(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),P=(x=n?.condition)==null?void 0:x.call(n,h,{getState:y,extra:b}),Vd(P)?[4,P]:[3,2];case 1:P=m.sent(),m.label=2;case 2:if(P===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return C=!0,M=new Promise(function(v,I){return O.signal.addEventListener("abort",function(){return I({name:"AbortError",message:w||"Aborted"})})}),p(i(g,h,(E=n?.getPendingMeta)==null?void 0:E.call(n,{requestId:g,arg:h},{getState:y,extra:b}))),[4,Promise.race([M,Promise.resolve(o(h,{dispatch:p,getState:y,extra:b,requestId:g,signal:O.signal,abort:A,rejectWithValue:function(v,I){return new Sn(v,I)},fulfillWithValue:function(v,I){return new Yi(v,I)}})).then(function(v){if(v instanceof Sn)throw v;return v instanceof Yi?a(v.payload,g,h,v.meta):a(v,g,h)})])];case 3:return R=m.sent(),[3,5];case 4:return N=m.sent(),R=N instanceof Sn?s(null,g,h,N.payload,N.meta):s(N,g,h),[3,5];case 5:return _=n&&!n.dispatchConditionRejection&&s.match(R)&&R.meta.condition,_||p(R),[2,R]}})})}();return Object.assign(S,{abort:A,requestId:g,arg:h,unwrap:function(){return S.then(Gd)}})}}return Object.assign(f,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function Gd(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Vd(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var rs="listener",os="completed",ns="cancelled",Eg="task-"+ns,wg="task-"+os,Cg=rs+"-"+ns,Ag=rs+"-"+os;var En="listenerMiddleware";var Rg=Le(En+"/add"),Ig=Le(En+"/removeAll"),_g=Le(En+"/remove");var Ji,Tg=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Ji||(Ji=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Kd=function(t){return function(e){setTimeout(e,t)}},Pg=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Kd(10);Mi();window.ftReduxStores||(window.ftReduxStores={});var rr=class t extends ve{static get(e){var o;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(xt(i))return i;if(a==null)return;let s=ts({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),l=Qi({reducer:(d,f)=>{if(f.type==="CLEAR_FT_REDUX_STORE"){let h=We(s.getInitialState());for(let p of f.keeping)h[p]=(d??h)[p];return h}else if(typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...f.overwrites};return s.reducer(d,f)}});return window.ftReduxStores[a.name]=new t(s,l,a.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Jt;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let d=s,f=i[d];return f?(...h)=>{let p=f(...h.map(a));return this.reduxStore.dispatch(p),p}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Zd(){var t;for(let e of Object.values((t=window.ftReduxStores)!==null&&t!==void 0?t:{}))xt(e)&&e.clear()}var Nr=class{constructor(e,o,n){this.store=e,this.valueSelector=o,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),o=this.valueSelector(e);$e(this.lastValue,o)&&(this.callback(o,e),this.lastValue=o)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function qd(t,e,o){return new Nr(t,e,o).watch()}var wn=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var o;return(o=this.requestConsumers.get(e))!==null&&o!==void 0?o:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,o){for(let n of o)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,o){for(let n of o)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var In={};D(In,{scrollHelper:()=>Yd});var An,kr=new Map,Rn=class{lock(e,o){if(o){let n=kr.get(o);if(n==null||n===e)return kr.set(o,e),o}}release(e,o){o&&kr.get(o)===e&&kr.delete(o)}findFirstScrollableParent(e){var o;let n,a;for(let i of co(e)){let s=i,l=this.elementCanScroll(s);if(l&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else l&&a==null&&(a=s)}return(o=n??a)!==null&&o!==void 0?o:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,o){var n,a;let i=0;for(;o&&o.offsetParent!==e.offsetParent;)i+=(n=o.offsetTop)!==null&&n!==void 0?n:0,o=o.offsetParent;return i+((a=o?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,o){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return o;default:return 0}}scrollIntoViewIfPossible(e,o){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let a=this.getAbsoluteScrollOffset(n,e),i=a-n.clientHeight+e.clientHeight,s=a,l=ze(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(o?.position,l)*(i-s)+s;n.scrollTo({behavior:o?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(An=window.FluidTopicsScrollHelper)!==null&&An!==void 0?An:new Rn;var Yd=window.FluidTopicsScrollHelper;var Tn={};D(Tn,{SearchPlaceConverter:()=>It,SearchPlaceQueryParams:()=>U,isSearchPlaceQueryParams:()=>zs,serializeRequest:()=>Qd});var Jd=ic(is(),1);var ss;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ss||(ss={}));var cs;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(cs||(cs={}));var ls;(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"})(ls||(ls={}));var ds;(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"})(ds||(ds={}));var us;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(us||(us={}));var fs;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(fs||(fs={}));var ps;(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__AI_TRANSLATE="DOCUMENT__AI_TRANSLATE",t.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__DISPLAY="TOPIC__DISPLAY",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(ps||(ps={}));var hs;(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"})(hs||(hs={}));var ms;(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"})(ms||(ms={}));var ys;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(ys||(ys={}));var gs;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(gs||(gs={}));var bs;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(bs||(bs={}));var xs;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(xs||(xs={}));var vs;(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"})(vs||(vs={}));var At;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(At||(At={}));var Ss;(function(t){t.ASC="ASC",t.DESC="DESC"})(Ss||(Ss={}));var Os;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Os||(Os={}));var _n;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(_n||(_n={}));var Ps=t=>Object.keys(_n).includes(t);var Es;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Es||(Es={}));var ws;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ws||(ws={}));var Cs;(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"})(Cs||(Cs={}));var Rt;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Rt||(Rt={}));var Ls=t=>Object.keys(Rt).includes(t);var As;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(As||(As={}));var Rs;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Rs||(Rs={}));var Is;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Is||(Is={}));var j;(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"})(j||(j={}));var _s;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(_s||(_s={}));var Ts;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Ts||(Ts={}));var Ns;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Ns||(Ns={}));var ks;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(ks||(ks={}));var Ds;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Ds||(Ds={}));var Ms;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Ms||(Ms={}));var Fs;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Fs||(Fs={}));var Us;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Us||(Us={}));var Bs;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Bs||(Bs={}));var Hs;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Hs||(Hs={}));var nb={[j.PERSONAL_BOOK_SHARE_USER]:[j.PERSONAL_BOOK_USER],[j.HTML_EXPORT_USER]:[j.PERSONAL_BOOK_USER],[j.PDF_EXPORT_USER]:[j.PERSONAL_BOOK_USER],[j.KHUB_ADMIN]:[j.CONTENT_PUBLISHER],[j.ADMIN]:[j.KHUB_ADMIN,j.USERS_ADMIN,j.PORTAL_ADMIN,j.BEHAVIOR_DATA_USER],[j.GENERATIVE_AI_EXPORT_USER]:[j.GENERATIVE_AI_USER]};function Xd(t){return`"${t}"`}function $s(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Qd(t,e){return new It(t).serialize(e)}var U;(function(t){t.LOCALE="content-lang",t.QUERY="query",t.SCOPE="scope",t.FILTERS="filters",t.VIRTUAL_FIELD="virtual-field",t.PERIOD="period",t.VALUE_FILTERS="value-filters",t.DATE_FILTERS="date-filters",t.RANGE_FILTERS="range-filters",t.SORT="sort",t.PER_PAGE="per-page",t.KEYWORD_MATCH="keyword-match"})(U||(U={}));var eu=new Set(Object.values(U));function zs(t){return eu.has(t)}var It=class{constructor(e,o=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=o,this.allLanguagesAllowed=n,this.defaultContentLocale=a,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,o){return this.serializeToCurrentPageIfPossible(e,o??"/search")}serializeToCurrentPageIfPossible(e,o){let n=o==null||o.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${o}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,o=!1){var n,a,i,s,l,d,f,h,p,y,b;let g=new URLSearchParams;e.contentLocale?(!o||e.contentLocale!==this.defaultContentLocale)&&g.append(U.LOCALE,e.contentLocale):g.append(U.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&g.append(U.QUERY,e.query);let O=(i=(a=e.metadataFilters)===null||a===void 0?void 0:a.filter(x=>x.valueFilter&&!x.valueFilter.negative))!==null&&i!==void 0?i:[];if(O.length>0){let x=O.map(E=>{var R,P;let M=((P=(R=E.valueFilter)===null||R===void 0?void 0:R.values)!==null&&P!==void 0?P:[]).map(N=>this.escapeFilters(N)).map(N=>Xd($s(N))).join("_");return`${E.key}~${M}`}).join("*");g.append(U.VALUE_FILTERS,x)}let w=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(x=>x.dateFilter))!==null&&l!==void 0?l:[];if(w.length>0){let x=w.map(E=>{var R;return`${E.key}~${(R=E.dateFilter)===null||R===void 0?void 0:R.type.toLowerCase()}`}).join("*");g.append(U.DATE_FILTERS,x)}let C=(f=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(x=>x.rangeFilter))!==null&&f!==void 0?f:[];if(C.length>0){let x=C.map(E=>{var R,P;return`${E.key}~${(R=E.rangeFilter)===null||R===void 0?void 0:R.from}_${(P=E.rangeFilter)===null||P===void 0?void 0:P.to}`}).join("*");g.append(U.RANGE_FILTERS,x)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&g.append(U.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&g.append(U.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&g.append(U.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((y=(p=e.paging)===null||p===void 0?void 0:p.perPage)!==null&&y!==void 0?y:this.defaultPerPage)!=this.defaultPerPage&&g.append(U.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&g.append(U.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let A=(b=e.otherQueryParams)!==null&&b!==void 0?b:{};for(let x in A)g.append(x,A[x]);let S=new Array;return g.forEach((x,E)=>{S.push(this.encodeQueryString(E)+"="+this.encodeQueryString(x))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var o;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(o=this.scopeMapping[i])!==null&&o!==void 0?o:a.scope}}fromURLSearchParams(e){var o,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(C){console.warn("Could not decode search request query params, fallback on raw value",C)}let d=new URLSearchParams(e),f=d.get(U.LOCALE)==="all"?void 0:d.get(U.LOCALE),h=((o=d.get(U.VIRTUAL_FIELD))!==null&&o!==void 0?o:"EVERYWHERE").toUpperCase(),p=(n=d.get(U.SORT))===null||n===void 0?void 0:n.toLowerCase(),y=(a=d.get(U.SCOPE))!==null&&a!==void 0?a:"default",b=+((i=d.get(U.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),g=d.get(U.KEYWORD_MATCH),O=g?g.toUpperCase()===At.MANDATORY?At.MANDATORY:At.OPTIONAL:void 0,w={};for(let C of d.keys())zs(C)||(w[C]=d.get(C));return{contentLocale:f??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(U.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[y])!==null&&l!==void 0?l:"DEFAULT",virtualField:Ps(h)?h:"EVERYWHERE",sortId:p,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:ze(1,isNaN(b)?this.defaultPerPage:b,1e3)},keywordMatch:O,otherQueryParams:w}}parseCompatFilters(e){var o,n,a,i,s,l;let d=[];return e.has(U.FILTERS)&&(d=this.parseValueFilters((o=e.get(U.FILTERS))!==null&&o!==void 0?o:"")),(n=e.has(U.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(U.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(U.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(U.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(U.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(o=>o.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],valueFilter:{values:o[1].split("_").map($s).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],dateFilter:{type:Rt[o[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],rangeFilter:{from:o[1].split("_")[0],to:o[1].split("_")[1]}}))}escapeFilters(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replaceAll(o,n);return e}superEscapeFilters(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replace(a,o);return e}parseLegacyPeriodFilter(e){if(Ls(e))return[{key:"ft:lastEdition",dateFilter:{type:Rt[e]}}];if(e.startsWith("CUSTOM_")){let[o,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var Ln={};D(Ln,{toFtFormComponent:()=>tu});var Pn=Symbol("elementInternals"),tu=ee(Symbol("toFtFormComponent"),function(t){class e extends t{static get formAssociated(){return!0}get form(){return this[Pn].form}constructor(...n){super(n),this[Pn]=this.attachInternals()}setFormValue(n){this[Pn].setFormValue(n)}}return e});var Nn={};D(Nn,{DateFormatter:()=>or});var or=class{static format(e,o,n,a){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,o,n,a)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,n,a){let i=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(i);if(!a)return s;let l=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(i);return`${s} ${l}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var Dn={};D(Dn,{ALL_KEYS_VALUE:()=>kn,SameWindowStorageEvent:()=>_t});var kn="__all__",_t=class extends CustomEvent{constructor(e,o,n){super("same-window-storage",{detail:{key:e,oldValue:o,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==kn}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(t,e,o){let n=e.getItem(o[0]);Reflect.apply(t,e,o),window.dispatchEvent(new _t(o[0],n,o[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(t,e,o){let n=e.getItem(o[0]);Reflect.apply(t,e,o),window.dispatchEvent(new _t(o[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(t,e,o){Reflect.apply(t,e,o),window.dispatchEvent(new _t(kn))}});var Fn={};D(Fn,{FocusMainContentEvent:()=>Mn});var Mn=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var Ws={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function ru(t){(t.key==="Enter"||t.key===" "||t.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=t.key}function ou(t){window.FluidTopicsA11yHints.isKeyboardNavigation=t.detail==0}document.addEventListener("keydown",ru);document.addEventListener("click",ou);var js=W`
48
+ `;var Ci={};var Xo={};D(Xo,{ParametrizedLabelResolver:()=>Yt});var Yt=class t{constructor(e,o){this.defaultLabels=e,this.labels=o}resolve(e,...o){var n,a;e=this.resolvePluralKey(e,o);let i=(a=(n=this.labels[e])!==null&&n!==void 0?n:this.defaultLabels[e])!==null&&a!==void 0?a:"";return t.replaceParameters(i,...o)}static replaceParameters(e,...o){return o.forEach((n,a)=>e=e.replace(new RegExp(`\\{${a}([^}]*)\\}`,"g"),(i,s)=>t.formatValue(n,s))),e}resolvePluralKey(e,o){for(let n of o)if(typeof n=="number"){let a=`${String(e)}[\\=${n}]`;if(a in this.labels||a in this.defaultLabels)return a}return e}static formatValue(e,o){return e instanceof Date?t.formatDate(e,o):e??""}static formatDate(e,o){let n=a=>o?.includes("date")?e.toLocaleDateString(a):o?.includes("time")?e.toLocaleTimeString(a):e.toLocaleString(a);try{return n(document.documentElement.lang)}catch{return n()}}};var Cn={};D(Cn,{FtCommandQueue:()=>Jt,FtLitElementRedux:()=>Qo,FtReduxStore:()=>rr,FtStateManager:()=>wn,ReduxWatcher:()=>Nr,clearAllStores:()=>Zd,isFtReduxStore:()=>xt,redux:()=>dd,reduxEventListener:()=>ud,reduxReactive:()=>ld,watch:()=>qd,withRedux:()=>Ai});var ld=()=>(t,e)=>{var o;let n=t.constructor;n.reduxReactiveProperties=new Set(n.reduxReactiveProperties),(o=n.reduxReactiveProperties)===null||o===void 0||o.add(e)},dd=t=>{let e=t??{};return(o,n)=>{var a;let i={hasChanged:$e,attribute:!1,...e};T(i)(o,n);let s=o.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(a=e.selector)!==null&&a!==void 0?a:l=>l[n],store:e.store})}},ud=t=>(e,o)=>{let n=e.constructor;n.reduxEventListeners=new Map(n.reduxEventListeners),n.reduxEventListeners.set(o,t)};var Jt=class{constructor(){this.queue=[]}add(e,o=!1){o&&this.clear(e.type),this.queue.push(e)}consume(e){let o=this.queue.find(n=>n.type===e);return o&&(this.queue=this.queue.filter(n=>n!==o)),o}clear(e){typeof e=="string"?this.queue=this.queue.filter(o=>o.type!==e):this.queue=this.queue.filter(o=>!e.test(o.type))}};function xt(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Xt=Symbol("internalReduxEventsUnsubscribers"),Ie=Symbol("internalStoresUnsubscribers"),Xe=Symbol("internalStores"),Ai=ee(Symbol("withRedux"),function(t){var e,o,n;class a extends t{constructor(){super(...arguments),this[e]=new Map,this[o]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&this.updateFromStores()}getUnnamedStore(){if(this[Xe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Xe].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Xe].get(s)}addStore(s,l){var d;l=(d=l??s.name)!==null&&d!==void 0?d:"default-store",this.unsubscribeFromStore(l),this[Xe].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Xe].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Xe].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let d=this.constructor.getPropertyOptions(l);if(!d?.attribute||!this.hasAttribute(typeof d?.attribute=="string"?d.attribute:l)){let f=this.getStore(s.store);f&&(s.store?this[Ie].has(s.store):this[Ie].size>0)&&(this[l]=s.selector(f.getState(),this))}})}subscribeToStore(s,l){var d;this[Ie].set(s,l.subscribe(()=>this.updateFromStores())),this[Xt].set(s,[]),xt(l)&&l.eventBus&&((d=this.reduxConstructor.reduxEventListeners)===null||d===void 0||d.forEach((f,h)=>{if(typeof this[h]=="function"&&(!f.store||l.name===f.store)){let p=y=>this[h](y);l.addEventListener(f.eventName,p),this[Xt].get(s).push(()=>l.removeEventListener(f.eventName,p))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ie].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ie].has(s)&&this[Ie].get(s)(),this[Ie].delete(s),(l=this[Xt].get(s))===null||l===void 0||l.forEach(d=>d()),this[Xt].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=Ie,o=Xe,n=Xt,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Qo=class extends Ai(Y){};function ae(t){for(var e=arguments.length,o=Array(e>1?e-1:0),n=1;n<e;n++)o[n-1]=arguments[n];if(0)var a,i;throw Error("[Immer] minified error nr: "+t+(o.length?" "+o.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Oe(t){return!!t&&!!t[z]}function de(t){var e;return!!t&&(function(o){if(!o||typeof o!="object")return!1;var n=Object.getPrototypeOf(o);if(n===null)return!0;var a=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return a===Object||typeof a=="function"&&Function.toString.call(a)===xd}(t)||Array.isArray(t)||!!t[Ni]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ni])||ln(t)||dn(t))}function Qe(t,e,o){o===void 0&&(o=!1),Ot(t)===0?(o?Object.keys:St)(t).forEach(function(n){o&&typeof n=="symbol"||e(n,t[n],t)}):t.forEach(function(n,a){return e(a,n,t)})}function Ot(t){var e=t[z];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ln(t)?2:dn(t)?3:0}function vt(t,e){return Ot(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function fd(t,e){return Ot(t)===2?t.get(e):t[e]}function ki(t,e,o){var n=Ot(t);n===2?t.set(e,o):n===3?t.add(o):t[e]=o}function Di(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function ln(t){return gd&&t instanceof Map}function dn(t){return bd&&t instanceof Set}function _e(t){return t.o||t.t}function un(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Ui(t);delete e[z];for(var o=St(e),n=0;n<o.length;n++){var a=o[n],i=e[a];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[a]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[a]})}return Object.create(Object.getPrototypeOf(t),e)}function fn(t,e){return e===void 0&&(e=!1),pn(t)||Oe(t)||!de(t)||(Ot(t)>1&&(t.set=t.add=t.clear=t.delete=pd),Object.freeze(t),e&&Qe(t,function(o,n){return fn(n,!0)},!0)),t}function pd(){ae(2)}function pn(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function ge(t){var e=cn[t];return e||ae(18,t),e}function hd(t,e){cn[t]||(cn[t]=e)}function nn(){return er}function en(t,e){e&&(ge("Patches"),t.u=[],t.s=[],t.v=e)}function Ir(t){an(t),t.p.forEach(md),t.p=null}function an(t){t===er&&(er=t.l)}function Ri(t){return er={p:[],l:er,h:t,m:!0,_:0}}function md(t){var e=t[z];e.i===0||e.i===1?e.j():e.g=!0}function tn(t,e){e._=e.p.length;var o=e.p[0],n=t!==void 0&&t!==o;return e.h.O||ge("ES5").S(e,t,n),n?(o[z].P&&(Ir(e),ae(4)),de(t)&&(t=_r(e,t),e.l||Tr(e,t)),e.u&&ge("Patches").M(o[z].t,t,e.u,e.s)):t=_r(e,o,[]),Ir(e),e.u&&e.v(e.u,e.s),t!==Fi?t:void 0}function _r(t,e,o){if(pn(e))return e;var n=e[z];if(!n)return Qe(e,function(l,d){return Ii(t,n,e,l,d,o)},!0),e;if(n.A!==t)return e;if(!n.P)return Tr(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var a=n.i===4||n.i===5?n.o=un(n.k):n.o,i=a,s=!1;n.i===3&&(i=new Set(a),a.clear(),s=!0),Qe(i,function(l,d){return Ii(t,n,a,l,d,o,s)}),Tr(t,a,!1),o&&t.u&&ge("Patches").N(n,o,t.u,t.s)}return n.o}function Ii(t,e,o,n,a,i,s){if(Oe(a)){var l=_r(t,a,i&&e&&e.i!==3&&!vt(e.R,n)?i.concat(n):void 0);if(ki(o,n,l),!Oe(l))return;t.m=!1}else s&&o.add(a);if(de(a)&&!pn(a)){if(!t.h.D&&t._<1)return;_r(t,a),e&&e.A.l||Tr(t,a)}}function Tr(t,e,o){o===void 0&&(o=!1),!t.l&&t.h.D&&t.m&&fn(e,o)}function rn(t,e){var o=t[z];return(o?_e(o):t)[e]}function _i(t,e){if(e in t)for(var o=Object.getPrototypeOf(t);o;){var n=Object.getOwnPropertyDescriptor(o,e);if(n)return n;o=Object.getPrototypeOf(o)}}function Te(t){t.P||(t.P=!0,t.l&&Te(t.l))}function on(t){t.o||(t.o=un(t.t))}function sn(t,e,o){var n=ln(e)?ge("MapSet").F(e,o):dn(e)?ge("MapSet").T(e,o):t.O?function(a,i){var s=Array.isArray(a),l={i:s?1:0,A:i?i.A:nn(),P:!1,I:!1,R:{},l:i,t:a,k:null,o:null,j:null,C:!1},d=l,f=tr;s&&(d=[l],f=Qt);var h=Proxy.revocable(d,f),p=h.revoke,y=h.proxy;return l.k=y,l.j=p,y}(e,o):ge("ES5").J(e,o);return(o?o.A:nn()).p.push(n),n}function yd(t){return Oe(t)||ae(22,t),function e(o){if(!de(o))return o;var n,a=o[z],i=Ot(o);if(a){if(!a.P&&(a.i<4||!ge("ES5").K(a)))return a.t;a.I=!0,n=Ti(o,i),a.I=!1}else n=Ti(o,i);return Qe(n,function(s,l){a&&fd(a.t,s)===l||ki(n,s,e(l))}),i===3?new Set(n):n}(t)}function Ti(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return un(t)}function Mi(){function t(s,l){var d=i[s];return d?d.enumerable=l:i[s]=d={configurable:!0,enumerable:l,get:function(){var f=this[z];return tr.get(f,s)},set:function(f){var h=this[z];tr.set(h,s,f)}},d}function e(s){for(var l=s.length-1;l>=0;l--){var d=s[l][z];if(!d.P)switch(d.i){case 5:n(d)&&Te(d);break;case 4:o(d)&&Te(d)}}}function o(s){for(var l=s.t,d=s.k,f=St(d),h=f.length-1;h>=0;h--){var p=f[h];if(p!==z){var y=l[p];if(y===void 0&&!vt(l,p))return!0;var b=d[p],g=b&&b[z];if(g?g.t!==y:!Di(b,y))return!0}}var O=!!l[z];return f.length!==St(l).length+(O?0:1)}function n(s){var l=s.k;if(l.length!==s.t.length)return!0;var d=Object.getOwnPropertyDescriptor(l,l.length-1);if(d&&!d.get)return!0;for(var f=0;f<l.length;f++)if(!l.hasOwnProperty(f))return!0;return!1}function a(s){s.g&&ae(3,JSON.stringify(_e(s)))}var i={};hd("ES5",{J:function(s,l){var d=Array.isArray(s),f=function(p,y){if(p){for(var b=Array(y.length),g=0;g<y.length;g++)Object.defineProperty(b,""+g,t(g,!0));return b}var O=Ui(y);delete O[z];for(var w=St(O),C=0;C<w.length;C++){var A=w[C];O[A]=t(A,p||!!O[A].enumerable)}return Object.create(Object.getPrototypeOf(y),O)}(d,s),h={i:d?5:4,A:l?l.A:nn(),P:!1,I:!1,R:{},l,t:s,k:f,o:null,g:!1,C:!1};return Object.defineProperty(f,z,{value:h,writable:!0}),f},S:function(s,l,d){d?Oe(l)&&l[z].A===s&&e(s.p):(s.u&&function f(h){if(h&&typeof h=="object"){var p=h[z];if(p){var y=p.t,b=p.k,g=p.R,O=p.i;if(O===4)Qe(b,function(x){x!==z&&(y[x]!==void 0||vt(y,x)?g[x]||f(b[x]):(g[x]=!0,Te(p)))}),Qe(y,function(x){b[x]!==void 0||vt(b,x)||(g[x]=!1,Te(p))});else if(O===5){if(n(p)&&(Te(p),g.length=!0),b.length<y.length)for(var w=b.length;w<y.length;w++)g[w]=!1;else for(var C=y.length;C<b.length;C++)g[C]=!0;for(var A=Math.min(b.length,y.length),S=0;S<A;S++)b.hasOwnProperty(S)||(g[S]=!0),g[S]===void 0&&f(b[S])}}}}(s.p[0]),e(s.p))},K:function(s){return s.i===4?o(s):n(s)}})}var Pi,er,hn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",gd=typeof Map<"u",bd=typeof Set<"u",Li=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Fi=hn?Symbol.for("immer-nothing"):((Pi={})["immer-nothing"]=!0,Pi),Ni=hn?Symbol.for("immer-draftable"):"__$immer_draftable",z=hn?Symbol.for("immer-state"):"__$immer_state";var xd=""+Object.prototype.constructor,St=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Ui=Object.getOwnPropertyDescriptors||function(t){var e={};return St(t).forEach(function(o){e[o]=Object.getOwnPropertyDescriptor(t,o)}),e},cn={},tr={get:function(t,e){if(e===z)return t;var o=_e(t);if(!vt(o,e))return function(a,i,s){var l,d=_i(i,s);return d?"value"in d?d.value:(l=d.get)===null||l===void 0?void 0:l.call(a.k):void 0}(t,o,e);var n=o[e];return t.I||!de(n)?n:n===rn(t.t,e)?(on(t),t.o[e]=sn(t.A.h,n,t)):n},has:function(t,e){return e in _e(t)},ownKeys:function(t){return Reflect.ownKeys(_e(t))},set:function(t,e,o){var n=_i(_e(t),e);if(n?.set)return n.set.call(t.k,o),!0;if(!t.P){var a=rn(_e(t),e),i=a?.[z];if(i&&i.t===o)return t.o[e]=o,t.R[e]=!1,!0;if(Di(o,a)&&(o!==void 0||vt(t.t,e)))return!0;on(t),Te(t)}return t.o[e]===o&&(o!==void 0||e in t.o)||Number.isNaN(o)&&Number.isNaN(t.o[e])||(t.o[e]=o,t.R[e]=!0),!0},deleteProperty:function(t,e){return rn(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,on(t),Te(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var o=_e(t),n=Reflect.getOwnPropertyDescriptor(o,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:o[e]}},defineProperty:function(){ae(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ae(12)}},Qt={};Qe(tr,function(t,e){Qt[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}}),Qt.deleteProperty=function(t,e){return Qt.set.call(this,t,e,void 0)},Qt.set=function(t,e,o){return tr.set.call(this,t[0],e,o,t[0])};var vd=function(){function t(o){var n=this;this.O=Li,this.D=!0,this.produce=function(a,i,s){if(typeof a=="function"&&typeof i!="function"){var l=i;i=a;var d=n;return function(O){var w=this;O===void 0&&(O=l);for(var C=arguments.length,A=Array(C>1?C-1:0),S=1;S<C;S++)A[S-1]=arguments[S];return d.produce(O,function(x){var E;return(E=i).call.apply(E,[w,x].concat(A))})}}var f;if(typeof i!="function"&&ae(6),s!==void 0&&typeof s!="function"&&ae(7),de(a)){var h=Ri(n),p=sn(n,a,void 0),y=!0;try{f=i(p),y=!1}finally{y?Ir(h):an(h)}return typeof Promise<"u"&&f instanceof Promise?f.then(function(O){return en(h,s),tn(O,h)},function(O){throw Ir(h),O}):(en(h,s),tn(f,h))}if(!a||typeof a!="object"){if((f=i(a))===void 0&&(f=a),f===Fi&&(f=void 0),n.D&&fn(f,!0),s){var b=[],g=[];ge("Patches").M(a,f,b,g),s(b,g)}return f}ae(21,a)},this.produceWithPatches=function(a,i){if(typeof a=="function")return function(f){for(var h=arguments.length,p=Array(h>1?h-1:0),y=1;y<h;y++)p[y-1]=arguments[y];return n.produceWithPatches(f,function(b){return a.apply(void 0,[b].concat(p))})};var s,l,d=n.produce(a,i,function(f,h){s=f,l=h});return typeof Promise<"u"&&d instanceof Promise?d.then(function(f){return[f,s,l]}):[d,s,l]},typeof o?.useProxies=="boolean"&&this.setUseProxies(o.useProxies),typeof o?.autoFreeze=="boolean"&&this.setAutoFreeze(o.autoFreeze)}var e=t.prototype;return e.createDraft=function(o){de(o)||ae(8),Oe(o)&&(o=yd(o));var n=Ri(this),a=sn(this,o,void 0);return a[z].C=!0,an(n),a},e.finishDraft=function(o,n){var a=o&&o[z],i=a.A;return en(i,n),tn(void 0,i)},e.setAutoFreeze=function(o){this.D=o},e.setUseProxies=function(o){o&&!Li&&ae(20),this.O=o},e.applyPatches=function(o,n){var a;for(a=n.length-1;a>=0;a--){var i=n[a];if(i.path.length===0&&i.op==="replace"){o=i.value;break}}a>-1&&(n=n.slice(a+1));var s=ge("Patches").$;return Oe(o)?s(o,n):this.produce(o,function(l){return s(l,n)})},t}(),te=new vd,Sd=te.produce,qy=te.produceWithPatches.bind(te),Yy=te.setAutoFreeze.bind(te),Jy=te.setUseProxies.bind(te),Xy=te.applyPatches.bind(te),Qy=te.createDraft.bind(te),eg=te.finishDraft.bind(te),Pr=Sd;function et(t){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(t)}function Bi(t,e){if(et(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(et(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hi(t){var e=Bi(t,"string");return et(e)=="symbol"?e:e+""}function $i(t,e,o){return(e=Hi(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function zi(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),o.push.apply(o,n)}return o}function mn(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?zi(Object(o),!0).forEach(function(n){$i(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):zi(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function q(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 Wi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),yn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Lr={INIT:"@@redux/INIT"+yn(),REPLACE:"@@redux/REPLACE"+yn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+yn()}};function Od(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function gn(t,e,o){var n;if(typeof e=="function"&&typeof o=="function"||typeof o=="function"&&typeof arguments[3]=="function")throw new Error(q(0));if(typeof e=="function"&&typeof o>"u"&&(o=e,e=void 0),typeof o<"u"){if(typeof o!="function")throw new Error(q(1));return o(gn)(t,e)}if(typeof t!="function")throw new Error(q(2));var a=t,i=e,s=[],l=s,d=!1;function f(){l===s&&(l=s.slice())}function h(){if(d)throw new Error(q(3));return i}function p(O){if(typeof O!="function")throw new Error(q(4));if(d)throw new Error(q(5));var w=!0;return f(),l.push(O),function(){if(w){if(d)throw new Error(q(6));w=!1,f();var A=l.indexOf(O);l.splice(A,1),s=null}}}function y(O){if(!Od(O))throw new Error(q(7));if(typeof O.type>"u")throw new Error(q(8));if(d)throw new Error(q(9));try{d=!0,i=a(i,O)}finally{d=!1}for(var w=s=l,C=0;C<w.length;C++){var A=w[C];A()}return O}function b(O){if(typeof O!="function")throw new Error(q(10));a=O,y({type:Lr.REPLACE})}function g(){var O,w=p;return O={subscribe:function(A){if(typeof A!="object"||A===null)throw new Error(q(11));function S(){A.next&&A.next(h())}S();var x=w(S);return{unsubscribe:x}}},O[Wi]=function(){return this},O}return y({type:Lr.INIT}),n={dispatch:y,subscribe:p,getState:h,replaceReducer:b},n[Wi]=g,n}function Ed(t){Object.keys(t).forEach(function(e){var o=t[e],n=o(void 0,{type:Lr.INIT});if(typeof n>"u")throw new Error(q(12));if(typeof o(void 0,{type:Lr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(q(13))})}function ji(t){for(var e=Object.keys(t),o={},n=0;n<e.length;n++){var a=e[n];typeof t[a]=="function"&&(o[a]=t[a])}var i=Object.keys(o),s,l;try{Ed(o)}catch(d){l=d}return function(f,h){if(f===void 0&&(f={}),l)throw l;if(0)var p;for(var y=!1,b={},g=0;g<i.length;g++){var O=i[g],w=o[O],C=f[O],A=w(C,h);if(typeof A>"u"){var S=h&&h.type;throw new Error(q(14))}b[O]=A,y=y||A!==C}return y=y||i.length!==Object.keys(f).length,y?b:f}}function Et(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,a){return function(){return n(a.apply(void 0,arguments))}})}function Gi(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return function(n){return function(){var a=n.apply(void 0,arguments),i=function(){throw new Error(q(15))},s={getState:a.getState,dispatch:function(){return i.apply(void 0,arguments)}},l=e.map(function(d){return d(s)});return i=Et.apply(void 0,l)(a.dispatch),mn(mn({},a),{},{dispatch:i})}}}function Vi(t){var e=function(n){var a=n.dispatch,i=n.getState;return function(s){return function(l){return typeof l=="function"?l(a,i,t):s(l)}}};return e}var Ki=Vi();Ki.withExtraArgument=Vi;var bn=Ki;var Xi=function(){var t=function(e,o){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},t(e,o)};return function(e,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}(),wd=function(t,e){var o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(f){return function(h){return d([f,h])}}function d(f){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,a&&(i=f[0]&2?a.return:f[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,f[1])).done)return i;switch(a=0,i&&(f=[f[0]&2,i.value]),f[0]){case 0:case 1:i=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,a=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!(i=i.length>0&&i[i.length-1])&&(f[0]===6||f[0]===2)){o=0;continue}if(f[0]===3&&(!i||f[1]>i[0]&&f[1]<i[3])){o.label=f[1];break}if(f[0]===6&&o.label<i[1]){o.label=i[1],i=f;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(f);break}i[2]&&o.ops.pop(),o.trys.pop();continue}f=e.call(t,o)}catch(h){f=[6,h],a=0}finally{n=i=0}if(f[0]&5)throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}},wt=function(t,e){for(var o=0,n=e.length,a=t.length;o<n;o++,a++)t[a]=e[o];return t},Cd=Object.defineProperty,Ad=Object.defineProperties,Rd=Object.getOwnPropertyDescriptors,Zi=Object.getOwnPropertySymbols,Id=Object.prototype.hasOwnProperty,_d=Object.prototype.propertyIsEnumerable,qi=function(t,e,o){return e in t?Cd(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o},Pe=function(t,e){for(var o in e||(e={}))Id.call(e,o)&&qi(t,o,e[o]);if(Zi)for(var n=0,a=Zi(e);n<a.length;n++){var o=a[n];_d.call(e,o)&&qi(t,o,e[o])}return t},xn=function(t,e){return Ad(t,Rd(e))},Td=function(t,e,o){return new Promise(function(n,a){var i=function(d){try{l(o.next(d))}catch(f){a(f)}},s=function(d){try{l(o.throw(d))}catch(f){a(f)}},l=function(d){return d.done?n(d.value):Promise.resolve(d.value).then(i,s)};l((o=o.apply(t,e)).next())})};var Pd=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Et:Et.apply(null,arguments)},bg=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Ld(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var o=e;Object.getPrototypeOf(o)!==null;)o=Object.getPrototypeOf(o);return e===o}var Nd=function(t){Xi(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,wt([void 0],o[0].concat(this)))):new(e.bind.apply(e,wt([void 0],o.concat(this))))},e}(Array),kd=function(t){Xi(e,t);function e(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];var a=t.apply(this,o)||this;return Object.setPrototypeOf(a,e.prototype),a}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return t.prototype.concat.apply(this,o)},e.prototype.prepend=function(){for(var o=[],n=0;n<arguments.length;n++)o[n]=arguments[n];return o.length===1&&Array.isArray(o[0])?new(e.bind.apply(e,wt([void 0],o[0].concat(this)))):new(e.bind.apply(e,wt([void 0],o.concat(this))))},e}(Array);function On(t){return de(t)?Pr(t,function(){}):t}function Dd(t){return typeof t=="boolean"}function Md(){return function(e){return Fd(e)}}function Fd(t){t===void 0&&(t={});var e=t.thunk,o=e===void 0?!0:e,n=t.immutableCheck,a=n===void 0?!0:n,i=t.serializableCheck,s=i===void 0?!0:i,l=new Nd;if(o&&(Dd(o)?l.push(bn):l.push(bn.withExtraArgument(o.extraArgument))),0){if(a)var d;if(s)var f}return l}var vn=!0;function Qi(t){var e=Md(),o=t||{},n=o.reducer,a=n===void 0?void 0:n,i=o.middleware,s=i===void 0?e():i,l=o.devTools,d=l===void 0?!0:l,f=o.preloadedState,h=f===void 0?void 0:f,p=o.enhancers,y=p===void 0?void 0:p,b;if(typeof a=="function")b=a;else if(Ld(a))b=ji(a);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var g=s;if(typeof g=="function"&&(g=g(e),!vn&&!Array.isArray(g)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!vn&&g.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var O=Gi.apply(void 0,g),w=Et;d&&(w=Pd(Pe({trace:!vn},typeof d=="object"&&d)));var C=new kd(O),A=C;Array.isArray(y)?A=wt([O],y):typeof y=="function"&&(A=y(C));var S=w.apply(void 0,A);return gn(b,h,S)}function Le(t,e){function o(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(e){var i=e.apply(void 0,n);if(!i)throw new Error("prepareAction did not return an object");return Pe(Pe({type:t,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:t,payload:n[0]}}return o.toString=function(){return""+t},o.type=t,o.match=function(n){return n.type===t},o}function es(t){var e={},o=[],n,a={addCase:function(i,s){var l=typeof i=="string"?i:i.type;if(l in e)throw new Error("addCase cannot be called with two reducers for the same action type");return e[l]=s,a},addMatcher:function(i,s){return o.push({matcher:i,reducer:s}),a},addDefaultCase:function(i){return n=i,a}};return t(a),[e,o,n]}function Ud(t){return typeof t=="function"}function Bd(t,e,o,n){o===void 0&&(o=[]);var a=typeof e=="function"?es(e):[e,o,n],i=a[0],s=a[1],l=a[2],d;if(Ud(t))d=function(){return On(t())};else{var f=On(t);d=function(){return f}}function h(p,y){p===void 0&&(p=d());var b=wt([i[y.type]],s.filter(function(g){var O=g.matcher;return O(y)}).map(function(g){var O=g.reducer;return O}));return b.filter(function(g){return!!g}).length===0&&(b=[l]),b.reduce(function(g,O){if(O)if(Oe(g)){var w=g,C=O(w,y);return C===void 0?g:C}else{if(de(g))return Pr(g,function(A){return O(A,y)});var C=O(g,y);if(C===void 0){if(g===null)return g;throw Error("A case reducer on a non-draftable value must not return undefined")}return C}return g},p)}return h.getInitialState=d,h}function Hd(t,e){return t+"/"+e}function ts(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var o=typeof t.initialState=="function"?t.initialState:On(t.initialState),n=t.reducers||{},a=Object.keys(n),i={},s={},l={};a.forEach(function(h){var p=n[h],y=Hd(e,h),b,g;"reducer"in p?(b=p.reducer,g=p.prepare):b=p,i[h]=b,s[y]=b,l[h]=g?Le(y,g):Le(y)});function d(){var h=typeof t.extraReducers=="function"?es(t.extraReducers):[t.extraReducers],p=h[0],y=p===void 0?{}:p,b=h[1],g=b===void 0?[]:b,O=h[2],w=O===void 0?void 0:O,C=Pe(Pe({},y),s);return Bd(o,function(A){for(var S in C)A.addCase(S,C[S]);for(var x=0,E=g;x<E.length;x++){var R=E[x];A.addMatcher(R.matcher,R.reducer)}w&&A.addDefaultCase(w)})}var f;return{name:e,reducer:function(h,p){return f||(f=d()),f(h,p)},actions:l,caseReducers:i,getInitialState:function(){return f||(f=d()),f.getInitialState()}}}var $d="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",zd=function(t){t===void 0&&(t=21);for(var e="",o=t;o--;)e+=$d[Math.random()*64|0];return e},Wd=["name","message","stack","code"],Sn=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),Yi=function(){function t(e,o){this.payload=e,this.meta=o}return t}(),jd=function(t){if(typeof t=="object"&&t!==null){for(var e={},o=0,n=Wd;o<n.length;o++){var a=n[o];typeof t[a]=="string"&&(e[a]=t[a])}return e}return{message:String(t)}},Og=function(){function t(e,o,n){var a=Le(e+"/fulfilled",function(h,p,y,b){return{payload:h,meta:xn(Pe({},b||{}),{arg:y,requestId:p,requestStatus:"fulfilled"})}}),i=Le(e+"/pending",function(h,p,y){return{payload:void 0,meta:xn(Pe({},y||{}),{arg:p,requestId:h,requestStatus:"pending"})}}),s=Le(e+"/rejected",function(h,p,y,b,g){return{payload:b,error:(n&&n.serializeError||jd)(h||"Rejected"),meta:xn(Pe({},g||{}),{arg:y,requestId:p,rejectedWithValue:!!b,requestStatus:"rejected",aborted:h?.name==="AbortError",condition:h?.name==="ConditionError"})}}),l=!1,d=typeof AbortController<"u"?AbortController:function(){function h(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return h.prototype.abort=function(){},h}();function f(h){return function(p,y,b){var g=n?.idGenerator?n.idGenerator(h):zd(),O=new d,w,C=!1;function A(x){w=x,O.abort()}var S=function(){return Td(this,null,function(){var x,E,R,P,M,N,_;return wd(this,function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),P=(x=n?.condition)==null?void 0:x.call(n,h,{getState:y,extra:b}),Vd(P)?[4,P]:[3,2];case 1:P=m.sent(),m.label=2;case 2:if(P===!1||O.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return C=!0,M=new Promise(function(v,I){return O.signal.addEventListener("abort",function(){return I({name:"AbortError",message:w||"Aborted"})})}),p(i(g,h,(E=n?.getPendingMeta)==null?void 0:E.call(n,{requestId:g,arg:h},{getState:y,extra:b}))),[4,Promise.race([M,Promise.resolve(o(h,{dispatch:p,getState:y,extra:b,requestId:g,signal:O.signal,abort:A,rejectWithValue:function(v,I){return new Sn(v,I)},fulfillWithValue:function(v,I){return new Yi(v,I)}})).then(function(v){if(v instanceof Sn)throw v;return v instanceof Yi?a(v.payload,g,h,v.meta):a(v,g,h)})])];case 3:return R=m.sent(),[3,5];case 4:return N=m.sent(),R=N instanceof Sn?s(null,g,h,N.payload,N.meta):s(N,g,h),[3,5];case 5:return _=n&&!n.dispatchConditionRejection&&s.match(R)&&R.meta.condition,_||p(R),[2,R]}})})}();return Object.assign(S,{abort:A,requestId:g,arg:h,unwrap:function(){return S.then(Gd)}})}}return Object.assign(f,{pending:i,rejected:s,fulfilled:a,typePrefix:e})}return t.withTypes=function(){return t},t}();function Gd(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Vd(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var rs="listener",os="completed",ns="cancelled",Eg="task-"+ns,wg="task-"+os,Cg=rs+"-"+ns,Ag=rs+"-"+os;var En="listenerMiddleware";var Rg=Le(En+"/add"),Ig=Le(En+"/removeAll"),_g=Le(En+"/remove");var Ji,Tg=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(Ji||(Ji=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Kd=function(t){return function(e){setTimeout(e,t)}},Pg=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Kd(10);Mi();window.ftReduxStores||(window.ftReduxStores={});var rr=class t extends ve{static get(e){var o;let n=typeof e=="string"?e:e.name,a=typeof e=="string"?void 0:e,i=window.ftReduxStores[n];if(xt(i))return i;if(a==null)return;let s=ts({...a,reducers:(o=a.reducers)!==null&&o!==void 0?o:{}}),l=Qi({reducer:(d,f)=>{if(f.type==="CLEAR_FT_REDUX_STORE"){let h=We(s.getInitialState());for(let p of f.keeping)h[p]=(d??h)[p];return h}else if(typeof f.type=="string"&&f.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...d,...f.overwrites};return s.reducer(d,f)}});return window.ftReduxStores[a.name]=new t(s,l,a.eventBus)}constructor(e,o,n){super(),this.reduxSlice=e,this.reduxStore=o,this.isFtReduxStore=!0,this.commands=new Jt;let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let d=s,f=i[d];return f?(...h)=>{let p=f(...h.map(a));return this.reduxStore.dispatch(p),p}:h=>{this.setState({[d]:a(h)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};function Zd(){var t;for(let e of Object.values((t=window.ftReduxStores)!==null&&t!==void 0?t:{}))xt(e)&&e.clear()}var Nr=class{constructor(e,o,n){this.store=e,this.valueSelector=o,this.callback=n}watch(){return this.stop(),this.lastValue=this.valueSelector(this.store.getState()),this.unsubscribe=this.store.subscribe(()=>{let e=this.store.getState(),o=this.valueSelector(e);$e(this.lastValue,o)&&(this.callback(o,e),this.lastValue=o)}),this}stop(){return this.unsubscribe!=null&&(this.unsubscribe(),this.unsubscribe=void 0),this.lastValue=void 0,this}};function qd(t,e,o){return new Nr(t,e,o).watch()}var wn=class{constructor(){this.requestConsumers=new Map}getOrCreateRequestConsumers(e){var o;return(o=this.requestConsumers.get(e))!==null&&o!==void 0?o:this.requestConsumers.set(e,new Set).get(e)}registerComponent(e,o){for(let n of o)this.getOrCreateRequestConsumers(n).add(e).size==1&&this.onNewNeededRequest(n)}unregisterComponent(e,o){for(let n of o)this.getOrCreateRequestConsumers(n).delete(e)}isRequestNeeded(e){return this.getOrCreateRequestConsumers(e).size>0}};var In={};D(In,{scrollHelper:()=>Yd});var An,kr=new Map,Rn=class{lock(e,o){if(o){let n=kr.get(o);if(n==null||n===e)return kr.set(o,e),o}}release(e,o){o&&kr.get(o)===e&&kr.delete(o)}findFirstScrollableParent(e){var o;let n,a;for(let i of co(e)){let s=i,l=this.elementCanScroll(s);if(l&&s.clientHeight&&s.clientHeight<s.scrollHeight){n=s;break}else l&&a==null&&(a=s)}return(o=n??a)!==null&&o!==void 0?o:document.body}elementCanScroll(e){try{return["auto","scroll"].includes(getComputedStyle(e).overflowY)&&!["contents"].includes(getComputedStyle(e).display)}catch{return!1}}getAbsoluteScrollOffset(e,o){var n,a;let i=0;for(;o&&o.offsetParent!==e.offsetParent;)i+=(n=o.offsetTop)!==null&&n!==void 0?n:0,o=o.offsetParent;return i+((a=o?.offsetTop)!==null&&a!==void 0?a:0)-e.offsetTop}computeTopOffsetRatio(e,o){if(typeof e=="number")return e;switch(e){case"end":return 1;case"center":return .5;case"nearest":return o;default:return 0}}scrollIntoViewIfPossible(e,o){let n=this.findFirstScrollableParent(e);if(e&&this.lock(this,n)){let a=this.getAbsoluteScrollOffset(n,e),i=a-n.clientHeight+e.clientHeight,s=a,l=ze(0,(s-n.scrollTop)/(s-i),1),d=this.computeTopOffsetRatio(o?.position,l)*(i-s)+s;n.scrollTo({behavior:o?.behavior,top:d})}else console.warn("Could not scroll element into view because the scrollable parent is already locked",e,n);this.release(this,n)}};window.FluidTopicsScrollHelper=(An=window.FluidTopicsScrollHelper)!==null&&An!==void 0?An:new Rn;var Yd=window.FluidTopicsScrollHelper;var Tn={};D(Tn,{SearchPlaceConverter:()=>It,SearchPlaceQueryParams:()=>U,isSearchPlaceQueryParams:()=>zs,serializeRequest:()=>Qd});var Jd=ic(is(),1);var ss;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ss||(ss={}));var cs;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(cs||(cs={}));var ls;(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"})(ls||(ls={}));var ds;(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"})(ds||(ds={}));var us;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(us||(us={}));var fs;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(fs||(fs={}));var ps;(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"})(ps||(ps={}));var hs;(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"})(hs||(hs={}));var ms;(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"})(ms||(ms={}));var ys;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(ys||(ys={}));var gs;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(gs||(gs={}));var bs;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(bs||(bs={}));var xs;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(xs||(xs={}));var vs;(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"})(vs||(vs={}));var At;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(At||(At={}));var Ss;(function(t){t.ASC="ASC",t.DESC="DESC"})(Ss||(Ss={}));var Os;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})(Os||(Os={}));var _n;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(_n||(_n={}));var Ps=t=>Object.keys(_n).includes(t);var Es;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Es||(Es={}));var ws;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(ws||(ws={}));var Cs;(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"})(Cs||(Cs={}));var Rt;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Rt||(Rt={}));var Ls=t=>Object.keys(Rt).includes(t);var As;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(As||(As={}));var Rs;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Rs||(Rs={}));var Is;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Is||(Is={}));var j;(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"})(j||(j={}));var _s;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(_s||(_s={}));var Ts;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Ts||(Ts={}));var Ns;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(Ns||(Ns={}));var ks;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.OTHER="OTHER"})(ks||(ks={}));var Ds;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Ds||(Ds={}));var Ms;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Ms||(Ms={}));var Fs;(function(t){t.USER="USER",t.ASSISTANT="ASSISTANT"})(Fs||(Fs={}));var Us;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Us||(Us={}));var Bs;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(Bs||(Bs={}));var Hs;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(Hs||(Hs={}));var nb={[j.PERSONAL_BOOK_SHARE_USER]:[j.PERSONAL_BOOK_USER],[j.HTML_EXPORT_USER]:[j.PERSONAL_BOOK_USER],[j.PDF_EXPORT_USER]:[j.PERSONAL_BOOK_USER],[j.KHUB_ADMIN]:[j.CONTENT_PUBLISHER],[j.ADMIN]:[j.KHUB_ADMIN,j.USERS_ADMIN,j.PORTAL_ADMIN,j.BEHAVIOR_DATA_USER],[j.GENERATIVE_AI_EXPORT_USER]:[j.GENERATIVE_AI_USER]};function Xd(t){return`"${t}"`}function $s(t){return t.startsWith('"')&&t.endsWith('"')?t.replace(/(^"+)|("+$)/g,""):t}function Qd(t,e){return new It(t).serialize(e)}var U;(function(t){t.LOCALE="content-lang",t.QUERY="query",t.SCOPE="scope",t.FILTERS="filters",t.VIRTUAL_FIELD="virtual-field",t.PERIOD="period",t.VALUE_FILTERS="value-filters",t.DATE_FILTERS="date-filters",t.RANGE_FILTERS="range-filters",t.SORT="sort",t.PER_PAGE="per-page",t.KEYWORD_MATCH="keyword-match"})(U||(U={}));var eu=new Set(Object.values(U));function zs(t){return eu.has(t)}var It=class{constructor(e,o=20,n=!1,a="en-US"){this.baseUrl=e,this.defaultPerPage=o,this.allLanguagesAllowed=n,this.defaultContentLocale=a,this.scopeMapping={documents:"DOCUMENTS",topics:"ALL_TOPICS"},this.filtersEscapeMapping=[["*","\\*","[ft-escaped-star-character]"],["~","\\\\~","[ft-escaped-tilde-character]"],["_","\\\\\\\\_","[ft-escaped-underscore-character]"]]}serialize(e,o){return this.serializeToCurrentPageIfPossible(e,o??"/search")}serializeToCurrentPageIfPossible(e,o){let n=o==null||o.trim().length===0,a=new URL(n?window.location.href:`${this.baseUrl.replace(/\/+$/,"")}${o}`);return a.search=this.toURLSearchParams(e),a.toString()}toURLSearchParams(e,o=!1){var n,a,i,s,l,d,f,h,p,y,b;let g=new URLSearchParams;e.contentLocale?(!o||e.contentLocale!==this.defaultContentLocale)&&g.append(U.LOCALE,e.contentLocale):g.append(U.LOCALE,this.allLanguagesAllowed?"all":this.defaultContentLocale),((n=e.query)===null||n===void 0?void 0:n.length)>0&&g.append(U.QUERY,e.query);let O=(i=(a=e.metadataFilters)===null||a===void 0?void 0:a.filter(x=>x.valueFilter&&!x.valueFilter.negative))!==null&&i!==void 0?i:[];if(O.length>0){let x=O.map(E=>{var R,P;let M=((P=(R=E.valueFilter)===null||R===void 0?void 0:R.values)!==null&&P!==void 0?P:[]).map(N=>this.escapeFilters(N)).map(N=>Xd($s(N))).join("_");return`${E.key}~${M}`}).join("*");g.append(U.VALUE_FILTERS,x)}let w=(l=(s=e.metadataFilters)===null||s===void 0?void 0:s.filter(x=>x.dateFilter))!==null&&l!==void 0?l:[];if(w.length>0){let x=w.map(E=>{var R;return`${E.key}~${(R=E.dateFilter)===null||R===void 0?void 0:R.type.toLowerCase()}`}).join("*");g.append(U.DATE_FILTERS,x)}let C=(f=(d=e.metadataFilters)===null||d===void 0?void 0:d.filter(x=>x.rangeFilter))!==null&&f!==void 0?f:[];if(C.length>0){let x=C.map(E=>{var R,P;return`${E.key}~${(R=E.rangeFilter)===null||R===void 0?void 0:R.from}_${(P=E.rangeFilter)===null||P===void 0?void 0:P.to}`}).join("*");g.append(U.RANGE_FILTERS,x)}e.virtualField&&e.virtualField!=="EVERYWHERE"&&g.append(U.VIRTUAL_FIELD,e.virtualField.toLowerCase()),e.scope&&e.scope!=="DEFAULT"&&g.append(U.SCOPE,e.scope.toLowerCase()),e.sortId!=null&&g.append(U.SORT,e.sortId),!((h=e.paging)===null||h===void 0)&&h.perPage&&((y=(p=e.paging)===null||p===void 0?void 0:p.perPage)!==null&&y!==void 0?y:this.defaultPerPage)!=this.defaultPerPage&&g.append(U.PER_PAGE,String(e.paging.perPage)),e.keywordMatch!=null&&g.append(U.KEYWORD_MATCH,e.keywordMatch.toLowerCase());let A=(b=e.otherQueryParams)!==null&&b!==void 0?b:{};for(let x in A)g.append(x,A[x]);let S=new Array;return g.forEach((x,E)=>{S.push(this.encodeQueryString(E)+"="+this.encodeQueryString(x))}),encodeURI(S.join("&")).replace(/#/g,"%23")}encodeQueryString(e){return encodeURIComponent(e).replace(/%20/g,"+")}parse(e){var o;let n=e.split("?"),a=this.fromURLSearchParams(n.slice(1).join("?")),i=n[0].split("/search/")[1];return i==null?a:{...a,scope:(o=this.scopeMapping[i])!==null&&o!==void 0?o:a.scope}}fromURLSearchParams(e){var o,n,a,i,s,l;try{e=decodeURI(e).replace(/%23/g,"#")}catch(C){console.warn("Could not decode search request query params, fallback on raw value",C)}let d=new URLSearchParams(e),f=d.get(U.LOCALE)==="all"?void 0:d.get(U.LOCALE),h=((o=d.get(U.VIRTUAL_FIELD))!==null&&o!==void 0?o:"EVERYWHERE").toUpperCase(),p=(n=d.get(U.SORT))===null||n===void 0?void 0:n.toLowerCase(),y=(a=d.get(U.SCOPE))!==null&&a!==void 0?a:"default",b=+((i=d.get(U.PER_PAGE))!==null&&i!==void 0?i:this.defaultPerPage),g=d.get(U.KEYWORD_MATCH),O=g?g.toUpperCase()===At.MANDATORY?At.MANDATORY:At.OPTIONAL:void 0,w={};for(let C of d.keys())zs(C)||(w[C]=d.get(C));return{contentLocale:f??(this.allLanguagesAllowed?void 0:this.defaultContentLocale),query:(s=d.get(U.QUERY))!==null&&s!==void 0?s:"",scope:(l=this.scopeMapping[y])!==null&&l!==void 0?l:"DEFAULT",virtualField:Ps(h)?h:"EVERYWHERE",sortId:p,metadataFilters:this.parseCompatFilters(d),facets:[],paging:{page:1,perPage:ze(1,isNaN(b)?this.defaultPerPage:b,1e3)},keywordMatch:O,otherQueryParams:w}}parseCompatFilters(e){var o,n,a,i,s,l;let d=[];return e.has(U.FILTERS)&&(d=this.parseValueFilters((o=e.get(U.FILTERS))!==null&&o!==void 0?o:"")),(n=e.has(U.PERIOD))!==null&&n!==void 0&&n&&(d=[...d,...this.parseLegacyPeriodFilter(((a=e.get(U.PERIOD))!==null&&a!==void 0?a:"").toUpperCase())]),[...d,...this.parseValueFilters((i=e.get(U.VALUE_FILTERS))!==null&&i!==void 0?i:""),...this.parseDateFilters((s=e.get(U.DATE_FILTERS))!==null&&s!==void 0?s:""),...this.parseRangeFilters((l=e.get(U.RANGE_FILTERS))!==null&&l!==void 0?l:"")]}splitUnknownFilter(e){return this.superEscapeFilters(e).split("*").map(o=>o.split("~"))}parseValueFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],valueFilter:{values:o[1].split("_").map($s).map(n=>this.unescapeFilterValue(n)),negative:!1}}))}parseDateFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],dateFilter:{type:Rt[o[1].toUpperCase()]}}))}parseRangeFilters(e){return e.length===0?[]:this.splitUnknownFilter(e).map(o=>({key:o[0],rangeFilter:{from:o[1].split("_")[0],to:o[1].split("_")[1]}}))}escapeFilters(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replaceAll(o,n);return e}superEscapeFilters(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replaceAll(n,a);return e}unescapeFilterValue(e){for(let[o,n,a]of this.filtersEscapeMapping)e=e.replace(a,o);return e}parseLegacyPeriodFilter(e){if(Ls(e))return[{key:"ft:lastEdition",dateFilter:{type:Rt[e]}}];if(e.startsWith("CUSTOM_")){let[o,n,a]=e.split("_");return[{key:"ft:lastEdition",rangeFilter:{from:n,to:a}}]}return[]}};var Ln={};D(Ln,{toFtFormComponent:()=>tu});var Pn=Symbol("elementInternals"),tu=ee(Symbol("toFtFormComponent"),function(t){class e extends t{static get formAssociated(){return!0}get form(){return this[Pn].form}constructor(...n){super(n),this[Pn]=this.attachInternals()}setFormValue(n){this[Pn].setFormValue(n)}}return e});var Nn={};D(Nn,{DateFormatter:()=>or});var or=class{static format(e,o,n,a){return window.moment?window.moment(e).locale(o).format(this.getMomentDateFormat(n,a)):this.getIntlDateTime(e,o,n,a)}static getMomentDateFormat(e,o){return e?o?"lll":"ll":o?"L LT":"L"}static getIntlDateTime(e,o,n,a){let i=typeof e=="string"?new Date(e):e,s=new Intl.DateTimeFormat(o,{dateStyle:n?"medium":"short"}).format(i);if(!a)return s;let l=new Intl.DateTimeFormat(o,{timeStyle:"short"}).format(i);return`${s} ${l}`}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),o=new Date().getTimezoneOffset();return`${o<0?"+":"-"}${e(Math.abs(o)/60)}:${e(Math.abs(o)%60)}`}};var Dn={};D(Dn,{ALL_KEYS_VALUE:()=>kn,SameWindowStorageEvent:()=>_t});var kn="__all__",_t=class extends CustomEvent{constructor(e,o,n){super("same-window-storage",{detail:{key:e,oldValue:o,newValue:n}})}keyMatch(e){return this.detail.key.includes(e)||this.detail.key==kn}};Storage.prototype.setItem=new Proxy(Storage.prototype.setItem,{apply(t,e,o){let n=e.getItem(o[0]);Reflect.apply(t,e,o),window.dispatchEvent(new _t(o[0],n,o[1]))}});Storage.prototype.removeItem=new Proxy(Storage.prototype.removeItem,{apply(t,e,o){let n=e.getItem(o[0]);Reflect.apply(t,e,o),window.dispatchEvent(new _t(o[0],n))}});Storage.prototype.clear=new Proxy(Storage.prototype.clear,{apply(t,e,o){Reflect.apply(t,e,o),window.dispatchEvent(new _t(kn))}});var Fn={};D(Fn,{FocusMainContentEvent:()=>Mn});var Mn=class extends Event{constructor(){super("ft-focus-main-content",{composed:!0,bubbles:!0})}};var Ws={};window.FluidTopicsA11yHints={isKeyboardNavigation:!1,lastPressedKey:""};function ru(t){(t.key==="Enter"||t.key===" "||t.key==="Tab")&&(window.FluidTopicsA11yHints.isKeyboardNavigation=!0),window.FluidTopicsA11yHints.lastPressedKey=t.key}function ou(t){window.FluidTopicsA11yHints.isKeyboardNavigation=t.detail==0}document.addEventListener("keydown",ru);document.addEventListener("click",ou);var js=W`
49
49
  .sr-only {
50
50
  position:absolute;
51
51
  left:-10000px;
@@ -1,4 +1,4 @@
1
- import type { FtDocumentSearchEvent, FtDocumentStartDisplayEvent, FtKhubSearchEvent, FtSearchPageSelectEvent, FtSearchResultOpenContextMenuEvent, FtTopicStartDisplayEvent } from "@fluid-topics/public-api";
1
+ import type { FtAnalyticsEventDocument, FtDocumentOnDemandTranslateEvent, FtDocumentSearchEvent, FtDocumentStartDisplayEvent, FtKhubSearchEvent, FtMap, FtSearchPageSelectEvent, FtSearchResultOpenContextMenuEvent, FtTopicStartDisplayEvent } from "@fluid-topics/public-api";
2
2
  import { FtServiceWithCache } from "./FtServiceWithCache";
3
3
  export declare class FtAnalyticsEventsService extends FtServiceWithCache {
4
4
  sendDocumentStartDisplayEvent(event: FtDocumentStartDisplayEvent): Promise<string>;
@@ -7,6 +7,8 @@ export declare class FtAnalyticsEventsService extends FtServiceWithCache {
7
7
  sendDocumentSearchEvent(event: FtDocumentSearchEvent): Promise<string>;
8
8
  sendSearchPageSelectEvent(event: FtSearchPageSelectEvent): Promise<string>;
9
9
  sendSearchResultOpenContextMenuEvent(event: FtSearchResultOpenContextMenuEvent): Promise<string>;
10
+ sendDocumentAiTranslateEvent(event: FtDocumentOnDemandTranslateEvent): Promise<string>;
11
+ convertMapToAnalyticsDocument(map: FtMap): FtAnalyticsEventDocument;
10
12
  private sortEventArrays;
11
13
  private sendEvents;
12
14
  }
@@ -18,6 +18,34 @@ export class FtAnalyticsEventsService extends FtServiceWithCache {
18
18
  async sendSearchResultOpenContextMenuEvent(event) {
19
19
  return this.sendEvents([this.sortEventArrays(event)], "Failed to send search_result.open_context_menu event");
20
20
  }
21
+ async sendDocumentAiTranslateEvent(event) {
22
+ return this.sendEvents([this.sortEventArrays(event)], "Failed to send document.on-demand_translate event");
23
+ }
24
+ convertMapToAnalyticsDocument(map) {
25
+ let documentType;
26
+ switch (map.editorialType) {
27
+ case "BOOK":
28
+ documentType = "STRUCTURED_DOCUMENT";
29
+ break;
30
+ case "SHARED_BOOK":
31
+ documentType = "SHARED_PERSONAL_BOOK";
32
+ break;
33
+ case "ARTICLE":
34
+ documentType = "RESOURCE";
35
+ break;
36
+ case "HTML_PACKAGE":
37
+ documentType = "HTML_PACKAGE";
38
+ break;
39
+ default:
40
+ throw new TypeError("Unknown editorial type for map : " + map.editorialType);
41
+ }
42
+ return {
43
+ id: map.id,
44
+ title: map.title,
45
+ type: documentType,
46
+ metadata: map.metadata,
47
+ };
48
+ }
21
49
  sortEventArrays(object) {
22
50
  const entries = Object.entries(object).map(([key, value]) => {
23
51
  if (Array.isArray(value)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-app-context",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "Global application context for Fluid Topics integrations",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,11 +19,11 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-wc-utils": "2.0.9",
22
+ "@fluid-topics/ft-wc-utils": "2.0.11",
23
23
  "lit": "3.1.0"
24
24
  },
25
25
  "devDependencies": {
26
- "@fluid-topics/public-api": "1.0.116"
26
+ "@fluid-topics/public-api": "1.0.117"
27
27
  },
28
- "gitHead": "0c31a55662f9e366ecd36cbb4d10d93ee5433b5c"
28
+ "gitHead": "aedc97fb65c7bafd16b7adef8218a58f59fea690"
29
29
  }