@fluid-topics/ft-reader-feedback 1.1.9 → 1.1.10
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/build/ft-reader-feedback.light.js +126 -126
- package/build/ft-reader-feedback.min.js +138 -138
- package/package.json +5 -5
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* subject to an additional IP rights grant found at
|
|
13
13
|
* http://polymer.github.io/PATENTS.txt
|
|
14
14
|
*/
|
|
15
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,r=new WeakMap,n=new WeakMap,a=new WeakMap,s=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){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(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const s=r.prototype.attributeChangedCallback,l=new Set(r.observedAttributes||[]);d(r,l,s);const c={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:s,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,c),this._definitionsByClass.set(r,c);let f=i.call(o,t);f||(f=h(t),e.call(o,t,f)),this===window.customElements&&(a.set(r,c),c.standInClass=f);const u=this._awaitingUpgrade.get(t);if(u){this._awaitingUpgrade.delete(t);for(const t of u)n.delete(t),p(t,c,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){g.push(this),o.upgrade.apply(o,arguments),g.pop()}get(t){const e=this._definitionsByTag.get(t);return e?.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=l;if(e)return l=void 0,e;const i=a.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),r.set(e,i),e},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,f=t=>{let e=t.getRootNode();if(!c(e)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),c(e)||(e=s.get(e)?.getRootNode()||document)}return e.customElements},h=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=f(i)||window.customElements,r=o._getDefinition(e);return r?p(i,r):n.set(i,o),i}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){const t=r.get(this);t?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,r){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);o.call(this,n,r),i.call(this,n,t,r)}else o.call(this,n,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o),i.call(this,o,t,null)}else r.call(this,o)});const n=t.prototype.toggleAttribute;n&&(t.prototype.toggleAttribute=function(t,o){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);n.call(this,r,o);const e=this.getAttribute(r);i.call(this,r,t,e)}else n.call(this,r,o)})},u=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t?Object.setPrototypeOf(e,window.HTMLElement):u(i)},p=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),l=t;try{new e.elementClass}catch(t){u(e.elementClass),new e.elementClass}e.attributeChangedCallback&&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)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=y.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let g=[document];const b=(t,e,i=void 0)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){g.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&s.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const v=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){g.push(this),i.set.call(this,t),g.pop()}})};if(v(Element,"innerHTML"),v(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===r.get(i).formAssociated)return o?.call(this,...e);throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`)}}));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"),r=e.get(o)||[];this[+i]=t,r.push(t),e.set(o,r)})),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 a=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=a.get.call(this,[]),e=[];for(const i of t){const t=r.get(i);t&&!0!==t.formAssociated||e.push(i)}return new n(e)}})}}try{window.customElements.define("custom-element",null)}catch(
|
|
15
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,i=window.customElements.get,o=window.customElements,r=new WeakMap,n=new WeakMap,a=new WeakMap,s=new WeakMap;let l;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,r){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(r))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const s=r.prototype.attributeChangedCallback,l=new Set(r.observedAttributes||[]);d(r,l,s);const c={elementClass:r,connectedCallback:r.prototype.connectedCallback,disconnectedCallback:r.prototype.disconnectedCallback,adoptedCallback:r.prototype.adoptedCallback,attributeChangedCallback:s,formAssociated:r.formAssociated,formAssociatedCallback:r.prototype.formAssociatedCallback,formDisabledCallback:r.prototype.formDisabledCallback,formResetCallback:r.prototype.formResetCallback,formStateRestoreCallback:r.prototype.formStateRestoreCallback,observedAttributes:l};this._definitionsByTag.set(t,c),this._definitionsByClass.set(r,c);let f=i.call(o,t);f||(f=h(t),e.call(o,t,f)),this===window.customElements&&(a.set(r,c),c.standInClass=f);const u=this._awaitingUpgrade.get(t);if(u){this._awaitingUpgrade.delete(t);for(const t of u)n.delete(t),p(t,c,!0)}const y=this._whenDefinedPromises.get(t);return void 0!==y&&(y.resolve(r),this._whenDefinedPromises.delete(t)),r}upgrade(){g.push(this),o.upgrade.apply(o,arguments),g.pop()}get(t){const e=this._definitionsByTag.get(t);return e?.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=l;if(e)return l=void 0,e;const i=a.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),r.set(e,i),e},window.HTMLElement.prototype=t.prototype;const c=t=>t===document||t instanceof ShadowRoot,f=t=>{let e=t.getRootNode();if(!c(e)){const t=g[g.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),c(e)||(e=s.get(e)?.getRootNode()||document)}return e.customElements},h=e=>class{static get formAssociated(){return!0}constructor(){const i=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(i,HTMLElement.prototype);const o=f(i)||window.customElements,r=o._getDefinition(e);return r?p(i,r):n.set(i,o),i}connectedCallback(){const t=r.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=r.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):n.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){const t=r.get(this);t?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=r.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=r.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=r.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=r.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},d=(t,e,i)=>{if(0===e.size||void 0===i)return;const o=t.prototype.setAttribute;o&&(t.prototype.setAttribute=function(t,r){const n=t.toLowerCase();if(e.has(n)){const t=this.getAttribute(n);o.call(this,n,r),i.call(this,n,t,r)}else o.call(this,n,r)});const r=t.prototype.removeAttribute;r&&(t.prototype.removeAttribute=function(t){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o),i.call(this,o,t,null)}else r.call(this,o)});const n=t.prototype.toggleAttribute;n&&(t.prototype.toggleAttribute=function(t,o){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);n.call(this,r,o);const e=this.getAttribute(r);i.call(this,r,t,e)}else n.call(this,r,o)})},u=e=>{const i=Object.getPrototypeOf(e);if(i!==window.HTMLElement)return i===t?Object.setPrototypeOf(e,window.HTMLElement):u(i)},p=(t,e,i=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),r.set(t,e),l=t;try{new e.elementClass}catch(t){u(e.elementClass),new e.elementClass}e.attributeChangedCallback&&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)},y=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=y.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let g=[document];const b=(t,e,i=void 0)=>{const o=(i?Object.getPrototypeOf(i):t.prototype)[e];t.prototype[e]=function(){g.push(this);const t=o.apply(i||this,arguments);return void 0!==t&&s.set(t,this),g.pop(),t}};b(ShadowRoot,"createElement",document),b(ShadowRoot,"importNode",document),b(Element,"insertAdjacentHTML");const v=(t,e)=>{const i=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...i,set(t){g.push(this),i.set.call(this,t),g.pop()}})};if(v(Element,"innerHTML"),v(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===r.get(i).formAssociated)return o?.call(this,...e);throw new DOMException(`Failed to execute ${o} on 'ElementInternals': The target element is not a form-associated custom element.`)}}));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"),r=e.get(o)||[];this[+i]=t,r.push(t),e.set(o,r)})),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 a=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=a.get.call(this,[]),e=[];for(const i of t){const t=r.get(i);t&&!0!==t.formAssociated||e.push(i)}return new n(e)}})}}try{window.customElements.define("custom-element",null)}catch(ms){const t=window.customElements.define;window.customElements.define=(e,i,o)=>{if(null!==i)try{t.bind(window.customElements)(e,i,o)}catch(t){console.info(e,i,o,t)}}}class e extends Error{constructor(t,e,i){super(t),this.canceledPromiseResult=e,this.canceledPromiseError=i}}class i extends Promise{constructor(t){super(((i,o)=>t((t=>{this.isCanceled?o(new e("Promise has been canceled",t)):i(t)}),(t=>{this.isCanceled?o(new e("Promise has been canceled",void 0,t)):o(t)})))),this.isCanceled=!1}cancel(){this.isCanceled=!0}}class o{constructor(){this.loaders={},this.content={},this.clearTimeouts={},this.finalContent=new Set}register(t,e){this.loaders[t]=e,this.finalContent.delete(t)}registerFinal(t,e){this.loaders[t]=e,this.finalContent.add(t)}clearAll(){for(let t in this.content)this.clear(t)}clear(t){this.finalContent.has(t)||this.forceClear(t)}forceClear(t){this.clearClearTimeout(t),this.content[t]instanceof i&&this.content[t].cancel(),delete this.content[t]}clearClearTimeout(t){null!=this.clearTimeouts[t]&&(window.clearTimeout(this.clearTimeouts[t]),delete this.clearTimeouts[t])}set(t,e){this.forceClear(t),this.register(t,(async()=>e)),this.content[t]=e}setFinal(t,e){this.forceClear(t),this.registerFinal(t,(async()=>e)),this.content[t]=e}async get(t,e,o){if(void 0===this.content[t]){if(null==(e=null!=e?e:this.loaders[t]))throw new Error("Unknown cache key "+t);const r=(t=>new i(((e,i)=>t.then(e).catch(i))))(e());return this.content[t]=r,r.then((e=>(this.content[t]=e,null!=o&&(this.clearClearTimeout(t),this.clearTimeouts[t]=window.setTimeout((()=>this.clear(t)),o)),e)))}if(this.content[t]instanceof Error)throw this.content[t];return this.content[t]}isResolvedValue(t){return!(null==t||t instanceof Promise||t instanceof Error)}getNow(t){if(this.isResolvedValue(this.content[t]))return this.content[t]}has(t){return null!=this.content[t]}resolvedKeys(){return Object.keys(this.content).filter((t=>this.isResolvedValue(this.content[t])))}resolvedValues(){return Object.values(this.content).filter((t=>this.isResolvedValue(t)))}keys(){return Object.keys(this.content)}values(){return Object.values(this.content)}}
|
|
16
16
|
/**
|
|
17
17
|
* @license
|
|
18
18
|
* Copyright 2019 Google LLC
|
|
@@ -710,7 +710,7 @@ const Jn=1,Qn=2,ta=t=>(...e)=>({_$litDirective$:t,values:e});class ea{constructo
|
|
|
710
710
|
}
|
|
711
711
|
|
|
712
712
|
.ft-tooltip {
|
|
713
|
-
position:
|
|
713
|
+
position: fixed;
|
|
714
714
|
box-sizing: border-box;
|
|
715
715
|
overflow: hidden;
|
|
716
716
|
width: max-content;
|
|
@@ -728,7 +728,7 @@ const Jn=1,Qn=2,ta=t=>(...e)=>({_$litDirective$:t,values:e});class ea{constructo
|
|
|
728
728
|
position: relative;
|
|
729
729
|
word-break: break-word;
|
|
730
730
|
}
|
|
731
|
-
`,ga=["start","end"],ba=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+ga[0],e+"-"+ga[1])),[]),va=Math.min,ma=Math.max,xa=Math.round,wa=t=>({x:t,y:t}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"},Sa={start:"end",end:"start"};function $a(t,e,i){return ma(t,va(e,i))}function Na(t,e){return"function"==typeof t?t(e):t}function Ca(t){return t.split("-")[0]}function Ea(t){return t.split("-")[1]}function ka(t){return"x"===t?"y":"x"}function Ra(t){return"y"===t?"height":"width"}function Ia(t){return["top","bottom"].includes(Ca(t))?"y":"x"}function Ua(t){return ka(Ia(t))}function La(t){return t.replace(/left|right|bottom|top/g,(t=>Oa[t]))}function Aa(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function _a(t,e,i){let{reference:o,floating:r}=t;const n=Ia(e),a=Ua(e),s=Ra(a),l=Ca(e),c="y"===n,f=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let u;switch(l){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:h};break;case"left":u={x:o.x-r.width,y:h};break;default:u={x:o.x,y:o.y}}switch(Ea(e)){case"start":u[a]-=d*(i&&c?-1:1);break;case"end":u[a]+=d*(i&&c?-1:1)}return u}async function Ta(t,e){var i;void 0===e&&(e={});const{x:o,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:d=!1,padding:u=0}=Na(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(u),y=s[d?"floating"===h?"reference":"floating":h],g=Aa(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(y)))||i?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),b="floating"===h?{...a.floating,x:o,y:r}:a.reference,v=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),m=await(null==n.isElement?void 0:n.isElement(v))&&await(null==n.getScale?void 0:n.getScale(v))||{x:1,y:1},x=Aa(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:v,strategy:l}):b);return{top:(g.top-x.top+p.top)/m.y,bottom:(x.bottom-g.bottom+p.bottom)/m.y,left:(g.left-x.left+p.left)/m.x,right:(x.right-g.right+p.right)/m.x}}function Wa(t,e,i){return(t?[...i.filter((e=>Ea(e)===t)),...i.filter((e=>Ea(e)!==t))]:i.filter((t=>Ca(t)===t))).filter((i=>!t||(Ea(i)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>Sa[t]))}(i)!==i)))}const Da=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,o,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:f=!1,alignment:h,allowedPlacements:d=ba,autoAlignment:u=!0,...p}=Na(t,e),y=void 0!==h||d===ba?Wa(h||null,u,d):d,g=await Ta(e,p),b=(null==(i=a.autoPlacement)?void 0:i.index)||0,v=y[b];if(null==v)return{};const m=function(t,e,i){void 0===i&&(i=!1);const o=Ea(t),r=Ua(t),n=Ra(r);let a="x"===r?o===(i?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=La(a)),[a,La(a)]}(v,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==v)return{reset:{placement:y[0]}};const x=[g[Ca(v)],g[m[0]],g[m[1]]],w=[...(null==(o=a.autoPlacement)?void 0:o.overflows)||[],{placement:v,overflows:x}],O=y[b+1];if(O)return{data:{index:b+1,overflows:w},reset:{placement:O}};const S=w.map((t=>{const e=Ea(t.placement);return[t.placement,e&&f?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),$=S.filter((t=>t[2].slice(0,Ea(t[0])?2:3).every((t=>t<=0)))),N=(null==(r=$[0])?void 0:r[0])||S[0][0];return N!==s?{data:{index:b+1,overflows:w},reset:{placement:N}}:{}}}};function Fa(t){return ja(t)?(t.nodeName||"").toLowerCase():"#document"}function Pa(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ma(t){var e;return null==(e=(ja(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ja(t){return t instanceof Node||t instanceof Pa(t).Node}function za(t){return t instanceof Element||t instanceof Pa(t).Element}function Ba(t){return t instanceof HTMLElement||t instanceof Pa(t).HTMLElement}function Ka(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Pa(t).ShadowRoot)}function Za(t){const{overflow:e,overflowX:i,overflowY:o,display:r}=Ya(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+i)&&!["inline","contents"].includes(r)}function Ha(t){return["table","td","th"].includes(Fa(t))}function Ga(t){const e=Va(),i=Ya(t);return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function Va(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function qa(t){return["html","body","#document"].includes(Fa(t))}function Ya(t){return Pa(t).getComputedStyle(t)}function Xa(t){return za(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ja(t){if("html"===Fa(t))return t;const e=t.assignedSlot||t.parentNode||Ka(t)&&t.host||Ma(t);return Ka(e)?e.host:e}function Qa(t){const e=Ja(t);return qa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ba(e)&&Za(e)?e:Qa(e)}function ts(t,e,i){var o;void 0===e&&(e=[]),void 0===i&&(i=!0);const r=Qa(t),n=r===(null==(o=t.ownerDocument)?void 0:o.body),a=Pa(r);return n?e.concat(a,a.visualViewport||[],Za(r)?r:[],a.frameElement&&i?ts(a.frameElement):[]):e.concat(r,ts(r,[],i))}function es(t){const e=Ya(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=Ba(t),n=r?t.offsetWidth:i,a=r?t.offsetHeight:o,s=xa(i)!==n||xa(o)!==a;return s&&(i=n,o=a),{width:i,height:o,$:s}}function is(t){return za(t)?t:t.contextElement}function os(t){const e=is(t);if(!Ba(e))return wa(1);const i=e.getBoundingClientRect(),{width:o,height:r,$:n}=es(e);let a=(n?xa(i.width):i.width)/o,s=(n?xa(i.height):i.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const rs=wa(0);function ns(t){const e=Pa(t);return Va()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:rs}function as(t,e,i,o){void 0===e&&(e=!1),void 0===i&&(i=!1);const r=t.getBoundingClientRect(),n=is(t);let a=wa(1);e&&(o?za(o)&&(a=os(o)):a=os(t));const s=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pa(t))&&e}(n,i,o)?ns(n):wa(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,f=r.width/a.x,h=r.height/a.y;if(n){const t=Pa(n),e=o&&za(o)?Pa(o):o;let i=t.frameElement;for(;i&&o&&e!==t;){const t=os(i),e=i.getBoundingClientRect(),o=Ya(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,n=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,h*=t.y,l+=r,c+=n,i=Pa(i).frameElement}}return Aa({width:f,height:h,x:l,y:c})}function ss(t){return as(Ma(t)).left+Xa(t).scrollLeft}function ls(t,e,i){let o;if("viewport"===e)o=function(t,e){const i=Pa(t),o=Ma(t),r=i.visualViewport;let n=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Va();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,i);else if("document"===e)o=function(t){const e=Ma(t),i=Xa(t),o=t.ownerDocument.body,r=ma(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=ma(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-i.scrollLeft+ss(t);const s=-i.scrollTop;return"rtl"===Ya(o).direction&&(a+=ma(e.clientWidth,o.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Ma(t));else if(za(e))o=function(t,e){const i=as(t,!0,"fixed"===e),o=i.top+t.clientTop,r=i.left+t.clientLeft,n=Ba(t)?os(t):wa(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:o*n.y}}(e,i);else{const i=ns(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return Aa(o)}function cs(t,e){const i=Ja(t);return!(i===e||!za(i)||qa(i))&&("fixed"===Ya(i).position||cs(i,e))}function fs(t,e,i){const o=Ba(e),r=Ma(e),n="fixed"===i,a=as(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=wa(0);if(o||!o&&!n)if(("body"!==Fa(e)||Za(r))&&(s=Xa(e)),o){const t=as(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=ss(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function hs(t,e){return Ba(t)&&"fixed"!==Ya(t).position?e?e(t):t.offsetParent:null}function ds(t,e){const i=Pa(t);if(!Ba(t))return i;let o=hs(t,e);for(;o&&Ha(o)&&"static"===Ya(o).position;)o=hs(o,e);return o&&("html"===Fa(o)||"body"===Fa(o)&&"static"===Ya(o).position&&!Ga(o))?i:o||function(t){let e=Ja(t);for(;Ba(e)&&!qa(e);){if(Ga(e))return e;e=Ja(e)}return null}(t)||i}const us={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:i,strategy:o}=t;const r=Ba(i),n=Ma(i);if(i===n)return e;let a={scrollLeft:0,scrollTop:0},s=wa(1);const l=wa(0);if((r||!r&&"fixed"!==o)&&(("body"!==Fa(i)||Za(n))&&(a=Xa(i)),Ba(i))){const t=as(i);s=os(i),l.x=t.x+i.clientLeft,l.y=t.y+i.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Ma,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:o,strategy:r}=t;const n="clippingAncestors"===i?function(t,e){const i=e.get(t);if(i)return i;let o=ts(t,[],!1).filter((t=>za(t)&&"body"!==Fa(t))),r=null;const n="fixed"===Ya(t).position;let a=n?Ja(t):t;for(;za(a)&&!qa(a);){const e=Ya(a),i=Ga(a);i||"fixed"!==e.position||(r=null),(n?!i&&!r:!i&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||Za(a)&&!i&&cs(t,a))?o=o.filter((t=>t!==a)):r=e,a=Ja(a)}return e.set(t,o),o}(e,this._c):[].concat(i),a=[...n,o],s=a[0],l=a.reduce(((t,i)=>{const o=ls(e,i,r);return t.top=ma(o.top,t.top),t.right=va(o.right,t.right),t.bottom=va(o.bottom,t.bottom),t.left=ma(o.left,t.left),t}),ls(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ds,getElementRects:async function(t){let{reference:e,floating:i,strategy:o}=t;const r=this.getOffsetParent||ds,n=this.getDimensions;return{reference:fs(e,await r(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return es(t)},getScale:os,isElement:za,isRTL:function(t){return"rtl"===Ya(t).direction}},ps=(t,e,i)=>{const o=new Map,r={platform:us,...i},n={...r.platform,_c:o};return(async(t,e,i)=>{const{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:a}=i,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:h}=_a(c,o,l),d=o,u={},p=0;for(let i=0;i<s.length;i++){const{name:n,fn:y}=s[i],{x:g,y:b,data:v,reset:m}=await y({x:f,y:h,initialPlacement:o,placement:d,strategy:r,middlewareData:u,rects:c,platform:a,elements:{reference:t,floating:e}});f=null!=g?g:f,h=null!=b?b:h,u={...u,[n]:{...u[n],...v}},m&&p<=50&&(p++,"object"==typeof m&&(m.placement&&(d=m.placement),m.rects&&(c=!0===m.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):m.rects),({x:f,y:h}=_a(c,d,l))),i=-1)}return{x:f,y:h,placement:d,strategy:r,middlewareData:u}})(t,e,{...r,platform:n})};var ys=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class gs extends Ke{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new A,this.revealDebouncer=new A}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return fe`
|
|
731
|
+
`,ga=["start","end"],ba=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+ga[0],e+"-"+ga[1])),[]),va=Math.min,ma=Math.max,xa=Math.round,wa=t=>({x:t,y:t}),Oa={left:"right",right:"left",bottom:"top",top:"bottom"},Sa={start:"end",end:"start"};function $a(t,e,i){return ma(t,va(e,i))}function Na(t,e){return"function"==typeof t?t(e):t}function Ca(t){return t.split("-")[0]}function Ea(t){return t.split("-")[1]}function ka(t){return"x"===t?"y":"x"}function Ra(t){return"y"===t?"height":"width"}function Ia(t){return["top","bottom"].includes(Ca(t))?"y":"x"}function Ua(t){return ka(Ia(t))}function La(t){return t.replace(/left|right|bottom|top/g,(t=>Oa[t]))}function Aa(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function _a(t,e,i){let{reference:o,floating:r}=t;const n=Ia(e),a=Ua(e),s=Ra(a),l=Ca(e),c="y"===n,f=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,d=o[s]/2-r[s]/2;let u;switch(l){case"top":u={x:f,y:o.y-r.height};break;case"bottom":u={x:f,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:h};break;case"left":u={x:o.x-r.width,y:h};break;default:u={x:o.x,y:o.y}}switch(Ea(e)){case"start":u[a]-=d*(i&&c?-1:1);break;case"end":u[a]+=d*(i&&c?-1:1)}return u}async function Ta(t,e){var i;void 0===e&&(e={});const{x:o,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:d=!1,padding:u=0}=Na(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(u),y=s[d?"floating"===h?"reference":"floating":h],g=Aa(await n.getClippingRect({element:null==(i=await(null==n.isElement?void 0:n.isElement(y)))||i?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:l})),b="floating"===h?{...a.floating,x:o,y:r}:a.reference,v=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),m=await(null==n.isElement?void 0:n.isElement(v))&&await(null==n.getScale?void 0:n.getScale(v))||{x:1,y:1},x=Aa(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:v,strategy:l}):b);return{top:(g.top-x.top+p.top)/m.y,bottom:(x.bottom-g.bottom+p.bottom)/m.y,left:(g.left-x.left+p.left)/m.x,right:(x.right-g.right+p.right)/m.x}}function Wa(t,e,i){return(t?[...i.filter((e=>Ea(e)===t)),...i.filter((e=>Ea(e)!==t))]:i.filter((t=>Ca(t)===t))).filter((i=>!t||(Ea(i)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>Sa[t]))}(i)!==i)))}const Da=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var i,o,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:f=!1,alignment:h,allowedPlacements:d=ba,autoAlignment:u=!0,...p}=Na(t,e),y=void 0!==h||d===ba?Wa(h||null,u,d):d,g=await Ta(e,p),b=(null==(i=a.autoPlacement)?void 0:i.index)||0,v=y[b];if(null==v)return{};const m=function(t,e,i){void 0===i&&(i=!1);const o=Ea(t),r=Ua(t),n=Ra(r);let a="x"===r?o===(i?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=La(a)),[a,La(a)]}(v,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==v)return{reset:{placement:y[0]}};const x=[g[Ca(v)],g[m[0]],g[m[1]]],w=[...(null==(o=a.autoPlacement)?void 0:o.overflows)||[],{placement:v,overflows:x}],O=y[b+1];if(O)return{data:{index:b+1,overflows:w},reset:{placement:O}};const S=w.map((t=>{const e=Ea(t.placement);return[t.placement,e&&f?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),$=S.filter((t=>t[2].slice(0,Ea(t[0])?2:3).every((t=>t<=0)))),N=(null==(r=$[0])?void 0:r[0])||S[0][0];return N!==s?{data:{index:b+1,overflows:w},reset:{placement:N}}:{}}}};function Fa(t){return ja(t)?(t.nodeName||"").toLowerCase():"#document"}function Pa(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ma(t){var e;return null==(e=(ja(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function ja(t){return t instanceof Node||t instanceof Pa(t).Node}function za(t){return t instanceof Element||t instanceof Pa(t).Element}function Ba(t){return t instanceof HTMLElement||t instanceof Pa(t).HTMLElement}function Ka(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof Pa(t).ShadowRoot)}function Za(t){const{overflow:e,overflowX:i,overflowY:o,display:r}=Ya(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+i)&&!["inline","contents"].includes(r)}function Ha(t){return["table","td","th"].includes(Fa(t))}function Ga(t){const e=Va(),i=Ya(t);return"none"!==i.transform||"none"!==i.perspective||!!i.containerType&&"normal"!==i.containerType||!e&&!!i.backdropFilter&&"none"!==i.backdropFilter||!e&&!!i.filter&&"none"!==i.filter||["transform","perspective","filter"].some((t=>(i.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(i.contain||"").includes(t)))}function Va(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function qa(t){return["html","body","#document"].includes(Fa(t))}function Ya(t){return Pa(t).getComputedStyle(t)}function Xa(t){return za(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ja(t){if("html"===Fa(t))return t;const e=t.assignedSlot||t.parentNode||Ka(t)&&t.host||Ma(t);return Ka(e)?e.host:e}function Qa(t){const e=Ja(t);return qa(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ba(e)&&Za(e)?e:Qa(e)}function ts(t,e,i){var o;void 0===e&&(e=[]),void 0===i&&(i=!0);const r=Qa(t),n=r===(null==(o=t.ownerDocument)?void 0:o.body),a=Pa(r);return n?e.concat(a,a.visualViewport||[],Za(r)?r:[],a.frameElement&&i?ts(a.frameElement):[]):e.concat(r,ts(r,[],i))}function es(t){const e=Ya(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const r=Ba(t),n=r?t.offsetWidth:i,a=r?t.offsetHeight:o,s=xa(i)!==n||xa(o)!==a;return s&&(i=n,o=a),{width:i,height:o,$:s}}function is(t){return za(t)?t:t.contextElement}function os(t){const e=is(t);if(!Ba(e))return wa(1);const i=e.getBoundingClientRect(),{width:o,height:r,$:n}=es(e);let a=(n?xa(i.width):i.width)/o,s=(n?xa(i.height):i.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const rs=wa(0);function ns(t){const e=Pa(t);return Va()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:rs}function as(t,e,i,o){void 0===e&&(e=!1),void 0===i&&(i=!1);const r=t.getBoundingClientRect(),n=is(t);let a=wa(1);e&&(o?za(o)&&(a=os(o)):a=os(t));const s=function(t,e,i){return void 0===e&&(e=!1),!(!i||e&&i!==Pa(t))&&e}(n,i,o)?ns(n):wa(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,f=r.width/a.x,h=r.height/a.y;if(n){const t=Pa(n),e=o&&za(o)?Pa(o):o;let i=t.frameElement;for(;i&&o&&e!==t;){const t=os(i),e=i.getBoundingClientRect(),o=Ya(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,n=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;l*=t.x,c*=t.y,f*=t.x,h*=t.y,l+=r,c+=n,i=Pa(i).frameElement}}return Aa({width:f,height:h,x:l,y:c})}function ss(t){return as(Ma(t)).left+Xa(t).scrollLeft}function ls(t,e,i){let o;if("viewport"===e)o=function(t,e){const i=Pa(t),o=Ma(t),r=i.visualViewport;let n=o.clientWidth,a=o.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=Va();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,i);else if("document"===e)o=function(t){const e=Ma(t),i=Xa(t),o=t.ownerDocument.body,r=ma(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),n=ma(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let a=-i.scrollLeft+ss(t);const s=-i.scrollTop;return"rtl"===Ya(o).direction&&(a+=ma(e.clientWidth,o.clientWidth)-r),{width:r,height:n,x:a,y:s}}(Ma(t));else if(za(e))o=function(t,e){const i=as(t,!0,"fixed"===e),o=i.top+t.clientTop,r=i.left+t.clientLeft,n=Ba(t)?os(t):wa(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:o*n.y}}(e,i);else{const i=ns(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return Aa(o)}function cs(t,e){const i=Ja(t);return!(i===e||!za(i)||qa(i))&&("fixed"===Ya(i).position||cs(i,e))}function fs(t,e,i){const o=Ba(e),r=Ma(e),n="fixed"===i,a=as(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=wa(0);if(o||!o&&!n)if(("body"!==Fa(e)||Za(r))&&(s=Xa(e)),o){const t=as(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=ss(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function hs(t,e){return Ba(t)&&"fixed"!==Ya(t).position?e?e(t):t.offsetParent:null}function ds(t,e){const i=Pa(t);if(!Ba(t))return i;let o=hs(t,e);for(;o&&Ha(o)&&"static"===Ya(o).position;)o=hs(o,e);return o&&("html"===Fa(o)||"body"===Fa(o)&&"static"===Ya(o).position&&!Ga(o))?i:o||function(t){let e=Ja(t);for(;Ba(e)&&!qa(e);){if(Ga(e))return e;e=Ja(e)}return null}(t)||i}const us={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:i,strategy:o}=t;const r=Ba(i),n=Ma(i);if(i===n)return e;let a={scrollLeft:0,scrollTop:0},s=wa(1);const l=wa(0);if((r||!r&&"fixed"!==o)&&(("body"!==Fa(i)||Za(n))&&(a=Xa(i)),Ba(i))){const t=as(i);s=os(i),l.x=t.x+i.clientLeft,l.y=t.y+i.clientTop}return{width:e.width*s.x,height:e.height*s.y,x:e.x*s.x-a.scrollLeft*s.x+l.x,y:e.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:Ma,getClippingRect:function(t){let{element:e,boundary:i,rootBoundary:o,strategy:r}=t;const n="clippingAncestors"===i?function(t,e){const i=e.get(t);if(i)return i;let o=ts(t,[],!1).filter((t=>za(t)&&"body"!==Fa(t))),r=null;const n="fixed"===Ya(t).position;let a=n?Ja(t):t;for(;za(a)&&!qa(a);){const e=Ya(a),i=Ga(a);i||"fixed"!==e.position||(r=null),(n?!i&&!r:!i&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||Za(a)&&!i&&cs(t,a))?o=o.filter((t=>t!==a)):r=e,a=Ja(a)}return e.set(t,o),o}(e,this._c):[].concat(i),a=[...n,o],s=a[0],l=a.reduce(((t,i)=>{const o=ls(e,i,r);return t.top=ma(o.top,t.top),t.right=va(o.right,t.right),t.bottom=va(o.bottom,t.bottom),t.left=ma(o.left,t.left),t}),ls(e,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:ds,getElementRects:async function(t){let{reference:e,floating:i,strategy:o}=t;const r=this.getOffsetParent||ds,n=this.getDimensions;return{reference:fs(e,await r(i),o),floating:{x:0,y:0,...await n(i)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return es(t)},getScale:os,isElement:za,isRTL:function(t){return"rtl"===Ya(t).direction}},ps=(t,e,i)=>{const o=new Map,r={platform:us,...i},n={...r.platform,_c:o};return(async(t,e,i)=>{const{placement:o="bottom",strategy:r="absolute",middleware:n=[],platform:a}=i,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let c=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:f,y:h}=_a(c,o,l),d=o,u={},p=0;for(let i=0;i<s.length;i++){const{name:n,fn:y}=s[i],{x:g,y:b,data:v,reset:m}=await y({x:f,y:h,initialPlacement:o,placement:d,strategy:r,middlewareData:u,rects:c,platform:a,elements:{reference:t,floating:e}});f=null!=g?g:f,h=null!=b?b:h,u={...u,[n]:{...u[n],...v}},m&&p<=50&&(p++,"object"==typeof m&&(m.placement&&(d=m.placement),m.rects&&(c=!0===m.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):m.rects),({x:f,y:h}=_a(c,d,l))),i=-1)}return{x:f,y:h,placement:d,strategy:r,middlewareData:u}})(t,e,{...r,platform:n})};function ys(t){return function(t){for(let e=t;e;e=gs(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=gs(t);e;e=gs(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return e;if("BODY"===e.tagName)return e}}return null}(t)}function gs(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var bs=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class vs extends Ke{constructor(){super(...arguments),this.text="",this.manual=!1,this.inline=!1,this.delay=500,this.position="bottom",this.visible=!1,this.validPositions=new Set(["top","bottom","left","right"]),this.hideDebounce=new A,this.revealDebouncer=new A}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return fe`
|
|
732
732
|
<div part="container"
|
|
733
733
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
734
734
|
@mouseenter=${this.onHover}
|
|
@@ -736,7 +736,7 @@ const Jn=1,Qn=2,ta=t=>(...e)=>({_$litDirective$:t,values:e});class ea{constructo
|
|
|
736
736
|
@focusin=${this.onHover}
|
|
737
737
|
@focusout=${this.onOut}
|
|
738
738
|
@touchstart=${this.onTouch}>
|
|
739
|
-
<slot></slot>
|
|
739
|
+
<slot part="slot"></slot>
|
|
740
740
|
<div part="tooltip" role="tooltip" inert
|
|
741
741
|
class="ft-tooltip ft-tooltip--${this.validPosition}"
|
|
742
742
|
?hidden=${!this.visible}>
|
|
@@ -746,24 +746,24 @@ const Jn=1,Qn=2,ta=t=>(...e)=>({_$litDirective$:t,values:e});class ea{constructo
|
|
|
746
746
|
</div>
|
|
747
747
|
</div>
|
|
748
748
|
</div>
|
|
749
|
-
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",ps(this.slottedElement,this.tooltip,{middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:o,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Na(t,e),c={x:i,y:o},f=await Ta(e,l),h=Ia(Ca(r)),d=ka(h);let u=c[d],p=c[h];if(n){const t="y"===d?"bottom":"right";u=$a(u+f["y"===d?"top":"left"],u,u-f[t])}if(a){const t="y"===h?"bottom":"right";p=$a(p+f["y"===h?"top":"left"],p,p-f[t])}const y=s.fn({...e,[d]:u,[h]:p});return{...y,data:{x:y.x-i,y:y.y-o}}}}),Da({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}
|
|
749
|
+
`}updated(t){t.has("visible")&&this.visible&&this.resetTooltipContent(),super.updated(t)}contentAvailableCallback(t){super.contentAvailableCallback(t),["visible","text"].some((e=>t.has(e)))&&this.visible&&this.positionTooltip()}show(t){this.visible=!0,null!=t&&this.hideDebounce.run((()=>this.hide()),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){var t;this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",ps(this.slottedElement,this.tooltip,{platform:{...us,getOffsetParent:t=>us.getOffsetParent(t,ys)},middleware:[(t={crossAxis:!0},void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:i,y:o,placement:r}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:i}=t;return{x:e,y:i}}},...l}=Na(t,e),c={x:i,y:o},f=await Ta(e,l),h=Ia(Ca(r)),d=ka(h);let u=c[d],p=c[h];if(n){const t="y"===d?"bottom":"right";u=$a(u+f["y"===d?"top":"left"],u,u-f[t])}if(a){const t="y"===h?"bottom":"right";p=$a(p+f["y"===h?"top":"left"],p,p-f[t])}const y=s.fn({...e,[d]:u,[h]:p});return{...y,data:{x:y.x-i,y:y.y-o}}}}),Da({allowedPlacements:[this.position]})]}).then((({x:t,y:e})=>{this.tooltip&&(this.tooltip.style.left=`${t}px`,this.tooltip.style.top=`${e}px`)}))),this.revealDebouncer.run((()=>{this.tooltipContent&&(this.tooltipContent.style.transition="top var(--ft-transition-duration, 250ms), left var(--ft-transition-duration, 250ms)",this.tooltipContent.style.top="0",this.tooltipContent.style.left="0")}),this.manual?0:this.delay)}onTouch(){this.manual||(this.show(),setTimeout((()=>window.addEventListener("touchstart",(t=>{t.composedPath().includes(this.container)||this.onOut()}),{once:!0})),100))}onHover(){this.manual||this.show()}onOut(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}vs.elementDefinitions={"ft-typography":Xn},vs.styles=ya,bs([E()],vs.prototype,"text",void 0),bs([E({type:Boolean})],vs.prototype,"manual",void 0),bs([E({type:Boolean})],vs.prototype,"inline",void 0),bs([E({type:Number})],vs.prototype,"delay",void 0),bs([E()],vs.prototype,"position",void 0),bs([L()],vs.prototype,"slotNodes",void 0),bs([U(".ft-tooltip--container")],vs.prototype,"container",void 0),bs([U(".ft-tooltip")],vs.prototype,"tooltip",void 0),bs([U(".ft-tooltip--content")],vs.prototype,"tooltipContent",void 0),bs([k()],vs.prototype,"visible",void 0),bs([R({passive:!0})],vs.prototype,"onTouch",null),bs([R({passive:!0})],vs.prototype,"onHover",null),bs([R({passive:!0})],vs.prototype,"onOut",null),W("ft-tooltip")(vs);
|
|
750
750
|
/**
|
|
751
751
|
* @license
|
|
752
752
|
* Copyright 2018 Google LLC
|
|
753
753
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
754
754
|
*/
|
|
755
|
-
const
|
|
755
|
+
const ms=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t.name||t.strings?.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]){if(void 0===this.it){this.it=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]&&!this.st?.has(t)&&this.it.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.it)t in e||(i.remove(t),this.it.delete(t));for(const t in e){const o=!!e[t];o===this.it.has(t)||this.st?.has(t)||(o?(i.add(t),this.it.add(t)):(i.remove(t),this.it.delete(t)))}return nt}});var xs=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class ws extends Ke{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.unbounded=!1,this.activated=!1,this.selected=!1,this.disabled=!1,this.hovered=!1,this.focused=!1,this.pressed=!1,this.rippling=!1,this.originX=0,this.originY=0,this.debouncer=new A(1e3),this.onTransitionStart=t=>{"transform"===t.propertyName&&(this.rippling=this.pressed,this.debouncer.run((()=>this.rippling=!1)))},this.onTransitionEnd=t=>{"transform"===t.propertyName&&(this.rippling=!1)},this.setupDebouncer=new A(10),this.moveRipple=t=>{var e,i;let{x:o,y:r}=this.getCoordinates(t),n=null!==(i=null===(e=this.ripple)||void 0===e?void 0:e.getBoundingClientRect())&&void 0!==i?i:{x:0,y:0,width:0,height:0};this.originX=Math.round(null!=o?o-n.x:n.width/2),this.originY=Math.round(null!=r?r-n.y:n.height/2)},this.startPress=t=>{this.moveRipple(t),this.pressed=!this.isIgnored(t)},this.endPress=()=>{this.pressed=!1},this.startHover=t=>{this.hovered=!this.isIgnored(t)},this.endHover=()=>{this.hovered=!1},this.startFocus=t=>{this.focused=this.isFocusVisible(null==t?void 0:t.target)&&!this.isIgnored(t)},this.endFocus=()=>{this.focused=!1}}render(){let t={"ft-ripple":!0,"ft-ripple--primary":this.primary,"ft-ripple--secondary":this.secondary,"ft-ripple--unbounded":this.unbounded,"ft-ripple--selected":(this.selected||this.activated)&&!this.disabled,"ft-ripple--pressed":(this.pressed||this.rippling)&&!this.disabled,"ft-ripple--hovered":this.hovered&&!this.disabled,"ft-ripple--focused":this.focused&&!this.disabled};return fe`
|
|
756
756
|
<style>
|
|
757
757
|
.ft-ripple .ft-ripple--effect {
|
|
758
758
|
left: ${this.originX}px;
|
|
759
759
|
top: ${this.originY}px;
|
|
760
760
|
}
|
|
761
761
|
</style>
|
|
762
|
-
<div class="${
|
|
762
|
+
<div class="${ms(t)}">
|
|
763
763
|
<div class="ft-ripple--background"></div>
|
|
764
764
|
<div class="ft-ripple--effect"></div>
|
|
765
765
|
</div>
|
|
766
|
-
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,i;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",i,n),t.addEventListener("touchstart",o,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",r,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",i,n),t.removeEventListener("touchstart",o,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",r,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,r;return null!=e.x?({x:o,y:r}=e):null!=i.touches&&(o=i.touches[0].clientX,r=i.touches[0].clientY),{x:o,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}
|
|
766
|
+
`}contentAvailableCallback(t){super.contentAvailableCallback(t),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(t){var e,i;super.update(t),t.has("disabled")&&(this.disabled?(this.endRipple(),null===(e=this.target)||void 0===e||e.removeAttribute("data-is-ft-ripple-target")):null===(i=this.target)||void 0===i||i.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run((()=>this.defaultSetup()))}defaultSetup(){var t,e;const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.host.parentElement;i&&this.setupFor(null!==(e=this.target)&&void 0!==e?e:i)}setupFor(t){if(this.setupDebouncer.cancel(),this.target===t)return;this.onDisconnect&&this.onDisconnect(),this.target=t,t.setAttribute("data-is-ft-ripple-target","true");const e=(...t)=>e=>{t.forEach((t=>window.addEventListener(t,this.endPress,{once:!0}))),this.startPress(e)},i=e("mouseup","contextmenu"),o=e("touchend","touchcancel"),r=t=>{["Enter"," "].includes(t.key)&&e("keyup")(t)},n={passive:!0};t.addEventListener("mouseover",this.startHover,n),t.addEventListener("mousemove",this.moveRipple,n),t.addEventListener("mouseleave",this.endHover,n),t.addEventListener("mousedown",i,n),t.addEventListener("touchstart",o,n),t.addEventListener("touchmove",this.moveRipple,n),t.addEventListener("keydown",r,n),t.addEventListener("focus",this.startFocus,n),t.addEventListener("blur",this.endFocus,n),t.addEventListener("focusin",this.startFocus,n),t.addEventListener("focusout",this.endFocus,n),this.onDisconnect=()=>{t.removeAttribute("data-is-ft-ripple-target"),t.removeEventListener("mouseover",this.startHover,n),t.removeEventListener("mousemove",this.moveRipple,n),t.removeEventListener("mouseleave",this.endHover,n),t.removeEventListener("mousedown",i,n),t.removeEventListener("touchstart",o,n),t.removeEventListener("touchmove",this.moveRipple,n),t.removeEventListener("keydown",r,n),t.removeEventListener("focus",this.startFocus,n),t.removeEventListener("blur",this.endFocus,n),t.removeEventListener("focusin",this.startFocus,n),t.removeEventListener("focusout",this.endFocus,n),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(t){const e=t,i=t;let o,r;return null!=e.x?({x:o,y:r}=e):null!=i.touches&&(o=i.touches[0].clientX,r=i.touches[0].clientY),{x:o,y:r}}isFocusVisible(t){return!(t instanceof HTMLElement)||t.matches(":focus-visible")}isIgnored(t){if(this.disabled)return!0;if(null!=t)for(let e of t.composedPath()){if(e===this.target)break;if("hasAttribute"in e&&e.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}}ws.elementDefinitions={},ws.styles=ur,xs([E({type:Boolean})],ws.prototype,"primary",void 0),xs([E({type:Boolean})],ws.prototype,"secondary",void 0),xs([E({type:Boolean})],ws.prototype,"unbounded",void 0),xs([E({type:Boolean})],ws.prototype,"activated",void 0),xs([E({type:Boolean})],ws.prototype,"selected",void 0),xs([E({type:Boolean})],ws.prototype,"disabled",void 0),xs([k()],ws.prototype,"hovered",void 0),xs([k()],ws.prototype,"focused",void 0),xs([k()],ws.prototype,"pressed",void 0),xs([k()],ws.prototype,"rippling",void 0),xs([k()],ws.prototype,"originX",void 0),xs([k()],ws.prototype,"originY",void 0),xs([U(".ft-ripple")],ws.prototype,"ripple",void 0),xs([U(".ft-ripple--effect")],ws.prototype,"rippleEffect",void 0),W("ft-ripple")(ws);const Os={borderRadiusLeft:ke.extend("--ft-switch-option-border-radius-left","",_e.borderRadiusL),borderRadiusRight:ke.extend("--ft-switch-option-border-radius-right","",_e.borderRadiusL),borderWidthLeft:ke.create("--ft-switch-option-border-width-left","","SIZE","1px"),borderWidthRight:ke.create("--ft-switch-option-border-width-right","","SIZE","1px"),borderWidthVertical:ke.create("--ft-switch-option-border-width-vertical","","SIZE","1px")},Ss=kt`
|
|
767
767
|
.ft-switch-option {
|
|
768
768
|
position: relative;
|
|
769
769
|
display: inline-block;
|
|
@@ -782,8 +782,8 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
782
782
|
|
|
783
783
|
border-style: solid;
|
|
784
784
|
border-color: ${$n.borderColor};
|
|
785
|
-
border-width: ${
|
|
786
|
-
border-radius: ${
|
|
785
|
+
border-width: ${Os.borderWidthVertical} ${Os.borderWidthRight} ${Os.borderWidthVertical} ${Os.borderWidthLeft};
|
|
786
|
+
border-radius: ${Os.borderRadiusLeft} ${Os.borderRadiusRight} ${Os.borderRadiusRight} ${Os.borderRadiusLeft};
|
|
787
787
|
display: flex;
|
|
788
788
|
align-items: center;
|
|
789
789
|
justify-content: center;
|
|
@@ -800,7 +800,7 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
800
800
|
|
|
801
801
|
.ft-switch-option--selected .ft-switch-option--content:before {
|
|
802
802
|
background-color: ${$n.selectedBackgroundColor};
|
|
803
|
-
border-radius: ${
|
|
803
|
+
border-radius: ${Os.borderRadiusLeft} ${Os.borderRadiusRight} ${Os.borderRadiusRight} ${Os.borderRadiusLeft};
|
|
804
804
|
position: absolute;
|
|
805
805
|
inset: 0;
|
|
806
806
|
content: "";
|
|
@@ -847,8 +847,8 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
847
847
|
.ft-switch-option--selected ft-icon {
|
|
848
848
|
color: ${$n.selectedTextColor};
|
|
849
849
|
}
|
|
850
|
-
`;var
|
|
851
|
-
<label part="label" for="input" class=${
|
|
850
|
+
`;var $s=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Ns extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class Cs extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class Es extends Ke{constructor(){super(...arguments),this.value="",this.label="",this.tooltipPosition="bottom",this.selected=!1,this.trailingIcon=!1,this.unselectable=!1}focus(){this.input.focus()}update(t){super.update(t),t.has("selected")&&this.dispatchEvent(new Cs(this.selected))}render(){const t={"ft-switch-option":!0,"ft-switch-option--trailing-icon":this.trailingIcon,"ft-switch-option--selected":this.selected};return this.addTooltip(fe`
|
|
851
|
+
<label part="label" for="input" class=${ms(t)}
|
|
852
852
|
@click=${this.onChange}>
|
|
853
853
|
<div class="ft-switch-option--content">
|
|
854
854
|
<ft-ripple part="ripple" class="ft-switch-option--ripple"></ft-ripple>
|
|
@@ -869,16 +869,16 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
869
869
|
position="${this.tooltipPosition}">
|
|
870
870
|
${t}
|
|
871
871
|
</ft-tooltip>
|
|
872
|
-
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new
|
|
872
|
+
`}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new Ns(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?fe`
|
|
873
873
|
<ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
|
|
874
|
-
`:de}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}
|
|
875
|
-
<div @keydown=${this.onKeyDown} tabindex="0" class="${
|
|
874
|
+
`:de}get textContent(){var t,e;return null!==(e=null===(t=this.slottedContent)||void 0===t?void 0:t.assignedNodes().map((t=>t.textContent)).join("").trim())&&void 0!==e?e:""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}}Es.elementDefinitions={"ft-ripple":ws,"ft-typography":Xn,"ft-tooltip":vs,"ft-icon":la},Es.styles=[Ge,Ss],$s([E()],Es.prototype,"value",void 0),$s([E()],Es.prototype,"icon",void 0),$s([E()],Es.prototype,"iconVariant",void 0),$s([E()],Es.prototype,"label",void 0),$s([E()],Es.prototype,"tooltipPosition",void 0),$s([E({type:Boolean,reflect:!0})],Es.prototype,"selected",void 0),$s([E({type:Boolean})],Es.prototype,"trailingIcon",void 0),$s([E({type:Boolean})],Es.prototype,"unselectable",void 0),$s([U(".ft-switch-option--content slot")],Es.prototype,"slottedContent",void 0),$s([U(".ft-switch-option--input")],Es.prototype,"input",void 0);var ks=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Rs extends CustomEvent{constructor(t){super("change",{detail:t})}}class Is extends Ke{constructor(){super(...arguments),this.dense=!1,this.unselectable=!1,this.options=[]}get value(){var t;return null===(t=this.selectedOption)||void 0===t?void 0:t.value}update(t){super.update(t),t.has("selectedOption")&&this.updateOptions(),t.has("unselectable")&&this.options.forEach((t=>t.unselectable=this.unselectable))}render(){const t={"ft-switch":!0,"ft-switch--dense":this.dense};return fe`
|
|
875
|
+
<div @keydown=${this.onKeyDown} tabindex="0" class="${ms(t)}">
|
|
876
876
|
<slot @slotchange=${this.onSlotchange}
|
|
877
877
|
@option-change=${this.onOptionChangeByScript}
|
|
878
878
|
@option-change-by-user=${this.onOptionChangeByUser}
|
|
879
879
|
></slot>
|
|
880
880
|
</div>
|
|
881
|
-
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof
|
|
881
|
+
`}onKeyDown(t){let e;"ArrowDown"!=t.key&&"ArrowRight"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)+1:0),"ArrowUp"!=t.key&&"ArrowLeft"!=t.key||(e=this.selectedOption?this.options.indexOf(this.selectedOption)-1:this.options.length-1),null!=e&&(t.preventDefault(),this.options[this.fixIndex(e)].selected=!0)}fixIndex(t){return t<0?this.options.length-1:t>this.options.length-1?0:t}onSlotchange(){var t;this.options=[],null===(t=this.slottedContent)||void 0===t||t.assignedElements().forEach((t=>{t instanceof Es&&this.registerOption(t)})),this.selectedOption=this.options.find((t=>t.selected))}registerOption(t){t.setAttribute("tabindex","-1"),t.unselectable=this.unselectable,this.options.push(t)}onOptionChangeByScript(t){t.stopPropagation();let e=t.target;this.onOptionChange(e)}onOptionChangeByUser(t){var e;t.stopPropagation(),this.onOptionChange(t.target),this.dispatchEvent(new Rs(null===(e=this.selectedOption)||void 0===e?void 0:e.value))}onOptionChange(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}private(t){t.selected?this.selectedOption=t:this.selectedOption=this.options.find((t=>t.selected))}focus(){this.ftSwitchDiv.focus()}updateOptions(){this.options.forEach((t=>{t.selected=t===this.selectedOption}))}}Is.elementDefinitions={},Is.styles=kt`
|
|
882
882
|
:host {
|
|
883
883
|
display: inline-block;
|
|
884
884
|
}
|
|
@@ -894,25 +894,25 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
894
894
|
}
|
|
895
895
|
|
|
896
896
|
.ft-switch slot::slotted(ft-switch-option) {
|
|
897
|
-
${Re(
|
|
898
|
-
${Re(
|
|
899
|
-
${Re(
|
|
897
|
+
${Re(Os.borderRadiusLeft,"0")};
|
|
898
|
+
${Re(Os.borderRadiusRight,"0")};
|
|
899
|
+
${Re(Os.borderWidthLeft,"0")};
|
|
900
900
|
}
|
|
901
901
|
|
|
902
902
|
.ft-switch slot::slotted(ft-switch-option:first-child) {
|
|
903
|
-
${Re(
|
|
904
|
-
${Re(
|
|
903
|
+
${Re(Os.borderRadiusLeft,$n.borderRadius)};
|
|
904
|
+
${Re(Os.borderWidthLeft,"1px")};
|
|
905
905
|
}
|
|
906
906
|
|
|
907
907
|
.ft-switch slot::slotted(ft-switch-option:last-child) {
|
|
908
|
-
${Re(
|
|
908
|
+
${Re(Os.borderRadiusRight,$n.borderRadius)};
|
|
909
909
|
}
|
|
910
910
|
|
|
911
911
|
.ft-switch--dense slot::slotted(ft-switch-option) {
|
|
912
912
|
--ft-switch-internal-vertical-padding: 2px;
|
|
913
913
|
--ft-switch-internal-horizontal-padding: 4px;
|
|
914
914
|
}
|
|
915
|
-
`,
|
|
915
|
+
`,ks([E({type:Boolean})],Is.prototype,"dense",void 0),ks([E({type:Boolean})],Is.prototype,"unselectable",void 0),ks([U(".ft-switch slot")],Is.prototype,"slottedContent",void 0),ks([k()],Is.prototype,"selectedOption",void 0),ks([U(".ft-switch")],Is.prototype,"ftSwitchDiv",void 0),W("ft-switch")(Is),W("ft-switch-option")(Es);const Us=ke.external(_e.colorOutline,"Design system"),Ls=ke.external(_e.colorOnSurfaceMedium,"Design system"),As=kt`
|
|
916
916
|
:host {
|
|
917
917
|
display: block;
|
|
918
918
|
}
|
|
@@ -923,14 +923,14 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
923
923
|
|
|
924
924
|
ft-icon {
|
|
925
925
|
transform: rotate(-45deg);
|
|
926
|
-
color: ${
|
|
926
|
+
color: ${Us};
|
|
927
927
|
}
|
|
928
928
|
|
|
929
929
|
.ft-resizer--dragging ft-icon,
|
|
930
930
|
.ft-resizer:hover ft-icon {
|
|
931
|
-
color: ${
|
|
931
|
+
color: ${Ls};
|
|
932
932
|
}
|
|
933
|
-
`;var
|
|
933
|
+
`;var _s=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Ts extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class Ws extends Ke{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=aa.material,this.cursor="nwse-resize",this.dragging=!1,this.fixedWidth=0,this.fixedHeight=0,this.startX=0,this.startY=0,this.doDragFromMouse=t=>this.doDrag(t.clientX,t.clientY),this.doDragFromTouch=t=>this.doDrag(t.touches[0].clientX,t.touches[0].clientY),this.stopDrag=()=>{this.dragging=!1,document.removeEventListener("mousemove",this.doDragFromMouse,!1),document.removeEventListener("mouseup",this.stopDrag,!1),document.removeEventListener("touchmove",this.doDragFromTouch,!1),document.removeEventListener("touchend",this.stopDrag,!1),document.removeEventListener("touchcancel",this.stopDrag,!1)}}render(){return fe`
|
|
934
934
|
<style>
|
|
935
935
|
.ft-resizer {
|
|
936
936
|
cursor: ${Et(this.cursor)}
|
|
@@ -941,25 +941,25 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
941
941
|
@touchstart=${this.initDragFromTouch}>
|
|
942
942
|
<ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
|
|
943
943
|
</div>
|
|
944
|
-
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,e){this.dragging=!0,this.startX=t,this.startY=e,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,e){let i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new
|
|
944
|
+
`}initDragFromMouse(t){this.initDrag(t.clientX,t.clientY)}initDragFromTouch(t){t.preventDefault(),t.stopPropagation(),this.initDrag(t.touches[0].clientX,t.touches[0].clientY)}initDrag(t,e){this.dragging=!0,this.startX=t,this.startY=e,this.fixedWidth=this.initialWidth,this.fixedHeight=this.initialHeight,this.installDocumentEventListeners()}installDocumentEventListeners(){document.addEventListener("mousemove",this.doDragFromMouse,!1),document.addEventListener("mouseup",this.stopDrag,!1),document.addEventListener("touchmove",this.doDragFromTouch,!1),document.addEventListener("touchend",this.stopDrag,!1),document.addEventListener("touchcancel",this.stopDrag,!1)}doDrag(t,e){let i=this.fixedWidth+t-this.startX,o=this.fixedHeight+e-this.startY;this.dispatchEvent(new Ts(i,o))}}Ws.elementDefinitions={"ft-icon":la},Ws.styles=[He,As],_s([E({type:Number})],Ws.prototype,"initialWidth",void 0),_s([E({type:Number})],Ws.prototype,"initialHeight",void 0),_s([E()],Ws.prototype,"icon",void 0),_s([E()],Ws.prototype,"iconVariant",void 0),_s([E()],Ws.prototype,"cursor",void 0),_s([k()],Ws.prototype,"dragging",void 0),_s([R({passive:!0})],Ws.prototype,"initDragFromMouse",null),_s([R({passive:!0})],Ws.prototype,"initDragFromTouch",null),W("ft-resizer")(Ws);const Ds={fontSize:ke.create("--ft-input-label-font-size","","SIZE","14px"),raisedFontSize:ke.create("--ft-input-label-raised-font-size","","SIZE","11px"),raisedZIndex:ke.create("--ft-input-label-outlined-raised-z-index","","NUMBER","2"),verticalSpacing:ke.create("--ft-input-label-vertical-spacing","","SIZE","4px"),horizontalSpacing:ke.create("--ft-input-label-horizontal-spacing","","SIZE","12px"),labelMaxWidth:ke.create("--ft-input-label-max-width","","SIZE","100%"),borderColor:ke.extend("--ft-input-label-border-color","",_e.colorOutline),textColor:ke.extend("--ft-input-label-text-color","",_e.colorOnSurfaceMedium),disabledTextColor:ke.extend("--ft-input-label-disabled-text-color","",_e.colorOnSurfaceDisabled),colorSurface:ke.external(_e.colorSurface,"Design system"),borderRadiusS:ke.external(_e.borderRadiusS,"Design system"),colorError:ke.external(_e.colorError,"Design system")},Fs=kt`
|
|
945
945
|
.ft-input-label {
|
|
946
946
|
position: absolute;
|
|
947
947
|
inset: 0;
|
|
948
948
|
display: flex;
|
|
949
|
-
background-color: ${
|
|
950
|
-
border-radius: ${
|
|
949
|
+
background-color: ${Ds.colorSurface};
|
|
950
|
+
border-radius: ${Ds.borderRadiusS} ${Ds.borderRadiusS} 0 0;
|
|
951
951
|
}
|
|
952
952
|
|
|
953
953
|
.ft-input-label--outlined {
|
|
954
|
-
border-radius: ${
|
|
954
|
+
border-radius: ${Ds.borderRadiusS};
|
|
955
955
|
}
|
|
956
956
|
|
|
957
957
|
.ft-input-label {
|
|
958
|
-
border-color: ${
|
|
958
|
+
border-color: ${Ds.borderColor};
|
|
959
959
|
}
|
|
960
960
|
|
|
961
961
|
.ft-input-label.ft-input-label--in-error {
|
|
962
|
-
border-color: ${
|
|
962
|
+
border-color: ${Ds.colorError}
|
|
963
963
|
}
|
|
964
964
|
|
|
965
965
|
.ft-input-label:before,
|
|
@@ -972,7 +972,7 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
972
972
|
}
|
|
973
973
|
|
|
974
974
|
.ft-input-label:before {
|
|
975
|
-
width: calc(${
|
|
975
|
+
width: calc(${Ds.horizontalSpacing} - 4px);
|
|
976
976
|
flex-shrink: 0;
|
|
977
977
|
}
|
|
978
978
|
|
|
@@ -988,20 +988,20 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
988
988
|
border-bottom-width: 1px;
|
|
989
989
|
border-bottom-style: solid;
|
|
990
990
|
border-color: inherit;
|
|
991
|
-
color: ${
|
|
991
|
+
color: ${Ds.textColor};
|
|
992
992
|
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
993
|
-
max-width: calc(${
|
|
993
|
+
max-width: calc(${Ds.labelMaxWidth} - 2 * (${Ds.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
|
|
994
994
|
text-overflow: ellipsis;
|
|
995
|
-
${Re(Fr.fontSize,
|
|
996
|
-
${Re(Fr.lineHeight,
|
|
995
|
+
${Re(Fr.fontSize,Ds.fontSize)};
|
|
996
|
+
${Re(Fr.lineHeight,Ds.fontSize)};
|
|
997
997
|
}
|
|
998
998
|
|
|
999
999
|
.ft-input-label--in-error .ft-input-label--text {
|
|
1000
|
-
color: ${
|
|
1000
|
+
color: ${Ds.colorError}
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
1003
|
.ft-input-label--disabled .ft-input-label--text {
|
|
1004
|
-
color: ${
|
|
1004
|
+
color: ${Ds.disabledTextColor};
|
|
1005
1005
|
}
|
|
1006
1006
|
|
|
1007
1007
|
.ft-input-label--hidden-text {
|
|
@@ -1018,19 +1018,19 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1018
1018
|
overflow: hidden;
|
|
1019
1019
|
white-space: nowrap;
|
|
1020
1020
|
text-overflow: ellipsis;
|
|
1021
|
-
padding: ${
|
|
1022
|
-
margin: calc(${
|
|
1021
|
+
padding: ${Ds.verticalSpacing} 4px;
|
|
1022
|
+
margin: calc(${Ds.verticalSpacing} * -1) 0;
|
|
1023
1023
|
max-width: 100%;
|
|
1024
1024
|
box-sizing: border-box;
|
|
1025
1025
|
}
|
|
1026
1026
|
|
|
1027
1027
|
.ft-input-label--raised .ft-input-label--text {
|
|
1028
|
-
${Re(Fr.fontSize,
|
|
1029
|
-
${Re(Fr.lineHeight,
|
|
1028
|
+
${Re(Fr.fontSize,Ds.raisedFontSize)};
|
|
1029
|
+
${Re(Fr.lineHeight,Ds.raisedFontSize)};
|
|
1030
1030
|
}
|
|
1031
1031
|
|
|
1032
1032
|
.ft-input-label--raised .ft-input-label--floating-text {
|
|
1033
|
-
top: ${
|
|
1033
|
+
top: ${Ds.verticalSpacing};
|
|
1034
1034
|
}
|
|
1035
1035
|
|
|
1036
1036
|
.ft-input-label--outlined .ft-input-label--text,
|
|
@@ -1043,28 +1043,28 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1043
1043
|
.ft-input-label--outlined:before {
|
|
1044
1044
|
border-left-width: 1px;
|
|
1045
1045
|
border-left-style: solid;
|
|
1046
|
-
border-radius: ${
|
|
1046
|
+
border-radius: ${Ds.borderRadiusS} 0 0 ${Ds.borderRadiusS};
|
|
1047
1047
|
}
|
|
1048
1048
|
|
|
1049
1049
|
.ft-input-label--outlined:after {
|
|
1050
1050
|
border-right-width: 1px;
|
|
1051
1051
|
border-right-style: solid;
|
|
1052
|
-
border-radius: 0 ${
|
|
1052
|
+
border-radius: 0 ${Ds.borderRadiusS} ${Ds.borderRadiusS} 0;
|
|
1053
1053
|
}
|
|
1054
1054
|
|
|
1055
1055
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
|
|
1056
1056
|
padding: 2px 4px;
|
|
1057
|
-
z-index: ${
|
|
1058
|
-
background-color: ${
|
|
1059
|
-
border-radius: ${
|
|
1057
|
+
z-index: ${Ds.raisedZIndex};
|
|
1058
|
+
background-color: ${Ds.colorSurface};
|
|
1059
|
+
border-radius: ${Ds.borderRadiusS};
|
|
1060
1060
|
top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
|
|
1061
1061
|
}
|
|
1062
1062
|
|
|
1063
1063
|
.ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
|
|
1064
1064
|
border-top: none;
|
|
1065
1065
|
}
|
|
1066
|
-
`;var
|
|
1067
|
-
<div class="${
|
|
1066
|
+
`;var Ps=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Ms extends Ke{constructor(){super(...arguments),this.text="",this.raised=!1,this.outlined=!1,this.disabled=!1,this.error=!1}render(){const t={"ft-input-label":!0,"ft-input-label--raised":this.raised,"ft-input-label--outlined":this.outlined,"ft-input-label--disabled":this.disabled,"ft-input-label--in-error":this.error};return fe`
|
|
1067
|
+
<div class="${ms(t)}">
|
|
1068
1068
|
${this.text?fe`
|
|
1069
1069
|
<div class="ft-input-label--text ft-typography--caption">
|
|
1070
1070
|
<span class="ft-input-label--floating-text">${this.text}</span>
|
|
@@ -1072,7 +1072,7 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1072
1072
|
</div>
|
|
1073
1073
|
`:null}
|
|
1074
1074
|
</div>
|
|
1075
|
-
`}}
|
|
1075
|
+
`}}Ms.elementDefinitions={},Ms.styles=[nn,Fs],Ps([E({type:String})],Ms.prototype,"text",void 0),Ps([E({type:Boolean})],Ms.prototype,"raised",void 0),Ps([E({type:Boolean})],Ms.prototype,"outlined",void 0),Ps([E({type:Boolean})],Ms.prototype,"disabled",void 0),Ps([E({type:Boolean})],Ms.prototype,"error",void 0),W("ft-input-label")(Ms);const js={fontSize:ke.create("--ft-text-area-font-size","","SIZE","14px"),labelSize:ke.create("--ft-text-area-label-size","","SIZE","11px"),verticalSpacing:ke.create("--ft-text-area-vertical-spacing","","SIZE","4px"),horizontalSpacing:ke.create("--ft-text-area-horizontal-spacing","","SIZE","16px"),helperColor:ke.extend("--ft-text-area-helper-color","",_e.colorOnSurfaceMedium),colorPrimary:ke.external(_e.colorPrimary,"Design system"),colorOnSurface:ke.external(_e.colorOnSurface,"Design system"),colorOnSurfaceDisabled:ke.external(_e.colorOnSurfaceDisabled,"Design system"),borderRadiusS:ke.external(_e.borderRadiusS,"Design system"),colorError:ke.external(_e.colorError,"Design system")},zs=kt`
|
|
1076
1076
|
*:focus {
|
|
1077
1077
|
outline: none;
|
|
1078
1078
|
}
|
|
@@ -1084,10 +1084,10 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1084
1084
|
}
|
|
1085
1085
|
|
|
1086
1086
|
ft-input-label {
|
|
1087
|
-
${Re(
|
|
1088
|
-
${Re(
|
|
1089
|
-
${Re(
|
|
1090
|
-
${Re(
|
|
1087
|
+
${Re(Ds.fontSize,js.fontSize)};
|
|
1088
|
+
${Re(Ds.raisedFontSize,js.labelSize)};
|
|
1089
|
+
${Re(Ds.verticalSpacing,js.verticalSpacing)};
|
|
1090
|
+
${Re(Ds.horizontalSpacing,js.horizontalSpacing)};
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
1093
|
.ft-text-area--main-panel {
|
|
@@ -1118,12 +1118,12 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1118
1118
|
align-self: stretch;
|
|
1119
1119
|
resize: none;
|
|
1120
1120
|
|
|
1121
|
-
${Re(Ur.fontSize,
|
|
1122
|
-
${Re(Ur.lineHeight,
|
|
1123
|
-
color: ${
|
|
1121
|
+
${Re(Ur.fontSize,js.fontSize)};
|
|
1122
|
+
${Re(Ur.lineHeight,js.fontSize)};
|
|
1123
|
+
color: ${js.colorOnSurface};
|
|
1124
1124
|
|
|
1125
|
-
padding: 0 ${
|
|
1126
|
-
margin: calc(${
|
|
1125
|
+
padding: 0 ${js.horizontalSpacing};
|
|
1126
|
+
margin: calc(${js.verticalSpacing} + ${js.labelSize} / 2) 0 ${js.verticalSpacing} 0;
|
|
1127
1127
|
|
|
1128
1128
|
border: none;
|
|
1129
1129
|
background: none;
|
|
@@ -1132,7 +1132,7 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1132
1132
|
}
|
|
1133
1133
|
|
|
1134
1134
|
.ft-text-area--disabled .ft-text-area--input {
|
|
1135
|
-
color: ${
|
|
1135
|
+
color: ${js.colorOnSurfaceDisabled};
|
|
1136
1136
|
}
|
|
1137
1137
|
|
|
1138
1138
|
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
@@ -1140,49 +1140,49 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1140
1140
|
}
|
|
1141
1141
|
|
|
1142
1142
|
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
1143
|
-
${Re(
|
|
1144
|
-
${Re(
|
|
1143
|
+
${Re(Ds.borderColor,js.colorPrimary)};
|
|
1144
|
+
${Re(Ds.textColor,js.colorPrimary)};
|
|
1145
1145
|
}
|
|
1146
1146
|
|
|
1147
1147
|
.ft-text-area--filled .ft-text-area--input-panel {
|
|
1148
|
-
border-radius: ${
|
|
1148
|
+
border-radius: ${js.borderRadiusS} ${js.borderRadiusS} 0 0;
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
1151
|
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
1152
1152
|
align-self: stretch;
|
|
1153
|
-
margin-bottom: ${
|
|
1154
|
-
margin-top: calc(${
|
|
1153
|
+
margin-bottom: ${js.verticalSpacing};
|
|
1154
|
+
margin-top: calc(${js.labelSize} + 2 * ${js.verticalSpacing});
|
|
1155
1155
|
}
|
|
1156
1156
|
|
|
1157
1157
|
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
1158
|
-
border-radius: ${
|
|
1158
|
+
border-radius: ${js.borderRadiusS};
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
1161
|
.ft-text-area--helper-text {
|
|
1162
|
-
padding: 0 12px 0 ${
|
|
1163
|
-
color: ${
|
|
1162
|
+
padding: 0 12px 0 ${js.horizontalSpacing};
|
|
1163
|
+
color: ${js.helperColor};
|
|
1164
1164
|
}
|
|
1165
1165
|
|
|
1166
1166
|
.ft-text-area--in-error .ft-text-area--input,
|
|
1167
1167
|
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
1168
|
-
color: ${
|
|
1168
|
+
color: ${js.colorError};
|
|
1169
1169
|
}
|
|
1170
1170
|
|
|
1171
1171
|
ft-resizer {
|
|
1172
1172
|
position: absolute;
|
|
1173
1173
|
bottom: 0;
|
|
1174
1174
|
}
|
|
1175
|
-
`;var
|
|
1175
|
+
`;var Bs=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Ks extends(qo(Ke,"textbox")){constructor(){super(...arguments),this.label="",this.value="",this.helper="",this.outlined=!1,this.disabled=!1,this.error=!1,this.height=50,this.focused=!1}render(){const t={"ft-text-area":!0,"ft-text-area--filled":!this.outlined,"ft-text-area--outlined":this.outlined,"ft-text-area--disabled":this.disabled,"ft-text-area--has-value":!!this.value,"ft-text-area--no-label":!this.label,"ft-text-area--in-error":this.error};return fe`
|
|
1176
1176
|
<style>
|
|
1177
1177
|
.ft-text-area--main-panel {
|
|
1178
|
-
height: calc(4 * ${
|
|
1178
|
+
height: calc(4 * ${js.verticalSpacing} + ${js.labelSize} + ${js.fontSize} + ${this.height}px);
|
|
1179
1179
|
}
|
|
1180
1180
|
|
|
1181
1181
|
ft-resizer {
|
|
1182
1182
|
right: ${null!=this.textarea?this.textarea.offsetWidth-this.textarea.clientWidth:0}px;
|
|
1183
1183
|
}
|
|
1184
1184
|
</style>
|
|
1185
|
-
<div class="${
|
|
1185
|
+
<div class="${ms(t)}">
|
|
1186
1186
|
<div class="ft-text-area--main-panel">
|
|
1187
1187
|
<ft-input-label text="${this.label}"
|
|
1188
1188
|
?disabled=${this.disabled}
|
|
@@ -1214,27 +1214,27 @@ const bs=ta(class extends ea{constructor(t){if(super(t),t.type!==Jn||"class"!==t
|
|
|
1214
1214
|
${this.helper}
|
|
1215
1215
|
</ft-typography>`:void 0}
|
|
1216
1216
|
</div>
|
|
1217
|
-
`}setValue(t,e=!1){this.value=t,this.setFormValue(t),e&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}
|
|
1217
|
+
`}setValue(t,e=!1){this.value=t,this.setFormValue(t),e&&(this.dispatchEvent(new CustomEvent("live-change",{detail:this.value})),this.dispatchEvent(new CustomEvent("change",{detail:this.value})))}contentAvailableCallback(t){super.contentAvailableCallback(t),this.requestUpdate()}onKeyDown(t){"Enter"!==t.key&&" "!==t.key||t.stopPropagation()}updateValueFromInputField(){this.dispatchEvent(new CustomEvent("change",{detail:this.value}))}liveUpdateValueFromInputField(){var t;this.value=(null===(t=this.textarea)||void 0===t?void 0:t.value)||"",this.setFormValue(this.value),this.dispatchEvent(new CustomEvent("live-change",{detail:this.value}))}onResize(t){t.detail.height>=50&&(this.height=t.detail.height)}}Ks.elementDefinitions={"ft-input-label":Ms,"ft-resizer":Ws,"ft-ripple":ws,"ft-typography":Xn},Ks.styles=[on,zs],Bs([E({type:String})],Ks.prototype,"label",void 0),Bs([E({reflect:!0})],Ks.prototype,"value",void 0),Bs([E({type:String})],Ks.prototype,"helper",void 0),Bs([E({type:Boolean})],Ks.prototype,"outlined",void 0),Bs([E({type:Boolean})],Ks.prototype,"disabled",void 0),Bs([E({type:Boolean})],Ks.prototype,"error",void 0),Bs([E({type:Number,reflect:!0})],Ks.prototype,"height",void 0),Bs([U("textarea")],Ks.prototype,"textarea",void 0),Bs([k()],Ks.prototype,"focused",void 0),W("ft-text-area")(Ks);
|
|
1218
1218
|
/**
|
|
1219
1219
|
* @license
|
|
1220
1220
|
* Copyright 2020 Google LLC
|
|
1221
1221
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1222
1222
|
*/
|
|
1223
|
-
const{D:
|
|
1223
|
+
const{D:Zs}=xt,Hs=()=>document.createComment(""),Gs=(t,e,i)=>{const o=t._$AA.parentNode,r=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=o.insertBefore(Hs(),r),n=o.insertBefore(Hs(),r);i=new Zs(e,n,t,t.options)}else{const e=i._$AB.nextSibling,n=i._$AM,a=n!==t;if(a){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==n._$AU&&i._$AP(e)}if(e!==r||a){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;o.insertBefore(t,r),t=e}}}return i},Vs=(t,e,i=t)=>(t._$AI(e,i),t),qs={},Ys=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},Xs=(t,e,i)=>{const o=new Map;for(let r=e;r<=i;r++)o.set(t[r],r);return o},Js=ta(class extends ea{constructor(t){if(super(t),t.type!==Qn)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 r=[],n=[];let a=0;for(const e of t)r[a]=o?o(e,a):a,n[a]=i(e,a),a++;return{values:n,keys:r}}render(t,e,i){return this.ht(t,e,i).values}update(t,[e,i,o]){const r=(t=>t._$AH)(t),{values:n,keys:a}=this.ht(e,i,o);if(!Array.isArray(r))return this.dt=a,n;const s=this.dt??=[],l=[];let c,f,h=0,d=r.length-1,u=0,p=n.length-1;for(;h<=d&&u<=p;)if(null===r[h])h++;else if(null===r[d])d--;else if(s[h]===a[u])l[u]=Vs(r[h],n[u]),h++,u++;else if(s[d]===a[p])l[p]=Vs(r[d],n[p]),d--,p--;else if(s[h]===a[p])l[p]=Vs(r[h],n[p]),Gs(t,l[p+1],r[h]),h++,p--;else if(s[d]===a[u])l[u]=Vs(r[d],n[u]),Gs(t,r[h],r[d]),d--,u++;else if(void 0===c&&(c=Xs(a,u,p),f=Xs(s,h,d)),c.has(s[h]))if(c.has(s[d])){const e=f.get(a[u]),i=void 0!==e?r[e]:null;if(null===i){const e=Gs(t,r[h]);Vs(e,n[u]),l[u]=e}else l[u]=Vs(i,n[u]),Gs(t,r[h],i),r[e]=null;u++}else Ys(r[d]),d--;else Ys(r[h]),h++;for(;u<=p;){const e=Gs(t,l[p+1]);Vs(e,n[u]),l[u++]=e}for(;h<=d;){const t=r[h++];null!==t&&Ys(t)}return this.dt=a,((t,e=qs)=>{t._$AH=e})(t,l),nt}});
|
|
1224
1224
|
/**
|
|
1225
1225
|
* @license
|
|
1226
1226
|
* Copyright 2017 Google LLC
|
|
1227
1227
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1228
|
-
*/class
|
|
1228
|
+
*/class Qs extends Ke{render(){return fe`
|
|
1229
1229
|
<div class="ft-loader">
|
|
1230
1230
|
<div></div>
|
|
1231
1231
|
<div></div>
|
|
1232
1232
|
<div></div>
|
|
1233
1233
|
<div></div>
|
|
1234
1234
|
</div>
|
|
1235
|
-
`}}
|
|
1235
|
+
`}}Qs.styles=dn,W("ft-loader")(Qs);var tl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class el extends(qo(Ke,"button")){constructor(){super(...arguments),this.role="button",this.type="button",this.disabled=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{var e;this.isDisabled()?(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()):"submit"==this.type&&(null===(e=this.form)||void 0===e||e.requestSubmit())}}render(){return this.addTooltipIfNeeded(fe`
|
|
1236
1236
|
<button part="button"
|
|
1237
|
-
class="${
|
|
1237
|
+
class="${ms(this.buttonClasses)}"
|
|
1238
1238
|
aria-label="${this.getLabel()}"
|
|
1239
1239
|
?disabled=${this.isDisabled()}>
|
|
1240
1240
|
<ft-ripple part="ripple" ?disabled=${this.isDisabled()}></ft-ripple>
|
|
@@ -1255,7 +1255,7 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1255
1255
|
</ft-tooltip>
|
|
1256
1256
|
`:t}resolveIcon(){return this.loading?fe`
|
|
1257
1257
|
<ft-loader part="loader icon"></ft-loader> `:this.icon?fe`
|
|
1258
|
-
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:de}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}
|
|
1258
|
+
<ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:de}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}el.elementDefinitions={"ft-ripple":ws,"ft-tooltip":vs,"ft-typography":Xn,"ft-icon":la,"ft-loader":Qs},tl([E({type:String,reflect:!0})],el.prototype,"role",void 0),tl([E()],el.prototype,"type",void 0),tl([E({type:Boolean})],el.prototype,"disabled",void 0),tl([E()],el.prototype,"label",void 0),tl([E()],el.prototype,"icon",void 0),tl([E()],el.prototype,"iconVariant",void 0),tl([E({type:Boolean})],el.prototype,"trailingIcon",void 0),tl([E({type:Boolean})],el.prototype,"loading",void 0),tl([E()],el.prototype,"tooltipPosition",void 0),tl([E({type:Boolean})],el.prototype,"hideTooltip",void 0),tl([E({type:Boolean})],el.prototype,"forceTooltip",void 0),tl([U(".ft-button")],el.prototype,"button",void 0),tl([U(".ft-button--label slot")],el.prototype,"slottedContent",void 0);var il=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class ol extends el{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.dense=!1,this.round=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0}}get typographyVariant(){return"button"}}ol.styles=[Ge,Sn],il([E({type:Boolean})],ol.prototype,"primary",void 0),il([E({type:Boolean})],ol.prototype,"outlined",void 0),il([E({type:Boolean})],ol.prototype,"dense",void 0),il([E({type:Boolean})],ol.prototype,"round",void 0);const rl=[kt`
|
|
1259
1259
|
:host {
|
|
1260
1260
|
display: inline-block;
|
|
1261
1261
|
max-width: 100%;
|
|
@@ -1473,15 +1473,15 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1473
1473
|
width: ${Ae.smallIconOnlyWidth};
|
|
1474
1474
|
padding: unset;
|
|
1475
1475
|
}
|
|
1476
|
-
`,He];var
|
|
1477
|
-
`,
|
|
1478
|
-
`,
|
|
1476
|
+
`,He];var nl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class al extends el{constructor(){super(...arguments),this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.small=!1}get buttonClasses(){return{"ft-button":!0,"ft-button--primary":this.primary,"ft-button--secondary":this.secondary,"ft-button--tertiary":this.tertiary||!this.primary&&!this.secondary&&!this.neutral,"ft-button--neutral":this.neutral,"ft-button--large":!this.small,"ft-button--small":this.small,"ft-button--icon-only":!this.hasTextContent(),"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0,"ft-button--no-icon":!this.icon}}get typographyVariant(){return this.small?qn.caption1medium:qn.body2medium}}al.styles=[Ge,rl],nl([E({type:Boolean})],al.prototype,"primary",void 0),nl([E({type:Boolean})],al.prototype,"secondary",void 0),nl([E({type:Boolean})],al.prototype,"tertiary",void 0),nl([E({type:Boolean})],al.prototype,"neutral",void 0),nl([E({type:Boolean})],al.prototype,"small",void 0),W("ft-button")(ol),W("ftds-button")(al);const sl=kt`
|
|
1477
|
+
`,ll=kt`
|
|
1478
|
+
`,cl=Go.get({name:"ft-app-info",reducers:{setBaseUrl:(t,e)=>{t.baseUrl=e.payload},setApiIntegrationIdentifier:(t,e)=>{t.apiIntegrationIdentifier=e.payload},setUiLocale:(t,e)=>{t.uiLocale=e.payload},setAvailableUiLocales:(t,e)=>{t.availableUiLocales=e.payload},setEditorMode:(t,e)=>{t.editorMode=e.payload},setNoCustom:(t,e)=>{t.noCustom=e.payload},setNoCustomComponent:(t,e)=>{t.noCustomComponent=e.payload},setSession:(t,e)=>{t.session=e.payload}},initialState:{uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],editorMode:!1,noCustom:!1,noCustomComponent:!1}});class fl{static build(t){const{baseUrl:e,apiIntegrationIdentifier:i}=cl.getState(),o=null!=t?t:i;if(e&&o&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,o,!0)}static get(t){var e;return null!=t?fl.build(t):null!==(e=fl.API)&&void 0!==e?e:fl.API=fl.build()}static await(t){return new Promise((e=>{let i=fl.get(t);if(i)e(i);else{const o=cl.subscribe((()=>{i=fl.get(t),i&&(o(),e(i))}))}}))}}var hl;const dl=Symbol("clearAfterUnitTest");class ul{constructor(t){this.messageContextProvider=t,this.defaultMessages={},this.cache=new o,this.listeners={},this.currentUiLocale="",this[hl]=()=>{this.defaultMessages={},this.cache=new o,this.listeners={}},this.currentUiLocale=cl.getState().uiLocale,cl.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=cl.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const e=t.name.toLowerCase();this.cache.setFinal(e,t),this.notify(e)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var i;if(t=t.toLowerCase(),Object.keys(e).length>0){const o={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};T(this.defaultMessages[t],o)||(this.defaultMessages[t]=o,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...i){var o,r,n;t=t.toLowerCase(),this.fetchContext(t);const a=null!==(r=null===(o=this.cache.getNow(t))||void 0===o?void 0:o.messages)&&void 0!==r?r:{};return new Ve(null!==(n=this.defaultMessages[t])&&void 0!==n?n:{},a).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,e){var i;return t=t.toLowerCase(),this.listeners[t]=null!==(i=this.listeners[t])&&void 0!==i?i:new Set,this.listeners[t].add(e),()=>{var i;return null===(i=this.listeners[t])||void 0===i?void 0:i.delete(e)}}async notifyAll(){await Promise.all(Object.keys(this.listeners).map((t=>this.notify(t))))}async notify(t){null!=this.listeners[t]&&await Promise.all([...this.listeners[t].values()].map((t=>_(0).then((()=>t())).catch((()=>null)))))}}hl=dl,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new ul((async(t,e)=>(await fl.await()).getFluidTopicsMessageContext(t,e)))),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new ul((async(t,e)=>(await fl.await()).getCustomMessageContext(t,e))));const pl=window.FluidTopicsI18nService,yl=window.FluidTopicsCustomI18nService;var gl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class bl extends Ke{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.availableUiLocales=[],this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>fl.get(),this.cache=new o,this.cleanSessionDebouncer=new A}render(){return fe`
|
|
1479
1479
|
<slot></slot>
|
|
1480
|
-
`}update(t){super.update(t),t.has("baseUrl")&&
|
|
1480
|
+
`}update(t){super.update(t),t.has("baseUrl")&&cl.actions.setBaseUrl(this.baseUrl),t.has("apiIntegrationIdentifier")&&cl.actions.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&cl.actions.setUiLocale(this.uiLocale),t.has("noCustom")&&cl.actions.setNoCustom(this.noCustom),t.has("editorMode")&&cl.actions.setEditorMode(this.editorMode),t.has("noCustomComponent")&&cl.actions.setNoCustomComponent(this.noCustomComponent),t.has("session")&&cl.actions.setSession(this.session),t.has("availableUiLocales")&&cl.actions.setAvailableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>pl.addContext(t))),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){const t=this.apiProvider();!this.withManualResources&&t&&(null==this.session&&(this.session=await this.cache.get("session",(async()=>{const e=await t.getCurrentSession();return e.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),e.idleTimeoutInMillis),e}))),null==this.availableUiLocales&&(this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>t.getAvailableUiLocales()))))}}bl.elementDefinitions={},bl.styles=ll,gl([E()],bl.prototype,"baseUrl",void 0),gl([E()],bl.prototype,"apiIntegrationIdentifier",void 0),gl([E()],bl.prototype,"uiLocale",void 0),gl([D([])],bl.prototype,"availableUiLocales",void 0),gl([E({type:Boolean})],bl.prototype,"editorMode",void 0),gl([E({type:Boolean})],bl.prototype,"noCustom",void 0),gl([E({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],bl.prototype,"noCustomComponent",void 0),gl([E({type:Boolean})],bl.prototype,"withManualResources",void 0),gl([D([])],bl.prototype,"messageContexts",void 0),gl([D(void 0)],bl.prototype,"session",void 0),gl([E({type:Object})],bl.prototype,"apiProvider",void 0);class vl{async listMySearches(){var t;return(null===(t=cl.getState().session)||void 0===t?void 0:t.sessionAuthenticated)?(await fl.await()).listMySearches(cl.getState().session.profile.userId):[]}}const ml=new o;class xl{async listMyBookmarks(){return ml.get("bookmarks",(async()=>(await fl.await()).listMyBookmarks(cl.getState().session.profile.userId)))}clearCache(){ml.clear("bookmarks")}}const wl=Go.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Ol=new class{constructor(){this.currentSession=cl.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new xl,cl.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=cl.getState();T(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){wl.actions.savedSearches(void 0)}clearMyBookmarks(){wl.actions.bookmarks(void 0)}async reloadMySearches(){const t=new vl,e=await t.listMySearches();wl.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){const e=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;wl.actions.bookmarks(e)}}};W("ft-app-context")(bl);var Sl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};const $l=Symbol("i18nProperties"),Nl=Symbol("i18nUnsubs");function Cl(t){var e;class i extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?yl:pl}i18n(t,e,...i){var o;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...i);const r=null!==(o=t.args)&&void 0!==o?o:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e;null===(e=this[$l])||void 0===e||e.forEach(((e,i)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[i]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}update(t){var e;super.update(t),null===(e=this[$l])||void 0===e||e.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}connectedCallback(){super.connectedCallback(),null!=this[$l]&&new Set([...this[$l].values()].map((t=>t.context))).forEach((t=>this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Nl].has(t)||this[Nl].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages(t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Nl].forEach((t=>t())),this[Nl].clear()}}return e=Nl,Sl([E({type:Boolean})],i.prototype,"useCustomMessageContexts",void 0),i}class El extends(Cl(Ke)){}class kl extends(Cl(ri)){}var Rl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Il extends kl{constructor(){super(),this.editorMode=!1,this.addStore(cl)}render(){return this.key&&this.context?fe`
|
|
1481
1481
|
<span class="ft-i18n">
|
|
1482
1482
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1483
1483
|
</span>
|
|
1484
|
-
`:this.editorMode?"Select a context and a label key.":de}update(t){var e;super.update(t),this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}
|
|
1484
|
+
`:this.editorMode?"Select a context and a label key.":de}update(t){var e;super.update(t),this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}Il.elementDefinitions={},Il.styles=sl,Rl([qe()],Il.prototype,"editorMode",void 0),Rl([E()],Il.prototype,"context",void 0),Rl([E()],Il.prototype,"key",void 0),Rl([D([])],Il.prototype,"args",void 0),Rl([E()],Il.prototype,"defaultMessage",void 0);class Ul{static build(t){return new Ul(t)}static fromGwt(t){return new Ul(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const i=e;return t=>({context:this.name,key:i,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>pl.resolveMessage(this.name,e,...t)})}}const Ll=(t,e)=>(i,o)=>{var r,n;i.constructor.createProperty(o,null!=e?e:{attribute:!1,type:String});const a={...t,key:null!==(r=t.key)&&void 0!==r?r:o};i[$l]=null!==(n=i[$l])&&void 0!==n?n:new Map,i[$l].set(o,a)};W("ft-i18n")(Il);const Al=Ul.build("integratedFeedbackComponent"),_l={starsRating:"{0} stars","starsRating[\\=1]":"1 star",like:"Like",dislike:"Dislike",dichotomousYes:"Yes",dichotomousNo:"No",notRated:"Not rated",ratedNow:"Rated now",ratedToday:"Rated today",ratedOn:"Rated on {0, date}",feedbackInputLabel:"How can we improve it?",feedbackfromEmail:"Your email",feedbackfromEmailInvalid:"Please enter a valid email address",okButton:"Send feedback",cancelButton:"Cancel",feedbackSuccess:"Feedback successfully sent. Thank you!",feedbackFailure:"Failed to send feedback. Please try again later.",ratingSuccess:"Rating successfully sent. Thank you!",ratingFailure:"Failed to send rating. Please try again later.",mapFeedbackMainTitle:"Send feedback",mapRatingSectionTitle:"Rate this document",mapDichotomousRatingSectionTitle:"Did it solve your problem?",mapFeedbackSectionTitle:"Write your review",topicFeedbackMainTitle:"Send feedback",topicRatingSectionTitle:"Rate this content",topicDichotomousRatingSectionTitle:"Did this content solve your problem?",topicFeedbackSectionTitle:"Write your review"},Tl=Ul.build("inDesignerFeedbackComponent"),Wl={ratingNotConfigured:"Rating unavailable: no rating configured for this content.",missingRatingRole:"Rating unavailable: missing role RATING_USER.",missingFeedbackRole:"Feedback unavailable: missing role FEEDBACK_USER.",inDesignerOnlyNotice:"This notice will not appear outside this designer.",feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."},Dl={fontSize:ke.create("--ft-text-field-font-size","","SIZE","14px"),labelSize:ke.create("--ft-text-field-label-size","","SIZE","11px"),verticalSpacing:ke.create("--ft-text-field-vertical-spacing","","SIZE","4px"),horizontalSpacing:ke.create("--ft-text-field-horizontal-spacing","","SIZE","16px"),helperColor:ke.extend("--ft-text-field-helper-color","",_e.colorOnSurfaceMedium),colorPrimary:ke.external(_e.colorPrimary,"Design system"),colorOnSurface:ke.external(_e.colorOnSurface,"Design system"),colorOnSurfaceDisabled:ke.external(_e.colorOnSurfaceDisabled,"Design system"),borderRadiusS:ke.external(_e.borderRadiusS,"Design system"),colorError:ke.external(_e.colorError,"Design system"),prefixColor:ke.extend("--ft-text-field-prefix-color","",_e.colorOnSurfaceMedium),iconColor:ke.extend("--ft-text-field-icon-color","",_e.colorOnSurfaceMedium),floatingZIndex:ke.create("--ft-text-field-floating-components-z-index","","NUMBER","3"),colorSurface:ke.external(_e.colorSurface,"Design system"),colorOutline:ke.external(_e.colorOutline,"Design system"),elevation02:ke.external(_e.elevation02,"Design system"),suggestSize:ke.create("--ft-text-field-suggest-size","","SIZE","300px")},Fl=kt`
|
|
1485
1485
|
*:focus {
|
|
1486
1486
|
outline: none;
|
|
1487
1487
|
}
|
|
@@ -1494,16 +1494,16 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1494
1494
|
}
|
|
1495
1495
|
|
|
1496
1496
|
ft-input-label {
|
|
1497
|
-
${Re(
|
|
1498
|
-
${Re(
|
|
1499
|
-
${Re(
|
|
1500
|
-
${Re(
|
|
1497
|
+
${Re(Ds.fontSize,Dl.fontSize)};
|
|
1498
|
+
${Re(Ds.raisedFontSize,Dl.labelSize)};
|
|
1499
|
+
${Re(Ds.verticalSpacing,Dl.verticalSpacing)};
|
|
1500
|
+
${Re(Ds.horizontalSpacing,Dl.horizontalSpacing)};
|
|
1501
1501
|
}
|
|
1502
1502
|
|
|
1503
1503
|
.ft-text-field--main-panel {
|
|
1504
1504
|
position: relative;
|
|
1505
1505
|
display: flex;
|
|
1506
|
-
height: calc(4 * ${
|
|
1506
|
+
height: calc(4 * ${Dl.verticalSpacing} + ${Dl.labelSize} + ${Dl.fontSize});
|
|
1507
1507
|
}
|
|
1508
1508
|
|
|
1509
1509
|
.ft-text-field--input-panel {
|
|
@@ -1512,10 +1512,10 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1512
1512
|
display: flex;
|
|
1513
1513
|
align-items: center;
|
|
1514
1514
|
overflow: hidden;
|
|
1515
|
-
padding: 0 ${
|
|
1515
|
+
padding: 0 ${Dl.horizontalSpacing};
|
|
1516
1516
|
|
|
1517
|
-
${Re(Ur.fontSize,
|
|
1518
|
-
${Re(Ur.lineHeight,
|
|
1517
|
+
${Re(Ur.fontSize,Dl.fontSize)};
|
|
1518
|
+
${Re(Ur.lineHeight,Dl.fontSize)};
|
|
1519
1519
|
}
|
|
1520
1520
|
|
|
1521
1521
|
.ft-text-field--input-panel ft-ripple {
|
|
@@ -1525,11 +1525,11 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1525
1525
|
|
|
1526
1526
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
|
|
1527
1527
|
align-items: flex-end;
|
|
1528
|
-
padding: 0 ${
|
|
1528
|
+
padding: 0 ${Dl.horizontalSpacing} ${Dl.verticalSpacing} ${Dl.horizontalSpacing};
|
|
1529
1529
|
}
|
|
1530
1530
|
|
|
1531
1531
|
.ft-text-field--prefix {
|
|
1532
|
-
color: ${
|
|
1532
|
+
color: ${Dl.prefixColor};
|
|
1533
1533
|
margin-right: 2px;
|
|
1534
1534
|
flex-shrink: 1;
|
|
1535
1535
|
overflow: hidden;
|
|
@@ -1548,15 +1548,15 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1548
1548
|
flex-shrink: 1;
|
|
1549
1549
|
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
1550
1550
|
|
|
1551
|
-
color: ${
|
|
1552
|
-
padding: calc(2 * ${
|
|
1551
|
+
color: ${Dl.colorOnSurface};
|
|
1552
|
+
padding: calc(2 * ${Dl.verticalSpacing}) 0;
|
|
1553
1553
|
border: none;
|
|
1554
1554
|
background: none;
|
|
1555
1555
|
}
|
|
1556
1556
|
|
|
1557
1557
|
.ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
|
|
1558
1558
|
padding-bottom: 0;
|
|
1559
|
-
padding-top: calc(${
|
|
1559
|
+
padding-top: calc(${Dl.labelSize} + 2 * ${Dl.verticalSpacing});
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
1562
|
.ft-text-field--input::-webkit-calendar-picker-indicator,
|
|
@@ -1565,37 +1565,37 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1565
1565
|
}
|
|
1566
1566
|
|
|
1567
1567
|
.ft-text-field--disabled .ft-text-field--input {
|
|
1568
|
-
color: ${
|
|
1568
|
+
color: ${Dl.colorOnSurfaceDisabled};
|
|
1569
1569
|
}
|
|
1570
1570
|
|
|
1571
1571
|
.ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
|
|
1572
|
-
${Re(
|
|
1573
|
-
${Re(
|
|
1572
|
+
${Re(Ds.borderColor,Dl.colorPrimary)};
|
|
1573
|
+
${Re(Ds.textColor,Dl.colorPrimary)};
|
|
1574
1574
|
}
|
|
1575
1575
|
|
|
1576
1576
|
.ft-text-field--filled .ft-text-field--input-panel {
|
|
1577
|
-
border-radius: ${
|
|
1577
|
+
border-radius: ${Dl.borderRadiusS} ${Dl.borderRadiusS} 0 0;
|
|
1578
1578
|
}
|
|
1579
1579
|
|
|
1580
1580
|
.ft-text-field--outlined .ft-text-field--input-panel {
|
|
1581
|
-
border-radius: ${
|
|
1581
|
+
border-radius: ${Dl.borderRadiusS};
|
|
1582
1582
|
}
|
|
1583
1583
|
|
|
1584
1584
|
.ft-text-field--helper-text {
|
|
1585
|
-
padding: 0 12px 0 ${
|
|
1586
|
-
color: ${
|
|
1585
|
+
padding: 0 12px 0 ${Dl.horizontalSpacing};
|
|
1586
|
+
color: ${Dl.helperColor};
|
|
1587
1587
|
}
|
|
1588
1588
|
|
|
1589
1589
|
.ft-text-field--in-error .ft-text-field--input,
|
|
1590
1590
|
.ft-text-field--in-error .ft-text-field--helper-text,
|
|
1591
1591
|
.ft-text-field--in-error .ft-text-field--prefix {
|
|
1592
|
-
color: ${
|
|
1592
|
+
color: ${Dl.colorError};
|
|
1593
1593
|
}
|
|
1594
1594
|
|
|
1595
1595
|
.ft-text-field--icon {
|
|
1596
1596
|
align-self: center;
|
|
1597
1597
|
margin-left: 8px;
|
|
1598
|
-
color: ${
|
|
1598
|
+
color: ${Dl.iconColor};
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
1601
|
.ft-text-field--container {
|
|
@@ -1608,13 +1608,13 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1608
1608
|
position: absolute;
|
|
1609
1609
|
left: 0;
|
|
1610
1610
|
right: 0;
|
|
1611
|
-
z-index: ${
|
|
1612
|
-
background: ${
|
|
1613
|
-
border: 1px solid ${
|
|
1614
|
-
border-radius: 0 0 ${
|
|
1615
|
-
box-shadow: ${
|
|
1611
|
+
z-index: ${Dl.floatingZIndex};
|
|
1612
|
+
background: ${Dl.colorSurface};
|
|
1613
|
+
border: 1px solid ${Dl.colorOutline};
|
|
1614
|
+
border-radius: 0 0 ${Dl.borderRadiusS} ${Dl.borderRadiusS};
|
|
1615
|
+
box-shadow: ${Dl.elevation02};
|
|
1616
1616
|
outline: none;
|
|
1617
|
-
max-height: ${
|
|
1617
|
+
max-height: ${Dl.suggestSize};
|
|
1618
1618
|
overflow-y: auto;
|
|
1619
1619
|
}
|
|
1620
1620
|
|
|
@@ -1631,14 +1631,14 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1631
1631
|
}
|
|
1632
1632
|
|
|
1633
1633
|
.ft-text-field--with-icon {
|
|
1634
|
-
${Re(
|
|
1634
|
+
${Re(Ds.labelMaxWidth,`calc(100% - ${un.size} - ${Ds.horizontalSpacing})`)};
|
|
1635
1635
|
}
|
|
1636
1636
|
|
|
1637
1637
|
.ft-text-field--with-password ft-icon:hover {
|
|
1638
1638
|
cursor: pointer;
|
|
1639
1639
|
}
|
|
1640
|
-
`;var
|
|
1641
|
-
<div class="${
|
|
1640
|
+
`;var Pl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Ml extends(qo(Ke,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=ra.EYE_SLASH,this.passwordRevealedIcon=ra.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,this.suggestionsOnTop=!1,this.hideSuggestions=!1,this.visibleSuggestions=[]}get value(){return this._value||""}set value(t){this.setInternalValue(t||""),this.dispatchedValue=t||""}setInternalValue(t){const e=this._value;this._value=t||"",this.setFormValue(this._value),this.requestUpdate("value",e)}focus(){var t;null===(t=this.input)||void 0===t||t.focus()}render(){const t={"ft-text-field":!0,"ft-text-field--filled":!this.outlined,"ft-text-field--outlined":this.outlined,"ft-text-field--disabled":this.disabled,"ft-text-field--has-value":!!this.value,"ft-text-field--with-label":!!this.label,"ft-text-field--in-error":this.error,"ft-text-field--with-prefix":!!this.prefix,"ft-text-field--hide-suggestions":0===this.visibleSuggestions.length||this.hideSuggestions,"ft-text-field--raised-label":this.focused||""!=this.value,"ft-text-field--with-icon":!!this.icon,"ft-text-field--with-password":this.password};return fe`
|
|
1641
|
+
<div class="${ms(t)}">
|
|
1642
1642
|
<div class="ft-text-field--main-panel"
|
|
1643
1643
|
@keydown=${this.handleKeyboardNavigation}
|
|
1644
1644
|
@focusout=${this.onMainPanelBlur}>
|
|
@@ -1688,7 +1688,7 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1688
1688
|
.variant=${this.iconVariant}
|
|
1689
1689
|
.value=${this.icon}
|
|
1690
1690
|
@click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
|
|
1691
|
-
`:de}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}
|
|
1691
|
+
`:de}update(t){super.update(t),(t.has("value")||t.has("filterSuggestions"))&&this.filterSuggestionsIfNeeded(),t.has("value")&&null!=t.get("value")&&(this.hideSuggestions=!1),t.has("dispatchedValue")&&null!=t.get("dispatchedValue")&&(this.hideSuggestions=!0)}filterSuggestionsIfNeeded(){this.filterSuggestions?(this.suggestions.forEach((t=>t.hidden=!t.getValue().toLowerCase().includes(this.value.toLowerCase()))),this.visibleSuggestions=this.suggestions.filter((t=>!t.hidden))):this.visibleSuggestions=this.suggestions}contentAvailableCallback(t){var e,i;if(super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0){const t=null===(e=this.input)||void 0===e?void 0:e.getBoundingClientRect(),o=null===(i=this.suggestionsContainer)||void 0===i?void 0:i.getBoundingClientRect();t&&o&&(this.suggestionsOnTop=t.bottom+o.height>window.innerHeight&&t.top-o.height>0)}}setValue(t,e=!1){this.value!==t&&(this.setInternalValue(t),this.dispatchEvent(new CustomEvent("live-change",{detail:t}))),e&&this.dispatchedValue!==t&&(this.dispatchedValue=t,this.dispatchEvent(new CustomEvent("change",{detail:t})))}handleInput(t){var e;const i=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(i,"Escape"==t.key||"Enter"==t.key)}handleClick(){this.hideSuggestions=!1}handleKeyboardNavigation(t){var e;if("ArrowDown"===t.key||"ArrowUp"===t.key){t.preventDefault(),t.stopPropagation(),this.hideSuggestions=!1;const i=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let o;o="ArrowDown"===t.key?i<this.visibleSuggestions.length-1?i+1:0:i>0?i-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[o])||void 0===e||e.focus()}"Escape"!=t.key&&"Enter"!=t.key||(this.hideSuggestions=!0)}onSuggestionSelected(t){var e;this.setValue(t.detail,!0),null===(e=this.input)||void 0===e||e.focus(),setTimeout((()=>this.hideSuggestions=!0),0)}onFocus(){this.focused=!0,this.hideSuggestions=!1}onMainPanelBlur(){var t,e;(null===(t=this.mainPanel)||void 0===t?void 0:t.matches(":focus-within"))||(this.focused=!1,this.setValue((null===(e=this.input)||void 0===e?void 0:e.value)||"",!0))}togglePasswordVisibility(){this.hidePassword=!this.hidePassword}}Ml.elementDefinitions={"ft-input-label":Ms,"ft-ripple":ws,"ft-typography":Xn,"ft-icon":la},Ml.styles=[on,Fl],Pl([E()],Ml.prototype,"label",void 0),Pl([E({noAccessor:!0})],Ml.prototype,"value",null),Pl([k()],Ml.prototype,"dispatchedValue",void 0),Pl([E()],Ml.prototype,"helper",void 0),Pl([E({type:Boolean})],Ml.prototype,"outlined",void 0),Pl([E({type:Boolean})],Ml.prototype,"disabled",void 0),Pl([E({type:Boolean})],Ml.prototype,"error",void 0),Pl([E()],Ml.prototype,"prefix",void 0),Pl([E()],Ml.prototype,"icon",void 0),Pl([E()],Ml.prototype,"passwordHiddenIcon",void 0),Pl([E()],Ml.prototype,"passwordRevealedIcon",void 0),Pl([E()],Ml.prototype,"iconVariant",void 0),Pl([E({type:Boolean})],Ml.prototype,"filterSuggestions",void 0),Pl([E({type:Number})],Ml.prototype,"maxLength",void 0),Pl([E({type:Boolean})],Ml.prototype,"password",void 0),Pl([k()],Ml.prototype,"focused",void 0),Pl([k()],Ml.prototype,"hidePassword",void 0),Pl([k()],Ml.prototype,"suggestionsOnTop",void 0),Pl([k()],Ml.prototype,"hideSuggestions",void 0),Pl([k()],Ml.prototype,"visibleSuggestions",void 0),Pl([U(".ft-text-field--main-panel")],Ml.prototype,"mainPanel",void 0),Pl([U(".ft-text-field--input")],Ml.prototype,"input",void 0),Pl([U(".ft-text-field--suggestions")],Ml.prototype,"suggestionsContainer",void 0),Pl([function(t){return(e,i)=>{const{slot:o,selector:r}=t??{},n="slot"+(o?`[name=${o}]`:":not([name])");return I(0,0,{get(){const e=this.renderRoot?.querySelector(n),i=e?.assignedElements(t)??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}({selector:"ft-text-field-suggestion"})],Ml.prototype,"suggestions",void 0);const jl=kt`
|
|
1692
1692
|
.ft-text-field-suggestion {
|
|
1693
1693
|
position: relative;
|
|
1694
1694
|
padding: 8px 16px;
|
|
@@ -1713,7 +1713,7 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1713
1713
|
slot {
|
|
1714
1714
|
pointer-events: none;
|
|
1715
1715
|
}
|
|
1716
|
-
`;var
|
|
1716
|
+
`;var zl=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class Bl extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class Kl extends Ke{render(){return fe`
|
|
1717
1717
|
<div class="ft-text-field-suggestion"
|
|
1718
1718
|
tabindex="-1"
|
|
1719
1719
|
@keydown=${this.onKeyDown}
|
|
@@ -1725,15 +1725,15 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1725
1725
|
<slot></slot>
|
|
1726
1726
|
</ft-typography>
|
|
1727
1727
|
</div>
|
|
1728
|
-
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new jl(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}zl.elementDefinitions={"ft-ripple":ms,"ft-typography":Xn,"ft-icon":la},zl.styles=Pl,Ml([E()],zl.prototype,"value",void 0),Ml([U(".ft-text-field-suggestion")],zl.prototype,"container",void 0),Ml([L()],zl.prototype,"assignedNodes",void 0),W("ft-text-field")(Fl),W("ft-text-field-suggestion")(zl);class Bl{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),f=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,f[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class Kl{convertPaginatedToc(t){return new Bl(t).build()}}class Zl{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return Bn(null!==(e=null===(t=sl.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=sl.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case tr.FEEDBACK:return Bn(null!=e?e:[],Mn.FEEDBACK_USER);case tr.RATING:return Bn(null!=e?e:[],Mn.RATING_USER)&&null!=i&&i!==In.NO_RATING;case tr.PRINT:return Bn(null!=e?e:[],Mn.PRINT_USER);case tr.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case tr.COLLECTIONS:return Bn(null!=e?e:[],Mn.COLLECTION_USER);case tr.PERSONAL_BOOKS:return Bn(null!=e?e:[],Mn.PERSONAL_BOOK_USER);default:return!1}}}class Hl extends Zl{static async build(t){return new Hl(new Kl,await ll.await(),new o,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){const e=await this.api.getMap(t);return this.fingerprint=e.fingerprint,e}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Gl{static build(t,e){return new Gl((t=>Go.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0}}))(t.trim()||"context"),null!=e?e:Hl.build)}constructor(t,e){this.store=t,this.reloadDebouncer=new A(10),this.initService(e)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await _(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e||this.errorHandler(t)}}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}}const Vl=kt`
|
|
1729
|
-
`;class
|
|
1728
|
+
`}focus(t){var e;null===(e=this.container)||void 0===e||e.focus(t)}click(){var t;null===(t=this.container)||void 0===t||t.click()}confirmSuggestion(){this.dispatchEvent(new Bl(this.getValue()))}getValue(){return this.value||this.textContent}get textContent(){return this.assignedNodes.map((t=>t.textContent)).join("").trim()}onKeyDown(t){["Enter"," "].includes(t.key)&&(t.preventDefault(),t.stopPropagation(),this.confirmSuggestion())}}Kl.elementDefinitions={"ft-ripple":ws,"ft-typography":Xn,"ft-icon":la},Kl.styles=jl,zl([E()],Kl.prototype,"value",void 0),zl([U(".ft-text-field-suggestion")],Kl.prototype,"container",void 0),zl([L()],Kl.prototype,"assignedNodes",void 0),W("ft-text-field")(Ml),W("ft-text-field-suggestion")(Kl);class Zl{constructor(t){this.paginatedToc=t,this.nodeByTocId={},this.knownPrettyUrls=new Set,this.duplicatedPrettyUrls=new Set,this.pages=[],this.pageByTocId={}}build(){return{paginationConfiguration:this.paginatedToc.configuration,toc:this.convertNodes(this.paginatedToc.paginatedToc,1),pagesToc:this.extractPagesToc(this.paginatedToc.paginatedToc,1),nodeByTocId:this.nodeByTocId,duplicatedPrettyUrls:this.duplicatedPrettyUrls,pages:this.pages,pageByTocId:this.pageByTocId}}extractPagesToc(t,e,i){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,i)),null==t.tocId?this.extractPagesToc(t.children,e,i):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,i){return t.flatMap((t=>{var o,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(o=t.pageToc)&&void 0!==o?o:[],e,t.tocId),...this.convertNodes(t.children,e,t.tocId)];let a=null===(r=t.prettyUrl)||void 0===r?void 0:r.replace(/^\//,"");const s={tocId:t.tocId,contentId:t.contentId,title:t.title,hasRating:t.hasRating,origin:t.origin,prettyUrl:a,depth:e,parentTocId:i,children:[]};this.register(s);const l=this.convertSectionNodes(null!==(n=t.pageToc)&&void 0!==n?n:[],e+1,t.tocId),c=this.convertNodes(t.children,e+1,s.tocId);return s.children=[...l,...c],[s]}))}convertSectionNodes(t,e,i){return t.flatMap((t=>{var o;let r=null===(o=t.prettyUrl)||void 0===o?void 0:o.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:i,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var i,o,r,n,a,s;const l={number:this.pages.length+1,title:null!==(i=t.title)&&void 0!==i?i:"",rootTocId:null!==(o=t.tocId)&&void 0!==o?o:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),f=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,f[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class Hl{convertPaginatedToc(t){return new Zl(t).build()}}class Gl{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,i,o){this.converter=t,this.api=e,this.cache=i,this._mapId=o,this.initCache()}async withMapId(t){return this._mapId?t(this._mapId):void 0}initCache(){this.cache.registerFinal("configuration",(()=>this.api.getReaderConfiguration())),this.cache.register("map",(()=>this.withMapId((t=>this.fetchMap(t))))),this.cache.register("enrichedToc",(()=>this.withMapId((t=>this.fetchPages(t).then((t=>this.converter.convertPaginatedToc(t))))))),this.cache.register("ratingSummary",(()=>{var t,e;return Bn(null!==(e=null===(t=cl.getState().session)||void 0===t?void 0:t.profile.roles)&&void 0!==e?e:[],"RATING_USER")?this.withMapId((t=>this.fetchMapRating(t))):Promise.resolve()}))}clear(){this.cache.clearAll()}getMap(){return this.cache.get("map")}getConfiguration(){return this.cache.get("configuration")}getEnrichedToc(){return this.cache.get("enrichedToc")}get enrichedToc(){return this.cache.getNow("enrichedToc")}async getPaginationConfiguration(){return(await this.getEnrichedToc()).paginationConfiguration}async getToc(){return(await this.getEnrichedToc()).toc}async getPagesToc(){return(await this.getEnrichedToc()).pagesToc}async getTocNode(t){return(await this.getEnrichedToc()).nodeByTocId[t]}getTocNodeNow(t){var e;return null===(e=this.enrichedToc)||void 0===e?void 0:e.nodeByTocId[t]}async getPage(t){const e=await this.getEnrichedToc();return e.pages[t-1]||e.pages[0]}async getPageByTocId(t){const e=await this.getEnrichedToc();return e.pageByTocId[t]||e.pages[0]}getTopicInfo(t){return this.cache.get("topic-"+t.tocId,(()=>this.fetchTopicMetadata(t)))}getTopicContent(t){return this.cache.get("topic-content-"+t.tocId,(()=>this.fetchTopicHTMLContent(t)))}getLink(t,e,i){const o=this.getNavigationData(t,e,i),r=this.getReaderLinkPrefix()+(o.prettyUrl?o.prettyUrl:`${o.mapId}/${o.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=o.page&&n.searchParams.set("page",`${o.page}`),o.prettyUrlDuplicated&&n.searchParams.set("tocId",o.tocId),null!=o.section&&n.searchParams.set("section",o.section),n.href}getNavigationData(t,e,i){var o,r;t=t||"root";const n=this.enrichedToc,a=null==n?void 0:n.pageByTocId[t],s=null==n?void 0:n.nodeByTocId[t],l=null==s?void 0:s.prettyUrl;return{mapId:this.mapId,tocId:t,topicTitle:null!==(o=null==s?void 0:s.title)&&void 0!==o?o:"",page:e&&a&&a.number!==e?e:void 0,prettyUrl:null!=l?l.replace(/^r\//,""):void 0,prettyUrlDuplicated:null!==(r=null==n?void 0:n.duplicatedPrettyUrls.has(null!=l?l:""))&&void 0!==r&&r,section:i}}async getAccurateNavigationData(t,e,i){return await this.getEnrichedToc(),this.getNavigationData(t,e,i)}getRatingSummary(){return this.cache.get("ratingSummary")}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var i;return e?{type:e.topics.type,rating:null===(i=e.topics)||void 0===i?void 0:i.ratings.find((e=>e.tocId===t))}:void 0}))}rateMap(t,e){return this.makeRateMapRequest(t,e).then((()=>this.clearRatingIfNecessary()))}unrateMap(){return this.makeUnrateMapRequest().then((()=>this.clearRatingIfNecessary()))}sendMapFeedback(t,e){return this.makeMapFeedbackRequest(t,e)}rateTopic(t,e,i){return this.makeRateTopicRequest(t,e,i).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=cl.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,i){return this.makeTopicFeedbackRequest(t,e,i)}fontsStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.fonts)}themeStylesheet(){return this.api.makeAbsolute(this.api.endpoints.stylesheets.theme)}buildBreadcrumb(t){let e=this.getTocNodeNow(t),i=[{tocId:e.tocId,title:e.title}],o=this.getTocNodeNow(e.parentTocId);for(;o;)i.unshift({tocId:o.tocId,title:o.title}),o=this.getTocNodeNow(o.parentTocId);return i}isFeatureAccessible(t,{session:e,ratingType:i}){if(!this.isFeatureAvailable(t))return!1;switch(t){case tr.FEEDBACK:return Bn(null!=e?e:[],Mn.FEEDBACK_USER);case tr.RATING:return Bn(null!=e?e:[],Mn.RATING_USER)&&null!=i&&i!==In.NO_RATING;case tr.PRINT:return Bn(null!=e?e:[],Mn.PRINT_USER);case tr.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case tr.COLLECTIONS:return Bn(null!=e?e:[],Mn.COLLECTION_USER);case tr.PERSONAL_BOOKS:return Bn(null!=e?e:[],Mn.PERSONAL_BOOK_USER);default:return!1}}}class Vl extends Gl{static async build(t){return new Vl(new Hl,await fl.await(),new o,t)}clear(){super.clear(),this.fingerprint=void 0}async fetchMap(t){const e=await this.api.getMap(t);return this.fingerprint=e.fingerprint,e}fetchMapRating(t){return this.api.getMapRating(t)}async fetchPages(t){return await this.getMap(),this.api.getPages(t,this.fingerprint)}fetchTopicHTMLContent(t){return this.api.getTopicHTMLContent(this.mapId,t.contentId,"DESIGNED_READER",this.fingerprint)}fetchTopicMetadata(t){return this.api.getTopic(this.mapId,t.contentId,this.fingerprint)}makeMapFeedbackRequest(t,e){return this.api.sendMapFeedback(this.mapId,t,e)}makeRateMapRequest(t,e){return this.api.rateMap(this.mapId,t,e)}makeRateTopicRequest(t,e,i){return this.api.rateTopic(this.mapId,t,e,i)}makeTopicFeedbackRequest(t,e,i){return this.api.sendTopicFeedback(this.mapId,t,e,i)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class ql{static build(t,e){return new ql((t=>Go.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0}}))(t.trim()||"context"),null!=e?e:Vl.build)}constructor(t,e){this.store=t,this.reloadDebouncer=new A(10),this.initService(e)}async initService(t){return this.service=await t(),this.service.mapId=this.store.getState().mapId,this.reload()}async setMapId(t){t!==this.store.getState().mapId&&(this.store.actions.mapId(t),this.service&&(this.service.mapId=t),await this.reload())}setVisibleTopics(t){this.store.actions.visibleTopics(t)}async awaitService(){for(;null==this.service;)await _(5);return this.service}async navigateToTopic(t,e,i){const o=await this.awaitService(),r=await(null!=i?o.getPage(i):o.getPageByTocId(null!=t?t:"root"));this.store.actions.currentPage(r),this.store.actions.scrollTarget({tocId:this.resolveValidNonRootTocId(t,r),section:e})}resolveValidNonRootTocId(t,e){var i,o,r;let n=null!==(i="root"===t?void 0:t)&&void 0!==i?i:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(o=e.topics[0])&&void 0!==o?o:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let i=await e.getPage(t);this.store.actions.currentPage(i)}scrollDone(){this.store.actions.scrollTarget({})}async reload(){var t,e;this.store.actions.configuration(void 0),this.store.actions.map(void 0),this.store.actions.toc(void 0),this.store.actions.pagesToc(void 0),this.store.actions.currentPage(void 0),this.store.actions.searchInDocumentQuery(""),null===(t=this.service)||void 0===t||t.clear(),(null===(e=this.service)||void 0===e?void 0:e.mapId)&&await this.reloadDebouncer.run((()=>this.fetchData()))}async fetchData(){var t,i,o,r,n;try{await Promise.all([null===(t=this.service)||void 0===t?void 0:t.getConfiguration().then((t=>this.store.actions.configuration(t))),null===(i=this.service)||void 0===i?void 0:i.getMap().then((t=>this.store.actions.map(t))),null===(o=this.service)||void 0===o?void 0:o.getToc().then((t=>this.store.actions.toc(t))),null===(r=this.service)||void 0===r?void 0:r.getPagesToc().then((t=>this.store.actions.pagesToc(t))),null===(n=this.service)||void 0===n?void 0:n.getPaginationConfiguration().then((t=>this.store.actions.paginationConfiguration(t)))])}catch(t){!this.errorHandler||t instanceof e||this.errorHandler(t)}}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}}const Yl=kt`
|
|
1729
|
+
`;class Xl extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Jl extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Ql extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class tc extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class ec extends Event{constructor(){super("ft-reader-map-not-found")}}class ic extends Event{constructor(){super("ft-reader-map-unauthorized")}}var oc=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class rc extends ri{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new A(5),this.navigationDebouncer=new A(10),this.addStore(cl)}render(){return fe`
|
|
1730
1730
|
${this.importStyleIfNeeded()}
|
|
1731
1731
|
<slot @register-ft-reader-component=${this.registerComponent}></slot>
|
|
1732
1732
|
`}importStyleIfNeeded(){var t,e;const i=null===(t=this.stateManager.service)||void 0===t?void 0:t.themeStylesheet();return!i||window.location.href.startsWith(null!==(e=this.baseUrl)&&void 0!==e?e:"")?de:fe`
|
|
1733
1733
|
<style>
|
|
1734
1734
|
@import "${i}"
|
|
1735
1735
|
</style>
|
|
1736
|
-
`}get stateManager(){return null==this._stateManager&&(this._stateManager=
|
|
1736
|
+
`}get stateManager(){return null==this._stateManager&&(this._stateManager=ql.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),this.readerServiceProvider),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"reader")),this._stateManager}connectedCallback(){super.connectedCallback(),this.stateManager.setMapId(this.mapId),this.stateManager.awaitService().then((t=>{const e=t.fontsStylesheet();if(e&&!window.location.href.startsWith(this.baseUrl)&&!document.querySelector(`head link[href="${e}"]`)){const t=document.createElement("link");t.setAttribute("rel","stylesheet"),t.setAttribute("href",e),document.head.append(t)}}))}update(t){super.update(t),t.has("readerServiceProvider")&&this.readerServiceProvider&&this.stateManager.initService(this.readerServiceProvider),t.has("mapId")&&this.mapId&&this.stateManager.setMapId(this.mapId),t.has("searchInDocumentQuery")&&null!=this.searchInDocumentQuery&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId"].some((e=>t.has(e)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.map&&this.toc&&this.dispatchEvent(new Xl(this.map,this.toc)),t.has("scrollTarget")&&null==(null===(e=this.scrollTarget)||void 0===e?void 0:e.tocId)){const e=t.get("scrollTarget");null!=(null==e?void 0:e.tocId)&&this.scrollToTargetDebouncer.run((()=>{var t;return this.stateManager.service.getAccurateNavigationData(e.tocId,null===(t=this.currentPage)||void 0===t?void 0:t.number,e.section).then((t=>this.dispatchEvent(new Ql(t))))}))}t.has("visibleTopics")&&Promise.all(this.visibleTopics.map((t=>{var e;return this.stateManager.service.getAccurateNavigationData(t,null===(e=this.currentPage)||void 0===e?void 0:e.number)}))).then((t=>{let e=t.filter((t=>null!=t&&""!==t.topicTitle)).map((t=>{var e;return{tocId:t.tocId,title:t.topicTitle,page:t.page,prettyUrl:t.prettyUrl,prettyUrlDuplicated:t.prettyUrlDuplicated,breadcrumb:null===(e=this.stateManager.service)||void 0===e?void 0:e.buildBreadcrumb(t.tocId)}}));this.dispatchEvent(new Jl(this.map,e))}))}async reload(){await this.stateManager.reload(),this.navigateToTarget()}navigateToTarget(){this.navigationDebouncer.run((()=>{null!=this.tocId?this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&this.stateManager.navigateToPage(this.page)}))}registerComponent(t){t.stopPropagation();const e=t.composedPath()[0];this.register(e)}register(t){t.setReaderStateManager(this.stateManager)}handleLoadError(t){const e=t;404===e.status?this.dispatchEvent(new ec):401===e.status?this.dispatchEvent(new ic):this.dispatchEvent(new tc(t))}reloadBookmarks(){Ol.reloadBookmarks()}}var nc;rc.styles=Yl,oc([qe({store:cl.name})],rc.prototype,"baseUrl",void 0),oc([E()],rc.prototype,"mapId",void 0),oc([E()],rc.prototype,"tocId",void 0),oc([E()],rc.prototype,"section",void 0),oc([E()],rc.prototype,"searchInDocumentQuery",void 0),oc([E({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:nc}})],rc.prototype,"page",void 0),oc([qe({store:"reader"})],rc.prototype,"map",void 0),oc([qe({store:"reader"})],rc.prototype,"toc",void 0),oc([qe({store:"reader"})],rc.prototype,"visibleTopics",void 0),oc([qe({store:"reader"})],rc.prototype,"currentPage",void 0),oc([qe({store:"reader"})],rc.prototype,"scrollTarget",void 0),oc([E({attribute:!1})],rc.prototype,"readerServiceProvider",void 0),W("ft-reader-context")(rc);var ac=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class sc extends(Cl(rr)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.ratingAllowed=!1,this.from="",this.feedbackMessage="",this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.addI18nContext(Al,_l),this.addI18nContext(Tl,Wl)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type})}get userHasRatingRole(){return this.session&&Bn(this.session,"RATING_USER")}get configuredRatingType(){var t,e;return null!==(e=this.ratingAllowed?null===(t=this.ratingSummary)||void 0===t?void 0:t.type:"NO_RATING")&&void 0!==e?e:"NO_RATING"}get ratingType(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==i?i:"NO_RATING"}get ratingValue(){var t,e,i;return null!==(i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==i?i:-1}get ratingDate(){var t,e;const i=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.date;return"string"==typeof i?((o=i).match(/^\d{4}-\d{2}-\d{2}$/)&&(o=o.replace(/-/g,"/")),o=o.replace(" ","T").replace(/^(.+)(\+\d{2})(\d{2})$/,((t,e,i,o)=>e+i+":"+o)),new Date(o)):i;var o}render(){return this.editorMode||this.canAccessFeedback||this.canAccessRating?fe`
|
|
1737
1737
|
<div class="ft-reader-feedback">
|
|
1738
1738
|
${this.hideTitle?de:fe`
|
|
1739
1739
|
<ft-typography variant="title" part="main-title">
|
|
@@ -1753,11 +1753,11 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1753
1753
|
${this.renderRatingDate()}
|
|
1754
1754
|
</ft-typography>
|
|
1755
1755
|
</div>
|
|
1756
|
-
`:this.placeholderInEditor(this.userHasRatingRole?
|
|
1756
|
+
`:this.placeholderInEditor(this.userHasRatingRole?Tl.messages.ratingNotConfigured():Tl.messages.missingRatingRole())}renderRatingDate(){const t=this.ratingDate;if(null==t)return Al.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return Al.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?Al.messages.ratedToday():Al.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return fe`
|
|
1757
1757
|
<div class="ft-reader-feedback--stars" part="rating rating-stars">
|
|
1758
|
-
${
|
|
1758
|
+
${Js(new Array(5),((t,e)=>e),((t,e)=>{let i="STARS"===this.ratingType&&this.ratingValue>e;const o=e+1;return fe`
|
|
1759
1759
|
<ft-button round part="rating-stars-${o}"
|
|
1760
|
-
label="${
|
|
1760
|
+
label="${Al.messages.starsRating(o)}"
|
|
1761
1761
|
tooltipPosition="top"
|
|
1762
1762
|
.iconVariant=${this.iconVariant}
|
|
1763
1763
|
icon="${i?this.filledStarIcon:this.emptyStarIcon}"
|
|
@@ -1774,13 +1774,13 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1774
1774
|
?selected=${e}
|
|
1775
1775
|
.iconVariant=${this.iconVariant}
|
|
1776
1776
|
icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
|
|
1777
|
-
${
|
|
1777
|
+
${Al.messages.like()}
|
|
1778
1778
|
</ft-switch-option>
|
|
1779
1779
|
<ft-switch-option .value=${0}
|
|
1780
1780
|
?selected=${t}
|
|
1781
1781
|
.iconVariant=${this.iconVariant}
|
|
1782
1782
|
icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
|
|
1783
|
-
${
|
|
1783
|
+
${Al.messages.dislike()}
|
|
1784
1784
|
</ft-switch-option>
|
|
1785
1785
|
</ft-switch>
|
|
1786
1786
|
`;case"DICHOTOMOUS":const i="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,o="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return fe`
|
|
@@ -1789,11 +1789,11 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1789
1789
|
part="rating rating-dichotomous">
|
|
1790
1790
|
<ft-switch-option .value=${1}
|
|
1791
1791
|
?selected=${o}>
|
|
1792
|
-
${
|
|
1792
|
+
${Al.messages.dichotomousYes()}
|
|
1793
1793
|
</ft-switch-option>
|
|
1794
1794
|
<ft-switch-option .value=${0}
|
|
1795
1795
|
?selected=${i}>
|
|
1796
|
-
${
|
|
1796
|
+
${Al.messages.dichotomousNo()}
|
|
1797
1797
|
</ft-switch-option>
|
|
1798
1798
|
</ft-switch>
|
|
1799
1799
|
`}return de}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,e,i;if(this.canAccessFeedback){const o=this.feedbackMailLinkBuilder(this.feedbackMessage);let r=fe`
|
|
@@ -1802,7 +1802,7 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1802
1802
|
class="ft-reader-feedback--send-feedback"
|
|
1803
1803
|
?disabled=${!this.feedbackMessage||!this.validFromEmail()}
|
|
1804
1804
|
part="send-feedback">
|
|
1805
|
-
${
|
|
1805
|
+
${Al.messages.okButton()}
|
|
1806
1806
|
</ft-button>
|
|
1807
1807
|
`;return o&&(r=fe`
|
|
1808
1808
|
<a class="ft-reader-feedback--feedback-link" href="${o}">
|
|
@@ -1817,28 +1817,28 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1817
1817
|
${null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers)?fe`
|
|
1818
1818
|
<ft-text-field outlined name="email" type="email" autocomplete="email"
|
|
1819
1819
|
class="ft-reader-feedback--from-input"
|
|
1820
|
-
label=${
|
|
1820
|
+
label=${Al.messages.feedbackfromEmail()}
|
|
1821
1821
|
@change=${t=>this.from=t.detail.trim()}
|
|
1822
1822
|
?error=${this.from&&!this.validFromEmail()}
|
|
1823
|
-
helper=${this.from&&!this.validFromEmail()?
|
|
1823
|
+
helper=${this.from&&!this.validFromEmail()?Al.messages.feedbackfromEmailInvalid():""}
|
|
1824
1824
|
/>
|
|
1825
1825
|
`:de}
|
|
1826
1826
|
<ft-text-area outlined
|
|
1827
1827
|
class="ft-reader-feedback--feedback-input" part="feedback-input"
|
|
1828
|
-
label="${
|
|
1828
|
+
label="${Al.messages.feedbackInputLabel()}"
|
|
1829
1829
|
@live-change=${t=>this.feedbackMessage=t.detail.trim()}
|
|
1830
1830
|
></ft-text-area>
|
|
1831
1831
|
${r}
|
|
1832
1832
|
</form>
|
|
1833
|
-
`}return this.placeholderInEditor(
|
|
1833
|
+
`}return this.placeholderInEditor(Tl.messages.missingFeedbackRole())}onFormSubmitEvent(t,e){t.preventDefault(),e?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,e,i;return!(null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers))||/^[a-zA-Z0-9_+&*-]+(?:\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/.test(this.from)}sendFeedback(){var t;this.dispatchEvent(new CustomEvent("send-feedback",{detail:{message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}}))}placeholderInEditor(t){return this.editorMode?fe`
|
|
1834
1834
|
<div class="ft-reader-feedback--placeholder">
|
|
1835
1835
|
<ft-typography variant="caption">${t}</ft-typography>
|
|
1836
1836
|
<ft-tooltip position="left"
|
|
1837
|
-
text="${
|
|
1837
|
+
text="${Tl.messages.inDesignerOnlyNotice()}">
|
|
1838
1838
|
<ft-icon>INFO</ft-icon>
|
|
1839
1839
|
</ft-tooltip>
|
|
1840
1840
|
</div>
|
|
1841
|
-
`:de}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}
|
|
1841
|
+
`:de}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}sc.elementDefinitions={"ft-button":ol,"ft-typography":Xn,"ft-icon":la,"ft-tooltip":vs,"ft-switch":Is,"ft-switch-option":Es,"ft-text-area":Ks,"ft-text-field":Ml},sc.styles=Cn,ac([E({type:Boolean})],sc.prototype,"editorMode",void 0),ac([E({type:Boolean})],sc.prototype,"hideTitle",void 0),ac([E({type:Boolean})],sc.prototype,"ratingAllowed",void 0),ac([E({attribute:!1})],sc.prototype,"i18nProperties",void 0),ac([E({attribute:!1})],sc.prototype,"ratingSummary",void 0),ac([E({attribute:!1})],sc.prototype,"session",void 0),ac([U(".ft-reader-feedback--feedback-input")],sc.prototype,"feedbackInput",void 0),ac([k()],sc.prototype,"from",void 0),ac([k()],sc.prototype,"feedbackMessage",void 0),ac([E()],sc.prototype,"iconVariant",void 0),ac([E()],sc.prototype,"emptyStarIcon",void 0),ac([E()],sc.prototype,"filledStarIcon",void 0),ac([E()],sc.prototype,"emptyLikeIcon",void 0),ac([E()],sc.prototype,"filledLikeIcon",void 0),ac([E()],sc.prototype,"emptyDislikeIcon",void 0),ac([E()],sc.prototype,"filledDislikeIcon",void 0),ac([qe({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],sc.prototype,"configuration",void 0),ac([E()],sc.prototype,"feedbackMailLinkBuilder",void 0);const lc=Ul.fromGwt("server");class cc{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,e,i,o,r){var n;this.subject=t,this.url=e,this.configuration=o,this.isAuthenticated=r,this.subjectMetadata=this.filterMetadata(i,o.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(i,null!==(n=o.bodyMetadataIds)&&void 0!==n?n:[]).map((t=>"["+t.values.join(", ")+"]")).join(" ")}filterMetadata(t,e){return e.map((e=>t.find((t=>t.key===e)))).filter((t=>null!=t&&t.values.length>0))}build(t){var e,i,o;if(0===t.length||this.isAuthenticated&&(null==this.configuration||(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopics))||(null===(i=this.configuration)||void 0===i?void 0:i.mailsSentByFluidTopicsForUnauthenticatedUsers))return;const r=encodeURIComponent(this.subject+" "+this.subjectMetadata),n=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${t}\n\n_________________________________________________________________\n${lc.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(o=this.configuration)||void 0===o?void 0:o.recipients.join(",")}?subject=${r}&body=${n}`}}var fc=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class hc extends(Cl(rr)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=aa.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new cc,this.i18nProperties={feedbackMainTitle:Al.properties.mapFeedbackMainTitle(),ratingSectionTitle:Al.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:Al.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:Al.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new A(100),this.sendRatingDebouncer=new A(500),this.addStore(cl)}render(){return this.map&&(this.editorMode||this.componentVisible)?fe`
|
|
1842
1842
|
<ft-reader-feedback
|
|
1843
1843
|
ratingAllowed
|
|
1844
1844
|
.i18nProperties=${this.i18nProperties}
|
|
@@ -1864,7 +1864,7 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1864
1864
|
display: none !important;
|
|
1865
1865
|
}
|
|
1866
1866
|
</style>
|
|
1867
|
-
`}get componentVisible(){var t,e,i;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(tr.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type}))}update(t){var e,i,o,r;super.update(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(r=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,i;this.map&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,i,o;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(o=this.ratingSummary)||void 0===o?void 0:o.type,t))}catch{this.dispatchEvent(new Te({type:"error",message:
|
|
1867
|
+
`}get componentVisible(){var t,e,i;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(tr.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type}))}update(t){var e,i,o,r;super.update(t),t.has("map")&&this.map&&this.updateData(),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(r=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}onStoreAvailable(t){super.onStoreAvailable(t),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,i;this.map&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getMapRating()))}))}rate(t){this.ratingSummary&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,i,o;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(o=this.ratingSummary)||void 0===o?void 0:o.type,t))}catch{this.dispatchEvent(new Te({type:"error",message:Al.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new Te({type:"info",message:Tl.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{this.editorMode?this.dispatchEvent(new Te({type:"info",message:Tl.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(e=this.service)||void 0===e?void 0:e.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new Te({type:"info",message:Al.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new Te({type:"error",message:Al.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0}))}}hc.elementDefinitions={"ft-reader-feedback":sc},fc([qe({store:cl.name})],hc.prototype,"session",void 0),fc([qe({store:"reader"})],hc.prototype,"map",void 0),fc([qe({store:cl.name})],hc.prototype,"editorMode",void 0),fc([qe({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],hc.prototype,"configuration",void 0),fc([k()],hc.prototype,"ratingSummary",void 0),fc([E({type:Boolean})],hc.prototype,"hideTitle",void 0),fc([E()],hc.prototype,"iconVariant",void 0),fc([E()],hc.prototype,"emptyStarIcon",void 0),fc([E()],hc.prototype,"filledStarIcon",void 0),fc([E()],hc.prototype,"emptyLikeIcon",void 0),fc([E()],hc.prototype,"filledLikeIcon",void 0),fc([E()],hc.prototype,"emptyDislikeIcon",void 0),fc([E()],hc.prototype,"filledDislikeIcon",void 0),fc([U("ft-reader-feedback")],hc.prototype,"readerFeedback",void 0),fc([Ll(lc.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],hc.prototype,"mailSubject",void 0);var dc=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class uc extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const pc=Symbol("registerInterval");class yc extends(function(t){var e;class i extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[pc]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[pc]):this.dispatchEvent(new uc)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=pc,dc([k()],i.prototype,"tocNode",void 0),dc([k()],i.prototype,"disableContextInteractions",void 0),i}(rr)){}var gc=function(t,e,i,o){for(var r,n=arguments.length,a=n<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,i,a):r(e,i))||a);return n>3&&a&&Object.defineProperty(e,i,a),a};class bc extends(Cl(yc)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.iconVariant=aa.fluid_topics,this.emptyStarIcon="STAR",this.filledStarIcon="STAR_PLAIN",this.emptyLikeIcon="THUMBS_UP",this.filledLikeIcon="THUMBS_UP_PLAIN",this.emptyDislikeIcon="THUMBS_DOWN",this.filledDislikeIcon="THUMBS_DOWN_PLAIN",this.feedbackLinkBuilder=new cc,this.i18nProperties={feedbackMainTitle:Al.properties.topicFeedbackMainTitle(),ratingSectionTitle:Al.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:Al.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:Al.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new A(100),this.sendRatingDebouncer=new A(500),this.addStore(cl)}render(){return this.map&&this.tocNode&&(this.editorMode||this.componentVisible)?fe`
|
|
1868
1868
|
<ft-reader-feedback
|
|
1869
1869
|
.i18nProperties=${this.i18nProperties}
|
|
1870
1870
|
?ratingAllowed=${this.tocNode.hasRating}
|
|
@@ -1890,4 +1890,4 @@ const{D:Bs}=xt,Ks=()=>document.createComment(""),Zs=(t,e,i)=>{const o=t._$AA.par
|
|
|
1890
1890
|
display: none !important;
|
|
1891
1891
|
}
|
|
1892
1892
|
</style>
|
|
1893
|
-
`}get componentVisible(){var t,e,i;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(tr.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type}))}update(t){var e,i,o,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(r=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,i;this.tocNode&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,i,o;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(o=this.ratingSummary)||void 0===o?void 0:o.type,t))}catch{this.dispatchEvent(new Te({type:"error",message:
|
|
1893
|
+
`}get componentVisible(){var t,e,i;return(null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(tr.FEEDBACK,{session:this.session}))||(null===(e=this.service)||void 0===e?void 0:e.isFeatureAccessible(tr.RATING,{session:this.session,ratingType:null===(i=this.ratingSummary)||void 0===i?void 0:i.type}))}update(t){var e,i,o,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(i=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==i?i:"",this.map.metadata,this.configuration,null!=(null===(r=null===(o=this.session)||void 0===o?void 0:o.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e,i;this.tocNode&&((null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)||null==this.ratingSummary)&&(this.ratingSummary=await(null===(i=this.service)||void 0===i?void 0:i.getTopicRating(this.tocNode.tocId)))}))}rate(t){this.ratingSummary&&this.tocNode&&(this.ratingSummary={...this.ratingSummary,rating:null==t.detail?void 0:{tocId:this.tocNode.tocId,type:this.ratingSummary.type,value:t.detail,date:new Date}},this.sendRatingDebouncer.run((()=>this.sendRating(t.detail))))}async sendRating(t){var e,i,o;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(e=this.service)||void 0===e?void 0:e.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(o=this.ratingSummary)||void 0===o?void 0:o.type,t))}catch{this.dispatchEvent(new Te({type:"error",message:Al.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new Te({type:"info",message:Tl.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var e;try{!this.editorMode&&this.tocNode?(await(null===(e=this.service)||void 0===e?void 0:e.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new Te({type:"info",message:Al.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new Te({type:"info",message:Tl.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new Te({type:"error",message:Al.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new CustomEvent("ft-reader-mailer-topic-feedback",{detail:{topic:t},composed:!0,bubbles:!0}))}}bc.elementDefinitions={"ft-reader-feedback":sc},gc([qe({store:cl.name})],bc.prototype,"session",void 0),gc([qe({store:"reader"})],bc.prototype,"map",void 0),gc([qe({store:cl.name})],bc.prototype,"editorMode",void 0),gc([qe({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],bc.prototype,"configuration",void 0),gc([k()],bc.prototype,"ratingSummary",void 0),gc([E({type:Boolean})],bc.prototype,"hideTitle",void 0),gc([E()],bc.prototype,"iconVariant",void 0),gc([E()],bc.prototype,"emptyStarIcon",void 0),gc([E()],bc.prototype,"filledStarIcon",void 0),gc([E()],bc.prototype,"emptyLikeIcon",void 0),gc([E()],bc.prototype,"filledLikeIcon",void 0),gc([E()],bc.prototype,"emptyDislikeIcon",void 0),gc([E()],bc.prototype,"filledDislikeIcon",void 0),gc([U("ft-reader-feedback")],bc.prototype,"readerFeedback",void 0),gc([Ll(lc.properties["mail.feedback.subject"]((t=>{var e,i;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(i=t.map)||void 0===i?void 0:i.title]})))],bc.prototype,"mailSubject",void 0),W("ft-reader-map-feedback")(hc),W("ft-reader-topic-feedback")(bc),t.FtReaderFeedbackCssVariables=Nn,t.FtReaderMapFeedback=hc,t.FtReaderTopicFeedback=bc,t.styles=Cn}({});
|