@fluid-topics/ft-search-type 1.1.36 → 1.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/ft-search-type.light.js +6 -6
- package/build/ft-search-type.min.js +317 -317
- package/package.json +3 -3
|
@@ -527,7 +527,7 @@ const M=Symbol.for(""),j=t=>{if(t?.r===M)return t?._$litStatic$},_=t=>({_$litSta
|
|
|
527
527
|
position: relative;
|
|
528
528
|
word-break: break-word;
|
|
529
529
|
}
|
|
530
|
-
`,Go=["start","end"],Vo=["top","right","bottom","left"].reduce(((t,o)=>t.concat(o,o+"-"+Go[0],o+"-"+Go[1])),[]),qo=Math.min,Yo=Math.max,Qo=Math.round,Xo=t=>({x:t,y:t}),Jo={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function oe(t,o,e){return Yo(t,qo(o,e))}function ee(t,o){return"function"==typeof t?t(o):t}function ie(t){return t.split("-")[0]}function re(t){return t.split("-")[1]}function ne(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}function se(t){return["top","bottom"].includes(ie(t))?"y":"x"}function le(t){return ne(se(t))}function ce(t){return t.replace(/left|right|bottom|top/g,(t=>Jo[t]))}function pe(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function fe(t,o,e){let{reference:i,floating:r}=t;const n=se(o),a=le(o),s=ae(a),l=ie(o),c="y"===n,p=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let d;switch(l){case"top":d={x:p,y:i.y-r.height};break;case"bottom":d={x:p,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(re(o)){case"start":d[a]-=h*(e&&c?-1:1);break;case"end":d[a]+=h*(e&&c?-1:1)}return d}async function he(t,o){var e;void 0===o&&(o={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=ee(o,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}}(d),y=s[h?"floating"===f?"reference":"floating":f],g=pe(await n.getClippingRect({element:null==(e=await(null==n.isElement?void 0:n.isElement(y)))||e?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),b="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=pe(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(g.top-x.top+u.top)/v.y,bottom:(x.bottom-g.bottom+u.bottom)/v.y,left:(g.left-x.left+u.left)/v.x,right:(x.right-g.right+u.right)/v.x}}function de(t,o,e){return(t?[...e.filter((o=>re(o)===t)),...e.filter((o=>re(o)!==t))]:e.filter((t=>ie(t)===t))).filter((e=>!t||(re(e)===t||!!o&&function(t){return t.replace(/start|end/g,(t=>te[t]))}(e)!==e)))}const ue=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(o){var e,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=o,{crossAxis:p=!1,alignment:f,allowedPlacements:h=Vo,autoAlignment:d=!0,...u}=ee(t,o),y=void 0!==f||h===Vo?de(f||null,d,h):h,g=await he(o,u),b=(null==(e=a.autoPlacement)?void 0:e.index)||0,m=y[b];if(null==m)return{};const v=function(t,o,e){void 0===e&&(e=!1);const i=re(t),r=le(t),n=ae(r);let a="x"===r?i===(e?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[n]>o.floating[n]&&(a=ce(a)),[a,ce(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:y[0]}};const x=[g[ie(m)],g[v[0]],g[v[1]]],O=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],N=y[b+1];if(N)return{data:{index:b+1,overflows:O},reset:{placement:N}};const S=O.map((t=>{const o=re(t.placement);return[t.placement,o&&p?t.overflows.slice(0,2).reduce(((t,o)=>t+o),0):t.overflows[0],t.overflows]})).sort(((t,o)=>t[1]-o[1])),w=S.filter((t=>t[2].slice(0,re(t[0])?2:3).every((t=>t<=0)))),$=(null==(r=w[0])?void 0:r[0])||S[0][0];return $!==s?{data:{index:b+1,overflows:O},reset:{placement:$}}:{}}}};function ye(t){return me(t)?(t.nodeName||"").toLowerCase():"#document"}function ge(t){var o;return(null==t||null==(o=t.ownerDocument)?void 0:o.defaultView)||window}function be(t){var o;return null==(o=(me(t)?t.ownerDocument:t.document)||window.document)?void 0:o.documentElement}function me(t){return t instanceof Node||t instanceof ge(t).Node}function ve(t){return t instanceof Element||t instanceof ge(t).Element}function xe(t){return t instanceof HTMLElement||t instanceof ge(t).HTMLElement}function Oe(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof ge(t).ShadowRoot)}function Ne(t){const{overflow:o,overflowX:e,overflowY:i,display:r}=ke(t);return/auto|scroll|overlay|hidden|clip/.test(o+i+e)&&!["inline","contents"].includes(r)}function Se(t){return["table","td","th"].includes(ye(t))}function we(t){const o=$e(),e=ke(t);return"none"!==e.transform||"none"!==e.perspective||!!e.containerType&&"normal"!==e.containerType||!o&&!!e.backdropFilter&&"none"!==e.backdropFilter||!o&&!!e.filter&&"none"!==e.filter||["transform","perspective","filter"].some((t=>(e.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(e.contain||"").includes(t)))}function $e(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ce(t){return["html","body","#document"].includes(ye(t))}function ke(t){return ge(t).getComputedStyle(t)}function Ie(t){return ve(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ee(t){if("html"===ye(t))return t;const o=t.assignedSlot||t.parentNode||Oe(t)&&t.host||be(t);return Oe(o)?o.host:o}function Re(t){const o=Ee(t);return Ce(o)?t.ownerDocument?t.ownerDocument.body:t.body:xe(o)&&Ne(o)?o:Re(o)}function Ue(t,o,e){var i;void 0===o&&(o=[]),void 0===e&&(e=!0);const r=Re(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=ge(r);return n?o.concat(a,a.visualViewport||[],Ne(r)?r:[],a.frameElement&&e?Ue(a.frameElement):[]):o.concat(r,Ue(r,[],e))}function Le(t){const o=ke(t);let e=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const r=xe(t),n=r?t.offsetWidth:e,a=r?t.offsetHeight:i,s=Qo(e)!==n||Qo(i)!==a;return s&&(e=n,i=a),{width:e,height:i,$:s}}function We(t){return ve(t)?t:t.contextElement}function ze(t){const o=We(t);if(!xe(o))return Xo(1);const e=o.getBoundingClientRect(),{width:i,height:r,$:n}=Le(o);let a=(n?Qo(e.width):e.width)/i,s=(n?Qo(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ae=Xo(0);function De(t){const o=ge(t);return $e()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Ae}function Ke(t,o,e,i){void 0===o&&(o=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),n=We(t);let a=Xo(1);o&&(i?ve(i)&&(a=ze(i)):a=ze(t));const s=function(t,o,e){return void 0===o&&(o=!1),!(!e||o&&e!==ge(t))&&o}(n,e,i)?De(n):Xo(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(n){const t=ge(n),o=i&&ve(i)?ge(i):i;let e=t.frameElement;for(;e&&i&&o!==t;){const t=ze(e),o=e.getBoundingClientRect(),i=ke(e),r=o.left+(e.clientLeft+parseFloat(i.paddingLeft))*t.x,n=o.top+(e.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,p*=t.x,f*=t.y,l+=r,c+=n,e=ge(e).frameElement}}return pe({width:p,height:f,x:l,y:c})}function Be(t){return Ke(be(t)).left+Ie(t).scrollLeft}function Ze(t,o,e){let i;if("viewport"===o)i=function(t,o){const e=ge(t),i=be(t),r=e.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=$e();(!t||t&&"fixed"===o)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,e);else if("document"===o)i=function(t){const o=be(t),e=Ie(t),i=t.ownerDocument.body,r=Yo(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),n=Yo(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Be(t);const s=-e.scrollTop;return"rtl"===ke(i).direction&&(a+=Yo(o.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(be(t));else if(ve(o))i=function(t,o){const e=Ke(t,!0,"fixed"===o),i=e.top+t.clientTop,r=e.left+t.clientLeft,n=xe(t)?ze(t):Xo(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(o,e);else{const e=De(t);i={...o,x:o.x-e.x,y:o.y-e.y}}return pe(i)}function Fe(t,o){const e=Ee(t);return!(e===o||!ve(e)||Ce(e))&&("fixed"===ke(e).position||Fe(e,o))}function Te(t,o,e){const i=xe(o),r=be(o),n="fixed"===e,a=Ke(t,!0,n,o);let s={scrollLeft:0,scrollTop:0};const l=Xo(0);if(i||!i&&!n)if(("body"!==ye(o)||Ne(r))&&(s=Ie(o)),i){const t=Ke(o,!0,n,o);l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}else r&&(l.x=Be(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function He(t,o){return xe(t)&&"fixed"!==ke(t).position?o?o(t):t.offsetParent:null}function Pe(t,o){const e=ge(t);if(!xe(t))return e;let i=He(t,o);for(;i&&Se(i)&&"static"===ke(i).position;)i=He(i,o);return i&&("html"===ye(i)||"body"===ye(i)&&"static"===ke(i).position&&!we(i))?e:i||function(t){let o=Ee(t);for(;xe(o)&&!Ce(o);){if(we(o))return o;o=Ee(o)}return null}(t)||e}const Me={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:o,offsetParent:e,strategy:i}=t;const r=xe(e),n=be(e);if(e===n)return o;let a={scrollLeft:0,scrollTop:0},s=Xo(1);const l=Xo(0);if((r||!r&&"fixed"!==i)&&(("body"!==ye(e)||Ne(n))&&(a=Ie(e)),xe(e))){const t=Ke(e);s=ze(e),l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-a.scrollLeft*s.x+l.x,y:o.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:be,getClippingRect:function(t){let{element:o,boundary:e,rootBoundary:i,strategy:r}=t;const n="clippingAncestors"===e?function(t,o){const e=o.get(t);if(e)return e;let i=Ue(t,[],!1).filter((t=>ve(t)&&"body"!==ye(t))),r=null;const n="fixed"===ke(t).position;let a=n?Ee(t):t;for(;ve(a)&&!Ce(a);){const o=ke(a),e=we(a);e||"fixed"!==o.position||(r=null),(n?!e&&!r:!e&&"static"===o.position&&r&&["absolute","fixed"].includes(r.position)||Ne(a)&&!e&&Fe(t,a))?i=i.filter((t=>t!==a)):r=o,a=Ee(a)}return o.set(t,i),i}(o,this._c):[].concat(e),a=[...n,i],s=a[0],l=a.reduce(((t,e)=>{const i=Ze(o,e,r);return t.top=Yo(i.top,t.top),t.right=qo(i.right,t.right),t.bottom=qo(i.bottom,t.bottom),t.left=Yo(i.left,t.left),t}),Ze(o,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Pe,getElementRects:async function(t){let{reference:o,floating:e,strategy:i}=t;const r=this.getOffsetParent||Pe,n=this.getDimensions;return{reference:Te(o,await r(e),i),floating:{x:0,y:0,...await n(e)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Le(t)},getScale:ze,isElement:ve,isRTL:function(t){return"rtl"===ke(t).direction}},je=(t,o,e)=>{const i=new Map,r={platform:Me,...e},n={...r.platform,_c:i};return(async(t,o,e)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=e,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(o));let c=await a.getElementRects({reference:t,floating:o,strategy:r}),{x:p,y:f}=fe(c,i,l),h=i,d={},u=0;for(let e=0;e<s.length;e++){const{name:n,fn:y}=s[e],{x:g,y:b,data:m,reset:v}=await y({x:p,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:o}});p=null!=g?g:p,f=null!=b?b:f,d={...d,[n]:{...d[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:o,strategy:r}):v.rects),({x:p,y:f}=fe(c,h,l))),e=-1)}return{x:p,y:f,placement:h,strategy:r,middlewareData:d}})(t,o,{...r,platform:n})};function _e(t){return function(t){for(let o=t;o;o=Ge(o))if(o instanceof Element&&"none"===getComputedStyle(o).display)return null;for(let o=Ge(t);o;o=Ge(o)){if(!(o instanceof Element))continue;const t=getComputedStyle(o);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return o;if("BODY"===o.tagName)return o}}return null}(t)}function Ge(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var Ve,qe,Ye,Qe=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Xe extends o.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 o.Debouncer,this.revealDebouncer=new o.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
530
|
+
`,Go=["start","end"],Vo=["top","right","bottom","left"].reduce(((t,o)=>t.concat(o,o+"-"+Go[0],o+"-"+Go[1])),[]),qo=Math.min,Yo=Math.max,Qo=Math.round,Xo=t=>({x:t,y:t}),Jo={left:"right",right:"left",bottom:"top",top:"bottom"},te={start:"end",end:"start"};function oe(t,o,e){return Yo(t,qo(o,e))}function ee(t,o){return"function"==typeof t?t(o):t}function ie(t){return t.split("-")[0]}function re(t){return t.split("-")[1]}function ne(t){return"x"===t?"y":"x"}function ae(t){return"y"===t?"height":"width"}function se(t){return["top","bottom"].includes(ie(t))?"y":"x"}function le(t){return ne(se(t))}function ce(t){return t.replace(/left|right|bottom|top/g,(t=>Jo[t]))}function pe(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function fe(t,o,e){let{reference:i,floating:r}=t;const n=se(o),a=le(o),s=ae(a),l=ie(o),c="y"===n,p=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,h=i[s]/2-r[s]/2;let d;switch(l){case"top":d={x:p,y:i.y-r.height};break;case"bottom":d={x:p,y:i.y+i.height};break;case"right":d={x:i.x+i.width,y:f};break;case"left":d={x:i.x-r.width,y:f};break;default:d={x:i.x,y:i.y}}switch(re(o)){case"start":d[a]-=h*(e&&c?-1:1);break;case"end":d[a]+=h*(e&&c?-1:1)}return d}async function he(t,o){var e;void 0===o&&(o={});const{x:i,y:r,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:p="viewport",elementContext:f="floating",altBoundary:h=!1,padding:d=0}=ee(o,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}}(d),y=s[h?"floating"===f?"reference":"floating":f],g=pe(await n.getClippingRect({element:null==(e=await(null==n.isElement?void 0:n.isElement(y)))||e?y:y.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:c,rootBoundary:p,strategy:l})),b="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=pe(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({rect:b,offsetParent:m,strategy:l}):b);return{top:(g.top-x.top+u.top)/v.y,bottom:(x.bottom-g.bottom+u.bottom)/v.y,left:(g.left-x.left+u.left)/v.x,right:(x.right-g.right+u.right)/v.x}}function de(t,o,e){return(t?[...e.filter((o=>re(o)===t)),...e.filter((o=>re(o)!==t))]:e.filter((t=>ie(t)===t))).filter((e=>!t||(re(e)===t||!!o&&function(t){return t.replace(/start|end/g,(t=>te[t]))}(e)!==e)))}const ue=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(o){var e,i,r;const{rects:n,middlewareData:a,placement:s,platform:l,elements:c}=o,{crossAxis:p=!1,alignment:f,allowedPlacements:h=Vo,autoAlignment:d=!0,...u}=ee(t,o),y=void 0!==f||h===Vo?de(f||null,d,h):h,g=await he(o,u),b=(null==(e=a.autoPlacement)?void 0:e.index)||0,m=y[b];if(null==m)return{};const v=function(t,o,e){void 0===e&&(e=!1);const i=re(t),r=le(t),n=ae(r);let a="x"===r?i===(e?"end":"start")?"right":"left":"start"===i?"bottom":"top";return o.reference[n]>o.floating[n]&&(a=ce(a)),[a,ce(a)]}(m,n,await(null==l.isRTL?void 0:l.isRTL(c.floating)));if(s!==m)return{reset:{placement:y[0]}};const x=[g[ie(m)],g[v[0]],g[v[1]]],O=[...(null==(i=a.autoPlacement)?void 0:i.overflows)||[],{placement:m,overflows:x}],N=y[b+1];if(N)return{data:{index:b+1,overflows:O},reset:{placement:N}};const S=O.map((t=>{const o=re(t.placement);return[t.placement,o&&p?t.overflows.slice(0,2).reduce(((t,o)=>t+o),0):t.overflows[0],t.overflows]})).sort(((t,o)=>t[1]-o[1])),w=S.filter((t=>t[2].slice(0,re(t[0])?2:3).every((t=>t<=0)))),$=(null==(r=w[0])?void 0:r[0])||S[0][0];return $!==s?{data:{index:b+1,overflows:O},reset:{placement:$}}:{}}}};function ye(t){return me(t)?(t.nodeName||"").toLowerCase():"#document"}function ge(t){var o;return(null==t||null==(o=t.ownerDocument)?void 0:o.defaultView)||window}function be(t){var o;return null==(o=(me(t)?t.ownerDocument:t.document)||window.document)?void 0:o.documentElement}function me(t){return t instanceof Node||t instanceof ge(t).Node}function ve(t){return t instanceof Element||t instanceof ge(t).Element}function xe(t){return t instanceof HTMLElement||t instanceof ge(t).HTMLElement}function Oe(t){return"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof ge(t).ShadowRoot)}function Ne(t){const{overflow:o,overflowX:e,overflowY:i,display:r}=ke(t);return/auto|scroll|overlay|hidden|clip/.test(o+i+e)&&!["inline","contents"].includes(r)}function Se(t){return["table","td","th"].includes(ye(t))}function we(t){const o=$e(),e=ke(t);return"none"!==e.transform||"none"!==e.perspective||!!e.containerType&&"normal"!==e.containerType||!o&&!!e.backdropFilter&&"none"!==e.backdropFilter||!o&&!!e.filter&&"none"!==e.filter||["transform","perspective","filter"].some((t=>(e.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(e.contain||"").includes(t)))}function $e(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ce(t){return["html","body","#document"].includes(ye(t))}function ke(t){return ge(t).getComputedStyle(t)}function Ie(t){return ve(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Ee(t){if("html"===ye(t))return t;const o=t.assignedSlot||t.parentNode||Oe(t)&&t.host||be(t);return Oe(o)?o.host:o}function Re(t){const o=Ee(t);return Ce(o)?t.ownerDocument?t.ownerDocument.body:t.body:xe(o)&&Ne(o)?o:Re(o)}function Ue(t,o,e){var i;void 0===o&&(o=[]),void 0===e&&(e=!0);const r=Re(t),n=r===(null==(i=t.ownerDocument)?void 0:i.body),a=ge(r);return n?o.concat(a,a.visualViewport||[],Ne(r)?r:[],a.frameElement&&e?Ue(a.frameElement):[]):o.concat(r,Ue(r,[],e))}function Le(t){const o=ke(t);let e=parseFloat(o.width)||0,i=parseFloat(o.height)||0;const r=xe(t),n=r?t.offsetWidth:e,a=r?t.offsetHeight:i,s=Qo(e)!==n||Qo(i)!==a;return s&&(e=n,i=a),{width:e,height:i,$:s}}function We(t){return ve(t)?t:t.contextElement}function ze(t){const o=We(t);if(!xe(o))return Xo(1);const e=o.getBoundingClientRect(),{width:i,height:r,$:n}=Le(o);let a=(n?Qo(e.width):e.width)/i,s=(n?Qo(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ae=Xo(0);function De(t){const o=ge(t);return $e()&&o.visualViewport?{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}:Ae}function Ke(t,o,e,i){void 0===o&&(o=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),n=We(t);let a=Xo(1);o&&(i?ve(i)&&(a=ze(i)):a=ze(t));const s=function(t,o,e){return void 0===o&&(o=!1),!(!e||o&&e!==ge(t))&&o}(n,e,i)?De(n):Xo(0);let l=(r.left+s.x)/a.x,c=(r.top+s.y)/a.y,p=r.width/a.x,f=r.height/a.y;if(n){const t=ge(n),o=i&&ve(i)?ge(i):i;let e=t.frameElement;for(;e&&i&&o!==t;){const t=ze(e),o=e.getBoundingClientRect(),i=ke(e),r=o.left+(e.clientLeft+parseFloat(i.paddingLeft))*t.x,n=o.top+(e.clientTop+parseFloat(i.paddingTop))*t.y;l*=t.x,c*=t.y,p*=t.x,f*=t.y,l+=r,c+=n,e=ge(e).frameElement}}return pe({width:p,height:f,x:l,y:c})}function Be(t){return Ke(be(t)).left+Ie(t).scrollLeft}function Ze(t,o,e){let i;if("viewport"===o)i=function(t,o){const e=ge(t),i=be(t),r=e.visualViewport;let n=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){n=r.width,a=r.height;const t=$e();(!t||t&&"fixed"===o)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,e);else if("document"===o)i=function(t){const o=be(t),e=Ie(t),i=t.ownerDocument.body,r=Yo(o.scrollWidth,o.clientWidth,i.scrollWidth,i.clientWidth),n=Yo(o.scrollHeight,o.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Be(t);const s=-e.scrollTop;return"rtl"===ke(i).direction&&(a+=Yo(o.clientWidth,i.clientWidth)-r),{width:r,height:n,x:a,y:s}}(be(t));else if(ve(o))i=function(t,o){const e=Ke(t,!0,"fixed"===o),i=e.top+t.clientTop,r=e.left+t.clientLeft,n=xe(t)?ze(t):Xo(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:r*n.x,y:i*n.y}}(o,e);else{const e=De(t);i={...o,x:o.x-e.x,y:o.y-e.y}}return pe(i)}function Fe(t,o){const e=Ee(t);return!(e===o||!ve(e)||Ce(e))&&("fixed"===ke(e).position||Fe(e,o))}function Te(t,o,e){const i=xe(o),r=be(o),n="fixed"===e,a=Ke(t,!0,n,o);let s={scrollLeft:0,scrollTop:0};const l=Xo(0);if(i||!i&&!n)if(("body"!==ye(o)||Ne(r))&&(s=Ie(o)),i){const t=Ke(o,!0,n,o);l.x=t.x+o.clientLeft,l.y=t.y+o.clientTop}else r&&(l.x=Be(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function He(t,o){return xe(t)&&"fixed"!==ke(t).position?o?o(t):t.offsetParent:null}function Pe(t,o){const e=ge(t);if(!xe(t))return e;let i=He(t,o);for(;i&&Se(i)&&"static"===ke(i).position;)i=He(i,o);return i&&("html"===ye(i)||"body"===ye(i)&&"static"===ke(i).position&&!we(i))?e:i||function(t){let o=Ee(t);for(;xe(o)&&!Ce(o);){if(we(o))return o;o=Ee(o)}return null}(t)||e}const Me={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{rect:o,offsetParent:e,strategy:i}=t;const r=xe(e),n=be(e);if(e===n)return o;let a={scrollLeft:0,scrollTop:0},s=Xo(1);const l=Xo(0);if((r||!r&&"fixed"!==i)&&(("body"!==ye(e)||Ne(n))&&(a=Ie(e)),xe(e))){const t=Ke(e);s=ze(e),l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}return{width:o.width*s.x,height:o.height*s.y,x:o.x*s.x-a.scrollLeft*s.x+l.x,y:o.y*s.y-a.scrollTop*s.y+l.y}},getDocumentElement:be,getClippingRect:function(t){let{element:o,boundary:e,rootBoundary:i,strategy:r}=t;const n=[..."clippingAncestors"===e?function(t,o){const e=o.get(t);if(e)return e;let i=Ue(t,[],!1).filter((t=>ve(t)&&"body"!==ye(t))),r=null;const n="fixed"===ke(t).position;let a=n?Ee(t):t;for(;ve(a)&&!Ce(a);){const o=ke(a),e=we(a);e||"fixed"!==o.position||(r=null),(n?!e&&!r:!e&&"static"===o.position&&r&&["absolute","fixed"].includes(r.position)||Ne(a)&&!e&&Fe(t,a))?i=i.filter((t=>t!==a)):r=o,a=Ee(a)}return o.set(t,i),i}(o,this._c):[].concat(e),i],a=n[0],s=n.reduce(((t,e)=>{const i=Ze(o,e,r);return t.top=Yo(i.top,t.top),t.right=qo(i.right,t.right),t.bottom=qo(i.bottom,t.bottom),t.left=Yo(i.left,t.left),t}),Ze(o,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Pe,getElementRects:async function(t){let{reference:o,floating:e,strategy:i}=t;const r=this.getOffsetParent||Pe,n=this.getDimensions;return{reference:Te(o,await r(e),i),floating:{x:0,y:0,...await n(e)}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){return Le(t)},getScale:ze,isElement:ve,isRTL:function(t){return"rtl"===ke(t).direction}},je=(t,o,e)=>{const i=new Map,r={platform:Me,...e},n={...r.platform,_c:i};return(async(t,o,e)=>{const{placement:i="bottom",strategy:r="absolute",middleware:n=[],platform:a}=e,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(o));let c=await a.getElementRects({reference:t,floating:o,strategy:r}),{x:p,y:f}=fe(c,i,l),h=i,d={},u=0;for(let e=0;e<s.length;e++){const{name:n,fn:y}=s[e],{x:g,y:b,data:m,reset:v}=await y({x:p,y:f,initialPlacement:i,placement:h,strategy:r,middlewareData:d,rects:c,platform:a,elements:{reference:t,floating:o}});p=null!=g?g:p,f=null!=b?b:f,d={...d,[n]:{...d[n],...m}},v&&u<=50&&(u++,"object"==typeof v&&(v.placement&&(h=v.placement),v.rects&&(c=!0===v.rects?await a.getElementRects({reference:t,floating:o,strategy:r}):v.rects),({x:p,y:f}=fe(c,h,l))),e=-1)}return{x:p,y:f,placement:h,strategy:r,middlewareData:d}})(t,o,{...r,platform:n})};function _e(t){return function(t){for(let o=t;o;o=Ge(o))if(o instanceof Element&&"none"===getComputedStyle(o).display)return null;for(let o=Ge(t);o;o=Ge(o)){if(!(o instanceof Element))continue;const t=getComputedStyle(o);if("contents"!==t.display){if("static"!==t.position||"none"!==t.filter)return o;if("BODY"===o.tagName)return o}}return null}(t)}function Ge(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}var Ve,qe,Ye,Qe=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Xe extends o.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 o.Debouncer,this.revealDebouncer=new o.Debouncer}get validPosition(){return this.validPositions.has(this.position)?this.position:"bottom"}render(){return e.html`
|
|
531
531
|
<div part="container"
|
|
532
532
|
class="ft-tooltip--container ${this.inline?"ft-tooltip--inline":""}"
|
|
533
533
|
@mouseenter=${this.onHover}
|
|
@@ -1482,16 +1482,16 @@ const M=Symbol.for(""),j=t=>{if(t?.r===M)return t?._$litStatic$},_=t=>({_$litSta
|
|
|
1482
1482
|
<slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
|
|
1483
1483
|
`}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Xi.elementDefinitions={},Qi([i.property({type:String})],Xi.prototype,"label",void 0),Qi([i.property({type:Object,converter:t=>t})],Xi.prototype,"value",void 0),Qi([i.property({type:Boolean,reflect:!0})],Xi.prototype,"selected",void 0),Qi([i.property({type:Object})],Xi.prototype,"subOptions",void 0),Qi([o.jsonProperty({})],Xi.prototype,"renderOption",void 0),Qi([i.query(".ft-filter-option--slot")],Xi.prototype,"slotElement",void 0),o.customElement("ft-filter")(Yi),o.customElement("ft-filter-option")(Xi);const Ji=e.css`
|
|
1484
1484
|
`,tr=e.css`
|
|
1485
|
-
`,or=o.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}});class er{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=or.getState(),i=null!=t?t:e;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static get(t){var o;return null!=t?er.build(t):null!==(o=er.API)&&void 0!==o?o:er.API=er.build()}static await(t){return new Promise((o=>{let e=er.get(t);if(e)o(e);else{const i=or.subscribe((()=>{e=er.get(t),e&&(i(),o(e))}))}}))}}var
|
|
1485
|
+
`,or=o.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}});class er{static build(t){const{baseUrl:o,apiIntegrationIdentifier:e}=or.getState(),i=null!=t?t:e;if(o&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(o,i,!0)}static get(t){var o;return null!=t?er.build(t):null!==(o=er.API)&&void 0!==o?o:er.API=er.build()}static await(t){return new Promise((o=>{let e=er.get(t);if(e)o(e);else{const i=or.subscribe((()=>{e=er.get(t),e&&(i(),o(e))}))}}))}}class ir{constructor(t=!0,e){var i;this.overrideApi=e;let r=this.constructor;r.commonCache=null!==(i=r.commonCache)&&void 0!==i?i:new o.CacheRegistry,this.cache=t?r.commonCache:new o.CacheRegistry}get api(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:er.get()}get awaitApi(){var t;return null!==(t=this.overrideApi)&&void 0!==t?t:er.await()}clearCache(){this.cache.clearAll()}}var rr;const nr=Symbol("clearAfterUnitTest");class ar extends ir{constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[rr]=()=>{this.defaultMessages={},this.cache=new o.CacheRegistry,this.listeners={}},this.currentUiLocale=or.getState().uiLocale,or.subscribe((()=>this.clearWhenUiLocaleChanges()))}clearWhenUiLocaleChanges(){const{uiLocale:t}=or.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){const o=t.name.toLowerCase();this.cache.setFinal(o,t),this.notify(o)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,e){var i;if(t=t.toLowerCase(),Object.keys(e).length>0){const r={...null!==(i=this.defaultMessages[t])&&void 0!==i?i:{},...e};o.deepEqual(this.defaultMessages[t],r)||(this.defaultMessages[t]=r,await this.notify(t))}await this.fetchContext(t)}resolveMessage(t,e,...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 o.ParametrizedLabelResolver(null!==(a=this.defaultMessages[t])&&void 0!==a?a:{},s).resolve(e,...i)}async fetchContext(t){if(!this.cache.has(t))try{await this.cache.get(t,(()=>this.messageContextProvider(this.currentUiLocale,t))),await this.notify(t)}catch(t){console.error(t)}}subscribe(t,o){var e;return t=t.toLowerCase(),this.listeners[t]=null!==(e=this.listeners[t])&&void 0!==e?e:new Set,this.listeners[t].add(o),()=>{var e;return null===(e=this.listeners[t])||void 0===e?void 0:e.delete(o)}}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=>o.delay(0).then((()=>t())).catch((()=>null)))))}}rr=nr,null==window.FluidTopicsI18nService&&(window.FluidTopicsI18nService=new class extends ar{constructor(){super((async(t,o)=>(await this.awaitApi).getFluidTopicsMessageContext(t,o)))}}),null==window.FluidTopicsCustomI18nService&&(window.FluidTopicsCustomI18nService=new class extends ar{constructor(){super((async(t,o)=>(await this.awaitApi).getCustomMessageContext(t,o)))}});const sr=window.FluidTopicsI18nService,lr=window.FluidTopicsCustomI18nService;var cr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class pr extends o.FtLitElement{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.messageContexts=[],this.apiProvider=()=>er.get(),this.cache=new o.CacheRegistry,this.cleanSessionDebouncer=new o.Debouncer}render(){return e.html`
|
|
1486
1486
|
<slot></slot>
|
|
1487
|
-
`}update(t){super.update(t),t.has("baseUrl")&&(or.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&or.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&or.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&or.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&or.actions.noCustom(this.noCustom),t.has("editorMode")&&or.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&or.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&or.actions.session(this.session),t.has("availableUiLocales")&&or.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>
|
|
1487
|
+
`}update(t){super.update(t),t.has("baseUrl")&&(or.actions.baseUrl(this.baseUrl),window.fluidTopicsBaseUrl=this.baseUrl),t.has("apiIntegrationIdentifier")&&or.actions.apiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("uiLocale")&&or.actions.uiLocale(this.uiLocale),t.has("metadataConfiguration")&&or.actions.metadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&or.actions.noCustom(this.noCustom),t.has("editorMode")&&or.actions.editorMode(this.editorMode),t.has("noCustomComponent")&&or.actions.noCustomComponent(this.noCustomComponent),t.has("session")&&or.actions.session(this.session),t.has("availableUiLocales")&&or.actions.availableUiLocales(Array.isArray(this.availableUiLocales)?this.availableUiLocales:[]),t.has("messageContexts")&&null!=this.messageContexts&&this.messageContexts.forEach((t=>sr.addContext(t))),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()))}}pr.elementDefinitions={},pr.styles=tr,cr([i.property()],pr.prototype,"baseUrl",void 0),cr([i.property()],pr.prototype,"apiIntegrationIdentifier",void 0),cr([i.property()],pr.prototype,"uiLocale",void 0),cr([o.jsonProperty(null)],pr.prototype,"availableUiLocales",void 0),cr([o.jsonProperty(null)],pr.prototype,"metadataConfiguration",void 0),cr([i.property({type:Boolean})],pr.prototype,"editorMode",void 0),cr([i.property({type:Boolean})],pr.prototype,"noCustom",void 0),cr([i.property({converter:{fromAttribute:t=>"false"!==t&&("true"===t||null!=t&&t)}})],pr.prototype,"noCustomComponent",void 0),cr([i.property({type:Boolean})],pr.prototype,"withManualResources",void 0),cr([o.jsonProperty([])],pr.prototype,"messageContexts",void 0),cr([o.jsonProperty(void 0)],pr.prototype,"session",void 0),cr([i.property({type:Object})],pr.prototype,"apiProvider",void 0);class fr extends ir{async listMySearches(){let t=or.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-searches",(async()=>(await this.awaitApi).listMySearches(t.profile.userId)),3e5):[]}}class hr extends ir{async listMyBookmarks(){let t=or.getState().session;return(null==t?void 0:t.sessionAuthenticated)?this.cache.get("my-bookmarks",(async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId)),3e5):[]}}const dr=o.FtReduxStore.get({name:"ft-user-assets",initialState:{savedSearches:void 0,bookmarks:void 0}});const ur=new class{constructor(){this.currentSession=or.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new hr,this.savedSearchesService=new fr,or.subscribe((()=>this.reloadWhenUserSessionChanges()))}reloadWhenUserSessionChanges(){var t;const{session:e}=or.getState();o.deepEqual(null===(t=this.currentSession)||void 0===t?void 0:t.profile,null==e?void 0:e.profile)||(this.currentSession=e,this.clearMySearches(),this.reloadBookmarks())}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),dr.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),dr.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();const t=await this.savedSearchesService.listMySearches();dr.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 o=(null===(t=this.currentSession)||void 0===t?void 0:t.sessionAuthenticated)?await this.bookmarksService.listMyBookmarks():void 0;dr.actions.bookmarks(o)}}};o.customElement("ft-app-context")(pr);var yr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};const gr=Symbol("i18nAttributes"),br=Symbol("i18nProperties"),mr=Symbol("i18nUnsubs");function vr(t){var o;class e extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[o]=new Map}get i18nService(){return this.useCustomMessageContexts?lr:sr}i18n(t,o,...e){var i;if("string"==typeof t)return this.i18nService.resolveMessage(t,o,...e);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 o,e;null===(o=this[gr])||void 0===o||o.forEach(((o,e)=>{var i;const r=this.getI18nAttributeValue(e);(null===(i=null==r?void 0:r.context)||void 0===i?void 0:i.toLowerCase())===t.toLowerCase()&&this.updateI18nAttributeMessage(e,r,o)})),null===(e=this[br])||void 0===e||e.forEach(((o,e)=>{o.context.toLowerCase()===t.toLowerCase()&&(this[e]=this.i18n(o))})),setTimeout((()=>this.requestUpdate()),0)}updateI18nAttributeMessage(t,o,e){this[t]={...o,message:this.i18n({context:o.context,key:o.key,...e})}}update(t){var o,e;super.update(t),null===(o=this[gr])||void 0===o||o.forEach(((o,e)=>{const i=this.getI18nAttributeValue(e);(null==i?void 0:i.context)&&i.key&&(t.has(e)||null!=o.argsProvider)&&(t.has(e)&&this.addI18nContext(i.context),this.updateI18nAttributeMessage(e,i,o))})),null===(e=this[br])||void 0===e||e.forEach(((t,o)=>{null!=t.argsProvider&&(this[o]=this.i18n(t))}))}getI18nAttributeValue(t){return this[t]}connectedCallback(){var t,o,e,i;super.connectedCallback(),new Set([...null!==(o=null===(t=this[br])||void 0===t?void 0:t.values())&&void 0!==o?o:[],...[...null!==(i=null===(e=this[gr])||void 0===e?void 0:e.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,o){t=t.toLowerCase(),this[mr].has(t)||this[mr].set(t,this.i18nService.subscribe(t,(()=>this.onI18nUpdate(t)))),this.i18nService.prepareContext(t,null!=o?o:{})}addI18nContext(t,o){this.addI18nMessages("string"==typeof t?t:t.name,o)}disconnectedCallback(){super.disconnectedCallback(),this[mr].forEach((t=>t())),this[mr].clear()}}return o=mr,yr([i.property({type:Boolean})],e.prototype,"useCustomMessageContexts",void 0),e}class xr extends(vr(o.FtLitElement)){}class Or extends(vr(o.FtLitElementRedux)){}var Nr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class Sr extends Or{constructor(){super(),this.editorMode=!1,this.addStore(or)}render(){return this.key&&this.context?e.html`
|
|
1488
1488
|
<span class="ft-i18n">
|
|
1489
1489
|
${this.i18n(this.context,this.key,...Array.isArray(this.args)?this.args:[])}
|
|
1490
1490
|
</span>
|
|
1491
|
-
`:this.editorMode?"Select a context and a label key.":e.nothing}update(t){var o;super.update(t),["context","key","defaultMessage"].some((o=>t.has(o)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(o=this.defaultMessage)&&void 0!==o?o:""})}}Sr.elementDefinitions={},Sr.styles=Ji,Nr([o.redux()],Sr.prototype,"editorMode",void 0),Nr([i.property()],Sr.prototype,"context",void 0),Nr([i.property()],Sr.prototype,"key",void 0),Nr([o.jsonProperty([])],Sr.prototype,"args",void 0),Nr([i.property()],Sr.prototype,"defaultMessage",void 0);class wr{static build(t){return new wr(t)}static fromGwt(t){return new wr(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,o)=>{const e=o;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,o)=>(...t)=>ar.resolveMessage(this.name,o,...t)})}}o.customElement("ft-i18n")(Sr);const $r={setRequest:(t,o)=>{t.request=o.payload},setRequestQuery:(t,o)=>{t.request.query=o.payload},setRequestContentLocale:(t,o)=>{t.request.contentLocale=o.payload},setPageSize:(t,o)=>{t.request.paging.perPage=o.payload},setPageNumber:(t,o)=>{t.request.paging.page=o.payload},setRequestSort:(t,o)=>{t.request.sort=o.payload},setRequestFilters:(t,o)=>{t.request.filters=o.payload},setRequestFacets:(t,o)=>{t.request.facets=o.payload},setRequestVirtualField:(t,o)=>{t.request.virtualField=o.payload},setRequestScope:(t,o)=>{t.request.scope=o.payload},setResults:(t,o)=>{t.results=o.payload},setFacets:(t,o)=>{t.facets=o.payload},setSpellcheck:(t,o)=>{t.spellcheck=o.payload},setLocales:(t,o)=>{t.locales=o.payload},setPaging:(t,o)=>{t.paging=o.payload},setLiveQuery:(t,o)=>{t.liveQuery=o.payload},setSuggestResults:(t,o)=>{t.suggestResults=o.payload}};var Cr,kr,Ir,Er,Rr,Ur,Lr,Wr,zr,Ar,Dr,Kr,Br,Zr,Fr,Tr,Hr,Pr;!function(t){!function(o){var e={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(e.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 o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function l(t){this.map={},t instanceof l?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var o=new FileReader,e=p(o);return o.readAsArrayBuffer(t),e}function h(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=h(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):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.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,o,e,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=p(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),i=0;i<o.length;i++)e[i]=String.fromCharCode(o[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,o){t=n(t),o=a(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},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,o){this.map[n(t)]=a(o)},l.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),s(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,o){var e,i,r=(o=o||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.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=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new l(o.headers)),this.method=(e=o.method||this.method||"GET",i=e.toUpperCase(),u.indexOf(i)>-1?i:e),this.mode=o.mode||this.mode||null,this.signal=o.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 g(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(i),decodeURIComponent(r))}})),o}function b(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new l(o.headers),this.url=o.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new b(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function v(t,i){return new Promise((function(r,n){var a=new y(t,i);if(a.signal&&a.signal.aborted)return n(new o.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,o,e={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",o=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();o.append(i,r)}})),o)};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new b(i,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new o.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&&e.blob&&(s.responseType="blob"),a.headers.forEach((function(t,o){s.setRequestHeader(o,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=y,t.Response=b),o.Headers=l,o.Request=y,o.Response=b,o.fetch=v,Object.defineProperty(o,"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"}(kr||(kr={})),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"}(Ir||(Ir={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Er||(Er={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Rr||(Rr={})),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"}(Lr||(Lr={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Wr||(Wr={})),function(t){t.ASC="ASC",t.DESC="DESC"}(zr||(zr={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ar||(Ar={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(Dr||(Dr={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Kr||(Kr={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Br||(Br={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Zr||(Zr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Fr||(Fr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(Tr||(Tr={})),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"}(Hr||(Hr={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(Pr||(Pr={})),Hr.PERSONAL_BOOK_SHARE_USER,Hr.PERSONAL_BOOK_USER,Hr.HTML_EXPORT_USER,Hr.PERSONAL_BOOK_USER,Hr.PDF_EXPORT_USER,Hr.PERSONAL_BOOK_USER,Hr.KHUB_ADMIN,Hr.CONTENT_PUBLISHER,Hr.ADMIN,Hr.KHUB_ADMIN,Hr.USERS_ADMIN,Hr.PORTAL_ADMIN,Hr.DEVELOPER,Hr.BETA_USER,Hr.DEBUG_USER;class Mr{static async build(){return new Mr(await er.await())}constructor(t){this.api=t,this.cache=new o.CacheRegistry,this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const jr=t=>t.request.virtualField===Dr.TITLE_ONLY&&t.request.scope===Tr.DOCUMENTS;class _r extends Event{constructor(){super(_r.eventName)}}_r.eventName="search-context-clear-all-filters";class Gr{static build(t){return new Gr((t=>o.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:$r}))(t.trim()||"context"),Mr.build)}constructor(t,e){this.store=t,this.serviceProvider=e,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new o.Debouncer(100),this.suggestDebouncer=new o.Debouncer(300)}async initService(){return this.service=await this.serviceProvider(),this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}async awaitService(){return o.waitFor((()=>this.service))}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let o=this.store.getState().locales,e=this.store.getState().request.contentLocale;if(t!=e){if(o){const i=t=>o.some((o=>o.lang==t));i(t)||(t=i(e)?e:o[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const o=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(o),this.store.actions.setPageNumber(1),o.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(Dr.TITLE_ONLY),this.store.actions.setRequestScope(Tr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Dr.EVERYWHERE),this.store.actions.setRequestScope(Tr.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return jr(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new _r)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,o){let e=this.facetIds.filter((o=>o!=t));o&&e.push(o),this.facetIds=e,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let o=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(o)}setFilter(t,o){let e=this.store.getState().request.filters,i={key:t,values:o,negative:!1},r=[...e.filter((o=>o.key!==t)),i];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}async launchSearch(){return await this.awaitService(),this.searchDebouncer.run((()=>this.fetchSearchData()))}async launchSuggest(){await this.awaitService(),this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let i=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==i.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=o.cancelable(this.service.launchSearch(i));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof o.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),i=e.request,r={input:e.liveQuery,filters:i.filters,sort:i.sort,contentLocale:i.contentLocale,scope:i.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=o.cancelable(this.service.launchSuggest(r));let n=await this.cancelableSuggest;this.store.actions.setSuggestResults(n.suggestions)}catch(t){t instanceof o.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var Vr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class qr extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Yr=Symbol("registerInterval");class Qr extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Yr]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Yr]):this.dispatchEvent(new qr)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=Yr,Vr([i.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}const Xr=wr.build("designedSearchType"),Jr={label:"Search scope",documentTitlesOnly:"Search in document titles only"},tn=e.css`
|
|
1492
|
-
`;var on=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class en extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class rn extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class nn extends CustomEvent{constructor(t,o,e){super("ft-search-results-change",{detail:{request:t,paging:o,spellcheck:e}})}}class an extends o.FtLitElementRedux{get stateManager(){
|
|
1491
|
+
`:this.editorMode?"Select a context and a label key.":e.nothing}update(t){var o;super.update(t),["context","key","defaultMessage"].some((o=>t.has(o)))&&this.context&&this.key&&this.addI18nMessages(this.context,{[this.key]:null!==(o=this.defaultMessage)&&void 0!==o?o:""})}}Sr.elementDefinitions={},Sr.styles=Ji,Nr([o.redux()],Sr.prototype,"editorMode",void 0),Nr([i.property()],Sr.prototype,"context",void 0),Nr([i.property()],Sr.prototype,"key",void 0),Nr([o.jsonProperty([])],Sr.prototype,"args",void 0),Nr([i.property()],Sr.prototype,"defaultMessage",void 0);class wr{static build(t){return new wr(t)}static fromGwt(t){return new wr(t)}constructor(t){this.name=t,this.properties=new Proxy({},{get:(t,o)=>{const e=o;return t=>({context:this.name,key:e,args:"function"==typeof t?void 0:t,argsProvider:"function"==typeof t?t:void 0})}}),this.messages=new Proxy({},{get:(t,o)=>(...t)=>sr.resolveMessage(this.name,o,...t)})}}o.customElement("ft-i18n")(Sr);const $r={setRequest:(t,o)=>{t.request=o.payload},setRequestQuery:(t,o)=>{t.request.query=o.payload},setRequestContentLocale:(t,o)=>{t.request.contentLocale=o.payload},setPageSize:(t,o)=>{t.request.paging.perPage=o.payload},setPageNumber:(t,o)=>{t.request.paging.page=o.payload},setRequestSort:(t,o)=>{t.request.sort=o.payload},setRequestFilters:(t,o)=>{t.request.filters=o.payload},setRequestFacets:(t,o)=>{t.request.facets=o.payload},setRequestVirtualField:(t,o)=>{t.request.virtualField=o.payload},setRequestScope:(t,o)=>{t.request.scope=o.payload},setResults:(t,o)=>{t.results=o.payload},setFacets:(t,o)=>{t.facets=o.payload},setSpellcheck:(t,o)=>{t.spellcheck=o.payload},setLocales:(t,o)=>{t.locales=o.payload},setPaging:(t,o)=>{t.paging=o.payload},setLiveQuery:(t,o)=>{t.liveQuery=o.payload},setSuggestResults:(t,o)=>{t.suggestResults=o.payload}};var Cr,kr,Ir,Er,Rr,Ur,Lr,Wr,zr,Ar,Dr,Kr,Br,Zr,Fr,Tr,Hr,Pr;!function(t){!function(o){var e={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(e.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 o={next:function(){var o=t.shift();return{done:void 0===o,value:o}}};return e.iterable&&(o[Symbol.iterator]=function(){return o}),o}function l(t){this.map={},t instanceof l?t.forEach((function(t,o){this.append(o,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(o){this.append(o,t[o])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function p(t){return new Promise((function(o,e){t.onload=function(){o(t.result)},t.onerror=function(){e(t.error)}}))}function f(t){var o=new FileReader,e=p(o);return o.readAsArrayBuffer(t),e}function h(t){if(t.slice)return t.slice(0);var o=new Uint8Array(t.byteLength);return o.set(new Uint8Array(t)),o.buffer}function d(){return this.bodyUsed=!1,this._initBody=function(t){var o;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:e.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:e.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():e.arrayBuffer&&e.blob&&((o=t)&&DataView.prototype.isPrototypeOf(o))?(this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):e.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||r(t))?this._bodyArrayBuffer=h(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):e.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},e.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,o,e,i=c(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,o=new FileReader,e=p(o),o.readAsText(t),e;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var o=new Uint8Array(t),e=new Array(o.length),i=0;i<o.length;i++)e[i]=String.fromCharCode(o[i]);return e.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},e.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(t,o){t=n(t),o=a(o);var e=this.map[t];this.map[t]=e?e+", "+o:o},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,o){this.map[n(t)]=a(o)},l.prototype.forEach=function(t,o){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(o,this.map[e],e,this)},l.prototype.keys=function(){var t=[];return this.forEach((function(o,e){t.push(e)})),s(t)},l.prototype.values=function(){var t=[];return this.forEach((function(o){t.push(o)})),s(t)},l.prototype.entries=function(){var t=[];return this.forEach((function(o,e){t.push([e,o])})),s(t)},e.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);var u=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,o){var e,i,r=(o=o||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,o.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=o.credentials||this.credentials||"same-origin",!o.headers&&this.headers||(this.headers=new l(o.headers)),this.method=(e=o.method||this.method||"GET",i=e.toUpperCase(),u.indexOf(i)>-1?i:e),this.mode=o.mode||this.mode||null,this.signal=o.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 g(t){var o=new FormData;return t.trim().split("&").forEach((function(t){if(t){var e=t.split("="),i=e.shift().replace(/\+/g," "),r=e.join("=").replace(/\+/g," ");o.append(decodeURIComponent(i),decodeURIComponent(r))}})),o}function b(t,o){o||(o={}),this.type="default",this.status=void 0===o.status?200:o.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in o?o.statusText:"OK",this.headers=new l(o.headers),this.url=o.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},d.call(y.prototype),d.call(b.prototype),b.prototype.clone=function(){return new b(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},b.error=function(){var t=new b(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];b.redirect=function(t,o){if(-1===m.indexOf(o))throw new RangeError("Invalid status code");return new b(null,{status:o,headers:{location:t}})},o.DOMException=t.DOMException;try{new o.DOMException}catch(t){o.DOMException=function(t,o){this.message=t,this.name=o;var e=Error(t);this.stack=e.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function v(t,i){return new Promise((function(r,n){var a=new y(t,i);if(a.signal&&a.signal.aborted)return n(new o.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,o,e={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",o=new l,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var e=t.split(":"),i=e.shift().trim();if(i){var r=e.join(":").trim();o.append(i,r)}})),o)};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;r(new b(i,e))},s.onerror=function(){n(new TypeError("Network request failed"))},s.ontimeout=function(){n(new TypeError("Network request failed"))},s.onabort=function(){n(new o.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&&e.blob&&(s.responseType="blob"),a.headers.forEach((function(t,o){s.setRequestHeader(o,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=y,t.Response=b),o.Headers=l,o.Request=y,o.Response=b,o.fetch=v,Object.defineProperty(o,"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"}(kr||(kr={})),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"}(Ir||(Ir={})),function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"}(Er||(Er={})),function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"}(Rr||(Rr={})),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"}(Lr||(Lr={})),function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"}(Wr||(Wr={})),function(t){t.ASC="ASC",t.DESC="DESC"}(zr||(zr={})),function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"}(Ar||(Ar={})),function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"}(Dr||(Dr={})),function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Kr||(Kr={})),function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"}(Br||(Br={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK"}(Zr||(Zr={})),function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC"}(Fr||(Fr={})),function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS"}(Tr||(Tr={})),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"}(Hr||(Hr={})),function(t){t.VALID="VALID",t.INVALID="INVALID"}(Pr||(Pr={})),Hr.PERSONAL_BOOK_SHARE_USER,Hr.PERSONAL_BOOK_USER,Hr.HTML_EXPORT_USER,Hr.PERSONAL_BOOK_USER,Hr.PDF_EXPORT_USER,Hr.PERSONAL_BOOK_USER,Hr.KHUB_ADMIN,Hr.CONTENT_PUBLISHER,Hr.ADMIN,Hr.KHUB_ADMIN,Hr.USERS_ADMIN,Hr.PORTAL_ADMIN,Hr.DEVELOPER,Hr.BETA_USER,Hr.DEBUG_USER;class Mr extends ir{constructor(){super(),this.cache.registerFinal("available-locales",(()=>this.api.getAvailableSearchLocales()))}async launchSearch(t){return this.api.search(t)}async launchSuggest(t){return this.api.getSuggestions(t)}async getAvailableSearchLocales(){return this.cache.get("available-locales")}}const jr=t=>t.request.virtualField===Dr.TITLE_ONLY&&t.request.scope===Tr.DOCUMENTS;class _r extends Event{constructor(){super(_r.eventName)}}_r.eventName="search-context-clear-all-filters";class Gr{static build(t,e){return new Gr((t=>o.FtReduxStore.get({name:"ft-search-"+t,initialState:{request:{query:"",filters:[],facets:[],sort:[],paging:{page:1,perPage:20}},liveQuery:""},reducers:$r}))(t.trim()||"context"),e)}constructor(t,e){this.store=t,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.searchDebouncer=new o.Debouncer(100),this.suggestDebouncer=new o.Debouncer(300),this.service=null!=e?e:new Mr}async initService(){return this.store.actions.setLocales((await this.service.getAvailableSearchLocales()).contentLocales),this.launchSearch()}setQuery(t){this.store.actions.setRequestQuery(t),this.store.actions.setLiveQuery(t),this.store.actions.setPageNumber(1),this.launchSearch()}setContentLocale(t){let o=this.store.getState().locales,e=this.store.getState().request.contentLocale;if(t!=e){if(o){const i=t=>o.some((o=>o.lang==t));i(t)||(t=i(e)?e:o[0].lang)}this.store.actions.setRequestContentLocale(t),this.store.actions.setPageNumber(1),this.store.actions.setRequestFilters([]),this.launchSearch()}return t}setPageSize(t){this.store.actions.setPageSize(t),this.launchSearch()}setPageNumber(t){this.store.actions.setPageNumber(t),this.launchSearch()}setSort(t){this.store.actions.setRequestSort(t),this.store.actions.setPageNumber(1),this.launchSearch()}setFilters(t){const o=t.filter((t=>t.values.length>0));this.store.actions.setRequestFilters(o),this.store.actions.setPageNumber(1),o.forEach((t=>{this.facetIds.includes(t.key)||(this.facetIds=[...this.facetIds,t.key])})),this.launchSearch()}setSearchInDocumentTitlesOnly(t){t?(this.store.actions.setRequestVirtualField(Dr.TITLE_ONLY),this.store.actions.setRequestScope(Tr.DOCUMENTS)):(this.store.actions.setRequestVirtualField(Dr.EVERYWHERE),this.store.actions.setRequestScope(Tr.DEFAULT)),this.launchSearch()}get searchInDocumentTitlesOnly(){return jr(this.store.getState())}clearAllFilters(){this.setFilters([]),this.store.eventBus.dispatchEvent(new _r)}addFacet(t){this.facetIds=[...this.facetIds,t],this.launchSearch()}replaceFacet(t,o){let e=this.facetIds.filter((o=>o!=t));o&&e.push(o),this.facetIds=e,this.launchSearch()}get facetIds(){return this.store.getState().request.facets.map((t=>t.id))}set facetIds(t){let o=[...new Set(t)].map((t=>({id:t})));this.store.actions.setRequestFacets(o)}setFilter(t,o){let e=this.store.getState().request.filters,i={key:t,values:o,negative:!1},r=[...e.filter((o=>o.key!==t)),i];this.setFilters(r)}setLiveQuery(t){this.store.actions.setLiveQuery(t),this.launchSuggest()}setRequest(t){this.store.actions.setRequest(t),this.store.actions.setLiveQuery(t.query),this.store.actions.setPageNumber(1),this.launchSearch()}setScope(t){this.store.actions.setRequestScope(t),this.launchSearch()}setIgnoreEmptyQuery(t){this.ignoreEmptyQuery=t,this.launchSearch()}setOpenExternalDocumentInNewTab(t){this.openExternalDocumentInNewTab=t}launchSearch(){return this.searchDebouncer.run((()=>this.fetchSearchData()))}launchSuggest(){return this.suggestDebouncer.run((()=>this.fetchSuggestData()))}async fetchSearchData(){var t,e;try{null===(t=this.cancelableSearch)||void 0===t||t.cancel();let i=this.store.getState().request;if(this.store.actions.setPaging(void 0),this.ignoreEmptyQuery&&0==i.query.length)this.store.actions.setResults(void 0),this.store.actions.setFacets(void 0),this.store.actions.setSpellcheck(void 0);else{this.cancelableSearch=o.cancelable(this.service.launchSearch(i));const t=await this.cancelableSearch;if(t.paging.currentPage<=1)this.store.actions.setResults(t.results),this.store.actions.setFacets(t.facets),this.store.actions.setSpellcheck(t.spellcheck);else{let o=(null!==(e=this.store.getState().results)&&void 0!==e?e:[]).concat(t.results);this.store.actions.setResults(o)}this.store.actions.setPaging(t.paging)}}catch(t){t instanceof o.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}async fetchSuggestData(){var t;try{const e=this.store.getState(),i=e.request,r={input:e.liveQuery,filters:i.filters,sort:i.sort,contentLocale:i.contentLocale,scope:i.scope};null===(t=this.cancelableSuggest)||void 0===t||t.cancel(),this.cancelableSuggest=o.cancelable(this.service.launchSuggest(r));let n=await this.cancelableSuggest;this.store.actions.setSuggestResults(n.suggestions)}catch(t){t instanceof o.CanceledPromiseError||!this.errorHandler||this.errorHandler(t)}}clear(){this.store.clear()}}var Vr=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class qr extends Event{constructor(){super("register-ft-search-component",{bubbles:!0,composed:!0})}}const Yr=Symbol("registerInterval");class Qr extends(function(t){var o;class e extends t{constructor(){super(...arguments),this[o]=0}setSearchStateManager(t){this.clearStateManager(),this.stateManager=t,this.addStore(t.store,"search")}clearStateManager(){this.stateManager&&(this.removeStore(this.stateManager.store),this.stateManager=void 0)}connectedCallback(){super.connectedCallback(),this[Yr]=window.setInterval((()=>this.tryToRegisterToContext()),50)}tryToRegisterToContext(){null!=this.stateManager?window.clearInterval(this[Yr]):this.dispatchEvent(new qr)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return o=Yr,Vr([i.state()],e.prototype,"stateManager",void 0),e}(o.FtLitElementRedux)){}const Xr=wr.build("designedSearchType"),Jr={label:"Search scope",documentTitlesOnly:"Search in document titles only"},tn=e.css`
|
|
1492
|
+
`;var on=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class en extends CustomEvent{constructor(t){super("ft-search-load-error",{detail:t})}}class rn extends CustomEvent{constructor(t){super("ft-search-request-change",{detail:t})}}class nn extends CustomEvent{constructor(t,o,e){super("ft-search-results-change",{detail:{request:t,paging:o,spellcheck:e}})}}class an extends o.FtLitElementRedux{get stateManager(){if(null==this._stateManager){const t=this.searchServiceProvider?this.searchServiceProvider():void 0;this._stateManager=Gr.build(this.id||(""+Math.round(999e3*Math.random())).padStart(6,"0"),t),this._stateManager.errorHandler=t=>this.handleLoadError(t),this.addStore(this.stateManager.store,"search")}return this._stateManager}constructor(){super(),this.query="",this.pageSize=20,this.searchInDocumentTitlesOnly=!1,this.ignoreEmptyQuery=!1,this.openExternalDocumentInNewTab=!1,this.filters=[],this.sort=[],this.addStore(or)}render(){return e.html`
|
|
1493
1493
|
<slot @register-ft-search-component=${this.registerComponent}></slot>
|
|
1494
|
-
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new rn(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new nn(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new en(t))}reloadSavedSearches(){ur.clearMySearches()}clear(){this.stateManager.clear()}}an.elementDefinitions={},an.styles=tn,on([i.property()],an.prototype,"query",void 0),on([i.property()],an.prototype,"contentLocale",void 0),on([i.property({type:Number})],an.prototype,"pageSize",void 0),on([i.property({type:Boolean})],an.prototype,"searchInDocumentTitlesOnly",void 0),on([i.property()],an.prototype,"scope",void 0),on([i.property({type:Boolean})],an.prototype,"ignoreEmptyQuery",void 0),on([i.property({type:Boolean})],an.prototype,"openExternalDocumentInNewTab",void 0),on([o.jsonProperty([])],an.prototype,"filters",void 0),on([o.jsonProperty([])],an.prototype,"sort",void 0),on([o.redux({store:"search"})],an.prototype,"request",void 0),on([o.redux({store:"search"})],an.prototype,"paging",void 0),on([o.redux({store:"search",selector:t=>t.spellcheck})],an.prototype,"autocorrect",void 0),on([o.redux({store:or.name})],an.prototype,"session",void 0),o.customElement("ft-search-context")(an);var sn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class ln extends(vr(Qr)){constructor(){super(),this.addI18nContext(Xr,Jr)}render(){return e.html`
|
|
1494
|
+
`}update(t){super.update(t),t.has("query")&&void 0!==this.query&&this.stateManager.setQuery(this.query),t.has("contentLocale")&&void 0!==this.contentLocale&&this.stateManager.setContentLocale(this.contentLocale),t.has("session")&&this.session&&this.stateManager.initService(),t.has("filters")&&void 0!==this.filters&&this.stateManager.setFilters(this.filters),t.has("sort")&&void 0!==this.sort&&this.stateManager.setSort(this.sort),t.has("pageSize")&&void 0!==this.pageSize&&this.stateManager.setPageSize(this.pageSize),t.has("searchInDocumentTitlesOnly")&&void 0!==this.searchInDocumentTitlesOnly&&this.stateManager.setSearchInDocumentTitlesOnly(this.searchInDocumentTitlesOnly),t.has("scope")&&void 0!==this.scope&&this.stateManager.setScope(this.scope),t.has("ignoreEmptyQuery")&&void 0!==this.ignoreEmptyQuery&&this.stateManager.setIgnoreEmptyQuery(this.ignoreEmptyQuery),t.has("openExternalDocumentInNewTab")&&void 0!==this.openExternalDocumentInNewTab&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab)}connectedCallback(){super.connectedCallback(),this.stateManager.setQuery(this.query),this.stateManager.setContentLocale(this.contentLocale),this.stateManager.setFilters(this.filters),this.stateManager.setPageSize(this.pageSize),this.stateManager.setSort(this.sort)}contentAvailableCallback(t){super.contentAvailableCallback(t),t.has("request")&&this.request&&this.dispatchEvent(new rn(this.request)),t.has("paging")&&void 0!==this.paging&&this.dispatchEvent(new nn(this.request,this.paging,this.autocorrect))}registerComponent(t){t.stopPropagation();const o=t.composedPath()[0];this.register(o)}register(t){t.setSearchStateManager(this.stateManager)}handleLoadError(t){this.dispatchEvent(new en(t))}reloadSavedSearches(){ur.clearMySearches()}clear(){this.stateManager.clear()}}an.elementDefinitions={},an.styles=tn,on([i.property()],an.prototype,"query",void 0),on([i.property()],an.prototype,"contentLocale",void 0),on([i.property({type:Number})],an.prototype,"pageSize",void 0),on([i.property({type:Boolean})],an.prototype,"searchInDocumentTitlesOnly",void 0),on([i.property()],an.prototype,"scope",void 0),on([i.property({type:Boolean})],an.prototype,"ignoreEmptyQuery",void 0),on([i.property({type:Boolean})],an.prototype,"openExternalDocumentInNewTab",void 0),on([o.jsonProperty([])],an.prototype,"filters",void 0),on([o.jsonProperty([])],an.prototype,"sort",void 0),on([o.redux({store:"search"})],an.prototype,"request",void 0),on([o.redux({store:"search"})],an.prototype,"paging",void 0),on([o.redux({store:"search",selector:t=>t.spellcheck})],an.prototype,"autocorrect",void 0),on([o.redux({store:or.name})],an.prototype,"session",void 0),on([i.property({attribute:!1})],an.prototype,"searchServiceProvider",void 0),o.customElement("ft-search-context")(an);var sn=function(t,o,e,i){for(var r,n=arguments.length,a=n<3?o:null===i?i=Object.getOwnPropertyDescriptor(o,e):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(o,e,a):r(o,e))||a);return n>3&&a&&Object.defineProperty(o,e,a),a};class ln extends(vr(Qr)){constructor(){super(),this.addI18nContext(Xr,Jr)}render(){return e.html`
|
|
1495
1495
|
<ft-filter
|
|
1496
1496
|
label=${Xr.messages.label()}
|
|
1497
1497
|
.options=${[{label:Xr.messages.documentTitlesOnly(),value:t=>{var o;return null===(o=this.stateManager)||void 0===o?void 0:o.setSearchInDocumentTitlesOnly(t)},selected:this.searchInDocumentTitlesOnly}]}
|