@fluid-topics/ft-reader-feedback 1.1.43 → 1.1.45

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.
@@ -582,7 +582,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
582
582
  position: relative;
583
583
  word-break: break-word;
584
584
  }
585
- `,_e=["start","end"],Ze=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+_e[0],e+"-"+_e[1])),[]),Fe=Math.min,Be=Math.max,Ke=Math.round,Me=t=>({x:t,y:t}),Pe={left:"right",right:"left",bottom:"top",top:"bottom"},He={start:"end",end:"start"};function je(t,e,o){return Be(t,Fe(e,o))}function Ge(t,e){return"function"==typeof t?t(e):t}function Ve(t){return t.split("-")[0]}function Ye(t){return t.split("-")[1]}function qe(t){return"x"===t?"y":"x"}function Xe(t){return"y"===t?"height":"width"}function Qe(t){return["top","bottom"].includes(Ve(t))?"y":"x"}function Je(t){return qe(Qe(t))}function to(t){return t.replace(/left|right|bottom|top/g,(t=>Pe[t]))}function eo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function oo(t,e,o){let{reference:i,floating:r}=t;const n=Qe(e),a=Je(e),s=Xe(a),l=Ve(e),c="y"===n,d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,p=i[s]/2-r[s]/2;let h;switch(l){case"top":h={x:d,y:i.y-r.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:f};break;case"left":h={x:i.x-r.width,y:f};break;default:h={x:i.x,y:i.y}}switch(Ye(e)){case"start":h[a]-=p*(o&&c?-1:1);break;case"end":h[a]+=p*(o&&c?-1:1)}return h}async function io(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ge(e,t),u=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}}(h),g=s[p?"floating"===f?"reference":"floating":f],b=eo(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(g)))||o?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),v=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},x=eo(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:m,strategy:l}):y);return{top:(b.top-x.top+u.top)/v.y,bottom:(x.bottom-b.bottom+u.bottom)/v.y,left:(b.left-x.left+u.left)/v.x,right:(x.right-b.right+u.right)/v.x}}function ro(t,e,o){return(t?[...o.filter((e=>Ye(e)===t)),...o.filter((e=>Ye(e)!==t))]:o.filter((t=>Ve(t)===t))).filter((o=>!t||(Ye(o)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>He[t]))}(o)!==o)))}const no=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:p=Ze,autoAlignment:h=!0,...u}=Ge(t,e),g=void 0!==f||p===Ze?ro(f||null,h,p):p,b=await io(e,u),y=(null==(o=a.autoPlacement)?void 0:o.index)||0,m=g[y];if(null==m)return{};const v=function(t,e,o){void 0===o&&(o=!1);const i=Ye(t),r=Je(t),n=Xe(r);let a="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=to(a)),[a,to(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:g[0]}};const x=[b[Ve(m)],b[v[0]],b[v[1]]],w=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],O=g[y+1];if(O)return{data:{index:y+1,overflows:w},reset:{placement:O}};const S=w.map((t=>{const e=Ye(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),N=S.filter((t=>t[2].slice(0,Ye(t[0])?2:3).every((t=>t<=0)))),$=(null==(r=N[0])?void 0:r[0])||S[0][0];return $!==s?{data:{index:y+1,overflows:w},reset:{placement:$}}:{}}}};function ao(t){return co(t)?(t.nodeName||"").toLowerCase():"#document"}function so(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function lo(t){var e;return null==(e=(co(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function co(t){return t instanceof Node||t instanceof so(t).Node}function fo(t){return t instanceof Element||t instanceof so(t).Element}function po(t){return t instanceof HTMLElement||t instanceof so(t).HTMLElement}function ho(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof so(t).ShadowRoot)}function uo(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=vo(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(r)}function go(t){return["table","td","th"].includes(ao(t))}function bo(t){const e=yo(),o=vo(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function yo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function mo(t){return["html","body","#document"].includes(ao(t))}function vo(t){return so(t).getComputedStyle(t)}function xo(t){return fo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function wo(t){if("html"===ao(t))return t;const e=t.assignedSlot||t.parentNode||ho(t)&&t.host||lo(t);return ho(e)?e.host:e}function Oo(t){const e=wo(t);return mo(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&uo(e)?e:Oo(e)}function So(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=Oo(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=so(r);return n?e.concat(a,a.visualViewport||[],uo(r)?r:[],a.frameElement&&o?So(a.frameElement):[]):e.concat(r,So(r,[],o))}function No(t){const e=vo(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=po(t),n=r?t.offsetWidth:o,a=r?t.offsetHeight:i,s=Ke(o)!==n||Ke(i)!==a;return s&&(o=n,i=a),{width:o,height:i,$:s}}function $o(t){return fo(t)?t:t.contextElement}function Io(t){const e=$o(t);if(!po(e))return Me(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:n}=No(e);let a=(n?Ke(o.width):o.width)/i,s=(n?Ke(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Co=Me(0);function ko(t){const e=so(t);return yo()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Co}function Eo(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),n=$o(t);let a=Me(1);e&&(i?fo(i)&&(a=Io(i)):a=Io(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==so(t))&&e}(n,o,i)?ko(n):Me(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(n){const t=so(n),e=i&&fo(i)?so(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=Io(o),e=o.getBoundingClientRect(),i=vo(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,f*=t.y,l+=r,c+=n,o=so(o).frameElement}}return eo({width:d,height:f,x:l,y:c})}function Ro(t){return Eo(lo(t)).left+xo(t).scrollLeft}function Uo(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=so(t),i=lo(t),r=o.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=yo();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)i=function(t){const e=lo(t),o=xo(t),i=t.ownerDocument.body,r=Be(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=Be(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+Ro(t);const s=-o.scrollTop;return"rtl"===vo(i).direction&&(a+=Be(e.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(lo(t));else if(fo(e))i=function(t,e){const o=Eo(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,n=po(t)?Io(t):Me(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(e,o);else{const o=ko(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return eo(i)}function Lo(t,e){const o=wo(t);return!(o===e||!fo(o)||mo(o))&&("fixed"===vo(o).position||Lo(o,e))}function Wo(t,e,o){const i=po(e),r=lo(e),n="fixed"===o,a=Eo(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=Me(0);if(i||!i&&!n)if(("body"!==ao(e)||uo(r))&&(s=xo(e)),i){const t=Eo(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=Ro(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function zo(t,e){return po(t)&&"fixed"!==vo(t).position?e?e(t):t.offsetParent:null}function Do(t,e){const o=so(t);if(!po(t))return o;let i=zo(t,e);for(;i&&go(i)&&"static"===vo(i).position;)i=zo(i,e);return i&&("html"===ao(i)||"body"===ao(i)&&"static"===vo(i).position&&!bo(i))?o:i||function(t){let e=wo(t);for(;po(e)&&!mo(e);){if(bo(e))return e;e=wo(e)}return null}(t)||o}const To={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:o,strategy:i}=t;const r=po(o),n=lo(o);if(o===n)return e;let a={scrollLeft:0,scrollTop:0},s=Me(1);const l=Me(0);if((r||!r&&"fixed"!==i)&&(("body"!==ao(o)||uo(n))&&(a=xo(o)),po(o))){const t=Eo(o);s=Io(o),l.x=t.x+o.clientLeft,l.y=t.y+o.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:lo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===o?function(t,e){const o=e.get(t);if(o)return o;let i=So(t,[],!1).filter((t=>fo(t)&&"body"!==ao(t))),r=null;const n="fixed"===vo(t).position;let a=n?wo(t):t;for(;fo(a)&&!mo(a);){const e=vo(a),o=bo(a);o||"fixed"!==e.position||(r=null),(n?!o&&!r:!o&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||uo(a)&&!o&&Lo(t,a))?i=i.filter((t=>t!==a)):r=e,a=wo(a)}return e.set(t,i),i}(e,this._c):[].concat(o),i],a=n[0],s=n.reduce(((t,o)=>{const i=Uo(e,o,r);return t.top=Be(i.top,t.top),t.right=Fe(i.right,t.right),t.bottom=Fe(i.bottom,t.bottom),t.left=Be(i.left,t.left),t}),Uo(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Do,getElementRects:async function(t){let{reference:e,floating:o,strategy:i}=t;const r=this.getOffsetParent||Do,n=this.getDimensions;return{reference:Wo(e,await r(o),i),floating:{x:0,y:0,...await n(o)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return No(t)},getScale:Io,isElement:fo,isRTL:function(t){return"rtl"===vo(t).direction}},Ao=(t,e,o)=>{const i=new Map,r={platform:To,...o},n={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=o,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:d,y:f}=oo(c,i,l),p=i,h={},u=0;for(let o=0;o<s.length;o++){const{name:n,fn:g}=s[o],{x:b,y,data:m,reset:v}=await g({x:d,y:f,initialPlacement:i,placement:p,strategy:r,middlewareData:h,rects:c,platform:a,elements:{reference:t,floating:e}});d=null!=b?b:d,f=null!=y?y:f,h={...h,[n]:{...h[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:d,y:f}=oo(c,p,l))),o=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:h}})(t,e,{...r,platform:n})};function _o(t){return function(t){for(let e=t;e;e=Zo(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Zo(t);e;e=Zo(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 Zo(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var Fo,Bo,Ko,Mo=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Po extends e.FtLitElement{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 e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return o.html`
585
+ `,_e=["start","end"],Ze=["top","right","bottom","left"].reduce(((t,e)=>t.concat(e,e+"-"+_e[0],e+"-"+_e[1])),[]),Fe=Math.min,Be=Math.max,Ke=Math.round,Me=t=>({x:t,y:t}),Pe={left:"right",right:"left",bottom:"top",top:"bottom"},He={start:"end",end:"start"};function je(t,e,o){return Be(t,Fe(e,o))}function Ge(t,e){return"function"==typeof t?t(e):t}function Ve(t){return t.split("-")[0]}function Ye(t){return t.split("-")[1]}function qe(t){return"x"===t?"y":"x"}function Xe(t){return"y"===t?"height":"width"}function Qe(t){return["top","bottom"].includes(Ve(t))?"y":"x"}function Je(t){return qe(Qe(t))}function to(t){return t.replace(/left|right|bottom|top/g,(t=>Pe[t]))}function eo(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function oo(t,e,o){let{reference:i,floating:r}=t;const n=Qe(e),a=Je(e),s=Xe(a),l=Ve(e),c="y"===n,d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,p=i[s]/2-r[s]/2;let h;switch(l){case"top":h={x:d,y:i.y-r.height};break;case"bottom":h={x:d,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:f};break;case"left":h={x:i.x-r.width,y:f};break;default:h={x:i.x,y:i.y}}switch(Ye(e)){case"start":h[a]-=p*(o&&c?-1:1);break;case"end":h[a]+=p*(o&&c?-1:1)}return h}async function io(t,e){var o;void 0===e&&(e={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:p=!1,padding:h=0}=Ge(e,t),u=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}}(h),g=s[p?"floating"===f?"reference":"floating":f],b=eo(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(g)))||o?g:g.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:d,strategy:l})),y="floating"===f?{...a.floating,x:i,y:r}:a.reference,m=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),v=await(null==n.isElement?void 0:n.isElement(m))&&await(null==n.getScale?void 0:n.getScale(m))||{x:1,y:1},x=eo(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:m,strategy:l}):y);return{top:(b.top-x.top+u.top)/v.y,bottom:(x.bottom-b.bottom+u.bottom)/v.y,left:(b.left-x.left+u.left)/v.x,right:(x.right-b.right+u.right)/v.x}}function ro(t,e,o){return(t?[...o.filter((e=>Ye(e)===t)),...o.filter((e=>Ye(e)!==t))]:o.filter((t=>Ve(t)===t))).filter((o=>!t||(Ye(o)===t||!!e&&function(t){return t.replace(/start|end/g,(t=>He[t]))}(o)!==o)))}const no=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=e,{crossAxis:d=!1,alignment:f,allowedPlacements:p=Ze,autoAlignment:h=!0,...u}=Ge(t,e),g=void 0!==f||p===Ze?ro(f||null,h,p):p,b=await io(e,u),y=(null==(o=a.autoPlacement)?void 0:o.index)||0,m=g[y];if(null==m)return{};const v=function(t,e,o){void 0===o&&(o=!1);const i=Ye(t),r=Je(t),n=Xe(r);let a="x"===r?i===(o?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=to(a)),[a,to(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:g[0]}};const x=[b[Ve(m)],b[v[0]],b[v[1]]],w=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],O=g[y+1];if(O)return{data:{index:y+1,overflows:w},reset:{placement:O}};const S=w.map((t=>{const e=Ye(t.placement);return[t.placement,e&&d?t.overflows.slice(0,2).reduce(((t,e)=>t+e),0):t.overflows[0],t.overflows]})).sort(((t,e)=>t[1]-e[1])),N=S.filter((t=>t[2].slice(0,Ye(t[0])?2:3).every((t=>t<=0)))),$=(null==(r=N[0])?void 0:r[0])||S[0][0];return $!==s?{data:{index:y+1,overflows:w},reset:{placement:$}}:{}}}};function ao(t){return co(t)?(t.nodeName||"").toLowerCase():"#document"}function so(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function lo(t){var e;return null==(e=(co(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function co(t){return t instanceof Node||t instanceof so(t).Node}function fo(t){return t instanceof Element||t instanceof so(t).Element}function po(t){return t instanceof HTMLElement||t instanceof so(t).HTMLElement}function ho(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof so(t).ShadowRoot)}function uo(t){const{overflow:e,overflowX:o,overflowY:i,display:r}=vo(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+o)&&!["inline","contents"].includes(r)}function go(t){return["table","td","th"].includes(ao(t))}function bo(t){const e=yo(),o=vo(t);return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((t=>(o.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(o.contain||"").includes(t)))}function yo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function mo(t){return["html","body","#document"].includes(ao(t))}function vo(t){return so(t).getComputedStyle(t)}function xo(t){return fo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function wo(t){if("html"===ao(t))return t;const e=t.assignedSlot||t.parentNode||ho(t)&&t.host||lo(t);return ho(e)?e.host:e}function Oo(t){const e=wo(t);return mo(e)?t.ownerDocument?t.ownerDocument.body:t.body:po(e)&&uo(e)?e:Oo(e)}function So(t,e,o){var i;void 0===e&&(e=[]),void 0===o&&(o=!0);const r=Oo(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=so(r);return n?e.concat(a,a.visualViewport||[],uo(r)?r:[],a.frameElement&&o?So(a.frameElement):[]):e.concat(r,So(r,[],o))}function No(t){const e=vo(t);let o=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=po(t),n=r?t.offsetWidth:o,a=r?t.offsetHeight:i,s=Ke(o)!==n||Ke(i)!==a;return s&&(o=n,i=a),{width:o,height:i,$:s}}function $o(t){return fo(t)?t:t.contextElement}function Io(t){const e=$o(t);if(!po(e))return Me(1);const o=e.getBoundingClientRect(),{width:i,height:r,$:n}=No(e);let a=(n?Ke(o.width):o.width)/i,s=(n?Ke(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Co=Me(0);function ko(t){const e=so(t);return yo()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Co}function Eo(t,e,o,i){void 0===e&&(e=!1),void 0===o&&(o=!1);const r=t.getBoundingClientRect(),n=$o(t);let a=Me(1);e&&(i?fo(i)&&(a=Io(i)):a=Io(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==so(t))&&e}(n,o,i)?ko(n):Me(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(n){const t=so(n),e=i&&fo(i)?so(i):i;let o=t.frameElement;for(;o&&i&&e!==t;){const t=Io(o),e=o.getBoundingClientRect(),i=vo(o),r=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,n=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,d*=t.x,f*=t.y,l+=r,c+=n,o=so(o).frameElement}}return eo({width:d,height:f,x:l,y:c})}function Ro(t){return Eo(lo(t)).left+xo(t).scrollLeft}function Uo(t,e,o){let i;if("viewport"===e)i=function(t,e){const o=so(t),i=lo(t),r=o.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=yo();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)i=function(t){const e=lo(t),o=xo(t),i=t.ownerDocument.body,r=Be(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),n=Be(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-o.scrollLeft+Ro(t);const s=-o.scrollTop;return"rtl"===vo(i).direction&&(a+=Be(e.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(lo(t));else if(fo(e))i=function(t,e){const o=Eo(t,!0,"fixed"===e),i=o.top+t.clientTop,r=o.left+t.clientLeft,n=po(t)?Io(t):Me(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(e,o);else{const o=ko(t);i={...e,x:e.x-o.x,y:e.y-o.y}}return eo(i)}function Lo(t,e){const o=wo(t);return!(o===e||!fo(o)||mo(o))&&("fixed"===vo(o).position||Lo(o,e))}function Wo(t,e,o){const i=po(e),r=lo(e),n="fixed"===o,a=Eo(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=Me(0);if(i||!i&&!n)if(("body"!==ao(e)||uo(r))&&(s=xo(e)),i){const t=Eo(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else r&&(l.x=Ro(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function zo(t,e){return po(t)&&"fixed"!==vo(t).position?e?e(t):t.offsetParent:null}function Do(t,e){const o=so(t);if(!po(t))return o;let i=zo(t,e);for(;i&&go(i)&&"static"===vo(i).position;)i=zo(i,e);return i&&("html"===ao(i)||"body"===ao(i)&&"static"===vo(i).position&&!bo(i))?o:i||function(t){let e=wo(t);for(;po(e)&&!mo(e);){if(bo(e))return e;e=wo(e)}return null}(t)||o}const To={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:e,offsetParent:o,strategy:i}=t;const r=po(o),n=lo(o);if(o===n)return e;let a={scrollLeft:0,scrollTop:0},s=Me(1);const l=Me(0);if((r||!r&&"fixed"!==i)&&(("body"!==ao(o)||uo(n))&&(a=xo(o)),po(o))){const t=Eo(o);s=Io(o),l.x=t.x+o.clientLeft,l.y=t.y+o.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:lo,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===o?function(t,e){const o=e.get(t);if(o)return o;let i=So(t,[],!1).filter((t=>fo(t)&&"body"!==ao(t))),r=null;const n="fixed"===vo(t).position;let a=n?wo(t):t;for(;fo(a)&&!mo(a);){const e=vo(a),o=bo(a);o||"fixed"!==e.position||(r=null),(n?!o&&!r:!o&&"static"===e.position&&r&&["absolute","fixed"].includes(r.position)||uo(a)&&!o&&Lo(t,a))?i=i.filter((t=>t!==a)):r=e,a=wo(a)}return e.set(t,i),i}(e,this._c):[].concat(o),i],a=n[0],s=n.reduce(((t,o)=>{const i=Uo(e,o,r);return t.top=Be(i.top,t.top),t.right=Fe(i.right,t.right),t.bottom=Fe(i.bottom,t.bottom),t.left=Be(i.left,t.left),t}),Uo(e,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Do,getElementRects:async function(t){let{reference:e,floating:o,strategy:i}=t;const r=this.getOffsetParent||Do,n=this.getDimensions;return{reference:Wo(e,await r(o),i),floating:{x:0,y:0,...await n(o)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return No(t)},getScale:Io,isElement:fo,isRTL:function(t){return"rtl"===vo(t).direction}},Ao=(t,e,o)=>{const i=new Map,r={platform:To,...o},n={...r.platform,_c:i};return(async(t,e,o)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=o,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:d,y:f}=oo(c,i,l),p=i,h={},u=0;for(let o=0;o<s.length;o++){const{name:n,fn:g}=s[o],{x:b,y,data:m,reset:v}=await g({x:d,y:f,initialPlacement:i,placement:p,strategy:r,middlewareData:h,rects:c,platform:a,elements:{reference:t,floating:e}});d=null!=b?b:d,f=null!=y?y:f,h={...h,[n]:{...h[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(p=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:d,y:f}=oo(c,p,l))),o=-1)}return{x:d,y:f,placement:p,strategy:r,middlewareData:h}})(t,e,{...r,platform:n})};function _o(t){return function(t){for(let e=t;e;e=Zo(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Zo(t);e;e=Zo(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 Zo(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}async function Fo(t,e,o){return Ao(t,e,{platform:{...To,getOffsetParent:t=>To.getOffsetParent(t,_o)},middleware:[(i={crossAxis:!0},void 0===i&&(i={}),{name:"shift",options:i,async fn(t){const{x:e,y:o,placement:r}=t,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=Ge(i,t),c={x:e,y:o},d=await io(t,l),f=Qe(Ve(r)),p=qe(f);let h=c[p],u=c[f];if(n){const t="y"===p?"bottom":"right";h=je(h+d["y"===p?"top":"left"],h,h-d[t])}if(a){const t="y"===f?"bottom":"right";u=je(u+d["y"===f?"top":"left"],u,u-d[t])}const g=s.fn({...t,[p]:h,[f]:u});return{...g,data:{x:g.x-e,y:g.y-o}}}}),no({allowedPlacements:[o]})]});var i}var Bo,Ko,Mo,Po=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ho extends e.FtLitElement{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 e.Debouncer,this.revealDebouncer=new e.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return o.html`
586
586
  <div part="container"
587
587
  class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
588
588
  @mouseenter=${this.onHover}
@@ -600,12 +600,12 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
600
600
  </div>
601
601
  </div>
602
602
  </div>
