@fluid-topics/ft-search-saved-searches 1.0.57 → 1.0.59
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.
|
@@ -334,7 +334,7 @@ const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void
|
|
|
334
334
|
`,Bi=e.css`
|
|
335
335
|
`,Ti=i.FtReduxStore.get({name:"ft-app-info",reducers:{setBaseUrl:(t,i)=>{t.baseUrl=i.payload},setApiIntegrationIdentifier:(t,i)=>{t.apiIntegrationIdentifier=i.payload},setUiLocale:(t,i)=>{t.uiLocale=i.payload},setAvailableUiLocales:(t,i)=>{t.availableUiLocales=i.payload},setEditorMode:(t,i)=>{t.editorMode=i.payload},setNoCustom:(t,i)=>{t.noCustom=i.payload},setNoCustomComponent:(t,i)=>{t.noCustomComponent=i.payload},setSession:(t,i)=>{t.session=i.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class Ii{static build(t){const{baseUrl:i,apiIntegrationIdentifier:e}=Ti.getState(),o=null!=t?t:e;if(i&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(i,o,!0)}static get(t){var i;return null!=t?Ii.build(t):null!==(i=Ii.API)&&void 0!==i?i:Ii.API=Ii.build()}static await(t){return new Promise((i=>{let e=Ii.get(t);if(e)i(e);else{const o=Ti.subscribe((()=>{e=Ii.get(t),e&&(o(),i(e))}))}}))}}var Ri;const Ui=Symbol("clearAfterUnitTest");class zi{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={},this.currentUiLocale="",this[Ri]=()=>{this.defaultMessages={},this.cache=new i.CacheRegistry,this.listeners={}},this.currentUiLocale=Ti.getState().uiLocale,Ti.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ti.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const i=t.name.toLowerCase();this.cache.setFinal(i,t),this.notify(i)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var o;if(t=t.toLowerCase(),Object.keys(e).length>0){const n={...null!==(o=this.defaultMessages[t])&&void 0!==o?o:{},...e};i.deepEqual(this.defaultMessages[t],n)||(this.defaultMessages[t]=n,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...o){var n,s,r;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(s=null===(n=this.cache.getNow(t))||void 0===n?void 0:n.messages)&&void 0!==s?s:{};return new i.ParametrizedLabelResolver(null!==(r=this.defaultMessages[t])&&void 0!==r?r:{},a).resolve(e,...o)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,i){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(i),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(i)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>i.delay(0).then((()=>t())).catch((()=>null)))))}}Ri=Ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new zi((async(t,i)=>(await Ii.await()).getFluidTopicsMessageContext(t,i)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new zi((async(t,i)=>(await Ii.await()).getCustomMessageContext(t,i))));const Ni=window.FluidTopicsI18nService,ji=window.FluidTopicsCustomI18nService;var Li=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class _i extends i.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Ii.get(),this.cache=new i.CacheRegistry,this.cleanSessionDebouncer=new i.Debouncer}render(){return e.html`
|
|
336
336
|
<slot></slot>
|
|
337
|
-
`}update(t){super.update(t),t.has("baseUrl")&&Ti.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Ti.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ti.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Ti.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Ti.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Ti.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Ti.actions.setSession(this.session),t.has("availableUiLocales")&&Ti.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ni.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}_i.elementDefinitions={},_i.styles=Bi,Li([o.property()],_i.prototype,"baseUrl",void 0),Li([o.property()],_i.prototype,"apiIntegrationIdentifier",void 0),Li([o.property()],_i.prototype,"uiLocale",void 0),Li([i.jsonProperty([])],_i.prototype,"availableUiLocales",void 0),Li([o.property({type:Boolean})],_i.prototype,"editorMode",void 0),Li([o.property({type:Boolean})],_i.prototype,"noCustom",void 0),Li([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],_i.prototype,"noCustomComponent",void 0),Li([o.property({type:Boolean})],_i.prototype,"withManualResources",void 0),Li([i.jsonProperty([])],_i.prototype,"messageContexts",void 0),Li([i.jsonProperty(void 0)],_i.prototype,"session",void 0),Li([o.property({type:Object})],_i.prototype,"apiProvider",void 0);class Mi{async listMySearches(){var t;return(null===(t=Ti.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ii.await()).listMySearches(Ti.getState().session.profile.userId):[]}}const Pi=new i.CacheRegistry;class Di{async listMyBookmarks(){return Pi.get("bookmarks",(async()=>(await Ii.await()).listMyBookmarks(Ti.getState().session.profile.userId)))}clearCache(){Pi.clear("bookmarks")}}const Fi=i.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Hi=new class{constructor(){this.currentSession=Ti.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Di,Ti.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ti.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Fi.actions.savedSearches(void 0)}clearMyBookmarks(){Fi.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Mi,i=await t.listMySearches();Fi.actions.savedSearches(i)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Fi.actions.bookmarks(i)}}};i.customElement("ft-app-context")(_i);class Zi extends Event{constructor(){super(Zi.eventName)}}Zi.eventName="search-context-clear-all-filters";var Ki=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Wi extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Gi=Symbol("registerInterval");class qi extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Gi]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Gi]):this.dispatchEvent(new Wi)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Gi,Ki([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}var Yi,Vi;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Yi||(Yi={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Vi||(Vi={})),new Map([...["abw"].map((t=>[t,Vi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Vi.AUDIO])),...["avi"].map((t=>[t,Vi.AVI])),...["chm","xhs"].map((t=>[t,Vi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Vi.CODE])),...["csv"].map((t=>[t,Vi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Vi.DITA])),...["epub"].map((t=>[t,Vi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Vi.EXCEL])),...["flac"].map((t=>[t,Vi.FLAC])),...["gif"].map((t=>[t,Vi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Vi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Vi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Vi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Vi.JPEG])),...["json"].map((t=>[t,Vi.JSON])),...["m4a","m4p"].map((t=>[t,Vi.M4A])),...["mov","qt"].map((t=>[t,Vi.MOV])),...["mp3"].map((t=>[t,Vi.MP3])),...["mp4","m4v"].map((t=>[t,Vi.MP4])),...["ogg","oga"].map((t=>[t,Vi.OGG])),...["pdf","ps"].map((t=>[t,Vi.PDF])),...["png"].map((t=>[t,Vi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Vi.POWERPOINT])),...["rar"].map((t=>[t,Vi.RAR])),...["stp"].map((t=>[t,Vi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Vi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Vi.VIDEO])),...["wav"].map((t=>[t,Vi.WAV])),...["wma"].map((t=>[t,Vi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Vi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Vi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Vi.YAML])),...["zip"].map((t=>[t,Vi.ZIP]))]);const Xi={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Ji=e.css`
|
|
337
|
+
`}update(t){super.update(t),t.has("baseUrl")&&Ti.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&Ti.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ti.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&Ti.actions.setNoCustom(this.noCustom),t.has("editorMode")&&Ti.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&Ti.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&Ti.actions.setSession(this.session),t.has("availableUiLocales")&&Ti.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Ni.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const i=await t.getCurrentSession();return i.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),i.idleTimeoutInMillis),i}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}_i.elementDefinitions={},_i.styles=Bi,Li([o.property()],_i.prototype,"baseUrl",void 0),Li([o.property()],_i.prototype,"apiIntegrationIdentifier",void 0),Li([o.property()],_i.prototype,"uiLocale",void 0),Li([i.jsonProperty([])],_i.prototype,"availableUiLocales",void 0),Li([o.property({type:Boolean})],_i.prototype,"editorMode",void 0),Li([o.property({type:Boolean})],_i.prototype,"noCustom",void 0),Li([o.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],_i.prototype,"noCustomComponent",void 0),Li([o.property({type:Boolean})],_i.prototype,"withManualResources",void 0),Li([i.jsonProperty([])],_i.prototype,"messageContexts",void 0),Li([i.jsonProperty(void 0)],_i.prototype,"session",void 0),Li([o.property({type:Object})],_i.prototype,"apiProvider",void 0);class Mi{async listMySearches(){var t;return(null===(t=Ti.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await Ii.await()).listMySearches(Ti.getState().session.profile.userId):[]}}const Pi=new i.CacheRegistry;class Di{async listMyBookmarks(){return Pi.get("bookmarks",(async()=>(await Ii.await()).listMyBookmarks(Ti.getState().session.profile.userId)))}clearCache(){Pi.clear("bookmarks")}}const Fi=i.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Hi=new class{constructor(){this.currentSession=Ti.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Di,Ti.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=Ti.getState();i.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){Fi.actions.savedSearches(void 0)}clearMyBookmarks(){Fi.actions.bookmarks(void 0)}async reloadMySearches(){const t=new Mi,i=await t.listMySearches();Fi.actions.savedSearches(i)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const i=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;Fi.actions.bookmarks(i)}}};i.customElement("ft-app-context")(_i);class Zi extends Event{constructor(){super(Zi.eventName)}}Zi.eventName="search-context-clear-all-filters";var Ki=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Wi extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Gi=Symbol("registerInterval");class qi extends(function(t){var i;class e extends t{constructor(){super(...arguments),this[i]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Gi]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Gi]):this.dispatchEvent(new Wi)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return i=Gi,Ki([o.state()],e.prototype,"stateManager",void 0),e}(i.FtLitElementRedux)){}var Yi,Vi;!function(t){t.THUMBS_DOWN="",t.THUMBS_DOWN_PLAIN="",t.THUMBS_UP="",t.THUMBS_UP_PLAIN="",t.STAR="",t.STAR_PLAIN="",t.DESKTOP="",t.LIFE_RING="",t.GLOBE="",t.PIGGY_BANK="",t.TABLET_LANDSCAPE="",t.TABLET_PORTRAIT="",t.MOBILE_LANDSCAPE="",t.MOBILE_PORTRAIT="",t.ARROW_RIGHT_TO_LINE="",t.THIN_ARROW_UP="",t.CONTEXTUAL="",t.CHART_SIMPLE="",t.BARS_PROGRESS="",t.LINE_CHART="",t.STACKED_CHART="",t.BOOK_OPEN_GEAR="",t.BOOK_OPEN_GEAR_SLASH="",t.DIAGRAM_SUNBURST="",t.DIAGRAM_SANKEY="",t.UNSTRUCTURED_DOC="",t.RESET="",t.THIN_ARROW_LEFT="",t.THIN_ARROW_RIGHT="",t.MY_COLLECTIONS="",t.OFFLINE_SETTINGS="",t.MY_LIBRARY="",t.RATE_PLAIN="",t.RATE="",t.FEEDBACK_PLAIN="",t.PAUSE="",t.PLAY="",t.RELATIVES_PLAIN="",t.RELATIVES="",t.SHORTCUT_MENU="",t.PRINT="",t.DEFAULT_ROLES="",t.ACCOUNT_SETTINGS="",t.ONLINE="",t.OFFLINE="",t.UPLOAD="",t.BOOK_PLAIN="",t.SYNC="",t.SHARED_PBK="",t.COLLECTIONS="",t.SEARCH_IN_PUBLICATION="",t.BOOKS="",t.LOCKER="",t.ARROW_DOWN="",t.ARROW_LEFT="",t.ARROW_RIGHT="",t.ARROW_UP="",t.SAVE="",t.MAILS_AND_NOTIFICATIONS="",t.DOT="",t.MINUS="",t.PLUS="",t.FILTERS="",t.STRIPE_ARROW_RIGHT="",t.STRIPE_ARROW_LEFT="",t.ATTACHMENTS="",t.ADD_BOOKMARK="",t.BOOKMARK="",t.EXPORT="",t.MENU="",t.TAG="",t.TAG_PLAIN="",t.COPY_TO_CLIPBOARD="",t.COLUMNS="",t.ARTICLE="",t.CLOSE_PLAIN="",t.CHECK_PLAIN="",t.LOGOUT="",t.SIGN_IN="",t.THIN_ARROW="",t.TRIANGLE_BOTTOM="",t.TRIANGLE_LEFT="",t.TRIANGLE_RIGHT="",t.TRIANGLE_TOP="",t.FACET_HAS_DESCENDANT="",t.MINUS_PLAIN="",t.PLUS_PLAIN="",t.INFO="",t.ICON_EXPAND="",t.ICON_COLLAPSE="",t.ADD_TO_PBK="",t.ALERT="",t.ADD_ALERT="",t.BACK_TO_SEARCH="",t.DOWNLOAD="",t.EDIT="",t.FEEDBACK="",t.MODIFY_PBK="",t.SCHEDULED="",t.SEARCH="",t.SHARE="󨃱",t.TOC="",t.WRITE_UGC="",t.TRASH="",t.EXTLINK="",t.EXTLINK_LIGHT="",t.CALENDAR="",t.BOOK="",t.DOWNLOAD_PLAIN="",t.CHECK="",t.TOPICS="",t.EYE="",t.EYE_SLASH="",t.DISC="",t.CIRCLE="",t.SHARED="",t.SORT_UNSORTED="",t.SORT_UP="",t.SORT_DOWN="",t.WORKING="",t.CLOSE="",t.ZOOM_OUT="",t.ZOOM_IN="",t.ZOOM_REALSIZE="",t.ZOOM_FULLSCREEN="",t.ADMIN_RESTRICTED="",t.ADMIN_THEME="",t.WARNING="",t.CONTEXT="",t.SEARCH_HOME="",t.STEPS="",t.HOME="",t.TRANSLATE="",t.USER="",t.ADMIN="",t.ANALYTICS="",t.ADMIN_KHUB="",t.ADMIN_USERS="",t.ADMIN_INTEGRATION="",t.ADMIN_PORTAL="",t.COMMENT_QUESTION="",t.COMMENT_QUESTION_PLAIN="",t.MESSAGE_BOT="",t.PIP="",t.PIP_WIDE="",t.EXPAND_WIDE="",t.X_MARK=""}(Yi||(Yi={})),function(t){t.UNKNOWN="",t.ABW="",t.AUDIO="",t.AVI="",t.CHM="",t.CODE="",t.CSV="",t.DITA="",t.EPUB="",t.EXCEL="",t.FLAC="",t.GIF="",t.GZIP="",t.HTML="",t.IMAGE="",t.JPEG="",t.JSON="",t.M4A="",t.MOV="",t.MP3="",t.MP4="",t.OGG="",t.PDF="",t.PNG="",t.POWERPOINT="",t.RAR="",t.STP="",t.TEXT="",t.VIDEO="",t.WAV="",t.WMA="",t.WORD="",t.XML="",t.YAML="",t.ZIP=""}(Vi||(Vi={})),new Map([...["abw"].map((t=>[t,Vi.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Vi.AUDIO])),...["avi"].map((t=>[t,Vi.AVI])),...["chm","xhs"].map((t=>[t,Vi.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Vi.CODE])),...["csv"].map((t=>[t,Vi.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Vi.DITA])),...["epub"].map((t=>[t,Vi.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Vi.EXCEL])),...["flac"].map((t=>[t,Vi.FLAC])),...["gif"].map((t=>[t,Vi.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Vi.GZIP])),...["html","htm","xhtml"].map((t=>[t,Vi.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf"].map((t=>[t,Vi.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Vi.JPEG])),...["json"].map((t=>[t,Vi.JSON])),...["m4a","m4p"].map((t=>[t,Vi.M4A])),...["mov","qt"].map((t=>[t,Vi.MOV])),...["mp3"].map((t=>[t,Vi.MP3])),...["mp4","m4v"].map((t=>[t,Vi.MP4])),...["ogg","oga"].map((t=>[t,Vi.OGG])),...["pdf","ps"].map((t=>[t,Vi.PDF])),...["png"].map((t=>[t,Vi.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Vi.POWERPOINT])),...["rar"].map((t=>[t,Vi.RAR])),...["stp"].map((t=>[t,Vi.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Vi.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Vi.VIDEO])),...["wav"].map((t=>[t,Vi.WAV])),...["wma"].map((t=>[t,Vi.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Vi.WORD])),...["xml","xsl","rdf"].map((t=>[t,Vi.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Vi.YAML])),...["zip"].map((t=>[t,Vi.ZIP]))]);const Xi={size:i.FtCssVariableFactory.create("--ft-icon-font-size","SIZE","24px"),fluidTopicsFontFamily:i.FtCssVariableFactory.extend("--ft-icon-fluid-topics-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-icons")),fileFormatFontFamily:i.FtCssVariableFactory.extend("--ft-icon-file-format-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","ft-mime")),materialFontFamily:i.FtCssVariableFactory.extend("--ft-icon-material-font-family",i.FtCssVariableFactory.create("--ft-icon-font-family","UNKNOWN","Material Icons")),verticalAlign:i.FtCssVariableFactory.create("--ft-icon-vertical-align","UNKNOWN","unset")},Ji=e.css`
|
|
338
338
|
:host, i.ft-icon {
|
|
339
339
|
display: inline-flex;
|
|
340
340
|
align-items: center;
|
|
@@ -434,7 +434,7 @@ const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void
|
|
|
434
434
|
</div>
|
|
435
435
|
</div>
|
|
436
436
|
</div>
|
|
437
|
-
`}
|
|
437
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((i=>t.has(i)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent();const t=this.slottedElement;if(this.tooltip&&t){const i=this.tooltip.offsetWidth,e=this.tooltip.offsetHeight,o=(t.offsetHeight-e)/2,n=(t.offsetWidth-i)/2;let s=0,r=0;switch(this.tooltip.style.top="0",this.tooltip.style.left="0",this.validPosition){case"top":r=t.offsetTop-e-this.tooltip.offsetTop,s=t.offsetLeft+n-this.tooltip.offsetLeft;break;case"bottom":r=t.offsetTop+t.offsetHeight-this.tooltip.offsetTop,s=t.offsetLeft+n-this.tooltip.offsetLeft;break;case"left":r=t.offsetTop+o-this.tooltip.offsetTop,s=t.offsetLeft-i-this.tooltip.offsetLeft;break;case"right":r=t.offsetTop+o-this.tooltip.offsetTop,s=t.offsetLeft+t.offsetWidth-this.tooltip.offsetLeft}const a=this.tooltip.style;a.left=s+"px",a.top=r+"px";const l=this.tooltip.getBoundingClientRect();let h=-l.x,c=l.x+l.width-window.innerWidth;a.left=s+Math.round(this.correctOutOfWindowPixels(h,c))+"px";let p=-l.y,d=l.y+l.height-window.innerHeight;a.top=r+Math.round(this.correctOutOfWindowPixels(p,d))+"px",a.maxWidth=`max(${t.offsetWidth}px, ${ae})`}this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,i){return Math.max(t,Math.min(0,-i))}}ce.elementDefinitions={"ft-typography":bi},ce.styles=le,he([o.property()],ce.prototype,"text",void 0),he([o.property({type:Boolean})],ce.prototype,"manual",void 0),he([o.property({type:Boolean})],ce.prototype,"inline",void 0),he([o.property({type:Number})],ce.prototype,"delay",void 0),he([o.property()],ce.prototype,"position",void 0),he([o.queryAssignedNodes("",!0)],ce.prototype,"slotNodes",void 0),he([o.query(".ft-tooltip--container")],ce.prototype,"container",void 0),he([o.query(".ft-tooltip")],ce.prototype,"tooltip",void 0),he([o.query(".ft-tooltip--content")],ce.prototype,"tooltipContent",void 0),he([o.state()],ce.prototype,"visible",void 0),i.customElement("ft-tooltip")(ce);const pe={color:i.FtCssVariableFactory.extend("--ft-loader-color",i.designSystemVariables.colorPrimary),size:i.FtCssVariableFactory.create("--ft-loader-size","SIZE","80px")},de=e.css`
|
|
438
438
|
:host {
|
|
439
439
|
line-height: 0;
|
|
440
440
|
}
|
|
@@ -647,7 +647,7 @@ const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void
|
|
|
647
647
|
${i.setVariable(pe.size,ve.iconSize)};
|
|
648
648
|
${i.setVariable(pe.color,"var(--ft-button-internal-color)")};
|
|
649
649
|
}
|
|
650
|
-
`,i.noTextSelect];var Se=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class ke extends
|
|
650
|
+
`,i.noTextSelect];var Se=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class ke extends(i.toFtFormComponent(i.FtLitElement,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var i;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(i=this.form)||void 0===i||i.requestSubmit())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
|
|
651
651
|
<button part="button"
|
|
652
652
|
class="${n.classMap(t)}"
|
|
653
653
|
aria-label="${this.getLabel()}"
|
|
@@ -663,14 +663,14 @@ const it=Symbol.for(""),et=t=>{if((null==t?void 0:t.r)===it)return null==t?void
|
|
|
663
663
|
${this.resolveIcon()}
|
|
664
664
|
</button>
|
|
665
665
|
`)}addTooltipIfNeeded(t){return this.getLabel().trim().length>0&&(this.forceTooltip||!this.hasTextContent()&&!this.hideTooltip)?e.html`
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
666
|
+
<ft-tooltip part="tooltip"
|
|
667
|
+
text="${this.getLabel()}"
|
|
668
|
+
position="${this.tooltipPosition}">
|
|
669
|
+
${t}
|
|
670
|
+
</ft-tooltip>
|
|
671
671
|
`:t}resolveIcon(){return this.loading?e.html`
|
|
672
672
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?e.html`
|
|
673
|
-
|
|
673
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}ke.elementDefinitions={"ft-ripple":b,"ft-tooltip":ce,"ft-typography":bi,"ft-icon":ie,"ft-loader":fe},ke.styles=[i.safariEllipsisFix,we],Se([o.property({type:String,reflect:!0})],ke.prototype,"role",void 0),Se([o.property()],ke.prototype,"type",void 0),Se([o.property({type:Boolean})],ke.prototype,"primary",void 0),Se([o.property({type:Boolean})],ke.prototype,"outlined",void 0),Se([o.property({type:Boolean})],ke.prototype,"disabled",void 0),Se([o.property({type:Boolean})],ke.prototype,"dense",void 0),Se([o.property({type:Boolean})],ke.prototype,"round",void 0),Se([o.property()],ke.prototype,"label",void 0),Se([o.property()],ke.prototype,"icon",void 0),Se([o.property()],ke.prototype,"iconVariant",void 0),Se([o.property({type:Boolean})],ke.prototype,"trailingIcon",void 0),Se([o.property({type:Boolean})],ke.prototype,"loading",void 0),Se([o.property()],ke.prototype,"tooltipPosition",void 0),Se([o.property({type:Boolean})],ke.prototype,"hideTooltip",void 0),Se([o.property({type:Boolean})],ke.prototype,"forceTooltip",void 0),Se([o.query(".ft-button")],ke.prototype,"button",void 0),Se([o.query(".ft-button--label slot")],ke.prototype,"slottedContent",void 0),i.customElement("ft-button")(ke);const Ee=e.css`
|
|
674
674
|
`;var Oe=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};const Ae=Symbol("i18nProperties"),Ce=Symbol("i18nUnsubs");function Be(t){var i;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[i]=new Map}get i18nService(){return this.useCustomMessageContexts?ji:Ni}i18n(t,i,...e){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,i,...e);const n=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...n)}onI18nUpdate(t){var i;null===(i=this[Ae])||void 0===i||i.forEach(((i,e)=>{i.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(i))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var i;super.update(t),null===(i=this[Ae])||void 0===i||i.forEach(((t,i)=>{null!=t.argsProvider&&(this[i]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[Ae]&&new Set([...this[Ae].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,i){t=t.toLowerCase(),this[Ce].has(t)||this[Ce].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=i?i:{})}addI18nContext(t,i){this.addI18nMessages(t.name,i)}disconnectedCallback(){super.disconnectedCallback(),this[Ce].forEach((t=>t())),this[Ce].clear()}}return i=Ce,Oe([o.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class Te extends(Be(i.FtLitElement)){}class Ie extends(Be(i.FtLitElementRedux)){}var Re=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Ue extends Ie{constructor(){super(),this.editorMode=!1,this.addStore(Ti)}render(){return this.key&&this.context?e.html`
|
|
675
675
|
<span class="ft-i18n">
|
|
676
676
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|