@fluid-topics/ft-file-drop 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.
@@ -5,8 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { html } from "lit";
8
- import { property, state } from "lit/decorators.js";
9
- import { FtLitElement } from "@fluid-topics/ft-wc-utils";
8
+ import { property, state, } from "lit/decorators.js";
9
+ import { FtLitElement, } from "@fluid-topics/ft-wc-utils";
10
10
  import { classMap } from "lit/directives/class-map.js";
11
11
  import { matchAccept } from "./match-accept";
12
12
  import { FtChip } from "@fluid-topics/ft-chip";
@@ -27,7 +27,7 @@ export class FtFileDrop extends FtLitElement {
27
27
  this.fileError = false;
28
28
  }
29
29
  render() {
30
- let contentClasses = {
30
+ const contentClasses = {
31
31
  dragging: this.dragging,
32
32
  visible: this.visible,
33
33
  };
@@ -65,7 +65,7 @@ export class FtFileDrop extends FtLitElement {
65
65
  async onDrop(event) {
66
66
  event.preventDefault();
67
67
  if (event.dataTransfer && event.dataTransfer.files) {
68
- let file = event.dataTransfer.files[0];
68
+ const file = event.dataTransfer.files[0];
69
69
  if (!matchAccept(this.accept, file.name, file.type)) {
70
70
  this.fileError = true;
71
71
  setTimeout(() => {
@@ -311,7 +311,7 @@
311
311
  word-break: break-word;
312
312
  }
313
313
  `;var Do=["top","right","bottom","left"],No=["start","end"],Rn=Do.reduce((e,t)=>e.concat(t,t+"-"+No[0],t+"-"+No[1]),[]),tr=Math.min,ze=Math.max,rr=Math.round;var Re=e=>({x:e,y:e}),Xl={left:"right",right:"left",bottom:"top",top:"bottom"};function Io(e,t,r){return ze(e,tr(t,r))}function wr(e,t){return typeof e=="function"?e(t):e}function nr(e){return e.split("-")[0]}function We(e){return e.split("-")[1]}function Ln(e){return e==="x"?"y":"x"}function Pn(e){return e==="y"?"height":"width"}function _r(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Nn(e){return Ln(_r(e))}function Mo(e,t,r){r===void 0&&(r=!1);let n=We(e),i=Nn(e),o=Pn(i),s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=_n(s)),[s,_n(s)]}function ko(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function _n(e){let t=nr(e);return Xl[t]+e.slice(t.length)}function Jl(e){var t,r,n,i;return{top:(t=e.top)!=null?t:0,right:(r=e.right)!=null?r:0,bottom:(n=e.bottom)!=null?n:0,left:(i=e.left)!=null?i:0}}function Uo(e){return typeof e!="number"?Jl(e):{top:e,right:e,bottom:e,left:e}}function it(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function $o(e,t,r){let{reference:n,floating:i}=e,o=_r(t),s=Nn(t),a=Pn(s),l=nr(t),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,f;switch(l){case"top":f={x:u,y:n.y-i.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:d};break;case"left":f={x:n.x-i.width,y:d};break;default:f={x:n.x,y:n.y}}let h=We(t);return h&&(f[s]+=p*(h==="end"?1:-1)*(r&&c?-1:1)),f}async function Bo(e,t){var r;t===void 0&&(t={});let{x:n,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=wr(t,e),h=Uo(f),b=a[p?d==="floating"?"reference":"floating":d],x=it(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})),A=d==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),T=await(o.isElement==null?void 0:o.isElement(S))&&await(o.getScale==null?void 0:o.getScale(S))||{x:1,y:1},z=it(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:S,strategy:l}):A);return{top:(x.top-z.top+h.top)/T.y,bottom:(z.bottom-x.bottom+h.bottom)/T.y,left:(x.left-z.left+h.left)/T.x,right:(z.right-x.right+h.right)/T.x}}var Zl=50,Ho=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,a=s.detectOverflow?s:{...s,detectOverflow:Bo},l=await(s.isRTL==null?void 0:s.isRTL(t)),c=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=$o(c,n,l),p=n,f=0,h={};for(let m=0;m<o.length;m++){let b=o[m];if(!b)continue;let{name:x,fn:A}=b,{x:S,y:T,data:z,reset:B}=await A({x:u,y:d,initialPlacement:n,placement:p,strategy:i,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=S??u,d=T??d,h[x]={...h[x],...z},B&&f<Zl&&(f++,typeof B=="object"&&(B.placement&&(p=B.placement),B.rects&&(c=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):B.rects),{x:u,y:d}=$o(c,p,l)),m=-1)}return{x:u,y:d,placement:p,strategy:i,middlewareData:h}};function Ql(e,t,r){return(e?[...r.filter(i=>We(i)===e),...r.filter(i=>We(i)!==e)]:r.filter(i=>nr(i)===i)).filter(i=>e?We(i)===e||(t?ko(i)!==i:!1):!0)}var jo=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,i;let{rects:o,middlewareData:s,placement:a,platform:l,elements:c}=t,{crossAxis:u=!1,alignment:d,allowedPlacements:p=Rn,autoAlignment:f=!0,...h}=wr(e,t),m=d!==void 0||p===Rn?Ql(d||null,f,p):p,b=((r=s.autoPlacement)==null?void 0:r.index)||0,x=m[b];if(x==null)return{};if(a!==x)return{reset:{placement:m[0]}};let A=await l.detectOverflow(t,h),S=Mo(x,o,await(l.isRTL==null?void 0:l.isRTL(c.floating))),T=[A[nr(x)],A[S[0]],A[S[1]]],z=[...((n=s.autoPlacement)==null?void 0:n.overflows)||[],{placement:x,overflows:T}],B=m[b+1];if(B)return{data:{index:b+1,overflows:z},reset:{placement:B}};let Ue=z.map(ie=>{let ue=We(ie.placement);return[ie.placement,ue&&u?ie.overflows.slice(0,2).reduce((oe,et)=>oe+et,0):ie.overflows[0],ie.overflows]}).sort((ie,ue)=>ie[1]-ue[1]),$e=((i=Ue.filter(ie=>ie[2].slice(0,We(ie[0])?2:3).every(ue=>ue<=0))[0])==null?void 0:i[0])||Ue[0][0];return $e!==a?{data:{index:b+1,overflows:z},reset:{placement:$e}}:{}}}};var Fo=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:n,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:A=>{let{x:S,y:T}=A;return{x:S,y:T}}},...c}=wr(e,t),u={x:r,y:n},d=await o.detectOverflow(t,c),p=_r(i),f=Ln(p),h=u[f],m=u[p],b=(A,S)=>Io(S+d[A==="y"?"top":"left"],S,S-d[A==="y"?"bottom":"right"]);s&&(h=b(f,h)),a&&(m=b(p,m));let x=l.fn({...t,[f]:h,[p]:m});return{...x,data:{x:x.x-r,y:x.y-n,enabled:{[f]:s,[p]:a}}}}}};function Lr(){return typeof window<"u"}function st(e){return zo(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function De(e){var t;return(t=(zo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zo(e){return Lr()?e instanceof Node||e instanceof re(e).Node:!1}function Ae(e){return Lr()?e instanceof Element||e instanceof re(e).Element:!1}function Ie(e){return Lr()?e instanceof HTMLElement||e instanceof re(e).HTMLElement:!1}function Vo(e){return!Lr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function ir(e){let{overflow:t,overflowX:r,overflowY:n,display:i}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&i!=="inline"&&i!=="contents"}function Wo(e){return/^(table|td|th)$/.test(st(e))}function or(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var ec=/transform|translate|scale|rotate|perspective|filter/,tc=/paint|layout|strict|content/,ot=e=>!!e&&e!=="none",Dn;function _t(e){let t=Ae(e)?Ee(e):e;return ot(t.transform)||ot(t.translate)||ot(t.scale)||ot(t.rotate)||ot(t.perspective)||!Pr()&&(ot(t.backdropFilter)||ot(t.filter))||ec.test(t.willChange||"")||tc.test(t.contain||"")}function Ko(e){let t=Ke(e);for(;Ie(t)&&!Rt(t);){if(_t(t))return t;if(or(t))return null;t=Ke(t)}return null}function Pr(){return Dn==null&&(Dn=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Dn}function Rt(e){return/^(html|body|#document)$/.test(st(e))}function Ee(e){return re(e).getComputedStyle(e)}function sr(e){return Ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ke(e){if(st(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Vo(e)&&e.host||De(e);return Vo(t)?t.host:t}function Go(e){let t=Ke(e);return Rt(t)?(e.ownerDocument||e).body:Ie(t)&&ir(t)?t:Go(t)}function Rr(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);let i=Go(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=re(i);if(o){let a=Nr(s);return t.concat(s,s.visualViewport||[],ir(i)?i:[],a&&r?Rr(a):[])}else return t.concat(i,Rr(i,[],r))}function Nr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xo(e){let t=Ee(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,i=Ie(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,a=rr(r)!==o||rr(n)!==s;return a&&(r=o,n=s),{width:r,height:n,$:a}}function Jo(e){return Ae(e)?e:e.contextElement}function Lt(e){let t=Jo(e);if(!Ie(t))return Re(1);let r=t.getBoundingClientRect(),{width:n,height:i,$:o}=Xo(t),s=(o?rr(r.width):r.width)/n,a=(o?rr(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var rc=Re(0);function Zo(e){let t=re(e);return!Pr()||!t.visualViewport?rc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nc(e,t,r){return t===void 0&&(t=!1),!!r&&t&&r===re(e)}function ar(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);let i=e.getBoundingClientRect(),o=Jo(e),s=Re(1);t&&(n?Ae(n)&&(s=Lt(n)):s=Lt(e));let a=nc(o,r,n)?Zo(o):Re(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=re(o),f=Ae(n)?re(n):n,h=p,m=Nr(h);for(;m&&f!==h;){let b=Lt(m),x=m.getBoundingClientRect(),A=Ee(m),S=x.left+(m.clientLeft+parseFloat(A.paddingLeft))*b.x,T=x.top+(m.clientTop+parseFloat(A.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=S,c+=T,h=re(m),m=Nr(h)}}return it({width:u,height:d,x:l,y:c})}function Dr(e,t){let r=sr(e).scrollLeft;return t?t.left+r:ar(De(e)).left+r}function Qo(e,t){let r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Dr(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function ic(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e,o=i==="fixed",s=De(n),a=t?or(t.floating):!1;if(n===s||a&&o)return r;let l={scrollLeft:0,scrollTop:0},c=Re(1),u=Re(0),d=Ie(n);if((d||!o)&&((st(n)!=="body"||ir(s))&&(l=sr(n)),d)){let f=ar(n);c=Lt(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}let p=s&&!d&&!o?Qo(s,l):Re(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 oc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function sc(e){let t=sr(e),r=e.ownerDocument.body,n=ze(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=ze(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),o=-t.scrollLeft+Dr(e),s=-t.scrollTop;return Ee(r).direction==="rtl"&&(o+=ze(e.clientWidth,r.clientWidth)-n),{width:n,height:i,x:o,y:s}}var ac=25;function lc(e,t,r){r===void 0&&(r="viewport");let n=r==="layoutViewport",i=re(e),o=De(e),s=i.visualViewport,a=o.clientWidth,l=o.clientHeight,c=0,u=0;if(s){let p=!Pr()||t==="fixed";n?p||(c=-s.offsetLeft,u=-s.offsetTop):(a=s.width,l=s.height,p&&(c=s.offsetLeft,u=s.offsetTop))}if(Dr(o)<=0){let p=o.ownerDocument,f=p.body,h=getComputedStyle(f),m=p.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,b=Math.abs(o.clientWidth-f.clientWidth-m),x=getComputedStyle(o).scrollbarGutter==="stable both-edges"?b/2:b;x<=ac&&(a-=x)}return{width:a,height:l,x:c,y:u}}function cc(e,t){let r=ar(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Lt(e),s=e.clientWidth*o.x,a=e.clientHeight*o.y,l=i*o.x,c=n*o.y;return{width:s,height:a,x:l,y:c}}function qo(e,t,r){let n;if(t==="viewport"||t==="layoutViewport")n=lc(e,r,t);else if(t==="document")n=sc(De(e));else if(Ae(t))n=cc(t,r);else{let i=Zo(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return it(n)}function uc(e,t){let r=t.get(e);if(r)return r;let n=Rr(e,[],!1).filter(a=>Ae(a)&&st(a)!=="body"),i=null,o=Ee(e).position==="fixed",s=o?Ke(e):e;for(;Ae(s)&&!Rt(s);){let a=Ee(s),l=_t(s),c=i?i.position:o?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?n=n.filter(d=>d!==s):i=a,s=Ke(s)}return t.set(e,n),n}function dc(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e,s=[...r==="clippingAncestors"?or(t)?[]:uc(t,this._c):[].concat(r),n],a=qo(t,s[0],i),l=a.top,c=a.right,u=a.bottom,d=a.left;for(let p=1;p<s.length;p++){let f=qo(t,s[p],i);l=ze(f.top,l),c=tr(f.right,c),u=tr(f.bottom,u),d=ze(f.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function pc(e){let{width:t,height:r}=Xo(e);return{width:t,height:r}}function fc(e,t,r){let n=Ie(t),i=De(t),o=r==="fixed",s=ar(e,!0,o,t),a={scrollLeft:0,scrollTop:0},l=Re(0);if((n||!o)&&((st(t)!=="body"||ir(i))&&(a=sr(t)),n)){let p=ar(t,!0,o,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!n&&i&&(l.x=Dr(i));let c=i&&!n&&!o?Qo(i,a):Re(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 In(e){return Ee(e).position==="static"}function Yo(e,t){if(!Ie(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return De(e)===r&&(r=r.ownerDocument.body),r}function es(e,t){let r=re(e);if(or(e))return r;if(!Ie(e)){let i=Ke(e);for(;i&&!Rt(i);){if(Ae(i)&&!In(i))return i;i=Ke(i)}return r}let n=Yo(e,t);for(;n&&Wo(n)&&In(n);)n=Yo(n,t);return n&&Rt(n)&&In(n)&&!_t(n)?r:n||Ko(e)||r}var hc=async function(e){let t=this.getOffsetParent||es,r=this.getDimensions,n=await r(e.floating);return{reference:fc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function mc(e){return Ee(e).direction==="rtl"}var Ir={convertOffsetParentRelativeRectToViewportRelativeRect:ic,getDocumentElement:De,getClippingRect:dc,getOffsetParent:es,getElementRects:hc,getClientRects:oc,getDimensions:pc,getScale:Lt,isElement:Ae,isRTL:mc};var ts=jo,rs=Fo;var ns=(e,t,r)=>{let n=new Map,i=r??{},o={...Ir,...i.platform,_c:n};return Ho(e,t,{...i,platform:o})};function is(e){return yc(e)}function Mn(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function yc(e){for(let t=e;t;t=Mn(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Mn(e);t;t=Mn(t)){if(!(t instanceof Element))continue;let r=getComputedStyle(t);if(r.display!=="contents"&&(r.position!=="static"||_t(r)||t.tagName==="BODY"))return t}return null}async function os(e,t,r){let n;return typeof r=="object"?n=r:n={placement:r},ns(e,t,{strategy:n.strategy,platform:{...Ir,getOffsetParent:i=>Ir.getOffsetParent(i,is)},middleware:[rs({crossAxis:!0}),ts({allowedPlacements:[n.placement]})]})}var Ft=y(C());var ai=y(X());var ss=y(X(),1);var kn=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function as(e,t){return(0,ss.property)({type:Object,converter:{fromAttribute:r=>{if(r==null)return lr(e);try{return JSON.parse(r)}catch{return lr(e)}},toAttribute:r=>JSON.stringify(r)},hasChanged:cr,...t??{}})}function gc(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,n;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!Mr(e[n],t[n]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;for(n of e.entries())if(!Mr(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();let i=s=>Object.keys(s).filter(a=>s[a]!=null),o=i(e);if(r=o.length,r!==i(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){let s=o[n];if(!Mr(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Mr(e,t){try{return gc(e,t)}catch{return!1}}function cr(e,t){return!Mr(e,t)}function lr(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function kr(e,t){let r=n=>n[e]===!0;return n=>{if(r(n))return n;let i=t(n);return i[e]=!0,i}}var ls=y(X(),1);var Un=e=>{let t=e??{};return(r,n)=>{var i;let o={hasChanged:cr,attribute:!1,...t};(0,ls.property)(o)(r,n);let s=r.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(n,{selector:(i=t.selector)!==null&&i!==void 0?i:(a=>a[n]),store:t.store})}};var Ur=class{constructor(){this.queue=[]}add(t,r=!1){r&&this.clear(t.type),this.queue.push(t)}consume(t){let r=this.queue.find(n=>n.type===t);return r&&(this.queue=this.queue.filter(n=>n!==r)),r}clear(t){typeof t=="string"?this.queue=this.queue.filter(r=>r.type!==t):this.queue=this.queue.filter(r=>!t.test(r.type))}};var at=y(X(),1);var $r=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,r){return this.callbacks=[t],this.debounce(r)}queue(t,r){return this.callbacks.push(t),this.debounce(r)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((r,n)=>{this.resolvePromise=r,this.rejectPromise=n})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,r;let n=[...this.callbacks];this.callbacks=[];let i=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>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 us=y($(),1);var Br=globalThis,vc=Br.ShadowRoot&&(Br.ShadyCSS===void 0||Br.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var cs=(e,t)=>{if(vc)e.adoptedStyleSheets=t.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(let r of t){let n=document.createElement("style"),i=Br.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=r.cssText,e.appendChild(n)}};var Hr=class extends us.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let r={...t.shadowRootOptions,customElements:t.registry},n=this.renderOptions.creationScope=this.attachShadow(r);return cs(n,t.elementStyles),n}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([r,n])=>this.defineScopedElement(r,n))}static defineScopedElement(t,r){kn(t)(r),this.canDefineScopedElement(t)&&this.registry.define(t,r)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,r){this.scopedRegistryConstructor.defineScopedElement(t,r)}};function ds(e,t,...r){var n;let i=e.querySelector(t);for(let o of r)i=(n=i?.shadowRoot)===null||n===void 0?void 0:n.querySelector(o);return i}var Nt=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},ms,ps=Symbol("constructorPrototype"),fs=Symbol("constructorName"),ys=Symbol("exportpartsDebouncer"),hs=Symbol("dynamicDependenciesLoaded"),Pt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Pt.eventName="exportparts-updated";var Le=class extends Hr{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[ms]=new $r(5),this.scheduleExportpartsUpdate=()=>{var t,r,n;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(n=(r=this.exportpartsPrefixes)===null||r===void 0?void 0:r.length)!==null&&n!==void 0&&n)&&this[ys].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[fs]=this.constructor.name,this[ps]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[fs]&&Object.setPrototypeOf(this,this[ps])}connectedCallback(){var t;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[hs]||(r[hs]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Pt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Pt.eventName,this.scheduleExportpartsUpdate)}importDynamicDependencies(){}updated(t){super.updated(t),this.updateComplete.then(()=>{this.contentAvailableCallback(t),this.focusElementToFocus(t),this.applyCustomStylesheet(t),this.scheduleExportpartsUpdate(),t.has("exportparts")&&this.dispatchEvent(new Pt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:r,selector:n,shadowPath:i}=this.elementToFocus;if(n!=null){let o=[...i??[],n];r=ds(this.shadowRoot,...o)}r?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||r?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){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(t.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(t){var r,n,i,o,s,a;let l=p=>p!=null&&p.trim().length>0,c=t.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 f=(o=(i=p.getAttribute("part"))===null||i===void 0?void 0:i.split(" "))!==null&&o!==void 0?o:[],h=(a=(s=p.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(b=>b.split(":")[1]))!==null&&a!==void 0?a:[],m=[...f,...h].filter(l).map(b=>b.trim());for(let b of m)u.add(b)}if(u.size===0){this.exportparts=void 0;return}let d=[...u.values()].flatMap(p=>c.map(f=>`${p}:${f}--${p}`));this.exportparts=[...this.part,...d].join(", ")}};ms=ys;Nt([(0,at.property)()],Le.prototype,"exportpartsPrefix",void 0);Nt([as([])],Le.prototype,"exportpartsPrefixes",void 0);Nt([(0,at.property)({reflect:!0})],Le.prototype,"exportparts",void 0);Nt([(0,at.property)()],Le.prototype,"customStylesheet",void 0);Nt([(0,at.property)()],Le.prototype,"elementToFocus",void 0);Nt([(0,at.state)()],Le.prototype,"useAdoptedStyleSheets",void 0);function jr(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var ur=Symbol("internalReduxEventsUnsubscribers"),Ge=Symbol("internalStoresUnsubscribers"),lt=Symbol("internalStores"),bc=kr(Symbol("withRedux"),function(e){var t,r,n;class i extends e{constructor(){super(...arguments),this[t]=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[lt].size>1)throw new Error("Cannot resolve unnamed store when multiple stores are configured.");return[...this[lt].values()][0]}getStore(s){return s==null?this.getUnnamedStore():this[lt].get(s)}addStore(s,a){var l;a=(l=a??s.name)!==null&&l!==void 0?l:"default-store",this.unsubscribeFromStore(a),this[lt].set(a,s),this.subscribeToStore(a,s),this.updateFromStores()}removeStore(s){let a=typeof s=="string"?s:s.name;this.unsubscribeFromStore(a),this[lt].delete(a)}setupStores(){this.unsubscribeFromStores(),this[lt].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[Ge].has(s.store):this[Ge].size>0)&&(this[a]=s.selector(c.getState(),this))}})}subscribeToStore(s,a){var l;this[Ge].set(s,a.subscribe(()=>this.updateFromStores())),this[ur].set(s,[]),jr(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[ur].get(s).push(()=>a.removeEventListener(c.eventName,d))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ge].forEach((s,a)=>this.unsubscribeFromStore(a))}unsubscribeFromStore(s){var a;this[Ge].has(s)&&this[Ge].get(s)(),this[Ge].delete(s),(a=this[ur].get(s))===null||a===void 0||a.forEach(l=>l()),this[ur].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Ge,r=lt,n=ur,i.reduxProperties=new Map,i.reduxReactiveProperties=new Set,i.reduxEventListeners=new Map,i}),gs=class extends bc(Le){};function fe(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(0)var i,o;throw Error("[Immer] minified error nr: "+e+(r.length?" "+r.map((function(s){return"'"+s+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Me(e){return!!e&&!!e[N]}function Se(e){var t;return!!e&&((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)===wc})(e)||Array.isArray(e)||!!e[Cs]||!!(!((t=e.constructor)===null||t===void 0)&&t[Cs])||Kn(e)||Gn(e))}function ct(e,t,r){r===void 0&&(r=!1),Mt(e)===0?(r?Object.keys:It)(e).forEach((function(n){r&&typeof n=="symbol"||t(n,e[n],e)})):e.forEach((function(n,i){return t(i,n,e)}))}function Mt(e){var t=e[N];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Kn(e)?2:Gn(e)?3:0}function Dt(e,t){return Mt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function xc(e,t){return Mt(e)===2?e.get(t):e[t]}function Os(e,t,r){var n=Mt(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Ts(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Kn(e){return Oc&&e instanceof Map}function Gn(e){return Tc&&e instanceof Set}function qe(e){return e.o||e.t}function qn(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=Rs(e);delete t[N];for(var r=It(t),n=0;n<r.length;n++){var i=r[n],o=t[i];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[i]})}return Object.create(Object.getPrototypeOf(e),t)}function Yn(e,t){return t===void 0&&(t=!1),Xn(e)||Me(e)||!Se(e)||(Mt(e)>1&&(e.set=e.add=e.clear=e.delete=Ac),Object.freeze(e),t&&ct(e,(function(r,n){return Yn(n,!0)}),!0)),e}function Ac(){fe(2)}function Xn(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Pe(e){var t=Wn[e];return t||fe(18,e),t}function Ec(e,t){Wn[e]||(Wn[e]=t)}function Fn(){return pr}function $n(e,t){t&&(Pe("Patches"),e.u=[],e.s=[],e.v=t)}function Fr(e){Vn(e),e.p.forEach(Sc),e.p=null}function Vn(e){e===pr&&(pr=e.l)}function vs(e){return pr={p:[],l:pr,h:e,m:!0,_:0}}function Sc(e){var t=e[N];t.i===0||t.i===1?t.j():t.g=!0}function Bn(e,t){t._=t.p.length;var r=t.p[0],n=e!==void 0&&e!==r;return t.h.O||Pe("ES5").S(t,e,n),n?(r[N].P&&(Fr(t),fe(4)),Se(e)&&(e=Vr(t,e),t.l||zr(t,e)),t.u&&Pe("Patches").M(r[N].t,e,t.u,t.s)):e=Vr(t,r,[]),Fr(t),t.u&&t.v(t.u,t.s),e!==_s?e:void 0}function Vr(e,t,r){if(Xn(t))return t;var n=t[N];if(!n)return ct(t,(function(a,l){return bs(e,n,t,a,l,r)}),!0),t;if(n.A!==e)return t;if(!n.P)return zr(e,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var i=n.i===4||n.i===5?n.o=qn(n.k):n.o,o=i,s=!1;n.i===3&&(o=new Set(i),i.clear(),s=!0),ct(o,(function(a,l){return bs(e,n,i,a,l,r,s)})),zr(e,i,!1),r&&e.u&&Pe("Patches").N(n,r,e.u,e.s)}return n.o}function bs(e,t,r,n,i,o,s){if(Me(i)){var a=Vr(e,i,o&&t&&t.i!==3&&!Dt(t.R,n)?o.concat(n):void 0);if(Os(r,n,a),!Me(a))return;e.m=!1}else s&&r.add(i);if(Se(i)&&!Xn(i)){if(!e.h.D&&e._<1)return;Vr(e,i),t&&t.A.l||zr(e,i)}}function zr(e,t,r){r===void 0&&(r=!1),!e.l&&e.h.D&&e.m&&Yn(t,r)}function Hn(e,t){var r=e[N];return(r?qe(r):e)[t]}function xs(e,t){if(t in e)for(var r=Object.getPrototypeOf(e);r;){var n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Object.getPrototypeOf(r)}}function Ye(e){e.P||(e.P=!0,e.l&&Ye(e.l))}function jn(e){e.o||(e.o=qn(e.t))}function zn(e,t,r){var n=Kn(t)?Pe("MapSet").F(t,r):Gn(t)?Pe("MapSet").T(t,r):e.O?(function(i,o){var s=Array.isArray(i),a={i:s?1:0,A:o?o.A:Fn(),P:!1,I:!1,R:{},l:o,t:i,k:null,o:null,j:null,C:!1},l=a,c=fr;s&&(l=[a],c=dr);var u=Proxy.revocable(l,c),d=u.revoke,p=u.proxy;return a.k=p,a.j=d,p})(t,r):Pe("ES5").J(t,r);return(r?r.A:Fn()).p.push(n),n}function Cc(e){return Me(e)||fe(22,e),(function t(r){if(!Se(r))return r;var n,i=r[N],o=Mt(r);if(i){if(!i.P&&(i.i<4||!Pe("ES5").K(i)))return i.t;i.I=!0,n=As(r,o),i.I=!1}else n=As(r,o);return ct(n,(function(s,a){i&&xc(i.t,s)===a||Os(n,s,t(a))})),o===3?new Set(n):n})(e)}function As(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return qn(e)}function ws(){function e(s,a){var l=o[s];return l?l.enumerable=a:o[s]=l={configurable:!0,enumerable:a,get:function(){var c=this[N];return fr.get(c,s)},set:function(c){var u=this[N];fr.set(u,s,c)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][N];if(!l.P)switch(l.i){case 5:n(l)&&Ye(l);break;case 4:r(l)&&Ye(l)}}}function r(s){for(var a=s.t,l=s.k,c=It(l),u=c.length-1;u>=0;u--){var d=c[u];if(d!==N){var p=a[d];if(p===void 0&&!Dt(a,d))return!0;var f=l[d],h=f&&f[N];if(h?h.t!==p:!Ts(f,p))return!0}}var m=!!a[N];return c.length!==It(a).length+(m?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&&fe(3,JSON.stringify(qe(s)))}var o={};Ec("ES5",{J:function(s,a){var l=Array.isArray(s),c=(function(d,p){if(d){for(var f=Array(p.length),h=0;h<p.length;h++)Object.defineProperty(f,""+h,e(h,!0));return f}var m=Rs(p);delete m[N];for(var b=It(m),x=0;x<b.length;x++){var A=b[x];m[A]=e(A,d||!!m[A].enumerable)}return Object.create(Object.getPrototypeOf(p),m)})(l,s),u={i:l?5:4,A:a?a.A:Fn(),P:!1,I:!1,R:{},l:a,t:s,k:c,o:null,g:!1,C:!1};return Object.defineProperty(c,N,{value:u,writable:!0}),c},S:function(s,a,l){l?Me(a)&&a[N].A===s&&t(s.p):(s.u&&(function c(u){if(u&&typeof u=="object"){var d=u[N];if(d){var p=d.t,f=d.k,h=d.R,m=d.i;if(m===4)ct(f,(function(T){T!==N&&(p[T]!==void 0||Dt(p,T)?h[T]||c(f[T]):(h[T]=!0,Ye(d)))})),ct(p,(function(T){f[T]!==void 0||Dt(f,T)||(h[T]=!1,Ye(d))}));else if(m===5){if(n(d)&&(Ye(d),h.length=!0),f.length<p.length)for(var b=f.length;b<p.length;b++)h[b]=!1;else for(var x=p.length;x<f.length;x++)h[x]=!0;for(var A=Math.min(f.length,p.length),S=0;S<A;S++)f.hasOwnProperty(S)||(h[S]=!0),h[S]===void 0&&c(f[S])}}}})(s.p[0]),t(s.p))},K:function(s){return s.i===4?r(s):n(s)}})}var Es,pr,Jn=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",Oc=typeof Map<"u",Tc=typeof Set<"u",Ss=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",_s=Jn?Symbol.for("immer-nothing"):((Es={})["immer-nothing"]=!0,Es),Cs=Jn?Symbol.for("immer-draftable"):"__$immer_draftable",N=Jn?Symbol.for("immer-state"):"__$immer_state";var wc=""+Object.prototype.constructor,It=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,Rs=Object.getOwnPropertyDescriptors||function(e){var t={};return It(e).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(e,r)})),t},Wn={},fr={get:function(e,t){if(t===N)return e;var r=qe(e);if(!Dt(r,t))return(function(i,o,s){var a,l=xs(o,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(i.k):void 0})(e,r,t);var n=r[t];return e.I||!Se(n)?n:n===Hn(e.t,t)?(jn(e),e.o[t]=zn(e.A.h,n,e)):n},has:function(e,t){return t in qe(e)},ownKeys:function(e){return Reflect.ownKeys(qe(e))},set:function(e,t,r){var n=xs(qe(e),t);if(n?.set)return n.set.call(e.k,r),!0;if(!e.P){var i=Hn(qe(e),t),o=i?.[N];if(o&&o.t===r)return e.o[t]=r,e.R[t]=!1,!0;if(Ts(r,i)&&(r!==void 0||Dt(e.t,t)))return!0;jn(e),Ye(e)}return e.o[t]===r&&(r!==void 0||t in e.o)||Number.isNaN(r)&&Number.isNaN(e.o[t])||(e.o[t]=r,e.R[t]=!0),!0},deleteProperty:function(e,t){return Hn(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,jn(e),Ye(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var r=qe(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty:function(){fe(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){fe(12)}},dr={};ct(fr,(function(e,t){dr[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),dr.deleteProperty=function(e,t){return dr.set.call(this,e,t,void 0)},dr.set=function(e,t,r){return fr.set.call(this,e[0],t,r,e[0])};var _c=(function(){function e(r){var n=this;this.O=Ss,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(m){var b=this;m===void 0&&(m=a);for(var x=arguments.length,A=Array(x>1?x-1:0),S=1;S<x;S++)A[S-1]=arguments[S];return l.produce(m,(function(T){var z;return(z=o).call.apply(z,[b,T].concat(A))}))}}var c;if(typeof o!="function"&&fe(6),s!==void 0&&typeof s!="function"&&fe(7),Se(i)){var u=vs(n),d=zn(n,i,void 0),p=!0;try{c=o(d),p=!1}finally{p?Fr(u):Vn(u)}return typeof Promise<"u"&&c instanceof Promise?c.then((function(m){return $n(u,s),Bn(m,u)}),(function(m){throw Fr(u),m})):($n(u,s),Bn(c,u))}if(!i||typeof i!="object"){if((c=o(i))===void 0&&(c=i),c===_s&&(c=void 0),n.D&&Yn(c,!0),s){var f=[],h=[];Pe("Patches").M(i,c,f,h),s(f,h)}return c}fe(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(f){return i.apply(void 0,[f].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 t=e.prototype;return t.createDraft=function(r){Se(r)||fe(8),Me(r)&&(r=Cc(r));var n=vs(this),i=zn(this,r,void 0);return i[N].C=!0,Vn(n),i},t.finishDraft=function(r,n){var i=r&&r[N],o=i.A;return $n(o,n),Bn(void 0,o)},t.setAutoFreeze=function(r){this.D=r},t.setUseProxies=function(r){r&&!Ss&&fe(20),this.O=r},t.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=Pe("Patches").$;return Me(r)?s(r,n):this.produce(r,(function(a){return s(a,n)}))},e})(),le=new _c,Rc=le.produce,hp=le.produceWithPatches.bind(le),mp=le.setAutoFreeze.bind(le),yp=le.setUseProxies.bind(le),gp=le.applyPatches.bind(le),vp=le.createDraft.bind(le),bp=le.finishDraft.bind(le),Wr=Rc;function ut(e){"@babel/helpers - typeof";return ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ut(e)}function Ls(e,t){if(ut(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(ut(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ps(e){var t=Ls(e,"string");return ut(t)=="symbol"?t:t+""}function Ns(e,t,r){return(t=Ps(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ds(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Zn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ds(Object(r),!0).forEach(function(n){Ns(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ds(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Y(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var Is=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),Qn=function(){return Math.random().toString(36).substring(7).split("").join(".")},Kr={INIT:"@@redux/INIT"+Qn(),REPLACE:"@@redux/REPLACE"+Qn(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Qn()}};function Lc(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ei(e,t,r){var n;if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Y(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Y(1));return r(ei)(e,t)}if(typeof e!="function")throw new Error(Y(2));var i=e,o=t,s=[],a=s,l=!1;function c(){a===s&&(a=s.slice())}function u(){if(l)throw new Error(Y(3));return o}function d(m){if(typeof m!="function")throw new Error(Y(4));if(l)throw new Error(Y(5));var b=!0;return c(),a.push(m),function(){if(b){if(l)throw new Error(Y(6));b=!1,c();var A=a.indexOf(m);a.splice(A,1),s=null}}}function p(m){if(!Lc(m))throw new Error(Y(7));if(typeof m.type>"u")throw new Error(Y(8));if(l)throw new Error(Y(9));try{l=!0,o=i(o,m)}finally{l=!1}for(var b=s=a,x=0;x<b.length;x++){var A=b[x];A()}return m}function f(m){if(typeof m!="function")throw new Error(Y(10));i=m,p({type:Kr.REPLACE})}function h(){var m,b=d;return m={subscribe:function(A){if(typeof A!="object"||A===null)throw new Error(Y(11));function S(){A.next&&A.next(u())}S();var T=b(S);return{unsubscribe:T}}},m[Is]=function(){return this},m}return p({type:Kr.INIT}),n={dispatch:p,subscribe:d,getState:u,replaceReducer:f},n[Is]=h,n}function Pc(e){Object.keys(e).forEach(function(t){var r=e[t],n=r(void 0,{type:Kr.INIT});if(typeof n>"u")throw new Error(Y(12));if(typeof r(void 0,{type:Kr.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Y(13))})}function Ms(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var i=t[n];typeof e[i]=="function"&&(r[i]=e[i])}var o=Object.keys(r),s,a;try{Pc(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,f={},h=0;h<o.length;h++){var m=o[h],b=r[m],x=c[m],A=b(x,u);if(typeof A>"u"){var S=u&&u.type;throw new Error(Y(14))}f[m]=A,p=p||A!==x}return p=p||o.length!==Object.keys(c).length,p?f:c}}function kt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.length===0?function(n){return n}:t.length===1?t[0]:t.reduce(function(n,i){return function(){return n(i.apply(void 0,arguments))}})}function ks(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){return function(){var i=n.apply(void 0,arguments),o=function(){throw new Error(Y(15))},s={getState:i.getState,dispatch:function(){return o.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return o=kt.apply(void 0,a)(i.dispatch),Zn(Zn({},i),{},{dispatch:o})}}}function Us(e){var t=function(n){var i=n.dispatch,o=n.getState;return function(s){return function(a){return typeof a=="function"?a(i,o,e):s(a)}}};return t}var $s=Us();$s.withExtraArgument=Us;var ti=$s;var Vs=(function(){var e=function(t,r){return e=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])},e(t,r)};return function(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}})(),Nc=function(e,t){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=t.call(e,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}}},Ut=function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e},Dc=Object.defineProperty,Ic=Object.defineProperties,Mc=Object.getOwnPropertyDescriptors,Bs=Object.getOwnPropertySymbols,kc=Object.prototype.hasOwnProperty,Uc=Object.prototype.propertyIsEnumerable,Hs=function(e,t,r){return t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r},Xe=function(e,t){for(var r in t||(t={}))kc.call(t,r)&&Hs(e,r,t[r]);if(Bs)for(var n=0,i=Bs(t);n<i.length;n++){var r=i[n];Uc.call(t,r)&&Hs(e,r,t[r])}return e},ri=function(e,t){return Ic(e,Mc(t))},$c=function(e,t,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(e,t)).next())})};var Bc=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?kt:kt.apply(null,arguments)},Up=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function Hc(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var r=t;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return t===r}function Je(e,t){function r(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Xe(Xe({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return r.toString=function(){return""+e},r.type=e,r.match=function(n){return n.type===e},r}var jc=(function(e){Vs(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.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(t.bind.apply(t,Ut([void 0],r[0].concat(this)))):new(t.bind.apply(t,Ut([void 0],r.concat(this))))},t})(Array),Fc=(function(e){Vs(t,e);function t(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=e.apply(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return e.prototype.concat.apply(this,r)},t.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(t.bind.apply(t,Ut([void 0],r[0].concat(this)))):new(t.bind.apply(t,Ut([void 0],r.concat(this))))},t})(Array);function oi(e){return Se(e)?Wr(e,function(){}):e}function Vc(e){return typeof e=="boolean"}function zc(){return function(t){return Wc(t)}}function Wc(e){e===void 0&&(e={});var t=e.thunk,r=t===void 0?!0:t,n=e.immutableCheck,i=n===void 0?!0:n,o=e.serializableCheck,s=o===void 0?!0:o,a=e.actionCreatorCheck,l=a===void 0?!0:a,c=new jc;if(r&&(Vc(r)?c.push(ti):c.push(ti.withExtraArgument(r.extraArgument))),0){if(i)var u;if(s)var d;if(l)var p}return c}var ni=!0;function zs(e){var t=zc(),r=e||{},n=r.reducer,i=n===void 0?void 0:n,o=r.middleware,s=o===void 0?t():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,f;if(typeof i=="function")f=i;else if(Hc(i))f=Ms(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 h=s;if(typeof h=="function"&&(h=h(t),!ni&&!Array.isArray(h)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!ni&&h.some(function(T){return typeof T!="function"}))throw new Error("each middleware provided to configureStore must be a function");var m=ks.apply(void 0,h),b=kt;l&&(b=Bc(Xe({trace:!ni},typeof l=="object"&&l)));var x=new Fc(m),A=x;Array.isArray(p)?A=Ut([m],p):typeof p=="function"&&(A=p(x));var S=b.apply(void 0,A);return ei(f,u,S)}function Ws(e){var t={},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 t)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return t[a]=s,i},addMatcher:function(o,s){return r.push({matcher:o,reducer:s}),i},addDefaultCase:function(o){return n=o,i}};return e(i),[t,r,n]}function Kc(e){return typeof e=="function"}function Gc(e,t,r,n){r===void 0&&(r=[]);var i=typeof t=="function"?Ws(t):[t,r,n],o=i[0],s=i[1],a=i[2],l;if(Kc(e))l=function(){return oi(e())};else{var c=oi(e);l=function(){return c}}function u(d,p){d===void 0&&(d=l());var f=Ut([o[p.type]],s.filter(function(h){var m=h.matcher;return m(p)}).map(function(h){var m=h.reducer;return m}));return f.filter(function(h){return!!h}).length===0&&(f=[a]),f.reduce(function(h,m){if(m)if(Me(h)){var b=h,x=m(b,p);return x===void 0?h:x}else{if(Se(h))return Wr(h,function(A){return m(A,p)});var x=m(h,p);if(x===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}return h},d)}return u.getInitialState=l,u}function qc(e,t){return e+"/"+t}function Ks(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var r=typeof e.initialState=="function"?e.initialState:oi(e.initialState),n=e.reducers||{},i=Object.keys(n),o={},s={},a={};i.forEach(function(u){var d=n[u],p=qc(t,u),f,h;"reducer"in d?(f=d.reducer,h=d.prepare):f=d,o[u]=f,s[p]=f,a[u]=h?Je(p,h):Je(p)});function l(){var u=typeof e.extraReducers=="function"?Ws(e.extraReducers):[e.extraReducers],d=u[0],p=d===void 0?{}:d,f=u[1],h=f===void 0?[]:f,m=u[2],b=m===void 0?void 0:m,x=Xe(Xe({},p),s);return Gc(r,function(A){for(var S in x)A.addCase(S,x[S]);for(var T=0,z=h;T<z.length;T++){var B=z[T];A.addMatcher(B.matcher,B.reducer)}b&&A.addDefaultCase(b)})}var c;return{name:t,reducer:function(u,d){return c||(c=l()),c(u,d)},actions:a,caseReducers:o,getInitialState:function(){return c||(c=l()),c.getInitialState()}}}var Yc="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Xc=function(e){e===void 0&&(e=21);for(var t="",r=e;r--;)t+=Yc[Math.random()*64|0];return t},Jc=["name","message","stack","code"],ii=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),js=(function(){function e(t,r){this.payload=t,this.meta=r}return e})(),Zc=function(e){if(typeof e=="object"&&e!==null){for(var t={},r=0,n=Jc;r<n.length;r++){var i=n[r];typeof e[i]=="string"&&(t[i]=e[i])}return t}return{message:String(e)}},jp=(function(){function e(t,r,n){var i=Je(t+"/fulfilled",function(u,d,p,f){return{payload:u,meta:ri(Xe({},f||{}),{arg:p,requestId:d,requestStatus:"fulfilled"})}}),o=Je(t+"/pending",function(u,d,p){return{payload:void 0,meta:ri(Xe({},p||{}),{arg:d,requestId:u,requestStatus:"pending"})}}),s=Je(t+"/rejected",function(u,d,p,f,h){return{payload:f,error:(n&&n.serializeError||Zc)(u||"Rejected"),meta:ri(Xe({},h||{}),{arg:p,requestId:d,rejectedWithValue:!!f,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,f){var h=n?.idGenerator?n.idGenerator(u):Xc(),m=new l,b,x=!1;function A(T){b=T,m.abort()}var S=(function(){return $c(this,null,function(){var T,z,B,Ue,hn,$e,ie;return Nc(this,function(ue){switch(ue.label){case 0:return ue.trys.push([0,4,,5]),Ue=(T=n?.condition)==null?void 0:T.call(n,u,{getState:p,extra:f}),eu(Ue)?[4,Ue]:[3,2];case 1:Ue=ue.sent(),ue.label=2;case 2:if(Ue===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return x=!0,hn=new Promise(function(oe,et){return m.signal.addEventListener("abort",function(){return et({name:"AbortError",message:b||"Aborted"})})}),d(o(h,u,(z=n?.getPendingMeta)==null?void 0:z.call(n,{requestId:h,arg:u},{getState:p,extra:f}))),[4,Promise.race([hn,Promise.resolve(r(u,{dispatch:d,getState:p,extra:f,requestId:h,signal:m.signal,abort:A,rejectWithValue:function(oe,et){return new ii(oe,et)},fulfillWithValue:function(oe,et){return new js(oe,et)}})).then(function(oe){if(oe instanceof ii)throw oe;return oe instanceof js?i(oe.payload,h,u,oe.meta):i(oe,h,u)})])];case 3:return B=ue.sent(),[3,5];case 4:return $e=ue.sent(),B=$e instanceof ii?s(null,h,u,$e.payload,$e.meta):s($e,h,u),[3,5];case 5:return ie=n&&!n.dispatchConditionRejection&&s.match(B)&&B.meta.condition,ie||d(B),[2,B]}})})})();return Object.assign(S,{abort:A,requestId:h,arg:u,unwrap:function(){return S.then(Qc)}})}}return Object.assign(c,{pending:o,rejected:s,fulfilled:i,typePrefix:t})}return e.withTypes=function(){return e},e})();function Qc(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function eu(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Gs="listener",qs="completed",Ys="cancelled",Fp="task-"+Ys,Vp="task-"+qs,zp=Gs+"-"+Ys,Wp=Gs+"-"+qs;var si="listenerMiddleware";var Kp=Je(si+"/add"),Gp=Je(si+"/removeAll"),qp=Je(si+"/remove");var Fs,Yp=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(Fs||(Fs=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},tu=function(e){return function(t){setTimeout(t,e)}},Xp=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:tu(10);ws();var ru=kr(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??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)}}}),Gr=class extends ru(Object){};window.ftReduxStores||(window.ftReduxStores={});var Xs=class e extends Gr{static get(t){var r;let n=typeof t=="string"?t:t.name,i=typeof t=="string"?void 0:t,o=window.ftReduxStores[n];if(jr(o))return o;if(i==null)return;let s=Ks({...i,reducers:(r=i.reducers)!==null&&r!==void 0?r:{}}),a=zs({reducer:(l,c)=>{if(c.type==="CLEAR_FT_REDUX_STORE"){let u=lr(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 e(s,a,i.eventBus)}constructor(t,r,n){super(),this.reduxSlice=t,this.reduxStore=r,this.isFtReduxStore=!0,this.commands=new Ur;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(...t){this.reduxStore.dispatch({type:"CLEAR_FT_REDUX_STORE",keeping:t})}setState(t){this.reduxStore.dispatch({type:"DEFAULT_VALUE_SETTER__"+Object.keys(t).join("_"),overwrites:t})}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(t){throw new Error("Not implemented yet.")}subscribe(t){return this.reduxStore.subscribe(t)}get name(){return this.reduxSlice.name}get reducer(){return this.reduxSlice.reducer}get caseReducers(){return this.reduxSlice.caseReducers}getInitialState(){return this.reduxSlice.getInitialState()}};var qr=class{static format(t,r,n,i,o){return window.moment?window.moment(t).locale(r).format(this.getMomentDateFormat(n,i,!!o)):this.getIntlDateTime(t,r,n,i,!!o)}static getMomentDateFormat(t,r,n){return n?"LT":t?r?"lll":"ll":r?"L LT":"L"}static getIntlDateTime(t,r,n,i,o){let s=typeof t=="string"?new Date(t):t,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 t=n=>String(Math.floor(n)).padStart(2,"0"),r=new Date().getTimezoneOffset();return`${r<0?"+":"-"}${t(Math.abs(r)/60)}:${t(Math.abs(r)%60)}`}};var Yr=y(C()),nu="ft-app-info",$t=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};$t.eventName="authentication-change";var hr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};hr.eventName="ui-locale-changed";var iu={session:(e,t)=>{(0,Yr.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>w.dispatchEvent(new $t(t.payload)),0))}},w=Yr.FtReduxStore.get({name:nu,reducers:iu,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 Js=y(C()),Xr=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Of=(0,Js.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...n){super(n),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(w)}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=>qr.format(a,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return Xr([(0,ai.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),Xr([(0,ai.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),Xr([Un({store:w.name,selector:r=>{var n,i;return(i=(n=r.metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&i!==void 0?i:[]}})],t.prototype,"metadataDescriptors",void 0),Xr([Un({store:w.name})],t.prototype,"uiLocale",void 0),t});var Zs;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Zs||(Zs={}));var Qs;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Qs||(Qs={}));var ea;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ea||(ea={}));var ta;(function(e){e.STRUCTURED_DOCUMENT="STRUCTURED_DOCUMENT",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT",e.SHARED_PERSONAL_BOOK="SHARED_PERSONAL_BOOK",e.PERSONAL_BOOK="PERSONAL_BOOK",e.ATTACHMENT="ATTACHMENT",e.RESOURCE="RESOURCE",e.HTML_PACKAGE="HTML_PACKAGE"})(ta||(ta={}));var ra;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(ra||(ra={}));var na;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(na||(na={}));var ia;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(ia||(ia={}));var oa;(function(e){e.BOOKMARK__CREATE="BOOKMARK__CREATE",e.BOOKMARK__DELETE="BOOKMARK__DELETE",e.CASE_DEFLECTION__START="CASE_DEFLECTION__START",e.CASE_DEFLECTION__OPEN_TICKET="CASE_DEFLECTION__OPEN_TICKET",e.CASE_DEFLECTION__RATE="CASE_DEFLECTION__RATE",e.CHATBOT__RATE="CHATBOT__RATE",e.COLLECTION__CREATE="COLLECTION__CREATE",e.COLLECTION__UPDATE="COLLECTION__UPDATE",e.COLLECTION__DELETE="COLLECTION__DELETE",e.CUSTOM_EVENT__TRIGGER="CUSTOM_EVENT__TRIGGER",e.DOCUMENT__ON_DEMAND_TRANSLATE="DOCUMENT__ON_DEMAND_TRANSLATE",e.DOCUMENT__DOWNLOAD="DOCUMENT__DOWNLOAD",e.DOCUMENT__PRINT="DOCUMENT__PRINT",e.DOCUMENT__PROCESS="DOCUMENT__PROCESS",e.DOCUMENT__RATE="DOCUMENT__RATE",e.DOCUMENT__SEARCH="DOCUMENT__SEARCH",e.DOCUMENT__START_DISPLAY="DOCUMENT__START_DISPLAY",e.DOCUMENT__UNRATE="DOCUMENT__UNRATE",e.FEEDBACK__SEND="FEEDBACK__SEND",e.AI__COMPLETED_QUERY="AI__COMPLETED_QUERY",e.AI__RATE="AI__RATE",e.AI_CASE_DEFLECTION__START="AI_CASE_DEFLECTION__START",e.AI_CASE_DEFLECTION__OPEN_TICKET="AI_CASE_DEFLECTION__OPEN_TICKET",e.KHUB__PROCESS="KHUB__PROCESS",e.KHUB__SEARCH="KHUB__SEARCH",e.LABELS__DOWNLOAD="LABELS__DOWNLOAD",e.LINK__SHARE="LINK__SHARE",e.PAGE__DISPLAY="PAGE__DISPLAY",e.PERSONAL_BOOK__CREATE="PERSONAL_BOOK__CREATE",e.PERSONAL_BOOK__DELETE="PERSONAL_BOOK__DELETE",e.PERSONAL_BOOK__UPDATE="PERSONAL_BOOK__UPDATE",e.PERSONAL_TOPIC__CREATE="PERSONAL_TOPIC__CREATE",e.PERSONAL_TOPIC__UPDATE="PERSONAL_TOPIC__UPDATE",e.PERSONAL_TOPIC__DELETE="PERSONAL_TOPIC__DELETE",e.SAVED_SEARCH__CREATE="SAVED_SEARCH__CREATE",e.SAVED_SEARCH__DELETE="SAVED_SEARCH__DELETE",e.SAVED_SEARCH__UPDATE="SAVED_SEARCH__UPDATE",e.SEARCH_PAGE__SELECT="SEARCH_PAGE__SELECT",e.SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU="SEARCH_RESULT__OPEN_BROWSER_CONTEXT_MENU",e.TOPIC__AI_TRANSLATE="TOPIC__AI_TRANSLATE",e.TOPIC__RATE="TOPIC__RATE",e.TOPIC__START_DISPLAY="TOPIC__START_DISPLAY",e.TOPIC__UNRATE="TOPIC__UNRATE",e.USER__LOGIN="USER__LOGIN",e.USER__LOGOUT="USER__LOGOUT",e.HEARTBEAT="HEARTBEAT"})(oa||(oa={}));var sa;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(sa||(sa={}));var aa;(function(e){e.THIRD_PARTY="THIRD_PARTY",e.OFF_THE_GRID="OFF_THE_GRID",e.CONTENT_PACKAGER="CONTENT_PACKAGER",e.PAGES="PAGES",e.DESIGNED_READER="DESIGNED_READER"})(aa||(aa={}));var la;(function(e){e.HOMEPAGE="HOMEPAGE",e.CUSTOM="CUSTOM",e.HEADER="HEADER",e.READER="READER",e.TOPIC_TEMPLATE="TOPIC_TEMPLATE",e.SEARCH="SEARCH",e.SEARCH_RESULT="SEARCH_RESULT",e.SEARCH_ANNOUNCEMENT="SEARCH_ANNOUNCEMENT",e.LINK_PREVIEW="LINK_PREVIEW",e.UD_VIEWER="UD_VIEWER",e.ASSET_VIEWER="ASSET_VIEWER"})(la||(la={}));var ca;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(ca||(ca={}));var ua;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(ua||(ua={}));var da;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(da||(da={}));var pa;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(pa||(pa={}));var fa;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR",e.CUSTOM="CUSTOM"})(fa||(fa={}));var ha;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(ha||(ha={}));var ma;(function(e){e.ASC="ASC",e.DESC="DESC"})(ma||(ma={}));var ya;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})(ya||(ya={}));var ga;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(ga||(ga={}));var va;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(va||(va={}));var ba;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(ba||(ba={}));var xa;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.PERSONAL_BOOK="PERSONAL_BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(xa||(xa={}));var Aa;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Aa||(Aa={}));var Ea;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Ea||(Ea={}));var Sa;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Sa||(Sa={}));var Ca;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(Ca||(Ca={}));var F;(function(e){e.PERSONAL_BOOK_USER="PERSONAL_BOOK_USER",e.PERSONAL_BOOK_SHARE_USER="PERSONAL_BOOK_SHARE_USER",e.HTML_EXPORT_USER="HTML_EXPORT_USER",e.PDF_EXPORT_USER="PDF_EXPORT_USER",e.SAVED_SEARCH_USER="SAVED_SEARCH_USER",e.COLLECTION_USER="COLLECTION_USER",e.OFFLINE_USER="OFFLINE_USER",e.ANALYTICS_USER="ANALYTICS_USER",e.BETA_USER="BETA_USER",e.DEBUG_USER="DEBUG_USER",e.PRINT_USER="PRINT_USER",e.RATING_USER="RATING_USER",e.FEEDBACK_USER="FEEDBACK_USER",e.GENERATIVE_AI_USER="GENERATIVE_AI_USER",e.GENERATIVE_AI_EXPORT_USER="GENERATIVE_AI_EXPORT_USER",e.CONTENT_PUBLISHER="CONTENT_PUBLISHER",e.BEHAVIOR_DATA_USER="BEHAVIOR_DATA_USER",e.ANNOUNCEMENT_ADMIN="ANNOUNCEMENT_ADMIN",e.KHUB_ADMIN="KHUB_ADMIN",e.USERS_ADMIN="USERS_ADMIN",e.PORTAL_ADMIN="PORTAL_ADMIN",e.ADMIN="ADMIN"})(F||(F={}));var he;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(he||(he={}));var Oa;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Oa||(Oa={}));var Ta;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Ta||(Ta={}));var wa;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(wa||(wa={}));var _a;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SUMMARY="SUMMARY",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(_a||(_a={}));var Ra;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(Ra||(Ra={}));var La;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(La||(La={}));var Pa;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(Pa||(Pa={}));var Na;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(Na||(Na={}));var Da;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(Da||(Da={}));var Ia;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(Ia||(Ia={}));var Ma;(function(e){e.SOURCES="SOURCES",e.ENRICH_AND_CLEAN="ENRICH_AND_CLEAN",e.VOCABULARIES="VOCABULARIES",e.METADATA="METADATA",e.PRETTY_URL="PRETTY_URL",e.ACCESS_RULE="ACCESS_RULE",e.DESIGNED_PAGES="DESIGNED_PAGES",e.THEME_STUDIO="THEME_STUDIO",e.PORTAL_GENERAL="PORTAL_GENERAL",e.ASSETS="ASSETS",e.CODE_LIBRARY="CODE_LIBRARY",e.THEME="THEME",e.CONTENT_STYLES="CONTENT_STYLES",e.HOMEPAGE="HOMEPAGE",e.CLASSIC_SEARCH_PAGE="CLASSIC_SEARCH_PAGE",e.CLASSIC_READER_PAGE="CLASSIC_READER_PAGE",e.PORTAL_METADATA="PORTAL_METADATA",e.LANGUAGES="LANGUAGES",e.PRINT_TEMPLATES="PRINT_TEMPLATES",e.OFFLINE="OFFLINE",e.CUSTOM_JS="CUSTOM_JS",e.CONFIDENTIALITY="CONFIDENTIALITY",e.NOTIFICATIONS="NOTIFICATIONS"})(Ma||(Ma={}));var ka;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(ka||(ka={}));var ou={[F.PERSONAL_BOOK_SHARE_USER]:[F.PERSONAL_BOOK_USER],[F.HTML_EXPORT_USER]:[F.PERSONAL_BOOK_USER],[F.PDF_EXPORT_USER]:[F.PERSONAL_BOOK_USER],[F.KHUB_ADMIN]:[F.CONTENT_PUBLISHER],[F.ADMIN]:[F.KHUB_ADMIN,F.USERS_ADMIN,F.PORTAL_ADMIN,F.BEHAVIOR_DATA_USER],[F.GENERATIVE_AI_EXPORT_USER]:[F.GENERATIVE_AI_USER]};function Ua(e,t){return e===t||(ou[e]??[]).some(r=>Ua(r,t))}function $a(e,t){return e==null?!1:(Array.isArray(e)?e:Array.isArray(e.roles)?e.roles:Array.isArray(e.profile?.roles)?e.profile.roles:[]).some(n=>Ua(n,t))}var tn=y(C());var li=y(C());var dt=class e{static get(t){let{baseUrl:r,apiIntegrationIdentifier:n}=w.getState(),i=t??n;if(r&&i&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(r,i,!0)}static await(t){return new Promise(r=>{let n=e.get(t);if(n)r(n);else{let i=w.subscribe(()=>{n=e.get(t),n&&(i(),r(n))})}})}};var Bt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:dt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):dt.await()}};var ce=class extends Bt{constructor(t=!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 li.CacheRegistry,this.cache=t?i.commonCache:new li.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((r,n)=>0|31*r+n.charCodeAt(0),0))}};var Jr=class extends ce{async listMySearches(){let{session:t}=w.getState();return $a(t,F.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Zr=class extends ce{async listMyBookmarks(){let t=w.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Qr=class extends ce{constructor(){super(...arguments),this.CACHE_DURATION=180*1e3}async getUserAssetCount(t){if(this.isAuthenticated())return this.cache.get(`user-asset-count-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/${t}`),this.CACHE_DURATION)}async getUserBookmarkCountByMap(t){if(this.isAuthenticated())return this.cache.get(`user-bookmark-count-by-map-${t}`,async()=>(await this.awaitApi).get(`/internal/api/webapp/user/assets/count/BOOKMARKS/${t}`),this.CACHE_DURATION)}isAuthenticated(){let t=w.getState().session;return!!t?.sessionAuthenticated}};var en=class extends ce{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 t=w.getState().session;return!!t?.sessionAuthenticated}};var su="ft-user-assets",au={setAssetCount:(e,t)=>{let{userAssetType:r,count:n}=t.payload.assetCount;e.assetCounts.allAsset[r]=n},clearAssetCount:e=>{Object.values(he).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let r=t.payload.mapId;e.assetCounts.bookmarkByMap[r]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:r,mapId:n,asset:i}=t.payload;ui(e,r,[...ci(e,r),i]),Ba(e,r,1,n),Ha(e,i)},editAsset:(e,t)=>{let{assetType:r,asset:n}=t.payload;ui(e,r,ci(e,r).map(i=>i.id===n.id?n:i)),Ha(e,n)},removeAsset:(e,t)=>{let{assetType:r,mapId:n,assetId:i}=t.payload;ui(e,r,ci(e,r).filter(o=>o.id!==i)),Ba(e,r,-1,n)}},ja={[he.SEARCHES]:"savedSearches",[he.BOOKMARKS]:"bookmarks",[he.BOOKS]:void 0,[he.COLLECTIONS]:void 0},ci=(e,t)=>{var r;let n=ja[t];return n?(r=e[n])!==null&&r!==void 0?r:[]:[]},ui=(e,t,r)=>{let n=ja[t];n&&(e[n]=r)},Ba=(e,t,r,n)=>{let i=e.assetCounts.allAsset[t];if(i!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,i+r),t===he.BOOKMARKS&&n)){let o=e.assetCounts.bookmarkByMap[n];e.assetCounts.bookmarkByMap[n]=Math.max(0,o+r)}},Ha=(e,t)=>{let r=e.assetLabels.map(i=>i.title),n=t.labels.filter(i=>!r.includes(i)).map(i=>({title:i}));e.assetLabels.push(...n)},Q=tn.FtReduxStore.get({name:su,reducers:au,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(he).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),di=class{constructor(t=new Qr,r=new en){this.assetCountsService=t,this.assetLabelsService=r,this.currentSession=w.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Zr,this.savedSearchesService=new Jr,w.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:r}=w.getState();(0,tn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,r?.profile)||(this.currentSession=r,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),Q.actions.clearAssetCount(),Q.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),Q.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),Q.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();Q.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();Q.actions.assetLabels(t)}async loadAssetCount(t){let r=await this.assetCountsService.getUserAssetCount(t);r&&Q.getState().assetCounts.allAsset[t]!==r.count&&Q.actions.setAssetCount({assetCount:r})}async loadBookmarkByMapId(t){let r=await this.assetCountsService.getUserBookmarkCountByMap(t);r&&Q.getState().assetCounts.bookmarkByMap[t]!==r.count&&Q.actions.setBookmarkCountByMap({count:r.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let r=Object.keys(Q.getState().assetCounts.bookmarkByMap).length!==0;t===he.BOOKMARKS&&r&&Q.actions.clearBookmarkCountByMap(),Q.getState().assetCounts.allAsset[t]!==void 0&&await this.loadAssetCount(t)}async registerBookmarkComponent(){this.bookmarksAreUsed=!0,await this.updateBookmarksIfUsed()}async updateBookmarksIfUsed(){var t;if(this.bookmarksAreUsed){let r=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;Q.actions.bookmarks(r)}}},lu=new di;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=lu);var pi=class{addCommand(t,r=!1){w.commands.add(t,r)}consumeCommand(t){return w.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new pi;var me=y(C());var Fa,Ht=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},cu=Symbol("clearAfterUnitTest"),rn=class extends(0,me.withEventBus)(ce){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[Fa]=()=>{this.defaultMessages={},this.cache=new me.CacheRegistry,this.listeners={}},this.currentUiLocale=w.getState().uiLocale,w.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=w.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let r=t.name.toLowerCase();this.cache.setFinal(r,t),this.notify(r)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,r){var n;if(t=t.toLowerCase(),r&&Object.keys(r).length>0){let i={...(n=this.defaultMessages[t])!==null&&n!==void 0?n:{},...r};(0,me.deepEqual)(this.defaultMessages[t],i)||(this.defaultMessages[t]=i,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var r,n;return this.fetchContext(t),(n=(r=this.cache.getNow(t))===null||r===void 0?void 0:r.messages)!==null&&n!==void 0?n:{}}resolveRawMessage(t,r){let n=t.toLowerCase();return this.resolveContext(n)[r]}resolveMessage(t,r,...n){var i;let o=t.toLowerCase(),s=this.resolveContext(o);return new me.ParametrizedLabelResolver((i=this.defaultMessages[o])!==null&&i!==void 0?i:{},s).resolve(r,...n)}async fetchContext(t){let r=!this.cache.has(t),n;try{n=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),r&&await this.notify(t)}catch(i){!(i instanceof me.CanceledPromiseError)&&r&&console.error(i)}return n}subscribe(t,r){var n;return t=t.toLowerCase(),this.listeners[t]=(n=this.listeners[t])!==null&&n!==void 0?n:new Set,this.listeners[t].add(r),()=>{var i;return(i=this.listeners[t])===null||i===void 0?void 0:i.delete(r)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Ht({loadedContexts:t})),this.dispatchEvent(new Ht({loadedContexts:t})),await Promise.all(t.map(r=>this.notify(r,!1)))}async notify(t,r=!0){r&&(document.body.dispatchEvent(new Ht({loadedContexts:[t]})),this.dispatchEvent(new Ht({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(n=>(0,me.delay)(0).then(()=>n()).catch(()=>null)))}};Fa=cu;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends rn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends rn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var mr=window.FluidTopicsI18nService,fi=window.FluidTopicsCustomI18nService;var Va=y(C()),hi=class{highlightHtml(t,r,n){(0,Va.highlightHtml)(t,r,n)}};window.FluidTopicsHighlightHtmlService=new hi;var za=y(C());var mi=class{isDate(t){var r,n,i,o;return(o=(i=((n=(r=w.getState().metadataConfiguration)===null||r===void 0?void 0:r.descriptors)!==null&&n!==void 0?n:[]).find(a=>a.key===t))===null||i===void 0?void 0:i.date)!==null&&o!==void 0?o:!1}format(t,r){var n,i,o,s;if(t==null)return"";try{return za.DateFormatter.format(t,(n=r?.locale)!==null&&n!==void 0?n:w.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(t)} is not valid`,a),a}}};window.FluidTopicsDateService=new mi;var Wa=y(C());var yr=class{static get(t,r){var n,i,o,s;let a=w.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 Wa.SearchPlaceConverter(a.baseUrl,t??20,(s=a.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,r??`${l}-${c}`)}};var yi=class{urlToSearchRequest(t){return yr.get().parse(t)}searchRequestToUrl(t){return yr.get().serialize(t)}};window.FluidTopicsUrlService=new yi;var ke=y(C());var pt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};pt.eventName="change";var gi=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let r=sessionStorage.getItem(this.itemName(t));return r?JSON.parse(r):void 0}set(t,r){sessionStorage.setItem(this.itemName(t),JSON.stringify(r))}},Ka=new gi;var nn=class e extends ke.WithEventBus{static build(){return new e(window.history,Ka,()=>window.location,!1)}constructor(t,r,n,i){var o,s;super(),this.history=t,this.historyStorage=r,this.windowLocation=n,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(o=t.state)===null||o===void 0?void 0:o.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(i)}setCurrentState(t,r=!1){let n=r&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},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,ke.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,window.location.href]),setTimeout(()=>this.dispatchEvent(new pt(this.currentItem())),0)}installProxies(){let t=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:t(()=>this.currentIndex+1)}),this.history.replaceState=new Proxy(this.history.replaceState,{apply:t(()=>this.currentIndex)})}initEventListeners(){window.addEventListener("popstate",t=>this.setCurrentState(t.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(t){for(let r=this.history.length-1;r>=0;r--)t?this.states[r]=this.historyStorage.get(r):setTimeout(()=>this.states[r]=this.historyStorage.get(r),this.history.length-r)}updateCurrentState(t){var r;let n={...this.buildCurrentState(),...t,index:this.currentIndex,title:(r=t?.title)!==null&&r!==void 0?r:this.currentState.title};this.setCurrentState(n)}addHistoryChangeListener(t){this.addEventListener(pt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(pt.eventName,t)}currentItem(){return(0,ke.deepCopy)(this.currentState)}back(){let t=this.previousDifferentMajorPosition();t>=0?this.history.go(t-this.currentIndex):this.currentIndex!==this.initialIndex?this.history.go(this.initialIndex-this.currentIndex):this.history.back()}backwardItem(){return(0,ke.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let r=this.states.filter(n=>!!n).filter(n=>n.index<this.currentIndex).reverse();return(0,ke.deepCopy)(r.find(n=>t(n)))}previousDifferentMajorPosition(){let t=this.currentIndex>0?this.currentIndex-1:0;for(;t>0&&!this.isDifferentMajorState(t);)t--;return t}forward(){let t=this.nextMajorPosition();t&&t<this.states.length?this.history.go(t-this.currentIndex):this.history.forward()}forwardItem(){let t=this.nextMajorPosition();if(t)return(0,ke.deepCopy)(this.states[t])}nextMajorPosition(){let t=this.currentIndex;if(!(t>=this.states.length)){do t++;while(t<this.states.length&&!this.isDifferentMajorState(t));return this.getHigherPositionInTheSameState(t)}}getHigherPositionInTheSameState(t){var r;let n=(r=this.states[t])===null||r===void 0?void 0:r.majorStateId;if(!n)return t;let i=t,o=t+1;for(;this.states.length>o&&!this.isDifferentMajorState(o,n);)this.hasState(o)&&(i=o),o++;return i}buildCurrentState(){var t,r;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(r=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&r!==void 0?r:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,r){var n;if(!this.hasState(t))return!1;let i=r??this.currentState.majorStateId,o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;return o==null||o!=i}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=nn.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e)});var Ga=y($());var qa=Ga.css`
314
- `;var Ja=y($()),ne=y(X()),mt=y(C());var ft=y(C());function Ya(e,t){let{authenticationRequired:r,session:n}=w.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var on=class extends Bt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var vi=class e extends ft.FtStateManager{static build(t){return new e(w,t)}constructor(t,r){super(),this.store=t,this.cache=new ft.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new on,this.cleanSessionDebouncer=new ft.Debouncer,this.reloadDebouncer=new ft.Debouncer(500),this.apiProvider=r??(()=>dt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener($t.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 t=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(t)}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 t;let r=await this.cache.get("availableContentLocales",()=>Ya(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=r.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setTenantId(t){this.store.actions.tenantId(t)}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t){this.userLocaleService.updateUiLocale({uiLocale:t}).then(r=>{r.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new hr(r)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Xa=vi.build();var ht=class extends Event{constructor(t,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var gr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let r=this.pendingContextRequests.get(t.context);if(r===void 0)return;this.pendingContextRequests.delete(t.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 ht(t.context,s,a,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let r=t.contextTarget??t.composedPath()[0],n=t.callback,i=this.pendingContextRequests.get(t.context);i===void 0&&this.pendingContextRequests.set(t.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(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var G=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},D=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=Xa,this.contextRoot=new gr}render(){return Ja.html`
314
+ `;var Ja=y($()),ne=y(X()),mt=y(C());var ft=y(C());function Ya(e,t){let{authenticationRequired:r,session:n}=w.getState();return r&&!n?.sessionAuthenticated?Promise.resolve(t):e()}var on=class extends Bt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var vi=class e extends ft.FtStateManager{static build(t){return new e(w,t)}constructor(t,r){super(),this.store=t,this.cache=new ft.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new on,this.cleanSessionDebouncer=new ft.Debouncer,this.reloadDebouncer=new ft.Debouncer(500),this.apiProvider=r??(()=>dt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}async initService(){this.store.addEventListener($t.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 t=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(t)}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 t;let r=await this.cache.get("availableContentLocales",()=>Ya(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=r.contentLocales)!==null&&t!==void 0?t:[])}reloadConfiguration(){var t;(t=this.cache)===null||t===void 0||t.clear("availableContentLocales"),typeof this.updateAvailableContentLocales=="function"&&this.updateAvailableContentLocales()}setBaseUrl(t){this.store.actions.baseUrl(t),window.fluidTopicsBaseUrl=t}setTenantId(t){this.store.actions.tenantId(t)}setApiIntegrationIdentifier(t){this.store.actions.apiIntegrationIdentifier(t)}setApiIntegrationAppVersion(t){this.store.actions.apiIntegrationAppVersion(t)}setUiLocale(t){this.store.actions.uiLocale(t)}setLocalesConfiguration(t){this.store.actions.localesConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setAvailableContentLocales(t){this.store.actions.availableContentLocales(t),setTimeout(()=>this.updateIfNeeded())}stopReloadDebouncer(){this.reloadDebouncer.cancel()}requestUiLocaleUpdate(t,r){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:r}).then(n=>{n.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new hr(n)))}).catch(()=>{})}setMetadataConfiguration(t){this.store.actions.metadataConfiguration(t),setTimeout(()=>this.updateIfNeeded())}setNoCustom(t){this.store.actions.noCustom(t)}setEditorMode(t){this.store.actions.editorMode(t)}setNoCustomComponent(t){this.store.actions.noCustomComponent(t)}setSession(t){this.store.actions.session(t),setTimeout(()=>this.updateIfNeeded())}setOpenExternalDocumentInNewTab(t){this.store.actions.openExternalDocumentInNewTab(t)}setNavigatorOnline(t){this.store.actions.navigatorOnline(t)}setForcedOffline(t){this.store.actions.forcedOffline(t)}setAuthenticationRequired(t){this.store.actions.authenticationRequired(t)}},Xa=vi.build();var ht=class extends Event{constructor(t,r,n,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=r,this.callback=n,this.subscribe=i??!1}};var gr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let r=this.pendingContextRequests.get(t.context);if(r===void 0)return;this.pendingContextRequests.delete(t.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 ht(t.context,s,a,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let r=t.contextTarget??t.composedPath()[0],n=t.callback,i=this.pendingContextRequests.get(t.context);i===void 0&&this.pendingContextRequests.set(t.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(t){t.addEventListener("context-request",this.onContextRequest),t.addEventListener("context-provider",this.onContextProvider)}detach(t){t.removeEventListener("context-request",this.onContextRequest),t.removeEventListener("context-provider",this.onContextProvider)}};var G=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},D=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=Xa,this.contextRoot=new gr}render(){return Ja.html`
315
315
  <slot></slot>
316
316
  `}connectedCallback(){super.connectedCallback(),this.stateManager.initService(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.contextRoot.detach(document.body)}update(t){var r;super.update(t),t.has("baseUrl")&&this.stateManager.setBaseUrl(this.baseUrl),t.has("tenantId")&&this.stateManager.setTenantId(this.tenantId),t.has("apiIntegrationIdentifier")&&this.stateManager.setApiIntegrationIdentifier(this.apiIntegrationIdentifier),t.has("apiIntegrationAppVersion")&&this.stateManager.setApiIntegrationAppVersion(this.apiIntegrationAppVersion),t.has("uiLocale")&&this.stateManager.setUiLocale(this.uiLocale),t.has("metadataConfiguration")&&this.stateManager.setMetadataConfiguration(this.metadataConfiguration),t.has("noCustom")&&this.stateManager.setNoCustom(this.noCustom),t.has("editorMode")&&this.stateManager.setEditorMode(this.editorMode),t.has("noCustomComponent")&&this.stateManager.setNoCustomComponent(this.noCustomComponent),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(n=>mr.addContext(n)),t.has("openExternalDocumentInNewTab")&&this.stateManager.setOpenExternalDocumentInNewTab(this.openExternalDocumentInNewTab),t.has("navigatorOnline")&&this.stateManager.setNavigatorOnline(this.navigatorOnline),t.has("forcedOffline")&&this.stateManager.setForcedOffline(this.forcedOffline),t.has("authenticationRequired")&&this.stateManager.setAuthenticationRequired(this.authenticationRequired),t.has("withManualResources")&&((r=this.stateManager)===null||r===void 0||r.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};D.elementDefinitions={};D.styles=qa;G([(0,ne.property)()],D.prototype,"baseUrl",void 0);G([(0,ne.property)()],D.prototype,"tenantId",void 0);G([(0,ne.property)()],D.prototype,"apiIntegrationIdentifier",void 0);G([(0,ne.property)()],D.prototype,"apiIntegrationAppVersion",void 0);G([(0,ne.property)()],D.prototype,"uiLocale",void 0);G([(0,mt.jsonProperty)(null)],D.prototype,"availableUiLocales",void 0);G([(0,mt.jsonProperty)(null)],D.prototype,"metadataConfiguration",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"editorMode",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"noCustom",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"openExternalDocumentInNewTab",void 0);G([(0,ne.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],D.prototype,"noCustomComponent",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"withManualResources",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"navigatorOnline",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"forcedOffline",void 0);G([(0,ne.property)({type:Boolean})],D.prototype,"authenticationRequired",void 0);G([(0,mt.jsonProperty)([])],D.prototype,"messageContexts",void 0);G([(0,mt.jsonProperty)(void 0)],D.prototype,"session",void 0);var Qa=y(C());var Za={"ft-app-context":D};(0,Qa.customElements)(Za);var el=y(X());var bi=class{fromLocalizableLabel(t){return t.type=="PLAIN_TEXT"?{message:t.text}:{key:t.key,custom:t.type=="LOCALIZED_CUSTOM",context:t.context,message:t.key}}fromAttribute(t){if(t!=null)try{return JSON.parse(t)}catch{if(this.isI18nKey(t)){let[r,n]=t.split(".");return{context:r,key:n,custom:r!=="officialContext",message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},jt=new bi;var pu=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},br=Symbol("i18nAttributes"),tl=Symbol("i18nListAttributes"),rl=Symbol("i18nProperties"),sn=Symbol("i18nContexts"),vr=Symbol("i18nUnsubs"),nl=(0,Ft.applyMixinOnce)(Symbol("withI18n"),function(e){var t,r;class n extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[r]=new Map}getI18nService(o){return o??this.useCustomMessageContexts?fi: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(jt.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[br])===null||s===void 0||s.forEach((u,d)=>l[d]=c(u,d,l[d])),(a=this[tl])===null||a===void 0||a.forEach((u,d)=>{var p;return l[d]=(p=l[d])===null||p===void 0?void 0:p.map(f=>c(u,d,f))})}updateI18nProperties(o){var s;(s=this[rl])===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[sn].set(l,{isCustomContext:a}),this[vr].has(l)||this[vr].set(l,this.getI18nService(a).subscribe(l,()=>this.onI18nUpdate(l))),this.getI18nService(a).prepareContext(l,s)}hasI18nContext(o){return this[sn].has(o.toLowerCase())}connectedCallback(){super.connectedCallback(),this[sn].forEach((o,s)=>this.addI18nContext(s,void 0,o.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[vr].forEach(o=>o()),this[vr].clear()}}return t=sn,r=vr,pu([(0,el.property)({type:Boolean})],n.prototype,"useCustomMessageContexts",void 0),n}),an=class extends nl(Ft.FtLitElement){},ln=class extends nl(Ft.FtLitElementRedux){};var il=y(C());var xi=class{fromAttribute(t){if(!t)return[];try{let r=JSON.parse(t);return Array.isArray(r)?r.map(n=>typeof n=="string"?jt.fromAttribute(n):n):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},fu=new xi;var ol=(e,t)=>(r,n)=>{var i;r.constructor.createProperty(n,{type:Object,hasChanged:il.hasChanged,converter:jt,...t}),r[br]=(i=r[br])!==null&&i!==void 0?i:new Map,r[br].set(n,e??{})};var sl=y($());var al=sl.css`
317
317
  `;var cn=y($()),un=y(X()),dn=y(C());var xr=function(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o},Ce=class extends ln{constructor(){super(),this.editorMode=!1,this.addStore(w)}render(){return!this.key||!this.context?this.editorMode?"Select a context and a label key.":cn.nothing:cn.html`