@fluid-topics/ft-reader-content 0.3.58 → 0.3.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(t,e,i,s,r,n){var o=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class h extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store)}clearStateManager(){this.stateManager&&(this.removeStore(
|
|
1
|
+
!function(t,e,i,s,r,n){var o=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class h extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this.registerIntervalReader=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this.registerIntervalReader):this.dispatchEvent(new l)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o([s.state()],e.prototype,"stateManager",void 0),e}(e.FtLitElementRedux)){}const a=e.FtCssVariableFactory.create("--ft-infinite-scroll-padding","SIZE","0"),d=i.css`
|
|
2
2
|
.items-container {
|
|
3
3
|
position: relative;
|
|
4
4
|
padding: ${a};
|
|
@@ -46,17 +46,12 @@
|
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
48
|
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;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 i=this.getItem(e);this.scrollToTarget(i),this.onMutation(),this.scrollDoneDebouncer.run((()=>{this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,r=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&r){e=t;break}r&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}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")&&(null!=this.scrollToItem||null!=this.scrollToIndex))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new v(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new u)}}p.styles=d,c([s.property({type:Array})],p.prototype,"items",void 0),c([s.property({attribute:!1})],p.prototype,"renderItem",void 0),c([s.property({type:Object})],p.prototype,"scrollToItem",void 0),c([s.property({type:Number})],p.prototype,"scrollToIndex",void 0),c([s.property({type:Boolean})],p.prototype,"internalScroll",void 0),c([s.property({type:Number})],p.prototype,"renderBeforeFirst",void 0),c([s.property({type:Number})],p.prototype,"renderAfterLast",void 0),c([s.state({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],p.prototype,"visibleItems",void 0),c([s.query(".scrollable")],p.prototype,"internalScrollable",void 0),c([s.query(".items-container")],p.prototype,"itemsContainer",void 0),c([s.state()],p.prototype,"scrolledToTarget",void 0),e.customElement("ft-infinite-scroll")(p);const f=i.css`
|
|
49
|
-
`,b=
|
|
50
|
-
|
|
51
|
-
box-sizing: border-box;
|
|
52
|
-
color: ${b};
|
|
53
|
-
background-color: ${m};
|
|
54
|
-
}
|
|
55
|
-
`;var x=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class I extends h{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return i.html`
|
|
49
|
+
`,b=i.css`
|
|
50
|
+
`;var m=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class g extends h{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return i.html`
|
|
56
51
|
<article id=${this.tocId}>
|
|
57
52
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
58
53
|
</article>
|
|
59
|
-
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}
|
|
54
|
+
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}g.styles=b,m([e.redux((t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}))],g.prototype,"mapId",void 0),m([s.property()],g.prototype,"tocId",void 0),m([s.property({type:Boolean})],g.prototype,"disableContextInteractions",void 0),m([s.state()],g.prototype,"tocNode",void 0),e.customElement("ft-reader-topic-context")(g);var x=function(t,e,i,s){for(var r,n=arguments.length,o=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(o=(n<3?r(o):n>3?r(e,i,o):r(e,i))||o);return n>3&&o&&Object.defineProperty(e,i,o),o};class I extends h{constructor(){super(...arguments),this.renderTopic=()=>i.html`
|
|
60
55
|
<ft-reader-topic-title></ft-reader-topic-title>
|
|
61
56
|
<ft-reader-topic-content></ft-reader-topic-content>
|
|
62
57
|
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e.Debouncer(100)}render(){var t;const e=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===e.length?i.nothing:i.html`
|
|
@@ -75,4 +70,4 @@
|
|
|
75
70
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
76
71
|
${this.renderTopic(t,e)}
|
|
77
72
|
</ft-reader-topic-context>
|
|
78
|
-
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=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!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}
|
|
73
|
+
`}getScrollTarget(){var t,e,i,s,r;if(this.disableContextInteractions)return null;const n=null!==(s=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!==s&&s;return!(null===(r=this.scrollTarget)||void 0===r?void 0:r.tocId)||n&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}I.elementDefinitions={"ft-infinite-scroll":p},I.styles=f,x([s.property()],I.prototype,"renderTopic",void 0),x([s.property({type:Boolean})],I.prototype,"disableContextInteractions",void 0),x([e.redux()],I.prototype,"currentPage",void 0),x([e.redux()],I.prototype,"scrollTarget",void 0),x([e.redux()],I.prototype,"visibleTopics",void 0),x([e.redux((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}))],I.prototype,"renderBeforeFirst",void 0),x([e.redux((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}))],I.prototype,"renderAfterLast",void 0),x([s.query(".ft-reader-content")],I.prototype,"container",void 0),e.customElement("ft-reader-content")(I),t.FtReaderContent=I,t.FtReaderContentCssVariables={},t.styles=f,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litRepeat,ftGlobals.litUnsafeHTML);
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,s=window.customElements,
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,s=window.customElements,n=new WeakMap,r=new WeakMap,o=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,n){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(n))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const l=n.prototype.attributeChangedCallback,a=new Set(n.observedAttributes||[]);d(n,a,l);const h={elementClass:n,connectedCallback:n.prototype.connectedCallback,disconnectedCallback:n.prototype.disconnectedCallback,adoptedCallback:n.prototype.adoptedCallback,attributeChangedCallback:l,formAssociated:n.formAssociated,formAssociatedCallback:n.prototype.formAssociatedCallback,formDisabledCallback:n.prototype.formDisabledCallback,formResetCallback:n.prototype.formResetCallback,formStateRestoreCallback:n.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,h),this._definitionsByClass.set(n,h);let c=i.call(s,t);c||(c=u(t),e.call(s,t,c)),this===window.customElements&&(o.set(n,h),h.standInClass=c);const p=this._awaitingUpgrade.get(t);if(p){this._awaitingUpgrade.delete(t);for(const t of p)r.delete(t),f(t,h,!0)}const v=this._whenDefinedPromises.get(t);return void 0!==v&&(v.resolve(n),this._whenDefinedPromises.delete(t)),n}upgrade(){b.push(this),s.upgrade.apply(s,arguments),b.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 s=this._awaitingUpgrade.get(e);s||this._awaitingUpgrade.set(e,s=new Set),i?s.add(t):s.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const i=o.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),n.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=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),h(e)||(e=l.get(e)?.getRootNode()||document)}return e.customElements},u=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const s=c(i)||window.customElements,n=s._getDefinition(e);return n?f(i,n):r.set(i,s),i}connectedCallback(){const t=n.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=n.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):r.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){n.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=n.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=n.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=n.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=n.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,n){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);s.call(this,r,n),i.call(this,r,t,n)}else s.call(this,r,n)});const n=t.prototype.removeAttribute;n&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);n.call(this,s),i.call(this,s,t,null)}else n.call(this,s)})},p=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t||"HTMLElement"===i?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):p(i)},f=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),n.set(t,e),a=t;try{new e.elementClass}catch(t){p(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 b=[document];const m=(t,e,i)=>{const s=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=s.apply(i||this,arguments);return void 0!==t&&l.set(t,this),b.pop(),t}};m(ShadowRoot,"createElement",document),m(ShadowRoot,"importNode",document),m(Element,"insertAdjacentHTML");const x=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){b.push(this),i.set.call(this,t),b.pop()}})};if(x(Element,"innerHTML"),x(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 s=e.call(this,...i);return t.set(s,this),s},i.forEach((e=>{const i=window.ElementInternals.prototype,s=i[e];i[e]=function(...e){const i=t.get(this);if(!0!==n.get(i).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...e)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class r{constructor(t){const e=new Map;t.forEach(((t,i)=>{const s=t.getAttribute("name"),n=e.get(s)||[];this[+i]=t,n.push(t),e.set(s,n)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new s(t))}))}namedItem(t){return this[t]}}const o=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=o.get.call(this,[]),e=[];for(const i of t){const t=n.get(i);t&&!0!==t.formAssociated||e.push(i)}return new r(e)}})}}try{window.customElements.define("custom-element",null)}catch(Lt){const t=window.customElements.define;window.customElements.define=(e,i,s)=>{try{t.bind(window.customElements)(e,i,s)}catch(t){console.info(e,i,s,t)}}}class e{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,e){return this.callbacks=[t],this.debounce(e)}queue(t,e){return this.callbacks.push(t),this.debounce(e)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return null==this.promise&&(this.promise=new Promise(((t,e)=>{this.resolvePromise=t,this.rejectPromise=e}))),this.clearTimeout(),this._debounce=window.setTimeout((()=>this.runCallbacks()),null!=t?t:this.timeout),this.promise}async runCallbacks(){var t,e;const i=[...this.callbacks];this.callbacks=[];const s=null!==(t=this.rejectPromise)&&void 0!==t?t:()=>null,n=null!==(e=this.resolvePromise)&&void 0!==e?e:()=>null;this.clearPromise();for(let t of i)try{await t()}catch(t){return void s(t)}n(!0)}clearTimeout(){null!=this._debounce&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}}
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
@@ -24,7 +24,7 @@ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.cust
|
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
|
-
*/}function
|
|
27
|
+
*/}function n(t){return s({...t,state:!0})}
|
|
28
28
|
/**
|
|
29
29
|
* @license
|
|
30
30
|
* Copyright 2017 Google LLC
|
|
@@ -35,45 +35,46 @@ if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.cust
|
|
|
35
35
|
* Copyright 2017 Google LLC
|
|
36
36
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
37
37
|
*/
|
|
38
|
-
function
|
|
38
|
+
function r(t,e){return(({finisher:t,descriptor:e})=>(i,s)=>{var n;if(void 0===s){const s=null!==(n=i.originalKey)&&void 0!==n?n:i.key,r=null!=e?{kind:"method",placement:"prototype",key:s,descriptor:e(i.key)}:{...i,key:s};return null!=t&&(r.finisher=function(e){t(e,s)}),r}{const n=i.constructor;void 0!==e&&Object.defineProperty(i,s,e(s)),null==t||t(n,s)}})({descriptor:i=>{const s={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;s.get=function(){var i,s;return void 0===this[e]&&(this[e]=null!==(s=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(t))&&void 0!==s?s:null),this[e]}}return s}})}
|
|
39
39
|
/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2021 Google LLC
|
|
42
42
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
43
|
-
*/var
|
|
43
|
+
*/var o;function l(t,e){try{return function(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,s,n;if(Array.isArray(t)){if((i=t.length)!=e.length)return!1;for(s=i;0!=s--;)if(!l(t[s],e[s]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[0]))return!1;for(s of t.entries())if(!l(s[1],e.get(s[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(s of t.entries())if(!e.has(s[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=(n=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(s=i;0!=s--;)if(!Object.prototype.hasOwnProperty.call(e,n[s]))return!1;for(s=i;0!=s--;){var r=n[s];if(!l(t[r],e[r]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}null===(o=window.HTMLSlotElement)||void 0===o||o.prototype.assignedElements;const a=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};
|
|
44
44
|
/**
|
|
45
45
|
* @license
|
|
46
46
|
* Copyright 2019 Google LLC
|
|
47
47
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
49
|
+
const h=window,c=h.ShadowRoot&&(void 0===h.ShadyCSS||h.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,u=Symbol(),d=new WeakMap;class p{constructor(t,e,i){if(this._$cssResult$=!0,i!==u)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(c&&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 f=t=>new p("string"==typeof t?t:t+"",void 0,u),v=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,s)=>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[s+1]),t[0]);return new p(i,t,u)},b=(t,e)=>{c?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const i=document.createElement("style"),s=h.litNonce;void 0!==s&&i.setAttribute("nonce",s),i.textContent=e.cssText,t.appendChild(i)}))},m=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return f(e)})(t):t
|
|
50
50
|
/**
|
|
51
51
|
* @license
|
|
52
52
|
* Copyright 2017 Google LLC
|
|
53
53
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
54
|
-
*/;var
|
|
54
|
+
*/;var x;const g=window,w=g.trustedTypes,y=w?w.emptyScript:"",O=g.reactiveElementPolyfillSupport,C={toAttribute(t,e){switch(e){case Boolean:t=t?y: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}},S=(t,e)=>e!==t&&(e==e||t==t),$={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:S};class N 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 s=this._$Ep(i,e);void 0!==s&&(this._$Ev.set(s,i),t.push(s))})),t}static createProperty(t,e=$){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,s=this.getPropertyDescriptor(t,i,e);void 0!==s&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){const n=this[t];this[e]=s,this.requestUpdate(t,n,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||$}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(m(t))}else void 0!==t&&e.push(m(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 b(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=$){var s;const n=this.constructor._$Ep(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==(null===(s=i.converter)||void 0===s?void 0:s.toAttribute)?i.converter:C).toAttribute(e,i.type);this._$El=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$El=null}}_$AK(t,e){var i;const s=this.constructor,n=s._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=s.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:C;this._$El=n,this[n]=r.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let s=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||S)(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))):s=!1),!this.isUpdatePending&&s&&(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){}}
|
|
55
55
|
/**
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
59
|
*/
|
|
60
|
-
var E;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:N}),(null!==(
|
|
60
|
+
var E;N.finalized=!0,N.elementProperties=new Map,N.elementStyles=[],N.shadowRootOptions={mode:"open"},null==O||O({ReactiveElement:N}),(null!==(x=g.reactiveElementVersions)&&void 0!==x?x:g.reactiveElementVersions=[]).push("1.4.1");const R=window,M=R.trustedTypes,k=M?M.createPolicy("lit-html",{createHTML:t=>t}):void 0,U=`lit$${(Math.random()+"").slice(9)}$`,T="?"+U,j=`<${T}>`,A=document,F=(t="")=>A.createComment(t),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,L=Array.isArray,B=t=>L(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),_=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,K=/>/g,P=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),D=/'/g,z=/"/g,H=/^(?:script|style|textarea|title)$/i,Z=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),J=Symbol.for("lit-noChange"),V=Symbol.for("lit-nothing"),q=new WeakMap,X=A.createTreeWalker(A,129,null,!1),G=(t,e)=>{const i=t.length-1,s=[];let n,r=2===e?"<svg>":"",o=_;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(o.lastIndex=c,a=o.exec(i),null!==a);)c=o.lastIndex,o===_?"!--"===a[1]?o=W:void 0!==a[1]?o=K:void 0!==a[2]?(H.test(a[2])&&(n=RegExp("</"+a[2],"g")),o=P):void 0!==a[3]&&(o=P):o===P?">"===a[0]?(o=null!=n?n:_,h=-1):void 0===a[1]?h=-2:(h=o.lastIndex-a[2].length,l=a[1],o=void 0===a[3]?P:'"'===a[3]?z:D):o===z||o===D?o=P:o===W||o===K?o=_:(o=P,n=void 0);const u=o===P&&t[e+1].startsWith("/>")?" ":"";r+=o===_?i+j:h>=0?(s.push(l),i.slice(0,h)+"$lit$"+i.slice(h)+U+u):i+U+(-2===h?(s.push(void 0),e):u)}const l=r+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==k?k.createHTML(l):l,s]};class Q{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let n=0,r=0;const o=t.length-1,l=this.parts,[a,h]=G(t,e);if(this.el=Q.createElement(a,i),X.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(s=X.nextNode())&&l.length<o;){if(1===s.nodeType){if(s.hasAttributes()){const t=[];for(const e of s.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(U)){const i=h[r++];if(t.push(e),void 0!==i){const t=s.getAttribute(i.toLowerCase()+"$lit$").split(U),e=/([.?@])?(.*)/.exec(i);l.push({type:1,index:n,name:e[2],strings:t,ctor:"."===e[1]?st:"?"===e[1]?rt:"@"===e[1]?ot:it})}else l.push({type:6,index:n})}for(const e of t)s.removeAttribute(e)}if(H.test(s.tagName)){const t=s.textContent.split(U),e=t.length-1;if(e>0){s.textContent=M?M.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],F()),X.nextNode(),l.push({type:2,index:++n});s.append(t[e],F())}}}else if(8===s.nodeType)if(s.data===T)l.push({type:2,index:n});else{let t=-1;for(;-1!==(t=s.data.indexOf(U,t+1));)l.push({type:7,index:n}),t+=U.length-1}n++}}static createElement(t,e){const i=A.createElement("template");return i.innerHTML=t,i}}function Y(t,e,i=t,s){var n,r,o,l;if(e===J)return e;let a=void 0!==s?null===(n=i._$Co)||void 0===n?void 0:n[s]:i._$Cl;const h=I(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==h&&(null===(r=null==a?void 0:a._$AO)||void 0===r||r.call(a,!1),void 0===h?a=void 0:(a=new h(t),a._$AT(t,i,s)),void 0!==s?(null!==(o=(l=i)._$Co)&&void 0!==o?o:l._$Co=[])[s]=a:i._$Cl=a),void 0!==a&&(e=Y(t,a._$AS(t,e.values),a,s)),e}class tt{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:s}=this._$AD,n=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:A).importNode(i,!0);X.currentNode=n;let r=X.nextNode(),o=0,l=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new et(r,r.nextSibling,this,t):1===a.type?e=new a.ctor(r,a.name,a.strings,this,t):6===a.type&&(e=new lt(r,this,t)),this.u.push(e),a=s[++l]}o!==(null==a?void 0:a.index)&&(r=X.nextNode(),o++)}return n}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class et{constructor(t,e,i,s){var n;this.type=2,this._$AH=V,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cm=null===(n=null==s?void 0:s.isConnected)||void 0===n||n}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}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=Y(this,t,e),I(t)?t===V||null==t||""===t?(this._$AH!==V&&this._$AR(),this._$AH=V):t!==this._$AH&&t!==J&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):B(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==V&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(A.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:s}=t,n="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=Q.createElement(s.h,this.options)),s);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===n)this._$AH.p(i);else{const t=new tt(n,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=q.get(t.strings);return void 0===e&&q.set(t.strings,e=new Q(t)),e}k(t){L(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const n of t)s===e.length?e.push(i=new et(this.O(F()),this.O(F()),this,this.options)):i=e[s],i._$AI(n),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$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._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class it{constructor(t,e,i,s,n){this.type=1,this._$AH=V,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=V}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){const n=this.strings;let r=!1;if(void 0===n)t=Y(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==J,r&&(this._$AH=t);else{const s=t;let o,l;for(t=n[0],o=0;o<n.length-1;o++)l=Y(this,s[i+o],e,o),l===J&&(l=this._$AH[o]),r||(r=!I(l)||l!==this._$AH[o]),l===V?t=V:t!==V&&(t+=(null!=l?l:"")+n[o+1]),this._$AH[o]=l}r&&!s&&this.j(t)}j(t){t===V?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class st extends it{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===V?void 0:t}}const nt=M?M.emptyScript:"";class rt extends it{constructor(){super(...arguments),this.type=4}j(t){t&&t!==V?this.element.setAttribute(this.name,nt):this.element.removeAttribute(this.name)}}class ot extends it{constructor(t,e,i,s,n){super(t,e,i,s,n),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=Y(this,t,e,0))&&void 0!==i?i:V)===J)return;const s=this._$AH,n=t===V&&s!==V||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,r=t!==V&&(s===V||n);n&&this.element.removeEventListener(this.name,this,s),r&&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 lt{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){Y(this,t)}}const at={P:"$lit$",A:U,M:T,C:1,L:G,R:tt,D:B,V:Y,I:et,H:it,N:rt,U:ot,B:st,F:lt},ht=R.litHtmlPolyfillSupport;null==ht||ht(Q,et),(null!==(E=R.litHtmlVersions)&&void 0!==E?E:R.litHtmlVersions=[]).push("2.4.0");
|
|
61
61
|
/**
|
|
62
62
|
* @license
|
|
63
63
|
* Copyright 2017 Google LLC
|
|
64
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
65
|
*/
|
|
66
|
-
var
|
|
66
|
+
var ct,ut;class dt extends N{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 s,n;const r=null!==(s=null==i?void 0:i.renderBefore)&&void 0!==s?s:e;let o=r._$litPart$;if(void 0===o){const t=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:null;r._$litPart$=o=new et(e.insertBefore(F(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(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 J}}dt.finalized=!0,dt._$litElement$=!0,null===(ct=globalThis.litElementHydrateSupport)||void 0===ct||ct.call(globalThis,{LitElement:dt});const pt=globalThis.litElementPolyfillSupport;null==pt||pt({LitElement:dt}),(null!==(ut=globalThis.litElementVersions)&&void 0!==ut?ut:globalThis.litElementVersions=[]).push("3.2.2");class ft{static create(t,e,i){let s=t=>f(null!=t?t:i),n=v`var(${f(t)}, ${s(i)})`;return n.name=t,n.category=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>v`var(${f(t)}, ${s(e)})`,n.breadcrumb=()=>[],n.lastResortDefaultValue=()=>i,n}static extend(t,e,i){let s=t=>e.get(null!=t?t:i),n=v`var(${f(t)}, ${s(i)})`;return n.name=t,n.category=e.category,n.fallbackVariable=e,n.defaultValue=i,n.defaultCssValue=s,n.get=e=>v`var(${f(t)}, ${s(e)})`,n.breadcrumb=()=>[e.name,...e.breadcrumb()],n.lastResortDefaultValue=()=>i,n}static external(t,e){let i=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):f(null!=e?e:t.defaultValue),s=v`var(${f(t.name)}, ${i(t.defaultValue)})`;return s.name=t.name,s.category=t.category,s.fallbackVariable=t.fallbackVariable,s.defaultValue=t.defaultValue,s.context=e,s.defaultCssValue=i,s.get=e=>v`var(${f(t.name)}, ${i(e)})`,s.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],s.lastResortDefaultValue=()=>{var e,i;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(i=t.fallbackVariable)||void 0===i?void 0:i.lastResortDefaultValue()},s}}ft.create("--ft-color-primary","COLOR","#2196F3"),ft.create("--ft-color-primary-variant","COLOR","#1976D2"),ft.create("--ft-color-secondary","COLOR","#FFCC80"),ft.create("--ft-color-secondary-variant","COLOR","#F57C00"),ft.create("--ft-color-surface","COLOR","#FFFFFF"),ft.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-error","COLOR","#B00020"),ft.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),ft.create("--ft-color-opacity-high","NUMBER","1"),ft.create("--ft-color-opacity-medium","NUMBER","0.74"),ft.create("--ft-color-opacity-disabled","NUMBER","0.38"),ft.create("--ft-color-on-primary","COLOR","#FFFFFF"),ft.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),ft.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),ft.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),ft.create("--ft-color-on-secondary","COLOR","#FFFFFF"),ft.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),ft.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),ft.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),ft.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),ft.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),ft.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),ft.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),ft.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),ft.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),ft.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),ft.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),ft.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),ft.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),ft.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),ft.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),ft.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),ft.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),ft.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),ft.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),ft.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),ft.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),ft.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),ft.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),ft.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),ft.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),ft.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),ft.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.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)"),ft.create("--ft-border-radius-S","SIZE","4px"),ft.create("--ft-border-radius-M","SIZE","8px"),ft.create("--ft-border-radius-L","SIZE","12px"),ft.create("--ft-border-radius-XL","SIZE","16px"),ft.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),ft.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),ft.create("--ft-transition-duration","UNKNOWN","250ms"),ft.create("--ft-transition-timing-function","UNKNOWN","ease-in-out");var vt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class bt extends(
|
|
67
67
|
/**
|
|
68
68
|
* @license
|
|
69
69
|
* Copyright 2021 Google LLC
|
|
70
70
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
71
|
-
*/
|
|
72
|
-
|
|
71
|
+
*/
|
|
72
|
+
function(t){return class extends t{createRenderRoot(){const t=this.constructor,{registry:e,elementDefinitions:i,shadowRootOptions:s}=t;i&&!e&&(t.registry=new CustomElementRegistry,Object.entries(i).forEach((([e,i])=>t.registry.define(e,i))));const n=this.renderOptions.creationScope=this.attachShadow({...s,customElements:t.registry});return b(n,this.constructor.elementStyles),n}}}(dt)){constructor(){super(),this.exportpartsDebouncer=new e(5),this.constructorName=this.constructor.name,this.constructorPrototype=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this.constructorName&&Object.setPrototypeOf(this,this.constructorPrototype)}getStyles(){return[]}getTemplate(){return null}render(){let t=this.getStyles();return Array.isArray(t)||(t=[t]),Z`
|
|
73
|
+
${t.map((t=>Z`
|
|
73
74
|
<style>${t}</style>
|
|
74
75
|
`))}
|
|
75
76
|
${this.getTemplate()}
|
|
76
|
-
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,s,r,o
|
|
77
|
+
`}updated(t){super.updated(t),setTimeout((()=>{this.contentAvailableCallback(t),this.scheduleExportpartsUpdate()}),0)}contentAvailableCallback(t){var e,i;if((null!==(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelectorAll(".ft-lit-element--custom-stylesheet"))&&void 0!==i?i:[]).forEach((t=>t.remove())),this.customStylesheet){const t=document.createElement("style");t.classList.add("ft-lit-element--custom-stylesheet"),t.innerHTML=this.customStylesheet,this.shadowRoot.append(t)}}scheduleExportpartsUpdate(){this.exportpartsDebouncer.run((()=>{var t;(null===(t=this.exportpartsPrefix)||void 0===t?void 0:t.trim())?this.setExportpartsAttribute([this.exportpartsPrefix]):null!=this.exportpartsPrefixes&&this.exportpartsPrefixes.length>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)}))}setExportpartsAttribute(t){var e,i,s,n,r,o;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!==(n=null===(s=t.getAttribute("part"))||void 0===s?void 0:s.split(" "))&&void 0!==n?n:[],i=null!==(o=null===(r=t.getAttribute("exportparts"))||void 0===r?void 0:r.split(",").map((t=>t.split(":")[1])))&&void 0!==o?o:[];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(", "))}}vt([s()],bt.prototype,"exportpartsPrefix",void 0),vt([function(t,e){const i=()=>JSON.parse(JSON.stringify(t));return s({type:Object,converter:{fromAttribute:t=>{if(null==t)return i();try{return JSON.parse(t)}catch{return i()}},toAttribute:t=>JSON.stringify(t)},hasChanged:(t,e)=>!l(t,e),...null!=e?e:{}})}([])],bt.prototype,"exportpartsPrefixes",void 0),vt([s()],bt.prototype,"customStylesheet",void 0),v`
|
|
77
78
|
.ft-no-text-select {
|
|
78
79
|
-webkit-touch-callout: none;
|
|
79
80
|
-webkit-user-select: none;
|
|
@@ -105,17 +106,17 @@ var ht,ut;class dt extends N{constructor(){super(...arguments),this.renderOption
|
|
|
105
106
|
display: inline-block;
|
|
106
107
|
width: 0;
|
|
107
108
|
}
|
|
108
|
-
`;const
|
|
109
|
+
`;const mt=t=>"object"==typeof t&&(0===Object.keys(t).length||"string"==typeof t.store||null!=t.selector||"function"==typeof t.hasChanged||null!=t.attribute),xt=(t,e)=>{var i;const s=mt(t)?t:{};return e=null!==(i=null!=e?e:s.hasChanged)&&void 0!==i?i:(t,e)=>!l(t,e),(i,n)=>{var r,o;i.constructor.createProperty(n,{hasChanged:e,attribute:null!==(r=s.attribute)&&void 0!==r&&r});const l=i;l.reduxProperties=l.reduxProperties||new Map;const a=null!==(o=mt(t)?s.selector:t)&&void 0!==o?o:t=>t[n];l.reduxProperties.set(n,{selector:a,store:s.store})}};class gt extends bt{constructor(){super(...arguments),this.internalStoresUnsubscribers=new Map,this.internalStores=new Map}getUnnamedStore(){if(this.internalStores.size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this.internalStores.values()][0]}get store(){return this.getUnnamedStore()}set store(t){this.unsubscribeFromStores(),this.internalStores.clear(),t&&this.addStore(t)}getStore(t){var e;return null==t?null!==(e=this.getUnnamedStore())&&void 0!==e?e:this.store:this.internalStores.get(t)}addStore(t,e){e=null!=e?e:wt(t)?t.name:"ft-lit-element-redux-default-store",this.unsubscribeFromStore(e),this.setupStore(e,t)}removeStore(t){const e="string"==typeof t?t:wt(t)?t.name:"ft-lit-element-redux-default-store";this.unsubscribeFromStore(e),this.internalStores.delete(e)}setupStore(t,e){this.internalStores.set(t,e),this.updateFromStores(),this.subscribeToStore(t,e)}setupStores(){this.unsubscribeFromStores(),0===this.internalStores.size&&null!=this.store?this.addStore(this.store):(this.updateFromStores(),this.internalStores.forEach(((t,e)=>this.subscribeToStore(e,t))))}updateFromStores(){this.reduxProperties&&this.reduxProperties.forEach(((t,e)=>{const i=this.constructor.getPropertyOptions(e);if(!(null==i?void 0:i.attribute)||!this.hasAttribute("string"==typeof(null==i?void 0:i.attribute)?i.attribute:e)){const i=this.getStore(t.store);i&&(this[e]=t.selector(i.getState(),this))}}))}subscribeToStore(t,e){this.internalStoresUnsubscribers.set(t,e.subscribe((()=>this.updateFromStores()))),this.onStoreAvailable(t)}unsubscribeFromStores(){Object.keys(this.internalStoresUnsubscribers).forEach((t=>this.unsubscribeFromStore(t)))}unsubscribeFromStore(t){this.internalStoresUnsubscribers.has(t)&&this.internalStoresUnsubscribers.get(t)(),this.internalStoresUnsubscribers.delete(t)}onStoreAvailable(t){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){this.unsubscribeFromStores(),super.disconnectedCallback()}}function wt(t){var e;return null===(e=t)||void 0===e?void 0:e.isFtReduxStore}var yt,Ot;navigator.vendor&&navigator.vendor.match(/apple/i)||(null===(Ot=null===(yt=window.safari)||void 0===yt?void 0:yt.pushNotification)||void 0===Ot||Ot.toString());var Ct=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class St extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class $t extends(function(t){class e extends t{constructor(){super(...arguments),this.registerIntervalReader=0}setReaderStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),this.registerIntervalReader=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this.registerIntervalReader):this.dispatchEvent(new St)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return Ct([n()],e.prototype,"stateManager",void 0),e}(gt)){}
|
|
109
110
|
/**
|
|
110
111
|
* @license
|
|
111
112
|
* Copyright 2017 Google LLC
|
|
112
113
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
113
|
-
*/const
|
|
114
|
+
*/const Nt=2,Et=t=>(...e)=>({_$litDirective$:t,values:e});class Rt{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)}}
|
|
114
115
|
/**
|
|
115
116
|
* @license
|
|
116
117
|
* Copyright 2020 Google LLC
|
|
117
118
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
118
|
-
*/const{I:
|
|
119
|
+
*/const{I:Mt}=at,kt=()=>document.createComment(""),Ut=(t,e,i)=>{var s;const n=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=n.insertBefore(kt(),r),s=n.insertBefore(kt(),r);i=new Mt(e,s,t,t.options)}else{const e=i._$AB.nextSibling,o=i._$AM,l=o!==t;if(l){let e;null===(s=i._$AQ)||void 0===s||s.call(i,t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==o._$AU&&i._$AP(e)}if(e!==r||l){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;n.insertBefore(t,r),t=e}}}return i},Tt=(t,e,i=t)=>(t._$AI(e,i),t),jt={},At=t=>{var e;null===(e=t._$AP)||void 0===e||e.call(t,!1,!0);let i=t._$AA;const s=t._$AB.nextSibling;for(;i!==s;){const t=i.nextSibling;i.remove(),i=t}},Ft=(t,e,i)=>{const s=new Map;for(let n=e;n<=i;n++)s.set(t[n],n);return s},It=Et(class extends Rt{constructor(t){if(super(t),t.type!==Nt)throw Error("repeat() can only be used in text expressions")}ht(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const n=[],r=[];let o=0;for(const e of t)n[o]=s?s(e,o):o,r[o]=i(e,o),o++;return{values:r,keys:n}}render(t,e,i){return this.ht(t,e,i).values}update(t,[e,i,s]){var n;const r=(t=>t._$AH)(t),{values:o,keys:l}=this.ht(e,i,s);if(!Array.isArray(r))return this.ut=l,o;const a=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],h=[];let c,u,d=0,p=r.length-1,f=0,v=o.length-1;for(;d<=p&&f<=v;)if(null===r[d])d++;else if(null===r[p])p--;else if(a[d]===l[f])h[f]=Tt(r[d],o[f]),d++,f++;else if(a[p]===l[v])h[v]=Tt(r[p],o[v]),p--,v--;else if(a[d]===l[v])h[v]=Tt(r[d],o[v]),Ut(t,h[v+1],r[d]),d++,v--;else if(a[p]===l[f])h[f]=Tt(r[p],o[f]),Ut(t,r[d],r[p]),p--,f++;else if(void 0===c&&(c=Ft(l,f,v),u=Ft(a,d,p)),c.has(a[d]))if(c.has(a[p])){const e=u.get(l[f]),i=void 0!==e?r[e]:null;if(null===i){const e=Ut(t,r[d]);Tt(e,o[f]),h[f]=e}else h[f]=Tt(i,o[f]),Ut(t,r[d],i),r[e]=null;f++}else At(r[p]),p--;else At(r[d]),d++;for(;f<=v;){const e=Ut(t,h[v+1]);Tt(e,o[f]),h[f++]=e}for(;d<=p;){const t=r[d++];null!==t&&At(t)}return this.ut=l,((t,e=jt)=>{t._$AH=e})(t,h),J}});
|
|
119
120
|
/**
|
|
120
121
|
* @license
|
|
121
122
|
* Copyright 2017 Google LLC
|
|
@@ -126,7 +127,7 @@ var ht,ut;class dt extends N{constructor(){super(...arguments),this.renderOption
|
|
|
126
127
|
* Copyright 2017 Google LLC
|
|
127
128
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
128
129
|
*/
|
|
129
|
-
class
|
|
130
|
+
class Lt extends Rt{constructor(t){if(super(t),this.it=V,t.type!==Nt)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===V||null==t)return this._t=void 0,this.it=t;if(t===J)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:[]}}}Lt.directiveName="unsafeHTML",Lt.resultType=1;const Bt=Et(Lt),_t=ft.create("--ft-infinite-scroll-padding","SIZE","0"),Wt=v`
|
|
130
131
|
.items-container {
|
|
131
132
|
position: relative;
|
|
132
133
|
padding: ${_t};
|
|
@@ -159,35 +160,30 @@ class Pt extends Mt{constructor(t){if(super(t),this.it=J,t.type!==Et)throw Error
|
|
|
159
160
|
.rendered {
|
|
160
161
|
display: flow-root;
|
|
161
162
|
}
|
|
162
|
-
`;var
|
|
163
|
+
`;var Kt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class Pt extends CustomEvent{constructor(t,e){super("visible-items-change",{detail:{visibleIndexes:t,visibleItems:e}})}}class Dt extends Event{constructor(){super("scrolled-to-target")}}class zt extends bt{constructor(){super(...arguments),this.items=[],this.renderItem=()=>Z``,this.internalScroll=!1,this.renderBeforeFirst=1,this.renderAfterLast=1,this.visibleItems=[],this.scrolledToTarget=!1,this.alreadyRenderedIndexes=new Set,this.scrollDebouncer=new e(5),this.scrollDoneDebouncer=new e(10),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))),s=[...this.visibleItems].filter((t=>!i.includes(t)));this.visibleItems=[...e,...s].sort(((t,e)=>t-e))},this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange),this.onResize=t=>{var e;this.triggerFindScrollableParent(),t=t.sort(((t,e)=>t.contentRect.top-e.contentRect.top));for(const i of t){const t=+i.target.parentElement.getAttribute("data-item-index"),s=i.target.parentElement.clientHeight,n=i.contentRect.height;if(this.alreadyRenderedIndexes.has(t)){if(this.scrollable){"none"===(null!==(e=getComputedStyle(this.scrollable).overflowAnchor)&&void 0!==e?e:"none")&&this.getOffset(i.target.parentElement)+s<this.scrollable.scrollTop&&(this.scrollable.scrollTop+=Math.ceil(n-s))}i.target.parentElement.style.height=n+"px"}}},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 Z`
|
|
163
164
|
<div class="items-container ${this.internalScroll?"scrollable":""}"
|
|
164
165
|
tabindex="-1"
|
|
165
166
|
@find-scrollable-parent=${this.findScrollableParent}>
|
|
166
167
|
${It(this.items,((t,e)=>this.renderItemContainer(t,e)))}
|
|
167
168
|
</div>
|
|
168
|
-
`}renderItemContainer(t,e){const i=this.scrolledToTarget&&this.visibleItems.includes(e),s=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=(null!=(
|
|
169
|
+
`}renderItemContainer(t,e){const i=this.scrolledToTarget&&this.visibleItems.includes(e),s=this.alreadyRenderedIndexes.has(e)||this.scrolledToTarget&&e>=this.visibleItems[0]-this.renderBeforeFirst&&e<=(null!=(n=this.visibleItems)?n:[])[(null!=n?n:[]).length-1]+this.renderAfterLast;var n;s&&this.alreadyRenderedIndexes.add(e);return Z`
|
|
169
170
|
<div id="item-${e}"
|
|
170
171
|
class="item-container"
|
|
171
172
|
data-item-index="${e}">
|
|
172
173
|
<div class="resizable ${i?"visible":""} ${s?"rendered":""}">
|
|
173
|
-
${s?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?
|
|
174
|
+
${s?(()=>{const i=this.renderItem(t,e);return"string"==typeof i?Z`${Bt(i)}`:i})():null}
|
|
174
175
|
</div>
|
|
175
176
|
</div>
|
|
176
|
-
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;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 i=this.getItem(e);this.scrollToTarget(i),this.onMutation(),this.scrollDoneDebouncer.run((()=>{this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,
|
|
177
|
-
`,Zt=
|
|
178
|
-
|
|
179
|
-
box-sizing: border-box;
|
|
180
|
-
color: ${Zt};
|
|
181
|
-
background-color: ${Jt};
|
|
182
|
-
}
|
|
183
|
-
`;var Xt=function(t,e,i,s){for(var r,o=arguments.length,n=o<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(r=t[l])&&(n=(o<3?r(n):o>3?r(e,i,n):r(e,i))||n);return o>3&&n&&Object.defineProperty(e,i,n),n};class Gt extends Nt{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return V`
|
|
177
|
+
`}resetScroll(){this.triggerFindScrollableParent(),this.intersectionObserver.disconnect(),this.resizeObserver.disconnect(),this.visibleItems=[],this.scrolledToTarget=!1,this.scrollDebouncer.run((()=>{var t;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 i=this.getItem(e);this.scrollToTarget(i),this.onMutation(),this.scrollDoneDebouncer.run((()=>{this.scrolledToTarget=!0}))}))}getItem(t){var e;return null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector(`#item-${t}`)}scrollToTarget(t){var e;if(t){let i=+(null!==(e=t.getAttribute("data-item-index"))&&void 0!==e?e:"0");this.scrollable&&0===i?this.scrollable.scrollTop=0:t.scrollIntoView({block:"start"})}}getOffset(t){var e;let i=0,s=t;for(;s&&s.offsetParent!==this.scrollable.offsetParent;)i+=s.offsetTop,s=s.offsetParent;return i+(null!==(e=null==s?void 0:s.offsetTop)&&void 0!==e?e:0)-this.scrollable.offsetTop}appendItems(...t){this.items=[...this.items,...t]}prependItems(...t){this.items=[...t,...this.items]}connectedCallback(){super.connectedCallback(),setTimeout((()=>{this.triggerFindScrollableParent(),this.initIntersectionObserver(),this.mutationObserver.disconnect(),this.mutationObserver.observe(this.itemsContainer,{childList:!0})}),0)}initIntersectionObserver(){this.intersectionObserver.disconnect(),this.intersectionObserver=new IntersectionObserver(this.onVisibilityChange,{root:this.scrollable,rootMargin:"-8px",threshold:[0,.01,.1]})}triggerFindScrollableParent(){var t;null===(t=this.itemsContainer)||void 0===t||t.dispatchEvent(new Event("find-scrollable-parent",{composed:!0}))}findScrollableParent(t){let e,i;t.stopPropagation();for(let s of t.composedPath()){const t=s,n=this.elementCanScroll(t);if(t.clientHeight&&t.clientHeight<t.scrollHeight&&n){e=t;break}n&&(i=t)}let s=e||i;s!==this.firstScrollableParent&&(this.firstScrollableParent=s,this.initIntersectionObserver(),this.resetScroll())}elementCanScroll(t){try{return["auto","scroll"].includes(getComputedStyle(t).overflowY)}catch(t){return!1}}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")&&(null!=this.scrollToItem||null!=this.scrollToIndex))&&this.resetScroll()}updated(t){super.updated(t),(t.has("visibleItems")||t.has("items"))&&this.dispatchEvent(new Pt(this.visibleItems,this.visibleItems.map((t=>this.items[t])))),t.has("scrolledToTarget")&&this.scrolledToTarget&&(null!=this.scrollToItem||null!=this.scrollToIndex)&&this.dispatchEvent(new Dt)}}zt.styles=Wt,Kt([s({type:Array})],zt.prototype,"items",void 0),Kt([s({attribute:!1})],zt.prototype,"renderItem",void 0),Kt([s({type:Object})],zt.prototype,"scrollToItem",void 0),Kt([s({type:Number})],zt.prototype,"scrollToIndex",void 0),Kt([s({type:Boolean})],zt.prototype,"internalScroll",void 0),Kt([s({type:Number})],zt.prototype,"renderBeforeFirst",void 0),Kt([s({type:Number})],zt.prototype,"renderAfterLast",void 0),Kt([n({hasChanged:(t,e)=>null!=t&&null==e||t.length!==e.length||t[0]!==e[0]})],zt.prototype,"visibleItems",void 0),Kt([r(".scrollable")],zt.prototype,"internalScrollable",void 0),Kt([r(".items-container")],zt.prototype,"itemsContainer",void 0),Kt([n()],zt.prototype,"scrolledToTarget",void 0),a("ft-infinite-scroll")(zt);const Ht=v`
|
|
178
|
+
`,Zt=v`
|
|
179
|
+
`;var Jt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class Vt extends $t{constructor(){super(...arguments),this.disableContextInteractions=!1,this.registeredComponents=[]}render(){return Z`
|
|
184
180
|
<article id=${this.tocId}>
|
|
185
181
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
186
182
|
</article>
|
|
187
|
-
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}
|
|
183
|
+
`}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions}updated(t){super.updated(t),["mapId","tocId","stateManager"].some((e=>t.has(e)))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach((t=>t.tocNode=this.tocNode))}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await(null===(t=this.service)||void 0===t?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}}Vt.styles=Zt,Jt([xt((t=>{var e;return null===(e=t.map)||void 0===e?void 0:e.id}))],Vt.prototype,"mapId",void 0),Jt([s()],Vt.prototype,"tocId",void 0),Jt([s({type:Boolean})],Vt.prototype,"disableContextInteractions",void 0),Jt([n()],Vt.prototype,"tocNode",void 0),a("ft-reader-topic-context")(Vt);var qt=function(t,e,i,s){for(var n,r=arguments.length,o=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(n=t[l])&&(o=(r<3?n(o):r>3?n(e,i,o):n(e,i))||o);return r>3&&o&&Object.defineProperty(e,i,o),o};class Xt extends $t{constructor(){super(...arguments),this.renderTopic=()=>Z`
|
|
188
184
|
<ft-reader-topic-title></ft-reader-topic-title>
|
|
189
185
|
<ft-reader-topic-content></ft-reader-topic-content>
|
|
190
|
-
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e(100)}render(){var t;const e=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===e.length?
|
|
186
|
+
`,this.disableContextInteractions=!1,this.renderBeforeFirst=5,this.renderAfterLast=10,this.visibleTopicsDebouncer=new e(100)}render(){var t;const e=(null===(t=this.currentPage)||void 0===t?void 0:t.topics)||[];return 0===e.length?V:Z`
|
|
191
187
|
<ft-infinite-scroll class="ft-reader-content"
|
|
192
188
|
.items=${e}
|
|
193
189
|
.renderItem=${(t,e)=>this.renderTopicInContext(t,e)}
|
|
@@ -199,8 +195,8 @@ class Pt extends Mt{constructor(t){if(super(t),this.it=J,t.type!==Et)throw Error
|
|
|
199
195
|
@scrolled-to-target=${this.onScrollDone}
|
|
200
196
|
>
|
|
201
197
|
</ft-infinite-scroll>
|
|
202
|
-
`}renderTopicInContext(t,e){return
|
|
198
|
+
`}renderTopicInContext(t,e){return Z`
|
|
203
199
|
<ft-reader-topic-context tocId="${t}" ?disableContextInteractions=${this.disableContextInteractions}>
|
|
204
200
|
${this.renderTopic(t,e)}
|
|
205
201
|
</ft-reader-topic-context>
|
|
206
|
-
`}getScrollTarget(){var t,e,i,s,
|
|
202
|
+
`}getScrollTarget(){var t,e,i,s,n;if(this.disableContextInteractions)return null;const r=null!==(s=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!==s&&s;return!(null===(n=this.scrollTarget)||void 0===n?void 0:n.tocId)||r&&null!=this.scrollTarget.section?null:this.scrollTarget.tocId}visibleTopicChange(t){this.disableContextInteractions||this.visibleTopicsDebouncer.run((()=>{var e;return null===(e=this.stateManager)||void 0===e?void 0:e.setVisibleTopics(t.detail.visibleItems)}))}onScrollDone(){var t,e;this.disableContextInteractions||null!=(null===(t=this.scrollTarget)||void 0===t?void 0:t.section)||null===(e=this.stateManager)||void 0===e||e.scrollDone()}}Xt.elementDefinitions={"ft-infinite-scroll":zt},Xt.styles=Ht,qt([s()],Xt.prototype,"renderTopic",void 0),qt([s({type:Boolean})],Xt.prototype,"disableContextInteractions",void 0),qt([xt()],Xt.prototype,"currentPage",void 0),qt([xt()],Xt.prototype,"scrollTarget",void 0),qt([xt()],Xt.prototype,"visibleTopics",void 0),qt([xt((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadBeforeFirstVisibleTopic)&&void 0!==i?i:5}))],Xt.prototype,"renderBeforeFirst",void 0),qt([xt((t=>{var e,i;return null!==(i=null===(e=t.configuration)||void 0===e?void 0:e.loadAfterLastVisibleTopic)&&void 0!==i?i:5}))],Xt.prototype,"renderAfterLast",void 0),qt([r(".ft-reader-content")],Xt.prototype,"container",void 0),a("ft-reader-content")(Xt),t.FtReaderContent=Xt,t.FtReaderContentCssVariables={},t.styles=Ht,Object.defineProperty(t,"i",{value:!0})}({});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-content",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.61",
|
|
4
4
|
"description": "Main content for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-infinite-scroll": "0.3.
|
|
23
|
-
"@fluid-topics/ft-reader-topic-content": "0.3.
|
|
24
|
-
"@fluid-topics/ft-reader-topic-context": "0.3.
|
|
25
|
-
"@fluid-topics/ft-reader-topic-title": "0.3.
|
|
26
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-infinite-scroll": "0.3.61",
|
|
23
|
+
"@fluid-topics/ft-reader-topic-content": "0.3.61",
|
|
24
|
+
"@fluid-topics/ft-reader-topic-context": "0.3.61",
|
|
25
|
+
"@fluid-topics/ft-reader-topic-title": "0.3.61",
|
|
26
|
+
"@fluid-topics/ft-wc-utils": "0.3.61",
|
|
27
27
|
"lit": "2.2.8"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "12a4024fb3084b17772a3aef10723d22ae56c877"
|
|
30
30
|
}
|