@fluid-topics/ftds-button 2.2.15 → 2.2.16

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.
@@ -343,7 +343,7 @@
343
343
  position: relative;
344
344
  word-break: break-word;
345
345
  }
346
- `;var Qi=["top","right","bottom","left"],Xi=["start","end"],Ao=Qi.reduce((e,t)=>e.concat(t,t+"-"+Xi[0],t+"-"+Xi[1]),[]),gr=Math.min,Ke=Math.max,yr=Math.round;var _e=e=>({x:e,y:e}),S4={left:"right",right:"left",bottom:"top",top:"bottom"};function Ji(e,t,n){return Ke(e,gr(t,n))}function Yr(e,t){return typeof e=="function"?e(t):e}function br(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Oo(e){return e==="x"?"y":"x"}function Ro(e){return e==="y"?"height":"width"}function Xr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function _o(e){return Oo(Xr(e))}function es(e,t,n){n===void 0&&(n=!1);let o=Ze(e),a=_o(e),i=Ro(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Lo(s)),[s,Lo(s)]}function ts(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function Lo(e){let t=br(e);return S4[t]+e.slice(t.length)}function C4(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function rs(e){return typeof e!="number"?C4(e):{top:e,right:e,bottom:e,left:e}}function vt(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function ns(e,t,n){let{reference:o,floating:a}=e,i=Xr(t),s=_o(t),l=Ro(s),f=br(t),m=i==="y",h=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:h,y:o.y-a.height};break;case"bottom":x={x:h,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:g};break;case"left":x={x:o.x-a.width,y:g};break;default:x={x:o.x,y:o.y}}let L=Ze(t);return L&&(x[s]+=b*(L==="end"?1:-1)*(n&&m?-1:1)),x}async function os(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:b=!1,padding:x=0}=Yr(t,e),L=rs(x),A=l[b?g==="floating"?"reference":"floating":g],N=vt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(A)))==null||n?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:h,strategy:f})),T=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},I=vt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:_,strategy:f}):T);return{top:(N.top-I.top+L.top)/k.y,bottom:(I.bottom-N.bottom+L.bottom)/k.y,left:(N.left-I.left+L.left)/k.x,right:(I.right-N.right+L.right)/k.x}}var E4=50,as=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:os},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:g}=ns(m,o,f),b=o,x=0,L={};for(let R=0;R<i.length;R++){let A=i[R];if(!A)continue;let{name:N,fn:T}=A,{x:_,y:k,data:I,reset:B}=await T({x:h,y:g,initialPlacement:o,placement:b,strategy:a,middlewareData:L,rects:m,platform:l,elements:{reference:e,floating:t}});h=_??h,g=k??g,L[N]={...L[N],...I},B&&x<E4&&(x++,typeof B=="object"&&(B.placement&&(b=B.placement),B.rects&&(m=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):B.rects),{x:h,y:g}=ns(m,b,f)),R=-1)}return{x:h,y:g,placement:b,strategy:a,middlewareData:L}};function L4(e,t,n){return(e?[...n.filter(a=>Ze(a)===e),...n.filter(a=>Ze(a)!==e)]:n.filter(a=>br(a)===a)).filter(a=>e?Ze(a)===e||(t?ts(a)!==a:!1):!0)}var is=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:f,elements:m}=t,{crossAxis:h=!1,alignment:g,allowedPlacements:b=Ao,autoAlignment:x=!0,...L}=Yr(e,t),R=g!==void 0||b===Ao?L4(g||null,x,b):b,A=((n=s.autoPlacement)==null?void 0:n.index)||0,N=R[A];if(N==null)return{};if(l!==N)return{reset:{placement:R[0]}};let T=await f.detectOverflow(t,L),_=es(N,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[T[br(N)],T[_[0]],T[_[1]]],I=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:N,overflows:k}],B=R[A+1];if(B)return{data:{index:A+1,overflows:I},reset:{placement:B}};let F=I.map(pe=>{let at=Ze(pe.placement);return[pe.placement,at&&h?pe.overflows.slice(0,2).reduce((c4,l4)=>c4+l4,0):pe.overflows[0],pe.overflows]}).sort((pe,at)=>pe[1]-at[1]),ot=((a=F.filter(pe=>pe[2].slice(0,Ze(pe[0])?2:3).every(at=>at<=0))[0])==null?void 0:a[0])||F[0][0];return ot!==l?{data:{index:A+1,overflows:I},reset:{placement:ot}}:{}}}};var ss=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:f={fn:T=>{let{x:_,y:k}=T;return{x:_,y:k}}},...m}=Yr(e,t),h={x:n,y:o},g=await i.detectOverflow(t,m),b=Xr(a),x=Oo(b),L=h[x],R=h[b],A=(T,_)=>Ji(_+g[T==="y"?"top":"left"],_,_-g[T==="y"?"bottom":"right"]);s&&(L=A(x,L)),l&&(R=A(b,R));let N=f.fn({...t,[x]:L,[b]:R});return{...N,data:{x:N.x-n,y:N.y-o,enabled:{[x]:s,[b]:l}}}}}};function Jr(){return typeof window<"u"}function Ct(e){return ls(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ls(e){return Jr()?e instanceof Node||e instanceof ce(e).Node:!1}function Ce(e){return Jr()?e instanceof Element||e instanceof ce(e).Element:!1}function Te(e){return Jr()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function cs(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function xr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function ds(e){return/^(table|td|th)$/.test(Ct(e))}function vr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var A4=/transform|translate|scale|rotate|perspective|filter/,O4=/paint|layout|strict|content/,St=e=>!!e&&e!=="none",wo;function $t(e){let t=Ce(e)?Ee(e):e;return St(t.transform)||St(t.translate)||St(t.scale)||St(t.rotate)||St(t.perspective)||!en()&&(St(t.backdropFilter)||St(t.filter))||A4.test(t.willChange||"")||O4.test(t.contain||"")}function fs(e){let t=qe(e);for(;Te(t)&&!Gt(t);){if($t(t))return t;if(vr(t))return null;t=qe(t)}return null}function en(){return wo==null&&(wo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wo}function Gt(e){return/^(html|body|#document)$/.test(Ct(e))}function Ee(e){return ce(e).getComputedStyle(e)}function Sr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ct(e)==="html")return e;let t=e.assignedSlot||e.parentNode||cs(e)&&e.host||Ie(e);return cs(t)?t.host:t}function us(e){let t=qe(e);return Gt(t)?(e.ownerDocument||e).body:Te(t)&&xr(t)?t:us(t)}function Qr(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=us(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=tn(s);return t.concat(s,s.visualViewport||[],xr(a)?a:[],l&&n?Qr(l):[])}else return t.concat(a,Qr(a,[],n))}function tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hs(e){let t=Ee(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Te(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=yr(n)!==i||yr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function gs(e){return Ce(e)?e:e.contextElement}function Ht(e){let t=gs(e);if(!Te(t))return _e(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=hs(t),s=(i?yr(n.width):n.width)/o,l=(i?yr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var R4=_e(0);function ys(e){let t=ce(e);return!en()||!t.visualViewport?R4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ce(e)}function Cr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=gs(e),s=_e(1);t&&(o?Ce(o)&&(s=Ht(o)):s=Ht(e));let l=_4(i,n,o)?ys(i):_e(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,h=a.width/s.x,g=a.height/s.y;if(i&&o){let b=ce(i),x=Ce(o)?ce(o):o,L=b,R=tn(L);for(;R&&x!==L;){let A=Ht(R),N=R.getBoundingClientRect(),T=Ee(R),_=N.left+(R.clientLeft+parseFloat(T.paddingLeft))*A.x,k=N.top+(R.clientTop+parseFloat(T.paddingTop))*A.y;f*=A.x,m*=A.y,h*=A.x,g*=A.y,f+=_,m+=k,L=ce(R),R=tn(L)}}return vt({width:h,height:g,x:f,y:m})}function rn(e,t){let n=Sr(e).scrollLeft;return t?t.left+n:Cr(Ie(e)).left+n}function bs(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-rn(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function w4(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Ie(o),l=t?vr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=_e(1),h=_e(0),g=Te(o);if((g||!i)&&((Ct(o)!=="body"||xr(s))&&(f=Sr(o)),g)){let x=Cr(o);m=Ht(o),h.x=x.x+o.clientLeft,h.y=x.y+o.clientTop}let b=s&&!g&&!i?bs(s,f):_e(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+h.x+b.x,y:n.y*m.y-f.scrollTop*m.y+h.y+b.y}}function N4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function M4(e){let t=Sr(e),n=e.ownerDocument.body,o=Ke(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ke(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+rn(e),s=-t.scrollTop;return Ee(n).direction==="rtl"&&(i+=Ke(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var z4=25;function k4(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=ce(e),i=Ie(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,h=0;if(s){let b=!en()||t==="fixed";o?b||(m=-s.offsetLeft,h=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,h=s.offsetTop))}if(rn(i)<=0){let b=i.ownerDocument,x=b.body,L=getComputedStyle(x),R=b.compatMode==="CSS1Compat"&&parseFloat(L.marginLeft)+parseFloat(L.marginRight)||0,A=Math.abs(i.clientWidth-x.clientWidth-R),N=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;N<=z4&&(l-=N)}return{width:l,height:f,x:m,y:h}}function I4(e,t){let n=Cr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ht(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function ps(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=k4(e,n,t);else if(t==="document")o=M4(Ie(e));else if(Ce(t))o=I4(t,n);else{let a=ys(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return vt(o)}function T4(e,t){let n=t.get(e);if(n)return n;let o=Qr(e,[],!1).filter(l=>Ce(l)&&Ct(l)!=="body"),a=null,i=Ee(e).position==="fixed",s=i?qe(e):e;for(;Ce(s)&&!Gt(s);){let l=Ee(s),f=$t(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(g=>g!==s):a=l,s=qe(s)}return t.set(e,o),o}function P4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?vr(t)?[]:T4(t,this._c):[].concat(n),o],l=ps(t,s[0],a),f=l.top,m=l.right,h=l.bottom,g=l.left;for(let b=1;b<s.length;b++){let x=ps(t,s[b],a);f=Ke(x.top,f),m=gr(x.right,m),h=gr(x.bottom,h),g=Ke(x.left,g)}return{width:m-g,height:h-f,x:g,y:f}}function D4(e){let{width:t,height:n}=hs(e);return{width:t,height:n}}function U4(e,t,n){let o=Te(t),a=Ie(t),i=n==="fixed",s=Cr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=_e(0);if((o||!i)&&((Ct(t)!=="body"||xr(a))&&(l=Sr(t)),o)){let b=Cr(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=rn(a));let m=a&&!o&&!i?bs(a,l):_e(0),h=s.left+l.scrollLeft-f.x-m.x,g=s.top+l.scrollTop-f.y-m.y;return{x:h,y:g,width:s.width,height:s.height}}function No(e){return Ee(e).position==="static"}function ms(e,t){if(!Te(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function xs(e,t){let n=ce(e);if(vr(e))return n;if(!Te(e)){let a=qe(e);for(;a&&!Gt(a);){if(Ce(a)&&!No(a))return a;a=qe(a)}return n}let o=ms(e,t);for(;o&&ds(o)&&No(o);)o=ms(o,t);return o&&Gt(o)&&No(o)&&!$t(o)?n:o||fs(e)||n}var F4=async function(e){let t=this.getOffsetParent||xs,n=this.getDimensions,o=await n(e.floating);return{reference:U4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function B4(e){return Ee(e).direction==="rtl"}var nn={convertOffsetParentRelativeRectToViewportRelativeRect:w4,getDocumentElement:Ie,getClippingRect:P4,getOffsetParent:xs,getElementRects:F4,getClientRects:N4,getDimensions:D4,getScale:Ht,isElement:Ce,isRTL:B4};var vs=is,Ss=ss;var Cs=(e,t,n)=>{let o=new Map,a=n??{},i={...nn,...a.platform,_c:o};return as(e,t,{...a,platform:i})};function Es(e){return $4(e)}function Mo(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function $4(e){for(let t=e;t;t=Mo(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Mo(e);t;t=Mo(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||$t(n)||t.tagName==="BODY"))return t}return null}async function Ls(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Cs(e,t,{strategy:o.strategy,platform:{...nn,getOffsetParent:a=>nn.getOffsetParent(a,Es)},middleware:[Ss({crossAxis:!0}),vs({allowedPlacements:[o.placement]})]})}var Qt=O(D());var Jo=O(ie());var As=O(ie(),1);var zo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function Os(e,t){return(0,As.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return Er(e);try{return JSON.parse(n)}catch{return Er(e)}},toAttribute:n=>JSON.stringify(n)},hasChanged:Lr,...t??{}})}function G4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Wt(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Wt(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[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 a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Wt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Wt(e,t){try{return G4(e,t)}catch{return!1}}function Lr(e,t){return!Wt(e,t)}function Er(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function on(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var Rs=O(ie(),1);var ko=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Lr,attribute:!1,...t};(0,Rs.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var an=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var Et=O(ie(),1);var sn=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ws=O(X(),1);var cn=globalThis,H4=cn.ShadowRoot&&(cn.ShadyCSS===void 0||cn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var _s=(e,t)=>{if(H4)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let o=document.createElement("style"),a=cn.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=n.cssText,e.appendChild(o)}};var ln=class extends ws.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return _s(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){zo(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function Ns(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var jt=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Is,Ms=Symbol("constructorPrototype"),zs=Symbol("constructorName"),Ts=Symbol("exportpartsDebouncer"),ks=Symbol("dynamicDependenciesLoaded"),Vt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Vt.eventName="exportparts-updated";var we=class extends ln{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Is]=new sn(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[Ts].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[zs]=this.constructor.name,this[Ms]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[zs]&&Object.setPrototypeOf(this,this[Ms])}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(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[ks]||(n[ks]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Vt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Vt.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 Vt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=Ns(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var n,o,a,i,s,l;let f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let h=new Set;for(let b of(o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let x=(i=(a=b.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],L=(l=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(A=>A.split(":")[1]))!==null&&l!==void 0?l:[],R=[...x,...L].filter(f).map(A=>A.trim());for(let A of R)h.add(A)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...g].join(", ")}};Is=Ts;jt([(0,Et.property)()],we.prototype,"exportpartsPrefix",void 0);jt([Os([])],we.prototype,"exportpartsPrefixes",void 0);jt([(0,Et.property)({reflect:!0})],we.prototype,"exportparts",void 0);jt([(0,Et.property)()],we.prototype,"customStylesheet",void 0);jt([(0,Et.property)()],we.prototype,"elementToFocus",void 0);jt([(0,Et.state)()],we.prototype,"useAdoptedStyleSheets",void 0);function dn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Ar=Symbol("internalReduxEventsUnsubscribers"),Ye=Symbol("internalStoresUnsubscribers"),Lt=Symbol("internalStores"),W4=on(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&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,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Lt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Lt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Lt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[Ye].has(s.store):this[Ye].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f;this[Ye].set(s,l.subscribe(()=>this.updateFromStores())),this[Ar].set(s,[]),dn(l)&&l.eventBus&&((f=this.reduxConstructor.reduxEventListeners)===null||f===void 0||f.forEach((m,h)=>{if(typeof this[h]=="function"&&(!m.store||l.name===m.store)){let g=b=>this[h](b);l.addEventListener(m.eventName,g),this[Ar].get(s).push(()=>l.removeEventListener(m.eventName,g))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ye].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ye].has(s)&&this[Ye].get(s)(),this[Ye].delete(s),(l=this[Ar].get(s))===null||l===void 0||l.forEach(f=>f()),this[Ar].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Ye,n=Lt,o=Ar,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ps=class extends W4(we){};function te(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 V4=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ds=V4,Io=()=>Math.random().toString(36).substring(7).split("").join("."),j4={INIT:`@@redux/INIT${Io()}`,REPLACE:`@@redux/REPLACE${Io()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Io()}`},fn=j4;function un(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function To(e,t,n){if(typeof e!="function")throw new Error(te(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(te(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(te(1));return n(To)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((A,N)=>{s.set(N,A)}))}function h(){if(f)throw new Error(te(3));return a}function g(A){if(typeof A!="function")throw new Error(te(4));if(f)throw new Error(te(5));let N=!0;m();let T=l++;return s.set(T,A),function(){if(N){if(f)throw new Error(te(6));N=!1,m(),s.delete(T),i=null}}}function b(A){if(!un(A))throw new Error(te(7));if(typeof A.type>"u")throw new Error(te(8));if(typeof A.type!="string")throw new Error(te(17));if(f)throw new Error(te(9));try{f=!0,a=o(a,A)}finally{f=!1}return(i=s).forEach(T=>{T()}),A}function x(A){if(typeof A!="function")throw new Error(te(10));o=A,b({type:fn.REPLACE})}function L(){let A=g;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(te(11));function T(){let k=N;k.next&&k.next(h())}return T(),{unsubscribe:A(T)}},[Ds](){return this}}}return b({type:fn.INIT}),{dispatch:b,subscribe:g,getState:h,replaceReducer:x,[Ds]:L}}function K4(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:fn.INIT})>"u")throw new Error(te(12));if(typeof n(void 0,{type:fn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(te(13))})}function Us(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{K4(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,h={};for(let g=0;g<o.length;g++){let b=o[g],x=n[b],L=l[b],R=x(L,f);if(typeof R>"u"){let A=f&&f.type;throw new Error(te(14))}h[b]=R,m=m||R!==L}return m=m||o.length!==Object.keys(l).length,m?h:l}}function Or(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Fs(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(te(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=Or(...l)(a.dispatch),{...a,dispatch:i}}}function Bs(e){return un(e)&&"type"in e&&typeof e.type=="string"}var qs=Symbol.for("immer-nothing"),$s=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function Le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var le=Object,Zt=le.getPrototypeOf,gn="constructor",Cn="prototype",Fo="configurable",yn="enumerable",mn="writable",Rr="value",Ne=e=>!!e&&!!e[ne];function de(e){return e?Ys(e)||Ln(e)||!!e[$s]||!!e[gn]?.[$s]||An(e)||On(e):!1}var Z4=le[Cn][gn].toString(),Gs=new WeakMap;function Ys(e){if(!e||!Ko(e))return!1;let t=Zt(e);if(t===null||t===le[Cn])return!0;let n=le.hasOwnProperty.call(t,gn)&&t[gn];if(n===Object)return!0;if(!Kt(n))return!1;let o=Gs.get(n);return o===void 0&&(o=Function.toString.call(n),Gs.set(n,o)),o===Z4}function En(e,t,n=!0){Nr(e)===0?(n?Reflect.ownKeys(e):le.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function Nr(e){let t=e[ne];return t?t.type_:Ln(e)?1:An(e)?2:On(e)?3:0}var Po=(e,t,n=Nr(e))=>n===2?e.has(t):le[Cn].hasOwnProperty.call(e,t),Bo=(e,t,n=Nr(e))=>n===2?e.get(t):e[t],bn=(e,t,n,o=Nr(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function q4(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ln=Array.isArray,An=e=>e instanceof Map,On=e=>e instanceof Set,Ko=e=>typeof e=="object",Kt=e=>typeof e=="function",Do=e=>typeof e=="boolean";function Y4(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Pe=e=>e.copy_||e.base_;var Zo=e=>e.modified_?e.copy_:e.base_;function $o(e,t){if(An(e))return new Map(e);if(On(e))return new Set(e);if(Ln(e))return Array[Cn].slice.call(e);let n=Ys(e);if(t===!0||t==="class_only"&&!n){let o=le.getOwnPropertyDescriptors(e);delete o[ne];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[mn]===!1&&(l[mn]=!0,l[Fo]=!0),(l.get||l.set)&&(o[s]={[Fo]:!0,[mn]:!0,[yn]:l[yn],[Rr]:e[s]})}return le.create(Zt(e),o)}else{let o=Zt(e);if(o!==null&&n)return{...e};let a=le.create(o);return le.assign(a,e)}}function qo(e,t=!1){return Rn(e)||Ne(e)||!de(e)||(Nr(e)>1&&le.defineProperties(e,{set:pn,add:pn,clear:pn,delete:pn}),le.freeze(e),t&&En(e,(n,o)=>{qo(o,!0)},!1)),e}function X4(){Le(2)}var pn={[Rr]:X4};function Rn(e){return e===null||!Ko(e)?!0:le.isFrozen(e)}var xn="MapSet",Go="Patches",Hs="ArrayMethods",Xs={};function At(e){let t=Xs[e];return t||Le(0,e),t}var Ws=e=>!!Xs[e];var _r,Qs=()=>_r,Q4=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ws(xn)?At(xn):void 0,arrayMethodsPlugin_:Ws(Hs)?At(Hs):void 0});function Vs(e,t){t&&(e.patchPlugin_=At(Go),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ho(e){Wo(e),e.drafts_.forEach(J4),e.drafts_=null}function Wo(e){e===_r&&(_r=e.parent_)}var js=e=>_r=Q4(_r,e);function J4(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ks(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[ne].modified_&&(Ho(t),Le(4)),de(e)&&(e=Zs(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[ne].base_,e,t)}else e=Zs(t,n);return e0(t,e,!0),Ho(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qs?e:void 0}function Zs(e,t){if(Rn(t))return t;let n=t[ne];if(!n)return vn(t,e.handledSet_,e);if(!_n(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);tc(n,e)}return n.copy_}function e0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qo(t,n)}function Js(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var _n=(e,t)=>e.scope_===t,t0=[];function ec(e,t,n,o){let a=Pe(e),i=e.type_;if(o!==void 0&&Bo(a,o,i)===t){bn(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;En(a,(f,m)=>{if(Ne(m)){let h=l.get(m)||[];h.push(f),l.set(m,h)}})}let s=e.draftLocations_.get(t)??t0;for(let l of s)bn(a,l,n,i)}function r0(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!_n(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=Zo(i);ec(e,i.draft_??i,s,n),tc(i,a)})}function tc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}Js(e)}}function n0(e,t,n){let{scope_:o}=e;if(Ne(n)){let a=n[ne];_n(a,o)&&a.callbacks_.push(function(){hn(e);let s=Zo(a);ec(e,n,s,t)})}else de(n)&&e.callbacks_.push(function(){let i=Pe(e);e.type_===3?i.has(n)&&vn(n,o.handledSet_,o):Bo(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&vn(Bo(e.copy_,t,e.type_),o.handledSet_,o)})}function vn(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ne(e)||t.has(e)||!de(e)||Rn(e)||(t.add(e),En(e,(o,a)=>{if(Ne(a)){let i=a[ne];if(_n(i,n)){let s=Zo(i);bn(e,o,s,e.type_),Js(i)}}else de(a)&&vn(a,t,n)})),e}function o0(e,t){let n=Ln(e),o={type_:n?1:0,scope_:t?t.scope_:Qs(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Sn;n&&(a=[o],i=wr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Sn={get(e,t){if(t===ne)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=Pe(e);if(!Po(a,t,e.type_))return i0(e,a,t);let i=a[t];if(e.finalized_||!de(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Y4(t))return i;if(i===Uo(e.base_,t)||a0(e,t,i)){hn(e);let s=e.type_===1?+t:t,l=jo(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in Pe(e)},ownKeys(e){return Reflect.ownKeys(Pe(e))},set(e,t,n){let o=rc(Pe(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Uo(Pe(e),t),i=a?.[ne];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(q4(n,a)&&(n!==void 0||Po(e.base_,t,e.type_)))return!0;hn(e),Vo(e)}return e.copy_[t]===n&&(n!==void 0||Po(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),n0(e,t,n)),!0},deleteProperty(e,t){return hn(e),Uo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Vo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Pe(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[mn]:!0,[Fo]:e.type_!==1||t!=="length",[yn]:o[yn],[Rr]:n[t]}},defineProperty(){Le(11)},getPrototypeOf(e){return Zt(e.base_)},setPrototypeOf(){Le(12)}},wr={};for(let e in Sn){let t=Sn[e];wr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}wr.deleteProperty=function(e,t){return wr.set.call(this,e,t,void 0)};wr.set=function(e,t,n){return Sn.set.call(this,e[0],t,n,e[0])};function Uo(e,t){let n=e[ne];return(n?Pe(n):e)[t]}function a0(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!de(n)||n[ne]?!1:e.baseRefs_.has(n)}function i0(e,t,n){let o=rc(t,n);return o?Rr in o?o[Rr]:o.get?.call(e.draft_):void 0}function rc(e,t){if(!(t in e))return;let n=Zt(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Zt(n)}}function Vo(e){e.modified_||(e.modified_=!0,e.parent_&&Vo(e.parent_))}function hn(e){e.copy_||(e.assigned_=new Map,e.copy_=$o(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var s0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Kt(t)&&!Kt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,h=>n.call(this,h,...m))}}Kt(n)||Le(6),o!==void 0&&!Kt(o)&&Le(7);let a;if(de(t)){let i=js(this),s=jo(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?Ho(i):Wo(i)}return Vs(i,o),Ks(a,i)}else if(!t||!Ko(t)){if(a=n(t),a===void 0&&(a=t),a===qs&&(a=void 0),this.autoFreeze_&&qo(a,!0),o){let i=[],s=[];At(Go).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else Le(1,t)},this.produceWithPatches=(t,n)=>{if(Kt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Do(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Do(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Do(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){de(e)||Le(8),Ne(e)&&(e=nc(e));let t=js(this),n=jo(t,e,void 0);return n[ne].isManual_=!0,Wo(t),n}finishDraft(e,t){let n=e&&e[ne];(!n||!n.isManual_)&&Le(9);let{scope_:o}=n;return Vs(o,t),Ks(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=At(Go).applyPatches_;return Ne(e)?o(e,t):this.produce(e,a=>o(a,t))}};function jo(e,t,n,o){let[a,i]=An(t)?At(xn).proxyMap_(t,n):On(t)?At(xn).proxySet_(t,n):o0(t,n);return(n?.scope_??Qs()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?r0(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function nc(e){return Ne(e)||Le(10,e),oc(e)}function oc(e){if(!de(e)||Rn(e))return e;let t=e[ne],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$o(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=$o(e,!0);return En(n,(a,i)=>{bn(n,a,oc(i))},o),t&&(t.finalized_=!1),n}var c0=globalThis.Iterator,L6=typeof c0?.from=="function";var l0=new s0,Yo=l0.produce;function ac(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var ic=ac(),sc=ac;var d0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Or:Or.apply(null,arguments)},M6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},f0=e=>e&&typeof e.match=="function";function Xe(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(De(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>Bs(o)&&o.type===e,n}var uc=class Mr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Mr.prototype)}static get[Symbol.species](){return Mr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Mr(...t[0].concat(this)):new Mr(...t.concat(this))}};function cc(e){return de(e)?Yo(e,()=>{}):e}function wn(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function u0(e){return typeof e=="boolean"}var p0=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new uc;return n&&(u0(n)?s.push(ic):s.push(sc(n.extraArgument))),s},m0="RTK_autoBatch";var lc=e=>t=>{setTimeout(t,e)},h0=(e,t)=>n=>{let o=!1,a=()=>{o||(o=!0,cancelAnimationFrame(i),clearTimeout(s),n())},i=e(a),s=setTimeout(a,t)},g0=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?h0(window.requestAnimationFrame,100):lc(10):e.type==="callback"?e.queueNotification:lc(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(h=>h()))};return Object.assign({},o,{subscribe(h){let g=()=>a&&h(),b=o.subscribe(g);return l.add(h),()=>{b(),l.delete(h)}},dispatch(h){try{return a=!h?.meta?.[m0],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(h)}finally{a=!0}}})},y0=e=>function(n){let{autoBatch:o=!0}=n??{},a=new uc(e);return o&&a.push(g0(typeof o=="object"?o:void 0)),a};function pc(e){let t=p0(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(un(n))f=Us(n);else throw new Error(De(1));let m;typeof o=="function"?m=o(t):m=t();let h=Or;a&&(h=d0({trace:!1,...typeof a=="object"&&a}));let g=Fs(...m),b=y0(g),x=typeof l=="function"?l(b):b(),L=h(...x);return To(f,s,L)}function mc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(De(28));if(l in t)throw new Error(De(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function b0(e){return typeof e=="function"}function x0(e,t){let[n,o,a]=mc(t),i;if(b0(e))i=()=>cc(e());else{let l=cc(e);i=()=>l}function s(l=i(),f){let m=[n[f.type],...o.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[a]),m.reduce((h,g)=>{if(g)if(Ne(h)){let x=g(h,f);return x===void 0?h:x}else{if(de(h))return Yo(h,b=>g(b,f));{let b=g(h,f);if(b===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return h},l)}return s.getInitialState=i,s}var v0=(e,t)=>f0(e)?e.match(t):e(t);function S0(...e){return t=>e.some(n=>v0(n,t))}var C0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",E0=(e=21)=>{let t="",n=e;for(;n--;)t+=C0[Math.random()*64|0];return t},L0=["name","message","stack","code"],Xo=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},dc=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},A0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let n of L0)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},fc="External signal was aborted",O0=(()=>{function e(t,n,o){let a=Xe(t+"/fulfilled",(f,m,h,g)=>({payload:f,meta:{...g||{},arg:h,requestId:m,requestStatus:"fulfilled"}})),i=Xe(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...h||{},arg:m,requestId:f,requestStatus:"pending"}})),s=Xe(t+"/rejected",(f,m,h,g,b)=>({payload:g,error:(o&&o.serializeError||A0)(f||"Rejected"),meta:{...b||{},arg:h,requestId:m,rejectedWithValue:!!g,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function l(f,{signal:m}={}){return(h,g,b)=>{let x=o?.idGenerator?o.idGenerator(f):E0(),L=new AbortController,R,A;function N(_){A=_,L.abort()}m&&(m.aborted?N(fc):m.addEventListener("abort",()=>N(fc),{once:!0}));let T=(async function(){let _;try{let I=o?.condition?.(f,{getState:g,extra:b});if(_0(I)&&(I=await I),I===!1||L.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let B=new Promise((F,$)=>{R=()=>{$({name:"AbortError",message:A||"Aborted"})},L.signal.addEventListener("abort",R,{once:!0})});h(i(x,f,o?.getPendingMeta?.({requestId:x,arg:f},{getState:g,extra:b}))),_=await Promise.race([B,Promise.resolve(n(f,{dispatch:h,getState:g,extra:b,requestId:x,signal:L.signal,abort:N,rejectWithValue:((F,$)=>new Xo(F,$)),fulfillWithValue:((F,$)=>new dc(F,$))})).then(F=>{if(F instanceof Xo)throw F;return F instanceof dc?a(F.payload,x,f,F.meta):a(F,x,f)})])}catch(I){_=I instanceof Xo?s(null,x,f,I.payload,I.meta):s(I,x,f)}finally{R&&L.signal.removeEventListener("abort",R)}return o&&!o.dispatchConditionRejection&&s.match(_)&&_.meta.condition||h(_),_})();return Object.assign(T,{abort:N,requestId:x,arg:f,unwrap(){return T.then(R0)}})}}return Object.assign(l,{pending:i,rejected:s,fulfilled:a,settled:S0(s,a),typePrefix:t})}return e.withTypes=()=>e,e})();function R0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function _0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hc=Symbol.for("rtk-slice-createasyncthunk"),k6={[hc]:O0};function w0(e,t){return`${e}/${t}`}function N0({creators:e}={}){let t=e?.asyncThunk?.[hc];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(De(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(z0()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(_,k){let I=typeof _=="string"?_:_.type;if(!I)throw new Error(De(12));if(I in f.sliceCaseReducersByType)throw new Error(De(13));return f.sliceCaseReducersByType[I]=k,m},addMatcher(_,k){return f.sliceMatchers.push({matcher:_,reducer:k}),m},exposeAction(_,k){return f.actionCreators[_]=k,m},exposeCaseReducer(_,k){return f.sliceCaseReducersByName[_]=k,m}};l.forEach(_=>{let k=s[_],I={reducerName:_,type:w0(a,_),createNotation:typeof o.reducers=="function"};I0(k)?P0(I,k,m,t):k0(I,k,m)});function h(){let[_={},k=[],I=void 0]=typeof o.extraReducers=="function"?mc(o.extraReducers):[o.extraReducers],B={..._,...f.sliceCaseReducersByType};return x0(o.initialState,F=>{for(let $ in B)F.addCase($,B[$]);for(let $ of f.sliceMatchers)F.addMatcher($.matcher,$.reducer);for(let $ of k)F.addMatcher($.matcher,$.reducer);I&&F.addDefaultCase(I)})}let g=_=>_,b=new Map,x=new WeakMap,L;function R(_,k){return L||(L=h()),L(_,k)}function A(){return L||(L=h()),L.getInitialState()}function N(_,k=!1){function I(F){let $=F[_];return typeof $>"u"&&k&&($=wn(x,I,A)),$}function B(F=g){let $=wn(b,k,()=>new WeakMap);return wn($,F,()=>{let ot={};for(let[pe,at]of Object.entries(o.selectors??{}))ot[pe]=M0(at,F,()=>wn(x,F,A),k);return ot})}return{reducerPath:_,getSelectors:B,get selectors(){return B(I)},selectSlice:I}}let T={name:a,reducer:R,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:A,...N(i),injectInto(_,{reducerPath:k,...I}={}){let B=k??i;return _.inject({reducerPath:B,reducer:R},I),{...T,...N(B,!0)}}};return T}}function M0(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var gc=N0();function z0(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function k0({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!T0(o))throw new Error(De(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Xe(e,s):Xe(e))}function I0(e){return e._reducerDefinitionType==="asyncThunk"}function T0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function P0({type:e,reducerName:t},n,o,a){if(!a)throw new Error(De(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:h}=n,g=a(e,i,h);o.exposeAction(t,g),s&&o.addCase(g.fulfilled,s),l&&o.addCase(g.pending,l),f&&o.addCase(g.rejected,f),m&&o.addMatcher(g.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Nn,pending:l||Nn,rejected:f||Nn,settled:m||Nn})}function Nn(){}var yc="listener",bc="completed",xc="cancelled",I6=`task-${xc}`,T6=`task-${bc}`,P6=`${yc}-${xc}`,D6=`${yc}-${bc}`;var{assign:vc}=Object;var Qo="listenerMiddleware";var D0=vc(Xe(`${Qo}/add`),{withTypes:()=>D0}),U6=Xe(`${Qo}/removeAll`),U0=vc(Xe(`${Qo}/remove`),{withTypes:()=>U0});function De(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var F0=on(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),Mn=class extends F0(Object){};window.ftReduxStores||(window.ftReduxStores={});var Sc=class e extends Mn{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(dn(i))return i;if(a==null)return;let s=gc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=pc({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let h=Er(s.getInitialState());for(let g of m.keeping)h[g]=(f??h)[g];return h}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus)}constructor(t,n,o){super(),this.reduxSlice=t,this.reduxStore=n,this.isFtReduxStore=!0,this.commands=new an,this.injectInto=(i,s)=>this.reduxSlice.injectInto(i,s),this.selectSlice=i=>this.reduxSlice.selectSlice(i);let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let f=s,m=i[f];return m?(...h)=>{let g=m(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{let g=f,b=this.getState()[g];Wt(b,h)||this.setState({[g]:a(h)})}}}),this.eventBus=o??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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var zn=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var kn=O(D()),B0="ft-app-info",Ot=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Ot.eventName="authentication-change";var zr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};zr.eventName="ui-locale-changed";var $0={session:(e,t)=>{(0,kn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>P.dispatchEvent(new Ot(t.payload)),0))}},P=kn.FtReduxStore.get({name:B0,reducers:$0,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,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Cc=O(D()),In=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},m8=(0,Cc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(P)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>zn.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return In([(0,Jo.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),In([(0,Jo.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),In([ko({store:P.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),In([ko({store:P.name})],t.prototype,"uiLocale",void 0),t});var Ec;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Ec||(Ec={}));var Lc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Lc||(Lc={}));var Ac;(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"})(Ac||(Ac={}));var Oc;(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"})(Oc||(Oc={}));var Rc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Rc||(Rc={}));var _c;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(_c||(_c={}));var wc;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(wc||(wc={}));var Nc;(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"})(Nc||(Nc={}));var Mc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Mc||(Mc={}));var zc;(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"})(zc||(zc={}));var kc;(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"})(kc||(kc={}));var Ic;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Ic||(Ic={}));var Tc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Tc||(Tc={}));var Pc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Pc||(Pc={}));var Dc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Dc||(Dc={}));var Uc;(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"})(Uc||(Uc={}));var Fc;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Fc||(Fc={}));var Bc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Bc||(Bc={}));var $c;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($c||($c={}));var Gc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Gc||(Gc={}));var Hc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Hc||(Hc={}));var Wc;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Wc||(Wc={}));var Vc;(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"})(Vc||(Vc={}));var jc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(jc||(jc={}));var Kc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Kc||(Kc={}));var Zc;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Zc||(Zc={}));var qc;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(qc||(qc={}));var Y;(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"})(Y||(Y={}));var he;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(he||(he={}));var Yc;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Yc||(Yc={}));var Xc;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Xc||(Xc={}));var Qc;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Qc||(Qc={}));var Jc;(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"})(Jc||(Jc={}));var el;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(el||(el={}));var tl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(tl||(tl={}));var rl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(rl||(rl={}));var nl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(nl||(nl={}));var ol;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(ol||(ol={}));var al;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(al||(al={}));var il;(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"})(il||(il={}));var sl;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(sl||(sl={}));var G0={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN,Y.BEHAVIOR_DATA_USER],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function cl(e,t){return e===t||(G0[e]??[]).some(n=>cl(n,t))}function ll(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(o=>cl(o,t))}var Fn=O(D());var ea=O(D());var Rt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=P.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=P.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var qt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Rt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Rt.await()}};var fe=class extends qt{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ea.CacheRegistry,this.cache=t?a.commonCache:new ea.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var Tn=class extends fe{async listMySearches(){let{session:t}=P.getState();return ll(t,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Pn=class extends fe{async listMyBookmarks(){let t=P.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Dn=class extends fe{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=P.getState().session;return!!t?.sessionAuthenticated}};var Un=class extends fe{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=P.getState().session;return!!t?.sessionAuthenticated}};var H0="ft-user-assets",W0={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(he).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ra(e,n,[...ta(e,n),a]),dl(e,n,1,o),fl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ra(e,n,ta(e,n).map(a=>a.id===o.id?o:a)),fl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ra(e,n,ta(e,n).filter(i=>i.id!==a)),dl(e,n,-1,o)}},ul={[he.SEARCHES]:"savedSearches",[he.BOOKMARKS]:"bookmarks",[he.BOOKS]:void 0,[he.COLLECTIONS]:void 0},ta=(e,t)=>{var n;let o=ul[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ra=(e,t,n)=>{let o=ul[t];o&&(e[o]=n)},dl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===he.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},fl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},oe=Fn.FtReduxStore.get({name:H0,reducers:W0,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(he).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),na=class{constructor(t=new Dn,n=new Un){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Pn,this.savedSearchesService=new Tn,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=P.getState();(0,Fn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),oe.actions.clearAssetCount(),oe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),oe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),oe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();oe.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();oe.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&oe.getState().assetCounts.allAsset[t]!==n.count&&oe.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&oe.getState().assetCounts.bookmarkByMap[t]!==n.count&&oe.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(oe.getState().assetCounts.bookmarkByMap).length!==0;t===he.BOOKMARKS&&n&&oe.actions.clearBookmarkCountByMap(),oe.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 n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;oe.actions.bookmarks(n)}}},V0=new na;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=V0);var oa=class{addCommand(t,n=!1){P.commands.add(t,n)}consumeCommand(t){return P.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new oa;var ge=O(D());var pl,Yt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},j0=Symbol("clearAfterUnitTest"),Bn=class extends(0,ge.withEventBus)(fe){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[pl]=()=>{this.defaultMessages={},this.cache=new ge.CacheRegistry,this.listeners={}},this.currentUiLocale=P.getState().uiLocale,P.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=P.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,ge.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new ge.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof ge.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Yt({loadedContexts:t})),this.dispatchEvent(new Yt({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new Yt({loadedContexts:[t]})),this.dispatchEvent(new Yt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ge.delay)(0).then(()=>o()).catch(()=>null)))}};pl=j0;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Bn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Bn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var kr=window.FluidTopicsI18nService,aa=window.FluidTopicsCustomI18nService;var ml=O(D()),ia=class{highlightHtml(t,n,o){(0,ml.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ia;var hl=O(D());var sa=class{isDate(t){var n,o,a,i;return(i=(a=((o=(n=P.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&o!==void 0?o:[]).find(l=>l.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return hl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:P.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new sa;var gl=O(D());var Ir=class{static get(t,n){var o,a,i,s;let l=P.getState(),{lang:f,region:m}=(i=(a=(o=l.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales)===null||a===void 0?void 0:a.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new gl.SearchPlaceConverter(l.baseUrl,t??20,(s=l.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,n??`${f}-${m}`)}};var ca=class{urlToSearchRequest(t){return Ir.get().parse(t)}searchRequestToUrl(t){return Ir.get().serialize(t)}};window.FluidTopicsUrlService=new ca;var Ue=O(D());var _t=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};_t.eventName="before-location-change";var wt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};wt.eventName="change";var la=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},yl=new la;var $n=class e extends Ue.WithEventBus{static build(){return new e(window.history,yl,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Ue.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new wt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new _t(new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin));this.dispatchEvent(f);let m=n(),h={...m===this.currentIndex?this.currentState:void 0,...i,index:m,href:f.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!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 n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addBeforeLocationChangeListener(t){this.addEventListener(_t.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(_t.eventName,t)}addHistoryChangeListener(t){this.addEventListener(wt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(wt.eventName,t)}currentItem(){return(0,Ue.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,Ue.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ue.deepCopy)(n.find(o=>t(o)))}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,Ue.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 n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$n.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var bl=O(X());var xl=bl.css`
346
+ `;var Qi=["top","right","bottom","left"],Xi=["start","end"],Ao=Qi.reduce((e,t)=>e.concat(t,t+"-"+Xi[0],t+"-"+Xi[1]),[]),gr=Math.min,Ke=Math.max,yr=Math.round;var _e=e=>({x:e,y:e}),S4={left:"right",right:"left",bottom:"top",top:"bottom"};function Ji(e,t,n){return Ke(e,gr(t,n))}function Yr(e,t){return typeof e=="function"?e(t):e}function br(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function Oo(e){return e==="x"?"y":"x"}function Ro(e){return e==="y"?"height":"width"}function Xr(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function _o(e){return Oo(Xr(e))}function es(e,t,n){n===void 0&&(n=!1);let o=Ze(e),a=_o(e),i=Ro(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Lo(s)),[s,Lo(s)]}function ts(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}function Lo(e){let t=br(e);return S4[t]+e.slice(t.length)}function C4(e){var t,n,o,a;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(o=e.bottom)!=null?o:0,left:(a=e.left)!=null?a:0}}function rs(e){return typeof e!="number"?C4(e):{top:e,right:e,bottom:e,left:e}}function vt(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function ns(e,t,n){let{reference:o,floating:a}=e,i=Xr(t),s=_o(t),l=Ro(s),f=br(t),m=i==="y",h=o.x+o.width/2-a.width/2,g=o.y+o.height/2-a.height/2,b=o[l]/2-a[l]/2,x;switch(f){case"top":x={x:h,y:o.y-a.height};break;case"bottom":x={x:h,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:g};break;case"left":x={x:o.x-a.width,y:g};break;default:x={x:o.x,y:o.y}}let L=Ze(t);return L&&(x[s]+=b*(L==="end"?1:-1)*(n&&m?-1:1)),x}async function os(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:i,rects:s,elements:l,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:b=!1,padding:x=0}=Yr(t,e),L=rs(x),A=l[b?g==="floating"?"reference":"floating":g],N=vt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(A)))==null||n?A:A.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:m,rootBoundary:h,strategy:f})),T=g==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},I=vt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:T,offsetParent:_,strategy:f}):T);return{top:(N.top-I.top+L.top)/k.y,bottom:(I.bottom-N.bottom+L.bottom)/k.y,left:(N.left-I.left+L.left)/k.x,right:(I.right-N.right+L.right)/k.x}}var E4=50,as=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:i=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:os},f=await(s.isRTL==null?void 0:s.isRTL(t)),m=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:g}=ns(m,o,f),b=o,x=0,L={};for(let R=0;R<i.length;R++){let A=i[R];if(!A)continue;let{name:N,fn:T}=A,{x:_,y:k,data:I,reset:B}=await T({x:h,y:g,initialPlacement:o,placement:b,strategy:a,middlewareData:L,rects:m,platform:l,elements:{reference:e,floating:t}});h=_??h,g=k??g,L[N]={...L[N],...I},B&&x<E4&&(x++,typeof B=="object"&&(B.placement&&(b=B.placement),B.rects&&(m=B.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):B.rects),{x:h,y:g}=ns(m,b,f)),R=-1)}return{x:h,y:g,placement:b,strategy:a,middlewareData:L}};function L4(e,t,n){return(e?[...n.filter(a=>Ze(a)===e),...n.filter(a=>Ze(a)!==e)]:n.filter(a=>br(a)===a)).filter(a=>e?Ze(a)===e||(t?ts(a)!==a:!1):!0)}var is=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,a;let{rects:i,middlewareData:s,placement:l,platform:f,elements:m}=t,{crossAxis:h=!1,alignment:g,allowedPlacements:b=Ao,autoAlignment:x=!0,...L}=Yr(e,t),R=g!==void 0||b===Ao?L4(g||null,x,b):b,A=((n=s.autoPlacement)==null?void 0:n.index)||0,N=R[A];if(N==null)return{};if(l!==N)return{reset:{placement:R[0]}};let T=await f.detectOverflow(t,L),_=es(N,i,await(f.isRTL==null?void 0:f.isRTL(m.floating))),k=[T[br(N)],T[_[0]],T[_[1]]],I=[...((o=s.autoPlacement)==null?void 0:o.overflows)||[],{placement:N,overflows:k}],B=R[A+1];if(B)return{data:{index:A+1,overflows:I},reset:{placement:B}};let F=I.map(pe=>{let at=Ze(pe.placement);return[pe.placement,at&&h?pe.overflows.slice(0,2).reduce((c4,l4)=>c4+l4,0):pe.overflows[0],pe.overflows]}).sort((pe,at)=>pe[1]-at[1]),ot=((a=F.filter(pe=>pe[2].slice(0,Ze(pe[0])?2:3).every(at=>at<=0))[0])==null?void 0:a[0])||F[0][0];return ot!==l?{data:{index:A+1,overflows:I},reset:{placement:ot}}:{}}}};var ss=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:f={fn:T=>{let{x:_,y:k}=T;return{x:_,y:k}}},...m}=Yr(e,t),h={x:n,y:o},g=await i.detectOverflow(t,m),b=Xr(a),x=Oo(b),L=h[x],R=h[b],A=(T,_)=>Ji(_+g[T==="y"?"top":"left"],_,_-g[T==="y"?"bottom":"right"]);s&&(L=A(x,L)),l&&(R=A(b,R));let N=f.fn({...t,[x]:L,[b]:R});return{...N,data:{x:N.x-n,y:N.y-o,enabled:{[x]:s,[b]:l}}}}}};function Jr(){return typeof window<"u"}function Ct(e){return ls(e)?(e.nodeName||"").toLowerCase():"#document"}function ce(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ie(e){var t;return(t=(ls(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ls(e){return Jr()?e instanceof Node||e instanceof ce(e).Node:!1}function Ce(e){return Jr()?e instanceof Element||e instanceof ce(e).Element:!1}function Te(e){return Jr()?e instanceof HTMLElement||e instanceof ce(e).HTMLElement:!1}function cs(e){return!Jr()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ce(e).ShadowRoot}function xr(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=Ee(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&a!=="inline"&&a!=="contents"}function ds(e){return/^(table|td|th)$/.test(Ct(e))}function vr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}var A4=/transform|translate|scale|rotate|perspective|filter/,O4=/paint|layout|strict|content/,St=e=>!!e&&e!=="none",wo;function $t(e){let t=Ce(e)?Ee(e):e;return St(t.transform)||St(t.translate)||St(t.scale)||St(t.rotate)||St(t.perspective)||!en()&&(St(t.backdropFilter)||St(t.filter))||A4.test(t.willChange||"")||O4.test(t.contain||"")}function fs(e){let t=qe(e);for(;Te(t)&&!Gt(t);){if($t(t))return t;if(vr(t))return null;t=qe(t)}return null}function en(){return wo==null&&(wo=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wo}function Gt(e){return/^(html|body|#document)$/.test(Ct(e))}function Ee(e){return ce(e).getComputedStyle(e)}function Sr(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function qe(e){if(Ct(e)==="html")return e;let t=e.assignedSlot||e.parentNode||cs(e)&&e.host||Ie(e);return cs(t)?t.host:t}function us(e){let t=qe(e);return Gt(t)?(e.ownerDocument||e).body:Te(t)&&xr(t)?t:us(t)}function Qr(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=us(e),i=a===((o=e.ownerDocument)==null?void 0:o.body),s=ce(a);if(i){let l=tn(s);return t.concat(s,s.visualViewport||[],xr(a)?a:[],l&&n?Qr(l):[])}else return t.concat(a,Qr(a,[],n))}function tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function hs(e){let t=Ee(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=Te(e),i=a?e.offsetWidth:n,s=a?e.offsetHeight:o,l=yr(n)!==i||yr(o)!==s;return l&&(n=i,o=s),{width:n,height:o,$:l}}function gs(e){return Ce(e)?e:e.contextElement}function Ht(e){let t=gs(e);if(!Te(t))return _e(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:i}=hs(t),s=(i?yr(n.width):n.width)/o,l=(i?yr(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var R4=_e(0);function ys(e){let t=ce(e);return!en()||!t.visualViewport?R4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ce(e)}function Cr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),i=gs(e),s=_e(1);t&&(o?Ce(o)&&(s=Ht(o)):s=Ht(e));let l=_4(i,n,o)?ys(i):_e(0),f=(a.left+l.x)/s.x,m=(a.top+l.y)/s.y,h=a.width/s.x,g=a.height/s.y;if(i&&o){let b=ce(i),x=Ce(o)?ce(o):o,L=b,R=tn(L);for(;R&&x!==L;){let A=Ht(R),N=R.getBoundingClientRect(),T=Ee(R),_=N.left+(R.clientLeft+parseFloat(T.paddingLeft))*A.x,k=N.top+(R.clientTop+parseFloat(T.paddingTop))*A.y;f*=A.x,m*=A.y,h*=A.x,g*=A.y,f+=_,m+=k,L=ce(R),R=tn(L)}}return vt({width:h,height:g,x:f,y:m})}function rn(e,t){let n=Sr(e).scrollLeft;return t?t.left+n:Cr(Ie(e)).left+n}function bs(e,t){let n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-rn(e,n),a=n.top+t.scrollTop;return{x:o,y:a}}function w4(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,i=a==="fixed",s=Ie(o),l=t?vr(t.floating):!1;if(o===s||l&&i)return n;let f={scrollLeft:0,scrollTop:0},m=_e(1),h=_e(0),g=Te(o);if((g||!i)&&((Ct(o)!=="body"||xr(s))&&(f=Sr(o)),g)){let x=Cr(o);m=Ht(o),h.x=x.x+o.clientLeft,h.y=x.y+o.clientTop}let b=s&&!g&&!i?bs(s,f):_e(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+h.x+b.x,y:n.y*m.y-f.scrollTop*m.y+h.y+b.y}}function N4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function M4(e){let t=Sr(e),n=e.ownerDocument.body,o=Ke(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),a=Ke(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+rn(e),s=-t.scrollTop;return Ee(n).direction==="rtl"&&(i+=Ke(e.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}var z4=25;function k4(e,t,n){n===void 0&&(n="viewport");let o=n==="layoutViewport",a=ce(e),i=Ie(e),s=a.visualViewport,l=i.clientWidth,f=i.clientHeight,m=0,h=0;if(s){let b=!en()||t==="fixed";o?b||(m=-s.offsetLeft,h=-s.offsetTop):(l=s.width,f=s.height,b&&(m=s.offsetLeft,h=s.offsetTop))}if(rn(i)<=0){let b=i.ownerDocument,x=b.body,L=getComputedStyle(x),R=b.compatMode==="CSS1Compat"&&parseFloat(L.marginLeft)+parseFloat(L.marginRight)||0,A=Math.abs(i.clientWidth-x.clientWidth-R),N=getComputedStyle(i).scrollbarGutter==="stable both-edges"?A/2:A;N<=z4&&(l-=N)}return{width:l,height:f,x:m,y:h}}function I4(e,t){let n=Cr(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,i=Ht(e),s=e.clientWidth*i.x,l=e.clientHeight*i.y,f=a*i.x,m=o*i.y;return{width:s,height:l,x:f,y:m}}function ps(e,t,n){let o;if(t==="viewport"||t==="layoutViewport")o=k4(e,n,t);else if(t==="document")o=M4(Ie(e));else if(Ce(t))o=I4(t,n);else{let a=ys(e);o={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return vt(o)}function T4(e,t){let n=t.get(e);if(n)return n;let o=Qr(e,[],!1).filter(l=>Ce(l)&&Ct(l)!=="body"),a=null,i=Ee(e).position==="fixed",s=i?qe(e):e;for(;Ce(s)&&!Gt(s);){let l=Ee(s),f=$t(s),m=a?a.position:i?"fixed":"";!f&&(m==="fixed"||m==="absolute"&&l.position==="static")?o=o.filter(g=>g!==s):a=l,s=qe(s)}return t.set(e,o),o}function P4(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,s=[...n==="clippingAncestors"?vr(t)?[]:T4(t,this._c):[].concat(n),o],l=ps(t,s[0],a),f=l.top,m=l.right,h=l.bottom,g=l.left;for(let b=1;b<s.length;b++){let x=ps(t,s[b],a);f=Ke(x.top,f),m=gr(x.right,m),h=gr(x.bottom,h),g=Ke(x.left,g)}return{width:m-g,height:h-f,x:g,y:f}}function D4(e){let{width:t,height:n}=hs(e);return{width:t,height:n}}function U4(e,t,n){let o=Te(t),a=Ie(t),i=n==="fixed",s=Cr(e,!0,i,t),l={scrollLeft:0,scrollTop:0},f=_e(0);if((o||!i)&&((Ct(t)!=="body"||xr(a))&&(l=Sr(t)),o)){let b=Cr(t,!0,i,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}!o&&a&&(f.x=rn(a));let m=a&&!o&&!i?bs(a,l):_e(0),h=s.left+l.scrollLeft-f.x-m.x,g=s.top+l.scrollTop-f.y-m.y;return{x:h,y:g,width:s.width,height:s.height}}function No(e){return Ee(e).position==="static"}function ms(e,t){if(!Te(e)||Ee(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ie(e)===n&&(n=n.ownerDocument.body),n}function xs(e,t){let n=ce(e);if(vr(e))return n;if(!Te(e)){let a=qe(e);for(;a&&!Gt(a);){if(Ce(a)&&!No(a))return a;a=qe(a)}return n}let o=ms(e,t);for(;o&&ds(o)&&No(o);)o=ms(o,t);return o&&Gt(o)&&No(o)&&!$t(o)?n:o||fs(e)||n}var F4=async function(e){let t=this.getOffsetParent||xs,n=this.getDimensions,o=await n(e.floating);return{reference:U4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function B4(e){return Ee(e).direction==="rtl"}var nn={convertOffsetParentRelativeRectToViewportRelativeRect:w4,getDocumentElement:Ie,getClippingRect:P4,getOffsetParent:xs,getElementRects:F4,getClientRects:N4,getDimensions:D4,getScale:Ht,isElement:Ce,isRTL:B4};var vs=is,Ss=ss;var Cs=(e,t,n)=>{let o=new Map,a=n??{},i={...nn,...a.platform,_c:o};return as(e,t,{...a,platform:i})};function Es(e){return $4(e)}function Mo(e){return e.assignedSlot?e.assignedSlot:e.parentNode instanceof ShadowRoot?e.parentNode.host:e.parentNode}function $4(e){for(let t=e;t;t=Mo(t))if(t instanceof Element&&getComputedStyle(t).display==="none")return null;for(let t=Mo(e);t;t=Mo(t)){if(!(t instanceof Element))continue;let n=getComputedStyle(t);if(n.display!=="contents"&&(n.position!=="static"||$t(n)||t.tagName==="BODY"))return t}return null}async function Ls(e,t,n){let o;return typeof n=="object"?o=n:o={placement:n},Cs(e,t,{strategy:o.strategy,platform:{...nn,getOffsetParent:a=>nn.getOffsetParent(a,Es)},middleware:[Ss({crossAxis:!0}),vs({allowedPlacements:[o.placement]})]})}var Qt=O(D());var Jo=O(ie());var As=O(ie(),1);var zo=e=>t=>{window.customElements.get(e)||window.customElements.define(e,t)};function Os(e,t){return(0,As.property)({type:Object,converter:{fromAttribute:n=>{if(n==null)return Er(e);try{return JSON.parse(n)}catch{return Er(e)}},toAttribute:n=>JSON.stringify(n)},hasChanged:Lr,...t??{}})}function G4(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let n,o;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Wt(e[o],t[o]))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!Wt(o[1],t.get(o[0])))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[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 a=s=>Object.keys(s).filter(l=>s[l]!=null),i=a(e);if(n=i.length,n!==a(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){let s=i[o];if(!Wt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t||e==null&&t==null}function Wt(e,t){try{return G4(e,t)}catch{return!1}}function Lr(e,t){return!Wt(e,t)}function Er(e){return typeof window.structuredClone=="function"?structuredClone(e):e!=null?JSON.parse(JSON.stringify(e)):e}function on(e,t){let n=o=>o[e]===!0;return o=>{if(n(o))return o;let a=t(o);return a[e]=!0,a}}var Rs=O(ie(),1);var ko=e=>{let t=e??{};return(n,o)=>{var a;let i={hasChanged:Lr,attribute:!1,...t};(0,Rs.property)(i)(n,o);let s=n.constructor;s.reduxProperties=new Map(s.reduxProperties),s.reduxProperties.set(o,{selector:(a=t.selector)!==null&&a!==void 0?a:(l=>l[o]),store:t.store})}};var an=class{constructor(){this.queue=[]}add(t,n=!1){n&&this.clear(t.type),this.queue.push(t)}consume(t){let n=this.queue.find(o=>o.type===t);return n&&(this.queue=this.queue.filter(o=>o!==n)),n}clear(t){typeof t=="string"?this.queue=this.queue.filter(n=>n.type!==t):this.queue=this.queue.filter(n=>!t.test(n.type))}};var Et=O(ie(),1);var sn=class{constructor(t=0){this.timeout=t,this.callbacks=[]}run(t,n){return this.callbacks=[t],this.debounce(n)}queue(t,n){return this.callbacks.push(t),this.debounce(n)}cancel(){this.clearTimeout(),this.resolvePromise&&this.resolvePromise(!1),this.clearPromise()}debounce(t){return this.promise==null&&(this.promise=new Promise((n,o)=>{this.resolvePromise=n,this.rejectPromise=o})),this.clearTimeout(),this._debounce=window.setTimeout(()=>this.runCallbacks(),t??this.timeout),this.promise}async runCallbacks(){var t,n;let o=[...this.callbacks];this.callbacks=[];let a=(t=this.rejectPromise)!==null&&t!==void 0?t:(()=>null),i=(n=this.resolvePromise)!==null&&n!==void 0?n:(()=>null);this.clearPromise();for(let s of o)try{await s()}catch(l){a(l);return}i(!0)}clearTimeout(){this._debounce!=null&&window.clearTimeout(this._debounce)}clearPromise(){this.promise=void 0,this.resolvePromise=void 0,this.rejectPromise=void 0}};var ws=O(X(),1);var cn=globalThis,H4=cn.ShadowRoot&&(cn.ShadyCSS===void 0||cn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype;var _s=(e,t)=>{if(H4)e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet);else for(let n of t){let o=document.createElement("style"),a=cn.litNonce;a!==void 0&&o.setAttribute("nonce",a),o.textContent=n.cssText,e.appendChild(o)}};var ln=class extends ws.LitElement{get scopedRegistryConstructor(){return this.constructor}createRenderRoot(){let t=this.scopedRegistryConstructor;t.elementDefinitions&&!t.registry&&(t.registry=new CustomElementRegistry,t.defineScopedElements(t.elementDefinitions));let n={...t.shadowRootOptions,customElements:t.registry},o=this.renderOptions.creationScope=this.attachShadow(n);return _s(o,t.elementStyles),o}static canDefineScopedElement(t){return!!this.registry&&!this.registry.get(t)}static defineScopedElements(t){Object.entries(t).forEach(([n,o])=>this.defineScopedElement(n,o))}static defineScopedElement(t,n){zo(t)(n),this.canDefineScopedElement(t)&&this.registry.define(t,n)}canDefineScopedElement(t){return this.scopedRegistryConstructor.canDefineScopedElement(t)}defineScopedElements(t){this.scopedRegistryConstructor.defineScopedElements(t)}defineScopedElement(t,n){this.scopedRegistryConstructor.defineScopedElement(t,n)}};function Ns(e,t,...n){var o;let a=e.querySelector(t);for(let i of n)a=(o=a?.shadowRoot)===null||o===void 0?void 0:o.querySelector(i);return a}var jt=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Is,Ms=Symbol("constructorPrototype"),zs=Symbol("constructorName"),Ts=Symbol("exportpartsDebouncer"),ks=Symbol("dynamicDependenciesLoaded"),Vt=class e extends CustomEvent{constructor(){super(e.eventName,{bubbles:!0})}};Vt.eventName="exportparts-updated";var we=class extends ln{constructor(){super(),this.useAdoptedStyleSheets=!0,this.adoptedCustomStyleSheet=new CSSStyleSheet,this[Is]=new sn(5),this.scheduleExportpartsUpdate=()=>{var t,n,o;(!((t=this.exportpartsPrefix)===null||t===void 0)&&t.trim()||(o=(n=this.exportpartsPrefixes)===null||n===void 0?void 0:n.length)!==null&&o!==void 0&&o)&&this[Ts].run(()=>{var a,i;!((a=this.exportpartsPrefix)===null||a===void 0)&&a.trim()?this.setExportpartsAttribute([this.exportpartsPrefix]):this.exportpartsPrefixes!=null&&((i=this.exportpartsPrefixes)===null||i===void 0?void 0:i.length)>0&&this.setExportpartsAttribute(this.exportpartsPrefixes)})},this[zs]=this.constructor.name,this[Ms]=this.constructor.prototype}adoptedCallback(){this.constructor.name!==this[zs]&&Object.setPrototypeOf(this,this[Ms])}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(o){this.useAdoptedStyleSheets=!1,console.error("Cannot use adopted stylesheets",o)}let n=this.constructor;n[ks]||(n[ks]=!0,this.importDynamicDependencies()),(t=this.shadowRoot)===null||t===void 0||t.addEventListener(Vt.eventName,this.scheduleExportpartsUpdate)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.shadowRoot)===null||t===void 0||t.removeEventListener(Vt.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 Vt)})}contentAvailableCallback(t){}focusElementToFocus(t){if(t.has("elementToFocus")&&this.elementToFocus!=null){let{element:n,selector:o,shadowPath:a}=this.elementToFocus;if(o!=null){let i=[...a??[],o];n=Ns(this.shadowRoot,...i)}n?.focus(),window.FluidTopicsA11yHints.isKeyboardNavigation||n?.blur(),this.elementToFocus=void 0}}applyCustomStylesheet(t){var n,o,a;if(((o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll(".ft-lit-element--custom-stylesheet"))!==null&&o!==void 0?o:[]).forEach(i=>i.remove()),this.useAdoptedStyleSheets){if(t.has("customStylesheet"))try{this.adoptedCustomStyleSheet.replaceSync((a=this.customStylesheet)!==null&&a!==void 0?a:"")}catch(i){console.error(i,this.customStylesheet),this.useAdoptedStyleSheets=!1}}else if(this.customStylesheet){let i=document.createElement("style");i.classList.add("ft-lit-element--custom-stylesheet"),i.innerHTML=this.customStylesheet,this.shadowRoot.append(i)}}setExportpartsAttribute(t){var n,o,a,i,s,l;let f=b=>b!=null&&b.trim().length>0,m=t.filter(f).map(b=>b.trim());if(m.length===0){this.exportparts=void 0;return}let h=new Set;for(let b of(o=(n=this.shadowRoot)===null||n===void 0?void 0:n.querySelectorAll("[part],[exportparts]"))!==null&&o!==void 0?o:[]){let x=(i=(a=b.getAttribute("part"))===null||a===void 0?void 0:a.split(" "))!==null&&i!==void 0?i:[],L=(l=(s=b.getAttribute("exportparts"))===null||s===void 0?void 0:s.split(",").map(A=>A.split(":")[1]))!==null&&l!==void 0?l:[],R=[...x,...L].filter(f).map(A=>A.trim());for(let A of R)h.add(A)}if(h.size===0){this.exportparts=void 0;return}let g=[...h.values()].flatMap(b=>m.map(x=>`${b}:${x}--${b}`));this.exportparts=[...this.part,...g].join(", ")}};Is=Ts;jt([(0,Et.property)()],we.prototype,"exportpartsPrefix",void 0);jt([Os([])],we.prototype,"exportpartsPrefixes",void 0);jt([(0,Et.property)({reflect:!0})],we.prototype,"exportparts",void 0);jt([(0,Et.property)()],we.prototype,"customStylesheet",void 0);jt([(0,Et.property)()],we.prototype,"elementToFocus",void 0);jt([(0,Et.state)()],we.prototype,"useAdoptedStyleSheets",void 0);function dn(e){var t;return(t=e?.isFtReduxStore)!==null&&t!==void 0?t:!1}var Ar=Symbol("internalReduxEventsUnsubscribers"),Ye=Symbol("internalStoresUnsubscribers"),Lt=Symbol("internalStores"),W4=on(Symbol("withRedux"),function(e){var t,n,o;class a extends e{constructor(){super(...arguments),this[t]=new Map,this[n]=new Map,this[o]=new Map}get reduxConstructor(){return this.constructor}willUpdate(s){super.willUpdate(s),[...this.reduxConstructor.reduxReactiveProperties].some(l=>s.has(l))&&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,l){var f;l=(f=l??s.name)!==null&&f!==void 0?f:"default-store",this.unsubscribeFromStore(l),this[Lt].set(l,s),this.subscribeToStore(l,s),this.updateFromStores()}removeStore(s){let l=typeof s=="string"?s:s.name;this.unsubscribeFromStore(l),this[Lt].delete(l)}setupStores(){this.unsubscribeFromStores(),this[Lt].forEach((s,l)=>this.subscribeToStore(l,s)),this.updateFromStores()}updateFromStores(){this.reduxConstructor.reduxProperties.forEach((s,l)=>{let f=this.constructor.getPropertyOptions(l);if(!f?.attribute||!this.hasAttribute(typeof f?.attribute=="string"?f.attribute:l)){let m=this.getStore(s.store);m&&(s.store?this[Ye].has(s.store):this[Ye].size>0)&&(this[l]=s.selector(m.getState(),this))}})}subscribeToStore(s,l){var f;this[Ye].set(s,l.subscribe(()=>this.updateFromStores())),this[Ar].set(s,[]),dn(l)&&l.eventBus&&((f=this.reduxConstructor.reduxEventListeners)===null||f===void 0||f.forEach((m,h)=>{if(typeof this[h]=="function"&&(!m.store||l.name===m.store)){let g=b=>this[h](b);l.addEventListener(m.eventName,g),this[Ar].get(s).push(()=>l.removeEventListener(m.eventName,g))}})),this.onStoreAvailable(s)}unsubscribeFromStores(){this[Ye].forEach((s,l)=>this.unsubscribeFromStore(l))}unsubscribeFromStore(s){var l;this[Ye].has(s)&&this[Ye].get(s)(),this[Ye].delete(s),(l=this[Ar].get(s))===null||l===void 0||l.forEach(f=>f()),this[Ar].delete(s)}onStoreAvailable(s){}connectedCallback(){super.connectedCallback(),this.setupStores()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeFromStores()}}return t=Ye,n=Lt,o=Ar,a.reduxProperties=new Map,a.reduxReactiveProperties=new Set,a.reduxEventListeners=new Map,a}),Ps=class extends W4(we){};function te(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 V4=typeof Symbol=="function"&&Symbol.observable||"@@observable",Ds=V4,Io=()=>Math.random().toString(36).substring(7).split("").join("."),j4={INIT:`@@redux/INIT${Io()}`,REPLACE:`@@redux/REPLACE${Io()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Io()}`},fn=j4;function un(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function To(e,t,n){if(typeof e!="function")throw new Error(te(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(te(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(te(1));return n(To)(e,t)}let o=e,a=t,i=new Map,s=i,l=0,f=!1;function m(){s===i&&(s=new Map,i.forEach((A,N)=>{s.set(N,A)}))}function h(){if(f)throw new Error(te(3));return a}function g(A){if(typeof A!="function")throw new Error(te(4));if(f)throw new Error(te(5));let N=!0;m();let T=l++;return s.set(T,A),function(){if(N){if(f)throw new Error(te(6));N=!1,m(),s.delete(T),i=null}}}function b(A){if(!un(A))throw new Error(te(7));if(typeof A.type>"u")throw new Error(te(8));if(typeof A.type!="string")throw new Error(te(17));if(f)throw new Error(te(9));try{f=!0,a=o(a,A)}finally{f=!1}return(i=s).forEach(T=>{T()}),A}function x(A){if(typeof A!="function")throw new Error(te(10));o=A,b({type:fn.REPLACE})}function L(){let A=g;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(te(11));function T(){let k=N;k.next&&k.next(h())}return T(),{unsubscribe:A(T)}},[Ds](){return this}}}return b({type:fn.INIT}),{dispatch:b,subscribe:g,getState:h,replaceReducer:x,[Ds]:L}}function K4(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:fn.INIT})>"u")throw new Error(te(12));if(typeof n(void 0,{type:fn.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(te(13))})}function Us(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let l=t[s];typeof e[l]=="function"&&(n[l]=e[l])}let o=Object.keys(n),a,i;try{K4(n)}catch(s){i=s}return function(l={},f){if(i)throw i;let m=!1,h={};for(let g=0;g<o.length;g++){let b=o[g],x=n[b],L=l[b],R=x(L,f);if(typeof R>"u"){let A=f&&f.type;throw new Error(te(14))}h[b]=R,m=m||R!==L}return m=m||o.length!==Object.keys(l).length,m?h:l}}function Or(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...o)=>t(n(...o)))}function Fs(...e){return t=>(n,o)=>{let a=t(n,o),i=()=>{throw new Error(te(15))},s={getState:a.getState,dispatch:(f,...m)=>i(f,...m)},l=e.map(f=>f(s));return i=Or(...l)(a.dispatch),{...a,dispatch:i}}}function Bs(e){return un(e)&&"type"in e&&typeof e.type=="string"}var qs=Symbol.for("immer-nothing"),$s=Symbol.for("immer-draftable"),ne=Symbol.for("immer-state");function Le(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var le=Object,Zt=le.getPrototypeOf,gn="constructor",Cn="prototype",Fo="configurable",yn="enumerable",mn="writable",Rr="value",Ne=e=>!!e&&!!e[ne];function de(e){return e?Ys(e)||Ln(e)||!!e[$s]||!!e[gn]?.[$s]||An(e)||On(e):!1}var Z4=le[Cn][gn].toString(),Gs=new WeakMap;function Ys(e){if(!e||!Ko(e))return!1;let t=Zt(e);if(t===null||t===le[Cn])return!0;let n=le.hasOwnProperty.call(t,gn)&&t[gn];if(n===Object)return!0;if(!Kt(n))return!1;let o=Gs.get(n);return o===void 0&&(o=Function.toString.call(n),Gs.set(n,o)),o===Z4}function En(e,t,n=!0){Nr(e)===0?(n?Reflect.ownKeys(e):le.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((o,a)=>t(a,o,e))}function Nr(e){let t=e[ne];return t?t.type_:Ln(e)?1:An(e)?2:On(e)?3:0}var Po=(e,t,n=Nr(e))=>n===2?e.has(t):le[Cn].hasOwnProperty.call(e,t),Bo=(e,t,n=Nr(e))=>n===2?e.get(t):e[t],bn=(e,t,n,o=Nr(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function q4(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Ln=Array.isArray,An=e=>e instanceof Map,On=e=>e instanceof Set,Ko=e=>typeof e=="object",Kt=e=>typeof e=="function",Do=e=>typeof e=="boolean";function Y4(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Pe=e=>e.copy_||e.base_;var Zo=e=>e.modified_?e.copy_:e.base_;function $o(e,t){if(An(e))return new Map(e);if(On(e))return new Set(e);if(Ln(e))return Array[Cn].slice.call(e);let n=Ys(e);if(t===!0||t==="class_only"&&!n){let o=le.getOwnPropertyDescriptors(e);delete o[ne];let a=Reflect.ownKeys(o);for(let i=0;i<a.length;i++){let s=a[i],l=o[s];l[mn]===!1&&(l[mn]=!0,l[Fo]=!0),(l.get||l.set)&&(o[s]={[Fo]:!0,[mn]:!0,[yn]:l[yn],[Rr]:e[s]})}return le.create(Zt(e),o)}else{let o=Zt(e);if(o!==null&&n)return{...e};let a=le.create(o);return le.assign(a,e)}}function qo(e,t=!1){return Rn(e)||Ne(e)||!de(e)||(Nr(e)>1&&le.defineProperties(e,{set:pn,add:pn,clear:pn,delete:pn}),le.freeze(e),t&&En(e,(n,o)=>{qo(o,!0)},!1)),e}function X4(){Le(2)}var pn={[Rr]:X4};function Rn(e){return e===null||!Ko(e)?!0:le.isFrozen(e)}var xn="MapSet",Go="Patches",Hs="ArrayMethods",Xs={};function At(e){let t=Xs[e];return t||Le(0,e),t}var Ws=e=>!!Xs[e];var _r,Qs=()=>_r,Q4=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Ws(xn)?At(xn):void 0,arrayMethodsPlugin_:Ws(Hs)?At(Hs):void 0});function Vs(e,t){t&&(e.patchPlugin_=At(Go),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Ho(e){Wo(e),e.drafts_.forEach(J4),e.drafts_=null}function Wo(e){e===_r&&(_r=e.parent_)}var js=e=>_r=Q4(_r,e);function J4(e){let t=e[ne];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ks(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[ne].modified_&&(Ho(t),Le(4)),de(e)&&(e=Zs(t,e));let{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(n[ne].base_,e,t)}else e=Zs(t,n);return e0(t,e,!0),Ho(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==qs?e:void 0}function Zs(e,t){if(Rn(t))return t;let n=t[ne];if(!n)return vn(t,e.handledSet_,e);if(!_n(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);tc(n,e)}return n.copy_}function e0(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&qo(t,n)}function Js(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var _n=(e,t)=>e.scope_===t,t0=[];function ec(e,t,n,o){let a=Pe(e),i=e.type_;if(o!==void 0&&Bo(a,o,i)===t){bn(a,o,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;En(a,(f,m)=>{if(Ne(m)){let h=l.get(m)||[];h.push(f),l.set(m,h)}})}let s=e.draftLocations_.get(t)??t0;for(let l of s)bn(a,l,n,i)}function r0(e,t,n){e.callbacks_.push(function(a){let i=t;if(!i||!_n(i,a))return;a.mapSetPlugin_?.fixSetContents(i);let s=Zo(i);ec(e,i.draft_??i,s,n),tc(i,a)})}function tc(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){let{patchPlugin_:o}=t;if(o){let a=o.getPath(e);a&&o.generatePatches_(e,a,t)}Js(e)}}function n0(e,t,n){let{scope_:o}=e;if(Ne(n)){let a=n[ne];_n(a,o)&&a.callbacks_.push(function(){hn(e);let s=Zo(a);ec(e,n,s,t)})}else de(n)&&e.callbacks_.push(function(){let i=Pe(e);e.type_===3?i.has(n)&&vn(n,o.handledSet_,o):Bo(i,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&vn(Bo(e.copy_,t,e.type_),o.handledSet_,o)})}function vn(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ne(e)||t.has(e)||!de(e)||Rn(e)||(t.add(e),En(e,(o,a)=>{if(Ne(a)){let i=a[ne];if(_n(i,n)){let s=Zo(i);bn(e,o,s,e.type_),Js(i)}}else de(a)&&vn(a,t,n)})),e}function o0(e,t){let n=Ln(e),o={type_:n?1:0,scope_:t?t.scope_:Qs(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},a=o,i=Sn;n&&(a=[o],i=wr);let{revoke:s,proxy:l}=Proxy.revocable(a,i);return o.draft_=l,o.revoke_=s,[l,o]}var Sn={get(e,t){if(t===ne)return e;let n=e.scope_.arrayMethodsPlugin_,o=e.type_===1&&typeof t=="string";if(o&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let a=Pe(e);if(!Po(a,t,e.type_))return i0(e,a,t);let i=a[t];if(e.finalized_||!de(i)||o&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Y4(t))return i;if(i===Uo(e.base_,t)||a0(e,t,i)){hn(e);let s=e.type_===1?+t:t,l=jo(e.scope_,i,e,s);return e.copy_[s]=l}return i},has(e,t){return t in Pe(e)},ownKeys(e){return Reflect.ownKeys(Pe(e))},set(e,t,n){let o=rc(Pe(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){let a=Uo(Pe(e),t),i=a?.[ne];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(q4(n,a)&&(n!==void 0||Po(e.base_,t,e.type_)))return!0;hn(e),Vo(e)}return e.copy_[t]===n&&(n!==void 0||Po(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),n0(e,t,n)),!0},deleteProperty(e,t){return hn(e),Uo(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Vo(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Pe(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[mn]:!0,[Fo]:e.type_!==1||t!=="length",[yn]:o[yn],[Rr]:n[t]}},defineProperty(){Le(11)},getPrototypeOf(e){return Zt(e.base_)},setPrototypeOf(){Le(12)}},wr={};for(let e in Sn){let t=Sn[e];wr[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}wr.deleteProperty=function(e,t){return wr.set.call(this,e,t,void 0)};wr.set=function(e,t,n){return Sn.set.call(this,e[0],t,n,e[0])};function Uo(e,t){let n=e[ne];return(n?Pe(n):e)[t]}function a0(e,t,n){return e.type_!==1||!e.allIndicesReassigned_||e.assigned_?.get(t)||!de(n)||n[ne]?!1:e.baseRefs_.has(n)}function i0(e,t,n){let o=rc(t,n);return o?Rr in o?o[Rr]:o.get?.call(e.draft_):void 0}function rc(e,t){if(!(t in e))return;let n=Zt(e);for(;n;){let o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Zt(n)}}function Vo(e){e.modified_||(e.modified_=!0,e.parent_&&Vo(e.parent_))}function hn(e){e.copy_||(e.assigned_=new Map,e.copy_=$o(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var s0=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(Kt(t)&&!Kt(n)){let i=n;n=t;let s=this;return function(f=i,...m){return s.produce(f,h=>n.call(this,h,...m))}}Kt(n)||Le(6),o!==void 0&&!Kt(o)&&Le(7);let a;if(de(t)){let i=js(this),s=jo(i,t,void 0),l=!0;try{a=n(s),l=!1}finally{l?Ho(i):Wo(i)}return Vs(i,o),Ks(a,i)}else if(!t||!Ko(t)){if(a=n(t),a===void 0&&(a=t),a===qs&&(a=void 0),this.autoFreeze_&&qo(a,!0),o){let i=[],s=[];At(Go).generateReplacementPatches_(t,a,{patches_:i,inversePatches_:s}),o(i,s)}return a}else Le(1,t)},this.produceWithPatches=(t,n)=>{if(Kt(t))return(s,...l)=>this.produceWithPatches(s,f=>t(f,...l));let o,a;return[this.produce(t,n,(s,l)=>{o=s,a=l}),o,a]},Do(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Do(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Do(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){de(e)||Le(8),Ne(e)&&(e=nc(e));let t=js(this),n=jo(t,e,void 0);return n[ne].isManual_=!0,Wo(t),n}finishDraft(e,t){let n=e&&e[ne];(!n||!n.isManual_)&&Le(9);let{scope_:o}=n;return Vs(o,t),Ks(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let a=t[n];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}n>-1&&(t=t.slice(n+1));let o=At(Go).applyPatches_;return Ne(e)?o(e,t):this.produce(e,a=>o(a,t))}};function jo(e,t,n,o){let[a,i]=An(t)?At(xn).proxyMap_(t,n):On(t)?At(xn).proxySet_(t,n):o0(t,n);return(n?.scope_??Qs()).drafts_.push(a),i.callbacks_=n?.callbacks_??[],i.key_=o,n&&o!==void 0?r0(n,i,o):i.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(i);let{patchPlugin_:m}=f;i.modified_&&m&&m.generatePatches_(i,[],f)}),a}function nc(e){return Ne(e)||Le(10,e),oc(e)}function oc(e){if(!de(e)||Rn(e))return e;let t=e[ne],n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=$o(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=$o(e,!0);return En(n,(a,i)=>{bn(n,a,oc(i))},o),t&&(t.finalized_=!1),n}var c0=globalThis.Iterator,L6=typeof c0?.from=="function";var l0=new s0,Yo=l0.produce;function ac(e){return({dispatch:n,getState:o})=>a=>i=>typeof i=="function"?i(n,o,e):a(i)}var ic=ac(),sc=ac;var d0=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Or:Or.apply(null,arguments)},M6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},f0=e=>e&&typeof e.match=="function";function Xe(e,t){function n(...o){if(t){let a=t(...o);if(!a)throw new Error(De(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:o[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=o=>Bs(o)&&o.type===e,n}var uc=class Mr extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Mr.prototype)}static get[Symbol.species](){return Mr}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Mr(...t[0].concat(this)):new Mr(...t.concat(this))}};function cc(e){return de(e)?Yo(e,()=>{}):e}function wn(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function u0(e){return typeof e=="boolean"}var p0=()=>function(t){let{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:i=!0}=t??{},s=new uc;return n&&(u0(n)?s.push(ic):s.push(sc(n.extraArgument))),s},m0="RTK_autoBatch";var lc=e=>t=>{setTimeout(t,e)},h0=(e,t)=>n=>{let o=!1,a=()=>{o||(o=!0,cancelAnimationFrame(i),clearTimeout(s),n())},i=e(a),s=setTimeout(a,t)},g0=(e={type:"raf"})=>t=>(...n)=>{let o=t(...n),a=!0,i=!1,s=!1,l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?h0(window.requestAnimationFrame,100):lc(10):e.type==="callback"?e.queueNotification:lc(e.timeout),m=()=>{s=!1,i&&(i=!1,l.forEach(h=>h()))};return Object.assign({},o,{subscribe(h){let g=()=>a&&h(),b=o.subscribe(g);return l.add(h),()=>{b(),l.delete(h)}},dispatch(h){try{return a=!h?.meta?.[m0],i=!a,i&&(s||(s=!0,f(m))),o.dispatch(h)}finally{a=!0}}})},y0=e=>function(n){let{autoBatch:o=!0}=n??{},a=new uc(e);return o&&a.push(g0(typeof o=="object"?o:void 0)),a};function pc(e){let t=p0(),{reducer:n=void 0,middleware:o,devTools:a=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:l=void 0}=e||{},f;if(typeof n=="function")f=n;else if(un(n))f=Us(n);else throw new Error(De(1));let m;typeof o=="function"?m=o(t):m=t();let h=Or;a&&(h=d0({trace:!1,...typeof a=="object"&&a}));let g=Fs(...m),b=y0(g),x=typeof l=="function"?l(b):b(),L=h(...x);return To(f,s,L)}function mc(e){let t={},n=[],o,a={addCase(i,s){let l=typeof i=="string"?i:i.type;if(!l)throw new Error(De(28));if(l in t)throw new Error(De(29));return t[l]=s,a},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),a},addMatcher(i,s){return n.push({matcher:i,reducer:s}),a},addDefaultCase(i){return o=i,a}};return e(a),[t,n,o]}function b0(e){return typeof e=="function"}function x0(e,t){let[n,o,a]=mc(t),i;if(b0(e))i=()=>cc(e());else{let l=cc(e);i=()=>l}function s(l=i(),f){let m=[n[f.type],...o.filter(({matcher:h})=>h(f)).map(({reducer:h})=>h)];return m.filter(h=>!!h).length===0&&(m=[a]),m.reduce((h,g)=>{if(g)if(Ne(h)){let x=g(h,f);return x===void 0?h:x}else{if(de(h))return Yo(h,b=>g(b,f));{let b=g(h,f);if(b===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return b}}return h},l)}return s.getInitialState=i,s}var v0=(e,t)=>f0(e)?e.match(t):e(t);function S0(...e){return t=>e.some(n=>v0(n,t))}var C0="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",E0=(e=21)=>{let t="",n=e;for(;n--;)t+=C0[Math.random()*64|0];return t},L0=["name","message","stack","code"],Xo=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},dc=class{constructor(e,t){this.payload=e,this.meta=t}payload;meta;_type},A0=e=>{if(typeof e=="object"&&e!==null){let t={};for(let n of L0)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},fc="External signal was aborted",O0=(()=>{function e(t,n,o){let a=Xe(t+"/fulfilled",(f,m,h,g)=>({payload:f,meta:{...g||{},arg:h,requestId:m,requestStatus:"fulfilled"}})),i=Xe(t+"/pending",(f,m,h)=>({payload:void 0,meta:{...h||{},arg:m,requestId:f,requestStatus:"pending"}})),s=Xe(t+"/rejected",(f,m,h,g,b)=>({payload:g,error:(o&&o.serializeError||A0)(f||"Rejected"),meta:{...b||{},arg:h,requestId:m,rejectedWithValue:!!g,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function l(f,{signal:m}={}){return(h,g,b)=>{let x=o?.idGenerator?o.idGenerator(f):E0(),L=new AbortController,R,A;function N(_){A=_,L.abort()}m&&(m.aborted?N(fc):m.addEventListener("abort",()=>N(fc),{once:!0}));let T=(async function(){let _;try{let I=o?.condition?.(f,{getState:g,extra:b});if(_0(I)&&(I=await I),I===!1||L.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let B=new Promise((F,$)=>{R=()=>{$({name:"AbortError",message:A||"Aborted"})},L.signal.addEventListener("abort",R,{once:!0})});h(i(x,f,o?.getPendingMeta?.({requestId:x,arg:f},{getState:g,extra:b}))),_=await Promise.race([B,Promise.resolve(n(f,{dispatch:h,getState:g,extra:b,requestId:x,signal:L.signal,abort:N,rejectWithValue:((F,$)=>new Xo(F,$)),fulfillWithValue:((F,$)=>new dc(F,$))})).then(F=>{if(F instanceof Xo)throw F;return F instanceof dc?a(F.payload,x,f,F.meta):a(F,x,f)})])}catch(I){_=I instanceof Xo?s(null,x,f,I.payload,I.meta):s(I,x,f)}finally{R&&L.signal.removeEventListener("abort",R)}return o&&!o.dispatchConditionRejection&&s.match(_)&&_.meta.condition||h(_),_})();return Object.assign(T,{abort:N,requestId:x,arg:f,unwrap(){return T.then(R0)}})}}return Object.assign(l,{pending:i,rejected:s,fulfilled:a,settled:S0(s,a),typePrefix:t})}return e.withTypes=()=>e,e})();function R0(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function _0(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var hc=Symbol.for("rtk-slice-createasyncthunk"),k6={[hc]:O0};function w0(e,t){return`${e}/${t}`}function N0({creators:e}={}){let t=e?.asyncThunk?.[hc];return function(o){let{name:a,reducerPath:i=a}=o;if(!a)throw new Error(De(11));typeof process<"u";let s=(typeof o.reducers=="function"?o.reducers(z0()):o.reducers)||{},l=Object.keys(s),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},m={addCase(_,k){let I=typeof _=="string"?_:_.type;if(!I)throw new Error(De(12));if(I in f.sliceCaseReducersByType)throw new Error(De(13));return f.sliceCaseReducersByType[I]=k,m},addMatcher(_,k){return f.sliceMatchers.push({matcher:_,reducer:k}),m},exposeAction(_,k){return f.actionCreators[_]=k,m},exposeCaseReducer(_,k){return f.sliceCaseReducersByName[_]=k,m}};l.forEach(_=>{let k=s[_],I={reducerName:_,type:w0(a,_),createNotation:typeof o.reducers=="function"};I0(k)?P0(I,k,m,t):k0(I,k,m)});function h(){let[_={},k=[],I=void 0]=typeof o.extraReducers=="function"?mc(o.extraReducers):[o.extraReducers],B={..._,...f.sliceCaseReducersByType};return x0(o.initialState,F=>{for(let $ in B)F.addCase($,B[$]);for(let $ of f.sliceMatchers)F.addMatcher($.matcher,$.reducer);for(let $ of k)F.addMatcher($.matcher,$.reducer);I&&F.addDefaultCase(I)})}let g=_=>_,b=new Map,x=new WeakMap,L;function R(_,k){return L||(L=h()),L(_,k)}function A(){return L||(L=h()),L.getInitialState()}function N(_,k=!1){function I(F){let $=F[_];return typeof $>"u"&&k&&($=wn(x,I,A)),$}function B(F=g){let $=wn(b,k,()=>new WeakMap);return wn($,F,()=>{let ot={};for(let[pe,at]of Object.entries(o.selectors??{}))ot[pe]=M0(at,F,()=>wn(x,F,A),k);return ot})}return{reducerPath:_,getSelectors:B,get selectors(){return B(I)},selectSlice:I}}let T={name:a,reducer:R,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:A,...N(i),injectInto(_,{reducerPath:k,...I}={}){let B=k??i;return _.inject({reducerPath:B,reducer:R},I),{...T,...N(B,!0)}}};return T}}function M0(e,t,n,o){function a(i,...s){let l=t(i);return typeof l>"u"&&o&&(l=n()),e(l,...s)}return a.unwrapped=e,a}var gc=N0();function z0(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function k0({type:e,reducerName:t,createNotation:n},o,a){let i,s;if("reducer"in o){if(n&&!T0(o))throw new Error(De(17));i=o.reducer,s=o.prepare}else i=o;a.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Xe(e,s):Xe(e))}function I0(e){return e._reducerDefinitionType==="asyncThunk"}function T0(e){return e._reducerDefinitionType==="reducerWithPrepare"}function P0({type:e,reducerName:t},n,o,a){if(!a)throw new Error(De(18));let{payloadCreator:i,fulfilled:s,pending:l,rejected:f,settled:m,options:h}=n,g=a(e,i,h);o.exposeAction(t,g),s&&o.addCase(g.fulfilled,s),l&&o.addCase(g.pending,l),f&&o.addCase(g.rejected,f),m&&o.addMatcher(g.settled,m),o.exposeCaseReducer(t,{fulfilled:s||Nn,pending:l||Nn,rejected:f||Nn,settled:m||Nn})}function Nn(){}var yc="listener",bc="completed",xc="cancelled",I6=`task-${xc}`,T6=`task-${bc}`,P6=`${yc}-${xc}`,D6=`${yc}-${bc}`;var{assign:vc}=Object;var Qo="listenerMiddleware";var D0=vc(Xe(`${Qo}/add`),{withTypes:()=>D0}),U6=Xe(`${Qo}/removeAll`),U0=vc(Xe(`${Qo}/remove`),{withTypes:()=>U0});function De(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var F0=on(Symbol("withEventBus"),function(e,t){return class extends e{constructor(){super(...arguments),this.eventBus=t??document.createElement("span")}addEventListener(n,o,a){this.eventBus.addEventListener(n,o,a)}dispatchEvent(n){return this.eventBus.dispatchEvent(n)}removeEventListener(n,o,a){this.eventBus.removeEventListener(n,o,a)}}}),Mn=class extends F0(Object){};window.ftReduxStores||(window.ftReduxStores={});var Sc=class e extends Mn{static get(t){var n;let o=typeof t=="string"?t:t.name,a=typeof t=="string"?void 0:t,i=window.ftReduxStores[o];if(dn(i))return i;if(a==null)return;let s=gc({...a,reducers:(n=a.reducers)!==null&&n!==void 0?n:{}}),l=pc({reducer:(f,m)=>{if(m.type==="CLEAR_FT_REDUX_STORE"){let h=Er(s.getInitialState());for(let g of m.keeping)h[g]=(f??h)[g];return h}else if(typeof m.type=="string"&&m.type.startsWith("DEFAULT_VALUE_SETTER__"))return{...f,...m.overwrites};return s.reducer(f,m)}});return window.ftReduxStores[a.name]=new e(s,l,a.eventBus)}constructor(t,n,o){super(),this.reduxSlice=t,this.reduxStore=n,this.isFtReduxStore=!0,this.commands=new an,this.injectInto=(i,s)=>this.reduxSlice.injectInto(i,s),this.selectSlice=i=>this.reduxSlice.selectSlice(i);let a=i=>i!=null?JSON.parse(JSON.stringify(i)):i;this.actions=new Proxy(this.reduxSlice.actions,{get:(i,s,l)=>{let f=s,m=i[f];return m?(...h)=>{let g=m(...h.map(a));return this.reduxStore.dispatch(g),g}:h=>{let g=f,b=this.getState()[g];Wt(b,h)||this.setState({[g]:a(h)})}}}),this.eventBus=o??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()}get selectors(){return this.reduxSlice.selectors}get reducerPath(){return this.reduxSlice.reducerPath}getSelectors(){return this.reduxSlice.getSelectors()}};var zn=class{static format(t,n,o,a,i){return window.moment?window.moment(t).locale(n).format(this.getMomentDateFormat(o,a,!!i)):this.getIntlDateTime(t,n,o,a,!!i)}static getMomentDateFormat(t,n,o){return o?"LT":t?n?"lll":"ll":n?"L LT":"L"}static getIntlDateTime(t,n,o,a,i){let s=typeof t=="string"?new Date(t):t,l=new Intl.DateTimeFormat(n,{dateStyle:o?"medium":"short"}).format(s),f=new Intl.DateTimeFormat(n,{timeStyle:"short"}).format(s);return i?f:a?`${l} ${f}`:l}static getTimezoneAsString(){let t=o=>String(Math.floor(o)).padStart(2,"0"),n=new Date().getTimezoneOffset();return`${n<0?"+":"-"}${t(Math.abs(n)/60)}:${t(Math.abs(n)%60)}`}};var kn=O(D()),B0="ft-app-info",Ot=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};Ot.eventName="authentication-change";var zr=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:t})}};zr.eventName="ui-locale-changed";var $0={session:(e,t)=>{(0,kn.deepEqual)(e.session,t.payload)||(e.session=t.payload,setTimeout(()=>P.dispatchEvent(new Ot(t.payload)),0))}},P=kn.FtReduxStore.get({name:B0,reducers:$0,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,noCustomCode:!1,session:void 0,openExternalDocumentInNewTab:!1,navigatorOnline:!0,forcedOffline:!1,authenticationRequired:!1,stickyFilters:void 0}});var Cc=O(D()),In=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},m8=(0,Cc.applyMixinOnce)(Symbol("withDateFormat"),function(e){class t extends e{constructor(...o){super(o),this.useLongDateFormat=!1,this.useDateTimeFormat=!1,this.metadataDescriptors=[],this.uiLocale="en-US",this.addStore(P)}dateFormatOptionsChanged(o){return o.has("metadataDescriptors")||o.has("useLongDateFormat")||o.has("useDateTimeFormat")||o.has("uiLocale")}getDateFormatter(o){var a,i;return((i=(a=this.metadataDescriptors.find(l=>l.key===o))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1)?l=>zn.format(l,this.uiLocale,this.useLongDateFormat,this.useDateTimeFormat):void 0}}return In([(0,Jo.property)({type:Boolean})],t.prototype,"useLongDateFormat",void 0),In([(0,Jo.property)({type:Boolean})],t.prototype,"useDateTimeFormat",void 0),In([ko({store:P.name,selector:n=>{var o,a;return(a=(o=n.metadataConfiguration)===null||o===void 0?void 0:o.descriptors)!==null&&a!==void 0?a:[]}})],t.prototype,"metadataDescriptors",void 0),In([ko({store:P.name})],t.prototype,"uiLocale",void 0),t});var Ec;(function(e){e.black="black",e.green="green",e.blue="blue",e.purple="purple",e.red="red",e.orange="orange",e.yellow="yellow"})(Ec||(Ec={}));var Lc;(function(e){e.OFFICIAL="OFFICIAL",e.PERSONAL="PERSONAL",e.SHARED="SHARED"})(Lc||(Lc={}));var Ac;(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"})(Ac||(Ac={}));var Oc;(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"})(Oc||(Oc={}));var Rc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(Rc||(Rc={}));var _c;(function(e){e.VALUE="VALUE",e.DATE="DATE",e.RANGE="RANGE"})(_c||(_c={}));var wc;(function(e){e.OFFICIAL="OFFICIAL",e.AI="AI"})(wc||(wc={}));var Nc;(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"})(Nc||(Nc={}));var Mc;(function(e){e.STANDARD="STANDARD",e.STRUCTURAL="STRUCTURAL"})(Mc||(Mc={}));var zc;(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"})(zc||(zc={}));var kc;(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"})(kc||(kc={}));var Ic;(function(e){e.CLASSIC="CLASSIC",e.CUSTOM="CUSTOM",e.DESIGNER="DESIGNER"})(Ic||(Ic={}));var Tc;(function(e){e.AND="AND",e.OR="OR",e.MONOVALUED="MONOVALUED"})(Tc||(Tc={}));var Pc;(function(e){e.NONE="NONE",e.ALPHABET="ALPHABET",e.VERSION="VERSION"})(Pc||(Pc={}));var Dc;(function(e){e.STARS="STARS",e.LIKE="LIKE",e.DICHOTOMOUS="DICHOTOMOUS",e.NO_RATING="NO_RATING"})(Dc||(Dc={}));var Uc;(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"})(Uc||(Uc={}));var Fc;(function(e){e.OPTIONAL="OPTIONAL",e.MANDATORY="MANDATORY"})(Fc||(Fc={}));var Bc;(function(e){e.ASC="ASC",e.DESC="DESC"})(Bc||(Bc={}));var $c;(function(e){e.ALPHA="ALPHA",e.NATURAL="NATURAL"})($c||($c={}));var Gc;(function(e){e.EVERYWHERE="EVERYWHERE",e.TITLE_ONLY="TITLE_ONLY",e.NONE="NONE"})(Gc||(Gc={}));var Hc;(function(e){e.ARTICLE="ARTICLE",e.BOOK="BOOK",e.SHARED_BOOK="SHARED_BOOK",e.HTML_PACKAGE="HTML_PACKAGE"})(Hc||(Hc={}));var Wc;(function(e){e.FLUIDTOPICS="FLUIDTOPICS",e.EXTERNAL="EXTERNAL"})(Wc||(Wc={}));var Vc;(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"})(Vc||(Vc={}));var jc;(function(e){e.LAST_WEEK="LAST_WEEK",e.LAST_MONTH="LAST_MONTH",e.LAST_QUARTER="LAST_QUARTER",e.LAST_YEAR="LAST_YEAR"})(jc||(jc={}));var Kc;(function(e){e.MAP="MAP",e.DOCUMENT="DOCUMENT",e.TOPIC="TOPIC",e.HTML_PACKAGE="HTML_PACKAGE",e.HTML_PACKAGE_PAGE="HTML_PACKAGE_PAGE"})(Kc||(Kc={}));var Zc;(function(e){e.DEFAULT="DEFAULT",e.DOCUMENTS="DOCUMENTS",e.ALL_TOPICS="ALL_TOPICS",e.TOPICS_AND_UNSTRUCTURED_DOCUMENTS="TOPICS_AND_UNSTRUCTURED_DOCUMENTS"})(Zc||(Zc={}));var qc;(function(e){e.PLAIN_TEXT="PLAIN_TEXT",e.LOCALIZED_OFFICIAL="LOCALIZED_OFFICIAL",e.LOCALIZED_CUSTOM="LOCALIZED_CUSTOM"})(qc||(qc={}));var Y;(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"})(Y||(Y={}));var he;(function(e){e.SEARCHES="SEARCHES",e.BOOKMARKS="BOOKMARKS",e.BOOKS="BOOKS",e.COLLECTIONS="COLLECTIONS"})(he||(he={}));var Yc;(function(e){e.UNAUTHENTICATED="UNAUTHENTICATED",e.USER_INCOMPLETE="USER_INCOMPLETE",e.MFA_REQUIRED="MFA_REQUIRED",e.AUTHENTICATED="AUTHENTICATED"})(Yc||(Yc={}));var Xc;(function(e){e.UNREACHABLE="UNREACHABLE",e.UNAUTHORIZED="UNAUTHORIZED",e.FORBIDDEN="FORBIDDEN",e.INCOMPATIBLE="INCOMPATIBLE",e.FAILED="FAILED",e.OK="OK"})(Xc||(Xc={}));var Qc;(function(e){e.VALID="VALID",e.INVALID="INVALID"})(Qc||(Qc={}));var Jc;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.SEMANTIC_SEARCH="SEMANTIC_SEARCH",e.CHATBOT_INSTRUCTIONS="CHATBOT_INSTRUCTIONS",e.DOCUMENTATION="DOCUMENTATION",e.OTHER="OTHER"})(Jc||(Jc={}));var el;(function(e){e.INACCURATE="INACCURATE",e.INCOMPLETE="INCOMPLETE",e.OFF_TOPIC="OFF_TOPIC",e.IRRELEVANT_SOURCES="IRRELEVANT_SOURCES",e.SLOW="SLOW",e.OTHER="OTHER"})(el||(el={}));var tl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(tl||(tl={}));var rl;(function(e){e.JSON="JSON",e.TEXT="TEXT"})(rl||(rl={}));var nl;(function(e){e.TEXT="TEXT",e.HTML="HTML"})(nl||(nl={}));var ol;(function(e){e.IN_PROGRESS="IN_PROGRESS",e.ERROR="ERROR",e.DONE="DONE"})(ol||(ol={}));var al;(function(e){e.HTML="HTML",e.MARKDOWN="MARKDOWN"})(al||(al={}));var il;(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"})(il||(il={}));var sl;(function(e){e.MAP="MAP",e.UNSTRUCTURED_DOCUMENT="UNSTRUCTURED_DOCUMENT"})(sl||(sl={}));var G0={[Y.PERSONAL_BOOK_SHARE_USER]:[Y.PERSONAL_BOOK_USER],[Y.HTML_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.PDF_EXPORT_USER]:[Y.PERSONAL_BOOK_USER],[Y.KHUB_ADMIN]:[Y.CONTENT_PUBLISHER],[Y.ADMIN]:[Y.KHUB_ADMIN,Y.USERS_ADMIN,Y.PORTAL_ADMIN,Y.BEHAVIOR_DATA_USER],[Y.GENERATIVE_AI_EXPORT_USER]:[Y.GENERATIVE_AI_USER]};function cl(e,t){return e===t||(G0[e]??[]).some(n=>cl(n,t))}function ll(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(o=>cl(o,t))}var Fn=O(D());var ea=O(D());var Rt=class e{static get(t){let{baseUrl:n,apiIntegrationIdentifier:o}=P.getState(),a=t??o;if(n&&a&&window.fluidtopics)return new window.fluidtopics.FluidTopicsApi(n,a,!0)}static await(t){return new Promise(n=>{let o=e.get(t);if(o)n(o);else{let a=P.subscribe(()=>{o=e.get(t),o&&(a(),n(o))})}})}};var qt=class{constructor(t){this.overrideApi=t}get api(){var t;return(t=this.overrideApi)!==null&&t!==void 0?t:Rt.get()}get awaitApi(){return this.overrideApi?Promise.resolve(this.overrideApi):Rt.await()}};var fe=class extends qt{constructor(t=!0,n){var o;super(n),this.sortObjectFields=(i,s)=>typeof s!="object"||s==null||Array.isArray(s)?s:Object.fromEntries(Object.entries(s).sort(([l],[f])=>l.localeCompare(f)));let a=this.constructor;a.commonCache=(o=a.commonCache)!==null&&o!==void 0?o:new ea.CacheRegistry,this.cache=t?a.commonCache:new ea.CacheRegistry}clearCache(){this.cache.clearAll()}hash(t){return String(Array.from(JSON.stringify(t,this.sortObjectFields)).reduce((n,o)=>0|31*n+o.charCodeAt(0),0))}};var Tn=class extends fe{async listMySearches(){let{session:t}=P.getState();return ll(t,Y.SAVED_SEARCH_USER)?this.cache.get("my-searches",async()=>(await this.awaitApi).listMySearches(t.profile.userId),300*1e3):[]}};var Pn=class extends fe{async listMyBookmarks(){let t=P.getState().session;return t?.sessionAuthenticated?this.cache.get("my-bookmarks",async()=>(await this.awaitApi).listMyBookmarks(t.profile.userId),300*1e3):[]}};var Dn=class extends fe{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=P.getState().session;return!!t?.sessionAuthenticated}};var Un=class extends fe{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=P.getState().session;return!!t?.sessionAuthenticated}};var H0="ft-user-assets",W0={setAssetCount:(e,t)=>{let{userAssetType:n,count:o}=t.payload.assetCount;e.assetCounts.allAsset[n]=o},clearAssetCount:e=>{Object.values(he).forEach(t=>{e.assetCounts.allAsset[t]=void 0})},setBookmarkCountByMap:(e,t)=>{let n=t.payload.mapId;e.assetCounts.bookmarkByMap[n]=t.payload.count},clearBookmarkCountByMap:e=>{e.assetCounts.bookmarkByMap={}},addAsset:(e,t)=>{let{assetType:n,mapId:o,asset:a}=t.payload;ra(e,n,[...ta(e,n),a]),dl(e,n,1,o),fl(e,a)},editAsset:(e,t)=>{let{assetType:n,asset:o}=t.payload;ra(e,n,ta(e,n).map(a=>a.id===o.id?o:a)),fl(e,o)},removeAsset:(e,t)=>{let{assetType:n,mapId:o,assetId:a}=t.payload;ra(e,n,ta(e,n).filter(i=>i.id!==a)),dl(e,n,-1,o)}},ul={[he.SEARCHES]:"savedSearches",[he.BOOKMARKS]:"bookmarks",[he.BOOKS]:void 0,[he.COLLECTIONS]:void 0},ta=(e,t)=>{var n;let o=ul[t];return o?(n=e[o])!==null&&n!==void 0?n:[]:[]},ra=(e,t,n)=>{let o=ul[t];o&&(e[o]=n)},dl=(e,t,n,o)=>{let a=e.assetCounts.allAsset[t];if(a!==void 0&&(e.assetCounts.allAsset[t]=Math.max(0,a+n),t===he.BOOKMARKS&&o)){let i=e.assetCounts.bookmarkByMap[o];e.assetCounts.bookmarkByMap[o]=Math.max(0,i+n)}},fl=(e,t)=>{let n=e.assetLabels.map(a=>a.title),o=t.labels.filter(a=>!n.includes(a)).map(a=>({title:a}));e.assetLabels.push(...o)},oe=Fn.FtReduxStore.get({name:H0,reducers:W0,initialState:{savedSearches:void 0,bookmarks:void 0,assetCounts:{allAsset:Object.fromEntries(Object.values(he).map(e=>[e,void 0])),bookmarkByMap:{}},assetLabels:[]}}),na=class{constructor(t=new Dn,n=new Un){this.assetCountsService=t,this.assetLabelsService=n,this.currentSession=P.getState().session,this.bookmarksAreUsed=!1,this.bookmarksService=new Pn,this.savedSearchesService=new Tn,P.subscribe(()=>this.reloadWhenUserSessionChanges())}reloadWhenUserSessionChanges(){var t;let{session:n}=P.getState();(0,Fn.deepEqual)((t=this.currentSession)===null||t===void 0?void 0:t.profile,n?.profile)||(this.currentSession=n,this.clearMySearches(),this.reloadBookmarks(),this.clearUserAssetCounts(),this.reloadAssetLabels())}clearUserAssetCounts(){this.assetCountsService.clearCache(),oe.actions.clearAssetCount(),oe.actions.clearBookmarkCountByMap()}clear(){this.clearMySearches(),this.clearMyBookmarks()}clearMySearches(){this.savedSearchesService.clearCache(),oe.actions.savedSearches(void 0)}clearMyBookmarks(){this.bookmarksService.clearCache(),oe.actions.bookmarks(void 0)}async reloadMySearches(){this.savedSearchesService.clearCache();let t=await this.savedSearchesService.listMySearches();oe.actions.savedSearches(t)}async reloadBookmarks(){this.bookmarksService.clearCache(),await this.updateBookmarksIfUsed()}async reloadAssetLabels(){this.assetLabelsService.clearCache();let t=await this.assetLabelsService.getUserAssetLabels();oe.actions.assetLabels(t)}async loadAssetCount(t){let n=await this.assetCountsService.getUserAssetCount(t);n&&oe.getState().assetCounts.allAsset[t]!==n.count&&oe.actions.setAssetCount({assetCount:n})}async loadBookmarkByMapId(t){let n=await this.assetCountsService.getUserBookmarkCountByMap(t);n&&oe.getState().assetCounts.bookmarkByMap[t]!==n.count&&oe.actions.setBookmarkCountByMap({count:n.count,mapId:t})}async reloadAssetCount(t){this.assetCountsService.clearCache();let n=Object.keys(oe.getState().assetCounts.bookmarkByMap).length!==0;t===he.BOOKMARKS&&n&&oe.actions.clearBookmarkCountByMap(),oe.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 n=!((t=this.currentSession)===null||t===void 0)&&t.sessionAuthenticated?await this.bookmarksService.listMyBookmarks():void 0;oe.actions.bookmarks(n)}}},V0=new na;window.FluidTopicsUserAssetsActions==null&&(window.FluidTopicsUserAssetsActions=V0);var oa=class{addCommand(t,n=!1){P.commands.add(t,n)}consumeCommand(t){return P.commands.consume(t)}};window.FluidTopicsAppInfoStoreService=new oa;var ge=O(D());var pl,Yt=class extends CustomEvent{constructor(t){super("ft-i18n-context-loaded",{detail:t})}},j0=Symbol("clearAfterUnitTest"),Bn=class extends(0,ge.withEventBus)(fe){constructor(t){super(),this.messageContextProvider=t,this.defaultMessages={},this.listeners={},this.currentUiLocale="",this[pl]=()=>{this.defaultMessages={},this.cache=new ge.CacheRegistry,this.listeners={}},this.currentUiLocale=P.getState().uiLocale,P.subscribe(()=>this.clearWhenUiLocaleChanges())}clearWhenUiLocaleChanges(){let{uiLocale:t}=P.getState();this.currentUiLocale!==t&&(this.currentUiLocale=t,this.cache.clearAll(),this.notifyAll())}addContext(t){let n=t.name.toLowerCase();this.cache.setFinal(n,t),this.notify(n)}getAllContexts(){return this.cache.resolvedValues()}async prepareContext(t,n){var o;if(t=t.toLowerCase(),n&&Object.keys(n).length>0){let a={...(o=this.defaultMessages[t])!==null&&o!==void 0?o:{},...n};(0,ge.deepEqual)(this.defaultMessages[t],a)||(this.defaultMessages[t]=a,await this.notify(t))}return this.fetchContext(t)}resolveContext(t){var n,o;return this.fetchContext(t),(o=(n=this.cache.getNow(t))===null||n===void 0?void 0:n.messages)!==null&&o!==void 0?o:{}}resolveRawMessage(t,n){let o=t.toLowerCase();return this.resolveContext(o)[n]}resolveMessage(t,n,...o){var a;let i=t.toLowerCase(),s=this.resolveContext(i);return new ge.ParametrizedLabelResolver((a=this.defaultMessages[i])!==null&&a!==void 0?a:{},s).resolve(n,...o)}async fetchContext(t){let n=!this.cache.has(t),o;try{o=await this.cache.get(t,()=>this.messageContextProvider(this.currentUiLocale,t)),n&&await this.notify(t)}catch(a){!(a instanceof ge.CanceledPromiseError)&&n&&console.error(a)}return o}subscribe(t,n){var o;return t=t.toLowerCase(),this.listeners[t]=(o=this.listeners[t])!==null&&o!==void 0?o:new Set,this.listeners[t].add(n),()=>{var a;return(a=this.listeners[t])===null||a===void 0?void 0:a.delete(n)}}async notifyAll(){let t=Object.keys(this.listeners);document.body.dispatchEvent(new Yt({loadedContexts:t})),this.dispatchEvent(new Yt({loadedContexts:t})),await Promise.all(t.map(n=>this.notify(n,!1)))}async notify(t,n=!0){n&&(document.body.dispatchEvent(new Yt({loadedContexts:[t]})),this.dispatchEvent(new Yt({loadedContexts:[t]}))),this.listeners[t]!=null&&await Promise.all([...this.listeners[t].values()].map(o=>(0,ge.delay)(0).then(()=>o()).catch(()=>null)))}};pl=j0;window.FluidTopicsI18nService==null&&(window.FluidTopicsI18nService=new class extends Bn{constructor(){super(async(e,t)=>(await this.awaitApi).getFluidTopicsMessageContext(e,t))}});window.FluidTopicsCustomI18nService==null&&(window.FluidTopicsCustomI18nService=new class extends Bn{constructor(){super(async(e,t)=>(await this.awaitApi).getCustomMessageContext(e,t))}});var kr=window.FluidTopicsI18nService,aa=window.FluidTopicsCustomI18nService;var ml=O(D()),ia=class{highlightHtml(t,n,o){(0,ml.highlightHtml)(t,n,o)}};window.FluidTopicsHighlightHtmlService=new ia;var hl=O(D());var sa=class{isDate(t){var n,o,a,i;return(i=(a=((o=(n=P.getState().metadataConfiguration)===null||n===void 0?void 0:n.descriptors)!==null&&o!==void 0?o:[]).find(l=>l.key===t))===null||a===void 0?void 0:a.date)!==null&&i!==void 0?i:!1}format(t,n){var o,a,i,s;if(t==null)return"";try{return hl.DateFormatter.format(t,(o=n?.locale)!==null&&o!==void 0?o:P.getState().uiLocale,(a=n?.longFormat)!==null&&a!==void 0?a:!1,(i=n?.withTime)!==null&&i!==void 0?i:!1,(s=n?.onlyTime)!==null&&s!==void 0?s:!1)}catch(l){throw console.error(`Date ${JSON.stringify(t)} is not valid`,l),l}}};window.FluidTopicsDateService=new sa;var gl=O(D());var Ir=class{static get(t,n){var o,a,i,s;let l=P.getState(),{lang:f,region:m}=(i=(a=(o=l.localesConfiguration)===null||o===void 0?void 0:o.defaultLocales)===null||a===void 0?void 0:a.defaultContentLocale)!==null&&i!==void 0?i:{lang:"en",region:"US"};return new gl.SearchPlaceConverter(l.baseUrl,t??20,(s=l.localesConfiguration)===null||s===void 0?void 0:s.allLanguagesAllowed,n??`${f}-${m}`)}};var ca=class{urlToSearchRequest(t){return Ir.get().parse(t)}searchRequestToUrl(t){return Ir.get().serialize(t)}};window.FluidTopicsUrlService=new ca;var Ue=O(D());var _t=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{nextLocation:t}})}};_t.eventName="before-location-change";var wt=class e extends CustomEvent{constructor(t){super(e.eventName,{detail:{currentItem:t}})}};wt.eventName="change";var la=class{itemName(t){return`fluid-topics-history-item-${t}`}get(t){let n=sessionStorage.getItem(this.itemName(t));return n?JSON.parse(n):void 0}set(t,n){sessionStorage.setItem(this.itemName(t),JSON.stringify(n))}},yl=new la;var $n=class e extends Ue.WithEventBus{static build(){return new e(window.history,yl,()=>window.location,!1)}constructor(t,n,o,a){var i,s;super(),this.history=t,this.historyStorage=n,this.windowLocation=o,this.states=[],this.realPushState=t.pushState,this.realReplaceState=t.replaceState,this.initialIndex=(s=(i=t.state)===null||i===void 0?void 0:i.index)!==null&&s!==void 0?s:t.length-1,this.currentIndex=this.initialIndex,this.setCurrentState(this.buildCurrentState()),this.installProxies(),this.initEventListeners(),this.initData(a)}setCurrentState(t,n=!1){let o=n&&this.currentIndex===t.index-1;this.currentState={...this.buildCurrentState(),...t},this.currentIndex=this.currentState.index,this.states[this.currentIndex]=this.currentState,o&&(this.states=this.states.slice(0,this.currentIndex+1)),this.historyStorage.set(this.currentIndex,this.currentState),(0,Ue.deepEqual)(this.currentState,this.history.state)||this.realReplaceState.apply(this.history,[this.currentState,this.currentState.title,this.windowLocation().href]),setTimeout(()=>this.dispatchEvent(new wt(this.currentItem())),0)}installProxies(){let t=n=>(o,a,[i,s,l])=>{let f=new _t(new URL(typeof l=="string"?l:(l??this.windowLocation()).href,window.location.origin));this.dispatchEvent(f);let m=n(),h={...m===this.currentIndex?this.currentState:void 0,...i,index:m,href:f.detail.nextLocation.href};o.apply(a,[h,s,h.href]),this.setCurrentState(h,!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 n=this.history.length-1;n>=0;n--)t?this.states[n]=this.historyStorage.get(n):setTimeout(()=>this.states[n]=this.historyStorage.get(n),this.history.length-n)}updateCurrentState(t){var n;let o={...this.buildCurrentState(),...t,index:this.currentIndex,title:(n=t?.title)!==null&&n!==void 0?n:this.currentState.title};this.setCurrentState(o)}addBeforeLocationChangeListener(t){this.addEventListener(_t.eventName,t)}removeBeforeLocationChangeListener(t){this.removeEventListener(_t.eventName,t)}addHistoryChangeListener(t){this.addEventListener(wt.eventName,t)}removeHistoryChangeListener(t){this.removeEventListener(wt.eventName,t)}currentItem(){return(0,Ue.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,Ue.deepCopy)(this.states[this.previousDifferentMajorPosition()])}backwardItemMatching(t){let n=this.states.filter(o=>!!o).filter(o=>o.index<this.currentIndex).reverse();return(0,Ue.deepCopy)(n.find(o=>t(o)))}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,Ue.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 n;let o=(n=this.states[t])===null||n===void 0?void 0:n.majorStateId;if(!o)return t;let a=t,i=t+1;for(;this.states.length>i&&!this.isDifferentMajorState(i,o);)this.hasState(i)&&(a=i),i++;return a}buildCurrentState(){var t,n;return{...this.history.state,index:this.currentIndex,href:this.windowLocation().href,title:(n=(t=this.history.state)===null||t===void 0?void 0:t.title)!==null&&n!==void 0?n:document.title}}hasState(t){return this.states[t]!=null}isDifferentMajorState(t,n){var o;if(!this.hasState(t))return!1;let a=n??this.currentState.majorStateId,i=(o=this.states[t])===null||o===void 0?void 0:o.majorStateId;return i==null||i!=a}};window.FluidTopicsInternalHistoryService==null&&(window.FluidTopicsInternalHistoryService=$n.build(),window.FluidTopicsHistoryService={currentItem:()=>window.FluidTopicsInternalHistoryService.currentItem(),back:()=>window.FluidTopicsInternalHistoryService.back(),forward:()=>window.FluidTopicsInternalHistoryService.forward(),backwardItem:()=>window.FluidTopicsInternalHistoryService.backwardItem(),forwardItem:()=>window.FluidTopicsInternalHistoryService.forwardItem(),backwardItemMatching:e=>window.FluidTopicsInternalHistoryService.backwardItemMatching(e),addHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.addHistoryChangeListener(e),removeHistoryChangeListener:e=>window.FluidTopicsInternalHistoryService.removeHistoryChangeListener(e),addBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.addBeforeLocationChangeListener(e),removeBeforeLocationChangeListener:e=>window.FluidTopicsInternalHistoryService.removeBeforeLocationChangeListener(e)});var bl=O(X());var xl=bl.css`
347
347
  `;var Cl=O(X()),ae=O(ie()),zt=O(D());var Nt=O(D());function vl(e,t){let{authenticationRequired:n,session:o}=P.getState();return n&&!o?.sessionAuthenticated?Promise.resolve(t):e()}var Gn=class extends qt{async updateUiLocale(t){return(await this.awaitApi).updateUiLocale(t)}};var da=class e extends Nt.FtStateManager{static build(t){return new e(P,t)}constructor(t,n){super(),this.store=t,this.cache=new Nt.CacheRegistry,this.withManualResources=!0,this.userLocaleService=new Gn,this.cleanSessionDebouncer=new Nt.Debouncer,this.reloadConfiguration=()=>{var o;(o=this.cache)===null||o===void 0||o.clear("availableContentLocales"),this.updateAvailableContentLocales()},this.reloadDebouncer=new Nt.Debouncer(500),this.apiProvider=n??(()=>Rt.get())}setWithManualResources(t){this.withManualResources=t,this.updateIfNeeded()}addListeners(){this.store.addEventListener(Ot.eventName,this.reloadConfiguration)}removeListeners(){this.store.removeEventListener(Ot.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 n=await this.apiProvider().getCurrentSession();return n.idleTimeoutInMillis>0&&this.cleanSessionDebouncer.run(()=>{this.cache.clear("session"),this.setSession(void 0)},n.idleTimeoutInMillis),n});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 n=await this.cache.get("availableContentLocales",()=>vl(()=>this.apiProvider().getAvailableSearchLocales(),{contentLocales:[]}));this.setAvailableContentLocales((t=n.contentLocales)!==null&&t!==void 0?t:[])}setStickyFilters(t){this.store.actions.stickyFilters(t)}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,n){this.userLocaleService.updateUiLocale({uiLocale:t,contentLocale:n}).then(o=>{o.uiLocaleChanged&&(this.reloadDebouncer.run(()=>window.location.reload()),this.store.dispatchEvent(new zr(o)))}).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)}setNoCustomCode(t){this.store.actions.noCustomCode(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)}},Sl=da.build();var Mt=class extends Event{constructor(t,n,o,a){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=n,this.callback=o,this.subscribe=a??!1}};var Tr=class{constructor(){this.pendingContextRequests=new Map,this.onContextProvider=t=>{let n=this.pendingContextRequests.get(t.context);if(n===void 0)return;this.pendingContextRequests.delete(t.context);let{requests:o}=n;for(let{elementRef:a,callbackRef:i}of o){let s=a.deref(),l=i.deref();s===void 0||l===void 0||s.dispatchEvent(new Mt(t.context,s,l,!0))}},this.onContextRequest=t=>{if(t.subscribe!==!0)return;let n=t.contextTarget??t.composedPath()[0],o=t.callback,a=this.pendingContextRequests.get(t.context);a===void 0&&this.pendingContextRequests.set(t.context,a={callbacks:new WeakMap,requests:[]});let i=a.callbacks.get(n);i===void 0&&a.callbacks.set(n,i=new WeakSet),i.has(o)||(i.add(o),a.requests.push({elementRef:new WeakRef(n),callbackRef:new WeakRef(o)}))}}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 J=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},W=class extends zt.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.noCustomCode=!1,this.withManualResources=!1,this.navigatorOnline=!1,this.forcedOffline=!1,this.authenticationRequired=!1,this.messageContexts=[],this.stateManager=Sl,this.contextRoot=new Tr}render(){return Cl.html`
