@fluid-topics/ft-reader-feedback 1.1.0 → 1.1.1
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,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,i,o,r,n,a){var s;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(s||(s={}));var l=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class c extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const d=Symbol("registerInterval");class h extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[d]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[d]):this.dispatchEvent(new c)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=d,l([o.state()],i.prototype,"stateManager",void 0),i}(e.FtLitElementRedux)){}const f=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorContent),p={color:f,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color","",f),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:e.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},u=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorPrimary),g=u,y=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",u),b=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorSecondary),m=b,v=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",b),x=i.css`
|
|
1
|
+
!function(t,e,i,o,r,n,a){var s;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(s||(s={}));var l=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class c extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const d=Symbol("registerInterval");class h extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[d]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[d]):this.dispatchEvent(new c)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=d,l([o.state()],i.prototype,"stateManager",void 0),i}(e.FtLitElementRedux)){}const f=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorContent),p={color:f,backgroundColor:e.FtCssVariableFactory.extend("--ft-ripple-background-color","",f),opacityContentOnSurfacePressed:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:e.FtCssVariableFactory.external(e.designSystemVariables.opacityContentOnSurfaceSelected,"Design system"),borderRadius:e.FtCssVariableFactory.create("--ft-ripple-border-radius","","SIZE","0px")},u=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorPrimary),g=u,y=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",u),b=e.FtCssVariableFactory.extend("--ft-ripple-color","",e.designSystemVariables.colorSecondary),m=b,v=e.FtCssVariableFactory.extend("--ft-ripple-background-color","",b),x=i.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -1573,7 +1573,7 @@ const Ae=Symbol.for(""),Be=t=>{if(t?.r===Ae)return t?._$litStatic$},Fe=t=>({_$li
|
|
|
1573
1573
|
<slot></slot>
|
|
1574
1574
|
</ft-typography>
|
|
1575
1575
|
</div>
|
|
1576
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new wo(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}$o.elementDefinitions={"ft-ripple":si,"ft-typography":Ve,"ft-icon":qe},$o.styles=xo,Oo([o.property()],$o.prototype,"value",void 0),Oo([o.query(".ft-text-field-suggestion")],$o.prototype,"container",void 0),Oo([o.queryAssignedNodes()],$o.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(vo),e.customElement("ft-text-field-suggestion")($o);class So{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class No{convertPaginatedToc(t){return new So(t).build()}}class ko{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return ee(null!==(e=null===(t=Ki.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Ki.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return ee(null!=e?e:[],Jt.FEEDBACK_USER);case s.RATING:return ee(null!=e?e:[],Jt.RATING_USER)&&null!=i&&i!==Zt.NO_RATING;case s.PRINT:return ee(null!=e?e:[],Jt.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return ee(null!=e?e:[],Jt.COLLECTION_USER);default:return!1}}}class Co extends ko{static async build(t){return new Co(new No,await Zi.await(),new e.CacheRegistry,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){var e;const i=await this.api.getMap(t);return this.fingerprint=null===(e=i.lastPublication)||void 0===e?void 0:e.replace(/\D/g,""),i}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Io{static build(t,i){return new Io((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0}}))(t.trim()||"context"),null!=i?i:Co.build)}constructor(t,i){this.store=t,this.reloadDebouncer=new e.Debouncer(10),this.initService(i)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}}const Ro=i.css`
|
|
1576
|
+
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new wo(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}$o.elementDefinitions={"ft-ripple":si,"ft-typography":Ve,"ft-icon":qe},$o.styles=xo,Oo([o.property()],$o.prototype,"value",void 0),Oo([o.query(".ft-text-field-suggestion")],$o.prototype,"container",void 0),Oo([o.queryAssignedNodes()],$o.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(vo),e.customElement("ft-text-field-suggestion")($o);class So{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class No{convertPaginatedToc(t){return new So(t).build()}}class ko{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return ee(null!==(e=null===(t=Ki.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Ki.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return ee(null!=e?e:[],Jt.FEEDBACK_USER);case s.RATING:return ee(null!=e?e:[],Jt.RATING_USER)&&null!=i&&i!==Zt.NO_RATING;case s.PRINT:return ee(null!=e?e:[],Jt.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return ee(null!=e?e:[],Jt.COLLECTION_USER);case s.PERSONAL_BOOKS:return ee(null!=e?e:[],Jt.PERSONAL_BOOK_USER);default:return!1}}}class Co extends ko{static async build(t){return new Co(new No,await Zi.await(),new e.CacheRegistry,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){var e;const i=await this.api.getMap(t);return this.fingerprint=null===(e=i.lastPublication)||void 0===e?void 0:e.replace(/\D/g,""),i}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Io{static build(t,i){return new Io((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0}}))(t.trim()||"context"),null!=i?i:Co.build)}constructor(t,i){this.store=t,this.reloadDebouncer=new e.Debouncer(10),this.initService(i)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await e.delay(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}}const Ro=i.css`
|
|
1577
1577
|
`;class Eo extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Uo extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Lo extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class Wo extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class _o extends Event{constructor(){super("ft-reader-map-not-found")}}class To extends Event{constructor(){super("ft-reader-map-unauthorized")}}var zo=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Do extends e.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new e.Debouncer(5),this.navigationDebouncer=new e.Debouncer(10),this.addStore(Ki)}render(){return i.html`
|
|
1578
1578
|
${this.importStyleIfNeeded()}
|
|
1579
1579
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
@@ -119,7 +119,7 @@ let $e=class extends Bt{constructor(){super(...arguments),this.renderOptions={ho
|
|
|
119
119
|
display: inline-block;
|
|
120
120
|
width: 0;
|
|
121
121
|
}
|
|
122
|
-
`;class He{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;t=this.resolvePluralKey(t,e);let r=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,i)=>this.formatValue(t,i))))),r}resolvePluralKey(t,e){for(let i of e)if("number"==typeof i){const e=`${String(t)}[\\=${i}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const i=i=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(i):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(i):t.toLocaleString(i);try{return i(document.documentElement.lang)}catch(t){return i()}}}function Ge(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Ve,qe,Ye;const Xe=Symbol("internalReduxEventsUnsubscribers"),Je=Symbol("internalStoresUnsubscribers"),Qe=Symbol("internalStores");class ti extends Be{constructor(){super(...arguments),this[Ve]=new Map,this[qe]=new Map,this[Ye]=[]}update(t){var e;super.update(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[Qe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Qe].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Qe].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Ge(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Qe].delete(e)}setupStore(t,e){this[Qe].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Qe].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[Je].has(t.store):this[Je].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Je].set(t,e.subscribe((()=>this.updateFromStores()))),Ge(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[Xe].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Je].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Xe].forEach((t=>t())),this[Xe]=[]}unsubscribeFromStore(t){this[Je].has(t)&&this[Je].get(t)(),this[Je].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function ei(t){for(var e=arguments.length,i=Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];throw Error("[Immer] minified error nr: "+t+(i.length?" "+i.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ii(t){return!!t&&!!t[ji]}function oi(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===Bi}(t)||Array.isArray(t)||!!t[zi]||!!(null===(e=t.constructor)||void 0===e?void 0:e[zi])||ci(t)||hi(t))}function ri(t,e,i){void 0===i&&(i=!1),0===ni(t)?(i?Object.keys:Ki)(t).forEach((function(o){i&&"symbol"==typeof o||e(o,t[o],t)})):t.forEach((function(i,o){return e(o,i,t)}))}function ni(t){var e=t[ji];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ci(t)?2:hi(t)?3:0}function ai(t,e){return 2===ni(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function si(t,e,i){var o=ni(t);2===o?t.set(e,i):3===o?t.add(i):t[e]=i}function li(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function ci(t){return Di&&t instanceof Map}function hi(t){return Fi&&t instanceof Set}function fi(t){return t.o||t.t}function di(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Zi(t);delete e[ji];for(var i=Ki(e),o=0;o<i.length;o++){var r=i[o],n=e[r];!1===n.writable&&(n.writable=!0,n.configurable=!0),(n.get||n.set)&&(e[r]={configurable:!0,writable:!0,enumerable:n.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function ui(t,e){return void 0===e&&(e=!1),yi(t)||ii(t)||!oi(t)||(ni(t)>1&&(t.set=t.add=t.clear=t.delete=pi),Object.freeze(t),e&&ri(t,(function(t,e){return ui(e,!0)}),!0)),t}function pi(){ei(2)}function yi(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function gi(t){var e=Hi[t];return e||ei(18,t),e}function bi(){return Ti}function vi(t,e){e&&(gi("Patches"),t.u=[],t.s=[],t.v=e)}function mi(t){xi(t),t.p.forEach(Oi),t.p=null}function xi(t){t===Ti&&(Ti=t.l)}function wi(t){return Ti={p:[],l:Ti,h:t,m:!0,_:0}}function Oi(t){var e=t[ji];0===e.i||1===e.i?e.j():e.g=!0}function Si(t,e){e._=e.p.length;var i=e.p[0],o=void 0!==t&&t!==i;return e.h.O||gi("ES5").S(e,t,o),o?(i[ji].P&&(mi(e),ei(4)),oi(t)&&(t=$i(e,t),e.l||Ci(e,t)),e.u&&gi("Patches").M(i[ji].t,t,e.u,e.s)):t=$i(e,i,[]),mi(e),e.u&&e.v(e.u,e.s),t!==Mi?t:void 0}function $i(t,e,i){if(yi(e))return e;var o=e[ji];if(!o)return ri(e,(function(r,n){return Ni(t,o,e,r,n,i)}),!0),e;if(o.A!==t)return e;if(!o.P)return Ci(t,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=4===o.i||5===o.i?o.o=di(o.k):o.o,n=r,a=!1;3===o.i&&(n=new Set(r),r.clear(),a=!0),ri(n,(function(e,n){return Ni(t,o,r,e,n,i,a)})),Ci(t,r,!1),i&&t.u&&gi("Patches").N(o,i,t.u,t.s)}return o.o}function Ni(t,e,i,o,r,n,a){if(ii(r)){var s=$i(t,r,n&&e&&3!==e.i&&!ai(e.R,o)?n.concat(o):void 0);if(si(i,o,s),!ii(s))return;t.m=!1}else a&&i.add(r);if(oi(r)&&!yi(r)){if(!t.h.D&&t._<1)return;$i(t,r),e&&e.A.l||Ci(t,r)}}function Ci(t,e,i){void 0===i&&(i=!1),!t.l&&t.h.D&&t.m&&ui(e,i)}function Ei(t,e){var i=t[ji];return(i?fi(i):t)[e]}function ki(t,e){if(e in t)for(var i=Object.getPrototypeOf(t);i;){var o=Object.getOwnPropertyDescriptor(i,e);if(o)return o;i=Object.getPrototypeOf(i)}}function Ri(t){t.P||(t.P=!0,t.l&&Ri(t.l))}function Ii(t){t.o||(t.o=di(t.t))}function Ui(t,e,i){var o=ci(e)?gi("MapSet").F(e,i):hi(e)?gi("MapSet").T(e,i):t.O?function(t,e){var i=Array.isArray(t),o={i:i?1:0,A:e?e.A:bi(),P:!1,I:!1,R:{},l:e,t,k:null,o:null,j:null,C:!1},r=o,n=Gi;i&&(r=[o],n=Vi);var a=Proxy.revocable(r,n),s=a.revoke,l=a.proxy;return o.k=l,o.j=s,l}(e,i):gi("ES5").J(e,i);return(i?i.A:bi()).p.push(o),o}function Li(t){return ii(t)||ei(22,t),function t(e){if(!oi(e))return e;var i,o=e[ji],r=ni(e);if(o){if(!o.P&&(o.i<4||!gi("ES5").K(o)))return o.t;o.I=!0,i=Ai(e,r),o.I=!1}else i=Ai(e,r);return ri(i,(function(e,r){o&&function(t,e){return 2===ni(t)?t.get(e):t[e]}(o.t,e)===r||si(i,e,t(r))})),3===r?new Set(i):i}(t)}function Ai(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return di(t)}Ve=Je,qe=Qe,Ye=Xe;var _i,Ti,Wi="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Di="undefined"!=typeof Map,Fi="undefined"!=typeof Set,Pi="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Mi=Wi?Symbol.for("immer-nothing"):((_i={})["immer-nothing"]=!0,_i),zi=Wi?Symbol.for("immer-draftable"):"__$immer_draftable",ji=Wi?Symbol.for("immer-state"):"__$immer_state",Bi=""+Object.prototype.constructor,Ki="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Zi=Object.getOwnPropertyDescriptors||function(t){var e={};return Ki(t).forEach((function(i){e[i]=Object.getOwnPropertyDescriptor(t,i)})),e},Hi={},Gi={get:function(t,e){if(e===ji)return t;var i=fi(t);if(!ai(i,e))return function(t,e,i){var o,r=ki(e,i);return r?"value"in r?r.value:null===(o=r.get)||void 0===o?void 0:o.call(t.k):void 0}(t,i,e);var o=i[e];return t.I||!oi(o)?o:o===Ei(t.t,e)?(Ii(t),t.o[e]=Ui(t.A.h,o,t)):o},has:function(t,e){return e in fi(t)},ownKeys:function(t){return Reflect.ownKeys(fi(t))},set:function(t,e,i){var o=ki(fi(t),e);if(null==o?void 0:o.set)return o.set.call(t.k,i),!0;if(!t.P){var r=Ei(fi(t),e),n=null==r?void 0:r[ji];if(n&&n.t===i)return t.o[e]=i,t.R[e]=!1,!0;if(li(i,r)&&(void 0!==i||ai(t.t,e)))return!0;Ii(t),Ri(t)}return t.o[e]===i&&(void 0!==i||e in t.o)||Number.isNaN(i)&&Number.isNaN(t.o[e])||(t.o[e]=i,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==Ei(t.t,e)||e in t.t?(t.R[e]=!1,Ii(t),Ri(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var i=fi(t),o=Reflect.getOwnPropertyDescriptor(i,e);return o?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:o.enumerable,value:i[e]}:o},defineProperty:function(){ei(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ei(12)}},Vi={};ri(Gi,(function(t,e){Vi[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Vi.deleteProperty=function(t,e){return Vi.set.call(this,t,e,void 0)},Vi.set=function(t,e,i){return Gi.set.call(this,t[0],e,i,t[0])};var qi=function(){function t(t){var e=this;this.O=Pi,this.D=!0,this.produce=function(t,i,o){if("function"==typeof t&&"function"!=typeof i){var r=i;i=t;var n=e;return function(t){var e=this;void 0===t&&(t=r);for(var o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return n.produce(t,(function(t){var o;return(o=i).call.apply(o,[e,t].concat(a))}))}}var a;if("function"!=typeof i&&ei(6),void 0!==o&&"function"!=typeof o&&ei(7),oi(t)){var s=wi(e),l=Ui(e,t,void 0),c=!0;try{a=i(l),c=!1}finally{c?mi(s):xi(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return vi(s,o),Si(t,s)}),(function(t){throw mi(s),t})):(vi(s,o),Si(a,s))}if(!t||"object"!=typeof t){if(void 0===(a=i(t))&&(a=t),a===Mi&&(a=void 0),e.D&&ui(a,!0),o){var h=[],f=[];gi("Patches").M(t,a,h,f),o(h,f)}return a}ei(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return e.produceWithPatches(i,(function(e){return t.apply(void 0,[e].concat(r))}))};var o,r,n=e.produce(t,i,(function(t,e){o=t,r=e}));return"undefined"!=typeof Promise&&n instanceof Promise?n.then((function(t){return[t,o,r]})):[n,o,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){oi(t)||ei(8),ii(t)&&(t=Li(t));var e=wi(this),i=Ui(this,t,void 0);return i[ji].C=!0,xi(e),i},e.finishDraft=function(t,e){var i=(t&&t[ji]).A;return vi(i,e),Si(void 0,i)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!Pi&&ei(20),this.O=t},e.applyPatches=function(t,e){var i;for(i=e.length-1;i>=0;i--){var o=e[i];if(0===o.path.length&&"replace"===o.op){t=o.value;break}}i>-1&&(e=e.slice(i+1));var r=gi("Patches").$;return ii(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),Yi=new qi,Xi=Yi.produce;function Ji(t){return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(t)}function Qi(t){var e=function(t,e){if("object"!==Ji(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!==Ji(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ji(e)?e:String(e)}function to(t,e,i){return(e=Qi(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function eo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function io(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(i),!0).forEach((function(e){to(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function oo(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}Yi.produceWithPatches.bind(Yi),Yi.setAutoFreeze.bind(Yi),Yi.setUseProxies.bind(Yi),Yi.applyPatches.bind(Yi),Yi.createDraft.bind(Yi),Yi.finishDraft.bind(Yi);var ro="function"==typeof Symbol&&Symbol.observable||"@@observable",no=function(){return Math.random().toString(36).substring(7).split("").join(".")},ao={INIT:"@@redux/INIT"+no(),REPLACE:"@@redux/REPLACE"+no(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+no()}};function so(t,e,i){var o;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(oo(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(oo(1));return i(so)(t,e)}if("function"!=typeof t)throw new Error(oo(2));var r=t,n=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function h(){if(l)throw new Error(oo(3));return n}function f(t){if("function"!=typeof t)throw new Error(oo(4));if(l)throw new Error(oo(5));var e=!0;return c(),s.push(t),function(){if(e){if(l)throw new Error(oo(6));e=!1,c();var i=s.indexOf(t);s.splice(i,1),a=null}}}function d(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(oo(7));if(void 0===t.type)throw new Error(oo(8));if(l)throw new Error(oo(9));try{l=!0,n=r(n,t)}finally{l=!1}for(var e=a=s,i=0;i<e.length;i++){(0,e[i])()}return t}return d({type:ao.INIT}),(o={dispatch:d,subscribe:f,getState:h,replaceReducer:function(t){if("function"!=typeof t)throw new Error(oo(10));r=t,d({type:ao.REPLACE})}})[ro]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(oo(11));function i(){t.next&&t.next(h())}return i(),{unsubscribe:e(i)}}})[ro]=function(){return this},t},o}function lo(t){for(var e=Object.keys(t),i={},o=0;o<e.length;o++){var r=e[o];"function"==typeof t[r]&&(i[r]=t[r])}var n,a=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ao.INIT}))throw new Error(oo(12));if(void 0===i(void 0,{type:ao.PROBE_UNKNOWN_ACTION()}))throw new Error(oo(13))}))}(i)}catch(t){n=t}return function(t,e){if(void 0===t&&(t={}),n)throw n;for(var o=!1,r={},s=0;s<a.length;s++){var l=a[s],c=i[l],h=t[l],f=c(h,e);if(void 0===f)throw e&&e.type,new Error(oo(14));r[l]=f,o=o||f!==h}return(o=o||a.length!==Object.keys(t).length)?r:t}}function co(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ho(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),o=function(){throw new Error(oo(15))},r={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},n=e.map((function(t){return t(r)}));return o=co.apply(void 0,n)(i.dispatch),io(io({},i),{},{dispatch:o})}}}function fo(t){return function(e){var i=e.dispatch,o=e.getState;return function(e){return function(r){return"function"==typeof r?r(i,o,t):e(r)}}}}var uo=fo();uo.withExtraArgument=fo;var po,yo=uo,go=(po=function(t,e){return po=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},po(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}po(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),bo=function(t,e){var i,o,r,n,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(r=2&n[0]?o.return:n[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,n[1])).done)return r;switch(o=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){a.label=n[1];break}if(6===n[0]&&a.label<r[1]){a.label=r[1],r=n;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(n);break}r[2]&&a.ops.pop(),a.trys.pop();continue}n=e.call(t,a)}catch(t){n=[6,t],o=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}},vo=function(t,e){for(var i=0,o=e.length,r=t.length;i<o;i++,r++)t[r]=e[i];return t},mo=Object.defineProperty,xo=Object.defineProperties,wo=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,No=function(t,e,i){return e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},Co=function(t,e){for(var i in e||(e={}))So.call(e,i)&&No(t,i,e[i]);if(Oo)for(var o=0,r=Oo(e);o<r.length;o++){i=r[o];$o.call(e,i)&&No(t,i,e[i])}return t},Eo=function(t,e){return xo(t,wo(e))},ko="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?co:co.apply(null,arguments)};var Ro=function(t){function e(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var r=t.apply(this,i)||this;return Object.setPrototypeOf(r,e.prototype),r}return go(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,vo([void 0],t[0].concat(this)))):new(e.bind.apply(e,vo([void 0],t.concat(this))))},e}(Array),Io=function(t){function e(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var r=t.apply(this,i)||this;return Object.setPrototypeOf(r,e.prototype),r}return go(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,vo([void 0],t[0].concat(this)))):new(e.bind.apply(e,vo([void 0],t.concat(this))))},e}(Array);function Uo(t){return oi(t)?Xi(t,(function(){})):t}function Lo(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,i=void 0===e||e;t.immutableCheck,t.serializableCheck;var o=new Ro;i&&(!function(t){return"boolean"==typeof t}(i)?o.push(yo.withExtraArgument(i.extraArgument)):o.push(yo));return o}(t)}}function Ao(t){var e,i=Lo(),o=t||{},r=o.reducer,n=void 0===r?void 0:r,a=o.middleware,s=void 0===a?i():a,l=o.devTools,c=void 0===l||l,h=o.preloadedState,f=void 0===h?void 0:h,d=o.enhancers,u=void 0===d?void 0:d;if("function"==typeof n)e=n;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var i=e;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return e===i}(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=lo(n)}var p=s;"function"==typeof p&&(p=p(i));var y=ho.apply(void 0,p),g=co;c&&(g=ko(Co({trace:!1},"object"==typeof c&&c)));var b=new Io(y),v=b;return Array.isArray(u)?v=vo([y],u):"function"==typeof u&&(v=u(b)),so(e,f,g.apply(void 0,v))}function _o(t,e){function i(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(e){var r=e.apply(void 0,i);if(!r)throw new Error("prepareAction did not return an object");return Co(Co({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(e){return e.type===t},i}function To(t){var e,i={},o=[],r={addCase:function(t,e){var o="string"==typeof t?t:t.type;if(o in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[o]=e,r},addMatcher:function(t,e){return o.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[i,o,e]}function Wo(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var i,o="function"==typeof t.initialState?t.initialState:Uo(t.initialState),r=t.reducers||{},n=Object.keys(r),a={},s={},l={};function c(){var e="function"==typeof t.extraReducers?To(t.extraReducers):[t.extraReducers],i=e[0],r=void 0===i?{}:i,n=e[1],a=void 0===n?[]:n,l=e[2],c=void 0===l?void 0:l,h=Co(Co({},r),s);return function(t,e,i,o){void 0===i&&(i=[]);var r,n="function"==typeof e?To(e):[e,i,o],a=n[0],s=n[1],l=n[2];if(function(t){return"function"==typeof t}(t))r=function(){return Uo(t())};else{var c=Uo(t);r=function(){return c}}function h(t,e){void 0===t&&(t=r());var i=vo([a[e.type]],s.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[l]),i.reduce((function(t,i){if(i){var o;if(ii(t))return void 0===(o=i(t,e))?t:o;if(oi(t))return Xi(t,(function(t){return i(t,e)}));if(void 0===(o=i(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return o}return t}),t)}return h.getInitialState=r,h}(o,(function(t){for(var e in h)t.addCase(e,h[e]);for(var i=0,o=a;i<o.length;i++){var r=o[i];t.addMatcher(r.matcher,r.reducer)}c&&t.addDefaultCase(c)}))}return n.forEach((function(t){var i,o,n=r[t],c=e+"/"+t;"reducer"in n?(i=n.reducer,o=n.prepare):i=n,a[t]=i,s[c]=i,l[t]=o?_o(c,o):_o(c)})),{name:e,reducer:function(t,e){return i||(i=c()),i(t,e)},actions:l,caseReducers:a,getInitialState:function(){return i||(i=c()),i.getInitialState()}}}var Do=["name","message","stack","code"],Fo=function(t,e){this.payload=t,this.meta=e},Po=function(t,e){this.payload=t,this.meta=e},Mo=function(t){if("object"==typeof t&&null!==t){for(var e={},i=0,o=Do;i<o.length;i++){var r=o[i];"string"==typeof t[r]&&(e[r]=t[r])}return e}return{message:String(t)}};function zo(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,i){var o=_o(t+"/fulfilled",(function(t,e,i,o){return{payload:t,meta:Eo(Co({},o||{}),{arg:i,requestId:e,requestStatus:"fulfilled"})}})),r=_o(t+"/pending",(function(t,e,i){return{payload:void 0,meta:Eo(Co({},i||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),n=_o(t+"/rejected",(function(t,e,o,r,n){return{payload:r,error:(i&&i.serializeError||Mo)(t||"Rejected"),meta:Eo(Co({},n||{}),{arg:o,requestId:e,rejectedWithValue:!!r,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(s,l,c){var h,f=(null==i?void 0:i.idGenerator)?i.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",i=t;i--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),d=new a;function u(t){h=t,d.abort()}var p=function(){return a=this,p=null,y=function(){var a,p,y,g,b,v;return bo(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),g=null==(a=null==i?void 0:i.condition)?void 0:a.call(i,t,{getState:l,extra:c}),null===(x=g)||"object"!=typeof x||"function"!=typeof x.then?[3,2]:[4,g];case 1:g=m.sent(),m.label=2;case 2:if(!1===g||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,e){return d.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:h||"Aborted"})}))})),s(r(f,t,null==(p=null==i?void 0:i.getPendingMeta)?void 0:p.call(i,{requestId:f,arg:t},{getState:l,extra:c}))),[4,Promise.race([b,Promise.resolve(e(t,{dispatch:s,getState:l,extra:c,requestId:f,signal:d.signal,abort:u,rejectWithValue:function(t,e){return new Fo(t,e)},fulfillWithValue:function(t,e){return new Po(t,e)}})).then((function(e){if(e instanceof Fo)throw e;return e instanceof Po?o(e.payload,f,t,e.meta):o(e,f,t)}))])];case 3:return y=m.sent(),[3,5];case 4:return v=m.sent(),y=v instanceof Fo?n(null,f,t,v.payload,v.meta):n(v,f,t),[3,5];case 5:return i&&!i.dispatchConditionRejection&&n.match(y)&&y.meta.condition||s(y),[2,y]}var x}))},new Promise((function(t,e){var i=function(t){try{r(y.next(t))}catch(t){e(t)}},o=function(t){try{r(y.throw(t))}catch(t){e(t)}},r=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(i,o)};r((y=y.apply(a,p)).next())}));var a,p,y}();return Object.assign(p,{abort:u,requestId:f,arg:t,unwrap:function(){return p.then(zo)}})}}),{pending:r,rejected:n,fulfilled:o,typePrefix:t})}t.withTypes=function(){return t}}();var jo="listenerMiddleware";_o(jo+"/add"),_o(jo+"/removeAll"),_o(jo+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var i=r[t];return i?i.enumerable=e:r[t]=i={configurable:!0,enumerable:e,get:function(){var e=this[ji];return Gi.get(e,t)},set:function(e){var i=this[ji];Gi.set(i,t,e)}},i}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][ji];if(!r.P)switch(r.i){case 5:o(r)&&Ri(r);break;case 4:i(r)&&Ri(r)}}}function i(t){for(var e=t.t,i=t.k,o=Ki(i),r=o.length-1;r>=0;r--){var n=o[r];if(n!==ji){var a=e[n];if(void 0===a&&!ai(e,n))return!0;var s=i[n],l=s&&s[ji];if(l?l.t!==a:!li(s,a))return!0}}var c=!!e[ji];return o.length!==Ki(e).length+(c?0:1)}function o(t){var e=t.k;if(e.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(e,e.length-1);if(i&&!i.get)return!0;for(var o=0;o<e.length;o++)if(!e.hasOwnProperty(o))return!0;return!1}var r={};!function(t,e){Hi[t]||(Hi[t]=e)}("ES5",{J:function(e,i){var o=Array.isArray(e),r=function(e,i){if(e){for(var o=Array(i.length),r=0;r<i.length;r++)Object.defineProperty(o,""+r,t(r,!0));return o}var n=Zi(i);delete n[ji];for(var a=Ki(n),s=0;s<a.length;s++){var l=a[s];n[l]=t(l,e||!!n[l].enumerable)}return Object.create(Object.getPrototypeOf(i),n)}(o,e),n={i:o?5:4,A:i?i.A:bi(),P:!1,I:!1,R:{},l:i,t:e,k:r,o:null,g:!1,C:!1};return Object.defineProperty(r,ji,{value:n,writable:!0}),r},S:function(t,i,r){r?ii(i)&&i[ji].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var i=e[ji];if(i){var r=i.t,n=i.k,a=i.R,s=i.i;if(4===s)ri(n,(function(e){e!==ji&&(void 0!==r[e]||ai(r,e)?a[e]||t(n[e]):(a[e]=!0,Ri(i)))})),ri(r,(function(t){void 0!==n[t]||ai(n,t)||(a[t]=!1,Ri(i))}));else if(5===s){if(o(i)&&(Ri(i),a.length=!0),n.length<r.length)for(var l=n.length;l<r.length;l++)a[l]=!1;else for(var c=r.length;c<n.length;c++)a[c]=!0;for(var h=Math.min(n.length,r.length),f=0;f<h;f++)n.hasOwnProperty(f)||(a[f]=!0),void 0===a[f]&&t(n[f])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?i(t):o(t)}})}(),window.ftReduxStores||(window.ftReduxStores={});class Bo{static get(t){var e;const i="string"==typeof t?t:t.name,o="string"==typeof t?void 0:t,r=window.ftReduxStores[i];if(Ge(r))return r;if(null==o)return;const n=Wo({...o,reducers:null!==(e=o.reducers)&&void 0!==e?e:{}}),a=Ao({reducer:(t,e)=>{var i;switch(e.type){case"CLEAR_FT_REDUX_STORE":return n.getInitialState();case"DEFAULT_STATE_FIELDS_VALUES_SETTER":return{...t,...null!==(i=e.overwrites)&&void 0!==i?i:{}};default:return n.reducer(t,e)}}});return window.ftReduxStores[o.name]=new Bo(n,a)}constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.eventBus=document.createElement("event-bus"),this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,i)=>{const o=e,r=t[o];return r?(...t)=>{const e=r(...t);return this.reduxStore.dispatch(e),e}:t=>{this.setState({[o]:t})}}})}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_STATE_FIELDS_VALUES_SETTER",overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}const Ko=t=>{const e=null!=t?t:{};return(t,i)=>{var o;const r={hasChanged:(t,e)=>!_(t,e),attribute:!1,...e};k(r)(t,i);const n=t;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(i,{selector:null!==(o=e.selector)&&void 0!==o?o:t=>t[i],store:e.store})}},Zo=Symbol("elementInternals");function Ho(t,e){return class extends t{static get formAssociated(){return!0}get form(){return this[Zo].form}constructor(...t){super(t),this[Zo]=this.attachInternals(),this[Zo].role=e}setFormValue(t){this[Zo].setFormValue(t)}}}var Go,Vo,qo;const Yo=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(qo=null===(Vo=null===(Go=window.safari)||void 0===Go?void 0:Go.pushNotification)||void 0===Vo?void 0:Vo.toString())&&void 0!==qo?qo:"");var Xo;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS"}(Xo||(Xo={}));var Jo=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Qo extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const tr=Symbol("registerInterval");class er extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[tr]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[tr]):this.dispatchEvent(new Qo)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=tr,Jo([R()],i.prototype,"stateManager",void 0),i}(ti)){}const ir=Ee.extend("--ft-ripple-color","",Ae.colorContent),or={color:ir,backgroundColor:Ee.extend("--ft-ripple-background-color","",ir),opacityContentOnSurfacePressed:Ee.external(Ae.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:Ee.external(Ae.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:Ee.external(Ae.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:Ee.external(Ae.opacityContentOnSurfaceSelected,"Design system"),borderRadius:Ee.create("--ft-ripple-border-radius","","SIZE","0px")},rr=Ee.extend("--ft-ripple-color","",Ae.colorPrimary),nr=rr,ar=Ee.extend("--ft-ripple-background-color","",rr),sr=Ee.extend("--ft-ripple-color","",Ae.colorSecondary),lr=sr,cr=Ee.extend("--ft-ripple-background-color","",sr),hr=Et`
|
|
122
|
+
`;class He{constructor(t,e){this.defaultLabels=t,this.labels=e}resolve(t,...e){var i,o;t=this.resolvePluralKey(t,e);let r=null!==(o=null!==(i=this.labels[t])&&void 0!==i?i:this.defaultLabels[t])&&void 0!==o?o:"";return e.forEach(((t,e)=>r=r.replace(new RegExp(`\\{${e}([^}]*)\\}`,"g"),((e,i)=>this.formatValue(t,i))))),r}resolvePluralKey(t,e){for(let i of e)if("number"==typeof i){const e=`${String(t)}[\\=${i}]`;if(e in this.labels||e in this.defaultLabels)return e}return t}formatValue(t,e){return t instanceof Date?this.formatDate(t,e):null!=t?t:""}formatDate(t,e){const i=i=>(null==e?void 0:e.includes("date"))?t.toLocaleDateString(i):(null==e?void 0:e.includes("time"))?t.toLocaleTimeString(i):t.toLocaleString(i);try{return i(document.documentElement.lang)}catch(t){return i()}}}function Ge(t){var e;return null!==(e=null==t?void 0:t.isFtReduxStore)&&void 0!==e&&e}var Ve,qe,Ye;const Xe=Symbol("internalReduxEventsUnsubscribers"),Je=Symbol("internalStoresUnsubscribers"),Qe=Symbol("internalStores");class ti extends Be{constructor(){super(...arguments),this[Ve]=new Map,this[qe]=new Map,this[Ye]=[]}update(t){var e;super.update(t),(null===(e=this.reduxReactiveProperties)||void 0===e?void 0:e.some((e=>t.has(e))))&&this.updateFromStores()}getUnnamedStore(){if(this[Qe].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Qe].values()][0]}getStore(t){return null==t?this.getUnnamedStore():this[Qe].get(t)}addStore(t,e){var i;e=null!==(i=null!=e?e:Ge(t)?t.name:void 0)&&void 0!==i?i:"default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:t.name;this.unsubscribeFromStore(e),this[Qe].delete(e)}setupStore(t,e){this[Qe].set(t,e),this.subscribeToStore(t,e),this.updateFromStores()}setupStores(){this.unsubscribeFromStores(),this[Qe].forEach(((t,e)=>this.subscribeToStore(e,t))),this.updateFromStores()}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(t.store?this[Je].has(t.store):this[Je].size>0)&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){var i;this[Je].set(t,e.subscribe((()=>this.updateFromStores()))),Ge(e)&&e.eventBus&&(null===(i=this.reduxEventListeners)||void 0===i||i.forEach(((t,i)=>{if("function"==typeof this[i]&&(!t.store||e.name===t.store)){const o=t=>this[i](t);e.eventBus.addEventListener(t.eventName,o),this[Xe].push((()=>e.eventBus.removeEventListener(t.eventName,o)))}}))),this.onStoreAvailable(t)}unsubscribeFromStores(){this[Je].forEach(((t,e)=>this.unsubscribeFromStore(e))),this[Xe].forEach((t=>t())),this[Xe]=[]}unsubscribeFromStore(t){this[Je].has(t)&&this[Je].get(t)(),this[Je].delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}function ei(t){for(var e=arguments.length,i=Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];throw Error("[Immer] minified error nr: "+t+(i.length?" "+i.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function ii(t){return!!t&&!!t[ji]}function oi(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var i=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return i===Object||"function"==typeof i&&Function.toString.call(i)===Bi}(t)||Array.isArray(t)||!!t[zi]||!!(null===(e=t.constructor)||void 0===e?void 0:e[zi])||ci(t)||hi(t))}function ri(t,e,i){void 0===i&&(i=!1),0===ni(t)?(i?Object.keys:Ki)(t).forEach((function(o){i&&"symbol"==typeof o||e(o,t[o],t)})):t.forEach((function(i,o){return e(o,i,t)}))}function ni(t){var e=t[ji];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:ci(t)?2:hi(t)?3:0}function ai(t,e){return 2===ni(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function si(t,e,i){var o=ni(t);2===o?t.set(e,i):3===o?t.add(i):t[e]=i}function li(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function ci(t){return Di&&t instanceof Map}function hi(t){return Fi&&t instanceof Set}function fi(t){return t.o||t.t}function di(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Zi(t);delete e[ji];for(var i=Ki(e),o=0;o<i.length;o++){var r=i[o],n=e[r];!1===n.writable&&(n.writable=!0,n.configurable=!0),(n.get||n.set)&&(e[r]={configurable:!0,writable:!0,enumerable:n.enumerable,value:t[r]})}return Object.create(Object.getPrototypeOf(t),e)}function ui(t,e){return void 0===e&&(e=!1),yi(t)||ii(t)||!oi(t)||(ni(t)>1&&(t.set=t.add=t.clear=t.delete=pi),Object.freeze(t),e&&ri(t,(function(t,e){return ui(e,!0)}),!0)),t}function pi(){ei(2)}function yi(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function gi(t){var e=Hi[t];return e||ei(18,t),e}function bi(){return Ti}function vi(t,e){e&&(gi("Patches"),t.u=[],t.s=[],t.v=e)}function mi(t){xi(t),t.p.forEach(Oi),t.p=null}function xi(t){t===Ti&&(Ti=t.l)}function wi(t){return Ti={p:[],l:Ti,h:t,m:!0,_:0}}function Oi(t){var e=t[ji];0===e.i||1===e.i?e.j():e.g=!0}function Si(t,e){e._=e.p.length;var i=e.p[0],o=void 0!==t&&t!==i;return e.h.O||gi("ES5").S(e,t,o),o?(i[ji].P&&(mi(e),ei(4)),oi(t)&&(t=$i(e,t),e.l||Ci(e,t)),e.u&&gi("Patches").M(i[ji].t,t,e.u,e.s)):t=$i(e,i,[]),mi(e),e.u&&e.v(e.u,e.s),t!==Mi?t:void 0}function $i(t,e,i){if(yi(e))return e;var o=e[ji];if(!o)return ri(e,(function(r,n){return Ni(t,o,e,r,n,i)}),!0),e;if(o.A!==t)return e;if(!o.P)return Ci(t,o.t,!0),o.t;if(!o.I){o.I=!0,o.A._--;var r=4===o.i||5===o.i?o.o=di(o.k):o.o,n=r,a=!1;3===o.i&&(n=new Set(r),r.clear(),a=!0),ri(n,(function(e,n){return Ni(t,o,r,e,n,i,a)})),Ci(t,r,!1),i&&t.u&&gi("Patches").N(o,i,t.u,t.s)}return o.o}function Ni(t,e,i,o,r,n,a){if(ii(r)){var s=$i(t,r,n&&e&&3!==e.i&&!ai(e.R,o)?n.concat(o):void 0);if(si(i,o,s),!ii(s))return;t.m=!1}else a&&i.add(r);if(oi(r)&&!yi(r)){if(!t.h.D&&t._<1)return;$i(t,r),e&&e.A.l||Ci(t,r)}}function Ci(t,e,i){void 0===i&&(i=!1),!t.l&&t.h.D&&t.m&&ui(e,i)}function Ei(t,e){var i=t[ji];return(i?fi(i):t)[e]}function ki(t,e){if(e in t)for(var i=Object.getPrototypeOf(t);i;){var o=Object.getOwnPropertyDescriptor(i,e);if(o)return o;i=Object.getPrototypeOf(i)}}function Ri(t){t.P||(t.P=!0,t.l&&Ri(t.l))}function Ii(t){t.o||(t.o=di(t.t))}function Ui(t,e,i){var o=ci(e)?gi("MapSet").F(e,i):hi(e)?gi("MapSet").T(e,i):t.O?function(t,e){var i=Array.isArray(t),o={i:i?1:0,A:e?e.A:bi(),P:!1,I:!1,R:{},l:e,t,k:null,o:null,j:null,C:!1},r=o,n=Gi;i&&(r=[o],n=Vi);var a=Proxy.revocable(r,n),s=a.revoke,l=a.proxy;return o.k=l,o.j=s,l}(e,i):gi("ES5").J(e,i);return(i?i.A:bi()).p.push(o),o}function Li(t){return ii(t)||ei(22,t),function t(e){if(!oi(e))return e;var i,o=e[ji],r=ni(e);if(o){if(!o.P&&(o.i<4||!gi("ES5").K(o)))return o.t;o.I=!0,i=Ai(e,r),o.I=!1}else i=Ai(e,r);return ri(i,(function(e,r){o&&function(t,e){return 2===ni(t)?t.get(e):t[e]}(o.t,e)===r||si(i,e,t(r))})),3===r?new Set(i):i}(t)}function Ai(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return di(t)}Ve=Je,qe=Qe,Ye=Xe;var _i,Ti,Wi="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Di="undefined"!=typeof Map,Fi="undefined"!=typeof Set,Pi="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Mi=Wi?Symbol.for("immer-nothing"):((_i={})["immer-nothing"]=!0,_i),zi=Wi?Symbol.for("immer-draftable"):"__$immer_draftable",ji=Wi?Symbol.for("immer-state"):"__$immer_state",Bi=""+Object.prototype.constructor,Ki="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Zi=Object.getOwnPropertyDescriptors||function(t){var e={};return Ki(t).forEach((function(i){e[i]=Object.getOwnPropertyDescriptor(t,i)})),e},Hi={},Gi={get:function(t,e){if(e===ji)return t;var i=fi(t);if(!ai(i,e))return function(t,e,i){var o,r=ki(e,i);return r?"value"in r?r.value:null===(o=r.get)||void 0===o?void 0:o.call(t.k):void 0}(t,i,e);var o=i[e];return t.I||!oi(o)?o:o===Ei(t.t,e)?(Ii(t),t.o[e]=Ui(t.A.h,o,t)):o},has:function(t,e){return e in fi(t)},ownKeys:function(t){return Reflect.ownKeys(fi(t))},set:function(t,e,i){var o=ki(fi(t),e);if(null==o?void 0:o.set)return o.set.call(t.k,i),!0;if(!t.P){var r=Ei(fi(t),e),n=null==r?void 0:r[ji];if(n&&n.t===i)return t.o[e]=i,t.R[e]=!1,!0;if(li(i,r)&&(void 0!==i||ai(t.t,e)))return!0;Ii(t),Ri(t)}return t.o[e]===i&&(void 0!==i||e in t.o)||Number.isNaN(i)&&Number.isNaN(t.o[e])||(t.o[e]=i,t.R[e]=!0),!0},deleteProperty:function(t,e){return void 0!==Ei(t.t,e)||e in t.t?(t.R[e]=!1,Ii(t),Ri(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var i=fi(t),o=Reflect.getOwnPropertyDescriptor(i,e);return o?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:o.enumerable,value:i[e]}:o},defineProperty:function(){ei(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){ei(12)}},Vi={};ri(Gi,(function(t,e){Vi[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Vi.deleteProperty=function(t,e){return Vi.set.call(this,t,e,void 0)},Vi.set=function(t,e,i){return Gi.set.call(this,t[0],e,i,t[0])};var qi=function(){function t(t){var e=this;this.O=Pi,this.D=!0,this.produce=function(t,i,o){if("function"==typeof t&&"function"!=typeof i){var r=i;i=t;var n=e;return function(t){var e=this;void 0===t&&(t=r);for(var o=arguments.length,a=Array(o>1?o-1:0),s=1;s<o;s++)a[s-1]=arguments[s];return n.produce(t,(function(t){var o;return(o=i).call.apply(o,[e,t].concat(a))}))}}var a;if("function"!=typeof i&&ei(6),void 0!==o&&"function"!=typeof o&&ei(7),oi(t)){var s=wi(e),l=Ui(e,t,void 0),c=!0;try{a=i(l),c=!1}finally{c?mi(s):xi(s)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return vi(s,o),Si(t,s)}),(function(t){throw mi(s),t})):(vi(s,o),Si(a,s))}if(!t||"object"!=typeof t){if(void 0===(a=i(t))&&(a=t),a===Mi&&(a=void 0),e.D&&ui(a,!0),o){var h=[],f=[];gi("Patches").M(t,a,h,f),o(h,f)}return a}ei(21,t)},this.produceWithPatches=function(t,i){if("function"==typeof t)return function(i){for(var o=arguments.length,r=Array(o>1?o-1:0),n=1;n<o;n++)r[n-1]=arguments[n];return e.produceWithPatches(i,(function(e){return t.apply(void 0,[e].concat(r))}))};var o,r,n=e.produce(t,i,(function(t,e){o=t,r=e}));return"undefined"!=typeof Promise&&n instanceof Promise?n.then((function(t){return[t,o,r]})):[n,o,r]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){oi(t)||ei(8),ii(t)&&(t=Li(t));var e=wi(this),i=Ui(this,t,void 0);return i[ji].C=!0,xi(e),i},e.finishDraft=function(t,e){var i=(t&&t[ji]).A;return vi(i,e),Si(void 0,i)},e.setAutoFreeze=function(t){this.D=t},e.setUseProxies=function(t){t&&!Pi&&ei(20),this.O=t},e.applyPatches=function(t,e){var i;for(i=e.length-1;i>=0;i--){var o=e[i];if(0===o.path.length&&"replace"===o.op){t=o.value;break}}i>-1&&(e=e.slice(i+1));var r=gi("Patches").$;return ii(t)?r(t,e):this.produce(t,(function(t){return r(t,e)}))},t}(),Yi=new qi,Xi=Yi.produce;function Ji(t){return Ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(t)}function Qi(t){var e=function(t,e){if("object"!==Ji(t)||null===t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var o=i.call(t,e||"default");if("object"!==Ji(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Ji(e)?e:String(e)}function to(t,e,i){return(e=Qi(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function eo(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,o)}return i}function io(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?eo(Object(i),!0).forEach((function(e){to(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):eo(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function oo(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}Yi.produceWithPatches.bind(Yi),Yi.setAutoFreeze.bind(Yi),Yi.setUseProxies.bind(Yi),Yi.applyPatches.bind(Yi),Yi.createDraft.bind(Yi),Yi.finishDraft.bind(Yi);var ro="function"==typeof Symbol&&Symbol.observable||"@@observable",no=function(){return Math.random().toString(36).substring(7).split("").join(".")},ao={INIT:"@@redux/INIT"+no(),REPLACE:"@@redux/REPLACE"+no(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+no()}};function so(t,e,i){var o;if("function"==typeof e&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(oo(0));if("function"==typeof e&&void 0===i&&(i=e,e=void 0),void 0!==i){if("function"!=typeof i)throw new Error(oo(1));return i(so)(t,e)}if("function"!=typeof t)throw new Error(oo(2));var r=t,n=e,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function h(){if(l)throw new Error(oo(3));return n}function f(t){if("function"!=typeof t)throw new Error(oo(4));if(l)throw new Error(oo(5));var e=!0;return c(),s.push(t),function(){if(e){if(l)throw new Error(oo(6));e=!1,c();var i=s.indexOf(t);s.splice(i,1),a=null}}}function d(t){if(!function(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t))throw new Error(oo(7));if(void 0===t.type)throw new Error(oo(8));if(l)throw new Error(oo(9));try{l=!0,n=r(n,t)}finally{l=!1}for(var e=a=s,i=0;i<e.length;i++){(0,e[i])()}return t}return d({type:ao.INIT}),(o={dispatch:d,subscribe:f,getState:h,replaceReducer:function(t){if("function"!=typeof t)throw new Error(oo(10));r=t,d({type:ao.REPLACE})}})[ro]=function(){var t,e=f;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(oo(11));function i(){t.next&&t.next(h())}return i(),{unsubscribe:e(i)}}})[ro]=function(){return this},t},o}function lo(t){for(var e=Object.keys(t),i={},o=0;o<e.length;o++){var r=e[o];"function"==typeof t[r]&&(i[r]=t[r])}var n,a=Object.keys(i);try{!function(t){Object.keys(t).forEach((function(e){var i=t[e];if(void 0===i(void 0,{type:ao.INIT}))throw new Error(oo(12));if(void 0===i(void 0,{type:ao.PROBE_UNKNOWN_ACTION()}))throw new Error(oo(13))}))}(i)}catch(t){n=t}return function(t,e){if(void 0===t&&(t={}),n)throw n;for(var o=!1,r={},s=0;s<a.length;s++){var l=a[s],c=i[l],h=t[l],f=c(h,e);if(void 0===f)throw e&&e.type,new Error(oo(14));r[l]=f,o=o||f!==h}return(o=o||a.length!==Object.keys(t).length)?r:t}}function co(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ho(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return function(t){return function(){var i=t.apply(void 0,arguments),o=function(){throw new Error(oo(15))},r={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},n=e.map((function(t){return t(r)}));return o=co.apply(void 0,n)(i.dispatch),io(io({},i),{},{dispatch:o})}}}function fo(t){return function(e){var i=e.dispatch,o=e.getState;return function(e){return function(r){return"function"==typeof r?r(i,o,t):e(r)}}}}var uo=fo();uo.withExtraArgument=fo;var po,yo=uo,go=(po=function(t,e){return po=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},po(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}po(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),bo=function(t,e){var i,o,r,n,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function s(n){return function(s){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,o&&(r=2&n[0]?o.return:n[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,n[1])).done)return r;switch(o=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){a=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){a.label=n[1];break}if(6===n[0]&&a.label<r[1]){a.label=r[1],r=n;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(n);break}r[2]&&a.ops.pop(),a.trys.pop();continue}n=e.call(t,a)}catch(t){n=[6,t],o=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,s])}}},vo=function(t,e){for(var i=0,o=e.length,r=t.length;i<o;i++,r++)t[r]=e[i];return t},mo=Object.defineProperty,xo=Object.defineProperties,wo=Object.getOwnPropertyDescriptors,Oo=Object.getOwnPropertySymbols,So=Object.prototype.hasOwnProperty,$o=Object.prototype.propertyIsEnumerable,No=function(t,e,i){return e in t?mo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i},Co=function(t,e){for(var i in e||(e={}))So.call(e,i)&&No(t,i,e[i]);if(Oo)for(var o=0,r=Oo(e);o<r.length;o++){i=r[o];$o.call(e,i)&&No(t,i,e[i])}return t},Eo=function(t,e){return xo(t,wo(e))},ko="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?co:co.apply(null,arguments)};var Ro=function(t){function e(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var r=t.apply(this,i)||this;return Object.setPrototypeOf(r,e.prototype),r}return go(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,vo([void 0],t[0].concat(this)))):new(e.bind.apply(e,vo([void 0],t.concat(this))))},e}(Array),Io=function(t){function e(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var r=t.apply(this,i)||this;return Object.setPrototypeOf(r,e.prototype),r}return go(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,vo([void 0],t[0].concat(this)))):new(e.bind.apply(e,vo([void 0],t.concat(this))))},e}(Array);function Uo(t){return oi(t)?Xi(t,(function(){})):t}function Lo(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,i=void 0===e||e;t.immutableCheck,t.serializableCheck;var o=new Ro;i&&(!function(t){return"boolean"==typeof t}(i)?o.push(yo.withExtraArgument(i.extraArgument)):o.push(yo));return o}(t)}}function Ao(t){var e,i=Lo(),o=t||{},r=o.reducer,n=void 0===r?void 0:r,a=o.middleware,s=void 0===a?i():a,l=o.devTools,c=void 0===l||l,h=o.preloadedState,f=void 0===h?void 0:h,d=o.enhancers,u=void 0===d?void 0:d;if("function"==typeof n)e=n;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var i=e;null!==Object.getPrototypeOf(i);)i=Object.getPrototypeOf(i);return e===i}(n))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=lo(n)}var p=s;"function"==typeof p&&(p=p(i));var y=ho.apply(void 0,p),g=co;c&&(g=ko(Co({trace:!1},"object"==typeof c&&c)));var b=new Io(y),v=b;return Array.isArray(u)?v=vo([y],u):"function"==typeof u&&(v=u(b)),so(e,f,g.apply(void 0,v))}function _o(t,e){function i(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(e){var r=e.apply(void 0,i);if(!r)throw new Error("prepareAction did not return an object");return Co(Co({type:t,payload:r.payload},"meta"in r&&{meta:r.meta}),"error"in r&&{error:r.error})}return{type:t,payload:i[0]}}return i.toString=function(){return""+t},i.type=t,i.match=function(e){return e.type===t},i}function To(t){var e,i={},o=[],r={addCase:function(t,e){var o="string"==typeof t?t:t.type;if(o in i)throw new Error("addCase cannot be called with two reducers for the same action type");return i[o]=e,r},addMatcher:function(t,e){return o.push({matcher:t,reducer:e}),r},addDefaultCase:function(t){return e=t,r}};return t(r),[i,o,e]}function Wo(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");var i,o="function"==typeof t.initialState?t.initialState:Uo(t.initialState),r=t.reducers||{},n=Object.keys(r),a={},s={},l={};function c(){var e="function"==typeof t.extraReducers?To(t.extraReducers):[t.extraReducers],i=e[0],r=void 0===i?{}:i,n=e[1],a=void 0===n?[]:n,l=e[2],c=void 0===l?void 0:l,h=Co(Co({},r),s);return function(t,e,i,o){void 0===i&&(i=[]);var r,n="function"==typeof e?To(e):[e,i,o],a=n[0],s=n[1],l=n[2];if(function(t){return"function"==typeof t}(t))r=function(){return Uo(t())};else{var c=Uo(t);r=function(){return c}}function h(t,e){void 0===t&&(t=r());var i=vo([a[e.type]],s.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===i.filter((function(t){return!!t})).length&&(i=[l]),i.reduce((function(t,i){if(i){var o;if(ii(t))return void 0===(o=i(t,e))?t:o;if(oi(t))return Xi(t,(function(t){return i(t,e)}));if(void 0===(o=i(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return o}return t}),t)}return h.getInitialState=r,h}(o,(function(t){for(var e in h)t.addCase(e,h[e]);for(var i=0,o=a;i<o.length;i++){var r=o[i];t.addMatcher(r.matcher,r.reducer)}c&&t.addDefaultCase(c)}))}return n.forEach((function(t){var i,o,n=r[t],c=e+"/"+t;"reducer"in n?(i=n.reducer,o=n.prepare):i=n,a[t]=i,s[c]=i,l[t]=o?_o(c,o):_o(c)})),{name:e,reducer:function(t,e){return i||(i=c()),i(t,e)},actions:l,caseReducers:a,getInitialState:function(){return i||(i=c()),i.getInitialState()}}}var Do=["name","message","stack","code"],Fo=function(t,e){this.payload=t,this.meta=e},Po=function(t,e){this.payload=t,this.meta=e},Mo=function(t){if("object"==typeof t&&null!==t){for(var e={},i=0,o=Do;i<o.length;i++){var r=o[i];"string"==typeof t[r]&&(e[r]=t[r])}return e}return{message:String(t)}};function zo(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,i){var o=_o(t+"/fulfilled",(function(t,e,i,o){return{payload:t,meta:Eo(Co({},o||{}),{arg:i,requestId:e,requestStatus:"fulfilled"})}})),r=_o(t+"/pending",(function(t,e,i){return{payload:void 0,meta:Eo(Co({},i||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),n=_o(t+"/rejected",(function(t,e,o,r,n){return{payload:r,error:(i&&i.serializeError||Mo)(t||"Rejected"),meta:Eo(Co({},n||{}),{arg:o,requestId:e,rejectedWithValue:!!r,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),a="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(s,l,c){var h,f=(null==i?void 0:i.idGenerator)?i.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",i=t;i--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),d=new a;function u(t){h=t,d.abort()}var p=function(){return a=this,p=null,y=function(){var a,p,y,g,b,v;return bo(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),g=null==(a=null==i?void 0:i.condition)?void 0:a.call(i,t,{getState:l,extra:c}),null===(x=g)||"object"!=typeof x||"function"!=typeof x.then?[3,2]:[4,g];case 1:g=m.sent(),m.label=2;case 2:if(!1===g||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,e){return d.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:h||"Aborted"})}))})),s(r(f,t,null==(p=null==i?void 0:i.getPendingMeta)?void 0:p.call(i,{requestId:f,arg:t},{getState:l,extra:c}))),[4,Promise.race([b,Promise.resolve(e(t,{dispatch:s,getState:l,extra:c,requestId:f,signal:d.signal,abort:u,rejectWithValue:function(t,e){return new Fo(t,e)},fulfillWithValue:function(t,e){return new Po(t,e)}})).then((function(e){if(e instanceof Fo)throw e;return e instanceof Po?o(e.payload,f,t,e.meta):o(e,f,t)}))])];case 3:return y=m.sent(),[3,5];case 4:return v=m.sent(),y=v instanceof Fo?n(null,f,t,v.payload,v.meta):n(v,f,t),[3,5];case 5:return i&&!i.dispatchConditionRejection&&n.match(y)&&y.meta.condition||s(y),[2,y]}var x}))},new Promise((function(t,e){var i=function(t){try{r(y.next(t))}catch(t){e(t)}},o=function(t){try{r(y.throw(t))}catch(t){e(t)}},r=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(i,o)};r((y=y.apply(a,p)).next())}));var a,p,y}();return Object.assign(p,{abort:u,requestId:f,arg:t,unwrap:function(){return p.then(zo)}})}}),{pending:r,rejected:n,fulfilled:o,typePrefix:t})}t.withTypes=function(){return t}}();var jo="listenerMiddleware";_o(jo+"/add"),_o(jo+"/removeAll"),_o(jo+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var i=r[t];return i?i.enumerable=e:r[t]=i={configurable:!0,enumerable:e,get:function(){var e=this[ji];return Gi.get(e,t)},set:function(e){var i=this[ji];Gi.set(i,t,e)}},i}function e(t){for(var e=t.length-1;e>=0;e--){var r=t[e][ji];if(!r.P)switch(r.i){case 5:o(r)&&Ri(r);break;case 4:i(r)&&Ri(r)}}}function i(t){for(var e=t.t,i=t.k,o=Ki(i),r=o.length-1;r>=0;r--){var n=o[r];if(n!==ji){var a=e[n];if(void 0===a&&!ai(e,n))return!0;var s=i[n],l=s&&s[ji];if(l?l.t!==a:!li(s,a))return!0}}var c=!!e[ji];return o.length!==Ki(e).length+(c?0:1)}function o(t){var e=t.k;if(e.length!==t.t.length)return!0;var i=Object.getOwnPropertyDescriptor(e,e.length-1);if(i&&!i.get)return!0;for(var o=0;o<e.length;o++)if(!e.hasOwnProperty(o))return!0;return!1}var r={};!function(t,e){Hi[t]||(Hi[t]=e)}("ES5",{J:function(e,i){var o=Array.isArray(e),r=function(e,i){if(e){for(var o=Array(i.length),r=0;r<i.length;r++)Object.defineProperty(o,""+r,t(r,!0));return o}var n=Zi(i);delete n[ji];for(var a=Ki(n),s=0;s<a.length;s++){var l=a[s];n[l]=t(l,e||!!n[l].enumerable)}return Object.create(Object.getPrototypeOf(i),n)}(o,e),n={i:o?5:4,A:i?i.A:bi(),P:!1,I:!1,R:{},l:i,t:e,k:r,o:null,g:!1,C:!1};return Object.defineProperty(r,ji,{value:n,writable:!0}),r},S:function(t,i,r){r?ii(i)&&i[ji].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var i=e[ji];if(i){var r=i.t,n=i.k,a=i.R,s=i.i;if(4===s)ri(n,(function(e){e!==ji&&(void 0!==r[e]||ai(r,e)?a[e]||t(n[e]):(a[e]=!0,Ri(i)))})),ri(r,(function(t){void 0!==n[t]||ai(n,t)||(a[t]=!1,Ri(i))}));else if(5===s){if(o(i)&&(Ri(i),a.length=!0),n.length<r.length)for(var l=n.length;l<r.length;l++)a[l]=!1;else for(var c=r.length;c<n.length;c++)a[c]=!0;for(var h=Math.min(n.length,r.length),f=0;f<h;f++)n.hasOwnProperty(f)||(a[f]=!0),void 0===a[f]&&t(n[f])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?i(t):o(t)}})}(),window.ftReduxStores||(window.ftReduxStores={});class Bo{static get(t){var e;const i="string"==typeof t?t:t.name,o="string"==typeof t?void 0:t,r=window.ftReduxStores[i];if(Ge(r))return r;if(null==o)return;const n=Wo({...o,reducers:null!==(e=o.reducers)&&void 0!==e?e:{}}),a=Ao({reducer:(t,e)=>{var i;switch(e.type){case"CLEAR_FT_REDUX_STORE":return n.getInitialState();case"DEFAULT_STATE_FIELDS_VALUES_SETTER":return{...t,...null!==(i=e.overwrites)&&void 0!==i?i:{}};default:return n.reducer(t,e)}}});return window.ftReduxStores[o.name]=new Bo(n,a)}constructor(t,e){this.reduxSlice=t,this.reduxStore=e,this.isFtReduxStore=!0,this.eventBus=document.createElement("event-bus"),this.actions=new Proxy(this.reduxSlice.actions,{get:(t,e,i)=>{const o=e,r=t[o];return r?(...t)=>{const e=r(...t);return this.reduxStore.dispatch(e),e}:t=>{this.setState({[o]:t})}}})}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE"})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_STATE_FIELDS_VALUES_SETTER",overwrites:t})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}}const Ko=t=>{const e=null!=t?t:{};return(t,i)=>{var o;const r={hasChanged:(t,e)=>!_(t,e),attribute:!1,...e};k(r)(t,i);const n=t;n.reduxProperties=n.reduxProperties||new Map,n.reduxProperties.set(i,{selector:null!==(o=e.selector)&&void 0!==o?o:t=>t[i],store:e.store})}},Zo=Symbol("elementInternals");function Ho(t,e){return class extends t{static get formAssociated(){return!0}get form(){return this[Zo].form}constructor(...t){super(t),this[Zo]=this.attachInternals(),this[Zo].role=e}setFormValue(t){this[Zo].setFormValue(t)}}}var Go,Vo,qo;const Yo=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(qo=null===(Vo=null===(Go=window.safari)||void 0===Go?void 0:Go.pushNotification)||void 0===Vo?void 0:Vo.toString())&&void 0!==qo?qo:"");var Xo;!function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"}(Xo||(Xo={}));var Jo=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Qo extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}const tr=Symbol("registerInterval");class er extends(function(t){var e;class i extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this[tr]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[tr]):this.dispatchEvent(new Qo)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=tr,Jo([R()],i.prototype,"stateManager",void 0),i}(ti)){}const ir=Ee.extend("--ft-ripple-color","",Ae.colorContent),or={color:ir,backgroundColor:Ee.extend("--ft-ripple-background-color","",ir),opacityContentOnSurfacePressed:Ee.external(Ae.opacityContentOnSurfacePressed,"Design system"),opacityContentOnSurfaceHover:Ee.external(Ae.opacityContentOnSurfaceHover,"Design system"),opacityContentOnSurfaceFocused:Ee.external(Ae.opacityContentOnSurfaceFocused,"Design system"),opacityContentOnSurfaceSelected:Ee.external(Ae.opacityContentOnSurfaceSelected,"Design system"),borderRadius:Ee.create("--ft-ripple-border-radius","","SIZE","0px")},rr=Ee.extend("--ft-ripple-color","",Ae.colorPrimary),nr=rr,ar=Ee.extend("--ft-ripple-background-color","",rr),sr=Ee.extend("--ft-ripple-color","",Ae.colorSecondary),lr=sr,cr=Ee.extend("--ft-ripple-background-color","",sr),hr=Et`
|
|
123
123
|
:host {
|
|
124
124
|
display: contents;
|
|
125
125
|
}
|
|
@@ -1716,7 +1716,7 @@ const{D:za}=mt,ja=()=>document.createComment(""),Ba=(t,e,i)=>{const o=t._$AA.par
|
|
|
1716
1716
|
<slot></slot>
|
|
1717
1717
|
</ft-typography>
|
|
1718
1718
|
</div>
|
|
1719
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new Ps(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Ms.elementDefinitions={"ft-ripple":ba,"ft-typography":Vn,"ft-icon":na},Ms.styles=Ds,Fs([k()],Ms.prototype,"value",void 0),Fs([U(".ft-text-field-suggestion")],Ms.prototype,"container",void 0),Fs([L()],Ms.prototype,"assignedNodes",void 0),T("ft-text-field")(Ws),T("ft-text-field-suggestion")(Ms);class zs{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),h=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,h[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class js{convertPaginatedToc(t){return new zs(t).build()}}class Bs{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return Mn(null!==(e=null===(t=ns.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=ns.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case Xo.FEEDBACK:return Mn(null!=e?e:[],Dn.FEEDBACK_USER);case Xo.RATING:return Mn(null!=e?e:[],Dn.RATING_USER)&&null!=i&&i!==En.NO_RATING;case Xo.PRINT:return Mn(null!=e?e:[],Dn.PRINT_USER);case Xo.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case Xo.COLLECTIONS:return Mn(null!=e?e:[],Dn.COLLECTION_USER);default:return!1}}}class Ks extends Bs{static async build(t){return new Ks(new js,await as.await(),new o,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){var e;const i=await this.api.getMap(t);return this.fingerprint=null===(e=i.lastPublication)||void 0===e?void 0:e.replace(/\D/g,""),i}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Zs{static build(t,e){return new Zs((t=>Bo.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0}}))(t.trim()||"context"),null!=e?e:Ks.build)}constructor(t,e){this.store=t,this.reloadDebouncer=new r(10),this.initService(e)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await A(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e||this.errorHandler(t)}}}const Hs=Et`
|
|
1719
|
+
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new Ps(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Ms.elementDefinitions={"ft-ripple":ba,"ft-typography":Vn,"ft-icon":na},Ms.styles=Ds,Fs([k()],Ms.prototype,"value",void 0),Fs([U(".ft-text-field-suggestion")],Ms.prototype,"container",void 0),Fs([L()],Ms.prototype,"assignedNodes",void 0),T("ft-text-field")(Ws),T("ft-text-field-suggestion")(Ms);class zs{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),h=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,h[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class js{convertPaginatedToc(t){return new zs(t).build()}}class Bs{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return Mn(null!==(e=null===(t=ns.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=ns.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case Xo.FEEDBACK:return Mn(null!=e?e:[],Dn.FEEDBACK_USER);case Xo.RATING:return Mn(null!=e?e:[],Dn.RATING_USER)&&null!=i&&i!==En.NO_RATING;case Xo.PRINT:return Mn(null!=e?e:[],Dn.PRINT_USER);case Xo.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case Xo.COLLECTIONS:return Mn(null!=e?e:[],Dn.COLLECTION_USER);case Xo.PERSONAL_BOOKS:return Mn(null!=e?e:[],Dn.PERSONAL_BOOK_USER);default:return!1}}}class Ks extends Bs{static async build(t){return new Ks(new js,await as.await(),new o,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){var e;const i=await this.api.getMap(t);return this.fingerprint=null===(e=i.lastPublication)||void 0===e?void 0:e.replace(/\D/g,""),i}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Zs{static build(t,e){return new Zs((t=>Bo.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0}}))(t.trim()||"context"),null!=e?e:Ks.build)}constructor(t,e){this.store=t,this.reloadDebouncer=new r(10),this.initService(e)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await A(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e||this.errorHandler(t)}}}const Hs=Et`
|
|
1720
1720
|
`;class Gs extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Vs extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class qs extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class Ys extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class Xs extends Event{constructor(){super("ft-reader-map-not-found")}}class Js extends Event{constructor(){super("ft-reader-map-unauthorized")}}var Qs=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class tl extends ti{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new r(5),this.navigationDebouncer=new r(10),this.addStore(ns)}render(){return ce`
|
|
1721
1721
|
${this.importStyleIfNeeded()}
|
|
1722
1722
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-feedback",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Feedback forms for a map and its topics in an integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-app-context": "1.1.
|
|
23
|
-
"@fluid-topics/ft-reader-context": "1.1.
|
|
24
|
-
"@fluid-topics/ft-wc-utils": "1.1.
|
|
22
|
+
"@fluid-topics/ft-app-context": "1.1.1",
|
|
23
|
+
"@fluid-topics/ft-reader-context": "1.1.1",
|
|
24
|
+
"@fluid-topics/ft-wc-utils": "1.1.1",
|
|
25
25
|
"lit": "3.1.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@fluid-topics/public-api": "1.0.
|
|
28
|
+
"@fluid-topics/public-api": "1.0.51"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "ceae4aed142c27cbf6034f45bb6e3f562163cc15"
|
|
31
31
|
}
|