603
- `}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()}async show(t){this.visible=!0,null!=t&&await this.hideDebounce.run((()=>{this.hide()}),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",async function(t,e,o){return Ao(t,e,{platform:{...To,getOffsetParent:t=>To.getOffsetParent(t,_o)},middleware:[(i={crossAxis:!0},void 0===i&&(i={}),{name:"shift",options:i,async fn(t){const{x:e,y:o,placement:r}=t,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=Ge(i,t),c={x:e,y:o},d=await io(t,l),f=Qe(Ve(r)),p=qe(f);let h=c[p],u=c[f];if(n){const t="y"===p?"bottom":"right";h=je(h+d["y"===p?"top":"left"],h,h-d[t])}if(a){const t="y"===f?"bottom":"right";u=je(u+d["y"===f?"top":"left"],u,u-d[t])}const g=s.fn({...t,[p]:h,[f]:u});return{...g,data:{x:g.x-e,y:g.y-o}}}}),no({allowedPlacements:[o]})]});var i}(this.slottedElement,this.tooltip,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())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Po.elementDefinitions={"ft-typography":ke},Po.styles=Ae,Mo([i.property()],Po.prototype,"text",void 0),Mo([i.property({type:Boolean})],Po.prototype,"manual",void 0),Mo([i.property({type:Boolean})],Po.prototype,"inline",void 0),Mo([i.property({type:Number})],Po.prototype,"delay",void 0),Mo([i.property()],Po.prototype,"position",void 0),Mo([i.queryAssignedNodes()],Po.prototype,"slotNodes",void 0),Mo([i.query(".ft-tooltip--container")],Po.prototype,"container",void 0),Mo([i.query(".ft-tooltip")],Po.prototype,"tooltip",void 0),Mo([i.query(".ft-tooltip--content")],Po.prototype,"tooltipContent",void 0),Mo([i.state()],Po.prototype,"visible",void 0),Mo([i.eventOptions({passive:!0})],Po.prototype,"onTouch",null),Mo([i.eventOptions({passive:!0})],Po.prototype,"onHover",null),Mo([i.eventOptions({passive:!0})],Po.prototype,"onOut",null),Mo([i.eventOptions({passive:!0})],Po.prototype,"onClick",null),e.customElement("ft-tooltip")(Po),function(t){t.THUMBS_DOWN="&#xe94d;",t.THUMBS_DOWN_PLAIN="&#xe94e;",t.THUMBS_UP="&#xe94f;",t.THUMBS_UP_PLAIN="&#xe950;",t.STAR="&#xe94c;",t.STAR_PLAIN="&#xe900;",t.DESKTOP="&#xe95e;",t.LIFE_RING="&#xe975;",t.GLOBE="&#xe976;",t.PIGGY_BANK="&#xe977;",t.TABLET_LANDSCAPE="&#xe95f;",t.TABLET_PORTRAIT="&#xe960;",t.MOBILE_LANDSCAPE="&#xe961;",t.MOBILE_PORTRAIT="&#xe962;",t.ARROW_RIGHT_TO_LINE="&#xe95d;",t.THIN_ARROW_UP="&#xe95c;",t.CONTEXTUAL="&#xe95b;",t.CHART_SIMPLE="&#xe968;",t.BARS_PROGRESS="&#xe969;",t.LINE_CHART="&#xe96c;",t.STACKED_CHART="&#xe96d;",t.CHART_BAR_NORMALIZED="&#xe97b;",t.BOOK_OPEN_GEAR="&#xe96a;",t.BOOK_OPEN_GEAR_SLASH="&#xe96b;",t.DIAGRAM_SUNBURST="&#xe963;",t.DIAGRAM_SANKEY="&#xe964;",t.UNSTRUCTURED_DOC="&#xe95a;",t.RESET="&#xe958;",t.THIN_ARROW_LEFT="&#xe956;",t.THIN_ARROW_RIGHT="&#xe957;",t.MY_COLLECTIONS="&#xe955;",t.OFFLINE_SETTINGS="&#xe954;",t.MY_LIBRARY="&#xe959;",t.RATE_PLAIN="&#xe952;",t.RATE="&#xe953;",t.FEEDBACK_PLAIN="&#xe951;",t.PAUSE="&#xe949;",t.PLAY="&#xe94a;",t.RELATIVES_PLAIN="&#xe947;",t.RELATIVES="&#xe948;",t.SHORTCUT_MENU="&#xe946;",t.PRINT="&#xe944;",t.DEFAULT_ROLES="&#xe945;",t.ACCOUNT_SETTINGS="&#xe943;",t.ONLINE="&#xe941;",t.OFFLINE="&#xe816;",t.UPLOAD="&#xe940;",t.BOOK_PLAIN="&#xe93f;",t.SYNC="&#xe93d;",t.SHARED_PBK="&#xe931;",t.COLLECTIONS="&#xe92a;",t.SEARCH_IN_PUBLICATION="&#xe92f;",t.BOOKS="&#xe806;",t.LOCKER="&#xe93b;",t.ARROW_DOWN="&#xe92b;",t.ARROW_LEFT="&#xe92c;",t.ARROW_RIGHT="&#xe92d;",t.ARROW_UP="&#xe92e;",t.SAVE="&#xe93a;",t.MAILS_AND_NOTIFICATIONS="&#xe939;",t.DOT="&#xe936;",t.MINUS="&#xe937;",t.PLUS="&#xe938;",t.FILTERS="&#xe935;",t.STRIPE_ARROW_RIGHT="&#xe934;",t.STRIPE_ARROW_LEFT="&#xe933;",t.ATTACHMENTS="&#xe932;",t.ADD_BOOKMARK="&#xe804;",t.BOOKMARK="&#xe805;",t.EXPORT="&#xe80f;",t.MENU="&#xe807;",t.TAG="&#xe93e;",t.TAG_PLAIN="&#xe942;",t.COPY_TO_CLIPBOARD="&#xe930;",t.COLUMNS="&#xe928;",t.ARTICLE="&#xe927;",t.CLOSE_PLAIN="&#xe925;",t.CHECK_PLAIN="&#xe926;",t.LOGOUT="&#xe923;",t.SIGN_IN="&#xe922;",t.THIN_ARROW="&#xe921;",t.TRIANGLE_BOTTOM="&#xe91d;",t.TRIANGLE_LEFT="&#xe91e;",t.TRIANGLE_RIGHT="&#xe91f;",t.TRIANGLE_TOP="&#xe920;",t.FACET_HAS_DESCENDANT="&#xe91c;",t.MINUS_PLAIN="&#xe91a;",t.PLUS_PLAIN="&#xe91b;",t.INFO="&#xe919;",t.ICON_EXPAND="&#xe917;",t.ICON_COLLAPSE="&#xe918;",t.ADD_TO_PBK="&#xe800;",t.ALERT="&#xe801;",t.ADD_ALERT="&#xe802;",t.BACK_TO_SEARCH="&#xe803;",t.DOWNLOAD="&#xe808;",t.EDIT="&#xe809;",t.FEEDBACK="&#xe80a;",t.MODIFY_PBK="&#xe80c;",t.SCHEDULED="&#xe80d;",t.SEARCH="&#xe80e;",t.SHARE="&#xe80f1;",t.TOC="&#xe810;",t.WRITE_UGC="&#xe811;",t.TRASH="&#xe812;",t.EXTLINK="&#xe814;",t.EXTLINK_LIGHT="&#xe978;",t.CALENDAR="&#xe815;",t.BOOK="&#xe817;",t.DOWNLOAD_PLAIN="&#xe818;",t.CHECK="&#xe819;",t.TOPICS="&#xe901;",t.EYE="&#xf06e;",t.EYE_SLASH="&#xe970;",t.DISC="&#xe902;",t.CIRCLE="&#xe903;",t.SHARED="&#xe904;",t.SORT_UNSORTED="&#xe905;",t.SORT_UP="&#xe906;",t.SORT_DOWN="&#xe907;",t.WORKING="&#xe908;",t.CLOSE="&#xe909;",t.ZOOM_OUT="&#xe90a;",t.ZOOM_IN="&#xe90b;",t.ZOOM_REALSIZE="&#xe90c;",t.ZOOM_FULLSCREEN="&#xe90d;",t.ADMIN_RESTRICTED="&#xe90e;",t.ADMIN_THEME="&#xe911;",t.WARNING="&#xe913;",t.CONTEXT="&#xe914;",t.SEARCH_HOME="&#xe915;",t.STEPS="&#xe916;",t.HOME="&#xe80b;",t.TRANSLATE="&#xe924;",t.USER="&#xe813;",t.ADMIN="&#xe90f;",t.ANALYTICS="&#xe929;",t.ADMIN_KHUB="&#xe910;",t.ADMIN_USERS="&#xe912;",t.ADMIN_INTEGRATION="&#xe93c;",t.ADMIN_PORTAL="&#xe94b;",t.COMMENT_QUESTION="&#xe965;",t.COMMENT_QUESTION_PLAIN="&#xe966;",t.MESSAGE_BOT="&#xe967;",t.PIP="&#xe973;",t.PIP_WIDE="&#xe974;",t.EXPAND_WIDE="&#xe972;",t.X_MARK="&#xe971;",t.CLONE="&#xe979;",t.CLONE_LINK_SIMPLE="&#xe97a;"}(Fo||(Fo={})),function(t){t.UNKNOWN="&#xe90a;",t.ABW="&#xe900;",t.AUDIO="&#xe901;",t.AVI="&#xe902;",t.CHM="&#xe904;",t.CODE="&#xe905;",t.CSV="&#xe903;",t.DITA="&#xe906;",t.EPUB="&#xe907;",t.EXCEL="&#xe908;",t.FLAC="&#xe909;",t.GIF="&#xe90b;",t.GZIP="&#xe90c;",t.HTML="&#xe90d;",t.IMAGE="&#xe90e;",t.JPEG="&#xe90f;",t.JSON="&#xe910;",t.M4A="&#xe911;",t.MOV="&#xe912;",t.MP3="&#xe913;",t.MP4="&#xe914;",t.OGG="&#xe915;",t.PDF="&#xe916;",t.PNG="&#xe917;",t.POWERPOINT="&#xe918;",t.RAR="&#xe91a;",t.STP="&#xe91b;",t.TEXT="&#xe91c;",t.VIDEO="&#xe91e;",t.WAV="&#xe91f;",t.WMA="&#xe920;",t.WORD="&#xe921;",t.XML="&#xe922;",t.YAML="&#xe919;",t.ZIP="&#xe923;"}(Bo||(Bo={})),new Map([...["abw"].map((t=>[t,Bo.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Bo.AUDIO])),...["avi"].map((t=>[t,Bo.AVI])),...["chm","xhs"].map((t=>[t,Bo.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Bo.CODE])),...["csv"].map((t=>[t,Bo.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Bo.DITA])),...["epub"].map((t=>[t,Bo.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Bo.EXCEL])),...["flac"].map((t=>[t,Bo.FLAC])),...["gif"].map((t=>[t,Bo.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Bo.GZIP])),...["html","htm","xhtml"].map((t=>[t,Bo.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf","ico"].map((t=>[t,Bo.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Bo.JPEG])),...["json"].map((t=>[t,Bo.JSON])),...["m4a","m4p"].map((t=>[t,Bo.M4A])),...["mov","qt"].map((t=>[t,Bo.MOV])),...["mp3"].map((t=>[t,Bo.MP3])),...["mp4","m4v"].map((t=>[t,Bo.MP4])),...["ogg","oga"].map((t=>[t,Bo.OGG])),...["pdf","ps"].map((t=>[t,Bo.PDF])),...["png"].map((t=>[t,Bo.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Bo.POWERPOINT])),...["rar"].map((t=>[t,Bo.RAR])),...["stp"].map((t=>[t,Bo.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Bo.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Bo.VIDEO])),...["wav"].map((t=>[t,Bo.WAV])),...["wma"].map((t=>[t,Bo.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Bo.WORD])),...["xml","xsl","rdf"].map((t=>[t,Bo.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Bo.YAML])),...["zip"].map((t=>[t,Bo.ZIP]))]),Bo.ABW,Bo.AUDIO,Bo.AVI,Bo.CHM,Bo.CODE,Bo.CSV,Bo.DITA,Bo.EPUB,Bo.EXCEL,Bo.FLAC,Bo.GIF,Bo.GZIP,Bo.HTML,Bo.IMAGE,Bo.JPEG,Bo.JSON,Bo.M4A,Bo.MOV,Bo.MP3,Bo.MP4,Bo.OGG,Bo.PDF,Bo.PNG,Bo.POWERPOINT,Bo.RAR,Bo.STP,Bo.TEXT,Bo.UNKNOWN,Bo.VIDEO,Bo.WAV,Bo.WMA,Bo.WORD,Bo.XML,Bo.YAML,Bo.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Ko||(Ko={}));var Ho=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class jo extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=o.nothing}render(){const t=this.variant&&Object.values(Ko).includes(this.variant)?this.variant:Ko.fluid_topics,e=t!==Ko.material||!!this.value;return o.html`
603
+ `}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()}async show(t){this.visible=!0,null!=t&&await this.hideDebounce.run((()=>{this.hide()}),t)}hide(){this.visible=!1}toggle(){this.visible=!this.visible}get slottedElement(){var t;return(null!==(t=this.slotNodes)&&void 0!==t?t:[]).filter((t=>t.nodeType==Node.ELEMENT_NODE))[0]}resetTooltipContent(){if(this.tooltip&&this.tooltipContent){const t=this.tooltipContent.style;switch(t.transition="none",this.validPosition){case"top":t.top=this.tooltip.clientHeight+"px",t.left="0";break;case"bottom":t.top=-this.tooltip.clientHeight+"px",t.left="0";break;case"left":t.top="0",t.left=this.tooltip.clientWidth+"px";break;case"right":t.top="0",t.left=-this.tooltip.clientWidth+"px"}}}positionTooltip(){this.resetTooltipContent(),this.tooltip&&this.slottedElement&&(this.tooltip.style.left="",this.tooltip.style.top="",Fo(this.slottedElement,this.tooltip,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())}onClick(){this.manual||(this.revealDebouncer.cancel(),this.hide())}correctOutOfWindowPixels(t,e){return Math.max(t,Math.min(0,-e))}}Ho.elementDefinitions={"ft-typography":ke},Ho.styles=Ae,Po([i.property()],Ho.prototype,"text",void 0),Po([i.property({type:Boolean})],Ho.prototype,"manual",void 0),Po([i.property({type:Boolean})],Ho.prototype,"inline",void 0),Po([i.property({type:Number})],Ho.prototype,"delay",void 0),Po([i.property()],Ho.prototype,"position",void 0),Po([i.queryAssignedNodes()],Ho.prototype,"slotNodes",void 0),Po([i.query(".ft-tooltip--container")],Ho.prototype,"container",void 0),Po([i.query(".ft-tooltip")],Ho.prototype,"tooltip",void 0),Po([i.query(".ft-tooltip--content")],Ho.prototype,"tooltipContent",void 0),Po([i.state()],Ho.prototype,"visible",void 0),Po([i.eventOptions({passive:!0})],Ho.prototype,"onTouch",null),Po([i.eventOptions({passive:!0})],Ho.prototype,"onHover",null),Po([i.eventOptions({passive:!0})],Ho.prototype,"onOut",null),Po([i.eventOptions({passive:!0})],Ho.prototype,"onClick",null),e.customElement("ft-tooltip")(Ho),function(t){t.THUMBS_DOWN="&#xe94d;",t.THUMBS_DOWN_PLAIN="&#xe94e;",t.THUMBS_UP="&#xe94f;",t.THUMBS_UP_PLAIN="&#xe950;",t.STAR="&#xe94c;",t.STAR_PLAIN="&#xe900;",t.DESKTOP="&#xe95e;",t.LIFE_RING="&#xe975;",t.GLOBE="&#xe976;",t.PIGGY_BANK="&#xe977;",t.TABLET_LANDSCAPE="&#xe95f;",t.TABLET_PORTRAIT="&#xe960;",t.MOBILE_LANDSCAPE="&#xe961;",t.MOBILE_PORTRAIT="&#xe962;",t.ARROW_RIGHT_TO_LINE="&#xe95d;",t.THIN_ARROW_UP="&#xe95c;",t.CONTEXTUAL="&#xe95b;",t.CHART_SIMPLE="&#xe968;",t.BARS_PROGRESS="&#xe969;",t.LINE_CHART="&#xe96c;",t.STACKED_CHART="&#xe96d;",t.CHART_BAR_NORMALIZED="&#xe97b;",t.BOOK_OPEN_GEAR="&#xe96a;",t.BOOK_OPEN_GEAR_SLASH="&#xe96b;",t.DIAGRAM_SUNBURST="&#xe963;",t.DIAGRAM_SANKEY="&#xe964;",t.UNSTRUCTURED_DOC="&#xe95a;",t.RESET="&#xe958;",t.THIN_ARROW_LEFT="&#xe956;",t.THIN_ARROW_RIGHT="&#xe957;",t.MY_COLLECTIONS="&#xe955;",t.OFFLINE_SETTINGS="&#xe954;",t.MY_LIBRARY="&#xe959;",t.RATE_PLAIN="&#xe952;",t.RATE="&#xe953;",t.FEEDBACK_PLAIN="&#xe951;",t.PAUSE="&#xe949;",t.PLAY="&#xe94a;",t.RELATIVES_PLAIN="&#xe947;",t.RELATIVES="&#xe948;",t.SHORTCUT_MENU="&#xe946;",t.PRINT="&#xe944;",t.DEFAULT_ROLES="&#xe945;",t.ACCOUNT_SETTINGS="&#xe943;",t.ONLINE="&#xe941;",t.OFFLINE="&#xe816;",t.UPLOAD="&#xe940;",t.BOOK_PLAIN="&#xe93f;",t.SYNC="&#xe93d;",t.SHARED_PBK="&#xe931;",t.COLLECTIONS="&#xe92a;",t.SEARCH_IN_PUBLICATION="&#xe92f;",t.BOOKS="&#xe806;",t.LOCKER="&#xe93b;",t.ARROW_DOWN="&#xe92b;",t.ARROW_LEFT="&#xe92c;",t.ARROW_RIGHT="&#xe92d;",t.ARROW_UP="&#xe92e;",t.SAVE="&#xe93a;",t.MAILS_AND_NOTIFICATIONS="&#xe939;",t.DOT="&#xe936;",t.MINUS="&#xe937;",t.PLUS="&#xe938;",t.FILTERS="&#xe935;",t.STRIPE_ARROW_RIGHT="&#xe934;",t.STRIPE_ARROW_LEFT="&#xe933;",t.ATTACHMENTS="&#xe932;",t.ADD_BOOKMARK="&#xe804;",t.BOOKMARK="&#xe805;",t.EXPORT="&#xe80f;",t.MENU="&#xe807;",t.TAG="&#xe93e;",t.TAG_PLAIN="&#xe942;",t.COPY_TO_CLIPBOARD="&#xe930;",t.COLUMNS="&#xe928;",t.ARTICLE="&#xe927;",t.CLOSE_PLAIN="&#xe925;",t.CHECK_PLAIN="&#xe926;",t.LOGOUT="&#xe923;",t.SIGN_IN="&#xe922;",t.THIN_ARROW="&#xe921;",t.TRIANGLE_BOTTOM="&#xe91d;",t.TRIANGLE_LEFT="&#xe91e;",t.TRIANGLE_RIGHT="&#xe91f;",t.TRIANGLE_TOP="&#xe920;",t.FACET_HAS_DESCENDANT="&#xe91c;",t.MINUS_PLAIN="&#xe91a;",t.PLUS_PLAIN="&#xe91b;",t.INFO="&#xe919;",t.ICON_EXPAND="&#xe917;",t.ICON_COLLAPSE="&#xe918;",t.ADD_TO_PBK="&#xe800;",t.ALERT="&#xe801;",t.ADD_ALERT="&#xe802;",t.BACK_TO_SEARCH="&#xe803;",t.DOWNLOAD="&#xe808;",t.EDIT="&#xe809;",t.FEEDBACK="&#xe80a;",t.MODIFY_PBK="&#xe80c;",t.SCHEDULED="&#xe80d;",t.SEARCH="&#xe80e;",t.SHARE="&#xe80f1;",t.TOC="&#xe810;",t.WRITE_UGC="&#xe811;",t.TRASH="&#xe812;",t.EXTLINK="&#xe814;",t.EXTLINK_LIGHT="&#xe978;",t.CALENDAR="&#xe815;",t.BOOK="&#xe817;",t.DOWNLOAD_PLAIN="&#xe818;",t.CHECK="&#xe819;",t.TOPICS="&#xe901;",t.EYE="&#xf06e;",t.EYE_SLASH="&#xe970;",t.DISC="&#xe902;",t.CIRCLE="&#xe903;",t.SHARED="&#xe904;",t.SORT_UNSORTED="&#xe905;",t.SORT_UP="&#xe906;",t.SORT_DOWN="&#xe907;",t.WORKING="&#xe908;",t.CLOSE="&#xe909;",t.ZOOM_OUT="&#xe90a;",t.ZOOM_IN="&#xe90b;",t.ZOOM_REALSIZE="&#xe90c;",t.ZOOM_FULLSCREEN="&#xe90d;",t.ADMIN_RESTRICTED="&#xe90e;",t.ADMIN_THEME="&#xe911;",t.WARNING="&#xe913;",t.CONTEXT="&#xe914;",t.SEARCH_HOME="&#xe915;",t.STEPS="&#xe916;",t.HOME="&#xe80b;",t.TRANSLATE="&#xe924;",t.USER="&#xe813;",t.ADMIN="&#xe90f;",t.ANALYTICS="&#xe929;",t.ADMIN_KHUB="&#xe910;",t.ADMIN_USERS="&#xe912;",t.ADMIN_INTEGRATION="&#xe93c;",t.ADMIN_PORTAL="&#xe94b;",t.COMMENT_QUESTION="&#xe965;",t.COMMENT_QUESTION_PLAIN="&#xe966;",t.MESSAGE_BOT="&#xe967;",t.PIP="&#xe973;",t.PIP_WIDE="&#xe974;",t.EXPAND_WIDE="&#xe972;",t.X_MARK="&#xe971;",t.CLONE="&#xe979;",t.CLONE_LINK_SIMPLE="&#xe97a;"}(Bo||(Bo={})),function(t){t.UNKNOWN="&#xe90a;",t.ABW="&#xe900;",t.AUDIO="&#xe901;",t.AVI="&#xe902;",t.CHM="&#xe904;",t.CODE="&#xe905;",t.CSV="&#xe903;",t.DITA="&#xe906;",t.EPUB="&#xe907;",t.EXCEL="&#xe908;",t.FLAC="&#xe909;",t.GIF="&#xe90b;",t.GZIP="&#xe90c;",t.HTML="&#xe90d;",t.IMAGE="&#xe90e;",t.JPEG="&#xe90f;",t.JSON="&#xe910;",t.M4A="&#xe911;",t.MOV="&#xe912;",t.MP3="&#xe913;",t.MP4="&#xe914;",t.OGG="&#xe915;",t.PDF="&#xe916;",t.PNG="&#xe917;",t.POWERPOINT="&#xe918;",t.RAR="&#xe91a;",t.STP="&#xe91b;",t.TEXT="&#xe91c;",t.VIDEO="&#xe91e;",t.WAV="&#xe91f;",t.WMA="&#xe920;",t.WORD="&#xe921;",t.XML="&#xe922;",t.YAML="&#xe919;",t.ZIP="&#xe923;"}(Ko||(Ko={})),new Map([...["abw"].map((t=>[t,Ko.ABW])),...["3gp","act","aiff","aac","amr","au","awb","dct","dss","dvf","gsm","iklax","ivs","mmf","mpc","msv","opus","ra","rm","raw","sln","tta","vox","wv"].map((t=>[t,Ko.AUDIO])),...["avi"].map((t=>[t,Ko.AVI])),...["chm","xhs"].map((t=>[t,Ko.CHM])),...["java","py","php","php3","php4","php5","js","javascript","rb","rbw","c","cpp","cxx","h","hh","hpp","hxx","sh","bash","zsh","tcsh","ksh","csh","vb","scala","pl","prl","perl","groovy","ceylon","aspx","jsp","scpt","applescript","bas","bat","lua","jsp","mk","cmake","css","sass","less","m","mm","xcodeproj"].map((t=>[t,Ko.CODE])),...["csv"].map((t=>[t,Ko.CSV])),...["dita","ditamap","ditaval"].map((t=>[t,Ko.DITA])),...["epub"].map((t=>[t,Ko.EPUB])),...["xls","xlt","xlm","xlsx","xlsm","xltx","xltm","xlsb","xla","xlam","xll","xlw"].map((t=>[t,Ko.EXCEL])),...["flac"].map((t=>[t,Ko.FLAC])),...["gif"].map((t=>[t,Ko.GIF])),...["gzip","x-gzip","giz","gz","tgz"].map((t=>[t,Ko.GZIP])),...["html","htm","xhtml"].map((t=>[t,Ko.HTML])),...["ai","vml","xps","img","cpt","psd","psp","xcf","svg","svg+xml","bmp","bpg","ppm","pgm","pbm","pnm","rif","tif","tiff","webp","wmf","ico"].map((t=>[t,Ko.IMAGE])),...["jpeg","jpg","jpe"].map((t=>[t,Ko.JPEG])),...["json"].map((t=>[t,Ko.JSON])),...["m4a","m4p"].map((t=>[t,Ko.M4A])),...["mov","qt"].map((t=>[t,Ko.MOV])),...["mp3"].map((t=>[t,Ko.MP3])),...["mp4","m4v"].map((t=>[t,Ko.MP4])),...["ogg","oga"].map((t=>[t,Ko.OGG])),...["pdf","ps"].map((t=>[t,Ko.PDF])),...["png"].map((t=>[t,Ko.PNG])),...["ppt","pot","pps","pptx","pptm","potx","potm","ppam","ppsx","ppsm","sldx","sldm"].map((t=>[t,Ko.POWERPOINT])),...["rar"].map((t=>[t,Ko.RAR])),...["stp"].map((t=>[t,Ko.STP])),...["txt","rtf","md","mdown"].map((t=>[t,Ko.TEXT])),...["webm","mkv","flv","vob","ogv","ogg","drc","mng","wmv","yuv","rm","rmvb","asf","mpg","mp2","mpeg","mpe","mpv","m2v","svi","3gp","3g2","mxf","roq","nsv"].map((t=>[t,Ko.VIDEO])),...["wav"].map((t=>[t,Ko.WAV])),...["wma"].map((t=>[t,Ko.WMA])),...["doc","dot","docx","docm","dotx","dotm","docb"].map((t=>[t,Ko.WORD])),...["xml","xsl","rdf"].map((t=>[t,Ko.XML])),...["yaml","yml","x-yaml"].map((t=>[t,Ko.YAML])),...["zip"].map((t=>[t,Ko.ZIP]))]),Ko.ABW,Ko.AUDIO,Ko.AVI,Ko.CHM,Ko.CODE,Ko.CSV,Ko.DITA,Ko.EPUB,Ko.EXCEL,Ko.FLAC,Ko.GIF,Ko.GZIP,Ko.HTML,Ko.IMAGE,Ko.JPEG,Ko.JSON,Ko.M4A,Ko.MOV,Ko.MP3,Ko.MP4,Ko.OGG,Ko.PDF,Ko.PNG,Ko.POWERPOINT,Ko.RAR,Ko.STP,Ko.TEXT,Ko.UNKNOWN,Ko.VIDEO,Ko.WAV,Ko.WMA,Ko.WORD,Ko.XML,Ko.YAML,Ko.ZIP,function(t){t.fluid_topics="fluid-topics",t.file_format="file-format",t.material="material"}(Mo||(Mo={}));var jo=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Go extends e.FtLitElement{constructor(){super(...arguments),this.resolvedIcon=o.nothing}render(){const t=this.variant&&Object.values(Mo).includes(this.variant)?this.variant:Mo.fluid_topics,e=t!==Mo.material||!!this.value;return o.html`
604
604
  <i class="ft-icon ft-icon--${t}" part="icon icon-${t}">