348
348
  <slot></slot>
349
349
  `}connectedCallback(){super.connectedCallback(),this.stateManager.addListeners(),this.contextRoot.attach(document.body)}disconnectedCallback(){super.disconnectedCallback(),this.stateManager.removeListeners(),this.contextRoot.detach(document.body)}update(t){var n;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("noCustomCode")&&this.stateManager.setNoCustomCode(this.noCustomCode),t.has("session")&&this.stateManager.setSession(this.session),t.has("messageContexts")&&this.messageContexts!=null&&this.messageContexts.forEach(o=>kr.addContext(o)),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")&&((n=this.stateManager)===null||n===void 0||n.setWithManualResources(this.withManualResources)),setTimeout(()=>this.stateManager.updateIfNeeded())}};W.elementDefinitions={};W.styles=xl;J([(0,ae.property)()],W.prototype,"baseUrl",void 0);J([(0,ae.property)()],W.prototype,"tenantId",void 0);J([(0,ae.property)()],W.prototype,"apiIntegrationIdentifier",void 0);J([(0,ae.property)()],W.prototype,"apiIntegrationAppVersion",void 0);J([(0,ae.property)()],W.prototype,"uiLocale",void 0);J([(0,zt.jsonProperty)(null)],W.prototype,"availableUiLocales",void 0);J([(0,zt.jsonProperty)(null)],W.prototype,"metadataConfiguration",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"editorMode",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"noCustom",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"openExternalDocumentInNewTab",void 0);J([(0,ae.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],W.prototype,"noCustomComponent",void 0);J([(0,ae.property)({converter:{fromAttribute(e){return e==="false"?!1:e==="true"||(e??!1)}}})],W.prototype,"noCustomCode",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"withManualResources",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"navigatorOnline",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"forcedOffline",void 0);J([(0,ae.property)({type:Boolean})],W.prototype,"authenticationRequired",void 0);J([(0,zt.jsonProperty)([])],W.prototype,"messageContexts",void 0);J([(0,zt.jsonProperty)(void 0)],W.prototype,"session",void 0);var Ll=O(D());var El={"ft-app-context":W};(0,Ll.customElements)(El);var Al=O(ie());var fa=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[n,o]=t.split(".");return{context:n,key:o,custom:n!=="officialContext",message:""}}return{message:t}}}toAttribute(t){if(t!=null)return JSON.stringify(t)}isI18nKey(t){return t.match(/^[\w-]+\.[\w-]+$/)}},Xt=new fa;var q0=function(e,t,n,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,n):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(s=e[l])&&(i=(a<3?s(i):a>3?s(t,n,i):s(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},Dr=Symbol("i18nAttributes"),Ol=Symbol("i18nListAttributes"),Rl=Symbol("i18nProperties"),Hn=Symbol("i18nContexts"),Pr=Symbol("i18nUnsubs"),_l=(0,Qt.applyMixinOnce)(Symbol("withI18n"),function(e){var t,n;class o extends e{constructor(){super(...arguments),this.useCustomMessageContexts=!1,this[t]=new Map,this[n]=new Map}getI18nService(i){return i??this.useCustomMessageContexts?aa:kr}i18n(i){let{context:s,key:l,message:f}=i,{custom:m,args:h,argsProvider:g}=i;if(s&&l){this.hasI18nContext(s)||this.addI18nContext(s,void 0,m);let b=h??(g?g(this):[]);return this.getI18nService(m).resolveMessage(s,l,...b)}return f}async awaitI18n(i){let{context:s,custom:l}=i;return s&&await this.getI18nService(l).prepareContext(s),this.i18n(i)}customI18n(i,s){if(Xt.isI18nKey(i)){let[l,f]=i.split(".");return this.i18n({custom:!0,context:l,key:f,...s})||i}return i}firstUpdated(i){super.firstUpdated(i),this.updateI18nAttributes(()=>!0),this.updateI18nProperties(()=>!0)}update(i){super.update(i),this.updateI18nAttributes((s,l,f)=>i.has(l)||typeof s.argsProvider=="function"),this.updateI18nProperties(s=>typeof s.argsProvider=="function")}onI18nUpdate(i){this.updateI18nAttributes((s,l,f)=>{var m;return((m=f?.context)===null||m===void 0?void 0:m.toLowerCase())===i}),this.updateI18nProperties(s=>s.context.toLowerCase()===i),this.requestUpdate()}updateI18nAttributes(i){var s,l;let f=this,m=(h,g,b)=>b?.context&&b.key&&i(h,g,b)?{...b,message:this.i18n({context:b.context,key:b.key,custom:b.custom,...h})}:b;(s=this[Dr])===null||s===void 0||s.forEach((h,g)=>f[g]=m(h,g,f[g])),(l=this[Ol])===null||l===void 0||l.forEach((h,g)=>{var b;return f[g]=(b=f[g])===null||b===void 0?void 0:b.map(x=>m(h,g,x))})}updateI18nProperties(i){var s;(s=this[Rl])===null||s===void 0||s.forEach((l,f)=>{i(l,f)&&(this[f]=this.i18n(l))})}addI18nMessages(i,s,l){console.warn('Deprecated usage of method "addI18nMessages", use "addI18nContext" instead.'),this.addI18nContext(i,s,l)}addI18nContext(i,s,l){let f=(typeof i=="string"?i:i.name).toLowerCase();l=typeof i=="string"?l:i.custom,this[Hn].set(f,{isCustomContext:l}),this[Pr].has(f)||this[Pr].set(f,this.getI18nService(l).subscribe(f,()=>this.onI18nUpdate(f))),this.getI18nService(l).prepareContext(f,s)}hasI18nContext(i){return this[Hn].has(i.toLowerCase())}connectedCallback(){super.connectedCallback(),this[Hn].forEach((i,s)=>this.addI18nContext(s,void 0,i.isCustomContext))}disconnectedCallback(){super.disconnectedCallback(),this[Pr].forEach(i=>i()),this[Pr].clear()}}return t=Hn,n=Pr,q0([(0,Al.property)({type:Boolean})],o.prototype,"useCustomMessageContexts",void 0),o}),Wn=class extends _l(Qt.FtLitElement){},Vn=class extends _l(Qt.FtLitElementRedux){};var wl=O(D());var ua=class{fromAttribute(t){if(!t)return[];try{let n=JSON.parse(t);return Array.isArray(n)?n.map(o=>typeof o=="string"?Xt.fromAttribute(o):o):[]}catch{return[]}}toAttribute(t){if(t!=null)return JSON.stringify(t)}},Y0=new ua;var Nl=(e,t)=>(n,o)=>{var a;n.constructor.createProperty(o,{type:Object,hasChanged:wl.hasChanged,converter:Xt,...t}),n[Dr]=(a=n[Dr])!==null&&a!==void 0?a:new Map,n[Dr].set(o,e??{})};var Ml=O(X());var zl=Ml.css`