@fluid-topics/ft-filter 2.1.19 → 2.1.20

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.
@@ -20,7 +20,7 @@ export const analyticsActions = {
20
20
  "more-filters-button-pressed": {
21
21
  label: "Revealing more filters",
22
22
  defaultEventName: "filters-click_see_more",
23
- defaultComponentId: "ft-filter-level"
23
+ defaultComponentId: "ft-filter-level",
24
24
  },
25
25
  };
26
26
  export class FtFilterLevel extends withAnalytics(withI18n(withAriaNotification(FtLitElement)), analyticsActions) {
@@ -4,9 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { FtLitElement, jsonProperty } from "@fluid-topics/ft-wc-utils";
8
- import { property, query } from "lit/decorators.js";
9
- import { html } from "lit";
7
+ import { FtLitElement, jsonProperty, } from "@fluid-topics/ft-wc-utils";
8
+ import { property, query, } from "lit/decorators.js";
9
+ import { html, } from "lit";
10
10
  export class FtFilterOption extends FtLitElement {
11
11
  constructor() {
12
12
  super(...arguments);
@@ -22,7 +22,7 @@ export class FtFilterOption extends FtLitElement {
22
22
  }
23
23
  updateSubOptionsFromSlot(e) {
24
24
  e.stopPropagation();
25
- this.subOptions = this.slotElement.assignedElements().map(n => n);
25
+ this.subOptions = this.slotElement.assignedElements().map((n) => n);
26
26
  }
27
27
  update(changedProperties) {
28
28
  super.update(changedProperties);
@@ -36,7 +36,7 @@ __decorate([
36
36
  __decorate([
37
37
  property({
38
38
  type: Object,
39
- converter: value => value
39
+ converter: (value) => value,
40
40
  })
41
41
  ], FtFilterOption.prototype, "value", void 0);
42
42
  __decorate([
@@ -4,13 +4,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { html } from "lit";
8
- import { property, query, queryAll, state } from "lit/decorators.js";
9
- import { Debouncer, deepEqual, flatDeep, withAnalytics, FtLitElement, jsonProperty, numberProperty, waitUntil } from "@fluid-topics/ft-wc-utils";
10
- import { FtTypography, FtTypographyVariants } from "@fluid-topics/ft-typography";
7
+ import { html, } from "lit";
8
+ import { property, query, queryAll, state, } from "lit/decorators.js";
9
+ import { Debouncer, deepEqual, flatDeep, withAnalytics, FtLitElement, jsonProperty, numberProperty, waitUntil, } from "@fluid-topics/ft-wc-utils";
10
+ import { FtTypography, FtTypographyVariants, } from "@fluid-topics/ft-typography";
11
11
  import { FtFilterLevel, analyticsActions } from "./ft-filter-level";
12
12
  import { FtButton } from "@fluid-topics/ft-button";
13
- import { FtSnapScroll } from "@fluid-topics/ft-snap-scroll";
13
+ import { FtSnapScroll, } from "@fluid-topics/ft-snap-scroll";
14
14
  import { styles } from "./ft-filter.styles";
15
15
  export class FtFilterChangeEvent extends CustomEvent {
16
16
  constructor(selectedValues) {
@@ -188,7 +188,7 @@ export class FtFilter extends withAnalytics(FtLitElement, analyticsActions) {
188
188
  class="${className}"
189
189
  filterId="${this.id}"
190
190
  .filter=${this.filter}
191
- .configuredAnalyticsActions="${this.configuredAnalyticsActions}"
191
+ .configuredAnalyticsActions=${this.configuredAnalyticsActions}
192
192
  moreValuesButtonLabel="${this.moreValuesButtonLabel}"
193
193
  ?multivalued=${this.multivalued}
194
194
  ?disabled=${this.disabled || className !== "ft-filter--level-center"}
@@ -258,7 +258,7 @@
258
258
  word-break: break-word;
259
259
  }
260
260
  `;var es=["top","right","bottom","left"],Qo=["start","end"],ri=es.reduce((t,e)=>t.concat(e,e+"-"+Qo[0],e+"-"+Qo[1]),[]),Sr=Math.min,st=Math.max,Er=Math.round;var We=t=>({x:t,y:t}),jc={left:"right",right:"left",bottom:"top",top:"bottom"};function ts(t,e,r){return st(t,Sr(e,r))}function Jr(t,e){return typeof t=="function"?t(e):t}function Cr(t){return t.split("-")[0]}function at(t){return t.split("-")[1]}function ni(t){return t==="x"?"y":"x"}function ii(t){return t==="y"?"height":"width"}function Zr(t){let e=t[0];return e==="t"||e==="b"?"y":"x"}function oi(t){return ni(Zr(t))}function rs(t,e,r){r===void 0&&(r=!1);let n=at(t),i=oi(t),o=ii(i),s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=ti(s)),[s,ti(s)]}function ns(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}function ti(t){let e=Cr(t);return jc[e]+t.slice(e.length)}function Fc(t){var e,r,n,i;return{top:(e=t.top)!=null?e:0,right:(r=t.right)!=null?r:0,bottom:(n=t.bottom)!=null?n:0,left:(i=t.left)!=null?i:0}}function is(t){return typeof t!="number"?Fc(t):{top:t,right:t,bottom:t,left:t}}function Ot(t){let{x:e,y:r,width:n,height:i}=t;return{width:n,height:i,top:r,left:e,right:e+n,bottom:r+i,x:e,y:r}}function os(t,e,r){let{reference:n,floating:i}=t,o=Zr(e),s=oi(e),a=ii(s),l=Cr(e),c=o==="y",u=n.x+n.width/2-i.width/2,d=n.y+n.height/2-i.height/2,p=n[a]/2-i[a]/2,h;switch(l){case"top":h={x:u,y:n.y-i.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-i.width,y:d};break;default:h={x:n.x,y:n.y}}let m=at(e);return m&&(h[s]+=p*(m==="end"?1:-1)*(r&&c?-1:1)),h}async function ss(t,e){var r;e===void 0&&(e={});let{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Jr(e,t),m=is(h),b=a[p?d==="floating"?"reference":"floating":d],x=Ot(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(b)))==null||r?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),S=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),w=await(o.isElement==null?void 0:o.isElement(C))&&await(o.getScale==null?void 0:o.getScale(C))||{x:1,y:1},q=Ot(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:S,offsetParent:C,strategy:l}):S);return{top:(x.top-q.top+m.top)/w.y,bottom:(q.bottom-x.bottom+m.bottom)/w.y,left:(x.left-q.left+m.left)/w.x,right:(q.right-x.right+m.right)/w.x}}var Vc=50,as=async(t,e,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=s.detectOverflow?s:{...s,detectOverflow:ss},l=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=os(c,n,l),p=n,h=0,m={};for(let v=0;v<o.length;v++){let b=o[v];if(!b)continue;let{name:x,fn:S}=b,{x:C,y:w,data:q,reset:V}=await S({x:u,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:m,rects:c,platform:a,elements:{reference:t,floating:e}});u=C??u,d=w??d,m[x]={...m[x],...q},V&&h<Vc&&(h++,typeof V=="object"&&(V.placement&&(p=V.placement),V.rects&&(c=V.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):V.rects),{x:u,y:d}=os(c,p,l)),v=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:m}};function zc(t,e,r){return(t?[...r.filter(i=>at(i)===t),...r.filter(i=>at(i)!==t)]:r.filter(i=>Cr(i)===i)).filter(i=>t?at(i)===t||(e?ns(i)!==i:!1):!0)}var ls=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var r,n,i;let{rects:o,middlewareData:s,placement:a,platform:l,elements:c}=e,{crossAxis:u=!1,alignment:d,allowedPlacements:p=ri,autoAlignment:h=!0,...m}=Jr(t,e),v=d!==void 0||p===ri?zc(d||null,h,p):p,b=((r=s.autoPlacement)==null?void 0:r.index)||0,x=v[b];if(x==null)return{};if(a!==x)return{reset:{placement:v[0]}};let S=await l.detectOverflow(e,m),C=rs(x,o,await(l.isRTL==null?void 0:l.isRTL(c.floating))),w=[S[Cr(x)],S[C[0]],S[C[1]]],q=[...((n=s.autoPlacement)==null?void 0:n.overflows)||[],{placement:x,overflows:w}],V=v[b+1];if(V)return{data:{index:b+1,overflows:q},reset:{placement:V}};let rt=q.map(me=>{let Ee=at(me.placement);return[me.placement,Ee&&u?me.overflows.slice(0,2).reduce((ve,At)=>ve+At,0):me.overflows[0],me.overflows]}).sort((me,Ee)=>me[1]-Ee[1]),nt=((i=rt.filter(me=>me[2].slice(0,at(me[0])?2:3).every(Ee=>Ee<=0))[0])==null?void 0:i[0])||rt[0][0];return nt!==a?{data:{index:b+1,overflows:q},reset:{placement:nt}}:{}}}};var cs=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:r,y:n,placement:i,platform:o}=e,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:C,y:w}=S;return{x:C,y:w}}},...c}=Jr(t,e),u={x:r,y:n},d=await o.detectOverflow(e,c),p=Zr(i),h=ni(p),m=u[h],v=u[p],b=(S,C)=>ts(C+d[S==="y"?"top":"left"],C,C-d[S==="y"?"bottom":"right"]);s&&(m=b(h,m)),a&&(v=b(p,v));let x=l.fn({...e,[h]:m,[p]:v});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[h]:s,[p]:a}}}}}};function en(){return typeof window<"u"}function Tt(t){return ds(t)?(t.nodeName||"").toLowerCase():"#document"}function de(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Je(t){var e;return(e=(ds(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ds(t){return en()?t instanceof Node||t instanceof de(t).Node:!1}function ke(t){return en()?t instanceof Element||t instanceof de(t).Element:!1}function Ze(t){return en()?t instanceof HTMLElement||t instanceof de(t).HTMLElement:!1}function us(t){return!en()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof de(t).ShadowRoot}function Or(t){let{overflow:e,overflowX:r,overflowY:n,display:i}=De(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&i!=="inline"&&i!=="contents"}function ps(t){return/^(table|td|th)$/.test(Tt(t))}function wr(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}var Wc=/transform|translate|scale|rotate|perspective|filter/,Kc=/paint|layout|strict|content/,wt=t=>!!t&&t!=="none",si;function er(t){let e=ke(t)?De(t):t;return wt(e.transform)||wt(e.translate)||wt(e.scale)||wt(e.rotate)||wt(e.perspective)||!tn()&&(wt(e.backdropFilter)||wt(e.filter))||Wc.test(e.willChange||"")||Kc.test(e.contain||"")}function fs(t){let e=lt(t);for(;Ze(e)&&!tr(e);){if(er(e))return e;if(wr(e))return null;e=lt(e)}return null}function tn(){return si==null&&(si=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),si}function tr(t){return/^(html|body|#document)$/.test(Tt(t))}function De(t){return de(t).getComputedStyle(t)}function Tr(t){return ke(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function lt(t){if(Tt(t)==="html")return t;let e=t.assignedSlot||t.parentNode||us(t)&&t.host||Je(t);return us(e)?e.host:e}function hs(t){let e=lt(t);return tr(e)?(t.ownerDocument||t).body:Ze(e)&&Or(e)?e:hs(e)}function Qr(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);let i=hs(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),s=de(i);if(o){let a=rn(s);return e.concat(s,s.visualViewport||[],Or(i)?i:[],a&&r?Qr(a):[])}else return e.concat(i,Qr(i,[],r))}function rn(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ys(t){let e=De(t),r=parseFloat(e.width)||0,n=parseFloat(e.height)||0,i=Ze(t),o=i?t.offsetWidth:r,s=i?t.offsetHeight:n,a=Er(r)!==o||Er(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function gs(t){return ke(t)?t:t.contextElement}function rr(t){let e=gs(t);if(!Ze(e))return We(1);let r=e.getBoundingClientRect(),{width:n,height:i,$:o}=ys(e),s=(o?Er(r.width):r.width)/n,a=(o?Er(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var Gc=We(0);function bs(t){let e=de(t);return!tn()||!e.visualViewport?Gc:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function qc(t,e,r){return e===void 0&&(e=!1),!!r&&e&&r===de(t)}function _r(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);let i=t.getBoundingClientRect(),o=gs(t),s=We(1);e&&(n?ke(n)&&(s=rr(n)):s=rr(t));let a=qc(o,r,n)?bs(o):We(0),l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o&&n){let p=de(o),h=ke(n)?de(n):n,m=p,v=rn(m);for(;v&&h!==m;){let b=rr(v),x=v.getBoundingClientRect(),S=De(v),C=x.left+(v.clientLeft+parseFloat(S.paddingLeft))*b.x,w=x.top+(v.clientTop+parseFloat(S.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=C,c+=w,m=de(v),v=rn(m)}}return Ot({width:u,height:d,x:l,y:c})}function nn(t,e){let r=Tr(t).scrollLeft;return e?e.left+r:_r(Je(t)).left+r}function xs(t,e){let r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-nn(t,r),i=r.top+e.scrollTop;return{x:n,y:i}}function Yc(t){let{elements:e,rect:r,offsetParent:n,strategy:i}=t,o=i==="fixed",s=Je(n),a=e?wr(e.floating):!1;if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=We(1),u=We(0),d=Ze(n);if((d||!o)&&((Tt(n)!=="body"||Or(s))&&(l=Tr(n)),d)){let h=_r(n);c=rr(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}let p=s&&!d&&!o?xs(s,l):We(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function Xc(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function Jc(t){let e=Tr(t),r=t.ownerDocument.body,n=st(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=st(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-e.scrollLeft+nn(t),s=-e.scrollTop;return De(r).direction==="rtl"&&(o+=st(t.clientWidth,r.clientWidth)-n),{width:n,height:i,x:o,y:s}}var Zc=25;function Qc(t,e,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=de(t),o=Je(t),s=i.visualViewport,a=o.clientWidth,l=o.clientHeight,c=0,u=0;if(s){let p=!tn()||e==="fixed";n?p||(c=-s.offsetLeft,u=-s.offsetTop):(a=s.width,l=s.height,p&&(c=s.offsetLeft,u=s.offsetTop))}if(nn(o)<=0){let p=o.ownerDocument,h=p.body,m=getComputedStyle(h),v=p.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(o.clientWidth-h.clientWidth-v),x=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;x<=Zc&&(a-=x)}return{width:a,height:l,x:c,y:u}}function eu(t,e){let r=_r(t,!0,e==="fixed"),n=r.top+t.clientTop,i=r.left+t.clientLeft,o=rr(t),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=n*o.y;return{width:s,height:a,x:l,y:c}}function ms(t,e,r){let n;if(e==="viewport"||e==="layoutViewport")n=Qc(t,r,e);else if(e==="document")n=Jc(Je(t));else if(ke(e))n=eu(e,r);else{let i=bs(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Ot(n)}function tu(t,e){let r=e.get(t);if(r)return r;let n=Qr(t,[],!1).filter(a=>ke(a)&&Tt(a)!=="body"),i=null,o=De(t).position==="fixed",s=o?lt(t):t;for(;ke(s)&&!tr(s);){let a=De(s),l=er(s),c=i?i.position:o?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(d=>d!==s):i=a,s=lt(s)}return e.set(t,n),n}function ru(t){let{element:e,boundary:r,rootBoundary:n,strategy:i}=t,s=[...r==="clippingAncestors"?wr(e)?[]:tu(e,this._c):[].concat(r),n],a=ms(e,s[0],i),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let p=1;p<s.length;p++){let h=ms(e,s[p],i);l=st(h.top,l),c=Sr(h.right,c),u=Sr(h.bottom,u),d=st(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function nu(t){let{width:e,height:r}=ys(t);return{width:e,height:r}}function iu(t,e,r){let n=Ze(e),i=Je(e),o=r==="fixed",s=_r(t,!0,o,e),a={scrollLeft:0,scrollTop:0},l=We(0);if((n||!o)&&((Tt(e)!=="body"||Or(i))&&(a=Tr(e)),n)){let p=_r(e,!0,o,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}!n&&i&&(l.x=nn(i));let c=i&&!n&&!o?xs(i,a):We(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function ai(t){return De(t).position==="static"}function vs(t,e){if(!Ze(t)||De(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Je(t)===r&&(r=r.ownerDocument.body),r}function As(t,e){let r=de(t);if(wr(t))return r;if(!Ze(t)){let i=lt(t);for(;i&&!tr(i);){if(ke(i)&&!ai(i))return i;i=lt(i)}return r}let n=vs(t,e);for(;n&&ps(n)&&ai(n);)n=vs(n,e);return n&&tr(n)&&ai(n)&&!er(n)?r:n||fs(t)||r}var ou=async function(t){let e=this.getOffsetParent||As,r=this.getDimensions,n=await r(t.floating);return{reference:iu(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function su(t){return De(t).direction==="rtl"}var on={convertOffsetParentRelativeRectToViewportRelativeRect:Yc,getDocumentElement:Je,getClippingRect:ru,getOffsetParent:As,getElementRects:ou,getClientRects:Xc,getDimensions:nu,getScale:rr,isElement:ke,isRTL:su};var Ss=ls,Es=cs;var Cs=(t,e,r)=>{let n=new Map,i=r??{},o={...on,...i.platform,_c:n};return as(t,e,{...i,platform:o})};function Os(t){return au(t)}function li(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}function au(t){for(let e=t;e;e=li(e))if(e instanceof Element&&getComputedStyle(e).display==="none")return null;for(let e=li(t);e;e=li(e)){if(!(e instanceof Element))continue;let r=getComputedStyle(e);if(r.display!=="contents"&&(r.position!=="static"||er(r)||e.tagName==="BODY"))return e}return null}async function ws(t,e,r){let n;return typeof r=="object"?n=r:n={placement:r},Cs(t,e,{strategy:n.strategy,platform:{...on,getOffsetParent:i=>on.getOffsetParent(i,Os)},middleware:[Es({crossAxis:!0}),Ss({allowedPlacements:[n.placement]})]})}var hr=f(E());var Ni=f(z());var Ts=f(z(),1);var ci=t=>e=>{window.customElements.get(t)||window.customElements.define(t,e)};function _s(t,e){return(0,Ts.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return Rr(t);try{return JSON.parse(r)}catch{return Rr(t)}},toAttribute:r=>JSON.stringify(r)},hasChanged:Lr,...e??{}})}function lu(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;let r,n;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!sn(t[n],e[n]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;for(n of t.entries())if(!sn(n[1],e.get(n[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(n of t.entries())if(!e.has(n[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();let i=s=>Object.keys(s).filter(a=>s[a]!=null),o=i(t);if(r=o.length,r!==i(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,o[n]))return!1;for(n=r;n--!==0;){let s=o[n];if(!sn(t[s],e[s]))return!1}return!0}return t!==t&&e!==e||t==null&&e==null}function sn(t,e){try{return lu(t,e)}catch{return!1}}function Lr(t,e){return!sn(t,e)}function Rr(t){return typeof window.structuredClone=="function"?structuredClone(t):t!=null?JSON.parse(JSON.stringify(t)):t}function an(t,e){let r=n=>n[t]===!0;return n=>{if(r(n))return n;let i=e(n);return i[t]=!0,i}}var Rs=f(z(),1);var ui=t=>{let e=t??{};return(r,n)=>{var i;let o={hasChanged:Lr,attribute:!1,...e};(0,Rs.property)(o)(r,n);let s=r.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=e.selector)!==null&&i!==void 0?i:(a=>a[n]),store:e.store})}};var ln=class{constructor(){this.queue=[]}add(e,r=!1){r&&this.clear(e.type),this.queue.push(e)}consume(e){let r=this.queue.find(n=>n.type===e);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(e){typeof e=="string"?this.queue=this.queue.filter(r=>r.type!==e):this.queue=this.queue.filter(r=>!e.test(r.type))}};var _t=f(z(),1);var cn=class{constructor(e=0){this.timeout=e,this.callbacks=[]}run(e,r){return this.callbacks=[e],this.debounce(r)}queue(e,r){return this.callbacks.push(e),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(e){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),e??this.timeout),this.promise}async runCallbacks(){var e,r;let n=[...this.callbacks];this.callbacks=[];let i=(e=this.rejectPromise)!==null&&e!==void 0?e:(()=>null),o=(r=this.resolvePromise)!==null&&r!==void 0?r:(()=>null);this.clearPromise();for(let s of n)try{await s()}catch(a){i(a);return}o(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var Ps=f(L(),1);var un=globalThis,cu=un.ShadowRoot&&(un.ShadyCSS===void 0||un.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var Ls=(t,e)=>{if(cu)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of e){let n=document.createElement("style"),i=un.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,t.appendChild(n)}};var dn=class extends Ps.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let e=this.scopedRegistryConstructor;e.elementDefinitions&&!e.registry&&(e.registry=new CustomElementRegistry,e.defineScopedElements(e.elementDefinitions));let r={...e.shadowRootOptions,customElements:e.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return Ls(n,e.elementStyles),n}static canDefineScopedElement(e){return!!this.registry&&!this.registry.get(e)}static defineScopedElements(e){Object.entries(e).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(e,r){ci(e)(r),this.canDefineScopedElement(e)&&this.registry.define(e,r)}canDefineScopedElement(e){return this.scopedRegistryConstructor.canDefineScopedElement(e)}defineScopedElements(e){this.scopedRegistryConstructor.defineScopedElements(e)}defineScopedElement(e,r){this.scopedRegistryConstructor.defineScopedElement(e,r)}};function ks(t,e,...r){var n;let i=t.querySelector(e);for(let o of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(o);return i}var ir=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},Ms,Ds=Symbol("constructorPrototype"),Ns=Symbol("constructorName"),$s=Symbol("exportpartsDebouncer"),Is=Symbol("dynamicDependenciesLoaded"),nr=class t extends CustomEvent{constructor(){super(t.eventName,{bubbles:!0})}};nr.eventName="exportparts-updated";var Ke=class extends dn{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Ms]=new cn(5),this.scheduleExportpartsUpdate=()=>{var e,r,n;(!((e=this.exportpartsPrefix)===null||e===void 0)&&e.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[$s].run(()=>{var i,o;!((i=this.exportpartsPrefix)===null||i===void 0)&&i.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((o=this.exportpartsPrefixes)===null||o===void 0?void 0:o.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[Ns]=this.constructor.name,this[Ds]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[Ns]&&Object.setPrototypeOf(this,this[Ds])}connectedCallback(){var e;super.connectedCallback();try{this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(this.adoptedCustomStyleSheet)&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,this.adoptedCustomStyleSheet]),this.useAdoptedStyleSheets=!0}catch(n){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",n)}let r=this.constructor;r[Is]||(r[Is]=!0,this.importDynamicDependencies()),(e=this.shadowRoot)===null||e===void 0||e.addEventListener(nr.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.shadowRoot)===null||e===void 0||e.removeEventListener(nr.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(e){super.updated(e),this.updateComplete.then(()=>{this.contentAvailableCallback(e),this.focusElementToFocus(e),this.applyCustomStylesheet(e),this.scheduleExportpartsUpdate(),e.has("exportparts")&&this.dispatchEvent(new nr)})}contentAvailableCallback(e){}focusElementToFocus(e){if(e.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let o=[...i??[],n];r=ks(this.shadowRoot,...o)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(e){var r,n,i;if(((n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&n!==void 0?n:[]).forEach(o=>o.remove()),this.useAdoptedStyleSheets){if(e.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((i=this.customStylesheet)!==null&&i!==void 0?i:"")}catch(o){console.error(o,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let o=document.createElement("style");o.classList.add("ft-lit-element--custom-stylesheet"),o.innerHTML=this.customStylesheet,this.shadowRoot.append(o)}}setExportpartsAttribute(e){var r,n,i,o,s,a;let l=p=>p!=null&&p.trim().length>0,c=e.filter(l).map(p=>p.trim());if(c.length===0){this.exportparts=void 0;return}let u=new Set;for(let p of(n=(r=this.shadowRoot)===null||r===void 0?void 0:r.querySelectorAll("[part],[exportparts]"))!==null&&n!==void 0?n:[]){let h=(o=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&o!==void 0?o:[],m=(a=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(b=>b.split(":")[1]))!==null&&a!==void 0?a:[],v=[...h,...m].filter(l).map(b=>b.trim());for(let b of v)u.add(b)}if(u.size===0){this.exportparts=void 0;return}let d=[...u.values()].flatMap(p=>c.map(h=>`${p}:${h}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};Ms=$s;ir([(0,_t.property)()],Ke.prototype,"exportpartsPrefix",void 0);ir([_s([])],Ke.prototype,"exportpartsPrefixes",void 0);ir([(0,_t.property)({reflect:!0})],Ke.prototype,"exportparts",void 0);ir([(0,_t.property)()],Ke.prototype,"customStylesheet",void 0);ir([(0,_t.property)()],Ke.prototype,"elementToFocus",void 0);ir([(0,_t.state)()],Ke.prototype,"useAdoptedStyleSheets",void 0);function pn(t){var e;return(e=t?.isFtReduxStore)!==null&&e!==void 0?e:!1}var Pr=Symbol("internalReduxEventsUnsubscribers"),ct=Symbol("internalStoresUnsubscribers"),Rt=Symbol("internalStores"),uu=an(Symbol("withRedux"),function(t){var e,r,n;class i extends t{constructor(){super(...arguments),this[e]=new Map,this[r]=new Map,this[n]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(a=>s.has(a))&&this.updateFromStores()}getUnnamedStore(){if(this[Rt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[Rt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[Rt].get(s)}addStore(s,a){var l;a=(l=a??s.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[Rt].set(a,s),this.subscribeToStore(a,s),this.updateFromStores()}removeStore(s){let a=typeof s=="string"?s:s.name;this.unsubscribeFromStore(a),this[Rt].delete(a)}setupStores(){this.unsubscribeFromStores(),this[Rt].forEach((s,a)=>this.subscribeToStore(a,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,a)=>{let l=this.constructor.getPropertyOptions(a);if(!l?.attribute||!this.hasAttribute(typeof l?.attribute=="string"?l.attribute:a)){let c=this.getStore(s.store);c&&(s.store?this[ct].has(s.store):this[ct].size>0)&&(this[a]=s.selector(c.getState(),this))}})}subscribeToStore(s,a){var l;this[ct].set(s,a.subscribe(()=>this.updateFromStores())),this[Pr].set(s,[]),pn(a)&&a.eventBus&&((l=this.reduxConstructor.reduxEventListeners)===null||l===void 0||l.forEach((c,u)=>{if(typeof this[u]=="function"&&(!c.store||a.name===c.store)){let d=p=>this[u](p);a.addEventListener(c.eventName,d),this[Pr].get(s).push(()=>a.removeEventListener(c.eventName,d))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[ct].forEach((s,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(s){var a;this[ct].has(s)&&this[ct].get(s)(),this[ct].delete(s),(a=this[Pr].get(s))===null||a===void 0||a.forEach(l=>l()),this[Pr].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return e=ct,r=Rt,n=Pr,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),Us=class extends uu(Ke){};function Oe(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];if(0)var i,o;throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(s){return"'"+s+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Qe(t){return!!t&&!!t[U]}function Ne(t){var e;return!!t&&((function(r){if(!r||typeof r!="object")return!1;var n=Object.getPrototypeOf(r);if(n===null)return!0;var i=Object.hasOwnProperty.call(n,"constructor")&&n.constructor;return i===Object||typeof i=="function"&&Function.toString.call(i)===gu})(t)||Array.isArray(t)||!!t[Ws]||!!(!((e=t.constructor)===null||e===void 0)&&e[Ws])||bi(t)||xi(t))}function Lt(t,e,r){r===void 0&&(r=!1),ar(t)===0?(r?Object.keys:sr)(t).forEach((function(n){r&&typeof n=="symbol"||e(n,t[n],t)})):t.forEach((function(n,i){return e(i,n,t)}))}function ar(t){var e=t[U];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:bi(t)?2:xi(t)?3:0}function or(t,e){return ar(t)===2?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function du(t,e){return ar(t)===2?t.get(e):t[e]}function Ks(t,e,r){var n=ar(t);n===2?t.set(e,r):n===3?t.add(r):t[e]=r}function Gs(t,e){return t===e?t!==0||1/t==1/e:t!=t&&e!=e}function bi(t){return vu&&t instanceof Map}function xi(t){return yu&&t instanceof Set}function ut(t){return t.o||t.t}function Ai(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=Xs(t);delete e[U];for(var r=sr(e),n=0;n<r.length;n++){var i=r[n],o=e[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(e[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:t[i]})}return Object.create(Object.getPrototypeOf(t),e)}function Si(t,e){return e===void 0&&(e=!1),Ei(t)||Qe(t)||!Ne(t)||(ar(t)>1&&(t.set=t.add=t.clear=t.delete=pu),Object.freeze(t),e&&Lt(t,(function(r,n){return Si(n,!0)}),!0)),t}function pu(){Oe(2)}function Ei(t){return t==null||typeof t!="object"||Object.isFrozen(t)}function Ge(t){var e=gi[t];return e||Oe(18,t),e}function fu(t,e){gi[t]||(gi[t]=e)}function mi(){return Dr}function di(t,e){e&&(Ge("Patches"),t.u=[],t.s=[],t.v=e)}function fn(t){vi(t),t.p.forEach(hu),t.p=null}function vi(t){t===Dr&&(Dr=t.l)}function Bs(t){return Dr={p:[],l:Dr,h:t,m:!0,_:0}}function hu(t){var e=t[U];e.i===0||e.i===1?e.j():e.g=!0}function pi(t,e){e._=e.p.length;var r=e.p[0],n=t!==void 0&&t!==r;return e.h.O||Ge("ES5").S(e,t,n),n?(r[U].P&&(fn(e),Oe(4)),Ne(t)&&(t=hn(e,t),e.l||mn(e,t)),e.u&&Ge("Patches").M(r[U].t,t,e.u,e.s)):t=hn(e,r,[]),fn(e),e.u&&e.v(e.u,e.s),t!==Ys?t:void 0}function hn(t,e,r){if(Ei(e))return e;var n=e[U];if(!n)return Lt(e,(function(a,l){return Hs(t,n,e,a,l,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return mn(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=Ai(n.k):n.o,o=i,s=!1;n.i===3&&(o=new Set(i),i.clear(),s=!0),Lt(o,(function(a,l){return Hs(t,n,i,a,l,r,s)})),mn(t,i,!1),r&&t.u&&Ge("Patches").N(n,r,t.u,t.s)}return n.o}function Hs(t,e,r,n,i,o,s){if(Qe(i)){var a=hn(t,i,o&&e&&e.i!==3&&!or(e.R,n)?o.concat(n):void 0);if(Ks(r,n,a),!Qe(a))return;t.m=!1}else s&&r.add(i);if(Ne(i)&&!Ei(i)){if(!t.h.D&&t._<1)return;hn(t,i),e&&e.A.l||mn(t,i)}}function mn(t,e,r){r===void 0&&(r=!1),!t.l&&t.h.D&&t.m&&Si(e,r)}function fi(t,e){var r=t[U];return(r?ut(r):t)[e]}function js(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function dt(t){t.P||(t.P=!0,t.l&&dt(t.l))}function hi(t){t.o||(t.o=Ai(t.t))}function yi(t,e,r){var n=bi(e)?Ge("MapSet").F(e,r):xi(e)?Ge("MapSet").T(e,r):t.O?(function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:mi(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=a,c=Nr;s&&(l=[a],c=kr);var u=Proxy.revocable(l,c),d=u.revoke,p=u.proxy;return a.k=p,a.j=d,p})(e,r):Ge("ES5").J(e,r);return(r?r.A:mi()).p.push(n),n}function mu(t){return Qe(t)||Oe(22,t),(function e(r){if(!Ne(r))return r;var n,i=r[U],o=ar(r);if(i){if(!i.P&&(i.i<4||!Ge("ES5").K(i)))return i.t;i.I=!0,n=Fs(r,o),i.I=!1}else n=Fs(r,o);return Lt(n,(function(s,a){i&&du(i.t,s)===a||Ks(n,s,e(a))})),o===3?new Set(n):n})(t)}function Fs(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return Ai(t)}function qs(){function t(s,a){var l=o[s];return l?l.enumerable=a:o[s]=l={configurable:!0,enumerable:a,get:function(){var c=this[U];return Nr.get(c,s)},set:function(c){var u=this[U];Nr.set(u,s,c)}},l}function e(s){for(var a=s.length-1;a>=0;a--){var l=s[a][U];if(!l.P)switch(l.i){case 5:n(l)&&dt(l);break;case 4:r(l)&&dt(l)}}}function r(s){for(var a=s.t,l=s.k,c=sr(l),u=c.length-1;u>=0;u--){var d=c[u];if(d!==U){var p=a[d];if(p===void 0&&!or(a,d))return!0;var h=l[d],m=h&&h[U];if(m?m.t!==p:!Gs(h,p))return!0}}var v=!!a[U];return c.length!==sr(a).length+(v?0:1)}function n(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var c=0;c<a.length;c++)if(!a.hasOwnProperty(c))return!0;return!1}function i(s){s.g&&Oe(3,JSON.stringify(ut(s)))}var o={};fu("ES5",{J:function(s,a){var l=Array.isArray(s),c=(function(d,p){if(d){for(var h=Array(p.length),m=0;m<p.length;m++)Object.defineProperty(h,""+m,t(m,!0));return h}var v=Xs(p);delete v[U];for(var b=sr(v),x=0;x<b.length;x++){var S=b[x];v[S]=t(S,d||!!v[S].enumerable)}return Object.create(Object.getPrototypeOf(p),v)})(l,s),u={i:l?5:4,A:a?a.A:mi(),P:!1,I:!1,R:{},l:a,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,U,{value:u,writable:!0}),c},S:function(s,a,l){l?Qe(a)&&a[U].A===s&&e(s.p):(s.u&&(function c(u){if(u&&typeof u=="object"){var d=u[U];if(d){var p=d.t,h=d.k,m=d.R,v=d.i;if(v===4)Lt(h,(function(w){w!==U&&(p[w]!==void 0||or(p,w)?m[w]||c(h[w]):(m[w]=!0,dt(d)))})),Lt(p,(function(w){h[w]!==void 0||or(h,w)||(m[w]=!1,dt(d))}));else if(v===5){if(n(d)&&(dt(d),m.length=!0),h.length<p.length)for(var b=h.length;b<p.length;b++)m[b]=!1;else for(var x=p.length;x<h.length;x++)m[x]=!0;for(var S=Math.min(h.length,p.length),C=0;C<S;C++)h.hasOwnProperty(C)||(m[C]=!0),m[C]===void 0&&c(h[C])}}}})(s.p[0]),e(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Vs,Dr,Ci=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",vu=typeof Map<"u",yu=typeof Set<"u",zs=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",Ys=Ci?Symbol.for("immer-nothing"):((Vs={})["immer-nothing"]=!0,Vs),Ws=Ci?Symbol.for("immer-draftable"):"__$immer_draftable",U=Ci?Symbol.for("immer-state"):"__$immer_state";var gu=""+Object.prototype.constructor,sr=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Xs=Object.getOwnPropertyDescriptors||function(t){var e={};return sr(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},gi={},Nr={get:function(t,e){if(e===U)return t;var r=ut(t);if(!or(r,e))return(function(i,o,s){var a,l=js(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0})(t,r,e);var n=r[e];return t.I||!Ne(n)?n:n===fi(t.t,e)?(hi(t),t.o[e]=yi(t.A.h,n,t)):n},has:function(t,e){return e in ut(t)},ownKeys:function(t){return Reflect.ownKeys(ut(t))},set:function(t,e,r){var n=js(ut(t),e);if(n?.set)return n.set.call(t.k,r),!0;if(!t.P){var i=fi(ut(t),e),o=i?.[U];if(o&&o.t===r)return t.o[e]=r,t.R[e]=!1,!0;if(Gs(r,i)&&(r!==void 0||or(t.t,e)))return!0;hi(t),dt(t)}return t.o[e]===r&&(r!==void 0||e in t.o)||Number.isNaN(r)&&Number.isNaN(t.o[e])||(t.o[e]=r,t.R[e]=!0),!0},deleteProperty:function(t,e){return fi(t.t,e)!==void 0||e in t.t?(t.R[e]=!1,hi(t),dt(t)):delete t.R[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=ut(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n&&{writable:!0,configurable:t.i!==1||e!=="length",enumerable:n.enumerable,value:r[e]}},defineProperty:function(){Oe(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Oe(12)}},kr={};Lt(Nr,(function(t,e){kr[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),kr.deleteProperty=function(t,e){return kr.set.call(this,t,e,void 0)},kr.set=function(t,e,r){return Nr.set.call(this,t[0],e,r,t[0])};var bu=(function(){function t(r){var n=this;this.O=zs,this.D=!0,this.produce=function(i,o,s){if(typeof i=="function"&&typeof o!="function"){var a=o;o=i;var l=n;return function(v){var b=this;v===void 0&&(v=a);for(var x=arguments.length,S=Array(x>1?x-1:0),C=1;C<x;C++)S[C-1]=arguments[C];return l.produce(v,(function(w){var q;return(q=o).call.apply(q,[b,w].concat(S))}))}}var c;if(typeof o!="function"&&Oe(6),s!==void 0&&typeof s!="function"&&Oe(7),Ne(i)){var u=Bs(n),d=yi(n,i,void 0),p=!0;try{c=o(d),p=!1}finally{p?fn(u):vi(u)}return typeof Promise<"u"&&c instanceof Promise?c.then((function(v){return di(u,s),pi(v,u)}),(function(v){throw fn(u),v})):(di(u,s),pi(c,u))}if(!i||typeof i!="object"){if((c=o(i))===void 0&&(c=i),c===Ys&&(c=void 0),n.D&&Si(c,!0),s){var h=[],m=[];Ge("Patches").M(i,c,h,m),s(h,m)}return c}Oe(21,i)},this.produceWithPatches=function(i,o){if(typeof i=="function")return function(c){for(var u=arguments.length,d=Array(u>1?u-1:0),p=1;p<u;p++)d[p-1]=arguments[p];return n.produceWithPatches(c,(function(h){return i.apply(void 0,[h].concat(d))}))};var s,a,l=n.produce(i,o,(function(c,u){s=c,a=u}));return typeof Promise<"u"&&l instanceof Promise?l.then((function(c){return[c,s,a]})):[l,s,a]},typeof r?.useProxies=="boolean"&&this.setUseProxies(r.useProxies),typeof r?.autoFreeze=="boolean"&&this.setAutoFreeze(r.autoFreeze)}var e=t.prototype;return e.createDraft=function(r){Ne(r)||Oe(8),Qe(r)&&(r=mu(r));var n=Bs(this),i=yi(this,r,void 0);return i[U].C=!0,vi(n),i},e.finishDraft=function(r,n){var i=r&&r[U],o=i.A;return di(o,n),pi(void 0,o)},e.setAutoFreeze=function(r){this.D=r},e.setUseProxies=function(r){r&&!zs&&Oe(20),this.O=r},e.applyPatches=function(r,n){var i;for(i=n.length-1;i>=0;i--){var o=n[i];if(o.path.length===0&&o.op==="replace"){r=o.value;break}}i>-1&&(n=n.slice(i+1));var s=Ge("Patches").$;return Qe(r)?s(r,n):this.produce(r,(function(a){return s(a,n)}))},t})(),ge=new bu,xu=ge.produce,Hp=ge.produceWithPatches.bind(ge),jp=ge.setAutoFreeze.bind(ge),Fp=ge.setUseProxies.bind(ge),Vp=ge.applyPatches.bind(ge),zp=ge.createDraft.bind(ge),Wp=ge.finishDraft.bind(ge),vn=xu;function Pt(t){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pt(t)}function Js(t,e){if(Pt(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Pt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zs(t){var e=Js(t,"string");return Pt(e)=="symbol"?e:e+""}function Qs(t,e,r){return(e=Zs(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ea(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Oi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ea(Object(r),!0).forEach(function(n){Qs(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oe(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ta=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),wi=function(){return Math.random().toString(36).substring(7).split("").join(".")},yn={INIT:"@@redux/INIT"+wi(),REPLACE:"@@redux/REPLACE"+wi(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+wi()}};function Au(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Ti(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(oe(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(oe(1));return r(Ti)(t,e)}if(typeof t!="function")throw new Error(oe(2));var i=t,o=e,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(oe(3));return o}function d(v){if(typeof v!="function")throw new Error(oe(4));if(l)throw new Error(oe(5));var b=!0;return c(),a.push(v),function(){if(b){if(l)throw new Error(oe(6));b=!1,c();var S=a.indexOf(v);a.splice(S,1),s=null}}}function p(v){if(!Au(v))throw new Error(oe(7));if(typeof v.type>"u")throw new Error(oe(8));if(l)throw new Error(oe(9));try{l=!0,o=i(o,v)}finally{l=!1}for(var b=s=a,x=0;x<b.length;x++){var S=b[x];S()}return v}function h(v){if(typeof v!="function")throw new Error(oe(10));i=v,p({type:yn.REPLACE})}function m(){var v,b=d;return v={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(oe(11));function C(){S.next&&S.next(u())}C();var w=b(C);return{unsubscribe:w}}},v[ta]=function(){return this},v}return p({type:yn.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:h},n[ta]=m,n}function Su(t){Object.keys(t).forEach(function(e){var r=t[e],n=r(void 0,{type:yn.INIT});if(typeof n>"u")throw new Error(oe(12));if(typeof r(void 0,{type:yn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(oe(13))})}function ra(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++){var i=e[n];typeof t[i]=="function"&&(r[i]=t[i])}var o=Object.keys(r),s,a;try{Su(r)}catch(l){a=l}return function(c,u){if(c===void 0&&(c={}),a)throw a;if(0)var d;for(var p=!1,h={},m=0;m<o.length;m++){var v=o[m],b=r[v],x=c[v],S=b(x,u);if(typeof S>"u"){var C=u&&u.type;throw new Error(oe(14))}h[v]=S,p=p||S!==x}return p=p||o.length!==Object.keys(c).length,p?h:c}}function lr(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return e.length===0?function(n){return n}:e.length===1?e[0]:e.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function na(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),o=function(){throw new Error(oe(15))},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=e.map(function(l){return l(s)});return o=lr.apply(void 0,a)(i.dispatch),Oi(Oi({},i),{},{dispatch:o})}}}function ia(t){var e=function(n){var i=n.dispatch,o=n.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,t):s(a)}}};return e}var oa=ia();oa.withExtraArgument=ia;var _i=oa;var ua=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Eu=function(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},cr=function(t,e){for(var r=0,n=e.length,i=t.length;r<n;r++,i++)t[i]=e[r];return t},Cu=Object.defineProperty,Ou=Object.defineProperties,wu=Object.getOwnPropertyDescriptors,sa=Object.getOwnPropertySymbols,Tu=Object.prototype.hasOwnProperty,_u=Object.prototype.propertyIsEnumerable,aa=function(t,e,r){return e in t?Cu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},pt=function(t,e){for(var r in e||(e={}))Tu.call(e,r)&&aa(t,r,e[r]);if(sa)for(var n=0,i=sa(e);n<i.length;n++){var r=i[n];_u.call(e,r)&&aa(t,r,e[r])}return t},Ri=function(t,e){return Ou(t,wu(e))},Ru=function(t,e,r){return new Promise(function(n,i){var o=function(l){try{a(r.next(l))}catch(c){i(c)}},s=function(l){try{a(r.throw(l))}catch(c){i(c)}},a=function(l){return l.done?n(l.value):Promise.resolve(l.value).then(o,s)};a((r=r.apply(t,e)).next())})};var Lu=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?lr:lr.apply(null,arguments)},uf=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(t){return t}};function Pu(t){if(typeof t!="object"||t===null)return!1;var e=Object.getPrototypeOf(t);if(e===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return e===r}function ft(t,e){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(e){var o=e.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return pt(pt({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:t,payload:n[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(n){return n.type===t},r}var ku=(function(t){ua(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,cr([void 0],r[0].concat(this)))):new(e.bind.apply(e,cr([void 0],r.concat(this))))},e})(Array),Du=(function(t){ua(e,t);function e(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=t.apply(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return t.prototype.concat.apply(this,r)},e.prototype.prepend=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return r.length===1&&Array.isArray(r[0])?new(e.bind.apply(e,cr([void 0],r[0].concat(this)))):new(e.bind.apply(e,cr([void 0],r.concat(this))))},e})(Array);function ki(t){return Ne(t)?vn(t,function(){}):t}function Nu(t){return typeof t=="boolean"}function Iu(){return function(e){return Mu(e)}}function Mu(t){t===void 0&&(t={});var e=t.thunk,r=e===void 0?!0:e,n=t.immutableCheck,i=n===void 0?!0:n,o=t.serializableCheck,s=o===void 0?!0:o,a=t.actionCreatorCheck,l=a===void 0?!0:a,c=new ku;if(r&&(Nu(r)?c.push(_i):c.push(_i.withExtraArgument(r.extraArgument))),0){if(i)var u;if(s)var d;if(l)var p}return c}var Li=!0;function da(t){var e=Iu(),r=t||{},n=r.reducer,i=n===void 0?void 0:n,o=r.middleware,s=o===void 0?e():o,a=r.devTools,l=a===void 0?!0:a,c=r.preloadedState,u=c===void 0?void 0:c,d=r.enhancers,p=d===void 0?void 0:d,h;if(typeof i=="function")h=i;else if(Pu(i))h=ra(i);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var m=s;if(typeof m=="function"&&(m=m(e),!Li&&!Array.isArray(m)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Li&&m.some(function(w){return typeof w!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=na.apply(void 0,m),b=lr;l&&(b=Lu(pt({trace:!Li},typeof l=="object"&&l)));var x=new Du(v),S=x;Array.isArray(p)?S=cr([v],p):typeof p=="function"&&(S=p(x));var C=b.apply(void 0,S);return Ti(h,u,C)}function pa(t){var e={},r=[],n,i={addCase:function(o,s){var a=typeof o=="string"?o:o.type;if(!a)throw new Error("`builder.addCase` cannot be called with an empty action type");if(a in e)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return e[a]=s,i},addMatcher:function(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase:function(o){return n=o,i}};return t(i),[e,r,n]}function $u(t){return typeof t=="function"}function Uu(t,e,r,n){r===void 0&&(r=[]);var i=typeof e=="function"?pa(e):[e,r,n],o=i[0],s=i[1],a=i[2],l;if($u(t))l=function(){return ki(t())};else{var c=ki(t);l=function(){return c}}function u(d,p){d===void 0&&(d=l());var h=cr([o[p.type]],s.filter(function(m){var v=m.matcher;return v(p)}).map(function(m){var v=m.reducer;return v}));return h.filter(function(m){return!!m}).length===0&&(h=[a]),h.reduce(function(m,v){if(v)if(Qe(m)){var b=m,x=v(b,p);return x===void 0?m:x}else{if(Ne(m))return vn(m,function(S){return v(S,p)});var x=v(m,p);if(x===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}return m},d)}return u.getInitialState=l,u}function Bu(t,e){return t+"/"+e}function fa(t){var e=t.name;if(!e)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof t.initialState=="function"?t.initialState:ki(t.initialState),n=t.reducers||{},i=Object.keys(n),o={},s={},a={};i.forEach(function(u){var d=n[u],p=Bu(e,u),h,m;"reducer"in d?(h=d.reducer,m=d.prepare):h=d,o[u]=h,s[p]=h,a[u]=m?ft(p,m):ft(p)});function l(){var u=typeof t.extraReducers=="function"?pa(t.extraReducers):[t.extraReducers],d=u[0],p=d===void 0?{}:d,h=u[1],m=h===void 0?[]:h,v=u[2],b=v===void 0?void 0:v,x=pt(pt({},p),s);return Uu(r,function(S){for(var C in x)S.addCase(C,x[C]);for(var w=0,q=m;w<q.length;w++){var V=q[w];S.addMatcher(V.matcher,V.reducer)}b&&S.addDefaultCase(b)})}var c;return{name:e,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:o,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var Hu="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",ju=function(t){t===void 0&&(t=21);for(var e="",r=t;r--;)e+=Hu[Math.random()*64|0];return e},Fu=["name","message","stack","code"],Pi=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),la=(function(){function t(e,r){this.payload=e,this.meta=r}return t})(),Vu=function(t){if(typeof t=="object"&&t!==null){for(var e={},r=0,n=Fu;r<n.length;r++){var i=n[r];typeof t[i]=="string"&&(e[i]=t[i])}return e}return{message:String(t)}},hf=(function(){function t(e,r,n){var i=ft(e+"/fulfilled",function(u,d,p,h){return{payload:u,meta:Ri(pt({},h||{}),{arg:p,requestId:d,requestStatus:"fulfilled"})}}),o=ft(e+"/pending",function(u,d,p){return{payload:void 0,meta:Ri(pt({},p||{}),{arg:d,requestId:u,requestStatus:"pending"})}}),s=ft(e+"/rejected",function(u,d,p,h,m){return{payload:h,error:(n&&n.serializeError||Vu)(u||"Rejected"),meta:Ri(pt({},m||{}),{arg:p,requestId:d,rejectedWithValue:!!h,requestStatus:"rejected",aborted:u?.name==="AbortError",condition:u?.name==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:(function(){function u(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return u.prototype.abort=function(){},u})();function c(u){return function(d,p,h){var m=n?.idGenerator?n.idGenerator(u):ju(),v=new l,b,x=!1;function S(w){b=w,v.abort()}var C=(function(){return Ru(this,null,function(){var w,q,V,rt,jn,nt,me;return Eu(this,function(Ee){switch(Ee.label){case 0:return Ee.trys.push([0,4,,5]),rt=(w=n?.condition)==null?void 0:w.call(n,u,{getState:p,extra:h}),Wu(rt)?[4,rt]:[3,2];case 1:rt=Ee.sent(),Ee.label=2;case 2:if(rt===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return x=!0,jn=new Promise(function(ve,At){return v.signal.addEventListener("abort",function(){return At({name:"AbortError",message:b||"Aborted"})})}),d(o(m,u,(q=n?.getPendingMeta)==null?void 0:q.call(n,{requestId:m,arg:u},{getState:p,extra:h}))),[4,Promise.race([jn,Promise.resolve(r(u,{dispatch:d,getState:p,extra:h,requestId:m,signal:v.signal,abort:S,rejectWithValue:function(ve,At){return new Pi(ve,At)},fulfillWithValue:function(ve,At){return new la(ve,At)}})).then(function(ve){if(ve instanceof Pi)throw ve;return ve instanceof la?i(ve.payload,m,u,ve.meta):i(ve,m,u)})])];case 3:return V=Ee.sent(),[3,5];case 4:return nt=Ee.sent(),V=nt instanceof Pi?s(null,m,u,nt.payload,nt.meta):s(nt,m,u),[3,5];case 5:return me=n&&!n.dispatchConditionRejection&&s.match(V)&&V.meta.condition,me||d(V),[2,V]}})})})();return Object.assign(C,{abort:S,requestId:m,arg:u,unwrap:function(){return C.then(zu)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,typePrefix:e})}return t.withTypes=function(){return t},t})();function zu(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function Wu(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var ha="listener",ma="completed",va="cancelled",mf="task-"+va,vf="task-"+ma,yf=ha+"-"+va,gf=ha+"-"+ma;var Di="listenerMiddleware";var bf=ft(Di+"/add"),xf=ft(Di+"/removeAll"),Af=ft(Di+"/remove");var ca,Sf=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(t){return(ca||(ca=Promise.resolve())).then(t).catch(function(e){return setTimeout(function(){throw e},0)})},Ku=function(t){return function(e){setTimeout(e,t)}},Ef=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Ku(10);qs();var Gu=an(Symbol("withEventBus"),function(t,e){return class extends t{constructor(){super(...arguments),this.eventBus=e??document.createElement("span")}addEventListener(r,n,i){this.eventBus.addEventListener(r,n,i)}dispatchEvent(r){return this.eventBus.dispatchEvent(r)}removeEventListener(r,n,i){this.eventBus.removeEventListener(r,n,i)}}}),gn=class extends Gu(Object){};window.ftReduxStores||(window.ftReduxStores={});var ya=class t extends gn{static get(e){var r;let n=typeof e=="string"?e:e.name,i=typeof e=="string"?void 0:e,o=window.ftReduxStores[n];if(pn(o))return o;if(i==null)return;let s=fa({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),a=da({reducer:(l,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let u=Rr(s.getInitialState());for(let d of c.keeping)u[d]=(l??u)[d];return u}else if(typeof c.type=="string"&&c.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...l,...c.overwrites};return s.reducer(l,c)}});return window.ftReduxStores[i.name]=new t(s,a,i.eventBus)}constructor(e,r,n){super(),this.reduxSlice=e,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new ln;let i=o=>o!=null?JSON.parse(JSON.stringify(o)):o;this.actions=new Proxy(this.reduxSlice.actions,{get:(o,s,a)=>{let l=s,c=o[l];return c?(...u)=>{let d=c(...u.map(i));return this.reduxStore.dispatch(d),d}:u=>{this.setState({[l]:i(u)})}}}),this.eventBus=n??this.eventBus}clear(){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:[]})}clearKeeping(...e){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:e})}setState(e){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(e).join("_"),overwrites:e})}get dispatch(){throw new Error("Don't use this method, actions are automatically dispatched when called.")}[Symbol.observable](){return this.reduxStore[Symbol.observable]()}getState(){return this.reduxStore.getState()}replaceReducer(e){throw new Error("Not implemented yet.")}subscribe(e){return this.reduxStore.subscribe(e)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var bn=class{static format(e,r,n,i,o){return window.moment?window.moment(e).locale(r).format(this.getMomentDateFormat(n,i,!!o)):this.getIntlDateTime(e,r,n,i,!!o)}static getMomentDateFormat(e,r,n){return n?"LT":e?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(e,r,n,i,o){let s=typeof e=="string"?new Date(e):e,a=new Intl.DateTimeFormat(r,{dateStyle:n?"medium":"short"}).format(s),l=new Intl.DateTimeFormat(r,{timeStyle:"short"}).format(s);return o?l:i?`${a} ${l}`:a}static getTimezoneAsString(){let e=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${e(Math.abs(r)/60)}:${e(Math.abs(r)%60)}`}};var xn=f(E()),qu="ft-app-info",ur=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ur.eventName="authentication-change";var Ir=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Ir.eventName="ui-locale-changed";var Yu={session:(t,e)=>{(0,xn.deepEqual)(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>T.dispatchEvent(new ur(e.payload)),0))}},T=xn.FtReduxStore.get({name:qu,reducers:Yu,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var ga=f(E()),An=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},Jf=(0,ga.applyMixinOnce)(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(T)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,o;return((o=(i=this.metadataDescriptors.find(a=>a.key===n))===null||i===void 0?void 0:i.date)!==null&&o!==void 0?o:!1)?a=>bn.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return An([(0,Ni.property)({type:Boolean})],e.prototype,"useLongDateFormat",void 0),An([(0,Ni.property)({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),An([ui({store:T.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),An([ui({store:T.name})],e.prototype,"uiLocale",void 0),e});var ba;(function(t){t.black="black",t.green="green",t.blue="blue",t.purple="purple",t.red="red",t.orange="orange",t.yellow="yellow"})(ba||(ba={}));var xa;(function(t){t.OFFICIAL="OFFICIAL",t.PERSONAL="PERSONAL",t.SHARED="SHARED"})(xa||(xa={}));var Aa;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Aa||(Aa={}));var Sa;(function(t){t.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",t.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",t.PERSONAL_BOOK="PERSONAL_BOOK",t.ATTACHMENT="ATTACHMENT",t.RESOURCE="RESOURCE",t.HTML_PACKAGE="HTML_PACKAGE"})(Sa||(Sa={}));var Ea;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Ea||(Ea={}));var Ca;(function(t){t.VALUE="VALUE",t.DATE="DATE",t.RANGE="RANGE"})(Ca||(Ca={}));var Oa;(function(t){t.OFFICIAL="OFFICIAL",t.AI="AI"})(Oa||(Oa={}));var wa;(function(t){t.BOOKMARK__CREATE="BOOKMARK__CREATE",t.BOOKMARK__DELETE="BOOKMARK__DELETE",t.CASE_DEFLECTION__START="CASE_DEFLECTION__START",t.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",t.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",t.CHATBOT__RATE="CHATBOT__RATE",t.COLLECTION__CREATE="COLLECTION__CREATE",t.COLLECTION__UPDATE="COLLECTION__UPDATE",t.COLLECTION__DELETE="COLLECTION__DELETE",t.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",t.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",t.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",t.DOCUMENT__PRINT="DOCUMENT__PRINT",t.DOCUMENT__PROCESS="DOCUMENT__PROCESS",t.DOCUMENT__RATE="DOCUMENT__RATE",t.DOCUMENT__SEARCH="DOCUMENT__SEARCH",t.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",t.DOCUMENT__UNRATE="DOCUMENT__UNRATE",t.FEEDBACK__SEND="FEEDBACK__SEND",t.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",t.AI__RATE="AI__RATE",t.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",t.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",t.KHUB__PROCESS="KHUB__PROCESS",t.KHUB__SEARCH="KHUB__SEARCH",t.LABELS__DOWNLOAD="LABELS__DOWNLOAD",t.LINK__SHARE="LINK__SHARE",t.PAGE__DISPLAY="PAGE__DISPLAY",t.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",t.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",t.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",t.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",t.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",t.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",t.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",t.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",t.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",t.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",t.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",t.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",t.TOPIC__RATE="TOPIC__RATE",t.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",t.TOPIC__UNRATE="TOPIC__UNRATE",t.USER__LOGIN="USER__LOGIN",t.USER__LOGOUT="USER__LOGOUT",t.HEARTBEAT="HEARTBEAT"})(wa||(wa={}));var Ta;(function(t){t.STANDARD="STANDARD",t.STRUCTURAL="STRUCTURAL"})(Ta||(Ta={}));var _a;(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"})(_a||(_a={}));var Ra;(function(t){t.HOMEPAGE="HOMEPAGE",t.CUSTOM="CUSTOM",t.HEADER="HEADER",t.READER="READER",t.TOPIC_TEMPLATE="TOPIC_TEMPLATE",t.SEARCH="SEARCH",t.SEARCH_RESULT="SEARCH_RESULT",t.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",t.LINK_PREVIEW="LINK_PREVIEW",t.UD_VIEWER="UD_VIEWER",t.ASSET_VIEWER="ASSET_VIEWER"})(Ra||(Ra={}));var La;(function(t){t.CLASSIC="CLASSIC",t.CUSTOM="CUSTOM",t.DESIGNER="DESIGNER"})(La||(La={}));var Pa;(function(t){t.AND="AND",t.OR="OR",t.MONOVALUED="MONOVALUED"})(Pa||(Pa={}));var ka;(function(t){t.NONE="NONE",t.ALPHABET="ALPHABET",t.VERSION="VERSION"})(ka||(ka={}));var Da;(function(t){t.STARS="STARS",t.LIKE="LIKE",t.DICHOTOMOUS="DICHOTOMOUS",t.NO_RATING="NO_RATING"})(Da||(Da={}));var Na;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR",t.CUSTOM="CUSTOM"})(Na||(Na={}));var Ia;(function(t){t.OPTIONAL="OPTIONAL",t.MANDATORY="MANDATORY"})(Ia||(Ia={}));var Ma;(function(t){t.ASC="ASC",t.DESC="DESC"})(Ma||(Ma={}));var $a;(function(t){t.ALPHA="ALPHA",t.NATURAL="NATURAL"})($a||($a={}));var Ua;(function(t){t.EVERYWHERE="EVERYWHERE",t.TITLE_ONLY="TITLE_ONLY",t.NONE="NONE"})(Ua||(Ua={}));var Ba;(function(t){t.ARTICLE="ARTICLE",t.BOOK="BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(Ba||(Ba={}));var Ha;(function(t){t.FLUIDTOPICS="FLUIDTOPICS",t.EXTERNAL="EXTERNAL"})(Ha||(Ha={}));var ja;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.PERSONAL_BOOK="PERSONAL_BOOK",t.SHARED_BOOK="SHARED_BOOK",t.HTML_PACKAGE="HTML_PACKAGE"})(ja||(ja={}));var Fa;(function(t){t.LAST_WEEK="LAST_WEEK",t.LAST_MONTH="LAST_MONTH",t.LAST_QUARTER="LAST_QUARTER",t.LAST_YEAR="LAST_YEAR"})(Fa||(Fa={}));var Va;(function(t){t.MAP="MAP",t.DOCUMENT="DOCUMENT",t.TOPIC="TOPIC",t.HTML_PACKAGE="HTML_PACKAGE",t.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Va||(Va={}));var za;(function(t){t.DEFAULT="DEFAULT",t.DOCUMENTS="DOCUMENTS",t.ALL_TOPICS="ALL_TOPICS",t.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(za||(za={}));var Wa;(function(t){t.PLAIN_TEXT="PLAIN_TEXT",t.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",t.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Wa||(Wa={}));var G;(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.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",t.CONTENT_PUBLISHER="CONTENT_PUBLISHER",t.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",t.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",t.KHUB_ADMIN="KHUB_ADMIN",t.USERS_ADMIN="USERS_ADMIN",t.PORTAL_ADMIN="PORTAL_ADMIN",t.ADMIN="ADMIN"})(G||(G={}));var we;(function(t){t.SEARCHES="SEARCHES",t.BOOKMARKS="BOOKMARKS",t.BOOKS="BOOKS",t.COLLECTIONS="COLLECTIONS"})(we||(we={}));var Ka;(function(t){t.UNAUTHENTICATED="UNAUTHENTICATED",t.USER_INCOMPLETE="USER_INCOMPLETE",t.MFA_REQUIRED="MFA_REQUIRED",t.AUTHENTICATED="AUTHENTICATED"})(Ka||(Ka={}));var Ga;(function(t){t.UNREACHABLE="UNREACHABLE",t.UNAUTHORIZED="UNAUTHORIZED",t.FORBIDDEN="FORBIDDEN",t.INCOMPATIBLE="INCOMPATIBLE",t.FAILED="FAILED",t.OK="OK"})(Ga||(Ga={}));var qa;(function(t){t.VALID="VALID",t.INVALID="INVALID"})(qa||(qa={}));var Ya;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SUMMARY="SUMMARY",t.SEMANTIC_SEARCH="SEMANTIC_SEARCH",t.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",t.DOCUMENTATION="DOCUMENTATION",t.OTHER="OTHER"})(Ya||(Ya={}));var Xa;(function(t){t.INACCURATE="INACCURATE",t.INCOMPLETE="INCOMPLETE",t.OFF_TOPIC="OFF_TOPIC",t.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",t.SLOW="SLOW",t.OTHER="OTHER"})(Xa||(Xa={}));var Ja;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Ja||(Ja={}));var Za;(function(t){t.JSON="JSON",t.TEXT="TEXT"})(Za||(Za={}));var Qa;(function(t){t.TEXT="TEXT",t.HTML="HTML"})(Qa||(Qa={}));var el;(function(t){t.IN_PROGRESS="IN_PROGRESS",t.ERROR="ERROR",t.DONE="DONE"})(el||(el={}));var tl;(function(t){t.HTML="HTML",t.MARKDOWN="MARKDOWN"})(tl||(tl={}));var rl;(function(t){t.SOURCES="SOURCES",t.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",t.VOCABULARIES="VOCABULARIES",t.METADATA="METADATA",t.PRETTY_URL="PRETTY_URL",t.ACCESS_RULE="ACCESS_RULE",t.DESIGNED_PAGES="DESIGNED_PAGES",t.THEME_STUDIO="THEME_STUDIO",t.PORTAL_GENERAL="PORTAL_GENERAL",t.ASSETS="ASSETS",t.CODE_LIBRARY="CODE_LIBRARY",t.THEME="THEME",t.CONTENT_STYLES="CONTENT_STYLES",t.HOMEPAGE="HOMEPAGE",t.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",t.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",t.PORTAL_METADATA="PORTAL_METADATA",t.LANGUAGES="LANGUAGES",t.PRINT_TEMPLATES="PRINT_TEMPLATES",t.OFFLINE="OFFLINE",t.CUSTOM_JS="CUSTOM_JS",t.CONFIDENTIALITY="CONFIDENTIALITY",t.NOTIFICATIONS="NOTIFICATIONS"})(rl||(rl={}));var nl;(function(t){t.MAP="MAP",t.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(nl||(nl={}));var Xu={[G.PERSONAL_BOOK_SHARE_USER]:[G.PERSONAL_BOOK_USER],[G.HTML_EXPORT_USER]:[G.PERSONAL_BOOK_USER],[G.PDF_EXPORT_USER]:[G.PERSONAL_BOOK_USER],[G.KHUB_ADMIN]:[G.CONTENT_PUBLISHER],[G.ADMIN]:[G.KHUB_ADMIN,G.USERS_ADMIN,G.PORTAL_ADMIN,G.BEHAVIOR_DATA_USER],[G.GENERATIVE_AI_EXPORT_USER]:[G.GENERATIVE_AI_USER]};function il(t,e){return t===e||(Xu[t]??[]).some(r=>il(r,e))}function ol(t,e){return t==null?!1:(Array.isArray(t)?t:Array.isArray(t.roles)?t.roles:Array.isArray(t.profile?.roles)?t.profile.roles:[]).some(n=>il(n,e))}var wn=f(E());var Ii=f(E());var kt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=T.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=T.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var dr=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:kt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):kt.await()}};var be=class extends dr{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(o,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([a],[l])=>a.localeCompare(l)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new Ii.CacheRegistry,this.cache=e?i.commonCache:new Ii.CacheRegistry}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Sn=class extends be{async listMySearches(){let{session:e}=T.getState();return ol(e,G.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var En=class extends be{async listMyBookmarks(){let e=T.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var Cn=class extends be{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var On=class extends be{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=T.getState().session;return!!e?.sessionAuthenticated}};var Ju="ft-user-assets",Zu={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(we).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;$i(t,r,[...Mi(t,r),i]),sl(t,r,1,n),al(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;$i(t,r,Mi(t,r).map(i=>i.id===n.id?n:i)),al(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;$i(t,r,Mi(t,r).filter(o=>o.id!==i)),sl(t,r,-1,n)}},ll={[we.SEARCHES]:"savedSearches",[we.BOOKMARKS]:"bookmarks",[we.BOOKS]:void 0,[we.COLLECTIONS]:void 0},Mi=(t,e)=>{var r;let n=ll[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},$i=(t,e,r)=>{let n=ll[e];n&&(t[n]=r)},sl=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===we.BOOKMARKS&&n)){let o=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,o+r)}},al=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},ae=wn.FtReduxStore.get({name:Ju,reducers:Zu,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(we).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Ui=class{constructor(e=new Cn,r=new On){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=T.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new En,this.savedSearchesService=new Sn,T.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=T.getState();(0,wn.deepEqual)((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),ae.actions.clearAssetCount(),ae.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),ae.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),ae.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();ae.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();ae.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&ae.getState().assetCounts.allAsset[e]!==r.count&&ae.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&ae.getState().assetCounts.bookmarkByMap[e]!==r.count&&ae.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(ae.getState().assetCounts.bookmarkByMap).length!==0;e===we.BOOKMARKS&&r&&ae.actions.clearBookmarkCountByMap(),ae.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;ae.actions.bookmarks(r)}}},Qu=new Ui;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=Qu);var Bi=class{addCommand(e,r=!1){T.commands.add(e,r)}consumeCommand(e){return T.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Bi;var Te=f(E());var cl,pr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},ed=Symbol("clearAfterUnitTest"),Tn=class extends(0,Te.withEventBus)(be){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[cl]=()=>{this.defaultMessages={},this.cache=new Te.CacheRegistry,this.listeners={}},this.currentUiLocale=T.getState().uiLocale,T.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=T.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};(0,Te.deepEqual)(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let o=e.toLowerCase(),s=this.resolveContext(o);return new Te.ParametrizedLabelResolver((i=this.defaultMessages[o])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof Te.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new pr({loadedContexts:e})),this.dispatchEvent(new pr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new pr({loadedContexts:[e]})),this.dispatchEvent(new pr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>(0,Te.delay)(0).then(()=>n()).catch(()=>null)))}};cl=ed;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Tn{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Tn{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var Mr=window.FluidTopicsI18nService,Hi=window.FluidTopicsCustomI18nService;var ul=f(E()),ji=class{highlightHtml(e,r,n){(0,ul.highlightHtml)(e,r,n)}};window.FluidTopicsHighlightHtmlService=new ji;var dl=f(E());var Fi=class{isDate(e){var r,n,i,o;return(o=(i=((n=(r=T.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===e))===null||i===void 0?void 0:i.date)!==null&&o!==void 0?o:!1}format(e,r){var n,i,o,s;if(e==null)return"";try{return dl.DateFormatter.format(e,(n=r?.locale)!==null&&n!==void 0?n:T.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(o=r?.withTime)!==null&&o!==void 0?o:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(a){throw console.error(`Date ${JSON.stringify(e)} is not valid`,a),a}}};window.FluidTopicsDateService=new Fi;var pl=f(E());var $r=class{static get(e,r){var n,i,o,s;let a=T.getState(),{lang:l,region:c}=(o=(i=(n=a.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&o!==void 0?o:{lang:"en",region:"US"};return new pl.SearchPlaceConverter(a.baseUrl,e??20,(s=a.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${l}-${c}`)}};var Vi=class{urlToSearchRequest(e){return $r.get().parse(e)}searchRequestToUrl(e){return $r.get().serialize(e)}};window.FluidTopicsUrlService=new Vi;var et=f(E());var Dt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};Dt.eventName="change";var zi=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},fl=new zi;var _n=class t extends et.WithEventBus{static build(){return new t(window.history,fl,()=>window.location,!1)}constructor(e,r,n,i){var o,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(o=e.state)===null||o===void 0?void 0:o.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,et.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new Dt(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[o,s,a])=>{let l=r(),c={...l===this.currentIndex?this.currentState:void 0,...o,index:l,href:typeof a=="string"?a:(a??this.windowLocation()).href};n.apply(i,[c,s,a]),this.setCurrentState(c,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(Dt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(Dt.eventName,e)}currentItem(){return(0,et.deepCopy)(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,et.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,et.deepCopy)(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return(0,et.deepCopy)(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,o=e+1;for(;this.states.length>o&&!this.isDifferentMajorState(o,n);)this.hasState(o)&&(i=o),o++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,o=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return o==null||o!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=_n.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var hl=f(L());var ml=hl.css`
261
- `;var gl=f(L()),pe=f(z()),Mt=f(E());var Nt=f(E());function vl(t,e){let{authenticationRequired:r,session:n}=T.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Rn=class extends dr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Wi=class t extends Nt.FtStateManager{static build(e){return new t(T,e)}constructor(e,r){super(),this.store=e,this.cache=new Nt.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Rn,this.cleanSessionDebouncer=new Nt.Debouncer,this.reloadDebouncer=new Nt.Debouncer(500),this.apiProvider=r??(()=>kt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(ur.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>vl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ir(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},yl=Wi.build();var It=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var Ur=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:o}of n){let s=i.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new It(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let o=i.callbacks.get(r);o===void 0&&i.callbacks.set(r,o=new WeakSet),o.has(n)||(o.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var te=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},B=class extends Mt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=yl,this.contextRoot=new Ur}render(){return gl.html`
261
+ `;var gl=f(L()),pe=f(z()),Mt=f(E());var Nt=f(E());function vl(t,e){let{authenticationRequired:r,session:n}=T.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var Rn=class extends dr{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var Wi=class t extends Nt.FtStateManager{static build(e){return new t(T,e)}constructor(e,r){super(),this.store=e,this.cache=new Nt.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Rn,this.cleanSessionDebouncer=new Nt.Debouncer,this.reloadDebouncer=new Nt.Debouncer(500),this.apiProvider=r??(()=>kt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(ur.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>vl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new Ir(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},yl=Wi.build();var It=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var Ur=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:o}of n){let s=i.deref(),a=o.deref();s===void 0||a===void 0||s.dispatchEvent(new It(e.context,s,a,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let o=i.callbacks.get(r);o===void 0&&i.callbacks.set(r,o=new WeakSet),o.has(n)||(o.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var te=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},B=class extends Mt.FtLitElementRedux{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=yl,this.contextRoot=new Ur}render(){return gl.html`
262
262
  <slot></slot>
263
263
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>Mr.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};B.elementDefinitions={};B.styles=ml;te([(0,pe.property)()],B.prototype,"baseUrl",void 0);te([(0,pe.property)()],B.prototype,"tenantId",void 0);te([(0,pe.property)()],B.prototype,"apiIntegrationIdentifier",void 0);te([(0,pe.property)()],B.prototype,"apiIntegrationAppVersion",void 0);te([(0,pe.property)()],B.prototype,"uiLocale",void 0);te([(0,Mt.jsonProperty)(null)],B.prototype,"availableUiLocales",void 0);te([(0,Mt.jsonProperty)(null)],B.prototype,"metadataConfiguration",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"editorMode",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"noCustom",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"openExternalDocumentInNewTab",void 0);te([(0,pe.property)({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],B.prototype,"noCustomComponent",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"withManualResources",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"navigatorOnline",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"forcedOffline",void 0);te([(0,pe.property)({type:Boolean})],B.prototype,"authenticationRequired",void 0);te([(0,Mt.jsonProperty)([])],B.prototype,"messageContexts",void 0);te([(0,Mt.jsonProperty)(void 0)],B.prototype,"session",void 0);var xl=f(E());var bl={"ft-app-context":B};(0,xl.customElements)(bl);var Al=f(z());var Ki=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[r,n]=e.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},fr=new Ki;var nd=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},Hr=Symbol("i18nAttributes"),Sl=Symbol("i18nListAttributes"),El=Symbol("i18nProperties"),Ln=Symbol("i18nContexts"),Br=Symbol("i18nUnsubs"),Dn=(0,hr.applyMixinOnce)(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(o){return o??this.useCustomMessageContexts?Hi:Mr}i18n(o){let{context:s,key:a,message:l}=o,{custom:c,args:u,argsProvider:d}=o;if(s&&a){this.hasI18nContext(s)||this.addI18nContext(s,void 0,c);let p=u??(d?d(this):[]);return this.getI18nService(c).resolveMessage(s,a,...p)}return l}async awaitI18n(o){let{context:s,custom:a}=o;return s&&await this.getI18nService(a).prepareContext(s),this.i18n(o)}customI18n(o,s){if(fr.isI18nKey(o)){let[a,l]=o.split(".");return this.i18n({custom:!0,context:a,key:l,...s})||o}return o}firstUpdated(o){super.firstUpdated(o),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(o){super.update(o),this.updateI18nAttributes((s,a,l)=>o.has(a)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(o){this.updateI18nAttributes((s,a,l)=>{var c;return((c=l?.context)===null||c===void 0?void 0:c.toLowerCase())===o}),this.updateI18nProperties(s=>s.context.toLowerCase()===o),this.requestUpdate()}updateI18nAttributes(o){var s,a;let l=this,c=(u,d,p)=>p?.context&&p.key&&o(u,d,p)?{...p,message:this.i18n({context:p.context,key:p.key,custom:p.custom,...u})}:p;(s=this[Hr])===null||s===void 0||s.forEach((u,d)=>l[d]=c(u,d,l[d])),(a=this[Sl])===null||a===void 0||a.forEach((u,d)=>{var p;return l[d]=(p=l[d])===null||p===void 0?void 0:p.map(h=>c(u,d,h))})}updateI18nProperties(o){var s;(s=this[El])===null||s===void 0||s.forEach((a,l)=>{o(a,l)&&(this[l]=this.i18n(a))})}addI18nMessages(o,s,a){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(o,s,a)}addI18nContext(o,s,a){let l=(typeof o=="string"?o:o.name).toLowerCase();a=typeof o=="string"?a:o.custom,this[Ln].set(l,{isCustomContext:a}),this[Br].has(l)||this[Br].set(l,this.getI18nService(a).subscribe(l,()=>this.onI18nUpdate(l))),this.getI18nService(a).prepareContext(l,s)}hasI18nContext(o){return this[Ln].has(o.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Ln].forEach((o,s)=>this.addI18nContext(s,void 0,o.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Br].forEach(o=>o()),this[Br].clear()}}return e=Ln,r=Br,nd([(0,Al.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),Pn=class extends Dn(hr.FtLitElement){},kn=class extends Dn(hr.FtLitElementRedux){};var Cl=f(E());var Gi=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?fr.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},id=new Gi;var Ol=(t,e)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:Cl.hasChanged,converter:fr,...e}),r[Hr]=(i=r[Hr])!==null&&i!==void 0?i:new Map,r[Hr].set(n,t??{})};var wl=f(L());var Tl=wl.css`
264
264
  `;var Nn=f(L()),In=f(z()),Mn=f(E());var jr=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},Ie=class extends kn{constructor(){super(),this.editorMode=!1,this.addStore(T)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":Nn.nothing:Nn.html`
@@ -1316,7 +1316,7 @@
1316
1316
  class="${e}"
1317
1317
  filterId="${this.id}"
1318
1318
  .filter=${this.filter}
1319
- .configuredAnalyticsActions="${this.configuredAnalyticsActions}"
1319
+ .configuredAnalyticsActions=${this.configuredAnalyticsActions}
1320
1320
  moreValuesButtonLabel="${this.moreValuesButtonLabel}"
1321
1321
  ?multivalued=${this.multivalued}
1322
1322
  ?disabled=${this.disabled||e!=="ft-filter--level-center"}
@@ -5,7 +5,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
5
5
  .highlight-html-match {
6
6
  background: ${Sl};
7
7
  }
8
- `;function wi(t,e,r){var n,i;let a=t.getAttribute("data-highlight-html-query");if((a??"")!==(e??"")){let s=new $p(t);if(s.unmark(),e&&e.trim()){let c={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(c.each=(p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])})),s.mark(e.replace(/"[^"]+"/g,""),{...c,separateWordSearch:!0}),((i=e.match(/"[^"]+"/g))!==null&&i!==void 0?i:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...c,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var _i={};H(_i,{noTextInputDefaultClearButton:()=>Li,noTextSelect:()=>ro,safariEllipsisFix:()=>Ti,wordWrap:()=>Hp});var ro=_`
8
+ `;function wi(t,e,r){var n,i;let a=t.getAttribute("data-highlight-html-query");if((a??"")!==(e??"")){let s=new $p(t);if(s.unmark(),e&&e.trim()){let c={className:(n=r?.className)!==null&&n!==void 0?n:"highlight-html-match",acrossElements:!0};r?.attributes!=null&&(c.each=p=>{for(let h in r.attributes)p.setAttribute(h,r.attributes[h])}),s.mark(e.replace(/"[^"]+"/g,""),{...c,separateWordSearch:!0}),((i=e.match(/"[^"]+"/g))!==null&&i!==void 0?i:[]).forEach(p=>s.mark(p.replace(/"/g,""),{...c,separateWordSearch:!1}))}}t.setAttribute("data-highlight-html-query",e??"")}var _i={};H(_i,{noTextInputDefaultClearButton:()=>Li,noTextSelect:()=>ro,safariEllipsisFix:()=>Ti,wordWrap:()=>Hp});var ro=_`
9
9
  .ft-no-text-select {
10
10
  -webkit-touch-callout: none;
11
11
  -webkit-user-select: none;
@@ -339,7 +339,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
339
339
  word-break: break-word;
340
340
  }
341
341
  `;var Gf="ft-app-info",Lr=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};Lr.eventName="authentication-change";var ho=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:e})}};ho.eventName="ui-locale-changed";var jf={session:(t,e)=>{be(t.session,e.payload)||(t.session=e.payload,setTimeout(()=>$.dispatchEvent(new Lr(e.payload)),0))}},$=Ht.get({name:Gf,reducers:jf,initialState:{baseUrl:void 0,tenantId:void 0,apiIntegrationIdentifier:void 0,apiIntegrationAppVersion:void 0,uiLocale:document.documentElement.lang||"en-US",availableContentLocales:[],localesConfiguration:void 0,metadataConfiguration:void 0,privacyPolicyConfiguration:void 0,editorMode:!1,noCustom:!1,noCustomComponent:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1}});var en=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},FE=ce(Symbol("withDateFormat"),function(t){class e extends t{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore($)}dateFormatOptionsChanged(n){return n.has("metadataDescriptors")||n.has("useLongDateFormat")||n.has("useDateTimeFormat")||n.has("uiLocale")}getDateFormatter(n){var i,a;return((a=(i=this.metadataDescriptors.find(c=>c.key===n))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1)?c=>zt.format(c,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return en([g({type:Boolean})],e.prototype,"useLongDateFormat",void 0),en([g({type:Boolean})],e.prototype,"useDateTimeFormat",void 0),en([cr({store:$.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],e.prototype,"metadataDescriptors",void 0),en([cr({store:$.name})],e.prototype,"uiLocale",void 0),e});var Gt=class t{static get(e){let{baseUrl:r,apiIntegrationIdentifier:n}=$.getState(),i=e??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(e){return new Promise(r=>{let n=t.get(e);if(n)r(n);else{let i=$.subscribe(()=>{n=t.get(e),n&&(i(),r(n))})}})}};var _r=class{constructor(e){this.overrideApi=e}get api(){var e;return(e=this.overrideApi)!==null&&e!==void 0?e:Gt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Gt.await()}};var Re=class extends _r{constructor(e=!0,r){var n;super(r),this.sortObjectFields=(a,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([c],[d])=>c.localeCompare(d)));let i=this.constructor;i.commonCache=(n=i.commonCache)!==null&&n!==void 0?n:new qe,this.cache=e?i.commonCache:new qe}clearCache(){this.cache.clearAll()}hash(e){return String(Array.from(JSON.stringify(e,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var tn=class extends Re{async listMySearches(){let{session:e}=$.getState();return Hc(e,oe.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(e.profile.userId),300*1e3):[]}};var rn=class extends Re{async listMyBookmarks(){let e=$.getState().session;return e?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(e.profile.userId),300*1e3):[]}};var on=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(e){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${e}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(e){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${e}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${e}`),this.CACHE_DURATION)}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var nn=class extends Re{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetLabels(){return this.isAuthenticated()?this.cache.get("user-asset-labels",async()=>(await this.awaitApi).get("/internal/api/webapp/user/assets/labels"),this.CACHE_DURATION):[]}isAuthenticated(){let e=$.getState().session;return!!e?.sessionAuthenticated}};var Kf="ft-user-assets",Zf={setAssetCount:(t,e)=>{let{userAssetType:r,count:n}=e.payload.assetCount;t.assetCounts.allAsset[r]=n},clearAssetCount:t=>{Object.values(Ie).forEach(e=>{t.assetCounts.allAsset[e]=void 0})},setBookmarkCountByMap:(t,e)=>{let r=e.payload.mapId;t.assetCounts.bookmarkByMap[r]=e.payload.count},clearBookmarkCountByMap:t=>{t.assetCounts.bookmarkByMap={}},addAsset:(t,e)=>{let{assetType:r,mapId:n,asset:i}=e.payload;ka(t,r,[..._a(t,r),i]),xd(t,r,1,n),vd(t,i)},editAsset:(t,e)=>{let{assetType:r,asset:n}=e.payload;ka(t,r,_a(t,r).map(i=>i.id===n.id?n:i)),vd(t,n)},removeAsset:(t,e)=>{let{assetType:r,mapId:n,assetId:i}=e.payload;ka(t,r,_a(t,r).filter(a=>a.id!==i)),xd(t,r,-1,n)}},Sd={[Ie.SEARCHES]:"savedSearches",[Ie.BOOKMARKS]:"bookmarks",[Ie.BOOKS]:void 0,[Ie.COLLECTIONS]:void 0},_a=(t,e)=>{var r;let n=Sd[e];return n?(r=t[n])!==null&&r!==void 0?r:[]:[]},ka=(t,e,r)=>{let n=Sd[e];n&&(t[n]=r)},xd=(t,e,r,n)=>{let i=t.assetCounts.allAsset[e];if(i!==void 0&&(t.assetCounts.allAsset[e]=Math.max(0,i+r),e===Ie.BOOKMARKS&&n)){let a=t.assetCounts.bookmarkByMap[n];t.assetCounts.bookmarkByMap[n]=Math.max(0,a+r)}},vd=(t,e)=>{let r=t.assetLabels.map(i=>i.title),n=e.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));t.assetLabels.push(...n)},xe=Ht.get({name:Kf,reducers:Zf,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(Ie).map(t=>[t,void 0])),bookmarkByMap:{}},assetLabels:[]}}),Pa=class{constructor(e=new on,r=new nn){this.assetCountsService=e,this.assetLabelsService=r,this.currentSession=$.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new rn,this.savedSearchesService=new tn,$.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var e;let{session:r}=$.getState();be((e=this.currentSession)===null||e===void 0?void 0:e.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),xe.actions.clearAssetCount(),xe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),xe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),xe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let e=await this.savedSearchesService.listMySearches();xe.actions.savedSearches(e)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let e=await this.assetLabelsService.getUserAssetLabels();xe.actions.assetLabels(e)}async loadAssetCount(e){let r=await this.assetCountsService.getUserAssetCount(e);r&&xe.getState().assetCounts.allAsset[e]!==r.count&&xe.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(e){let r=await this.assetCountsService.getUserBookmarkCountByMap(e);r&&xe.getState().assetCounts.bookmarkByMap[e]!==r.count&&xe.actions.setBookmarkCountByMap({count:r.count,mapId:e})}async reloadAssetCount(e){this.assetCountsService.clearCache();let r=Object.keys(xe.getState().assetCounts.bookmarkByMap).length!==0;e===Ie.BOOKMARKS&&r&&xe.actions.clearBookmarkCountByMap(),xe.getState().assetCounts.allAsset[e]!==void 0&&await this.loadAssetCount(e)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var e;if(this.bookmarksAreUsed){let r=!((e=this.currentSession)===null||e===void 0)&&e.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;xe.actions.bookmarks(r)}}},qf=new Pa;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=qf);var Ia=class{addCommand(e,r=!1){$.commands.add(e,r)}consumeCommand(e){return $.commands.consume(e)}};window.FluidTopicsAppInfoStoreService=new Ia;var Ed,kr=class extends CustomEvent{constructor(e){super("ft-i18n-context-loaded",{detail:e})}},Yf=Symbol("clearAfterUnitTest"),an=class extends Uo(Re){constructor(e){super(),this.messageContextProvider=e,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Ed]=()=>{this.defaultMessages={},this.cache=new qe,this.listeners={}},this.currentUiLocale=$.getState().uiLocale,$.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:e}=$.getState();this.currentUiLocale!==e&&(this.currentUiLocale=e,this.cache.clearAll(),this.notifyAll())}addContext(e){let r=e.name.toLowerCase();this.cache.setFinal(r,e),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(e,r){var n;if(e=e.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[e])!==null&&n!==void 0?n:{},...r};be(this.defaultMessages[e],i)||(this.defaultMessages[e]=i,await this.notify(e))}return this.fetchContext(e)}resolveContext(e){var r,n;return this.fetchContext(e),(n=(r=this.cache.getNow(e))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(e,r){let n=e.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(e,r,...n){var i;let a=e.toLowerCase(),s=this.resolveContext(a);return new oo((i=this.defaultMessages[a])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(e){let r=!this.cache.has(e),n;try{n=await this.cache.get(e,()=>this.messageContextProvider(this.currentUiLocale,e)),r&&await this.notify(e)}catch(i){!(i instanceof Rt)&&r&&console.error(i)}return n}subscribe(e,r){var n;return e=e.toLowerCase(),this.listeners[e]=(n=this.listeners[e])!==null&&n!==void 0?n:new Set,this.listeners[e].add(r),()=>{var i;return(i=this.listeners[e])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let e=Object.keys(this.listeners);document.body.dispatchEvent(new kr({loadedContexts:e})),this.dispatchEvent(new kr({loadedContexts:e})),await Promise.all(e.map(r=>this.notify(r,!1)))}async notify(e,r=!0){r&&(document.body.dispatchEvent(new kr({loadedContexts:[e]})),this.dispatchEvent(new kr({loadedContexts:[e]}))),this.listeners[e]!=null&&await Promise.all([...this.listeners[e].values()].map(n=>Do(0).then(()=>n()).catch(()=>null)))}};Ed=Yf;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends an{constructor(){super(async(t,e)=>(await this.awaitApi).getFluidTopicsMessageContext(t,e))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends an{constructor(){super(async(t,e)=>(await this.awaitApi).getCustomMessageContext(t,e))}});var mo=window.FluidTopicsI18nService,Na=window.FluidTopicsCustomI18nService;var Da=class{highlightHtml(e,r,n){wi(e,r,n)}};window.FluidTopicsHighlightHtmlService=new Da;var Ma=class{isDate(e){var r,n,i,a;return(a=(i=((n=(r=$.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(c=>c.key===e))===null||i===void 0?void 0:i.date)!==null&&a!==void 0?a:!1}format(e,r){var n,i,a,s;if(e==null)return"";try{return zt.format(e,(n=r?.locale)!==null&&n!==void 0?n:$.getState().uiLocale,(i=r?.longFormat)!==null&&i!==void 0?i:!1,(a=r?.withTime)!==null&&a!==void 0?a:!1,(s=r?.onlyTime)!==null&&s!==void 0?s:!1)}catch(c){throw console.error(`Date ${JSON.stringify(e)} is not valid`,c),c}}};window.FluidTopicsDateService=new Ma;var yo=class{static get(e,r){var n,i,a,s;let c=$.getState(),{lang:d,region:p}=(a=(i=(n=c.localesConfiguration)===null||n===void 0?void 0:n.defaultLocales)===null||i===void 0?void 0:i.defaultContentLocale)!==null&&a!==void 0?a:{lang:"en",region:"US"};return new br(c.baseUrl,e??20,(s=c.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${d}-${p}`)}};var Ua=class{urlToSearchRequest(e){return yo.get().parse(e)}searchRequestToUrl(e){return yo.get().serialize(e)}};window.FluidTopicsUrlService=new Ua;var jt=class t extends CustomEvent{constructor(e){super(t.eventName,{detail:{currentItem:e}})}};jt.eventName="change";var Ba=class{itemName(e){return`fluid-topics-history-item-${e}`}get(e){let r=sessionStorage.getItem(this.itemName(e));return r?JSON.parse(r):void 0}set(e,r){sessionStorage.setItem(this.itemName(e),JSON.stringify(r))}},Cd=new Ba;var sn=class t extends ot{static build(){return new t(window.history,Cd,()=>window.location,!1)}constructor(e,r,n,i){var a,s;super(),this.history=e,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=e.pushState,this.realReplaceState=e.replaceState,this.initialIndex=(s=(a=e.state)===null||a===void 0?void 0:a.index)!==null&&s!==void 0?s:e.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(e,r=!1){let n=r&&this.currentIndex===e.index-1;this.currentState={...this.buildCurrentState(),...e},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,n&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),be(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new jt(this.currentItem())),0)}installProxies(){let e=r=>(n,i,[a,s,c])=>{let d=r(),p={...d===this.currentIndex?this.currentState:void 0,...a,index:d,href:typeof c=="string"?c:(c??this.windowLocation()).href};n.apply(i,[p,s,c]),this.setCurrentState(p,!0)};this.history.pushState=new Proxy(this.history.pushState,{apply:e(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:e(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",e=>this.setCurrentState(e.state)),document.querySelector("title")==null&&document.head.append(document.createElement("title")),new MutationObserver(()=>this.updateCurrentState({title:document.title})).observe(document.querySelector("title"),{subtree:!0,characterData:!0,childList:!0})}initData(e){for(let r=this.history.length-1;r>=0;r--)e?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(e){var r;let n={...this.buildCurrentState(),...e,index:this.currentIndex,title:(r=e?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(e){this.addEventListener(jt.eventName,e)}removeHistoryChangeListener(e){this.removeEventListener(jt.eventName,e)}currentItem(){return Me(this.currentState)}back(){let e=this.previousDifferentMajorPosition();e>=0?this.history.go(e-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return Me(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(e){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return Me(r.find(n=>e(n)))}previousDifferentMajorPosition(){let e=this.currentIndex>0?this.currentIndex-1:0;for(;e>0&&!this.isDifferentMajorState(e);)e--;return e}forward(){let e=this.nextMajorPosition();e&&e<this.states.length?this.history.go(e-this.currentIndex):this.history.forward()}forwardItem(){let e=this.nextMajorPosition();if(e)return Me(this.states[e])}nextMajorPosition(){let e=this.currentIndex;if(!(e>=this.states.length)){do e++;while(e<this.states.length&&!this.isDifferentMajorState(e));return this.getHigherPositionInTheSameState(e)}}getHigherPositionInTheSameState(e){var r;let n=(r=this.states[e])===null||r===void 0?void 0:r.majorStateId;if(!n)return e;let i=e,a=e+1;for(;this.states.length>a&&!this.isDifferentMajorState(a,n);)this.hasState(a)&&(i=a),a++;return i}buildCurrentState(){var e,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(e=this.history.state)===null||e===void 0?void 0:e.title)!==null&&r!==void 0?r:document.title}}hasState(e){return this.states[e]!=null}isDifferentMajorState(e,r){var n;if(!this.hasState(e))return!1;let i=r??this.currentState.majorStateId,a=(n=this.states[e])===null||n===void 0?void 0:n.majorStateId;return a==null||a!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=sn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:t=>window.FluidTopicsInternalHistoryService.backwardItemMatching(t),addHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(t),removeHistoryChangeListener:t=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(t)});var Od=_`
342
- `;function Ad(t,e){let{authenticationRequired:r,session:n}=$.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var ln=class extends _r{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var $a=class t extends co{static build(e){return new t($,e)}constructor(e,r){super(),this.store=e,this.cache=new qe,this.withManualResources=!0,this.userLocaleService=new ln,this.cleanSessionDebouncer=new re,this.reloadDebouncer=new re(500),this.apiProvider=r??(()=>Gt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Lr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Ad(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e){this.userLocaleService.updateUiLocale({uiLocale:e}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new ho(r)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},wd=$a.build();var Kt=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var go=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),c=a.deref();s===void 0||c===void 0||s.dispatchEvent(new Kt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(r);a===void 0&&i.callbacks.set(r,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var pe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Q=class extends Bt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=wd,this.contextRoot=new go}render(){return k`
342
+ `;function Ad(t,e){let{authenticationRequired:r,session:n}=$.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(e):t()}var ln=class extends _r{async updateUiLocale(e){return(await this.awaitApi).updateUiLocale(e)}};var $a=class t extends co{static build(e){return new t($,e)}constructor(e,r){super(),this.store=e,this.cache=new qe,this.withManualResources=!0,this.userLocaleService=new ln,this.cleanSessionDebouncer=new re,this.reloadDebouncer=new re(500),this.apiProvider=r??(()=>Gt.get())}setWithManualResources(e){this.withManualResources=e,this.updateIfNeeded()}async initService(){this.store.addEventListener(Lr.eventName,this.reloadConfiguration)}async updateIfNeeded(){this.apiProvider()&&(this.withManualResources||(this.store.getState().session==null&&this.updateSession(),this.store.getState().metadataConfiguration==null&&this.updateMetadataConfiguration()),this.store.getState().localesConfiguration==null&&this.updateLocalesConfiguration(),(this.store.getState().availableContentLocales==null||this.store.getState().availableContentLocales.length==0)&&this.updateAvailableContentLocales())}async updateSession(){let e=await this.cache.get("session",async()=>{let r=await this.apiProvider().getCurrentSession();return r.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},r.idleTimeoutInMillis),r});this.setSession(e)}async updateMetadataConfiguration(){this.setMetadataConfiguration(await this.cache.get("metadataConfiguration",()=>this.apiProvider().getMetadataConfiguration()))}async updateLocalesConfiguration(){this.setLocalesConfiguration(await this.cache.get("localesConfiguration",()=>this.apiProvider().getLocalesConfiguration()))}async updateAvailableContentLocales(){var e;let r=await this.cache.get("availableContentLocales",()=>Ad(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((e=r.contentLocales)!==null&&e!==void 0?e:[])}reloadConfiguration(){var e;(e=this.cache)===null||e===void 0||e.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(e){this.store.actions.baseUrl(e),window.fluidTopicsBaseUrl=e}setTenantId(e){this.store.actions.tenantId(e)}setApiIntegrationIdentifier(e){this.store.actions.apiIntegrationIdentifier(e)}setApiIntegrationAppVersion(e){this.store.actions.apiIntegrationAppVersion(e)}setUiLocale(e){this.store.actions.uiLocale(e)}setLocalesConfiguration(e){this.store.actions.localesConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(e){this.store.actions.availableContentLocales(e),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(e,r){this.userLocaleService.updateUiLocale({uiLocale:e,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new ho(n)))}).catch(()=>{})}setMetadataConfiguration(e){this.store.actions.metadataConfiguration(e),setTimeout(()=>this.updateIfNeeded())}setNoCustom(e){this.store.actions.noCustom(e)}setEditorMode(e){this.store.actions.editorMode(e)}setNoCustomComponent(e){this.store.actions.noCustomComponent(e)}setSession(e){this.store.actions.session(e),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(e){this.store.actions.openExternalDocumentInNewTab(e)}setNavigatorOnline(e){this.store.actions.navigatorOnline(e)}setForcedOffline(e){this.store.actions.forcedOffline(e)}setAuthenticationRequired(e){this.store.actions.authenticationRequired(e)}},wd=$a.build();var Kt=class extends Event{constructor(e,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=e,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var go=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=e=>{let r=this.pendingContextRequests.get(e.context);if(r===void 0)return;this.pendingContextRequests.delete(e.context);let{requests:n}=r;for(let{elementRef:i,callbackRef:a}of n){let s=i.deref(),c=a.deref();s===void 0||c===void 0||s.dispatchEvent(new Kt(e.context,s,c,!0))}},this.onContextRequest=e=>{if(e.subscribe!==!0)return;let r=e.contextTarget??e.composedPath()[0],n=e.callback,i=this.pendingContextRequests.get(e.context);i===void 0&&this.pendingContextRequests.set(e.context,i={callbacks:new WeakMap,requests:[]});let a=i.callbacks.get(r);a===void 0&&i.callbacks.set(r,a=new WeakSet),a.has(n)||(a.add(n),i.requests.push({elementRef:new WeakRef(r),callbackRef:new WeakRef(n)}))}}attach(e){e.addEventListener("context-request",this.onContextRequest),e.addEventListener("context-provider",this.onContextProvider)}detach(e){e.removeEventListener("context-request",this.onContextRequest),e.removeEventListener("context-provider",this.onContextProvider)}};var pe=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},Q=class extends Bt{constructor(){super(...arguments),this.apiIntegrationIdentifier="ft-integration",this.apiIntegrationAppVersion="ft-integration-app-version",this.uiLocale="en-US",this.editorMode=!1,this.noCustom=!1,this.openExternalDocumentInNewTab=!1,this.noCustomComponent=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=wd,this.contextRoot=new go}render(){return k`
343
343
  <slot></slot>
344
344
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(e){var r;super.update(e),e.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),e.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),e.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),e.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),e.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),e.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),e.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),e.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),e.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),e.has("session")&&this.stateManager.setSession(this.session),e.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>mo.addContext(n)),e.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),e.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),e.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),e.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),e.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};Q.elementDefinitions={};Q.styles=Od;pe([g()],Q.prototype,"baseUrl",void 0);pe([g()],Q.prototype,"tenantId",void 0);pe([g()],Q.prototype,"apiIntegrationIdentifier",void 0);pe([g()],Q.prototype,"apiIntegrationAppVersion",void 0);pe([g()],Q.prototype,"uiLocale",void 0);pe([ie(null)],Q.prototype,"availableUiLocales",void 0);pe([ie(null)],Q.prototype,"metadataConfiguration",void 0);pe([g({type:Boolean})],Q.prototype,"editorMode",void 0);pe([g({type:Boolean})],Q.prototype,"noCustom",void 0);pe([g({type:Boolean})],Q.prototype,"openExternalDocumentInNewTab",void 0);pe([g({converter:{fromAttribute(t){return t==="false"?!1:t==="true"||(t??!1)}}})],Q.prototype,"noCustomComponent",void 0);pe([g({type:Boolean})],Q.prototype,"withManualResources",void 0);pe([g({type:Boolean})],Q.prototype,"navigatorOnline",void 0);pe([g({type:Boolean})],Q.prototype,"forcedOffline",void 0);pe([g({type:Boolean})],Q.prototype,"authenticationRequired",void 0);pe([ie([])],Q.prototype,"messageContexts",void 0);pe([ie(void 0)],Q.prototype,"session",void 0);var Rd={"ft-app-context":Q};Y(Rd);var Fa=class{fromLocalizableLabel(e){return e.type=="PLAIN_TEXT"?{message:e.text}:{key:e.key,custom:e.type=="LOCALIZED_CUSTOM",context:e.context,message:e.key}}fromAttribute(e){if(e!=null)try{return JSON.parse(e)}catch{if(this.isI18nKey(e)){let[r,n]=e.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:e}}}toAttribute(e){if(e!=null)return JSON.stringify(e)}isI18nKey(e){return e.match(/^[\w-]+\.[\w-]+$/)}},Pr=new Fa;var Qf=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},xo=Symbol("i18nAttributes"),Td=Symbol("i18nListAttributes"),Ld=Symbol("i18nProperties"),cn=Symbol("i18nContexts"),bo=Symbol("i18nUnsubs"),pn=ce(Symbol("withI18n"),function(t){var e,r;class n extends t{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[e]=new Map,this[r]=new Map}getI18nService(a){return a??this.useCustomMessageContexts?Na:mo}i18n(a){let{context:s,key:c,message:d}=a,{custom:p,args:h,argsProvider:f}=a;if(s&&c){this.hasI18nContext(s)||this.addI18nContext(s,void 0,p);let m=h??(f?f(this):[]);return this.getI18nService(p).resolveMessage(s,c,...m)}return d}async awaitI18n(a){let{context:s,custom:c}=a;return s&&await this.getI18nService(c).prepareContext(s),this.i18n(a)}customI18n(a,s){if(Pr.isI18nKey(a)){let[c,d]=a.split(".");return this.i18n({custom:!0,context:c,key:d,...s})||a}return a}firstUpdated(a){super.firstUpdated(a),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(a){super.update(a),this.updateI18nAttributes((s,c,d)=>a.has(c)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(a){this.updateI18nAttributes((s,c,d)=>{var p;return((p=d?.context)===null||p===void 0?void 0:p.toLowerCase())===a}),this.updateI18nProperties(s=>s.context.toLowerCase()===a),this.requestUpdate()}updateI18nAttributes(a){var s,c;let d=this,p=(h,f,m)=>m?.context&&m.key&&a(h,f,m)?{...m,message:this.i18n({context:m.context,key:m.key,custom:m.custom,...h})}:m;(s=this[xo])===null||s===void 0||s.forEach((h,f)=>d[f]=p(h,f,d[f])),(c=this[Td])===null||c===void 0||c.forEach((h,f)=>{var m;return d[f]=(m=d[f])===null||m===void 0?void 0:m.map(y=>p(h,f,y))})}updateI18nProperties(a){var s;(s=this[Ld])===null||s===void 0||s.forEach((c,d)=>{a(c,d)&&(this[d]=this.i18n(c))})}addI18nMessages(a,s,c){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(a,s,c)}addI18nContext(a,s,c){let d=(typeof a=="string"?a:a.name).toLowerCase();c=typeof a=="string"?c:a.custom,this[cn].set(d,{isCustomContext:c}),this[bo].has(d)||this[bo].set(d,this.getI18nService(c).subscribe(d,()=>this.onI18nUpdate(d))),this.getI18nService(c).prepareContext(d,s)}hasI18nContext(a){return this[cn].has(a.toLowerCase())}connectedCallback(){super.connectedCallback(),this[cn].forEach((a,s)=>this.addI18nContext(s,void 0,a.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[bo].forEach(a=>a()),this[bo].clear()}}return e=cn,r=bo,Qf([g({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),dn=class extends pn(B){},un=class extends pn(Bt){};var Ha=class{fromAttribute(e){if(!e)return[];try{let r=JSON.parse(e);return Array.isArray(r)?r.map(n=>typeof n=="string"?Pr.fromAttribute(n):n):[]}catch{return[]}}toAttribute(e){if(e!=null)return JSON.stringify(e)}},eh=new Ha;var _d=(t,e)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:Ue,converter:Pr,...e}),r[xo]=(i=r[xo])!==null&&i!==void 0?i:new Map,r[xo].set(n,t??{})};var kd=_`
345
345
  `;var vo=function(t,e,r,n){var i=arguments.length,a=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},He=class extends un{constructor(){super(),this.editorMode=!1,this.addStore($)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":z:k`
@@ -1397,7 +1397,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:o.extend("--ftds-con
1397
1397
  class="${e}"
1398
1398
  filterId="${this.id}"
1399
1399
  .filter=${this.filter}
1400
- .configuredAnalyticsActions="${this.configuredAnalyticsActions}"
1400
+ .configuredAnalyticsActions=${this.configuredAnalyticsActions}
1401
1401
  moreValuesButtonLabel="${this.moreValuesButtonLabel}"
1402
1402
  ?multivalued=${this.multivalued}
1403
1403
  ?disabled=${this.disabled||e!=="ft-filter--level-center"}
@@ -1,6 +1,6 @@
1
1
  import { css } from "lit";
2
- import { designSystemVariables, FtCssVariableFactory, noTextInputDefaultClearButton, setVariable } from "@fluid-topics/ft-wc-utils";
3
- import { FtTypographyCaption, FtTypographyCssVariables } from "@fluid-topics/ft-typography/build/ft-typography.styles";
2
+ import { designSystemVariables, FtCssVariableFactory, noTextInputDefaultClearButton, setVariable, } from "@fluid-topics/ft-wc-utils";
3
+ import { FtTypographyCaption, FtTypographyCssVariables, } from "@fluid-topics/ft-typography/build/ft-typography.styles";
4
4
  import { FtButtonCssVariables } from "@fluid-topics/ft-button/build/ft-button.styles";
5
5
  export const FtFilterCssVariables = {
6
6
  colorOutline: FtCssVariableFactory.external(designSystemVariables.colorOutline, "Design system"),
@@ -16,7 +16,7 @@ export const FtFilterCssVariables = {
16
16
  export const styles = [
17
17
  FtTypographyCaption,
18
18
  noTextInputDefaultClearButton,
19
- //language=css
19
+ // language=css
20
20
  css `
21
21
  :host {
22
22
  display: flex;
@@ -134,5 +134,5 @@ export const styles = [
134
134
  slot:not([name]) {
135
135
  display: none;
136
136
  }
137
- `
137
+ `,
138
138
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-filter",
3
- "version": "2.1.19",
3
+ "version": "2.1.20",
4
4
  "description": "Flat selector for multivalued or monovalued filters",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,15 +19,15 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-button": "2.1.19",
23
- "@fluid-topics/ft-checkbox": "2.1.19",
24
- "@fluid-topics/ft-icon": "2.1.19",
25
- "@fluid-topics/ft-radio": "2.1.19",
26
- "@fluid-topics/ft-ripple": "2.1.19",
27
- "@fluid-topics/ft-snap-scroll": "2.1.19",
28
- "@fluid-topics/ft-typography": "2.1.19",
29
- "@fluid-topics/ft-wc-utils": "2.1.19",
22
+ "@fluid-topics/ft-button": "2.1.20",
23
+ "@fluid-topics/ft-checkbox": "2.1.20",
24
+ "@fluid-topics/ft-icon": "2.1.20",
25
+ "@fluid-topics/ft-radio": "2.1.20",
26
+ "@fluid-topics/ft-ripple": "2.1.20",
27
+ "@fluid-topics/ft-snap-scroll": "2.1.20",
28
+ "@fluid-topics/ft-typography": "2.1.20",
29
+ "@fluid-topics/ft-wc-utils": "2.1.20",
30
30
  "lit": "3.1.0"
31
31
  },
32
- "gitHead": "c2c202986d05fbee1378d8dbb74fa609e89260ec"
32
+ "gitHead": "77e9f03085f977dde887e175b964bf66b862253f"
33
33
  }