605
605
  ${n.unsafeHTML(this.resolvedIcon)}
606
606
  <slot ?hidden=${e}></slot>
607
607
  </i>
608
- `}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:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case Ko.file_format:this.resolvedIcon=null!==(t=Bo[i.replace("-","_").toUpperCase()])&&void 0!==t?t:i;break;case Ko.material:this.resolvedIcon=this.value||o.nothing;break;default:this.resolvedIcon=null!==(e=Fo[i.replace("-","_").toUpperCase()])&&void 0!==e?e:i}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}jo.elementDefinitions={},jo.styles=It,Ho([i.property()],jo.prototype,"variant",void 0),Ho([i.property()],jo.prototype,"value",void 0),Ho([i.state()],jo.prototype,"resolvedIcon",void 0),Ho([i.query("slot")],jo.prototype,"slottedContent",void 0),e.customElement("ft-icon")(jo);const Go={borderRadiusLeft:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left","",e.designSystemVariables.borderRadiusL),borderRadiusRight:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right","",e.designSystemVariables.borderRadiusL),borderWidthLeft:e.FtCssVariableFactory.create("--ft-switch-option-border-width-left","","SIZE","1px"),borderWidthRight:e.FtCssVariableFactory.create("--ft-switch-option-border-width-right","","SIZE","1px"),borderWidthVertical:e.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","","SIZE","1px")},Vo=o.css`
608
+ `}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:""}update(t){super.update(t),["value","variant"].some((e=>t.has(e)))&&this.resolveIcon()}resolveIcon(){var t,e;let i=this.value||this.textContent;switch(this.variant){case Mo.file_format:this.resolvedIcon=null!==(t=Ko[i.replace("-","_").toUpperCase()])&&void 0!==t?t:i;break;case Mo.material:this.resolvedIcon=this.value||o.nothing;break;default:this.resolvedIcon=null!==(e=Bo[i.replace("-","_").toUpperCase()])&&void 0!==e?e:i}}firstUpdated(t){super.firstUpdated(t),setTimeout((()=>this.resolveIcon()))}}Go.elementDefinitions={},Go.styles=It,jo([i.property()],Go.prototype,"variant",void 0),jo([i.property()],Go.prototype,"value",void 0),jo([i.state()],Go.prototype,"resolvedIcon",void 0),jo([i.query("slot")],Go.prototype,"slottedContent",void 0),e.customElement("ft-icon")(Go);const Vo={borderRadiusLeft:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-left","",e.designSystemVariables.borderRadiusL),borderRadiusRight:e.FtCssVariableFactory.extend("--ft-switch-option-border-radius-right","",e.designSystemVariables.borderRadiusL),borderWidthLeft:e.FtCssVariableFactory.create("--ft-switch-option-border-width-left","","SIZE","1px"),borderWidthRight:e.FtCssVariableFactory.create("--ft-switch-option-border-width-right","","SIZE","1px"),borderWidthVertical:e.FtCssVariableFactory.create("--ft-switch-option-border-width-vertical","","SIZE","1px")},Yo=o.css`
609
609
  .ft-switch-option {
610
610
  position: relative;
611
611
  display: inline-block;
@@ -624,8 +624,8 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
624
624
 
625
625
  border-style: solid;
626
626
  border-color: ${Tt.borderColor};
627
- border-width: ${Go.borderWidthVertical} ${Go.borderWidthRight} ${Go.borderWidthVertical} ${Go.borderWidthLeft};
628
- border-radius: ${Go.borderRadiusLeft} ${Go.borderRadiusRight} ${Go.borderRadiusRight} ${Go.borderRadiusLeft};
627
+ border-width: ${Vo.borderWidthVertical} ${Vo.borderWidthRight} ${Vo.borderWidthVertical} ${Vo.borderWidthLeft};
628
+ border-radius: ${Vo.borderRadiusLeft} ${Vo.borderRadiusRight} ${Vo.borderRadiusRight} ${Vo.borderRadiusLeft};
629
629
  display: flex;
630
630
  align-items: center;
631
631
  justify-content: center;
@@ -642,7 +642,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
642
642
 
643
643
  .ft-switch-option--selected .ft-switch-option--content:before {
644
644
  background-color: ${Tt.selectedBackgroundColor};
645
- border-radius: ${Go.borderRadiusLeft} ${Go.borderRadiusRight} ${Go.borderRadiusRight} ${Go.borderRadiusLeft};
645
+ border-radius: ${Vo.borderRadiusLeft} ${Vo.borderRadiusRight} ${Vo.borderRadiusRight} ${Vo.borderRadiusLeft};
646
646
  position: absolute;
647
647
  inset: 0;
648
648
  content: "";
@@ -689,7 +689,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
689
689
  .ft-switch-option--selected ft-icon {
690
690
  color: ${Tt.selectedTextColor};
691
691
  }
692
- `;var Yo=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qo extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class Xo extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class Qo extends e.FtLitElement{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 Xo(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(o.html`
692
+ `;var qo=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Xo extends CustomEvent{constructor(t){super("option-change-by-user",{detail:t,bubbles:!0,composed:!0})}}class Qo extends CustomEvent{constructor(t){super("option-change",{detail:t,bubbles:!0,composed:!0})}}class Jo extends e.FtLitElement{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 Qo(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(o.html`
693
693
  <label part="label" for="input" class=${r.classMap(t)}
694
694
  @click=${this.onChange}>
695
695
  <div class="ft-switch-option--content">
@@ -711,16 +711,16 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
711
711
  position="${this.tooltipPosition}">
712
712
  ${t}
713
713
  </ft-tooltip>
714
- `}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new qo(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?o.html`
714
+ `}onChange(){this.selected=!this.unselectable||!this.selected,this.dispatchEvent(new Xo(this.selected))}getLabel(){return this.label||this.textContent}resolveIcon(){return this.icon?o.html`
715
715
  <ft-icon part="icon" .variant=${this.iconVariant} .value=${this.icon}></ft-icon>
716
- `:o.nothing}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()}}Qo.elementDefinitions={"ft-ripple":Re,"ft-typography":ke,"ft-tooltip":Po,"ft-icon":jo},Qo.styles=[e.safariEllipsisFix,Vo],Yo([i.property()],Qo.prototype,"value",void 0),Yo([i.property()],Qo.prototype,"icon",void 0),Yo([i.property()],Qo.prototype,"iconVariant",void 0),Yo([i.property()],Qo.prototype,"label",void 0),Yo([i.property()],Qo.prototype,"tooltipPosition",void 0),Yo([i.property({type:Boolean,reflect:!0})],Qo.prototype,"selected",void 0),Yo([i.property({type:Boolean})],Qo.prototype,"trailingIcon",void 0),Yo([i.property({type:Boolean})],Qo.prototype,"unselectable",void 0),Yo([i.query(".ft-switch-option--content slot")],Qo.prototype,"slottedContent",void 0),Yo([i.query(".ft-switch-option--input")],Qo.prototype,"input",void 0);var Jo=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ti extends CustomEvent{constructor(t){super("change",{detail:t})}}class ei extends e.FtLitElement{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 o.html`
716
+ `:o.nothing}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()}}Jo.elementDefinitions={"ft-ripple":Re,"ft-typography":ke,"ft-tooltip":Ho,"ft-icon":Go},Jo.styles=[e.safariEllipsisFix,Yo],qo([i.property()],Jo.prototype,"value",void 0),qo([i.property()],Jo.prototype,"icon",void 0),qo([i.property()],Jo.prototype,"iconVariant",void 0),qo([i.property()],Jo.prototype,"label",void 0),qo([i.property()],Jo.prototype,"tooltipPosition",void 0),qo([i.property({type:Boolean,reflect:!0})],Jo.prototype,"selected",void 0),qo([i.property({type:Boolean})],Jo.prototype,"trailingIcon",void 0),qo([i.property({type:Boolean})],Jo.prototype,"unselectable",void 0),qo([i.query(".ft-switch-option--content slot")],Jo.prototype,"slottedContent",void 0),qo([i.query(".ft-switch-option--input")],Jo.prototype,"input",void 0);var ti=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ei extends CustomEvent{constructor(t){super("change",{detail:t})}}class oi extends e.FtLitElement{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 o.html`
717
717
  <div @keydown=${this.onKeyDown} tabindex="0" class="${r.classMap(t)}">
718
718
  <slot @slotchange=${this.onSlotchange}
719
719
  @option-change=${this.onOptionChangeByScript}
720
720
  @option-change-by-user=${this.onOptionChangeByUser}
721
721
  ></slot>
722
722
  </div>
723
- `}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 Qo&&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 ti(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}))}}ei.elementDefinitions={},ei.styles=o.css`
723
+ `}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 Jo&&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 ei(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}))}}oi.elementDefinitions={},oi.styles=o.css`
724
724
  :host {
725
725
  display: inline-block;
726
726
  }
@@ -736,25 +736,25 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
736
736
  }
737
737
 
738
738
  .ft-switch slot::slotted(ft-switch-option) {
739
- ${e.setVariable(Go.borderRadiusLeft,"0")};
740
- ${e.setVariable(Go.borderRadiusRight,"0")};
741
- ${e.setVariable(Go.borderWidthLeft,"0")};
739
+ ${e.setVariable(Vo.borderRadiusLeft,"0")};
740
+ ${e.setVariable(Vo.borderRadiusRight,"0")};
741
+ ${e.setVariable(Vo.borderWidthLeft,"0")};
742
742
  }
743
743
 
744
744
  .ft-switch slot::slotted(ft-switch-option:first-child) {
745
- ${e.setVariable(Go.borderRadiusLeft,Tt.borderRadius)};
746
- ${e.setVariable(Go.borderWidthLeft,"1px")};
745
+ ${e.setVariable(Vo.borderRadiusLeft,Tt.borderRadius)};
746
+ ${e.setVariable(Vo.borderWidthLeft,"1px")};
747
747
  }
748
748
 
749
749
  .ft-switch slot::slotted(ft-switch-option:last-child) {
750
- ${e.setVariable(Go.borderRadiusRight,Tt.borderRadius)};
750
+ ${e.setVariable(Vo.borderRadiusRight,Tt.borderRadius)};
751
751
  }
752
752
 
753
753
  .ft-switch--dense slot::slotted(ft-switch-option) {
754
754
  --ft-switch-internal-vertical-padding: 2px;
755
755
  --ft-switch-internal-horizontal-padding: 4px;
756
756
  }
757
- `,Jo([i.property({type:Boolean})],ei.prototype,"dense",void 0),Jo([i.property({type:Boolean})],ei.prototype,"unselectable",void 0),Jo([i.query(".ft-switch slot")],ei.prototype,"slottedContent",void 0),Jo([i.state()],ei.prototype,"selectedOption",void 0),Jo([i.query(".ft-switch")],ei.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(ei),e.customElement("ft-switch-option")(Qo);const oi=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),ii=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),ri=o.css`
757
+ `,ti([i.property({type:Boolean})],oi.prototype,"dense",void 0),ti([i.property({type:Boolean})],oi.prototype,"unselectable",void 0),ti([i.query(".ft-switch slot")],oi.prototype,"slottedContent",void 0),ti([i.state()],oi.prototype,"selectedOption",void 0),ti([i.query(".ft-switch")],oi.prototype,"ftSwitchDiv",void 0),e.customElement("ft-switch")(oi),e.customElement("ft-switch-option")(Jo);const ii=e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),ri=e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceMedium,"Design system"),ni=o.css`
758
758
  :host {
759
759
  display: block;
760
760
  }
@@ -765,14 +765,14 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
765
765
 
766
766
  ft-icon {
767
767
  transform: rotate(-45deg);
768
- color: ${oi};
768
+ color: ${ii};
769
769
  }
770
770
 
771
771
  .ft-resizer--dragging ft-icon,
772
772
  .ft-resizer:hover ft-icon {
773
- color: ${ii};
773
+ color: ${ri};
774
774
  }
775
- `;var ni=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ai extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class si extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=Ko.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 o.html`
775
+ `;var ai=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class si extends CustomEvent{constructor(t,e){super("resize",{detail:{width:t,height:e}})}}class li extends e.FtLitElement{constructor(){super(...arguments),this.initialWidth=0,this.initialHeight=0,this.icon="drag_handle",this.iconVariant=Mo.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 o.html`
776
776
  <style>
777
777
  .ft-resizer {
778
778
  cursor: ${o.unsafeCSS(this.cursor)}
@@ -783,25 +783,25 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
783
783
  @touchstart=${this.initDragFromTouch}>
784
784
  <ft-icon .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon>
785
785
  </div>
786
- `}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 o=this.fixedWidth+t-this.startX,i=this.fixedHeight+e-this.startY;this.dispatchEvent(new ai(o,i))}}si.elementDefinitions={"ft-icon":jo},si.styles=[e.noTextSelect,ri],ni([i.property({type:Number})],si.prototype,"initialWidth",void 0),ni([i.property({type:Number})],si.prototype,"initialHeight",void 0),ni([i.property()],si.prototype,"icon",void 0),ni([i.property()],si.prototype,"iconVariant",void 0),ni([i.property()],si.prototype,"cursor",void 0),ni([i.state()],si.prototype,"dragging",void 0),ni([i.eventOptions({passive:!0})],si.prototype,"initDragFromMouse",null),ni([i.eventOptions({passive:!0})],si.prototype,"initDragFromTouch",null),e.customElement("ft-resizer")(si);const li={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color","",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color","",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color","",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},ci=o.css`
786
+ `}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 o=this.fixedWidth+t-this.startX,i=this.fixedHeight+e-this.startY;this.dispatchEvent(new si(o,i))}}li.elementDefinitions={"ft-icon":Go},li.styles=[e.noTextSelect,ni],ai([i.property({type:Number})],li.prototype,"initialWidth",void 0),ai([i.property({type:Number})],li.prototype,"initialHeight",void 0),ai([i.property()],li.prototype,"icon",void 0),ai([i.property()],li.prototype,"iconVariant",void 0),ai([i.property()],li.prototype,"cursor",void 0),ai([i.state()],li.prototype,"dragging",void 0),ai([i.eventOptions({passive:!0})],li.prototype,"initDragFromMouse",null),ai([i.eventOptions({passive:!0})],li.prototype,"initDragFromTouch",null),e.customElement("ft-resizer")(li);const ci={fontSize:e.FtCssVariableFactory.create("--ft-input-label-font-size","","SIZE","14px"),raisedFontSize:e.FtCssVariableFactory.create("--ft-input-label-raised-font-size","","SIZE","11px"),raisedZIndex:e.FtCssVariableFactory.create("--ft-input-label-outlined-raised-z-index","","NUMBER","2"),verticalSpacing:e.FtCssVariableFactory.create("--ft-input-label-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-input-label-horizontal-spacing","","SIZE","12px"),labelMaxWidth:e.FtCssVariableFactory.create("--ft-input-label-max-width","","SIZE","100%"),borderColor:e.FtCssVariableFactory.extend("--ft-input-label-border-color","",e.designSystemVariables.colorOutline),textColor:e.FtCssVariableFactory.extend("--ft-input-label-text-color","",e.designSystemVariables.colorOnSurfaceMedium),disabledTextColor:e.FtCssVariableFactory.extend("--ft-input-label-disabled-text-color","",e.designSystemVariables.colorOnSurfaceDisabled),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},di=o.css`
787
787
  .ft-input-label {
788
788
  position: absolute;
789
789
  inset: 0;
790
790
  display: flex;
791
- background-color: ${li.colorSurface};
792
- border-radius: ${li.borderRadiusS} ${li.borderRadiusS} 0 0;
791
+ background-color: ${ci.colorSurface};
792
+ border-radius: ${ci.borderRadiusS} ${ci.borderRadiusS} 0 0;
793
793
  }
794
794
 
795
795
  .ft-input-label--outlined {
796
- border-radius: ${li.borderRadiusS};
796
+ border-radius: ${ci.borderRadiusS};
797
797
  }
798
798
 
799
799
  .ft-input-label {
800
- border-color: ${li.borderColor};
800
+ border-color: ${ci.borderColor};
801
801
  }
802
802
 
803
803
  .ft-input-label.ft-input-label--in-error {
804
- border-color: ${li.colorError}
804
+ border-color: ${ci.colorError}
805
805
  }
806
806
 
807
807
  .ft-input-label:before,
@@ -814,7 +814,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
814
814
  }
815
815
 
816
816
  .ft-input-label:before {
817
- width: calc(${li.horizontalSpacing} - 4px);
817
+ width: calc(${ci.horizontalSpacing} - 4px);
818
818
  flex-shrink: 0;
819
819
  }
820
820
 
@@ -830,20 +830,20 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
830
830
  border-bottom-width: 1px;
831
831
  border-bottom-style: solid;
832
832
  border-color: inherit;
833
- color: ${li.textColor};
833
+ color: ${ci.textColor};
834
834
  transition: font-size 250ms, line-height 250ms, color 250ms;
835
- max-width: calc(${li.labelMaxWidth} - 2 * (${li.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
835
+ max-width: calc(${ci.labelMaxWidth} - 2 * (${ci.horizontalSpacing} - 4px)); /* -2px on spacing for label padding */
836
836
  text-overflow: ellipsis;
837
- ${e.setVariable(X.fontSize,li.fontSize)};
838
- ${e.setVariable(X.lineHeight,li.fontSize)};
837
+ ${e.setVariable(X.fontSize,ci.fontSize)};
838
+ ${e.setVariable(X.lineHeight,ci.fontSize)};
839
839
  }
840
840
 
841
841
  .ft-input-label--in-error .ft-input-label--text {
842
- color: ${li.colorError}
842
+ color: ${ci.colorError}
843
843
  }
844
844
 
845
845
  .ft-input-label--disabled .ft-input-label--text {
846
- color: ${li.disabledTextColor};
846
+ color: ${ci.disabledTextColor};
847
847
  }
848
848
 
849
849
  .ft-input-label--hidden-text {
@@ -860,19 +860,19 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
860
860
  overflow: hidden;
861
861
  white-space: nowrap;
862
862
  text-overflow: ellipsis;
863
- padding: ${li.verticalSpacing} 4px;
864
- margin: calc(${li.verticalSpacing} * -1) 0;
863
+ padding: ${ci.verticalSpacing} 4px;
864
+ margin: calc(${ci.verticalSpacing} * -1) 0;
865
865
  max-width: 100%;
866
866
  box-sizing: border-box;
867
867
  }
868
868
 
869
869
  .ft-input-label--raised .ft-input-label--text {
870
- ${e.setVariable(X.fontSize,li.raisedFontSize)};
871
- ${e.setVariable(X.lineHeight,li.raisedFontSize)};
870
+ ${e.setVariable(X.fontSize,ci.raisedFontSize)};
871
+ ${e.setVariable(X.lineHeight,ci.raisedFontSize)};
872
872
  }
873
873
 
874
874
  .ft-input-label--raised .ft-input-label--floating-text {
875
- top: ${li.verticalSpacing};
875
+ top: ${ci.verticalSpacing};
876
876
  }
877
877
 
878
878
  .ft-input-label--outlined .ft-input-label--text,
@@ -885,27 +885,27 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
885
885
  .ft-input-label--outlined:before {
886
886
  border-left-width: 1px;
887
887
  border-left-style: solid;
888
- border-radius: ${li.borderRadiusS} 0 0 ${li.borderRadiusS};
888
+ border-radius: ${ci.borderRadiusS} 0 0 ${ci.borderRadiusS};
889
889
  }
890
890
 
891
891
  .ft-input-label--outlined:after {
892
892
  border-right-width: 1px;
893
893
  border-right-style: solid;
894
- border-radius: 0 ${li.borderRadiusS} ${li.borderRadiusS} 0;
894
+ border-radius: 0 ${ci.borderRadiusS} ${ci.borderRadiusS} 0;
895
895
  }
896
896
 
897
897
  .ft-input-label--outlined.ft-input-label--raised .ft-input-label--floating-text {
898
898
  padding: 2px 4px;
899
- z-index: ${li.raisedZIndex};
900
- background-color: ${li.colorSurface};
901
- border-radius: ${li.borderRadiusS};
899
+ z-index: ${ci.raisedZIndex};
900
+ background-color: ${ci.colorSurface};
901
+ border-radius: ${ci.borderRadiusS};
902
902
  top: calc((var(--ft-typography-caption-line-height) / -2) + 2px);
903
903
  }
904
904
 
905
905
  .ft-input-label--outlined.ft-input-label--raised .ft-input-label--text {
906
906
  border-top: none;
907
907
  }
908
- `;var di=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class fi extends e.FtLitElement{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 o.html`
908
+ `;var fi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pi extends e.FtLitElement{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 o.html`
909
909
  <div class="${r.classMap(t)}">
910
910
  ${this.text?o.html`
911
911
  <div class="ft-input-label--text ft-typography--caption">
@@ -914,7 +914,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
914
914
  </div>
915
915
  `:null}
916
916
  </div>
917
- `}}fi.elementDefinitions={},fi.styles=[yt,ci],di([i.property({type:String})],fi.prototype,"text",void 0),di([i.property({type:Boolean})],fi.prototype,"raised",void 0),di([i.property({type:Boolean})],fi.prototype,"outlined",void 0),di([i.property({type:Boolean})],fi.prototype,"disabled",void 0),di([i.property({type:Boolean})],fi.prototype,"error",void 0),e.customElement("ft-input-label")(fi);const pi={fontSize:e.FtCssVariableFactory.create("--ft-text-area-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-area-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-area-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},hi=o.css`
917
+ `}}pi.elementDefinitions={},pi.styles=[yt,di],fi([i.property({type:String})],pi.prototype,"text",void 0),fi([i.property({type:Boolean})],pi.prototype,"raised",void 0),fi([i.property({type:Boolean})],pi.prototype,"outlined",void 0),fi([i.property({type:Boolean})],pi.prototype,"disabled",void 0),fi([i.property({type:Boolean})],pi.prototype,"error",void 0),e.customElement("ft-input-label")(pi);const hi={fontSize:e.FtCssVariableFactory.create("--ft-text-area-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-area-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-area-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-area-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-area-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system")},ui=o.css`
918
918
  *:focus {
919
919
  outline: none;
920
920
  }
@@ -926,10 +926,10 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
926
926
  }
927
927
 
928
928
  ft-input-label {
929
- ${e.setVariable(li.fontSize,pi.fontSize)};
930
- ${e.setVariable(li.raisedFontSize,pi.labelSize)};
931
- ${e.setVariable(li.verticalSpacing,pi.verticalSpacing)};
932
- ${e.setVariable(li.horizontalSpacing,pi.horizontalSpacing)};
929
+ ${e.setVariable(ci.fontSize,hi.fontSize)};
930
+ ${e.setVariable(ci.raisedFontSize,hi.labelSize)};
931
+ ${e.setVariable(ci.verticalSpacing,hi.verticalSpacing)};
932
+ ${e.setVariable(ci.horizontalSpacing,hi.horizontalSpacing)};
933
933
  }
934
934
 
935
935
  .ft-text-area--main-panel {
@@ -960,12 +960,12 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
960
960
  align-self: stretch;
961
961
  resize: none;
962
962
 
963
- ${e.setVariable(P.fontSize,pi.fontSize)};
964
- ${e.setVariable(P.lineHeight,pi.fontSize)};
965
- color: ${pi.colorOnSurface};
963
+ ${e.setVariable(P.fontSize,hi.fontSize)};
964
+ ${e.setVariable(P.lineHeight,hi.fontSize)};
965
+ color: ${hi.colorOnSurface};
966
966
 
967
- padding: 0 ${pi.horizontalSpacing};
968
- margin: calc(${pi.verticalSpacing} + ${pi.labelSize} / 2) 0 ${pi.verticalSpacing} 0;
967
+ padding: 0 ${hi.horizontalSpacing};
968
+ margin: calc(${hi.verticalSpacing} + ${hi.labelSize} / 2) 0 ${hi.verticalSpacing} 0;
969
969
 
970
970
  border: none;
971
971
  background: none;
@@ -974,7 +974,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
974
974
  }
975
975
 
976
976
  .ft-text-area--disabled .ft-text-area--input {
977
- color: ${pi.colorOnSurfaceDisabled};
977
+ color: ${hi.colorOnSurfaceDisabled};
978
978
  }
979
979
 
980
980
  .ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
@@ -982,42 +982,42 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
982
982
  }
983
983
 
984
984
  .ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
985
- ${e.setVariable(li.borderColor,pi.colorPrimary)};
986
- ${e.setVariable(li.textColor,pi.colorPrimary)};
985
+ ${e.setVariable(ci.borderColor,hi.colorPrimary)};
986
+ ${e.setVariable(ci.textColor,hi.colorPrimary)};
987
987
  }
