@deepdesk/deepdesk-sdk 10.2.0 → 10.2.1-beta.0

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.
@@ -6,7 +6,7 @@
6
6
  Error generating stack: `+i.message+`
7
7
  `+i.stack}return{value:e,source:t,stack:o}}function Jf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var CT=typeof WeakMap=="function"?WeakMap:Map;function t0(e,t,n){n=Yn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){pu||(pu=!0,ip=r),Jf(e,t)},n}function n0(e,t,n){n=Yn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return Jf(e,t),r(o)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Yt===null?Yt=new Set([this]):Yt.add(this),Jf(e,t));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}var bT=typeof WeakSet=="function"?WeakSet:Set;function Lv(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){tr(e,n)}else t.current=null}function TT(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var n=e.memoizedProps,r=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?n:Mt(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&Op(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(T(163))}function kT(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var o=e;r=o.next,o=o.tag,o&4&&o&1&&(d0(n,e),MT(n,e)),e=r}while(e!==t)}return;case 1:e=n.stateNode,n.flags&4&&(t===null?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:Mt(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&pv(n,t,e);return;case 3:if(t=n.updateQueue,t!==null){if(e=null,n.child!==null)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}pv(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&kS(n.type,n.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&sS(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(T(163))}function Ov(e,t){for(var n=e;;){if(n.tag===5){var r=n.stateNode;if(t)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,r.style.display=Xv("display",o)}}else if(n.tag===6)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function Nv(e,t){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(Np,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,o!==void 0)if(r&4)d0(t,n);else{r=t;try{o()}catch(i){tr(r,i)}}n=n.next}while(n!==e)}break;case 1:if(Lv(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){tr(t,i)}break;case 5:Lv(t);break;case 4:r0(e,t)}}function Mv(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function Dv(e){return e.tag===5||e.tag===3||e.tag===4}function Fv(e){e:{for(var t=e.return;t!==null;){if(Dv(t))break e;t=t.return}throw Error(T(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:t=t.containerInfo,r=!0;break;case 4:t=t.containerInfo,r=!0;break;default:throw Error(T(161))}n.flags&16&&(Rs(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||Dv(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?ep(e,n,t):tp(e,n,t)}function ep(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zl));else if(r!==4&&(e=e.child,e!==null))for(ep(e,t,n),e=e.sibling;e!==null;)ep(e,t,n),e=e.sibling}function tp(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(tp(e,t,n),e=e.sibling;e!==null;)tp(e,t,n),e=e.sibling}function r0(e,t){for(var n=t,r=!1,o,i;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(T(160));switch(o=r.stateNode,r.tag){case 5:i=!1;break e;case 3:o=o.containerInfo,i=!0;break e;case 4:o=o.containerInfo,i=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var s=e,a=n,l=a;;)if(Nv(s,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}i?(s=o,a=n.stateNode,s.nodeType===8?s.parentNode.removeChild(a):s.removeChild(a)):o.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){o=n.stateNode.containerInfo,i=!0,n.child.return=n,n=n.child;continue}}else if(Nv(e,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function xf(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var o=e!==null?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,i!==null){for(n[Jl]=r,e==="input"&&r.type==="radio"&&r.name!=null&&Wv(n,r),Of(e,o),t=Of(e,r),o=0;o<i.length;o+=2){var s=i[o],a=i[o+1];s==="style"?Qv(n,a):s==="dangerouslySetInnerHTML"?Gv(n,a):s==="children"?Rs(n,a):fp(n,s,a,t)}switch(e){case"input":Tf(n,r);break;case"textarea":$v(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,i=r.value,i!=null?Io(n,!!r.multiple,i,!1):e!==!!r.multiple&&(r.defaultValue!=null?Io(n,!!r.multiple,r.defaultValue,!0):Io(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(T(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:n=t.stateNode,n.hydrate&&(n.hydrate=!1,sS(n.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(Xp=Le(),Ov(t.child,!0)),jv(t);return;case 19:jv(t);return;case 17:return;case 23:case 24:Ov(t,t.memoizedState!==null);return}throw Error(T(163))}function jv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bT),t.forEach(function(r){var o=jT.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function PT(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var RT=Math.ceil,fu=qr.ReactCurrentDispatcher,qp=qr.ReactCurrentOwner,D=0,Be=null,ve=null,Oe=0,Wr=0,np=ar(0),Te=0,Tu=null,Wo=0,Ws=0,$o=0,Gp=0,rp=null,Xp=0,op=1/0;function qo(){op=Le()+500}var A=null,pu=!1,ip=null,Yt=null,ir=!1,bs=null,ms=90,sp=[],ap=[],gn=null,Ts=0,lp=null,zl=-1,fn=0,Vl=0,ks=null,Kl=!1;function tt(){return D&48?Le():zl!==-1?zl:zl=Le()}function Jn(e){if(e=e.mode,!(e&2))return 1;if(!(e&4))return Uo()===99?1:2;if(fn===0&&(fn=Wo),hT.transition!==0){Vl!==0&&(Vl=rp!==null?rp.pendingLanes:0),e=fn;var t=4186112&~Vl;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=Uo(),D&4&&e===98?e=Ql(12,fn):(e=Sb(e),e=Ql(e,fn)),e}function er(e,t,n){if(50<Ts)throw Ts=0,lp=null,Error(T(185));if(e=ku(e,t),e===null)return null;Su(e,t,n),e===Be&&($o|=t,Te===4&&Do(e,Oe));var r=Uo();t===1?D&8&&!(D&48)?up(e):(_t(e,n),D===0&&(qo(),en())):(!(D&4)||r!==98&&r!==99||(gn===null?gn=new Set([e]):gn.add(e)),_t(e,n)),rp=e}function ku(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}function _t(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-rr(s),l=1<<a,u=i[a];if(u===-1){if(!(l&r)||l&o){u=t,_o(l);var c=ne;i[a]=10<=c?u+250:6<=c?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);s&=~l}if(r=Os(e,e===Be?Oe:0),t=ne,r===0)n!==null&&(n!==gf&&Kf(n),e.callbackNode=null,e.callbackPriority=0);else{if(n!==null){if(e.callbackPriority===t)return;n!==gf&&Kf(n)}t===15?(n=up.bind(null,e),dn===null?(dn=[n],Ul=Mp(Cu,MS)):dn.push(n),n=gf):t===14?n=Fs(99,up.bind(null,e)):(n=xb(t),n=Fs(n,o0.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function o0(e){if(zl=-1,Vl=fn=0,D&48)throw Error(T(327));var t=e.callbackNode;if(lr()&&e.callbackNode!==t)return null;var n=Os(e,e===Be?Oe:0);if(n===0)return null;var r=n,o=D;D|=16;var i=l0();(Be!==e||Oe!==r)&&(qo(),Fo(e,r));do try{LT();break}catch(a){a0(e,a)}while(1);if(Dp(),fu.current=i,D=o,ve!==null?r=0:(Be=null,Oe=0,r=Te),Wo&$o)Fo(e,0);else if(r!==0){if(r===2&&(D|=64,e.hydrate&&(e.hydrate=!1,Op(e.containerInfo)),n=pS(e),n!==0&&(r=gs(e,n))),r===1)throw t=Tu,Fo(e,0),Do(e,n),_t(e,Le()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(T(345));case 2:Dr(e);break;case 3:if(Do(e,n),(n&62914560)===n&&(r=Xp+500-Le(),10<r)){if(Os(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){tt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=iv(Dr.bind(null,e),r);break}Dr(e);break;case 4:if(Do(e,n),(n&4186112)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-rr(n);i=1<<s,s=r[s],s>o&&(o=s),n&=~i}if(n=o,n=Le()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*RT(n/1960))-n,10<n){e.timeoutHandle=iv(Dr.bind(null,e),n);break}Dr(e);break;case 5:Dr(e);break;default:throw Error(T(329))}}return _t(e,Le()),e.callbackNode===t?o0.bind(null,e):null}function Do(e,t){for(t&=~Gp,t&=~$o,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-rr(t),r=1<<n;e[n]=-1,t&=~r}}function up(e){if(D&48)throw Error(T(327));if(lr(),e===Be&&e.expiredLanes&Oe){var t=Oe,n=gs(e,t);Wo&$o&&(t=Os(e,t),n=gs(e,t))}else t=Os(e,0),n=gs(e,t);if(e.tag!==0&&n===2&&(D|=64,e.hydrate&&(e.hydrate=!1,Op(e.containerInfo)),t=pS(e),t!==0&&(n=gs(e,t))),n===1)throw n=Tu,Fo(e,0),Do(e,t),_t(e,Le()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,Dr(e),_t(e,Le()),null}function IT(){if(gn!==null){var e=gn;gn=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,_t(t,Le())})}en()}function i0(e,t){var n=D;D|=1;try{return e(t)}finally{D=n,D===0&&(qo(),en())}}function s0(e,t){var n=D;D&=-2,D|=8;try{return e(t)}finally{D=n,D===0&&(qo(),en())}}function Ml(e,t){de(np,Wr),Wr|=t,Wo|=t}function Qp(){Wr=np.current,se(np)}function Fo(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,cT(n)),ve!==null)for(n=ve.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&eu();break;case 3:zo(),se($e),se(Ne),Hp();break;case 5:Bp(r);break;case 4:zo();break;case 13:se(ce);break;case 19:se(ce);break;case 10:Fp(r);break;case 23:case 24:Qp()}n=n.return}Be=e,ve=sr(e.current,null),Oe=Wr=Wo=t,Te=0,Tu=null,Gp=$o=Ws=0}function a0(e,t){do{var n=ve;try{if(Dp(),Es.current=du,au){for(var r=ge.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}au=!1}if(Us=0,be=Ae=ge=null,Cs=!1,qp.current=null,n===null||n.return===null){Te=1,Tu=t,ve=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Oe,a.flags|=2048,a.firstEffect=a.lastEffect=null,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l;if(!(a.mode&2)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.lanes=c.lanes):(a.updateQueue=null,a.memoizedState=null)}var f=(ce.current&1)!==0,d=s;do{var y;if(y=d.tag===13){var v=d.memoizedState;if(v!==null)y=v.dehydrated!==null;else{var h=d.memoizedProps;y=h.fallback===void 0?!1:h.unstable_avoidThisFallback!==!0?!0:!f}}if(y){var m=d.updateQueue;if(m===null){var g=new Set;g.add(u),d.updateQueue=g}else m.add(u);if(!(d.mode&2)){if(d.flags|=64,a.flags|=16384,a.flags&=-2981,a.tag===1)if(a.alternate===null)a.tag=17;else{var p=Yn(-1,1);p.tag=2,Zn(a,p)}a.lanes|=1;break e}l=void 0,a=t;var x=i.pingCache;if(x===null?(x=i.pingCache=new CT,l=new Set,x.set(u,l)):(l=x.get(u),l===void 0&&(l=new Set,x.set(u,l))),!l.has(a)){l.add(a);var _=FT.bind(null,i,u,a);u.then(_,_)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(d!==null);l=Error((Ro(a.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
8
8
 
9
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Te!==5&&(Te=2),l=$p(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var C=t0(d,i,t);fv(d,C);break e;case 1:i=l;var w=d.type,b=d.stateNode;if(!(d.flags&64)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Yt===null||!Yt.has(b)))){d.flags|=4096,t&=-t,d.lanes|=t;var R=n0(d,i,t);fv(d,R);break e}}d=d.return}while(d!==null)}c0(n)}catch(P){t=P,ve===n&&n!==null&&(ve=n=n.return);continue}break}while(1)}function l0(){var e=fu.current;return fu.current=du,e===null?du:e}function gs(e,t){var n=D;D|=16;var r=l0();Be===e&&Oe===t||Fo(e,t);do try{AT();break}catch(o){a0(e,o)}while(1);if(Dp(),D=n,fu.current=r,ve!==null)throw Error(T(261));return Be=null,Oe=0,Te}function AT(){for(;ve!==null;)u0(ve)}function LT(){for(;ve!==null&&!pT();)u0(ve)}function u0(e){var t=f0(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,t===null?c0(e):ve=t,qp.current=null}function c0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=ET(t),n!==null){n.flags&=2047,ve=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=wT(n,t,Wr),n!==null){ve=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||Wr&1073741824||!(n.mode&4)){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Te===0&&(Te=5)}function Dr(e){var t=Uo();return Kr(99,OT.bind(null,e,t)),null}function OT(e,t){do lr();while(bs!==null);if(D&48)throw Error(T(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(T(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-rr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(gn!==null&&!(r&24)&&gn.has(e)&&gn.delete(e),e===Be&&(ve=Be=null,Oe=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=D,D|=32,qp.current=null,ff=Fl,s=Jy(),Bf(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch{a=null;break e}var c=0,f=-1,d=-1,y=0,v=0,h=s,m=null;t:for(;;){for(var g;h!==a||i!==0&&h.nodeType!==3||(f=c+i),h!==l||u!==0&&h.nodeType!==3||(d=c+u),h.nodeType===3&&(c+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===s)break t;if(m===a&&++y===i&&(f=c),m===l&&++v===u&&(d=c),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;pf={focusedElem:s,selectionRange:a},Fl=!1,ks=null,Kl=!1,A=r;do try{NT()}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);ks=null,A=r;do try{for(s=e;A!==null;){var p=A.flags;if(p&16&&Rs(A.stateNode,""),p&128){var x=A.alternate;if(x!==null){var _=x.ref;_!==null&&(typeof _=="function"?_(null):_.current=null)}}switch(p&1038){case 2:Fv(A),A.flags&=-3;break;case 6:Fv(A),A.flags&=-3,xf(A.alternate,A);break;case 1024:A.flags&=-1025;break;case 1028:A.flags&=-1025,xf(A.alternate,A);break;case 4:xf(A.alternate,A);break;case 8:a=A,r0(s,a);var C=a.alternate;Mv(a),C!==null&&Mv(C)}A=A.nextEffect}}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);if(_=pf,x=Jy(),p=_.focusedElem,s=_.selectionRange,x!==p&&p&&p.ownerDocument&&_S(p.ownerDocument.documentElement,p)){for(s!==null&&Bf(p)&&(x=s.start,_=s.end,_===void 0&&(_=x),"selectionStart"in p?(p.selectionStart=x,p.selectionEnd=Math.min(_,p.value.length)):(_=(x=p.ownerDocument||document)&&x.defaultView||window,_.getSelection&&(_=_.getSelection(),a=p.textContent.length,C=Math.min(s.start,a),s=s.end===void 0?C:Math.min(s.end,a),!_.extend&&C>s&&(a=s,s=C,C=a),a=Zy(p,C),i=Zy(p,s),a&&i&&(_.rangeCount!==1||_.anchorNode!==a.node||_.anchorOffset!==a.offset||_.focusNode!==i.node||_.focusOffset!==i.offset)&&(x=x.createRange(),x.setStart(a.node,a.offset),_.removeAllRanges(),C>s?(_.addRange(x),_.extend(i.node,i.offset)):(x.setEnd(i.node,i.offset),_.addRange(x)))))),x=[],_=p;_=_.parentNode;)_.nodeType===1&&x.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<x.length;p++)_=x[p],_.element.scrollLeft=_.left,_.element.scrollTop=_.top}Fl=!!ff,pf=ff=null,e.current=n,A=r;do try{for(p=e;A!==null;){var w=A.flags;if(w&36&&kT(p,A.alternate,A),w&128){x=void 0;var b=A.ref;if(b!==null){var R=A.stateNode;switch(A.tag){case 5:x=R;break;default:x=R}typeof b=="function"?b(x):b.current=x}}A=A.nextEffect}}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);A=null,gT(),D=o}else e.current=n;if(ir)ir=!1,bs=e,ms=t;else for(A=r;A!==null;)t=A.nextEffect,A.nextEffect=null,A.flags&8&&(w=A,w.sibling=null,w.stateNode=null),A=t;if(r=e.pendingLanes,r===0&&(Yt=null),r===1?e===lp?Ts++:(Ts=0,lp=e):Ts=0,n=n.stateNode,zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(Np,n,void 0,(n.current.flags&64)===64)}catch{}if(_t(e,Le()),pu)throw pu=!1,e=ip,ip=null,e;return D&8||en(),null}function NT(){for(;A!==null;){var e=A.alternate;Kl||ks===null||(A.flags&8?By(A,ks)&&(Kl=!0):A.tag===13&&PT(e,A)&&By(A,ks)&&(Kl=!0));var t=A.flags;t&256&&TT(e,A),!(t&512)||ir||(ir=!0,Fs(97,function(){return lr(),null})),A=A.nextEffect}}function lr(){if(ms!==90){var e=97<ms?97:ms;return ms=90,Kr(e,DT)}return!1}function MT(e,t){sp.push(t,e),ir||(ir=!0,Fs(97,function(){return lr(),null}))}function d0(e,t){ap.push(t,e),ir||(ir=!0,Fs(97,function(){return lr(),null}))}function DT(){if(bs===null)return!1;var e=bs;if(bs=null,D&48)throw Error(T(331));var t=D;D|=32;var n=ap;ap=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(T(330));tr(i,l)}}for(n=sp,sp=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(T(330));tr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return D=t,en(),!0}function Bv(e,t,n){t=$p(n,t),t=t0(e,t,1),Zn(e,t),t=tt(),e=ku(e,1),e!==null&&(Su(e,1,t),_t(e,t))}function tr(e,t){if(e.tag===3)Bv(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Bv(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yt===null||!Yt.has(r))){e=$p(t,e);var o=n0(n,e,1);if(Zn(n,o),o=tt(),n=ku(n,1),n!==null)Su(n,1,o),_t(n,o);else if(typeof r.componentDidCatch=="function"&&(Yt===null||!Yt.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function FT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&(Oe&n)===n&&(Te===4||Te===3&&(Oe&62914560)===Oe&&500>Le()-Xp?Fo(e,0):Gp|=n),_t(e,t)}function jT(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(fn===0&&(fn=Wo),t=wo(62914560&~fn),t===0&&(t=4194304)):t=Uo()===99?1:2:t=1),n=tt(),e=ku(e,t),e!==null&&(Su(e,t,n),_t(e,n))}var f0;f0=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||$e.current)Dt=!0;else if(n&r)Dt=!!(e.flags&16384);else{switch(Dt=!1,t.tag){case 3:bv(t),yf();break;case 5:hv(t);break;case 1:qe(t.type)&&Hl(t);break;case 4:qf(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;de(tu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?Tv(e,t,n):(de(ce,ce.current&1),t=mn(e,t,n),t!==null?t.sibling:null);de(ce,ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return Av(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),de(ce,ce.current),r)break;return null;case 23:case 24:return t.lanes=0,vf(e,t,n)}return mn(e,t,n)}else Dt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Ho(t,Ne.current),No(t,n),o=zp(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,qe(r)){var i=!0;Hl(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jp(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&ou(t,r,s,e),o.updater=bu,t.stateNode=o,o._reactInternals=t,$f(t,r,e,n),t=Yf(null,t,r,!0,i,n)}else t.tag=0,We(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=HT(o),e=Mt(o,e),i){case 0:t=Qf(null,t,o,e,n);break e;case 1:t=Cv(null,t,o,e,n);break e;case 11:t=wv(null,t,o,e,n);break e;case 14:t=Ev(null,t,o,Mt(o.type,e),r,n);break e}throw Error(T(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Qf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Cv(e,t,r,o,n);case 3:if(bv(t),r=t.updateQueue,e===null||r===null)throw Error(T(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,FS(e,t),js(t,r,null,n),r=t.memoizedState.element,r===o)yf(),t=mn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(qn=Oo(t.stateNode.containerInfo.firstChild),pn=t,i=Jt=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],Mo.push(i);for(n=US(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else We(e,t,r,n),yf();t=t.child}return t;case 5:return hv(t),e===null&&Gf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,zf(r,o)?s=null:i!==null&&zf(r,i)&&(t.flags|=16),YS(e,t),We(e,t,s,n),t.child;case 6:return e===null&&Gf(t),null;case 13:return Tv(e,t,n);case 4:return qf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=iu(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),wv(e,t,r,o,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(de(tu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=yt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!$e.current){t=mn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=Yn(-1,n&-n),u.tag=2,Zn(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),DS(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}We(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,No(t,n),o=xt(o,i.unstable_observedBits),r=r(o),t.flags|=1,We(e,t,r,n),t.child;case 14:return o=t.type,i=Mt(o,t.pendingProps),i=Mt(o.type,i),Ev(e,t,o,i,r,n);case 15:return QS(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,qe(r)?(e=!0,Hl(t)):e=!1,No(t,n),BS(t,r,o),$f(t,r,o,n),Yf(null,t,r,!0,e,n);case 19:return Av(e,t,n);case 23:return vf(e,t,n);case 24:return vf(e,t,n)}throw Error(T(156,t.tag))};function BT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,r){return new BT(e,t,n,r)}function Yp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function HT(e){if(typeof e=="function")return Yp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hu)return 11;if(e===yu)return 14}return 2}function sr(e,t){var n=e.alternate;return n===null?(n=vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wl(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Yp(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Kn:return jo(n.children,o,i,t);case zv:s=8,o|=16;break;case pp:s=8,o|=1;break;case hs:return e=vt(12,n,t,o|8),e.elementType=hs,e.type=hs,e.lanes=i,e;case ys:return e=vt(13,n,t,o),e.type=ys,e.elementType=ys,e.lanes=i,e;case $l:return e=vt(19,n,t,o),e.elementType=$l,e.lanes=i,e;case Sp:return Zp(n,o,i,t);case Cf:return e=vt(24,n,t,o),e.elementType=Cf,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mp:s=10;break e;case gp:s=9;break e;case hu:s=11;break e;case yu:s=14;break e;case hp:s=16,r=null;break e;case yp:s=22;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=vt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function jo(e,t,n,r){return e=vt(7,e,r,t),e.lanes=n,e}function Zp(e,t,n,r){return e=vt(23,e,r,t),e.elementType=Sp,e.lanes=n,e}function _f(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function wf(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function UT(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=sf(0),this.expirationTimes=sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sf(0),this.mutableSourceEagerHydrationData=null}function zT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function mu(e,t,n,r){var o=t.current,i=tt(),s=Jn(o);e:if(n){n=n._reactInternals;t:{if(Gr(n)!==n||n.tag!==1)throw Error(T(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(qe(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(T(171))}if(n.tag===1){var l=n.type;if(qe(l)){n=RS(n,l,a);break e}}n=a}else n=or;return t.context===null?t.context=n:t.pendingContext=n,t=Yn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Zn(o,t),er(o,s,i),s}function Ef(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Hv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jp(e,t){Hv(e,t),(e=e.alternate)&&Hv(e,t)}function VT(){return null}function em(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new UT(e,t,n!=null&&n.hydrate===!0),t=vt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,jp(t),e[Ko]=n.current,CS(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var o=t._getVersion;o=o(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}em.prototype.render=function(e){mu(e,this._internalRoot,null,null)};em.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;mu(null,e,null,function(){t[Ko]=null})};function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function KT(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new em(e,0,t?{hydrate:!0}:void 0)}function Pu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Ef(s);a.call(u)}}mu(t,s,e,o)}else{if(i=n._reactRootContainer=KT(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Ef(s);l.call(u)}}s0(function(){mu(t,s,e,o)})}return Ef(s)}rS=function(e){if(e.tag===13){var t=tt();er(e,4,t),Jp(e,4)}};Cp=function(e){if(e.tag===13){var t=tt();er(e,67108864,t),Jp(e,67108864)}};oS=function(e){if(e.tag===13){var t=tt(),n=Jn(e);er(e,n,t),Jp(e,n)}};iS=function(e,t){return t()};Nf=function(e,t,n){switch(t){case"input":if(Tf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Eu(r);if(!o)throw Error(T(90));Kv(r),Tf(r,o)}}}break;case"textarea":$v(e,n);break;case"select":t=n.value,t!=null&&Io(e,!!n.multiple,t,!1)}};_p=i0;Jv=function(e,t,n,r,o){var i=D;D|=4;try{return Kr(98,e.bind(null,t,n,r,o))}finally{D=i,D===0&&(qo(),en())}};wp=function(){!(D&49)&&(IT(),lr())};eS=function(e,t){var n=D;D|=2;try{return e(t)}finally{D=n,D===0&&(qo(),en())}};function p0(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$s(t))throw Error(T(200));return zT(e,t,null,n)}var WT={Events:[Vs,To,Eu,Yv,Zv,lr,{current:!1}]},us={findFiberByHostInstance:Br,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},$T={bundleType:us.bundleType,version:us.version,rendererPackageName:us.rendererPackageName,rendererConfig:us.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nS(e),e===null?null:e.stateNode},findFiberByHostInstance:us.findFiberByHostInstance||VT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(cs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!cs.isDisabled&&cs.supportsFiber))try{Np=cs.inject($T),zr=cs}catch{}var cs;wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WT;wt.createPortal=p0;wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):Error(T(268,Object.keys(e)));return e=nS(t),e=e===null?null:e.stateNode,e};wt.flushSync=function(e,t){var n=D;if(n&48)return e(t);D|=1;try{if(e)return Kr(99,e.bind(null,t))}finally{D=n,en()}};wt.hydrate=function(e,t,n){if(!$s(t))throw Error(T(200));return Pu(null,e,t,!0,n)};wt.render=function(e,t,n){if(!$s(t))throw Error(T(200));return Pu(null,e,t,!1,n)};wt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(T(40));return e._reactRootContainer?(s0(function(){Pu(null,null,e,!1,function(){e._reactRootContainer=null,e[Ko]=null})}),!0):!1};wt.unstable_batchedUpdates=i0;wt.unstable_createPortal=function(e,t){return p0(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$s(n))throw Error(T(200));if(e==null||e._reactInternals===void 0)throw Error(T(38));return Pu(e,t,n,!1,r)};wt.version="17.0.2"});var Ru=pe((BO,h0)=>{"use strict";function g0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g0)}catch(e){console.error(e)}}g0(),h0.exports=m0()});var K0=pe(V0=>{"use strict";var Jo=O();function Ik(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ak=typeof Object.is=="function"?Object.is:Ik,Lk=Jo.useState,Ok=Jo.useEffect,Nk=Jo.useLayoutEffect,Mk=Jo.useDebugValue;function Dk(e,t){var n=t(),r=Lk({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Nk(function(){o.value=n,o.getSnapshot=t,km(o)&&i({inst:o})},[e,n,t]),Ok(function(){return km(o)&&i({inst:o}),e(function(){km(o)&&i({inst:o})})},[e]),Mk(n),n}function km(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ak(e,n)}catch{return!0}}function Fk(e,t){return t()}var jk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fk:Dk;V0.useSyncExternalStore=Jo.useSyncExternalStore!==void 0?Jo.useSyncExternalStore:jk});var Pm=pe((TN,W0)=>{"use strict";W0.exports=K0()});var q0=pe($0=>{"use strict";var Fu=O(),Bk=Pm();function Hk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uk=typeof Object.is=="function"?Object.is:Hk,zk=Bk.useSyncExternalStore,Vk=Fu.useRef,Kk=Fu.useEffect,Wk=Fu.useMemo,$k=Fu.useDebugValue;$0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Vk(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Wk(function(){function l(y){if(!u){if(u=!0,c=y,y=r(y),o!==void 0&&s.hasValue){var v=s.value;if(o(v,y))return f=v}return f=y}if(v=f,Uk(c,y))return v;var h=r(y);return o!==void 0&&o(v,h)?v:(c=y,f=h)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var a=zk(e,i[0],i[1]);return Kk(function(){s.hasValue=!0,s.value=a},[a]),$k(a),a}});var X0=pe((PN,G0)=>{"use strict";G0.exports=q0()});var sx=pe(Q=>{"use strict";var _e=typeof Symbol=="function"&&Symbol.for,Im=_e?Symbol.for("react.element"):60103,Am=_e?Symbol.for("react.portal"):60106,Uu=_e?Symbol.for("react.fragment"):60107,zu=_e?Symbol.for("react.strict_mode"):60108,Vu=_e?Symbol.for("react.profiler"):60114,Ku=_e?Symbol.for("react.provider"):60109,Wu=_e?Symbol.for("react.context"):60110,Lm=_e?Symbol.for("react.async_mode"):60111,$u=_e?Symbol.for("react.concurrent_mode"):60111,qu=_e?Symbol.for("react.forward_ref"):60112,Gu=_e?Symbol.for("react.suspense"):60113,Qk=_e?Symbol.for("react.suspense_list"):60120,Xu=_e?Symbol.for("react.memo"):60115,Qu=_e?Symbol.for("react.lazy"):60116,Yk=_e?Symbol.for("react.block"):60121,Zk=_e?Symbol.for("react.fundamental"):60117,Jk=_e?Symbol.for("react.responder"):60118,eP=_e?Symbol.for("react.scope"):60119;function ot(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Im:switch(e=e.type,e){case Lm:case $u:case Uu:case Vu:case zu:case Gu:return e;default:switch(e=e&&e.$$typeof,e){case Wu:case qu:case Qu:case Xu:case Ku:return e;default:return t}}case Am:return t}}}function ix(e){return ot(e)===$u}Q.AsyncMode=Lm;Q.ConcurrentMode=$u;Q.ContextConsumer=Wu;Q.ContextProvider=Ku;Q.Element=Im;Q.ForwardRef=qu;Q.Fragment=Uu;Q.Lazy=Qu;Q.Memo=Xu;Q.Portal=Am;Q.Profiler=Vu;Q.StrictMode=zu;Q.Suspense=Gu;Q.isAsyncMode=function(e){return ix(e)||ot(e)===Lm};Q.isConcurrentMode=ix;Q.isContextConsumer=function(e){return ot(e)===Wu};Q.isContextProvider=function(e){return ot(e)===Ku};Q.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Im};Q.isForwardRef=function(e){return ot(e)===qu};Q.isFragment=function(e){return ot(e)===Uu};Q.isLazy=function(e){return ot(e)===Qu};Q.isMemo=function(e){return ot(e)===Xu};Q.isPortal=function(e){return ot(e)===Am};Q.isProfiler=function(e){return ot(e)===Vu};Q.isStrictMode=function(e){return ot(e)===zu};Q.isSuspense=function(e){return ot(e)===Gu};Q.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Uu||e===$u||e===Vu||e===zu||e===Gu||e===Qk||typeof e=="object"&&e!==null&&(e.$$typeof===Qu||e.$$typeof===Xu||e.$$typeof===Ku||e.$$typeof===Wu||e.$$typeof===qu||e.$$typeof===Zk||e.$$typeof===Jk||e.$$typeof===eP||e.$$typeof===Yk)};Q.typeOf=ot});var lx=pe((zN,ax)=>{"use strict";ax.exports=sx()});var gx=pe((VN,mx)=>{"use strict";var Om=lx(),tP={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},nP={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},rP={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},fx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nm={};Nm[Om.ForwardRef]=rP;Nm[Om.Memo]=fx;function ux(e){return Om.isMemo(e)?fx:Nm[e.$$typeof]||tP}var oP=Object.defineProperty,iP=Object.getOwnPropertyNames,cx=Object.getOwnPropertySymbols,sP=Object.getOwnPropertyDescriptor,aP=Object.getPrototypeOf,dx=Object.prototype;function px(e,t,n){if(typeof t!="string"){if(dx){var r=aP(t);r&&r!==dx&&px(e,r,n)}var o=iP(t);cx&&(o=o.concat(cx(t)));for(var i=ux(e),s=ux(t),a=0;a<o.length;++a){var l=o[a];if(!nP[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=sP(t,l);try{oP(e,l,u)}catch{}}}}return e}mx.exports=px});var yx=pe(Y=>{"use strict";var Mm=Symbol.for("react.element"),Dm=Symbol.for("react.portal"),Yu=Symbol.for("react.fragment"),Zu=Symbol.for("react.strict_mode"),Ju=Symbol.for("react.profiler"),ec=Symbol.for("react.provider"),tc=Symbol.for("react.context"),lP=Symbol.for("react.server_context"),nc=Symbol.for("react.forward_ref"),rc=Symbol.for("react.suspense"),oc=Symbol.for("react.suspense_list"),ic=Symbol.for("react.memo"),sc=Symbol.for("react.lazy"),uP=Symbol.for("react.offscreen"),hx;hx=Symbol.for("react.module.reference");function Ct(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Mm:switch(e=e.type,e){case Yu:case Ju:case Zu:case rc:case oc:return e;default:switch(e=e&&e.$$typeof,e){case lP:case tc:case nc:case sc:case ic:case ec:return e;default:return t}}case Dm:return t}}}Y.ContextConsumer=tc;Y.ContextProvider=ec;Y.Element=Mm;Y.ForwardRef=nc;Y.Fragment=Yu;Y.Lazy=sc;Y.Memo=ic;Y.Portal=Dm;Y.Profiler=Ju;Y.StrictMode=Zu;Y.Suspense=rc;Y.SuspenseList=oc;Y.isAsyncMode=function(){return!1};Y.isConcurrentMode=function(){return!1};Y.isContextConsumer=function(e){return Ct(e)===tc};Y.isContextProvider=function(e){return Ct(e)===ec};Y.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mm};Y.isForwardRef=function(e){return Ct(e)===nc};Y.isFragment=function(e){return Ct(e)===Yu};Y.isLazy=function(e){return Ct(e)===sc};Y.isMemo=function(e){return Ct(e)===ic};Y.isPortal=function(e){return Ct(e)===Dm};Y.isProfiler=function(e){return Ct(e)===Ju};Y.isStrictMode=function(e){return Ct(e)===Zu};Y.isSuspense=function(e){return Ct(e)===rc};Y.isSuspenseList=function(e){return Ct(e)===oc};Y.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yu||e===Ju||e===Zu||e===rc||e===oc||e===uP||typeof e=="object"&&e!==null&&(e.$$typeof===sc||e.$$typeof===ic||e.$$typeof===ec||e.$$typeof===tc||e.$$typeof===nc||e.$$typeof===hx||e.getModuleId!==void 0)};Y.typeOf=Ct});var Sx=pe((WN,vx)=>{"use strict";vx.exports=yx()});var a_=pe((G2,s_)=>{"use strict";var UP=/["'&<>]/;s_.exports=zP;function zP(e){var t=""+e,n=UP.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var Ag=pe((s8,Mw)=>{"use strict";var LR="Expected a function",Ow=NaN,OR="[object Symbol]",NR=/^\s+|\s+$/g,MR=/^[-+]0x[0-9a-f]+$/i,DR=/^0b[01]+$/i,FR=/^0o[0-7]+$/i,jR=parseInt,BR=typeof global=="object"&&global&&global.Object===Object&&global,HR=typeof self=="object"&&self&&self.Object===Object&&self,UR=BR||HR||Function("return this")(),zR=Object.prototype,VR=zR.toString,KR=Math.max,WR=Math.min,Rg=function(){return UR.Date.now()};function $R(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(LR);t=Nw(t)||0,Ig(n)&&(c=!!n.leading,f="maxWait"in n,i=f?KR(Nw(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function y(w){var b=r,R=o;return r=o=void 0,u=w,s=e.apply(R,b),s}function v(w){return u=w,a=setTimeout(g,t),c?y(w):s}function h(w){var b=w-l,R=w-u,P=t-b;return f?WR(P,i-R):P}function m(w){var b=w-l,R=w-u;return l===void 0||b>=t||b<0||f&&R>=i}function g(){var w=Rg();if(m(w))return p(w);a=setTimeout(g,h(w))}function p(w){return a=void 0,d&&r?y(w):(r=o=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function _(){return a===void 0?s:p(Rg())}function C(){var w=Rg(),b=m(w);if(r=arguments,o=this,l=w,b){if(a===void 0)return v(l);if(f)return a=setTimeout(g,t),y(l)}return a===void 0&&(a=setTimeout(g,t)),s}return C.cancel=x,C.flush=_,C}function Ig(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qR(e){return!!e&&typeof e=="object"}function GR(e){return typeof e=="symbol"||qR(e)&&VR.call(e)==OR}function Nw(e){if(typeof e=="number")return e;if(GR(e))return Ow;if(Ig(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ig(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(NR,"");var n=DR.test(e);return n||FR.test(e)?jR(e.slice(2),n?2:8):MR.test(e)?Ow:+e}Mw.exports=$R});var OA={};Ce(OA,{Card:()=>me,Chip:()=>ny,ContentEditableInput:()=>ao,DeepdeskAPI:()=>Fn,DeepdeskSDK:()=>Ba,HTTPClient:()=>Wt,InputMediator:()=>_n,InputType:()=>Un,KeyboardHint:()=>pl,Label:()=>ml,Locale:()=>ea,Section:()=>Hn,SectionList:()=>gl,Sources:()=>Ot,Suggestion:()=>oe,SuggestionList:()=>qt,TextAreaInput:()=>wn,ToggleButton:()=>Nr,attachFile:()=>nC,authenticateWithKey:()=>eC,createFullRange:()=>Oi,createOverlayContainer:()=>mi,createRangeFromOffsets:()=>kr,escapeHTML:()=>ki,fetchPlatformConfig:()=>tC,formatTextMarkup:()=>JE,getRangeOffsets:()=>Ma,getRangeText:()=>Da,isSupportedInputElement:()=>wd,updateContentEditable:()=>ZE,updateTextArea:()=>YE,useStyles:()=>k,waitForElementVisibilityChange:()=>Ed});var Xa=S(X()),pt=S(O());var qa=S(O()),Bh=S(X()),zi=qa.default.createContext({});function k(e,t){let{debug:n,...r}=(0,qa.useContext)(zi),o=r[e];return o?Object.entries(t).reduce((i,[s,a])=>{let l=o[s];return{...i,[s]:(0,Bh.default)(a,l,n?`${e}__${s}`:!1)}},{}):t}var Hh={root:"_root_vr71j_1"};var Ar=S(E()),Ga=()=>(0,Ar.jsxs)("svg",{className:Hh.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ar.jsx)("defs",{children:(0,Ar.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Ar.jsx)("title",{children:"Failed loading image"}),(0,Ar.jsx)("path",{className:"cls-1",d:"M15 130.896V16.994c0-1.097.898-1.994 2.007-1.994h150.986A2 2 0 0 1 170 16.994v69.147L133.015 51 87.26 120.377l-35.863-17.758L15 130.896zM2 0C.895 0 0 .887 0 2v166c0 1.105.887 2 2 2h181c1.105 0 2-.887 2-2V2c0-1.105-.887-2-2-2H2zm49 72c11.046 0 20-9.178 20-20.5S62.046 31 51 31s-20 9.178-20 20.5S39.954 72 51 72z",fillRule:"evenodd"})]});var Ad={root:"_root_4e7lf_1",imageWrapper:"_imageWrapper_4e7lf_7",image:"_image_4e7lf_7",content:"_content_4e7lf_24",title:"_title_4e7lf_35",contentIsCropped:"_contentIsCropped_4e7lf_45",lineClamp:"_lineClamp_4e7lf_51"};var Lr=S(E()),Qa=(0,pt.createContext)(Ad),wC=({title:e,src:t})=>{let n=(0,pt.useContext)(Qa),[r,o]=(0,pt.useState)(!1);return(0,pt.useEffect)(()=>{o(!1)},[t]),(0,Lr.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,Lr.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,Lr.jsx)(Ga,{})})},EC=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,pt.useContext)(Qa);return(0,Lr.jsx)("div",{className:(0,Xa.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},CC=({as:e="h1",cropText:t=!1,className:n,children:r,...o})=>{let i=(0,pt.useContext)(Qa);return pt.default.createElement(e,{className:(0,Xa.default)(i.title,n,{[i.contentIsCropped]:t}),...o},r)},Ya=({children:e})=>{let t=k("Card",Ad);return(0,Lr.jsx)("div",{className:(0,Xa.default)(t.root),children:(0,Lr.jsx)(Qa.Provider,{value:t,children:e})})};Ya.Image=wC;Ya.Content=EC;Ya.Title=CC;var me=Ya;var Wh={root:"_root_nkim0_1"};var dl=S(O());var Ld=function(e,t){return Ld=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Ld(e,t)};function Ki(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ld(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var et=function(){return et=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},et.apply(this,arguments)};function $h(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Za(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ja;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Ja||(Ja={}));var el=class{constructor(t){console.warn(`[vite-messages-plugin]: Message "${t}" was not precompiled. Did you use the correct extenstion *.messages.ts?`)}};var Lt;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(Lt||(Lt={}));var tl;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(tl||(tl={}));function Od(e){return e.type===Lt.literal}function qh(e){return e.type===Lt.argument}function nl(e){return e.type===Lt.number}function rl(e){return e.type===Lt.date}function ol(e){return e.type===Lt.time}function il(e){return e.type===Lt.select}function sl(e){return e.type===Lt.plural}function Gh(e){return e.type===Lt.pound}function al(e){return e.type===Lt.tag}function ll(e){return!!(e&&typeof e=="object"&&e.type===tl.number)}function Wi(e){return!!(e&&typeof e=="object"&&e.type===tl.dateTime)}function Nd(e){e.forEach(function(t){if(delete t.location,il(t)||sl(t))for(var n in t.options)delete t.options[n].location,Nd(t.options[n].value);else nl(t)&&ll(t.style)||(rl(t)||ol(t))&&Wi(t.style)?delete t.style.location:al(t)&&Nd(t.children)})}function Xh(e,t){t===void 0&&(t={}),t=et({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new el(e,t).parse();if(n.err){var r=SyntaxError(Ja[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||Nd(n.val),n.val}function ul(e,t){var n=t&&t.cache?t.cache:IC,r=t&&t.serializer?t.serializer:RC,o=t&&t.strategy?t.strategy:TC;return o(e,{cache:n,serializer:r})}function bC(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Qh(e,t,n,r){var o=bC(r)?r:n(r),i=t.get(o);return typeof i>"u"&&(i=e.call(this,r),t.set(o,i)),i}function Yh(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,r),t.set(o,i)),i}function Md(e,t,n,r,o){return n.bind(t,e,r,o)}function TC(e,t){var n=e.length===1?Qh:Yh;return Md(e,this,n,t.cache.create(),t.serializer)}function kC(e,t){return Md(e,this,Yh,t.cache.create(),t.serializer)}function PC(e,t){return Md(e,this,Qh,t.cache.create(),t.serializer)}var RC=function(){return JSON.stringify(arguments)};function Dd(){this.cache=Object.create(null)}Dd.prototype.get=function(e){return this.cache[e]};Dd.prototype.set=function(e,t){this.cache[e]=t};var IC={create:function(){return new Dd}},cl={variadic:kC,monadic:PC};var Or;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Or||(Or={}));var $i=function(e){Ki(t,e);function t(n,r,o){var i=e.call(this,n)||this;return i.code=r,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Fd=function(e){Ki(t,e);function t(n,r,o,i){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(o).join('", "'),'"'),Or.INVALID_VALUE,i)||this}return t}($i);var Zh=function(e){Ki(t,e);function t(n,r,o){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Or.INVALID_VALUE,o)||this}return t}($i);var Jh=function(e){Ki(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Or.MISSING_VALUE,r)||this}return t}($i);var Re;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Re||(Re={}));function AC(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==Re.literal||n.type!==Re.literal?t.push(n):r.value+=n.value,t},[])}function LC(e){return typeof e=="function"}function qi(e,t,n,r,o,i,s){if(e.length===1&&Od(e[0]))return[{type:Re.literal,value:e[0].value}];for(var a=[],l=0,u=e;l<u.length;l++){var c=u[l];if(Od(c)){a.push({type:Re.literal,value:c.value});continue}if(Gh(c)){typeof i=="number"&&a.push({type:Re.literal,value:n.getNumberFormat(t).format(i)});continue}var f=c.value;if(!(o&&f in o))throw new Jh(f,s);var d=o[f];if(qh(c)){(!d||typeof d=="string"||typeof d=="number")&&(d=typeof d=="string"||typeof d=="number"?String(d):""),a.push({type:typeof d=="string"?Re.literal:Re.object,value:d});continue}if(rl(c)){var y=typeof c.style=="string"?r.date[c.style]:Wi(c.style)?c.style.parsedOptions:void 0;a.push({type:Re.literal,value:n.getDateTimeFormat(t,y).format(d)});continue}if(ol(c)){var y=typeof c.style=="string"?r.time[c.style]:Wi(c.style)?c.style.parsedOptions:r.time.medium;a.push({type:Re.literal,value:n.getDateTimeFormat(t,y).format(d)});continue}if(nl(c)){var y=typeof c.style=="string"?r.number[c.style]:ll(c.style)?c.style.parsedOptions:void 0;y&&y.scale&&(d=d*(y.scale||1)),a.push({type:Re.literal,value:n.getNumberFormat(t,y).format(d)});continue}if(al(c)){var v=c.children,h=c.value,m=o[h];if(!LC(m))throw new Zh(h,"function",s);var g=qi(v,t,n,r,o,i),p=m(g.map(function(C){return C.value}));Array.isArray(p)||(p=[p]),a.push.apply(a,p.map(function(C){return{type:typeof C=="string"?Re.literal:Re.object,value:C}}))}if(il(c)){var x=c.options[d]||c.options.other;if(!x)throw new Fd(c.value,d,Object.keys(c.options),s);a.push.apply(a,qi(x.value,t,n,r,o));continue}if(sl(c)){var x=c.options["=".concat(d)];if(!x){if(!Intl.PluralRules)throw new $i(`Intl.PluralRules is not available in this environment.
9
+ Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Te!==5&&(Te=2),l=$p(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var C=t0(d,i,t);fv(d,C);break e;case 1:i=l;var w=d.type,b=d.stateNode;if(!(d.flags&64)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Yt===null||!Yt.has(b)))){d.flags|=4096,t&=-t,d.lanes|=t;var R=n0(d,i,t);fv(d,R);break e}}d=d.return}while(d!==null)}c0(n)}catch(P){t=P,ve===n&&n!==null&&(ve=n=n.return);continue}break}while(1)}function l0(){var e=fu.current;return fu.current=du,e===null?du:e}function gs(e,t){var n=D;D|=16;var r=l0();Be===e&&Oe===t||Fo(e,t);do try{AT();break}catch(o){a0(e,o)}while(1);if(Dp(),D=n,fu.current=r,ve!==null)throw Error(T(261));return Be=null,Oe=0,Te}function AT(){for(;ve!==null;)u0(ve)}function LT(){for(;ve!==null&&!pT();)u0(ve)}function u0(e){var t=f0(e.alternate,e,Wr);e.memoizedProps=e.pendingProps,t===null?c0(e):ve=t,qp.current=null}function c0(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=ET(t),n!==null){n.flags&=2047,ve=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=wT(n,t,Wr),n!==null){ve=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||Wr&1073741824||!(n.mode&4)){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&!(e.flags&2048)&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1<t.flags&&(e.lastEffect!==null?e.lastEffect.nextEffect=t:e.firstEffect=t,e.lastEffect=t))}if(t=t.sibling,t!==null){ve=t;return}ve=t=e}while(t!==null);Te===0&&(Te=5)}function Dr(e){var t=Uo();return Kr(99,OT.bind(null,e,t)),null}function OT(e,t){do lr();while(bs!==null);if(D&48)throw Error(T(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(T(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-rr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(gn!==null&&!(r&24)&&gn.has(e)&&gn.delete(e),e===Be&&(ve=Be=null,Oe=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=D,D|=32,qp.current=null,ff=Fl,s=Jy(),Bf(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch{a=null;break e}var c=0,f=-1,d=-1,y=0,v=0,h=s,m=null;t:for(;;){for(var g;h!==a||i!==0&&h.nodeType!==3||(f=c+i),h!==l||u!==0&&h.nodeType!==3||(d=c+u),h.nodeType===3&&(c+=h.nodeValue.length),(g=h.firstChild)!==null;)m=h,h=g;for(;;){if(h===s)break t;if(m===a&&++y===i&&(f=c),m===l&&++v===u&&(d=c),(g=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;pf={focusedElem:s,selectionRange:a},Fl=!1,ks=null,Kl=!1,A=r;do try{NT()}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);ks=null,A=r;do try{for(s=e;A!==null;){var p=A.flags;if(p&16&&Rs(A.stateNode,""),p&128){var x=A.alternate;if(x!==null){var _=x.ref;_!==null&&(typeof _=="function"?_(null):_.current=null)}}switch(p&1038){case 2:Fv(A),A.flags&=-3;break;case 6:Fv(A),A.flags&=-3,xf(A.alternate,A);break;case 1024:A.flags&=-1025;break;case 1028:A.flags&=-1025,xf(A.alternate,A);break;case 4:xf(A.alternate,A);break;case 8:a=A,r0(s,a);var C=a.alternate;Mv(a),C!==null&&Mv(C)}A=A.nextEffect}}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);if(_=pf,x=Jy(),p=_.focusedElem,s=_.selectionRange,x!==p&&p&&p.ownerDocument&&_S(p.ownerDocument.documentElement,p)){for(s!==null&&Bf(p)&&(x=s.start,_=s.end,_===void 0&&(_=x),"selectionStart"in p?(p.selectionStart=x,p.selectionEnd=Math.min(_,p.value.length)):(_=(x=p.ownerDocument||document)&&x.defaultView||window,_.getSelection&&(_=_.getSelection(),a=p.textContent.length,C=Math.min(s.start,a),s=s.end===void 0?C:Math.min(s.end,a),!_.extend&&C>s&&(a=s,s=C,C=a),a=Zy(p,C),i=Zy(p,s),a&&i&&(_.rangeCount!==1||_.anchorNode!==a.node||_.anchorOffset!==a.offset||_.focusNode!==i.node||_.focusOffset!==i.offset)&&(x=x.createRange(),x.setStart(a.node,a.offset),_.removeAllRanges(),C>s?(_.addRange(x),_.extend(i.node,i.offset)):(x.setEnd(i.node,i.offset),_.addRange(x)))))),x=[],_=p;_=_.parentNode;)_.nodeType===1&&x.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<x.length;p++)_=x[p],_.element.scrollLeft=_.left,_.element.scrollTop=_.top}Fl=!!ff,pf=ff=null,e.current=n,A=r;do try{for(p=e;A!==null;){var w=A.flags;if(w&36&&kT(p,A.alternate,A),w&128){x=void 0;var b=A.ref;if(b!==null){var R=A.stateNode;switch(A.tag){case 5:x=R;break;default:x=R}typeof b=="function"?b(x):b.current=x}}A=A.nextEffect}}catch(P){if(A===null)throw Error(T(330));tr(A,P),A=A.nextEffect}while(A!==null);A=null,gT(),D=o}else e.current=n;if(ir)ir=!1,bs=e,ms=t;else for(A=r;A!==null;)t=A.nextEffect,A.nextEffect=null,A.flags&8&&(w=A,w.sibling=null,w.stateNode=null),A=t;if(r=e.pendingLanes,r===0&&(Yt=null),r===1?e===lp?Ts++:(Ts=0,lp=e):Ts=0,n=n.stateNode,zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(Np,n,void 0,(n.current.flags&64)===64)}catch{}if(_t(e,Le()),pu)throw pu=!1,e=ip,ip=null,e;return D&8||en(),null}function NT(){for(;A!==null;){var e=A.alternate;Kl||ks===null||(A.flags&8?By(A,ks)&&(Kl=!0):A.tag===13&&PT(e,A)&&By(A,ks)&&(Kl=!0));var t=A.flags;t&256&&TT(e,A),!(t&512)||ir||(ir=!0,Fs(97,function(){return lr(),null})),A=A.nextEffect}}function lr(){if(ms!==90){var e=97<ms?97:ms;return ms=90,Kr(e,DT)}return!1}function MT(e,t){sp.push(t,e),ir||(ir=!0,Fs(97,function(){return lr(),null}))}function d0(e,t){ap.push(t,e),ir||(ir=!0,Fs(97,function(){return lr(),null}))}function DT(){if(bs===null)return!1;var e=bs;if(bs=null,D&48)throw Error(T(331));var t=D;D|=32;var n=ap;ap=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(T(330));tr(i,l)}}for(n=sp,sp=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(T(330));tr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return D=t,en(),!0}function Bv(e,t,n){t=$p(n,t),t=t0(e,t,1),Zn(e,t),t=tt(),e=ku(e,1),e!==null&&(Su(e,1,t),_t(e,t))}function tr(e,t){if(e.tag===3)Bv(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){Bv(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Yt===null||!Yt.has(r))){e=$p(t,e);var o=n0(n,e,1);if(Zn(n,o),o=tt(),n=ku(n,1),n!==null)Su(n,1,o),_t(n,o);else if(typeof r.componentDidCatch=="function"&&(Yt===null||!Yt.has(r)))try{r.componentDidCatch(t,e)}catch{}break}}n=n.return}}function FT(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=tt(),e.pingedLanes|=e.suspendedLanes&n,Be===e&&(Oe&n)===n&&(Te===4||Te===3&&(Oe&62914560)===Oe&&500>Le()-Xp?Fo(e,0):Gp|=n),_t(e,t)}function jT(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(fn===0&&(fn=Wo),t=wo(62914560&~fn),t===0&&(t=4194304)):t=Uo()===99?1:2:t=1),n=tt(),e=ku(e,t),e!==null&&(Su(e,t,n),_t(e,n))}var f0;f0=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||$e.current)Dt=!0;else if(n&r)Dt=!!(e.flags&16384);else{switch(Dt=!1,t.tag){case 3:bv(t),yf();break;case 5:hv(t);break;case 1:qe(t.type)&&Hl(t);break;case 4:qf(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;de(tu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?Tv(e,t,n):(de(ce,ce.current&1),t=mn(e,t,n),t!==null?t.sibling:null);de(ce,ce.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return Av(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),de(ce,ce.current),r)break;return null;case 23:case 24:return t.lanes=0,vf(e,t,n)}return mn(e,t,n)}else Dt=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Ho(t,Ne.current),No(t,n),o=zp(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,qe(r)){var i=!0;Hl(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jp(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&ou(t,r,s,e),o.updater=bu,t.stateNode=o,o._reactInternals=t,$f(t,r,e,n),t=Yf(null,t,r,!0,i,n)}else t.tag=0,We(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=HT(o),e=Mt(o,e),i){case 0:t=Qf(null,t,o,e,n);break e;case 1:t=Cv(null,t,o,e,n);break e;case 11:t=wv(null,t,o,e,n);break e;case 14:t=Ev(null,t,o,Mt(o.type,e),r,n);break e}throw Error(T(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Qf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),Cv(e,t,r,o,n);case 3:if(bv(t),r=t.updateQueue,e===null||r===null)throw Error(T(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,FS(e,t),js(t,r,null,n),r=t.memoizedState.element,r===o)yf(),t=mn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(qn=Oo(t.stateNode.containerInfo.firstChild),pn=t,i=Jt=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],Mo.push(i);for(n=US(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else We(e,t,r,n),yf();t=t.child}return t;case 5:return hv(t),e===null&&Gf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,zf(r,o)?s=null:i!==null&&zf(r,i)&&(t.flags|=16),YS(e,t),We(e,t,s,n),t.child;case 6:return e===null&&Gf(t),null;case 13:return Tv(e,t,n);case 4:return qf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=iu(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),wv(e,t,r,o,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(de(tu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=yt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!$e.current){t=mn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=Yn(-1,n&-n),u.tag=2,Zn(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),DS(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}We(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,No(t,n),o=xt(o,i.unstable_observedBits),r=r(o),t.flags|=1,We(e,t,r,n),t.child;case 14:return o=t.type,i=Mt(o,t.pendingProps),i=Mt(o.type,i),Ev(e,t,o,i,r,n);case 15:return QS(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Mt(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,qe(r)?(e=!0,Hl(t)):e=!1,No(t,n),BS(t,r,o),$f(t,r,o,n),Yf(null,t,r,!0,e,n);case 19:return Av(e,t,n);case 23:return vf(e,t,n);case 24:return vf(e,t,n)}throw Error(T(156,t.tag))};function BT(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.flags=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,r){return new BT(e,t,n,r)}function Yp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function HT(e){if(typeof e=="function")return Yp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hu)return 11;if(e===yu)return 14}return 2}function sr(e,t){var n=e.alternate;return n===null?(n=vt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wl(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Yp(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Kn:return jo(n.children,o,i,t);case zv:s=8,o|=16;break;case pp:s=8,o|=1;break;case hs:return e=vt(12,n,t,o|8),e.elementType=hs,e.type=hs,e.lanes=i,e;case ys:return e=vt(13,n,t,o),e.type=ys,e.elementType=ys,e.lanes=i,e;case $l:return e=vt(19,n,t,o),e.elementType=$l,e.lanes=i,e;case Sp:return Zp(n,o,i,t);case Cf:return e=vt(24,n,t,o),e.elementType=Cf,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case mp:s=10;break e;case gp:s=9;break e;case hu:s=11;break e;case yu:s=14;break e;case hp:s=16,r=null;break e;case yp:s=22;break e}throw Error(T(130,e==null?e:typeof e,""))}return t=vt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function jo(e,t,n,r){return e=vt(7,e,r,t),e.lanes=n,e}function Zp(e,t,n,r){return e=vt(23,e,r,t),e.elementType=Sp,e.lanes=n,e}function _f(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function wf(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function UT(e,t,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=0,this.eventTimes=sf(0),this.expirationTimes=sf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sf(0),this.mutableSourceEagerHydrationData=null}function zT(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Fr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function mu(e,t,n,r){var o=t.current,i=tt(),s=Jn(o);e:if(n){n=n._reactInternals;t:{if(Gr(n)!==n||n.tag!==1)throw Error(T(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(qe(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(T(171))}if(n.tag===1){var l=n.type;if(qe(l)){n=RS(n,l,a);break e}}n=a}else n=or;return t.context===null?t.context=n:t.pendingContext=n,t=Yn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Zn(o,t),er(o,s,i),s}function Ef(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Hv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Jp(e,t){Hv(e,t),(e=e.alternate)&&Hv(e,t)}function VT(){return null}function em(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new UT(e,t,n!=null&&n.hydrate===!0),t=vt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,jp(t),e[Ko]=n.current,CS(e.nodeType===8?e.parentNode:e),r)for(e=0;e<r.length;e++){t=r[e];var o=t._getVersion;o=o(t._source),n.mutableSourceEagerHydrationData==null?n.mutableSourceEagerHydrationData=[t,o]:n.mutableSourceEagerHydrationData.push(t,o)}this._internalRoot=n}em.prototype.render=function(e){mu(e,this._internalRoot,null,null)};em.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;mu(null,e,null,function(){t[Ko]=null})};function $s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function KT(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new em(e,0,t?{hydrate:!0}:void 0)}function Pu(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Ef(s);a.call(u)}}mu(t,s,e,o)}else{if(i=n._reactRootContainer=KT(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Ef(s);l.call(u)}}s0(function(){mu(t,s,e,o)})}return Ef(s)}rS=function(e){if(e.tag===13){var t=tt();er(e,4,t),Jp(e,4)}};Cp=function(e){if(e.tag===13){var t=tt();er(e,67108864,t),Jp(e,67108864)}};oS=function(e){if(e.tag===13){var t=tt(),n=Jn(e);er(e,n,t),Jp(e,n)}};iS=function(e,t){return t()};Nf=function(e,t,n){switch(t){case"input":if(Tf(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Eu(r);if(!o)throw Error(T(90));Kv(r),Tf(r,o)}}}break;case"textarea":$v(e,n);break;case"select":t=n.value,t!=null&&Io(e,!!n.multiple,t,!1)}};_p=i0;Jv=function(e,t,n,r,o){var i=D;D|=4;try{return Kr(98,e.bind(null,t,n,r,o))}finally{D=i,D===0&&(qo(),en())}};wp=function(){!(D&49)&&(IT(),lr())};eS=function(e,t){var n=D;D|=2;try{return e(t)}finally{D=n,D===0&&(qo(),en())}};function p0(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$s(t))throw Error(T(200));return zT(e,t,null,n)}var WT={Events:[Vs,To,Eu,Yv,Zv,lr,{current:!1}]},us={findFiberByHostInstance:Br,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},$T={bundleType:us.bundleType,version:us.version,rendererPackageName:us.rendererPackageName,rendererConfig:us.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:qr.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=nS(e),e===null?null:e.stateNode},findFiberByHostInstance:us.findFiberByHostInstance||VT,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(cs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!cs.isDisabled&&cs.supportsFiber))try{Np=cs.inject($T),zr=cs}catch{}var cs;wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=WT;wt.createPortal=p0;wt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(T(188)):Error(T(268,Object.keys(e)));return e=nS(t),e=e===null?null:e.stateNode,e};wt.flushSync=function(e,t){var n=D;if(n&48)return e(t);D|=1;try{if(e)return Kr(99,e.bind(null,t))}finally{D=n,en()}};wt.hydrate=function(e,t,n){if(!$s(t))throw Error(T(200));return Pu(null,e,t,!0,n)};wt.render=function(e,t,n){if(!$s(t))throw Error(T(200));return Pu(null,e,t,!1,n)};wt.unmountComponentAtNode=function(e){if(!$s(e))throw Error(T(40));return e._reactRootContainer?(s0(function(){Pu(null,null,e,!1,function(){e._reactRootContainer=null,e[Ko]=null})}),!0):!1};wt.unstable_batchedUpdates=i0;wt.unstable_createPortal=function(e,t){return p0(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};wt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!$s(n))throw Error(T(200));if(e==null||e._reactInternals===void 0)throw Error(T(38));return Pu(e,t,n,!1,r)};wt.version="17.0.2"});var Ru=pe((BO,h0)=>{"use strict";function g0(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(g0)}catch(e){console.error(e)}}g0(),h0.exports=m0()});var K0=pe(V0=>{"use strict";var Jo=O();function Ik(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ak=typeof Object.is=="function"?Object.is:Ik,Lk=Jo.useState,Ok=Jo.useEffect,Nk=Jo.useLayoutEffect,Mk=Jo.useDebugValue;function Dk(e,t){var n=t(),r=Lk({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return Nk(function(){o.value=n,o.getSnapshot=t,km(o)&&i({inst:o})},[e,n,t]),Ok(function(){return km(o)&&i({inst:o}),e(function(){km(o)&&i({inst:o})})},[e]),Mk(n),n}function km(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ak(e,n)}catch{return!0}}function Fk(e,t){return t()}var jk=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Fk:Dk;V0.useSyncExternalStore=Jo.useSyncExternalStore!==void 0?Jo.useSyncExternalStore:jk});var Pm=pe((TN,W0)=>{"use strict";W0.exports=K0()});var q0=pe($0=>{"use strict";var Fu=O(),Bk=Pm();function Hk(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Uk=typeof Object.is=="function"?Object.is:Hk,zk=Bk.useSyncExternalStore,Vk=Fu.useRef,Kk=Fu.useEffect,Wk=Fu.useMemo,$k=Fu.useDebugValue;$0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=Vk(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=Wk(function(){function l(y){if(!u){if(u=!0,c=y,y=r(y),o!==void 0&&s.hasValue){var v=s.value;if(o(v,y))return f=v}return f=y}if(v=f,Uk(c,y))return v;var h=r(y);return o!==void 0&&o(v,h)?v:(c=y,f=h)}var u=!1,c,f,d=n===void 0?null:n;return[function(){return l(t())},d===null?void 0:function(){return l(d())}]},[t,n,r,o]);var a=zk(e,i[0],i[1]);return Kk(function(){s.hasValue=!0,s.value=a},[a]),$k(a),a}});var X0=pe((PN,G0)=>{"use strict";G0.exports=q0()});var sx=pe(Q=>{"use strict";var _e=typeof Symbol=="function"&&Symbol.for,Im=_e?Symbol.for("react.element"):60103,Am=_e?Symbol.for("react.portal"):60106,Uu=_e?Symbol.for("react.fragment"):60107,zu=_e?Symbol.for("react.strict_mode"):60108,Vu=_e?Symbol.for("react.profiler"):60114,Ku=_e?Symbol.for("react.provider"):60109,Wu=_e?Symbol.for("react.context"):60110,Lm=_e?Symbol.for("react.async_mode"):60111,$u=_e?Symbol.for("react.concurrent_mode"):60111,qu=_e?Symbol.for("react.forward_ref"):60112,Gu=_e?Symbol.for("react.suspense"):60113,Qk=_e?Symbol.for("react.suspense_list"):60120,Xu=_e?Symbol.for("react.memo"):60115,Qu=_e?Symbol.for("react.lazy"):60116,Yk=_e?Symbol.for("react.block"):60121,Zk=_e?Symbol.for("react.fundamental"):60117,Jk=_e?Symbol.for("react.responder"):60118,eP=_e?Symbol.for("react.scope"):60119;function ot(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Im:switch(e=e.type,e){case Lm:case $u:case Uu:case Vu:case zu:case Gu:return e;default:switch(e=e&&e.$$typeof,e){case Wu:case qu:case Qu:case Xu:case Ku:return e;default:return t}}case Am:return t}}}function ix(e){return ot(e)===$u}Q.AsyncMode=Lm;Q.ConcurrentMode=$u;Q.ContextConsumer=Wu;Q.ContextProvider=Ku;Q.Element=Im;Q.ForwardRef=qu;Q.Fragment=Uu;Q.Lazy=Qu;Q.Memo=Xu;Q.Portal=Am;Q.Profiler=Vu;Q.StrictMode=zu;Q.Suspense=Gu;Q.isAsyncMode=function(e){return ix(e)||ot(e)===Lm};Q.isConcurrentMode=ix;Q.isContextConsumer=function(e){return ot(e)===Wu};Q.isContextProvider=function(e){return ot(e)===Ku};Q.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Im};Q.isForwardRef=function(e){return ot(e)===qu};Q.isFragment=function(e){return ot(e)===Uu};Q.isLazy=function(e){return ot(e)===Qu};Q.isMemo=function(e){return ot(e)===Xu};Q.isPortal=function(e){return ot(e)===Am};Q.isProfiler=function(e){return ot(e)===Vu};Q.isStrictMode=function(e){return ot(e)===zu};Q.isSuspense=function(e){return ot(e)===Gu};Q.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Uu||e===$u||e===Vu||e===zu||e===Gu||e===Qk||typeof e=="object"&&e!==null&&(e.$$typeof===Qu||e.$$typeof===Xu||e.$$typeof===Ku||e.$$typeof===Wu||e.$$typeof===qu||e.$$typeof===Zk||e.$$typeof===Jk||e.$$typeof===eP||e.$$typeof===Yk)};Q.typeOf=ot});var lx=pe((zN,ax)=>{"use strict";ax.exports=sx()});var gx=pe((VN,mx)=>{"use strict";var Om=lx(),tP={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},nP={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},rP={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},fx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nm={};Nm[Om.ForwardRef]=rP;Nm[Om.Memo]=fx;function ux(e){return Om.isMemo(e)?fx:Nm[e.$$typeof]||tP}var oP=Object.defineProperty,iP=Object.getOwnPropertyNames,cx=Object.getOwnPropertySymbols,sP=Object.getOwnPropertyDescriptor,aP=Object.getPrototypeOf,dx=Object.prototype;function px(e,t,n){if(typeof t!="string"){if(dx){var r=aP(t);r&&r!==dx&&px(e,r,n)}var o=iP(t);cx&&(o=o.concat(cx(t)));for(var i=ux(e),s=ux(t),a=0;a<o.length;++a){var l=o[a];if(!nP[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=sP(t,l);try{oP(e,l,u)}catch{}}}}return e}mx.exports=px});var yx=pe(Y=>{"use strict";var Mm=Symbol.for("react.element"),Dm=Symbol.for("react.portal"),Yu=Symbol.for("react.fragment"),Zu=Symbol.for("react.strict_mode"),Ju=Symbol.for("react.profiler"),ec=Symbol.for("react.provider"),tc=Symbol.for("react.context"),lP=Symbol.for("react.server_context"),nc=Symbol.for("react.forward_ref"),rc=Symbol.for("react.suspense"),oc=Symbol.for("react.suspense_list"),ic=Symbol.for("react.memo"),sc=Symbol.for("react.lazy"),uP=Symbol.for("react.offscreen"),hx;hx=Symbol.for("react.module.reference");function Ct(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Mm:switch(e=e.type,e){case Yu:case Ju:case Zu:case rc:case oc:return e;default:switch(e=e&&e.$$typeof,e){case lP:case tc:case nc:case sc:case ic:case ec:return e;default:return t}}case Dm:return t}}}Y.ContextConsumer=tc;Y.ContextProvider=ec;Y.Element=Mm;Y.ForwardRef=nc;Y.Fragment=Yu;Y.Lazy=sc;Y.Memo=ic;Y.Portal=Dm;Y.Profiler=Ju;Y.StrictMode=Zu;Y.Suspense=rc;Y.SuspenseList=oc;Y.isAsyncMode=function(){return!1};Y.isConcurrentMode=function(){return!1};Y.isContextConsumer=function(e){return Ct(e)===tc};Y.isContextProvider=function(e){return Ct(e)===ec};Y.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Mm};Y.isForwardRef=function(e){return Ct(e)===nc};Y.isFragment=function(e){return Ct(e)===Yu};Y.isLazy=function(e){return Ct(e)===sc};Y.isMemo=function(e){return Ct(e)===ic};Y.isPortal=function(e){return Ct(e)===Dm};Y.isProfiler=function(e){return Ct(e)===Ju};Y.isStrictMode=function(e){return Ct(e)===Zu};Y.isSuspense=function(e){return Ct(e)===rc};Y.isSuspenseList=function(e){return Ct(e)===oc};Y.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Yu||e===Ju||e===Zu||e===rc||e===oc||e===uP||typeof e=="object"&&e!==null&&(e.$$typeof===sc||e.$$typeof===ic||e.$$typeof===ec||e.$$typeof===tc||e.$$typeof===nc||e.$$typeof===hx||e.getModuleId!==void 0)};Y.typeOf=Ct});var Sx=pe((WN,vx)=>{"use strict";vx.exports=yx()});var a_=pe((G2,s_)=>{"use strict";var UP=/["'&<>]/;s_.exports=zP;function zP(e){var t=""+e,n=UP.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var Ag=pe((i8,Mw)=>{"use strict";var LR="Expected a function",Ow=NaN,OR="[object Symbol]",NR=/^\s+|\s+$/g,MR=/^[-+]0x[0-9a-f]+$/i,DR=/^0b[01]+$/i,FR=/^0o[0-7]+$/i,jR=parseInt,BR=typeof global=="object"&&global&&global.Object===Object&&global,HR=typeof self=="object"&&self&&self.Object===Object&&self,UR=BR||HR||Function("return this")(),zR=Object.prototype,VR=zR.toString,KR=Math.max,WR=Math.min,Rg=function(){return UR.Date.now()};function $R(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(LR);t=Nw(t)||0,Ig(n)&&(c=!!n.leading,f="maxWait"in n,i=f?KR(Nw(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function y(w){var b=r,R=o;return r=o=void 0,u=w,s=e.apply(R,b),s}function v(w){return u=w,a=setTimeout(g,t),c?y(w):s}function h(w){var b=w-l,R=w-u,P=t-b;return f?WR(P,i-R):P}function m(w){var b=w-l,R=w-u;return l===void 0||b>=t||b<0||f&&R>=i}function g(){var w=Rg();if(m(w))return p(w);a=setTimeout(g,h(w))}function p(w){return a=void 0,d&&r?y(w):(r=o=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function _(){return a===void 0?s:p(Rg())}function C(){var w=Rg(),b=m(w);if(r=arguments,o=this,l=w,b){if(a===void 0)return v(l);if(f)return a=setTimeout(g,t),y(l)}return a===void 0&&(a=setTimeout(g,t)),s}return C.cancel=x,C.flush=_,C}function Ig(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function qR(e){return!!e&&typeof e=="object"}function GR(e){return typeof e=="symbol"||qR(e)&&VR.call(e)==OR}function Nw(e){if(typeof e=="number")return e;if(GR(e))return Ow;if(Ig(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ig(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(NR,"");var n=DR.test(e);return n||FR.test(e)?jR(e.slice(2),n?2:8):MR.test(e)?Ow:+e}Mw.exports=$R});var OA={};Ce(OA,{Card:()=>me,Chip:()=>ny,ContentEditableInput:()=>ao,DeepdeskAPI:()=>Fn,DeepdeskSDK:()=>Ba,HTTPClient:()=>Wt,InputMediator:()=>_n,InputType:()=>Un,KeyboardHint:()=>pl,Label:()=>ml,Locale:()=>ea,Section:()=>Hn,SectionList:()=>gl,Sources:()=>Ot,Suggestion:()=>oe,SuggestionList:()=>qt,TextAreaInput:()=>wn,ToggleButton:()=>Nr,attachFile:()=>nC,authenticateWithKey:()=>eC,createFullRange:()=>Oi,createOverlayContainer:()=>mi,createRangeFromOffsets:()=>kr,escapeHTML:()=>ki,fetchPlatformConfig:()=>tC,formatTextMarkup:()=>JE,getRangeOffsets:()=>Ma,getRangeText:()=>Da,isSupportedInputElement:()=>wd,updateContentEditable:()=>ZE,updateTextArea:()=>YE,useStyles:()=>k,waitForElementVisibilityChange:()=>Ed});var Xa=S(X()),pt=S(O());var qa=S(O()),Bh=S(X()),zi=qa.default.createContext({});function k(e,t){let{debug:n,...r}=(0,qa.useContext)(zi),o=r[e];return o?Object.entries(t).reduce((i,[s,a])=>{let l=o[s];return{...i,[s]:(0,Bh.default)(a,l,n?`${e}__${s}`:!1)}},{}):t}var Hh={root:"_root_vr71j_1"};var Ar=S(E()),Ga=()=>(0,Ar.jsxs)("svg",{className:Hh.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ar.jsx)("defs",{children:(0,Ar.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Ar.jsx)("title",{children:"Failed loading image"}),(0,Ar.jsx)("path",{className:"cls-1",d:"M15 130.896V16.994c0-1.097.898-1.994 2.007-1.994h150.986A2 2 0 0 1 170 16.994v69.147L133.015 51 87.26 120.377l-35.863-17.758L15 130.896zM2 0C.895 0 0 .887 0 2v166c0 1.105.887 2 2 2h181c1.105 0 2-.887 2-2V2c0-1.105-.887-2-2-2H2zm49 72c11.046 0 20-9.178 20-20.5S62.046 31 51 31s-20 9.178-20 20.5S39.954 72 51 72z",fillRule:"evenodd"})]});var Ad={root:"_root_4e7lf_1",imageWrapper:"_imageWrapper_4e7lf_7",image:"_image_4e7lf_7",content:"_content_4e7lf_24",title:"_title_4e7lf_35",contentIsCropped:"_contentIsCropped_4e7lf_45",lineClamp:"_lineClamp_4e7lf_51"};var Lr=S(E()),Qa=(0,pt.createContext)(Ad),wC=({title:e,src:t})=>{let n=(0,pt.useContext)(Qa),[r,o]=(0,pt.useState)(!1);return(0,pt.useEffect)(()=>{o(!1)},[t]),(0,Lr.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,Lr.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,Lr.jsx)(Ga,{})})},EC=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,pt.useContext)(Qa);return(0,Lr.jsx)("div",{className:(0,Xa.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},CC=({as:e="h1",cropText:t=!1,className:n,children:r,...o})=>{let i=(0,pt.useContext)(Qa);return pt.default.createElement(e,{className:(0,Xa.default)(i.title,n,{[i.contentIsCropped]:t}),...o},r)},Ya=({children:e})=>{let t=k("Card",Ad);return(0,Lr.jsx)("div",{className:(0,Xa.default)(t.root),children:(0,Lr.jsx)(Qa.Provider,{value:t,children:e})})};Ya.Image=wC;Ya.Content=EC;Ya.Title=CC;var me=Ya;var Wh={root:"_root_nkim0_1"};var dl=S(O());var Ld=function(e,t){return Ld=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Ld(e,t)};function Ki(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Ld(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var et=function(){return et=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},et.apply(this,arguments)};function $h(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Za(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Ja;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Ja||(Ja={}));var el=class{constructor(t){console.warn(`[vite-messages-plugin]: Message "${t}" was not precompiled. Did you use the correct extenstion *.messages.ts?`)}};var Lt;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(Lt||(Lt={}));var tl;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(tl||(tl={}));function Od(e){return e.type===Lt.literal}function qh(e){return e.type===Lt.argument}function nl(e){return e.type===Lt.number}function rl(e){return e.type===Lt.date}function ol(e){return e.type===Lt.time}function il(e){return e.type===Lt.select}function sl(e){return e.type===Lt.plural}function Gh(e){return e.type===Lt.pound}function al(e){return e.type===Lt.tag}function ll(e){return!!(e&&typeof e=="object"&&e.type===tl.number)}function Wi(e){return!!(e&&typeof e=="object"&&e.type===tl.dateTime)}function Nd(e){e.forEach(function(t){if(delete t.location,il(t)||sl(t))for(var n in t.options)delete t.options[n].location,Nd(t.options[n].value);else nl(t)&&ll(t.style)||(rl(t)||ol(t))&&Wi(t.style)?delete t.style.location:al(t)&&Nd(t.children)})}function Xh(e,t){t===void 0&&(t={}),t=et({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new el(e,t).parse();if(n.err){var r=SyntaxError(Ja[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||Nd(n.val),n.val}function ul(e,t){var n=t&&t.cache?t.cache:IC,r=t&&t.serializer?t.serializer:RC,o=t&&t.strategy?t.strategy:TC;return o(e,{cache:n,serializer:r})}function bC(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Qh(e,t,n,r){var o=bC(r)?r:n(r),i=t.get(o);return typeof i>"u"&&(i=e.call(this,r),t.set(o,i)),i}function Yh(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return typeof i>"u"&&(i=e.apply(this,r),t.set(o,i)),i}function Md(e,t,n,r,o){return n.bind(t,e,r,o)}function TC(e,t){var n=e.length===1?Qh:Yh;return Md(e,this,n,t.cache.create(),t.serializer)}function kC(e,t){return Md(e,this,Yh,t.cache.create(),t.serializer)}function PC(e,t){return Md(e,this,Qh,t.cache.create(),t.serializer)}var RC=function(){return JSON.stringify(arguments)};function Dd(){this.cache=Object.create(null)}Dd.prototype.get=function(e){return this.cache[e]};Dd.prototype.set=function(e,t){this.cache[e]=t};var IC={create:function(){return new Dd}},cl={variadic:kC,monadic:PC};var Or;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Or||(Or={}));var $i=function(e){Ki(t,e);function t(n,r,o){var i=e.call(this,n)||this;return i.code=r,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var Fd=function(e){Ki(t,e);function t(n,r,o,i){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(o).join('", "'),'"'),Or.INVALID_VALUE,i)||this}return t}($i);var Zh=function(e){Ki(t,e);function t(n,r,o){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Or.INVALID_VALUE,o)||this}return t}($i);var Jh=function(e){Ki(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Or.MISSING_VALUE,r)||this}return t}($i);var Re;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Re||(Re={}));function AC(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==Re.literal||n.type!==Re.literal?t.push(n):r.value+=n.value,t},[])}function LC(e){return typeof e=="function"}function qi(e,t,n,r,o,i,s){if(e.length===1&&Od(e[0]))return[{type:Re.literal,value:e[0].value}];for(var a=[],l=0,u=e;l<u.length;l++){var c=u[l];if(Od(c)){a.push({type:Re.literal,value:c.value});continue}if(Gh(c)){typeof i=="number"&&a.push({type:Re.literal,value:n.getNumberFormat(t).format(i)});continue}var f=c.value;if(!(o&&f in o))throw new Jh(f,s);var d=o[f];if(qh(c)){(!d||typeof d=="string"||typeof d=="number")&&(d=typeof d=="string"||typeof d=="number"?String(d):""),a.push({type:typeof d=="string"?Re.literal:Re.object,value:d});continue}if(rl(c)){var y=typeof c.style=="string"?r.date[c.style]:Wi(c.style)?c.style.parsedOptions:void 0;a.push({type:Re.literal,value:n.getDateTimeFormat(t,y).format(d)});continue}if(ol(c)){var y=typeof c.style=="string"?r.time[c.style]:Wi(c.style)?c.style.parsedOptions:r.time.medium;a.push({type:Re.literal,value:n.getDateTimeFormat(t,y).format(d)});continue}if(nl(c)){var y=typeof c.style=="string"?r.number[c.style]:ll(c.style)?c.style.parsedOptions:void 0;y&&y.scale&&(d=d*(y.scale||1)),a.push({type:Re.literal,value:n.getNumberFormat(t,y).format(d)});continue}if(al(c)){var v=c.children,h=c.value,m=o[h];if(!LC(m))throw new Zh(h,"function",s);var g=qi(v,t,n,r,o,i),p=m(g.map(function(C){return C.value}));Array.isArray(p)||(p=[p]),a.push.apply(a,p.map(function(C){return{type:typeof C=="string"?Re.literal:Re.object,value:C}}))}if(il(c)){var x=c.options[d]||c.options.other;if(!x)throw new Fd(c.value,d,Object.keys(c.options),s);a.push.apply(a,qi(x.value,t,n,r,o));continue}if(sl(c)){var x=c.options["=".concat(d)];if(!x){if(!Intl.PluralRules)throw new $i(`Intl.PluralRules is not available in this environment.
10
10
  Try polyfilling it using "@formatjs/intl-pluralrules"
11
11
  `,Or.MISSING_INTL_API,s);var _=n.getPluralRules(t,{type:c.pluralType}).select(d-(c.offset||0));x=c.options[_]||c.options.other}if(!x)throw new Fd(c.value,d,Object.keys(c.options),s);a.push.apply(a,qi(x.value,t,n,r,o,d-(c.offset||0)));continue}}return AC(a)}function OC(e,t){return t?et(et(et({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=et(et({},e[r]),t[r]||{}),n},{})):e}function NC(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=OC(e[r],t[r]),n},et({},e)):e}function jd(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function MC(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:ul(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,Za([void 0],n,!1)))},{cache:jd(e.number),strategy:cl.variadic}),getDateTimeFormat:ul(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,Za([void 0],n,!1)))},{cache:jd(e.dateTime),strategy:cl.variadic}),getPluralRules:ul(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,Za([void 0],n,!1)))},{cache:jd(e.pluralRules),strategy:cl.variadic})}}var ey=function(){function e(t,n,r,o){n===void 0&&(n=e.defaultLocale);var i=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var c=i.formatToParts(u);if(c.length===1)return c[0].value;var f=c.reduce(function(d,y){return!d.length||y.type!==Re.literal||typeof d[d.length-1]!="string"?d.push(y.value):d[d.length-1]+=y.value,d},[]);return f.length<=1?f[0]||"":f},this.formatToParts=function(u){return qi(i.ast,i.locales,i.formatters,i.formats,u,void 0,i.message)},this.resolvedOptions=function(){var u;return{locale:((u=i.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(i.locales)[0]}},this.getAst=function(){return i.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},a=s.formatters,l=$h(s,["formatters"]);this.ast=e.__parse(t,et(et({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=NC(e.formats,r),this.formatters=o&&o.formatters||MC(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(!(typeof Intl.Locale>"u")){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Xh,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function DC(e,t){return t.split(".").reduce((n,r)=>n?n[r]:void 0,e)}var FC="dummy",Bd=(0,dl.createContext)(null);function j(e){let t=(0,dl.useContext)(Bd);if(!t)throw new Error("useTranslator() may be used only in the context of a <LocaleContext> component.");let n=e[t]??{};return(r,o)=>{let i=DC(n,r);return i?new ey(i).format(o):(t!==FC&&console.warn(`${r} does not exist in messages of ${t}`),`[${r}]`)}}var Hd={};Ce(Hd,{enUS:()=>jC,nlNL:()=>BC});var jC={experimental:[{type:0,value:"Experimental"}]},BC={experimental:[{type:0,value:"Experimenteel"}]};var Ud=S(E()),ty=({children:e})=>{let t=k("Chip",Wh);return(0,Ud.jsx)("span",{className:t.root,children:e})},fl=()=>{let e=j(Hd);return(0,Ud.jsx)(ty,{children:e("experimental")})},ny=ty;var oy=S(X());var ry={root:"_root_cq1yq_1"};var iy=S(E());var HC={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},UC=({className:e,keyCode:t,...n})=>{let r=k("KeyboardHint",ry);return(0,iy.jsx)("span",{"data-key":HC[t],className:(0,oy.default)(e,r.root),...n})},pl=UC;var ay=S(X());var sy={root:"_root_4a08n_1"};var ly=S(E()),zC=({className:e,children:t,...n})=>{let r=k("Label",sy);return(0,ly.jsx)("span",{...n,className:(0,ay.default)(e,r.root),children:t})},ml=zC;var uy={root:"_root_jlggj_1",subTitleContainer:"_subTitleContainer_jlggj_5",subtitle:"_subtitle_jlggj_9",suggestions:"_suggestions_jlggj_17"};var po=S(E()),VC=({title:e,children:t,type:n,...r})=>{let o=k("Section",uy);return(0,po.jsxs)("section",{...r,className:o.root,"data-section-type":n,children:[e&&(0,po.jsx)("div",{className:o.subTitleContainer,children:(0,po.jsx)("span",{className:o.subtitle,children:e})}),(0,po.jsx)("div",{className:o.suggestions,children:t})]})},Hn=VC;var dy=S(X()),fy=S(O());var cy={root:"_root_19wxp_1"};var py=S(E()),KC=fy.default.forwardRef(({className:e,children:t},n)=>{let r=k("SectionList",cy);return(0,py.jsx)("div",{ref:n,className:(0,dy.default)(r.root,e),children:t})}),gl=KC;var Gi=S(X()),gt=S(O());var zd={root:"_root_9kn3u_10",fadein:"_fadein_9kn3u_1",isClickable:"_isClickable_9kn3u_47",isSelected:"_isSelected_9kn3u_52",actions:"_actions_9kn3u_76",actionsIsFixed:"_actionsIsFixed_9kn3u_98",actionButton:"_actionButton_9kn3u_106",dropdownList:"_dropdownList_9kn3u_127",dropdownButton:"_dropdownButton_9kn3u_142",dropdownItem:"_dropdownItem_9kn3u_152",dropdownItemButton:"_dropdownItemButton_9kn3u_161",actionButtonIsPrimary:"_actionButtonIsPrimary_9kn3u_175",actionButtonIsDisabled:"_actionButtonIsDisabled_9kn3u_179",labels:"_labels_9kn3u_187",label:"_label_9kn3u_187"};var mt=S(E()),mo=(0,gt.createContext)(zd),WC=({fixed:e,children:t,...n})=>{let r=(0,gt.useContext)(mo);return(0,mt.jsx)("div",{...n,className:(0,Gi.default)(r.actions,{[r.actionsIsFixed]:e}),children:t})},$C=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,gt.useContext)(mo);return(0,mt.jsxs)("div",{className:(0,Gi.default)(e,i.actionButton,i.dropdownButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[r,(0,mt.jsx)("ul",{className:i.dropdownList,children:o})]})},qC=({index:e,label:t,onClick:n})=>{let r=(0,gt.useContext)(mo);return(0,mt.jsx)("li",{className:r.dropdownItem,children:(0,mt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},GC=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,gt.useContext)(mo);return(0,mt.jsx)("button",{type:"button",className:(0,Gi.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r??(s=>s.stopPropagation()),disabled:n,"aria-hidden":n,children:o})},Vd=({labels:e})=>{let t=(0,gt.useContext)(mo);return(0,mt.jsx)("div",{className:t.labels,children:e.map(n=>(0,mt.jsx)("span",{className:t.label,children:n},n))})},go=gt.default.forwardRef(({className:e,selected:t,onClick:n,children:r,as:o="div",...i},s)=>{let a=k("Suggestion",zd),l=(0,gt.useCallback)(u=>{u.preventDefault(),n&&n(u)},[n]);return(0,mt.jsx)(o,{...i,ref:s,className:(0,Gi.default)(e,a.root,{[a.isSelected]:t,[a.isClickable]:!!n}),onClick:l,children:(0,mt.jsx)(mo.Provider,{value:a,children:r})})});go.Labels=Vd;go.Actions=WC;go.ActionButton=GC;go.DropdownButton=$C;go.DropdownItem=qC;var oe=go;var gy=S(X());var my={root:"_root_fp74r_1",isWithDivider:"_isWithDivider_fp74r_9"};var hy=S(E()),XC=({withDivider:e,children:t})=>{let n=k("SuggestionList",my);return(0,hy.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,gy.default)(n.root,{[n.isWithDivider]:e}),children:t})},qt=XC;var vy=S(X());var yy={root:"_root_1wpmq_1",isCollapsed:"_isCollapsed_1wpmq_17"};var hl=S(E()),QC=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=k("ToggleButton",yy);return(0,hl.jsx)("button",{type:"button",className:(0,vy.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,hl.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,hl.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},Nr=QC;var Sy=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,ho=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var xy=/x-deepdesk-(([a-z0-9\-_])+-version)/,Ot=(h=>(h.SEARCH="search",h.TEMPLATE="template",h.ELASTIC_SEARCH="search-autocomplete",h.GPT="gpt",h.TRIE="trie",h.TRIE_WITH_TYPOS="trie-with-typos",h.SEMANTIC="semantic",h.TEXT_RECOMMENDATION="text_recommendation",h.URL_RECOMMENDATION="url_recommendation",h.LINK_RECOMMENDATION="link_recommendation",h.PERSONAL_COLLECTION="personal-collection",h.PERSONAL_COLLECTION_SEARCH="personal-collection-search",h.SEARCH_OVERLAY="search-overlay",h.SEARCH_PREVIEW="search-preview",h.SEARCH_URL="search-url",h))(Ot||{}),Un=(o=>(o.TAB="tab",o.ARROW="arrow",o.HOTKEY="hotkey",o.MOUSE="mouse",o))(Un||{});var jn=S(Ru());var s1=S(O());function Et(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!1)var o,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function yn(e){return!!e&&!!e[le]}function Ft(e){var t;return!!e&&(function(n){if(!n||typeof n!="object")return!1;var r=Object.getPrototypeOf(n);if(r===null)return!0;var o=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return o===Object||typeof o=="function"&&Function.toString.call(o)===ek}(e)||Array.isArray(e)||!!e[E0]||!!(!((t=e.constructor)===null||t===void 0)&&t[E0])||um(e)||cm(e))}function Qr(e,t,n){n===void 0&&(n=!1),Qo(e)===0?(n?Object.keys:Xo)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Qo(e){var t=e[le];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:um(e)?2:cm(e)?3:0}function Go(e,t){return Qo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function qT(e,t){return Qo(e)===2?e.get(t):e[t]}function C0(e,t,n){var r=Qo(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function b0(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function um(e){return ZT&&e instanceof Map}function cm(e){return JT&&e instanceof Set}function ur(e){return e.o||e.t}function dm(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=P0(e);delete t[le];for(var n=Xo(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function fm(e,t){return t===void 0&&(t=!1),pm(e)||yn(e)||!Ft(e)||(Qo(e)>1&&(e.set=e.add=e.clear=e.delete=GT),Object.freeze(e),t&&Qr(e,function(n,r){return fm(r,!0)},!0)),e}function GT(){Et(2)}function pm(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function tn(e){var t=lm[e];return t||Et(18,e),t}function XT(e,t){lm[e]||(lm[e]=t)}function im(){return Gs}function tm(e,t){t&&(tn("Patches"),e.u=[],e.s=[],e.v=t)}function Iu(e){sm(e),e.p.forEach(QT),e.p=null}function sm(e){e===Gs&&(Gs=e.l)}function y0(e){return Gs={p:[],l:Gs,h:e,m:!0,_:0}}function QT(e){var t=e[le];t.i===0||t.i===1?t.j():t.g=!0}function nm(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||tn("ES5").S(t,e,r),r?(n[le].P&&(Iu(t),Et(4)),Ft(e)&&(e=Au(t,e),t.l||Lu(t,e)),t.u&&tn("Patches").M(n[le].t,e,t.u,t.s)):e=Au(t,n,[]),Iu(t),t.u&&t.v(t.u,t.s),e!==k0?e:void 0}function Au(e,t,n){if(pm(t))return t;var r=t[le];if(!r)return Qr(t,function(a,l){return v0(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Lu(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=dm(r.k):r.o,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),Qr(i,function(a,l){return v0(e,r,o,a,l,n,s)}),Lu(e,o,!1),n&&e.u&&tn("Patches").N(r,n,e.u,e.s)}return r.o}function v0(e,t,n,r,o,i,s){if(yn(o)){var a=Au(e,o,i&&t&&t.i!==3&&!Go(t.R,r)?i.concat(r):void 0);if(C0(n,r,a),!yn(a))return;e.m=!1}else s&&n.add(o);if(Ft(o)&&!pm(o)){if(!e.h.D&&e._<1)return;Au(e,o),t&&t.A.l||Lu(e,o)}}function Lu(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&fm(t,n)}function rm(e,t){var n=e[le];return(n?ur(n):e)[t]}function S0(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function cr(e){e.P||(e.P=!0,e.l&&cr(e.l))}function om(e){e.o||(e.o=dm(e.t))}function am(e,t,n){var r=um(t)?tn("MapSet").F(t,n):cm(t)?tn("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:im(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=a,u=Xs;s&&(l=[a],u=qs);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):tn("ES5").J(t,n);return(n?n.A:im()).p.push(r),r}function YT(e){return yn(e)||Et(22,e),function t(n){if(!Ft(n))return n;var r,o=n[le],i=Qo(n);if(o){if(!o.P&&(o.i<4||!tn("ES5").K(o)))return o.t;o.I=!0,r=x0(n,i),o.I=!1}else r=x0(n,i);return Qr(r,function(s,a){o&&qT(o.t,s)===a||C0(r,s,t(a))}),i===3?new Set(r):r}(e)}function x0(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return dm(e)}function T0(){function e(s,a){var l=i[s];return l?l.enumerable=a:i[s]=l={configurable:!0,enumerable:a,get:function(){var u=this[le];return Xs.get(u,s)},set:function(u){var c=this[le];Xs.set(c,s,u)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][le];if(!l.P)switch(l.i){case 5:r(l)&&cr(l);break;case 4:n(l)&&cr(l)}}}function n(s){for(var a=s.t,l=s.k,u=Xo(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==le){var d=a[f];if(d===void 0&&!Go(a,f))return!0;var y=l[f],v=y&&y[le];if(v?v.t!==d:!b0(y,d))return!0}}var h=!!a[le];return u.length!==Xo(a).length+(h?0:1)}function r(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function o(s){s.g&&Et(3,JSON.stringify(ur(s)))}var i={};XT("ES5",{J:function(s,a){var l=Array.isArray(s),u=function(f,d){if(f){for(var y=Array(d.length),v=0;v<d.length;v++)Object.defineProperty(y,""+v,e(v,!0));return y}var h=P0(d);delete h[le];for(var m=Xo(h),g=0;g<m.length;g++){var p=m[g];h[p]=e(p,f||!!h[p].enumerable)}return Object.create(Object.getPrototypeOf(d),h)}(l,s),c={i:l?5:4,A:a?a.A:im(),P:!1,I:!1,R:{},l:a,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,le,{value:c,writable:!0}),u},S:function(s,a,l){l?yn(a)&&a[le].A===s&&t(s.p):(s.u&&function u(c){if(c&&typeof c=="object"){var f=c[le];if(f){var d=f.t,y=f.k,v=f.R,h=f.i;if(h===4)Qr(y,function(_){_!==le&&(d[_]!==void 0||Go(d,_)?v[_]||u(y[_]):(v[_]=!0,cr(f)))}),Qr(d,function(_){y[_]!==void 0||Go(y,_)||(v[_]=!1,cr(f))});else if(h===5){if(r(f)&&(cr(f),v.length=!0),y.length<d.length)for(var m=y.length;m<d.length;m++)v[m]=!1;else for(var g=d.length;g<y.length;g++)v[g]=!0;for(var p=Math.min(y.length,d.length),x=0;x<p;x++)y.hasOwnProperty(x)||(v[x]=!0),v[x]===void 0&&u(y[x])}}}}(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):r(s)}})}var _0,Gs,mm=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",ZT=typeof Map<"u",JT=typeof Set<"u",w0=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",k0=mm?Symbol.for("immer-nothing"):((_0={})["immer-nothing"]=!0,_0),E0=mm?Symbol.for("immer-draftable"):"__$immer_draftable",le=mm?Symbol.for("immer-state"):"__$immer_state";var ek=""+Object.prototype.constructor,Xo=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,P0=Object.getOwnPropertyDescriptors||function(e){var t={};return Xo(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},lm={},Xs={get:function(e,t){if(t===le)return e;var n=ur(e);if(!Go(n,t))return function(o,i,s){var a,l=S0(i,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Ft(r)?r:r===rm(e.t,t)?(om(e),e.o[t]=am(e.A.h,r,e)):r},has:function(e,t){return t in ur(e)},ownKeys:function(e){return Reflect.ownKeys(ur(e))},set:function(e,t,n){var r=S0(ur(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=rm(ur(e),t),i=o==null?void 0:o[le];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(b0(n,o)&&(n!==void 0||Go(e.t,t)))return!0;om(e),cr(e)}return e.o[t]===n&&(n!==void 0||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return rm(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,om(e),cr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=ur(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Et(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Et(12)}},qs={};Qr(Xs,function(e,t){qs[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),qs.deleteProperty=function(e,t){return qs.set.call(this,e,t,void 0)},qs.set=function(e,t,n){return Xs.set.call(this,e[0],t,n,e[0])};var tk=function(){function e(n){var r=this;this.O=w0,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var l=r;return function(h){var m=this;h===void 0&&(h=a);for(var g=arguments.length,p=Array(g>1?g-1:0),x=1;x<g;x++)p[x-1]=arguments[x];return l.produce(h,function(_){var C;return(C=i).call.apply(C,[m,_].concat(p))})}}var u;if(typeof i!="function"&&Et(6),s!==void 0&&typeof s!="function"&&Et(7),Ft(o)){var c=y0(r),f=am(r,o,void 0),d=!0;try{u=i(f),d=!1}finally{d?Iu(c):sm(c)}return typeof Promise<"u"&&u instanceof Promise?u.then(function(h){return tm(c,s),nm(h,c)},function(h){throw Iu(c),h}):(tm(c,s),nm(u,c))}if(!o||typeof o!="object"){if((u=i(o))===void 0&&(u=o),u===k0&&(u=void 0),r.D&&fm(u,!0),s){var y=[],v=[];tn("Patches").M(o,u,y,v),s(y,v)}return u}Et(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(u){for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];return r.produceWithPatches(u,function(y){return o.apply(void 0,[y].concat(f))})};var s,a,l=r.produce(o,i,function(u,c){s=u,a=c});return typeof Promise<"u"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){Ft(n)||Et(8),yn(n)&&(n=YT(n));var r=y0(this),o=am(this,n,void 0);return o[le].C=!0,sm(r),o},t.finishDraft=function(n,r){var o=n&&n[le],i=o.A;return tm(i,r),nm(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!w0&&Et(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=tn("Patches").$;return yn(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),rt=new tk,nk=rt.produce,HO=rt.produceWithPatches.bind(rt),UO=rt.setAutoFreeze.bind(rt),zO=rt.setUseProxies.bind(rt),VO=rt.applyPatches.bind(rt),KO=rt.createDraft.bind(rt),WO=rt.finishDraft.bind(rt),Ou=nk;function dr(e){"@babel/helpers - typeof";return dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(e)}function gm(e,t){if(dr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function hm(e){var t=gm(e,"string");return dr(t)==="symbol"?t:String(t)}function ym(e,t,n){return t=hm(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R0(Object(n),!0).forEach(function(r){ym(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Me(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 I0=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),vm=function(){return Math.random().toString(36).substring(7).split("").join(".")},Mu={INIT:"@@redux/INIT"+vm(),REPLACE:"@@redux/REPLACE"+vm(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+vm()}};function rk(e){if(typeof e!="object"||e===null)return!1;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Sm(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Me(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Me(1));return n(Sm)(e,t)}if(typeof e!="function")throw new Error(Me(2));var o=e,i=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(Me(3));return i}function f(h){if(typeof h!="function")throw new Error(Me(4));if(l)throw new Error(Me(5));var m=!0;return u(),a.push(h),function(){if(m){if(l)throw new Error(Me(6));m=!1,u();var p=a.indexOf(h);a.splice(p,1),s=null}}}function d(h){if(!rk(h))throw new Error(Me(7));if(typeof h.type>"u")throw new Error(Me(8));if(l)throw new Error(Me(9));try{l=!0,i=o(i,h)}finally{l=!1}for(var m=s=a,g=0;g<m.length;g++){var p=m[g];p()}return h}function y(h){if(typeof h!="function")throw new Error(Me(10));o=h,d({type:Mu.REPLACE})}function v(){var h,m=f;return h={subscribe:function(p){if(typeof p!="object"||p===null)throw new Error(Me(11));function x(){p.next&&p.next(c())}x();var _=m(x);return{unsubscribe:_}}},h[I0]=function(){return this},h}return d({type:Mu.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:y},r[I0]=v,r}function ok(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Mu.INIT});if(typeof r>"u")throw new Error(Me(12));if(typeof n(void 0,{type:Mu.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Me(13))})}function Du(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),s,a;try{ok(n)}catch(l){a=l}return function(u,c){if(u===void 0&&(u={}),a)throw a;if(!1)var f;for(var d=!1,y={},v=0;v<i.length;v++){var h=i[v],m=n[h],g=u[h],p=m(g,c);if(typeof p>"u"){var x=c&&c.type;throw new Error(Me(14))}y[h]=p,d=d||p!==g}return d=d||i.length!==Object.keys(u).length,d?y:u}}function Yo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.length===0?function(r){return r}:t.length===1?t[0]:t.reduce(function(r,o){return function(){return r(o.apply(void 0,arguments))}})}function A0(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(Me(15))},s={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return i=Yo.apply(void 0,a)(o.dispatch),Nu(Nu({},o),{},{dispatch:i})}}}function L0(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(s){return function(a){return typeof a=="function"?a(o,i,e):s(a)}}};return t}var O0=L0();O0.withExtraArgument=L0;var xm=O0;var j0=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ik=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Zo=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},sk=Object.defineProperty,ak=Object.defineProperties,lk=Object.getOwnPropertyDescriptors,N0=Object.getOwnPropertySymbols,uk=Object.prototype.hasOwnProperty,ck=Object.prototype.propertyIsEnumerable,M0=function(e,t,n){return t in e?sk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},fr=function(e,t){for(var n in t||(t={}))uk.call(t,n)&&M0(e,n,t[n]);if(N0)for(var r=0,o=N0(t);r<o.length;r++){var n=o[r];ck.call(t,n)&&M0(e,n,t[n])}return e},_m=function(e,t){return ak(e,lk(t))},dk=function(e,t,n){return new Promise(function(r,o){var i=function(l){try{a(n.next(l))}catch(u){o(u)}},s=function(l){try{a(n.throw(l))}catch(u){o(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(i,s)};a((n=n.apply(e,t)).next())})};var fk=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Yo:Yo.apply(null,arguments)},uN=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function pk(e){if(typeof e!="object"||e===null)return!1;var t=Object.getPrototypeOf(e);if(t===null)return!0;for(var n=t;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return t===n}var mk=function(e){j0(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,Zo([void 0],n[0].concat(this)))):new(t.bind.apply(t,Zo([void 0],n.concat(this))))},t}(Array),gk=function(e){j0(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return e.prototype.concat.apply(this,n)},t.prototype.prepend=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return n.length===1&&Array.isArray(n[0])?new(t.bind.apply(t,Zo([void 0],n[0].concat(this)))):new(t.bind.apply(t,Zo([void 0],n.concat(this))))},t}(Array);function Cm(e){return Ft(e)?Ou(e,function(){}):e}function hk(e){return typeof e=="boolean"}function yk(){return function(t){return vk(t)}}function vk(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,i=e.serializableCheck,s=i===void 0?!0:i,a=new mk;if(n&&(hk(n)?a.push(xm):a.push(xm.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(s)var u}return a}var wm=!0;function B0(e){var t=yk(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,i=n.middleware,s=i===void 0?t():i,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,f=n.enhancers,d=f===void 0?void 0:f,y;if(typeof o=="function")y=o;else if(pk(o))y=Du(o);else throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');var v=s;if(typeof v=="function"&&(v=v(t),!wm&&!Array.isArray(v)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!wm&&v.some(function(_){return typeof _!="function"}))throw new Error("each middleware provided to configureStore must be a function");var h=A0.apply(void 0,v),m=Yo;l&&(m=fk(fr({trace:!wm},typeof l=="object"&&l)));var g=new gk(h),p=g;Array.isArray(d)?p=Zo([h],d):typeof d=="function"&&(p=d(g));var x=m.apply(void 0,p);return Sm(y,c,x)}function fe(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return fr(fr({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function H0(e){var t={},n=[],r,o={addCase:function(i,s){var a=typeof i=="string"?i:i.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,o},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase:function(i){return r=i,o}};return e(o),[t,n,r]}function Sk(e){return typeof e=="function"}function xk(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?H0(t):[t,n,r],i=o[0],s=o[1],a=o[2],l;if(Sk(e))l=function(){return Cm(e())};else{var u=Cm(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var y=Zo([i[d.type]],s.filter(function(v){var h=v.matcher;return h(d)}).map(function(v){var h=v.reducer;return h}));return y.filter(function(v){return!!v}).length===0&&(y=[a]),y.reduce(function(v,h){if(h)if(yn(v)){var m=v,g=h(m,d);return g===void 0?v:g}else{if(Ft(v))return Ou(v,function(p){return h(p,d)});var g=h(v,d);if(g===void 0){if(v===null)return v;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return v},f)}return c.getInitialState=l,c}function _k(e,t){return e+"/"+t}function B(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");typeof process<"u";var n=typeof e.initialState=="function"?e.initialState:Cm(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},s={},a={};o.forEach(function(c){var f=r[c],d=_k(t,c),y,v;"reducer"in f?(y=f.reducer,v=f.prepare):y=f,i[c]=y,s[d]=y,a[c]=v?fe(d,v):fe(d)});function l(){var c=typeof e.extraReducers=="function"?H0(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,y=c[1],v=y===void 0?[]:y,h=c[2],m=h===void 0?void 0:h,g=fr(fr({},d),s);return xk(n,function(p){for(var x in g)p.addCase(x,g[x]);for(var _=0,C=v;_<C.length;_++){var w=C[_];p.addMatcher(w.matcher,w.reducer)}m&&p.addDefaultCase(m)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:i,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var wk="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",Ek=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=wk[Math.random()*64|0];return t},Ck=["name","message","stack","code"],Em=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),D0=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),bk=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=Ck;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},M=function(){function e(t,n,r){var o=fe(t+"/fulfilled",function(c,f,d,y){return{payload:c,meta:_m(fr({},y||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),i=fe(t+"/pending",function(c,f,d){return{payload:void 0,meta:_m(fr({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),s=fe(t+"/rejected",function(c,f,d,y,v){return{payload:y,error:(r&&r.serializeError||bk)(c||"Rejected"),meta:_m(fr({},v||{}),{arg:d,requestId:f,rejectedWithValue:!!y,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=!1,l=typeof AbortController<"u"?AbortController:function(){function c(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return c.prototype.abort=function(){},c}();function u(c){return function(f,d,y){var v=r!=null&&r.idGenerator?r.idGenerator(c):Ek(),h=new l,m,g=!1;function p(_){m=_,h.abort()}var x=function(){return dk(this,null,function(){var _,C,w,b,R,P,N;return ik(this,function(V){switch(V.label){case 0:return V.trys.push([0,4,,5]),b=(_=r==null?void 0:r.condition)==null?void 0:_.call(r,c,{getState:d,extra:y}),kk(b)?[4,b]:[3,2];case 1:b=V.sent(),V.label=2;case 2:if(b===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,R=new Promise(function(H,je){return h.signal.addEventListener("abort",function(){return je({name:"AbortError",message:m||"Aborted"})})}),f(i(v,c,(C=r==null?void 0:r.getPendingMeta)==null?void 0:C.call(r,{requestId:v,arg:c},{getState:d,extra:y}))),[4,Promise.race([R,Promise.resolve(n(c,{dispatch:f,getState:d,extra:y,requestId:v,signal:h.signal,abort:p,rejectWithValue:function(H,je){return new Em(H,je)},fulfillWithValue:function(H,je){return new D0(H,je)}})).then(function(H){if(H instanceof Em)throw H;return H instanceof D0?o(H.payload,v,c,H.meta):o(H,v,c)})])];case 3:return w=V.sent(),[3,5];case 4:return P=V.sent(),w=P instanceof Em?s(null,v,c,P.payload,P.meta):s(P,v,c),[3,5];case 5:return N=r&&!r.dispatchConditionRejection&&s.match(w)&&w.meta.condition,N||f(w),[2,w]}})})}();return Object.assign(x,{abort:p,requestId:v,arg:c,unwrap:function(){return x.then(Tk)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function Tk(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function kk(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Pk="task",U0="listener",z0="completed",bm="cancelled",pN="task-"+bm,mN="task-"+z0,gN=U0+"-"+bm,hN=U0+"-"+z0,yN=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=Pk+" "+bm+" (reason: "+t+")"}return e}();var Tm="listenerMiddleware";var vN=fe(Tm+"/add"),SN=fe(Tm+"/removeAll"),xN=fe(Tm+"/remove");var F0,_N=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window<"u"?window:typeof global<"u"?global:globalThis):function(e){return(F0||(F0=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},Rk=function(e){return function(t){setTimeout(t,e)}},wN=typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Rk(10);T0();var Ix=S(Pm()),Ax=S(X0());var Rm=S(Ru());function qk(e){e()}var Q0=qk,Y0=e=>Q0=e,Z0=()=>Q0;var ei=S(O());var tx=S(O());var ju=S(O()),J0=Symbol.for(`react-redux-context-${ju.version}`),ex=globalThis;function Gk(){let e=ex[J0];return e||(e=(0,ju.createContext)(null),ex[J0]=e),e}var De=new Proxy({},new Proxy({},{get(e,t){let n=Gk();return(r,...o)=>Reflect[t](n,...o)}}));function Qs(e=De){return function(){return(0,tx.useContext)(e)}}var Bu=Qs();var Hu=()=>{throw new Error("uSES not initialized!")};var nx=Hu,rx=e=>{nx=e},Xk=(e,t)=>e===t;function ox(e=De){let t=e===De?Bu:Qs(e);return function(r,o={}){let{equalityFn:i=Xk,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),y=(0,ei.useRef)(!0),v=(0,ei.useCallback)({[r.name](m){return r(m)}}[r.name],[r,f,s]),h=nx(u.addNestedSub,l.getState,c||l.getState,v,i);return(0,ei.useDebugValue)(h),h}}var L=ox();function vn(){return vn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},vn.apply(this,arguments)}function Ys(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Bm=S(gx()),Z=S(O()),Tx=S(Sx());var dP=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function fP(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,u,c,f,d;function y(p,x){return l=p,u=x,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function v(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function h(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function m(){let p=e(l,u),x=!s(p,c);return c=p,x&&(d=n(c,f,u)),d}function g(p,x){let _=!i(x,u),C=!o(p,l,x,u);return l=p,u=x,_&&C?v():_?h():C?m():d}return function(x,_){return a?g(x,_):y(x,_)}}function Fm(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,i=Ys(t,dP),s=n(e,i),a=r(e,i),l=o(e,i);return fP(s,a,l,e,i)}function jm(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function Zs(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function xx(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function ac(e,t){return function(r,{displayName:o}){let i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=e,i.dependsOnOwnProps=xx(e);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=xx(u),u=i(a,l)),u},i}}function ti(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function _x(e){return e&&typeof e=="object"?Zs(t=>jm(e,t)):e?typeof e=="function"?ac(e,"mapDispatchToProps"):ti(e,"mapDispatchToProps"):Zs(t=>({dispatch:t}))}function wx(e){return e?typeof e=="function"?ac(e,"mapStateToProps"):ti(e,"mapStateToProps"):Zs(()=>({}))}function pP(e,t,n){return vn({},n,e,t)}function mP(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,u,c){let f=e(l,u,c);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function Ex(e){return e?typeof e=="function"?mP(e):ti(e,"mergeProps"):()=>pP}function gP(){let e=Z0(),t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var Cx={notify(){},get:()=>[]};function lc(e,t){let n,r=Cx;function o(f){return l(),r.subscribe(f)}function i(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=gP())}function u(){n&&(n(),n=void 0,r.clear(),r=Cx)}let c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var uc=S(O()),hP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ni=hP?uc.useLayoutEffect:uc.useEffect;function bx(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ri(e,t){if(bx(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!bx(e[n[o]],t[n[o]]))return!1;return!0}var yP=["reactReduxForwardedRef"],kx=Hu,Px=e=>{kx=e};var vP=[null,null];function SP(e,t,n){ni(()=>e(...t),n)}function xP(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function _P(e,t,n,r,o,i,s,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,y=()=>{if(f||!a.current)return;let h=t.getState(),m,g;try{m=r(h,o.current)}catch(p){g=p,d=p}g||(d=null),m===i.current?s.current||u():(i.current=m,l.current=m,s.current=!0,c())};return n.onStateChange=y,n.trySubscribe(),y(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function wP(e,t){return e===t}function EP(e,t,n,{pure:r,areStatesEqual:o=wP,areOwnPropsEqual:i=ri,areStatePropsEqual:s=ri,areMergedPropsEqual:a=ri,forwardRef:l=!1,context:u=De}={}){let c=u,f=wx(e),d=_x(t),y=Ex(n),v=!!e;return m=>{let g=m.displayName||m.name||"Component",p=`Connect(${g})`,x={shouldHandleStateChanges:v,displayName:p,wrappedComponentName:g,WrappedComponent:m,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:y,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function _(b){let[R,P,N]=(0,Z.useMemo)(()=>{let{reactReduxForwardedRef:dt}=b,Ir=Ys(b,yP);return[b.context,dt,Ir]},[b]),V=(0,Z.useMemo)(()=>R&&R.Consumer&&(0,Tx.isContextConsumer)(Z.default.createElement(R.Consumer,null))?R:c,[R,c]),H=(0,Z.useContext)(V),je=!!b.store&&!!b.store.getState&&!!b.store.dispatch,an=!!H&&!!H.store,$t=je?b.store:H.store,uo=an?H.getServerState:$t.getState,Di=(0,Z.useMemo)(()=>Fm($t.dispatch,x),[$t]),[Pr,Ha]=(0,Z.useMemo)(()=>{if(!v)return vP;let dt=lc($t,je?void 0:H.subscription),Ir=dt.notifyNestedSubs.bind(dt);return[dt,Ir]},[$t,je,H]),Ua=(0,Z.useMemo)(()=>je?H:vn({},H,{subscription:Pr}),[je,H,Pr]),Fi=(0,Z.useRef)(),ji=(0,Z.useRef)(N),ln=(0,Z.useRef)(),Bi=(0,Z.useRef)(!1),Rr=(0,Z.useRef)(!1),I=(0,Z.useRef)(!1),$=(0,Z.useRef)();ni(()=>(I.current=!0,()=>{I.current=!1}),[]);let At=(0,Z.useMemo)(()=>()=>ln.current&&N===ji.current?ln.current:Di($t.getState(),N),[$t,N]),Bn=(0,Z.useMemo)(()=>Ir=>Pr?_P(v,$t,Pr,Di,ji,Fi,Bi,I,ln,Ha,Ir):()=>{},[Pr]);SP(xP,[ji,Fi,Bi,N,ln,Ha]);let un;try{un=kx(Bn,At,uo?()=>Di(uo(),N):At)}catch(dt){throw $.current&&(dt.message+=`
12
12
  The error may be correlated with this previous error:
@@ -18,7 +18,7 @@ ${$.current.stack}
18
18
 
19
19
  `),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global<"u"&&global.INTERWEAVE_SSR_POLYFILL||GP)();if(!o)return;let i=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",s=i==="body"||i==="fragment"?o.body:o.createElement(i);return t.match(WP)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,u_.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==l_||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),u=Lc[l]||Lc[s];if(!this.isSafe(t)||!l.match($P)&&(!n&&(!u||u===rg)||l.startsWith("on")||a.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c=l==="style"?this.extractStyleAttribute(t):a;u===hr?c=!0:u===Jr?c=Number.parseFloat(String(c)):u!==Ac&&(c=String(c)),r[og[l]||l]=this.applyAttributeFilters(l,c),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(i,s)=>String(s).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return ua[t]?{...n,...ua[t],tagName:t}:n}isSafe(t){if(typeof HTMLAnchorElement<"u"&&t instanceof HTMLAnchorElement){let n=t.getAttribute("href");if(n!=null&&n.startsWith("#"))return!0;let r=t.protocol.toLowerCase();return r===":"||r==="http:"||r==="https:"||r==="mailto:"||r==="tel:"}return!0}isTagAllowed(t){return this.banned.has(t)||this.blocked.has(t)?!1:this.props.allowElements||this.allowed.has(t)}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){let{noHtml:r,noHtmlExceptMatchers:o,allowElements:i,transform:s,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===l_){let d=c.nodeName.toLowerCase(),y=this.getTagConfig(d);u&&(l.push(u),u="");let v=this.applyNodeFilters(d,c);if(!v)return;let h;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let m=this.keyIndex;h=this.parseNode(v,y);let g=s(v,h,y);if(g===null)return;if(typeof g<"u"){l.push(to.default.cloneElement(g,{key:m}));return}this.keyIndex=m-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,y))){var f;this.keyIndex+=1;let m=this.extractAttributes(v),g={tagName:d};m&&(g.attributes=m),y.void&&(g.selfClose=y.void),l.push(to.default.createElement(Oc,{...g,key:this.keyIndex},(f=h)!==null&&f!==void 0?f:this.parseNode(v,y)))}else l=[...l,...this.parseNode(v,y.tagName?y:n)]}else if(c.nodeType===KP){let d=r&&!o?c.textContent:this.applyMatchers(c.textContent||"",n);Array.isArray(d)?l=[...l,...d]:u+=d}}),u&&l.push(u),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(qP);){let[s,a]=i,l=i.index,u=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],y;if(u)y=s.length,r.push(f.createElement(c,d));else{let v=o.match(new RegExp(`{{{/${a}}}}`));y=v.index+v[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,v.index),n),d))}o=o.slice(y)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function XP(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,parsedContent:a,tagName:l,noWrap:u}=e,c=(t=o??l)!==null&&t!==void 0?t:"span",f=c==="fragment"?!0:u,d;if(a)d=a;else{let y=new Nc(i??"",e).parse();y.length>0&&(d=y)}return d||(d=s),f?to.default.createElement(to.default.Fragment,null,d):to.default.createElement(Oc,{attributes:n,className:r,tagName:c},d)}function li(e){let{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1,...y}=e,v=i?[]:l,h=o?[]:a,m=c?[c]:[],g=u?[u]:[];v.forEach(C=>{C.onBeforeParse&&m.push(C.onBeforeParse.bind(C)),C.onAfterParse&&g.push(C.onAfterParse.bind(C))});let p=m.reduce((C,w)=>w(C,e),r??""),x=new Nc(p,y,v,h),_=g.reduce((C,w)=>w(C,e),x.parse());return to.default.createElement(XP,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:_.length===0?void 0:_,tagName:f})}var pg=S(X());var sg={root:"_root_kxnai_1",agentText:"_agentText_kxnai_3",textInput:"_textInput_kxnai_8",textInputWrapper:"_textInputWrapper_kxnai_27",alert:"_alert_kxnai_31",alertText:"_alertText_kxnai_50",warning:"_warning_kxnai_60",success:"_success_kxnai_69"};var d_=S(X());var ui=S(O());function c_(e,t){let n;return[(...r)=>{window.cancelAnimationFrame(n);let o=t?t(...r):r;n=window.requestAnimationFrame(()=>{e(...o)})},()=>window.cancelAnimationFrame(n)]}function Mc(e){let t=(0,ui.useRef)(null),[n,r]=(0,ui.useState)(!1);return(0,ui.useEffect)(()=>{let o=!1,i=parseFloat(window.getComputedStyle(document.body).zoom??"1"),[s,a]=c_((c,f)=>{let d=t.current;if(!d)return;let y=c/i,v=f/i,h=d.getBoundingClientRect(),m=y>h.x&&y<h.x+h.width&&v>h.y&&v<h.y+h.height;m&&!o?(o=!0,r(!0)):!m&&o&&(o=!1,r(!1))},({clientX:c,clientY:f})=>[c,f]),[l,u]=c_(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",s),e.addEventListener("mouseleave",l),()=>{a(),u(),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}var bt={root:"_root_81non_1",container:"_container_81non_3",agentText:"_agentText_81non_5",tabText:"_tabText_81non_6",hint:"_hint_81non_6",matchSelection:"_matchSelection_81non_10",focus:"_focus_81non_16",resetIndent:"_resetIndent_81non_20",matchKeyword:"_matchKeyword_81non_24",matchPlaceholder:"_matchPlaceholder_81non_25",hover:"_hover_81non_31",hintText:"_hintText_81non_64",popover:"_popover_81non_72",popoverRoot:"_popoverRoot_81non_77",popoverContentContainer:"_popoverContentContainer_81non_81",popoverContent:"_popoverContent_81non_81",selectionOptions:"_selectionOptions_81non_107",selectionOptionsIsHidden:"_selectionOptionsIsHidden_81non_112",selectionOptionsButton:"_selectionOptionsButton_81non_116",caret:"_caret_81non_132",popoverSuggestionsRoot:"_popoverSuggestionsRoot_81non_136",suggestionsOverlayInputStyles:"_suggestionsOverlayInputStyles_81non_141"};var ag=S(E()),QP=({inputElement:e,children:t})=>{let n=k("TabCompletion",bt),[r,o]=Mc(e);return(0,ag.jsx)("mark",{ref:r,className:(0,d_.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},ci=class extends Ht{match(t){let n=t.match(/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\}(?!\}))/);return n?{index:n.index,length:n[0].length,match:n[0],matchString:n[0],valid:!0}:null}replaceWith(t,n){return(0,ag.jsx)(QP,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var di=S(O());function Dc(e){return e.contentEditable==="true"}function YP(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),n=i.toString().length,i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length}return{selectionStart:t,selectionEnd:n}}function f_(e){let{selectionStart:t,selectionEnd:n}=Dc(e)?YP(e):e;return[t,n]}function Fc(e){let[,t]=(0,di.useState)(),n=(0,di.useRef)(null);return n.current=f_(e),(0,di.useEffect)(()=>{let r=()=>{let[o,i]=n.current??[],s=f_(e);(!s||o!==s[0]||i!==s[1])&&(n.current=s,t({}))};return e.addEventListener("keyup",r),e.addEventListener("click",r),e.addEventListener("focus",r),document.addEventListener("selectionchange",r),()=>{e.removeEventListener("keyup",r),e.removeEventListener("click",r),e.removeEventListener("focus",r),document.removeEventListener("selectionchange",r)}},[e]),n.current}function jc(e,t){if(!t)return;let n=e,{value:r}=n,[o,i]=t,s=r.match(ho);if(!s||s.length===0)return;let a=0;s.find(l=>{let u=r.indexOf(l,a);return o>u&&i<u+l.length?(n.selectionStart=u,n.selectionEnd=u+l.length,!0):(a=u+l.length,!1)})}var p_=S(O());function fi(e){(0,p_.useEffect)(()=>{let t=n=>{n.isWithinRoot||e(n)};return document.body.addEventListener("mouseup",t),()=>{document.body.removeEventListener("mouseup",t)}},[e])}function no(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}var m_,nn=new Map,ZP=["bottom","height","left","right","top","width"],JP=(e={},t={})=>ZP.some(n=>e[n]!==t[n]),g_=()=>{let e=[];nn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),nn.delete(n);return}let r=n.getBoundingClientRect();JP(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{t.callbacks.forEach(n=>n(t.rect))}),nn.size!==0&&(m_=window.requestAnimationFrame(g_))};function h_(e,t){return{observe(){let n=nn.size===0;if(nn.has(e)){let r=nn.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else nn.set(e,{rect:void 0,callbacks:[t]});n&&g_()},unobserve(){let n=nn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||nn.delete(e),nn.size||cancelAnimationFrame(m_)}}}}var y_,rn=new Map,v_=()=>{rn.forEach((e,t)=>{if(!t.isConnected){rn.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(i=>i(e.visible)))}),rn.size!==0&&(y_=window.requestAnimationFrame(v_))};function S_(e,t){return{observe(){let n=rn.size===0;rn.has(e)?rn.get(e).callbacks.push(t):rn.set(e,{visible:void 0,callbacks:[t]}),n&&v_()},unobserve(){let n=rn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||rn.delete(e),rn.size||cancelAnimationFrame(y_)}}}}var lg=["borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","borderStyle","boxSizing","color","overflowWrap","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontWeight","fontKerning","lineHeight","letterSpacing","paddingLeft","paddingTop","paddingRight","paddingBottom","width","height","textIndent","whiteSpace","wordBreak","wordSpacing","wordWrap"];function ug(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function pi(e){return parseFloat(e)}function Bc(e){return Math.round(e*1e6)}function x_(e){return e/1e6}function cg(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=pi(e.width),i=pi(e.borderLeftWidth),s=pi(e.borderRightWidth),a=pi(e.paddingRight),l=x_(Bc(o)-Bc(i)-Bc(s)),u=x_(Bc(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function mi(e,t={}){var l;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position="fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",no(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};ug(r,n,lg),cg(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=S_(e,()=>{ug(r,n,lg),cg(r,e,n),i(),setTimeout(i,0)}),a=h_(e,u=>{if(u===null){t.onRemove&&t.onRemove(),n.remove();return}if(u.height===0&&u.width===0){if(o===!0)return;t.onHide&&t.onHide(),n.style.display="none",o=!0;return}if(ug(r,n,lg),cg(r,e,n),i(),n.style.top=`${u.top}px`,n.style.left=`${u.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let c=t.closestScrollElement.getBoundingClientRect(),f=window.getComputedStyle(t.closestScrollElement),d=pi(f.borderTopWidth),y=pi(f.borderBottomWidth),v=c.top+d-u.top,h=u.top+u.height+-(c.top+c.height-y);n.style.clipPath=`inset(${v}px 0px ${h}px 0px)`}o&&(n.style.display="block",t.onShow&&t.onShow(),o=!1)});return t.appendTo?t.appendTo.appendChild(n):(l=e.parentElement)==null||l.appendChild(n),a.observe(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),a.unobserve(),s.unobserve()}]}var dg={};Ce(dg,{enUS:()=>eR,nlNL:()=>tR});var eR={placeholders:[{type:6,value:"placeholderSize",options:{"=0":{value:[{type:0,value:"No placeholders found"}]},one:{value:[{type:0,value:"There is one placeholder in your message"}]},other:{value:[{type:0,value:"There are "},{type:7},{type:0,value:" placeholders in your message"}]}},offset:0,pluralType:"cardinal"}]},tR={placeholders:[{type:6,value:"placeholderSize",options:{"=0":{value:[{type:0,value:"Alle placeholders zijn uit je bericht"}]},one:{value:[{type:0,value:"Er is 1 placeholder in jouw bericht"}]},other:{value:[{type:0,value:"Er zijn "},{type:7},{type:0,value:" placeholders in jouw bericht"}]}},offset:0,pluralType:"cardinal"}]};var ca=S(E()),__=()=>(0,ca.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 512 512","aria-labelledby":"circleCheckTitle",children:[(0,ca.jsx)("title",{id:"circleCheckTitle",children:"Check"}),(0,ca.jsx)("path",{d:"M243.8 339.8C232.9 350.7 215.1 350.7 204.2 339.8L140.2 275.8C129.3 264.9 129.3 247.1 140.2 236.2C151.1 225.3 168.9 225.3 179.8 236.2L224 280.4L332.2 172.2C343.1 161.3 360.9 161.3 371.8 172.2C382.7 183.1 382.7 200.9 371.8 211.8L243.8 339.8zM512 256C512 397.4 397.4 512 256 512C114.6 512 0 397.4 0 256C0 114.6 114.6 0 256 0C397.4 0 512 114.6 512 256zM256 48C141.1 48 48 141.1 48 256C48 370.9 141.1 464 256 464C370.9 464 464 370.9 464 256C464 141.1 370.9 48 256 48z"})]});var fg=S(E()),w_=()=>(0,fg.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",fill:"currentColor",children:(0,fg.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32z"})});var E_=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(E_||{}),_n=class{constructor(t){this.element=t;this.currentText=this.getText(),this.currentHTML=this.getHTML(),this.listen()}eventListeners={};disposeHandlers=[];currentText="";currentSelection={start:0,end:0};currentHTML="";isFocused=!1;isActive=!0;isSettingValue=!1;isSubmitting=!1;isPossibleClearInputAction=!1;isDisposed=!1;addEventListener(t,n){let r=o=>{n(o)};this.element.addEventListener(t,r),this.disposeHandlers.push(()=>{this.element.removeEventListener(t,r)})}removeEventListener(t,n){this.element.removeEventListener(t,n)}triggerChange(){let t=this.getText(),n=this.getHTML(),r=t!==this.currentText;this.isActive&&(t===""&&this.currentText!==""&&!this.isSettingValue&&!this.isPossibleClearInputAction&&(this.isSubmitting=!0,this.emit("submit")),!this.isSettingValue&&r&&!this.isSubmitting&&this.emit("change",{plainText:t}),r&&(this.currentSelection=this.getSelection()),this.currentText=t,this.isSubmitting=!1,(this.currentHTML!==n||n===null&&r)&&(this.emit("updated",{plainText:t}),this.currentHTML=n))}triggerSelection(){let t=this.getSelection();(t.start!==this.currentSelection.start||t.end!==this.currentSelection.end)&&(this.currentSelection=t,this.emit("selection",t))}handleKeyUp(t){let{key:n,shiftKey:r}=t;(n==="Enter"&&r===!0||n==="Backspace")&&this.triggerChange(),this.triggerSelection()}handleClick(){this.triggerSelection()}handleFocus(){this.isFocused||this.emit("focus"),this.triggerSelection(),this.isFocused=!0}handleBlur(){this.isPossibleClearInputAction=!1,this.isFocused&&this.emit("blur"),this.isFocused=!1}handleKeyDown(t){let{key:n,ctrlKey:r,metaKey:o}=t;this.isPossibleClearInputAction=Object.values(E_).includes(n)||n.toLowerCase()==="z"&&(r||o),this.emit("keydown",t)}handleCut(){this.isPossibleClearInputAction=!0,this.emit("cut",{selectionText:this.getSelectedText()})}handlePaste(t){var r,o;let n=((r=t.clipboardData)==null?void 0:r.getData("text"))||((o=t.clipboardData)==null?void 0:o.getData("text/plain"))||"";this.emit("paste",{pastedText:n,selectionText:this.getSelectedText()})}listen(){this.addEventListener("keydown",n=>this.handleKeyDown(n)),this.addEventListener("keyup",n=>this.handleKeyUp(n)),this.addEventListener("input",()=>this.triggerChange()),this.addEventListener("change",()=>this.triggerChange()),this.addEventListener("focus",()=>this.handleFocus()),this.addEventListener("blur",()=>this.handleBlur()),this.addEventListener("cut",()=>this.handleCut()),this.addEventListener("paste",n=>this.handlePaste(n)),this.addEventListener("click",()=>this.triggerSelection()),document.activeElement===this.element&&setTimeout(()=>{this.handleFocus()},0);let t=new MutationObserver(()=>{this.element.isConnected||(this.emit("unmounted"),this.dispose())});t.observe(document.body,{subtree:!0,childList:!0}),this.disposeHandlers.push(()=>{t.disconnect()})}focus(){this.element.focus()}emit(t,...n){this.isDisposed||this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r(...n)})}on(t,n){this.isDisposed||(this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n))}activate(){let t=this.isActive===!1;this.isActive=!0,t&&this.triggerChange()}deactivate(){this.isActive=!1}dispose(){this.disposeHandlers.forEach(t=>t()),this.eventListeners={},this.isDisposed=!0}};var wn=class extends _n{lastKnownSelection=null;getText(){return this.element.value}getHTML(){return null}getSelection(){let{selectionStart:t,selectionEnd:n}=this.element;return{start:t,end:n}}getSelectedText(){let t=this.getSelection();return t?this.getText().slice(t.start,t.end):""}applyChanges(t){if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(){super.listen();let t=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var o;return(o=t==null?void 0:t.get)==null?void 0:o.call(this.element)},set:o=>{var i;(i=t==null?void 0:t.set)==null||i.call(this.element,o),this.triggerChange()}});let n=this.element.disabled,r=new MutationObserver(()=>{this.element.disabled!==n&&(n=this.element.disabled,this.emit(n?"disabled":"enabled"))});r.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>r.disconnect())}};var Xe=S(E()),nR=({value:e,onUse:t,...n})=>{var c;let r=j(dg),o=W(),i=k("EditSuggestionTextInput",sg),[s,a]=(0,Tt.useState)(null),l=(0,Tt.useRef)(null),u=((c=e.match(ho))==null?void 0:c.length)||0;return(0,Tt.useEffect)(()=>{let f;return l.current&&(a(l.current),f=new wn(l.current),f.on("change",({plainText:d})=>{o(Ge.actions.userInput({text:d,selection:f.getSelection()}))}),f.on("keydown",d=>{o(Ge.actions.registerKeyDown(xc(d))),d.code==="Enter"&&d.shiftKey&&t(f.getText())}),f.on("paste",({pastedText:d,selectionText:y})=>{o(Ge.actions.registerPaste({text:d,selectionText:y}))}),f.on("cut",({selectionText:d})=>{o(Ge.actions.registerCut(d))})),()=>{o(Ge.actions.reset()),f.dispose(),f.deactivate()}},[l]),(0,Tt.useEffect)(()=>{e&&l.current&&(l.current.value=e)},[e,l]),(0,Tt.useEffect)(()=>{l.current&&setTimeout(()=>{if(!l.current)return;let f=l.current.value.length;l.current.setSelectionRange(f,f),l.current.focus()},0)},[l]),(0,Xe.jsxs)("div",{className:i.textInputWrapper,children:[(0,Xe.jsx)("textarea",{...n,ref:l,"data-testid":"edit-suggestion-dialog-textarea",className:i.textInput,defaultValue:e,onChange:()=>{}}),s&&(0,Xe.jsx)(rR,{inputElement:l.current,value:e}),(0,Xe.jsxs)("div",{className:(0,pg.default)(i.alert,u===0?i.success:i.warning),children:[(0,Xe.jsx)("div",{className:i.alertText,children:r("placeholders",{placeholderSize:u})}),u===0?(0,Xe.jsx)(__,{}):(0,Xe.jsx)(w_,{})]})]})},rR=({inputElement:e,value:t})=>{let n=k("EditSuggestionTextInput",sg),r=(0,Tt.useRef)(null),o=Fc(e);return(0,Tt.useEffect)(()=>{jc(e,o)},[o,e]),(0,Xe.jsx)(oR,{inputElement:e,children:(0,Xe.jsxs)("div",{ref:r,className:(0,pg.default)(n.root,n.agentText),children:[(0,Xe.jsx)(li,{tagName:"span",disableLineBreaks:!0,content:t,matchers:[new ci("placeholders")],inputElement:e,boundaryRef:r}),(0,Xe.jsx)("br",{})]})})},oR=({inputElement:e,children:t})=>{let n=(0,Tt.useRef)(null);return(0,Tt.useEffect)(()=>{if(!n.current)return()=>{};let[r,o]=mi(e,{overlayContainer:n.current,mirrorOverflow:!0});return r.setAttribute("translate","no"),()=>{o()}},[n.current]),(0,Xe.jsx)("div",{ref:n,children:t})},C_=nR;var yi=S(O());var b_=S(O()),Hc=S(X());var Qe={root:"_root_185k9_1",list:"_list_185k9_2",listWrapper:"_listWrapper_185k9_6",listHorizontal:"_listHorizontal_185k9_10",page:"_page_185k9_19",search:"_search_185k9_25",pageNav:"_pageNav_185k9_33",pageTitle:"_pageTitle_185k9_41",pageBackButton:"_pageBackButton_185k9_48",listHeading:"_listHeading_185k9_62",listItem:"_listItem_185k9_70",listItemContent:"_listItemContent_185k9_79",listItemText:"_listItemText_185k9_97",listItemDescription:"_listItemDescription_185k9_105",truncate:"_truncate_185k9_112",lineClamp:"_lineClamp_185k9_118",listItemTitle:"_listItemTitle_185k9_125",listItemAction:"_listItemAction_185k9_132",listItemPrimaryAction:"_listItemPrimaryAction_185k9_146",listItemSelected:"_listItemSelected_185k9_151",sources:"_sources_185k9_155",sourcesTitle:"_sourcesTitle_185k9_162",source:"_source_185k9_155",icon:"_icon_185k9_177",searchIcon:"_searchIcon_185k9_194",searchInputWrapper:"_searchInputWrapper_185k9_199",searchInput:"_searchInput_185k9_199",select:"_select_185k9_220",selectType:"_selectType_185k9_237",selectWrapper:"_selectWrapper_185k9_241",image:"_image_185k9_271",imageSrc:"_imageSrc_185k9_278",imageSrcHidden:"_imageSrcHidden_185k9_289",imageSrcStatus:"_imageSrcStatus_185k9_293",imageTitle:"_imageTitle_185k9_303",actions:"_actions_185k9_308",actionsWrapper:"_actionsWrapper_185k9_312",actionsBar:"_actionsBar_185k9_318",actionButton:"_actionButton_185k9_327",actionShortcut:"_actionShortcut_185k9_345",actionShortcutFixKerning:"_actionShortcutFixKerning_185k9_352"};var ro={};Ce(ro,{enUS:()=>iR,nlNL:()=>sR});var iR={visitUrl:[{type:0,value:"Visit"}],back:[{type:0,value:"Back"}],loading:[{type:0,value:"Loading..."}],imageError:[{type:0,value:"Could not load image"}]},sR={visitUrl:[{type:0,value:"Bekijk"}],back:[{type:0,value:"Terug"}],loading:[{type:0,value:"Laden..."}],imageError:[{type:0,value:"Kan afbeelding niet laden"}]};var yr=S(E()),aR=({src:e,title:t})=>{let n=k("CommandPalette",Qe),[r,o]=(0,b_.useState)("loading"),i=j(ro);return(0,yr.jsxs)("div",{className:n.image,children:[(0,yr.jsx)("img",{src:e,alt:t,onLoad:()=>o("done"),onError:()=>o("error"),className:(0,Hc.default)(n.imageSrc,{[n.imageSrcHidden]:["loading","error"].includes(r)})}),r==="loading"&&(0,yr.jsx)("span",{className:(0,Hc.default)(n.imageSrc,n.imageSrcStatus),children:i("loading")}),r==="error"&&(0,yr.jsx)("span",{className:(0,Hc.default)(n.imageSrc,n.imageSrcStatus),children:(0,yr.jsx)(Ga,{})}),t&&(0,yr.jsx)("span",{className:n.imageTitle,children:t})]})},T_=aR;var k_=S(O()),P_=S(X());var da=S(E());function mg({children:e,heading:t,orientation:n}){let r=k("CommandPalette",Qe);return k_.default.Children.count(e)===0?null:(0,da.jsxs)("div",{"data-testid":"commandpalette-list",className:r.list,children:[t&&(0,da.jsx)("h4",{className:r.listHeading,children:t}),(0,da.jsx)("div",{className:(0,P_.default)(r.listWrapper,n==="horizontal"&&r.listHorizontal),children:e})]})}var fa=S(X());var Uc=S(O()),A_=S(E()),R_=Uc.default.createContext(void 0);function vr(){let e=Uc.default.useContext(R_);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var I_=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i})=>{let s=Uc.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,A_.jsx)(R_.Provider,{value:s,children:e})};var kt=S(E());function gg({closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,onSourceClick:o,index:i,isExperimental:s,description:a,sources:l,styles:u,...c}){let{selected:f,onChangeOpen:d}=vr(),y=k("CommandPalette",Qe);function v(h){r(h),e&&d(!1)}return(0,kt.jsxs)("div",{className:(0,fa.default)(y.listItem,f===i&&y.listItemSelected),children:[(0,kt.jsxs)("button",{type:"button",className:(0,fa.default)("command-palette-list-item",y.listItemAction,y.listItemPrimaryAction),"aria-disabled":c.disabled??!1,onClick:v,...c,children:[(0,kt.jsxs)("div",{className:y.listItemContent,children:[typeof n=="string"?(0,kt.jsx)("p",{className:(0,fa.default)(y.listItemText,y.truncate,u==null?void 0:u.title),children:n}):n,a&&(0,kt.jsx)("p",{className:(0,fa.default)(y.listItemDescription,u==null?void 0:u.description,t?y.lineClamp:y.truncate),children:a})]}),s&&(0,kt.jsx)(fl,{})]}),l&&(0,kt.jsxs)("div",{className:y.sources,children:[(0,kt.jsx)("span",{className:y.sourcesTitle,children:"Sources"}),l.map(h=>h.url?(0,kt.jsx)("a",{className:y.source,href:h.url,target:"_blank",title:h.url,rel:"noopener noreferrer",onClick:()=>o&&o(h),children:h.name},h.url):(0,kt.jsx)("span",{className:y.source,children:h.name},h.name))]})]})}var Sr=S(E());function hg({children:e,title:t,id:n,onDismiss:r,isExperimental:o}){let i=j(ro),s=k("CommandPalette",Qe),{page:a}=vr();return a!==n?null:(0,Sr.jsxs)("div",{className:s.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,Sr.jsxs)("div",{className:s.pageNav,children:[(0,Sr.jsxs)("button",{className:s.pageBackButton,type:"button",onClick:r,children:[(0,Sr.jsx)(kc,{}),i("back")]}),t&&(0,Sr.jsx)("h3",{className:s.pageTitle,children:t}),o&&(0,Sr.jsx)(fl,{})]}),e]})}var xr=S(O());var zc=()=>/Mac/i.test(navigator.platform);var lR={info(...e){console.info("[Deepdesk]",...e)},warn(...e){console.warn("[Deepdesk]",...e)},error(...e){console.error("[Deepdesk]",...e)}},U=lR;function uR(e){return e.replace(/(_\w)/g,t=>t[1].toUpperCase())}function re(e){return Array.isArray(e)?e.map(re):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>({...t,[uR(n)]:re(e[n])}),{}):e}function yg(e){return e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function we(e){return Array.isArray(e)?e.map(we):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>({...t,[yg(n)]:we(e[n])}),{}):e}var cR={agentInfo:void 0,agentSettings:{},visitorInfo:void 0,fetchState:"idle"},ma=e=>{var t,n,r;return{timezone:((t=e.info.visitorInfo)==null?void 0:t.visitorTimeZone)||Intl.DateTimeFormat().resolvedOptions().timeZone,agentName:((n=e.info.agentInfo)==null?void 0:n.agentNickname)||"",visitorName:((r=e.info.visitorInfo)==null?void 0:r.visitorName)||""}},pa=M("info/setAgentInfo",async(e,t)=>{let{deepdeskAPI:n}=t.extra;if(!e.agentId&&!e.agentNickname)throw new Error("At least provide agentId or agentNickname");let r=await n.client.get("/apis/admin/session/me/",{version:null}),o={};return r.external_id||(o.external_id=e.agentId),r.nickname||(o.nickname=e.agentNickname),!o.external_id&&!o.nickname?re(r):(await n.client.patch("/apis/admin/session/me/",o,{version:null}),re(r))}),vg=M("info/setAgentSettings",async(e,t)=>{let{deepdeskAPI:n}=t.extra,r=await n.client.get("/apis/admin/session/me/",{version:null}),o={...typeof r.ui_config=="object"?r.ui_config:{},...e};return await n.client.patch("/apis/admin/session/me/",{ui_config:o}),o}),Sg=M("info/getAgentSettings",async(e,t)=>{let{deepdeskAPI:n}=t.extra;return(await n.client.get("/apis/admin/session/me/",{version:null})).ui_config}),L_=e=>e.info.agentInfo,O_=B({name:"info",initialState:cR,reducers:{setVisitorInfo(e,t){e.visitorInfo={...e.visitorInfo,...t.payload}}},extraReducers:e=>{e.addCase(pa.pending,(t,n)=>{t.fetchState="loading",t.agentInfo={...t.agentInfo,...n.meta.arg}}).addCase(pa.rejected,t=>{t.fetchState="error"}).addCase(pa.fulfilled,(t,n)=>{t.fetchState="done",t.agentInfo={...t.agentInfo,...n.meta.arg,agentId:n.payload.externalId||n.meta.arg.agentId||"",agentNickname:n.payload.nickname||n.meta.arg.agentNickname||""}}).addCase(vg.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(Sg.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(J,t=>{t.visitorInfo=void 0})}}),{setVisitorInfo:N_}=O_.actions,M_=O_.reducer;var Vc={list:[],fetchState:"idle",isOpen:!1,page:"search"},D_=e=>e.search.isOpen,F_=e=>e.search.page,j_=e=>e.search.list;function B_(e,t=n=>n){return n=>n.search.list.filter(r=>r.type===e).map(t)}var oo=M("search/getAll",async(e,t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(s=r.conversation.current)==null?void 0:s.profileCode;if(!o)throw new Error("Profile should be provided in order to be able to search");let{results:i}=await n.search({profile:o,query:e.query,filters:{type:e.type},params:ma(r),tags:e.tags});return i.map(a=>({...a,source:`search-${a.type.toLowerCase()}`,searchTerm:e.query}))}),H_=B({name:"search",initialState:Vc,reducers:{setIsOpen(e,t){e.isOpen=t.payload},setPage(e,t){e.page=t.payload},resetSearch(e){e.fetchState=Vc.fetchState,e.list=Vc.list}},extraReducers:e=>{e.addCase(oo.pending,t=>{t.fetchState="loading"}).addCase(oo.rejected,(t,n)=>{t.fetchState="error",U.error(n.error)}).addCase(oo.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload}).addCase(J,()=>Vc)}}),{resetSearch:Kc,setIsOpen:st,setPage:Ue}=H_.actions,U_=H_.reducer;var dR=/(https?:\/\/[^\s]+)/,Wc=e=>e.split(" ").find(t=>dR.test(t));var xg=S(X());var $c=S(E()),fR=({onClick:e,shortKeys:t,children:n,...r})=>{let o=k("CommandPalette",Qe);return(0,$c.jsxs)("button",{type:"button",...r,onClick:e,className:(0,xg.default)(o.actionButton,r.className),children:[n,t&&t.map(i=>(0,$c.jsx)("span",{className:(0,xg.default)(o.actionShortcut,i===8629&&o.actionShortcutFixKerning),children:typeof i=="number"?String.fromCharCode(i):i},i))]})},gi=fR;var En=S(E()),pR=({children:e,primaryLabel:t,secondaryLabel:n,onPrimary:r,onSecondary:o,list:i})=>{let s=k("CommandPalette",Qe),a=j(ro),{selected:l,setSelected:u}=vr(),c=i[l],f=c&&typeof c.text=="string"&&Wc(c.text),d=(0,xr.useRef)(null);function y(x){if(!d.current)return;let _=d.current.querySelectorAll(".command-palette-list-item"),C=0,w=0;x==="down"?(_.forEach((R,P)=>{P===l&&(C=P)}),w=C===_.length-1?0:C+1):x==="up"?(_.forEach((R,P)=>{P===l&&(C=P)}),w=C?C-1:_.length-1):u(0);let b=_[w];b&&typeof w=="number"&&(u(w),b.scrollIntoView&&b.scrollIntoView({behavior:"smooth",block:w?"center":"end"}))}function v(){if(!d.current)return;let x=d.current.querySelectorAll(".command-palette-list-item"),_=0;x.forEach((w,b)=>{b===l&&(_=b)});let C=x[_];C&&C.click()}let h=()=>{f&&window.open(f,"_blank")},m=()=>{c&&r(c,l)},g=()=>{!c.type||["IMAGE","command"].includes(c.type)||o&&o(c,l)},p=(0,xr.useCallback)(x=>{if(x.key==="Enter"&&x.altKey&&f){h();return}if(x.key==="Enter"&&x.shiftKey){g();return}if(x.key==="ArrowDown"){x.preventDefault(),x.stopPropagation(),y("down");return}if(x.key==="ArrowUp"){x.preventDefault(),x.stopPropagation(),y("up");return}x.key==="Enter"&&l!==-1&&(x.preventDefault(),x.stopPropagation(),v())},[l]);return(0,xr.useEffect)(()=>(window.addEventListener("keyup",p),()=>{window.removeEventListener("keyup",p)}),[p]),(0,En.jsxs)("div",{className:s.actions,children:[(0,En.jsx)("div",{className:s.actionsWrapper,ref:d,children:e}),(0,En.jsxs)("div",{className:s.actionsBar,children:[f&&(0,En.jsx)(gi,{onClick:h,shortKeys:[zc()?8997:"ALT",8629],children:a("visitUrl")}),c&&(0,En.jsxs)(xr.Fragment,{children:[o&&c.type&&!["command","image"].includes(c.type.toLowerCase())&&(0,En.jsx)(gi,{onClick:g,shortKeys:[8679,8629],children:n}),(0,En.jsx)(gi,{onClick:m,shortKeys:[8629],children:t})]})]})]})},V_=pR;var K_=S(O());var ga=S(E()),hi=()=>(0,ga.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,ga.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,ga.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]});var Ut=S(E());function mR({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=k("CommandPalette",Qe);return(0,Ut.jsxs)("div",{className:l.search,children:[(0,Ut.jsx)("div",{className:l.searchIcon,children:(0,Ut.jsx)(hi,{})}),(0,Ut.jsxs)("div",{className:l.searchInputWrapper,children:[(0,Ut.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:u=>{e(u.currentTarget.value)},onFocus:u=>{u.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,Ut.jsx)("div",{className:l.selectWrapper,children:(0,Ut.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:s||r,children:[r&&(0,Ut.jsx)("option",{children:r}),o.map(u=>(0,Ut.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var W_=(0,K_.forwardRef)(mR);var ha=S(E());function io({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:i,onChangeType:s,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d}){let[y,v]=(0,yi.useState)(0),h=(0,yi.useRef)(null),m=()=>{o&&o(n),s(void 0),i(""),a(!1)},g=()=>{var p;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(p=h.current)==null||p.focus();return}if(d.length>0){i("");return}a(!1)};return(0,yi.useEffect)(()=>{v(0)},[d,r]),(0,ha.jsx)(ai,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:m,children:(0,ha.jsxs)(I_,{selected:y,setSelected:v,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,ha.jsx)(W_,{ref:h,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}io.Page=hg;io.List=mg;io.Image=T_;io.ListItem=gg;io.ActionsBar=V_;io.Button=gi;var te=io;var Fe=S(E()),gR=({suggestion:e,onUse:t,onDismiss:n,onTouched:r,onNext:o,onPrevious:i})=>{let s=e.text||e.url||e.message,a=k("EditSuggestionForm",r_),l=W(),u=j(Ym),c=L(v=>v.overlayInput.text);(0,_g.useEffect)(()=>{e&&(l(Ge.actions.reset()),l(Ge.actions.stageSuggestion({text:s,suggestion:e,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"})),l(Ge.actions.commitSuggestion()))},[e]);let f=v=>{v.preventDefault(),d(c)},d=v=>{l(Ec(v)),t(v)},y=v=>h=>{c!==s?window.confirm(u("warning"))&&v(h):v(h)};return(0,_g.useEffect)(()=>{r&&r(c!==s)},[r,e,c]),(0,Fe.jsxs)("div",{className:a.root,children:[(0,Fe.jsxs)("div",{className:a.content,children:[e.title&&(0,Fe.jsx)("h3",{className:a.title,children:e.title}),e.searchKeywords&&e.searchKeywords.length>0&&(0,Fe.jsx)(Vd,{labels:e.searchKeywords}),(0,Fe.jsx)(C_,{onUse:d,value:c})]}),(0,Fe.jsxs)("form",{className:a.actions,onSubmit:f,children:[(0,Fe.jsxs)("div",{children:[(0,Fe.jsx)("button",{disabled:!i,className:a.pagination,type:"button",onClick:i&&y(i),children:(0,Fe.jsx)(kc,{})}),(0,Fe.jsx)("button",{disabled:!o,className:a.pagination,type:"button",onClick:o&&y(o),children:(0,Fe.jsx)(o_,{})})]}),(0,Fe.jsxs)("div",{className:a.primaryButtons,children:[(0,Fe.jsx)(te.Button,{onClick:y(n),shortKeys:["esc"],children:u("dismiss")}),(0,Fe.jsx)(te.Button,{shortKeys:[8679,8629],type:"submit",children:u("add")})]})]})]})},qc=gR;var hR=["{amount}"," {amount}","{date}","{email}","{iban}","{name}","{postal_code}","{street}","{tarif}","{usage}","{3_digits}","{4_digits}","{5_digits}","{6_digits}","{7_digits}","{8_digits}","{9_digits}","{10_digits}"],yR=new RegExp(hR.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function $_(e,t){let n=e.split(yR),r=0,o=[];for(let i=0;i<n.length;i++){let s=n[i];if(o.push(s),i===n.length-1)break;if(t.indexOf(s)===-1)return e;let a=n[i+1],l=i===n.length-2;r+=s.length;let u=r;if(l){let f=a.charAt(0),d=0;do u=f?t.indexOf(f,u+1):-1,d+=1;while(u!==-1&&a.indexOf(t.slice(u))!==0);if(u===-1&&d>2)return e}else u=a&&a!==""?t.indexOf(a,r):-1;let c=u===-1?t.slice(r):t.slice(r,u);o.push(c),r=u}return o.join("")}function q_(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var X_={suggestions:[],fetchState:"idle",isInitialRequest:null},G_={default:X_},Q_=e=>t=>{var n;return((n=t.textSuggestions[e])==null?void 0:n.suggestions)||[]},Y_=e=>t=>{var n;return((n=t.textSuggestions[e])==null?void 0:n.suggestions)??[]},Z_=e=>{let t=Object.keys(e.textSuggestions).map(n=>{var r;return(r=e.textSuggestions[n])==null?void 0:r.fetchState});return t.length===0?!0:t.every(n=>n!=="done")},vi=e=>e.textSuggestions,J_=e=>t=>t.text.startsWith(e),Gc=fe("textSuggestions/refresh"),Cn=M("textSuggestions/recommendations",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,inlineSuggestions:s}=r.settings,a=ii(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getTextSuggestions(o,ma(r),e);if(e==="default"){let c=s?l.filter(J_(a)):l;t.dispatch(mr(c.slice(0,i)))}return l}),ya=M("textSuggestions/autocompletions",async(e,t)=>{var u;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{textSuggestionsCount:i,deanonymize:s,inlineSuggestions:a}=r.settings;if(!o)throw new Error("No current conversation to fetch text suggestions");let l=await n.getAutocompleteSuggestions(o,{...ma(r),input:e});if(!t.getState().input.text)throw new Error("Abort");return a&&(l=l.filter(J_(e))),s&&(l=l.map(c=>({...c,text:c.source!=="trie-with-typos"?$_(c.text,e):c.text}))),l=q_(l,i),t.dispatch(mr(l)),l}),ew=B({name:"textSuggestions",initialState:G_,reducers:{setTextSuggestions:{reducer(e,t){let{contentType:n}=t.payload;e[n].fetchState="done",e[n].suggestions=t.payload.suggestions},prepare(e,t){return{payload:{contentType:e,suggestions:t}}}},setSuggestionState(e,t){return t.payload}},extraReducers:e=>{e.addCase(Cn.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||X_;return{...t,[r]:{...o,fetchState:"loading",isInitialRequest:o.isInitialRequest===null}}}).addCase(Cn.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(Cn.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(ya.pending,t=>{t.default.fetchState="loading"}).addCase(ya.rejected,t=>{t.default.fetchState="error"}).addCase(ya.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(J,()=>G_)}}),{setTextSuggestions:tw,setSuggestionState:nw}=ew.actions,rw=ew.reducer;var ow={contentType:null,suggestion:null},iw=e=>e.activeSuggestion.suggestion,sw=e=>e.activeSuggestion.contentType,aw=B({name:"activeSuggestion",initialState:ow,reducers:{setActiveSuggestion(e,t){let{contentType:n,suggestion:r}=t.payload;e.contentType=n,e.suggestion=r},resetActiveSuggestion(e){e.contentType=null,e.suggestion=null}},extraReducers:e=>{e.addCase(J,()=>ow)}}),{setActiveSuggestion:bn,resetActiveSuggestion:wg}=aw.actions,lw=aw.reducer;var Eg={};Ce(Eg,{enUS:()=>vR,nlNL:()=>SR});var vR={warning:[{type:0,value:"Are you sure you want to discard the message?"}],editContentLabel:[{type:0,value:"Edit and view suggestion"}],overlayLabel:[{type:0,value:"Close dialog"}]},SR={warning:[{type:0,value:"Weet je zeker dat je de wijzigingen wilt weggooien?"}],editContentLabel:[{type:0,value:"Bewerk en bekijk suggestie"}],overlayLabel:[{type:0,value:"Sluit"}]};var xR={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1};var uw=({ui:e})=>e.overlayCollapsed;var cw=B({name:"ui",initialState:xR,reducers:{setShowTabHint(e,t){e.showTabHint=t.payload},setInputHasFocus(e,t){e.overlayCollapsedUserOverwrite!==!0&&(t.payload===!0&&(e.overlayCollapsed=!1),e.inputHasFocus=t.payload)},setOverlayCollapsed(e,t){t.payload.collapse===!1&&(e.openOverlayWhenTyping=!1),!(t.payload.skipWhenInputFocus&&e.inputHasFocus)&&(e.overlayCollapsed=t.payload.collapse)},setOpenOverlayWhenTyping(e,t){e.openOverlayWhenTyping=t.payload},setOverlayCollapsedUserOverwrite(e,t){e.overlayCollapsedUserOverwrite=t.payload,e.overlayCollapsed=t.payload}}}),{setShowTabHint:va,setInputHasFocus:Si,setOverlayCollapsed:xi,setOpenOverlayWhenTyping:dw,setOverlayCollapsedUserOverwrite:fw}=cw.actions,pw=cw.reducer;var Sa=S(O()),gw=S(E()),mw=Sa.default.createContext(null),xa=({broadcastEvents:e,children:t})=>{let n=Sa.default.useMemo(()=>e,[]);return(0,gw.jsx)(mw.Provider,{value:n,children:t})},Pt=()=>{let e=(0,Sa.useContext)(mw);if(!e)throw new Error("You should use the useBroadcastEvents within a BroadcastEventsProvider");return e};var _R={isLoggedIn:!0,loginFetchState:"idle",verifyFetchState:"idle",showLoginOverlay:!1},Tn=e=>e.auth.isLoggedIn,hw=e=>e.auth.loginFetchState,yw=e=>e.auth.verifyFetchState,vw=e=>e.auth.showLoginOverlay,_r=M("auth/validate",async(e,t)=>t.extra.deepdeskAPI.isLoggedIn()),Sw=M("auth/requestLogin",async({email:e},t)=>{let{deepdeskAPI:n}=t.extra;return n.requestLoginByEmail(e)}),_a=M("auth/verifyLoginToken",async({token:e},t)=>{let{deepdeskAPI:n}=t.extra;return n.verifyLoginToken(e)}),xw=B({name:"auth",initialState:_R,reducers:{setIsLoggedIn(e,t){e.isLoggedIn=t.payload},setShowLoginOverlay(e,t){e.showLoginOverlay=t.payload}},extraReducers:e=>{e.addCase(_r.pending,t=>{t.loginFetchState="loading"}),e.addCase(_r.fulfilled,(t,{payload:n})=>{t.isLoggedIn=n,t.loginFetchState="done"}),e.addCase(_r.rejected,t=>{t.loginFetchState="error",t.isLoggedIn=!1}),e.addCase(_a.pending,t=>{t.verifyFetchState="loading"}),e.addCase(_a.rejected,t=>{t.verifyFetchState="error"}),e.addCase(_a.fulfilled,(t,n)=>{n.payload.isLoggedIn?t.verifyFetchState="done":t.verifyFetchState="error"})}}),{setIsLoggedIn:_i,setShowLoginOverlay:_w}=xw.actions,ww=xw.reducer;var Cg="SetActiveSuggestion",wi="ShowLoginOverlay",bg="UserLoggedIn",wR="UserLoggedOut",kn="ApplySuggestion",Tg="ApplyImageSuggestion",ER="ShowCommandPalette",CR=e=>({[Cg]:t=>{e.dispatch(nw(t.state)),e.dispatch(bn({contentType:t.contentType,suggestion:t.suggestion}))},[ER]:t=>{e.dispatch(st(t.isOpen)),t.page&&e.dispatch(Ue(t.page))},[wi]:t=>{e.dispatch(_w(t))},[bg]:()=>{e.dispatch(_r())},[wR]:()=>{e.dispatch(_r())},[Tg]:t=>{e.dispatch(bc({suggestion:t.suggestion}))},[kn]:t=>{e.dispatch(jt({...t,eventMetrics:{inputType:"mouse"},replace:"selection"})),e.dispatch(gr())}}),Ew=CR;var kg=S(E()),bR=()=>{var v;let[e,t]=(0,Cw.useState)(!1),n=L(iw),r=L(sw),o=L(vi),i=W(),s=Pt(),a=j(Eg),l=()=>{n!==null&&e?window.confirm(a("warning"))&&u():u()},u=()=>{i(wg()),i(Si(!0)),i(Ge.actions.reset())},c=(h,m)=>{i(wg()),i(Si(!0)),s.send(kn,{text:h,suggestion:{...m,source:`${m.source||"text_recommendation"}-preview`}})};if(n===null||r===null)return null;let f=(v=o[r])==null?void 0:v.suggestions.indexOf(n),d=f===0||f===null?void 0:()=>i(bn({contentType:r,suggestion:o[r].suggestions[f-1]})),y=f===o[r].suggestions.length-1||f===null?void 0:()=>i(bn({contentType:r,suggestion:o[r].suggestions[f+1]}));return(0,kg.jsx)(ai,{autoFocus:!0,isOpen:f!==null,onClose:l,onBack:l,contentAriaLabel:a("editContentLabel"),overlayAriaLabel:a("overlayLabel"),children:(0,kg.jsx)(qc,{onTouched:t,onDismiss:u,onUse:h=>c(h,n),suggestion:n,onNext:y,onPrevious:d})})},bw=bR;var Xc=S(X()),zt=S(O());var kw=S(X());var Tw={root:"_root_1ukx5_1"};var Pw=S(E()),TR=({className:e,value:t,...n})=>{let r=k("TextInput",Tw);return(0,Pw.jsx)("input",{className:(0,kw.default)(e,r.root),type:"text",value:t,...n})},wa=TR;var Pg={};Ce(Pg,{enUS:()=>kR,nlNL:()=>PR});var kR={back:[{type:0,value:"Back"}],promptTitle:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Paste the code from your email"}],verifyCodeBody:[{type:0,value:"Copy the code from the email you just received and paste it here."}],verifyCodeInputPlaceholder:[{type:0,value:"Paste link or code here"}],verifyCodeSubmitLabel:[{type:0,value:"Sign in"}],verifyCodeError:[{type:0,value:"Sign in failed. The code is probably no longer valid. Please "},{type:8,value:"login",children:[{type:0,value:"request new code"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Have a code sent to your email"}],requestCodeBody:[{type:0,value:"Enter your email and request a code. If you are an existing "},{type:1,value:"productName"},{type:0,value:" user you will receive an email with a code. If you are a new user you will receive an email asking to request access to "},{type:1,value:"productName"},{type:0,value:" first."}],requestCodeInputPlaceholder:[{type:0,value:"Enter your email"}],requestCodeSubmitLabel:[{type:0,value:"Request code"}]},PR={back:[{type:0,value:"Terug"}],promptTitle:[{type:0,value:"Login bij "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Plak de code uit je email"}],verifyCodeBody:[{type:0,value:"Kopieer de code uit de email en plak deze hier."}],verifyCodeInputPlaceholder:[{type:0,value:"Plak hier de code"}],verifyCodeSubmitLabel:[{type:0,value:"Inloggen"}],verifyCodeError:[{type:0,value:"Inloggen is niet gelukt. De code is waarschijnlijk niet meer geldig. "},{type:8,value:"login",children:[{type:0,value:"Vraag een nieuwe code aan"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Verstuur een login code naar je email"}],requestCodeBody:[{type:0,value:"Voer je e-mailadres in en krijg een login code. Als je een bestaande "},{type:1,value:"productName"},{type:0,value:" gebruiker bent krijg je een email met een code. Als je een nieuwe gebruiker bent wordt er een email verstuurd met een toegangsverzoek voor "},{type:1,value:"productName"},{type:0,value:"."}],requestCodeInputPlaceholder:[{type:0,value:"Typ hier je e-mailadres"}],requestCodeSubmitLabel:[{type:0,value:"Code aanvragen"}]};var Rw={root:"_root_1edpl_1",anchorButton:"_anchorButton_1edpl_5",errorMessage:"_errorMessage_1edpl_19",title:"_title_1edpl_25",subtitle:"_subtitle_1edpl_31",text:"_text_1edpl_38",input:"_input_1edpl_43",actions:"_actions_1edpl_48",button:"_button_1edpl_55",primaryButton:"_primaryButton_1edpl_70"};var he=S(E());var RR=e=>{try{let t=new URL(e);return new URLSearchParams(t.search).get("token")||void 0}catch{return e}},IR=({agentEmail:e,isOpen:t,origin:n="",onSuccess:r,onDismiss:o})=>{let i=j(Pg),s=k("LoginTokenDialog",Rw),a=L(yw),l=W(),u=F("productName"),[c,f]=(0,zt.useState)(e||""),[d,y]=(0,zt.useState)(0),[v,h]=(0,zt.useState)(""),m=(0,zt.useCallback)(async _=>{_.preventDefault(),l(Sw({email:c})),y(1)},[n,c]),g=()=>{h(""),y(0)},p=(0,zt.useCallback)(async _=>{_.preventDefault();let C=RR(_.target.elements.token.value);if(!C){h(i("verifyCodeError",{login:x}));return}l(_a({token:C}))},[n]),x=(0,zt.useMemo)(()=>_=>(0,he.jsx)("button",{type:"button","data-testid":"login-token-dialog-back-button",className:s.anchorButton,onClick:g,children:_},"back-button"),[]);return(0,zt.useEffect)(()=>{a==="error"&&h(i("verifyCodeError",{login:x})),a==="done"&&r()},[a]),(0,he.jsx)(ai,{autoFocus:!0,isOpen:t,contentAriaLabel:i("promptTitle",{productName:u}),overlayAriaLabel:i("promptTitle",{productName:u}),onClose:o,onBack:o,children:(0,he.jsxs)("div",{className:s.root,children:[(0,he.jsx)("h1",{className:s.title,children:i("promptTitle",{productName:u})}),d===0&&(0,he.jsxs)("form",{onSubmit:m,children:[(0,he.jsx)("h2",{className:s.subtitle,children:i("requestCodeTitle")}),(0,he.jsx)("p",{className:s.text,children:i("requestCodeBody",{productName:u})}),(0,he.jsx)(wa,{className:s.input,name:"email",placeholder:i("requestCodeInputPlaceholder"),value:c,onChange:_=>f(_.target.value)}),(0,he.jsx)("div",{className:s.actions,children:(0,he.jsx)("button",{type:"submit",className:(0,Xc.default)(s.button,s.primaryButton),children:i("requestCodeSubmitLabel")})})]}),d===1&&(0,he.jsxs)("form",{onSubmit:p,children:[(0,he.jsx)("h2",{className:s.subtitle,children:i("verifyCodeTitle")}),(0,he.jsx)("p",{className:s.text,children:i("verifyCodeBody")}),(0,he.jsx)(wa,{className:s.input,name:"token",placeholder:i("verifyCodeInputPlaceholder"),disabled:["loading","done"].includes(a)}),v&&(0,he.jsx)("div",{className:s.errorMessage,children:v}),(0,he.jsxs)("div",{className:s.actions,children:[(0,he.jsx)("button",{type:"button",className:(0,Xc.default)(s.button),onClick:g,children:i("back")}),(0,he.jsx)("button",{type:"submit",className:(0,Xc.default)(s.button,s.primaryButton),disabled:["loading","done"].includes(a),children:i("verifyCodeSubmitLabel")})]})]})]})})},Iw=IR;var Lw=S(E()),AR=()=>{let e=L(vw),t=L(L_),n=F("adminUrl"),r=Pt(),o=()=>r.send(wi,!1),i=()=>{r.send(wi,!1),r.send(bg)};return(0,Lw.jsx)(Iw,{isOpen:e,agentEmail:t==null?void 0:t.agentEmail,origin:n,onDismiss:o,onSuccess:i})},Aw=AR;var o1=S(Ag()),Ze=S(O());var XR={data:null,fetchState:"idle"},Dw=e=>e.contentTypes.data,Ea=M("contentTypes/getContentTypes",async(e,t)=>t.extra.deepdeskAPI.getContentTypes()),QR=B({name:"contentTypes",initialState:XR,reducers:{},extraReducers:e=>{e.addCase(Ea.pending,t=>{t.fetchState="loading"}).addCase(Ea.rejected,t=>{t.fetchState="error"}).addCase(Ea.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),Fw=QR.reducer;function Ca(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),t.remove()}var jw=S(O());function Bw(e,t){(0,jw.useEffect)(()=>{let n=r=>{var o;((o=navigator==null?void 0:navigator.platform)!=null&&o.toLowerCase().includes("mac")?r.metaKey:r.ctrlKey)&&r.key===e&&(r.preventDefault(),r.stopPropagation(),t())};return document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n)}},[])}var ba=S(O());var Hw={data:null,fetchState:"idle"},Qc=e=>{var i;let t=[],{visitorName:n}=e.info.visitorInfo??{},{agentName:r,agentNickname:o}=e.info.agentInfo??{};return r&&r!==n&&t.push(r),o&&o!==n&&t.push(o),((i=e.entities.data)==null?void 0:i.filter(s=>!t.includes(s.text)))??null},Vt=M("entities/getEntities",async(e,t)=>{let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,i=await o();return i.length===0?Promise.resolve([]):n.getEntities(i)}),YR=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),ZR=B({name:"entities",initialState:Hw,reducers:{},extraReducers:e=>{e.addCase(Vt.pending,t=>{t.fetchState="loading"}).addCase(Vt.rejected,t=>{t.fetchState="error"}).addCase(Vt.fulfilled,(t,n)=>{t.fetchState="done",t.data=YR(t.data?[...t.data,...n.payload]:n.payload)}).addCase(J,()=>Hw)}}),Uw=ZR.reducer;var Lg={};Ce(Lg,{enUS:()=>JR,nlNL:()=>eI});var JR={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},eI={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var zw={root:"_root_17kae_1",empty:"_empty_17kae_5"};var so=S(E()),tI=({onCopy:e,onUse:t})=>{let n=(0,ba.useRef)(null),r=k("EntitiesList",zw),o=j(Lg),i=L(Qc),s=W();return(0,ba.useEffect)(()=>{s(Vt())},[]),(0,ba.useEffect)(()=>{n.current&&n.current.focus()},[n]),(0,so.jsxs)("div",{className:r.root,ref:n,tabIndex:-1,children:[i&&i.length>0&&(0,so.jsx)(te.ActionsBar,{primaryLabel:o("copy"),secondaryLabel:o("use"),onPrimary:(a,l)=>e(i[l]),onSecondary:(a,l)=>t(i[l]),list:i.map(a=>({text:a.text,type:a.label,primaryAction:"copy",secondaryAction:"use"})),children:(0,so.jsx)(te.List,{children:i.map((a,l)=>(0,so.jsx)(te.ListItem,{index:l,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities")}),i&&i.length===0&&(0,so.jsx)("p",{className:r.empty,children:o("noResults")})]})},Vw=tI;var Kt=S(O());var Kw={data:null,fetchState:"idle"},Ww=e=>e.summary.data,$w=e=>e.summary.fetchState==="error",Pn=M("summary/getSummary",async(e,t)=>{let n=t.getState().profile.data;if(!n)throw new Error("Profile is not defined");let{deepdeskAPI:r,dynamicThunkObject:o}=t.extra;if(!o.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let i=o.conversationQuery,s=await i();return s.length===0?Promise.reject(new Error("No messages are included")):{summary:await r.getSummary(s,{promptInstruction:n.summarizerPromptInstruction,model:n.summarizerModel})}}),nI=B({name:"summary",initialState:Kw,reducers:{},extraReducers:e=>{e.addCase(Pn.pending,t=>{t.data=null,t.fetchState="loading"}).addCase(Pn.rejected,t=>{t.data=null,t.fetchState="error"}).addCase(Pn.fulfilled,(t,n)=>{t.fetchState="done",n.payload&&(t.data=n.payload.summary)}).addCase(J,()=>Kw)}}),qw=nI.reducer;var Og={};Ce(Og,{enUS:()=>rI,nlNL:()=>oI});var rI={copy:[{type:0,value:"Copy"}],error:[{type:0,value:"Could not generate a summary"}],loading:[{type:0,value:"Generating summary, this may take a few moments."}]},oI={copy:[{type:0,value:"Kopieer"}],error:[{type:0,value:"Kon helaas geen samenvatting genereren."}],loading:[{type:0,value:"Samenvatting wordt gemaakt, dit kan even duren."}]};var Gw={root:"_root_6ahh3_1",actions:"_actions_6ahh3_5",main:"_main_6ahh3_11",textInput:"_textInput_6ahh3_15",loading:"_loading_6ahh3_34",error:"_error_6ahh3_38"};var Rn=S(E()),iI=({onCopy:e})=>{let t=(0,Kt.useRef)(null),n=k("SummaryForm",Gw),[r,o]=(0,Kt.useState)(""),i=j(Og),s=L(Ww),a=L($w),l=W(),u=()=>{l(it({name:"summary copied to clipboard",data:{originalText:s,finalText:r},options:{includeConversationData:!0}})),e(r)},c=()=>{let f=document.getSelection();f&&l(it({name:"summary copied to clipboard",data:{originalText:s,finalText:f==null?void 0:f.toString()},options:{includeConversationData:!0}}))};return(0,Kt.useEffect)(()=>{l(Pn())},[]),(0,Kt.useEffect)(()=>{o(s||"")},[s]),(0,Kt.useEffect)(()=>{t.current&&s&&t.current.focus()},[t,s]),(0,Kt.useEffect)(()=>{let f=d=>{d.key==="Enter"&&d.shiftKey&&u()};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[r]),(0,Rn.jsx)("div",{className:n.root,tabIndex:-1,children:a?(0,Rn.jsx)("p",{className:n.error,children:i("error")}):(0,Rn.jsxs)(Kt.Fragment,{children:[(0,Rn.jsx)("div",{className:n.main,children:(0,Rn.jsx)("textarea",{placeholder:s?void 0:i("loading"),disabled:!s,className:n.textInput,ref:t,value:r,onCopy:c,onChange:f=>o(f.target.value)})}),(0,Rn.jsx)("div",{className:n.actions,children:(0,Rn.jsx)(te.Button,{shortKeys:[8679,8629],onClick:u,children:i("copy")})})]})})},Xw=iI;var Ng={};Ce(Ng,{enUS:()=>sI,nlNL:()=>aI});var sI={personalCollectionLink:[{type:0,value:"Go to Personal Collection"}],searchPlaceholder:[{type:0,value:"Start typing to search..."}],urlSuggestions:[{type:0,value:"Link suggestions"}],personalSuggestions:[{type:0,value:"Personal suggestions"}],pinnedMessages:[{type:0,value:"Pinned messages"}],imageSuggestions:[{type:0,value:"Images"}],typePlaceholder:[{type:0,value:"All types"}],navigation:[{type:0,value:"Navigation"}],entitiesClipboard:[{type:0,value:"Conversation clipper"}],entitiesTitle:[{type:0,value:"Copy to your clipboard"}],summaryClipboard:[{type:0,value:"Summarize conversation"}],summaryTitle:[{type:0,value:"Conversation summary"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Commands"}],use:[{type:0,value:"Use"}],preview:[{type:0,value:"Preview"}],warning:[{type:0,value:"Are you sure you want to discard the message?"}]},aI={personalCollectionLink:[{type:0,value:"Ga naar persoonlijke collectie"}],searchPlaceholder:[{type:0,value:"Begin met typen om te zoeken..."}],personalSuggestions:[{type:0,value:"Persoonlijke suggesties"}],urlSuggestions:[{type:0,value:"Link suggesties"}],imageSuggestions:[{type:0,value:"Afbeeldingen"}],navigation:[{type:0,value:"Navigatie"}],typePlaceholder:[{type:0,value:"Alle types"}],pinnedMessages:[{type:0,value:"Actueel"}],entitiesClipboard:[{type:0,value:"Klembord"}],entitiesTitle:[{type:0,value:"Kopieer naar klembord"}],summaryClipboard:[{type:0,value:"Gesprek samenvatten"}],summaryTitle:[{type:0,value:"Gesprek samenvatting"}],knowledgeAssist:[{type:0,value:"Knowledge assist"}],commands:[{type:0,value:"Acties"}],use:[{type:0,value:"Gebruik"}],preview:[{type:0,value:"Bewerk"}],warning:[{type:0,value:"Weet je zeker dat je de wijzigingen wilt weggooien?"}]};var wr=S(O());var Mg={};Ce(Mg,{enUS:()=>lI,nlNL:()=>uI});var lI={use:[{type:0,value:"Use"}],loading:[{type:0,value:"Loading..."}],error:[{type:0,value:"Something went wrong, please try again later."}],anotherQuestion:[{type:0,value:"Send a message..."}],reset:[{type:0,value:"Reset conversation"}]},uI={use:[{type:0,value:"Gebruik"}],loading:[{type:0,value:"Laden..."}],error:[{type:0,value:"Er ging iets mis, probeer het later opnieuw."}],anotherQuestion:[{type:0,value:"Stuur een bericht..."}],reset:[{type:0,value:"Reset gesprek"}]};var Qw={root:"_root_1g4pq_1",title:"_title_1g4pq_9",empty:"_empty_1g4pq_20",status:"_status_1g4pq_24",form:"_form_1g4pq_30",input:"_input_1g4pq_43",submit:"_submit_1g4pq_55",question:"_question_1g4pq_63",answer:"_answer_1g4pq_67",alignRight:"_alignRight_1g4pq_73"};var Dg={data:[],fetchState:"idle"},Yw=e=>{var t;return(t=e.answer)==null?void 0:t.data},Zw=e=>e.answer.fetchState,Ci=fe("answer/resetKnowledgeSearch"),Ei=M("answer/getAnswer",async(e,t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState().answer.data,o=(s=t.getState().conversation.current)==null?void 0:s.profileCode;if(!o)throw new Error("Profile is not defined");let i=await n.knowledgeAssist({promptInstruction:e.promptInstruction,question:e.question},r,o);return{question:e.question,answer:i}}),cI=B({name:"answer",initialState:Dg,reducers:{},extraReducers:e=>{e.addCase(Ei.pending,t=>{t.fetchState="loading"}).addCase(Ei.rejected,t=>{t.fetchState="error"}).addCase(Ei.fulfilled,(t,n)=>{t.fetchState="done",t.data=[...t.data,n.payload]}).addCase(J,()=>Dg).addCase(Ci,()=>Dg)}}),Jw=cI.reducer;var Ta=S(E()),e1=()=>(0,Ta.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512","aria-labelledby":"paperPlaneTitle",children:[(0,Ta.jsx)("title",{id:"paperPlaneTitle",children:"PaperPlane"}),(0,Ta.jsx)("path",{d:"M498.1 5.6c10.1 7 15.4 19.1 13.5 31.2l-64 416c-1.5 9.7-7.4 18.2-16 23s-18.9 5.4-28 1.6L284 427.7l-68.5 74.1c-8.9 9.7-22.9 12.9-35.2 8.1S160 493.2 160 480V396.4c0-4 1.5-7.8 4.2-10.7L331.8 202.8c5.8-6.3 5.6-16-.4-22s-15.7-6.4-22-.7L106 360.8 17.7 316.6C7.1 311.3 .3 300.7 0 288.9s5.9-22.8 16.1-28.7l448-256c10.7-6.1 23.9-5.5 34 1.4z"})]});var Ye=S(E()),dI=({onUse:e,onResetQuestion:t,question:n,promptInstruction:r})=>{let[o,i]=wr.default.useState(""),{setSelected:s}=vr(),a=(0,wr.useRef)(null),l=k("EntitiesList",Qw),u=j(Mg),c=W(),f=L(Yw),d=L(Zw),y=async h=>{h.preventDefault(),h.stopPropagation(),o!==""&&c(Ei({question:o,promptInstruction:r}))},v=(h,m)=>{c(it({name:"knowledge assist source viewed",data:{question:m,sourceViewed:h.url||h.name},options:{includeConversationData:!0}}))};return(0,wr.useEffect)(()=>{var h;n&&d==="idle"?c(Ei({question:n,promptInstruction:r})):(h=a.current)==null||h.focus()},[a,d]),(0,wr.useEffect)(()=>{d==="done"&&(c(it({name:"knowledge assist question answered",data:{question:o||n,sources:f[f.length-1].answer.sources,answer:f[f.length-1].answer.answer,isFollowUpQuestion:f.length>1},options:{includeConversationData:!0}})),s(f.length-1),i(""))},[d,f]),(0,wr.useEffect)(()=>{a.current&&a.current.scrollIntoView({behavior:"smooth"})},[a,f]),(0,Ye.jsxs)("div",{className:l.root,children:[f.length>0&&(0,Ye.jsx)("div",{className:l.alignRight,children:(0,Ye.jsx)(te.Button,{onClick:t,children:u("reset")})}),(0,Ye.jsxs)(te.ActionsBar,{list:f.map(({answer:h})=>({text:h.answer,type:"answer"})),primaryLabel:u("use"),onPrimary:h=>e(h.text),children:[f.map(({question:h,answer:m},g)=>(0,Ye.jsx)(te.List,{children:(0,Ye.jsx)(te.ListItem,{"data-testid":"knowledge-search-answer",index:g,description:m.answer,closeOnSelect:!0,onClick:()=>e(m.answer),onSourceClick:p=>v(p,h),sources:m.sources,styles:{title:l.question,description:l.answer},children:h})},`${m.answer}_${g}`)),d==="loading"&&(0,Ye.jsx)("p",{className:l.status,children:u("loading")}),d==="error"&&(0,Ye.jsx)("p",{className:l.status,children:u("error")}),(0,Ye.jsxs)("form",{className:l.form,onSubmit:y,children:[(0,Ye.jsx)("input",{ref:a,placeholder:u("anotherQuestion"),className:l.input,type:"text",value:o,onFocus:()=>{s(-1)},onChange:h=>{s(-1),i(h.target.value)}}),(0,Ye.jsx)("button",{type:"submit",className:l.submit,children:(0,Ye.jsx)(e1,{})})]})]})]})},t1=dI;var fI={data:null,fetchState:"idle"},bi=e=>e.profile.data,Yc=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],ka=M("profile/getProfile",async(e,t)=>{var i;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");return((i=r.profile.data)==null?void 0:i.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)}),pI=B({name:"profile",initialState:fI,reducers:{},extraReducers:e=>{e.addCase(ka.pending,t=>{t.fetchState="loading"}).addCase(ka.rejected,t=>{t.fetchState="error"}).addCase(ka.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),n1=pI.reducer;var Ee=S(E()),mI=200,gI=5,hI=4,yI=e=>e.reduce((t,n)=>[...t,...n.list.map(r=>({...r,type:n.value}))],[]),r1=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),vI=()=>{let e=W(),t=Pt(),n=j(Ng),[r,o]=(0,Ze.useState)(!1),[i,s]=(0,Ze.useState)(""),a=L(F_),l=L(bi),[u,c]=(0,Ze.useState)(null),[f,d]=(0,Ze.useState)([]),[y,v]=(0,Ze.useState)(),h=L(Tn),m=F("showSearch"),g=F("showEntitiesCommand"),p=F("showSummaryCommand"),x=F("showKnowledgeSearch"),_=F("showImageSearch"),C=F("searchTriggerKey"),w=L(Dw),b=L(j_),R=L(D_),P=I=>ln(b.filter($=>$.type===I.toUpperCase()),I),N=[{value:"PERSONAL",label:n("personalSuggestions"),list:P("PERSONAL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"URL",label:n("urlSuggestions"),list:P("URL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:P("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:P("IMAGE"),listOrientation:"horizontal",shouldShow:_}].filter(I=>I.shouldShow),V=[{label:n("entitiesClipboard"),onClick:()=>e(Ue("entities")),shouldShow:g&&r1(n("entitiesClipboard"),i),experimental:!0},{label:n("summaryClipboard"),onClick:()=>e(Ue("summary")),shouldShow:p&&r1(n("summaryClipboard"),i),experimental:!0},{label:i?`${n("knowledgeAssist")}: ${i}`:n("knowledgeAssist"),onClick:()=>e(Ue("knowledgeAssist")),shouldShow:x,experimental:!0}].filter(I=>I.shouldShow),H=(w==null?void 0:w.map(I=>({value:I.code.toUpperCase(),label:`${I.name}s`,list:P(I.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[],je=(0,Ze.useCallback)((0,o1.default)((I,$)=>{e(oo({query:I,type:$,tags:["search-overlay"]}))},mI),[]),an=yI([...H,...N]),$t=(0,Ze.useCallback)((I,$)=>{if(!$)return;let At=[...N,...H].find(({value:Bn})=>Bn===$);At&&(e(Ue("edit")),c({...I,searchTerm:void 0}),d(At.list))},[e,u,H]),uo=(0,Ze.useCallback)((I,$)=>{switch($.type){case"IMAGE":t.send(Tg,{suggestion:$});break;default:t.send(kn,{text:I,suggestion:$})}e(st(!1))},[e]),Di=I=>{Ca(I.text),e(it({name:"entity copied",data:{entity:I,type:"copy"}})),e(st(!1))},Pr=I=>{t.send(kn,{text:I,suggestion:{source:"knowledge-assist",text:I}}),e(it({name:"answer used",data:{originalText:I},options:{includeConversationData:!0}})),s(""),e(Ue("search")),e(Ci()),e(st(!1))},Ha=I=>{Ca(I),e(st(!1))},Ua=I=>{t.send(kn,{text:I.text,suggestion:{source:"entity",text:I.text}}),e(st(!1))},Fi=u===null||f.indexOf(u)-1<0?void 0:()=>c(f[f.indexOf(u)-1]),ji=u===null||f.indexOf(u)===f.length-1?void 0:()=>c(f[f.indexOf(u)+1]);function ln(I,$){return I.slice(0,y?10:$.toLowerCase()==="image"?hI:gI)}function Bi(I,$,At){return $.reduce((Bn,un)=>At&&y===At?un.length+Bn:ln(un,At).length+Bn,I)}function Rr(I){return $=>{r?window.confirm(n("warning"))&&(I($),o(!1)):I($)}}return(0,Ze.useEffect)(()=>{i?je(i,y):e(Kc())},[i,y]),(0,Ze.useEffect)(()=>{a==="search"&&e(Ci())},[a]),(0,Ze.useEffect)(()=>{h&&e(Ea())},[h]),Bw(C,()=>e(st(!0))),!m||!l?null:(0,Ee.jsxs)(te,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:Rr(I=>e(st(I))),onChangeType:I=>v(I),onChangePage:Rr(I=>e(Ue(I))),selectedType:y,search:i,page:a,isOpen:R,types:[...H,...N],children:[(0,Ee.jsx)(te.Page,{id:"search",children:(0,Ee.jsxs)(te.ActionsBar,{list:[...V.map(I=>({text:I.label,type:"command"})),...an.map(I=>({text:I.text||I.url||I.message,type:I.type}))],primaryLabel:n("use"),secondaryLabel:n("preview"),onPrimary:({text:I},$)=>uo(I,an[$]),onSecondary:(I,$)=>{$t(an[$-V.length],an[$-V.length].type)},children:[V.length>0&&(0,Ee.jsx)(te.List,{heading:n("commands"),children:V.map((I,$)=>(0,Ee.jsx)(te.ListItem,{index:Bi($,[],"commands"),closeOnSelect:!1,onClick:I.onClick,isExperimental:I.experimental,children:I.label},I.label))}),[...H,...N].map(({value:I,label:$,list:At,lineClamp:Bn,listOrientation:un},Hi)=>(0,Ee.jsx)(te.List,{heading:$,orientation:un==="horizontal"?"horizontal":"vertical",children:ln(At,I).map((ct,dt)=>(0,Ee.jsx)(te.ListItem,{index:Bi(V.length+dt,[...H,...N].slice(0,Hi).map(({list:Ir})=>Ir),I),closeOnSelect:!1,lineClamp:Bn,onClick:()=>uo(ct.text,ct),description:I!=="IMAGE"?ct.title&&ct.text:void 0,children:I==="IMAGE"?(0,Ee.jsx)(te.Image,{title:ct.title||ct.text,src:ct.image}):ct.title||ct.text},`${ct.id}-${ct.text}`))},I))]})}),(0,Ee.jsx)(te.Page,{id:"edit",onDismiss:Rr(()=>{e(Ue("search")),c(null)}),children:u&&(0,Ee.jsx)(qc,{suggestion:u,onTouched:o,onDismiss:()=>{o(!1),e(Ue("search")),c(null),d([])},onNext:ji,onPrevious:Fi,onUse:I=>{e(Ue("search")),uo(I,{...u,source:`${u.source||"text_recommendation"}-preview`}),e(st(!1)),d([]),c(null)}})}),(0,Ee.jsx)(te.Page,{id:"entities",title:n("entitiesTitle"),isExperimental:!0,onDismiss:Rr(()=>{e(Ue("search"))}),children:(0,Ee.jsx)(Vw,{onUse:Ua,onCopy:Di})}),(0,Ee.jsx)(te.Page,{id:"summary",title:n("summaryTitle"),isExperimental:!0,onDismiss:Rr(()=>{e(Ue("search"))}),children:(0,Ee.jsx)(Xw,{onCopy:Ha})}),(0,Ee.jsx)(te.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),isExperimental:!0,onDismiss:Rr(()=>{e(Ci()),e(Ue("search"))}),children:(0,Ee.jsx)(t1,{promptInstruction:l.knowledgeAssistPromptInstruction,question:i,onUse:Pr,onResetQuestion:()=>{e(Ci()),s("")}})})]})},i1=vI;var Ti=S(E()),SI=()=>{let e=F("showSearch"),t=F("isEmbedded");return(0,Ti.jsxs)(s1.Fragment,{children:[e&&(0,Ti.jsx)(i1,{}),(0,Ti.jsx)(bw,{}),t&&(0,Ti.jsx)(Aw,{})]})},a1=SI;var Pa=S(E()),xI=({children:e})=>{let n=F("locale").replace("-","");return(0,Pa.jsx)(Bd.Provider,{value:n,children:e})},_I=({store:e,customStyles:t={},children:n})=>(0,Pa.jsx)(Hm,{store:e,children:(0,Pa.jsx)(xI,{children:(0,Pa.jsx)(zi.Provider,{value:t,children:n})})}),Ra=_I;var ed=S(X()),Ri=S(O());var l1=S(O());function u1(e,t){let[n,r]=(0,l1.useState)(()=>{if(typeof window>"u")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return U.error(i),t}});return[n,i=>{try{let s=i instanceof Function?i(n):i;r(s),typeof window<"u"&&window.localStorage.setItem(e,JSON.stringify(s))}catch(s){U.error(s)}}]}function Zc(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:i}=e.input.userCommitted;return i.start!==i.end?!1:i.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(i.end))||r&&new RegExp(r).test(o.substring(0,i.end))?!0:n===!1&&r===!1:!1}var d1=S(X()),In=S(O());var Fg={};Ce(Fg,{enUS:()=>wI,nlNL:()=>EI});var wI={loginPlease:[{type:8,value:"login",children:[{type:0,value:"Sign in"}]},{type:0,value:" to enable "},{type:1,value:"productName"},{type:0,value:"."}],snooze:[{type:0,value:"Snooze for "},{type:8,value:"min",children:[{type:0,value:"10 minutes"}]},{type:0,value:", "},{type:8,value:"hour",children:[{type:0,value:"1 hour"}]},{type:0,value:" or "},{type:8,value:"day",children:[{type:0,value:"1 day"}]}]},EI={loginPlease:[{type:8,value:"login",children:[{type:0,value:"Log in"}]},{type:0,value:" bij "},{type:1,value:"productName"},{type:0,value:"."}],snooze:[{type:0,value:"Snooze voor "},{type:8,value:"min",children:[{type:0,value:"10 minuten"}]},{type:0,value:", "},{type:8,value:"hour",children:[{type:0,value:"1 uur"}]},{type:0,value:" of "},{type:8,value:"day",children:[{type:0,value:"1 dag"}]}]};var c1={root:"_root_1vfca_1",anchor:"_anchor_1vfca_6",anchorButton:"_anchorButton_1vfca_11"};var Er=S(E()),jg=(e,t,n)=>r=>(0,Er.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),CI=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r})=>{let o=j(Fg),i=Pt(),s=k("Login",c1),a=F("productName"),l=(0,In.useCallback)(h=>{h.preventDefault(),r&&r(parseInt(h.target.value,10))},[]),u=(0,In.useCallback)(h=>{h.preventDefault(),i.send(wi,!0)},[t]),c=(0,In.useMemo)(()=>h=>(0,Er.jsx)("a",{href:t,className:s.anchor,target:"_blank",rel:"noreferrer",children:h},"login"),[t]),f=(0,In.useCallback)(h=>(0,Er.jsx)("button",{type:"button",className:s.anchorButton,onClick:u,children:h},"prompt"),[u]),{min:d,hour:y,day:v}=(0,In.useMemo)(()=>({min:jg(s,60*10,l),hour:jg(s,60*60,l),day:jg(s,60*60*12,l)}),[]);return(0,Er.jsxs)("div",{className:(0,d1.default)(e,s.root),children:[o("loginPlease",{login:n?f:c,productName:a}),r&&(0,Er.jsxs)(In.Fragment,{children:[(0,Er.jsx)("br",{}),o("snooze",{min:d,hour:y,day:v})]})]})},Jc=CI;var f1={root:"_root_1g8fi_1",text:"_text_1g8fi_19"};var Ia=S(E()),bI=({title:e})=>{let t=k("SearchTrigger",f1),n=W();return(0,Ia.jsxs)("button",{type:"button",className:t.root,onClick:()=>n(st(!0)),children:[(0,Ia.jsx)(hi,{}),(0,Ia.jsx)("span",{className:t.text,children:e})]})},p1=bI;var x1=S(O());var Pi=S(O());var m1=S(O());function g1(e,t,n){(0,m1.useEffect)(()=>{let r=e.current;return r?(r.addEventListener(t,n),()=>{r.removeEventListener(t,n)}):()=>{}},[e,t,n])}var TI=/[.*+?^${}()|[\]\\]/g,kI=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function PI(e){return e.replace(TI,"\\$&")}function RI(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function Bg(e){return e.search(kI)}function h1(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${PI(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function y1(e){return e.replace(ho,'<mark data-type="placeholder">$1</mark>')}function ki(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function II(e,t){return e.split("").map((s,a)=>({char:s,index:a})).filter(({char:s,index:a})=>/\s/.test(s)&&a<=t).map(({index:s})=>s).reverse()[0]}function Hg(e,t,n={}){if(t){let r=RI(t.toLowerCase(),e.toLowerCase()),o=ki(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=Bg(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let s=t.split(Sy).length>3||t.length>30?II(t.trim(),r):0;return`${`${s>0?"\u2026":""}${ki(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var v1={badge:"_badge_8rv7b_1",formattedText:"_formattedText_8rv7b_5"};var Ug=S(E()),LI=["search","personal-collection-search","search-autocomplete"];function OI(e,t,n,r={}){let o="";return LI.includes(t)?o=h1(Hg(e,n,{stripAgentPart:!0}),r.searchKeywords??[n]):o=Hg(e,n,r),r.placeholders===!0&&(o=y1(o)),o}var NI=()=>{},MI=({index:e,selected:t,suggestion:n})=>{let r=F("inlineSuggestions"),o=L(ii),i=W(),s=k("TextSuggestion",v1),a=(0,Pi.useRef)(null);(0,Pi.useEffect)(()=>{let u=setTimeout(()=>{i(Xx({text:n.text,suggestion:n}))},500);return()=>{clearTimeout(u)}},[n]),g1(a,"click",()=>{i(Tc(e)),i(jt({suggestion:n,text:n.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let l=(0,Pi.useMemo)(()=>OI(n.text,n.source,o,{stripAgentPart:r,placeholders:!0,searchKeywords:n.searchKeywords}),[r,n.text,n.source,o,n.searchKeywords]);return n.source==="gpt"?null:(0,Ug.jsx)(oe,{ref:a,as:"button","data-testid":"suggestions-overlay-item",selected:t,onClick:NI,children:(0,Ug.jsx)(li,{containerTagName:"div",noWrap:!1,tagName:"span",className:s.formattedText,content:l})})},S1=MI;var zg=S(E()),DI=({suggestions:e,selectedIndex:t})=>(0,zg.jsx)(x1.Fragment,{children:e.slice().map((n,r)=>(0,zg.jsx)(S1,{index:r,selected:r===t,suggestion:n},`${n.text}-${n.source}`)).reverse()}),_1=DI;var Vg={};Ce(Vg,{enUS:()=>FI,nlNL:()=>jI});var FI={arrowHint:[{type:0,value:"Tip: use arrow keys to navigate suggestions"}],searchHintWindows:[{type:0,value:"Press CTRL+"},{type:1,value:"searchTriggerKey"},{type:0,value:" to search"}],searchHintMac:[{type:0,value:"Press CMD+"},{type:1,value:"searchTriggerKey"},{type:0,value:" to search"}],open:[{type:0,value:"Open "},{type:1,value:"productName"}],collapse:[{type:0,value:"Close"}],search:[{type:0,value:"Search"}]},jI={arrowHint:[{type:0,value:"Tip: Selecteer suggesties met pijltoetsen"}],searchHintWindows:[{type:0,value:"Druk CTRL+"},{type:1,value:"searchTriggerKey"},{type:0,value:" om te zoeken"}],searchHintMac:[{type:0,value:"Druk CMD+"},{type:1,value:"searchTriggerKey"},{type:0,value:" om te zoeken"}],open:[{type:0,value:"Open "},{type:1,value:"productName"}],collapse:[{type:0,value:"Sluiten"}],search:[{type:0,value:"Zoeken"}]};var w1={root:"_root_4kcme_1",isInline:"_isInline_4kcme_14",toggleButton:"_toggleButton_4kcme_18",toggleButtonWrapper:"_toggleButtonWrapper_4kcme_22",toggleButtonWrapperHidden:"_toggleButtonWrapperHidden_4kcme_29",isCollapsed:"_isCollapsed_4kcme_33",collapsible:"_collapsible_4kcme_33",hints:"_hints_4kcme_41",hintsHidden:"_hintsHidden_4kcme_48",triggers:"_triggers_4kcme_53",triggersRight:"_triggersRight_4kcme_68"};var ue=S(E()),BI=({inline:e=!1,textSuggestions:t,selectedIndex:n})=>{let r=k("SuggestionsOverlay",w1),o=j(Vg),i=F("inlineSuggestions"),s=L(Zc),a=Kx(),l=W(),u=(0,Ri.useRef)(null),c=F("searchTriggerKey"),f=F("productName"),d=L(uw),y=L(Tn),v=L(mc),[h,m]=(0,Ri.useState)(null),g=F("showSearch"),p=F("showTextSuggestions"),x=F("adminUrl"),_=F("isEmbedded"),[C,w]=u1("dd-snooze-until-ms",0),b=d||C>Date.now(),R=t.filter(V=>V.source!=="gpt").length,P=()=>{b&&w(0),l(fw(!b))},N=V=>{let H=Date.now()+V*1e3;w(H),U.info(`Snooze until: ${new Date(H)}`),l(xi({collapse:!0}))};return(0,Ri.useEffect)(()=>{R===0&&m(null)},[t,R]),fi(()=>{l(xi({collapse:!0,skipWhenInputFocus:!0}))}),i!==e||y===null||v===!1?null:y===!1?(0,ue.jsxs)("div",{ref:u,className:(0,ed.default)(r.root,{[r.isCollapsed]:b,[r.isInline]:e}),"data-inline":e,children:[!b&&(0,ue.jsxs)("div",{className:r.triggers,children:[(0,ue.jsx)("div",{style:{flex:1}}),(0,ue.jsx)("div",{className:r.triggersRight,children:(0,ue.jsx)(Nr,{className:r.toggleButton,title:o("collapse"),onClick:P,isCollapsed:!1})})]}),(0,ue.jsx)("div",{className:r.toggleButtonWrapper,children:(0,ue.jsx)(Nr,{className:r.toggleButton,title:o("open",{productName:f}),onClick:P,isCollapsed:!0})}),(0,ue.jsx)("div",{className:r.collapsible,children:(0,ue.jsx)(Jc,{loginUrl:x,isEmbedded:_,onSnooze:N})})]}):!a||!s?null:(0,ue.jsxs)("div",{ref:u,className:(0,ed.default)(r.root,{[r.isCollapsed]:b,[r.isInline]:e}),"data-inline":e,children:[!b&&(0,ue.jsxs)("div",{className:r.triggers,children:[(0,ue.jsx)("div",{style:{flex:1},children:g&&(0,ue.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>m(o(zc()?"searchHintMac":"searchHintWindows",{searchTriggerKey:c.toUpperCase()})),onMouseLeave:()=>m(null),children:(0,ue.jsx)(p1,{title:o("search")})})}),(0,ue.jsxs)("div",{className:r.triggersRight,onFocus:()=>{},children:[(0,ue.jsx)("div",{className:(0,ed.default)(!h&&r.hintsHidden,r.hints),children:h}),(0,ue.jsx)(Nr,{className:r.toggleButton,title:o("collapse"),onClick:P,isCollapsed:!1})]})]}),(0,ue.jsx)("div",{className:r.toggleButtonWrapper,children:(0,ue.jsx)(Nr,{className:r.toggleButton,title:o("open",{productName:f}),onClick:P,isCollapsed:!0})}),R>0&&p&&(0,ue.jsx)("div",{className:r.collapsible,onFocus:()=>{},children:(0,ue.jsx)(qt,{children:(0,ue.jsx)(_1,{suggestions:t,selectedIndex:n})})})]})},HI=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),td=Yr(HI)(BI);var md=S(X());var Nn=S(O());var E1=S(O()),UI=["div","span","mark","strong","b","i","u","em"];function Kg(e,t,n=0){var i;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(i=r.props)==null?void 0:i.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(UI.includes(o)){let s=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,E1.cloneElement)(r,{children:Kg(s,t,n+1)})]}return[...e,...t]}function An(e){return e.tagName.toLowerCase()==="textarea"}var C1={root:"_root_81non_1",container:"_container_81non_3",agentText:"_agentText_81non_5",tabText:"_tabText_81non_6",hint:"_hint_81non_6",matchSelection:"_matchSelection_81non_10",focus:"_focus_81non_16",resetIndent:"_resetIndent_81non_20",matchKeyword:"_matchKeyword_81non_24",matchPlaceholder:"_matchPlaceholder_81non_25",hover:"_hover_81non_31",hintText:"_hintText_81non_64",popover:"_popover_81non_72",popoverRoot:"_popoverRoot_81non_77",popoverContentContainer:"_popoverContentContainer_81non_81",popoverContent:"_popoverContent_81non_81",selectionOptions:"_selectionOptions_81non_107",selectionOptionsIsHidden:"_selectionOptionsIsHidden_81non_112",selectionOptionsButton:"_selectionOptionsButton_81non_116",caret:"_caret_81non_132",popoverSuggestionsRoot:"_popoverSuggestionsRoot_81non_136",suggestionsOverlayInputStyles:"_suggestionsOverlayInputStyles_81non_141"};var id=S(O());var $g=S(X()),Rt=S(O());var nd=S(O()),zI=["bottom","height","left","right","top","width"],VI=(e={},t={})=>zI.some(n=>e[n]!==t[n]),Ln=new Map,b1,T1=()=>{let e=[],t=[];Ln.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();VI(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{Ln.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),b1=window.requestAnimationFrame(T1)};function KI(e,t){return{observe(){let n=Ln.size===0;if(Ln.has(e)){let r=Ln.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else Ln.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&T1()},unobserve(){let n=Ln.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Ln.delete(e),Ln.size||cancelAnimationFrame(b1)}}}}function Wg(e){let[t,n]=(0,nd.useState)(null);return(0,nd.useLayoutEffect)(()=>{if(!e.current)return;let r=KI(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var Ii=S(O()),P1=S(Ru());var k1={root:"_root_1jq08_1"};var R1=({children:e})=>{let[t,n]=(0,Ii.useState)(null),r=(0,Ii.useContext)(zi);return(0,Ii.useLayoutEffect)(()=>{let o=document.createElement("div");return no(o),o.classList.add(k1.root),r!=null&&r.portalRootNode&&o.classList.add(r==null?void 0:r.portalRootNode),document.body.appendChild(o),n(o),()=>{o.isConnected&&document.body.removeChild(o)}},[]),t?(0,P1.createPortal)(e,t):null};var on={ref:"_ref_1rcyi_1",root:"_root_1rcyi_7",positionAbove:"_positionAbove_1rcyi_13",positionBelow:"_positionBelow_1rcyi_17",positionLeft:"_positionLeft_1rcyi_21",positionRight:"_positionRight_1rcyi_25",alignStart:"_alignStart_1rcyi_29",alignCenter:"_alignCenter_1rcyi_34",alignEnd:"_alignEnd_1rcyi_40"};var rd=S(E()),Ai=(e=!1)=>{let[t,n]=(0,Rt.useState)(e),r=(0,Rt.useCallback)(()=>n(!0),[]),o=(0,Rt.useCallback)(()=>n(!1),[]),i=(0,Rt.useCallback)(()=>n(a=>!a),[]),s=(0,Rt.useRef)(null);return{opened:t,open:r,close:o,toggle:i,triggerRef:s}};function qg(e,t=null,n=0){if(!e)return{display:"none"};let r=t?e.top-t.top<0||e.top<t.top-n?t.top-n:e.top+e.height>t.top+t.height+n?t.top+t.height+n-e.height:e.top:e.top,o=t?e.left<t.left-n?t.left-n:e.left+e.width>t.left+t.width+n?t.left+t.width+n-e.width:e.left:e.left;return{top:r,left:o,height:e.height,width:e.width}}var Li=({className:e,triggerRef:t,boundaryRef:n=(0,Rt.createRef)(),position:r="above",align:o="center",children:i,toStyle:s=qg,...a})=>{let l=Wg(t),u=Wg(n),c=(0,Rt.useMemo)(()=>s(l,u,0),[l,u]);return(0,rd.jsx)(R1,{children:(0,rd.jsx)("div",{className:(0,$g.default)(on.ref,{[on.positionAbove]:r==="above",[on.positionBelow]:r==="below",[on.positionLeft]:r==="left",[on.positionRight]:r==="right",[on.alignStart]:o==="start",[on.alignCenter]:o==="center",[on.alignEnd]:o==="end"}),style:c,...a,role:"dialog",children:(0,rd.jsx)("div",{className:(0,$g.default)(e,on.root),children:i})})})};var Cr=S(E()),WI=({inputStyle:e,inputElement:t})=>{let n=k("TabCompletion",bt),r=Ai(document.activeElement===t);return fi(()=>r.close()),(0,id.useEffect)(()=>{let o=()=>r.open();return t.addEventListener("focus",o),()=>{t.removeEventListener("focus",o)}},[]),(0,Cr.jsxs)(id.Fragment,{children:[(0,Cr.jsx)("mark",{className:bt.caret,ref:r.triggerRef}),r.opened&&(0,Cr.jsx)(Li,{className:n.popoverSuggestionsRoot,triggerRef:r.triggerRef,position:"above",align:"start",children:(0,Cr.jsx)("div",{style:e,className:n.suggestionsOverlayInputStyles,children:(0,Cr.jsx)(td,{inline:!0})})})]})},od=class extends Ht{charCounter=0;charLength=0;found=!1;onlyAtEnd=!1;props;onBeforeParse(t,n){var r;return this.props=n,this.charCounter=0,this.onlyAtEnd=n.inlineSuggestionsOnlyAtEnd??!1,this.charLength=(An(n.inputElement)?n.inputElement.value.length:(r=n.inputElement.textContent)==null?void 0:r.length)??0,this.found=!1,t}match(t){if(this.found||!this.props||this.props.selection===null)return null;let[n,r]=this.props.selection;if(n!==r||this.onlyAtEnd&&n!==this.charLength)return null;let o=n,s=o>=this.charCounter&&o<=this.charCounter+t.length?{index:Bg(t.slice(0,o))+1-this.charCounter,length:0,match:"",valid:!0}:null;return s&&(this.found=!0),this.charCounter+=t.length,s??null}replaceWith(t,n){return(0,Cr.jsx)(WI,{inputStyle:n.inputStyle,inputElement:n.inputElement},"caret")}asTag(){return"mark"}};var O1=S(X());var cd=S(O());function I1(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function sd(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function A1(e){return e!=null}var L1=S(X()),ad=S(O());var Gg=S(E()),ld=(0,ad.forwardRef)(({className:e,children:t,...n},r)=>{let o=(0,ad.useRef)(null),i=k("TabCompletion",bt);return(0,Gg.jsx)("div",{ref:sd([o,r]),className:(0,L1.default)(e,i.popoverContentContainer),...n,children:(0,Gg.jsx)("div",{className:i.popoverContent,children:t})})});var br=S(E()),$I=e=>t=>{let n=qg(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},qI=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let i=k("TabCompletion",bt),s=Ai(),a=(0,cd.useMemo)(()=>$I(e.getBoundingClientRect()),[e]),[l,u]=Mc(e);return(0,cd.useEffect)(()=>{u?s.open():s.close()},[u]),(0,br.jsxs)("span",{children:[(0,br.jsx)("mark",{ref:sd([l,s.triggerRef]),className:(0,O1.default)(i.matchKeyword,{[i.hover]:u}),"aria-haspopup":"dialog","aria-expanded":s.opened?"true":"false",children:r}),s.opened&&(0,br.jsx)(Li,{className:i.popover,triggerRef:s.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,br.jsx)(ld,{style:n,children:(0,br.jsx)("div",{className:i.hintText,children:o})})})]})},ud=class extends Ht{keywordMatches=[];preparedKeywordMatches=[];usedKeywordMatches=new Set;onBeforeParse(t,n){return n.keywordMatches&&n.keywordMatches!==this.keywordMatches&&(this.preparedKeywordMatches=n.keywordMatches.map(r=>({...r,keywordRegex:new RegExp(`\\b${I1(r.keyword)}\\b`,"i")})),this.keywordMatches=n.keywordMatches),this.usedKeywordMatches.clear(),t}match(t){let n=this.preparedKeywordMatches.map(o=>{if(this.usedKeywordMatches.has(o))return null;let i=t.match(o.keywordRegex);if(!i)return null;let s=t.charAt(i.index-1),a=t.charAt(i.index+o.keyword.length);return s==="{"&&a==="}"?null:{index:i.index,length:i[0].length,match:i[0],matchString:i[0],suggestion:o.suggestion,preparedKeywordMatch:o,valid:!0}}).filter(A1);if(n.length===0)return null;let r=n.reduce((o,i)=>i.index<o.index?i:o);return this.usedKeywordMatches.add(r.preparedKeywordMatch),r}replaceWith(t,n){return(0,br.jsx)(qI,{inputElement:n.inputElement,suggestion:n.suggestion,inputStyle:n.inputStyle,boundaryRef:n.boundaryRef,children:t},`keyword_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var fd=S(X());var Ve=S(O());var Xg=S(E()),N1=()=>(0,Xg.jsx)("svg",{width:"1.3em",height:"1.3em",focusable:"false","aria-hidden":"true",viewBox:"0 0 24 24","data-testid":"InsertLinkIcon",tabIndex:-1,children:(0,Xg.jsx)("path",{fill:"currentColor",d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"})});var Tr=S(O());var D1=S(Ag());var M1={root:"_root_1muu8_1",content:"_content_1muu8_7"};function dd(e,t,n){var o;let r=((o=e.imageSizes)==null?void 0:o[t])||e.image||n;if(!r)return null;try{return new URL(r).toString()}catch{return null}}function Qg(e){return e.replace("https://www.","").replace("https://","")}var It=S(E()),GI=3,XI=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),QI=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=GI})=>{let i=k("LinkSearch",M1),[s,a]=(0,Tr.useState)(""),l=W(),u=L(Q_("url")),c=L(B_("URL",XI)),[f,d]=(0,Tr.useState)(c.length-1),y=F("fallbackImage"),v=p=>{let x=p.target;a(x.value)},h=(p,x)=>{p.stopPropagation(),p.preventDefault(),window.open(x,"_blank")},m=p=>{var C;let x=f-1<0?c.length-1:f-1,_=f+1===c.length?0:f+1;p.code==="Escape"&&(a(""),t()),p.code==="ArrowUp"&&d(x),p.code==="ArrowDown"&&d(_),p.code==="Enter"&&e(((C=c[f])==null?void 0:C.text)||s)},g=(0,Tr.useCallback)((0,D1.default)(p=>{l(oo({query:p,type:"URL",tags:["link-search"]}))},300),[]);return(0,Tr.useEffect)(()=>{s&&g(s)},[s]),(0,Tr.useEffect)(()=>()=>{l(Kc())},[]),(0,It.jsxs)("div",{className:i.root,children:[(0,It.jsx)(qt,{withDivider:!0,children:(s?c:u).slice(0,o).map((p,x)=>(0,It.jsx)(oe,{selected:f===x,onClick:()=>e(p.text),"data-testid":"linksearch-suggestion",children:(0,It.jsxs)(me,{children:[(0,It.jsx)(me.Image,{src:dd(p,"small",y||void 0),title:p.title||p.text}),(0,It.jsxs)(me.Content,{className:i.content,cropText:!0,children:[(0,It.jsx)(me.Title,{children:p.title||Qg(p.text)}),p.title&&Qg(p.text)]}),(0,It.jsx)(oe.Actions,{children:(0,It.jsx)(oe.ActionButton,{label:r,onClick:_=>h(_,p.text)})})]})},p.text))}),(0,It.jsx)(wa,{value:s,onChange:v,autoFocus:!0,placeholder:n,onKeyUp:m})]})},F1=QI;var Yg={};Ce(Yg,{enUS:()=>YI,nlNL:()=>ZI});var YI={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}]},ZI={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}]};var ze=S(E()),JI=(0,Ve.forwardRef)((e,t)=>{let n=k("TabCompletion",bt);return(0,ze.jsx)("mark",{ref:t,className:(0,fd.default)(n.matchSelection)},"selection-start")}),eA=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let i=j(Yg),s=k("TabCompletion",bt),a=(0,Ve.useRef)(null),l=(0,Ve.useRef)(null),[u,c]=(0,Ve.useState)(null),f=W(),d=Ai(document.activeElement===r),[y]=(0,Ve.useState)(()=>document.createRange());d.triggerRef.current=y,(0,Ve.useEffect)(()=>()=>y.detach(),[]),(0,Ve.useEffect)(()=>{let h=e.current,m=a.current;!h||!m||(y.setStart(h,0),y.setEnd(m,0))},[e.current,a.current]),fi(()=>{d.close()});let v=(0,Ve.useCallback)(h=>{let m=y.toString(),g=/^http(s?):\/\//.test(h)?h:`https://${h}`;f(_c({text:`[${m}](${g})`,replace:"selection"}))},[]);return(0,ze.jsxs)("span",{children:[(0,ze.jsx)("mark",{ref:a,className:(0,fd.default)(s.matchSelection),"aria-haspopup":"dialog","aria-expanded":d.opened?"true":"false",children:o}),d.opened&&(0,ze.jsx)(Li,{className:s.popoverRoot,triggerRef:d.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,ze.jsxs)(ld,{style:n,ref:l,children:[(0,ze.jsx)("div",{className:(0,fd.default)(s.selectionOptions,{[s.selectionOptionsIsHidden]:u!==null}),children:(0,ze.jsxs)("button",{type:"button",tabIndex:u===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>c("insertLink"),children:[(0,ze.jsx)(N1,{}),(0,ze.jsx)("span",{children:"\xA0"}),(0,ze.jsx)("span",{children:i("insertLink")})]})}),u==="insertLink"&&(0,ze.jsx)(F1,{placeholder:i("linkInputPlaceholder"),visitUrlText:i("visitUrl"),onSelectLink:v,onDismiss:()=>{c(null),d.close()}})]})})]},"selection-end")},pd=class extends Ht{charCount=0;foundIndex=0;startRef=null;props;onBeforeParse(t,n){return this.props=n,this.charCount=0,this.startRef=(0,Ve.createRef)(),this.foundIndex=0,t}match(t){if(!this.props||this.props.selection===null||this.foundIndex===2)return null;let[n,r]=this.props.selection;if(n===r)return null;let o=this.foundIndex===0?n:r,i=o>=this.charCount&&o<=this.charCount+t.length?{index:o-this.charCount,length:0,match:"",valid:!0}:null;i&&this.foundIndex++;let s=this.foundIndex===1;return i&&s?this.charCount+=o-this.charCount:this.charCount+=t.length,i?{isStart:s,...i}:null}replaceWith(t,n){return n.isStart?(0,ze.jsx)(JI,{ref:this.startRef}):(0,ze.jsx)(eA,{inputElement:n.inputElement,startRef:this.startRef,boundaryRef:n.boundaryRef,inputStyle:n.inputStyle})}asTag(){return"mark"}};var On=S(E()),tA=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:i,keywordMatches:s,inputElement:a,source:l})=>{let u=k("TabCompletion",C1),c=F("insertLink"),f=F("showMidSentenceSuggestions"),d=F("inlineSuggestions"),y=Fc(a),v=(0,Nn.useRef)(null);(0,Nn.useEffect)(()=>{An(a)&&y&&jc(a,y)},[y]);let h=(0,Nn.useCallback)(p=>{if(!o||!n)return p;let x=[(0,On.jsx)("span",{className:u.resetIndent,children:"\u200B"},"u200B"),(0,On.jsx)("span",{"data-testid":"tab-completion",className:(0,md.default)(u.tabText,u.resetIndent),"data-source":l,children:n},"tabText")];return r&&x.push((0,On.jsx)("span",{className:(0,md.default)(u.hint,u.resetIndent),children:(0,On.jsx)(pl,{keyCode:"tab"},"tabHint")})),Kg(p,x)},[o,n,r]),m=(0,Nn.useMemo)(()=>{let p=[];return d&&p.push(new od("inline")),c&&p.push(new pd("selection")),p.push(new ci("placeholders")),i&&p.push(new ud("keywords")),p},[d,c,i]),g=(0,Nn.useMemo)(()=>{let p=window.getComputedStyle(a);return{"--dd-color":p.color,"--dd-font-size":p.fontSize,"--dd-font-family":p.fontFamily,"--dd-font-variant":p.fontVariant}},[]);return e?(0,On.jsxs)("div",{ref:p=>{p!=null&&p.parentElement&&(v.current=p==null?void 0:p.parentElement)},className:u.root,style:g,children:[(0,On.jsx)(li,{tagName:"span",containerTagName:"div",className:(0,md.default)(u.container,u.agentText),disableLineBreaks:An(a),content:t||"\u200B",onAfterParse:h,matchers:m,selection:y,keywordMatches:s,inputElement:a,inputStyle:g,boundaryRef:v,inlineSuggestionsOnlyAtEnd:!f}),(0,On.jsx)("br",{})]}):null},nA=({input:e,ui:t,settings:n,styleSuggestions:r,conversation:o})=>{var h;let{tabCompletionSuggestion:i}=e,s=(i==null?void 0:i.text)||"",a=(i==null?void 0:i.source)||"",l=e.html??ki(e.text),u=s.indexOf(e.text)===0?s.slice(e.text.length):"",{showTabHint:c}=t,{isSupported:f}=o,{showTabCompletion:d,visible:y,showStyleSuggestions:v}=n;return{showTabHint:c,showStyleSuggestions:v,showTabCompletion:d,content:l,tabText:u,source:a,keywordMatches:((h=r.list)==null?void 0:h.keywordMatches)??[],enabled:y&&f!==!1}},j1=Yr(nA)(tA);var TE=S(X()),kE=S(O());var B1={list:[],fetchState:"idle",isInitialRequest:null},U1=e=>e.autoflows.list||[],H1=e=>t=>{var n;return(n=t.list)==null?void 0:n.find(r=>r.triggerPayload===e)},Mn=M("autoflows/getAll",async(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getAutoflows(e)}),Zg=M("autoflows/start",async(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");await r.startAutoflowSession(e),await n(Mn(e.platformSessionId))}),Jg=M("autoflows/stop",async(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");await r.stopAutoflowSession(e.platformSessionId),await n(Mn(e.platformSessionId))}),rA=B({name:"autoflows",initialState:B1,reducers:{},extraReducers:e=>{e.addCase(Zg.pending,(t,n)=>{let r=H1(n.meta.arg.triggerPayload)(t);r.state="Started",r.isBusy=!0}),e.addCase(Jg.pending,(t,n)=>{let r=H1(n.meta.arg.triggerPayload)(t);r.state="Aborted",r.isBusy=!0}),e.addCase(Mn.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}),e.addCase(Mn.rejected,t=>{t.fetchState="error"}),e.addCase(Mn.fulfilled,(t,n)=>{t.list=n.payload,t.fetchState="done"}),e.addCase(J,()=>B1)}}),z1=M("autoflows/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");let o=r.openStream(e);o.on("sessionAborted",()=>{n(Mn(e))}),o.on("sessionCompleted",()=>{n(Mn(e))})}),V1=M("autoflows/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),K1=rA.reducer;var W1={list:[],fetchState:"idle",isInitialRequest:null,sentSuggestions:[],errorSuggestions:[],answeredSuggestions:[]},$1=e=>e.customMessages.list,q1=e=>t=>!!t.customMessages.sentSuggestions.find(n=>n===e),G1=e=>t=>!!t.customMessages.answeredSuggestions.find(n=>n===e),X1=e=>t=>!!t.customMessages.errorSuggestions.find(n=>n===e),Aa=M("customMessages/getAll",async(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getCustomMessages(e)}),gd=M("customMessages/send",async(e,t)=>{let{platformSessionId:n,suggestion:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");await o.sendCustomMessage(n,r)}),hd=M("customMessages/answer",async(e,t)=>{let{platformSessionId:n,reply:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");await o.answerCustomMessage(n,r)}),Q1=B({name:"customMessages",initialState:W1,reducers:{onCustomMessage(e,t){Array.isArray(t.payload)?e.list=t.payload:e.list=[t.payload]}},extraReducers:e=>{e.addCase(Aa.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(Aa.rejected,t=>{t.fetchState="error"}).addCase(Aa.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload||[]}).addCase(gd.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.errorSuggestions=t.errorSuggestions.filter(r=>n.meta.arg.suggestion.text!==r)}).addCase(gd.rejected,(t,n)=>{let r=t.sentSuggestions.indexOf(n.meta.arg.suggestion.text);t.errorSuggestions.push(...t.sentSuggestions.splice(r,1))}).addCase(hd.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.answeredSuggestions.push(n.meta.arg.suggestion.text)}).addCase(hd.rejected,(t,n)=>{let r=t.answeredSuggestions.indexOf(n.meta.arg.suggestion.text);t.errorSuggestions.push(...t.sentSuggestions.splice(r,1)),t.answeredSuggestions.splice(r,1)}).addCase(J,()=>W1)}}),Y1=M("customMessages/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");r.openStream(e).on("customMessageSuggestion",i=>{n(Q1.actions.onCustomMessage(i))})}),Z1=M("customMessages/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),J1=Q1.reducer;var oA={jwt:null,accountUrl:null,interval:null},eE=e=>t=>{let{exchangeToken:{jwt:n,accountUrl:r}}=t;return n&&r?`${r}/apis/admin/session/jwt/?jwt=${n}&redirect=${e}`:null},eh=M("exchangeToken/getTemporaryExchangeToken",async(e,t)=>{let{deepdeskAPI:n}=t.extra,r=await n.getTemporaryExchangeToken();return{accountUrl:n.client.baseUrl,jwt:r}}),th=M("exchangeToken/pollExchangeToken",(e={},t)=>{let{interval:n=1e3*60*30}=e,{dispatch:r}=t;return r(eh()),setInterval(()=>r(eh()),n)}),tE=B({name:"exchangeToken",initialState:oA,reducers:{stopPollExchangeToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(eh.fulfilled,(t,n)=>{t.jwt=n.payload.jwt,t.accountUrl=n.payload.accountUrl}),e.addCase(th.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollExchangeToken:nE}=tE.actions,rE=tE.reducer;function oE(e){let{customMessages:t,autoflows:n}=e;return n.fetchState==="loading"&&n.isInitialRequest===!0||t.fetchState==="loading"&&t.isInitialRequest===!0}var pE=S(O());var cE=S(X()),dE=S(O());var sE=S(X());var iE={root:"_root_838fd_1"};var lE=S(E()),iA=({className:e,children:t})=>{let n=k("Unicode",iE);return(0,lE.jsx)("span",{className:(0,sE.default)(e,n.root),children:t})},aE=iA;var uE={isDisabled:"_isDisabled_1rmfm_1",buttonStart:"_buttonStart_1rmfm_5",root:"_root_1rmfm_8",buttonStop:"_buttonStop_1rmfm_8",stateBadge:"_stateBadge_1rmfm_19",isCompleted:"_isCompleted_1rmfm_26",isStarted:"_isStarted_1rmfm_30",isAborted:"_isAborted_1rmfm_34"};var nh={};Ce(nh,{enUS:()=>sA,nlNL:()=>aA});var sA={start:[{type:0,value:"Start"}],stop:[{type:0,value:"Stop"}],aborted:[{type:0,value:"Stopped"}],completed:[{type:0,value:"Completed"}],Aborted:[{type:0,value:"Stopped"}],Started:[{type:0,value:"Running"}],Completed:[{type:0,value:"Completed"}]},aA={start:[{type:0,value:"Start"}],stop:[{type:0,value:"Stop"}],aborted:[{type:0,value:"Stopped"}],completed:[{type:0,value:"Completed"}],Aborted:[{type:0,value:"Stopped"}],Started:[{type:0,value:"Running"}],Completed:[{type:0,value:"Completed"}]};var at=S(E()),uA=({disabled:e,state:t,displayName:n,description:r,onStartAutoflow:o,onStopAutoflow:i})=>{let s=k("Autoflow",uE),a=j(nh),l=t==="Started"?"stop":"start",u=l==="start"?"\u25B6":l==="stop"?"\u25FC":"";return(0,at.jsxs)(oe,{className:(0,cE.default)(s.root,{[s.isDisabled]:e,[s.isCompleted]:t==="Completed",[s.isAborted]:t==="Aborted",[s.isStarted]:t==="Started"}),children:[(0,at.jsx)(me,{children:(0,at.jsxs)(me.Content,{children:[(0,at.jsxs)(me.Title,{children:[t&&(0,at.jsx)("span",{className:s.stateBadge,children:a(t)}),n]}),(0,at.jsx)("span",{children:r})]})}),(0,at.jsx)(oe.Actions,{fixed:t==="Started",children:(0,at.jsx)(oe.ActionButton,{primary:!0,className:l==="start"?s.buttonStart:s.buttonStop,onClick:t==="Started"?i:o,disabled:e,label:(0,at.jsxs)(dE.Fragment,{children:[(0,at.jsx)(aE,{children:u})," ",(0,at.jsx)("span",{children:a(l)})]})})})]})},fE=uA;var rh=S(E()),cA=(e,t)=>{let n=t.filter(r=>r.state==="Started");return n.length>0?n.indexOf(e)===-1:!1},dA=({autoflows:e,onStartAutoflow:t,onStopAutoflow:n,platformSessionId:r})=>(0,rh.jsx)(pE.Fragment,{children:e.map(o=>(0,rh.jsx)(fE,{displayName:o.displayName,description:o.description,disabled:o.isBusy||cA(o,e),state:o.state,onStartAutoflow:()=>t({platformSessionId:r,triggerPayload:o.triggerPayload}),onStopAutoflow:()=>n({platformSessionId:r,triggerPayload:o.triggerPayload})},o.displayName))}),fA=({autoflows:e,conversation:t})=>{var n;return{autoflows:e.list,platformSessionId:(n=t.current)==null?void 0:n.sessionId}},pA={onStartAutoflow:Zg,onStopAutoflow:Jg},mE=Yr(fA,pA)(dA);var yd=S(O());var sh=S(X());var oh=S(E()),ih=()=>(0,oh.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,oh.jsx)("path",{d:"M502.6 70.63l-61.25-61.25C435.4 3.371 427.2 0 418.7 0H255.1c-35.35 0-64 28.66-64 64l.0195 256C192 355.4 220.7 384 256 384h192c35.2 0 64-28.8 64-64V93.25C512 84.77 508.6 76.63 502.6 70.63zM464 320c0 8.836-7.164 16-16 16H255.1c-8.838 0-16-7.164-16-16L239.1 64.13c0-8.836 7.164-16 16-16h128L384 96c0 17.67 14.33 32 32 32h47.1V320zM272 448c0 8.836-7.164 16-16 16H63.1c-8.838 0-16-7.164-16-16L47.98 192.1c0-8.836 7.164-16 16-16H160V128H63.99c-35.35 0-64 28.65-64 64l.0098 256C.002 483.3 28.66 512 64 512h192c35.2 0 64-28.8 64-64v-32h-47.1L272 448z"})});var gE={root:"_root_rjdyr_1",entity:"_entity_rjdyr_10",entityText:"_entityText_rjdyr_46",iconWrapper:"_iconWrapper_rjdyr_53",icon:"_icon_rjdyr_53",iconClicked:"_iconClicked_rjdyr_67"};var sn=S(E()),mA=({entities:e})=>{let t=k("EntitiesWidgetList",gE),[n,r]=(0,yd.useState)(void 0),o=W(),i=()=>{r(void 0)},s=a=>{e&&(r(e.indexOf(a)),Ca(a.text),o(it({name:"entity copied",data:{entity:a,type:"copy"}})))};return(0,yd.useEffect)(()=>{let a=setTimeout(i,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,sn.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,sn.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>s(a),children:[(0,sn.jsx)("span",{className:t.entityText,children:a.text}),(0,sn.jsxs)("span",{className:t.iconWrapper,children:[(0,sn.jsx)("span",{className:(0,sh.default)(t.icon),children:(0,sn.jsx)(ih,{})}),(0,sn.jsx)("span",{className:(0,sh.default)(t.icon,n===l&&t.iconClicked),children:(0,sn.jsx)(ih,{})})]})]},a.text))})},hE=mA;var yE=S(X()),ah=S(O());var La={};Ce(La,{enUS:()=>gA,nlNL:()=>hA});var gA={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Add"}],sendSuggestion:[{type:0,value:"Send"}],suggestionSent:[{type:0,value:"Sent"}],sendingError:[{type:0,value:"Sending failed"}],tryAgain:[{type:0,value:"Try again"}],editSuggestion:[{type:0,value:"Edit"}],visitUrl:[{type:0,value:"Visit"}],answer:[{type:0,value:"Answer"}]},hA={preview:[{type:0,value:"Preview"}],useSuggestion:[{type:0,value:"Gebruik"}],sendSuggestion:[{type:0,value:"Verzenden"}],suggestionSent:[{type:0,value:"Verzonden"}],sendingError:[{type:0,value:"Verzenden mislukt"}],tryAgain:[{type:0,value:"Probeer opnieuw"}],editSuggestion:[{type:0,value:"Bewerken"}],visitUrl:[{type:0,value:"Bekijk"}],answer:[{type:0,value:"Antwoord"}]};var Dn={root:"_root_1e6ej_1",title:"_title_1e6ej_8",isUsed:"_isUsed_1e6ej_13",quickReplies:"_quickReplies_1e6ej_22",quickReply:"_quickReply_1e6ej_29",hasError:"_hasError_1e6ej_39",label:"_label_1e6ej_43",errorIcon:"_errorIcon_1e6ej_48"};var Je=S(E()),yA=({suggestion:e})=>{let t=j(La),n=W(),r=L(q1(e.text)),o=L(G1(e.text)),i=L(X1(e.text)),s=L(fc),{replyOptions:a}=e,l=(0,ah.useCallback)(c=>{c.preventDefault(),c.stopPropagation(),!(r||!s)&&n(gd({platformSessionId:s,suggestion:e}))},[e,r,n,s]),u=(0,ah.useCallback)(c=>{if(c.preventDefault(),c.stopPropagation(),!s||!a)return;let f=parseInt(c.target.dataset.index,10),d=a[f];n(hd({platformSessionId:s,reply:d,suggestion:e}))},[e,r,n,s]);return(0,Je.jsxs)(oe,{onClick:l,className:(0,yE.default)(Dn.root,{[Dn.isUsed]:r,[Dn.hasError]:i}),children:[(0,Je.jsx)(me,{children:(0,Je.jsxs)(me.Content,{children:[(0,Je.jsxs)(me.Title,{className:Dn.title,children:[e.text," ",(0,Je.jsx)(ml,{className:Dn.label,children:"analyse tool"})," ",i&&(0,Je.jsx)("span",{className:Dn.errorIcon,role:"img","aria-label":t("sendingError"),title:t("sendingError"),children:"!"})]}),a&&a.length>0&&(0,Je.jsx)("ul",{className:Dn.quickReplies,children:a.map(c=>(0,Je.jsx)("li",{className:Dn.quickReply,children:c.title},c.title))})]})}),(0,Je.jsxs)(oe.Actions,{fixed:i||r,children:[a&&a.length>0&&(0,Je.jsx)(oe.DropdownButton,{label:t("answer"),disabled:o,children:a.map((c,f)=>(0,Je.jsx)(oe.DropdownItem,{index:f,label:c.title,onClick:u},c.title))}),(0,Je.jsx)(oe.ActionButton,{primary:!0,disabled:r,onClick:l,label:t(r?"suggestionSent":i?"tryAgain":"sendSuggestion")})]})]})},vE=yA;var lh=S(E()),SE=()=>(0,lh.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,lh.jsx)("path",{d:"M17 13.5v6H5v-12h6m3-3h6v6m0-6-9 9",stroke:"currentColor",strokeWidth:"1.5",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"})});var xE=S(O());var lt=S(E()),vA=({suggestion:e,lines:t,onEdit:n,onUse:r})=>{var d;let o=e.text||e.url||e.message,i=Wc(o),s=j(La),a=F("showImages"),l=F("fallbackImage"),u=y=>{y.preventDefault(),y.stopPropagation(),r(o)},c=y=>{y.preventDefault(),y.stopPropagation(),n(e)},f=(0,xE.useCallback)(y=>{window.open(i,"_blank"),y.stopPropagation(),y.preventDefault()},[i]);return(0,lt.jsxs)(oe,{onClick:u,"data-testid":"edit-suggestion",children:[(0,lt.jsxs)(me,{children:[a&&e.image&&(0,lt.jsx)(me.Image,{src:dd(e,"small",l||void 0),title:e.title}),(0,lt.jsxs)(me.Content,{children:[e.title&&(0,lt.jsx)(me.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((d=e.searchKeywords)==null?void 0:d.length)>0&&(0,lt.jsx)(oe.Labels,{labels:e.searchKeywords}),(0,lt.jsx)(me.Content,{cropText:t==="single",lineClamp:t==="multiple",children:o})]})]}),(0,lt.jsxs)(oe.Actions,{children:[i&&(0,lt.jsx)(oe.ActionButton,{onClick:f,label:s("visitUrl")}),(0,lt.jsx)(oe.ActionButton,{primary:!0,onClick:c,label:s("preview")}),(0,lt.jsx)(oe.ActionButton,{primary:!0,onClick:u,label:s("useSuggestion")})]})]})},_E=vA;var Oa=S(E()),SA=({contentType:e,lines:t,suggestions:n})=>{let r=Pt(),o=L(vi),i=a=>{r.send(Cg,{state:o,suggestion:a,contentType:e})},s=(a,l)=>{r.send(kn,{text:a,suggestion:{...l,source:l.source,sourceText:l.text}})};return(0,Oa.jsx)(Oa.Fragment,{children:n.map(a=>(0,Oa.jsx)(_E,{suggestion:a,lines:t,onEdit:l=>i(l),onUse:l=>s(l,a)},a.text||a.url||a.message))})},wE=SA;var uh={};Ce(uh,{enUS:()=>xA,nlNL:()=>_A});var xA={waiting:[{type:0,value:"Loading\u2026"}],notSupported:[{type:0,value:"This conversation is not supported"}],noResults:[{type:0,value:"No results found\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],actions:[{type:0,value:"Shortcuts"}],linkPersonalcollection:[{type:0,value:"Personal Collection"}],linkSummary:[{type:0,value:"Summarize"}],linkKnowledgeSearch:[{type:0,value:"Knowledge Assist"}],linkSearch:[{type:0,value:"Search"}]},_A={waiting:[{type:0,value:"Laden\u2026"}],notSupported:[{type:0,value:"Dit gesprek wordt niet ondersteund"}],noResults:[{type:0,value:"Geen resultaten gevonden\u2026"}],titleAutoflows:[{type:0,value:"Autoflows"}],titleCustomMessages:[{type:0,value:"Quick replies"}],actions:[{type:0,value:"Shortcuts"}],linkPersonalcollection:[{type:0,value:"Personal Collection"}],linkSummary:[{type:0,value:"Gesprek samenvatten"}],linkKnowledgeSearch:[{type:0,value:"Knowledge assist"}],linkSearch:[{type:0,value:"Zoeken"}]};var EE={root:"_root_x0pwe_1",loginText:"_loginText_x0pwe_7",stateText:"_stateText_x0pwe_8",sectionList:"_sectionList_x0pwe_20",shortcutList:"_shortcutList_x0pwe_24",shortcut:"_shortcut_x0pwe_24",link:"_link_x0pwe_52"};var ch=S(E()),CE=()=>(0,ch.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,ch.jsx)("path",{d:"M543-340q16.595 0 28.798-12.202Q584-364.405 584-381t-12.202-28.798Q559.595-422 543-422t-28.798 12.202Q502-397.595 502-381t12.202 28.798Q526.405-340 543-340Zm-25-126h47q2-29 8.5-43t32.5-39q27-26 37.5-45.395Q654-612.79 654-639q0-45.882-31.5-74.941Q591-743 540-743q-38 0-68 20.5T428-665l45 19q11-25 27.5-38t39.5-13q29.778 0 48.389 17Q607-663 607-637q0 20-9 35t-32 32q-32 29-40 46.5t-8 57.5ZM260-200q-24 0-42-18t-18-42v-560q0-24 18-42t42-18h560q24 0 42 18t18 42v560q0 24-18 42t-42 18H260Zm0-60h560v-560H260v560ZM140-80q-24 0-42-18t-18-42v-620h60v620h620v60H140Zm120-740v560-560Z"})});var dh=S(E()),bE=()=>(0,dh.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,dh.jsx)("path",{d:"M319-250h322v-60H319v60Zm0-170h322v-60H319v60ZM220-80q-24 0-42-18t-18-42v-680q0-24 18-42t42-18h361l219 219v521q0 24-18 42t-42 18H220Zm331-554v-186H220v680h520v-494H551ZM220-820v186-186 680-680Z"})});var z=S(E()),vd=(e,t)=>{let n=L(Tn);(0,kE.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},wA=()=>{let e=j(uh),t=W(),n=F("isEmbedded"),r=k("Widget",EE),o=F("showAutoflows"),i=F("showCustomMessages"),s=F("showPersonalCollectionLink"),a=F("showSummaryCommand"),l=F("showKnowledgeSearch"),u=F("showSearch"),c=L(bi),f=L(Yc),d=L(U1),y=L(Qc),v=L($1),h=L(pc),m=L(mc),g=L(Tn),p=L(fc),x=L(oE),_=L(vi),C=Pt(),w=L(Z_),b=L(eE("/admin/personal-collection")),R=F("adminUrl");if(vd(()=>(t(Aa(p)),t(Y1(p)),()=>{t(Z1(p))}),[t,m,i,p]),vd(()=>(t(Mn(p)),t(z1(p)),()=>{t(V1(p))}),[t,m,o,p]),vd(()=>{f.forEach(({type:N})=>{t(N==="entities"?Vt():Cn(N))})},[t,m,h,c]),vd(()=>(t(th()),()=>{t(nE())}),[t,m,s,h]),m===!1)return(0,z.jsx)("div",{className:r.stateText,children:(0,z.jsx)("div",{children:(0,z.jsx)("p",{children:e("notSupported")})})},"supported");if(g===!1)return(0,z.jsx)("div",{className:r.loginText,children:(0,z.jsx)("div",{children:(0,z.jsx)(Jc,{isEmbedded:n,loginUrl:R})})},"login");if(!c||!p||g===null||w||x)return(0,z.jsx)("div",{className:r.stateText,children:(0,z.jsx)("div",{children:(0,z.jsx)("p",{children:e("waiting")})})},"waiting");let P=u||a||l||b;return(0,z.jsx)("div",{className:(0,TE.default)(r.root),"data-testid":"widget",children:(0,z.jsxs)(gl,{className:r.sectionList,children:[P&&(0,z.jsx)(Hn,{title:e("actions"),type:"shortcuts",children:(0,z.jsxs)("div",{className:r.shortcutList,children:[u&&(0,z.jsxs)("button",{className:r.shortcut,"data-testid":"shortcut-search",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0}),children:[(0,z.jsx)(hi,{}),e("linkSearch")]}),a&&(0,z.jsxs)("button",{className:r.shortcut,"data-testid":"shortcut-summary",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,z.jsx)(bE,{}),e("linkSummary")]}),l&&(0,z.jsxs)("button",{className:r.shortcut,"data-testid":"shortcut-knowledge-assist",onClick:()=>C.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,z.jsx)(CE,{}),e("linkKnowledgeSearch")]}),b&&(0,z.jsxs)("a",{className:r.shortcut,target:"_blank",href:b,"data-testid":"shortcut-personal-collection",rel:"noreferrer",children:[(0,z.jsx)(SE,{}),e("linkPersonalcollection")]})]})}),i&&v.length>0&&(0,z.jsx)(Hn,{type:"custom-messages","data-testid":"custom-messages",children:(0,z.jsx)(qt,{withDivider:!0,children:v.map(N=>(0,z.jsx)(vE,{suggestion:N},N.text))})}),o&&d.length>0&&(0,z.jsx)(Hn,{type:"autoflows",title:e("titleAutoflows"),"data-testid":"autoflows",children:(0,z.jsx)(qt,{withDivider:!0,children:(0,z.jsx)(mE,{})})}),f.map(({type:N,title:V,amount:H,lines:je})=>{var an;switch(N){case"entities":return y&&y.length>0&&(0,z.jsx)(Hn,{type:N,title:V,"data-testid":`type-${N}`,children:(0,z.jsx)(hE,{entities:y})},N);default:return((an=_[N])==null?void 0:an.fetchState)==="done"&&_[N].suggestions.length>0&&(0,z.jsx)(Hn,{type:N,title:V,"data-testid":`type-${N}`,children:(0,z.jsx)(qt,{withDivider:!0,children:(0,z.jsx)(wE,{lines:je,contentType:N,suggestions:_[N].suggestions.slice(0,H)||[]})})},N)}})]})})},PE=wA;function Oi(e){let t=new Range;return t.selectNodeContents(e),t}function RE(e,t,n){try{return kr(e,t,n),!0}catch{return!1}}var Na=/[\u200B-\u200D\uFEFF]/g;function kr(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,i=!1;function s(l,u){let c=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return u;for(let d=0;d<=l.length;d++)if(f.test(l[d])||c++,c===u)return d;throw new Error("Offset out of range")}function a(l){var u;switch(l.nodeType){case Node.TEXT_NODE:{let c=l.textContent,f=c.replace(Na,""),d=o+f.length,y=t>=o&&t<=d,v=n>=o&&n<=d;if(y){let h=s(c,t-o);h===0&&!v?r.setStartBefore(l):r.setStart(l,h)}v&&(r.setEnd(l,s(c,n-o)),i=!0),o=d;break}case Node.ELEMENT_NODE:{if(l.tagName==="BR"&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let f=0;f<l.childNodes.length&&(a(l.childNodes[f]),!i);f++);let c=(u=l.lastChild)==null?void 0:u.tagName;l.tagName==="DIV"&&c!=="DIV"&&c!=="BR"&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function Ma(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i,collapsed:s}=t,a,l,u=0;function c(f){let d=f===n,y=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let v=f.textContent;d&&(a=u+v.substring(0,r).replace(Na,"").length),y&&(l=u+v.substring(0,i).replace(Na,"").length),u+=v.replace(Na,"").length;break}case Node.ELEMENT_NODE:{let{tagName:v}=f,h=f.nextSibling===null;v==="BR"&&!h&&u++;for(let m=0;m<f.childNodes.length;m++){let g=d&&m===r;if(g&&(a=u),(!g||!s)&&c(f.childNodes[m]),y&&m===i-1&&(l=u),l!==void 0)break}!y&&v==="DIV"&&!h&&u++,y&&(l=u);break}default:break}}if(c(e),l===void 0)throw new Error("Could not determine start and end");return{start:a??l,end:l}}function Da(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i}=t,s=-1,a="";function l(u){let c=u===n,f=u===o;switch(c&&s++,u.nodeType){case Node.TEXT_NODE:{if(s!==0)return;let d=c?r:0,y=f?i:void 0,v=u.textContent.replace(Na,"");d===0&&y===void 0?a+=v:a+=v.substring(d,y);break}case Node.ELEMENT_NODE:{let{tagName:d}=u,y=u.nextSibling===null;s===0&&d==="BR"&&!y&&(a+=`
20
20
  `);for(let v=c?r:0;v<(f?Math.min(i,u.childNodes.length):u.childNodes.length)&&(l(u.childNodes[v]),s!==1);v++);!f&&s===0&&d==="DIV"&&!y&&(a+=`
21
- `);break}default:break}f&&s++}return l(e),a}var ao=class extends _n{observer;lastKnownSelection=null;getRootNode(){return this.element.getRootNode()}getText(){let t=new Range;return t.selectNodeContents(this.element),Da(this.element,t)}getHTML(){return this.element.innerHTML||""}getRange(){var o;let t=this.getRootNode();if(t.activeElement!==this.element)return null;let n="getSelection"in t?t.getSelection():window.getSelection();if(!n)return null;let r="getComposedRanges"in n&&t instanceof ShadowRoot?(o=n.getComposedRanges(t))==null?void 0:o[0]:n.rangeCount>0?n.getRangeAt(0):null;return!r||!this.element.contains(r.startContainer)||!this.element.contains(r.endContainer)?null:r}getSelection(){let t=this.getRange();if(t)return Ma(this.element,t);let n=this.lastKnownSelection;if(n&&RE(this.element,n.start,n.end))return n;let r=Oi(this.element);return r.collapse(!1),Ma(this.element,r)}getSelectedText(){let{start:t,end:n}=this.getSelection();return Da(this.element,kr(this.element,t,n))}applyChanges(t){var o;if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);(o=this.observer)==null||o.takeRecords(),Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(){super.listen(),this.observer=new MutationObserver(()=>{setTimeout(()=>{this.triggerChange()},0)}),this.observer.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0});let t=this.element.isContentEditable,n=new MutationObserver(()=>{this.element.isContentEditable!==t&&(t=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});n.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>n.disconnect())}dispose(){super.dispose(),this.observer&&this.observer.disconnect()}};var fh=class{constructor(t){this.name=t;this.broadcastChannel=new BroadcastChannel(t)}broadcastChannel;disposeHandlers=[];onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(t)}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},ph=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.iframe=this.createIframe(),document.body.appendChild(this.iframe)}iframe;disposeHandlers=[];createIframe(){let t=`deepdesk-iframe-${this.name}`,n=document.getElementById(t);if(n)return n;let r=document.createElement("iframe"),o=`${this.targetOrigin}/v2/widget/liveengage/channel.html`,i=new URLSearchParams({channel:this.name,host:window.location.origin});return this.options.debug&&i.set("debug","1"),r.style.position="absolute",r.style.left="-999em",r.style.width="0px",r.style.height="0px",r.tabIndex=-1,r.id=t,r.title=`iframe-${this.name}`,r.src=`${o}?${i.toString()}`,r}onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(t,this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},mh=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.defaultChannel=this.createChannel("deepdesk-general")}sessionId;deepdeskUrl;channel;defaultChannel;eventMap;get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),U.info("Set sessionId",t),this.sessionId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new ph(t,this.deepdeskUrl,{debug:!0}):new fh(t),r=o=>{var i,s;o.origin===this.deepdeskUrl&&o.data.type==="event"&&o.data.channel===t&&(U.info("Received broadcast event",this.sessionId,o),(s=(i=this.eventMap)[o.data.name])==null||s.call(i,o.data.payload))};return n.onMessage(r),n}send(t,n){var o,i,s;if(!this.sessionId)return;U.info("broadcast event",{sessionId:this.sessionId,name:t,payload:n});let r={type:"event",name:t,payload:n};(i=(o=this.eventMap)[t])==null||i.call(o,n),(s=this.channel)==null||s.postMessage({...r,channel:this.sessionId})}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),delete this.channel,t&&((r=this.defaultChannel)==null||r.close(),delete this.defaultChannel)}},IE=mh;var Ni=class extends Error{constructor(n,r){super(n);this.body=r}name="CustomError"};var gh=e=>new Promise(t=>{setTimeout(t,e)});var Mi=class extends Ni{name="ClientError"},hh=class extends Ni{name="ServerError"},Wt=class e{constructor(t="",n={}){this.baseUrl=t;this.options=n;n.fetch&&(this.fetch=n.fetch)}latestRequestByUrl={};csrfToken;fetch=window.fetch.bind(window);static refreshingToken=null;patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,{abortLatest:l=!1,attempts:u=1,retryDelay:c=500,refreshTokenOn401:f=!0,retryOnError:d=_=>_ instanceof TypeError,retryOnResponse:y=_=>_.status>=500,version:v="v1",...h}=n,m={credentials:"include",...h,headers:{"Content-Type":"application/json",...h.headers}};n.method!==void 0&&n.method!=="GET"&&this.csrfToken&&(m.headers={...m.headers,"X-CSRFToken":this.csrfToken}),typeof v=="string"&&(m.headers={...m.headers,"X-Deepdesk-API-Version":v});let g=u,p=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&l&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let x=async()=>(g--,a(s,m).then(async _=>y(_)&&!i.isAborted&&g>0?(await gh(c),x()):_.status===401&&f===!0&&p===!1?(p=!0,await this.refreshToken(),x()):_).catch(async _=>{if(d(_)&&!i.isAborted&&g>0)return await gh(c),x();throw _}));x().then(_=>_.json().catch(()=>null).then(C=>{_.status>=500?o(new hh("Server Error",C)):_.status===401?o(new Mi("Unauthorized",C)):_.status===403?o(new Mi("Forbidden",C)):_.status===404?o(new Mi("Not Found",C)):_.status>=400&&o(new Mi("Bad Request",C)),delete this.latestRequestByUrl[s],r(C)})).catch(_=>{o(_)})})}async validateToken(){let{has_valid_access_token:t}=await this.get("/auth/validate");if(!t)return!1;let{is_logged_in:n}=await this.get("/apis/admin/session/validate/",{version:null});return!!n}refreshToken(){return e.refreshingToken||(e.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{e.refreshingToken=null},1e3*60)})),e.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,{method:"POST",body:JSON.stringify(n),...r})}patch(t,n,r){return this.request(t,{method:"PATCH",body:JSON.stringify(n),...r})}put(t,n,r){return this.request(t,{method:"PUT",body:JSON.stringify(n),...r})}delete(t,n){return this.request(t,{method:"DELETE",...n})}};var EA;(t=>{let e;(l=>(l.SEND_MESSAGE="Send Message",l.HANDLING_TIME="Handling Time",l.START_AUTOFLOW="Start Autoflow",l.ABORT_AUTOFLOW="Abort Autoflow",l.ADD_TO_PERSONAL_COLLECTION="Add to personal collection",l.DELETE_FROM_PERSONAL_COLLECTION="Delete from personal collection"))(e=t.EventType||={})})(EA||={});function Sd(e){return{...re(e),tags:e.tags}}var Fn=class e{constructor(t,n={}){this.options=n;this.client=new Wt(t,{fetch:n.fetch}),this.client.patchFetch(r=>async(o,i)=>{let s=await r(o,i);return this.handleDeepdeskVersionHeaders(s),s})}latestReceivedDeepdeskVersions={};client;shouldFetchCsrfToken=!0;static exchangeTokenPromise=null;async preflight(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=await this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(e.exchangeTokenPromise||(e.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),e.exchangeTokenPromise):Promise.resolve()}async createConversation(t){await this.preflight(),U.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=await this.client.post("/api/conversations",{...we(t),tags:t.tags},{version:"v2"});return Sd(n)}async getProfile(t){let n=await this.client.get(`/apis/admin/profiles/${t}/`,{version:null});return re(n)}async getContentTypes(){let t=await this.client.get("/apis/admin/content-types/",{version:null});return re(t)}async getPlatformConfig(){let{config:t}=await this.client.get("/platform/config/",{version:null});return re(t)}async checkUserExists(t){let{exists:n}=await this.client.get(`/apis/admin/users/exists?external_id=${t}`);return n}async getConversationBySessionId(t,n={}){await this.preflight(),U.info(`Getting conversation for session ${t}`);let{attempts:r=1,retryDelay:o=1e3}=n,i=await this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"});return Sd(i)}async isConversationSupported(t,n={}){U.info(`Check if conversation for session ${t} is supported`);let{attempts:r=1,retryDelay:o=1e3}=n;return(await this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"})).has_active_profile}async updateConversation(t,n){let r=we(n);n.tags&&(r.tags=n.tags);let o=await this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return Sd(o)}async postMessages(t,n){return(await this.client.post(`/api/conversations/${t}/messages`,n.map(o=>({...we(o),tags:o.tags})),{version:"v2"})).map(o=>Sd(o))}async sendEvent(t,n){let{data:r,...o}=n,i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((s,[a,l])=>({...s,[a]:l}),{});return this.client.post("/api/events",we({...i,...o,data:r,name:t}),{version:"v2"})}async sendEventV1(t,n){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>({...o,[i]:s}),{});return this.client.post("/api/events",{event:t,data:we({...n,...r})})}async getEntities(t){return(await this.client.post("/api/entities",{messages:t.filter(r=>r.text)})).entities}async getSummary(t,n={}){return(await this.client.post("/api/summary",{conversation:{messages:t.filter(o=>o.text&&o.source)},prompt_instruction:n.promptInstruction,model:n.model})).summary}async getTemporaryExchangeToken(){return(await this.client.get("/auth/exchange-token",{version:null})).jwt}async exchangeTokenForAccessCookie(t){return this.client.post("/apis/admin/session/jwt/",{jwt:t},{version:null}).catch(n=>{throw U.warn(`Invalid token '${t}'`),n})}async authenticateWithKey(t,n){await this.client.post("/apis/admin/session/api-key/",we(n),{version:null,refreshTokenOn401:!1,headers:{apikey:t}})}async getTextSuggestions(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(await this.client.post(`/api/conversations/${t}/recommend/${r}`,we(n),{abortLatest:!0})).map(i=>({...re(i),text:i.text||i.url||i.message,source:r,type:r})).filter((i,s,a)=>s===a.findIndex(l=>l.text===i.text))}async isLoggedIn(){return await this.preflight(),this.client.validateToken()}async getAutocompleteSuggestions(t,n){return(await this.client.post(`/api/conversations/${t}/autocomplete`,we(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,i,s)=>i===s.findIndex(a=>a.text===o.text))}async getPinnedMessages(t){let n=await this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0});return re(n).map(r=>({...r,text:r.message,source:"sticky-messages",type:"pinned-message"}))}async getStyleSuggestions(t){let n=await this.client.post("/api/style-suggestions",we(t),{abortLatest:!0});return re(n)}async search(t){let n=await this.client.post(`/api/profiles/${t.profile}/search`,we(t),{version:"v2"});return re(n)}async knowledgeAssist(t,n,r){let o=await this.client.post("/api/knowledge-search/search",we({question:t.question,promptInstruction:t.promptInstruction,profile:r,chatHistory:n.map(i=>({question:i.question,answer:i.answer.answer}))}),{version:"v2"});return re(o)}async requestLoginByEmail(t){let n=await this.client.post("/apis/admin/session/passwordless/request/",{email:t},{version:null});return re(n)}async getCsrfToken(){let{token:t}=await this.client.get("/apis/admin/session/csrf/",{version:null});return t}async verifyLoginToken(t){let n=await this.client.post("/apis/admin/session/passwordless/login/",{token:t},{version:null});return re(n)}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(xy);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&U.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};var Fa=class{constructor(t,n){this.url=t;this.options={timeout:25e3,...n}}eventListeners={};options;timeoutTimer;eventSource;proxyEvent(t){this.eventSource.addEventListener(yg(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,re(o))}catch{U.warn(`Invalid JSON for ${t}: ${r}`)}})}connect(){clearTimeout(this.timeoutTimer);let t=new EventSource(this.url,{withCredentials:!0});this.eventSource=t;let n=!1;t.onopen=()=>{n=!0},t.onerror=()=>{n&&t.readyState===2&&this.connect()},this.timeoutTimer=setTimeout(()=>{t.close(),this.connect()},this.options.timeout),Object.keys(this.eventListeners).forEach(r=>{this.proxyEvent(r)})}disconnect(){var t;clearTimeout(this.timeoutTimer),this.eventListeners={},(t=this.eventSource)==null||t.close()}emit(t,n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>r(n))}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),this.proxyEvent(t),()=>{this.off(t,n)}}off(t,n){let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}};var CA;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||={})})(CA||={});var ja=class{constructor(t,n={}){this.apiUrl=t;this.client=new Wt(t,n)}client;streams={};logger=U;async getCustomMessages(t){let n=await this.client.get(`/sessions/${t}/suggestions`);return re(n.suggestions)}async sendCustomMessage(t,n){let r=await this.client.post(`/sessions/${t}/messages`,we(n));return re(r)}async answerCustomMessage(t,n){await this.client.post(`/sessions/${t}/answers`,we(n))}async getAutoflows(t){let n=await this.client.get(`/sessions/${t}/autoflows`);return re(n.autoflows)}async startAutoflowSession(t){let n=await this.client.post("/autoflow-sessions",we(t));return re(n)}async stopAutoflowSession(t){await this.client.delete(`/autoflow-sessions/${t}`)}openStream(t){return this.streams[t]||(this.streams[t]=new Fa(`${this.apiUrl}/sessions/${t}/events`),this.streams[t].connect()),this.streams[t]}closeStream(t){this.streams[t]||(this.streams[t].disconnect(),delete this.streams[t])}};var AE={startTime:null,stopTime:null},LE=B({name:"handlingTime",initialState:AE,reducers:{handlingTimeStart(e){if(e.startTime&&!e.stopTime)throw new Error("Timing already started");e.startTime=new Date,e.stopTime=null},handlingTimeStop(e){if(!e.startTime)throw new Error("Timing not started");e.stopTime=new Date},handlingTimeReset(e){e.startTime=null,e.stopTime=null}},extraReducers:e=>{e.addCase(J,()=>AE)}}),{handlingTimeStart:OE,handlingTimeStop:xd,handlingTimeReset:NE}=LE.actions,ME=LE.reducer;var DE=(e={})=>{let t={onAuthError:_i(!1),...e};return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var _d={list:{keywordMatches:[]},fetchState:"idle",isInitialRequest:null};var lo=M("styleSuggestions/getAll",async({text:e},t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),{showStyleSuggestions:o}=r.settings,i=(s=r.conversation.current)==null?void 0:s.profileCode;if(!o)return _d.list;if(!i)throw new Error("No current conversation to fetch pinned messages");return n.getStyleSuggestions({profileCode:i,message:e})}),bA=B({name:"styleSuggestions",initialState:_d,reducers:{},extraReducers:e=>{e.addCase(lo.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(lo.rejected,t=>{t.fetchState="error"}).addCase(lo.fulfilled,(t,n)=>{t.fetchState="done",oi(t.list,n.payload)||(t.list=n.payload)}).addCase(Zr,t=>{t.list=_d.list}).addCase(J,()=>_d)}}),FE=bA.reducer;var jE=(e={})=>{let t,n=!0,r={getStyleSuggestions:lo,debounce:500,...e};return o=>i=>s=>{var y;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((y=u.conversation.current)==null?void 0:y.id)||!c)return l;let{text:d}=u.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function TA(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var BE=(e={})=>{let t={getTextSuggestions:Cn,getAutocompleteSuggestions:ya,debounce:200,check:Zc,...e},n;return r=>o=>i=>{var h;let{input:{userCommitted:s}}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(h=l.conversation.current)==null?void 0:h.id,d=i.type===Gc.toString();if(!f||!u&&!c)return a;let{input:{userCommitted:y}}=l;return TA(y,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let m=ii(l);m===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(m))},d?0:t.debounce)),a}};var HE=lo.fulfilled.toString();function kA(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var UE=e=>t=>n=>r=>{var u;if(r.type!==HE){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=kA(o,s);r.type===HE&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var PA=Du({activeSuggestion:lw,answer:Jw,auth:ww,autoflows:K1,conversation:zx,contentTypes:Fw,customMessages:J1,exchangeToken:rE,entities:Uw,handlingTime:ME,info:M_,input:Gm.reducer,overlayInput:Ge.reducer,settings:Ox,profile:n1,search:U_,summary:qw,styleSuggestions:FE,ui:pw,textSuggestions:rw});function zE(e){return B0({reducer:PA,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),DE(),BE({debounce:200}),jE({debounce:500}),UE(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var RA=e=>{var t;return((t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())??"unknown"},IA=e=>t=>n=>r=>{var a;let o=t.getState(),i=zm("inlineSuggestions")(o);switch(r.type){case bn.toString():{let l=Y_(r.payload.contentType)(t.getState()),u=l.indexOf(r.payload.suggestion);e.emit("edit-suggestion",{contentType:r.payload.contentType,index:u,suggestions:l});break}case _i.toString():{!r.payload&&e.emit("logout",void 0);break}case jt.toString():{let{start:l,end:u}=o.input.selection;e.emit("select-suggestion",{type:RA(r.payload.suggestion),...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case _c.toString():{let{start:l,end:u}=o.input.selection;e.emit("replace",{...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case ra.toString():{let l=t.getState(),{text:u,selection:c}=l.input.userCommitted;e.emit("reset",{text:u,selectionAfter:c},{mayApplyChanges:!0});break}case bc.toString():e.emit("select-image",r.payload,{mayApplyChanges:!0}),e.sendEvent("Image attached",{conversationId:o.conversation.current.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case Vt.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:o.conversation.current.id,data:{entities:r.payload}});break;case Pn.fulfilled.toString():e.sendEvent("conversation summarized",{conversationId:o.conversation.current.id,data:{summary:r.payload.summary}});break;case it.toString():e.sendEvent(r.payload.name,{conversationId:((a=r.payload.options)==null?void 0:a.includeConversationData)&&o.conversation.current.id,data:r.payload.data});break;case wc.toString():e.handleKeyDown(r.payload);break;case Zr.toString():e.logSendMessage(r.payload);break;case Ec.toString():e.logSendEditSuggestionMessage(r.payload);break;case Cc.toString():e.handleInputChanged(r.payload);break;default:break}let s=n(r);switch(r.type){case Zr.toString():e.handleAfterSendMessage(r.payload);break;case va.toString():e.onUpdateShowTabHint(r.payload);break;case xd.toString():e.logHandlingTime();break;case jt.toString():{i&&(t.dispatch(mr([])),t.dispatch(gr()));break}default:break}return s},VE=IA;function yh(e){return e.toISOString().replace("T"," ").replace("Z","")}function KE(e,t){var o,i,s;let{startTime:n,stopTime:r}=e.handlingTime;if(!n||!r)throw new Error("No startTime and stopTime for handling time metrics");return{conversationId:e.conversation.current.id,clientVersion:t.version,agentId:(o=e.info.agentInfo)==null?void 0:o.agentId,agentName:(i=e.info.agentInfo)==null?void 0:i.agentName,agentEmail:(s=e.info.agentInfo)==null?void 0:s.agentEmail,timeStart:yh(n),timeStop:yh(r)}}function vh(e,t,n){var b,R,P;let{text:r,metrics:{numCharsTyped:o,numCharsPasted:i,numCharsCut:s,numCharsDeleted:a,numPaste:l,agentStartedTypingTimestamp:u,externalTimeTotalSeconds:c,pastes:f,cuts:d,deletions:y,textSuggestions:v,offeredTextSuggestions:h}}=t[e],m=r.length,p=v.reduce((N,{text:V,searchTerm:H})=>N+V.length-(H?H.length:0),0),x=u??Date.now(),_=(Date.now()-x)/1e3+(c||0),C=o/_,w=v.reduce((N,{searchTerm:V})=>N+(V?V.length:0),0);return{conversationId:t.conversation.current.id,source:"agent",text:r,clientVersion:n.version,pastes:f,cuts:d,deletions:y,lenTextTyped:o+w,lenTextTotal:m,lenTextAssisted:p,lenTextPasted:i,lenTextCut:s,lenTextDeleted:a,timeTotalSeconds:_,charsPerSecond:C,numPastes:l,textSuggestionsV2:v,suggestionsCounters:[{source:"gpt",countOffered:h.filter(N=>N.source==="gpt").length}],agentId:(b=t.info.agentInfo)==null?void 0:b.agentId,agentName:(R=t.info.agentInfo)==null?void 0:R.agentName,agentEmail:(P=t.info.agentInfo)==null?void 0:P.agentEmail}}function WE(e,t){let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;return r instanceof HTMLElement?WE(r,t):null}function $E(e,t){return WE(e,t)}function qE(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function wd(e){return e instanceof HTMLElement&&(An(e)||Dc(e))}var GE=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch{return t}}catch{return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch{U.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function AA(e){return e.offsetParent!==null}function XE(e){if(!AA(e))return!1;let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function Ed(e,t,n=100){let r=XE(e);t({isVisible:r});let o=setInterval(()=>{let i=XE(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var ut=S(E()),QE=GE("showTabHint",!0),Ba=class e{static version="10.2.0";static count=0;deepdeskApi;inputMediator=null;version;broadcastEvents;eventListeners={};unmountHandlers=[];widgetRoot=null;dynamicThunkObject={};isMounted=!1;instanceId;shouldRender=!0;store;constructor({deepdeskUrl:t,brokerUrl:n,version:r=e.version||"unknown",locale:o="en-US",token:i,fetch:s,productName:a,createCustomChannel:l}){let u=t.replace(/\/api$/,"");this.deepdeskApi=new Fn(u,{token:i,fetch:s}),this.version=r,this.instanceId=e.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[VE({emit:(f,d,y)=>this.emit(f,d,y),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),handleInputChanged:f=>this.handleInputChanged(f),handleKeyDown:f=>this.handleKeyDown(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),logSendEditSuggestionMessage:f=>this.logSendEditMessage(f),onUpdateShowTabHint:f=>QE.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new ja(n)}),this.store=zE(c),this.broadcastEvents=new IE({debug:!0,deepdeskUrl:u,eventMap:Ew(this.store),createCustomChannel:l}),this.store.dispatch(ta),this.store.dispatch(va(QE.value())),this.store.dispatch(ta({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){return this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex]??null}hasConversation(){return!!this.state.conversation.current}conversationId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.id}sessionId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.sessionId}shouldAbort(){return this.state.conversation.isSupported===!1?(U.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(U.warn("Profile has not been loaded (yet)"),!0):(U.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(_i(null)),this.store.dispatch(_r()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();Tn(r)&&hw(r)!=="loading"&&t()});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return this.deepdeskApi.isLoggedIn()}async setPlatformAgentId(t){try{if((await this.deepdeskApi.client.get("/apis/admin/session/me/",{version:null})).external_id)return;await this.deepdeskApi.client.request("/apis/admin/session/me/",{method:"PATCH",body:JSON.stringify({external_id:t}),version:null})}catch(n){U.warn("Failed to attach user:",n)}}async isConversationSupported(t,n){return(await this.store.dispatch($m({sessionId:t,options:n}))).payload}async createConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(gc(t))).payload}async getConversationBySessionId(t,n){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(await this.store.dispatch(hc({sessionId:t,options:n}))).payload}async upsertConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(qm(t))).payload}async postMessages(t){return(await this.store.dispatch(vc(t))).payload}async updateConversation(t){return(await this.store.dispatch(yc(t))).payload}resetConversation(){this.store.dispatch(J()),this.dynamicThunkObject.conversationQuery=null}async getSummary(){let t=await this.store.dispatch(Pn());if(t.error)throw new Error(t.error.message);return t.payload.summary}configure(t){this.store.dispatch(ta(t))}setVisitorInfo(t){this.store.dispatch(N_(t))}async setAgentInfo(t){await this.store.dispatch(pa(t))}async setAgentSettings(t){await this.store.dispatch(vg(t))}async getAgentSettings(){return(await this.store.dispatch(Sg())).payload}async refresh(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.handleInputChanged(this.inputMediator.getText());let t=[];return this.store.dispatch(Gc()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})}notifyInputChanged(t){this.store.dispatch(Cc(t))}notifyKeyDown(t){this.store.dispatch(wc(t))}notifyPaste(t,n){this.store.dispatch(Jx({text:t,selectionText:n}))}notifyCut(t){this.store.dispatch(Yx(t))}notifyExternalSuggestion(t){this.store.dispatch(jt(t)),this.store.dispatch(gr())}notifyEditSuggestion(t){this.store.dispatch(tw(t.contentType,t.suggestions)),this.store.dispatch(bn({contentType:t.contentType,suggestion:typeof t.index=="number"?t.suggestions[t.index]:null}))}handleInputChanged(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui;n&&r&&this.store.dispatch(xi({collapse:!1})),this.inputMediator&&this.store.dispatch(Wx({text:t,html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),!this.shouldAbort()&&(this.isMounted||this.store.dispatch(mr([])))}handleKeyDown(t){let{overlayCollapsed:n}=this.state.ui,{textSuggestions:r,selectedSuggestionIndex:o,selection:i}=this.state.input,{inlineSuggestions:s}=this.state.settings,a=r.length>0,l=o!==-1;if(this.store.dispatch(Zx(xc(t))),!(t.key!=="Tab"&&!this.settings.showTextSuggestions))switch(t.key){case"Up":case"ArrowUp":if(n||!a||!i||t.shiftKey)return;this.store.dispatch(Gx()),s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault();return;case"Down":case"ArrowDown":{if(n||!a||!i||t.shiftKey)return;this.store.dispatch(Qx());let{selectedSuggestionIndex:u}=this.state.input;u===-1?this.store.dispatch(ra()):s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault();return}case"Esc":case"Escape":{l?(this.store.dispatch(Tc(-1)),this.store.dispatch(ra()),t.preventDefault()):n||(this.store.dispatch(xi({collapse:!0})),this.store.dispatch(dw(!0)),t.preventDefault());return}case"Tab":{let{userCommitted:u}=this.state.input,c=u.text.substring(0,u.selection.end),{tabCompletionSuggestion:f}=this.state.input;this.store.dispatch(va(!1)),this.state.input.selectedSuggestionIndex>-1?this.stageSelectedSuggestion({inputType:"tab"}):this.settings.showTabCompletion&&f&&f.text.startsWith(c)&&(this.store.dispatch(jt({text:f.text,suggestion:f,eventMetrics:{inputType:"tab"},replace:"until-selection-end"})),this.store.dispatch(gr())),t.preventDefault();break}default:}}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(e_()),this.store.dispatch(mr([]))}handlingTimeStart(){this.state.handlingTime.startTime||(U.info("Start handling time"),this.store.dispatch(OE()))}handlingTimeStop(){this.state.handlingTime.startTime&&(U.info("Stop handling time"),this.store.dispatch(xd()))}logSendMessage(t){let n=vh("input",this.state,{version:this.version});t&&Object.assign(n,{text:t}),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n)}logSendEditMessage(t){let n=vh("overlayInput",this.state,{version:this.version});t&&Object.assign(n,{text:t}),this.store.dispatch(qx(this.state.overlayInput.metrics))}logHandlingTime(){let t=KE(this.state,{version:this.version});this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(NE())}notifySubmit(t={}){this.shouldAbort()||(this.store.dispatch(gr()),this.store.dispatch(Zr(t.text??this.state.input.text)))}stageSelectedSuggestion(t){let n=this.state.input.selectedSuggestionIndex,{textSuggestions:r}=this.state.input;this.store.dispatch(jt({text:r[n].text,suggestion:r[n],eventMetrics:t,replace:"until-selection-end"}))}emit(t,n,r={}){let o=()=>{this.eventListeners[t]&&this.eventListeners[t].forEach(i=>{try{i(n)}catch(s){U.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),U.error(s)}})};this.inputMediator&&r.mayApplyChanges?this.inputMediator.applyChanges(o):o()}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),()=>{this.off(t,n)}}off(t,n){if(!t&&!n){this.eventListeners={};return}let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}setConversationQuery(t){this.dynamicThunkObject.conversationQuery=t}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=mi(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,jn.unmountComponentAtNode)(i),s(),i.remove()}),i}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return no(o),o.dataset.testid=t,o.style.color=r.color,o.style.fontSize=r.fontSize,o.style.fontFamily=r.fontFamily,o.style.fontVariant=r.fontVariant,o.setAttribute("translate","no"),n.appendChild(o),this.unmountHandlers.push(()=>{(0,jn.unmountComponentAtNode)(o),o.remove()}),o}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!wd(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:y,inputMediator:v,closestScrollSelector:h,appendOverlayTo:m,inlineSuggestions:g}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:y,isEmbedded:f,inlineSuggestions:g});let p=h&&$E(t,h)||void 0,x=this.overlayContainerFactory("deepdesk-tab-completion",p||t,{appendTo:m,closestScrollElement:p,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),_=this.overlayContainerFactory("deepdesk-suggestions-overlay",p||t,{appendTo:m},r==null?void 0:r.suggestionsRootNode);n.automaticHandlingTime&&this.setupHandlingTime(t),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(j1,{inputElement:t})})}),x),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(td,{})})}),_),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(a1,{})})}),this.createContainer("deepdesk-overlays")),no(t),this.inputMediator=v||(An(t)?new wn(t):new ao(t)),this.inputMediator.on("change",({plainText:w})=>{this.notifyInputChanged(w)}),this.inputMediator.on("updated",()=>{this.inputMediator&&this.store.dispatch(t_({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()}))}),this.inputMediator.on("keydown",w=>{this.notifyKeyDown(w)}),this.inputMediator.on("paste",({pastedText:w,selectionText:b})=>{this.notifyPaste(w,b)}),this.inputMediator.on("cut",({selectionText:w})=>{this.notifyCut(w)});let C;this.inputMediator.on("selection",w=>{clearTimeout(C),w===null?C=setTimeout(()=>{w!==null&&this.store.dispatch(Xm(w))},500):this.store.dispatch(Xm(w))}),this.inputMediator.on("disabled",()=>{var w;(w=this.inputMediator)==null||w.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{d&&this.notifySubmit()}),this.inputMediator.on("blur",()=>this.store.dispatch(Si(!1))),this.inputMediator.on("focus",()=>this.store.dispatch(Si(!0))),this.store.dispatch($x({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),this.whenConversationLoaded(()=>{var w;this.refresh(),this.broadcastEvents.setSessionId((w=this.state.conversation.current)==null?void 0:w.sessionId)}),this.isMounted=!0}unmount(){var t;this.unmountHandlers.forEach(n=>n()),this.unmountHandlers=[],(t=this.inputMediator)==null||t.dispose(),this.broadcastEvents.cleanup(),this.isMounted=!1}renderWidget(t,n={}){if(this.widgetRoot&&U.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,showPersonalCollectionLink:i,isEmbedded:s}=n;this.widgetRoot=t,this.configure({showImages:o,showPersonalCollectionLink:i,isEmbedded:s}),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(PE,{})})}),t),this.whenConversationLoaded(()=>{var a;this.broadcastEvents.setSessionId((a=this.state.conversation.current)==null?void 0:a.sessionId)})}unmountWidget(){this.widgetRoot&&(0,jn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Ed(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){qE(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfigPromise=null;loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(async()=>{await this.store.dispatch(ka());let t=bi(this.state);t&&this.store.dispatch(ta({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:t.knowledgeAssistForAgents,recommendTextSuggestions:t.recommendTextSuggestions}))}),this.loadProfileConfigPromise)}async checkForTrialMode(t){try{let{account:n}=await this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(U.info("Trial is active"),!await this.deepdeskApi.checkUserExists(t))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;U.info(r),this.shouldRender=!1}}async refreshWidgetSuggestions(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Yc(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(Vt()):this.store.dispatch(Cn(r))})}catch(r){this.handleError(r)}}};async function YE(e,t,n={}){let{value:r}=e,{start:o,end:i}=n.replace??{start:0,end:r.length},s=`${r.slice(0,o)}${t}${r.slice(i)}`,a=n.selectionAfter??{start:o+t.length,end:o+t.length},l=()=>{if(n.setValue)return n.setValue(s);e.value=s};return Promise.resolve(l()).then(()=>{e.selectionStart=a.start,e.selectionEnd=a.end,e.blur(),e.focus()})}async function ZE(e,t,n={}){let r=n.replace?kr(e,n.replace.start,n.replace.end):Oi(e),o,i=()=>{if(n.setRange)return n.setRange(r.cloneRange());r.deleteContents(),o=document.createElement("span"),r.insertNode(o),n.insertBRs!==!1?t.split(`
21
+ `);break}default:break}f&&s++}return l(e),a}var ao=class extends _n{observer;lastKnownSelection=null;getRootNode(){return this.element.getRootNode()}getText(){let t=new Range;return t.selectNodeContents(this.element),Da(this.element,t)}getHTML(){return this.element.innerHTML||""}getRange(){var o;let t=this.getRootNode();if(t.activeElement!==this.element)return null;let n="getSelection"in t?t.getSelection():window.getSelection();if(!n)return null;let r="getComposedRanges"in n&&t instanceof ShadowRoot?(o=n.getComposedRanges(t))==null?void 0:o[0]:n.rangeCount>0?n.getRangeAt(0):null;return!r||!this.element.contains(r.startContainer)||!this.element.contains(r.endContainer)?null:r}getSelection(){let t=this.getRange();if(t)return Ma(this.element,t);let n=this.lastKnownSelection;if(n&&RE(this.element,n.start,n.end))return n;let r=Oi(this.element);return r.collapse(!1),Ma(this.element,r)}getSelectedText(){let{start:t,end:n}=this.getSelection();return Da(this.element,kr(this.element,t,n))}applyChanges(t){var o;if(!this.isActive)return;this.isSettingValue=!0;let n=this.getText(),r=t(this.element);(o=this.observer)==null||o.takeRecords(),Promise.resolve(r).then(()=>{this.currentText=this.getText(),n!==this.currentText&&this.triggerChange(),this.isSettingValue=!1})}listen(){super.listen(),this.observer=new MutationObserver(()=>{setTimeout(()=>{this.triggerChange()},0)}),this.observer.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0});let t=this.element.isContentEditable,n=new MutationObserver(()=>{this.element.isContentEditable!==t&&(t=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});n.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>n.disconnect())}dispose(){super.dispose(),this.observer&&this.observer.disconnect()}};var fh=class{constructor(t){this.name=t;this.broadcastChannel=new BroadcastChannel(t)}broadcastChannel;disposeHandlers=[];onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(t)}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},ph=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.iframe=this.createIframe(),document.body.appendChild(this.iframe)}iframe;disposeHandlers=[];createIframe(){let t=`deepdesk-iframe-${this.name}`,n=document.getElementById(t);if(n)return n;let r=document.createElement("iframe"),o=`${this.targetOrigin}/v2/widget/liveengage/channel.html`,i=new URLSearchParams({channel:this.name,host:window.location.origin});return this.options.debug&&i.set("debug","1"),r.style.position="absolute",r.style.left="-999em",r.style.width="0px",r.style.height="0px",r.tabIndex=-1,r.id=t,r.title=`iframe-${this.name}`,r.src=`${o}?${i.toString()}`,r}onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(t,this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},mh=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.defaultChannel=this.createChannel("deepdesk-general")}sessionId;deepdeskUrl;channel;defaultChannel;eventMap;get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),U.info("Set sessionId",t),this.sessionId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new ph(t,this.deepdeskUrl,{debug:!0}):new fh(t),r=o=>{var i,s;o.origin===this.deepdeskUrl&&o.data.type==="event"&&o.data.channel===t&&(U.info("Received broadcast event",this.sessionId,o),(s=(i=this.eventMap)[o.data.name])==null||s.call(i,o.data.payload))};return n.onMessage(r),n}send(t,n){var o,i,s;if(!this.sessionId)return;U.info("broadcast event",{sessionId:this.sessionId,name:t,payload:n});let r={type:"event",name:t,payload:n};(i=(o=this.eventMap)[t])==null||i.call(o,n),(s=this.channel)==null||s.postMessage({...r,channel:this.sessionId})}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),delete this.channel,t&&((r=this.defaultChannel)==null||r.close(),delete this.defaultChannel)}},IE=mh;var Ni=class extends Error{constructor(n,r){super(n);this.body=r}name="CustomError"};var gh=e=>new Promise(t=>{setTimeout(t,e)});var Mi=class extends Ni{name="ClientError"},hh=class extends Ni{name="ServerError"},Wt=class e{constructor(t="",n={}){this.baseUrl=t;this.options=n;n.fetch&&(this.fetch=n.fetch)}latestRequestByUrl={};csrfToken;fetch=window.fetch.bind(window);static refreshingToken=null;patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,{abortLatest:l=!1,attempts:u=1,retryDelay:c=500,refreshTokenOn401:f=!0,retryOnError:d=_=>_ instanceof TypeError,retryOnResponse:y=_=>_.status>=500,version:v="v1",...h}=n,m={credentials:"include",...h,headers:{"Content-Type":"application/json",...h.headers}};n.method!==void 0&&n.method!=="GET"&&this.csrfToken&&(m.headers={...m.headers,"X-CSRFToken":this.csrfToken}),typeof v=="string"&&(m.headers={...m.headers,"X-Deepdesk-API-Version":v});let g=u,p=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&l&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let x=async()=>(g--,a(s,m).then(async _=>y(_)&&!i.isAborted&&g>0?(await gh(c),x()):_.status===401&&f===!0&&p===!1?(p=!0,await this.refreshToken(),x()):_).catch(async _=>{if(d(_)&&!i.isAborted&&g>0)return await gh(c),x();throw _}));x().then(_=>_.json().catch(()=>null).then(C=>{_.status>=500?o(new hh("Server Error",C)):_.status===401?o(new Mi("Unauthorized",C)):_.status===403?o(new Mi("Forbidden",C)):_.status===404?o(new Mi("Not Found",C)):_.status>=400&&o(new Mi("Bad Request",C)),delete this.latestRequestByUrl[s],r(C)})).catch(_=>{o(_)})})}async validateToken(){let{has_valid_access_token:t}=await this.get("/auth/validate");if(!t)return!1;let{is_logged_in:n}=await this.get("/apis/admin/session/validate/",{version:null});return!!n}refreshToken(){return e.refreshingToken||(e.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{e.refreshingToken=null},1e3*60)})),e.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,{method:"POST",body:JSON.stringify(n),...r})}patch(t,n,r){return this.request(t,{method:"PATCH",body:JSON.stringify(n),...r})}put(t,n,r){return this.request(t,{method:"PUT",body:JSON.stringify(n),...r})}delete(t,n){return this.request(t,{method:"DELETE",...n})}};var EA;(t=>{let e;(l=>(l.SEND_MESSAGE="Send Message",l.HANDLING_TIME="Handling Time",l.START_AUTOFLOW="Start Autoflow",l.ABORT_AUTOFLOW="Abort Autoflow",l.ADD_TO_PERSONAL_COLLECTION="Add to personal collection",l.DELETE_FROM_PERSONAL_COLLECTION="Delete from personal collection"))(e=t.EventType||={})})(EA||={});function Sd(e){return{...re(e),tags:e.tags}}var Fn=class e{constructor(t,n={}){this.options=n;this.client=new Wt(t,{fetch:n.fetch}),this.client.patchFetch(r=>async(o,i)=>{let s=await r(o,i);return this.handleDeepdeskVersionHeaders(s),s})}latestReceivedDeepdeskVersions={};client;shouldFetchCsrfToken=!0;static exchangeTokenPromise=null;async preflight(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=await this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(e.exchangeTokenPromise||(e.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),e.exchangeTokenPromise):Promise.resolve()}async createConversation(t){await this.preflight(),U.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=await this.client.post("/api/conversations",{...we(t),tags:t.tags},{version:"v2"});return Sd(n)}async getProfile(t){let n=await this.client.get(`/apis/admin/profiles/${t}/`,{version:null});return re(n)}async getContentTypes(){let t=await this.client.get("/apis/admin/content-types/",{version:null});return re(t)}async getPlatformConfig(){let{config:t}=await this.client.get("/platform/config/",{version:null});return re(t)}async checkUserExists(t){let{exists:n}=await this.client.get(`/apis/admin/users/exists?external_id=${t}`);return n}async getConversationBySessionId(t,n={}){await this.preflight(),U.info(`Getting conversation for session ${t}`);let{attempts:r=1,retryDelay:o=1e3}=n,i=await this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"});return Sd(i)}async isConversationSupported(t,n={}){U.info(`Check if conversation for session ${t} is supported`);let{attempts:r=1,retryDelay:o=1e3}=n;return(await this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:r,retryDelay:o,retryOnResponse:s=>s.status===404||s.status>=500,version:"v2"})).has_active_profile}async updateConversation(t,n){let r=we(n);n.tags&&(r.tags=n.tags);let o=await this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return Sd(o)}async postMessages(t,n){return(await this.client.post(`/api/conversations/${t}/messages`,n.map(o=>({...we(o),tags:o.tags})),{version:"v2"})).map(o=>Sd(o))}async sendEvent(t,n){let{data:r,...o}=n,i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((s,[a,l])=>({...s,[a]:l}),{});return this.client.post("/api/events",we({...i,...o,data:r,name:t}),{version:"v2"})}async sendEventV1(t,n){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>({...o,[i]:s}),{});return this.client.post("/api/events",{event:t,data:we({...n,...r})})}async getEntities(t){return(await this.client.post("/api/entities",{messages:t.filter(r=>r.text)})).entities}async getSummary(t,n={}){return(await this.client.post("/api/summary",{conversation:{messages:t.filter(o=>o.text&&o.source)},prompt_instruction:n.promptInstruction,model:n.model})).summary}async getTemporaryExchangeToken(){return(await this.client.get("/auth/exchange-token",{version:null})).jwt}async exchangeTokenForAccessCookie(t){return this.client.post("/apis/admin/session/jwt/",{jwt:t},{version:null}).catch(n=>{throw U.warn(`Invalid token '${t}'`),n})}async authenticateWithKey(t,n){await this.client.post("/apis/admin/session/api-key/",we(n),{version:null,refreshTokenOn401:!1,headers:{apikey:t}})}async getTextSuggestions(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(await this.client.post(`/api/conversations/${t}/recommend/${r}`,we(n),{abortLatest:!0})).map(i=>({...re(i),text:i.text||i.url||i.message,source:r,type:r})).filter((i,s,a)=>s===a.findIndex(l=>l.text===i.text))}async isLoggedIn(){return await this.preflight(),this.client.validateToken()}async getAutocompleteSuggestions(t,n){return(await this.client.post(`/api/conversations/${t}/autocomplete`,we(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,i,s)=>i===s.findIndex(a=>a.text===o.text))}async getPinnedMessages(t){let n=await this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0});return re(n).map(r=>({...r,text:r.message,source:"sticky-messages",type:"pinned-message"}))}async getStyleSuggestions(t){let n=await this.client.post("/api/style-suggestions",we(t),{abortLatest:!0});return re(n)}async search(t){let n=await this.client.post(`/api/profiles/${t.profile}/search`,we(t),{version:"v2"});return re(n)}async knowledgeAssist(t,n,r){let o=await this.client.post("/api/knowledge-search/search",we({question:t.question,promptInstruction:t.promptInstruction,profile:r,chatHistory:n.map(i=>({question:i.question,answer:i.answer.answer}))}),{version:"v2"});return re(o)}async requestLoginByEmail(t){let n=await this.client.post("/apis/admin/session/passwordless/request/",{email:t},{version:null});return re(n)}async getCsrfToken(){let{token:t}=await this.client.get("/apis/admin/session/csrf/",{version:null});return t}async verifyLoginToken(t){let n=await this.client.post("/apis/admin/session/passwordless/login/",{token:t},{version:null});return re(n)}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(xy);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&U.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};var Fa=class{constructor(t,n){this.url=t;this.options={timeout:25e3,...n}}eventListeners={};options;timeoutTimer;eventSource;proxyEvent(t){this.eventSource.addEventListener(yg(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,re(o))}catch{U.warn(`Invalid JSON for ${t}: ${r}`)}})}connect(){clearTimeout(this.timeoutTimer);let t=new EventSource(this.url,{withCredentials:!0});this.eventSource=t;let n=!1;t.onopen=()=>{n=!0},t.onerror=()=>{n&&t.readyState===2&&this.connect()},this.timeoutTimer=setTimeout(()=>{t.close(),this.connect()},this.options.timeout),Object.keys(this.eventListeners).forEach(r=>{this.proxyEvent(r)})}disconnect(){var t;clearTimeout(this.timeoutTimer),this.eventListeners={},(t=this.eventSource)==null||t.close()}emit(t,n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>r(n))}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),this.proxyEvent(t),()=>{this.off(t,n)}}off(t,n){let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}};var CA;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||={})})(CA||={});var ja=class{constructor(t,n={}){this.apiUrl=t;this.client=new Wt(t,n)}client;streams={};logger=U;async getCustomMessages(t){let n=await this.client.get(`/sessions/${t}/suggestions`);return re(n.suggestions)}async sendCustomMessage(t,n){let r=await this.client.post(`/sessions/${t}/messages`,we(n));return re(r)}async answerCustomMessage(t,n){await this.client.post(`/sessions/${t}/answers`,we(n))}async getAutoflows(t){let n=await this.client.get(`/sessions/${t}/autoflows`);return re(n.autoflows)}async startAutoflowSession(t){let n=await this.client.post("/autoflow-sessions",we(t));return re(n)}async stopAutoflowSession(t){await this.client.delete(`/autoflow-sessions/${t}`)}openStream(t){return this.streams[t]||(this.streams[t]=new Fa(`${this.apiUrl}/sessions/${t}/events`),this.streams[t].connect()),this.streams[t]}closeStream(t){this.streams[t]||(this.streams[t].disconnect(),delete this.streams[t])}};var AE={startTime:null,stopTime:null},LE=B({name:"handlingTime",initialState:AE,reducers:{handlingTimeStart(e){if(e.startTime&&!e.stopTime)throw new Error("Timing already started");e.startTime=new Date,e.stopTime=null},handlingTimeStop(e){if(!e.startTime)throw new Error("Timing not started");e.stopTime=new Date},handlingTimeReset(e){e.startTime=null,e.stopTime=null}},extraReducers:e=>{e.addCase(J,()=>AE)}}),{handlingTimeStart:OE,handlingTimeStop:xd,handlingTimeReset:NE}=LE.actions,ME=LE.reducer;var DE=(e={})=>{let t={onAuthError:_i(!1),...e};return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var _d={list:{keywordMatches:[]},fetchState:"idle",isInitialRequest:null};var lo=M("styleSuggestions/getAll",async({text:e},t)=>{var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),{showStyleSuggestions:o}=r.settings,i=(s=r.conversation.current)==null?void 0:s.profileCode;if(!o)return _d.list;if(!i)throw new Error("No current conversation to fetch pinned messages");return n.getStyleSuggestions({profileCode:i,message:e})}),bA=B({name:"styleSuggestions",initialState:_d,reducers:{},extraReducers:e=>{e.addCase(lo.pending,t=>{t.isInitialRequest=t.isInitialRequest===null,t.fetchState="loading"}).addCase(lo.rejected,t=>{t.fetchState="error"}).addCase(lo.fulfilled,(t,n)=>{t.fetchState="done",oi(t.list,n.payload)||(t.list=n.payload)}).addCase(Zr,t=>{t.list=_d.list}).addCase(J,()=>_d)}}),FE=bA.reducer;var jE=(e={})=>{let t,n=!0,r={getStyleSuggestions:lo,debounce:500,...e};return o=>i=>s=>{var y;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((y=u.conversation.current)==null?void 0:y.id)||!c)return l;let{text:d}=u.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function TA(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var BE=(e={})=>{let t={getTextSuggestions:Cn,getAutocompleteSuggestions:ya,debounce:200,check:Zc,...e},n;return r=>o=>i=>{var h;let{input:{userCommitted:s}}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(h=l.conversation.current)==null?void 0:h.id,d=i.type===Gc.toString();if(!f||!u&&!c)return a;let{input:{userCommitted:y}}=l;return TA(y,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let m=ii(l);m===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(m))},d?0:t.debounce)),a}};var HE=lo.fulfilled.toString();function kA(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var UE=e=>t=>n=>r=>{var u;if(r.type!==HE){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=kA(o,s);r.type===HE&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var PA=Du({activeSuggestion:lw,answer:Jw,auth:ww,autoflows:K1,conversation:zx,contentTypes:Fw,customMessages:J1,exchangeToken:rE,entities:Uw,handlingTime:ME,info:M_,input:Gm.reducer,overlayInput:Ge.reducer,settings:Ox,profile:n1,search:U_,summary:qw,styleSuggestions:FE,ui:pw,textSuggestions:rw});function zE(e){return B0({reducer:PA,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),DE(),BE({debounce:200}),jE({debounce:500}),UE(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var RA=e=>{var t;return((t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())??"unknown"},IA=e=>t=>n=>r=>{var a;let o=t.getState(),i=zm("inlineSuggestions")(o);switch(r.type){case bn.toString():{let l=Y_(r.payload.contentType)(t.getState()),u=l.indexOf(r.payload.suggestion);e.emit("edit-suggestion",{contentType:r.payload.contentType,index:u,suggestions:l});break}case _i.toString():{!r.payload&&e.emit("logout",void 0);break}case jt.toString():{let{start:l,end:u}=o.input.selection;e.emit("select-suggestion",{type:RA(r.payload.suggestion),...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case _c.toString():{let{start:l,end:u}=o.input.selection;e.emit("replace",{...r.payload,replace:r.payload.replace==="selection"?{start:l,end:u}:{start:0,end:u}},{mayApplyChanges:!0});break}case ra.toString():{let l=t.getState(),{text:u,selection:c}=l.input.userCommitted;e.emit("reset",{text:u,selectionAfter:c},{mayApplyChanges:!0});break}case bc.toString():e.emit("select-image",r.payload,{mayApplyChanges:!0}),e.sendEvent("Image attached",{conversationId:o.conversation.current.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case Vt.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:o.conversation.current.id,data:{entities:r.payload}});break;case Pn.fulfilled.toString():e.sendEvent("conversation summarized",{conversationId:o.conversation.current.id,data:{summary:r.payload.summary}});break;case it.toString():e.sendEvent(r.payload.name,{conversationId:((a=r.payload.options)==null?void 0:a.includeConversationData)&&o.conversation.current.id,data:r.payload.data});break;case wc.toString():e.handleKeyDown(r.payload);break;case Zr.toString():e.logSendMessage(r.payload);break;case Ec.toString():e.logSendEditSuggestionMessage(r.payload);break;case Cc.toString():e.handleInputChanged(r.payload);break;default:break}let s=n(r);switch(r.type){case Zr.toString():e.handleAfterSendMessage(r.payload);break;case va.toString():e.onUpdateShowTabHint(r.payload);break;case xd.toString():e.logHandlingTime();break;case jt.toString():{i&&(t.dispatch(mr([])),t.dispatch(gr()));break}default:break}return s},VE=IA;function yh(e){return e.toISOString().replace("T"," ").replace("Z","")}function KE(e,t){var o,i,s;let{startTime:n,stopTime:r}=e.handlingTime;if(!n||!r)throw new Error("No startTime and stopTime for handling time metrics");return{conversationId:e.conversation.current.id,clientVersion:t.version,agentId:(o=e.info.agentInfo)==null?void 0:o.agentId,agentName:(i=e.info.agentInfo)==null?void 0:i.agentName,agentEmail:(s=e.info.agentInfo)==null?void 0:s.agentEmail,timeStart:yh(n),timeStop:yh(r)}}function vh(e,t,n){var b,R,P;let{text:r,metrics:{numCharsTyped:o,numCharsPasted:i,numCharsCut:s,numCharsDeleted:a,numPaste:l,agentStartedTypingTimestamp:u,externalTimeTotalSeconds:c,pastes:f,cuts:d,deletions:y,textSuggestions:v,offeredTextSuggestions:h}}=t[e],m=r.length,p=v.reduce((N,{text:V,searchTerm:H})=>N+V.length-(H?H.length:0),0),x=u??Date.now(),_=(Date.now()-x)/1e3+(c||0),C=o/_,w=v.reduce((N,{searchTerm:V})=>N+(V?V.length:0),0);return{conversationId:t.conversation.current.id,source:"agent",text:r,clientVersion:n.version,pastes:f,cuts:d,deletions:y,lenTextTyped:o+w,lenTextTotal:m,lenTextAssisted:p,lenTextPasted:i,lenTextCut:s,lenTextDeleted:a,timeTotalSeconds:_,charsPerSecond:C,numPastes:l,textSuggestionsV2:v,suggestionsCounters:[{source:"gpt",countOffered:h.filter(N=>N.source==="gpt").length}],agentId:(b=t.info.agentInfo)==null?void 0:b.agentId,agentName:(R=t.info.agentInfo)==null?void 0:R.agentName,agentEmail:(P=t.info.agentInfo)==null?void 0:P.agentEmail}}function WE(e,t){let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;return r instanceof HTMLElement?WE(r,t):null}function $E(e,t){return WE(e,t)}function qE(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function wd(e){return e instanceof HTMLElement&&(An(e)||Dc(e))}var GE=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch{return t}}catch{return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch{U.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function AA(e){return e.offsetParent!==null}function XE(e){if(!AA(e))return!1;let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}function Ed(e,t,n=100){let r=XE(e);t({isVisible:r});let o=setInterval(()=>{let i=XE(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var ut=S(E()),QE=GE("showTabHint",!0),Ba=class e{static version="10.2.1-beta.0";static count=0;deepdeskApi;inputMediator=null;version;broadcastEvents;eventListeners={};unmountHandlers=[];widgetRoot=null;dynamicThunkObject={};isMounted=!1;instanceId;shouldRender=!0;store;constructor({deepdeskUrl:t,brokerUrl:n,version:r=e.version||"unknown",locale:o="en-US",token:i,fetch:s,productName:a,createCustomChannel:l}){let u=t.replace(/\/api$/,"");this.deepdeskApi=new Fn(u,{token:i,fetch:s}),this.version=r,this.instanceId=e.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[VE({emit:(f,d,y)=>this.emit(f,d,y),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),handleInputChanged:f=>this.handleInputChanged(f),handleKeyDown:f=>this.handleKeyDown(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),logSendEditSuggestionMessage:f=>this.logSendEditMessage(f),onUpdateShowTabHint:f=>QE.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new ja(n)}),this.store=zE(c),this.broadcastEvents=new IE({debug:!0,deepdeskUrl:u,eventMap:Ew(this.store),createCustomChannel:l}),this.store.dispatch(ta),this.store.dispatch(va(QE.value())),this.store.dispatch(ta({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){return this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex]??null}hasConversation(){return!!this.state.conversation.current}conversationId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.id}sessionId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.sessionId}shouldAbort(){return this.state.conversation.isSupported===!1?(U.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(U.warn("Profile has not been loaded (yet)"),!0):(U.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(_i(null)),this.store.dispatch(_r()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();Tn(r)&&hw(r)!=="loading"&&t()});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return this.deepdeskApi.isLoggedIn()}async setPlatformAgentId(t){try{if((await this.deepdeskApi.client.get("/apis/admin/session/me/",{version:null})).external_id)return;await this.deepdeskApi.client.request("/apis/admin/session/me/",{method:"PATCH",body:JSON.stringify({external_id:t}),version:null})}catch(n){U.warn("Failed to attach user:",n)}}async isConversationSupported(t,n){return(await this.store.dispatch($m({sessionId:t,options:n}))).payload}async createConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(gc(t))).payload}async getConversationBySessionId(t,n){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(await this.store.dispatch(hc({sessionId:t,options:n}))).payload}async upsertConversation(t){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(await this.store.dispatch(qm(t))).payload}async postMessages(t){return(await this.store.dispatch(vc(t))).payload}async updateConversation(t){return(await this.store.dispatch(yc(t))).payload}resetConversation(){this.store.dispatch(J()),this.dynamicThunkObject.conversationQuery=null}async getSummary(){let t=await this.store.dispatch(Pn());if(t.error)throw new Error(t.error.message);return t.payload.summary}configure(t){this.store.dispatch(ta(t))}setVisitorInfo(t){this.store.dispatch(N_(t))}async setAgentInfo(t){await this.store.dispatch(pa(t))}async setAgentSettings(t){await this.store.dispatch(vg(t))}async getAgentSettings(){return(await this.store.dispatch(Sg())).payload}async refresh(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.handleInputChanged(this.inputMediator.getText());let t=[];return this.store.dispatch(Gc()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})}notifyInputChanged(t){this.store.dispatch(Cc(t))}notifyKeyDown(t){this.store.dispatch(wc(t))}notifyPaste(t,n){this.store.dispatch(Jx({text:t,selectionText:n}))}notifyCut(t){this.store.dispatch(Yx(t))}notifyExternalSuggestion(t){this.store.dispatch(jt(t)),this.store.dispatch(gr())}notifyEditSuggestion(t){this.store.dispatch(tw(t.contentType,t.suggestions)),this.store.dispatch(bn({contentType:t.contentType,suggestion:typeof t.index=="number"?t.suggestions[t.index]:null}))}handleInputChanged(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui;n&&r&&this.store.dispatch(xi({collapse:!1})),this.inputMediator&&this.store.dispatch(Wx({text:t,html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),!this.shouldAbort()&&(this.isMounted||this.store.dispatch(mr([])))}handleKeyDown(t){let{overlayCollapsed:n}=this.state.ui,{textSuggestions:r,selectedSuggestionIndex:o,selection:i}=this.state.input,{inlineSuggestions:s}=this.state.settings,a=r.length>0,l=o!==-1;if(this.store.dispatch(Zx(xc(t))),!(t.key!=="Tab"&&!this.settings.showTextSuggestions))switch(t.key){case"Up":case"ArrowUp":if(n||!a||!i||t.shiftKey)return;this.store.dispatch(Gx()),s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault();return;case"Down":case"ArrowDown":{if(n||!a||!i||t.shiftKey)return;this.store.dispatch(Qx());let{selectedSuggestionIndex:u}=this.state.input;u===-1?this.store.dispatch(ra()):s||this.stageSelectedSuggestion({inputType:"arrow"}),t.preventDefault();return}case"Esc":case"Escape":{l?(this.store.dispatch(Tc(-1)),this.store.dispatch(ra()),t.preventDefault()):n||(this.store.dispatch(xi({collapse:!0})),this.store.dispatch(dw(!0)),t.preventDefault());return}case"Tab":{let{userCommitted:u}=this.state.input,c=u.text.substring(0,u.selection.end),{tabCompletionSuggestion:f}=this.state.input;this.store.dispatch(va(!1)),this.state.input.selectedSuggestionIndex>-1?this.stageSelectedSuggestion({inputType:"tab"}):this.settings.showTabCompletion&&f&&f.text.startsWith(c)&&(this.store.dispatch(jt({text:f.text,suggestion:f,eventMetrics:{inputType:"tab"},replace:"until-selection-end"})),this.store.dispatch(gr())),t.preventDefault();break}default:}}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(e_()),this.store.dispatch(mr([]))}handlingTimeStart(){this.state.handlingTime.startTime||(U.info("Start handling time"),this.store.dispatch(OE()))}handlingTimeStop(){this.state.handlingTime.startTime&&(U.info("Stop handling time"),this.store.dispatch(xd()))}logSendMessage(t){let n=vh("input",this.state,{version:this.version});t&&Object.assign(n,{text:t}),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n)}logSendEditMessage(t){let n=vh("overlayInput",this.state,{version:this.version});t&&Object.assign(n,{text:t}),this.store.dispatch(qx(this.state.overlayInput.metrics))}logHandlingTime(){let t=KE(this.state,{version:this.version});this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(NE())}notifySubmit(t={}){this.shouldAbort()||(this.store.dispatch(gr()),this.store.dispatch(Zr(t.text??this.state.input.text)))}stageSelectedSuggestion(t){let n=this.state.input.selectedSuggestionIndex,{textSuggestions:r}=this.state.input;this.store.dispatch(jt({text:r[n].text,suggestion:r[n],eventMetrics:t,replace:"until-selection-end"}))}emit(t,n,r={}){let o=()=>{this.eventListeners[t]&&this.eventListeners[t].forEach(i=>{try{i(n)}catch(s){U.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),U.error(s)}})};this.inputMediator&&r.mayApplyChanges?this.inputMediator.applyChanges(o):o()}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),()=>{this.off(t,n)}}off(t,n){if(!t&&!n){this.eventListeners={};return}let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}setConversationQuery(t){this.dynamicThunkObject.conversationQuery=t}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=mi(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,jn.unmountComponentAtNode)(i),s(),i.remove()}),i}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return no(o),o.dataset.testid=t,o.style.color=r.color,o.style.fontSize=r.fontSize,o.style.fontFamily=r.fontFamily,o.style.fontVariant=r.fontVariant,o.setAttribute("translate","no"),n.appendChild(o),this.unmountHandlers.push(()=>{(0,jn.unmountComponentAtNode)(o),o.remove()}),o}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!wd(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:y,inputMediator:v,closestScrollSelector:h,appendOverlayTo:m,inlineSuggestions:g}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:y,isEmbedded:f,inlineSuggestions:g});let p=h&&$E(t,h)||void 0,x=this.overlayContainerFactory("deepdesk-tab-completion",p||t,{appendTo:m,closestScrollElement:p,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),_=this.overlayContainerFactory("deepdesk-suggestions-overlay",p||t,{appendTo:m},r==null?void 0:r.suggestionsRootNode);n.automaticHandlingTime&&this.setupHandlingTime(t),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(j1,{inputElement:t})})}),x),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(td,{})})}),_),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(a1,{})})}),this.createContainer("deepdesk-overlays")),no(t),this.inputMediator=v||(An(t)?new wn(t):new ao(t)),this.inputMediator.on("change",({plainText:w})=>{this.notifyInputChanged(w)}),this.inputMediator.on("updated",()=>{this.inputMediator&&this.store.dispatch(t_({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()}))}),this.inputMediator.on("keydown",w=>{this.notifyKeyDown(w)}),this.inputMediator.on("paste",({pastedText:w,selectionText:b})=>{this.notifyPaste(w,b)}),this.inputMediator.on("cut",({selectionText:w})=>{this.notifyCut(w)});let C;this.inputMediator.on("selection",w=>{clearTimeout(C),w===null?C=setTimeout(()=>{w!==null&&this.store.dispatch(Xm(w))},500):this.store.dispatch(Xm(w))}),this.inputMediator.on("disabled",()=>{var w;(w=this.inputMediator)==null||w.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{d&&this.notifySubmit()}),this.inputMediator.on("blur",()=>this.store.dispatch(Si(!1))),this.inputMediator.on("focus",()=>this.store.dispatch(Si(!0))),this.store.dispatch($x({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),selection:this.inputMediator.getSelection()})),this.whenConversationLoaded(()=>{var w;this.refresh(),this.broadcastEvents.setSessionId((w=this.state.conversation.current)==null?void 0:w.sessionId)}),this.isMounted=!0}unmount(){var t;this.unmountHandlers.forEach(n=>n()),this.unmountHandlers=[],(t=this.inputMediator)==null||t.dispose(),this.broadcastEvents.cleanup(),this.isMounted=!1}renderWidget(t,n={}){if(this.widgetRoot&&U.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,showPersonalCollectionLink:i,isEmbedded:s}=n;this.widgetRoot=t,this.configure({showImages:o,showPersonalCollectionLink:i,isEmbedded:s}),(0,jn.render)((0,ut.jsx)(Ra,{store:this.store,customStyles:r,children:(0,ut.jsx)(xa,{broadcastEvents:this.broadcastEvents,children:(0,ut.jsx)(PE,{})})}),t),this.whenConversationLoaded(()=>{var a;this.broadcastEvents.setSessionId((a=this.state.conversation.current)==null?void 0:a.sessionId)})}unmountWidget(){this.widgetRoot&&(0,jn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Ed(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){qE(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfigPromise=null;loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(async()=>{await this.store.dispatch(ka());let t=bi(this.state);t&&this.store.dispatch(ta({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:t.knowledgeAssistForAgents,recommendTextSuggestions:t.recommendTextSuggestions}))}),this.loadProfileConfigPromise)}async checkForTrialMode(t){try{let{account:n}=await this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(U.info("Trial is active"),!await this.deepdeskApi.checkUserExists(t))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;U.info(r),this.shouldRender=!1}}async refreshWidgetSuggestions(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Yc(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(Vt()):this.store.dispatch(Cn(r))})}catch(r){this.handleError(r)}}};async function YE(e,t,n={}){let{value:r}=e,{start:o,end:i}=n.replace??{start:0,end:r.length},s=`${r.slice(0,o)}${t}${r.slice(i)}`,a=n.selectionAfter??{start:o+t.length,end:o+t.length},l=()=>{if(n.setValue)return n.setValue(s);e.value=s};return Promise.resolve(l()).then(()=>{e.selectionStart=a.start,e.selectionEnd=a.end,e.blur(),e.focus()})}async function ZE(e,t,n={}){let r=n.replace?kr(e,n.replace.start,n.replace.end):Oi(e),o,i=()=>{if(n.setRange)return n.setRange(r.cloneRange());r.deleteContents(),o=document.createElement("span"),r.insertNode(o),n.insertBRs!==!1?t.split(`
22
22
  `).reverse().forEach((s,a)=>{a>0&&r.insertNode(document.createElement("br")),r.insertNode(document.createTextNode(s))}):r.insertNode(document.createTextNode(t))};return Promise.resolve(i()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let s=n.selectionAfter?kr(e,n.selectionAfter.start,n.selectionAfter.end):(r.collapse(!1),r),a=window.getSelection();a==null||a.removeAllRanges(),a==null||a.addRange(s)}if(!o)return;o.scrollIntoView&&o.scrollIntoView({block:"nearest",inline:"nearest"})}finally{o&&o.remove()}})}function JE(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}async function eC(e,t,n){await new Fn(e).authenticateWithKey(t,n)}async function tC(e){let n=await new Wt(e).get("/platform/config/",{version:null});return re(n)}async function LA(e){let n=await(e.fetch??window.fetch)(e.url),r=await n.blob();return new File([r],e.name,{type:e.mimeType??n.headers.get("Content-Type")??"image/jpeg"})}async function nC(e,t){let n=await LA(t),r=new Event("change",{bubbles:!0,cancelable:!0});try{Object.defineProperty(e,"files",{configurable:!0,get:()=>[n]}),e.dispatchEvent(r)}finally{Object.hasOwn(e,"files")&&delete e.files}}return lC(OA);})();
23
23
  /*! Bundled license information:
24
24