@fluid-topics/public-api 1.0.98 → 1.0.100

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 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}};!function(e,r){var a="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,i=function(){function e(){this.fetch=!1,this.DOMException=a.DOMException}return e.prototype=a,new e}();!function(e){!function(r){var a=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t||{},i={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};if(i.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],s=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||s(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;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 e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,a,i,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),a=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=a?a[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),a=0;a<t.length;a++)r[a]=String.fromCharCode(t[a]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=o(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[o(e)]},c.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},c.prototype.set=function(e,t){this.map[o(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),u(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var E=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function T(e,t){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,i,n=(t=t||{}).body;if(e instanceof T){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),E.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in a)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),a=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(a),decodeURIComponent(i))}})),t}function f(e,t){if(!(this instanceof f))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.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=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},A.call(T.prototype),A.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var S=[301,302,303,307,308];f.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})},r.DOMException=a.DOMException;try{new r.DOMException}catch(e){r.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function F(e,t){return new Promise((function(n,s){var u=new T(e,t);if(u.signal&&u.signal.aborted)return s(new r.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function p(){d.abort()}if(d.onload=function(){var e,t,r={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),a=r.shift().trim();if(a){var i=r.join(":").trim();try{t.append(a,i)}catch(e){console.warn("Response "+e.message)}}})),t)};0===u.url.indexOf("file://")&&(d.status<200||d.status>599)?r.status=200:r.status=d.status,r.url="responseURL"in d?d.responseURL:r.headers.get("X-Request-URL");var a="response"in d?d.response:d.responseText;setTimeout((function(){n(new f(a,r))}),0)},d.onerror=function(){setTimeout((function(){s(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){s(new TypeError("Network request timed out"))}),0)},d.onabort=function(){setTimeout((function(){s(new r.DOMException("Aborted","AbortError"))}),0)},d.open(u.method,function(e){try{return""===e&&a.location.href?a.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?d.withCredentials=!0:"omit"===u.credentials&&(d.withCredentials=!1),"responseType"in d&&(i.blob?d.responseType="blob":i.arrayBuffer&&(d.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof c||a.Headers&&t.headers instanceof a.Headers)){var y=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){y.push(o(e)),d.setRequestHeader(e,l(t.headers[e]))})),u.headers.forEach((function(e,t){-1===y.indexOf(t)&&d.setRequestHeader(t,e)}))}else u.headers.forEach((function(e,t){d.setRequestHeader(t,e)}));u.signal&&(u.signal.addEventListener("abort",p),d.onreadystatechange=function(){4===d.readyState&&u.signal.removeEventListener("abort",p)}),d.send(void 0===u._bodyInit?null:u._bodyInit)}))}F.polyfill=!0,a.fetch||(a.fetch=F,a.Headers=c,a.Request=T,a.Response=f),r.Headers=c,r.Request=T,r.Response=f,r.fetch=F}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=a.fetch?a:i;(r=n.fetch).default=n.fetch,r.fetch=n.fetch,r.Headers=n.Headers,r.Request=n.Request,r.Response=n.Response,e.exports=r}(a,a.exports);var i=r(a.exports);class n{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"===t&&r.length>0&&(yield JSON.parse(r))}}const s=e=>"object"==typeof e&&null!=e,o=e=>"boolean"==typeof e,l=e=>"number"==typeof e,u=e=>"string"==typeof e;var c;e.FtMyLibraryColors=void 0,(c=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",c.green="green",c.blue="blue",c.purple="purple",c.red="red",c.orange="orange",c.yellow="yellow";const d=t=>Object.keys(e.FtMyLibraryColors).includes(t);var p;e.FtTopicOriginType=void 0,(p=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",p.PERSONAL="PERSONAL",p.SHARED="SHARED";const y=t=>Object.keys(e.FtTopicOriginType).includes(t);var h;e.FtAnalyticsDocumentType=void 0,(h=e.FtAnalyticsDocumentType||(e.FtAnalyticsDocumentType={})).STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",h.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",h.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",h.PERSONAL_BOOK="PERSONAL_BOOK",h.MAP_ATTACHMENT="MAP_ATTACHMENT",h.RESOURCE="RESOURCE";const A=t=>Object.keys(e.FtAnalyticsDocumentType).includes(t),E=e=>s(e)&&l(e.width)&&l(e.height),T=e=>s(e)&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e))))&&u(e.id)&&(null==e.mimeType||u(e.mimeType))&&(null==e.title||u(e.title))&&(null==e.type||A(e.type))&&(null==e.parentId||u(e.parentId)),m=e=>s(e)&&u(e.provider)&&(null==e.model||u(e.model)),f=e=>s(e)&&u(e.provider)&&(null==e.model||u(e.model)),S=e=>s(e)&&u(e.provider)&&(null==e.engine||u(e.engine)),F=e=>s(e)&&u(e.type)&&u(e.value),_=e=>s(e)&&u(e.pageType)&&u(e.type)&&u(e.url),R=e=>s(e)&&u(e.name)&&(null==e.language||u(e.language))&&u(e.id)&&u(e.type)&&u(e.url),g=e=>s(e)&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e))))&&u(e.id)&&(null==e.mimeType||u(e.mimeType))&&(null==e.title||u(e.title))&&(null==e.type||I(e.type))&&(null==e.parentId||u(e.parentId)),b=e=>s(e)&&u(e.type)&&(null==e.value||u(e.value)),O=e=>s(e)&&u(e.terms)&&(null==e.searchType||u(e.searchType))&&(null==e.lastUpdate||u(e.lastUpdate))&&(null==e.facets||Array.isArray(e.facets)&&e.facets.every((e=>L(e)))),v=e=>s(e)&&(null==e.autocorrect||o(e.autocorrect))&&l(e.nbResults),C=e=>s(e)&&T(e.document)&&l(e.rank)&&(null==e.topic||U(e.topic))&&u(e.type),U=e=>s(e)&&(null==e.mapTitle||u(e.mapTitle))&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e))))&&u(e.tocId)&&(null==e.mapId||u(e.mapId))&&u(e.title);var D;e.FtAnalyticsPublicationType=void 0,(D=e.FtAnalyticsPublicationType||(e.FtAnalyticsPublicationType={})).STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",D.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",D.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",D.PERSONAL_BOOK="PERSONAL_BOOK",D.MAP_ATTACHMENT="MAP_ATTACHMENT",D.RESOURCE="RESOURCE";const I=t=>Object.keys(e.FtAnalyticsPublicationType).includes(t),L=e=>s(e)&&(null==e.dateValue||N(e.dateValue))&&(null==e.values||Array.isArray(e.values)&&e.values.every((e=>u(e))))&&(null==e.from||u(e.from))&&(null==e.to||u(e.to))&&(null==e.type||M(e.type))&&u(e.key);var P;e.FtAnalyticsSearchDateFacetValue=void 0,(P=e.FtAnalyticsSearchDateFacetValue||(e.FtAnalyticsSearchDateFacetValue={})).LAST_WEEK="LAST_WEEK",P.LAST_MONTH="LAST_MONTH",P.LAST_QUARTER="LAST_QUARTER",P.LAST_YEAR="LAST_YEAR";const N=t=>Object.keys(e.FtAnalyticsSearchDateFacetValue).includes(t);var k;e.FtAnalyticsSearchFacetType=void 0,(k=e.FtAnalyticsSearchFacetType||(e.FtAnalyticsSearchFacetType={})).VALUE="VALUE",k.DATE="DATE",k.RANGE="RANGE";const M=t=>Object.keys(e.FtAnalyticsSearchFacetType).includes(t);var w;e.FtAnalyticsEventName=void 0,(w=e.FtAnalyticsEventName||(e.FtAnalyticsEventName={})).BOOKMARK__CREATE="BOOKMARK__CREATE",w.BOOKMARK__DELETE="BOOKMARK__DELETE",w.CASE_DEFLECTION__START="CASE_DEFLECTION__START",w.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",w.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",w.COLLECTION__CREATE="COLLECTION__CREATE",w.COLLECTION__UPDATE="COLLECTION__UPDATE",w.COLLECTION__DELETE="COLLECTION__DELETE",w.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",w.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",w.DOCUMENT__PRINT="DOCUMENT__PRINT",w.DOCUMENT__PROCESS="DOCUMENT__PROCESS",w.DOCUMENT__RATE="DOCUMENT__RATE",w.DOCUMENT__SEARCH="DOCUMENT__SEARCH",w.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",w.DOCUMENT__UNRATE="DOCUMENT__UNRATE",w.FEEDBACK__SEND="FEEDBACK__SEND",w.GEN_AI__COMPLETED_QUERY="GEN_AI__COMPLETED_QUERY",w.GEN_AI__RATE="GEN_AI__RATE",w.GENAI_CASE_DEFLECTION__START="GENAI_CASE_DEFLECTION__START",w.GENAI_CASE_DEFLECTION__OPEN_TICKET="GENAI_CASE_DEFLECTION__OPEN_TICKET",w.KHUB__PROCESS="KHUB__PROCESS",w.KHUB__SEARCH="KHUB__SEARCH",w.LABELS__DOWNLOAD="LABELS__DOWNLOAD",w.LINK__SHARE="LINK__SHARE",w.PAGE__DISPLAY="PAGE__DISPLAY",w.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",w.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",w.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",w.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",w.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",w.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",w.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",w.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",w.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",w.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",w.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",w.TOPIC__DISPLAY="TOPIC__DISPLAY",w.TOPIC__RATE="TOPIC__RATE",w.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",w.TOPIC__UNRATE="TOPIC__UNRATE",w.USER__LOGIN="USER__LOGIN",w.USER__LOGOUT="USER__LOGOUT",w.HEARTBEAT="HEARTBEAT";const B=t=>Object.keys(e.FtAnalyticsEventName).includes(t),H=e=>s(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>u(e)))))&&u(e.key),x=e=>s(e)&&u(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>x(e)))&&(null==e.topicLink||j(e.topicLink))&&u(e.title)&&(null==e.htmlContent||u(e.htmlContent)),j=e=>s(e)&&u(e.tocId)&&u(e.contentId)&&u(e.mapId),V=e=>s(e)&&u(e.topicStylesheetUrl)&&u(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>u(e))),K=e=>s(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&(null==e.hasRating||o(e.hasRating))&&u(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>K(e)))&&(null==e.origin||G(e.origin))&&u(e.contentId)&&(null==e.untranslatedTitle||null==e.untranslatedTitle||u(e.untranslatedTitle))&&u(e.title),G=e=>s(e)&&u(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&u(e.contentId)&&u(e.mapId)&&y(e.type);var $;e.FtTopicContentTarget=void 0,($=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",$.OFF_THE_GRID="OFF_THE_GRID",$.CONTENT_PACKAGER="CONTENT_PACKAGER",$.PAGES="PAGES",$.DESIGNED_READER="DESIGNED_READER";var q;e.FtExternalWebComponentContext=void 0,(q=e.FtExternalWebComponentContext||(e.FtExternalWebComponentContext={})).HOMEPAGE="HOMEPAGE",q.CUSTOM="CUSTOM",q.HEADER="HEADER",q.READER="READER",q.TOPIC_TEMPLATE="TOPIC_TEMPLATE",q.SEARCH="SEARCH",q.SEARCH_RESULT="SEARCH_RESULT";var Y;e.FtMetadataHomeLayout=void 0,(Y=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",Y.CUSTOM="CUSTOM",Y.DESIGNER="DESIGNER";const W=e=>s(e)&&u(e.lang)&&u(e.region),X=e=>s(e)&&W(e.defaultUiLocale)&&W(e.defaultContentLocale)&&Array.isArray(e.defaultRegions)&&e.defaultRegions.every((e=>W(e))),Q=e=>s(e)&&l(e.count)&&u(e.label)&&(null==e.lang||u(e.lang)),z=e=>s(e)&&u(e.displayName)&&u(e.languageTag)&&o(e.translated);var J;e.FtFacetType=void 0,(J=e.FtFacetType||(e.FtFacetType={})).AND="AND",J.OR="OR",J.MONOVALUED="MONOVALUED";const Z=e=>s(e)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>u(e))))))&&u(e.label)&&u(e.key);var ee;e.FtMetadataSortRule=void 0,(ee=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",ee.ALPHABET="ALPHABET",ee.VERSION="VERSION";const te=t=>Object.keys(e.FtMetadataSortRule).includes(t),re=e=>s(e)&&o(e.date)&&te(e.sortRule)&&u(e.label)&&o(e.reverseSort)&&u(e.key),ae=e=>s(e)&&(null==e.periodFilter||null==e.periodFilter||Ne(e.periodFilter))&&u(e.query)&&(null==e.scope||Ye(e.scope))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Le(e))))&&Array.isArray(e.sort)&&e.sort.every((e=>Je(e)))&&(null==e.virtualField||me(e.virtualField))&&(null==e.metadataFilters||Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>Ie(e))))&&(null==e.contentLocale||u(e.contentLocale));var ie;e.FtRatingType=void 0,(ie=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",ie.LIKE="LIKE",ie.DICHOTOMOUS="DICHOTOMOUS",ie.NO_RATING="NO_RATING";const ne=t=>Object.keys(e.FtRatingType).includes(t),se=e=>s(e)&&u(e.date)&&ne(e.type)&&l(e.value),oe=e=>s(e)&&(null==e.rating||se(e.rating))&&ne(e.type),le=e=>s(e)&&u(e.date)&&u(e.tocId)&&ne(e.type)&&l(e.value),ue=e=>s(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>le(e)))&&ne(e.type),ce=e=>s(e)&&Array.isArray(e.filter)&&e.filter.every((e=>u(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>u(e)));var de;e.FtPeriodFilterType=void 0,(de=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",de.LAST_MONTH="LAST_MONTH",de.LAST_QUARTER="LAST_QUARTER",de.LAST_YEAR="LAST_YEAR",de.CUSTOM="CUSTOM";const pe=t=>Object.keys(e.FtPeriodFilterType).includes(t);var ye;e.FtSearchSortCriterionOrder=void 0,(ye=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",ye.DESC="DESC";const he=t=>Object.keys(e.FtSearchSortCriterionOrder).includes(t);var Ae;e.FtSearchSortCriterionType=void 0,(Ae=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",Ae.NATURAL="NATURAL";const Ee=t=>Object.keys(e.FtSearchSortCriterionType).includes(t);var Te;e.FtVirtualField=void 0,(Te=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",Te.TITLE_ONLY="TITLE_ONLY",Te.NONE="NONE";const me=t=>Object.keys(e.FtVirtualField).includes(t),fe=e=>s(e)&&l(e.totalResultsCount)&&o(e.isLastPage)&&l(e.currentPage)&&l(e.totalClustersCount);var Se;e.FtEditorialType=void 0,(Se=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",Se.BOOK="BOOK",Se.SHARED_BOOK="SHARED_BOOK";const Fe=t=>Object.keys(e.FtEditorialType).includes(t);var _e;e.FtOpenMode=void 0,(_e=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",_e.EXTERNAL="EXTERNAL";const Re=t=>Object.keys(e.FtOpenMode).includes(t),ge=e=>s(e)&&(null==e.perPage||l(e.perPage))&&l(e.page),be=e=>s(e)&&u(e.key);var Oe;e.FtCollectionDocumentType=void 0,(Oe=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",Oe.DOCUMENT="DOCUMENT",Oe.TOPIC="TOPIC",Oe.PERSONAL_BOOK="PERSONAL_BOOK",Oe.SHARED_BOOK="SHARED_BOOK";const ve=t=>Object.keys(e.FtCollectionDocumentType).includes(t),Ce=e=>s(e)&&De(e.type);var Ue;e.FtDateFilterType=void 0,(Ue=e.FtDateFilterType||(e.FtDateFilterType={})).LAST_WEEK="LAST_WEEK",Ue.LAST_MONTH="LAST_MONTH",Ue.LAST_QUARTER="LAST_QUARTER",Ue.LAST_YEAR="LAST_YEAR";const De=t=>Object.keys(e.FtDateFilterType).includes(t),Ie=e=>s(e)&&(null==e.valueFilter||We(e.valueFilter))&&(null==e.rangeFilter||we(e.rangeFilter))&&u(e.label)&&u(e.key)&&(null==e.dateFilter||Ce(e.dateFilter)),Le=e=>s(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&u(e.label)&&u(e.key),Pe=e=>s(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&u(e.key),Ne=e=>s(e)&&(null==e.period||Me(e.period))&&pe(e.periodType)&&(null==e.key||u(e.key)),ke=e=>s(e)&&(null==e.valueFilter||We(e.valueFilter))&&(null==e.rangeFilter||we(e.rangeFilter))&&u(e.key)&&(null==e.dateFilter||Ce(e.dateFilter)),Me=e=>s(e)&&u(e.from)&&u(e.to),we=e=>s(e)&&u(e.from)&&u(e.to),Be=e=>s(e)&&l(e.weight)&&u(e.value)&&u(e.key),He=e=>s(e)&&Array.isArray(e.entries)&&e.entries.every((e=>xe(e)))&&(null==e.metadataVariableAxis||u(e.metadataVariableAxis)),xe=e=>s(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>u(e)))&&(null==e.document||je(e.document))&&(null==e.topic||Ke(e.topic))&&$e(e.type)&&(null==e.map||Ve(e.map)),je=e=>s(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&Re(e.openMode)&&u(e.documentUrl)&&u(e.mimeType)&&u(e.title)&&(null==e.lastPublicationDate||u(e.lastPublicationDate))&&u(e.viewerUrl)&&u(e.contentUrl)&&u(e.filename)&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.documentId)&&u(e.lastEditionDate)&&u(e.htmlExcerpt),Ve=e=>s(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&(null==e.openMode||Re(e.openMode))&&Fe(e.editorialType)&&u(e.title)&&(null==e.lastPublicationDate||u(e.lastPublicationDate))&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.mapUrl)&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt),Ke=e=>s(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&Re(e.openMode)&&u(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>et(e)))&&u(e.title)&&u(e.mapTitle)&&u(e.topicUrl)&&u(e.contentUrl)&&u(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&(null==e.originUrl||u(e.originUrl))&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt);var Ge;e.FtSearchResultType=void 0,(Ge=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",Ge.DOCUMENT="DOCUMENT",Ge.TOPIC="TOPIC";const $e=t=>Object.keys(e.FtSearchResultType).includes(t);var qe;e.FtSearchScope=void 0,(qe=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",qe.DOCUMENTS="DOCUMENTS",qe.ALL_TOPICS="ALL_TOPICS",qe.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS";const Ye=t=>Object.keys(e.FtSearchScope).includes(t),We=e=>s(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e))),Xe=e=>s(e)&&o(e.hierarchical)&&u(e.label)&&o(e.multiSelectionable)&&u(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>ze(e))),Qe=e=>s(e)&&(null==e.maxDepth||l(e.maxDepth))&&u(e.id),ze=e=>s(e)&&l(e.totalResultsCount)&&o(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>ze(e)))&&u(e.label)&&u(e.value)&&o(e.selected),Je=e=>s(e)&&Ee(e.type)&&u(e.key)&&he(e.order),Ze=e=>s(e)&&u(e.suggestedQuery)&&u(e.htmlSuggestedQuery),et=e=>s(e)&&u(e.filename)&&u(e.resourceUrl)&&u(e.id)&&u(e.mimeType)&&u(e.resourceContentUrl)&&u(e.viewerUrl),tt=e=>s(e)&&(null==e.filenameExtension||u(e.filenameExtension))&&(null==e.editorialType||Fe(e.editorialType))&&(null==e.mimeType||u(e.mimeType))&&$e(e.type)&&u(e.value);var rt;e.FtUserRole=void 0,(rt=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",rt.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",rt.HTML_EXPORT_USER="HTML_EXPORT_USER",rt.PDF_EXPORT_USER="PDF_EXPORT_USER",rt.SAVED_SEARCH_USER="SAVED_SEARCH_USER",rt.COLLECTION_USER="COLLECTION_USER",rt.OFFLINE_USER="OFFLINE_USER",rt.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",rt.ANALYTICS_USER="ANALYTICS_USER",rt.BETA_USER="BETA_USER",rt.DEBUG_USER="DEBUG_USER",rt.PRINT_USER="PRINT_USER",rt.RATING_USER="RATING_USER",rt.FEEDBACK_USER="FEEDBACK_USER",rt.GENERATIVE_AI_USER="GENERATIVE_AI_USER",rt.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",rt.CONTENT_PUBLISHER="CONTENT_PUBLISHER",rt.KHUB_ADMIN="KHUB_ADMIN",rt.USERS_ADMIN="USERS_ADMIN",rt.PORTAL_ADMIN="PORTAL_ADMIN",rt.ADMIN="ADMIN";const at=t=>Object.keys(e.FtUserRole).includes(t),it=e=>s(e)&&u(e.identifier)&&u(e.realm),nt=e=>s(e)&&(null==e.defaultFilters||Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>Pe(e))))&&Array.isArray(e.defaultMetadataFilters)&&e.defaultMetadataFilters.every((e=>ke(e))),st=e=>s(e)&&(null==e.emailAddress||u(e.emailAddress))&&(null==e.displayName||u(e.displayName))&&(null==e.otpValidated||o(e.otpValidated))&&Array.isArray(e.roles)&&e.roles.every((e=>at(e)))&&(null==e.userId||u(e.userId))&&(null==e.privacyPolicyAgreementDate||u(e.privacyPolicyAgreementDate))&&Array.isArray(e.tags)&&e.tags.every((e=>u(e))),ot=e=>s(e)&&u(e.color)&&Array.isArray(e.text)&&e.text.every((e=>u(e)))&&l(e.opacity),lt=e=>"object"==typeof e&&null!=e,ut=e=>"boolean"==typeof e,ct=e=>"number"==typeof e,dt=e=>"string"==typeof e;var pt;e.FtConfigurationHistoryEntryStatus=void 0,(pt=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",pt.INVALID="INVALID";const yt=e=>lt(e)&&ut(e.mailsSentByFluidTopics)&&ut(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>dt(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>dt(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>dt(e)));var ht;e.FtRagResponseFormat=void 0,(ht=e.FtRagResponseFormat||(e.FtRagResponseFormat={})).JSON="JSON",ht.TEXT="TEXT";const At=t=>Object.keys(e.FtRagResponseFormat).includes(t),Et=e=>lt(e)&&dt(e.role)&&dt(e.content);var Tt;e.TranslationFormat=void 0,(Tt=e.TranslationFormat||(e.TranslationFormat={})).TEXT="TEXT",Tt.HTML="HTML";const mt=t=>Object.keys(e.TranslationFormat).includes(t),ft=e=>lt(e)&&dt(e.code)&&dt(e.label),St=e=>lt(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>ut(e))))&&ut(e.isVisible),Ft=e=>lt(e)&&(null==e.prettyUrl||dt(e.prettyUrl))&&(null==e.hasRating||ut(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||dt(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Ft(e)))&&(null==e.pageConfiguration||St(e.pageConfiguration))&&(null==e.contentId||dt(e.contentId))&&(null==e.untranslatedTitle||dt(e.untranslatedTitle))&&(null==e.title||dt(e.title)),_t=e=>lt(e)&&ut(e.splitCurrentPageToc),Rt=e=>lt(e)&&lt(e.metadata)&&Object.keys(e.metadata).every((e=>dt(e)))&&Object.values(e.metadata).every((e=>Array.isArray(e)&&e.every((e=>dt(e)))))&&dt(e.excerpt)&&ct(e.relevance),gt=e=>lt(e),bt={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.GENERATIVE_AI_EXPORT_USER]:[e.FtUserRole.GENERATIVE_AI_USER]};function Ot(e,t){return e===t||(bt[e]??[]).some((e=>Ot(e,t)))}function vt(e,t){if(null==e)return!1;return(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>Ot(e,t)))}const Ct="undefined"==typeof window?globalThis:window;function Ut(e){let t={};for(let r in e){let a=e[r];("object"!=typeof a||Array.isArray(a))&&(a={prior:a});for(let e of["prior","filter"])a[e]=Array.isArray(a[e])?a[e]:[a[e]],a[e]=a[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=a}return t}function Dt(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const It="undefined"==typeof window?globalThis:window;class Lt extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,a,i){super(`${e} ${t} -> ${r} - ${a}: ${i}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=a,this.body=i}}class Pt extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function Nt(e,t,r){if(!r.ok){let a={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof It.dispatchEvent&&It.dispatchEvent(new Pt(a)),new Lt(a.method,a.endpoint,a.status,a.statusText,a.body)}return r}function kt(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class Mt{tenantBaseUrl;tenantBaseUrlNoTrailingSlash;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`,translation:`api/khub/maps/${e}/topics/${t}/content/translation`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},semantic:{search:"api/khub/semantic/search",clusteredSearch:"api/khub/semantic/clustered-search"},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`,create:`api/users/${e}/searches`,mySearchId:t=>({delete:`api/users/${e}/searches/${t}`,update:`api/users/${e}/searches/${t}`})},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui",get:"api/locales"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat",translate:"api/ai/translate",destinationLanguages:e=>({endpoint:`api/ai/translate/${e}/languages`})},assets:{highlightjs:"assets/scripts/highlightjs"},analytics:{events:"api/analytics/events"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??It.fluidTopicsBaseUrl??It.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",this.tenantBaseUrlNoTrailingSlash=this.tenantBaseUrl.replace(/\/$/,""),r&&void 0!==It.location&&It.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t,r){const a=this.endpoints.khub.maps.mapId(e).info,i={...this.buildTranslationParameters(t),v:r};return this.get(this.buildUrlFromParams(a,i))}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t,r){const a=this.endpoints.khub.maps.mapId(e).pages,i={...this.buildTranslationParameters(r),v:t};return this.get(this.buildUrlFromParams(a,i))}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,a){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),a)}getTranslatedTopicHTMLContent(e,t,r,a,i){const n=this.endpoints.khub.maps.mapId(e).topics.contentId(t).translation,s={...this.buildTranslationParameters(i),target:r,v:a};return this.get(this.buildUrlFromParams(n,s))}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.locales.ui)}getLocalesConfiguration(){return this.get(this.endpoints.locales.get)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,a){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:a})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,a){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:a})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}semanticSearch(e){return this.post(this.endpoints.khub.semantic.search,{request:e})}clusteredSemanticSearch(e){return this.post(this.endpoints.khub.semantic.clusteredSearch,{request:e})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}createMySearch(e,t){return this.post(this.endpoints.users.userId(e).searches.create,t)}updateMySearch(e,t,r){return this.put(this.endpoints.users.userId(e).searches.mySearchId(t).update,r)}deleteMySearch(e,t){return this.delete(this.endpoints.users.userId(e).searches.mySearchId(t).delete)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}sendEvents(e){return e.length?this.post(this.endpoints.analytics.events,e):Promise.resolve()}async*generate(e,t){const r=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await Nt("POST",this.endpoints.ai.generate,r);const a=new n(r.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await Nt("POST",this.endpoints.ai.chat,t);const r=new n(t.body.getReader());yield*r.read()}translate(e){return this.post(this.endpoints.ai.translate,e)}getDestinationLanguages(e,t){const r=this.endpoints.ai.destinationLanguages(e).endpoint,a={sourceLanguage:t};return this.get(this.buildUrlFromParams(r,a))}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)||e===this.tenantBaseUrlNoTrailingSlash?e:this.tenantBaseUrl+e.replace(/^\//,"")}extractEndpoint(e){return e.replace(this.tenantBaseUrlNoTrailingSlash,"").replace(/^\//,"")}async fetch(e,t){const r=t;return await i(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,a=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((i,n)=>{let s=new XMLHttpRequest;s.onload=()=>{if(s.status>=200&&s.status<300){let e="application/json"===s.getResponseHeader("Content-Type")?JSON.parse(s.responseText):s.responseText;i(e)}else n(new Lt("GET",t,s.status,s.statusText,s.responseText))},s.upload.onprogress=e=>a(e),s.open(e,this.makeAbsolute(t),!0),s.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>Nt(e,t,r))).then(kt)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>Nt(e,t,r))).then(kt)}fetchRawData(e,t){return i(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>Nt("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}withAnalyticsQueryParams(e){let t=new URL(this.makeAbsolute(e));return t.searchParams.append("Ft-Calling-App",this.ftCallingApp),t.toString()}buildUrlFromParams(e,t){const r=new URL(this.makeAbsolute(e));return t&&Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,t)})),r.toString()}buildTranslationParameters(e){if(e)return{translationProfileId:e.profileId,translationDestinationLanguage:e.destinationLanguage,translationSourceLanguage:e.sourceLanguage?.slice(0,2)}}}e.AIChunkReader=n,e.FluidTopicsApi=Mt,e.HttpError=Lt,e.HttpErrorEvent=Pt,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(Ct.localStorage){const r=Dt(e),a=e=>{e.storageArea===Ct.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return Ct.addEventListener("storage",a),{removeHandler:()=>Ct.removeEventListener("storage",a)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=Mt,e.getUnauthenticatedUserSearchPreferences=function(e){if(Ct.localStorage)return JSON.parse(Ct.localStorage.getItem(Dt(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAnalyticsDocumentType=A,e.isFtAnalyticsEvent=e=>s(e)&&o(e.offline)&&u(e.appVersion)&&u(e.appName)&&B(e.name),e.isFtAnalyticsEventDisplay=E,e.isFtAnalyticsEventDocument=T,e.isFtAnalyticsEventGenAIProfile=e=>s(e)&&(null==e.chatbotDetails||m(e.chatbotDetails))&&(null==e.translationDetails||S(e.translationDetails))&&(null==e.completionDetails||f(e.completionDetails))&&u(e.name)&&u(e.id)&&u(e.type),e.isFtAnalyticsEventGenAIProfileChatbotDetails=m,e.isFtAnalyticsEventGenAIProfileCompletionDetails=f,e.isFtAnalyticsEventGenAIProfileTranslationDetails=S,e.isFtAnalyticsEventLocation=F,e.isFtAnalyticsEventName=B,e.isFtAnalyticsEventOrigin=_,e.isFtAnalyticsEventPage=R,e.isFtAnalyticsEventPublication=g,e.isFtAnalyticsEventRating=b,e.isFtAnalyticsEventSearchQuery=O,e.isFtAnalyticsEventSearchResponse=v,e.isFtAnalyticsEventSearchResult=C,e.isFtAnalyticsEventTopic=U,e.isFtAnalyticsPublicationType=I,e.isFtAnalyticsSearchDateFacetValue=N,e.isFtAnalyticsSearchFacet=L,e.isFtAnalyticsSearchFacetType=M,e.isFtAuthenticatedSession=e=>s(e)&&it(e.authenticationIdentifier)&&st(e.profile),e.isFtAuthenticationIdentifier=it,e.isFtBookmark=e=>s(e)&&u(e.mapTitle)&&d(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&u(e.lastUpdate)&&u(e.readerUrl)&&u(e.mapId)&&u(e.id)&&u(e.title)&&u(e.creationDate),e.isFtCaseDeflectionEvent=e=>s(e)&&(null==e.searchQuery||O(e.searchQuery))&&u(e.context)&&(null==e.rating||b(e.rating))&&(null==e.topic||U(e.topic)),e.isFtClusteredSemanticSearchReply=e=>lt(e)&&Array.isArray(e.documents)&&e.documents.every((e=>Rt(e)))&&Array.isArray(e.clusterId)&&e.clusterId.every((e=>dt(e))),e.isFtCollectionDocument=e=>s(e)&&o(e.deleted)&&(null==e.apiUrl||u(e.apiUrl))&&(null==e.portalUrl||u(e.portalUrl))&&u(e.id)&&u(e.title)&&ve(e.type),e.isFtCollectionDocumentType=ve,e.isFtConfigurationHistoryEntryStatus=t=>Object.keys(e.FtConfigurationHistoryEntryStatus).includes(t),e.isFtCredentials=e=>s(e)&&u(e.password)&&(null==e.newPassword||u(e.newPassword))&&o(e.rememberMe)&&u(e.login),e.isFtDateFilter=Ce,e.isFtDateFilterType=De,e.isFtDefaultLocale=W,e.isFtDefaultLocales=X,e.isFtDocumentDisplayEvent=e=>s(e)&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&l(e.viewDurationMs)&&F(e.location),e.isFtDocumentDownloadEvent=e=>s(e)&&T(e.document)&&F(e.location),e.isFtDocumentPrintEvent=e=>s(e)&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document)),e.isFtDocumentSearchEvent=e=>s(e)&&v(e.searchResponse)&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&O(e.searchQuery),e.isFtDocumentStartDisplayEvent=e=>s(e)&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&F(e.location),e.isFtEditorialType=Fe,e.isFtExternalWebComponentContext=t=>Object.keys(e.FtExternalWebComponentContext).includes(t),e.isFtFacetType=t=>Object.keys(e.FtFacetType).includes(t),e.isFtFeedbackCreation=e=>s(e)&&(null==e.from||u(e.from))&&u(e.message),e.isFtFeedbackSendEvent=e=>s(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>U(e)))&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&o(e.loggedIn),e.isFtGenAIGenerateInput=e=>lt(e)&&dt(e.profileId)&&(null==e.parameters||lt(e.parameters)&&Object.keys(e.parameters).every((e=>dt(e)))&&Object.values(e.parameters).every((e=>dt(e)))),e.isFtGenAIRating=e=>lt(e)&&ct(e.rating)&&dt(e.comment)&&dt(e.queryId),e.isFtGenAiCaseDeflectionEvent=e=>s(e)&&(null==e.generationId||u(e.generationId))&&(null==e.searchQuery||O(e.searchQuery))&&u(e.context),e.isFtGenAiRateEvent=e=>s(e)&&b(e.rating)&&u(e.comment)&&u(e.queryId),e.isFtHttpErrorDetails=e=>s(e)&&u(e.endpoint)&&u(e.method)&&u(e.statusText)&&u(e.body)&&l(e.status),e.isFtKhubSearchEvent=e=>s(e)&&v(e.searchResponse)&&O(e.searchQuery),e.isFtLabeledMetadataFilter=Ie,e.isFtLabelsDownloadEvent=e=>s(e)&&u(e.locale),e.isFtLegacyLabeledMetadataFilter=Le,e.isFtLegacyMetadataFilter=Pe,e.isFtLinkShareEvent=e=>s(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>U(e)))&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document)),e.isFtLocalesConfiguration=e=>s(e)&&Array.isArray(e.availableUiLocales)&&e.availableUiLocales.every((e=>z(e)))&&o(e.allLanguagesAllowed)&&X(e.defaultLocales),e.isFtMap=e=>s(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&(null==e.watermark||ot(e.watermark))&&Re(e.openMode)&&(null==e.topicsApiEndpoint||u(e.topicsApiEndpoint))&&(null==e.description||u(e.description))&&(null==e.attachmentsApiEndpoint||u(e.attachmentsApiEndpoint))&&Fe(e.editorialType)&&u(e.baseId)&&u(e.clusterId)&&u(e.title)&&u(e.lastPublication)&&o(e.pbkConfidential)&&u(e.lastEdition)&&u(e.originId)&&(null==e.rightsApiEndpoint||u(e.rightsApiEndpoint))&&V(e.contentStyles)&&(null==e.originUrl||u(e.originUrl))&&u(e.fingerprint)&&u(e.readerUrl)&&(null==e.untranslatedTitle||null==e.untranslatedTitle||u(e.untranslatedTitle))&&(null==e.khubVersion||u(e.khubVersion))&&u(e.id)&&(null==e.lang||u(e.lang)),e.isFtMapAttachment=e=>lt(e)&&dt(e.file)&&(null==e.size||ct(e.size))&&ut(e.externalLink)&&dt(e.name)&&dt(e.id)&&(null==e.mimeType||dt(e.mimeType))&&(null==e.viewerUrl||dt(e.viewerUrl)),e.isFtMapResource=e=>s(e)&&u(e.contentUrl)&&u(e.filename)&&u(e.id)&&u(e.mimeType),e.isFtMapStyles=V,e.isFtMessageContext=e=>s(e)&&u(e.name)&&s(e.messages)&&Object.keys(e.messages).every((e=>u(e)))&&Object.values(e.messages).every((e=>u(e)))&&u(e.locale),e.isFtMetadata=Z,e.isFtMetadataConfiguration=e=>s(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>re(e))),e.isFtMetadataDescriptor=re,e.isFtMetadataFilter=ke,e.isFtMetadataHomeLayout=t=>Object.keys(e.FtMetadataHomeLayout).includes(t),e.isFtMetadataPreferenceConfiguration=ce,e.isFtMetadataSortRule=te,e.isFtMyLibraryColors=d,e.isFtMySearch=e=>s(e)&&ae(e.searchRequest)&&d(e.color)&&o(e.alert)&&u(e.description)&&u(e.id)&&u(e.ownerId)&&u(e.title)&&u(e.creationDate),e.isFtMySearchCreation=e=>s(e)&&ae(e.searchRequest)&&d(e.color)&&o(e.alert)&&u(e.description)&&u(e.title),e.isFtMySearchRequest=ae,e.isFtMySearchUpdate=e=>s(e)&&(null==e.searchRequest||ae(e.searchRequest))&&(null==e.color||d(e.color))&&(null==e.alert||o(e.alert))&&(null==e.description||u(e.description))&&(null==e.title||u(e.title)),e.isFtOpenMode=Re,e.isFtPageConfiguration=St,e.isFtPageDisplayEvent=e=>s(e)&&_(e.origin)&&E(e.display)&&R(e.page),e.isFtPageRequest=ge,e.isFtPaginatedToc=e=>lt(e)&&_t(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Ft(e)))&&ut(e.translationError),e.isFtPaginatedTocNode=Ft,e.isFtPaginatedTocNodeWithTranslationFailure=e=>lt(e)&&Ft(e.paginatedToc)&&ut(e.translationError),e.isFtPaginationConfiguration=_t,e.isFtPeriod=Me,e.isFtPeriodFilter=Ne,e.isFtPeriodFilterType=pe,e.isFtPersonalBookCreation=e=>s(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>H(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>x(e)))&&u(e.description)&&u(e.title),e.isFtPersonalBookMetadataUpdate=H,e.isFtPersonalBookNodeCreation=x,e.isFtPersonalBookTopicLinkCreation=j,e.isFtPrivacyPolicyConfiguration=e=>s(e)&&u(e.policyDescription)&&o(e.agreementRequired)&&u(e.userAgreementMessage),e.isFtPublicClusterSortCriterion=be,e.isFtPublicationRating=se,e.isFtPublicationRatingSummary=oe,e.isFtRagHistory=Et,e.isFtRagInput=e=>lt(e)&&dt(e.profileId)&&(null==e.conversationId||dt(e.conversationId))&&dt(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>Et(e))))&&(null==e.responseFormat||At(e.responseFormat))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>gt(e)))),e.isFtRagResponseFormat=At,e.isFtRangeFilter=we,e.isFtRatingCreation=e=>s(e)&&ne(e.type)&&l(e.value),e.isFtRatingSummary=e=>s(e)&&(null==e.topics||ue(e.topics))&&oe(e.publication),e.isFtRatingType=ne,e.isFtReaderConfiguration=e=>lt(e)&&yt(e.feedback)&&ct(e.loadAfterLastVisibleTopic)&&dt(e.relativeTopicPivotMetadata)&&ct(e.loadBeforeFirstVisibleTopic)&&dt(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=yt,e.isFtSearchFacet=Xe,e.isFtSearchFacetConf=Qe,e.isFtSearchFacetEntry=ze,e.isFtSearchLocale=Q,e.isFtSearchLocales=e=>s(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>Q(e))),e.isFtSearchPageSelectEvent=e=>s(e)&&C(e.searchResult)&&(null==e.externalLink||u(e.externalLink))&&O(e.searchQuery),e.isFtSearchPreferences=nt,e.isFtSearchPreferencesConfiguration=e=>s(e)&&s(e.metadata)&&Object.keys(e.metadata).every((e=>u(e)))&&Object.values(e.metadata).every((e=>ce(e))),e.isFtSearchPreset=e=>s(e)&&u(e.name)&&l(e.priority)&&(null==e.contentLocale||u(e.contentLocale))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>ke(e))),e.isFtSearchPrior=Be,e.isFtSearchRequest=e=>s(e)&&(null==e.periodFilter||null==e.periodFilter||Ne(e.periodFilter))&&u(e.query)&&ge(e.paging)&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Pe(e))))&&Array.isArray(e.sort)&&e.sort.every((e=>Je(e)))&&(null==e.virtualField||me(e.virtualField))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>ke(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>Qe(e)))&&(null==e.scope||Ye(e.scope))&&(null==e.uiLocale||u(e.uiLocale))&&(null==e.contentLocale||u(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>Be(e))))&&(null==e.clusterSortCriterions||Array.isArray(e.clusterSortCriterions)&&e.clusterSortCriterions.every((e=>be(e)))),e.isFtSearchResultCluster=He,e.isFtSearchResultClusterEntry=xe,e.isFtSearchResultMap=Ve,e.isFtSearchResultOpenContextMenuEvent=e=>s(e)&&C(e.searchResult)&&(null==e.externalLink||u(e.externalLink))&&O(e.searchQuery),e.isFtSearchResultTopic=Ke,e.isFtSearchResultType=$e,e.isFtSearchResultUnstructuredDocument=je,e.isFtSearchResults=e=>s(e)&&(null==e.spellcheck||Ze(e.spellcheck))&&fe(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>He(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>Xe(e))),e.isFtSearchResultsPageInfo=fe,e.isFtSearchScope=Ye,e.isFtSearchSortCriterion=Je,e.isFtSearchSortCriterionOrder=he,e.isFtSearchSortCriterionType=Ee,e.isFtSemanticSearchAndFilter=e=>lt(e)&&Array.isArray(e.and)&&e.and.every((e=>gt(e))),e.isFtSemanticSearchFilter=gt,e.isFtSemanticSearchKeyValueFilter=e=>lt(e)&&Array.isArray(e.values)&&e.values.every((e=>dt(e)))&&Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>dt(e)))))&&dt(e.key),e.isFtSemanticSearchNotFilter=e=>lt(e)&&gt(e.not),e.isFtSemanticSearchOrFilter=e=>lt(e)&&Array.isArray(e.or)&&e.or.every((e=>gt(e))),e.isFtSemanticSearchRequest=e=>lt(e)&&dt(e.query)&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>gt(e))))&&(null==e.nbResults||ct(e.nbResults)),e.isFtSemanticSearchResponseItem=Rt,e.isFtSession=e=>s(e)&&(null==e.authenticationIdentifier||it(e.authenticationIdentifier))&&l(e.idleTimeoutInMillis)&&st(e.profile)&&o(e.sessionAuthenticated)&&nt(e.searchPreferences),e.isFtSpellcheck=Ze,e.isFtSuggestRequest=e=>s(e)&&u(e.input)&&(null==e.scope||Ye(e.scope))&&Array.isArray(e.sort)&&e.sort.every((e=>Je(e)))&&(null==e.maxCount||l(e.maxCount))&&(null==e.contentLocale||u(e.contentLocale))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>ke(e))),e.isFtSuggestResult=tt,e.isFtSuggestResults=e=>s(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>tt(e))),e.isFtTocNode=K,e.isFtTopic=e=>s(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&u(e.id)&&u(e.contentApiEndpoint)&&u(e.title),e.isFtTopicContentTarget=t=>Object.keys(e.FtTopicContentTarget).includes(t),e.isFtTopicDisplayEvent=e=>s(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>U(e)))&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&l(e.viewDurationMs)&&F(e.location),e.isFtTopicOrigin=G,e.isFtTopicOriginType=y,e.isFtTopicRating=le,e.isFtTopicResource=et,e.isFtTopicStartDisplayEvent=e=>s(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>U(e)))&&(null==e.publication||g(e.publication))&&(null==e.document||T(e.document))&&F(e.location),e.isFtTopicsRatingSummary=ue,e.isFtTranslationContent=e=>s(e)&&o(e.isTranslationError)&&u(e.content),e.isFtTranslationLanguagesResponse=e=>lt(e)&&Array.isArray(e.items)&&e.items.every((e=>ft(e))),e.isFtTranslationLocale=ft,e.isFtTranslationRequest=e=>lt(e)&&dt(e.profileId)&&(null==e.format||mt(e.format))&&dt(e.destinationLanguage)&&Array.isArray(e.content)&&e.content.every((e=>dt(e)))&&(null==e.sourceLanguage||dt(e.sourceLanguage)),e.isFtTranslationResponse=e=>lt(e)&&Array.isArray(e.items)&&e.items.every((e=>dt(e))),e.isFtUiLocale=z,e.isFtUnstructuredDocument=e=>s(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>Z(e)))&&u(e.openMode)&&(null==e.description||u(e.description))&&u(e.mimeType)&&(null==e.baseId||u(e.baseId))&&(null==e.clusterId||u(e.clusterId))&&u(e.contentApiEndpoint)&&u(e.title)&&(null==e.lastPublication||u(e.lastPublication))&&u(e.viewerUrl)&&u(e.lastEdition)&&u(e.filename)&&(null==e.originId||u(e.originId))&&u(e.rightsApiEndpoint)&&(null==e.originUrl||u(e.originUrl))&&(null==e.khubVersion||u(e.khubVersion))&&u(e.id)&&(null==e.lang||u(e.lang)),e.isFtUserProfile=st,e.isFtUserRole=at,e.isFtValueFilter=We,e.isFtVirtualField=me,e.isFtWatermark=ot,e.isTranslationFormat=mt,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(Ct.localStorage){let r={...t,metadata:Ut(t.metadata??{})};const a=Dt(e),i=JSON.stringify(r);return Ct.localStorage.setItem(a,i),Ct.dispatchEvent(new StorageEvent("storage",{key:a,newValue:i,storageArea:Ct.localStorage,url:Ct.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasAllRoles=function(e,...t){return null!=e&&t.every((t=>vt(e,t)))},e.userHasAnyRole=function(e,...t){return null!=e&&t.some((t=>vt(e,t)))},e.userHasRole=vt}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).fluidtopics={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var a={exports:{}};!function(e,r){var a="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==t&&t,i=function(){function e(){this.fetch=!1,this.DOMException=a.DOMException}return e.prototype=a,new e}();!function(e){!function(r){var a=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==t&&t||{},i={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};if(i.arrayBuffer)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],n=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function u(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i.iterable&&(t[Symbol.iterator]=function(){return t}),t}function c(e){this.map={},e instanceof c?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function A(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():i.arrayBuffer&&i.blob&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):i.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||n(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i.blob&&(this.blob=function(){var e=d(this);if(e)return e;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 e=d(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(i.blob)return this.blob().then(y);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,a,i,s=d(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=p(t),a=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=a?a[1]:"utf-8",t.readAsText(e,i),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),a=0;a<t.length;a++)r[a]=String.fromCharCode(t[a]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},i.formData&&(this.formData=function(){return this.text().then(m)}),this.json=function(){return this.text().then(JSON.parse)},this}c.prototype.append=function(e,t){e=o(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},c.prototype.delete=function(e){delete this.map[o(e)]},c.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},c.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},c.prototype.set=function(e,t){this.map[o(e)]=l(t)},c.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},c.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),u(e)},c.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),u(e)},c.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),u(e)},i.iterable&&(c.prototype[Symbol.iterator]=c.prototype.entries);var E=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function T(e,t){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var r,i,s=(t=t||{}).body;if(e instanceof T){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new c(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,s||null==e._bodyInit||(s=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new c(t.headers)),this.method=(r=t.method||this.method||"GET",i=r.toUpperCase(),E.indexOf(i)>-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in a)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function m(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),a=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(a),decodeURIComponent(i))}})),t}function f(e,t){if(!(this instanceof f))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.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=void 0===t.statusText?"":""+t.statusText,this.headers=new c(t.headers),this.url=t.url||"",this._initBody(e)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})},A.call(T.prototype),A.call(f.prototype),f.prototype.clone=function(){return new f(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new c(this.headers),url:this.url})},f.error=function(){var e=new f(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var S=[301,302,303,307,308];f.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new f(null,{status:t,headers:{location:e}})},r.DOMException=a.DOMException;try{new r.DOMException}catch(e){r.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},r.DOMException.prototype=Object.create(Error.prototype),r.DOMException.prototype.constructor=r.DOMException}function F(e,t){return new Promise((function(s,n){var u=new T(e,t);if(u.signal&&u.signal.aborted)return n(new r.DOMException("Aborted","AbortError"));var d=new XMLHttpRequest;function p(){d.abort()}if(d.onload=function(){var e,t,r={statusText:d.statusText,headers:(e=d.getAllResponseHeaders()||"",t=new c,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),a=r.shift().trim();if(a){var i=r.join(":").trim();try{t.append(a,i)}catch(e){console.warn("Response "+e.message)}}})),t)};0===u.url.indexOf("file://")&&(d.status<200||d.status>599)?r.status=200:r.status=d.status,r.url="responseURL"in d?d.responseURL:r.headers.get("X-Request-URL");var a="response"in d?d.response:d.responseText;setTimeout((function(){s(new f(a,r))}),0)},d.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},d.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},d.onabort=function(){setTimeout((function(){n(new r.DOMException("Aborted","AbortError"))}),0)},d.open(u.method,function(e){try{return""===e&&a.location.href?a.location.href:e}catch(t){return e}}(u.url),!0),"include"===u.credentials?d.withCredentials=!0:"omit"===u.credentials&&(d.withCredentials=!1),"responseType"in d&&(i.blob?d.responseType="blob":i.arrayBuffer&&(d.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof c||a.Headers&&t.headers instanceof a.Headers)){var y=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){y.push(o(e)),d.setRequestHeader(e,l(t.headers[e]))})),u.headers.forEach((function(e,t){-1===y.indexOf(t)&&d.setRequestHeader(t,e)}))}else u.headers.forEach((function(e,t){d.setRequestHeader(t,e)}));u.signal&&(u.signal.addEventListener("abort",p),d.onreadystatechange=function(){4===d.readyState&&u.signal.removeEventListener("abort",p)}),d.send(void 0===u._bodyInit?null:u._bodyInit)}))}F.polyfill=!0,a.fetch||(a.fetch=F,a.Headers=c,a.Request=T,a.Response=f),r.Headers=c,r.Request=T,r.Response=f,r.fetch=F}({})}(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=a.fetch?a:i;(r=s.fetch).default=s.fetch,r.fetch=s.fetch,r.Headers=s.Headers,r.Request=s.Request,r.Response=s.Response,e.exports=r}(a,a.exports);var i=r(a.exports);class s{reader;decoder=new TextDecoder;partialChunk="";constructor(e){this.reader=e}async*read(){for(;;){const{done:e,value:t}=await this.reader.read();if(e)return void(yield*this.readRemainingChunks());yield*this.readChunksFromValue(t)}}*readRemainingChunks(){yield*this.parseLine(this.partialChunk)}*readChunksFromValue(e){const t=(this.partialChunk+this.decoder.decode(e)).split("\n");this.partialChunk=t.pop();for(let e of t)yield*this.parseLine(e)}*parseLine(e){const[t,r]=e.split(/:(.*)/);"data"===t&&r.length>0&&(yield JSON.parse(r))}}const n=e=>"object"==typeof e&&null!=e,o=e=>"boolean"==typeof e,l=e=>"number"==typeof e,u=e=>"string"==typeof e;var c;e.FtMyLibraryColors=void 0,(c=e.FtMyLibraryColors||(e.FtMyLibraryColors={})).black="black",c.green="green",c.blue="blue",c.purple="purple",c.red="red",c.orange="orange",c.yellow="yellow";const d=t=>Object.keys(e.FtMyLibraryColors).includes(t);var p;e.FtTopicOriginType=void 0,(p=e.FtTopicOriginType||(e.FtTopicOriginType={})).OFFICIAL="OFFICIAL",p.PERSONAL="PERSONAL",p.SHARED="SHARED";const y=t=>Object.keys(e.FtTopicOriginType).includes(t);var h;e.FtAnalyticsDocumentType=void 0,(h=e.FtAnalyticsDocumentType||(e.FtAnalyticsDocumentType={})).STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",h.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",h.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",h.PERSONAL_BOOK="PERSONAL_BOOK",h.ATTACHMENT="ATTACHMENT",h.RESOURCE="RESOURCE";const A=t=>Object.keys(e.FtAnalyticsDocumentType).includes(t),E=e=>n(e)&&(null==e.chatbotDetails||T(e.chatbotDetails))&&(null==e.translationDetails||f(e.translationDetails))&&(null==e.completionDetails||m(e.completionDetails))&&u(e.name)&&u(e.id)&&u(e.type),T=e=>n(e)&&u(e.provider)&&(null==e.model||u(e.model)),m=e=>n(e)&&u(e.provider)&&(null==e.model||u(e.model)),f=e=>n(e)&&u(e.provider)&&(null==e.engine||u(e.engine)),S=e=>n(e)&&l(e.width)&&l(e.height),F=e=>n(e)&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>te(e))))&&u(e.id)&&(null==e.mimeType||u(e.mimeType))&&(null==e.title||u(e.title))&&(null==e.type||A(e.type))&&(null==e.parentId||u(e.parentId)),R=e=>n(e)&&u(e.terms),g=e=>n(e)&&u(e.type)&&u(e.value),_=e=>n(e)&&u(e.pageType)&&u(e.type)&&u(e.url),b=e=>n(e)&&u(e.name)&&(null==e.language||u(e.language))&&u(e.id)&&u(e.type)&&u(e.url),O=e=>n(e)&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>te(e))))&&u(e.id)&&(null==e.mimeType||u(e.mimeType))&&(null==e.title||u(e.title))&&(null==e.type||P(e.type))&&(null==e.parentId||u(e.parentId)),v=e=>n(e)&&u(e.type)&&(null==e.value||u(e.value)),C=e=>n(e)&&u(e.terms)&&(null==e.searchType||u(e.searchType))&&(null==e.lastUpdate||u(e.lastUpdate))&&(null==e.facets||Array.isArray(e.facets)&&e.facets.every((e=>N(e)))),I=e=>n(e)&&o(e.autocorrect)&&l(e.nbResults),U=e=>n(e)&&F(e.document)&&l(e.rank)&&(null==e.topic||D(e.topic))&&u(e.type),D=e=>n(e)&&(null==e.mapTitle||u(e.mapTitle))&&(null==e.metadata||Array.isArray(e.metadata)&&e.metadata.every((e=>te(e))))&&u(e.tocId)&&(null==e.mapId||u(e.mapId))&&u(e.title);var L;e.FtAnalyticsPublicationType=void 0,(L=e.FtAnalyticsPublicationType||(e.FtAnalyticsPublicationType={})).STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",L.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",L.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",L.PERSONAL_BOOK="PERSONAL_BOOK",L.ATTACHMENT="ATTACHMENT",L.RESOURCE="RESOURCE";const P=t=>Object.keys(e.FtAnalyticsPublicationType).includes(t),N=e=>n(e)&&(null==e.dateValue||k(e.dateValue))&&(null==e.values||Array.isArray(e.values)&&e.values.every((e=>u(e))))&&(null==e.from||u(e.from))&&(null==e.to||u(e.to))&&(null==e.type||B(e.type))&&u(e.key);var M;e.FtAnalyticsSearchDateFacetValue=void 0,(M=e.FtAnalyticsSearchDateFacetValue||(e.FtAnalyticsSearchDateFacetValue={})).LAST_WEEK="LAST_WEEK",M.LAST_MONTH="LAST_MONTH",M.LAST_QUARTER="LAST_QUARTER",M.LAST_YEAR="LAST_YEAR";const k=t=>Object.keys(e.FtAnalyticsSearchDateFacetValue).includes(t);var w;e.FtAnalyticsSearchFacetType=void 0,(w=e.FtAnalyticsSearchFacetType||(e.FtAnalyticsSearchFacetType={})).VALUE="VALUE",w.DATE="DATE",w.RANGE="RANGE";const B=t=>Object.keys(e.FtAnalyticsSearchFacetType).includes(t);var H;e.FtAnalyticsEventName=void 0,(H=e.FtAnalyticsEventName||(e.FtAnalyticsEventName={})).BOOKMARK__CREATE="BOOKMARK__CREATE",H.BOOKMARK__DELETE="BOOKMARK__DELETE",H.CASE_DEFLECTION__START="CASE_DEFLECTION__START",H.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",H.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",H.COLLECTION__CREATE="COLLECTION__CREATE",H.COLLECTION__UPDATE="COLLECTION__UPDATE",H.COLLECTION__DELETE="COLLECTION__DELETE",H.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",H.DOCUMENT__DISPLAY="DOCUMENT__DISPLAY",H.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",H.DOCUMENT__PRINT="DOCUMENT__PRINT",H.DOCUMENT__PROCESS="DOCUMENT__PROCESS",H.DOCUMENT__RATE="DOCUMENT__RATE",H.DOCUMENT__SEARCH="DOCUMENT__SEARCH",H.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",H.DOCUMENT__UNRATE="DOCUMENT__UNRATE",H.FEEDBACK__SEND="FEEDBACK__SEND",H.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",H.AI__RATE="AI__RATE",H.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",H.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",H.KHUB__PROCESS="KHUB__PROCESS",H.KHUB__SEARCH="KHUB__SEARCH",H.LABELS__DOWNLOAD="LABELS__DOWNLOAD",H.LINK__SHARE="LINK__SHARE",H.PAGE__DISPLAY="PAGE__DISPLAY",H.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",H.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",H.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",H.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",H.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",H.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",H.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",H.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",H.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",H.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",H.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",H.TOPIC__DISPLAY="TOPIC__DISPLAY",H.TOPIC__RATE="TOPIC__RATE",H.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",H.TOPIC__UNRATE="TOPIC__UNRATE",H.USER__LOGIN="USER__LOGIN",H.USER__LOGOUT="USER__LOGOUT",H.HEARTBEAT="HEARTBEAT";const x=t=>Object.keys(e.FtAnalyticsEventName).includes(t),j=e=>n(e)&&Array.isArray(e.values)&&e.values.every((e=>Array.isArray(e)&&e.every((e=>u(e)))))&&u(e.key),K=e=>n(e)&&u(e.notes)&&Array.isArray(e.children)&&e.children.every((e=>K(e)))&&(null==e.topicLink||V(e.topicLink))&&u(e.title)&&(null==e.htmlContent||u(e.htmlContent)),V=e=>n(e)&&u(e.tocId)&&u(e.contentId)&&u(e.mapId),G=e=>n(e)&&u(e.topicStylesheetUrl)&&u(e.titleStylesheetUrl)&&Array.isArray(e.customCssClasses)&&e.customCssClasses.every((e=>u(e))),$=e=>n(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&(null==e.hasRating||o(e.hasRating))&&u(e.tocId)&&Array.isArray(e.children)&&e.children.every((e=>$(e)))&&(null==e.origin||q(e.origin))&&u(e.contentId)&&(null==e.untranslatedTitle||u(e.untranslatedTitle))&&u(e.title),q=e=>n(e)&&u(e.mapTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&u(e.contentId)&&u(e.mapId)&&y(e.type);var Y;e.FtTopicContentTarget=void 0,(Y=e.FtTopicContentTarget||(e.FtTopicContentTarget={})).THIRD_PARTY="THIRD_PARTY",Y.OFF_THE_GRID="OFF_THE_GRID",Y.CONTENT_PACKAGER="CONTENT_PACKAGER",Y.PAGES="PAGES",Y.DESIGNED_READER="DESIGNED_READER";var W;e.FtExternalWebComponentContext=void 0,(W=e.FtExternalWebComponentContext||(e.FtExternalWebComponentContext={})).HOMEPAGE="HOMEPAGE",W.CUSTOM="CUSTOM",W.HEADER="HEADER",W.READER="READER",W.TOPIC_TEMPLATE="TOPIC_TEMPLATE",W.SEARCH="SEARCH",W.SEARCH_RESULT="SEARCH_RESULT";var Q;e.FtMetadataHomeLayout=void 0,(Q=e.FtMetadataHomeLayout||(e.FtMetadataHomeLayout={})).CLASSIC="CLASSIC",Q.CUSTOM="CUSTOM",Q.DESIGNER="DESIGNER";const X=e=>n(e)&&u(e.lang)&&u(e.region),z=e=>n(e)&&X(e.defaultUiLocale)&&X(e.defaultContentLocale)&&Array.isArray(e.defaultRegions)&&e.defaultRegions.every((e=>X(e))),J=e=>n(e)&&l(e.count)&&u(e.label)&&(null==e.lang||u(e.lang)),Z=e=>n(e)&&u(e.displayName)&&u(e.languageTag)&&o(e.translated);var ee;e.FtFacetType=void 0,(ee=e.FtFacetType||(e.FtFacetType={})).AND="AND",ee.OR="OR",ee.MONOVALUED="MONOVALUED";const te=e=>n(e)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&(null==e.hierarchicalValues||Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>u(e))))))&&u(e.label)&&u(e.key);var re;e.FtMetadataSortRule=void 0,(re=e.FtMetadataSortRule||(e.FtMetadataSortRule={})).NONE="NONE",re.ALPHABET="ALPHABET",re.VERSION="VERSION";const ae=t=>Object.keys(e.FtMetadataSortRule).includes(t),ie=e=>n(e)&&o(e.date)&&ae(e.sortRule)&&u(e.label)&&o(e.reverseSort)&&u(e.key),se=e=>n(e)&&(null==e.periodFilter||ke(e.periodFilter))&&u(e.query)&&(null==e.scope||Qe(e.scope))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Ne(e))))&&Array.isArray(e.sort)&&e.sort.every((e=>et(e)))&&(null==e.virtualField||Se(e.virtualField))&&(null==e.metadataFilters||Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>Pe(e))))&&(null==e.contentLocale||u(e.contentLocale));var ne;e.FtRatingType=void 0,(ne=e.FtRatingType||(e.FtRatingType={})).STARS="STARS",ne.LIKE="LIKE",ne.DICHOTOMOUS="DICHOTOMOUS",ne.NO_RATING="NO_RATING";const oe=t=>Object.keys(e.FtRatingType).includes(t),le=e=>n(e)&&u(e.date)&&oe(e.type)&&l(e.value),ue=e=>n(e)&&(null==e.rating||le(e.rating))&&oe(e.type),ce=e=>n(e)&&u(e.date)&&u(e.tocId)&&oe(e.type)&&l(e.value),de=e=>n(e)&&Array.isArray(e.ratings)&&e.ratings.every((e=>ce(e)))&&oe(e.type),pe=e=>n(e)&&Array.isArray(e.filter)&&e.filter.every((e=>u(e)))&&Array.isArray(e.prior)&&e.prior.every((e=>u(e)));var ye;e.FtPeriodFilterType=void 0,(ye=e.FtPeriodFilterType||(e.FtPeriodFilterType={})).LAST_WEEK="LAST_WEEK",ye.LAST_MONTH="LAST_MONTH",ye.LAST_QUARTER="LAST_QUARTER",ye.LAST_YEAR="LAST_YEAR",ye.CUSTOM="CUSTOM";const he=t=>Object.keys(e.FtPeriodFilterType).includes(t);var Ae;e.FtSearchSortCriterionOrder=void 0,(Ae=e.FtSearchSortCriterionOrder||(e.FtSearchSortCriterionOrder={})).ASC="ASC",Ae.DESC="DESC";const Ee=t=>Object.keys(e.FtSearchSortCriterionOrder).includes(t);var Te;e.FtSearchSortCriterionType=void 0,(Te=e.FtSearchSortCriterionType||(e.FtSearchSortCriterionType={})).ALPHA="ALPHA",Te.NATURAL="NATURAL";const me=t=>Object.keys(e.FtSearchSortCriterionType).includes(t);var fe;e.FtVirtualField=void 0,(fe=e.FtVirtualField||(e.FtVirtualField={})).EVERYWHERE="EVERYWHERE",fe.TITLE_ONLY="TITLE_ONLY",fe.NONE="NONE";const Se=t=>Object.keys(e.FtVirtualField).includes(t),Fe=e=>n(e)&&l(e.totalResultsCount)&&o(e.isLastPage)&&l(e.currentPage)&&l(e.totalClustersCount);var Re;e.FtEditorialType=void 0,(Re=e.FtEditorialType||(e.FtEditorialType={})).ARTICLE="ARTICLE",Re.BOOK="BOOK",Re.SHARED_BOOK="SHARED_BOOK";const ge=t=>Object.keys(e.FtEditorialType).includes(t);var _e;e.FtOpenMode=void 0,(_e=e.FtOpenMode||(e.FtOpenMode={})).FLUIDTOPICS="FLUIDTOPICS",_e.EXTERNAL="EXTERNAL";const be=t=>Object.keys(e.FtOpenMode).includes(t),Oe=e=>n(e)&&(null==e.perPage||l(e.perPage))&&l(e.page),ve=e=>n(e)&&u(e.key);var Ce;e.FtCollectionDocumentType=void 0,(Ce=e.FtCollectionDocumentType||(e.FtCollectionDocumentType={})).MAP="MAP",Ce.DOCUMENT="DOCUMENT",Ce.TOPIC="TOPIC",Ce.PERSONAL_BOOK="PERSONAL_BOOK",Ce.SHARED_BOOK="SHARED_BOOK";const Ie=t=>Object.keys(e.FtCollectionDocumentType).includes(t),Ue=e=>n(e)&&Le(e.type);var De;e.FtDateFilterType=void 0,(De=e.FtDateFilterType||(e.FtDateFilterType={})).LAST_WEEK="LAST_WEEK",De.LAST_MONTH="LAST_MONTH",De.LAST_QUARTER="LAST_QUARTER",De.LAST_YEAR="LAST_YEAR";const Le=t=>Object.keys(e.FtDateFilterType).includes(t),Pe=e=>n(e)&&(null==e.valueFilter||Xe(e.valueFilter))&&(null==e.rangeFilter||He(e.rangeFilter))&&u(e.label)&&u(e.key)&&(null==e.dateFilter||Ue(e.dateFilter)),Ne=e=>n(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&u(e.label)&&u(e.key),Me=e=>n(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e)))&&u(e.key),ke=e=>n(e)&&(null==e.period||Be(e.period))&&he(e.periodType)&&(null==e.key||u(e.key)),we=e=>n(e)&&(null==e.valueFilter||Xe(e.valueFilter))&&(null==e.rangeFilter||He(e.rangeFilter))&&u(e.key)&&(null==e.dateFilter||Ue(e.dateFilter)),Be=e=>n(e)&&u(e.from)&&u(e.to),He=e=>n(e)&&u(e.from)&&u(e.to),xe=e=>n(e)&&l(e.weight)&&u(e.value)&&u(e.key),je=e=>n(e)&&Array.isArray(e.entries)&&e.entries.every((e=>Ke(e)))&&(null==e.metadataVariableAxis||u(e.metadataVariableAxis)),Ke=e=>n(e)&&Array.isArray(e.missingTerms)&&e.missingTerms.every((e=>u(e)))&&(null==e.document||Ve(e.document))&&(null==e.topic||$e(e.topic))&&Ye(e.type)&&(null==e.map||Ge(e.map)),Ve=e=>n(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&(null==e.openMode||be(e.openMode))&&u(e.documentUrl)&&u(e.mimeType)&&u(e.title)&&u(e.lastPublicationDate)&&u(e.viewerUrl)&&u(e.contentUrl)&&u(e.filename)&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.documentId)&&u(e.lastEditionDate)&&u(e.htmlExcerpt),Ge=e=>n(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&(null==e.openMode||be(e.openMode))&&ge(e.editorialType)&&u(e.title)&&u(e.lastPublicationDate)&&u(e.htmlTitle)&&(null==e.originUrl||u(e.originUrl))&&u(e.mapUrl)&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt),$e=e=>n(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&(null==e.openMode||be(e.openMode))&&u(e.contentId)&&Array.isArray(e.resources)&&e.resources.every((e=>rt(e)))&&u(e.title)&&u(e.mapTitle)&&u(e.topicUrl)&&u(e.contentUrl)&&u(e.htmlTitle)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&(null==e.originUrl||u(e.originUrl))&&u(e.readerUrl)&&u(e.mapId)&&(null==e.lastEditionDate||u(e.lastEditionDate))&&u(e.htmlExcerpt);var qe;e.FtSearchResultType=void 0,(qe=e.FtSearchResultType||(e.FtSearchResultType={})).MAP="MAP",qe.DOCUMENT="DOCUMENT",qe.TOPIC="TOPIC";const Ye=t=>Object.keys(e.FtSearchResultType).includes(t);var We;e.FtSearchScope=void 0,(We=e.FtSearchScope||(e.FtSearchScope={})).DEFAULT="DEFAULT",We.DOCUMENTS="DOCUMENTS",We.ALL_TOPICS="ALL_TOPICS",We.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS";const Qe=t=>Object.keys(e.FtSearchScope).includes(t),Xe=e=>n(e)&&o(e.negative)&&Array.isArray(e.values)&&e.values.every((e=>u(e))),ze=e=>n(e)&&o(e.hierarchical)&&u(e.label)&&o(e.multiSelectionable)&&u(e.key)&&Array.isArray(e.rootNodes)&&e.rootNodes.every((e=>Ze(e))),Je=e=>n(e)&&(null==e.maxDepth||l(e.maxDepth))&&u(e.id),Ze=e=>n(e)&&l(e.totalResultsCount)&&o(e.descendantSelected)&&Array.isArray(e.childNodes)&&e.childNodes.every((e=>Ze(e)))&&u(e.label)&&u(e.value)&&o(e.selected),et=e=>n(e)&&me(e.type)&&u(e.key)&&Ee(e.order),tt=e=>n(e)&&u(e.suggestedQuery)&&u(e.htmlSuggestedQuery),rt=e=>n(e)&&u(e.filename)&&u(e.resourceUrl)&&u(e.id)&&u(e.mimeType)&&u(e.resourceContentUrl)&&u(e.viewerUrl),at=e=>n(e)&&(null==e.filenameExtension||u(e.filenameExtension))&&(null==e.editorialType||ge(e.editorialType))&&(null==e.mimeType||u(e.mimeType))&&Ye(e.type)&&u(e.value);var it;e.FtUserRole=void 0,(it=e.FtUserRole||(e.FtUserRole={})).PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",it.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",it.HTML_EXPORT_USER="HTML_EXPORT_USER",it.PDF_EXPORT_USER="PDF_EXPORT_USER",it.SAVED_SEARCH_USER="SAVED_SEARCH_USER",it.COLLECTION_USER="COLLECTION_USER",it.OFFLINE_USER="OFFLINE_USER",it.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",it.ANALYTICS_USER="ANALYTICS_USER",it.BETA_USER="BETA_USER",it.DEBUG_USER="DEBUG_USER",it.PRINT_USER="PRINT_USER",it.RATING_USER="RATING_USER",it.FEEDBACK_USER="FEEDBACK_USER",it.GENERATIVE_AI_USER="GENERATIVE_AI_USER",it.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",it.CONTENT_PUBLISHER="CONTENT_PUBLISHER",it.KHUB_ADMIN="KHUB_ADMIN",it.USERS_ADMIN="USERS_ADMIN",it.PORTAL_ADMIN="PORTAL_ADMIN",it.ADMIN="ADMIN";const st=t=>Object.keys(e.FtUserRole).includes(t);var nt;e.FtUserAssetType=void 0,(nt=e.FtUserAssetType||(e.FtUserAssetType={})).SEARCHES="SEARCHES",nt.BOOKMARKS="BOOKMARKS",nt.BOOKS="BOOKS",nt.COLLECTIONS="COLLECTIONS";const ot=t=>Object.keys(e.FtUserAssetType).includes(t),lt=e=>n(e)&&u(e.identifier)&&u(e.realm),ut=e=>n(e)&&(null==e.defaultFilters||Array.isArray(e.defaultFilters)&&e.defaultFilters.every((e=>Me(e))))&&Array.isArray(e.defaultMetadataFilters)&&e.defaultMetadataFilters.every((e=>we(e))),ct=e=>n(e)&&(null==e.emailAddress||u(e.emailAddress))&&(null==e.displayName||u(e.displayName))&&(null==e.otpValidated||o(e.otpValidated))&&Array.isArray(e.roles)&&e.roles.every((e=>st(e)))&&(null==e.userId||u(e.userId))&&(null==e.privacyPolicyAgreementDate||u(e.privacyPolicyAgreementDate))&&Array.isArray(e.tags)&&e.tags.every((e=>u(e))),dt=e=>n(e)&&u(e.color)&&Array.isArray(e.text)&&e.text.every((e=>u(e)))&&l(e.opacity),pt=e=>"object"==typeof e&&null!=e,yt=e=>"boolean"==typeof e,ht=e=>"number"==typeof e,At=e=>"string"==typeof e;var Et;e.FtConfigurationHistoryEntryStatus=void 0,(Et=e.FtConfigurationHistoryEntryStatus||(e.FtConfigurationHistoryEntryStatus={})).VALID="VALID",Et.INVALID="INVALID";const Tt=e=>pt(e)&&yt(e.mailsSentByFluidTopics)&&yt(e.mailsSentByFluidTopicsForUnauthenticatedUsers)&&Array.isArray(e.recipients)&&e.recipients.every((e=>At(e)))&&Array.isArray(e.bodyMetadataIds)&&e.bodyMetadataIds.every((e=>At(e)))&&Array.isArray(e.subjectMetadataIds)&&e.subjectMetadataIds.every((e=>At(e)));var mt;e.FtRagResponseFormat=void 0,(mt=e.FtRagResponseFormat||(e.FtRagResponseFormat={})).JSON="JSON",mt.TEXT="TEXT";const ft=t=>Object.keys(e.FtRagResponseFormat).includes(t),St=e=>pt(e)&&At(e.role)&&At(e.content),Ft=e=>pt(e)&&gt(e.output)&&Rt(e.input)&&(null==e.profileId||At(e.profileId))&&At(e.id)&&(null==e.sessionId||At(e.sessionId))&&(null==e.userId||At(e.userId))&&At(e.timestamp),Rt=e=>pt(e)&&At(e.query),gt=e=>pt(e)&&At(e.response),_t=e=>pt(e)&&vt(e.output)&&Ot(e.input)&&(null==e.conversationId||At(e.conversationId))&&(null==e.profileId||At(e.profileId))&&At(e.id)&&(null==e.sessionId||At(e.sessionId))&&(null==e.userId||At(e.userId))&&At(e.timestamp),bt=e=>pt(e)&&At(e.role)&&At(e.content),Ot=e=>pt(e)&&At(e.userInstructions)&&At(e.query)&&Array.isArray(e.history)&&e.history.every((e=>bt(e))),vt=e=>pt(e)&&At(e.response);var Ct;e.TranslationFormat=void 0,(Ct=e.TranslationFormat||(e.TranslationFormat={})).TEXT="TEXT",Ct.HTML="HTML";const It=t=>Object.keys(e.TranslationFormat).includes(t),Ut=e=>pt(e)&&At(e.code)&&At(e.label),Dt=e=>pt(e)&&(null==e.parentsVisibility||Array.isArray(e.parentsVisibility)&&e.parentsVisibility.every((e=>yt(e))))&&yt(e.isVisible),Lt=e=>pt(e)&&(null==e.prettyUrl||At(e.prettyUrl))&&(null==e.hasRating||yt(e.hasRating))&&(null==e.pageToc||Array.isArray(e.pageToc))&&(null==e.tocId||At(e.tocId))&&Array.isArray(e.children)&&e.children.every((e=>Lt(e)))&&(null==e.pageConfiguration||Dt(e.pageConfiguration))&&(null==e.contentId||At(e.contentId))&&(null==e.untranslatedTitle||At(e.untranslatedTitle))&&(null==e.title||At(e.title)),Pt=e=>pt(e)&&yt(e.splitCurrentPageToc),Nt=e=>pt(e)&&pt(e.metadata)&&Object.keys(e.metadata).every((e=>At(e)))&&Object.values(e.metadata).every((e=>Array.isArray(e)&&e.every((e=>At(e)))))&&At(e.excerpt)&&ht(e.relevance),Mt=e=>pt(e),kt={[e.FtUserRole.PERSONAL_BOOK_SHARE_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.HTML_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.PDF_EXPORT_USER]:[e.FtUserRole.PERSONAL_BOOK_USER],[e.FtUserRole.KHUB_ADMIN]:[e.FtUserRole.CONTENT_PUBLISHER],[e.FtUserRole.ADMIN]:[e.FtUserRole.KHUB_ADMIN,e.FtUserRole.USERS_ADMIN,e.FtUserRole.PORTAL_ADMIN],[e.FtUserRole.GENERATIVE_AI_EXPORT_USER]:[e.FtUserRole.GENERATIVE_AI_USER]};function wt(e,t){return e===t||(kt[e]??[]).some((e=>wt(e,t)))}function Bt(e,t){if(null==e)return!1;return(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some((e=>wt(e,t)))}const Ht="undefined"==typeof window?globalThis:window;function xt(e){let t={};for(let r in e){let a=e[r];("object"!=typeof a||Array.isArray(a))&&(a={prior:a});for(let e of["prior","filter"])a[e]=Array.isArray(a[e])?a[e]:[a[e]],a[e]=a[e].map((e=>null!=e?""+e:"")).filter((e=>""!==e));t[r]=a}return t}function jt(e){return`${e}-FluidTopicsUnauthenticatedUserSearchPreferences`}const Kt="undefined"==typeof window?globalThis:window;class Vt extends Error{method;endpoint;status;statusText;body;constructor(e,t,r,a,i){super(`${e} ${t} -> ${r} - ${a}: ${i}`),this.method=e,this.endpoint=t,this.status=r,this.statusText=a,this.body=i}}class Gt extends CustomEvent{constructor(e){super("ft-api-http-error",{detail:e})}}async function $t(e,t,r){if(!r.ok){let a={method:e,endpoint:t,status:r.status,statusText:r.statusText,body:await r.text()};throw"function"==typeof Kt.dispatchEvent&&Kt.dispatchEvent(new Gt(a)),new Vt(a.method,a.endpoint,a.status,a.statusText,a.body)}return r}function qt(e){return"application/json"===e.headers.get("Content-Type")?e.json():e.text()}class Yt{tenantBaseUrl;tenantBaseUrlNoTrailingSlash;ftCallingApp;authorization;searchLabel;endpoints={authentication:{login:"api/authentication/login",logout:"api/authentication/logout",currentSession:"api/authentication/current-session"},khub:{maps:{mapId:e=>({info:`api/khub/maps/${e}`,toc:`api/khub/maps/${e}/toc`,pages:`api/khub/maps/${e}/pages`,feedback:`api/khub/maps/${e}/feedback`,rating:`api/khub/maps/${e}/rating`,attachments:{list:`api/khub/maps/${e}/attachments`,attachmentId:t=>({content:`api/khub/maps/${e}/attachments/${t}/content`})},resources:{list:`api/khub/maps/${e}/resources`,resourceId:t=>({content:`api/khub/maps/${e}/resources/${t}/content`})},topics:{contentId:t=>({info:`api/khub/maps/${e}/topics/${t}`,content:`api/khub/maps/${e}/topics/${t}/content`,translation:`api/khub/maps/${e}/topics/${t}/content/translation`}),tocId:t=>({feedback:`api/khub/maps/${e}/topics/${t}/feedback`,rating:`api/khub/maps/${e}/topics/${t}/rating`})}})},documents:{documentId:e=>({info:`api/khub/documents/${e}`,content:`api/khub/documents/${e}/content`,text:`api/khub/documents/${e}/content/text`,feedback:`api/khub/documents/${e}/feedback`,rating:`api/khub/documents/${e}/rating`})},semantic:{search:"api/khub/semantic/search",clusteredSearch:"api/khub/semantic/clustered-search"},suggest:"api/khub/suggest",clusteredSearch:"api/khub/clustered-search",locales:"api/khub/locales"},users:{userId:e=>({collections:{collectionId:t=>({documents:`api/users/${e}/collections/${t}/documents`})},searches:{list:`api/users/${e}/searches`,create:`api/users/${e}/searches`,mySearchId:t=>({delete:`api/users/${e}/searches/${t}`,update:`api/users/${e}/searches/${t}`})},bookmarks:{list:`api/users/${e}/bookmarks`}})},stylesheets:{fonts:"stylesheets/fonts.css",theme:"stylesheets/theme.css",content:{title:"stylesheets/content/title.css",topic:"stylesheets/content/topic.css"}},configuration:{reader:"api/configuration/reader",metadata:"api/configuration/metadata"},locales:{ui:"api/locales/ui",get:"api/locales"},messages:{locale:e=>({fluidTopics:{contextName:t=>({endpoint:`api/messages/${e}/fluid-topics/${t}`})},custom:{contextName:t=>({endpoint:`api/messages/${e}/custom/${t}`})}})},ai:{generate:"api/ai/generate",sendFeedback:"api/ai/rate",chat:"/api/ai/rag/chat",translate:"api/ai/translate",destinationLanguages:e=>({endpoint:`api/ai/translate/${e}/languages`})},assets:{highlightjs:"assets/scripts/highlightjs",customCode:e=>({endpoint:`portal/custom-code/${e}`})},analytics:{events:"api/analytics/events"}};get defaultHeaders(){return{...this.authorization,...this.searchLabel,"Ft-Calling-App":this.ftCallingApp}}constructor(e,t,r){e=(e??Kt.fluidTopicsBaseUrl??Kt.__gwt_ft_moduleBase??"").trim(),this.tenantBaseUrl=e.endsWith("/")?e:e+"/",this.tenantBaseUrlNoTrailingSlash=this.tenantBaseUrl.replace(/\/$/,""),r&&void 0!==Kt.location&&Kt.location.href.startsWith(this.tenantBaseUrl)?this.ftCallingApp=t:this.ftCallingApp=`ft-public-api/${t}`}setApiKey(e){this.authorization={Authorization:"Bearer "+e}}setCredentials(e,t){var r;this.authorization={Authorization:"Basic "+(r=`${e}:${t}`,"undefined"!=typeof Buffer?Buffer.from(r).toString("base64"):btoa(r))}}clearAuthentication(){this.authorization=void 0}setSearchLabel(e){this.searchLabel={"FT-search-label":e}}clearSearchLabel(){this.searchLabel=void 0}login(e,t){let r={login:e,password:t,rememberMe:!0};return this.post(this.endpoints.authentication.login,r).then((r=>(this.setCredentials(e,t),r)))}logout(){return this.post(this.endpoints.authentication.logout).then((()=>this.clearAuthentication()))}getCurrentSession(){return this.get(this.endpoints.authentication.currentSession)}getReaderConfiguration(){return this.get(this.endpoints.configuration.reader)}getMap(e,t,r){const a=this.endpoints.khub.maps.mapId(e).info,i={...this.buildTranslationParameters(t),v:r};return this.get(this.buildUrlFromParams(a,i))}getTableOfContent(e,t){return this.get(this.endpoints.khub.maps.mapId(e).toc,t)}getPages(e,t,r){const a=this.endpoints.khub.maps.mapId(e).pages,i={...this.buildTranslationParameters(r),v:t};return this.get(this.buildUrlFromParams(a,i))}getTopic(e,t,r){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).info,r)}getTopicHTMLContent(e,t,r,a){return this.get(this.endpoints.khub.maps.mapId(e).topics.contentId(t).content+(r?"?target="+r:""),a)}getTranslatedTopicHTMLContent(e,t,r,a,i){const s=this.endpoints.khub.maps.mapId(e).topics.contentId(t).translation,n={...this.buildTranslationParameters(i),target:r,v:a};return this.get(this.buildUrlFromParams(s,n))}getMapAttachments(e,t){return this.get(this.endpoints.khub.maps.mapId(e).attachments.list,t)}getMapAttachmentContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).attachments.attachmentId(t).content,r)}getMapResources(e,t){return this.get(this.endpoints.khub.maps.mapId(e).resources.list,t)}getMapResourceContent(e,t,r){return this.fetchRawData(this.endpoints.khub.maps.mapId(e).resources.resourceId(t).content,r)}getUnstructuredDocument(e,t){return this.get(this.endpoints.khub.documents.documentId(e).info,t)}getUnstructuredDocumentContent(e,t){return this.fetchRawData(this.endpoints.khub.documents.documentId(e).content,t)}getUnstructuredDocumentTextContent(e,t){return this.get(this.endpoints.khub.documents.documentId(e).text,t)}getCollectionDocuments(e,t){return this.get(this.endpoints.users.userId(e).collections.collectionId(t).documents)}getSuggestions(e){return this.post(this.endpoints.khub.suggest,e)}search(e){return this.post(this.endpoints.khub.clusteredSearch,e)}getAvailableSearchLocales(){return this.get(this.endpoints.khub.locales)}getAvailableUiLocales(){return this.get(this.endpoints.locales.ui)}getLocalesConfiguration(){return this.get(this.endpoints.locales.get)}getMetadataConfiguration(){return this.get(this.endpoints.configuration.metadata)}getMapRating(e){return this.get(this.endpoints.khub.maps.mapId(e).rating)}rateMap(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).rating,{type:t,value:r})}unrateMap(e){return this.delete(this.endpoints.khub.maps.mapId(e).rating)}sendMapFeedback(e,t,r){return this.post(this.endpoints.khub.maps.mapId(e).feedback,{message:t,from:r})}rateTopic(e,t,r,a){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating,{type:r,value:a})}unrateTopic(e,t){return this.delete(this.endpoints.khub.maps.mapId(e).topics.tocId(t).rating)}sendTopicFeedback(e,t,r,a){return this.post(this.endpoints.khub.maps.mapId(e).topics.tocId(t).feedback,{message:r,from:a})}getDocumentRating(e){return this.get(this.endpoints.khub.documents.documentId(e).rating)}rateDocument(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).rating,{type:t,value:r})}unrateDocument(e){return this.delete(this.endpoints.khub.documents.documentId(e).rating)}sendDocumentFeedback(e,t,r){return this.post(this.endpoints.khub.documents.documentId(e).feedback,{message:t,from:r})}semanticSearch(e){return this.post(this.endpoints.khub.semantic.search,{request:e})}clusteredSemanticSearch(e){return this.post(this.endpoints.khub.semantic.clusteredSearch,{request:e})}getFluidTopicsMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).fluidTopics.contextName(t).endpoint)}getCustomMessageContext(e,t){return this.get(this.endpoints.messages.locale(e).custom.contextName(t).endpoint)}listMySearches(e){return this.get(this.endpoints.users.userId(e).searches.list)}createMySearch(e,t){return this.post(this.endpoints.users.userId(e).searches.create,t)}updateMySearch(e,t,r){return this.put(this.endpoints.users.userId(e).searches.mySearchId(t).update,r)}deleteMySearch(e,t){return this.delete(this.endpoints.users.userId(e).searches.mySearchId(t).delete)}listMyBookmarks(e){return this.get(this.endpoints.users.userId(e).bookmarks.list)}sendEvents(e){return e.length?this.post(this.endpoints.analytics.events,e):Promise.resolve()}async*generate(e,t){const r=await this.fetch(this.endpoints.ai.generate,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({profileId:e,parameters:t}),credentials:null==this.authorization?"include":void 0});await $t("POST",this.endpoints.ai.generate,r);const a=new s(r.body.getReader());yield*a.read()}async*chat(e){const t=await this.fetch(this.endpoints.ai.chat,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),credentials:null==this.authorization?"include":void 0});await $t("POST",this.endpoints.ai.chat,t);const r=new s(t.body.getReader());yield*r.read()}translate(e){return this.post(this.endpoints.ai.translate,e)}getDestinationLanguages(e,t){const r=this.endpoints.ai.destinationLanguages(e).endpoint,a={sourceLanguage:t};return this.get(this.buildUrlFromParams(r,a))}sendFeedback(e){return this.post(this.endpoints.ai.sendFeedback,e)}get(e,t){return this.makeRequest("GET",this.withVersion(e,t))}post(e,t){return this.makeRequest("POST",e,t)}put(e,t){return this.makeRequest("PUT",e,t)}delete(e){return this.makeRequest("DELETE",e)}makeAbsolute(e){return e.startsWith(this.tenantBaseUrl)||e===this.tenantBaseUrlNoTrailingSlash?e:this.tenantBaseUrl+e.replace(/^\//,"")}extractEndpoint(e){return e.replace(this.tenantBaseUrlNoTrailingSlash,"").replace(/^\//,"")}async fetch(e,t){const r=t;return await i(this.makeAbsolute(e),{...r??{},headers:{...this.defaultHeaders,...r?.headers??{}}})}upload(e,t,r,a=(()=>{})){return"undefined"!=typeof XMLHttpRequest?new Promise(((i,s)=>{let n=new XMLHttpRequest;n.onload=()=>{if(n.status>=200&&n.status<300){let e="application/json"===n.getResponseHeader("Content-Type")?JSON.parse(n.responseText):n.responseText;i(e)}else s(new Vt("GET",t,n.status,n.statusText,n.responseText))},n.upload.onprogress=e=>a(e),n.open(e,this.makeAbsolute(t),!0),n.send(r)})):this.fetch(t,{method:e,body:r}).then((r=>$t(e,t,r))).then(qt)}makeRequest(e,t,r){return this.fetch(t,{method:e,headers:{...null!=r?{"Content-Type":"application/json"}:{}},body:null!=r?JSON.stringify(r):void 0,credentials:null==this.authorization?"include":void 0}).then((r=>$t(e,t,r))).then(qt)}fetchRawData(e,t){return i(this.withVersion(e,t),{headers:this.defaultHeaders,credentials:null==this.authorization?"include":void 0}).then((t=>$t("GET",e,t))).then((e=>e.arrayBuffer()))}withVersion(e,t){let r=new URL(this.makeAbsolute(e));return t&&r.searchParams.append("v",t),r.toString()}withAnalyticsQueryParams(e){let t=new URL(this.makeAbsolute(e));return t.searchParams.append("Ft-Calling-App",this.ftCallingApp),t.toString()}buildUrlFromParams(e,t){const r=new URL(this.makeAbsolute(e));return t&&Object.entries(t).forEach((([e,t])=>{t&&r.searchParams.append(e,t)})),r.toString()}buildTranslationParameters(e){if(e)return{translationProfileId:e.profileId,translationDestinationLanguage:e.destinationLanguage,translationSourceLanguage:e.sourceLanguage?.slice(0,2)}}}e.AIChunkReader=s,e.FluidTopicsApi=Yt,e.HttpError=Vt,e.HttpErrorEvent=Gt,e.addUnauthenticatedUserSearchPreferencesChangeHandler=function(e,t){if(Ht.localStorage){const r=jt(e),a=e=>{e.storageArea===Ht.localStorage&&e.key===r&&t(JSON.parse(e.newValue??"{}"))};return Ht.addEventListener("storage",a),{removeHandler:()=>Ht.removeEventListener("storage",a)}}console.error("Cannot handle unauthenticated preferences: local storage is unavailable.")},e.default=Yt,e.getUnauthenticatedUserSearchPreferences=function(e){if(Ht.localStorage)return JSON.parse(Ht.localStorage.getItem(jt(e))??"{}");console.error("Cannot get unauthenticated preferences: local storage is unavailable.")},e.isFtAiCaseDeflectionEvent=e=>n(e)&&(null==e.generationId||u(e.generationId))&&(null==e.searchQuery||C(e.searchQuery))&&u(e.context),e.isFtAiCompletedQueryEvent=e=>n(e)&&u(e.result)&&E(e.profile)&&l(e.durationMs)&&(null==e.parameters||n(e.parameters)&&Object.keys(e.parameters).every((e=>u(e)))&&Object.values(e.parameters).every((e=>u(e))))&&u(e.queryId),e.isFtAiRateEvent=e=>n(e)&&v(e.rating)&&u(e.comment)&&u(e.queryId),e.isFtAnalyticsDocumentType=A,e.isFtAnalyticsEvent=e=>n(e)&&o(e.offline)&&u(e.appVersion)&&(null==e.internal||o(e.internal))&&u(e.appName)&&x(e.name),e.isFtAnalyticsEventAIProfile=E,e.isFtAnalyticsEventAIProfileChatbotDetails=T,e.isFtAnalyticsEventAIProfileCompletionDetails=m,e.isFtAnalyticsEventAIProfileTranslationDetails=f,e.isFtAnalyticsEventDisplay=S,e.isFtAnalyticsEventDocument=F,e.isFtAnalyticsEventDocumentSearchQuery=R,e.isFtAnalyticsEventLocation=g,e.isFtAnalyticsEventName=x,e.isFtAnalyticsEventOrigin=_,e.isFtAnalyticsEventPage=b,e.isFtAnalyticsEventPublication=O,e.isFtAnalyticsEventRating=v,e.isFtAnalyticsEventSearchQuery=C,e.isFtAnalyticsEventSearchResponse=I,e.isFtAnalyticsEventSearchResult=U,e.isFtAnalyticsEventTopic=D,e.isFtAnalyticsPublicationType=P,e.isFtAnalyticsSearchDateFacetValue=k,e.isFtAnalyticsSearchFacet=N,e.isFtAnalyticsSearchFacetType=B,e.isFtAuthenticatedSession=e=>n(e)&&lt(e.authenticationIdentifier)&&ct(e.profile),e.isFtAuthenticationIdentifier=lt,e.isFtBookmark=e=>n(e)&&u(e.mapTitle)&&d(e.color)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>u(e)))&&u(e.tocId)&&u(e.lastUpdate)&&u(e.readerUrl)&&u(e.mapId)&&u(e.id)&&u(e.title)&&u(e.creationDate),e.isFtCaseDeflectionEvent=e=>n(e)&&(null==e.searchQuery||C(e.searchQuery))&&u(e.context)&&(null==e.rating||v(e.rating))&&(null==e.topic||D(e.topic)),e.isFtClusteredSemanticSearchReply=e=>pt(e)&&Array.isArray(e.documents)&&e.documents.every((e=>Nt(e)))&&Array.isArray(e.clusterId)&&e.clusterId.every((e=>At(e))),e.isFtCollectionDocument=e=>n(e)&&o(e.deleted)&&(null==e.apiUrl||u(e.apiUrl))&&(null==e.portalUrl||u(e.portalUrl))&&u(e.id)&&u(e.title)&&Ie(e.type),e.isFtCollectionDocumentType=Ie,e.isFtConfigurationHistoryEntryStatus=t=>Object.keys(e.FtConfigurationHistoryEntryStatus).includes(t),e.isFtCredentials=e=>n(e)&&u(e.password)&&(null==e.newPassword||u(e.newPassword))&&o(e.rememberMe)&&u(e.login),e.isFtCustomTriggerEvent=e=>n(e)&&(null==e.componentId||u(e.componentId))&&u(e.eventName)&&b(e.page),e.isFtDateFilter=Ue,e.isFtDateFilterType=Le,e.isFtDefaultLocale=X,e.isFtDefaultLocales=z,e.isFtDocumentDisplayEvent=e=>n(e)&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&l(e.viewDurationMs)&&g(e.location),e.isFtDocumentDownloadEvent=e=>n(e)&&F(e.document)&&g(e.location),e.isFtDocumentPrintEvent=e=>n(e)&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document)),e.isFtDocumentSearchEvent=e=>n(e)&&I(e.searchResponse)&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&R(e.searchQuery),e.isFtDocumentStartDisplayEvent=e=>n(e)&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&g(e.location),e.isFtEditorialType=ge,e.isFtExternalWebComponentContext=t=>Object.keys(e.FtExternalWebComponentContext).includes(t),e.isFtFacetType=t=>Object.keys(e.FtFacetType).includes(t),e.isFtFeedbackCreation=e=>n(e)&&(null==e.from||u(e.from))&&u(e.message),e.isFtFeedbackSendEvent=e=>n(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>D(e)))&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&o(e.loggedIn),e.isFtGenAIFetchGenerationTracesResult=e=>pt(e)&&(null==e.endDate||At(e.endDate))&&ht(e.nbResults)&&Array.isArray(e.results)&&e.results.every((e=>Ft(e)))&&(null==e.startDate||At(e.startDate)),e.isFtGenAIFetchRagTracesResult=e=>pt(e)&&(null==e.endDate||At(e.endDate))&&ht(e.nbResults)&&Array.isArray(e.results)&&e.results.every((e=>_t(e)))&&(null==e.startDate||At(e.startDate)),e.isFtGenAIGenerateInput=e=>pt(e)&&At(e.profileId)&&(null==e.parameters||pt(e.parameters)&&Object.keys(e.parameters).every((e=>At(e)))&&Object.values(e.parameters).every((e=>At(e)))),e.isFtGenAIGenerationFetchTracesRequest=e=>pt(e)&&(null==e.endDate||At(e.endDate))&&(null==e.nbResults||ht(e.nbResults))&&(null==e.userId||At(e.userId))&&(null==e.startDate||At(e.startDate)),e.isFtGenAIGenerationTrace=Ft,e.isFtGenAIGenerationTraceInput=Rt,e.isFtGenAIGenerationTraceOutput=gt,e.isFtGenAIRagFetchTracesRequest=e=>pt(e)&&(null==e.endDate||At(e.endDate))&&(null==e.nbResults||ht(e.nbResults))&&(null==e.userId||At(e.userId))&&(null==e.startDate||At(e.startDate)),e.isFtGenAIRagTrace=_t,e.isFtGenAIRagTraceHistoryItem=bt,e.isFtGenAIRagTraceInput=Ot,e.isFtGenAIRagTraceOutput=vt,e.isFtGenAIRating=e=>pt(e)&&ht(e.rating)&&At(e.comment)&&At(e.queryId),e.isFtHttpErrorDetails=e=>n(e)&&u(e.endpoint)&&u(e.method)&&u(e.statusText)&&u(e.body)&&l(e.status),e.isFtKhubSearchEvent=e=>n(e)&&I(e.searchResponse)&&C(e.searchQuery),e.isFtLabeledMetadataFilter=Pe,e.isFtLabelsDownloadEvent=e=>n(e)&&u(e.locale),e.isFtLegacyLabeledMetadataFilter=Ne,e.isFtLegacyMetadataFilter=Me,e.isFtLinkShareEvent=e=>n(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>D(e)))&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document)),e.isFtLocalesConfiguration=e=>n(e)&&Array.isArray(e.availableUiLocales)&&e.availableUiLocales.every((e=>Z(e)))&&o(e.allLanguagesAllowed)&&z(e.defaultLocales),e.isFtMap=e=>n(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&(null==e.topicsApiEndpoint||u(e.topicsApiEndpoint))&&(null==e.description||u(e.description))&&ge(e.editorialType)&&u(e.baseId)&&u(e.clusterId)&&u(e.title)&&u(e.lastEdition)&&u(e.originId)&&(null==e.rightsApiEndpoint||u(e.rightsApiEndpoint))&&u(e.fingerprint)&&u(e.readerUrl)&&(null==e.untranslatedTitle||u(e.untranslatedTitle))&&(null==e.khubVersion||u(e.khubVersion))&&u(e.id)&&(null==e.lang||u(e.lang))&&(null==e.watermark||dt(e.watermark))&&be(e.openMode)&&(null==e.attachmentsApiEndpoint||u(e.attachmentsApiEndpoint))&&u(e.lastPublication)&&o(e.pbkConfidential)&&G(e.contentStyles)&&(null==e.originUrl||u(e.originUrl))&&o(e.translationError),e.isFtMapAttachment=e=>pt(e)&&At(e.file)&&(null==e.size||ht(e.size))&&yt(e.externalLink)&&At(e.name)&&At(e.id)&&(null==e.mimeType||At(e.mimeType))&&(null==e.viewerUrl||At(e.viewerUrl)),e.isFtMapResource=e=>n(e)&&u(e.contentUrl)&&u(e.filename)&&u(e.id)&&u(e.mimeType),e.isFtMapStyles=G,e.isFtMessageContext=e=>n(e)&&u(e.name)&&n(e.messages)&&Object.keys(e.messages).every((e=>u(e)))&&Object.values(e.messages).every((e=>u(e)))&&u(e.locale),e.isFtMetadata=te,e.isFtMetadataConfiguration=e=>n(e)&&Array.isArray(e.descriptors)&&e.descriptors.every((e=>ie(e))),e.isFtMetadataDescriptor=ie,e.isFtMetadataFilter=we,e.isFtMetadataHomeLayout=t=>Object.keys(e.FtMetadataHomeLayout).includes(t),e.isFtMetadataPreferenceConfiguration=pe,e.isFtMetadataSortRule=ae,e.isFtMyLibraryColors=d,e.isFtMySearch=e=>n(e)&&se(e.searchRequest)&&d(e.color)&&o(e.alert)&&u(e.description)&&u(e.id)&&u(e.ownerId)&&u(e.title)&&u(e.creationDate),e.isFtMySearchCreation=e=>n(e)&&se(e.searchRequest)&&d(e.color)&&o(e.alert)&&u(e.description)&&u(e.title),e.isFtMySearchRequest=se,e.isFtMySearchUpdate=e=>n(e)&&(null==e.searchRequest||se(e.searchRequest))&&(null==e.color||d(e.color))&&(null==e.alert||o(e.alert))&&(null==e.description||u(e.description))&&(null==e.title||u(e.title)),e.isFtOpenMode=be,e.isFtPageConfiguration=Dt,e.isFtPageDisplayEvent=e=>n(e)&&_(e.origin)&&S(e.display)&&b(e.page),e.isFtPageRequest=Oe,e.isFtPaginatedToc=e=>pt(e)&&Pt(e.configuration)&&Array.isArray(e.paginatedToc)&&e.paginatedToc.every((e=>Lt(e)))&&yt(e.translationError),e.isFtPaginatedTocNode=Lt,e.isFtPaginatedTocNodeWithTranslationFailure=e=>pt(e)&&Lt(e.paginatedToc)&&yt(e.translationError),e.isFtPaginationConfiguration=Pt,e.isFtPeriod=Be,e.isFtPeriodFilter=ke,e.isFtPeriodFilterType=he,e.isFtPersonalBookCreation=e=>n(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>j(e)))&&Array.isArray(e.nodes)&&e.nodes.every((e=>K(e)))&&u(e.description)&&u(e.title),e.isFtPersonalBookMetadataUpdate=j,e.isFtPersonalBookNodeCreation=K,e.isFtPersonalBookTopicLinkCreation=V,e.isFtPrivacyPolicyConfiguration=e=>n(e)&&u(e.policyDescription)&&o(e.agreementRequired)&&u(e.userAgreementMessage),e.isFtPublicClusterSortCriterion=ve,e.isFtPublicationRating=le,e.isFtPublicationRatingSummary=ue,e.isFtRagHistory=St,e.isFtRagInput=e=>pt(e)&&At(e.profileId)&&(null==e.conversationId||At(e.conversationId))&&At(e.query)&&(null==e.messages||Array.isArray(e.messages)&&e.messages.every((e=>St(e))))&&(null==e.responseFormat||ft(e.responseFormat))&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Mt(e)))),e.isFtRagResponseFormat=ft,e.isFtRangeFilter=He,e.isFtRatingCreation=e=>n(e)&&oe(e.type)&&l(e.value),e.isFtRatingSummary=e=>n(e)&&(null==e.topics||de(e.topics))&&ue(e.publication),e.isFtRatingType=oe,e.isFtReaderConfiguration=e=>pt(e)&&Tt(e.feedback)&&ht(e.loadAfterLastVisibleTopic)&&At(e.relativeTopicPivotMetadata)&&ht(e.loadBeforeFirstVisibleTopic)&&At(e.relativePivotMetadata),e.isFtReaderFeedbackConfiguration=Tt,e.isFtSearchFacet=ze,e.isFtSearchFacetConf=Je,e.isFtSearchFacetEntry=Ze,e.isFtSearchLocale=J,e.isFtSearchLocales=e=>n(e)&&Array.isArray(e.contentLocales)&&e.contentLocales.every((e=>J(e))),e.isFtSearchPageSelectEvent=e=>n(e)&&U(e.searchResult)&&(null==e.externalLink||u(e.externalLink))&&C(e.searchQuery),e.isFtSearchPreferences=ut,e.isFtSearchPreferencesConfiguration=e=>n(e)&&n(e.metadata)&&Object.keys(e.metadata).every((e=>u(e)))&&Object.values(e.metadata).every((e=>pe(e))),e.isFtSearchPreset=e=>n(e)&&u(e.name)&&l(e.priority)&&(null==e.contentLocale||u(e.contentLocale))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>we(e))),e.isFtSearchPrior=xe,e.isFtSearchRequest=e=>n(e)&&(null==e.periodFilter||ke(e.periodFilter))&&u(e.query)&&Oe(e.paging)&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Me(e))))&&Array.isArray(e.sort)&&e.sort.every((e=>et(e)))&&(null==e.virtualField||Se(e.virtualField))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>we(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>Je(e)))&&(null==e.scope||Qe(e.scope))&&(null==e.uiLocale||u(e.uiLocale))&&(null==e.contentLocale||u(e.contentLocale))&&(null==e.priors||Array.isArray(e.priors)&&e.priors.every((e=>xe(e))))&&(null==e.clusterSortCriterions||Array.isArray(e.clusterSortCriterions)&&e.clusterSortCriterions.every((e=>ve(e)))),e.isFtSearchResultCluster=je,e.isFtSearchResultClusterEntry=Ke,e.isFtSearchResultMap=Ge,e.isFtSearchResultOpenContextMenuEvent=e=>n(e)&&U(e.searchResult)&&(null==e.externalLink||u(e.externalLink))&&C(e.searchQuery),e.isFtSearchResultTopic=$e,e.isFtSearchResultType=Ye,e.isFtSearchResultUnstructuredDocument=Ve,e.isFtSearchResults=e=>n(e)&&(null==e.spellcheck||tt(e.spellcheck))&&Fe(e.paging)&&Array.isArray(e.results)&&e.results.every((e=>je(e)))&&Array.isArray(e.facets)&&e.facets.every((e=>ze(e))),e.isFtSearchResultsPageInfo=Fe,e.isFtSearchScope=Qe,e.isFtSearchSortCriterion=et,e.isFtSearchSortCriterionOrder=Ee,e.isFtSearchSortCriterionType=me,e.isFtSemanticSearchAndFilter=e=>pt(e)&&Array.isArray(e.and)&&e.and.every((e=>Mt(e))),e.isFtSemanticSearchFilter=Mt,e.isFtSemanticSearchKeyValueFilter=e=>pt(e)&&Array.isArray(e.values)&&e.values.every((e=>At(e)))&&Array.isArray(e.hierarchicalValues)&&e.hierarchicalValues.every((e=>Array.isArray(e)&&e.every((e=>At(e)))))&&At(e.key),e.isFtSemanticSearchNotFilter=e=>pt(e)&&Mt(e.not),e.isFtSemanticSearchOrFilter=e=>pt(e)&&Array.isArray(e.or)&&e.or.every((e=>Mt(e))),e.isFtSemanticSearchRequest=e=>pt(e)&&At(e.query)&&(null==e.filters||Array.isArray(e.filters)&&e.filters.every((e=>Mt(e))))&&(null==e.nbResults||ht(e.nbResults)),e.isFtSemanticSearchResponseItem=Nt,e.isFtSession=e=>n(e)&&(null==e.authenticationIdentifier||lt(e.authenticationIdentifier))&&l(e.idleTimeoutInMillis)&&ct(e.profile)&&o(e.sessionAuthenticated)&&ut(e.searchPreferences),e.isFtSpellcheck=tt,e.isFtSuggestRequest=e=>n(e)&&u(e.input)&&(null==e.scope||Qe(e.scope))&&Array.isArray(e.sort)&&e.sort.every((e=>et(e)))&&(null==e.maxCount||l(e.maxCount))&&(null==e.contentLocale||u(e.contentLocale))&&Array.isArray(e.metadataFilters)&&e.metadataFilters.every((e=>we(e))),e.isFtSuggestResult=at,e.isFtSuggestResults=e=>n(e)&&Array.isArray(e.suggestions)&&e.suggestions.every((e=>at(e))),e.isFtTocNode=$,e.isFtTopic=e=>n(e)&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&u(e.id)&&u(e.contentApiEndpoint)&&u(e.title),e.isFtTopicContentTarget=t=>Object.keys(e.FtTopicContentTarget).includes(t),e.isFtTopicDisplayEvent=e=>n(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>D(e)))&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&l(e.viewDurationMs)&&g(e.location),e.isFtTopicOrigin=q,e.isFtTopicOriginType=y,e.isFtTopicRating=ce,e.isFtTopicResource=rt,e.isFtTopicStartDisplayEvent=e=>n(e)&&Array.isArray(e.breadcrumb)&&e.breadcrumb.every((e=>D(e)))&&(null==e.publication||O(e.publication))&&(null==e.document||F(e.document))&&g(e.location),e.isFtTopicsRatingSummary=de,e.isFtTranslationContent=e=>n(e)&&o(e.isTranslationError)&&u(e.content),e.isFtTranslationLanguagesResponse=e=>pt(e)&&Array.isArray(e.items)&&e.items.every((e=>Ut(e))),e.isFtTranslationLocale=Ut,e.isFtTranslationRequest=e=>pt(e)&&At(e.profileId)&&(null==e.format||It(e.format))&&At(e.destinationLanguage)&&Array.isArray(e.content)&&e.content.every((e=>At(e)))&&(null==e.sourceLanguage||At(e.sourceLanguage)),e.isFtTranslationResponse=e=>pt(e)&&Array.isArray(e.items)&&e.items.every((e=>At(e))),e.isFtUiLocale=Z,e.isFtUnstructuredDocument=e=>n(e)&&(null==e.prettyUrl||u(e.prettyUrl))&&Array.isArray(e.metadata)&&e.metadata.every((e=>te(e)))&&u(e.openMode)&&(null==e.description||u(e.description))&&u(e.mimeType)&&u(e.baseId)&&(null==e.clusterId||u(e.clusterId))&&u(e.contentApiEndpoint)&&u(e.title)&&u(e.lastPublication)&&u(e.viewerUrl)&&u(e.lastEdition)&&u(e.filename)&&(null==e.originId||u(e.originId))&&u(e.rightsApiEndpoint)&&(null==e.originUrl||u(e.originUrl))&&u(e.khubVersion)&&u(e.id)&&(null==e.lang||u(e.lang)),e.isFtUserAssetCount=e=>n(e)&&l(e.count)&&ot(e.userAssetType),e.isFtUserAssetType=ot,e.isFtUserProfile=ct,e.isFtUserRole=st,e.isFtValueFilter=Xe,e.isFtVirtualField=Se,e.isFtWatermark=dt,e.isTranslationFormat=It,e.setUnauthenticatedUserSearchPreferences=function(e,t){if(Ht.localStorage){let r={...t,metadata:xt(t.metadata??{})};const a=jt(e),i=JSON.stringify(r);return Ht.localStorage.setItem(a,i),Ht.dispatchEvent(new StorageEvent("storage",{key:a,newValue:i,storageArea:Ht.localStorage,url:Ht.location.href})),r}console.error("Cannot set unauthenticated preferences: local storage is unavailable.")},e.userHasAllRoles=function(e,...t){return null!=e&&t.every((t=>Bt(e,t)))},e.userHasAnyRole=function(e,...t){return null!=e&&t.some((t=>Bt(e,t)))},e.userHasRole=Bt}));
@@ -145,6 +145,9 @@ export declare class FluidTopicsApi {
145
145
  };
146
146
  assets: {
147
147
  highlightjs: string;
148
+ customCode: (subPath: string) => {
149
+ endpoint: string;
150
+ };
148
151
  };
149
152
  analytics: {
150
153
  events: string;
package/dist/mjs/index.js CHANGED
@@ -171,6 +171,9 @@ export class FluidTopicsApi {
171
171
  },
172
172
  assets: {
173
173
  highlightjs: `assets/scripts/highlightjs`,
174
+ customCode: (subPath) => ({
175
+ endpoint: `portal/custom-code/${subPath}`,
176
+ })
174
177
  },
175
178
  analytics: {
176
179
  events: "api/analytics/events",
@@ -29,11 +29,35 @@ export declare enum FtAnalyticsDocumentType {
29
29
  UNSTRUCTURED_DOCUMENT = "UNSTRUCTURED_DOCUMENT",
30
30
  SHARED_PERSONAL_BOOK = "SHARED_PERSONAL_BOOK",
31
31
  PERSONAL_BOOK = "PERSONAL_BOOK",
32
- MAP_ATTACHMENT = "MAP_ATTACHMENT",
32
+ ATTACHMENT = "ATTACHMENT",
33
33
  RESOURCE = "RESOURCE"
34
34
  }
35
35
  export type FtAnalyticsDocumentTypeKeys = keyof typeof FtAnalyticsDocumentType;
36
36
  export declare const isFtAnalyticsDocumentType: (o: any) => o is FtAnalyticsDocumentType;
37
+ export interface FtAnalyticsEventAIProfile {
38
+ chatbotDetails?: FtAnalyticsEventAIProfileChatbotDetails;
39
+ translationDetails?: FtAnalyticsEventAIProfileTranslationDetails;
40
+ completionDetails?: FtAnalyticsEventAIProfileCompletionDetails;
41
+ name: string;
42
+ id: string;
43
+ type: string;
44
+ }
45
+ export declare const isFtAnalyticsEventAIProfile: (o: any) => o is FtAnalyticsEventAIProfile;
46
+ export interface FtAnalyticsEventAIProfileChatbotDetails {
47
+ provider: string;
48
+ model?: string;
49
+ }
50
+ export declare const isFtAnalyticsEventAIProfileChatbotDetails: (o: any) => o is FtAnalyticsEventAIProfileChatbotDetails;
51
+ export interface FtAnalyticsEventAIProfileCompletionDetails {
52
+ provider: string;
53
+ model?: string;
54
+ }
55
+ export declare const isFtAnalyticsEventAIProfileCompletionDetails: (o: any) => o is FtAnalyticsEventAIProfileCompletionDetails;
56
+ export interface FtAnalyticsEventAIProfileTranslationDetails {
57
+ provider: string;
58
+ engine?: string;
59
+ }
60
+ export declare const isFtAnalyticsEventAIProfileTranslationDetails: (o: any) => o is FtAnalyticsEventAIProfileTranslationDetails;
37
61
  export interface FtAnalyticsEventDisplay {
38
62
  width: number;
39
63
  height: number;
@@ -48,30 +72,10 @@ export interface FtAnalyticsEventDocument {
48
72
  parentId?: string;
49
73
  }
50
74
  export declare const isFtAnalyticsEventDocument: (o: any) => o is FtAnalyticsEventDocument;
51
- export interface FtAnalyticsEventGenAIProfile {
52
- chatbotDetails?: FtAnalyticsEventGenAIProfileChatbotDetails;
53
- translationDetails?: FtAnalyticsEventGenAIProfileTranslationDetails;
54
- completionDetails?: FtAnalyticsEventGenAIProfileCompletionDetails;
55
- name: string;
56
- id: string;
57
- type: string;
58
- }
59
- export declare const isFtAnalyticsEventGenAIProfile: (o: any) => o is FtAnalyticsEventGenAIProfile;
60
- export interface FtAnalyticsEventGenAIProfileChatbotDetails {
61
- provider: string;
62
- model?: string;
63
- }
64
- export declare const isFtAnalyticsEventGenAIProfileChatbotDetails: (o: any) => o is FtAnalyticsEventGenAIProfileChatbotDetails;
65
- export interface FtAnalyticsEventGenAIProfileCompletionDetails {
66
- provider: string;
67
- model?: string;
68
- }
69
- export declare const isFtAnalyticsEventGenAIProfileCompletionDetails: (o: any) => o is FtAnalyticsEventGenAIProfileCompletionDetails;
70
- export interface FtAnalyticsEventGenAIProfileTranslationDetails {
71
- provider: string;
72
- engine?: string;
75
+ export interface FtAnalyticsEventDocumentSearchQuery {
76
+ terms: string;
73
77
  }
74
- export declare const isFtAnalyticsEventGenAIProfileTranslationDetails: (o: any) => o is FtAnalyticsEventGenAIProfileTranslationDetails;
78
+ export declare const isFtAnalyticsEventDocumentSearchQuery: (o: any) => o is FtAnalyticsEventDocumentSearchQuery;
75
79
  export interface FtAnalyticsEventLocation {
76
80
  type: string;
77
81
  value: string;
@@ -113,7 +117,7 @@ export interface FtAnalyticsEventSearchQuery {
113
117
  }
114
118
  export declare const isFtAnalyticsEventSearchQuery: (o: any) => o is FtAnalyticsEventSearchQuery;
115
119
  export interface FtAnalyticsEventSearchResponse {
116
- autocorrect?: boolean;
120
+ autocorrect: boolean;
117
121
  nbResults: number;
118
122
  }
119
123
  export declare const isFtAnalyticsEventSearchResponse: (o: any) => o is FtAnalyticsEventSearchResponse;
@@ -137,7 +141,7 @@ export declare enum FtAnalyticsPublicationType {
137
141
  UNSTRUCTURED_DOCUMENT = "UNSTRUCTURED_DOCUMENT",
138
142
  SHARED_PERSONAL_BOOK = "SHARED_PERSONAL_BOOK",
139
143
  PERSONAL_BOOK = "PERSONAL_BOOK",
140
- MAP_ATTACHMENT = "MAP_ATTACHMENT",
144
+ ATTACHMENT = "ATTACHMENT",
141
145
  RESOURCE = "RESOURCE"
142
146
  }
143
147
  export type FtAnalyticsPublicationTypeKeys = keyof typeof FtAnalyticsPublicationType;
@@ -166,9 +170,30 @@ export declare enum FtAnalyticsSearchFacetType {
166
170
  }
167
171
  export type FtAnalyticsSearchFacetTypeKeys = keyof typeof FtAnalyticsSearchFacetType;
168
172
  export declare const isFtAnalyticsSearchFacetType: (o: any) => o is FtAnalyticsSearchFacetType;
173
+ export interface FtAiCaseDeflectionEvent extends FtAnalyticsEvent {
174
+ generationId?: string;
175
+ searchQuery?: FtAnalyticsEventSearchQuery;
176
+ context: string;
177
+ }
178
+ export declare const isFtAiCaseDeflectionEvent: (o: any) => o is FtAiCaseDeflectionEvent;
179
+ export interface FtAiCompletedQueryEvent extends FtAnalyticsEvent {
180
+ result: string;
181
+ profile: FtAnalyticsEventAIProfile;
182
+ durationMs: number;
183
+ parameters?: Record<string, string>;
184
+ queryId: string;
185
+ }
186
+ export declare const isFtAiCompletedQueryEvent: (o: any) => o is FtAiCompletedQueryEvent;
187
+ export interface FtAiRateEvent extends FtAnalyticsEvent {
188
+ rating: FtAnalyticsEventRating;
189
+ comment: string;
190
+ queryId: string;
191
+ }
192
+ export declare const isFtAiRateEvent: (o: any) => o is FtAiRateEvent;
169
193
  export interface FtAnalyticsEvent {
170
194
  offline: boolean;
171
195
  appVersion: string;
196
+ internal?: boolean;
172
197
  appName: string;
173
198
  name: FtAnalyticsEventNameKeys;
174
199
  }
@@ -182,6 +207,7 @@ export declare enum FtAnalyticsEventName {
182
207
  COLLECTION__CREATE = "COLLECTION__CREATE",
183
208
  COLLECTION__UPDATE = "COLLECTION__UPDATE",
184
209
  COLLECTION__DELETE = "COLLECTION__DELETE",
210
+ CUSTOM_EVENT__TRIGGER = "CUSTOM_EVENT__TRIGGER",
185
211
  DOCUMENT__DISPLAY = "DOCUMENT__DISPLAY",
186
212
  DOCUMENT__DOWNLOAD = "DOCUMENT__DOWNLOAD",
187
213
  DOCUMENT__PRINT = "DOCUMENT__PRINT",
@@ -191,10 +217,10 @@ export declare enum FtAnalyticsEventName {
191
217
  DOCUMENT__START_DISPLAY = "DOCUMENT__START_DISPLAY",
192
218
  DOCUMENT__UNRATE = "DOCUMENT__UNRATE",
193
219
  FEEDBACK__SEND = "FEEDBACK__SEND",
194
- GEN_AI__COMPLETED_QUERY = "GEN_AI__COMPLETED_QUERY",
195
- GEN_AI__RATE = "GEN_AI__RATE",
196
- GENAI_CASE_DEFLECTION__START = "GENAI_CASE_DEFLECTION__START",
197
- GENAI_CASE_DEFLECTION__OPEN_TICKET = "GENAI_CASE_DEFLECTION__OPEN_TICKET",
220
+ AI__COMPLETED_QUERY = "AI__COMPLETED_QUERY",
221
+ AI__RATE = "AI__RATE",
222
+ AI_CASE_DEFLECTION__START = "AI_CASE_DEFLECTION__START",
223
+ AI_CASE_DEFLECTION__OPEN_TICKET = "AI_CASE_DEFLECTION__OPEN_TICKET",
198
224
  KHUB__PROCESS = "KHUB__PROCESS",
199
225
  KHUB__SEARCH = "KHUB__SEARCH",
200
226
  LABELS__DOWNLOAD = "LABELS__DOWNLOAD",
@@ -228,6 +254,12 @@ export interface FtCaseDeflectionEvent extends FtAnalyticsEvent {
228
254
  topic?: FtAnalyticsEventTopic;
229
255
  }
230
256
  export declare const isFtCaseDeflectionEvent: (o: any) => o is FtCaseDeflectionEvent;
257
+ export interface FtCustomTriggerEvent extends FtAnalyticsEvent {
258
+ componentId?: string;
259
+ eventName: string;
260
+ page: FtAnalyticsEventPage;
261
+ }
262
+ export declare const isFtCustomTriggerEvent: (o: any) => o is FtCustomTriggerEvent;
231
263
  export interface FtDocumentDisplayEvent extends FtAnalyticsEvent {
232
264
  /** @deprecated */ publication?: FtAnalyticsEventPublication;
233
265
  document?: FtAnalyticsEventDocument;
@@ -249,7 +281,7 @@ export interface FtDocumentSearchEvent extends FtAnalyticsEvent {
249
281
  searchResponse: FtAnalyticsEventSearchResponse;
250
282
  /** @deprecated */ publication?: FtAnalyticsEventPublication;
251
283
  document?: FtAnalyticsEventDocument;
252
- searchQuery: FtAnalyticsEventSearchQuery;
284
+ searchQuery: FtAnalyticsEventDocumentSearchQuery;
253
285
  }
254
286
  export declare const isFtDocumentSearchEvent: (o: any) => o is FtDocumentSearchEvent;
255
287
  export interface FtDocumentStartDisplayEvent extends FtAnalyticsEvent {
@@ -265,18 +297,6 @@ export interface FtFeedbackSendEvent extends FtAnalyticsEvent {
265
297
  loggedIn: boolean;
266
298
  }
267
299
  export declare const isFtFeedbackSendEvent: (o: any) => o is FtFeedbackSendEvent;
268
- export interface FtGenAiCaseDeflectionEvent extends FtAnalyticsEvent {
269
- generationId?: string;
270
- searchQuery?: FtAnalyticsEventSearchQuery;
271
- context: string;
272
- }
273
- export declare const isFtGenAiCaseDeflectionEvent: (o: any) => o is FtGenAiCaseDeflectionEvent;
274
- export interface FtGenAiRateEvent extends FtAnalyticsEvent {
275
- rating: FtAnalyticsEventRating;
276
- comment: string;
277
- queryId: string;
278
- }
279
- export declare const isFtGenAiRateEvent: (o: any) => o is FtGenAiRateEvent;
280
300
  export interface FtKhubSearchEvent extends FtAnalyticsEvent {
281
301
  searchResponse: FtAnalyticsEventSearchResponse;
282
302
  searchQuery: FtAnalyticsEventSearchQuery;
@@ -384,28 +404,29 @@ export declare const isFtCollectionDocument: (o: any) => o is FtCollectionDocume
384
404
  export interface FtMap {
385
405
  prettyUrl?: string;
386
406
  metadata: Array<FtMetadata>;
387
- watermark?: FtWatermark;
388
- openMode: FtOpenModeKeys;
389
407
  topicsApiEndpoint?: string;
390
408
  description?: string;
391
- attachmentsApiEndpoint?: string;
392
409
  editorialType: FtEditorialTypeKeys;
393
410
  baseId: string;
394
411
  clusterId: string;
395
412
  title: string;
396
- lastPublication: string;
397
- pbkConfidential: boolean;
398
413
  lastEdition: string;
399
414
  originId: string;
400
415
  rightsApiEndpoint?: string;
401
- contentStyles: FtMapStyles;
402
- originUrl?: string;
403
416
  fingerprint: string;
404
417
  readerUrl: string;
405
418
  untranslatedTitle?: string;
406
419
  khubVersion?: string;
407
420
  id: string;
408
421
  lang?: string;
422
+ watermark?: FtWatermark;
423
+ openMode: FtOpenModeKeys;
424
+ attachmentsApiEndpoint?: string;
425
+ lastPublication: string;
426
+ pbkConfidential: boolean;
427
+ contentStyles: FtMapStyles;
428
+ originUrl?: string;
429
+ translationError: boolean;
409
430
  }
410
431
  export declare const isFtMap: (o: any) => o is FtMap;
411
432
  export interface FtMapStyles {
@@ -447,18 +468,18 @@ export interface FtUnstructuredDocument {
447
468
  openMode: string;
448
469
  description?: string;
449
470
  mimeType: string;
450
- baseId?: string;
471
+ baseId: string;
451
472
  clusterId?: string;
452
473
  contentApiEndpoint: string;
453
474
  title: string;
454
- lastPublication?: string;
475
+ lastPublication: string;
455
476
  viewerUrl: string;
456
477
  lastEdition: string;
457
478
  filename: string;
458
479
  originId?: string;
459
480
  rightsApiEndpoint: string;
460
481
  originUrl?: string;
461
- khubVersion?: string;
482
+ khubVersion: string;
462
483
  id: string;
463
484
  lang?: string;
464
485
  }
@@ -847,12 +868,12 @@ export interface FtSearchResultClusterEntry {
847
868
  export declare const isFtSearchResultClusterEntry: (o: any) => o is FtSearchResultClusterEntry;
848
869
  export interface FtSearchResultUnstructuredDocument {
849
870
  metadata: Array<FtMetadata>;
850
- openMode: FtOpenModeKeys;
871
+ openMode?: FtOpenModeKeys;
851
872
  documentUrl: string;
852
873
  mimeType: string;
853
874
  source: any;
854
875
  title: string;
855
- lastPublicationDate?: string;
876
+ lastPublicationDate: string;
856
877
  viewerUrl: string;
857
878
  contentUrl: string;
858
879
  filename: string;
@@ -869,7 +890,7 @@ export interface FtSearchResultMap {
869
890
  editorialType: FtEditorialTypeKeys;
870
891
  source?: any;
871
892
  title: string;
872
- lastPublicationDate?: string;
893
+ lastPublicationDate: string;
873
894
  htmlTitle: string;
874
895
  originUrl?: string;
875
896
  mapUrl: string;
@@ -881,7 +902,7 @@ export interface FtSearchResultMap {
881
902
  export declare const isFtSearchResultMap: (o: any) => o is FtSearchResultMap;
882
903
  export interface FtSearchResultTopic {
883
904
  metadata: Array<FtMetadata>;
884
- openMode: FtOpenModeKeys;
905
+ openMode?: FtOpenModeKeys;
885
906
  contentId: string;
886
907
  resources: Array<FtTopicResource>;
887
908
  source?: any;
@@ -1007,6 +1028,14 @@ export declare enum FtUserRole {
1007
1028
  }
1008
1029
  export type FtUserRoleKeys = keyof typeof FtUserRole;
1009
1030
  export declare const isFtUserRole: (o: any) => o is FtUserRole;
1031
+ export declare enum FtUserAssetType {
1032
+ SEARCHES = "SEARCHES",
1033
+ BOOKMARKS = "BOOKMARKS",
1034
+ BOOKS = "BOOKS",
1035
+ COLLECTIONS = "COLLECTIONS"
1036
+ }
1037
+ export type FtUserAssetTypeKeys = keyof typeof FtUserAssetType;
1038
+ export declare const isFtUserAssetType: (o: any) => o is FtUserAssetType;
1010
1039
  export interface FtAuthenticationIdentifier {
1011
1040
  identifier: string;
1012
1041
  realm: string;
@@ -1040,6 +1069,11 @@ export interface FtUserProfile {
1040
1069
  tags: Array<string>;
1041
1070
  }
1042
1071
  export declare const isFtUserProfile: (o: any) => o is FtUserProfile;
1072
+ export interface FtUserAssetCount {
1073
+ count: number;
1074
+ userAssetType: FtUserAssetTypeKeys;
1075
+ }
1076
+ export declare const isFtUserAssetCount: (o: any) => o is FtUserAssetCount;
1043
1077
  export interface FtWatermark {
1044
1078
  color: string;
1045
1079
  text: Array<string>;