988
988
 
989
989
  .ft-text-area--filled .ft-text-area--input-panel {
990
- border-radius: ${pi.borderRadiusS} ${pi.borderRadiusS} 0 0;
990
+ border-radius: ${hi.borderRadiusS} ${hi.borderRadiusS} 0 0;
991
991
  }
992
992
 
993
993
  .ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
994
994
  align-self: stretch;
995
- margin-bottom: ${pi.verticalSpacing};
996
- margin-top: calc(${pi.labelSize} + 2 * ${pi.verticalSpacing});
995
+ margin-bottom: ${hi.verticalSpacing};
996
+ margin-top: calc(${hi.labelSize} + 2 * ${hi.verticalSpacing});
997
997
  }
998
998
 
999
999
  .ft-text-area--outlined .ft-text-area--input-panel {
1000
- border-radius: ${pi.borderRadiusS};
1000
+ border-radius: ${hi.borderRadiusS};
1001
1001
  }
1002
1002
 
1003
1003
  .ft-text-area--helper-text {
1004
- padding: 0 12px 0 ${pi.horizontalSpacing};
1005
- color: ${pi.helperColor};
1004
+ padding: 0 12px 0 ${hi.horizontalSpacing};
1005
+ color: ${hi.helperColor};
1006
1006
  }
1007
1007
 
1008
1008
  .ft-text-area--in-error .ft-text-area--input,
1009
1009
  .ft-text-area--in-error .ft-text-area--helper-text {
1010
- color: ${pi.colorError};
1010
+ color: ${hi.colorError};
1011
1011
  }
1012
1012
 
1013
1013
  ft-resizer {
1014
1014
  position: absolute;
1015
1015
  bottom: 0;
1016
1016
  }
1017
- `;var ui=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class gi extends(e.toFtFormComponent(e.FtLitElement,"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 o.html`
1017
+ `;var gi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class bi extends(e.toFtFormComponent(e.FtLitElement,"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 o.html`
1018
1018
  <style>
1019
1019
  .ft-text-area--main-panel {
1020
- height: calc(4 * ${pi.verticalSpacing} + ${pi.labelSize} + ${pi.fontSize} + ${this.height}px);
1020
+ height: calc(4 * ${hi.verticalSpacing} + ${hi.labelSize} + ${hi.fontSize} + ${this.height}px);
1021
1021
  }
1022
1022
 
