@fluid-topics/ft-reader-content 0.3.7

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.
package/README.md ADDED
@@ -0,0 +1,19 @@
1
+ Main content for integrated reader
2
+
3
+ ## Install
4
+
5
+ ```shell
6
+ npm install @fluid-topics/ft-reader-content
7
+ yarn add @fluid-topics/ft-reader-content
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ ```typescript
13
+ import { html } from "lit"
14
+ import "@fluid-topics/ft-reader-content"
15
+
16
+ function render() {
17
+ return html` <ft-reader-content></ft-reader-content> `
18
+ }
19
+ ```
@@ -0,0 +1,22 @@
1
+ import { TemplateResult } from "lit";
2
+ import { ElementDefinitionsMap } from "@fluid-topics/ft-wc-utils";
3
+ import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
4
+ import "@fluid-topics/ft-reader-topic";
5
+ export interface FtReaderContentProperties {
6
+ }
7
+ export declare const FtReaderContentCssVariables: {};
8
+ export declare class FtReaderContent extends FtReaderComponent implements FtReaderContentProperties {
9
+ static elementDefinitions: ElementDefinitionsMap;
10
+ static styles: import("lit").CSSResult;
11
+ renderTopic: (tocId: any, index: number) => TemplateResult | string;
12
+ private currentPage?;
13
+ private scrollTarget?;
14
+ private visibleTopics?;
15
+ private container;
16
+ protected render(): TemplateResult<1>;
17
+ private getScrollTarget;
18
+ private visibleTopicsDebouncer;
19
+ private visibleTopicChange;
20
+ private onScrollDone;
21
+ }
22
+ //# sourceMappingURL=ft-reader-content.d.ts.map
@@ -0,0 +1,77 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { css, html } from "lit";
8
+ import { property, query } from "lit/decorators.js";
9
+ import { Debouncer, redux } from "@fluid-topics/ft-wc-utils";
10
+ import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
11
+ import "@fluid-topics/ft-reader-topic";
12
+ import { FtInfiniteScroll } from "@fluid-topics/ft-infinite-scroll";
13
+ export const FtReaderContentCssVariables = {};
14
+ export class FtReaderContent extends FtReaderComponent {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.renderTopic = (tocId) => html `
18
+ <ft-reader-topic tocId="${tocId}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
19
+ `;
20
+ this.visibleTopicsDebouncer = new Debouncer(100);
21
+ }
22
+ render() {
23
+ var _a;
24
+ return html `
25
+ <ft-infinite-scroll class="ft-reader-content"
26
+ .items=${((_a = this.currentPage) === null || _a === void 0 ? void 0 : _a.topics) || []}
27
+ .renderItem=${this.renderTopic}
28
+ .scrollToItem=${this.getScrollTarget()}
29
+ exportpartsPrefix="scroller"
30
+ @visible-items-change=${this.visibleTopicChange}
31
+ @scrolled-to-target=${this.onScrollDone}
32
+ >
33
+
34
+ </ft-infinite-scroll>
35
+ `;
36
+ }
37
+ getScrollTarget() {
38
+ var _a, _b, _c, _d, _e;
39
+ // If there's a section specified and the target topic is visible, the topic itself will handle the scroll
40
+ const isVisible = (_d = (_a = this.visibleTopics) === null || _a === void 0 ? void 0 : _a.includes((_c = (_b = this.scrollTarget) === null || _b === void 0 ? void 0 : _b.tocId) !== null && _c !== void 0 ? _c : "")) !== null && _d !== void 0 ? _d : false;
41
+ if (((_e = this.scrollTarget) === null || _e === void 0 ? void 0 : _e.tocId) && (!isVisible || this.scrollTarget.section == null)) {
42
+ return this.scrollTarget.tocId;
43
+ }
44
+ return null;
45
+ }
46
+ visibleTopicChange(event) {
47
+ this.visibleTopicsDebouncer.run(() => { var _a; return (_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.setVisibleTopics(event.detail.visibleItems); });
48
+ }
49
+ onScrollDone() {
50
+ var _a, _b;
51
+ if (((_a = this.scrollTarget) === null || _a === void 0 ? void 0 : _a.section) == null) {
52
+ (_b = this.stateManager) === null || _b === void 0 ? void 0 : _b.scrollDone();
53
+ }
54
+ }
55
+ }
56
+ FtReaderContent.elementDefinitions = {
57
+ "ft-infinite-scroll": FtInfiniteScroll
58
+ };
59
+ // language=CSS
60
+ FtReaderContent.styles = css `
61
+ `;
62
+ __decorate([
63
+ property()
64
+ ], FtReaderContent.prototype, "renderTopic", void 0);
65
+ __decorate([
66
+ redux()
67
+ ], FtReaderContent.prototype, "currentPage", void 0);
68
+ __decorate([
69
+ redux()
70
+ ], FtReaderContent.prototype, "scrollTarget", void 0);
71
+ __decorate([
72
+ redux()
73
+ ], FtReaderContent.prototype, "visibleTopics", void 0);
74
+ __decorate([
75
+ query(".ft-reader-content")
76
+ ], FtReaderContent.prototype, "container", void 0);
77
+ //# sourceMappingURL=ft-reader-content.js.map
@@ -0,0 +1,262 @@
1
+ !function(t,i,e,o,s,n,r){var l=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class h extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class a extends i.FtLitElementRedux{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new h)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}l([o.state()],a.prototype,"stateManager",void 0);const f=i.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),p=i.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),d=i.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),c=i.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),y=i.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),g=i.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),v=i.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),u=i.FtCssVariableFactory.external(i.designSystemVariables.borderRadiusM,"Design system");class b extends i.FtLitElement{render(){return e.html`
2
+ `}}
3
+ /**
4
+ * @license
5
+ * Copyright 2017 Google LLC
6
+ * SPDX-License-Identifier: BSD-3-Clause
7
+ */
8
+ var $;b.elementDefinitions={},b.styles=e.css`
9
+ :host {
10
+ width: ${p};
11
+ height: ${d};
12
+ display: ${f};
13
+ overflow: hidden;
14
+ border-radius: ${u};
15
+ background: linear-gradient(
16
+ 90deg,
17
+ transparent,
18
+ ${g} calc(0.45 * ${y}),
19
+ ${g} calc(0.55 * ${y}),
20
+ transparent ${y}
21
+ ), ${c};
22
+ background-repeat: repeat-y;
23
+ background-size: 100vw 100vh;
24
+ background-attachment: fixed;
25
+ background-position: calc(${y} * -1) 0;
26
+ animation: shine ${v} infinite;
27
+ animation-timing-function: linear;
28
+ }
29
+
30
+ @keyframes shine {
31
+ to {
32
+ background-position: calc(100vw + ${y}) 0, calc(${y} * -1) 0;
33
+ }
34
+ }
35
+ `,i.customElement("ft-skeleton")(b);const m=globalThis.trustedTypes,x=m?m.createPolicy("lit-html",{createHTML:t=>t}):void 0,w=`lit$${(Math.random()+"").slice(9)}$`,k="?"+w,I=`<${k}>`,z=document,S=(t="")=>z.createComment(t),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,O=Array.isArray,N=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,C=/>/g,j=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),E=/'/g,_=/"/g,M=/^(?:script|style|textarea|title)$/i,P=(t=>(i,...e)=>({_$litType$:t,strings:i,values:e}))(1),U=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),Z=new WeakMap,W=z.createTreeWalker(z,129,null,!1),G=(t,i)=>{const e=t.length-1,o=[];let s,n=2===i?"<svg>":"",r=N;for(let i=0;i<e;i++){const e=t[i];let l,h,a=-1,f=0;for(;f<e.length&&(r.lastIndex=f,h=r.exec(e),null!==h);)f=r.lastIndex,r===N?"!--"===h[1]?r=A:void 0!==h[1]?r=C:void 0!==h[2]?(M.test(h[2])&&(s=RegExp("</"+h[2],"g")),r=j):void 0!==h[3]&&(r=j):r===j?">"===h[0]?(r=null!=s?s:N,a=-1):void 0===h[1]?a=-2:(a=r.lastIndex-h[2].length,l=h[1],r=void 0===h[3]?j:'"'===h[3]?_:E):r===_||r===E?r=j:r===A||r===C?r=N:(r=j,s=void 0);const p=r===j&&t[i+1].startsWith("/>")?" ":"";n+=r===N?e+I:a>=0?(o.push(l),e.slice(0,a)+"$lit$"+e.slice(a)+w+p):e+w+(-2===a?(o.push(void 0),i):p)}const l=n+(t[e]||"<?>")+(2===i?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==x?x.createHTML(l):l,o]};class L{constructor({strings:t,_$litType$:i},e){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[h,a]=G(t,i);if(this.el=L.createElement(h,e),W.currentNode=this.el.content,2===i){const t=this.el.content,i=t.firstChild;i.remove(),t.append(...i.childNodes)}for(;null!==(o=W.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const i of o.getAttributeNames())if(i.endsWith("$lit$")||i.startsWith(w)){const e=a[n++];if(t.push(i),void 0!==e){const t=o.getAttribute(e.toLowerCase()+"$lit$").split(w),i=/([.?@])?(.*)/.exec(e);l.push({type:1,index:s,name:i[2],strings:t,ctor:"."===i[1]?H:"?"===i[1]?q:"@"===i[1]?J:F})}else l.push({type:6,index:s})}for(const i of t)o.removeAttribute(i)}if(M.test(o.tagName)){const t=o.textContent.split(w),i=t.length-1;if(i>0){o.textContent=m?m.emptyScript:"";for(let e=0;e<i;e++)o.append(t[e],S()),W.nextNode(),l.push({type:2,index:++s});o.append(t[i],S())}}}else if(8===o.nodeType)if(o.data===k)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(w,t+1));)l.push({type:7,index:s}),t+=w.length-1}s++}}static createElement(t,i){const e=z.createElement("template");return e.innerHTML=t,e}}function B(t,i,e=t,o){var s,n,r,l;if(i===U)return i;let h=void 0!==o?null===(s=e._$Cl)||void 0===s?void 0:s[o]:e._$Cu;const a=T(i)?void 0:i._$litDirective$;return(null==h?void 0:h.constructor)!==a&&(null===(n=null==h?void 0:h._$AO)||void 0===n||n.call(h,!1),void 0===a?h=void 0:(h=new a(t),h._$AT(t,e,o)),void 0!==o?(null!==(r=(l=e)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=h:e._$Cu=h),void 0!==h&&(i=B(t,h._$AS(t,i.values),h,o)),i}class D{constructor(t,i){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var i;const{el:{content:e},parts:o}=this._$AD,s=(null!==(i=null==t?void 0:t.creationScope)&&void 0!==i?i:z).importNode(e,!0);W.currentNode=s;let n=W.nextNode(),r=0,l=0,h=o[0];for(;void 0!==h;){if(r===h.index){let i;2===h.type?i=new K(n,n.nextSibling,this,t):1===h.type?i=new h.ctor(n,h.name,h.strings,this,t):6===h.type&&(i=new Q(n,this,t)),this.v.push(i),h=o[++l]}r!==(null==h?void 0:h.index)&&(n=W.nextNode(),r++)}return s}m(t){let i=0;for(const e of this.v)void 0!==e&&(void 0!==e.strings?(e._$AI(t,e,i),i+=e.strings.length-2):e._$AI(t[i])),i++}}class K{constructor(t,i,e,o){var s;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=e,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,i;return null!==(i=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==i?i:this._$C_}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=B(this,t,i),T(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==U&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):(t=>O(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.S(t):this.T(t)}j(t,i=this._$AB){return this._$AA.parentNode.insertBefore(t,i)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==R&&T(this._$AH)?this._$AA.nextSibling.data=t:this.k(z.createTextNode(t)),this._$AH=t}$(t){var i;const{values:e,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=L.createElement(o.h,this.options)),o);if((null===(i=this._$AH)||void 0===i?void 0:i._$AD)===s)this._$AH.m(e);else{const t=new D(s,this),i=t.p(this.options);t.m(e),this.k(i),this._$AH=t}}_$AC(t){let i=Z.get(t.strings);return void 0===i&&Z.set(t.strings,i=new L(t)),i}S(t){O(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let e,o=0;for(const s of t)o===i.length?i.push(e=new K(this.j(S()),this.j(S()),this,this.options)):e=i[o],e._$AI(s),o++;o<i.length&&(this._$AR(e&&e._$AB.nextSibling,o),i.length=o)}_$AR(t=this._$AA.nextSibling,i){var e;for(null===(e=this._$AP)||void 0===e||e.call(this,!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i}}setConnected(t){var i;void 0===this._$AM&&(this._$C_=t,null===(i=this._$AP)||void 0===i||i.call(this,t))}}class F{constructor(t,i,e,o,s){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=i,this._$AM=o,this.options=s,e.length>2||""!==e[0]||""!==e[1]?(this._$AH=Array(e.length-1).fill(new String),this.strings=e):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,i=this,e,o){const s=this.strings;let n=!1;if(void 0===s)t=B(this,t,i,0),n=!T(t)||t!==this._$AH&&t!==U,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=B(this,o[e+r],i,r),l===U&&(l=this._$AH[r]),n||(n=!T(l)||l!==this._$AH[r]),l===R?t=R:t!==R&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class H extends F{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===R?void 0:t}}const Y=m?m.emptyScript:"";class q extends F{constructor(){super(...arguments),this.type=4}P(t){t&&t!==R?this.element.setAttribute(this.name,Y):this.element.removeAttribute(this.name)}}class J extends F{constructor(t,i,e,o,s){super(t,i,e,o,s),this.type=5}_$AI(t,i=this){var e;if((t=null!==(e=B(this,t,i,0))&&void 0!==e?e:R)===U)return;const o=this._$AH,s=t===R&&o!==R||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==R&&(o===R||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var i,e;"function"==typeof this._$AH?this._$AH.call(null!==(e=null===(i=this.options)||void 0===i?void 0:i.host)&&void 0!==e?e:this.element,t):this._$AH.handleEvent(t)}}class Q{constructor(t,i,e){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=e}get _$AU(){return this._$AM._$AU}_$AI(t){B(this,t)}}const V=window.litHtmlPolyfillSupport;null==V||V(L,K),(null!==($=globalThis.litHtmlVersions)&&void 0!==$?$:globalThis.litHtmlVersions=[]).push("2.2.7");
36
+ /**
37
+ * @license
38
+ * Copyright 2020 Google LLC
39
+ * SPDX-License-Identifier: BSD-3-Clause
40
+ */
41
+ const X=Symbol.for(""),tt=t=>{if((null==t?void 0:t.r)===X)return null==t?void 0:t._$litStatic$},it=t=>({_$litStatic$:t,r:X}),et=new Map,ot=(t=>(i,...e)=>{const o=e.length;let s,n;const r=[],l=[];let h,a=0,f=!1;for(;a<o;){for(h=i[a];a<o&&void 0!==(n=e[a],s=tt(n));)h+=s+i[++a],f=!0;l.push(n),r.push(h),a++}if(a===o&&r.push(i[o]),f){const t=r.join("$$lit$$");void 0===(i=et.get(t))&&(r.raw=r,et.set(t,i=r)),e=l}return t(i,...e)})(P);var st,nt=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(st||(st={}));const rt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.titleFont),lt=i.FtCssVariableFactory.extend("--ft-typography-font-family",i.designSystemVariables.contentFont),ht={fontFamily:lt,fontSize:i.FtCssVariableFactory.create("--ft-typography-font-size","SIZE","16px"),fontWeight:i.FtCssVariableFactory.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:i.FtCssVariableFactory.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:i.FtCssVariableFactory.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:i.FtCssVariableFactory.create("--ft-typography-text-transform","UNKNOWN","inherit")},at=i.FtCssVariableFactory.extend("--ft-typography-title-font-family",rt),ft=i.FtCssVariableFactory.extend("--ft-typography-title-font-size",ht.fontSize,"20px"),pt=i.FtCssVariableFactory.extend("--ft-typography-title-font-weight",ht.fontWeight,"normal"),dt=i.FtCssVariableFactory.extend("--ft-typography-title-letter-spacing",ht.letterSpacing,"0.15px"),ct=i.FtCssVariableFactory.extend("--ft-typography-title-line-height",ht.lineHeight,"1.2"),yt=i.FtCssVariableFactory.extend("--ft-typography-title-text-transform",ht.textTransform,"inherit"),gt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-family",rt),vt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-size",ht.fontSize,"14px"),ut=i.FtCssVariableFactory.extend("--ft-typography-title-dense-font-weight",ht.fontWeight,"normal"),bt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-letter-spacing",ht.letterSpacing,"0.105px"),$t=i.FtCssVariableFactory.extend("--ft-typography-title-dense-line-height",ht.lineHeight,"1.7"),mt=i.FtCssVariableFactory.extend("--ft-typography-title-dense-text-transform",ht.textTransform,"inherit"),xt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-family",lt),wt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-size",ht.fontSize,"16px"),kt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-font-weight",ht.fontWeight,"600"),It=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-letter-spacing",ht.letterSpacing,"0.144px"),zt=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-line-height",ht.lineHeight,"1.5"),St=i.FtCssVariableFactory.extend("--ft-typography-subtitle1-text-transform",ht.textTransform,"inherit"),Tt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-family",lt),Ot=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-size",ht.fontSize,"14px"),Nt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-font-weight",ht.fontWeight,"normal"),At=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-letter-spacing",ht.letterSpacing,"0.098px"),Ct=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-line-height",ht.lineHeight,"1.7"),jt=i.FtCssVariableFactory.extend("--ft-typography-subtitle2-text-transform",ht.textTransform,"inherit"),Et=i.FtCssVariableFactory.extend("--ft-typography-body1-font-family",lt),_t=i.FtCssVariableFactory.extend("--ft-typography-body1-font-size",ht.fontSize,"16px"),Mt=i.FtCssVariableFactory.extend("--ft-typography-body1-font-weight",ht.fontWeight,"normal"),Pt=i.FtCssVariableFactory.extend("--ft-typography-body1-letter-spacing",ht.letterSpacing,"0.496px"),Ut=i.FtCssVariableFactory.extend("--ft-typography-body1-line-height",ht.lineHeight,"1.5"),Rt=i.FtCssVariableFactory.extend("--ft-typography-body1-text-transform",ht.textTransform,"inherit"),Zt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-family",lt),Wt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-size",ht.fontSize,"14px"),Gt=i.FtCssVariableFactory.extend("--ft-typography-body2-font-weight",ht.fontWeight,"normal"),Lt=i.FtCssVariableFactory.extend("--ft-typography-body2-letter-spacing",ht.letterSpacing,"0.252px"),Bt=i.FtCssVariableFactory.extend("--ft-typography-body2-line-height",ht.lineHeight,"1.4"),Dt=i.FtCssVariableFactory.extend("--ft-typography-body2-text-transform",ht.textTransform,"inherit"),Kt=i.FtCssVariableFactory.extend("--ft-typography-caption-font-family",lt),Ft=i.FtCssVariableFactory.extend("--ft-typography-caption-font-size",ht.fontSize,"12px"),Ht=i.FtCssVariableFactory.extend("--ft-typography-caption-font-weight",ht.fontWeight,"normal"),Yt=i.FtCssVariableFactory.extend("--ft-typography-caption-letter-spacing",ht.letterSpacing,"0.396px"),qt=i.FtCssVariableFactory.extend("--ft-typography-caption-line-height",ht.lineHeight,"1.33"),Jt=i.FtCssVariableFactory.extend("--ft-typography-caption-text-transform",ht.textTransform,"inherit"),Qt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-family",lt),Vt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-size",ht.fontSize,"10px"),Xt=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-font-weight",ht.fontWeight,"normal"),ti=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-letter-spacing",ht.letterSpacing,"0.33px"),ii=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-line-height",ht.lineHeight,"1.6"),ei=i.FtCssVariableFactory.extend("--ft-typography-breadcrumb-text-transform",ht.textTransform,"inherit"),oi=i.FtCssVariableFactory.extend("--ft-typography-overline-font-family",lt),si=i.FtCssVariableFactory.extend("--ft-typography-overline-font-size",ht.fontSize,"10px"),ni=i.FtCssVariableFactory.extend("--ft-typography-overline-font-weight",ht.fontWeight,"normal"),ri=i.FtCssVariableFactory.extend("--ft-typography-overline-letter-spacing",ht.letterSpacing,"1.5px"),li=i.FtCssVariableFactory.extend("--ft-typography-overline-line-height",ht.lineHeight,"1.6"),hi=i.FtCssVariableFactory.extend("--ft-typography-overline-text-transform",ht.textTransform,"uppercase"),ai=i.FtCssVariableFactory.extend("--ft-typography-button-font-family",lt),fi=i.FtCssVariableFactory.extend("--ft-typography-button-font-size",ht.fontSize,"14px"),pi=i.FtCssVariableFactory.extend("--ft-typography-button-font-weight",ht.fontWeight,"600"),di=i.FtCssVariableFactory.extend("--ft-typography-button-letter-spacing",ht.letterSpacing,"1.246px"),ci=i.FtCssVariableFactory.extend("--ft-typography-button-line-height",ht.lineHeight,"1.15"),yi=i.FtCssVariableFactory.extend("--ft-typography-button-text-transform",ht.textTransform,"uppercase"),gi=e.css`
42
+ .ft-typography--title {
43
+ font-family: ${at};
44
+ font-size: ${ft};
45
+ font-weight: ${pt};
46
+ letter-spacing: ${dt};
47
+ line-height: ${ct};
48
+ text-transform: ${yt};
49
+ }
50
+ `,vi=e.css`
51
+ .ft-typography--title-dense {
52
+ font-family: ${gt};
53
+ font-size: ${vt};
54
+ font-weight: ${ut};
55
+ letter-spacing: ${bt};
56
+ line-height: ${$t};
57
+ text-transform: ${mt};
58
+ }
59
+ `,ui=e.css`
60
+ .ft-typography--subtitle1 {
61
+ font-family: ${xt};
62
+ font-size: ${wt};
63
+ font-weight: ${kt};
64
+ letter-spacing: ${It};
65
+ line-height: ${zt};
66
+ text-transform: ${St};
67
+ }
68
+ `,bi=e.css`
69
+ .ft-typography--subtitle2 {
70
+ font-family: ${Tt};
71
+ font-size: ${Ot};
72
+ font-weight: ${Nt};
73
+ letter-spacing: ${At};
74
+ line-height: ${Ct};
75
+ text-transform: ${jt};
76
+ }
77
+
78
+ `,$i=e.css`
79
+ .ft-typography--body1 {
80
+ font-family: ${Et};
81
+ font-size: ${_t};
82
+ font-weight: ${Mt};
83
+ letter-spacing: ${Pt};
84
+ line-height: ${Ut};
85
+ text-transform: ${Rt};
86
+ }
87
+ `,mi=e.css`
88
+ .ft-typography--body2 {
89
+ font-family: ${Zt};
90
+ font-size: ${Wt};
91
+ font-weight: ${Gt};
92
+ letter-spacing: ${Lt};
93
+ line-height: ${Bt};
94
+ text-transform: ${Dt};
95
+ }
96
+ `,xi=e.css`
97
+ .ft-typography--caption {
98
+ font-family: ${Kt};
99
+ font-size: ${Ft};
100
+ font-weight: ${Ht};
101
+ letter-spacing: ${Yt};
102
+ line-height: ${qt};
103
+ text-transform: ${Jt};
104
+ }
105
+ `,wi=e.css`
106
+ .ft-typography--breadcrumb {
107
+ font-family: ${Qt};
108
+ font-size: ${Vt};
109
+ font-weight: ${Xt};
110
+ letter-spacing: ${ti};
111
+ line-height: ${ii};
112
+ text-transform: ${ei};
113
+ }
114
+ `,ki=e.css`
115
+ .ft-typography--overline {
116
+ font-family: ${oi};
117
+ font-size: ${si};
118
+ font-weight: ${ni};
119
+ letter-spacing: ${ri};
120
+ line-height: ${li};
121
+ text-transform: ${hi};
122
+ }
123
+ `,Ii=e.css`
124
+ .ft-typography--button {
125
+ font-family: ${ai};
126
+ font-size: ${fi};
127
+ font-weight: ${pi};
128
+ letter-spacing: ${di};
129
+ line-height: ${ci};
130
+ text-transform: ${yi};
131
+ }
132
+ `;class zi extends i.FtLitElement{constructor(){super(...arguments),this.variant=st.body1}render(){return this.element?ot`
133
+ <${it(this.element)}
134
+ class="ft-typography ft-typography--${this.variant}">
135
+ <slot></slot>
136
+ </${it(this.element)}>
137
+ `:ot`
138
+ <slot class="ft-typography ft-typography--${this.variant}"></slot>
139
+ `}}zi.styles=[gi,vi,ui,bi,$i,mi,xi,wi,ki,Ii,e.css`
140
+ .ft-typography {
141
+ vertical-align: inherit;
142
+ }
143
+ `],nt([o.property()],zi.prototype,"element",void 0),nt([o.property()],zi.prototype,"variant",void 0),i.customElement("ft-typography")(zi);var Si=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ti extends a{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let i=n.classMap({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return e.html`
144
+ <a class=${i}
145
+ href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
146
+ @click=${t=>this.onClick(t)}>
147
+ <slot></slot>
148
+ </a>
149
+ `}onClick(t){var i;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(i=this.stateManager)||void 0===i||i.navigateToTopic(this.tocId,this.section)))}}Ti.styles=e.css`
150
+ .ft-reader-link--remove-style {
151
+ text-decoration: none;
152
+ color: inherit;
153
+ }
154
+ `,Si([o.property()],Ti.prototype,"tocId",void 0),Si([o.property()],Ti.prototype,"section",void 0),Si([o.property()],Ti.prototype,"pageNumber",void 0),Si([o.property({type:Boolean})],Ti.prototype,"removeStyle",void 0),i.customElement("ft-reader-internal-link")(Ti);var Oi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Ni extends a{constructor(){super(...arguments),this.tocId=""}render(){var t,i,o,n;const r=null!==(i=null===(t=this.tocNode)||void 0===t?void 0:t.depth)&&void 0!==i?i:1;return this.tocNode&&this.content?e.html`
155
+ <section class="ft-reader-topic readercontent-topic-depth-${r} depth-${r}" id="${this.tocId}"
156
+ part="container">
157
+ <ft-typography variant="title" element="h${Math.min(r+1,6)}" part="title">
158
+ ${null===(n=this.tocNode)||void 0===n?void 0:n.title}
159
+ </ft-typography>
160
+ <div class="ft-reader-topic--content topic" part="content">
161
+ ${s.unsafeHTML(this.content)}
162
+ </div>
163
+ </section>
164
+ `:e.html`
165
+ <div class="loading-topic" part="loader">
166
+ ${this.tocNode?e.html`
167
+ <ft-typography variant="title" element="h${Math.min(r+1,6)}" part="title">
168
+ ${null===(o=this.tocNode)||void 0===o?void 0:o.title}
169
+ </ft-typography>
170
+ `:e.html`
171
+ <ft-skeleton
172
+ style="--ft-skeleton--width: 50%;--ft-skeleton--height: 24px; margin-bottom: 24px"></ft-skeleton>
173
+ `}
174
+ <ft-skeleton style="--ft-skeleton--width: 80%"></ft-skeleton>
175
+ <ft-skeleton style="--ft-skeleton--width: 40%;--ft-skeleton--height: 200px"></ft-skeleton>
176
+ <ft-skeleton style="--ft-skeleton--width: 50%"></ft-skeleton>
177
+ <ft-skeleton style="--ft-skeleton--width: 70%"></ft-skeleton>
178
+ <ft-skeleton style="--ft-skeleton--width: 30%"></ft-skeleton>
179
+ </div>
180
+ `}updated(t){var i;super.updated(t),t.has("tocId")&&this.tocId&&this.getTocNode(),t.has("tocNode")&&this.tocNode&&(null===(i=this.service)||void 0===i||i.getTopicContent(this.tocNode.contentId).then((t=>this.content=t)))}contentAvailableCallback(t){var i,e,o,s;if(super.contentAvailableCallback(t),(null===(i=this.scrollTarget)||void 0===i?void 0:i.section)&&this.tocId&&this.tocId===this.scrollTarget.tocId&&this.content){(null!==(o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))&&void 0!==o?o:this).scrollIntoView({block:"start",behavior:"smooth"}),null===(s=this.stateManager)||void 0===s||s.scrollDone()}}onStoreAvailable(){super.onStoreAvailable(),this.getTocNode()}async getTocNode(){var t;this.content=void 0,this.tocNode=await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId))}}Ni.styles=e.css`
181
+ .ft-reader-topic {
182
+ box-sizing: border-box;
183
+ }
184
+
185
+ .loading-topic {
186
+ height: 100vh;
187
+ }
188
+
189
+ ft-skeleton {
190
+ margin: 8px 0;
191
+ }
192
+
193
+ .ft-reader-topic--content {
194
+ max-width: 100%;
195
+ overflow-x: auto;
196
+ }
197
+
198
+ img {
199
+ max-width: 100%;
200
+ }
201
+ `,Oi([o.property()],Ni.prototype,"tocId",void 0),Oi([o.state()],Ni.prototype,"tocNode",void 0),Oi([o.state()],Ni.prototype,"content",void 0),Oi([o.query(".ft-reader-topic")],Ni.prototype,"container",void 0),Oi([i.redux()],Ni.prototype,"scrollTarget",void 0),i.customElement("ft-reader-topic")(Ni);var Ai=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};const Ci=i.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0");class ji extends CustomEvent{constructor(t,i){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:i}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class _i extends i.FtLitElement{constructor(){super(...arguments),this.items=[],this.renderItem=()=>e.html``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new i.Debouncer(5),this.onVisibilityChange=t=>{const i=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),e=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!e.includes(t)));this.visibleItems=[...i,...o].sort(((t,i)=>t-i))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index");let o=i.target.parentElement.clientHeight,s=i.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(i.target.parentElement.style.height=s+"px",e+=t<this.visibleItems[0]?o-s:0)}this.scrollable&&i.isSafari&&(this.scrollable.scrollTop-=e)},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.intersectionObserver.observe(t),this.resizeObserver.observe(t.children.item(0))}))},this.mutationObserver=new MutationObserver(this.onMutation)}get scrollable(){return this.internalScroll?this.internalScrollable:this.firstScrollableParent}render(){return e.html`
202
+ <div class="items-container ${this.internalScroll?"scrollable":""}"
203
+ tabindex="-1"
204
+ @find-scrollable-parent=${this.findScrollableParent}>
205
+ ${r.repeat(this.items,((t,i)=>this.renderItemContainer(t,i)))}
206
+ </div>
207
+ `}renderItemContainer(t,i){const o=this.scrolledToTarget&&this.visibleItems.includes(i),n=this.alreadyRenderedIndexes.has(i)||this.scrolledToTarget&&i>=this.visibleItems[0]-1&&i<=(null!=(r=this.visibleItems)?r:[])[(null!=r?r:[]).length-1]+1;var r;n&&this.alreadyRenderedIndexes.add(i);return e.html`
208
+ <div id="item-${i}"
209
+ class="item-container"
210
+ data-item-index="${i}">
211
+ <div class="resizable ${o?"visible":""} ${n?"rendered":""}">
212
+ ${n?(()=>{const o=this.renderItem(t,i);return"string"==typeof o?e.html`${s.unsafeHTML(o)}`:o})():null}
213
+ </div>
214
+ </div>
215
+ `}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,i;let e=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;e>=this.items.length&&(e=-1);let o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`#item-${e}`);o&&o.scrollIntoView({block:"start"}),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let i of t.composedPath()){const t=i;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new ji(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new Ei)}}_i.styles=e.css`
216
+ .items-container {
217
+ position: relative;
218
+ padding: ${Ci};
219
+ outline: none;
220
+ }
221
+
222
+ .scrollable {
223
+ height: 100%;
224
+ overflow-y: auto;
225
+ }
226
+
227
+ .item-container {
228
+ height: 100vh;
229
+ }
230
+
231
+ .item-container + .item-container {
232
+ /*
233
+ We add a gap between items to be sure to hide the content above the targeted item
234
+ When a div is visible (even by a fraction of a pixel) if its height changes
235
+ the browser will try to keep the scroll stable in relation to the first visible element
236
+ By adding this gap we ensure that the previous item will be fully hidden and event if its size changes, it will not impact the scroll offset
237
+ */
238
+ margin-top: 4px;
239
+ }
240
+
241
+ .scrollable .item-container {
242
+ height: 100%;
243
+ }
244
+
245
+ .resizable:not(.rendered) {
246
+ width: 0;
247
+ }
248
+ `,Ai([o.property({type:Array})],_i.prototype,"items",void 0),Ai([o.property({attribute:!1})],_i.prototype,"renderItem",void 0),Ai([o.property({type:Object})],_i.prototype,"scrollToItem",void 0),Ai([o.property({type:Number})],_i.prototype,"scrollToIndex",void 0),Ai([o.property({type:Boolean})],_i.prototype,"internalScroll",void 0),Ai([o.state({hasChanged:(t,i)=>null!=t&&null==i||t.length!==i.length||t[0]!==i[0]})],_i.prototype,"visibleItems",void 0),Ai([o.query(".scrollable")],_i.prototype,"internalScrollable",void 0),Ai([o.query(".items-container")],_i.prototype,"itemsContainer",void 0),Ai([o.state()],_i.prototype,"scrolledToTarget",void 0),i.customElement("ft-infinite-scroll")(_i);var Mi=function(t,i,e,o){for(var s,n=arguments.length,r=n<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(i,e,r):s(i,e))||r);return n>3&&r&&Object.defineProperty(i,e,r),r};class Pi extends a{constructor(){super(...arguments),this.renderTopic=t=>e.html`
249
+ <ft-reader-topic tocId="${t}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
250
+ `,this.visibleTopicsDebouncer=new i.Debouncer(100)}render(){var t;return e.html`
251
+ <ft-infinite-scroll class="ft-reader-content"
252
+ .items=${(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[]}
253
+ .renderItem=${this.renderTopic}
254
+ .scrollToItem=${this.getScrollTarget()}
255
+ exportpartsPrefix="scroller"
256
+ @visible-items-change=${this.visibleTopicChange}
257
+ @scrolled-to-target=${this.onScrollDone}
258
+ >
259
+
260
+ </ft-infinite-scroll>
261
+ `}getScrollTarget(){var t,i,e,o,s;const n=null!==(o=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(e=null===(i=this.scrollTarget)||void 0===i?void 0:i.tocId)&&void 0!==e?e:""))&&void 0!==o&&o;return!(null===(s=this.scrollTarget)||void 0===s?void 0:s.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.visibleTopicsDebouncer.run((()=>{var i;return null===(i=this.stateManager)||void 0===i?void 0:i.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,i;null==(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)&&(null===(i=this.stateManager)||void 0===i||i.scrollDone())}}Pi.elementDefinitions={"ft-infinite-scroll":_i},Pi.styles=e.css`
262
+ `,Mi([o.property()],Pi.prototype,"renderTopic",void 0),Mi([i.redux()],Pi.prototype,"currentPage",void 0),Mi([i.redux()],Pi.prototype,"scrollTarget",void 0),Mi([i.redux()],Pi.prototype,"visibleTopics",void 0),Mi([o.query(".ft-reader-content")],Pi.prototype,"container",void 0),i.customElement("ft-reader-content")(Pi),t.FtReaderContent=Pi,t.FtReaderContentCssVariables={},Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litUnsafeHTML,ftGlobals.litClassMap,ftGlobals.litRepeat);
@@ -0,0 +1,367 @@
1
+ !function(t){
2
+ /**
3
+ * @license
4
+ * Copyright (c) 2020 The Polymer Project Authors. All rights reserved.
5
+ * This code may only be used under the BSD style license found at
6
+ * http://polymer.github.io/LICENSE.txt
7
+ * The complete set of authors may be found at
8
+ * http://polymer.github.io/AUTHORS.txt
9
+ * The complete set of contributors may be found at
10
+ * http://polymer.github.io/CONTRIBUTORS.txt
11
+ * Code distributed by Google as part of the polymer project is also
12
+ * subject to an additional IP rights grant found at
13
+ * http://polymer.github.io/PATENTS.txt
14
+ *
15
+ * @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
16
+ */
17
+ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,s=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,s){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(s))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=s.prototype.attributeChangedCallback,a=new Set(s.observedAttributes||[]);p(s,a,l);const h={elementClass:s,connectedCallback:s.prototype.connectedCallback,disconnectedCallback:s.prototype.disconnectedCallback,adoptedCallback:s.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:s.formAssociated,formAssociatedCallback:s.prototype.formAssociatedCallback,formDisabledCallback:s.prototype.formDisabledCallback,formResetCallback:s.prototype.formResetCallback,formStateRestoreCallback:s.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(s,h);let c=i.call(o,t);c||(c=d(t),e.call(o,t,c)),this===window.customElements&&(r.set(s,h),h.standInClass=c);const u=this._awaitingUpgrade.get(t);if(u){this._awaitingUpgrade.delete(t);for(const t of u)n.delete(t),f(t,h,!0)}const v=this._whenDefinedPromises.get(t);return void 0!==v&&(v.resolve(s),this._whenDefinedPromises.delete(t)),s}upgrade(){y.push(this),o.upgrade.apply(o,arguments),y.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let i=this._whenDefinedPromises.get(t);return void 0===i&&(i={},i.promise=new Promise((t=>i.resolve=t)),this._whenDefinedPromises.set(t,i)),i.promise}_upgradeWhenDefined(t,e,i){let o=this._awaitingUpgrade.get(e);o||this._awaitingUpgrade.set(e,o=new Set),i?o.add(t):o.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const i=r.get(this.constructor);if(!i)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],i.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),s.set(e,i),e},window.HTMLElement.prototype=t.prototype;const h=t=>t===document||t instanceof ShadowRoot,c=t=>{let e=t.getRootNode();if(!h(e)){const t=y[y.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),h(e)||(e=l.get(e)?.getRootNode()||document)}return e.customElements},d=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=c(i)||window.customElements,s=o._getDefinition(e);return s?f(i,s):n.set(i,o),i}connectedCallback(){const t=s.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=s.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){s.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=s.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=s.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=s.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=s.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},p=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,s){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);o.call(this,n,s),i.call(this,n,t,s)}else o.call(this,n,s)});const s=t.prototype.removeAttribute;s&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);s.call(this,o),i.call(this,o,t,null)}else s.call(this,o)})},u=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):u(i)},f=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),s.set(t,e),a=t;try{new e.elementClass}catch(t){u(e.elementClass),new e.elementClass}e.observedAttributes.forEach((i=>{t.hasAttribute(i)&&e.attributeChangedCallback.call(t,i,null,t.getAttribute(i))})),i&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},v=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=v.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let y=[document];const g=(t,e,i)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){y.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&l.set(t,this),y.pop(),t}};g(ShadowRoot,"createElement",document),g(ShadowRoot,"importNode",document),g(Element,"insertAdjacentHTML");const b=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){y.push(this),i.set.call(this,t),y.pop()}})};if(b(Element,"innerHTML"),b(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,i=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...i){const o=e.call(this,...i);return t.set(o,this),o},i.forEach((e=>{const i=window.ElementInternals.prototype,o=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==s.get(i).formAssociated)throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`);o?.call(this,...e)}}));class o extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class n{constructor(t){const e=new Map;t.forEach(((t,i)=>{const o=t.getAttribute("name"),s=e.get(o)||[];this[+i]=t,s.push(t),e.set(o,s)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new o(t))}))}namedItem(t){return this[t]}}const r=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=r.get.call(this,[]),e=[];for(const i of t){const t=s.get(i);t&&!0!==t.formAssociated||e.push(i)}return new n(e)}})}}try{window.customElements.define("custom-element",null)}catch(zt){const t=window.customElements.define;window.customElements.define=(e,i,o)=>{try{t.bind(window.customElements)(e,i,o)}catch(t){console.warn(e,i,o,t)}}}class e{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){this.callbacks=[t],this.debounce(e)}queue(t,e){this.callbacks.push(t),this.debounce(e)}cancel(){null!=this._debounce&&window.clearTimeout(this._debounce)}debounce(t){this.cancel(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout)}runCallbacks(){for(let t of this.callbacks)t();this.callbacks=[]}}
18
+ /**
19
+ * @license
20
+ * Copyright 2017 Google LLC
21
+ * SPDX-License-Identifier: BSD-3-Clause
22
+ */const i=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function o(t){return(e,o)=>void 0!==o?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,o):i(t,e)
23
+ /**
24
+ * @license
25
+ * Copyright 2017 Google LLC
26
+ * SPDX-License-Identifier: BSD-3-Clause
27
+ */}function s(t){return o({...t,state:!0})}
28
+ /**
29
+ * @license
30
+ * Copyright 2017 Google LLC
31
+ * SPDX-License-Identifier: BSD-3-Clause
32
+ */
33
+ /**
34
+ * @license
35
+ * Copyright 2017 Google LLC
36
+ * SPDX-License-Identifier: BSD-3-Clause
37
+ */
38
+ function n(t,e){return(({finisher:t,descriptor:e})=>(i,o)=>{var s;if(void 0===o){const o=null!==(s=i.originalKey)&&void 0!==s?s:i.key,n=null!=e?{kind:"method",placement:"prototype",key:o,descriptor:e(i.key)}:{...i,key:o};return null!=t&&(n.finisher=function(e){t(e,o)}),n}{const s=i.constructor;void 0!==e&&Object.defineProperty(i,o,e(o)),null==t||t(s,o)}})({descriptor:i=>{const o={get(){var e,i;return null!==(i=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==i?i:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof i?Symbol():"__"+i;o.get=function(){var i,o;return void 0===this[e]&&(this[e]=null!==(o=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==o?o:null),this[e]}}return o}})}
39
+ /**
40
+ * @license
41
+ * Copyright 2021 Google LLC
42
+ * SPDX-License-Identifier: BSD-3-Clause
43
+ */var r;null===(r=window.HTMLSlotElement)||void 0===r||r.prototype.assignedElements;const l=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function a(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var i,o,s;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(o=i;0!=o--;)if(!a(t[o],e[o]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;for(o of t.entries())if(!a(o[1],e.get(o[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(o of t.entries())if(!e.has(o[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((i=(s=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(o=i;0!=o--;)if(!Object.prototype.hasOwnProperty.call(e,s[o]))return!1;for(o=i;0!=o--;){var n=s[o];if(!a(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}
44
+ /**
45
+ * @license
46
+ * Copyright 2019 Google LLC
47
+ * SPDX-License-Identifier: BSD-3-Clause
48
+ */const h=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,c=Symbol(),d=new WeakMap;class p{constructor(t,e,i){if(this._$cssResult$=!0,i!==c)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(h&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=d.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&d.set(e,t))}return t}toString(){return this.cssText}}const u=t=>new p("string"==typeof t?t:t+"",void 0,c),f=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new p(i,t,c)},v=(t,e)=>{h?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),o=window.litNonce;void 0!==o&&i.setAttribute("nonce",o),i.textContent=e.cssText,t.appendChild(i)}))},y=h?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return u(e)})(t):t
49
+ /**
50
+ * @license
51
+ * Copyright 2017 Google LLC
52
+ * SPDX-License-Identifier: BSD-3-Clause
53
+ */;var g;const b=window.trustedTypes,m=b?b.emptyScript:"",x=window.reactiveElementPolyfillSupport,w={toAttribute(t,e){switch(e){case Boolean:t=t?m:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},$=(t,e)=>e!==t&&(e==e||t==t),O={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:$};class S extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const o=this._$Ep(i,e);void 0!==o&&(this._$Ev.set(o,i),t.push(o))})),t}static createProperty(t,e=O){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,o=this.getPropertyDescriptor(t,i,e);void 0!==o&&Object.defineProperty(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(o){const s=this[t];this[e]=o,this.requestUpdate(t,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||O}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(y(t))}else void 0!==t&&e.push(y(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return v(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=O){var o,s;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const r=(null!==(s=null===(o=i.converter)||void 0===o?void 0:o.toAttribute)&&void 0!==s?s:w.toAttribute)(e,i.type);this._$El=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$El=null}}_$AK(t,e){var i,o;const s=this.constructor,n=s._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=s.getPropertyOptions(n),r=t.converter,l=null!==(o=null!==(i=null==r?void 0:r.fromAttribute)&&void 0!==i?i:"function"==typeof r?r:null)&&void 0!==o?o:w.fromAttribute;this._$El=n,this[n]=l(e,t.type),this._$El=null}}requestUpdate(t,e,i){let o=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||$)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):o=!1),!this.isUpdatePending&&o&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}
54
+ /**
55
+ * @license
56
+ * Copyright 2017 Google LLC
57
+ * SPDX-License-Identifier: BSD-3-Clause
58
+ */
59
+ var k;S.finalized=!0,S.elementProperties=new Map,S.elementStyles=[],S.shadowRootOptions={mode:"open"},null==x||x({ReactiveElement:S}),(null!==(g=globalThis.reactiveElementVersions)&&void 0!==g?g:globalThis.reactiveElementVersions=[]).push("1.3.4");const N=globalThis.trustedTypes,C=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,E=`lit$${(Math.random()+"").slice(9)}$`,R="?"+E,M=`<${R}>`,U=document,T=(t="")=>U.createComment(t),F=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,A=t=>j(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,P=/-->/g,I=/>/g,z=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),_=/'/g,B=/"/g,W=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),H=Symbol.for("lit-noChange"),K=Symbol.for("lit-nothing"),Z=new WeakMap,V=U.createTreeWalker(U,129,null,!1),J=(t,e)=>{const i=t.length-1,o=[];let s,n=2===e?"<svg>":"",r=L;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,a=r.exec(i),null!==a);)c=r.lastIndex,r===L?"!--"===a[1]?r=P:void 0!==a[1]?r=I:void 0!==a[2]?(W.test(a[2])&&(s=RegExp("</"+a[2],"g")),r=z):void 0!==a[3]&&(r=z):r===z?">"===a[0]?(r=null!=s?s:L,h=-1):void 0===a[1]?h=-2:(h=r.lastIndex-a[2].length,l=a[1],r=void 0===a[3]?z:'"'===a[3]?B:_):r===B||r===_?r=z:r===P||r===I?r=L:(r=z,s=void 0);const d=r===z&&t[e+1].startsWith("/>")?" ":"";n+=r===L?i+M:h>=0?(o.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+E+d):i+E+(-2===h?(o.push(void 0),e):d)}const l=n+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==C?C.createHTML(l):l,o]};class q{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let s=0,n=0;const r=t.length-1,l=this.parts,[a,h]=J(t,e);if(this.el=q.createElement(a,i),V.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(o=V.nextNode())&&l.length<r;){if(1===o.nodeType){if(o.hasAttributes()){const t=[];for(const e of o.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(E)){const i=h[n++];if(t.push(e),void 0!==i){const t=o.getAttribute(i.toLowerCase()+"$lit$").split(E),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:s,name:e[2],strings:t,ctor:"."===e[1]?tt:"?"===e[1]?it:"@"===e[1]?ot:Q})}else l.push({type:6,index:s})}for(const e of t)o.removeAttribute(e)}if(W.test(o.tagName)){const t=o.textContent.split(E),e=t.length-1;if(e>0){o.textContent=N?N.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],T()),V.nextNode(),l.push({type:2,index:++s});o.append(t[e],T())}}}else if(8===o.nodeType)if(o.data===R)l.push({type:2,index:s});else{let t=-1;for(;-1!==(t=o.data.indexOf(E,t+1));)l.push({type:7,index:s}),t+=E.length-1}s++}}static createElement(t,e){const i=U.createElement("template");return i.innerHTML=t,i}}function X(t,e,i=t,o){var s,n,r,l;if(e===H)return e;let a=void 0!==o?null===(s=i._$Cl)||void 0===s?void 0:s[o]:i._$Cu;const h=F(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(n=null==a?void 0:a._$AO)||void 0===n||n.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,o)),void 0!==o?(null!==(r=(l=i)._$Cl)&&void 0!==r?r:l._$Cl=[])[o]=a:i._$Cu=a),void 0!==a&&(e=X(t,a._$AS(t,e.values),a,o)),e}class Y{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;const{el:{content:i},parts:o}=this._$AD,s=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:U).importNode(i,!0);V.currentNode=s;let n=V.nextNode(),r=0,l=0,a=o[0];for(;void 0!==a;){if(r===a.index){let e;2===a.type?e=new G(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new st(n,this,t)),this.v.push(e),a=o[++l]}r!==(null==a?void 0:a.index)&&(n=V.nextNode(),r++)}return s}m(t){let e=0;for(const i of this.v)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class G{constructor(t,e,i,o){var s;this.type=2,this._$AH=K,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$C_=null===(s=null==o?void 0:o.isConnected)||void 0===s||s}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$C_}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=X(this,t,e),F(t)?t===K||null==t||""===t?(this._$AH!==K&&this._$AR(),this._$AH=K):t!==this._$AH&&t!==H&&this.T(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.k(t):A(t)?this.S(t):this.T(t)}j(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.j(t))}T(t){this._$AH!==K&&F(this._$AH)?this._$AA.nextSibling.data=t:this.k(U.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,s="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=q.createElement(o.h,this.options)),o);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===s)this._$AH.m(i);else{const t=new Y(s,this),e=t.p(this.options);t.m(i),this.k(e),this._$AH=t}}_$AC(t){let e=Z.get(t.strings);return void 0===e&&Z.set(t.strings,e=new q(t)),e}S(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const s of t)o===e.length?e.push(i=new G(this.j(T()),this.j(T()),this,this.options)):i=e[o],i._$AI(s),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$C_=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class Q{constructor(t,e,i,o,s){this.type=1,this._$AH=K,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=s,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=K}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,o){const s=this.strings;let n=!1;if(void 0===s)t=X(this,t,e,0),n=!F(t)||t!==this._$AH&&t!==H,n&&(this._$AH=t);else{const o=t;let r,l;for(t=s[0],r=0;r<s.length-1;r++)l=X(this,o[i+r],e,r),l===H&&(l=this._$AH[r]),n||(n=!F(l)||l!==this._$AH[r]),l===K?t=K:t!==K&&(t+=(null!=l?l:"")+s[r+1]),this._$AH[r]=l}n&&!o&&this.P(t)}P(t){t===K?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tt extends Q{constructor(){super(...arguments),this.type=3}P(t){this.element[this.name]=t===K?void 0:t}}const et=N?N.emptyScript:"";class it extends Q{constructor(){super(...arguments),this.type=4}P(t){t&&t!==K?this.element.setAttribute(this.name,et):this.element.removeAttribute(this.name)}}class ot extends Q{constructor(t,e,i,o,s){super(t,e,i,o,s),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=X(this,t,e,0))&&void 0!==i?i:K)===H)return;const o=this._$AH,s=t===K&&o!==K||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==K&&(o===K||s);s&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){X(this,t)}}const nt={A:"$lit$",C:E,M:R,L:1,R:J,V:Y,D:A,I:X,H:G,N:Q,U:it,B:ot,F:tt,W:st},rt=window.litHtmlPolyfillSupport;
60
+ /**
61
+ * @license
62
+ * Copyright 2017 Google LLC
63
+ * SPDX-License-Identifier: BSD-3-Clause
64
+ */
65
+ var lt,at;null==rt||rt(q,G),(null!==(k=globalThis.litHtmlVersions)&&void 0!==k?k:globalThis.litHtmlVersions=[]).push("2.2.7");class ht extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var o,s;const n=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:e;let r=n._$litPart$;if(void 0===r){const t=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:null;n._$litPart$=r=new G(e.insertBefore(T(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return H}}ht.finalized=!0,ht._$litElement$=!0,null===(lt=globalThis.litElementHydrateSupport)||void 0===lt||lt.call(globalThis,{LitElement:ht});const ct=globalThis.litElementPolyfillSupport;null==ct||ct({LitElement:ht}),(null!==(at=globalThis.litElementVersions)&&void 0!==at?at:globalThis.litElementVersions=[]).push("3.2.2");class dt{static create(t,e,i){let o=t=>u(null!=t?t:i),s=f`var(${u(t)}, ${o(i)})`;return s.name=t,s.category=e,s.defaultValue=i,s.defaultCssValue=o,s.get=e=>f`var(${u(t)}, ${o(e)})`,s.breadcrumb=()=>[],s.lastResortDefaultValue=()=>i,s}static extend(t,e,i){let o=t=>e.get(null!=t?t:i),s=f`var(${u(t)}, ${o(i)})`;return s.name=t,s.category=e.category,s.fallbackVariable=e,s.defaultValue=i,s.defaultCssValue=o,s.get=e=>f`var(${u(t)}, ${o(e)})`,s.breadcrumb=()=>[e.name,...e.breadcrumb()],s.lastResortDefaultValue=()=>i,s}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):u(null!=e?e:t.defaultValue),o=f`var(${u(t.name)}, ${i(t.defaultValue)})`;return o.name=t.name,o.category=t.category,o.fallbackVariable=t.fallbackVariable,o.defaultValue=t.defaultValue,o.context=e,o.defaultCssValue=i,o.get=e=>f`var(${u(t.name)}, ${i(e)})`,o.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],o.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},o}}const pt={colorPrimary:dt.create("--ft-color-primary","COLOR","#2196F3"),colorPrimaryVariant:dt.create("--ft-color-primary-variant","COLOR","#1976D2"),colorSecondary:dt.create("--ft-color-secondary","COLOR","#FFCC80"),colorSecondaryVariant:dt.create("--ft-color-secondary-variant","COLOR","#F57C00"),colorSurface:dt.create("--ft-color-surface","COLOR","#FFFFFF"),colorContent:dt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),colorError:dt.create("--ft-color-error","COLOR","#B00020"),colorOutline:dt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),colorOpacityHigh:dt.create("--ft-color-opacity-high","NUMBER","1"),colorOpacityMedium:dt.create("--ft-color-opacity-medium","NUMBER","0.74"),colorOpacityDisabled:dt.create("--ft-color-opacity-disabled","NUMBER","0.38"),colorOnPrimary:dt.create("--ft-color-on-primary","COLOR","#FFFFFF"),colorOnPrimaryHigh:dt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),colorOnPrimaryMedium:dt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnPrimaryDisabled:dt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSecondary:dt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),colorOnSecondaryHigh:dt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),colorOnSecondaryMedium:dt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnSecondaryDisabled:dt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSurface:dt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceHigh:dt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceMedium:dt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),colorOnSurfaceDisabled:dt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),opacityContentOnSurfaceDisabled:dt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),opacityContentOnSurfaceEnable:dt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),opacityContentOnSurfaceHover:dt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),opacityContentOnSurfaceFocused:dt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),opacityContentOnSurfacePressed:dt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),opacityContentOnSurfaceSelected:dt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),opacityContentOnSurfaceDragged:dt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),opacityPrimaryOnSurfaceDisabled:dt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),opacityPrimaryOnSurfaceEnable:dt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),opacityPrimaryOnSurfaceHover:dt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),opacityPrimaryOnSurfaceFocused:dt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),opacityPrimaryOnSurfacePressed:dt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),opacityPrimaryOnSurfaceSelected:dt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),opacityPrimaryOnSurfaceDragged:dt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),opacitySurfaceOnPrimaryDisabled:dt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),opacitySurfaceOnPrimaryEnable:dt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),opacitySurfaceOnPrimaryHover:dt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),opacitySurfaceOnPrimaryFocused:dt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),opacitySurfaceOnPrimaryPressed:dt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),opacitySurfaceOnPrimarySelected:dt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),opacitySurfaceOnPrimaryDragged:dt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),elevation00:dt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),elevation01:dt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation02:dt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation03:dt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),elevation04:dt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),elevation06:dt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),elevation08:dt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),elevation12:dt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),elevation16:dt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),elevation24:dt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),borderRadiusS:dt.create("--ft-border-radius-S","SIZE","4px"),borderRadiusM:dt.create("--ft-border-radius-M","SIZE","8px"),borderRadiusL:dt.create("--ft-border-radius-L","SIZE","12px"),borderRadiusXL:dt.create("--ft-border-radius-XL","SIZE","16px"),titleFont:dt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),contentFont:dt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),transitionDuration:dt.create("--ft-transition-duration","UNKNOWN","250ms"),transitionTimingFunction:dt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out")};
66
+ /**
67
+ * @license
68
+ * Copyright 2021 Google LLC
69
+ * SPDX-License-Identifier: BSD-3-Clause
70
+ */var ut=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ft extends(function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:o}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,i])=>t.registry.define(e,i))));const s=this.renderOptions.creationScope=this.attachShadow({...o,customElements:t.registry});return v(s,this.constructor.elementStyles),s}}}(ht)){getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),D`
71
+ ${t.map((t=>D`
72
+ <style>${t}</style>
73
+ `))}
74
+ ${this.getTemplate()}
75
+ `}updated(t){super.updated(t),setTimeout((()=>{var e;this.contentAvailableCallback(t),(null===(e=this.exportpartsPrefix)||void 0===e?void 0:e.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}),0)}setExportpartsAttribute(t){var e,i,o,s,n,r;const l=t=>null!=t&&t.trim().length>0,a=t.filter(l).map((t=>t.trim()));if(0===a.length)return void this.removeAttribute("exportparts");const h=new Set;for(let t of null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll("[part],[exportparts]"))&&void 0!==i?i:[]){const e=null!==(s=null===(o=t.getAttribute("part"))||void 0===o?void 0:o.split(" "))&&void 0!==s?s:[],i=null!==(r=null===(n=t.getAttribute("exportparts"))||void 0===n?void 0:n.split(",").map((t=>t.split(":")[1])))&&void 0!==r?r:[];new Array(...e,...i).filter(l).map((t=>t.trim())).forEach((t=>h.add(t)))}if(0===h.size)return void this.removeAttribute("exportparts");const c=[...h.values()].flatMap((t=>a.map((e=>`${t}:${e}--${t}`))));this.setAttribute("exportparts",[...this.part,...c].join(", "))}contentAvailableCallback(t){}}ut([o()],ft.prototype,"exportpartsPrefix",void 0),ut([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return o({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},...null!=e?e:{}})}([])],ft.prototype,"exportpartsPrefixes",void 0),f`
76
+ .ft-no-text-select {
77
+ -webkit-touch-callout: none;
78
+ -webkit-user-select: none;
79
+ -khtml-user-select: none;
80
+ -moz-user-select: none;
81
+ -ms-user-select: none;
82
+ user-select: none;
83
+ }
84
+ `;const vt=(t,e)=>(i,o)=>{i.constructor.createProperty(o,{attribute:!1,hasChanged:null!=e?e:a});const s=i;s.reduxProperties=s.reduxProperties||new Map,s.reduxProperties.set(o,null!=t?t:t=>t[o])};class yt extends ft{get store(){return this.internalStore}set store(t){this.internalStore=t,this.store&&this.setupStore()}updateFromStore(){const t=this.store.getState();this.reduxProperties&&this.reduxProperties.forEach(((e,i)=>{this[i]=e(t,this)}))}setupStore(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),this.updateFromStore(),this.unsubscribeFromStore=this.store.subscribe((()=>{this.updateFromStore()})),this.onStoreAvailable(),this.requestUpdate()}onStoreAvailable(){}connectedCallback(){super.connectedCallback(),this.store&&this.setupStore()}disconnectedCallback(){this.unsubscribeFromStore&&this.unsubscribeFromStore(),super.disconnectedCallback()}}var gt,bt,mt;const xt=navigator.vendor&&!!navigator.vendor.match(/apple/i)||"[object SafariRemoteNotification]"===(null!==(mt=null===(bt=null===(gt=window.safari)||void 0===gt?void 0:gt.pushNotification)||void 0===bt?void 0:bt.toString())&&void 0!==mt?mt:"");var wt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class $t extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class Ot extends yt{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new $t)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}wt([s()],Ot.prototype,"stateManager",void 0);
85
+ /**
86
+ * @license
87
+ * Copyright 2017 Google LLC
88
+ * SPDX-License-Identifier: BSD-3-Clause
89
+ */
90
+ const St=1,kt=2,Nt=t=>(...e)=>({_$litDirective$:t,values:e});class Ct{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
91
+ /**
92
+ * @license
93
+ * Copyright 2017 Google LLC
94
+ * SPDX-License-Identifier: BSD-3-Clause
95
+ */class Et extends Ct{constructor(t){if(super(t),this.it=K,t.type!==kt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===K||null==t)return this._t=void 0,this.it=t;if(t===H)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Et.directiveName="unsafeHTML",Et.resultType=1;const Rt=Nt(Et),Mt=dt.create("--ft-skeleton--display","DISPLAY","block"),Ut=dt.create("--ft-skeleton--width","SIZE","100%"),Tt=dt.create("--ft-skeleton--height","SIZE","20px"),Ft=dt.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),jt=dt.create("--ft-skeleton--glare-width","SIZE","200px"),At=dt.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),Lt=dt.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),Pt=dt.external(pt.borderRadiusM,"Design system");class It extends ft{render(){return D`
96
+ `}}It.elementDefinitions={},It.styles=f`
97
+ :host {
98
+ width: ${Ut};
99
+ height: ${Tt};
100
+ display: ${Mt};
101
+ overflow: hidden;
102
+ border-radius: ${Pt};
103
+ background: linear-gradient(
104
+ 90deg,
105
+ transparent,
106
+ ${At} calc(0.45 * ${jt}),
107
+ ${At} calc(0.55 * ${jt}),
108
+ transparent ${jt}
109
+ ), ${Ft};
110
+ background-repeat: repeat-y;
111
+ background-size: 100vw 100vh;
112
+ background-attachment: fixed;
113
+ background-position: calc(${jt} * -1) 0;
114
+ animation: shine ${Lt} infinite;
115
+ animation-timing-function: linear;
116
+ }
117
+
118
+ @keyframes shine {
119
+ to {
120
+ background-position: calc(100vw + ${jt}) 0, calc(${jt} * -1) 0;
121
+ }
122
+ }
123
+ `,l("ft-skeleton")(It);
124
+ /**
125
+ * @license
126
+ * Copyright 2020 Google LLC
127
+ * SPDX-License-Identifier: BSD-3-Clause
128
+ */
129
+ const zt=Symbol.for(""),_t=t=>{if((null==t?void 0:t.r)===zt)return null==t?void 0:t._$litStatic$},Bt=t=>({_$litStatic$:t,r:zt}),Wt=new Map,Dt=(t=>(e,...i)=>{const o=i.length;let s,n;const r=[],l=[];let a,h=0,c=!1;for(;h<o;){for(a=e[h];h<o&&void 0!==(n=i[h],s=_t(n));)a+=s+e[++h],c=!0;l.push(n),r.push(a),h++}if(h===o&&r.push(e[o]),c){const t=r.join("$$lit$$");void 0===(e=Wt.get(t))&&(r.raw=r,Wt.set(t,e=r)),i=l}return t(e,...i)})(D);var Ht,Kt=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};!function(t){t.title="title",t.title_dense="title-dense",t.subtitle1="subtitle1",t.subtitle2="subtitle2",t.body1="body1",t.body2="body2",t.caption="caption",t.breadcrumb="breadcrumb",t.overline="overline",t.button="button"}(Ht||(Ht={}));const Zt=dt.extend("--ft-typography-font-family",pt.titleFont),Vt=dt.extend("--ft-typography-font-family",pt.contentFont),Jt={fontFamily:Vt,fontSize:dt.create("--ft-typography-font-size","SIZE","16px"),fontWeight:dt.create("--ft-typography-font-weight","UNKNOWN","normal"),letterSpacing:dt.create("--ft-typography-letter-spacing","SIZE","0.496px"),lineHeight:dt.create("--ft-typography-line-height","NUMBER","1.5"),textTransform:dt.create("--ft-typography-text-transform","UNKNOWN","inherit")},qt=dt.extend("--ft-typography-title-font-family",Zt),Xt=dt.extend("--ft-typography-title-font-size",Jt.fontSize,"20px"),Yt=dt.extend("--ft-typography-title-font-weight",Jt.fontWeight,"normal"),Gt=dt.extend("--ft-typography-title-letter-spacing",Jt.letterSpacing,"0.15px"),Qt=dt.extend("--ft-typography-title-line-height",Jt.lineHeight,"1.2"),te=dt.extend("--ft-typography-title-text-transform",Jt.textTransform,"inherit"),ee=dt.extend("--ft-typography-title-dense-font-family",Zt),ie=dt.extend("--ft-typography-title-dense-font-size",Jt.fontSize,"14px"),oe=dt.extend("--ft-typography-title-dense-font-weight",Jt.fontWeight,"normal"),se=dt.extend("--ft-typography-title-dense-letter-spacing",Jt.letterSpacing,"0.105px"),ne=dt.extend("--ft-typography-title-dense-line-height",Jt.lineHeight,"1.7"),re=dt.extend("--ft-typography-title-dense-text-transform",Jt.textTransform,"inherit"),le=dt.extend("--ft-typography-subtitle1-font-family",Vt),ae=dt.extend("--ft-typography-subtitle1-font-size",Jt.fontSize,"16px"),he=dt.extend("--ft-typography-subtitle1-font-weight",Jt.fontWeight,"600"),ce=dt.extend("--ft-typography-subtitle1-letter-spacing",Jt.letterSpacing,"0.144px"),de=dt.extend("--ft-typography-subtitle1-line-height",Jt.lineHeight,"1.5"),pe=dt.extend("--ft-typography-subtitle1-text-transform",Jt.textTransform,"inherit"),ue=dt.extend("--ft-typography-subtitle2-font-family",Vt),fe=dt.extend("--ft-typography-subtitle2-font-size",Jt.fontSize,"14px"),ve=dt.extend("--ft-typography-subtitle2-font-weight",Jt.fontWeight,"normal"),ye=dt.extend("--ft-typography-subtitle2-letter-spacing",Jt.letterSpacing,"0.098px"),ge=dt.extend("--ft-typography-subtitle2-line-height",Jt.lineHeight,"1.7"),be=dt.extend("--ft-typography-subtitle2-text-transform",Jt.textTransform,"inherit"),me=dt.extend("--ft-typography-body1-font-family",Vt),xe=dt.extend("--ft-typography-body1-font-size",Jt.fontSize,"16px"),we=dt.extend("--ft-typography-body1-font-weight",Jt.fontWeight,"normal"),$e=dt.extend("--ft-typography-body1-letter-spacing",Jt.letterSpacing,"0.496px"),Oe=dt.extend("--ft-typography-body1-line-height",Jt.lineHeight,"1.5"),Se=dt.extend("--ft-typography-body1-text-transform",Jt.textTransform,"inherit"),ke=dt.extend("--ft-typography-body2-font-family",Vt),Ne=dt.extend("--ft-typography-body2-font-size",Jt.fontSize,"14px"),Ce=dt.extend("--ft-typography-body2-font-weight",Jt.fontWeight,"normal"),Ee=dt.extend("--ft-typography-body2-letter-spacing",Jt.letterSpacing,"0.252px"),Re=dt.extend("--ft-typography-body2-line-height",Jt.lineHeight,"1.4"),Me=dt.extend("--ft-typography-body2-text-transform",Jt.textTransform,"inherit"),Ue=dt.extend("--ft-typography-caption-font-family",Vt),Te=dt.extend("--ft-typography-caption-font-size",Jt.fontSize,"12px"),Fe=dt.extend("--ft-typography-caption-font-weight",Jt.fontWeight,"normal"),je=dt.extend("--ft-typography-caption-letter-spacing",Jt.letterSpacing,"0.396px"),Ae=dt.extend("--ft-typography-caption-line-height",Jt.lineHeight,"1.33"),Le=dt.extend("--ft-typography-caption-text-transform",Jt.textTransform,"inherit"),Pe=dt.extend("--ft-typography-breadcrumb-font-family",Vt),Ie=dt.extend("--ft-typography-breadcrumb-font-size",Jt.fontSize,"10px"),ze=dt.extend("--ft-typography-breadcrumb-font-weight",Jt.fontWeight,"normal"),_e=dt.extend("--ft-typography-breadcrumb-letter-spacing",Jt.letterSpacing,"0.33px"),Be=dt.extend("--ft-typography-breadcrumb-line-height",Jt.lineHeight,"1.6"),We=dt.extend("--ft-typography-breadcrumb-text-transform",Jt.textTransform,"inherit"),De=dt.extend("--ft-typography-overline-font-family",Vt),He=dt.extend("--ft-typography-overline-font-size",Jt.fontSize,"10px"),Ke=dt.extend("--ft-typography-overline-font-weight",Jt.fontWeight,"normal"),Ze=dt.extend("--ft-typography-overline-letter-spacing",Jt.letterSpacing,"1.5px"),Ve=dt.extend("--ft-typography-overline-line-height",Jt.lineHeight,"1.6"),Je=dt.extend("--ft-typography-overline-text-transform",Jt.textTransform,"uppercase"),qe=dt.extend("--ft-typography-button-font-family",Vt),Xe=dt.extend("--ft-typography-button-font-size",Jt.fontSize,"14px"),Ye=dt.extend("--ft-typography-button-font-weight",Jt.fontWeight,"600"),Ge=dt.extend("--ft-typography-button-letter-spacing",Jt.letterSpacing,"1.246px"),Qe=dt.extend("--ft-typography-button-line-height",Jt.lineHeight,"1.15"),ti=dt.extend("--ft-typography-button-text-transform",Jt.textTransform,"uppercase"),ei=f`
130
+ .ft-typography--title {
131
+ font-family: ${qt};
132
+ font-size: ${Xt};
133
+ font-weight: ${Yt};
134
+ letter-spacing: ${Gt};
135
+ line-height: ${Qt};
136
+ text-transform: ${te};
137
+ }
138
+ `,ii=f`
139
+ .ft-typography--title-dense {
140
+ font-family: ${ee};
141
+ font-size: ${ie};
142
+ font-weight: ${oe};
143
+ letter-spacing: ${se};
144
+ line-height: ${ne};
145
+ text-transform: ${re};
146
+ }
147
+ `,oi=f`
148
+ .ft-typography--subtitle1 {
149
+ font-family: ${le};
150
+ font-size: ${ae};
151
+ font-weight: ${he};
152
+ letter-spacing: ${ce};
153
+ line-height: ${de};
154
+ text-transform: ${pe};
155
+ }
156
+ `,si=f`
157
+ .ft-typography--subtitle2 {
158
+ font-family: ${ue};
159
+ font-size: ${fe};
160
+ font-weight: ${ve};
161
+ letter-spacing: ${ye};
162
+ line-height: ${ge};
163
+ text-transform: ${be};
164
+ }
165
+
166
+ `,ni=f`
167
+ .ft-typography--body1 {
168
+ font-family: ${me};
169
+ font-size: ${xe};
170
+ font-weight: ${we};
171
+ letter-spacing: ${$e};
172
+ line-height: ${Oe};
173
+ text-transform: ${Se};
174
+ }
175
+ `,ri=f`
176
+ .ft-typography--body2 {
177
+ font-family: ${ke};
178
+ font-size: ${Ne};
179
+ font-weight: ${Ce};
180
+ letter-spacing: ${Ee};
181
+ line-height: ${Re};
182
+ text-transform: ${Me};
183
+ }
184
+ `,li=f`
185
+ .ft-typography--caption {
186
+ font-family: ${Ue};
187
+ font-size: ${Te};
188
+ font-weight: ${Fe};
189
+ letter-spacing: ${je};
190
+ line-height: ${Ae};
191
+ text-transform: ${Le};
192
+ }
193
+ `,ai=f`
194
+ .ft-typography--breadcrumb {
195
+ font-family: ${Pe};
196
+ font-size: ${Ie};
197
+ font-weight: ${ze};
198
+ letter-spacing: ${_e};
199
+ line-height: ${Be};
200
+ text-transform: ${We};
201
+ }
202
+ `,hi=f`
203
+ .ft-typography--overline {
204
+ font-family: ${De};
205
+ font-size: ${He};
206
+ font-weight: ${Ke};
207
+ letter-spacing: ${Ze};
208
+ line-height: ${Ve};
209
+ text-transform: ${Je};
210
+ }
211
+ `,ci=f`
212
+ .ft-typography--button {
213
+ font-family: ${qe};
214
+ font-size: ${Xe};
215
+ font-weight: ${Ye};
216
+ letter-spacing: ${Ge};
217
+ line-height: ${Qe};
218
+ text-transform: ${ti};
219
+ }
220
+ `;class di extends ft{constructor(){super(...arguments),this.variant=Ht.body1}render(){return this.element?Dt`
221
+ <${Bt(this.element)}
222
+ class="ft-typography ft-typography--${this.variant}">
223
+ <slot></slot>
224
+ </${Bt(this.element)}>
225
+ `:Dt`
226
+ <slot class="ft-typography ft-typography--${this.variant}"></slot>
227
+ `}}di.styles=[ei,ii,oi,si,ni,ri,li,ai,hi,ci,f`
228
+ .ft-typography {
229
+ vertical-align: inherit;
230
+ }
231
+ `],Kt([o()],di.prototype,"element",void 0),Kt([o()],di.prototype,"variant",void 0),l("ft-typography")(di);
232
+ /**
233
+ * @license
234
+ * Copyright 2018 Google LLC
235
+ * SPDX-License-Identifier: BSD-3-Clause
236
+ */
237
+ const pi=Nt(class extends Ct{constructor(t){var e;if(super(t),t.type!==St||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,o;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const s=t.element.classList;this.nt.forEach((t=>{t in e||(s.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(o=this.st)||void 0===o?void 0:o.has(t))||(i?(s.add(t),this.nt.add(t)):(s.remove(t),this.nt.delete(t)))}return H}});var ui=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class fi extends Ot{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let e=pi({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return D`
238
+ <a class=${e}
239
+ href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
240
+ @click=${t=>this.onClick(t)}>
241
+ <slot></slot>
242
+ </a>
243
+ `}onClick(t){var e;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(e=this.stateManager)||void 0===e||e.navigateToTopic(this.tocId,this.section)))}}fi.styles=f`
244
+ .ft-reader-link--remove-style {
245
+ text-decoration: none;
246
+ color: inherit;
247
+ }
248
+ `,ui([o()],fi.prototype,"tocId",void 0),ui([o()],fi.prototype,"section",void 0),ui([o()],fi.prototype,"pageNumber",void 0),ui([o({type:Boolean})],fi.prototype,"removeStyle",void 0),l("ft-reader-internal-link")(fi);var vi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class yi extends Ot{constructor(){super(...arguments),this.tocId=""}render(){var t,e,i,o;const s=null!==(e=null===(t=this.tocNode)||void 0===t?void 0:t.depth)&&void 0!==e?e:1;return this.tocNode&&this.content?D`
249
+ <section class="ft-reader-topic readercontent-topic-depth-${s} depth-${s}" id="${this.tocId}"
250
+ part="container">
251
+ <ft-typography variant="title" element="h${Math.min(s+1,6)}" part="title">
252
+ ${null===(o=this.tocNode)||void 0===o?void 0:o.title}
253
+ </ft-typography>
254
+ <div class="ft-reader-topic--content topic" part="content">
255
+ ${Rt(this.content)}
256
+ </div>
257
+ </section>
258
+ `:D`
259
+ <div class="loading-topic" part="loader">
260
+ ${this.tocNode?D`
261
+ <ft-typography variant="title" element="h${Math.min(s+1,6)}" part="title">
262
+ ${null===(i=this.tocNode)||void 0===i?void 0:i.title}
263
+ </ft-typography>
264
+ `:D`
265
+ <ft-skeleton
266
+ style="--ft-skeleton--width: 50%;--ft-skeleton--height: 24px; margin-bottom: 24px"></ft-skeleton>
267
+ `}
268
+ <ft-skeleton style="--ft-skeleton--width: 80%"></ft-skeleton>
269
+ <ft-skeleton style="--ft-skeleton--width: 40%;--ft-skeleton--height: 200px"></ft-skeleton>
270
+ <ft-skeleton style="--ft-skeleton--width: 50%"></ft-skeleton>
271
+ <ft-skeleton style="--ft-skeleton--width: 70%"></ft-skeleton>
272
+ <ft-skeleton style="--ft-skeleton--width: 30%"></ft-skeleton>
273
+ </div>
274
+ `}updated(t){var e;super.updated(t),t.has("tocId")&&this.tocId&&this.getTocNode(),t.has("tocNode")&&this.tocNode&&(null===(e=this.service)||void 0===e||e.getTopicContent(this.tocNode.contentId).then((t=>this.content=t)))}contentAvailableCallback(t){var e,i,o,s;if(super.contentAvailableCallback(t),(null===(e=this.scrollTarget)||void 0===e?void 0:e.section)&&this.tocId&&this.tocId===this.scrollTarget.tocId&&this.content){(null!==(o=null===(i=this.shadowRoot)||void 0===i?void 0:i.querySelector(`[id="${this.scrollTarget.section}"], [name="${this.scrollTarget.section}"]`))&&void 0!==o?o:this).scrollIntoView({block:"start",behavior:"smooth"}),null===(s=this.stateManager)||void 0===s||s.scrollDone()}}onStoreAvailable(){super.onStoreAvailable(),this.getTocNode()}async getTocNode(){var t;this.content=void 0,this.tocNode=await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId))}}yi.styles=f`
275
+ .ft-reader-topic {
276
+ box-sizing: border-box;
277
+ }
278
+
279
+ .loading-topic {
280
+ height: 100vh;
281
+ }
282
+
283
+ ft-skeleton {
284
+ margin: 8px 0;
285
+ }
286
+
287
+ .ft-reader-topic--content {
288
+ max-width: 100%;
289
+ overflow-x: auto;
290
+ }
291
+
292
+ img {
293
+ max-width: 100%;
294
+ }
295
+ `,vi([o()],yi.prototype,"tocId",void 0),vi([s()],yi.prototype,"tocNode",void 0),vi([s()],yi.prototype,"content",void 0),vi([n(".ft-reader-topic")],yi.prototype,"container",void 0),vi([vt()],yi.prototype,"scrollTarget",void 0),l("ft-reader-topic")(yi);
296
+ /**
297
+ * @license
298
+ * Copyright 2020 Google LLC
299
+ * SPDX-License-Identifier: BSD-3-Clause
300
+ */
301
+ const{H:gi}=nt,bi=()=>document.createComment(""),mi=(t,e,i)=>{var o;const s=t._$AA.parentNode,n=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(bi(),n),o=s.insertBefore(bi(),n);i=new gi(e,o,t,t.options)}else{const e=i._$AB.nextSibling,r=i._$AM,l=r!==t;if(l){let e;null===(o=i._$AQ)||void 0===o||o.call(i,t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==r._$AU&&i._$AP(e)}if(e!==n||l){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,n),t=e}}}return i},xi=(t,e,i=t)=>(t._$AI(e,i),t),wi={},$i=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let i=t._$AA;const o=t._$AB.nextSibling;for(;i!==o;){const t=i.nextSibling;i.remove(),i=t}},Oi=(t,e,i)=>{const o=new Map;for(let s=e;s<=i;s++)o.set(t[s],s);return o},Si=Nt(class extends Ct{constructor(t){if(super(t),t.type!==kt)throw Error("repeat() can only be used in text expressions")}ht(t,e,i){let o;void 0===i?i=e:void 0!==e&&(o=e);const s=[],n=[];let r=0;for(const e of t)s[r]=o?o(e,r):r,n[r]=i(e,r),r++;return{values:n,keys:s}}render(t,e,i){return this.ht(t,e,i).values}update(t,[e,i,o]){var s;const n=(t=>t._$AH)(t),{values:r,keys:l}=this.ht(e,i,o);if(!Array.isArray(n))return this.ut=l,r;const a=null!==(s=this.ut)&&void 0!==s?s:this.ut=[],h=[];let c,d,p=0,u=n.length-1,f=0,v=r.length-1;for(;p<=u&&f<=v;)if(null===n[p])p++;else if(null===n[u])u--;else if(a[p]===l[f])h[f]=xi(n[p],r[f]),p++,f++;else if(a[u]===l[v])h[v]=xi(n[u],r[v]),u--,v--;else if(a[p]===l[v])h[v]=xi(n[p],r[v]),mi(t,h[v+1],n[p]),p++,v--;else if(a[u]===l[f])h[f]=xi(n[u],r[f]),mi(t,n[p],n[u]),u--,f++;else if(void 0===c&&(c=Oi(l,f,v),d=Oi(a,p,u)),c.has(a[p]))if(c.has(a[u])){const e=d.get(l[f]),i=void 0!==e?n[e]:null;if(null===i){const e=mi(t,n[p]);xi(e,r[f]),h[f]=e}else h[f]=xi(i,r[f]),mi(t,n[p],i),n[e]=null;f++}else $i(n[u]),u--;else $i(n[p]),p++;for(;f<=v;){const e=mi(t,h[v+1]);xi(e,r[f]),h[f++]=e}for(;p<=u;){const t=n[p++];null!==t&&$i(t)}return this.ut=l,((t,e=wi)=>{t._$AH=e})(t,h),H}});
302
+ /**
303
+ * @license
304
+ * Copyright 2017 Google LLC
305
+ * SPDX-License-Identifier: BSD-3-Clause
306
+ */var ki=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const Ni=dt.create("--ft-infinite-scroll-padding","SIZE","0");class Ci extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Ei extends Event{constructor(){super("scrolled-to-target")}}class Ri extends ft{constructor(){super(...arguments),this.items=[],this.renderItem=()=>D``,this.internalScroll=!1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.onVisibilityChange=t=>{const e=t.filter((t=>t.intersectionRect.height>1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>!this.visibleItems.includes(t))),i=t.filter((t=>t.intersectionRect.height<=1)).map((t=>+t.target.attributes.getNamedItem("data-item-index").value)).filter((t=>this.visibleItems.includes(t))),o=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...o].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{this.triggerFindScrollableParent();let e=0;for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index");let o=i.target.parentElement.clientHeight,s=i.contentRect.height;this.alreadyRenderedIndexes.has(t)&&(i.target.parentElement.style.height=s+"px",e+=t<this.visibleItems[0]?o-s:0)}this.scrollable&&xt&&(this.scrollable.scrollTop-=e)},this.resizeObserver=new ResizeObserver(this.onResize),this.onMutation=()=>{[...this.itemsContainer.children].forEach((t=>{this.intersectionObserver.observe(t),this.resizeObserver.observe(t.children.item(0))}))},this.mutationObserver=new MutationObserver(this.onMutation)}get scrollable(){return this.internalScroll?this.internalScrollable:this.firstScrollableParent}render(){return D`
307
+ <div class="items-container ${this.internalScroll?"scrollable":""}"
308
+ tabindex="-1"
309
+ @find-scrollable-parent=${this.findScrollableParent}>
310
+ ${Si(this.items,((t,e)=>this.renderItemContainer(t,e)))}
311
+ </div>
312
+ `}renderItemContainer(t,e){const i=this.scrolledToTarget&&this.visibleItems.includes(e),o=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-1&&e<=(null!=(s=this.visibleItems)?s:[])[(null!=s?s:[]).length-1]+1;var s;o&&this.alreadyRenderedIndexes.add(e);return D`
313
+ <div id="item-${e}"
314
+ class="item-container"
315
+ data-item-index="${e}">
316
+ <div class="resizable ${i?"visible":""} ${o?"rendered":""}">
317
+ ${o?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?D`${Rt(i)}`:i})():null}
318
+ </div>
319
+ </div>
320
+ `}resetScroll(){this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t,e;let i=null!==(t=this.scrollToIndex)&&void 0!==t?t:this.scrollToItem?this.items.indexOf(this.scrollToItem):-1;i>=this.items.length&&(i=-1);let o=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${i}`);o&&o.scrollIntoView({block:"start"}),this.onMutation(),setTimeout((()=>{this.scrolledToTarget=!0}),10)}))}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{rootMargin:"-2px",threshold:[0,.01,.1]}),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}triggerFindScrollableParent(){this.itemsContainer.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){t.stopPropagation();for(let e of t.composedPath()){const t=e;if(t.clientHeight&&t.clientHeight<t.scrollHeight&&["auto","scroll"].includes(getComputedStyle(t).overflowY)){this.firstScrollableParent=t;break}}}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.mutationObserver.disconnect()}firstUpdated(t){super.firstUpdated(t),this.resetScroll()}update(t){super.update(t),t.has("items")&&(this.alreadyRenderedIndexes=new Set),(t.has("scrollToItem")||t.has("scrollToIndex"))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new Ci(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&this.dispatchEvent(new Ei)}}Ri.styles=f`
321
+ .items-container {
322
+ position: relative;
323
+ padding: ${Ni};
324
+ outline: none;
325
+ }
326
+
327
+ .scrollable {
328
+ height: 100%;
329
+ overflow-y: auto;
330
+ }
331
+
332
+ .item-container {
333
+ height: 100vh;
334
+ }
335
+
336
+ .item-container + .item-container {
337
+ /*
338
+ We add a gap between items to be sure to hide the content above the targeted item
339
+ When a div is visible (even by a fraction of a pixel) if its height changes
340
+ the browser will try to keep the scroll stable in relation to the first visible element
341
+ By adding this gap we ensure that the previous item will be fully hidden and event if its size changes, it will not impact the scroll offset
342
+ */
343
+ margin-top: 4px;
344
+ }
345
+
346
+ .scrollable .item-container {
347
+ height: 100%;
348
+ }
349
+
350
+ .resizable:not(.rendered) {
351
+ width: 0;
352
+ }
353
+ `,ki([o({type:Array})],Ri.prototype,"items",void 0),ki([o({attribute:!1})],Ri.prototype,"renderItem",void 0),ki([o({type:Object})],Ri.prototype,"scrollToItem",void 0),ki([o({type:Number})],Ri.prototype,"scrollToIndex",void 0),ki([o({type:Boolean})],Ri.prototype,"internalScroll",void 0),ki([s({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],Ri.prototype,"visibleItems",void 0),ki([n(".scrollable")],Ri.prototype,"internalScrollable",void 0),ki([n(".items-container")],Ri.prototype,"itemsContainer",void 0),ki([s()],Ri.prototype,"scrolledToTarget",void 0),l("ft-infinite-scroll")(Ri);var Mi=function(t,e,i,o){for(var s,n=arguments.length,r=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(r=(n<3?s(r):n>3?s(e,i,r):s(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class Ui extends Ot{constructor(){super(...arguments),this.renderTopic=t=>D`
354
+ <ft-reader-topic tocId="${t}" .exportpartsPrefix=${"topic"}></ft-reader-topic>
355
+ `,this.visibleTopicsDebouncer=new e(100)}render(){var t;return D`
356
+ <ft-infinite-scroll class="ft-reader-content"
357
+ .items=${(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[]}
358
+ .renderItem=${this.renderTopic}
359
+ .scrollToItem=${this.getScrollTarget()}
360
+ exportpartsPrefix="scroller"
361
+ @visible-items-change=${this.visibleTopicChange}
362
+ @scrolled-to-target=${this.onScrollDone}
363
+ >
364
+
365
+ </ft-infinite-scroll>
366
+ `}getScrollTarget(){var t,e,i,o,s;const n=null!==(o=null===(t=this.visibleTopics)||void 0===t?void 0:t.includes(null!==(i=null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)&&void 0!==i?i:""))&&void 0!==o&&o;return!(null===(s=this.scrollTarget)||void 0===s?void 0:s.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;null==(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)&&(null===(e=this.stateManager)||void 0===e||e.scrollDone())}}Ui.elementDefinitions={"ft-infinite-scroll":Ri},Ui.styles=f`
367
+ `,Mi([o()],Ui.prototype,"renderTopic",void 0),Mi([vt()],Ui.prototype,"currentPage",void 0),Mi([vt()],Ui.prototype,"scrollTarget",void 0),Mi([vt()],Ui.prototype,"visibleTopics",void 0),Mi([n(".ft-reader-content")],Ui.prototype,"container",void 0),l("ft-reader-content")(Ui),t.FtReaderContent=Ui,t.FtReaderContentCssVariables={},Object.defineProperty(t,"i",{value:!0})}({});
@@ -0,0 +1,2 @@
1
+ export * from "./ft-reader-content";
2
+ //# sourceMappingURL=index.d.ts.map
package/build/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { customElement } from "@fluid-topics/ft-wc-utils";
2
+ import { FtReaderContent } from "./ft-reader-content";
3
+ export * from "./ft-reader-content";
4
+ customElement("ft-reader-content")(FtReaderContent);
5
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "@fluid-topics/ft-reader-content",
3
+ "version": "0.3.7",
4
+ "description": "Main content for integrated reader",
5
+ "keywords": [
6
+ "Lit"
7
+ ],
8
+ "author": "Fluid Topics <devtopics@antidot.net>",
9
+ "license": "ISC",
10
+ "main": "build/index.js",
11
+ "web": "build/ft-reader-content.min.js",
12
+ "typings": "build/index",
13
+ "files": [
14
+ "build/**/*.js",
15
+ "build/**/*.ts"
16
+ ],
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
+ },
21
+ "dependencies": {
22
+ "@fluid-topics/ft-infinite-scroll": "0.3.7",
23
+ "@fluid-topics/ft-reader-context": "0.3.7",
24
+ "@fluid-topics/ft-reader-topic": "0.3.7",
25
+ "@fluid-topics/ft-wc-utils": "0.3.7",
26
+ "lit": "2.2.8"
27
+ },
28
+ "gitHead": "fe65a046ba9d3df70aac994a4e0aac1b550df72f"
29
+ }