1023
1023
  ft-resizer {
@@ -1056,14 +1056,14 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1056
1056
  ${this.helper}
1057
1057
  </ft-typography>`:void 0}
1058
1058
  </div>
1059
- `}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})))}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)}}gi.elementDefinitions={"ft-input-label":fi,"ft-resizer":si,"ft-ripple":Re,"ft-typography":ke},gi.styles=[gt,hi],ui([i.property({type:String})],gi.prototype,"label",void 0),ui([i.property({reflect:!0})],gi.prototype,"value",void 0),ui([i.property({type:String})],gi.prototype,"helper",void 0),ui([i.property({type:Boolean})],gi.prototype,"outlined",void 0),ui([i.property({type:Boolean})],gi.prototype,"disabled",void 0),ui([i.property({type:Boolean})],gi.prototype,"error",void 0),ui([i.property({type:Number,reflect:!0})],gi.prototype,"height",void 0),ui([i.query("textarea")],gi.prototype,"textarea",void 0),ui([i.state()],gi.prototype,"focused",void 0),e.customElement("ft-text-area")(gi);class bi extends e.FtLitElement{render(){return o.html`
1059
+ `}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})))}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)}}bi.elementDefinitions={"ft-input-label":pi,"ft-resizer":li,"ft-ripple":Re,"ft-typography":ke},bi.styles=[gt,ui],gi([i.property({type:String})],bi.prototype,"label",void 0),gi([i.property({reflect:!0})],bi.prototype,"value",void 0),gi([i.property({type:String})],bi.prototype,"helper",void 0),gi([i.property({type:Boolean})],bi.prototype,"outlined",void 0),gi([i.property({type:Boolean})],bi.prototype,"disabled",void 0),gi([i.property({type:Boolean})],bi.prototype,"error",void 0),gi([i.property({type:Number,reflect:!0})],bi.prototype,"height",void 0),gi([i.query("textarea")],bi.prototype,"textarea",void 0),gi([i.state()],bi.prototype,"focused",void 0),e.customElement("ft-text-area")(bi);class yi extends e.FtLitElement{render(){return o.html`
1060
1060
  <div class="ft-loader">
1061
1061
  <div></div>
1062
1062
  <div></div>
1063
1063
  <div></div>
1064
1064
  <div></div>
1065
1065
  </div>
1066
- `}}bi.styles=Nt,e.customElement("ft-loader")(bi);var yi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class mi extends(e.toFtFormComponent(e.FtLitElement,"button")){constructor(){super(),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.addEventListener("click",(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(o.html`
1066
+ `}}yi.styles=Nt,e.customElement("ft-loader")(yi);var mi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class vi extends(e.toFtFormComponent(e.FtLitElement,"button")){constructor(){super(),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.addEventListener("click",(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(o.html`
1067
1067
  <button part="button"
1068
1068
  class="${r.classMap(this.buttonClasses)}"
1069
1069
  aria-label="${this.getLabel()}"
@@ -1086,7 +1086,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1086
1086
  </ft-tooltip>
1087
1087
  `:t}resolveIcon(){return this.loading?o.html`
1088
1088
  <ft-loader part="loader icon"></ft-loader> `:this.icon?o.html`
1089
- <ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:o.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}mi.elementDefinitions={"ft-ripple":Re,"ft-tooltip":Po,"ft-typography":ke,"ft-icon":jo,"ft-loader":bi},yi([i.property({type:String,reflect:!0})],mi.prototype,"role",void 0),yi([i.property()],mi.prototype,"type",void 0),yi([i.property({type:Boolean})],mi.prototype,"disabled",void 0),yi([i.property()],mi.prototype,"label",void 0),yi([i.property()],mi.prototype,"icon",void 0),yi([i.property()],mi.prototype,"iconVariant",void 0),yi([i.property({type:Boolean})],mi.prototype,"trailingIcon",void 0),yi([i.property({type:Boolean})],mi.prototype,"loading",void 0),yi([i.property()],mi.prototype,"tooltipPosition",void 0),yi([i.property({type:Boolean})],mi.prototype,"hideTooltip",void 0),yi([i.property({type:Boolean})],mi.prototype,"forceTooltip",void 0),yi([i.query(".ft-button")],mi.prototype,"button",void 0),yi([i.query(".ft-button--label slot")],mi.prototype,"slottedContent",void 0);var vi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class xi extends mi{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"}}xi.styles=[e.safariEllipsisFix,Dt],vi([i.property({type:Boolean})],xi.prototype,"primary",void 0),vi([i.property({type:Boolean})],xi.prototype,"outlined",void 0),vi([i.property({type:Boolean})],xi.prototype,"dense",void 0),vi([i.property({type:Boolean})],xi.prototype,"round",void 0);const wi=[o.css`
1089
+ <ft-icon part="icon" .variant="${this.iconVariant}" .value="${this.icon}"></ft-icon> `:o.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}vi.elementDefinitions={"ft-ripple":Re,"ft-tooltip":Ho,"ft-typography":ke,"ft-icon":Go,"ft-loader":yi},mi([i.property({type:String,reflect:!0})],vi.prototype,"role",void 0),mi([i.property()],vi.prototype,"type",void 0),mi([i.property({type:Boolean})],vi.prototype,"disabled",void 0),mi([i.property()],vi.prototype,"label",void 0),mi([i.property()],vi.prototype,"icon",void 0),mi([i.property()],vi.prototype,"iconVariant",void 0),mi([i.property({type:Boolean})],vi.prototype,"trailingIcon",void 0),mi([i.property({type:Boolean})],vi.prototype,"loading",void 0),mi([i.property()],vi.prototype,"tooltipPosition",void 0),mi([i.property({type:Boolean})],vi.prototype,"hideTooltip",void 0),mi([i.property({type:Boolean})],vi.prototype,"forceTooltip",void 0),mi([i.query(".ft-button")],vi.prototype,"button",void 0),mi([i.query(".ft-button--label slot")],vi.prototype,"slottedContent",void 0);var xi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class wi extends vi{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"}}wi.styles=[e.safariEllipsisFix,Dt],xi([i.property({type:Boolean})],wi.prototype,"primary",void 0),xi([i.property({type:Boolean})],wi.prototype,"outlined",void 0),xi([i.property({type:Boolean})],wi.prototype,"dense",void 0),xi([i.property({type:Boolean})],wi.prototype,"round",void 0);const Oi=[o.css`
1090
1090
  :host {
1091
1091
  display: inline-block;
1092
1092
  max-width: 100%;
@@ -1304,15 +1304,15 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1304
1304
  width: ${I.smallIconOnlyWidth};
1305
1305
  padding: unset;
1306
1306
  }
1307
- `,e.noTextSelect];var Oi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Si extends mi{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?Ie.caption1medium:Ie.body2medium}}Si.styles=[e.safariEllipsisFix,wi],Oi([i.property({type:Boolean})],Si.prototype,"primary",void 0),Oi([i.property({type:Boolean})],Si.prototype,"secondary",void 0),Oi([i.property({type:Boolean})],Si.prototype,"tertiary",void 0),Oi([i.property({type:Boolean})],Si.prototype,"neutral",void 0),Oi([i.property({type:Boolean})],Si.prototype,"small",void 0),e.customElement("ft-button")(xi),e.customElement("ftds-button")(Si);const Ni=o.css`
1308
- `,$i=o.css`
1309
- `,Ii=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class Ci{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Ii.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?Ci.build(t):null!==(e=Ci.API)&&void 0!==e?e:Ci.API=Ci.build()}static await(t){return new Promise((e=>{let o=Ci.get(t);if(o)e(o);else{const i=Ii.subscribe((()=>{o=Ci.get(t),o&&(i(),e(o))}))}}))}}class ki{constructor(t=!0,o){var i;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new e.CacheRegistry,this.cache=t?r.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Ci.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:Ci.await()}clearCache(){this.cache.clearAll()}}var Ei;const Ri=Symbol("clearAfterUnitTest");class Ui extends ki{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ei]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Ii.getState().uiLocale,Ii.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ii.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,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...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 o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}Ei=Ri,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Ui{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Ui{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Li=window.FluidTopicsI18nService,Wi=window.FluidTopicsCustomI18nService;var zi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Di extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>Ci.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1307
+ `,e.noTextSelect];var Si=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ni extends vi{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?Ie.caption1medium:Ie.body2medium}}Ni.styles=[e.safariEllipsisFix,Oi],Si([i.property({type:Boolean})],Ni.prototype,"primary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"secondary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"tertiary",void 0),Si([i.property({type:Boolean})],Ni.prototype,"neutral",void 0),Si([i.property({type:Boolean})],Ni.prototype,"small",void 0),e.customElement("ft-button")(wi),e.customElement("ftds-button")(Ni);const $i=o.css`
1308
+ `,Ii=o.css`
1309
+ `,Ci=e.FtReduxStore.get({name:"ft-app-info",reducers:{},initialState:{baseUrl:void 0,apiIntegrationIdentifier:void 0,uiLocale:document.documentElement.lang||"en-US",availableUiLocales:[],metadataConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1}});class ki{static build(t){const{baseUrl:e,apiIntegrationIdentifier:o}=Ci.getState(),i=null!=t?t:o;if(e&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(e,i,!0)}static get(t){var e;return null!=t?ki.build(t):null!==(e=ki.API)&&void 0!==e?e:ki.API=ki.build()}static await(t){return new Promise((e=>{let o=ki.get(t);if(o)e(o);else{const i=Ci.subscribe((()=>{o=ki.get(t),o&&(i(),e(o))}))}}))}}class Ei{constructor(t=!0,o){var i;this.overrideApi=o;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new e.CacheRegistry,this.cache=t?r.commonCache:new e.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:ki.await()}clearCache(){this.cache.clearAll()}}var Ri;const Ui=Symbol("clearAfterUnitTest");class Li extends Ei{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ri]=()=>{this.defaultMessages={},this.cache=new e.CacheRegistry,this.listeners={}},this.currentUiLocale=Ci.getState().uiLocale,Ci.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=Ci.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,o){var i;if(t=t.toLowerCase(),Object.keys(o).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...o};e.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,o,...i){var r,n,a;t=t.toLowerCase(),this.fetchContext(t);const s=null!==(n=null===(r=this.cache.getNow(t))||void 0===r?void 0:r.messages)&&void 0!==n?n:{};return new e.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(o,...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 o;return t=t.toLowerCase(),this.listeners[t]=null!==(o=this.listeners[t])&&void 0!==o?o:new Set,this.listeners[t].add(e),()=>{var o;return null===(o=this.listeners[t])||void 0===o?void 0:o.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=>e.delay(0).then((()=>t())).catch((()=>null)))))}}Ri=Ui,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends Li{constructor(){super((async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e)))}});const Wi=window.FluidTopicsI18nService,zi=window.FluidTopicsCustomI18nService;var Di=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ti extends e.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>ki.get(),this.cache=new e.CacheRegistry,this.cleanSessionDebouncer=new e.Debouncer}render(){return o.html`
1310
1310
  <slot></slot>
1311
- `}update(t){super.update(t),t.has("baseUrl")&&(Ii.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ii.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ii.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ii.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ii.actions.noCustom(this.noCustom),t.has("editorMode")&&Ii.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ii.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ii.actions.session(this.session),t.has("availableUiLocales")&&Ii.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Li.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ii.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Di.elementDefinitions={},Di.styles=$i,zi([i.property()],Di.prototype,"baseUrl",void 0),zi([i.property()],Di.prototype,"apiIntegrationIdentifier",void 0),zi([i.property()],Di.prototype,"uiLocale",void 0),zi([e.jsonProperty(null)],Di.prototype,"availableUiLocales",void 0),zi([e.jsonProperty(null)],Di.prototype,"metadataConfiguration",void 0),zi([i.property({type:Boolean})],Di.prototype,"editorMode",void 0),zi([i.property({type:Boolean})],Di.prototype,"noCustom",void 0),zi([i.property({type:Boolean})],Di.prototype,"openExternalDocumentInNewTab",void 0),zi([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Di.prototype,"noCustomComponent",void 0),zi([i.property({type:Boolean})],Di.prototype,"withManualResources",void 0),zi([e.jsonProperty([])],Di.prototype,"messageContexts",void 0),zi([e.jsonProperty(void 0)],Di.prototype,"session",void 0),zi([i.property({type:Object})],Di.prototype,"apiProvider",void 0);class Ti extends ki{async listMySearches(){let t=Ii.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class Ai extends ki{async listMyBookmarks(){let t=Ii.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const _i=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Zi=new class{constructor(){this.currentSession=Ii.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Ai,this.savedSearchesService=new Ti,Ii.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Ii.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),_i.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),_i.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();_i.actions.savedSearches(t)}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;_i.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Di);var Fi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Bi=Symbol("i18nAttributes"),Ki=Symbol("i18nProperties"),Mi=Symbol("i18nUnsubs");function Pi(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?Wi:Li}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[Bi])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[Ki])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Bi])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[Ki])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Ki])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[Bi])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Mi].has(t)||this[Mi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Mi].forEach((t=>t())),this[Mi].clear()}}return e=Mi,Fi([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class Hi extends(Pi(e.FtLitElement)){}class ji extends(Pi(e.FtLitElementRedux)){}var Gi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Vi extends ji{constructor(){super(),this.editorMode=!1,this.addStore(Ii)}render(){return this.key&&this.context?o.html`
1311
+ `}update(t){super.update(t),t.has("baseUrl")&&(Ci.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&Ci.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&Ci.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&Ci.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&Ci.actions.noCustom(this.noCustom),t.has("editorMode")&&Ci.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&Ci.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&Ci.actions.session(this.session),t.has("availableUiLocales")&&Ci.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>Wi.addContext(t))),t.has("openExternalDocumentInNewTab")&&Ci.actions.openExternalDocumentInNewTab(this.openExternalDocumentInNewTab),setTimeout((()=>this.updateIfNeeded()))}async updateIfNeeded(){!this.withManualResources&&this.apiProvider()&&(null==this.session&&this.updateSession(),null==this.availableUiLocales&&this.updateUiLocales(),null==this.metadataConfiguration&&this.updateMetadataConfiguration())}async updateSession(){this.session=await this.cache.get("session",(async()=>{const t=await this.apiProvider().getCurrentSession();return t.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run((()=>{this.cache.clear("session"),this.session=void 0}),t.idleTimeoutInMillis),t}))}async updateUiLocales(){this.availableUiLocales=await this.cache.get("availableUiLocales",(()=>this.apiProvider().getAvailableUiLocales()))}async updateMetadataConfiguration(){this.metadataConfiguration=await this.cache.get("metadataConfiguration",(()=>this.apiProvider().getMetadataConfiguration()))}}Ti.elementDefinitions={},Ti.styles=Ii,Di([i.property()],Ti.prototype,"baseUrl",void 0),Di([i.property()],Ti.prototype,"apiIntegrationIdentifier",void 0),Di([i.property()],Ti.prototype,"uiLocale",void 0),Di([e.jsonProperty(null)],Ti.prototype,"availableUiLocales",void 0),Di([e.jsonProperty(null)],Ti.prototype,"metadataConfiguration",void 0),Di([i.property({type:Boolean})],Ti.prototype,"editorMode",void 0),Di([i.property({type:Boolean})],Ti.prototype,"noCustom",void 0),Di([i.property({type:Boolean})],Ti.prototype,"openExternalDocumentInNewTab",void 0),Di([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],Ti.prototype,"noCustomComponent",void 0),Di([i.property({type:Boolean})],Ti.prototype,"withManualResources",void 0),Di([e.jsonProperty([])],Ti.prototype,"messageContexts",void 0),Di([e.jsonProperty(void 0)],Ti.prototype,"session",void 0),Di([i.property({type:Object})],Ti.prototype,"apiProvider",void 0);class Ai extends Ei{async listMySearches(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class _i extends Ei{async listMyBookmarks(){let t=Ci.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const Zi=e.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const Fi=new class{constructor(){this.currentSession=Ci.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new _i,this.savedSearchesService=new Ai,Ci.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:o}=Ci.getState();e.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==o?void 0:o.profile)||(this.currentSession=o,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Zi.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Zi.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();Zi.actions.savedSearches(t)}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;Zi.actions.bookmarks(e)}}};e.customElement("ft-app-context")(Ti);var Bi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};const Ki=Symbol("i18nAttributes"),Mi=Symbol("i18nProperties"),Pi=Symbol("i18nUnsubs");function Hi(t){var e;class o extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map}get i18nService(){return this.useCustomMessageContexts?zi:Wi}i18n(t,e,...o){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,e,...o);const r=null!==(i=t.args)&&void 0!==i?i:t.argsProvider?t.argsProvider(this):[];return this.i18nService.resolveMessage(t.context,t.key,...r)}onI18nUpdate(t){var e,o;null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{var i;const r=this.getI18nAttributeValue(o);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(o,r,e)})),null===(o=this[Mi])||void 0===o||o.forEach(((e,o)=>{e.context.toLowerCase()===t.toLowerCase()&&(this[o]=this.i18n(e))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,e,o){this[t]={...e,message:this.i18n({context:e.context,key:e.key,...o})}}update(t){var e,o;super.update(t),null===(e=this[Ki])||void 0===e||e.forEach(((e,o)=>{const i=this.getI18nAttributeValue(o);(null==i?void 0:i.context)&&i.key&&(t.has(o)||null!=e.argsProvider)&&(t.has(o)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(o,i,e))})),null===(o=this[Mi])||void 0===o||o.forEach(((t,e)=>{null!=t.argsProvider&&(this[e]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,e,o,i;super.connectedCallback(),new Set([...null!==(e=null===(t=this[Mi])||void 0===t?void 0:t.values())&&void 0!==e?e:[],...[...null!==(i=null===(o=this[Ki])||void 0===o?void 0:o.keys())&&void 0!==i?i:[]].map((t=>this.getI18nAttributeValue(t)))].map((t=>null==t?void 0:t.context))).forEach((t=>t&&this.addI18nMessages(t)))}addI18nMessages(t,e){t=t.toLowerCase(),this[Pi].has(t)||this[Pi].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=e?e:{})}addI18nContext(t,e){this.addI18nMessages("string"==typeof t?t:t.name,e)}disconnectedCallback(){super.disconnectedCallback(),this[Pi].forEach((t=>t())),this[Pi].clear()}}return e=Pi,Bi([i.property({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}class ji extends(Hi(e.FtLitElement)){}class Gi extends(Hi(e.FtLitElementRedux)){}var Vi=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Yi extends Gi{constructor(){super(),this.editorMode=!1,this.addStore(Ci)}render(){return this.key&&this.context?o.html`
1312
1312
  <span class="ft-i18n">
1313
1313
  ${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
1314
1314
  </span>
1315
- `:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}Vi.elementDefinitions={},Vi.styles=Ni,Gi([e.redux()],Vi.prototype,"editorMode",void 0),Gi([i.property()],Vi.prototype,"context",void 0),Gi([i.property()],Vi.prototype,"key",void 0),Gi([e.jsonProperty([])],Vi.prototype,"args",void 0),Gi([i.property()],Vi.prototype,"defaultMessage",void 0);class Yi{static build(t){return new Yi(t)}static fromGwt(t){return new Yi(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Li.resolveMessage(this.name,e,...t)})}}const qi=(t,e)=>(o,i)=>{var r,n;o.constructor.createProperty(i,null!=e?e:{attribute:!1,type:String});const a={...t,key:null!==(r=t.key)&&void 0!==r?r:i};o[Ki]=null!==(n=o[Ki])&&void 0!==n?n:new Map,o[Ki].set(i,a)};e.customElement("ft-i18n")(Vi);const Xi=Yi.build("integratedFeedbackComponent"),Qi={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",moreOptionsButton:"More options",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"},Ji={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-field-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-field-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system"),prefixColor:e.FtCssVariableFactory.extend("--ft-text-field-prefix-color","",e.designSystemVariables.colorOnSurfaceMedium),iconColor:e.FtCssVariableFactory.extend("--ft-text-field-icon-color","",e.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:e.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),suggestSize:e.FtCssVariableFactory.create("--ft-text-field-suggest-size","","SIZE","300px")},tr=o.css`
1315
+ `:this.editorMode?"Select a context and a label key.":o.nothing}update(t){var e;super.update(t),["context","key","defaultMessage"].some((e=>t.has(e)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(e=this.defaultMessage)&&void 0!==e?e:""})}}Yi.elementDefinitions={},Yi.styles=$i,Vi([e.redux()],Yi.prototype,"editorMode",void 0),Vi([i.property()],Yi.prototype,"context",void 0),Vi([i.property()],Yi.prototype,"key",void 0),Vi([e.jsonProperty([])],Yi.prototype,"args",void 0),Vi([i.property()],Yi.prototype,"defaultMessage",void 0);class qi{static build(t){return new qi(t)}static fromGwt(t){return new qi(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,e)=>{const o=e;return t=>({context:this.name,key:o,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,e)=>(...t)=>Wi.resolveMessage(this.name,e,...t)})}}const Xi=(t,e)=>(o,i)=>{var r,n;o.constructor.createProperty(i,null!=e?e:{attribute:!1,type:String});const a={...t,key:null!==(r=t.key)&&void 0!==r?r:i};o[Mi]=null!==(n=o[Mi])&&void 0!==n?n:new Map,o[Mi].set(i,a)};e.customElement("ft-i18n")(Yi);const Qi=qi.build("integratedFeedbackComponent"),Ji={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",moreOptionsButton:"More options",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"},tr={fontSize:e.FtCssVariableFactory.create("--ft-text-field-font-size","","SIZE","14px"),labelSize:e.FtCssVariableFactory.create("--ft-text-field-label-size","","SIZE","11px"),verticalSpacing:e.FtCssVariableFactory.create("--ft-text-field-vertical-spacing","","SIZE","4px"),horizontalSpacing:e.FtCssVariableFactory.create("--ft-text-field-horizontal-spacing","","SIZE","16px"),helperColor:e.FtCssVariableFactory.extend("--ft-text-field-helper-color","",e.designSystemVariables.colorOnSurfaceMedium),colorPrimary:e.FtCssVariableFactory.external(e.designSystemVariables.colorPrimary,"Design system"),colorOnSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceDisabled:e.FtCssVariableFactory.external(e.designSystemVariables.colorOnSurfaceDisabled,"Design system"),borderRadiusS:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusS,"Design system"),colorError:e.FtCssVariableFactory.external(e.designSystemVariables.colorError,"Design system"),prefixColor:e.FtCssVariableFactory.extend("--ft-text-field-prefix-color","",e.designSystemVariables.colorOnSurfaceMedium),iconColor:e.FtCssVariableFactory.extend("--ft-text-field-icon-color","",e.designSystemVariables.colorOnSurfaceMedium),floatingZIndex:e.FtCssVariableFactory.create("--ft-text-field-floating-components-z-index","","NUMBER","3"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system"),colorOutline:e.FtCssVariableFactory.external(e.designSystemVariables.colorOutline,"Design system"),elevation02:e.FtCssVariableFactory.external(e.designSystemVariables.elevation02,"Design system"),suggestSize:e.FtCssVariableFactory.create("--ft-text-field-suggest-size","","SIZE","300px")},er=o.css`
1316
1316
  *:focus {
1317
1317
  outline: none;
1318
1318
  }
@@ -1325,16 +1325,16 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1325
1325
  }
1326
1326
 
1327
1327
  ft-input-label {
1328
- ${e.setVariable(li.fontSize,Ji.fontSize)};
1329
- ${e.setVariable(li.raisedFontSize,Ji.labelSize)};
1330
- ${e.setVariable(li.verticalSpacing,Ji.verticalSpacing)};
1331
- ${e.setVariable(li.horizontalSpacing,Ji.horizontalSpacing)};
1328
+ ${e.setVariable(ci.fontSize,tr.fontSize)};
1329
+ ${e.setVariable(ci.raisedFontSize,tr.labelSize)};
1330
+ ${e.setVariable(ci.verticalSpacing,tr.verticalSpacing)};
1331
+ ${e.setVariable(ci.horizontalSpacing,tr.horizontalSpacing)};
1332
1332
  }
1333
1333
 
1334
1334
  .ft-text-field--main-panel {
1335
1335
  position: relative;
1336
1336
  display: flex;
1337
- height: calc(4 * ${Ji.verticalSpacing} + ${Ji.labelSize} + ${Ji.fontSize});
1337
+ height: calc(4 * ${tr.verticalSpacing} + ${tr.labelSize} + ${tr.fontSize});
1338
1338
  }
1339
1339
 
1340
1340
  .ft-text-field--input-panel {
@@ -1343,10 +1343,10 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1343
1343
  display: flex;
1344
1344
  align-items: center;
1345
1345
  overflow: hidden;
1346
- padding: 0 ${Ji.horizontalSpacing};
1346
+ padding: 0 ${tr.horizontalSpacing};
1347
1347
 
1348
- ${e.setVariable(P.fontSize,Ji.fontSize)};
1349
- ${e.setVariable(P.lineHeight,Ji.fontSize)};
1348
+ ${e.setVariable(P.fontSize,tr.fontSize)};
1349
+ ${e.setVariable(P.lineHeight,tr.fontSize)};
1350
1350
  }
1351
1351
 
1352
1352
  .ft-text-field--input-panel ft-ripple {
@@ -1356,11 +1356,11 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1356
1356
 
1357
1357
  .ft-text-field--filled.ft-text-field--with-label .ft-text-field--input-panel {
1358
1358
  align-items: flex-end;
1359
- padding: 0 ${Ji.horizontalSpacing} ${Ji.verticalSpacing} ${Ji.horizontalSpacing};
1359
+ padding: 0 ${tr.horizontalSpacing} ${tr.verticalSpacing} ${tr.horizontalSpacing};
1360
1360
  }
1361
1361
 
1362
1362
  .ft-text-field--prefix {
1363
- color: ${Ji.prefixColor};
1363
+ color: ${tr.prefixColor};
1364
1364
  margin-right: 2px;
1365
1365
  flex-shrink: 1;
1366
1366
  overflow: hidden;
@@ -1379,15 +1379,15 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1379
1379
  flex-shrink: 1;
1380
1380
  min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
1381
1381
 
1382
- color: ${Ji.colorOnSurface};
1383
- padding: calc(2 * ${Ji.verticalSpacing}) 0;
1382
+ color: ${tr.colorOnSurface};
1383
+ padding: calc(2 * ${tr.verticalSpacing}) 0;
1384
1384
  border: none;
1385
1385
  background: none;
1386
1386
  }
1387
1387
 
1388
1388
  .ft-text-field--filled.ft-text-field--with-label .ft-text-field--input {
1389
1389
  padding-bottom: 0;
1390
- padding-top: calc(${Ji.labelSize} + 2 * ${Ji.verticalSpacing});
1390
+ padding-top: calc(${tr.labelSize} + 2 * ${tr.verticalSpacing});
1391
1391
  }
1392
1392
 
1393
1393
  .ft-text-field--input::-webkit-calendar-picker-indicator,
@@ -1396,37 +1396,37 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1396
1396
  }
1397
1397
 
1398
1398
  .ft-text-field--disabled .ft-text-field--input {
1399
- color: ${Ji.colorOnSurfaceDisabled};
1399
+ color: ${tr.colorOnSurfaceDisabled};
1400
1400
  }
1401
1401
 
1402
1402
  .ft-text-field:not(.ft-text-field--disabled):focus-within ft-input-label {
1403
- ${e.setVariable(li.borderColor,Ji.colorPrimary)};
1404
- ${e.setVariable(li.textColor,Ji.colorPrimary)};
1403
+ ${e.setVariable(ci.borderColor,tr.colorPrimary)};
1404
+ ${e.setVariable(ci.textColor,tr.colorPrimary)};
1405
1405
  }
1406
1406
 
1407
1407
  .ft-text-field--filled .ft-text-field--input-panel {
1408
- border-radius: ${Ji.borderRadiusS} ${Ji.borderRadiusS} 0 0;
1408
+ border-radius: ${tr.borderRadiusS} ${tr.borderRadiusS} 0 0;
1409
1409
  }
1410
1410
 
1411
1411
  .ft-text-field--outlined .ft-text-field--input-panel {
1412
- border-radius: ${Ji.borderRadiusS};
1412
+ border-radius: ${tr.borderRadiusS};
1413
1413
  }
1414
1414
 
1415
1415
  .ft-text-field--helper-text {
1416
- padding: 0 12px 0 ${Ji.horizontalSpacing};
1417
- color: ${Ji.helperColor};
1416
+ padding: 0 12px 0 ${tr.horizontalSpacing};
1417
+ color: ${tr.helperColor};
1418
1418
  }
1419
1419
 
1420
1420
  .ft-text-field--in-error .ft-text-field--input,
1421
1421
  .ft-text-field--in-error .ft-text-field--helper-text,
1422
1422
  .ft-text-field--in-error .ft-text-field--prefix {
1423
- color: ${Ji.colorError};
1423
+ color: ${tr.colorError};
1424
1424
  }
1425
1425
 
1426
1426
  .ft-text-field--icon {
1427
1427
  align-self: center;
1428
1428
  margin-left: 8px;
1429
- color: ${Ji.iconColor};
1429
+ color: ${tr.iconColor};
1430
1430
  }
1431
1431
 
1432
1432
  .ft-text-field--container {
@@ -1437,24 +1437,18 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1437
1437
  display: none;
1438
1438
  flex-direction: column;
1439
1439
  position: absolute;
1440
- left: 0;
1441
- right: 0;
1442
- z-index: ${Ji.floatingZIndex};
1443
- background: ${Ji.colorSurface};
1444
- border: 1px solid ${Ji.colorOutline};
1445
- border-radius: 0 0 ${Ji.borderRadiusS} ${Ji.borderRadiusS};
1446
- box-shadow: ${Ji.elevation02};
1440
+ z-index: ${tr.floatingZIndex};
1441
+ background: ${tr.colorSurface};
1442
+ border: 1px solid ${tr.colorOutline};
1443
+ border-radius: 0 0 ${tr.borderRadiusS} ${tr.borderRadiusS};
1444
+ box-shadow: ${tr.elevation02};
1447
1445
  outline: none;
1448
- max-height: ${Ji.suggestSize};
1446
+ max-height: ${tr.suggestSize};
1449
1447
  overflow-y: auto;
1450
1448
  }
1451
1449
 
1452
- .ft-text-field--suggestions:not(.ft-text-field--suggestions-on-top) {
1453
- top: 100%;
1454
- }
1455
-
1456
- .ft-text-field--suggestions.ft-text-field--suggestions-on-top {
1457
- bottom: 100%;
1450
+ .ft-text-field--fixed .ft-text-field--suggestions {
1451
+ position: fixed;
1458
1452
  }
1459
1453
 
1460
1454
  .ft-text-field:not(.ft-text-field--hide-suggestions):focus-within .ft-text-field--suggestions {
@@ -1462,13 +1456,13 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1462
1456
  }
1463
1457
 
1464
1458
  .ft-text-field--with-icon {
1465
- ${e.setVariable(li.labelMaxWidth,`calc(100% - ${$t.size} - ${li.horizontalSpacing})`)};
1459
+ ${e.setVariable(ci.labelMaxWidth,`calc(100% - ${$t.size} - ${ci.horizontalSpacing})`)};
1466
1460
  }
1467
1461
 
1468
1462
  .ft-text-field--with-password ft-icon:hover {
1469
1463
  cursor: pointer;
1470
1464
  }
1471
- `;var er=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class or extends(e.toFtFormComponent(e.FtLitElement,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.prefix=null,this.passwordHiddenIcon=Fo.EYE_SLASH,this.passwordRevealedIcon=Fo.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 o.html`
1465
+ `;var or=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ir extends(e.toFtFormComponent(e.FtLitElement,"textbox")){constructor(){super(...arguments),this._value="",this.dispatchedValue="",this.outlined=!1,this.disabled=!1,this.error=!1,this.fixedMenuPosition=!1,this.prefix=null,this.passwordHiddenIcon=Bo.EYE_SLASH,this.passwordRevealedIcon=Bo.EYE,this.filterSuggestions=!1,this.password=!1,this.focused=!1,this.hidePassword=!0,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--fixed":this.fixedMenuPosition,"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 o.html`
1472
1466
  <div class="${r.classMap(t)}">
1473
1467
  <div class="ft-text-field--main-panel"
1474
1468
  @keydown=${this.handleKeyboardNavigation}
@@ -1499,7 +1493,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1499
1493
  @focus=${this.onFocus}/>
1500
1494
  ${this.renderIcon()}
1501
1495
  </div>
1502
- <div class="ft-text-field--suggestions ${this.suggestionsOnTop?"ft-text-field--suggestions-on-top":""}"
1496
+ <div class="ft-text-field--suggestions"
1503
1497
  @suggestion-selected=${this.onSuggestionSelected}>
1504
1498
  <slot @slotchange=${()=>this.filterSuggestionsIfNeeded()}></slot>
1505
1499
  </div>
@@ -1520,7 +1514,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1520
1514
  .variant=${this.iconVariant}
1521
1515
  .value=${this.icon}
1522
1516
  @click=${()=>{var t;return null===(t=this.input)||void 0===t?void 0:t.focus()}}></ft-icon>
1523
- `:o.nothing}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,o;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(),i=null===(o=this.suggestionsContainer)||void 0===o?void 0:o.getBoundingClientRect();t&&i&&(this.suggestionsOnTop=t.bottom+i.height>window.innerHeight&&t.top-i.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 o=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(o,"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 o=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let i;i="ArrowDown"===t.key?o<this.visibleSuggestions.length-1?o+1:0:o>0?o-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[i])||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}}or.elementDefinitions={"ft-input-label":fi,"ft-ripple":Re,"ft-typography":ke,"ft-icon":jo},or.styles=[gt,tr],er([i.property()],or.prototype,"label",void 0),er([i.property({noAccessor:!0})],or.prototype,"value",null),er([i.state()],or.prototype,"dispatchedValue",void 0),er([i.property()],or.prototype,"helper",void 0),er([i.property({type:Boolean})],or.prototype,"outlined",void 0),er([i.property({type:Boolean})],or.prototype,"disabled",void 0),er([i.property({type:Boolean})],or.prototype,"error",void 0),er([i.property()],or.prototype,"prefix",void 0),er([i.property()],or.prototype,"icon",void 0),er([i.property()],or.prototype,"passwordHiddenIcon",void 0),er([i.property()],or.prototype,"passwordRevealedIcon",void 0),er([i.property()],or.prototype,"iconVariant",void 0),er([i.property({type:Boolean})],or.prototype,"filterSuggestions",void 0),er([i.property({type:Number})],or.prototype,"maxLength",void 0),er([i.property({type:Boolean})],or.prototype,"password",void 0),er([i.state()],or.prototype,"focused",void 0),er([i.state()],or.prototype,"hidePassword",void 0),er([i.state()],or.prototype,"suggestionsOnTop",void 0),er([i.state()],or.prototype,"hideSuggestions",void 0),er([i.state()],or.prototype,"visibleSuggestions",void 0),er([i.query(".ft-text-field--main-panel")],or.prototype,"mainPanel",void 0),er([i.query(".ft-text-field--input")],or.prototype,"input",void 0),er([i.query(".ft-text-field--suggestions")],or.prototype,"suggestionsContainer",void 0),er([i.queryAssignedElements({selector:"ft-text-field-suggestion"})],or.prototype,"suggestions",void 0);const ir=o.css`
1517
+ `:o.nothing}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){super.contentAvailableCallback(t),t.has("focused")&&!this.hideSuggestions&&this.visibleSuggestions.length>0&&(this.suggestionsContainer.style.width=this.mainPanel.getBoundingClientRect().width+"px",Fo(this.mainPanel,this.suggestionsContainer,"bottom").then((({x:t,y:e})=>{this.suggestionsContainer.style.left=`${t}px`,this.suggestionsContainer.style.top=`${e}px`})))}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 o=(null===(e=this.input)||void 0===e?void 0:e.value)||"";this.setValue(o,"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 o=this.visibleSuggestions.findIndex((t=>t.matches(":focus-within")));let i;i="ArrowDown"===t.key?o<this.visibleSuggestions.length-1?o+1:0:o>0?o-1:this.visibleSuggestions.length-1,null===(e=this.visibleSuggestions[i])||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}}ir.elementDefinitions={"ft-input-label":pi,"ft-ripple":Re,"ft-typography":ke,"ft-icon":Go},ir.styles=[gt,er],or([i.property()],ir.prototype,"label",void 0),or([i.property({noAccessor:!0})],ir.prototype,"value",null),or([i.state()],ir.prototype,"dispatchedValue",void 0),or([i.property()],ir.prototype,"helper",void 0),or([i.property({type:Boolean})],ir.prototype,"outlined",void 0),or([i.property({type:Boolean})],ir.prototype,"disabled",void 0),or([i.property({type:Boolean})],ir.prototype,"error",void 0),or([i.property({type:Boolean})],ir.prototype,"fixedMenuPosition",void 0),or([i.property()],ir.prototype,"prefix",void 0),or([i.property()],ir.prototype,"icon",void 0),or([i.property()],ir.prototype,"passwordHiddenIcon",void 0),or([i.property()],ir.prototype,"passwordRevealedIcon",void 0),or([i.property()],ir.prototype,"iconVariant",void 0),or([i.property({type:Boolean})],ir.prototype,"filterSuggestions",void 0),or([i.property({type:Number})],ir.prototype,"maxLength",void 0),or([i.property({type:Boolean})],ir.prototype,"password",void 0),or([i.state()],ir.prototype,"focused",void 0),or([i.state()],ir.prototype,"hidePassword",void 0),or([i.state()],ir.prototype,"hideSuggestions",void 0),or([i.state()],ir.prototype,"visibleSuggestions",void 0),or([i.query(".ft-text-field--main-panel")],ir.prototype,"mainPanel",void 0),or([i.query(".ft-text-field--input")],ir.prototype,"input",void 0),or([i.query(".ft-text-field--suggestions")],ir.prototype,"suggestionsContainer",void 0),or([i.queryAssignedElements({selector:"ft-text-field-suggestion"})],ir.prototype,"suggestions",void 0);const rr=o.css`
1524
1518
  .ft-text-field-suggestion {
1525
1519
  position: relative;
1526
1520
  padding: 8px 16px;
@@ -1545,7 +1539,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1545
1539
  slot {
1546
1540
  pointer-events: none;
1547
1541
  }
1548
- `;var rr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class nr extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class ar extends e.FtLitElement{render(){return o.html`
1542
+ `;var nr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class ar extends CustomEvent{constructor(t){super("suggestion-selected",{detail:t,bubbles:!0,composed:!0})}}class sr extends e.FtLitElement{render(){return o.html`
1549
1543
  <div class="ft-text-field-suggestion"
1550
1544
  tabindex="-1"
1551
1545
  @keydown=${this.onKeyDown}
@@ -1557,15 +1551,15 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1557
1551
  <slot></slot>
1558
1552
  </ft-typography>
1559
1553
  </div>
1560
- `}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 nr(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())}}ar.elementDefinitions={"ft-ripple":Re,"ft-typography":ke,"ft-icon":jo},ar.styles=ir,rr([i.property()],ar.prototype,"value",void 0),rr([i.query(".ft-text-field-suggestion")],ar.prototype,"container",void 0),rr([i.queryAssignedNodes()],ar.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(or),e.customElement("ft-text-field-suggestion")(ar);class sr{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,o){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,o)),null==t.tocId?this.extractPagesToc(t.children,e,o):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,o){return t.flatMap((t=>{var i,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],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:o,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,o){return t.flatMap((t=>{var i;let r=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:o,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var o,i,r,n,a,s;const l={number:this.pages.length+1,title:null!==(o=t.title)&&void 0!==o?o:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class lr{convertPaginatedToc(t){return new sr(t).build()}}var cr,dr,fr,pr,hr,ur,gr,br,yr,mr,vr,xr,wr,Or,Sr,Nr,$r,Ir;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function f(t){var e=new FileReader,o=d(e);return e.readAsArrayBuffer(t),o}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,o,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,o=d(e),e.readAsText(t),o;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),i=0;i<e.length;i++)o[i]=String.fromCharCode(e[i]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var o,i,r=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",i=o.toUpperCase(),u.indexOf(i)>-1?i:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),i=o.shift().replace(/\+/g," "),r=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function y(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},h.call(g.prototype),h.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];y.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),i=o.shift().trim();if(i){var r=o.join(":").trim();e.append(i,r)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new y(i,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=g,t.Response=y),e.Headers=l,e.Request=g,e.Response=y,e.fetch=v,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(cr||(cr={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(dr||(dr={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(fr||(fr={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(pr||(pr={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(hr||(hr={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(ur||(ur={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(gr||(gr={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(br||(br={})),function(t){t.ASC="ASC",t.DESC="DESC"}(yr||(yr={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(mr||(mr={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(vr||(vr={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(xr||(xr={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(wr||(wr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Or||(Or={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Sr||(Sr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(Nr||(Nr={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}($r||($r={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(Ir||(Ir={}));const Cr={[$r.PERSONAL_BOOK_SHARE_USER]:[$r.PERSONAL_BOOK_USER],[$r.HTML_EXPORT_USER]:[$r.PERSONAL_BOOK_USER],[$r.PDF_EXPORT_USER]:[$r.PERSONAL_BOOK_USER],[$r.KHUB_ADMIN]:[$r.CONTENT_PUBLISHER],[$r.ADMIN]:[$r.KHUB_ADMIN,$r.USERS_ADMIN,$r.PORTAL_ADMIN],[$r.DEVELOPER]:[$r.BETA_USER,$r.DEBUG_USER]};function kr(t,e){return t===e||(Cr[t]??[]).some((t=>kr(t,e)))}function Er(t,e){if(null==t)return!1;return(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some((t=>kr(t,e)))}class Rr extends ki{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,o){super(!1,e),this.converter=t,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 Er(null!==(e=null===(t=Ii.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)))}getAttachments(){return this.cache.get("map-attachments",(()=>this.fetchAttachments()))}getRelativesForDocument(t,e){return this.cache.get("document-relatives-"+t+"-"+e.join("-"),(()=>this.fetchRelativesForDocument(t,e)))}getRelativesForTopicInMap(t,e,o){return this.cache.get("topic-relatives-"+[t,e,...o].join("-"),(()=>this.fetchRelativesForTopicInMap(t,e,o)))}getAttachmentDownloadLink(t){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(t).content}?download=true`)}getLink(t,e,o){const i=this.getNavigationData(t,e,o),r=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=i.page&&n.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&n.searchParams.set("tocId",i.tocId),null!=i.section&&n.searchParams.set("section",i.section),n.href}getNavigationData(t,e,o){var i,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!==(i=null==s?void 0:s.title)&&void 0!==i?i:"",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:o}}async getAccurateNavigationData(t,e,o){return await this.getEnrichedToc(),this.getNavigationData(t,e,o)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var o;return e?{type:e.topics.type,rating:null===(o=e.topics)||void 0===o?void 0:o.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,o){return this.makeRateTopicRequest(t,e,o).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Ii.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,o){return this.makeTopicFeedbackRequest(t,e,o)}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),o=[{tocId:e.tocId,title:e.title}],i=this.getTocNodeNow(e.parentTocId);for(;i;)o.unshift({tocId:i.tocId,title:i.title}),i=this.getTocNodeNow(i.parentTocId);return o}isFeatureAccessible(t,{session:e,ratingType:o}){if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return Er(null!=e?e:[],$r.FEEDBACK_USER);case s.RATING:return Er(null!=e?e:[],$r.RATING_USER)&&null!=o&&o!==gr.NO_RATING;case s.PRINT:return Er(null!=e?e:[],$r.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return Er(null!=e?e:[],$r.COLLECTION_USER);case s.PERSONAL_BOOKS:return Er(null!=e?e:[],$r.PERSONAL_BOOK_USER);default:return!1}}makeAbsolute(t){return this.api.makeAbsolute(t)}}class Ur extends Rr{static async build(t){return new Ur(new lr,void 0,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)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch((()=>[]))}fetchRelativesForDocument(t,e){return this.api.search({query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",filters:[{negative:!1,values:e,key:t}],sort:[],facets:[]})}fetchRelativesForTopicInMap(t,e,o){return this.api.search({query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",filters:[{negative:!1,values:o,key:e},{negative:!1,values:[t],key:"ft:publicationId"}],sort:[],facets:[]})}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,o){return this.api.rateTopic(this.mapId,t,e,o)}makeTopicFeedbackRequest(t,e,o){return this.api.sendTopicFeedback(this.mapId,t,e,o)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Lr{static build(t,o){return new Lr((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0}}))(t.trim()||"context"),null!=o?o:Ur.build)}constructor(t,o){this.store=t,this.metadataForSwitchToRelatives=new Set,this.loadDebouncer=new e.Debouncer(10),this.initService(o)}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(){return e.waitFor((()=>this.service))}async navigateToTopic(t,e,o){const i=await this.awaitService(),r=await(null!=o?i.getPage(o):i.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 o,i,r;let n=null!==(o="root"===t?void 0:t)&&void 0!==o?o:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(i=e.topics[0])&&void 0!==i?i:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let o=await e.getPage(t);this.store.actions.currentPage(o)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var t;(null===(t=this.service)||void 0===t?void 0:t.mapId)&&null==this.store.getState().map&&await this.loadDebouncer.run((()=>this.fetchData()))}clear(){var t;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(""),this.store.actions.relatives(void 0),null===(t=this.service)||void 0===t||t.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(){var t,o,i,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===(o=this.service)||void 0===o?void 0:o.getMap().then((t=>this.store.actions.map(t))),null===(i=this.service)||void 0===i?void 0:i.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)))]).then((()=>{this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives()}))}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}fetchRelatives(){var t,e,o;const i=null===(t=this.store.getState().map)||void 0===t?void 0:t.metadata.filter((t=>{var e;return t.key==(null===(e=this.store.getState().configuration)||void 0===e?void 0:e.relativePivotMetadata)})).flatMap((t=>t.values));void 0!==i&&i.length>0&&(null===(e=this.service)||void 0===e||e.getRelativesForDocument(null===(o=this.store.getState().configuration)||void 0===o?void 0:o.relativePivotMetadata,i).then((t=>{const e=t.results.flatMap((t=>t.entries));this.store.actions.relatives(e),this.createClusteringHelper()})))}createClusteringHelper(){var t,o;this.store.getState().relatives&&(this.clusteringHelper=new e.ClusteringHelper(this.store.getState().relatives,this.store.getState().relatives.find((t=>{var e;return(null===(e=t.map)||void 0===e?void 0:e.mapId)==this.store.getState().mapId})),this.metadataForSwitchToRelatives,null!==(o=null===(t=Ii.getState().metadataConfiguration)||void 0===t?void 0:t.descriptors)&&void 0!==o?o:[]),this.store.eventBus.dispatchEvent(new CustomEvent("clustering-helper-created")))}async navigateToRelativeTopicIfFound(t){var o,i,r;const n=await e.waitFor((()=>{var t;return null===(t=this.store.getState().configuration)||void 0===t?void 0:t.relativeTopicPivotMetadata})),a=this.store.getState().mapId,s=await this.awaitService(),l=await s.getRelativesForTopicInMap(a,n,[t]);if(null===(r=null===(i=null===(o=null==l?void 0:l.results)||void 0===o?void 0:o[0])||void 0===i?void 0:i.entries)||void 0===r?void 0:r[0]){const t=l.results[0].entries[0].topic.tocId;return await this.navigateToTopic(t),!0}return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}registerMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.add(t),null==this.store.getState().relatives?this.fetchRelatives():this.createClusteringHelper()}unregisterMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.delete(t),this.createClusteringHelper()}}const Wr=o.css`
1561
- `;class zr extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Dr extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Tr extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class Ar extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class _r extends Event{constructor(){super("ft-reader-map-not-found")}}class Zr extends Event{constructor(){super("ft-reader-map-unauthorized")}}class Fr extends Event{constructor(){super("ft-reader-map-forbidden")}}class Br extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}}var Kr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Mr extends e.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new e.Debouncer(5),this.navigationDebouncer=new e.Debouncer(10),this.mapLoadedEventDebouncer=new e.Debouncer(50),this.addStore(Ii)}render(){return o.html`
1554
+ `}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 ar(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())}}sr.elementDefinitions={"ft-ripple":Re,"ft-typography":ke,"ft-icon":Go},sr.styles=rr,nr([i.property()],sr.prototype,"value",void 0),nr([i.query(".ft-text-field-suggestion")],sr.prototype,"container",void 0),nr([i.queryAssignedNodes()],sr.prototype,"assignedNodes",void 0),e.customElement("ft-text-field")(ir),e.customElement("ft-text-field-suggestion")(sr);class lr{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,o){return t.flatMap((t=>(t.pageConfiguration&&this.registerPage(this.buildPage(t,o)),null==t.tocId?this.extractPagesToc(t.children,e,o):[{tocId:t.tocId,title:t.title,depth:e,children:this.extractPagesToc(t.children,e+1,t.tocId)}])))}convertNodes(t,e,o){return t.flatMap((t=>{var i,r,n;if(null==t.tocId)return[...this.convertSectionNodes(null!==(i=t.pageToc)&&void 0!==i?i:[],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:o,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,o){return t.flatMap((t=>{var i;let r=null===(i=t.prettyUrl)||void 0===i?void 0:i.replace(/^\//,"");const n={...t,prettyUrl:r,depth:e,parentTocId:o,children:[]};return this.register(n),n.children=this.convertSectionNodes(t.children,e+1,t.tocId),[n]}))}buildPage(t,e){var o,i,r,n,a,s;const l={number:this.pages.length+1,title:null!==(o=t.title)&&void 0!==o?o:"",rootTocId:null!==(i=t.tocId)&&void 0!==i?i:"root",toc:(null!==(r=t.pageToc)&&void 0!==r?r:[]).map((t=>this.nodeByTocId[t.tocId])),topics:[],hiddenTopics:[],breadcrumb:e?this.buildBreadcrumb(this.nodeByTocId[e]):[]},c=(t,e)=>(e?l.topics:l.hiddenTopics).push(t),d=null!==(a=null===(n=t.pageConfiguration)||void 0===n?void 0:n.parentsVisibility)&&void 0!==a?a:[];return l.breadcrumb.forEach(((t,e)=>{c(t,d[e])})),t.tocId&&c(t.tocId,t.pageConfiguration.isVisible),l.topics.push(...this.tocIds(null!==(s=t.pageToc)&&void 0!==s?s:[])),l}registerPage(t){for(let e of[...t.topics,...t.hiddenTopics])this.pageByTocId[e]||(this.pageByTocId[e]=t);this.pages.push(t)}tocIds(t){return t.flatMap((t=>[t.tocId,...this.tocIds(t.children)]))}buildBreadcrumb(t){const e=[t.tocId];for(;null==t?void 0:t.parentTocId;)e.unshift(t.parentTocId),t=this.nodeByTocId[t.parentTocId];return e}register(t){t.prettyUrl&&(this.knownPrettyUrls.has(t.prettyUrl)&&this.duplicatedPrettyUrls.add(t.prettyUrl),this.knownPrettyUrls.add(t.prettyUrl)),this.nodeByTocId[t.tocId]=t}}class cr{convertPaginatedToc(t){return new lr(t).build()}}var dr,fr,pr,hr,ur,gr,br,yr,mr,vr,xr,wr,Or,Sr,Nr,$r,Ir,Cr;!function(t){!function(e){var o={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(o.arrayBuffer)var i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],r=ArrayBuffer.isView||function(t){return t&&i.indexOf(Object.prototype.toString.call(t))>-1};function n(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return o.iterable&&(e[Symbol.iterator]=function(){return e}),e}function l(t){this.map={},t instanceof l?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,o){t.onload=function(){e(t.result)},t.onerror=function(){o(t.error)}}))}function f(t){var e=new FileReader,o=d(e);return e.readAsArrayBuffer(t),o}function p(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function h(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:o.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():o.arrayBuffer&&o.blob&&((e=t)&&DataView.prototype.isPrototypeOf(e))?(this._bodyArrayBuffer=p(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):o.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=p(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},o.blob&&(this.blob=function(){var t=c(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(f)}),this.text=function(){var t,e,o,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,o=d(e),e.readAsText(t),o;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),o=new Array(e.length),i=0;i<e.length;i++)o[i]=String.fromCharCode(e[i]);return o.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o.formData&&(this.formData=function(){return this.text().then(b)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,e){t=n(t),e=a(e);var o=this.map[t];this.map[t]=o?o+", "+e:e},l.prototype.delete=function(t){delete this.map[n(t)]},l.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},l.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},l.prototype.set=function(t,e){this.map[n(t)]=a(e)},l.prototype.forEach=function(t,e){for(var o in this.map)this.map.hasOwnProperty(o)&&t.call(e,this.map[o],o,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(e,o){t.push(o)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(e,o){t.push([o,e])})),s(t)},o.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function g(t,e){var o,i,r=(e=e||{}).body;if(t instanceof g){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new l(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,r||null==t._bodyInit||(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new l(e.headers)),this.method=(o=e.method||this.method||"GET",i=o.toUpperCase(),u.indexOf(i)>-1?i:o),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function b(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var o=t.split("="),i=o.shift().replace(/\+/g," "),r=o.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(r))}})),e}function y(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new l(e.headers),this.url=e.url||"",this._initBody(t)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},h.call(g.prototype),h.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var t=new y(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];y.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new y(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var o=Error(t);this.stack=o.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(t,i){return new Promise((function(r,n){var a=new g(t,i);if(a.signal&&a.signal.aborted)return n(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,o={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var o=t.split(":"),i=o.shift().trim();if(i){var r=o.join(":").trim();e.append(i,r)}})),e)};o.url="responseURL"in s?s.responseURL:o.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new y(i,o))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&o.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}v.polyfill=!0,t.fetch||(t.fetch=v,t.Headers=l,t.Request=g,t.Response=y),e.Headers=l,e.Request=g,e.Response=y,e.fetch=v,Object.defineProperty(e,"t",{value:!0})}({})}("undefined"!=typeof self?self:void 0),function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"}(dr||(dr={})),function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"}(fr||(fr={})),function(t){t.THIRD_PARTY="THIRD_PARTY",t.OFF_THE_GRID="OFF_THE_GRID",t.CONTENT_PACKAGER="CONTENT_PACKAGER",t.PAGES="PAGES",t.DESIGNED_READER="DESIGNED_READER"}(pr||(pr={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(hr||(hr={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(ur||(ur={})),function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"}(gr||(gr={})),function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"}(br||(br={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(yr||(yr={})),function(t){t.ASC="ASC",t.DESC="DESC"}(mr||(mr={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(vr||(vr={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(xr||(xr={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(wr||(wr={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Or||(Or={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Sr||(Sr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Nr||(Nr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}($r||($r={})),function(t){t.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",t.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",t.HTML_EXPORT_USER="HTML_EXPORT_USER",t.PDF_EXPORT_USER="PDF_EXPORT_USER",t.SAVED_SEARCH_USER="SAVED_SEARCH_USER",t.COLLECTION_USER="COLLECTION_USER",t.OFFLINE_USER="OFFLINE_USER",t.ANALYTICS_USER="ANALYTICS_USER",t.BETA_USER="BETA_USER",t.DEBUG_USER="DEBUG_USER",t.PRINT_USER="PRINT_USER",t.RATING_USER="RATING_USER",t.FEEDBACK_USER="FEEDBACK_USER",t.GENERATIVE_AI_USER="GENERATIVE_AI_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN",t.DEVELOPER="DEVELOPER"}(Ir||(Ir={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(Cr||(Cr={}));const kr={[Ir.PERSONAL_BOOK_SHARE_USER]:[Ir.PERSONAL_BOOK_USER],[Ir.HTML_EXPORT_USER]:[Ir.PERSONAL_BOOK_USER],[Ir.PDF_EXPORT_USER]:[Ir.PERSONAL_BOOK_USER],[Ir.KHUB_ADMIN]:[Ir.CONTENT_PUBLISHER],[Ir.ADMIN]:[Ir.KHUB_ADMIN,Ir.USERS_ADMIN,Ir.PORTAL_ADMIN],[Ir.DEVELOPER]:[Ir.BETA_USER,Ir.DEBUG_USER]};function Er(t,e){return t===e||(kr[t]??[]).some((t=>Er(t,e)))}function Rr(t,e){if(null==t)return!1;return(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some((t=>Er(t,e)))}class Ur extends Ei{get mapId(){return this._mapId}set mapId(t){t!==this._mapId&&this.clear(),this._mapId=t}constructor(t,e,o){super(!1,e),this.converter=t,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 Rr(null!==(e=null===(t=Ci.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")}getMapNow(){return this.cache.getNow("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)))}getAttachments(){return this.cache.get("map-attachments",(()=>this.fetchAttachments()))}getRelativesForDocument(t,e){return this.cache.get("document-relatives-"+t+"-"+e.join("-"),(()=>this.fetchRelativesForDocument(t,e)))}getRelativesForTopicInMap(t,e,o){return this.cache.get("topic-relatives-"+[t,e,...o].join("-"),(()=>this.fetchRelativesForTopicInMap(t,e,o)))}getAttachmentDownloadLink(t){return this.makeAbsolute(`${this.api.endpoints.khub.maps.mapId(this.mapId).attachments.attachmentId(t).content}?download=true`)}getLink(t,e,o){const i=this.getNavigationData(t,e,o),r=this.getReaderLinkPrefix()+(i.prettyUrl?i.prettyUrl:`${i.mapId}/${i.tocId}`),n=new URL(r,this.api.tenantBaseUrl);return null!=i.page&&n.searchParams.set("page",`${i.page}`),i.prettyUrlDuplicated&&n.searchParams.set("tocId",i.tocId),null!=i.section&&n.searchParams.set("section",i.section),n.href}getNavigationData(t,e,o){var i,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!==(i=null==s?void 0:s.title)&&void 0!==i?i:"",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:o}}async getAccurateNavigationData(t,e,o){return await this.getEnrichedToc(),this.getNavigationData(t,e,o)}getRatingSummary(){return this.cache.get("ratingSummary")}reloadRating(){return this.cache.clear("ratingSummary"),this.getRatingSummary()}getMapRating(){return this.getRatingSummary().then((t=>null==t?void 0:t.publication))}getTopicRating(t){return this.getRatingSummary().then((e=>{var o;return e?{type:e.topics.type,rating:null===(o=e.topics)||void 0===o?void 0:o.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,o){return this.makeRateTopicRequest(t,e,o).then((()=>this.clearRatingIfNecessary()))}unrateTopic(t){return this.makeUnrateTopicRequest(t).then((()=>this.clearRatingIfNecessary()))}async clearRatingIfNecessary(){const t=Ci.getState().session;(null==t?void 0:t.sessionAuthenticated)&&this.cache.clear("ratingSummary")}sendTopicFeedback(t,e,o){return this.makeTopicFeedbackRequest(t,e,o)}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),o=[{tocId:e.tocId,title:e.title}],i=this.getTocNodeNow(e.parentTocId);for(;i;)o.unshift({tocId:i.tocId,title:i.title}),i=this.getTocNodeNow(i.parentTocId);return o}isFeatureAccessible(t,{session:e,ratingType:o}){var i;if(!this.isFeatureAvailable(t))return!1;switch(t){case s.FEEDBACK:return Rr(null!=e?e:[],Ir.FEEDBACK_USER);case s.RATING:return Rr(null!=e?e:[],Ir.RATING_USER)&&null!=o&&o!==br.NO_RATING;case s.PRINT:return Rr(null!=e?e:[],Ir.PRINT_USER);case s.BOOKMARK:return!!(null==e?void 0:e.sessionAuthenticated);case s.COLLECTIONS:return Rr(null!=e?e:[],Ir.COLLECTION_USER);case s.PERSONAL_BOOKS:return Rr(null!=e?e:[],Ir.PERSONAL_BOOK_USER)&&!(null===(i=this.getMapNow())||void 0===i?void 0:i.pbkConfidential);default:return!1}}makeAbsolute(t){return this.api.makeAbsolute(t)}}class Lr extends Ur{static async build(t){return new Lr(new cr,void 0,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)}fetchAttachments(){return this.api.getMapAttachments(this.mapId).catch((()=>[]))}fetchRelativesForDocument(t,e){return this.api.search({query:"",paging:{page:1,perPage:-1},scope:"DOCUMENTS",filters:[{negative:!1,values:e,key:t}],sort:[],facets:[]})}fetchRelativesForTopicInMap(t,e,o){return this.api.search({query:"",paging:{page:1,perPage:1},scope:"ALL_TOPICS",filters:[{negative:!1,values:o,key:e},{negative:!1,values:[t],key:"ft:publicationId"}],sort:[],facets:[]})}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,o){return this.api.rateTopic(this.mapId,t,e,o)}makeTopicFeedbackRequest(t,e,o){return this.api.sendTopicFeedback(this.mapId,t,e,o)}makeUnrateMapRequest(){return this.api.unrateMap(this.mapId)}makeUnrateTopicRequest(t){return this.api.unrateTopic(this.mapId,t)}getReaderLinkPrefix(){return"r/"}isFeatureAvailable(t){return!0}}class Wr{static build(t,o){return new Wr((t=>e.FtReduxStore.get({name:"ft-reader-"+t,initialState:{mapId:void 0,visibleTopics:[],map:void 0,toc:void 0,pagesToc:void 0,paginationConfiguration:void 0,currentPage:void 0,scrollTarget:void 0,configuration:void 0,searchInDocumentQuery:void 0,relatives:void 0}}))(t.trim()||"context"),null!=o?o:Lr.build)}constructor(t,o){this.store=t,this.metadataForSwitchToRelatives=new Set,this.loadDebouncer=new e.Debouncer(10),this.initService(o)}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(){return e.waitFor((()=>this.service))}async navigateToTopic(t,e,o){const i=await this.awaitService(),r=await(null!=o?i.getPage(o):i.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 o,i,r;let n=null!==(o="root"===t?void 0:t)&&void 0!==o?o:e.rootTocId;return e.topics.includes(n)?n:null!==(r=null!==(i=e.topics[0])&&void 0!==i?i:e.hiddenTopics[0])&&void 0!==r?r:"root"}async navigateToPage(t){const e=await this.awaitService();let o=await e.getPage(t);this.store.actions.currentPage(o)}scrollDone(){this.store.actions.scrollTarget({})}async load(){var t;(null===(t=this.service)||void 0===t?void 0:t.mapId)&&null==this.store.getState().map&&await this.loadDebouncer.run((()=>this.fetchData()))}clear(){var t;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(""),this.store.actions.relatives(void 0),null===(t=this.service)||void 0===t||t.clear(),this.clusteringHelper=void 0}reload(){return this.clear(),this.load()}async fetchData(){var t,o,i,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===(o=this.service)||void 0===o?void 0:o.getMap().then((t=>this.store.actions.map(t))),null===(i=this.service)||void 0===i?void 0:i.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)))]).then((()=>{this.metadataForSwitchToRelatives.size>0&&this.fetchRelatives()}))}catch(t){!this.errorHandler||t instanceof e.CanceledPromiseError||this.errorHandler(t)}}fetchRelatives(){var t,e,o;const i=null===(t=this.store.getState().map)||void 0===t?void 0:t.metadata.filter((t=>{var e;return t.key==(null===(e=this.store.getState().configuration)||void 0===e?void 0:e.relativePivotMetadata)})).flatMap((t=>t.values));void 0!==i&&i.length>0&&(null===(e=this.service)||void 0===e||e.getRelativesForDocument(null===(o=this.store.getState().configuration)||void 0===o?void 0:o.relativePivotMetadata,i).then((t=>{const e=t.results.flatMap((t=>t.entries));this.store.actions.relatives(e),this.createClusteringHelper()})))}createClusteringHelper(){var t,o;this.store.getState().relatives&&(this.clusteringHelper=new e.ClusteringHelper(this.store.getState().relatives,this.store.getState().relatives.find((t=>{var e;return(null===(e=t.map)||void 0===e?void 0:e.mapId)==this.store.getState().mapId})),this.metadataForSwitchToRelatives,null!==(o=null===(t=Ci.getState().metadataConfiguration)||void 0===t?void 0:t.descriptors)&&void 0!==o?o:[]),this.store.eventBus.dispatchEvent(new CustomEvent("clustering-helper-created")))}async navigateToRelativeTopicIfFound(t){var o,i,r;const n=await e.waitFor((()=>{var t;return null===(t=this.store.getState().configuration)||void 0===t?void 0:t.relativeTopicPivotMetadata})),a=this.store.getState().mapId,s=await this.awaitService(),l=await s.getRelativesForTopicInMap(a,n,[t]);if(null===(r=null===(i=null===(o=null==l?void 0:l.results)||void 0===o?void 0:o[0])||void 0===i?void 0:i.entries)||void 0===r?void 0:r[0]){const t=l.results[0].entries[0].topic.tocId;return await this.navigateToTopic(t),!0}return await this.navigateToTopic("root"),!1}setSearchInDocumentQuery(t){this.store.actions.searchInDocumentQuery(t)}registerMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.add(t),null==this.store.getState().relatives?this.fetchRelatives():this.createClusteringHelper()}unregisterMetadataForSwitchToRelatives(t){this.metadataForSwitchToRelatives.delete(t),this.createClusteringHelper()}}const zr=o.css`
1555
+ `;class Dr extends CustomEvent{constructor(t,e){super("ft-reader-map-loaded",{detail:{map:t,toc:e}})}}class Tr extends CustomEvent{constructor(t,e){super("ft-reader-visible-topics-change",{detail:{visibleTopics:e}})}}class Ar extends CustomEvent{constructor(t){super("ft-reader-navigation-done",{detail:t})}}class _r extends CustomEvent{constructor(t){super("ft-reader-load-error",{detail:t})}}class Zr extends Event{constructor(){super("ft-reader-map-not-found")}}class Fr extends Event{constructor(){super("ft-reader-map-unauthorized")}}class Br extends Event{constructor(){super("ft-reader-map-forbidden")}}class Kr extends Event{constructor(){super("ft-reader-topic-relative-not-found",{bubbles:!0,composed:!0})}}var Mr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Pr extends e.FtLitElementRedux{constructor(){super(),this.visibleTopics=[],this.scrollToTargetDebouncer=new e.Debouncer(5),this.navigationDebouncer=new e.Debouncer(10),this.mapLoadedEventDebouncer=new e.Debouncer(50),this.addStore(Ci)}render(){return o.html`
1562
1556
  ${this.importStyleIfNeeded()}
1563
1557
  <slot @register-ft-reader-component=${this.registerComponent}></slot>
1564
1558
  `}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:"")?o.nothing:o.html`
1565
1559
  <style>
1566
1560
  @import "${i}"
1567
1561
  </style>
1568
- `}get stateManager(){return null==this._stateManager&&(this._stateManager=Lr.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),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&null!=this.searchInDocumentQuery&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some((e=>t.has(e)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),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 Tr(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 Dr(this.map,e))}))}clear(){this.stateManager.clear()}async reload(){this.clear(),await this.navigateToTarget()}async navigateToTarget(){await this.stateManager.load(),await this.navigationDebouncer.run((async()=>{if(null!=this.topicPivot){await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)||this.lastNotifiedNotFoundRelative===this.mapId+this.topicPivot?this.lastNotifiedNotFoundRelative=void 0:(this.dispatchEvent(new Br),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot)}else null!=this.tocId?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&await 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;401===e.status?this.dispatchEvent(new Zr):403===e.status?this.dispatchEvent(new Fr):404===e.status?this.dispatchEvent(new _r):this.dispatchEvent(new Ar(t))}reloadBookmarks(){Zi.reloadBookmarks()}async reloadRating(){var t,e;await(null===(t=this.stateManager.service)||void 0===t?void 0:t.reloadRating()),null===(e=this.stateManager.store)||void 0===e||e.eventBus.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run((()=>{this.map&&this.toc&&this.dispatchEvent(new zr(this.map,this.toc))}))}}var Pr;Mr.styles=Wr,Kr([e.redux({store:Ii.name})],Mr.prototype,"baseUrl",void 0),Kr([i.property()],Mr.prototype,"mapId",void 0),Kr([i.property()],Mr.prototype,"tocId",void 0),Kr([i.property()],Mr.prototype,"section",void 0),Kr([i.property()],Mr.prototype,"topicPivot",void 0),Kr([i.property()],Mr.prototype,"searchInDocumentQuery",void 0),Kr([i.property({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:Pr}})],Mr.prototype,"page",void 0),Kr([e.redux({store:"reader"})],Mr.prototype,"map",void 0),Kr([e.redux({store:"reader"})],Mr.prototype,"toc",void 0),Kr([e.redux({store:"reader"})],Mr.prototype,"visibleTopics",void 0),Kr([e.redux({store:"reader"})],Mr.prototype,"currentPage",void 0),Kr([e.redux({store:"reader"})],Mr.prototype,"scrollTarget",void 0),Kr([i.property({attribute:!1})],Mr.prototype,"readerServiceProvider",void 0),e.customElement("ft-reader-context")(Mr);class Hr extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}}class jr extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}}class Gr extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}}class Vr extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}}class Yr extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}}var qr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Xr extends(Pi(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!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(Xi,Qi)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type})}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,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==o?o:"NO_RATING"}get ratingValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==o?o:-1}get ratingDate(){var t,o;const i=null===(o=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===o?void 0:o.date;return"string"==typeof i?e.parseDate(i):i}render(){return this.canAccessFeedback||this.canAccessRating?o.html`
1562
+ `}get stateManager(){return null==this._stateManager&&(this._stateManager=Wr.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),this.lastNotifiedNotFoundRelative=void 0),t.has("searchInDocumentQuery")&&null!=this.searchInDocumentQuery&&this.stateManager.setSearchInDocumentQuery(this.searchInDocumentQuery),["tocId","section","page","mapId","topicPivot"].some((e=>t.has(e)))&&this.mapId&&this.navigateToTarget()}contentAvailableCallback(t){var e;if(super.contentAvailableCallback(t),(t.has("map")||t.has("toc"))&&this.sendLoadedEventIfLoaded(),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 Ar(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 Tr(this.map,e))}))}clear(){this.stateManager.clear()}async reload(){this.clear(),await this.navigateToTarget()}async navigateToTarget(){await this.stateManager.load(),await this.navigationDebouncer.run((async()=>{if(null!=this.topicPivot){await this.stateManager.navigateToRelativeTopicIfFound(this.topicPivot)||this.lastNotifiedNotFoundRelative===this.mapId+this.topicPivot?this.lastNotifiedNotFoundRelative=void 0:(this.dispatchEvent(new Kr),this.lastNotifiedNotFoundRelative=this.mapId+this.topicPivot)}else null!=this.tocId?await this.stateManager.navigateToTopic(this.tocId,this.section,this.page):null!=this.page&&await 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;401===e.status?this.dispatchEvent(new Fr):403===e.status?this.dispatchEvent(new Br):404===e.status?this.dispatchEvent(new Zr):this.dispatchEvent(new _r(t))}reloadBookmarks(){Fi.reloadBookmarks()}async reloadRating(){var t,e;await(null===(t=this.stateManager.service)||void 0===t?void 0:t.reloadRating()),null===(e=this.stateManager.store)||void 0===e||e.eventBus.dispatchEvent(new CustomEvent("rating-changed"))}sendLoadedEventIfLoaded(){this.mapLoadedEventDebouncer.run((()=>{this.map&&this.toc&&this.dispatchEvent(new Dr(this.map,this.toc))}))}}var Hr;Pr.styles=zr,Mr([e.redux({store:Ci.name})],Pr.prototype,"baseUrl",void 0),Mr([i.property()],Pr.prototype,"mapId",void 0),Mr([i.property()],Pr.prototype,"tocId",void 0),Mr([i.property()],Pr.prototype,"section",void 0),Mr([i.property()],Pr.prototype,"topicPivot",void 0),Mr([i.property()],Pr.prototype,"searchInDocumentQuery",void 0),Mr([i.property({type:Number,converter:{fromAttribute:t=>+(null!=t?t:"NaN")>0?+t:Hr}})],Pr.prototype,"page",void 0),Mr([e.redux({store:"reader"})],Pr.prototype,"map",void 0),Mr([e.redux({store:"reader"})],Pr.prototype,"toc",void 0),Mr([e.redux({store:"reader"})],Pr.prototype,"visibleTopics",void 0),Mr([e.redux({store:"reader"})],Pr.prototype,"currentPage",void 0),Mr([e.redux({store:"reader"})],Pr.prototype,"scrollTarget",void 0),Mr([i.property({attribute:!1})],Pr.prototype,"readerServiceProvider",void 0),e.customElement("ft-reader-context")(Pr);class jr extends CustomEvent{constructor(t){super("send-feedback",{detail:t})}}class Gr extends CustomEvent{constructor(t){super("ft-reader-topic-feedback",{composed:!0,bubbles:!0,detail:t})}}class Vr extends CustomEvent{constructor(t){super("ft-reader-feedback",{composed:!0,bubbles:!0,detail:t})}}class Yr extends CustomEvent{constructor(t){super("ft-reader-mailer-topic-feedback",{composed:!0,bubbles:!0,detail:{topic:t}})}}class qr extends CustomEvent{constructor(){super("ft-reader-mailer-map-feedback",{composed:!0,bubbles:!0})}}var Xr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Qr extends(Hi(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!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(Qi,Ji)}get canAccessFeedback(){var t;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.FEEDBACK,{session:this.session})}get canAccessRating(){var t,e;return null===(t=this.service)||void 0===t?void 0:t.isFeatureAccessible(s.RATING,{session:this.session,ratingType:null===(e=this.ratingSummary)||void 0===e?void 0:e.type})}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,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.type)&&void 0!==o?o:"NO_RATING"}get ratingValue(){var t,e,o;return null!==(o=null===(e=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===e?void 0:e.value)&&void 0!==o?o:-1}get ratingDate(){var t,o;const i=null===(o=null===(t=this.ratingSummary)||void 0===t?void 0:t.rating)||void 0===o?void 0:o.date;return"string"==typeof i?e.parseDate(i):i}render(){return this.canAccessFeedback||this.canAccessRating?o.html`
1569
1563
  <div class="ft-reader-feedback">
1570
1564
  ${this.hideTitle?o.nothing:o.html`
1571
1565
  <ft-typography variant="title" part="main-title">
@@ -1585,11 +1579,11 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1585
1579
  ${this.renderRatingDate()}
1586
1580
  </ft-typography>
1587
1581
  </div>
1588
- `:o.nothing}renderRatingDate(){const t=this.ratingDate;if(null==t)return Xi.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return Xi.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?Xi.messages.ratedToday():Xi.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return o.html`
1582
+ `:o.nothing}renderRatingDate(){const t=this.ratingDate;if(null==t)return Qi.messages.notRated();if(t.getTime()>(new Date).getTime()-6e4)return Qi.messages.ratedNow();return(new Date).toLocaleDateString()===t.toLocaleDateString()?Qi.messages.ratedToday():Qi.messages.ratedOn(t)}renderRating(){switch(this.configuredRatingType){case"STARS":return o.html`
1589
1583
  <div class="ft-reader-feedback--stars" part="rating rating-stars">
1590
1584
  ${a.repeat(new Array(5),((t,e)=>e),((t,e)=>{let i="STARS"===this.ratingType&&this.ratingValue>e;const r=e+1;return o.html`
1591
1585
  <ft-button round part="rating-stars-${r}"
1592
- label="${Xi.messages.starsRating(r)}"
1586
+ label="${Qi.messages.starsRating(r)}"
1593
1587
  tooltipPosition="top"
1594
1588
  .iconVariant=${this.iconVariant}
1595
1589
  icon="${i?this.filledStarIcon:this.emptyStarIcon}"
@@ -1606,13 +1600,13 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1606
1600
  ?selected=${e}
1607
1601
  .iconVariant=${this.iconVariant}
1608
1602
  icon="${e?this.filledLikeIcon:this.emptyLikeIcon}">
1609
- ${Xi.messages.like()}
1603
+ ${Qi.messages.like()}
1610
1604
  </ft-switch-option>
1611
1605
  <ft-switch-option .value=${0}
1612
1606
  ?selected=${t}
1613
1607
  .iconVariant=${this.iconVariant}
1614
1608
  icon="${t?this.filledDislikeIcon:this.emptyDislikeIcon}">
1615
- ${Xi.messages.dislike()}
1609
+ ${Qi.messages.dislike()}
1616
1610
  </ft-switch-option>
1617
1611
  </ft-switch>
1618
1612
  `;case"DICHOTOMOUS":const i="DICHOTOMOUS"===this.ratingType&&0===this.ratingValue,r="DICHOTOMOUS"===this.ratingType&&1===this.ratingValue;return o.html`
@@ -1621,11 +1615,11 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1621
1615
  part="rating rating-dichotomous">
1622
1616
  <ft-switch-option .value=${1}
1623
1617
  ?selected=${r}>
1624
- ${Xi.messages.dichotomousYes()}
1618
+ ${Qi.messages.dichotomousYes()}
1625
1619
  </ft-switch-option>
1626
1620
  <ft-switch-option .value=${0}
1627
1621
  ?selected=${i}>
1628
- ${Xi.messages.dichotomousNo()}
1622
+ ${Qi.messages.dichotomousNo()}
1629
1623
  </ft-switch-option>
1630
1624
  </ft-switch>
1631
1625
  `}return o.nothing}rate(t){(null!=t?t:-1)!==this.ratingValue&&this.dispatchEvent(new CustomEvent("rate",{detail:t}))}renderFeedbackSection(){var t,e,i,r,n;if(this.canAccessFeedback){const a=this.feedbackMailLinkBuilder(this.feedbackMessage);let s=o.html`
@@ -1634,7 +1628,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1634
1628
  class="ft-reader-feedback--send-feedback"
1635
1629
  ?disabled=${!this.feedbackMessage||!this.validFromEmail()}
1636
1630
  part="send-feedback">
1637
- ${Xi.messages.okButton()}
1631
+ ${Qi.messages.okButton()}
1638
1632
  </ft-button>
1639
1633
  `;a&&(s=o.html`
1640
1634
  <a class="ft-reader-feedback--feedback-link" href="${a}">
@@ -1646,7 +1640,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1646
1640
  class="ft-reader-feedback--more-options"
1647
1641
  @click="${this.onOpenMoreDetails}"
1648
1642
  part="more-options">
1649
- ${Xi.messages.moreOptionsButton()}
1643
+ ${Qi.messages.moreOptionsButton()}
1650
1644
  </ft-button>
1651
1645
  `:o.nothing;return o.html`
1652
1646
  <form class="ft-reader-feedback--feedback" part="feedback-container" autocomplete="on"
@@ -1657,15 +1651,15 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1657
1651
  ${null==(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId)&&(null===(n=this.configuration)||void 0===n?void 0:n.mailsSentByFluidTopicsForUnauthenticatedUsers)?o.html`
1658
1652
  <ft-text-field outlined name="email" type="email" autocomplete="email"
1659
1653
  class="ft-reader-feedback--from-input"
1660
- label=${Xi.messages.feedbackfromEmail()}
1654
+ label=${Qi.messages.feedbackfromEmail()}
1661
1655
  @change=${t=>this.from=t.detail.trim()}
1662
1656
  ?error=${this.from&&!this.validFromEmail()}
1663
- helper=${this.from&&!this.validFromEmail()?Xi.messages.feedbackfromEmailInvalid():""}
1657
+ helper=${this.from&&!this.validFromEmail()?Qi.messages.feedbackfromEmailInvalid():""}
1664
1658
  />
1665
1659
  `:o.nothing}
1666
1660
  <ft-text-area outlined
1667
1661
  class="ft-reader-feedback--feedback-input" part="feedback-input"
1668
- label="${Xi.messages.feedbackInputLabel()}"
1662
+ label="${Qi.messages.feedbackInputLabel()}"
1669
1663
  @live-change=${t=>this.feedbackMessage=t.detail.trim()}
1670
1664
  ></ft-text-area>
1671
1665
  <div part="buttons-container">
@@ -1673,7 +1667,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1673
1667
  ${s}
1674
1668
  </div>
1675
1669
  </form>
1676
- `}return o.nothing}onFormSubmitEvent(t,e){t.preventDefault(),e?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,e,o;return!(null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(o=this.configuration)||void 0===o?void 0:o.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 Hr({message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}))}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}onOpenMoreDetails(){this.dispatchEvent(new CustomEvent("open-more-options"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Xr.elementDefinitions={"ft-button":xi,"ft-typography":ke,"ft-switch":ei,"ft-switch-option":Qo,"ft-text-area":gi,"ft-text-field":or},Xr.styles=_t,qr([i.property({type:Boolean})],Xr.prototype,"editorMode",void 0),qr([i.property({type:Boolean})],Xr.prototype,"hideTitle",void 0),qr([i.property({type:Boolean})],Xr.prototype,"withMoreOptionsButton",void 0),qr([i.property({type:Boolean})],Xr.prototype,"ratingAllowed",void 0),qr([i.property({attribute:!1})],Xr.prototype,"i18nProperties",void 0),qr([i.property({attribute:!1})],Xr.prototype,"ratingSummary",void 0),qr([i.property({attribute:!1})],Xr.prototype,"session",void 0),qr([i.query(".ft-reader-feedback--feedback-input")],Xr.prototype,"feedbackInput",void 0),qr([i.state()],Xr.prototype,"from",void 0),qr([i.state()],Xr.prototype,"feedbackMessage",void 0),qr([i.property()],Xr.prototype,"iconVariant",void 0),qr([i.property()],Xr.prototype,"emptyStarIcon",void 0),qr([i.property()],Xr.prototype,"filledStarIcon",void 0),qr([i.property()],Xr.prototype,"emptyLikeIcon",void 0),qr([i.property()],Xr.prototype,"filledLikeIcon",void 0),qr([i.property()],Xr.prototype,"emptyDislikeIcon",void 0),qr([i.property()],Xr.prototype,"filledDislikeIcon",void 0),qr([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Xr.prototype,"configuration",void 0),qr([i.property()],Xr.prototype,"feedbackMailLinkBuilder",void 0);const Qr=Yi.fromGwt("server");class Jr{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,e,o,i,r){var n;this.subject=t,this.url=e,this.configuration=i,this.isAuthenticated=r,this.subjectMetadata=this.filterMetadata(o,i.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(o,null!==(n=i.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))}shouldUseMailer(){var t,e;const o=this.isAuthenticated&&!(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopics),i=!this.isAuthenticated&&!(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers);return o||i}build(t){var e;if(null!=t&&0===t.length||!this.shouldUseMailer())return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),i=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${null!=t?t:""}\n\n_________________________________________________________________\n${Qr.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(e=this.configuration)||void 0===e?void 0:e.recipients.join(",")}?subject=${o}&body=${i}`}}const tn=Yi.build("inDesignerFeedbackComponent"),en={feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."};var on=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class rn extends(Pi(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.iconVariant=Ko.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 Jr,this.i18nProperties={feedbackMainTitle:Xi.properties.mapFeedbackMainTitle(),ratingSectionTitle:Xi.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:Xi.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:Xi.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Ii)}render(){return o.html`
1670
+ `}return o.nothing}onFormSubmitEvent(t,e){t.preventDefault(),e?this.onMailerFeedbackSent():this.sendFeedback()}validFromEmail(){var t,e,o;return!(null==(null===(e=null===(t=this.session)||void 0===t?void 0:t.profile)||void 0===e?void 0:e.userId)&&(null===(o=this.configuration)||void 0===o?void 0:o.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 jr({message:this.feedbackInput.value,...(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopicsForUnauthenticatedUsers)&&{from:this.from}}))}onMailerFeedbackSent(){this.dispatchEvent(new CustomEvent("mailer-feedback"))}onOpenMoreDetails(){this.dispatchEvent(new CustomEvent("open-more-options"))}clearFeedbackInput(){setTimeout((()=>this.feedbackInput.value=""),0)}}Qr.elementDefinitions={"ft-button":wi,"ft-typography":ke,"ft-switch":oi,"ft-switch-option":Jo,"ft-text-area":bi,"ft-text-field":ir},Qr.styles=_t,Xr([i.property({type:Boolean})],Qr.prototype,"editorMode",void 0),Xr([i.property({type:Boolean})],Qr.prototype,"hideTitle",void 0),Xr([i.property({type:Boolean})],Qr.prototype,"withMoreOptionsButton",void 0),Xr([i.property({type:Boolean})],Qr.prototype,"ratingAllowed",void 0),Xr([i.property({attribute:!1})],Qr.prototype,"i18nProperties",void 0),Xr([i.property({attribute:!1})],Qr.prototype,"ratingSummary",void 0),Xr([i.property({attribute:!1})],Qr.prototype,"session",void 0),Xr([i.query(".ft-reader-feedback--feedback-input")],Qr.prototype,"feedbackInput",void 0),Xr([i.state()],Qr.prototype,"from",void 0),Xr([i.state()],Qr.prototype,"feedbackMessage",void 0),Xr([i.property()],Qr.prototype,"iconVariant",void 0),Xr([i.property()],Qr.prototype,"emptyStarIcon",void 0),Xr([i.property()],Qr.prototype,"filledStarIcon",void 0),Xr([i.property()],Qr.prototype,"emptyLikeIcon",void 0),Xr([i.property()],Qr.prototype,"filledLikeIcon",void 0),Xr([i.property()],Qr.prototype,"emptyDislikeIcon",void 0),Xr([i.property()],Qr.prototype,"filledDislikeIcon",void 0),Xr([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],Qr.prototype,"configuration",void 0),Xr([i.property()],Qr.prototype,"feedbackMailLinkBuilder",void 0);const Jr=qi.fromGwt("server");class tn{constructor(){this.subject="",this.url="",this.subjectMetadata="",this.bodyMetadata="",this.isAuthenticated=!1}update(t,e,o,i,r){var n;this.subject=t,this.url=e,this.configuration=i,this.isAuthenticated=r,this.subjectMetadata=this.filterMetadata(o,i.subjectMetadataIds).map((t=>"["+t.values[t.values.length-1]+"]")).join(""),this.bodyMetadata=this.filterMetadata(o,null!==(n=i.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))}shouldUseMailer(){var t,e;const o=this.isAuthenticated&&!(null===(t=this.configuration)||void 0===t?void 0:t.mailsSentByFluidTopics),i=!this.isAuthenticated&&!(null===(e=this.configuration)||void 0===e?void 0:e.mailsSentByFluidTopicsForUnauthenticatedUsers);return o||i}build(t){var e;if(null!=t&&0===t.length||!this.shouldUseMailer())return;const o=encodeURIComponent(this.subject+" "+this.subjectMetadata),i=encodeURIComponent(`\n${this.bodyMetadata}\n${this.url}\n_________________________________________________________________\n\n${null!=t?t:""}\n\n_________________________________________________________________\n${Jr.messages["mail.feedback.disclaimer"]()}`);return`mailto:${null===(e=this.configuration)||void 0===e?void 0:e.recipients.join(",")}?subject=${o}&body=${i}`}}const en=qi.build("inDesignerFeedbackComponent"),on={feedbackAndRatingDisabledInEditor:"Feedback and ratings performed here are not taken into account."};var rn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class nn extends(Hi(f)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.iconVariant=Mo.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 tn,this.i18nProperties={feedbackMainTitle:Qi.properties.mapFeedbackMainTitle(),ratingSectionTitle:Qi.properties.mapRatingSectionTitle(),dichotomousRatingSectionTitle:Qi.properties.mapDichotomousRatingSectionTitle(),feedbackSectionTitle:Qi.properties.mapFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Ci)}render(){return o.html`
1677
1671
  <ft-reader-feedback
1678
1672
  ratingAllowed
1679
1673
  .i18nProperties=${this.i18nProperties}
@@ -1695,7 +1689,7 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1695
1689
  @mailer-feedback=${this.onMailerFeedbackSent}
1696
1690
  @open-more-options=${this.openMoreOptions}
1697
1691
  ></ft-reader-feedback>
1698
- `}update(t){var e,o,i,r;super.update(t),t.has("map")&&this.map&&this.updateData(),t.has("editorMode")&&this.editorMode&&this.addI18nContext(tn,en),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.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;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)&&await this.fetchRatingSummary()}))}async fetchRatingSummary(){var t;this.ratingSummary=await(null===(t=this.service)||void 0===t?void 0:t.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 o,i,r;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Xi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:tn.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:tn.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(o=this.service)||void 0===o?void 0:o.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Xi.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Xi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new Yr)}openMoreOptions(){var t,e,o;this.dispatchEvent(new Gr({mapId:this.map.id,mapTitle:this.map.title,mapMetadata:(null===(t=this.map)||void 0===t?void 0:t.metadata)||[],ratingType:(null===(e=this.ratingSummary)||void 0===e?void 0:e.type)||gr.NO_RATING,ratingValue:null===(o=this.ratingSummary)||void 0===o?void 0:o.rating}))}}rn.elementDefinitions={"ft-reader-feedback":Xr},on([e.redux({store:Ii.name})],rn.prototype,"session",void 0),on([e.redux({store:"reader"})],rn.prototype,"map",void 0),on([e.redux({store:Ii.name})],rn.prototype,"editorMode",void 0),on([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],rn.prototype,"configuration",void 0),on([i.state()],rn.prototype,"ratingSummary",void 0),on([i.property({type:Boolean})],rn.prototype,"hideTitle",void 0),on([i.property({type:Boolean})],rn.prototype,"withMoreOptionsButton",void 0),on([i.property()],rn.prototype,"iconVariant",void 0),on([i.property()],rn.prototype,"emptyStarIcon",void 0),on([i.property()],rn.prototype,"filledStarIcon",void 0),on([i.property()],rn.prototype,"emptyLikeIcon",void 0),on([i.property()],rn.prototype,"filledLikeIcon",void 0),on([i.property()],rn.prototype,"emptyDislikeIcon",void 0),on([i.property()],rn.prototype,"filledDislikeIcon",void 0),on([i.query("ft-reader-feedback")],rn.prototype,"readerFeedback",void 0),on([qi(Qr.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],rn.prototype,"mailSubject",void 0),on([e.reduxEventListener({eventName:"rating-changed"})],rn.prototype,"fetchRatingSummary",null);var nn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class an extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const sn=Symbol("registerInterval");class ln extends(function(t){var e;class o extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[sn]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[sn]):this.dispatchEvent(new an)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=sn,nn([i.state()],o.prototype,"tocNode",void 0),nn([i.state()],o.prototype,"disableContextInteractions",void 0),o}(f)){}var cn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dn extends(Pi(ln)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.iconVariant=Ko.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 Jr,this.i18nProperties={feedbackMainTitle:Xi.properties.topicFeedbackMainTitle(),ratingSectionTitle:Xi.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:Xi.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:Xi.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Ii)}render(){var t;return o.html`
1692
+ `}update(t){var e,o,i,r;super.update(t),t.has("map")&&this.map&&this.updateData(),t.has("editorMode")&&this.editorMode&&this.addI18nContext(en,on),["map","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink())&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.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;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)&&await this.fetchRatingSummary()}))}async fetchRatingSummary(){var t;this.ratingSummary=await(null===(t=this.service)||void 0===t?void 0:t.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 o,i,r;if(!this.editorMode&&this.ratingSummary){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateMap()):await(null===(i=this.service)||void 0===i?void 0:i.rateMap(null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Qi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:en.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{this.editorMode?this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:en.messages.feedbackAndRatingDisabledInEditor()})):(await(null===(o=this.service)||void 0===o?void 0:o.sendMapFeedback(t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Qi.messages.feedbackSuccess()}))),this.readerFeedback.clearFeedbackInput()}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Qi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){this.dispatchEvent(new qr)}openMoreOptions(){var t,e,o;this.dispatchEvent(new Vr({mapId:this.map.id,mapTitle:this.map.title,mapMetadata:(null===(t=this.map)||void 0===t?void 0:t.metadata)||[],ratingType:(null===(e=this.ratingSummary)||void 0===e?void 0:e.type)||br.NO_RATING,ratingValue:null===(o=this.ratingSummary)||void 0===o?void 0:o.rating}))}}nn.elementDefinitions={"ft-reader-feedback":Qr},rn([e.redux({store:Ci.name})],nn.prototype,"session",void 0),rn([e.redux({store:"reader"})],nn.prototype,"map",void 0),rn([e.redux({store:Ci.name})],nn.prototype,"editorMode",void 0),rn([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],nn.prototype,"configuration",void 0),rn([i.state()],nn.prototype,"ratingSummary",void 0),rn([i.property({type:Boolean})],nn.prototype,"hideTitle",void 0),rn([i.property({type:Boolean})],nn.prototype,"withMoreOptionsButton",void 0),rn([i.property()],nn.prototype,"iconVariant",void 0),rn([i.property()],nn.prototype,"emptyStarIcon",void 0),rn([i.property()],nn.prototype,"filledStarIcon",void 0),rn([i.property()],nn.prototype,"emptyLikeIcon",void 0),rn([i.property()],nn.prototype,"filledLikeIcon",void 0),rn([i.property()],nn.prototype,"emptyDislikeIcon",void 0),rn([i.property()],nn.prototype,"filledDislikeIcon",void 0),rn([i.query("ft-reader-feedback")],nn.prototype,"readerFeedback",void 0),rn([Xi(Jr.properties["mail.map_feedback.subject"]((t=>{var e;return[null===(e=t.map)||void 0===e?void 0:e.title]})))],nn.prototype,"mailSubject",void 0),rn([e.reduxEventListener({eventName:"rating-changed"})],nn.prototype,"fetchRatingSummary",null);var an=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class sn extends Event{constructor(){super("register-ft-reader-topic-component",{bubbles:!0,composed:!0})}}const ln=Symbol("registerInterval");class cn extends(function(t){var e;class o extends t{constructor(){super(...arguments),this.disableContextInteractions=!1,this[e]=0}connectedCallback(){super.connectedCallback(),this[ln]=window.setInterval((()=>this.tryToRegisterToTopicContext()),50)}tryToRegisterToTopicContext(){null!=this.tocNode?window.clearInterval(this[ln]):this.dispatchEvent(new sn)}disconnectedCallback(){super.disconnectedCallback(),this.tocNode=void 0}}return e=ln,an([i.state()],o.prototype,"tocNode",void 0),an([i.state()],o.prototype,"disableContextInteractions",void 0),o}(f)){}var dn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class fn extends(Hi(cn)){constructor(){super(),this.editorMode=!1,this.hideTitle=!1,this.withMoreOptionsButton=!1,this.iconVariant=Mo.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 tn,this.i18nProperties={feedbackMainTitle:Qi.properties.topicFeedbackMainTitle(),ratingSectionTitle:Qi.properties.topicRatingSectionTitle(),dichotomousRatingSectionTitle:Qi.properties.topicDichotomousRatingSectionTitle(),feedbackSectionTitle:Qi.properties.topicFeedbackSectionTitle()},this.updateDebouncer=new e.Debouncer(100),this.sendRatingDebouncer=new e.Debouncer(500),this.addStore(Ci)}render(){var t;return o.html`
1699
1693
  <ft-reader-feedback
1700
1694
  .i18nProperties=${this.i18nProperties}
1701
1695
  ?ratingAllowed=${null===(t=this.tocNode)||void 0===t?void 0:t.hasRating}
@@ -1717,4 +1711,4 @@ const we=Symbol.for(""),Oe=t=>{if(t?.r===we)return t?._$litStatic$},Se=t=>({_$li
1717
1711
  @mailer-feedback=${this.onMailerFeedbackSent}
1718
1712
  @open-more-options=${this.openMoreOptions}
1719
1713
  ></ft-reader-feedback>
1720
- `}update(t){var e,o,i,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),t.has("editorMode")&&this.editorMode&&this.addI18nContext(tn,en),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;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)&&await this.fetchRatingSummary()}))}async fetchRatingSummary(){var t;this.ratingSummary=await(null===(t=this.service)||void 0===t?void 0:t.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 o,i,r;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Xi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:tn.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{!this.editorMode&&this.tocNode?(await(null===(o=this.service)||void 0===o?void 0:o.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Xi.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:tn.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Xi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new Vr(t))}openMoreOptions(){var t,e,o,i,r,n,a,s;this.dispatchEvent(new jr({mapId:this.map.id,mapTitle:this.map.title,tocId:this.tocNode.tocId,topicTitle:this.tocNode.title,topicUrl:null!==(e=null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocNode.tocId))&&void 0!==e?e:"",mapMetadata:(null===(o=this.map)||void 0===o?void 0:o.metadata)||[],breadcrumb:(null===(r=null===(i=this.stateManager)||void 0===i?void 0:i.service)||void 0===r?void 0:r.buildBreadcrumb(this.tocNode.tocId))||[],ratingType:((null===(n=this.tocNode)||void 0===n?void 0:n.hasRating)?null===(a=this.ratingSummary)||void 0===a?void 0:a.type:gr.NO_RATING)||gr.NO_RATING,ratingValue:null===(s=this.ratingSummary)||void 0===s?void 0:s.rating}))}}dn.elementDefinitions={"ft-reader-feedback":Xr},cn([e.redux({store:Ii.name})],dn.prototype,"session",void 0),cn([e.redux({store:"reader"})],dn.prototype,"map",void 0),cn([e.redux({store:Ii.name})],dn.prototype,"editorMode",void 0),cn([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],dn.prototype,"configuration",void 0),cn([i.state()],dn.prototype,"ratingSummary",void 0),cn([i.property({type:Boolean})],dn.prototype,"hideTitle",void 0),cn([i.property({type:Boolean})],dn.prototype,"withMoreOptionsButton",void 0),cn([i.property()],dn.prototype,"iconVariant",void 0),cn([i.property()],dn.prototype,"emptyStarIcon",void 0),cn([i.property()],dn.prototype,"filledStarIcon",void 0),cn([i.property()],dn.prototype,"emptyLikeIcon",void 0),cn([i.property()],dn.prototype,"filledLikeIcon",void 0),cn([i.property()],dn.prototype,"emptyDislikeIcon",void 0),cn([i.property()],dn.prototype,"filledDislikeIcon",void 0),cn([i.query("ft-reader-feedback")],dn.prototype,"readerFeedback",void 0),cn([qi(Qr.properties["mail.feedback.subject"]((t=>{var e,o;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(o=t.map)||void 0===o?void 0:o.title]})))],dn.prototype,"mailSubject",void 0),cn([e.reduxEventListener({eventName:"rating-changed"})],dn.prototype,"fetchRatingSummary",null),e.customElement("ft-reader-map-feedback")(rn),e.customElement("ft-reader-topic-feedback")(dn),t.FtReaderFeedbackCssVariables=At,t.FtReaderMapFeedback=rn,t.FtReaderTopicFeedback=dn,t.styles=_t}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);
1714
+ `}update(t){var e,o,i,r;super.update(t),["tocNode","user"].some((e=>t.has(e)))&&this.tocNode&&this.updateData(),t.has("editorMode")&&this.editorMode&&this.addI18nContext(en,on),["map","tocNode","configuration","user","mailSubject"].some((e=>t.has(e)))&&this.map&&this.tocNode&&this.configuration&&this.feedbackLinkBuilder.update(this.mailSubject,null!==(o=null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocNode.tocId))&&void 0!==o?o:"",this.map.metadata,this.configuration,null!=(null===(r=null===(i=this.session)||void 0===i?void 0:i.profile)||void 0===r?void 0:r.userId))}connectedCallback(){super.connectedCallback(),this.updateData()}updateData(){this.updateDebouncer.run((async()=>{var t,e;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)&&await this.fetchRatingSummary()}))}async fetchRatingSummary(){var t;this.ratingSummary=await(null===(t=this.service)||void 0===t?void 0:t.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 o,i,r;if(!this.editorMode&&this.ratingSummary&&this.tocNode){try{null==t?await(null===(o=this.service)||void 0===o?void 0:o.unrateTopic(this.tocNode.tocId)):await(null===(i=this.service)||void 0===i?void 0:i.rateTopic(this.tocNode.tocId,null===(r=this.ratingSummary)||void 0===r?void 0:r.type,t))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Qi.messages.ratingFailure()}))}this.updateData()}else this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:en.messages.feedbackAndRatingDisabledInEditor()}))}async sendFeedback(t){var o;try{!this.editorMode&&this.tocNode?(await(null===(o=this.service)||void 0===o?void 0:o.sendTopicFeedback(this.tocNode.tocId,t.detail.message,t.detail.from)),this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:Qi.messages.feedbackSuccess()})),this.readerFeedback.clearFeedbackInput()):this.editorMode&&this.dispatchEvent(new e.FtNotificationEvent({type:"info",message:en.messages.feedbackAndRatingDisabledInEditor()}))}catch{this.dispatchEvent(new e.FtNotificationEvent({type:"error",message:Qi.messages.feedbackFailure()}))}}onMailerFeedbackSent(){const t=this.tocNode;this.dispatchEvent(new Yr(t))}openMoreOptions(){var t,e,o,i,r,n,a,s;this.dispatchEvent(new Gr({mapId:this.map.id,mapTitle:this.map.title,tocId:this.tocNode.tocId,topicTitle:this.tocNode.title,topicUrl:null!==(e=null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocNode.tocId))&&void 0!==e?e:"",mapMetadata:(null===(o=this.map)||void 0===o?void 0:o.metadata)||[],breadcrumb:(null===(r=null===(i=this.stateManager)||void 0===i?void 0:i.service)||void 0===r?void 0:r.buildBreadcrumb(this.tocNode.tocId))||[],ratingType:((null===(n=this.tocNode)||void 0===n?void 0:n.hasRating)?null===(a=this.ratingSummary)||void 0===a?void 0:a.type:br.NO_RATING)||br.NO_RATING,ratingValue:null===(s=this.ratingSummary)||void 0===s?void 0:s.rating}))}}fn.elementDefinitions={"ft-reader-feedback":Qr},dn([e.redux({store:Ci.name})],fn.prototype,"session",void 0),dn([e.redux({store:"reader"})],fn.prototype,"map",void 0),dn([e.redux({store:Ci.name})],fn.prototype,"editorMode",void 0),dn([e.redux({store:"reader",selector:t=>{var e;return null===(e=t.configuration)||void 0===e?void 0:e.feedback}})],fn.prototype,"configuration",void 0),dn([i.state()],fn.prototype,"ratingSummary",void 0),dn([i.property({type:Boolean})],fn.prototype,"hideTitle",void 0),dn([i.property({type:Boolean})],fn.prototype,"withMoreOptionsButton",void 0),dn([i.property()],fn.prototype,"iconVariant",void 0),dn([i.property()],fn.prototype,"emptyStarIcon",void 0),dn([i.property()],fn.prototype,"filledStarIcon",void 0),dn([i.property()],fn.prototype,"emptyLikeIcon",void 0),dn([i.property()],fn.prototype,"filledLikeIcon",void 0),dn([i.property()],fn.prototype,"emptyDislikeIcon",void 0),dn([i.property()],fn.prototype,"filledDislikeIcon",void 0),dn([i.query("ft-reader-feedback")],fn.prototype,"readerFeedback",void 0),dn([Xi(Jr.properties["mail.feedback.subject"]((t=>{var e,o;return[null===(e=t.tocNode)||void 0===e?void 0:e.title,null===(o=t.map)||void 0===o?void 0:o.title]})))],fn.prototype,"mailSubject",void 0),dn([e.reduxEventListener({eventName:"rating-changed"})],fn.prototype,"fetchRatingSummary",null),e.customElement("ft-reader-map-feedback")(nn),e.customElement("ft-reader-topic-feedback")(fn),t.FtReaderFeedbackCssVariables=At,t.FtReaderMapFeedback=nn,t.FtReaderTopicFeedback=fn,t.styles=_t}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML,ftGlobals.litRepeat);