@deepdesk/deepdesk-sdk 14.2.1-beta.7 → 14.3.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.
@@ -1,4 +1,4 @@
1
- "use strict";var Deepdesk=(()=>{var Qk=Object.create;var Ni=Object.defineProperty,Xk=Object.defineProperties,Zk=Object.getOwnPropertyDescriptor,Jk=Object.getOwnPropertyDescriptors,eP=Object.getOwnPropertyNames,Wl=Object.getOwnPropertySymbols,tP=Object.getPrototypeOf,Kf=Object.prototype.hasOwnProperty,pv=Object.prototype.propertyIsEnumerable;var fv=(e,t,n)=>t in e?Ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Kf.call(t,n)&&fv(e,n,t[n]);if(Wl)for(var n of Wl(t))pv.call(t,n)&&fv(e,n,t[n]);return e},I=(e,t)=>Xk(e,Jk(t));var ee=(e,t)=>{var n={};for(var r in e)Kf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wl)for(var r of Wl(e))t.indexOf(r)<0&&pv.call(e,r)&&(n[r]=e[r]);return n};var Re=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xe=(e,t)=>{for(var n in t)Ni(e,n,{get:t[n],enumerable:!0})},mv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of eP(t))!Kf.call(e,o)&&o!==n&&Ni(e,o,{get:()=>t[o],enumerable:!(r=Zk(t,o))||r.enumerable});return e};var x=(e,t,n)=>(n=e!=null?Qk(tP(e)):{},mv(t||!e||!e.__esModule?Ni(n,"default",{value:e,enumerable:!0}):n,e)),nP=e=>mv(Ni({},"__esModule",{value:!0}),e);var P=(e,t,n)=>new Promise((r,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},i=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,i);a((n=n.apply(e,t)).next())});var se=Re((w_,$l)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var s=arguments[o];if(s){var i=typeof s;if(i==="string"||i==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var a=n.apply(null,s);a&&r.push(a)}}else if(i==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var l in s)e.call(s,l)&&s[l]&&r.push(l)}}}return r.join(" ")}typeof $l!="undefined"&&$l.exports?(n.default=n,$l.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var ql=Re((E_,hv)=>{"use strict";var gv=Object.getOwnPropertySymbols,rP=Object.prototype.hasOwnProperty,oP=Object.prototype.propertyIsEnumerable;function sP(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function iP(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(s){o[s]=s}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch(s){return!1}}hv.exports=iP()?Object.assign:function(e,t){for(var n,r=sP(e),o,s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var i in n)rP.call(n,i)&&(r[i]=n[i]);if(gv){o=gv(n);for(var a=0;a<o.length;a++)oP.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var Ov=Re(ne=>{"use strict";var $f=ql(),cs=60103,Sv=60106;ne.Fragment=60107;ne.StrictMode=60108;ne.Profiler=60114;var xv=60109,wv=60110,Ev=60112;ne.Suspense=60113;var bv=60115,Cv=60116;typeof Symbol=="function"&&Symbol.for&&(zt=Symbol.for,cs=zt("react.element"),Sv=zt("react.portal"),ne.Fragment=zt("react.fragment"),ne.StrictMode=zt("react.strict_mode"),ne.Profiler=zt("react.profiler"),xv=zt("react.provider"),wv=zt("react.context"),Ev=zt("react.forward_ref"),ne.Suspense=zt("react.suspense"),bv=zt("react.memo"),Cv=zt("react.lazy"));var zt,yv=typeof Symbol=="function"&&Symbol.iterator;function aP(e){return e===null||typeof e!="object"?null:(e=yv&&e[yv]||e["@@iterator"],typeof e=="function"?e:null)}function Mi(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Tv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kv={};function ds(e,t,n){this.props=e,this.context=t,this.refs=kv,this.updater=n||Tv}ds.prototype.isReactComponent={};ds.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(Mi(85));this.updater.enqueueSetState(this,e,t,"setState")};ds.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pv(){}Pv.prototype=ds.prototype;function qf(e,t,n){this.props=e,this.context=t,this.refs=kv,this.updater=n||Tv}var Gf=qf.prototype=new Pv;Gf.constructor=qf;$f(Gf,ds.prototype);Gf.isPureReactComponent=!0;var Yf={current:null},Rv=Object.prototype.hasOwnProperty,Av={key:!0,ref:!0,__self:!0,__source:!0};function Iv(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Rv.call(t,r)&&!Av.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:cs,type:e,key:s,ref:i,props:o,_owner:Yf.current}}function lP(e,t){return{$$typeof:cs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Qf(e){return typeof e=="object"&&e!==null&&e.$$typeof===cs}function uP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vv=/\/+/g;function Wf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?uP(""+e.key):t.toString(36)}function Yl(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case cs:case Sv:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+Wf(i,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace(vv,"$&/")+"/"),Yl(o,t,n,"",function(u){return u})):o!=null&&(Qf(o)&&(o=lP(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(vv,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Wf(s,a);i+=Yl(s,t,n,l,o)}else if(l=aP(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Wf(s,a++),i+=Yl(s,t,n,l,o);else if(s==="object")throw t=""+e,Error(Mi(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return i}function Gl(e,t,n){if(e==null)return e;var r=[],o=0;return Yl(e,r,"","",function(s){return t.call(n,s,o++)}),r}function cP(e){if(e._status===-1){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(n){e._status===0&&(n=n.default,e._status=1,e._result=n)},function(n){e._status===0&&(e._status=2,e._result=n)})}if(e._status===1)return e._result;throw e._result}var Lv={current:null};function Bn(){var e=Lv.current;if(e===null)throw Error(Mi(321));return e}var dP={ReactCurrentDispatcher:Lv,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:Yf,IsSomeRendererActing:{current:!1},assign:$f};ne.Children={map:Gl,forEach:function(e,t,n){Gl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gl(e,function(){t++}),t},toArray:function(e){return Gl(e,function(t){return t})||[]},only:function(e){if(!Qf(e))throw Error(Mi(143));return e}};ne.Component=ds;ne.PureComponent=qf;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dP;ne.cloneElement=function(e,t,n){if(e==null)throw Error(Mi(267,e));var r=$f({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Yf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Rv.call(t,l)&&!Av.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:cs,type:e.type,key:o,ref:s,props:r,_owner:i}};ne.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:wv,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:xv,_context:e},e.Consumer=e};ne.createElement=Iv;ne.createFactory=function(e){var t=Iv.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Ev,render:e}};ne.isValidElement=Qf;ne.lazy=function(e){return{$$typeof:Cv,_payload:{_status:-1,_result:e},_init:cP}};ne.memo=function(e,t){return{$$typeof:bv,type:e,compare:t===void 0?null:t}};ne.useCallback=function(e,t){return Bn().useCallback(e,t)};ne.useContext=function(e,t){return Bn().useContext(e,t)};ne.useDebugValue=function(){};ne.useEffect=function(e,t){return Bn().useEffect(e,t)};ne.useImperativeHandle=function(e,t,n){return Bn().useImperativeHandle(e,t,n)};ne.useLayoutEffect=function(e,t){return Bn().useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Bn().useMemo(e,t)};ne.useReducer=function(e,t,n){return Bn().useReducer(e,t,n)};ne.useRef=function(e){return Bn().useRef(e)};ne.useState=function(e){return Bn().useState(e)};ne.version="17.0.2"});var D=Re((C_,Nv)=>{"use strict";Nv.exports=Ov()});var Hv=Re(Di=>{"use strict";ql();var fP=D(),Dv=60103;Di.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Xf=Symbol.for,Dv=Xf("react.element"),Di.Fragment=Xf("react.fragment"));var Xf,pP=fP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mP=Object.prototype.hasOwnProperty,gP={key:!0,ref:!0,__self:!0,__source:!0};function Fv(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)mP.call(t,r)&&!gP.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Dv,type:e,key:s,ref:i,props:o,_owner:pP.current}}Di.jsx=Fv;Di.jsxs=Fv});var C=Re((O_,Uv)=>{"use strict";Uv.exports=Hv()});var u0=Re(ie=>{"use strict";var hs,Ui,uu,ap;typeof performance=="object"&&typeof performance.now=="function"?(o0=performance,ie.unstable_now=function(){return o0.now()}):(tp=Date,s0=tp.now(),ie.unstable_now=function(){return tp.now()-s0});var o0,tp,s0;typeof window=="undefined"||typeof MessageChannel!="function"?(gs=null,np=null,rp=function(){if(gs!==null)try{var e=ie.unstable_now();gs(!0,e),gs=null}catch(t){throw setTimeout(rp,0),t}},hs=function(e){gs!==null?setTimeout(hs,0,e):(gs=e,setTimeout(rp,0))},Ui=function(e,t){np=setTimeout(e,t)},uu=function(){clearTimeout(np)},ie.unstable_shouldYield=function(){return!1},ap=ie.unstable_forceFrameRate=function(){}):(i0=window.setTimeout,a0=window.clearTimeout,typeof console!="undefined"&&(l0=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof l0!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),Fi=!1,Hi=null,iu=-1,op=5,sp=0,ie.unstable_shouldYield=function(){return ie.unstable_now()>=sp},ap=function(){},ie.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):op=0<e?Math.floor(1e3/e):5},ip=new MessageChannel,au=ip.port2,ip.port1.onmessage=function(){if(Hi!==null){var e=ie.unstable_now();sp=e+op;try{Hi(!0,e)?au.postMessage(null):(Fi=!1,Hi=null)}catch(t){throw au.postMessage(null),t}}else Fi=!1},hs=function(e){Hi=e,Fi||(Fi=!0,au.postMessage(null))},Ui=function(e,t){iu=i0(function(){e(ie.unstable_now())},t)},uu=function(){a0(iu),iu=-1});var gs,np,rp,i0,a0,l0,Fi,Hi,iu,op,sp,ip,au;function lp(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<lu(o,t))e[r]=t,e[n]=o,n=r;else break e}}function an(e){return e=e[0],e===void 0?null:e}function cu(e){var t=e[0];if(t!==void 0){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var s=2*(r+1)-1,i=e[s],a=s+1,l=e[a];if(i!==void 0&&0>lu(i,n))l!==void 0&&0>lu(l,i)?(e[r]=l,e[a]=n,r=a):(e[r]=i,e[s]=n,r=s);else if(l!==void 0&&0>lu(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function lu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var Tn=[],br=[],NP=1,Bt=null,Ze=3,du=!1,po=!1,zi=!1;function up(e){for(var t=an(br);t!==null;){if(t.callback===null)cu(br);else if(t.startTime<=e)cu(br),t.sortIndex=t.expirationTime,lp(Tn,t);else break;t=an(br)}}function cp(e){if(zi=!1,up(e),!po)if(an(Tn)!==null)po=!0,hs(dp);else{var t=an(br);t!==null&&Ui(cp,t.startTime-e)}}function dp(e,t){po=!1,zi&&(zi=!1,uu()),du=!0;var n=Ze;try{for(up(t),Bt=an(Tn);Bt!==null&&(!(Bt.expirationTime>t)||e&&!ie.unstable_shouldYield());){var r=Bt.callback;if(typeof r=="function"){Bt.callback=null,Ze=Bt.priorityLevel;var o=r(Bt.expirationTime<=t);t=ie.unstable_now(),typeof o=="function"?Bt.callback=o:Bt===an(Tn)&&cu(Tn),up(t)}else cu(Tn);Bt=an(Tn)}if(Bt!==null)var s=!0;else{var i=an(br);i!==null&&Ui(cp,i.startTime-t),s=!1}return s}finally{Bt=null,Ze=n,du=!1}}var MP=ap;ie.unstable_IdlePriority=5;ie.unstable_ImmediatePriority=1;ie.unstable_LowPriority=4;ie.unstable_NormalPriority=3;ie.unstable_Profiling=null;ie.unstable_UserBlockingPriority=2;ie.unstable_cancelCallback=function(e){e.callback=null};ie.unstable_continueExecution=function(){po||du||(po=!0,hs(dp))};ie.unstable_getCurrentPriorityLevel=function(){return Ze};ie.unstable_getFirstCallbackNode=function(){return an(Tn)};ie.unstable_next=function(e){switch(Ze){case 1:case 2:case 3:var t=3;break;default:t=Ze}var n=Ze;Ze=t;try{return e()}finally{Ze=n}};ie.unstable_pauseExecution=function(){};ie.unstable_requestPaint=MP;ie.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ze;Ze=e;try{return t()}finally{Ze=n}};ie.unstable_scheduleCallback=function(e,t,n){var r=ie.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:NP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,lp(br,e),an(Tn)===null&&e===an(br)&&(zi?uu():zi=!0,Ui(cp,n-r))):(e.sortIndex=o,lp(Tn,e),po||du||(po=!0,hs(dp))),e};ie.unstable_wrapCallback=function(e){var t=Ze;return function(){var n=Ze;Ze=t;try{return e.apply(this,arguments)}finally{Ze=n}}}});var d0=Re((Z2,c0)=>{"use strict";c0.exports=u0()});var Xx=Re(Gt=>{"use strict";var oc=D(),Ee=ql(),ze=d0();function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!oc)throw Error(O(227));var CS=new Set,ha={};function Co(e,t){Fs(e,t),Fs(e+"Capture",t)}function Fs(e,t){for(ha[e]=t,e=0;e<t.length;e++)CS.add(t[e])}var Yn=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),_P=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f0=Object.prototype.hasOwnProperty,p0={},m0={};function DP(e){return f0.call(m0,e)?!0:f0.call(p0,e)?!1:_P.test(e)?m0[e]=!0:(p0[e]=!0,!1)}function FP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function HP(e,t,n,r){if(t===null||typeof t=="undefined"||FP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function lt(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var We={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){We[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];We[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){We[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){We[e]=new lt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){We[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){We[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){We[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){We[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){We[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var xm=/[\-:]([a-z])/g;function wm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){We[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});We.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){We[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Em(e,t,n,r){var o=We.hasOwnProperty(t)?We[t]:null,s=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(HP(t,n,o,r)&&(n=null),r||o===null?DP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var To=oc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ji=60103,go=60106,Tr=60107,bm=60108,oa=60114,Cm=60109,Tm=60110,sc=60112,sa=60113,_u=60120,ic=60115,km=60116,Pm=60121,Rm=60128,TS=60129,Am=60130,Mp=60131;typeof Symbol=="function"&&Symbol.for&&(Ne=Symbol.for,Ji=Ne("react.element"),go=Ne("react.portal"),Tr=Ne("react.fragment"),bm=Ne("react.strict_mode"),oa=Ne("react.profiler"),Cm=Ne("react.provider"),Tm=Ne("react.context"),sc=Ne("react.forward_ref"),sa=Ne("react.suspense"),_u=Ne("react.suspense_list"),ic=Ne("react.memo"),km=Ne("react.lazy"),Pm=Ne("react.block"),Ne("react.scope"),Rm=Ne("react.opaque.id"),TS=Ne("react.debug_trace_mode"),Am=Ne("react.offscreen"),Mp=Ne("react.legacy_hidden"));var Ne,g0=typeof Symbol=="function"&&Symbol.iterator;function ji(e){return e===null||typeof e!="object"?null:(e=g0&&e[g0]||e["@@iterator"],typeof e=="function"?e:null)}var fp;function ea(e){if(fp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fp=t&&t[1]||""}return`
1
+ "use strict";var Deepdesk=(()=>{var Qk=Object.create;var Ni=Object.defineProperty,Xk=Object.defineProperties,Zk=Object.getOwnPropertyDescriptor,Jk=Object.getOwnPropertyDescriptors,eP=Object.getOwnPropertyNames,Wl=Object.getOwnPropertySymbols,tP=Object.getPrototypeOf,Kf=Object.prototype.hasOwnProperty,pv=Object.prototype.propertyIsEnumerable;var fv=(e,t,n)=>t in e?Ni(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Kf.call(t,n)&&fv(e,n,t[n]);if(Wl)for(var n of Wl(t))pv.call(t,n)&&fv(e,n,t[n]);return e},I=(e,t)=>Xk(e,Jk(t));var ee=(e,t)=>{var n={};for(var r in e)Kf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Wl)for(var r of Wl(e))t.indexOf(r)<0&&pv.call(e,r)&&(n[r]=e[r]);return n};var Re=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Xe=(e,t)=>{for(var n in t)Ni(e,n,{get:t[n],enumerable:!0})},mv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of eP(t))!Kf.call(e,o)&&o!==n&&Ni(e,o,{get:()=>t[o],enumerable:!(r=Zk(t,o))||r.enumerable});return e};var x=(e,t,n)=>(n=e!=null?Qk(tP(e)):{},mv(t||!e||!e.__esModule?Ni(n,"default",{value:e,enumerable:!0}):n,e)),nP=e=>mv(Ni({},"__esModule",{value:!0}),e);var P=(e,t,n)=>new Promise((r,o)=>{var s=l=>{try{a(n.next(l))}catch(u){o(u)}},i=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,i);a((n=n.apply(e,t)).next())});var se=Re((x_,$l)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var s=arguments[o];if(s){var i=typeof s;if(i==="string"||i==="number")r.push(s);else if(Array.isArray(s)){if(s.length){var a=n.apply(null,s);a&&r.push(a)}}else if(i==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){r.push(s.toString());continue}for(var l in s)e.call(s,l)&&s[l]&&r.push(l)}}}return r.join(" ")}typeof $l!="undefined"&&$l.exports?(n.default=n,$l.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var ql=Re((w_,hv)=>{"use strict";var gv=Object.getOwnPropertySymbols,rP=Object.prototype.hasOwnProperty,oP=Object.prototype.propertyIsEnumerable;function sP(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function iP(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(s){return t[s]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(s){o[s]=s}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch(s){return!1}}hv.exports=iP()?Object.assign:function(e,t){for(var n,r=sP(e),o,s=1;s<arguments.length;s++){n=Object(arguments[s]);for(var i in n)rP.call(n,i)&&(r[i]=n[i]);if(gv){o=gv(n);for(var a=0;a<o.length;a++)oP.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var Ov=Re(ne=>{"use strict";var $f=ql(),cs=60103,Sv=60106;ne.Fragment=60107;ne.StrictMode=60108;ne.Profiler=60114;var xv=60109,wv=60110,Ev=60112;ne.Suspense=60113;var bv=60115,Cv=60116;typeof Symbol=="function"&&Symbol.for&&(zt=Symbol.for,cs=zt("react.element"),Sv=zt("react.portal"),ne.Fragment=zt("react.fragment"),ne.StrictMode=zt("react.strict_mode"),ne.Profiler=zt("react.profiler"),xv=zt("react.provider"),wv=zt("react.context"),Ev=zt("react.forward_ref"),ne.Suspense=zt("react.suspense"),bv=zt("react.memo"),Cv=zt("react.lazy"));var zt,yv=typeof Symbol=="function"&&Symbol.iterator;function aP(e){return e===null||typeof e!="object"?null:(e=yv&&e[yv]||e["@@iterator"],typeof e=="function"?e:null)}function Mi(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Tv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},kv={};function ds(e,t,n){this.props=e,this.context=t,this.refs=kv,this.updater=n||Tv}ds.prototype.isReactComponent={};ds.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(Mi(85));this.updater.enqueueSetState(this,e,t,"setState")};ds.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Pv(){}Pv.prototype=ds.prototype;function qf(e,t,n){this.props=e,this.context=t,this.refs=kv,this.updater=n||Tv}var Gf=qf.prototype=new Pv;Gf.constructor=qf;$f(Gf,ds.prototype);Gf.isPureReactComponent=!0;var Yf={current:null},Rv=Object.prototype.hasOwnProperty,Av={key:!0,ref:!0,__self:!0,__source:!0};function Iv(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)Rv.call(t,r)&&!Av.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:cs,type:e,key:s,ref:i,props:o,_owner:Yf.current}}function lP(e,t){return{$$typeof:cs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Qf(e){return typeof e=="object"&&e!==null&&e.$$typeof===cs}function uP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var vv=/\/+/g;function Wf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?uP(""+e.key):t.toString(36)}function Yl(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case cs:case Sv:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+Wf(i,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace(vv,"$&/")+"/"),Yl(o,t,n,"",function(u){return u})):o!=null&&(Qf(o)&&(o=lP(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(vv,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+Wf(s,a);i+=Yl(s,t,n,l,o)}else if(l=aP(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+Wf(s,a++),i+=Yl(s,t,n,l,o);else if(s==="object")throw t=""+e,Error(Mi(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return i}function Gl(e,t,n){if(e==null)return e;var r=[],o=0;return Yl(e,r,"","",function(s){return t.call(n,s,o++)}),r}function cP(e){if(e._status===-1){var t=e._result;t=t(),e._status=0,e._result=t,t.then(function(n){e._status===0&&(n=n.default,e._status=1,e._result=n)},function(n){e._status===0&&(e._status=2,e._result=n)})}if(e._status===1)return e._result;throw e._result}var Lv={current:null};function Bn(){var e=Lv.current;if(e===null)throw Error(Mi(321));return e}var dP={ReactCurrentDispatcher:Lv,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:Yf,IsSomeRendererActing:{current:!1},assign:$f};ne.Children={map:Gl,forEach:function(e,t,n){Gl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Gl(e,function(){t++}),t},toArray:function(e){return Gl(e,function(t){return t})||[]},only:function(e){if(!Qf(e))throw Error(Mi(143));return e}};ne.Component=ds;ne.PureComponent=qf;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dP;ne.cloneElement=function(e,t,n){if(e==null)throw Error(Mi(267,e));var r=$f({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=Yf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Rv.call(t,l)&&!Av.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:cs,type:e.type,key:o,ref:s,props:r,_owner:i}};ne.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:wv,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:xv,_context:e},e.Consumer=e};ne.createElement=Iv;ne.createFactory=function(e){var t=Iv.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:Ev,render:e}};ne.isValidElement=Qf;ne.lazy=function(e){return{$$typeof:Cv,_payload:{_status:-1,_result:e},_init:cP}};ne.memo=function(e,t){return{$$typeof:bv,type:e,compare:t===void 0?null:t}};ne.useCallback=function(e,t){return Bn().useCallback(e,t)};ne.useContext=function(e,t){return Bn().useContext(e,t)};ne.useDebugValue=function(){};ne.useEffect=function(e,t){return Bn().useEffect(e,t)};ne.useImperativeHandle=function(e,t,n){return Bn().useImperativeHandle(e,t,n)};ne.useLayoutEffect=function(e,t){return Bn().useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Bn().useMemo(e,t)};ne.useReducer=function(e,t,n){return Bn().useReducer(e,t,n)};ne.useRef=function(e){return Bn().useRef(e)};ne.useState=function(e){return Bn().useState(e)};ne.version="17.0.2"});var D=Re((b_,Nv)=>{"use strict";Nv.exports=Ov()});var Hv=Re(Di=>{"use strict";ql();var fP=D(),Dv=60103;Di.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Xf=Symbol.for,Dv=Xf("react.element"),Di.Fragment=Xf("react.fragment"));var Xf,pP=fP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,mP=Object.prototype.hasOwnProperty,gP={key:!0,ref:!0,__self:!0,__source:!0};function Fv(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)mP.call(t,r)&&!gP.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Dv,type:e,key:s,ref:i,props:o,_owner:pP.current}}Di.jsx=Fv;Di.jsxs=Fv});var C=Re((L_,Uv)=>{"use strict";Uv.exports=Hv()});var u0=Re(ie=>{"use strict";var hs,Ui,uu,ap;typeof performance=="object"&&typeof performance.now=="function"?(o0=performance,ie.unstable_now=function(){return o0.now()}):(tp=Date,s0=tp.now(),ie.unstable_now=function(){return tp.now()-s0});var o0,tp,s0;typeof window=="undefined"||typeof MessageChannel!="function"?(gs=null,np=null,rp=function(){if(gs!==null)try{var e=ie.unstable_now();gs(!0,e),gs=null}catch(t){throw setTimeout(rp,0),t}},hs=function(e){gs!==null?setTimeout(hs,0,e):(gs=e,setTimeout(rp,0))},Ui=function(e,t){np=setTimeout(e,t)},uu=function(){clearTimeout(np)},ie.unstable_shouldYield=function(){return!1},ap=ie.unstable_forceFrameRate=function(){}):(i0=window.setTimeout,a0=window.clearTimeout,typeof console!="undefined"&&(l0=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof l0!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),Fi=!1,Hi=null,iu=-1,op=5,sp=0,ie.unstable_shouldYield=function(){return ie.unstable_now()>=sp},ap=function(){},ie.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):op=0<e?Math.floor(1e3/e):5},ip=new MessageChannel,au=ip.port2,ip.port1.onmessage=function(){if(Hi!==null){var e=ie.unstable_now();sp=e+op;try{Hi(!0,e)?au.postMessage(null):(Fi=!1,Hi=null)}catch(t){throw au.postMessage(null),t}}else Fi=!1},hs=function(e){Hi=e,Fi||(Fi=!0,au.postMessage(null))},Ui=function(e,t){iu=i0(function(){e(ie.unstable_now())},t)},uu=function(){a0(iu),iu=-1});var gs,np,rp,i0,a0,l0,Fi,Hi,iu,op,sp,ip,au;function lp(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<lu(o,t))e[r]=t,e[n]=o,n=r;else break e}}function an(e){return e=e[0],e===void 0?null:e}function cu(e){var t=e[0];if(t!==void 0){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length;r<o;){var s=2*(r+1)-1,i=e[s],a=s+1,l=e[a];if(i!==void 0&&0>lu(i,n))l!==void 0&&0>lu(l,i)?(e[r]=l,e[a]=n,r=a):(e[r]=i,e[s]=n,r=s);else if(l!==void 0&&0>lu(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function lu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var Tn=[],br=[],NP=1,Bt=null,Ze=3,du=!1,po=!1,zi=!1;function up(e){for(var t=an(br);t!==null;){if(t.callback===null)cu(br);else if(t.startTime<=e)cu(br),t.sortIndex=t.expirationTime,lp(Tn,t);else break;t=an(br)}}function cp(e){if(zi=!1,up(e),!po)if(an(Tn)!==null)po=!0,hs(dp);else{var t=an(br);t!==null&&Ui(cp,t.startTime-e)}}function dp(e,t){po=!1,zi&&(zi=!1,uu()),du=!0;var n=Ze;try{for(up(t),Bt=an(Tn);Bt!==null&&(!(Bt.expirationTime>t)||e&&!ie.unstable_shouldYield());){var r=Bt.callback;if(typeof r=="function"){Bt.callback=null,Ze=Bt.priorityLevel;var o=r(Bt.expirationTime<=t);t=ie.unstable_now(),typeof o=="function"?Bt.callback=o:Bt===an(Tn)&&cu(Tn),up(t)}else cu(Tn);Bt=an(Tn)}if(Bt!==null)var s=!0;else{var i=an(br);i!==null&&Ui(cp,i.startTime-t),s=!1}return s}finally{Bt=null,Ze=n,du=!1}}var MP=ap;ie.unstable_IdlePriority=5;ie.unstable_ImmediatePriority=1;ie.unstable_LowPriority=4;ie.unstable_NormalPriority=3;ie.unstable_Profiling=null;ie.unstable_UserBlockingPriority=2;ie.unstable_cancelCallback=function(e){e.callback=null};ie.unstable_continueExecution=function(){po||du||(po=!0,hs(dp))};ie.unstable_getCurrentPriorityLevel=function(){return Ze};ie.unstable_getFirstCallbackNode=function(){return an(Tn)};ie.unstable_next=function(e){switch(Ze){case 1:case 2:case 3:var t=3;break;default:t=Ze}var n=Ze;Ze=t;try{return e()}finally{Ze=n}};ie.unstable_pauseExecution=function(){};ie.unstable_requestPaint=MP;ie.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ze;Ze=e;try{return t()}finally{Ze=n}};ie.unstable_scheduleCallback=function(e,t,n){var r=ie.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?r+n:r):n=r,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return o=n+o,e={id:NP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,lp(br,e),an(Tn)===null&&e===an(br)&&(zi?uu():zi=!0,Ui(cp,n-r))):(e.sortIndex=o,lp(Tn,e),po||du||(po=!0,hs(dp))),e};ie.unstable_wrapCallback=function(e){var t=Ze;return function(){var n=Ze;Ze=t;try{return e.apply(this,arguments)}finally{Ze=n}}}});var d0=Re((X2,c0)=>{"use strict";c0.exports=u0()});var Xx=Re(Gt=>{"use strict";var oc=D(),Ee=ql(),ze=d0();function O(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!oc)throw Error(O(227));var CS=new Set,ha={};function Co(e,t){Fs(e,t),Fs(e+"Capture",t)}function Fs(e,t){for(ha[e]=t,e=0;e<t.length;e++)CS.add(t[e])}var Yn=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),_P=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,f0=Object.prototype.hasOwnProperty,p0={},m0={};function DP(e){return f0.call(m0,e)?!0:f0.call(p0,e)?!1:_P.test(e)?m0[e]=!0:(p0[e]=!0,!1)}function FP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function HP(e,t,n,r){if(t===null||typeof t=="undefined"||FP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function lt(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var We={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){We[e]=new lt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];We[t]=new lt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){We[e]=new lt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){We[e]=new lt(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){We[e]=new lt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){We[e]=new lt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){We[e]=new lt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){We[e]=new lt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){We[e]=new lt(e,5,!1,e.toLowerCase(),null,!1,!1)});var xm=/[\-:]([a-z])/g;function wm(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(xm,wm);We[t]=new lt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){We[e]=new lt(e,1,!1,e.toLowerCase(),null,!1,!1)});We.xlinkHref=new lt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){We[e]=new lt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Em(e,t,n,r){var o=We.hasOwnProperty(t)?We[t]:null,s=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(HP(t,n,o,r)&&(n=null),r||o===null?DP(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var To=oc.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ji=60103,go=60106,Tr=60107,bm=60108,oa=60114,Cm=60109,Tm=60110,sc=60112,sa=60113,_u=60120,ic=60115,km=60116,Pm=60121,Rm=60128,TS=60129,Am=60130,Mp=60131;typeof Symbol=="function"&&Symbol.for&&(Ne=Symbol.for,Ji=Ne("react.element"),go=Ne("react.portal"),Tr=Ne("react.fragment"),bm=Ne("react.strict_mode"),oa=Ne("react.profiler"),Cm=Ne("react.provider"),Tm=Ne("react.context"),sc=Ne("react.forward_ref"),sa=Ne("react.suspense"),_u=Ne("react.suspense_list"),ic=Ne("react.memo"),km=Ne("react.lazy"),Pm=Ne("react.block"),Ne("react.scope"),Rm=Ne("react.opaque.id"),TS=Ne("react.debug_trace_mode"),Am=Ne("react.offscreen"),Mp=Ne("react.legacy_hidden"));var Ne,g0=typeof Symbol=="function"&&Symbol.iterator;function ji(e){return e===null||typeof e!="object"?null:(e=g0&&e[g0]||e["@@iterator"],typeof e=="function"?e:null)}var fp;function ea(e){if(fp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);fp=t&&t[1]||""}return`
2
2
  `+fp+e}var pp=!1;function fu(e,t){if(!e||pp)return"";pp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(l){var r=l}Reflect.construct(e,[],t)}else{try{t.call()}catch(l){r=l}e.call(t.prototype)}else{try{throw Error()}catch(l){r=l}e()}}catch(l){if(l&&r&&typeof l.stack=="string"){for(var o=l.stack.split(`
3
3
  `),s=r.stack.split(`
4
4
  `),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a])return`
@@ -6,27 +6,27 @@
6
6
  Error generating stack: `+s.message+`
7
7
  `+s.stack}return{value:e,source:t,stack:o}}function um(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var iA=typeof WeakMap=="function"?WeakMap:Map;function Hx(e,t,n){n=Or(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nc||(nc=!0,gm=r),um(e,t)},n}function Ux(e,t,n){n=Or(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return um(e,t),r(o)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Rn===null?Rn=new Set([this]):Rn.add(this),um(e,t));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}var aA=typeof WeakSet=="function"?WeakSet:Set;function gS(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Dr(e,n)}else t.current=null}function lA(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:ln(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&Vm(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(O(163))}function uA(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&&(Gx(n,e),yA(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:ln(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&Q0(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}Q0(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&cx(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&&VS(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(O(163))}function hS(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=OS("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 yS(e,t){if(xo&&typeof xo.onCommitFiberUnmount=="function")try{xo.onCommitFiberUnmount(Km,t)}catch(s){}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)Gx(t,n);else{r=t;try{o()}catch(s){Dr(r,s)}}n=n.next}while(n!==e)}break;case 1:if(gS(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(s){Dr(t,s)}break;case 5:gS(t);break;case 4:zx(e,t)}}function vS(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 SS(e){return e.tag===5||e.tag===3||e.tag===4}function xS(e){e:{for(var t=e.return;t!==null;){if(SS(t))break e;t=t.return}throw Error(O(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(O(161))}n.flags&16&&(ya(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||SS(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?cm(e,n,t):dm(e,n,t)}function cm(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=ju));else if(r!==4&&(e=e.child,e!==null))for(cm(e,t,n),e=e.sibling;e!==null;)cm(e,t,n),e=e.sibling}function dm(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(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function zx(e,t){for(var n=t,r=!1,o,s;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(O(160));switch(o=r.stateNode,r.tag){case 5:s=!1;break e;case 3:o=o.containerInfo,s=!0;break e;case 4:o=o.containerInfo,s=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var i=e,a=n,l=a;;)if(yS(i,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}s?(i=o,a=n.stateNode,i.nodeType===8?i.parentNode.removeChild(a):i.removeChild(a)):o.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){o=n.stateNode.containerInfo,s=!0,n.child.return=n,n=n.child;continue}}else if(yS(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 Ip(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 s=t.updateQueue;if(t.updateQueue=null,s!==null){for(n[Bu]=r,e==="input"&&r.type==="radio"&&r.name!=null&&RS(n,r),Vp(e,o),t=Vp(e,r),o=0;o<s.length;o+=2){var i=s[o],a=s[o+1];i==="style"?NS(n,a):i==="dangerouslySetInnerHTML"?LS(n,a):i==="children"?ya(n,a):Em(n,i,a,t)}switch(e){case"input":Dp(n,r);break;case"textarea":AS(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,s=r.value,s!=null?Rs(n,!!r.multiple,s,!1):e!==!!r.multiple&&(r.defaultValue!=null?Rs(n,!!r.multiple,r.defaultValue,!0):Rs(n,!!r.multiple,r.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(O(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:n=t.stateNode,n.hydrate&&(n.hydrate=!1,VS(n.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(sg=et(),hS(t.child,!0)),wS(t);return;case 19:wS(t);return;case 17:return;case 23:case 24:hS(t,t.memoizedState!==null);return}throw Error(O(163))}function wS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new aA),t.forEach(function(r){var o=xA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function cA(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var dA=Math.ceil,tc=To.ReactCurrentDispatcher,rg=To.ReactCurrentOwner,$=0,at=null,Me=null,tt=0,bo=0,fm=Br(0),Ke=0,gc=null,Vs=0,Na=0,Ks=0,og=0,pm=null,sg=0,mm=1/0;function Ws(){mm=et()+500}var F=null,nc=!1,gm=null,Rn=null,zr=!1,pa=null,na=90,hm=[],ym=[],Gn=null,ma=0,vm=null,Lu=-1,Wn=0,Ou=0,ga=null,Nu=!1;function At(){return $&48?et():Lu!==-1?Lu:Lu=et()}function Mr(e){if(e=e.mode,!(e&2))return 1;if(!(e&4))return Us()===99?1:2;if(Wn===0&&(Wn=Vs),ZR.transition!==0){Ou!==0&&(Ou=pm!==null?pm.pendingLanes:0),e=Wn;var t=4186112&~Ou;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=Us(),$&4&&e===98?e=Uu(12,Wn):(e=tR(e),e=Uu(e,Wn)),e}function _r(e,t,n){if(50<ma)throw ma=0,vm=null,Error(O(185));if(e=hc(e,t),e===null)return null;lc(e,t,n),e===at&&(Ks|=t,Ke===4&&Ms(e,tt));var r=Us();t===1?$&8&&!($&48)?Sm(e):(qt(e,n),$===0&&(Ws(),Ln())):(!($&4)||r!==98&&r!==99||(Gn===null?Gn=new Set([e]):Gn.add(e)),qt(e,n)),pm=e}function hc(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 qt(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-Hr(i),l=1<<a,u=s[a];if(u===-1){if(!(l&r)||l&o){u=t,Ss(l);var c=ge;s[a]=10<=c?u+250:6<=c?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);i&=~l}if(r=wa(e,e===at?tt:0),t=ge,r===0)n!==null&&(n!==Tp&&em(n),e.callbackNode=null,e.callbackPriority=0);else{if(n!==null){if(e.callbackPriority===t)return;n!==Tp&&em(n)}t===15?(n=Sm.bind(null,e),Kn===null?(Kn=[n],Iu=Wm(pc,vx)):Kn.push(n),n=Tp):t===14?n=Ta(99,Sm.bind(null,e)):(n=nR(t),n=Ta(n,jx.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function jx(e){if(Lu=-1,Ou=Wn=0,$&48)throw Error(O(327));var t=e.callbackNode;if(Vr()&&e.callbackNode!==t)return null;var n=wa(e,e===at?tt:0);if(n===0)return null;var r=n,o=$;$|=16;var s=Wx();(at!==e||tt!==r)&&(Ws(),_s(e,r));do try{mA();break}catch(a){Kx(e,a)}while(1);if($m(),tc.current=s,$=o,Me!==null?r=0:(at=null,tt=0,r=Ke),Vs&Ks)_s(e,0);else if(r!==0){if(r===2&&($|=64,e.hydrate&&(e.hydrate=!1,Vm(e.containerInfo)),n=QS(e),n!==0&&(r=ra(e,n))),r===1)throw t=gc,_s(e,0),Ms(e,n),qt(e,et()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(O(345));case 2:mo(e);break;case 3:if(Ms(e,n),(n&62914560)===n&&(r=sg+500-et(),10<r)){if(wa(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){At(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=B0(mo.bind(null,e),r);break}mo(e);break;case 4:if(Ms(e,n),(n&4186112)===n)break;for(r=e.eventTimes,o=-1;0<n;){var i=31-Hr(n);s=1<<i,i=r[i],i>o&&(o=i),n&=~s}if(n=o,n=et()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*dA(n/1960))-n,10<n){e.timeoutHandle=B0(mo.bind(null,e),n);break}mo(e);break;case 5:mo(e);break;default:throw Error(O(329))}}return qt(e,et()),e.callbackNode===t?jx.bind(null,e):null}function Ms(e,t){for(t&=~og,t&=~Ks,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Hr(t),r=1<<n;e[n]=-1,t&=~r}}function Sm(e){if($&48)throw Error(O(327));if(Vr(),e===at&&e.expiredLanes&tt){var t=tt,n=ra(e,t);Vs&Ks&&(t=wa(e,t),n=ra(e,t))}else t=wa(e,0),n=ra(e,t);if(e.tag!==0&&n===2&&($|=64,e.hydrate&&(e.hydrate=!1,Vm(e.containerInfo)),t=QS(e),t!==0&&(n=ra(e,t))),n===1)throw n=gc,_s(e,0),Ms(e,t),qt(e,et()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,mo(e),qt(e,et()),null}function fA(){if(Gn!==null){var e=Gn;Gn=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,qt(t,et())})}Ln()}function Bx(e,t){var n=$;$|=1;try{return e(t)}finally{$=n,$===0&&(Ws(),Ln())}}function Vx(e,t){var n=$;$&=-2,$|=8;try{return e(t)}finally{$=n,$===0&&(Ws(),Ln())}}function Cu(e,t){ke(fm,bo),bo|=t,Vs|=t}function ig(){bo=fm.current,Se(fm)}function _s(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$R(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&Vu();break;case 3:zs(),Se(Tt),Se(nt),Qm();break;case 5:Ym(r);break;case 4:zs();break;case 13:Se(Te);break;case 19:Se(Te);break;case 10:qm(r);break;case 23:case 24:ig()}n=n.return}at=e,Me=jr(e.current,null),tt=bo=Vs=t,Ke=0,gc=null,og=Ks=Na=0}function Kx(e,t){do{var n=Me;try{if($m(),da.current=ec,Qu){for(var r=Ae.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Qu=!1}if(Aa=0,Ve=Je=Ae=null,fa=!1,rg.current=null,n===null||n.return===null){Ke=1,gc=t,Me=null;break}e:{var s=e,i=n.return,a=n,l=t;if(t=tt,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=(Te.current&1)!==0,d=i;do{var g;if(g=d.tag===13){var y=d.memoizedState;if(y!==null)g=y.dehydrated!==null;else{var v=d.memoizedProps;g=v.fallback===void 0?!1:v.unstable_avoidThisFallback!==!0?!0:!f}}if(g){var p=d.updateQueue;if(p===null){var m=new Set;m.add(u),d.updateQueue=m}else p.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 h=Or(-1,1);h.tag=2,Nr(a,h)}a.lanes|=1;break e}l=void 0,a=t;var S=s.pingCache;if(S===null?(S=s.pingCache=new iA,l=new Set,S.set(u,l)):(l=S.get(u),l===void 0&&(l=new Set,S.set(u,l))),!l.has(a)){l.add(a);var w=SA.bind(null,s,u,a);u.then(w,w)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(d!==null);l=Error((Ps(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.`)}Ke!==5&&(Ke=2),l=ng(l,a),d=i;do{switch(d.tag){case 3:s=l,d.flags|=4096,t&=-t,d.lanes|=t;var k=Hx(d,s,t);Y0(d,k);break e;case 1:s=l;var b=d.type,R=d.stateNode;if(!(d.flags&64)&&(typeof b.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(Rn===null||!Rn.has(R)))){d.flags|=4096,t&=-t,d.lanes|=t;var N=Ux(d,s,t);Y0(d,N);break e}}d=d.return}while(d!==null)}qx(n)}catch(_){t=_,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(1)}function Wx(){var e=tc.current;return tc.current=ec,e===null?ec:e}function ra(e,t){var n=$;$|=16;var r=Wx();at===e&&tt===t||_s(e,t);do try{pA();break}catch(o){Kx(e,o)}while(1);if($m(),$=n,tc.current=r,Me!==null)throw Error(O(261));return at=null,tt=0,Ke}function pA(){for(;Me!==null;)$x(Me)}function mA(){for(;Me!==null&&!YR();)$x(Me)}function $x(e){var t=Yx(e.alternate,e,bo);e.memoizedProps=e.pendingProps,t===null?qx(e):Me=t,rg.current=null}function qx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=sA(t),n!==null){n.flags&=2047,Me=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=oA(n,t,bo),n!==null){Me=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||bo&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){Me=t;return}Me=t=e}while(t!==null);Ke===0&&(Ke=5)}function mo(e){var t=Us();return Eo(99,gA.bind(null,e,t)),null}function gA(e,t){do Vr();while(pa!==null);if($&48)throw Error(O(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(O(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,s=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 i=e.eventTimes,a=e.expirationTimes;0<s;){var l=31-Hr(s),u=1<<l;o[l]=0,i[l]=-1,a[l]=-1,s&=~u}if(Gn!==null&&!(r&24)&&Gn.has(e)&&Gn.delete(e),e===at&&(Me=at=null,tt=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=$,$|=32,rg.current=null,Ep=ku,i=D0(),Yp(i)){if("selectionStart"in i)a={start:i.selectionStart,end:i.selectionEnd};else e:if(a=(a=i.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,s=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,g=0,y=0,v=i,p=null;t:for(;;){for(var m;v!==a||s!==0&&v.nodeType!==3||(f=c+s),v!==l||u!==0&&v.nodeType!==3||(d=c+u),v.nodeType===3&&(c+=v.nodeValue.length),(m=v.firstChild)!==null;)p=v,v=m;for(;;){if(v===i)break t;if(p===a&&++g===s&&(f=c),p===l&&++y===u&&(d=c),(m=v.nextSibling)!==null)break;v=p,p=v.parentNode}v=m}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;bp={focusedElem:i,selectionRange:a},ku=!1,ga=null,Nu=!1,F=r;do try{hA()}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);ga=null,F=r;do try{for(i=e;F!==null;){var h=F.flags;if(h&16&&ya(F.stateNode,""),h&128){var S=F.alternate;if(S!==null){var w=S.ref;w!==null&&(typeof w=="function"?w(null):w.current=null)}}switch(h&1038){case 2:xS(F),F.flags&=-3;break;case 6:xS(F),F.flags&=-3,Ip(F.alternate,F);break;case 1024:F.flags&=-1025;break;case 1028:F.flags&=-1025,Ip(F.alternate,F);break;case 4:Ip(F.alternate,F);break;case 8:a=F,zx(i,a);var k=a.alternate;vS(a),k!==null&&vS(k)}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);if(w=bp,S=D0(),h=w.focusedElem,i=w.selectionRange,S!==h&&h&&h.ownerDocument&&ox(h.ownerDocument.documentElement,h)){for(i!==null&&Yp(h)&&(S=i.start,w=i.end,w===void 0&&(w=S),"selectionStart"in h?(h.selectionStart=S,h.selectionEnd=Math.min(w,h.value.length)):(w=(S=h.ownerDocument||document)&&S.defaultView||window,w.getSelection&&(w=w.getSelection(),a=h.textContent.length,k=Math.min(i.start,a),i=i.end===void 0?k:Math.min(i.end,a),!w.extend&&k>i&&(a=i,i=k,k=a),a=_0(h,k),s=_0(h,i),a&&s&&(w.rangeCount!==1||w.anchorNode!==a.node||w.anchorOffset!==a.offset||w.focusNode!==s.node||w.focusOffset!==s.offset)&&(S=S.createRange(),S.setStart(a.node,a.offset),w.removeAllRanges(),k>i?(w.addRange(S),w.extend(s.node,s.offset)):(S.setEnd(s.node,s.offset),w.addRange(S)))))),S=[],w=h;w=w.parentNode;)w.nodeType===1&&S.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<S.length;h++)w=S[h],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}ku=!!Ep,bp=Ep=null,e.current=n,F=r;do try{for(h=e;F!==null;){var b=F.flags;if(b&36&&uA(h,F.alternate,F),b&128){S=void 0;var R=F.ref;if(R!==null){var N=F.stateNode;switch(F.tag){case 5:S=N;break;default:S=N}typeof R=="function"?R(S):R.current=S}}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);F=null,XR(),$=o}else e.current=n;if(zr)zr=!1,pa=e,na=t;else for(F=r;F!==null;)t=F.nextEffect,F.nextEffect=null,F.flags&8&&(b=F,b.sibling=null,b.stateNode=null),F=t;if(r=e.pendingLanes,r===0&&(Rn=null),r===1?e===vm?ma++:(ma=0,vm=e):ma=0,n=n.stateNode,xo&&typeof xo.onCommitFiberRoot=="function")try{xo.onCommitFiberRoot(Km,n,void 0,(n.current.flags&64)===64)}catch(_){}if(qt(e,et()),nc)throw nc=!1,e=gm,gm=null,e;return $&8||Ln(),null}function hA(){for(;F!==null;){var e=F.alternate;Nu||ga===null||(F.flags&8?E0(F,ga)&&(Nu=!0):F.tag===13&&cA(e,F)&&E0(F,ga)&&(Nu=!0));var t=F.flags;t&256&&lA(e,F),!(t&512)||zr||(zr=!0,Ta(97,function(){return Vr(),null})),F=F.nextEffect}}function Vr(){if(na!==90){var e=97<na?97:na;return na=90,Eo(e,vA)}return!1}function yA(e,t){hm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function Gx(e,t){ym.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function vA(){if(pa===null)return!1;var e=pa;if(pa=null,$&48)throw Error(O(331));var t=$;$|=32;var n=ym;ym=[];for(var r=0;r<n.length;r+=2){var o=n[r],s=n[r+1],i=o.destroy;if(o.destroy=void 0,typeof i=="function")try{i()}catch(l){if(s===null)throw Error(O(330));Dr(s,l)}}for(n=hm,hm=[],r=0;r<n.length;r+=2){o=n[r],s=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(s===null)throw Error(O(330));Dr(s,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 $=t,Ln(),!0}function ES(e,t,n){t=ng(n,t),t=Hx(e,t,1),Nr(e,t),t=At(),e=hc(e,1),e!==null&&(lc(e,1,t),qt(e,t))}function Dr(e,t){if(e.tag===3)ES(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){ES(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){e=ng(t,e);var o=Ux(n,e,1);if(Nr(n,o),o=At(),n=hc(n,1),n!==null)lc(n,1,o),qt(n,o);else if(typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r)))try{r.componentDidCatch(t,e)}catch(s){}break}}n=n.return}}function SA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=At(),e.pingedLanes|=e.suspendedLanes&n,at===e&&(tt&n)===n&&(Ke===4||Ke===3&&(tt&62914560)===tt&&500>et()-sg?_s(e,0):og|=n),qt(e,t)}function xA(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Wn===0&&(Wn=Vs),t=xs(62914560&~Wn),t===0&&(t=4194304)):t=Us()===99?1:2:t=1),n=At(),e=hc(e,t),e!==null&&(lc(e,t,n),qt(e,n))}var Yx;Yx=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||Tt.current)un=!0;else if(n&r)un=!!(e.flags&16384);else{switch(un=!1,t.tag){case 3:lS(t),Pp();break;case 5:J0(t);break;case 1:kt(t.type)&&Au(t);break;case 4:rm(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;ke(Ku,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?uS(e,t,n):(ke(Te,Te.current&1),t=qn(e,t,n),t!==null?t.sibling:null);ke(Te,Te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return mS(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ke(Te,Te.current),r)break;return null;case 23:case 24:return t.lanes=0,Rp(e,t,n)}return qn(e,t,n)}else un=!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=Hs(t,nt.current),Os(t,n),o=Zm(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,kt(r)){var s=!0;Au(t)}else s=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Gm(t);var i=r.getDerivedStateFromProps;typeof i=="function"&&qu(t,r,i,e),o.updater=mc,t.stateNode=o,o._reactInternals=t,nm(t,r,e,n),t=am(null,t,r,!0,s,n)}else t.tag=0,Ct(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,s=o._init,o=s(o._payload),t.type=o,s=t.tag=EA(o),e=ln(o,e),s){case 0:t=im(null,t,o,e,n);break e;case 1:t=aS(null,t,o,e,n);break e;case 11:t=sS(null,t,o,e,n);break e;case 14:t=iS(null,t,o,ln(o.type,e),r,n);break e}throw Error(O(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),im(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),aS(e,t,r,o,n);case 3:if(lS(t),r=t.updateQueue,e===null||r===null)throw Error(O(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,xx(e,t),ka(t,r,null,n),r=t.memoizedState.element,r===o)Pp(),t=qn(e,t,n);else{if(o=t.stateNode,(s=o.hydrate)&&(Rr=Ls(t.stateNode.containerInfo.firstChild),$n=t,s=In=!0),s){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)s=e[o],s._workInProgressVersionPrimary=e[o+1],Ns.push(s);for(n=Cx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else Ct(e,t,r,n),Pp();t=t.child}return t;case 5:return J0(t),e===null&&om(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Zp(r,o)?i=null:s!==null&&Zp(r,s)&&(t.flags|=16),Mx(e,t),Ct(e,t,i,n),t.child;case 6:return e===null&&om(t),null;case 13:return uS(e,t,n);case 4:return rm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gu(t,null,r,n):Ct(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),sS(e,t,r,o,n);case 7:return Ct(e,t,t.pendingProps,n),t.child;case 8:return Ct(e,t,t.pendingProps.children,n),t.child;case 12:return Ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value;var a=t.type._context;if(ke(Ku,a._currentValue),a._currentValue=s,i!==null)if(a=i.value,s=Vt(a,s)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,s):1073741823)|0,s===0){if(i.children===o.children&&!Tt.current){t=qn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){i=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&s){a.tag===1&&(u=Or(-1,n&-n),u.tag=2,Nr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Sx(a.return,n),l.lanes|=n;break}u=u.next}}else i=a.tag===10&&a.type===t.type?null:a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Ct(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps,r=s.children,Os(t,n),o=$t(o,s.unstable_observedBits),r=r(o),t.flags|=1,Ct(e,t,r,n),t.child;case 14:return o=t.type,s=ln(o,t.pendingProps),s=ln(o.type,s),iS(e,t,o,s,r,n);case 15:return Nx(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,kt(r)?(e=!0,Au(t)):e=!1,Os(t,n),Ex(t,r,o),nm(t,r,o,n),am(null,t,r,!0,e,n);case 19:return mS(e,t,n);case 23:return Rp(e,t,n);case 24:return Rp(e,t,n)}throw Error(O(156,t.tag))};function wA(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 Kt(e,t,n,r){return new wA(e,t,n,r)}function ag(e){return e=e.prototype,!(!e||!e.isReactComponent)}function EA(e){if(typeof e=="function")return ag(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===ic)return 14}return 2}function jr(e,t){var n=e.alternate;return n===null?(n=Kt(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 Mu(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")ag(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Tr:return Ds(n.children,o,s,t);case TS:i=8,o|=16;break;case bm:i=8,o|=1;break;case oa:return e=Kt(12,n,t,o|8),e.elementType=oa,e.type=oa,e.lanes=s,e;case sa:return e=Kt(13,n,t,o),e.type=sa,e.elementType=sa,e.lanes=s,e;case _u:return e=Kt(19,n,t,o),e.elementType=_u,e.lanes=s,e;case Am:return lg(n,o,s,t);case Mp:return e=Kt(24,n,t,o),e.elementType=Mp,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cm:i=10;break e;case Tm:i=9;break e;case sc:i=11;break e;case ic:i=14;break e;case km:i=16,r=null;break e;case Pm:i=22;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Kt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Ds(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function lg(e,t,n,r){return e=Kt(23,e,r,t),e.elementType=Am,e.lanes=n,e}function Lp(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function Op(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bA(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=hp(0),this.expirationTimes=hp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hp(0),this.mutableSourceEagerHydrationData=null}function CA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:go,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function rc(e,t,n,r){var o=t.current,s=At(),i=Mr(o);e:if(n){n=n._reactInternals;t:{if(ko(n)!==n||n.tag!==1)throw Error(O(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(kt(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(O(171))}if(n.tag===1){var l=n.type;if(kt(l)){n=fx(n,l,a);break e}}n=a}else n=Ur;return t.context===null?t.context=n:t.pendingContext=n,t=Or(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Nr(o,t),_r(o,i,s),i}function Np(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 bS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ug(e,t){bS(e,t),(e=e.alternate)&&bS(e,t)}function TA(){return null}function cg(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new bA(e,t,n!=null&&n.hydrate===!0),t=Kt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Gm(t),e[Bs]=n.current,ax(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}cg.prototype.render=function(e){rc(e,this._internalRoot,null,null)};cg.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;rc(null,e,null,function(){t[Bs]=null})};function Ma(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function kA(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 cg(e,0,t?{hydrate:!0}:void 0)}function yc(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Np(i);a.call(u)}}rc(t,i,e,o)}else{if(s=n._reactRootContainer=kA(n,r),i=s._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Np(i);l.call(u)}}Vx(function(){rc(t,i,e,o)})}return Np(i)}zS=function(e){if(e.tag===13){var t=At();_r(e,4,t),ug(e,4)}};Mm=function(e){if(e.tag===13){var t=At();_r(e,67108864,t),ug(e,67108864)}};jS=function(e){if(e.tag===13){var t=At(),n=Mr(e);_r(e,n,t),ug(e,n)}};BS=function(e,t){return t()};Kp=function(e,t,n){switch(t){case"input":if(Dp(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=fc(r);if(!o)throw Error(O(90));PS(r),Dp(r,o)}}}break;case"textarea":AS(e,n);break;case"select":t=n.value,t!=null&&Rs(e,!!n.multiple,t,!1)}};Lm=Bx;DS=function(e,t,n,r,o){var s=$;$|=4;try{return Eo(98,e.bind(null,t,n,r,o))}finally{$=s,$===0&&(Ws(),Ln())}};Om=function(){!($&49)&&(fA(),Vr())};FS=function(e,t){var n=$;$|=2;try{return e(t)}finally{$=n,$===0&&(Ws(),Ln())}};function Qx(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(O(200));return CA(e,t,null,n)}var PA={Events:[La,Cs,fc,MS,_S,Vr,{current:!1}]},Xi={findFiberByHostInstance:yo,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},RA={bundleType:Xi.bundleType,version:Xi.version,rendererPackageName:Xi.rendererPackageName,rendererConfig:Xi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:To.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=US(e),e===null?null:e.stateNode},findFiberByHostInstance:Xi.findFiberByHostInstance||TA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Zi.isDisabled&&Zi.supportsFiber))try{Km=Zi.inject(RA),xo=Zi}catch(e){}var Zi;Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PA;Gt.createPortal=Qx;Gt.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(O(188)):Error(O(268,Object.keys(e)));return e=US(t),e=e===null?null:e.stateNode,e};Gt.flushSync=function(e,t){var n=$;if(n&48)return e(t);$|=1;try{if(e)return Eo(99,e.bind(null,t))}finally{$=n,Ln()}};Gt.hydrate=function(e,t,n){if(!Ma(t))throw Error(O(200));return yc(null,e,t,!0,n)};Gt.render=function(e,t,n){if(!Ma(t))throw Error(O(200));return yc(null,e,t,!1,n)};Gt.unmountComponentAtNode=function(e){if(!Ma(e))throw Error(O(40));return e._reactRootContainer?(Vx(function(){yc(null,null,e,!1,function(){e._reactRootContainer=null,e[Bs]=null})}),!0):!1};Gt.unstable_batchedUpdates=Bx;Gt.unstable_createPortal=function(e,t){return Qx(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ma(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return yc(e,t,n,!1,r)};Gt.version="17.0.2"});var vc=Re((eD,Jx)=>{"use strict";function Zx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zx)}catch(e){console.error(e)}}Zx(),Jx.exports=Xx()});var Pw=Re(kw=>{"use strict";var Xs=D();function fI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pI=typeof Object.is=="function"?Object.is:fI,mI=Xs.useState,gI=Xs.useEffect,hI=Xs.useLayoutEffect,yI=Xs.useDebugValue;function vI(e,t){var n=t(),r=mI({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return hI(function(){o.value=n,o.getSnapshot=t,Fg(o)&&s({inst:o})},[e,n,t]),gI(function(){return Fg(o)&&s({inst:o}),e(function(){Fg(o)&&s({inst:o})})},[e]),yI(n),n}function Fg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pI(e,n)}catch(r){return!0}}function SI(e,t){return t()}var xI=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?SI:vI;kw.useSyncExternalStore=Xs.useSyncExternalStore!==void 0?Xs.useSyncExternalStore:xI});var Hg=Re((jD,Rw)=>{"use strict";Rw.exports=Pw()});var Iw=Re(Aw=>{"use strict";var kc=D(),wI=Hg();function EI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bI=typeof Object.is=="function"?Object.is:EI,CI=wI.useSyncExternalStore,TI=kc.useRef,kI=kc.useEffect,PI=kc.useMemo,RI=kc.useDebugValue;Aw.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=TI(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=PI(function(){function l(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&i.hasValue){var y=i.value;if(o(y,g))return f=y}return f=g}if(y=f,bI(c,g))return y;var v=r(g);return o!==void 0&&o(y,v)?y:(c=g,f=v)}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=CI(e,s[0],s[1]);return kI(function(){i.hasValue=!0,i.value=a},[a]),RI(a),a}});var Ow=Re((VD,Lw)=>{"use strict";Lw.exports=Iw()});var Vw=Re(le=>{"use strict";var je=typeof Symbol=="function"&&Symbol.for,zg=je?Symbol.for("react.element"):60103,jg=je?Symbol.for("react.portal"):60106,Ic=je?Symbol.for("react.fragment"):60107,Lc=je?Symbol.for("react.strict_mode"):60108,Oc=je?Symbol.for("react.profiler"):60114,Nc=je?Symbol.for("react.provider"):60109,Mc=je?Symbol.for("react.context"):60110,Bg=je?Symbol.for("react.async_mode"):60111,_c=je?Symbol.for("react.concurrent_mode"):60111,Dc=je?Symbol.for("react.forward_ref"):60112,Fc=je?Symbol.for("react.suspense"):60113,OI=je?Symbol.for("react.suspense_list"):60120,Hc=je?Symbol.for("react.memo"):60115,Uc=je?Symbol.for("react.lazy"):60116,NI=je?Symbol.for("react.block"):60121,MI=je?Symbol.for("react.fundamental"):60117,_I=je?Symbol.for("react.responder"):60118,DI=je?Symbol.for("react.scope"):60119;function Ot(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case zg:switch(e=e.type,e){case Bg:case _c:case Ic:case Oc:case Lc:case Fc:return e;default:switch(e=e&&e.$$typeof,e){case Mc:case Dc:case Uc:case Hc:case Nc:return e;default:return t}}case jg:return t}}}function Bw(e){return Ot(e)===_c}le.AsyncMode=Bg;le.ConcurrentMode=_c;le.ContextConsumer=Mc;le.ContextProvider=Nc;le.Element=zg;le.ForwardRef=Dc;le.Fragment=Ic;le.Lazy=Uc;le.Memo=Hc;le.Portal=jg;le.Profiler=Oc;le.StrictMode=Lc;le.Suspense=Fc;le.isAsyncMode=function(e){return Bw(e)||Ot(e)===Bg};le.isConcurrentMode=Bw;le.isContextConsumer=function(e){return Ot(e)===Mc};le.isContextProvider=function(e){return Ot(e)===Nc};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===zg};le.isForwardRef=function(e){return Ot(e)===Dc};le.isFragment=function(e){return Ot(e)===Ic};le.isLazy=function(e){return Ot(e)===Uc};le.isMemo=function(e){return Ot(e)===Hc};le.isPortal=function(e){return Ot(e)===jg};le.isProfiler=function(e){return Ot(e)===Oc};le.isStrictMode=function(e){return Ot(e)===Lc};le.isSuspense=function(e){return Ot(e)===Fc};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ic||e===_c||e===Oc||e===Lc||e===Fc||e===OI||typeof e=="object"&&e!==null&&(e.$$typeof===Uc||e.$$typeof===Hc||e.$$typeof===Nc||e.$$typeof===Mc||e.$$typeof===Dc||e.$$typeof===MI||e.$$typeof===_I||e.$$typeof===DI||e.$$typeof===NI)};le.typeOf=Ot});var Ww=Re((r4,Kw)=>{"use strict";Kw.exports=Vw()});var Zw=Re((o4,Xw)=>{"use strict";var Vg=Ww(),FI={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},HI={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},UI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Kg={};Kg[Vg.ForwardRef]=UI;Kg[Vg.Memo]=Yw;function $w(e){return Vg.isMemo(e)?Yw:Kg[e.$$typeof]||FI}var zI=Object.defineProperty,jI=Object.getOwnPropertyNames,qw=Object.getOwnPropertySymbols,BI=Object.getOwnPropertyDescriptor,VI=Object.getPrototypeOf,Gw=Object.prototype;function Qw(e,t,n){if(typeof t!="string"){if(Gw){var r=VI(t);r&&r!==Gw&&Qw(e,r,n)}var o=jI(t);qw&&(o=o.concat(qw(t)));for(var s=$w(e),i=$w(t),a=0;a<o.length;++a){var l=o[a];if(!HI[l]&&!(n&&n[l])&&!(i&&i[l])&&!(s&&s[l])){var u=BI(t,l);try{zI(e,l,u)}catch(c){}}}}return e}Xw.exports=Qw});var e1=Re(ue=>{"use strict";var Wg=Symbol.for("react.element"),$g=Symbol.for("react.portal"),zc=Symbol.for("react.fragment"),jc=Symbol.for("react.strict_mode"),Bc=Symbol.for("react.profiler"),Vc=Symbol.for("react.provider"),Kc=Symbol.for("react.context"),KI=Symbol.for("react.server_context"),Wc=Symbol.for("react.forward_ref"),$c=Symbol.for("react.suspense"),qc=Symbol.for("react.suspense_list"),Gc=Symbol.for("react.memo"),Yc=Symbol.for("react.lazy"),WI=Symbol.for("react.offscreen"),Jw;Jw=Symbol.for("react.module.reference");function Qt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Wg:switch(e=e.type,e){case zc:case Bc:case jc:case $c:case qc:return e;default:switch(e=e&&e.$$typeof,e){case KI:case Kc:case Wc:case Yc:case Gc:case Vc:return e;default:return t}}case $g:return t}}}ue.ContextConsumer=Kc;ue.ContextProvider=Vc;ue.Element=Wg;ue.ForwardRef=Wc;ue.Fragment=zc;ue.Lazy=Yc;ue.Memo=Gc;ue.Portal=$g;ue.Profiler=Bc;ue.StrictMode=jc;ue.Suspense=$c;ue.SuspenseList=qc;ue.isAsyncMode=function(){return!1};ue.isConcurrentMode=function(){return!1};ue.isContextConsumer=function(e){return Qt(e)===Kc};ue.isContextProvider=function(e){return Qt(e)===Vc};ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wg};ue.isForwardRef=function(e){return Qt(e)===Wc};ue.isFragment=function(e){return Qt(e)===zc};ue.isLazy=function(e){return Qt(e)===Yc};ue.isMemo=function(e){return Qt(e)===Gc};ue.isPortal=function(e){return Qt(e)===$g};ue.isProfiler=function(e){return Qt(e)===Bc};ue.isStrictMode=function(e){return Qt(e)===jc};ue.isSuspense=function(e){return Qt(e)===$c};ue.isSuspenseList=function(e){return Qt(e)===qc};ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===zc||e===Bc||e===jc||e===$c||e===qc||e===WI||typeof e=="object"&&e!==null&&(e.$$typeof===Yc||e.$$typeof===Gc||e.$$typeof===Vc||e.$$typeof===Kc||e.$$typeof===Wc||e.$$typeof===Jw||e.getModuleId!==void 0)};ue.typeOf=Qt});var n1=Re((i4,t1)=>{"use strict";t1.exports=e1()});var wh=Re((V6,RE)=>{"use strict";var qL="Expected a function",kE=NaN,GL="[object Symbol]",YL=/^\s+|\s+$/g,QL=/^[-+]0x[0-9a-f]+$/i,XL=/^0b[01]+$/i,ZL=/^0o[0-7]+$/i,JL=parseInt,eO=typeof global=="object"&&global&&global.Object===Object&&global,tO=typeof self=="object"&&self&&self.Object===Object&&self,nO=eO||tO||Function("return this")(),rO=Object.prototype,oO=rO.toString,sO=Math.max,iO=Math.min,Sh=function(){return nO.Date.now()};function aO(e,t,n){var r,o,s,i,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(qL);t=PE(t)||0,xh(n)&&(c=!!n.leading,f="maxWait"in n,s=f?sO(PE(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function g(b){var R=r,N=o;return r=o=void 0,u=b,i=e.apply(N,R),i}function y(b){return u=b,a=setTimeout(m,t),c?g(b):i}function v(b){var R=b-l,N=b-u,_=t-R;return f?iO(_,s-N):_}function p(b){var R=b-l,N=b-u;return l===void 0||R>=t||R<0||f&&N>=s}function m(){var b=Sh();if(p(b))return h(b);a=setTimeout(m,v(b))}function h(b){return a=void 0,d&&r?g(b):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function w(){return a===void 0?i:h(Sh())}function k(){var b=Sh(),R=p(b);if(r=arguments,o=this,l=b,R){if(a===void 0)return y(l);if(f)return a=setTimeout(m,t),g(l)}return a===void 0&&(a=setTimeout(m,t)),i}return k.cancel=S,k.flush=w,k}function xh(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function lO(e){return!!e&&typeof e=="object"}function uO(e){return typeof e=="symbol"||lO(e)&&oO.call(e)==GL}function PE(e){if(typeof e=="number")return e;if(uO(e))return kE;if(xh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(YL,"");var n=XL.test(e);return n||ZL.test(e)?JL(e.slice(2),n?2:8):QL.test(e)?kE:+e}RE.exports=aO});var $E=Re((NF,WE)=>{"use strict";var xO=/["'&<>]/;WE.exports=wO;function wO(e){var t=""+e,n=xO.exec(t);if(!n)return t;var r,o="",s=0,i=0;for(s=n.index;s<t.length;s++){switch(t.charCodeAt(s)){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}i!==s&&(o+=t.substring(i,s)),i=s+1,o+=r}return i!==s?o+t.substring(i,s):o}});var S_={};Xe(S_,{Card:()=>ye,ContentEditableInput:()=>Zo,DeepdeskAPI:()=>Sr,DeepdeskSDK:()=>Fl,HTTPClient:()=>vr,InputMediator:()=>yr,InputType:()=>ms,KeyboardHint:()=>eu,Label:()=>tu,Locale:()=>Ba,Section:()=>Cn,SectionList:()=>nu,Sources:()=>Vn,Suggestion:()=>re,SuggestionList:()=>Et,TextAreaInput:()=>Jo,ToggleButton:()=>fo,attachFile:()=>_k,authenticateWithKey:()=>Dk,createFullRange:()=>Ti,createOverlayContainer:()=>Dl,createRangeFromOffsets:()=>io,escapeHTML:()=>ci,formatTextMarkup:()=>Fk,getRangeOffsets:()=>Ol,getRangeText:()=>Nl,insertCKEditor:()=>jk,isHTML:()=>jd,isSupportedInputElement:()=>Mf,updateContentEditable:()=>Uk,updateTextArea:()=>Hk,useClickOutsideRoot:()=>to,useStyles:()=>L,waitForElementVisibilityChange:()=>Ff});var Jf=x(se()),jt=x(D());var Ql=x(D()),Mv=x(se());var _i=Ql.default.createContext({});function L(e,t){let s=(0,Ql.useContext)(_i),{debug:n}=s,o=ee(s,["debug"])[e];return Object.entries(t).reduce((i,[a,l])=>{let u=o==null?void 0:o[a];return I(T({},i),{[a]:(0,Mv.default)(l,u,n?`${e}__${a}`:!1)})},{})}var _v={root:"dd-4s9wq"};var uo=x(C()),Xl=()=>(0,uo.jsxs)("svg",{className:_v.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,uo.jsx)("defs",{children:(0,uo.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,uo.jsx)("title",{children:"Failed loading image"}),(0,uo.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 Zf={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var co=x(C()),Zl=(0,jt.createContext)(Zf),hP=({title:e,src:t})=>{let n=(0,jt.useContext)(Zl),[r,o]=(0,jt.useState)(!1);return(0,jt.useEffect)(()=>{o(!1)},[t]),(0,co.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,co.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,co.jsx)(Xl,{})})},yP=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,jt.useContext)(Zl);return(0,co.jsx)("div",{className:(0,Jf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},vP=s=>{var i=s,{as:e="h1",cropText:t=!1,className:n,children:r}=i,o=ee(i,["as","cropText","className","children"]);let a=(0,jt.useContext)(Zl);return jt.default.createElement(e,T({className:(0,Jf.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},Jl=({children:e})=>{let t=L("Card",Zf);return(0,co.jsx)("div",{className:t.root,children:(0,co.jsx)(Zl.Provider,{value:t,children:e})})};Jl.Image=hP;Jl.Content=yP;Jl.Title=vP;var ye=Jl;var jv=x(se());var zv={root:"dd-llBx9"};var Bv=x(C());var SP={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},xP=r=>{var o=r,{className:e,keyCode:t}=o,n=ee(o,["className","keyCode"]);let s=L("KeyboardHint",zv);return(0,Bv.jsx)("span",T({"data-key":SP[t],className:(0,jv.default)(e,s.root)},n))},eu=xP;var Kv=x(se());var Vv={root:"dd-e6HXZ"};var Wv=x(C()),wP=r=>{var o=r,{className:e,children:t}=o,n=ee(o,["className","children"]);let s=L("Label",Vv);return(0,Wv.jsx)("span",I(T({},n),{className:(0,Kv.default)(e,s.root),children:t}))},tu=wP;var $v={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var fs=x(C()),EP=o=>{var s=o,{title:e,children:t,type:n}=s,r=ee(s,["title","children","type"]);let i=L("Section",$v);return(0,fs.jsxs)("section",I(T({},r),{className:i.root,"data-section-type":n,children:[e&&(0,fs.jsx)("div",{className:i.subTitleContainer,children:(0,fs.jsx)("span",{className:i.subtitle,children:e})}),(0,fs.jsx)("div",{className:i.suggestions,children:t})]}))},Cn=EP;var Gv=x(se()),Yv=x(D());var qv={root:"dd-uoTXh"};var Qv=x(C()),bP=Yv.default.forwardRef(({className:e,children:t},n)=>{let r=L("SectionList",qv);return(0,Qv.jsx)("div",{ref:n,className:(0,Gv.default)(r.root,e),children:t})}),nu=bP;var ps=x(se()),wt=x(D());var ep={root:"dd-1g-A9",fadein:"dd-McXxq",isClickable:"dd-CTG8E",isSelected:"dd-yhg27",actions:"dd-Nlm6p",actionsIsFixed:"dd-OK-kw",actionButton:"dd-zbXsQ",dropdownList:"dd-AvwWP",dropdownButton:"dd-piaJi",dropdownItem:"dd-qgkTO",dropdownItemButton:"dd-sTE2D",actionButtonIsPrimary:"dd-mhkWS",actionButtonIsDisabled:"dd-0eKLQ",labels:"dd-QKJu6",label:"dd-aMplE",buttonsContainer:"dd-uRYN4",button:"dd-9UE-x",buttonWithIcon:"dd-MQVt5",buttonDisabled:"dd-agTuH"};var xt=x(C()),wr=(0,wt.createContext)(ep),CP=r=>{var o=r,{fixed:e,children:t}=o,n=ee(o,["fixed","children"]);let s=(0,wt.useContext)(wr);return(0,xt.jsx)("div",I(T({},n),{className:(0,ps.default)(s.actions,{[s.actionsIsFixed]:e}),children:t}))};function TP(a){var l=a,{as:e,className:t,icon:n,title:r,children:o,disabled:s}=l,i=ee(l,["as","className","icon","title","children","disabled"]);let u=(0,wt.useContext)(wr);return(0,xt.jsxs)(e||"button",I(T({type:"button",className:(0,ps.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:s},t),title:r,"aria-label":r},i),{children:[n,o]}))}var kP=({children:e})=>{let t=(0,wt.useContext)(wr);return(0,xt.jsx)("div",{className:t.buttonsContainer,children:e})},PP=({className:e,primary:t,disabled:n,label:r,children:o})=>{let s=(0,wt.useContext)(wr);return(0,xt.jsxs)("div",{className:(0,ps.default)(e,s.actionButton,s.dropdownButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onMouseDown:i=>i.stopPropagation(),onClick:i=>i.stopPropagation(),children:[r,(0,xt.jsx)("ul",{className:s.dropdownList,children:o})]})},RP=({index:e,label:t,onClick:n})=>{let r=(0,wt.useContext)(wr);return(0,xt.jsx)("li",{className:r.dropdownItem,children:(0,xt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},AP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let s=(0,wt.useContext)(wr);return(0,xt.jsx)("button",{type:"button",className:(0,ps.default)(e,s.actionButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onClick:r!=null?r:i=>i.stopPropagation(),disabled:n,"aria-hidden":n,children:o})},IP=({labels:e})=>{let t=(0,wt.useContext)(wr);return(0,xt.jsx)("div",{className:t.labels,children:e.map(n=>(0,xt.jsx)("span",{className:t.label,children:n},n))})},Er=wt.default.forwardRef((a,i)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,s=ee(l,["className","selected","onClick","children","as"]);let u=L("Suggestion",ep),c=(0,wt.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,xt.jsx)(o,I(T({},s),{ref:i,className:(0,ps.default)(e,u.root,{[u.isSelected]:t,[u.isClickable]:!!n}),onClick:c,children:(0,xt.jsx)(wr.Provider,{value:u,children:r})}))});Er.Labels=IP;Er.Actions=CP;Er.ActionButton=AP;Er.DropdownButton=PP;Er.DropdownItem=RP;Er.ButtonsContainer=kP;Er.Button=TP;var re=Er;var Zv=x(se());var Xv={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Jv=x(C()),LP=({withDivider:e,children:t})=>{let n=L("SuggestionList",Xv);return(0,Jv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Zv.default)(n.root,{[n.isWithDivider]:e}),children:t})},Et=LP;var t0=x(se());var e0={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var ru=x(C()),OP=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=L("ToggleButton",e0);return(0,ru.jsx)("button",{type:"button",className:(0,t0.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,ru.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,ru.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},fo=OP;var n0=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,ou=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var r0=/x-deepdesk-(([a-z0-9\-_])+-version)/,su=["cues","custom-data"],Vn=(v=>(v.SEARCH="search",v.TEMPLATE="template",v.ELASTIC_SEARCH="search-autocomplete",v.GPT="gpt",v.TRIE="trie",v.TRIE_WITH_TYPOS="trie-with-typos",v.SEMANTIC="semantic",v.TEXT_RECOMMENDATION="text_recommendation",v.URL_RECOMMENDATION="url_recommendation",v.LINK_RECOMMENDATION="link_recommendation",v.PERSONAL_COLLECTION="personal-collection",v.PERSONAL_COLLECTION_SEARCH="personal-collection-search",v.SEARCH_OVERLAY="search-overlay",v.SEARCH_PREVIEW="search-preview",v.SEARCH_URL="search-url",v))(Vn||{}),ms=(i=>(i.ENTER="enter",i.TAB="tab",i.ARROW="arrow",i.HOTKEY="hotkey",i.MOUSE="mouse",i.SPACE="space",i))(ms||{});var sn=x(vc());var zb=x(D());function Yt(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,s;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Qn(e){return!!e&&!!e[be]}function cn(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)===DA}(e)||Array.isArray(e)||!!e[iw]||!!(!((t=e.constructor)===null||t===void 0)&&t[iw])||Sg(e)||xg(e))}function Ro(e,t,n){n===void 0&&(n=!1),Gs(e)===0?(n?Object.keys:qs)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Gs(e){var t=e[be];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Sg(e)?2:xg(e)?3:0}function $s(e,t){return Gs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function AA(e,t){return Gs(e)===2?e.get(t):e[t]}function aw(e,t,n){var r=Gs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function lw(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Sg(e){return MA&&e instanceof Map}function xg(e){return _A&&e instanceof Set}function Kr(e){return e.o||e.t}function wg(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=dw(e);delete t[be];for(var n=qs(t),r=0;r<n.length;r++){var o=n[r],s=t[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Eg(e,t){return t===void 0&&(t=!1),bg(e)||Qn(e)||!cn(e)||(Gs(e)>1&&(e.set=e.add=e.clear=e.delete=IA),Object.freeze(e),t&&Ro(e,function(n,r){return Eg(r,!0)},!0)),e}function IA(){Yt(2)}function bg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function On(e){var t=vg[e];return t||Yt(18,e),t}function LA(e,t){vg[e]||(vg[e]=t)}function gg(){return Da}function dg(e,t){t&&(On("Patches"),e.u=[],e.s=[],e.v=t)}function Sc(e){hg(e),e.p.forEach(OA),e.p=null}function hg(e){e===Da&&(Da=e.l)}function ew(e){return Da={p:[],l:Da,h:e,m:!0,_:0}}function OA(e){var t=e[be];t.i===0||t.i===1?t.j():t.g=!0}function fg(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||On("ES5").S(t,e,r),r?(n[be].P&&(Sc(t),Yt(4)),cn(e)&&(e=xc(t,e),t.l||wc(t,e)),t.u&&On("Patches").M(n[be].t,e,t.u,t.s)):e=xc(t,n,[]),Sc(t),t.u&&t.v(t.u,t.s),e!==cw?e:void 0}function xc(e,t,n){if(bg(t))return t;var r=t[be];if(!r)return Ro(t,function(a,l){return tw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return wc(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=wg(r.k):r.o,s=o,i=!1;r.i===3&&(s=new Set(o),o.clear(),i=!0),Ro(s,function(a,l){return tw(e,r,o,a,l,n,i)}),wc(e,o,!1),n&&e.u&&On("Patches").N(r,n,e.u,e.s)}return r.o}function tw(e,t,n,r,o,s,i){if(Qn(o)){var a=xc(e,o,s&&t&&t.i!==3&&!$s(t.R,r)?s.concat(r):void 0);if(aw(n,r,a),!Qn(a))return;e.m=!1}else i&&n.add(o);if(cn(o)&&!bg(o)){if(!e.h.D&&e._<1)return;xc(e,o),t&&t.A.l||wc(e,o)}}function wc(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Eg(t,n)}function pg(e,t){var n=e[be];return(n?Kr(n):e)[t]}function nw(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 Wr(e){e.P||(e.P=!0,e.l&&Wr(e.l))}function mg(e){e.o||(e.o=wg(e.t))}function yg(e,t,n){var r=Sg(t)?On("MapSet").F(t,n):xg(t)?On("MapSet").T(t,n):e.O?function(o,s){var i=Array.isArray(o),a={i:i?1:0,A:s?s.A:gg(),P:!1,I:!1,R:{},l:s,t:o,k:null,o:null,j:null,C:!1},l=a,u=Fa;i&&(l=[a],u=_a);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):On("ES5").J(t,n);return(n?n.A:gg()).p.push(r),r}function NA(e){return Qn(e)||Yt(22,e),function t(n){if(!cn(n))return n;var r,o=n[be],s=Gs(n);if(o){if(!o.P&&(o.i<4||!On("ES5").K(o)))return o.t;o.I=!0,r=rw(n,s),o.I=!1}else r=rw(n,s);return Ro(r,function(i,a){o&&AA(o.t,i)===a||aw(r,i,t(a))}),s===3?new Set(r):r}(e)}function rw(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return wg(e)}function uw(){function e(i,a){var l=s[i];return l?l.enumerable=a:s[i]=l={configurable:!0,enumerable:a,get:function(){var u=this[be];return Fa.get(u,i)},set:function(u){var c=this[be];Fa.set(c,i,u)}},l}function t(i){for(var a=i.length-1;a>=0;a--){var l=i[a][be];if(!l.P)switch(l.i){case 5:r(l)&&Wr(l);break;case 4:n(l)&&Wr(l)}}}function n(i){for(var a=i.t,l=i.k,u=qs(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==be){var d=a[f];if(d===void 0&&!$s(a,f))return!0;var g=l[f],y=g&&g[be];if(y?y.t!==d:!lw(g,d))return!0}}var v=!!a[be];return u.length!==qs(a).length+(v?0:1)}function r(i){var a=i.k;if(a.length!==i.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(i){i.g&&Yt(3,JSON.stringify(Kr(i)))}var s={};LA("ES5",{J:function(i,a){var l=Array.isArray(i),u=function(f,d){if(f){for(var g=Array(d.length),y=0;y<d.length;y++)Object.defineProperty(g,""+y,e(y,!0));return g}var v=dw(d);delete v[be];for(var p=qs(v),m=0;m<p.length;m++){var h=p[m];v[h]=e(h,f||!!v[h].enumerable)}return Object.create(Object.getPrototypeOf(d),v)}(l,i),c={i:l?5:4,A:a?a.A:gg(),P:!1,I:!1,R:{},l:a,t:i,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,be,{value:c,writable:!0}),u},S:function(i,a,l){l?Qn(a)&&a[be].A===i&&t(i.p):(i.u&&function u(c){if(c&&typeof c=="object"){var f=c[be];if(f){var d=f.t,g=f.k,y=f.R,v=f.i;if(v===4)Ro(g,function(w){w!==be&&(d[w]!==void 0||$s(d,w)?y[w]||u(g[w]):(y[w]=!0,Wr(f)))}),Ro(d,function(w){g[w]!==void 0||$s(g,w)||(y[w]=!1,Wr(f))});else if(v===5){if(r(f)&&(Wr(f),y.length=!0),g.length<d.length)for(var p=g.length;p<d.length;p++)y[p]=!1;else for(var m=d.length;m<g.length;m++)y[m]=!0;for(var h=Math.min(g.length,d.length),S=0;S<h;S++)g.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&u(g[S])}}}}(i.p[0]),t(i.p))},K:function(i){return i.i===4?n(i):r(i)}})}var ow,Da,Cg=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",MA=typeof Map!="undefined",_A=typeof Set!="undefined",sw=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",cw=Cg?Symbol.for("immer-nothing"):((ow={})["immer-nothing"]=!0,ow),iw=Cg?Symbol.for("immer-draftable"):"__$immer_draftable",be=Cg?Symbol.for("immer-state"):"__$immer_state";var DA=""+Object.prototype.constructor,qs=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,dw=Object.getOwnPropertyDescriptors||function(e){var t={};return qs(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},vg={},Fa={get:function(e,t){if(t===be)return e;var n=Kr(e);if(!$s(n,t))return function(o,s,i){var a,l=nw(s,i);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||!cn(r)?r:r===pg(e.t,t)?(mg(e),e.o[t]=yg(e.A.h,r,e)):r},has:function(e,t){return t in Kr(e)},ownKeys:function(e){return Reflect.ownKeys(Kr(e))},set:function(e,t,n){var r=nw(Kr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=pg(Kr(e),t),s=o==null?void 0:o[be];if(s&&s.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(lw(n,o)&&(n!==void 0||$s(e.t,t)))return!0;mg(e),Wr(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 pg(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,mg(e),Wr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Kr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Yt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Yt(12)}},_a={};Ro(Fa,function(e,t){_a[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),_a.deleteProperty=function(e,t){return _a.set.call(this,e,t,void 0)},_a.set=function(e,t,n){return Fa.set.call(this,e[0],t,n,e[0])};var FA=function(){function e(n){var r=this;this.O=sw,this.D=!0,this.produce=function(o,s,i){if(typeof o=="function"&&typeof s!="function"){var a=s;s=o;var l=r;return function(v){var p=this;v===void 0&&(v=a);for(var m=arguments.length,h=Array(m>1?m-1:0),S=1;S<m;S++)h[S-1]=arguments[S];return l.produce(v,function(w){var k;return(k=s).call.apply(k,[p,w].concat(h))})}}var u;if(typeof s!="function"&&Yt(6),i!==void 0&&typeof i!="function"&&Yt(7),cn(o)){var c=ew(r),f=yg(r,o,void 0),d=!0;try{u=s(f),d=!1}finally{d?Sc(c):hg(c)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(v){return dg(c,i),fg(v,c)},function(v){throw Sc(c),v}):(dg(c,i),fg(u,c))}if(!o||typeof o!="object"){if((u=s(o))===void 0&&(u=o),u===cw&&(u=void 0),r.D&&Eg(u,!0),i){var g=[],y=[];On("Patches").M(o,u,g,y),i(g,y)}return u}Yt(21,o)},this.produceWithPatches=function(o,s){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(g){return o.apply(void 0,[g].concat(f))})};var i,a,l=r.produce(o,s,function(u,c){i=u,a=c});return typeof Promise!="undefined"&&l instanceof Promise?l.then(function(u){return[u,i,a]}):[l,i,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){cn(n)||Yt(8),Qn(n)&&(n=NA(n));var r=ew(this),o=yg(this,n,void 0);return o[be].C=!0,hg(r),o},t.finishDraft=function(n,r){var o=n&&n[be],s=o.A;return dg(s,r),fg(void 0,s)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!sw&&Yt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var s=r[o];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}o>-1&&(r=r.slice(o+1));var i=On("Patches").$;return Qn(n)?i(n,r):this.produce(n,function(a){return i(a,r)})},e}(),Lt=new FA,HA=Lt.produce,tD=Lt.produceWithPatches.bind(Lt),nD=Lt.setAutoFreeze.bind(Lt),rD=Lt.setUseProxies.bind(Lt),oD=Lt.applyPatches.bind(Lt),sD=Lt.createDraft.bind(Lt),iD=Lt.finishDraft.bind(Lt),Ec=HA;function $r(e){"@babel/helpers - typeof";return $r=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},$r(e)}function Tg(e,t){if($r(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($r(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kg(e){var t=Tg(e,"string");return $r(t)==="symbol"?t:String(t)}function Pg(e,t,n){return t=kg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fw(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 bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fw(Object(n),!0).forEach(function(r){Pg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rt(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 pw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Rg=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cc={INIT:"@@redux/INIT"+Rg(),REPLACE:"@@redux/REPLACE"+Rg(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Rg()}};function UA(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 Ag(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(rt(0));if(typeof t=="function"&&typeof n=="undefined"&&(n=t,t=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(rt(1));return n(Ag)(e,t)}if(typeof e!="function")throw new Error(rt(2));var o=e,s=t,i=[],a=i,l=!1;function u(){a===i&&(a=i.slice())}function c(){if(l)throw new Error(rt(3));return s}function f(v){if(typeof v!="function")throw new Error(rt(4));if(l)throw new Error(rt(5));var p=!0;return u(),a.push(v),function(){if(p){if(l)throw new Error(rt(6));p=!1,u();var h=a.indexOf(v);a.splice(h,1),i=null}}}function d(v){if(!UA(v))throw new Error(rt(7));if(typeof v.type=="undefined")throw new Error(rt(8));if(l)throw new Error(rt(9));try{l=!0,s=o(s,v)}finally{l=!1}for(var p=i=a,m=0;m<p.length;m++){var h=p[m];h()}return v}function g(v){if(typeof v!="function")throw new Error(rt(10));o=v,d({type:Cc.REPLACE})}function y(){var v,p=f;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(rt(11));function S(){h.next&&h.next(c())}S();var w=p(S);return{unsubscribe:w}}},v[pw]=function(){return this},v}return d({type:Cc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:g},r[pw]=y,r}function zA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Cc.INIT});if(typeof r=="undefined")throw new Error(rt(12));if(typeof n(void 0,{type:Cc.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(rt(13))})}function Tc(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 s=Object.keys(n),i,a;try{zA(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,g={},y=0;y<s.length;y++){var v=s[y],p=n[v],m=u[v],h=p(m,c);if(typeof h=="undefined"){var S=c&&c.type;throw new Error(rt(14))}g[v]=h,d=d||h!==m}return d=d||s.length!==Object.keys(u).length,d?g:u}}function Ys(){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 mw(){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),s=function(){throw new Error(rt(15))},i={getState:o.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=t.map(function(l){return l(i)});return s=Ys.apply(void 0,a)(o.dispatch),bc(bc({},o),{},{dispatch:s})}}}function gw(e){var t=function(r){var o=r.dispatch,s=r.getState;return function(i){return function(a){return typeof a=="function"?a(o,s,e):i(a)}}};return t}var hw=gw();hw.withExtraArgument=gw;var Ig=hw;var ww=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),jA=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;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&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=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(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Qs=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},BA=Object.defineProperty,VA=Object.defineProperties,KA=Object.getOwnPropertyDescriptors,yw=Object.getOwnPropertySymbols,WA=Object.prototype.hasOwnProperty,$A=Object.prototype.propertyIsEnumerable,vw=function(e,t,n){return t in e?BA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qr=function(e,t){for(var n in t||(t={}))WA.call(t,n)&&vw(e,n,t[n]);if(yw)for(var r=0,o=yw(t);r<o.length;r++){var n=o[r];$A.call(t,n)&&vw(e,n,t[n])}return e},Lg=function(e,t){return VA(e,KA(t))},qA=function(e,t,n){return new Promise(function(r,o){var s=function(l){try{a(n.next(l))}catch(u){o(u)}},i=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(s,i)};a((n=n.apply(e,t)).next())})};var GA=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ys:Ys.apply(null,arguments)},CD=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function YA(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 QA=function(e){ww(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,Qs([void 0],n[0].concat(this)))):new(t.bind.apply(t,Qs([void 0],n.concat(this))))},t}(Array),XA=function(e){ww(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,Qs([void 0],n[0].concat(this)))):new(t.bind.apply(t,Qs([void 0],n.concat(this))))},t}(Array);function Mg(e){return cn(e)?Ec(e,function(){}):e}function ZA(e){return typeof e=="boolean"}function JA(){return function(t){return eI(t)}}function eI(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,s=e.serializableCheck,i=s===void 0?!0:s,a=new QA;if(n&&(ZA(n)?a.push(Ig):a.push(Ig.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(i)var u}return a}var Og=!0;function Ew(e){var t=JA(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,s=n.middleware,i=s===void 0?t():s,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,g;if(typeof o=="function")g=o;else if(YA(o))g=Tc(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 y=i;if(typeof y=="function"&&(y=y(t),!Og&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Og&&y.some(function(w){return typeof w!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=mw.apply(void 0,y),p=Ys;l&&(p=GA(qr({trace:!Og},typeof l=="object"&&l)));var m=new XA(v),h=m;Array.isArray(d)?h=Qs([v],d):typeof d=="function"&&(h=d(m));var S=p.apply(void 0,h);return Ag(g,c,S)}function Ie(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var s=t.apply(void 0,r);if(!s)throw new Error("prepareAction did not return an object");return qr(qr({type:e,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.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 bw(e){var t={},n=[],r,o={addCase:function(s,i){var a=typeof s=="string"?s:s.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=i,o},addMatcher:function(s,i){return n.push({matcher:s,reducer:i}),o},addDefaultCase:function(s){return r=s,o}};return e(o),[t,n,r]}function tI(e){return typeof e=="function"}function nI(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?bw(t):[t,n,r],s=o[0],i=o[1],a=o[2],l;if(tI(e))l=function(){return Mg(e())};else{var u=Mg(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var g=Qs([s[d.type]],i.filter(function(y){var v=y.matcher;return v(d)}).map(function(y){var v=y.reducer;return v}));return g.filter(function(y){return!!y}).length===0&&(g=[a]),g.reduce(function(y,v){if(v)if(Qn(y)){var p=y,m=v(p,d);return m===void 0?y:m}else{if(cn(y))return Ec(y,function(h){return v(h,d)});var m=v(y,d);if(m===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}return y},f)}return c.getInitialState=l,c}function rI(e,t){return e+"/"+t}function J(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n=typeof e.initialState=="function"?e.initialState:Mg(e.initialState),r=e.reducers||{},o=Object.keys(r),s={},i={},a={};o.forEach(function(c){var f=r[c],d=rI(t,c),g,y;"reducer"in f?(g=f.reducer,y=f.prepare):g=f,s[c]=g,i[d]=g,a[c]=y?Ie(d,y):Ie(d)});function l(){var c=typeof e.extraReducers=="function"?bw(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,g=c[1],y=g===void 0?[]:g,v=c[2],p=v===void 0?void 0:v,m=qr(qr({},d),i);return nI(n,function(h){for(var S in m)h.addCase(S,m[S]);for(var w=0,k=y;w<k.length;w++){var b=k[w];h.addMatcher(b.matcher,b.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:s,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var oI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",sI=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=oI[Math.random()*64|0];return t},iI=["name","message","stack","code"],Ng=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),Sw=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),aI=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=iI;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},V=function(){function e(t,n,r){var o=Ie(t+"/fulfilled",function(c,f,d,g){return{payload:c,meta:Lg(qr({},g||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),s=Ie(t+"/pending",function(c,f,d){return{payload:void 0,meta:Lg(qr({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),i=Ie(t+"/rejected",function(c,f,d,g,y){return{payload:g,error:(r&&r.serializeError||aI)(c||"Rejected"),meta:Lg(qr({},y||{}),{arg:d,requestId:f,rejectedWithValue:!!g,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=!1,l=typeof AbortController!="undefined"?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,g){var y=r!=null&&r.idGenerator?r.idGenerator(c):sI(),v=new l,p,m=!1;function h(w){p=w,v.abort()}var S=function(){return qA(this,null,function(){var w,k,b,R,N,_,Q;return jA(this,function(K){switch(K.label){case 0:return K.trys.push([0,4,,5]),R=(w=r==null?void 0:r.condition)==null?void 0:w.call(r,c,{getState:d,extra:g}),uI(R)?[4,R]:[3,2];case 1:R=K.sent(),K.label=2;case 2:if(R===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return m=!0,N=new Promise(function(W,de){return v.signal.addEventListener("abort",function(){return de({name:"AbortError",message:p||"Aborted"})})}),f(s(y,c,(k=r==null?void 0:r.getPendingMeta)==null?void 0:k.call(r,{requestId:y,arg:c},{getState:d,extra:g}))),[4,Promise.race([N,Promise.resolve(n(c,{dispatch:f,getState:d,extra:g,requestId:y,signal:v.signal,abort:h,rejectWithValue:function(W,de){return new Ng(W,de)},fulfillWithValue:function(W,de){return new Sw(W,de)}})).then(function(W){if(W instanceof Ng)throw W;return W instanceof Sw?o(W.payload,y,c,W.meta):o(W,y,c)})])];case 3:return b=K.sent(),[3,5];case 4:return _=K.sent(),b=_ instanceof Ng?i(null,y,c,_.payload,_.meta):i(_,y,c),[3,5];case 5:return Q=r&&!r.dispatchConditionRejection&&i.match(b)&&b.meta.condition,Q||f(b),[2,b]}})})}();return Object.assign(S,{abort:h,requestId:y,arg:c,unwrap:function(){return S.then(lI)}})}}return Object.assign(u,{pending:s,rejected:i,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function lI(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function uI(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var cI="task",Cw="listener",Tw="completed",_g="cancelled",RD="task-"+_g,AD="task-"+Tw,ID=Cw+"-"+_g,LD=Cw+"-"+Tw,OD=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=cI+" "+_g+" (reason: "+t+")"}return e}();var Dg="listenerMiddleware";var ND=Ie(Dg+"/add"),MD=Ie(Dg+"/removeAll"),_D=Ie(Dg+"/remove");var xw,DD=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window!="undefined"?window:typeof global!="undefined"?global:globalThis):function(e){return(xw||(xw=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},dI=function(e){return function(t){setTimeout(t,e)}},FD=typeof window!="undefined"&&window.requestAnimationFrame?window.requestAnimationFrame:dI(10);uw();var p1=x(Hg()),m1=x(Ow());var Ug=x(vc());function AI(e){e()}var Nw=AI,Mw=e=>Nw=e,_w=()=>Nw;var Zs=x(D());var Hw=x(D());var Pc=x(D()),Dw=Symbol.for(`react-redux-context-${Pc.version}`),Fw=globalThis;function II(){let e=Fw[Dw];return e||(e=(0,Pc.createContext)(null),Fw[Dw]=e),e}var ot=new Proxy({},new Proxy({},{get(e,t){let n=II();return(r,...o)=>Reflect[t](n,...o)}}));function Ha(e=ot){return function(){return(0,Hw.useContext)(e)}}var Rc=Ha();var Ac=()=>{throw new Error("uSES not initialized!")};var Uw=Ac,zw=e=>{Uw=e},LI=(e,t)=>e===t;function jw(e=ot){let t=e===ot?Rc:Ha(e);return function(r,o={}){let{equalityFn:s=LI,stabilityCheck:i=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),g=(0,Zs.useRef)(!0),y=(0,Zs.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,i]),v=Uw(u.addNestedSub,l.getState,c||l.getState,y,s);return(0,Zs.useDebugValue)(v),v}}var M=jw();function Xn(){return Xn=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},Xn.apply(this,arguments)}function Ua(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Yg=x(Zw()),pe=x(D()),u1=x(n1());var qI=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function GI(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:s,areStatePropsEqual:i}){let a=!1,l,u,c,f,d;function g(h,S){return l=h,u=S,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function y(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function v(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function p(){let h=e(l,u),S=!i(h,c);return c=h,S&&(d=n(c,f,u)),d}function m(h,S){let w=!s(S,u),k=!o(h,l,S,u);return l=h,u=S,w&&k?y():w?v():k?p():d}return function(S,w){return a?m(S,w):g(S,w)}}function qg(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,s=Ua(t,qI),i=n(e,s),a=r(e,s),l=o(e,s);return GI(i,a,l,e,s)}function Gg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...s)=>t(o(...s)))}return n}function za(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function r1(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Qc(e,t){return function(r,{displayName:o}){let s=function(a,l){return s.dependsOnOwnProps?s.mapToProps(a,l):s.mapToProps(a,void 0)};return s.dependsOnOwnProps=!0,s.mapToProps=function(a,l){s.mapToProps=e,s.dependsOnOwnProps=r1(e);let u=s(a,l);return typeof u=="function"&&(s.mapToProps=u,s.dependsOnOwnProps=r1(u),u=s(a,l)),u},s}}function Js(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function o1(e){return e&&typeof e=="object"?za(t=>Gg(e,t)):e?typeof e=="function"?Qc(e,"mapDispatchToProps"):Js(e,"mapDispatchToProps"):za(t=>({dispatch:t}))}function s1(e){return e?typeof e=="function"?Qc(e,"mapStateToProps"):Js(e,"mapStateToProps"):za(()=>({}))}function YI(e,t,n){return Xn({},n,e,t)}function QI(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let s=!1,i;return function(l,u,c){let f=e(l,u,c);return s?o(f,i)||(i=f):(s=!0,i=f),i}}}function i1(e){return e?typeof e=="function"?QI(e):Js(e,"mergeProps"):()=>YI}function XI(){let e=_w(),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,s=n={callback:r,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!o||t===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var a1={notify(){},get:()=>[]};function Xc(e,t){let n,r=a1;function o(f){return l(),r.subscribe(f)}function s(){r.notify()}function i(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=XI())}function u(){n&&(n(),n=void 0,r.clear(),r=a1)}let c={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:i,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Zc=x(D()),ZI=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",ei=ZI?Zc.useLayoutEffect:Zc.useEffect;function l1(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ti(e,t){if(l1(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])||!l1(e[n[o]],t[n[o]]))return!1;return!0}var JI=["reactReduxForwardedRef"],c1=Ac,d1=e=>{c1=e};var eL=[null,null];function tL(e,t,n){ei(()=>e(...t),n)}function nL(e,t,n,r,o,s){e.current=r,n.current=!1,o.current&&(o.current=null,s())}function rL(e,t,n,r,o,s,i,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,g=()=>{if(f||!a.current)return;let v=t.getState(),p,m;try{p=r(v,o.current)}catch(h){m=h,d=h}m||(d=null),p===s.current?i.current||u():(s.current=p,l.current=p,i.current=!0,c())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function oL(e,t){return e===t}function sL(e,t,n,{pure:r,areStatesEqual:o=oL,areOwnPropsEqual:s=ti,areStatePropsEqual:i=ti,areMergedPropsEqual:a=ti,forwardRef:l=!1,context:u=ot}={}){let c=u,f=s1(e),d=o1(t),g=i1(n),y=!!e;return p=>{let m=p.displayName||p.name||"Component",h=`Connect(${m})`,S={shouldHandleStateChanges:y,displayName:h,wrappedComponentName:m,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:i,areOwnPropsEqual:s,areMergedPropsEqual:a};function w(R){let[N,_,Q]=(0,pe.useMemo)(()=>{let{reactReduxForwardedRef:He}=R,Un=Ua(R,JI);return[R.context,He,Un]},[R]),K=(0,pe.useMemo)(()=>N&&N.Consumer&&(0,u1.isContextConsumer)(pe.default.createElement(N.Consumer,null))?N:c,[N,c]),W=(0,pe.useContext)(K),de=!!R.store&&!!R.store.getState&&!!R.store.dispatch,Ye=!!W&&!!W.store,Ft=de?R.store:W.store,ns=Ye?W.getServerState:Ft.getState,Ht=(0,pe.useMemo)(()=>qg(Ft.dispatch,S),[Ft]),[En,xr]=(0,pe.useMemo)(()=>{if(!y)return eL;let He=Xc(Ft,de?void 0:W.subscription),Un=He.notifyNestedSubs.bind(He);return[He,Un]},[Ft,de,W]),we=(0,pe.useMemo)(()=>de?W:Xn({},W,{subscription:En}),[de,W,En]),B=(0,pe.useRef)(),X=(0,pe.useRef)(Q),yt=(0,pe.useRef)(),ce=(0,pe.useRef)(!1),Pe=(0,pe.useRef)(!1),fe=(0,pe.useRef)(!1),rs=(0,pe.useRef)();ei(()=>(fe.current=!0,()=>{fe.current=!1}),[]);let os=(0,pe.useMemo)(()=>()=>yt.current&&Q===X.current?yt.current:Ht(Ft.getState(),Q),[Ft,Q]),Hl=(0,pe.useMemo)(()=>Un=>En?rL(y,Ft,En,Ht,X,B,ce,fe,yt,xr,Un):()=>{},[En]);tL(nL,[X,B,ce,Q,yt,xr]);let lo;try{lo=c1(Hl,os,ns?()=>Ht(ns(),Q):os)}catch(He){throw rs.current&&(He.message+=`
9
+ Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}Ke!==5&&(Ke=2),l=ng(l,a),d=i;do{switch(d.tag){case 3:s=l,d.flags|=4096,t&=-t,d.lanes|=t;var k=Hx(d,s,t);Y0(d,k);break e;case 1:s=l;var b=d.type,R=d.stateNode;if(!(d.flags&64)&&(typeof b.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(Rn===null||!Rn.has(R)))){d.flags|=4096,t&=-t,d.lanes|=t;var N=Ux(d,s,t);Y0(d,N);break e}}d=d.return}while(d!==null)}qx(n)}catch(_){t=_,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(1)}function Wx(){var e=tc.current;return tc.current=ec,e===null?ec:e}function ra(e,t){var n=$;$|=16;var r=Wx();at===e&&tt===t||_s(e,t);do try{pA();break}catch(o){Kx(e,o)}while(1);if($m(),$=n,tc.current=r,Me!==null)throw Error(O(261));return at=null,tt=0,Ke}function pA(){for(;Me!==null;)$x(Me)}function mA(){for(;Me!==null&&!YR();)$x(Me)}function $x(e){var t=Yx(e.alternate,e,bo);e.memoizedProps=e.pendingProps,t===null?qx(e):Me=t,rg.current=null}function qx(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=sA(t),n!==null){n.flags&=2047,Me=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=oA(n,t,bo),n!==null){Me=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||bo&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){Me=t;return}Me=t=e}while(t!==null);Ke===0&&(Ke=5)}function mo(e){var t=Us();return Eo(99,gA.bind(null,e,t)),null}function gA(e,t){do Vr();while(pa!==null);if($&48)throw Error(O(327));var n=e.finishedWork;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(O(177));e.callbackNode=null;var r=n.lanes|n.childLanes,o=r,s=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 i=e.eventTimes,a=e.expirationTimes;0<s;){var l=31-Hr(s),u=1<<l;o[l]=0,i[l]=-1,a[l]=-1,s&=~u}if(Gn!==null&&!(r&24)&&Gn.has(e)&&Gn.delete(e),e===at&&(Me=at=null,tt=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=$,$|=32,rg.current=null,Ep=ku,i=D0(),Yp(i)){if("selectionStart"in i)a={start:i.selectionStart,end:i.selectionEnd};else e:if(a=(a=i.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,s=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,g=0,y=0,v=i,p=null;t:for(;;){for(var m;v!==a||s!==0&&v.nodeType!==3||(f=c+s),v!==l||u!==0&&v.nodeType!==3||(d=c+u),v.nodeType===3&&(c+=v.nodeValue.length),(m=v.firstChild)!==null;)p=v,v=m;for(;;){if(v===i)break t;if(p===a&&++g===s&&(f=c),p===l&&++y===u&&(d=c),(m=v.nextSibling)!==null)break;v=p,p=v.parentNode}v=m}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;bp={focusedElem:i,selectionRange:a},ku=!1,ga=null,Nu=!1,F=r;do try{hA()}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);ga=null,F=r;do try{for(i=e;F!==null;){var h=F.flags;if(h&16&&ya(F.stateNode,""),h&128){var S=F.alternate;if(S!==null){var w=S.ref;w!==null&&(typeof w=="function"?w(null):w.current=null)}}switch(h&1038){case 2:xS(F),F.flags&=-3;break;case 6:xS(F),F.flags&=-3,Ip(F.alternate,F);break;case 1024:F.flags&=-1025;break;case 1028:F.flags&=-1025,Ip(F.alternate,F);break;case 4:Ip(F.alternate,F);break;case 8:a=F,zx(i,a);var k=a.alternate;vS(a),k!==null&&vS(k)}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);if(w=bp,S=D0(),h=w.focusedElem,i=w.selectionRange,S!==h&&h&&h.ownerDocument&&ox(h.ownerDocument.documentElement,h)){for(i!==null&&Yp(h)&&(S=i.start,w=i.end,w===void 0&&(w=S),"selectionStart"in h?(h.selectionStart=S,h.selectionEnd=Math.min(w,h.value.length)):(w=(S=h.ownerDocument||document)&&S.defaultView||window,w.getSelection&&(w=w.getSelection(),a=h.textContent.length,k=Math.min(i.start,a),i=i.end===void 0?k:Math.min(i.end,a),!w.extend&&k>i&&(a=i,i=k,k=a),a=_0(h,k),s=_0(h,i),a&&s&&(w.rangeCount!==1||w.anchorNode!==a.node||w.anchorOffset!==a.offset||w.focusNode!==s.node||w.focusOffset!==s.offset)&&(S=S.createRange(),S.setStart(a.node,a.offset),w.removeAllRanges(),k>i?(w.addRange(S),w.extend(s.node,s.offset)):(S.setEnd(s.node,s.offset),w.addRange(S)))))),S=[],w=h;w=w.parentNode;)w.nodeType===1&&S.push({element:w,left:w.scrollLeft,top:w.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<S.length;h++)w=S[h],w.element.scrollLeft=w.left,w.element.scrollTop=w.top}ku=!!Ep,bp=Ep=null,e.current=n,F=r;do try{for(h=e;F!==null;){var b=F.flags;if(b&36&&uA(h,F.alternate,F),b&128){S=void 0;var R=F.ref;if(R!==null){var N=F.stateNode;switch(F.tag){case 5:S=N;break;default:S=N}typeof R=="function"?R(S):R.current=S}}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);F=null,XR(),$=o}else e.current=n;if(zr)zr=!1,pa=e,na=t;else for(F=r;F!==null;)t=F.nextEffect,F.nextEffect=null,F.flags&8&&(b=F,b.sibling=null,b.stateNode=null),F=t;if(r=e.pendingLanes,r===0&&(Rn=null),r===1?e===vm?ma++:(ma=0,vm=e):ma=0,n=n.stateNode,xo&&typeof xo.onCommitFiberRoot=="function")try{xo.onCommitFiberRoot(Km,n,void 0,(n.current.flags&64)===64)}catch(_){}if(qt(e,et()),nc)throw nc=!1,e=gm,gm=null,e;return $&8||Ln(),null}function hA(){for(;F!==null;){var e=F.alternate;Nu||ga===null||(F.flags&8?E0(F,ga)&&(Nu=!0):F.tag===13&&cA(e,F)&&E0(F,ga)&&(Nu=!0));var t=F.flags;t&256&&lA(e,F),!(t&512)||zr||(zr=!0,Ta(97,function(){return Vr(),null})),F=F.nextEffect}}function Vr(){if(na!==90){var e=97<na?97:na;return na=90,Eo(e,vA)}return!1}function yA(e,t){hm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function Gx(e,t){ym.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function vA(){if(pa===null)return!1;var e=pa;if(pa=null,$&48)throw Error(O(331));var t=$;$|=32;var n=ym;ym=[];for(var r=0;r<n.length;r+=2){var o=n[r],s=n[r+1],i=o.destroy;if(o.destroy=void 0,typeof i=="function")try{i()}catch(l){if(s===null)throw Error(O(330));Dr(s,l)}}for(n=hm,hm=[],r=0;r<n.length;r+=2){o=n[r],s=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(s===null)throw Error(O(330));Dr(s,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 $=t,Ln(),!0}function ES(e,t,n){t=ng(n,t),t=Hx(e,t,1),Nr(e,t),t=At(),e=hc(e,1),e!==null&&(lc(e,1,t),qt(e,t))}function Dr(e,t){if(e.tag===3)ES(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){ES(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r))){e=ng(t,e);var o=Ux(n,e,1);if(Nr(n,o),o=At(),n=hc(n,1),n!==null)lc(n,1,o),qt(n,o);else if(typeof r.componentDidCatch=="function"&&(Rn===null||!Rn.has(r)))try{r.componentDidCatch(t,e)}catch(s){}break}}n=n.return}}function SA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=At(),e.pingedLanes|=e.suspendedLanes&n,at===e&&(tt&n)===n&&(Ke===4||Ke===3&&(tt&62914560)===tt&&500>et()-sg?_s(e,0):og|=n),qt(e,t)}function xA(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(Wn===0&&(Wn=Vs),t=xs(62914560&~Wn),t===0&&(t=4194304)):t=Us()===99?1:2:t=1),n=At(),e=hc(e,t),e!==null&&(lc(e,t,n),qt(e,n))}var Yx;Yx=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||Tt.current)un=!0;else if(n&r)un=!!(e.flags&16384);else{switch(un=!1,t.tag){case 3:lS(t),Pp();break;case 5:J0(t);break;case 1:kt(t.type)&&Au(t);break;case 4:rm(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;ke(Ku,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?uS(e,t,n):(ke(Te,Te.current&1),t=qn(e,t,n),t!==null?t.sibling:null);ke(Te,Te.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return mS(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ke(Te,Te.current),r)break;return null;case 23:case 24:return t.lanes=0,Rp(e,t,n)}return qn(e,t,n)}else un=!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=Hs(t,nt.current),Os(t,n),o=Zm(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,kt(r)){var s=!0;Au(t)}else s=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Gm(t);var i=r.getDerivedStateFromProps;typeof i=="function"&&qu(t,r,i,e),o.updater=mc,t.stateNode=o,o._reactInternals=t,nm(t,r,e,n),t=am(null,t,r,!0,s,n)}else t.tag=0,Ct(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,s=o._init,o=s(o._payload),t.type=o,s=t.tag=EA(o),e=ln(o,e),s){case 0:t=im(null,t,o,e,n);break e;case 1:t=aS(null,t,o,e,n);break e;case 11:t=sS(null,t,o,e,n);break e;case 14:t=iS(null,t,o,ln(o.type,e),r,n);break e}throw Error(O(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),im(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),aS(e,t,r,o,n);case 3:if(lS(t),r=t.updateQueue,e===null||r===null)throw Error(O(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,xx(e,t),ka(t,r,null,n),r=t.memoizedState.element,r===o)Pp(),t=qn(e,t,n);else{if(o=t.stateNode,(s=o.hydrate)&&(Rr=Ls(t.stateNode.containerInfo.firstChild),$n=t,s=In=!0),s){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)s=e[o],s._workInProgressVersionPrimary=e[o+1],Ns.push(s);for(n=Cx(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else Ct(e,t,r,n),Pp();t=t.child}return t;case 5:return J0(t),e===null&&om(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Zp(r,o)?i=null:s!==null&&Zp(r,s)&&(t.flags|=16),Mx(e,t),Ct(e,t,i,n),t.child;case 6:return e===null&&om(t),null;case 13:return uS(e,t,n);case 4:return rm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Gu(t,null,r,n):Ct(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),sS(e,t,r,o,n);case 7:return Ct(e,t,t.pendingProps,n),t.child;case 8:return Ct(e,t,t.pendingProps.children,n),t.child;case 12:return Ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value;var a=t.type._context;if(ke(Ku,a._currentValue),a._currentValue=s,i!==null)if(a=i.value,s=Vt(a,s)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,s):1073741823)|0,s===0){if(i.children===o.children&&!Tt.current){t=qn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){i=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&s){a.tag===1&&(u=Or(-1,n&-n),u.tag=2,Nr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),Sx(a.return,n),l.lanes|=n;break}u=u.next}}else i=a.tag===10&&a.type===t.type?null:a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}Ct(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,s=t.pendingProps,r=s.children,Os(t,n),o=$t(o,s.unstable_observedBits),r=r(o),t.flags|=1,Ct(e,t,r,n),t.child;case 14:return o=t.type,s=ln(o,t.pendingProps),s=ln(o.type,s),iS(e,t,o,s,r,n);case 15:return Nx(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,kt(r)?(e=!0,Au(t)):e=!1,Os(t,n),Ex(t,r,o),nm(t,r,o,n),am(null,t,r,!0,e,n);case 19:return mS(e,t,n);case 23:return Rp(e,t,n);case 24:return Rp(e,t,n)}throw Error(O(156,t.tag))};function wA(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 Kt(e,t,n,r){return new wA(e,t,n,r)}function ag(e){return e=e.prototype,!(!e||!e.isReactComponent)}function EA(e){if(typeof e=="function")return ag(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===ic)return 14}return 2}function jr(e,t){var n=e.alternate;return n===null?(n=Kt(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 Mu(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")ag(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Tr:return Ds(n.children,o,s,t);case TS:i=8,o|=16;break;case bm:i=8,o|=1;break;case oa:return e=Kt(12,n,t,o|8),e.elementType=oa,e.type=oa,e.lanes=s,e;case sa:return e=Kt(13,n,t,o),e.type=sa,e.elementType=sa,e.lanes=s,e;case _u:return e=Kt(19,n,t,o),e.elementType=_u,e.lanes=s,e;case Am:return lg(n,o,s,t);case Mp:return e=Kt(24,n,t,o),e.elementType=Mp,e.lanes=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Cm:i=10;break e;case Tm:i=9;break e;case sc:i=11;break e;case ic:i=14;break e;case km:i=16,r=null;break e;case Pm:i=22;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=Kt(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Ds(e,t,n,r){return e=Kt(7,e,r,t),e.lanes=n,e}function lg(e,t,n,r){return e=Kt(23,e,r,t),e.elementType=Am,e.lanes=n,e}function Lp(e,t,n){return e=Kt(6,e,null,t),e.lanes=n,e}function Op(e,t,n){return t=Kt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function bA(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=hp(0),this.expirationTimes=hp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hp(0),this.mutableSourceEagerHydrationData=null}function CA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:go,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function rc(e,t,n,r){var o=t.current,s=At(),i=Mr(o);e:if(n){n=n._reactInternals;t:{if(ko(n)!==n||n.tag!==1)throw Error(O(170));var a=n;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(kt(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(O(171))}if(n.tag===1){var l=n.type;if(kt(l)){n=fx(n,l,a);break e}}n=a}else n=Ur;return t.context===null?t.context=n:t.pendingContext=n,t=Or(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Nr(o,t),_r(o,i,s),i}function Np(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 bS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ug(e,t){bS(e,t),(e=e.alternate)&&bS(e,t)}function TA(){return null}function cg(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new bA(e,t,n!=null&&n.hydrate===!0),t=Kt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,Gm(t),e[Bs]=n.current,ax(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}cg.prototype.render=function(e){rc(e,this._internalRoot,null,null)};cg.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;rc(null,e,null,function(){t[Bs]=null})};function Ma(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function kA(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 cg(e,0,t?{hydrate:!0}:void 0)}function yc(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Np(i);a.call(u)}}rc(t,i,e,o)}else{if(s=n._reactRootContainer=kA(n,r),i=s._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Np(i);l.call(u)}}Vx(function(){rc(t,i,e,o)})}return Np(i)}zS=function(e){if(e.tag===13){var t=At();_r(e,4,t),ug(e,4)}};Mm=function(e){if(e.tag===13){var t=At();_r(e,67108864,t),ug(e,67108864)}};jS=function(e){if(e.tag===13){var t=At(),n=Mr(e);_r(e,n,t),ug(e,n)}};BS=function(e,t){return t()};Kp=function(e,t,n){switch(t){case"input":if(Dp(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=fc(r);if(!o)throw Error(O(90));PS(r),Dp(r,o)}}}break;case"textarea":AS(e,n);break;case"select":t=n.value,t!=null&&Rs(e,!!n.multiple,t,!1)}};Lm=Bx;DS=function(e,t,n,r,o){var s=$;$|=4;try{return Eo(98,e.bind(null,t,n,r,o))}finally{$=s,$===0&&(Ws(),Ln())}};Om=function(){!($&49)&&(fA(),Vr())};FS=function(e,t){var n=$;$|=2;try{return e(t)}finally{$=n,$===0&&(Ws(),Ln())}};function Qx(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(O(200));return CA(e,t,null,n)}var PA={Events:[La,Cs,fc,MS,_S,Vr,{current:!1}]},Xi={findFiberByHostInstance:yo,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},RA={bundleType:Xi.bundleType,version:Xi.version,rendererPackageName:Xi.rendererPackageName,rendererConfig:Xi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:To.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=US(e),e===null?null:e.stateNode},findFiberByHostInstance:Xi.findFiberByHostInstance||TA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Zi=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Zi.isDisabled&&Zi.supportsFiber))try{Km=Zi.inject(RA),xo=Zi}catch(e){}var Zi;Gt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PA;Gt.createPortal=Qx;Gt.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(O(188)):Error(O(268,Object.keys(e)));return e=US(t),e=e===null?null:e.stateNode,e};Gt.flushSync=function(e,t){var n=$;if(n&48)return e(t);$|=1;try{if(e)return Eo(99,e.bind(null,t))}finally{$=n,Ln()}};Gt.hydrate=function(e,t,n){if(!Ma(t))throw Error(O(200));return yc(null,e,t,!0,n)};Gt.render=function(e,t,n){if(!Ma(t))throw Error(O(200));return yc(null,e,t,!1,n)};Gt.unmountComponentAtNode=function(e){if(!Ma(e))throw Error(O(40));return e._reactRootContainer?(Vx(function(){yc(null,null,e,!1,function(){e._reactRootContainer=null,e[Bs]=null})}),!0):!1};Gt.unstable_batchedUpdates=Bx;Gt.unstable_createPortal=function(e,t){return Qx(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};Gt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ma(n))throw Error(O(200));if(e==null||e._reactInternals===void 0)throw Error(O(38));return yc(e,t,n,!1,r)};Gt.version="17.0.2"});var vc=Re((J2,Jx)=>{"use strict";function Zx(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Zx)}catch(e){console.error(e)}}Zx(),Jx.exports=Xx()});var Pw=Re(kw=>{"use strict";var Xs=D();function fI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pI=typeof Object.is=="function"?Object.is:fI,mI=Xs.useState,gI=Xs.useEffect,hI=Xs.useLayoutEffect,yI=Xs.useDebugValue;function vI(e,t){var n=t(),r=mI({inst:{value:n,getSnapshot:t}}),o=r[0].inst,s=r[1];return hI(function(){o.value=n,o.getSnapshot=t,Fg(o)&&s({inst:o})},[e,n,t]),gI(function(){return Fg(o)&&s({inst:o}),e(function(){Fg(o)&&s({inst:o})})},[e]),yI(n),n}function Fg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pI(e,n)}catch(r){return!0}}function SI(e,t){return t()}var xI=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?SI:vI;kw.useSyncExternalStore=Xs.useSyncExternalStore!==void 0?Xs.useSyncExternalStore:xI});var Hg=Re((zD,Rw)=>{"use strict";Rw.exports=Pw()});var Iw=Re(Aw=>{"use strict";var kc=D(),wI=Hg();function EI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bI=typeof Object.is=="function"?Object.is:EI,CI=wI.useSyncExternalStore,TI=kc.useRef,kI=kc.useEffect,PI=kc.useMemo,RI=kc.useDebugValue;Aw.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=TI(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=PI(function(){function l(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&i.hasValue){var y=i.value;if(o(y,g))return f=y}return f=g}if(y=f,bI(c,g))return y;var v=r(g);return o!==void 0&&o(y,v)?y:(c=g,f=v)}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=CI(e,s[0],s[1]);return kI(function(){i.hasValue=!0,i.value=a},[a]),RI(a),a}});var Ow=Re((BD,Lw)=>{"use strict";Lw.exports=Iw()});var Vw=Re(le=>{"use strict";var je=typeof Symbol=="function"&&Symbol.for,zg=je?Symbol.for("react.element"):60103,jg=je?Symbol.for("react.portal"):60106,Ic=je?Symbol.for("react.fragment"):60107,Lc=je?Symbol.for("react.strict_mode"):60108,Oc=je?Symbol.for("react.profiler"):60114,Nc=je?Symbol.for("react.provider"):60109,Mc=je?Symbol.for("react.context"):60110,Bg=je?Symbol.for("react.async_mode"):60111,_c=je?Symbol.for("react.concurrent_mode"):60111,Dc=je?Symbol.for("react.forward_ref"):60112,Fc=je?Symbol.for("react.suspense"):60113,OI=je?Symbol.for("react.suspense_list"):60120,Hc=je?Symbol.for("react.memo"):60115,Uc=je?Symbol.for("react.lazy"):60116,NI=je?Symbol.for("react.block"):60121,MI=je?Symbol.for("react.fundamental"):60117,_I=je?Symbol.for("react.responder"):60118,DI=je?Symbol.for("react.scope"):60119;function Ot(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case zg:switch(e=e.type,e){case Bg:case _c:case Ic:case Oc:case Lc:case Fc:return e;default:switch(e=e&&e.$$typeof,e){case Mc:case Dc:case Uc:case Hc:case Nc:return e;default:return t}}case jg:return t}}}function Bw(e){return Ot(e)===_c}le.AsyncMode=Bg;le.ConcurrentMode=_c;le.ContextConsumer=Mc;le.ContextProvider=Nc;le.Element=zg;le.ForwardRef=Dc;le.Fragment=Ic;le.Lazy=Uc;le.Memo=Hc;le.Portal=jg;le.Profiler=Oc;le.StrictMode=Lc;le.Suspense=Fc;le.isAsyncMode=function(e){return Bw(e)||Ot(e)===Bg};le.isConcurrentMode=Bw;le.isContextConsumer=function(e){return Ot(e)===Mc};le.isContextProvider=function(e){return Ot(e)===Nc};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===zg};le.isForwardRef=function(e){return Ot(e)===Dc};le.isFragment=function(e){return Ot(e)===Ic};le.isLazy=function(e){return Ot(e)===Uc};le.isMemo=function(e){return Ot(e)===Hc};le.isPortal=function(e){return Ot(e)===jg};le.isProfiler=function(e){return Ot(e)===Oc};le.isStrictMode=function(e){return Ot(e)===Lc};le.isSuspense=function(e){return Ot(e)===Fc};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ic||e===_c||e===Oc||e===Lc||e===Fc||e===OI||typeof e=="object"&&e!==null&&(e.$$typeof===Uc||e.$$typeof===Hc||e.$$typeof===Nc||e.$$typeof===Mc||e.$$typeof===Dc||e.$$typeof===MI||e.$$typeof===_I||e.$$typeof===DI||e.$$typeof===NI)};le.typeOf=Ot});var Ww=Re((n4,Kw)=>{"use strict";Kw.exports=Vw()});var Zw=Re((r4,Xw)=>{"use strict";var Vg=Ww(),FI={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},HI={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},UI={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Yw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Kg={};Kg[Vg.ForwardRef]=UI;Kg[Vg.Memo]=Yw;function $w(e){return Vg.isMemo(e)?Yw:Kg[e.$$typeof]||FI}var zI=Object.defineProperty,jI=Object.getOwnPropertyNames,qw=Object.getOwnPropertySymbols,BI=Object.getOwnPropertyDescriptor,VI=Object.getPrototypeOf,Gw=Object.prototype;function Qw(e,t,n){if(typeof t!="string"){if(Gw){var r=VI(t);r&&r!==Gw&&Qw(e,r,n)}var o=jI(t);qw&&(o=o.concat(qw(t)));for(var s=$w(e),i=$w(t),a=0;a<o.length;++a){var l=o[a];if(!HI[l]&&!(n&&n[l])&&!(i&&i[l])&&!(s&&s[l])){var u=BI(t,l);try{zI(e,l,u)}catch(c){}}}}return e}Xw.exports=Qw});var e1=Re(ue=>{"use strict";var Wg=Symbol.for("react.element"),$g=Symbol.for("react.portal"),zc=Symbol.for("react.fragment"),jc=Symbol.for("react.strict_mode"),Bc=Symbol.for("react.profiler"),Vc=Symbol.for("react.provider"),Kc=Symbol.for("react.context"),KI=Symbol.for("react.server_context"),Wc=Symbol.for("react.forward_ref"),$c=Symbol.for("react.suspense"),qc=Symbol.for("react.suspense_list"),Gc=Symbol.for("react.memo"),Yc=Symbol.for("react.lazy"),WI=Symbol.for("react.offscreen"),Jw;Jw=Symbol.for("react.module.reference");function Qt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Wg:switch(e=e.type,e){case zc:case Bc:case jc:case $c:case qc:return e;default:switch(e=e&&e.$$typeof,e){case KI:case Kc:case Wc:case Yc:case Gc:case Vc:return e;default:return t}}case $g:return t}}}ue.ContextConsumer=Kc;ue.ContextProvider=Vc;ue.Element=Wg;ue.ForwardRef=Wc;ue.Fragment=zc;ue.Lazy=Yc;ue.Memo=Gc;ue.Portal=$g;ue.Profiler=Bc;ue.StrictMode=jc;ue.Suspense=$c;ue.SuspenseList=qc;ue.isAsyncMode=function(){return!1};ue.isConcurrentMode=function(){return!1};ue.isContextConsumer=function(e){return Qt(e)===Kc};ue.isContextProvider=function(e){return Qt(e)===Vc};ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Wg};ue.isForwardRef=function(e){return Qt(e)===Wc};ue.isFragment=function(e){return Qt(e)===zc};ue.isLazy=function(e){return Qt(e)===Yc};ue.isMemo=function(e){return Qt(e)===Gc};ue.isPortal=function(e){return Qt(e)===$g};ue.isProfiler=function(e){return Qt(e)===Bc};ue.isStrictMode=function(e){return Qt(e)===jc};ue.isSuspense=function(e){return Qt(e)===$c};ue.isSuspenseList=function(e){return Qt(e)===qc};ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===zc||e===Bc||e===jc||e===$c||e===qc||e===WI||typeof e=="object"&&e!==null&&(e.$$typeof===Yc||e.$$typeof===Gc||e.$$typeof===Vc||e.$$typeof===Kc||e.$$typeof===Wc||e.$$typeof===Jw||e.getModuleId!==void 0)};ue.typeOf=Qt});var n1=Re((s4,t1)=>{"use strict";t1.exports=e1()});var wh=Re((B6,RE)=>{"use strict";var qL="Expected a function",kE=NaN,GL="[object Symbol]",YL=/^\s+|\s+$/g,QL=/^[-+]0x[0-9a-f]+$/i,XL=/^0b[01]+$/i,ZL=/^0o[0-7]+$/i,JL=parseInt,eO=typeof global=="object"&&global&&global.Object===Object&&global,tO=typeof self=="object"&&self&&self.Object===Object&&self,nO=eO||tO||Function("return this")(),rO=Object.prototype,oO=rO.toString,sO=Math.max,iO=Math.min,Sh=function(){return nO.Date.now()};function aO(e,t,n){var r,o,s,i,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(qL);t=PE(t)||0,xh(n)&&(c=!!n.leading,f="maxWait"in n,s=f?sO(PE(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function g(b){var R=r,N=o;return r=o=void 0,u=b,i=e.apply(N,R),i}function y(b){return u=b,a=setTimeout(m,t),c?g(b):i}function v(b){var R=b-l,N=b-u,_=t-R;return f?iO(_,s-N):_}function p(b){var R=b-l,N=b-u;return l===void 0||R>=t||R<0||f&&N>=s}function m(){var b=Sh();if(p(b))return h(b);a=setTimeout(m,v(b))}function h(b){return a=void 0,d&&r?g(b):(r=o=void 0,i)}function S(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function w(){return a===void 0?i:h(Sh())}function k(){var b=Sh(),R=p(b);if(r=arguments,o=this,l=b,R){if(a===void 0)return y(l);if(f)return a=setTimeout(m,t),g(l)}return a===void 0&&(a=setTimeout(m,t)),i}return k.cancel=S,k.flush=w,k}function xh(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function lO(e){return!!e&&typeof e=="object"}function uO(e){return typeof e=="symbol"||lO(e)&&oO.call(e)==GL}function PE(e){if(typeof e=="number")return e;if(uO(e))return kE;if(xh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=xh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(YL,"");var n=XL.test(e);return n||ZL.test(e)?JL(e.slice(2),n?2:8):QL.test(e)?kE:+e}RE.exports=aO});var $E=Re((OF,WE)=>{"use strict";var xO=/["'&<>]/;WE.exports=wO;function wO(e){var t=""+e,n=xO.exec(t);if(!n)return t;var r,o="",s=0,i=0;for(s=n.index;s<t.length;s++){switch(t.charCodeAt(s)){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}i!==s&&(o+=t.substring(i,s)),i=s+1,o+=r}return i!==s?o+t.substring(i,s):o}});var v_={};Xe(v_,{Card:()=>ye,ContentEditableInput:()=>Zo,DeepdeskAPI:()=>Sr,DeepdeskSDK:()=>Fl,HTTPClient:()=>vr,InputMediator:()=>yr,InputType:()=>ms,KeyboardHint:()=>eu,Label:()=>tu,Locale:()=>Ba,Section:()=>Cn,SectionList:()=>nu,Sources:()=>Vn,Suggestion:()=>re,SuggestionList:()=>Et,TextAreaInput:()=>Jo,ToggleButton:()=>fo,attachFile:()=>_k,authenticateWithKey:()=>Dk,createFullRange:()=>Ti,createOverlayContainer:()=>Dl,createRangeFromOffsets:()=>io,escapeHTML:()=>ci,formatTextMarkup:()=>Fk,getRangeOffsets:()=>Ol,getRangeText:()=>Nl,insertCKEditor:()=>jk,isHTML:()=>jd,isSupportedInputElement:()=>Mf,updateContentEditable:()=>Uk,updateTextArea:()=>Hk,useClickOutsideRoot:()=>to,useStyles:()=>L,waitForElementVisibilityChange:()=>Ff});var Jf=x(se()),jt=x(D());var Ql=x(D()),Mv=x(se());var _i=Ql.default.createContext({});function L(e,t){let s=(0,Ql.useContext)(_i),{debug:n}=s,o=ee(s,["debug"])[e];return Object.entries(t).reduce((i,[a,l])=>{let u=o==null?void 0:o[a];return I(T({},i),{[a]:(0,Mv.default)(l,u,n?`${e}__${a}`:!1)})},{})}var _v={root:"dd-4s9wq"};var uo=x(C()),Xl=()=>(0,uo.jsxs)("svg",{className:_v.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,uo.jsx)("defs",{children:(0,uo.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,uo.jsx)("title",{children:"Failed loading image"}),(0,uo.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 Zf={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var co=x(C()),Zl=(0,jt.createContext)(Zf),hP=({title:e,src:t})=>{let n=(0,jt.useContext)(Zl),[r,o]=(0,jt.useState)(!1);return(0,jt.useEffect)(()=>{o(!1)},[t]),(0,co.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,co.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,co.jsx)(Xl,{})})},yP=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,jt.useContext)(Zl);return(0,co.jsx)("div",{className:(0,Jf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},vP=s=>{var i=s,{as:e="h1",cropText:t=!1,className:n,children:r}=i,o=ee(i,["as","cropText","className","children"]);let a=(0,jt.useContext)(Zl);return jt.default.createElement(e,T({className:(0,Jf.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},Jl=({children:e})=>{let t=L("Card",Zf);return(0,co.jsx)("div",{className:t.root,children:(0,co.jsx)(Zl.Provider,{value:t,children:e})})};Jl.Image=hP;Jl.Content=yP;Jl.Title=vP;var ye=Jl;var jv=x(se());var zv={root:"dd-llBx9"};var Bv=x(C());var SP={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},xP=r=>{var o=r,{className:e,keyCode:t}=o,n=ee(o,["className","keyCode"]);let s=L("KeyboardHint",zv);return(0,Bv.jsx)("span",T({"data-key":SP[t],className:(0,jv.default)(e,s.root)},n))},eu=xP;var Kv=x(se());var Vv={root:"dd-e6HXZ"};var Wv=x(C()),wP=r=>{var o=r,{className:e,children:t}=o,n=ee(o,["className","children"]);let s=L("Label",Vv);return(0,Wv.jsx)("span",I(T({},n),{className:(0,Kv.default)(e,s.root),children:t}))},tu=wP;var $v={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var fs=x(C()),EP=o=>{var s=o,{title:e,children:t,type:n}=s,r=ee(s,["title","children","type"]);let i=L("Section",$v);return(0,fs.jsxs)("section",I(T({},r),{className:i.root,"data-section-type":n,children:[e&&(0,fs.jsx)("div",{className:i.subTitleContainer,children:(0,fs.jsx)("span",{className:i.subtitle,children:e})}),(0,fs.jsx)("div",{className:i.suggestions,children:t})]}))},Cn=EP;var Gv=x(se()),Yv=x(D());var qv={root:"dd-uoTXh"};var Qv=x(C()),bP=Yv.default.forwardRef(({className:e,children:t},n)=>{let r=L("SectionList",qv);return(0,Qv.jsx)("div",{ref:n,className:(0,Gv.default)(r.root,e),children:t})}),nu=bP;var ps=x(se()),wt=x(D());var ep={root:"dd-1g-A9",fadein:"dd-McXxq",isClickable:"dd-CTG8E",isSelected:"dd-yhg27",actions:"dd-Nlm6p",actionsIsFixed:"dd-OK-kw",actionButton:"dd-zbXsQ",dropdownList:"dd-AvwWP",dropdownButton:"dd-piaJi",dropdownItem:"dd-qgkTO",dropdownItemButton:"dd-sTE2D",actionButtonIsPrimary:"dd-mhkWS",actionButtonIsDisabled:"dd-0eKLQ",labels:"dd-QKJu6",label:"dd-aMplE",buttonsContainer:"dd-uRYN4",button:"dd-9UE-x",buttonWithIcon:"dd-MQVt5",buttonDisabled:"dd-agTuH"};var xt=x(C()),wr=(0,wt.createContext)(ep),CP=r=>{var o=r,{fixed:e,children:t}=o,n=ee(o,["fixed","children"]);let s=(0,wt.useContext)(wr);return(0,xt.jsx)("div",I(T({},n),{className:(0,ps.default)(s.actions,{[s.actionsIsFixed]:e}),children:t}))};function TP(a){var l=a,{as:e,className:t,icon:n,title:r,children:o,disabled:s}=l,i=ee(l,["as","className","icon","title","children","disabled"]);let u=(0,wt.useContext)(wr);return(0,xt.jsxs)(e||"button",I(T({type:"button",className:(0,ps.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:s},t),title:r,"aria-label":r},i),{children:[n,o]}))}var kP=({children:e})=>{let t=(0,wt.useContext)(wr);return(0,xt.jsx)("div",{className:t.buttonsContainer,children:e})},PP=({className:e,primary:t,disabled:n,label:r,children:o})=>{let s=(0,wt.useContext)(wr);return(0,xt.jsxs)("div",{className:(0,ps.default)(e,s.actionButton,s.dropdownButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onMouseDown:i=>i.stopPropagation(),onClick:i=>i.stopPropagation(),children:[r,(0,xt.jsx)("ul",{className:s.dropdownList,children:o})]})},RP=({index:e,label:t,onClick:n})=>{let r=(0,wt.useContext)(wr);return(0,xt.jsx)("li",{className:r.dropdownItem,children:(0,xt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},AP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let s=(0,wt.useContext)(wr);return(0,xt.jsx)("button",{type:"button",className:(0,ps.default)(e,s.actionButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onClick:r!=null?r:i=>i.stopPropagation(),disabled:n,"aria-hidden":n,children:o})},IP=({labels:e})=>{let t=(0,wt.useContext)(wr);return(0,xt.jsx)("div",{className:t.labels,children:e.map(n=>(0,xt.jsx)("span",{className:t.label,children:n},n))})},Er=wt.default.forwardRef((a,i)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,s=ee(l,["className","selected","onClick","children","as"]);let u=L("Suggestion",ep),c=(0,wt.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,xt.jsx)(o,I(T({},s),{ref:i,className:(0,ps.default)(e,u.root,{[u.isSelected]:t,[u.isClickable]:!!n}),onClick:c,children:(0,xt.jsx)(wr.Provider,{value:u,children:r})}))});Er.Labels=IP;Er.Actions=CP;Er.ActionButton=AP;Er.DropdownButton=PP;Er.DropdownItem=RP;Er.ButtonsContainer=kP;Er.Button=TP;var re=Er;var Zv=x(se());var Xv={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Jv=x(C()),LP=({withDivider:e,children:t})=>{let n=L("SuggestionList",Xv);return(0,Jv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Zv.default)(n.root,{[n.isWithDivider]:e}),children:t})},Et=LP;var t0=x(se());var e0={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var ru=x(C()),OP=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=L("ToggleButton",e0);return(0,ru.jsx)("button",{type:"button",className:(0,t0.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,ru.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,ru.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},fo=OP;var n0=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,ou=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var r0=/x-deepdesk-(([a-z0-9\-_])+-version)/,su=["cues","custom-data"],Vn=(v=>(v.SEARCH="search",v.TEMPLATE="template",v.ELASTIC_SEARCH="search-autocomplete",v.GPT="gpt",v.TRIE="trie",v.TRIE_WITH_TYPOS="trie-with-typos",v.SEMANTIC="semantic",v.TEXT_RECOMMENDATION="text_recommendation",v.URL_RECOMMENDATION="url_recommendation",v.LINK_RECOMMENDATION="link_recommendation",v.PERSONAL_COLLECTION="personal-collection",v.PERSONAL_COLLECTION_SEARCH="personal-collection-search",v.SEARCH_OVERLAY="search-overlay",v.SEARCH_PREVIEW="search-preview",v.SEARCH_URL="search-url",v))(Vn||{}),ms=(i=>(i.ENTER="enter",i.TAB="tab",i.ARROW="arrow",i.HOTKEY="hotkey",i.MOUSE="mouse",i.SPACE="space",i))(ms||{});var sn=x(vc());var zb=x(D());function Yt(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,s;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(i){return"'"+i+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function Qn(e){return!!e&&!!e[be]}function cn(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)===DA}(e)||Array.isArray(e)||!!e[iw]||!!(!((t=e.constructor)===null||t===void 0)&&t[iw])||Sg(e)||xg(e))}function Ro(e,t,n){n===void 0&&(n=!1),Gs(e)===0?(n?Object.keys:qs)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Gs(e){var t=e[be];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:Sg(e)?2:xg(e)?3:0}function $s(e,t){return Gs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function AA(e,t){return Gs(e)===2?e.get(t):e[t]}function aw(e,t,n){var r=Gs(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function lw(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Sg(e){return MA&&e instanceof Map}function xg(e){return _A&&e instanceof Set}function Kr(e){return e.o||e.t}function wg(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=dw(e);delete t[be];for(var n=qs(t),r=0;r<n.length;r++){var o=n[r],s=t[o];s.writable===!1&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Eg(e,t){return t===void 0&&(t=!1),bg(e)||Qn(e)||!cn(e)||(Gs(e)>1&&(e.set=e.add=e.clear=e.delete=IA),Object.freeze(e),t&&Ro(e,function(n,r){return Eg(r,!0)},!0)),e}function IA(){Yt(2)}function bg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function On(e){var t=vg[e];return t||Yt(18,e),t}function LA(e,t){vg[e]||(vg[e]=t)}function gg(){return Da}function dg(e,t){t&&(On("Patches"),e.u=[],e.s=[],e.v=t)}function Sc(e){hg(e),e.p.forEach(OA),e.p=null}function hg(e){e===Da&&(Da=e.l)}function ew(e){return Da={p:[],l:Da,h:e,m:!0,_:0}}function OA(e){var t=e[be];t.i===0||t.i===1?t.j():t.g=!0}function fg(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||On("ES5").S(t,e,r),r?(n[be].P&&(Sc(t),Yt(4)),cn(e)&&(e=xc(t,e),t.l||wc(t,e)),t.u&&On("Patches").M(n[be].t,e,t.u,t.s)):e=xc(t,n,[]),Sc(t),t.u&&t.v(t.u,t.s),e!==cw?e:void 0}function xc(e,t,n){if(bg(t))return t;var r=t[be];if(!r)return Ro(t,function(a,l){return tw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return wc(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=wg(r.k):r.o,s=o,i=!1;r.i===3&&(s=new Set(o),o.clear(),i=!0),Ro(s,function(a,l){return tw(e,r,o,a,l,n,i)}),wc(e,o,!1),n&&e.u&&On("Patches").N(r,n,e.u,e.s)}return r.o}function tw(e,t,n,r,o,s,i){if(Qn(o)){var a=xc(e,o,s&&t&&t.i!==3&&!$s(t.R,r)?s.concat(r):void 0);if(aw(n,r,a),!Qn(a))return;e.m=!1}else i&&n.add(o);if(cn(o)&&!bg(o)){if(!e.h.D&&e._<1)return;xc(e,o),t&&t.A.l||wc(e,o)}}function wc(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&Eg(t,n)}function pg(e,t){var n=e[be];return(n?Kr(n):e)[t]}function nw(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 Wr(e){e.P||(e.P=!0,e.l&&Wr(e.l))}function mg(e){e.o||(e.o=wg(e.t))}function yg(e,t,n){var r=Sg(t)?On("MapSet").F(t,n):xg(t)?On("MapSet").T(t,n):e.O?function(o,s){var i=Array.isArray(o),a={i:i?1:0,A:s?s.A:gg(),P:!1,I:!1,R:{},l:s,t:o,k:null,o:null,j:null,C:!1},l=a,u=Fa;i&&(l=[a],u=_a);var c=Proxy.revocable(l,u),f=c.revoke,d=c.proxy;return a.k=d,a.j=f,d}(t,n):On("ES5").J(t,n);return(n?n.A:gg()).p.push(r),r}function NA(e){return Qn(e)||Yt(22,e),function t(n){if(!cn(n))return n;var r,o=n[be],s=Gs(n);if(o){if(!o.P&&(o.i<4||!On("ES5").K(o)))return o.t;o.I=!0,r=rw(n,s),o.I=!1}else r=rw(n,s);return Ro(r,function(i,a){o&&AA(o.t,i)===a||aw(r,i,t(a))}),s===3?new Set(r):r}(e)}function rw(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return wg(e)}function uw(){function e(i,a){var l=s[i];return l?l.enumerable=a:s[i]=l={configurable:!0,enumerable:a,get:function(){var u=this[be];return Fa.get(u,i)},set:function(u){var c=this[be];Fa.set(c,i,u)}},l}function t(i){for(var a=i.length-1;a>=0;a--){var l=i[a][be];if(!l.P)switch(l.i){case 5:r(l)&&Wr(l);break;case 4:n(l)&&Wr(l)}}}function n(i){for(var a=i.t,l=i.k,u=qs(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==be){var d=a[f];if(d===void 0&&!$s(a,f))return!0;var g=l[f],y=g&&g[be];if(y?y.t!==d:!lw(g,d))return!0}}var v=!!a[be];return u.length!==qs(a).length+(v?0:1)}function r(i){var a=i.k;if(a.length!==i.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(i){i.g&&Yt(3,JSON.stringify(Kr(i)))}var s={};LA("ES5",{J:function(i,a){var l=Array.isArray(i),u=function(f,d){if(f){for(var g=Array(d.length),y=0;y<d.length;y++)Object.defineProperty(g,""+y,e(y,!0));return g}var v=dw(d);delete v[be];for(var p=qs(v),m=0;m<p.length;m++){var h=p[m];v[h]=e(h,f||!!v[h].enumerable)}return Object.create(Object.getPrototypeOf(d),v)}(l,i),c={i:l?5:4,A:a?a.A:gg(),P:!1,I:!1,R:{},l:a,t:i,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,be,{value:c,writable:!0}),u},S:function(i,a,l){l?Qn(a)&&a[be].A===i&&t(i.p):(i.u&&function u(c){if(c&&typeof c=="object"){var f=c[be];if(f){var d=f.t,g=f.k,y=f.R,v=f.i;if(v===4)Ro(g,function(w){w!==be&&(d[w]!==void 0||$s(d,w)?y[w]||u(g[w]):(y[w]=!0,Wr(f)))}),Ro(d,function(w){g[w]!==void 0||$s(g,w)||(y[w]=!1,Wr(f))});else if(v===5){if(r(f)&&(Wr(f),y.length=!0),g.length<d.length)for(var p=g.length;p<d.length;p++)y[p]=!1;else for(var m=d.length;m<g.length;m++)y[m]=!0;for(var h=Math.min(g.length,d.length),S=0;S<h;S++)g.hasOwnProperty(S)||(y[S]=!0),y[S]===void 0&&u(g[S])}}}}(i.p[0]),t(i.p))},K:function(i){return i.i===4?n(i):r(i)}})}var ow,Da,Cg=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",MA=typeof Map!="undefined",_A=typeof Set!="undefined",sw=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",cw=Cg?Symbol.for("immer-nothing"):((ow={})["immer-nothing"]=!0,ow),iw=Cg?Symbol.for("immer-draftable"):"__$immer_draftable",be=Cg?Symbol.for("immer-state"):"__$immer_state";var DA=""+Object.prototype.constructor,qs=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,dw=Object.getOwnPropertyDescriptors||function(e){var t={};return qs(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},vg={},Fa={get:function(e,t){if(t===be)return e;var n=Kr(e);if(!$s(n,t))return function(o,s,i){var a,l=nw(s,i);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||!cn(r)?r:r===pg(e.t,t)?(mg(e),e.o[t]=yg(e.A.h,r,e)):r},has:function(e,t){return t in Kr(e)},ownKeys:function(e){return Reflect.ownKeys(Kr(e))},set:function(e,t,n){var r=nw(Kr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=pg(Kr(e),t),s=o==null?void 0:o[be];if(s&&s.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(lw(n,o)&&(n!==void 0||$s(e.t,t)))return!0;mg(e),Wr(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 pg(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,mg(e),Wr(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Kr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Yt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Yt(12)}},_a={};Ro(Fa,function(e,t){_a[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),_a.deleteProperty=function(e,t){return _a.set.call(this,e,t,void 0)},_a.set=function(e,t,n){return Fa.set.call(this,e[0],t,n,e[0])};var FA=function(){function e(n){var r=this;this.O=sw,this.D=!0,this.produce=function(o,s,i){if(typeof o=="function"&&typeof s!="function"){var a=s;s=o;var l=r;return function(v){var p=this;v===void 0&&(v=a);for(var m=arguments.length,h=Array(m>1?m-1:0),S=1;S<m;S++)h[S-1]=arguments[S];return l.produce(v,function(w){var k;return(k=s).call.apply(k,[p,w].concat(h))})}}var u;if(typeof s!="function"&&Yt(6),i!==void 0&&typeof i!="function"&&Yt(7),cn(o)){var c=ew(r),f=yg(r,o,void 0),d=!0;try{u=s(f),d=!1}finally{d?Sc(c):hg(c)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(v){return dg(c,i),fg(v,c)},function(v){throw Sc(c),v}):(dg(c,i),fg(u,c))}if(!o||typeof o!="object"){if((u=s(o))===void 0&&(u=o),u===cw&&(u=void 0),r.D&&Eg(u,!0),i){var g=[],y=[];On("Patches").M(o,u,g,y),i(g,y)}return u}Yt(21,o)},this.produceWithPatches=function(o,s){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(g){return o.apply(void 0,[g].concat(f))})};var i,a,l=r.produce(o,s,function(u,c){i=u,a=c});return typeof Promise!="undefined"&&l instanceof Promise?l.then(function(u){return[u,i,a]}):[l,i,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){cn(n)||Yt(8),Qn(n)&&(n=NA(n));var r=ew(this),o=yg(this,n,void 0);return o[be].C=!0,hg(r),o},t.finishDraft=function(n,r){var o=n&&n[be],s=o.A;return dg(s,r),fg(void 0,s)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!sw&&Yt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var s=r[o];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}o>-1&&(r=r.slice(o+1));var i=On("Patches").$;return Qn(n)?i(n,r):this.produce(n,function(a){return i(a,r)})},e}(),Lt=new FA,HA=Lt.produce,eD=Lt.produceWithPatches.bind(Lt),tD=Lt.setAutoFreeze.bind(Lt),nD=Lt.setUseProxies.bind(Lt),rD=Lt.applyPatches.bind(Lt),oD=Lt.createDraft.bind(Lt),sD=Lt.finishDraft.bind(Lt),Ec=HA;function $r(e){"@babel/helpers - typeof";return $r=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},$r(e)}function Tg(e,t){if($r(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($r(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kg(e){var t=Tg(e,"string");return $r(t)==="symbol"?t:String(t)}function Pg(e,t,n){return t=kg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fw(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 bc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?fw(Object(n),!0).forEach(function(r){Pg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fw(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rt(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 pw=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Rg=function(){return Math.random().toString(36).substring(7).split("").join(".")},Cc={INIT:"@@redux/INIT"+Rg(),REPLACE:"@@redux/REPLACE"+Rg(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Rg()}};function UA(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 Ag(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(rt(0));if(typeof t=="function"&&typeof n=="undefined"&&(n=t,t=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(rt(1));return n(Ag)(e,t)}if(typeof e!="function")throw new Error(rt(2));var o=e,s=t,i=[],a=i,l=!1;function u(){a===i&&(a=i.slice())}function c(){if(l)throw new Error(rt(3));return s}function f(v){if(typeof v!="function")throw new Error(rt(4));if(l)throw new Error(rt(5));var p=!0;return u(),a.push(v),function(){if(p){if(l)throw new Error(rt(6));p=!1,u();var h=a.indexOf(v);a.splice(h,1),i=null}}}function d(v){if(!UA(v))throw new Error(rt(7));if(typeof v.type=="undefined")throw new Error(rt(8));if(l)throw new Error(rt(9));try{l=!0,s=o(s,v)}finally{l=!1}for(var p=i=a,m=0;m<p.length;m++){var h=p[m];h()}return v}function g(v){if(typeof v!="function")throw new Error(rt(10));o=v,d({type:Cc.REPLACE})}function y(){var v,p=f;return v={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(rt(11));function S(){h.next&&h.next(c())}S();var w=p(S);return{unsubscribe:w}}},v[pw]=function(){return this},v}return d({type:Cc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:g},r[pw]=y,r}function zA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Cc.INIT});if(typeof r=="undefined")throw new Error(rt(12));if(typeof n(void 0,{type:Cc.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(rt(13))})}function Tc(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 s=Object.keys(n),i,a;try{zA(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,g={},y=0;y<s.length;y++){var v=s[y],p=n[v],m=u[v],h=p(m,c);if(typeof h=="undefined"){var S=c&&c.type;throw new Error(rt(14))}g[v]=h,d=d||h!==m}return d=d||s.length!==Object.keys(u).length,d?g:u}}function Ys(){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 mw(){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),s=function(){throw new Error(rt(15))},i={getState:o.getState,dispatch:function(){return s.apply(void 0,arguments)}},a=t.map(function(l){return l(i)});return s=Ys.apply(void 0,a)(o.dispatch),bc(bc({},o),{},{dispatch:s})}}}function gw(e){var t=function(r){var o=r.dispatch,s=r.getState;return function(i){return function(a){return typeof a=="function"?a(o,s,e):i(a)}}};return t}var hw=gw();hw.withExtraArgument=gw;var Ig=hw;var ww=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var s in o)Object.prototype.hasOwnProperty.call(o,s)&&(r[s]=o[s])},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)}}(),jA=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,o,s,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;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&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=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(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Qs=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},BA=Object.defineProperty,VA=Object.defineProperties,KA=Object.getOwnPropertyDescriptors,yw=Object.getOwnPropertySymbols,WA=Object.prototype.hasOwnProperty,$A=Object.prototype.propertyIsEnumerable,vw=function(e,t,n){return t in e?BA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qr=function(e,t){for(var n in t||(t={}))WA.call(t,n)&&vw(e,n,t[n]);if(yw)for(var r=0,o=yw(t);r<o.length;r++){var n=o[r];$A.call(t,n)&&vw(e,n,t[n])}return e},Lg=function(e,t){return VA(e,KA(t))},qA=function(e,t,n){return new Promise(function(r,o){var s=function(l){try{a(n.next(l))}catch(u){o(u)}},i=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(s,i)};a((n=n.apply(e,t)).next())})};var GA=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Ys:Ys.apply(null,arguments)},bD=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function YA(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 QA=function(e){ww(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,Qs([void 0],n[0].concat(this)))):new(t.bind.apply(t,Qs([void 0],n.concat(this))))},t}(Array),XA=function(e){ww(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,Qs([void 0],n[0].concat(this)))):new(t.bind.apply(t,Qs([void 0],n.concat(this))))},t}(Array);function Mg(e){return cn(e)?Ec(e,function(){}):e}function ZA(e){return typeof e=="boolean"}function JA(){return function(t){return eI(t)}}function eI(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,s=e.serializableCheck,i=s===void 0?!0:s,a=new QA;if(n&&(ZA(n)?a.push(Ig):a.push(Ig.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(i)var u}return a}var Og=!0;function Ew(e){var t=JA(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,s=n.middleware,i=s===void 0?t():s,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,g;if(typeof o=="function")g=o;else if(YA(o))g=Tc(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 y=i;if(typeof y=="function"&&(y=y(t),!Og&&!Array.isArray(y)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Og&&y.some(function(w){return typeof w!="function"}))throw new Error("each middleware provided to configureStore must be a function");var v=mw.apply(void 0,y),p=Ys;l&&(p=GA(qr({trace:!Og},typeof l=="object"&&l)));var m=new XA(v),h=m;Array.isArray(d)?h=Qs([v],d):typeof d=="function"&&(h=d(m));var S=p.apply(void 0,h);return Ag(g,c,S)}function Ie(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var s=t.apply(void 0,r);if(!s)throw new Error("prepareAction did not return an object");return qr(qr({type:e,payload:s.payload},"meta"in s&&{meta:s.meta}),"error"in s&&{error:s.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 bw(e){var t={},n=[],r,o={addCase:function(s,i){var a=typeof s=="string"?s:s.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=i,o},addMatcher:function(s,i){return n.push({matcher:s,reducer:i}),o},addDefaultCase:function(s){return r=s,o}};return e(o),[t,n,r]}function tI(e){return typeof e=="function"}function nI(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?bw(t):[t,n,r],s=o[0],i=o[1],a=o[2],l;if(tI(e))l=function(){return Mg(e())};else{var u=Mg(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var g=Qs([s[d.type]],i.filter(function(y){var v=y.matcher;return v(d)}).map(function(y){var v=y.reducer;return v}));return g.filter(function(y){return!!y}).length===0&&(g=[a]),g.reduce(function(y,v){if(v)if(Qn(y)){var p=y,m=v(p,d);return m===void 0?y:m}else{if(cn(y))return Ec(y,function(h){return v(h,d)});var m=v(y,d);if(m===void 0){if(y===null)return y;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}return y},f)}return c.getInitialState=l,c}function rI(e,t){return e+"/"+t}function J(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n=typeof e.initialState=="function"?e.initialState:Mg(e.initialState),r=e.reducers||{},o=Object.keys(r),s={},i={},a={};o.forEach(function(c){var f=r[c],d=rI(t,c),g,y;"reducer"in f?(g=f.reducer,y=f.prepare):g=f,s[c]=g,i[d]=g,a[c]=y?Ie(d,y):Ie(d)});function l(){var c=typeof e.extraReducers=="function"?bw(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,g=c[1],y=g===void 0?[]:g,v=c[2],p=v===void 0?void 0:v,m=qr(qr({},d),i);return nI(n,function(h){for(var S in m)h.addCase(S,m[S]);for(var w=0,k=y;w<k.length;w++){var b=k[w];h.addMatcher(b.matcher,b.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:s,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var oI="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",sI=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=oI[Math.random()*64|0];return t},iI=["name","message","stack","code"],Ng=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),Sw=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),aI=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=iI;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},V=function(){function e(t,n,r){var o=Ie(t+"/fulfilled",function(c,f,d,g){return{payload:c,meta:Lg(qr({},g||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),s=Ie(t+"/pending",function(c,f,d){return{payload:void 0,meta:Lg(qr({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),i=Ie(t+"/rejected",function(c,f,d,g,y){return{payload:g,error:(r&&r.serializeError||aI)(c||"Rejected"),meta:Lg(qr({},y||{}),{arg:d,requestId:f,rejectedWithValue:!!g,requestStatus:"rejected",aborted:(c==null?void 0:c.name)==="AbortError",condition:(c==null?void 0:c.name)==="ConditionError"})}}),a=!1,l=typeof AbortController!="undefined"?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,g){var y=r!=null&&r.idGenerator?r.idGenerator(c):sI(),v=new l,p,m=!1;function h(w){p=w,v.abort()}var S=function(){return qA(this,null,function(){var w,k,b,R,N,_,Q;return jA(this,function(K){switch(K.label){case 0:return K.trys.push([0,4,,5]),R=(w=r==null?void 0:r.condition)==null?void 0:w.call(r,c,{getState:d,extra:g}),uI(R)?[4,R]:[3,2];case 1:R=K.sent(),K.label=2;case 2:if(R===!1||v.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return m=!0,N=new Promise(function(W,de){return v.signal.addEventListener("abort",function(){return de({name:"AbortError",message:p||"Aborted"})})}),f(s(y,c,(k=r==null?void 0:r.getPendingMeta)==null?void 0:k.call(r,{requestId:y,arg:c},{getState:d,extra:g}))),[4,Promise.race([N,Promise.resolve(n(c,{dispatch:f,getState:d,extra:g,requestId:y,signal:v.signal,abort:h,rejectWithValue:function(W,de){return new Ng(W,de)},fulfillWithValue:function(W,de){return new Sw(W,de)}})).then(function(W){if(W instanceof Ng)throw W;return W instanceof Sw?o(W.payload,y,c,W.meta):o(W,y,c)})])];case 3:return b=K.sent(),[3,5];case 4:return _=K.sent(),b=_ instanceof Ng?i(null,y,c,_.payload,_.meta):i(_,y,c),[3,5];case 5:return Q=r&&!r.dispatchConditionRejection&&i.match(b)&&b.meta.condition,Q||f(b),[2,b]}})})}();return Object.assign(S,{abort:h,requestId:y,arg:c,unwrap:function(){return S.then(lI)}})}}return Object.assign(u,{pending:s,rejected:i,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function lI(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function uI(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var cI="task",Cw="listener",Tw="completed",_g="cancelled",PD="task-"+_g,RD="task-"+Tw,AD=Cw+"-"+_g,ID=Cw+"-"+Tw,LD=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=cI+" "+_g+" (reason: "+t+")"}return e}();var Dg="listenerMiddleware";var OD=Ie(Dg+"/add"),ND=Ie(Dg+"/removeAll"),MD=Ie(Dg+"/remove");var xw,_D=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window!="undefined"?window:typeof global!="undefined"?global:globalThis):function(e){return(xw||(xw=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},dI=function(e){return function(t){setTimeout(t,e)}},DD=typeof window!="undefined"&&window.requestAnimationFrame?window.requestAnimationFrame:dI(10);uw();var p1=x(Hg()),m1=x(Ow());var Ug=x(vc());function AI(e){e()}var Nw=AI,Mw=e=>Nw=e,_w=()=>Nw;var Zs=x(D());var Hw=x(D());var Pc=x(D()),Dw=Symbol.for(`react-redux-context-${Pc.version}`),Fw=globalThis;function II(){let e=Fw[Dw];return e||(e=(0,Pc.createContext)(null),Fw[Dw]=e),e}var ot=new Proxy({},new Proxy({},{get(e,t){let n=II();return(r,...o)=>Reflect[t](n,...o)}}));function Ha(e=ot){return function(){return(0,Hw.useContext)(e)}}var Rc=Ha();var Ac=()=>{throw new Error("uSES not initialized!")};var Uw=Ac,zw=e=>{Uw=e},LI=(e,t)=>e===t;function jw(e=ot){let t=e===ot?Rc:Ha(e);return function(r,o={}){let{equalityFn:s=LI,stabilityCheck:i=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),g=(0,Zs.useRef)(!0),y=(0,Zs.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,i]),v=Uw(u.addNestedSub,l.getState,c||l.getState,y,s);return(0,Zs.useDebugValue)(v),v}}var M=jw();function Xn(){return Xn=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},Xn.apply(this,arguments)}function Ua(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Yg=x(Zw()),pe=x(D()),u1=x(n1());var qI=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function GI(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:s,areStatePropsEqual:i}){let a=!1,l,u,c,f,d;function g(h,S){return l=h,u=S,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function y(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function v(){return e.dependsOnOwnProps&&(c=e(l,u)),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function p(){let h=e(l,u),S=!i(h,c);return c=h,S&&(d=n(c,f,u)),d}function m(h,S){let w=!s(S,u),k=!o(h,l,S,u);return l=h,u=S,w&&k?y():w?v():k?p():d}return function(S,w){return a?m(S,w):g(S,w)}}function qg(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,s=Ua(t,qI),i=n(e,s),a=r(e,s),l=o(e,s);return GI(i,a,l,e,s)}function Gg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...s)=>t(o(...s)))}return n}function za(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function r1(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Qc(e,t){return function(r,{displayName:o}){let s=function(a,l){return s.dependsOnOwnProps?s.mapToProps(a,l):s.mapToProps(a,void 0)};return s.dependsOnOwnProps=!0,s.mapToProps=function(a,l){s.mapToProps=e,s.dependsOnOwnProps=r1(e);let u=s(a,l);return typeof u=="function"&&(s.mapToProps=u,s.dependsOnOwnProps=r1(u),u=s(a,l)),u},s}}function Js(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function o1(e){return e&&typeof e=="object"?za(t=>Gg(e,t)):e?typeof e=="function"?Qc(e,"mapDispatchToProps"):Js(e,"mapDispatchToProps"):za(t=>({dispatch:t}))}function s1(e){return e?typeof e=="function"?Qc(e,"mapStateToProps"):Js(e,"mapStateToProps"):za(()=>({}))}function YI(e,t,n){return Xn({},n,e,t)}function QI(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let s=!1,i;return function(l,u,c){let f=e(l,u,c);return s?o(f,i)||(i=f):(s=!0,i=f),i}}}function i1(e){return e?typeof e=="function"?QI(e):Js(e,"mergeProps"):()=>YI}function XI(){let e=_w(),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,s=n={callback:r,next:null,prev:n};return s.prev?s.prev.next=s:t=s,function(){!o||t===null||(o=!1,s.next?s.next.prev=s.prev:n=s.prev,s.prev?s.prev.next=s.next:t=s.next)}}}}var a1={notify(){},get:()=>[]};function Xc(e,t){let n,r=a1;function o(f){return l(),r.subscribe(f)}function s(){r.notify()}function i(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(i):e.subscribe(i),r=XI())}function u(){n&&(n(),n=void 0,r.clear(),r=a1)}let c={addNestedSub:o,notifyNestedSubs:s,handleChangeWrapper:i,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Zc=x(D()),ZI=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",ei=ZI?Zc.useLayoutEffect:Zc.useEffect;function l1(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ti(e,t){if(l1(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])||!l1(e[n[o]],t[n[o]]))return!1;return!0}var JI=["reactReduxForwardedRef"],c1=Ac,d1=e=>{c1=e};var eL=[null,null];function tL(e,t,n){ei(()=>e(...t),n)}function nL(e,t,n,r,o,s){e.current=r,n.current=!1,o.current&&(o.current=null,s())}function rL(e,t,n,r,o,s,i,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,g=()=>{if(f||!a.current)return;let v=t.getState(),p,m;try{p=r(v,o.current)}catch(h){m=h,d=h}m||(d=null),p===s.current?i.current||u():(s.current=p,l.current=p,i.current=!0,c())};return n.onStateChange=g,n.trySubscribe(),g(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function oL(e,t){return e===t}function sL(e,t,n,{pure:r,areStatesEqual:o=oL,areOwnPropsEqual:s=ti,areStatePropsEqual:i=ti,areMergedPropsEqual:a=ti,forwardRef:l=!1,context:u=ot}={}){let c=u,f=s1(e),d=o1(t),g=i1(n),y=!!e;return p=>{let m=p.displayName||p.name||"Component",h=`Connect(${m})`,S={shouldHandleStateChanges:y,displayName:h,wrappedComponentName:m,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:g,areStatesEqual:o,areStatePropsEqual:i,areOwnPropsEqual:s,areMergedPropsEqual:a};function w(R){let[N,_,Q]=(0,pe.useMemo)(()=>{let{reactReduxForwardedRef:He}=R,Un=Ua(R,JI);return[R.context,He,Un]},[R]),K=(0,pe.useMemo)(()=>N&&N.Consumer&&(0,u1.isContextConsumer)(pe.default.createElement(N.Consumer,null))?N:c,[N,c]),W=(0,pe.useContext)(K),de=!!R.store&&!!R.store.getState&&!!R.store.dispatch,Ye=!!W&&!!W.store,Ft=de?R.store:W.store,ns=Ye?W.getServerState:Ft.getState,Ht=(0,pe.useMemo)(()=>qg(Ft.dispatch,S),[Ft]),[En,xr]=(0,pe.useMemo)(()=>{if(!y)return eL;let He=Xc(Ft,de?void 0:W.subscription),Un=He.notifyNestedSubs.bind(He);return[He,Un]},[Ft,de,W]),we=(0,pe.useMemo)(()=>de?W:Xn({},W,{subscription:En}),[de,W,En]),B=(0,pe.useRef)(),X=(0,pe.useRef)(Q),yt=(0,pe.useRef)(),ce=(0,pe.useRef)(!1),Pe=(0,pe.useRef)(!1),fe=(0,pe.useRef)(!1),rs=(0,pe.useRef)();ei(()=>(fe.current=!0,()=>{fe.current=!1}),[]);let os=(0,pe.useMemo)(()=>()=>yt.current&&Q===X.current?yt.current:Ht(Ft.getState(),Q),[Ft,Q]),Hl=(0,pe.useMemo)(()=>Un=>En?rL(y,Ft,En,Ht,X,B,ce,fe,yt,xr,Un):()=>{},[En]);tL(nL,[X,B,ce,Q,yt,xr]);let lo;try{lo=c1(Hl,os,ns?()=>Ht(ns(),Q):os)}catch(He){throw rs.current&&(He.message+=`
10
10
  The error may be correlated with this previous error:
11
11
  ${rs.current.stack}
12
12
 
13
13
  `),He}ei(()=>{rs.current=void 0,yt.current=void 0,B.current=lo});let bn=(0,pe.useMemo)(()=>pe.default.createElement(p,Xn({},lo,{ref:_})),[_,p,lo]);return(0,pe.useMemo)(()=>y?pe.default.createElement(K.Provider,{value:we},bn):bn,[K,bn,we])}let b=pe.default.memo(w);if(b.WrappedComponent=p,b.displayName=w.displayName=h,l){let N=pe.default.forwardRef(function(Q,K){return pe.default.createElement(b,Xn({},Q,{reactReduxForwardedRef:K}))});return N.displayName=h,N.WrappedComponent=p,(0,Yg.default)(N,p)}return(0,Yg.default)(b,p)}}var Zn=sL;var ja=x(D());function iL({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:s="once"}){let i=(0,ja.useMemo)(()=>{let u=Xc(e);return{store:e,subscription:u,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:s}},[e,r,o,s]),a=(0,ja.useMemo)(()=>e.getState(),[e]);ei(()=>{let{subscription:u}=i;return u.onStateChange=u.notifyNestedSubs,u.trySubscribe(),a!==e.getState()&&u.notifyNestedSubs(),()=>{u.tryUnsubscribe(),u.onStateChange=void 0}},[i,a]);let l=t||ot;return ja.default.createElement(l.Provider,{value:i},n)}var Qg=iL;function Jc(e=ot){let t=e===ot?Rc:Ha(e);return function(){let{store:r}=t();return r}}var Xg=Jc();function f1(e=ot){let t=e===ot?Xg:Jc(e);return function(){return t().dispatch}}var G=f1();zw(m1.useSyncExternalStoreWithSelector);d1(p1.useSyncExternalStore);Mw(Ug.unstable_batchedUpdates);var Ba=(n=>(n.NL_NL="nl-NL",n.EN_US="en-US",n))(Ba||{});var aL={locale:"en-US",deanonymize:!1,fallbackImage:!1,isEmbedded:!1,showAutoflows:!1,showCustomMessages:!1,showImages:!1,showSearch:!1,showImageSearch:!1,showStyleSuggestions:!1,showMidSentenceSuggestions:!1,showSuggestionsBeforePattern:!1,showSuggestionsAfterPattern:!1,showTabCompletion:!0,showTextSuggestions:!0,showEntitiesCommand:!1,showSummaryCommand:!1,showKnowledgeSearch:!1,textSuggestionsCount:3,recommendTextSuggestions:!0,searchTriggerKey:"k",visible:!0,insertLink:!1,inlineSuggestions:!1,floatingMenu:!1,enableSuggestionFeedback:!1,enableFeedbackForm:!1,adminUrl:void 0,productName:"Deepdesk",hasKeyboardInput:!0},g1=J({name:"settings",initialState:aL,reducers:{set(e,t){Object.entries(t.payload).forEach(n=>{let[r,o]=n;typeof o!="undefined"&&(e[r]=o)})}}}),{set:ed}=g1.actions,Zg=e=>t=>t.settings[e],z=e=>M(Zg(e)),h1=g1.reducer;var lL={isLoggedIn:!0,loginFetchState:"idle",verifyFetchState:"idle",showLoginOverlay:!1},ut=e=>e.auth.isLoggedIn,y1=e=>e.auth.loginFetchState,v1=e=>e.auth.verifyFetchState,S1=e=>e.auth.showLoginOverlay,Jn=V("auth/validate",(e,t)=>P(void 0,null,function*(){return t.extra.deepdeskAPI.isLoggedIn()})),x1=V("auth/requestLogin",(n,r)=>P(void 0,[n,r],function*({email:e},t){let{deepdeskAPI:o}=t.extra;return o.requestLoginByEmail(e)})),Va=V("auth/verifyLoginToken",(n,r)=>P(void 0,[n,r],function*({token:e},t){let{deepdeskAPI:o}=t.extra;return o.verifyLoginToken(e)})),w1=J({name:"auth",initialState:lL,reducers:{setIsLoggedIn(e,t){e.isLoggedIn=t.payload},setShowLoginOverlay(e,t){e.showLoginOverlay=t.payload}},extraReducers:e=>{e.addCase(Jn.pending,t=>{t.loginFetchState="loading"}),e.addCase(Jn.fulfilled,(t,{payload:n})=>{t.isLoggedIn=n,t.loginFetchState="done"}),e.addCase(Jn.rejected,t=>{t.loginFetchState="error",t.isLoggedIn=!1}),e.addCase(Va.pending,t=>{t.verifyFetchState="loading"}),e.addCase(Va.rejected,t=>{t.verifyFetchState="error"}),e.addCase(Va.fulfilled,(t,n)=>{n.payload.isLoggedIn?t.verifyFetchState="done":t.verifyFetchState="error"})}}),{setIsLoggedIn:ni,setShowLoginOverlay:E1}=w1.actions,b1=w1.reducer;function er(){}er.prototype={diff:function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.callback;typeof r=="function"&&(o=r,r={}),this.options=r;var s=this;function i(v){return o?(setTimeout(function(){o(void 0,v)},0),!0):v}t=this.castInput(t),n=this.castInput(n),t=this.removeEmpty(this.tokenize(t)),n=this.removeEmpty(this.tokenize(n));var a=n.length,l=t.length,u=1,c=a+l;r.maxEditLength&&(c=Math.min(c,r.maxEditLength));var f=[{newPos:-1,components:[]}],d=this.extractCommon(f[0],n,t,0);if(f[0].newPos+1>=a&&d+1>=l)return i([{value:this.join(n),count:n.length}]);function g(){for(var v=-1*u;v<=u;v+=2){var p=void 0,m=f[v-1],h=f[v+1],S=(h?h.newPos:0)-v;m&&(f[v-1]=void 0);var w=m&&m.newPos+1<a,k=h&&0<=S&&S<l;if(!w&&!k){f[v]=void 0;continue}if(!w||k&&m.newPos<h.newPos?(p=cL(h),s.pushComponent(p.components,void 0,!0)):(p=m,p.newPos++,s.pushComponent(p.components,!0,void 0)),S=s.extractCommon(p,n,t,v),p.newPos+1>=a&&S+1>=l)return i(uL(s,p.components,n,t,s.useLongestToken));f[v]=p}u++}if(o)(function v(){setTimeout(function(){if(u>c)return o();g()||v()},0)})();else for(;u<=c;){var y=g();if(y)return y}},pushComponent:function(t,n,r){var o=t[t.length-1];o&&o.added===n&&o.removed===r?t[t.length-1]={count:o.count+1,added:n,removed:r}:t.push({count:1,added:n,removed:r})},extractCommon:function(t,n,r,o){for(var s=n.length,i=r.length,a=t.newPos,l=a-o,u=0;a+1<s&&l+1<i&&this.equals(n[a+1],r[l+1]);)a++,l++,u++;return u&&t.components.push({count:u}),t.newPos=a,l},equals:function(t,n){return this.options.comparator?this.options.comparator(t,n):t===n||this.options.ignoreCase&&t.toLowerCase()===n.toLowerCase()},removeEmpty:function(t){for(var n=[],r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function uL(e,t,n,r,o){for(var s=0,i=t.length,a=0,l=0;s<i;s++){var u=t[s];if(u.removed){if(u.value=e.join(r.slice(l,l+u.count)),l+=u.count,s&&t[s-1].added){var f=t[s-1];t[s-1]=t[s],t[s]=f}}else{if(!u.added&&o){var c=n.slice(a,a+u.count);c=c.map(function(g,y){var v=r[l+y];return v.length>g.length?v:g}),u.value=e.join(c)}else u.value=e.join(n.slice(a,a+u.count));a+=u.count,u.added||(l+=u.count)}}var d=t[i-1];return i>1&&typeof d.value=="string"&&(d.added||d.removed)&&e.equals("",d.value)&&(t[i-2].value+=d.value,t.pop()),t}function cL(e){return{newPos:e.newPos,components:e.components.slice(0)}}var dL=new er;function k1(e,t,n){return dL.diff(e,t,n)}var C1=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,T1=/\S/,P1=new er;P1.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!T1.test(e)&&!T1.test(t)};P1.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&C1.test(t[n])&&C1.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};var R1=new er;R1.tokenize=function(e){var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var o=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=o:(this.options.ignoreWhitespace&&(o=o.trim()),t.push(o))}return t};var fL=new er;fL.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var pL=new er;pL.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function td(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?td=function(t){return typeof t}:td=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(e)}var mL=Object.prototype.toString,Ka=new er;Ka.useLongestToken=!0;Ka.tokenize=R1.tokenize;Ka.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,o=r===void 0?function(s,i){return typeof i=="undefined"?n:i}:r;return typeof e=="string"?e:JSON.stringify(Jg(e,null,null,o),o," ")};Ka.equals=function(e,t){return er.prototype.equals.call(Ka,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Jg(e,t,n,r,o){t=t||[],n=n||[],r&&(e=r(o,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return n[s];var i;if(mL.call(e)==="[object Array]"){for(t.push(e),i=new Array(e.length),n.push(i),s=0;s<e.length;s+=1)i[s]=Jg(e[s],t,n,r,o);return t.pop(),n.pop(),i}if(e&&e.toJSON&&(e=e.toJSON()),td(e)==="object"&&e!==null){t.push(e),i={},n.push(i);var a=[],l;for(l in e)e.hasOwnProperty(l)&&a.push(l);for(a.sort(),s=0;s<a.length;s+=1)l=a[s],i[l]=Jg(e[l],t,n,r,l);t.pop(),n.pop()}else i=e;return i}var eh=new er;eh.tokenize=function(e){return e.slice()};eh.join=eh.removeEmpty=function(e){return e};function A1(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function Gr(e,t,n=10){let r=typeof e,o=typeof t;if(n===0)throw new Error("Max depth deepEqual, possible circular references?");return r!==o?!1:e==null||r==="string"||r==="number"||r==="boolean"?e===t:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:e.every((s,i)=>Gr(s,t[i],n-1)):A1(e)&&A1(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>Gr(e[i],t[i],n-1)):!1}function gL(e){return Math.max(...e.map(t=>t.length))}function hL(e,t){let n=e.reduce((r,o)=>{if(o){let s=r[o]?r[o]+1:1;return I(T({},r),{[o]:s})}return r},{});return Object.keys(n).reduce((r,o)=>(n[o]<t&&r.push(o),r),[])}function I1(e,t){let r=[...e.map(({text:o})=>o.split(/\b(\w+)\b/))];for(let o=0;o<gL(r);o++){let s=hL(r.map(a=>a[o]),t),i=r.filter(a=>!s.includes(a[o]));if(i.length>=t)r=i;else return{text:r[0].slice(0,o).join("").replace(/ (\?| |!|\.|,|\n)/g,"$1").trimEnd(),source:"mixed"}}}var yL=2;function L1(e,t=""){if(e.length===0)return;if(e.length===1)return e[0];let n=I1(e,yL);return n&&n.text!==t?n:e[0]}var vL={info(...e){console.info("[Deepdesk]",...e)},warn(...e){console.warn("[Deepdesk]",...e)},error(...e){console.error("[Deepdesk]",...e)}},H=vL;var O1={current:null,isSupported:null},xe=Ie("resetConversation"),ri=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.sessionId)||null},Yr=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.id)||null},oi=e=>e.conversation.isSupported,th=V("conversation/isSupported",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.isConversationSupported(e.sessionId,e.options)}),nd=V("conversation/create",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.createConversation(e)}),rd=V("conversation/bySessionId",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationBySessionId(e.sessionId,e.options)}),od=V("conversation/update",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Yr(t.getState());if(!r)throw new Error("No current conversation to update");return n.updateConversation(r,e)}),nh=V("conversation/upsert",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationBySessionId(e.sessionId).catch(()=>null).then(r=>{if(!r)return n.createConversation(e);let{agentId:o,agentName:s,agentEmail:i,agentNickname:a,tags:l}=e;return n.updateConversation(r.id,{agentId:o,agentEmail:i,agentName:s,agentNickname:a,tags:l})})}),sd=V("conversation/postMessages",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Yr(t.getState());if(!r)throw new Error("No current conversation to update messages");return n.postMessages(r,e.map(o=>T({},o)))}),SL=[nd.rejected,rd.rejected,od.rejected,sd.rejected].map(e=>e==null?void 0:e.toString()),xL=J({name:"conversation",initialState:O1,reducers:{},extraReducers:e=>{e.addCase(th.fulfilled,(t,n)=>{t.isSupported=n.payload}).addCase(nd.fulfilled,(t,n)=>{var r,o;t.current=n.payload,t.isSupported=(o=(r=n.payload)==null?void 0:r.hasActiveProfile)!=null?o:null}).addCase(rd.fulfilled,(t,n)=>{var r,o;t.current=n.payload,t.isSupported=(o=(r=n.payload)==null?void 0:r.hasActiveProfile)!=null?o:null}).addCase(nh.fulfilled,(t,n)=>{var r,o;t.current=n.payload,t.isSupported=(o=(r=n.payload)==null?void 0:r.hasActiveProfile)!=null?o:null}).addCase(od.fulfilled,(t,n)=>{var r,o;t.current=n.payload,t.isSupported=(o=(r=n.payload)==null?void 0:r.hasActiveProfile)!=null?o:null}).addCase(sd.fulfilled,(t,n)=>{t.current&&(t.current.messages=n.payload)}).addCase(xe,()=>O1).addMatcher(t=>SL.includes(t.type),(t,n)=>{var r;throw H.info("Conversation action rejected",n.type,((r=n.error)==null?void 0:r.message)||"No message"),new Error(n.error.message)})}}),N1=xL.reducer;var Ao={text:"",html:null,selection:{start:0,end:0},beforeInputChange:null,mixedSuggestion:null,textSuggestions:[],selectedSuggestionIndex:-1,metrics:{numCharsTyped:0,numCharsPasted:0,numCharsCut:0,numCharsDeleted:0,numPaste:0,agentStartedTypingTimestamp:null,externalTimeTotalSeconds:null,pastes:[],deletions:[],offeredTextSuggestions:[],textSuggestions:[],cuts:[]}};function rh(e){let{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:s}=e;return{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:s}}var id=Ie("input/replaceText"),Io=Ie("input/sendMessage"),ad=Ie("input/applyImageSuggestion"),ct=Ie("input/sendEvent"),M1=J({name:"input",initialState:Ao,reducers:{setInput(e,t){var s,i;let{beforeInputChange:n}=e,{text:r,html:o}=t.payload;if(e.text=r,e.html=o!=null?o:null,r==="")e.metrics=Ao.metrics,e.textSuggestions=[],e.mixedSuggestion=null;else if(n!==null&&e.text!==n.text){let{key:a,shiftKey:l,ctrlKey:u,metaKey:c,altKey:f}=n.keyDown;switch(a){case"Enter":l&&(e.metrics.numCharsTyped+=1);break;case"Backspace":case"Delete":{let{text:d}=e,g=k1(n.text,d);n.text.length-d.length>1&&e.metrics.deletions.push(...g.filter(y=>y.removed).map(y=>y.value)),e.metrics.numCharsDeleted+=n.text.length-d.length;break}case"Shift":case"Meta":case"Tab":break;case"C":case"V":case"X":case"c":case"v":case"x":if(u||c)break;default:if(!u&&!c&&!f){e.metrics.numCharsTyped+=1;let d=((s=n.selection)==null?void 0:s.start)!==void 0&&((i=n.selection)==null?void 0:i.end)!==void 0?n.text.substring(n.selection.start,n.selection.end):null;d&&d.length>0&&(e.metrics.numCharsDeleted+=d.length,e.metrics.deletions.push(d))}}e.metrics.agentStartedTypingTimestamp||(e.metrics.agentStartedTypingTimestamp=Date.now())}e.beforeInputChange=null},setSelection(e,t){t.payload!==null&&(Gr(e.selection,t.payload)||(e.selection=t.payload))},commitSuggestion(e,t){let n=t.payload,{text:r,suggestion:{source:o,abVariant:s,abTestName:i,trainingJobs:a,sourceText:l,searchTerm:u,text:c},eventMetrics:{inputType:f},replace:d}=n,g=o==="search"||o==="personal-collection-search",y=r.slice(e.text.substring(0,e.selection.start).length);(g||d==="selection")&&(y=r),n.suggestion.source==="search-overlay"&&(y=c),e.metrics.textSuggestions.push({text:y,source:o,abVariant:s,abTestName:i,inputType:f,sourceText:l,trainingJobs:a||[],searchTerm:g?e.text:u}),e.textSuggestions=[],e.selectedSuggestionIndex=-1},offeredTextSuggestion(e,t){let{text:n,suggestion:{source:r}}=t.payload;e.metrics.offeredTextSuggestions.find(s=>s.text===n)||e.metrics.offeredTextSuggestions.push({text:n,source:r})},registerKeyDown(e,t){let{key:n}=t.payload;["Control","Meta","Shift","Alt"].includes(n)||(e.beforeInputChange={text:e.text,selection:e.selection,keyDown:t.payload})},registerKeyUp(e,t){},registerCut(e,t){let{metrics:n}=e,r=t.payload;e.metrics=I(T({},e.metrics),{numCharsCut:n.numCharsCut+r.length,cuts:[...n.cuts,r]})},registerPaste(e,t){let{metrics:n}=e,{text:r,selectionText:o}=t.payload,s=n.numCharsDeleted+(o&&o.length?o.length:0),i=o&&o.length?[...n.deletions,o]:n.deletions;e.metrics=I(T({},e.metrics),{numCharsDeleted:s,deletions:i,numCharsPasted:n.numCharsPasted+r.length,numPaste:n.numPaste+1,pastes:[...n.pastes,r]})},selectNextTextSuggestion(e){let t=e.textSuggestions.length;e.selectedSuggestionIndex=e.selectedSuggestionIndex<t-1?e.selectedSuggestionIndex+1:e.selectedSuggestionIndex},selectPreviousTextSuggestion(e){e.selectedSuggestionIndex=e.selectedSuggestionIndex>=0?e.selectedSuggestionIndex-1:e.selectedSuggestionIndex},selectTextSuggestionByIndex(e,t){e.selectedSuggestionIndex=t.payload},setTextSuggestions(e,t){if(e.selectedSuggestionIndex=-1,e.textSuggestions=t.payload,t.payload.length===0){e.mixedSuggestion=null;return}let n=e.text.substring(0,e.selection.end),r=L1(t.payload,n);e.mixedSuggestion=r!=null&&r.text.includes(n)?r:null},setMetrics(e,{payload:t}){e.metrics=t},resetMetrics(e){e.metrics=Ao.metrics}},extraReducers:e=>{e.addCase(xe,t=>{t.mixedSuggestion=Ao.mixedSuggestion,t.textSuggestions=Ao.textSuggestions,t.selectedSuggestionIndex=Ao.selectedSuggestionIndex,t.metrics=Ao.metrics})}}),si=e=>e.input.text.substring(0,e.input.selection.end),wL=e=>e.input.selection,ii=e=>{let{mixedSuggestion:t,selectedSuggestionIndex:n,textSuggestions:r}=e.input;return n>-1?r[n]:t},_1=()=>M(wL),{commitSuggestion:dn,offeredTextSuggestion:D1,registerCut:F1,registerKeyDown:H1,registerKeyUp:U1,registerPaste:z1,selectNextTextSuggestion:j1,selectPreviousTextSuggestion:B1,selectTextSuggestionByIndex:ld,setInput:ud,setMetrics:V1,setSelection:cd,setTextSuggestions:Qr,resetMetrics:K1}=M1.actions,W1=M1.reducer;var EL={agentInfo:void 0,agentSettings:{},visitorInfo:void 0,customData:void 0,platformVariables:void 0,fetchState:"idle"},$a=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)||""}},bL=[["agentNickname","nickname"],["agentDefaultLocale","defaultLocale"],["agentEmail","email"]],Wa=V("info/setAgentInfo",(e,t)=>P(void 0,null,function*(){var s,i,a;let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=[];if(e.agentId&&e.skipSync!==!0&&o.push(n.postIdentity({externalId:e.agentId})),e.skipSync!==!0){let l=bL.reduce((u,[c,f])=>!r[f]&&c in e?I(T({},u),{[f]:e[c]}):u,{});Object.keys(l).length>0&&o.push(n.patchMe(l).then(u=>r=u))}return o.length>0&&(yield Promise.all(o)),{agentId:e.agentId,agentName:e.agentName,agentNickname:(s=r.nickname)!=null?s:e.agentNickname,agentEmail:(i=r.email)!=null?i:e.agentEmail,agentDefaultLocale:(a=r.defaultLocale)!=null?a:e.agentDefaultLocale,agentTimeZone:e.agentTimeZone}})),oh=V("info/setAgentSettings",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=T(T({},typeof r.uiConfig=="object"?r.uiConfig:{}),e);return yield n.patchMe({uiConfig:o}),o})),sh=V("info/getAgentSettings",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n}=t.extra;return(yield n.getMe()).uiConfig})),$1=e=>e.info.agentInfo,q1=e=>e.info.customData,G1=J({name:"info",initialState:EL,reducers:{setVisitorInfo(e,t){e.visitorInfo=T(T({},e.visitorInfo),t.payload)},setCustomData(e,t){e.customData=t.payload},setPlatformVariables(e,t){e.platformVariables=t.payload}},extraReducers:e=>{e.addCase(Wa.pending,(t,n)=>{t.fetchState="loading",t.agentInfo=T(T({},t.agentInfo),n.meta.arg)}).addCase(Wa.rejected,t=>{t.fetchState="error"}).addCase(Wa.fulfilled,(t,n)=>{t.fetchState="done",t.agentInfo=n.payload}).addCase(oh.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(sh.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(xe,t=>{t.visitorInfo=void 0})}}),{setVisitorInfo:Y1,setCustomData:Q1,setPlatformVariables:X1}=G1.actions,Z1=G1.reducer;function qe(e,t){return Object.entries(t).reduce((n,[r,o])=>n.replaceAll(r,o),e)}var dd={list:[],fetchState:"idle",isOpen:!1,page:"search",aggregates:{}},J1=e=>e.search.isOpen,eE=e=>e.search.page,tE=e=>e.search.list,nE=e=>e.search.aggregates;function rE(e,t=n=>n){return n=>n.search.list.filter(r=>r.type===e).map(t)}var Lo=V("search/getAll",(e,t)=>P(void 0,null,function*(){var l;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(l=r.conversation.current)==null?void 0:l.profileCode,{platformVariables:s}=r.info;if(!o)throw new Error("Profile should be provided in order to be able to search");let{results:i,aggregates:a}=yield n.search({profile:o,query:e.query,tags:e.tags,size:e.size,current:e.current,filters:{type:e.type},params:$a(r)});return{results:i.map(u=>I(T(T({},u),u.title&&s?{title:qe(u.title,s)}:{}),{text:qe(u.text,s!=null?s:{}),source:`search-${u.type.toLowerCase()}`,searchTerm:e.query})),aggregates:a}})),oE=J({name:"search",initialState:dd,reducers:{setIsOpen(e,t){e.isOpen=t.payload},setPage(e,t){e.page=t.payload},resetSearch(e){e.fetchState=dd.fetchState,e.list=dd.list}},extraReducers:e=>{e.addCase(Lo.pending,t=>{t.fetchState="loading"}).addCase(Lo.rejected,(t,n)=>{t.fetchState="error",H.error(n.error)}).addCase(Lo.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload.results,t.aggregates=n.payload.aggregates||{}}).addCase(xe,()=>dd)}}),{resetSearch:fd,setIsOpen:Nt,setPage:fn}=oE.actions,sE=oE.reducer;var ih="SetCues",ah="SetOutputs",ai="ShowLoginOverlay",qa="UserLoggedIn",CL="UserLoggedOut",Xr="ApplySuggestion",lh="ApplyImageSuggestion",TL="ShowCommandPalette",kL=e=>({[ih]:t=>{e.dispatch(I(T({},t),{isBroadcasted:!0}))},[ah]:t=>{e.dispatch(I(T({},t),{isBroadcasted:!0}))},[TL]:t=>{e.dispatch(Nt(t.isOpen)),t.page&&e.dispatch(fn(t.page))},[ai]:t=>{e.dispatch(E1(t))},[qa]:()=>{e.dispatch(Jn())},[CL]:()=>{e.dispatch(Jn())},[lh]:t=>{e.dispatch(ad({suggestion:t.suggestion}))},[Xr]:t=>{e.dispatch(dn(I(T({},t),{eventMetrics:{inputType:"mouse"},replace:"selection"})))}}),iE=kL;var Ga=x(D()),lE=x(C()),aE=Ga.default.createContext(null),Oo=({broadcastEvents:e,children:t})=>{let n=Ga.default.useMemo(()=>e,[]);return(0,lE.jsx)(aE.Provider,{value:n,children:t})},Xt=()=>{let e=(0,Ga.useContext)(aE);if(!e)throw new Error("You should use the useBroadcastEvents within a BroadcastEventsProvider");return e};var Ad=x(se()),mn=x(D());var kd=x(D());var uh=function(e,t){return uh=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])},uh(e,t)};function Ya(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");uh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Mt=function(){return Mt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Mt.apply(this,arguments)};function uE(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 pd(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var md;(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"})(md||(md={}));var gd=class{constructor(t){console.warn(`[vite-messages-plugin]: Message "${t}" was not precompiled. Did you use the correct extenstion *.messages.ts?`)}};var pn;(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"})(pn||(pn={}));var hd;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(hd||(hd={}));function ch(e){return e.type===pn.literal}function cE(e){return e.type===pn.argument}function yd(e){return e.type===pn.number}function vd(e){return e.type===pn.date}function Sd(e){return e.type===pn.time}function xd(e){return e.type===pn.select}function wd(e){return e.type===pn.plural}function dE(e){return e.type===pn.pound}function Ed(e){return e.type===pn.tag}function bd(e){return!!(e&&typeof e=="object"&&e.type===hd.number)}function Qa(e){return!!(e&&typeof e=="object"&&e.type===hd.dateTime)}function dh(e){e.forEach(function(t){if(delete t.location,xd(t)||wd(t))for(var n in t.options)delete t.options[n].location,dh(t.options[n].value);else yd(t)&&bd(t.style)||(vd(t)||Sd(t))&&Qa(t.style)?delete t.style.location:Ed(t)&&dh(t.children)})}function fE(e,t){t===void 0&&(t={}),t=Mt({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new gd(e,t).parse();if(n.err){var r=SyntaxError(md[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||dh(n.val),n.val}function Cd(e,t){var n=t&&t.cache?t.cache:OL,r=t&&t.serializer?t.serializer:LL,o=t&&t.strategy?t.strategy:RL;return o(e,{cache:n,serializer:r})}function PL(e){return e==null||typeof e=="number"||typeof e=="boolean"}function pE(e,t,n,r){var o=PL(r)?r:n(r),s=t.get(o);return typeof s=="undefined"&&(s=e.call(this,r),t.set(o,s)),s}function mE(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),s=t.get(o);return typeof s=="undefined"&&(s=e.apply(this,r),t.set(o,s)),s}function fh(e,t,n,r,o){return n.bind(t,e,r,o)}function RL(e,t){var n=e.length===1?pE:mE;return fh(e,this,n,t.cache.create(),t.serializer)}function AL(e,t){return fh(e,this,mE,t.cache.create(),t.serializer)}function IL(e,t){return fh(e,this,pE,t.cache.create(),t.serializer)}var LL=function(){return JSON.stringify(arguments)};function ph(){this.cache=Object.create(null)}ph.prototype.get=function(e){return this.cache[e]};ph.prototype.set=function(e,t){this.cache[e]=t};var OL={create:function(){return new ph}},Td={variadic:AL,monadic:IL};var No;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(No||(No={}));var Xa=function(e){Ya(t,e);function t(n,r,o){var s=e.call(this,n)||this;return s.code=r,s.originalMessage=o,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error);var mh=function(e){Ya(t,e);function t(n,r,o,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(o).join('", "'),'"'),No.INVALID_VALUE,s)||this}return t}(Xa);var gE=function(e){Ya(t,e);function t(n,r,o){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),No.INVALID_VALUE,o)||this}return t}(Xa);var hE=function(e){Ya(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,'"'),No.MISSING_VALUE,r)||this}return t}(Xa);var st;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(st||(st={}));function NL(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==st.literal||n.type!==st.literal?t.push(n):r.value+=n.value,t},[])}function ML(e){return typeof e=="function"}function Za(e,t,n,r,o,s,i){if(e.length===1&&ch(e[0]))return[{type:st.literal,value:e[0].value}];for(var a=[],l=0,u=e;l<u.length;l++){var c=u[l];if(ch(c)){a.push({type:st.literal,value:c.value});continue}if(dE(c)){typeof s=="number"&&a.push({type:st.literal,value:n.getNumberFormat(t).format(s)});continue}var f=c.value;if(!(o&&f in o))throw new hE(f,i);var d=o[f];if(cE(c)){(!d||typeof d=="string"||typeof d=="number")&&(d=typeof d=="string"||typeof d=="number"?String(d):""),a.push({type:typeof d=="string"?st.literal:st.object,value:d});continue}if(vd(c)){var g=typeof c.style=="string"?r.date[c.style]:Qa(c.style)?c.style.parsedOptions:void 0;a.push({type:st.literal,value:n.getDateTimeFormat(t,g).format(d)});continue}if(Sd(c)){var g=typeof c.style=="string"?r.time[c.style]:Qa(c.style)?c.style.parsedOptions:r.time.medium;a.push({type:st.literal,value:n.getDateTimeFormat(t,g).format(d)});continue}if(yd(c)){var g=typeof c.style=="string"?r.number[c.style]:bd(c.style)?c.style.parsedOptions:void 0;g&&g.scale&&(d=d*(g.scale||1)),a.push({type:st.literal,value:n.getNumberFormat(t,g).format(d)});continue}if(Ed(c)){var y=c.children,v=c.value,p=o[v];if(!ML(p))throw new gE(v,"function",i);var m=Za(y,t,n,r,o,s),h=p(m.map(function(k){return k.value}));Array.isArray(h)||(h=[h]),a.push.apply(a,h.map(function(k){return{type:typeof k=="string"?st.literal:st.object,value:k}}))}if(xd(c)){var S=c.options[d]||c.options.other;if(!S)throw new mh(c.value,d,Object.keys(c.options),i);a.push.apply(a,Za(S.value,t,n,r,o));continue}if(wd(c)){var S=c.options["=".concat(d)];if(!S){if(!Intl.PluralRules)throw new Xa(`Intl.PluralRules is not available in this environment.
14
14
  Try polyfilling it using "@formatjs/intl-pluralrules"
15
- `,No.MISSING_INTL_API,i);var w=n.getPluralRules(t,{type:c.pluralType}).select(d-(c.offset||0));S=c.options[w]||c.options.other}if(!S)throw new mh(c.value,d,Object.keys(c.options),i);a.push.apply(a,Za(S.value,t,n,r,o,d-(c.offset||0)));continue}}return NL(a)}function _L(e,t){return t?Mt(Mt(Mt({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=Mt(Mt({},e[r]),t[r]||{}),n},{})):e}function DL(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=_L(e[r],t[r]),n},Mt({},e)):e}function gh(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function FL(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.number),strategy:Td.variadic}),getDateTimeFormat:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.dateTime),strategy:Td.variadic}),getPluralRules:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.pluralRules),strategy:Td.variadic})}}var yE=function(){function e(t,n,r,o){n===void 0&&(n=e.defaultLocale);var s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var c=s.formatToParts(u);if(c.length===1)return c[0].value;var f=c.reduce(function(d,g){return!d.length||g.type!==st.literal||typeof d[d.length-1]!="string"?d.push(g.value):d[d.length-1]+=g.value,d},[]);return f.length<=1?f[0]||"":f},this.formatToParts=function(u){return Za(s.ast,s.locales,s.formatters,s.formats,u,void 0,s.message)},this.resolvedOptions=function(){var u;return{locale:((u=s.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.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 i=o||{},a=i.formatters,l=uE(i,["formatters"]);this.ast=e.__parse(t,Mt(Mt({},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=DL(e.formats,r),this.formatters=o&&o.formatters||FL(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!="undefined"){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=fE,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 HL(e,t){return t.split(".").reduce((n,r)=>n?n[r]:void 0,e)}var UL="dummy",hh=(0,kd.createContext)(null);function Y(e){var r;let t=(0,kd.useContext)(hh);if(!t)throw new Error("useTranslator() may be used only in the context of a <LocaleContext> component.");let n=(r=e[t])!=null?r:{};return(o,s)=>{let i=HL(n,o);return i?new yE(i).format(s):(t!==UL&&console.warn(`${o} does not exist in messages of ${t}`),`[${o}]`)}}var Pd=x(D());var vE={root:"dd-tvkOF",content:"dd-eXA1D"};var yh=x(C()),zL=({isOpen:e,autoFocus:t,children:n,onClose:r,onBack:o,onKeyDown:s,overlayAriaLabel:i,contentAriaLabel:a})=>{let l=(0,Pd.useRef)(null),u=L("Dialog",vE),c=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),o();return}s&&s(d)},f=d=>{d.target===l.current&&e&&r()};return(0,Pd.useEffect)(()=>{var d,g;!l.current||!e||!t||(g=(d=l.current)==null?void 0:d.querySelector("input, textarea"))==null||g.focus()},[e,t,l]),e?(0,yh.jsx)("div",{role:"dialog","data-testid":"dialog",className:u.root,"aria-label":i,ref:l,onKeyDown:c,onMouseDown:f,children:(0,yh.jsx)("div",{"data-testid":"dialog-content",className:u.content,"aria-label":a,children:n})}):null},Rd=zL;var xE=x(se());var SE={root:"dd-ranhW"};var wE=x(C()),jL=r=>{var o=r,{className:e,value:t}=o,n=ee(o,["className","value"]);let s=L("TextInput",SE);return(0,wE.jsx)("input",T({className:(0,xE.default)(e,s.root),type:"text",value:t},n))},Ja=jL;var vh={};Xe(vh,{enUS:()=>BL,nlNL:()=>VL});var BL={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"}]},VL={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 EE={root:"dd-lWxnE",anchorButton:"dd-TZ4in",errorMessage:"dd-fIsPg",title:"dd-pGhJx",subtitle:"dd-f5l29",text:"dd-iamoD",input:"dd-uhQZ3",actions:"dd-lubvx",button:"dd-CJsNI",primaryButton:"dd-MWBfl"};var Oe=x(C());var KL=e=>{try{let t=new URL(e);return new URLSearchParams(t.search).get("token")||void 0}catch(t){return e}},WL=({agentEmail:e,isOpen:t,origin:n="",onSuccess:r,onDismiss:o})=>{let s=Y(vh),i=L("LoginTokenDialog",EE),a=M(v1),l=G(),u=z("productName"),[c,f]=(0,mn.useState)(e||""),[d,g]=(0,mn.useState)(0),[y,v]=(0,mn.useState)(""),p=(0,mn.useCallback)(w=>P(void 0,null,function*(){w.preventDefault(),l(x1({email:c})),g(1)}),[n,c]),m=()=>{v(""),g(0)},h=(0,mn.useCallback)(w=>P(void 0,null,function*(){w.preventDefault();let k=KL(w.target.elements.token.value);if(!k){v(s("verifyCodeError",{login:S}));return}l(Va({token:k}))}),[n]),S=(0,mn.useMemo)(()=>w=>(0,Oe.jsx)("button",{type:"button","data-testid":"login-token-dialog-back-button",className:i.anchorButton,onClick:m,children:w},"back-button"),[]);return(0,mn.useEffect)(()=>{a==="error"&&v(s("verifyCodeError",{login:S})),a==="done"&&r()},[a]),(0,Oe.jsx)(Rd,{autoFocus:!0,isOpen:t,contentAriaLabel:s("promptTitle",{productName:u}),overlayAriaLabel:s("promptTitle",{productName:u}),onClose:o,onBack:o,children:(0,Oe.jsxs)("div",{className:i.root,children:[(0,Oe.jsx)("h1",{className:i.title,children:s("promptTitle",{productName:u})}),d===0&&(0,Oe.jsxs)("form",{onSubmit:p,children:[(0,Oe.jsx)("h2",{className:i.subtitle,children:s("requestCodeTitle")}),(0,Oe.jsx)("p",{className:i.text,children:s("requestCodeBody",{productName:u})}),(0,Oe.jsx)(Ja,{className:i.input,name:"email",placeholder:s("requestCodeInputPlaceholder"),value:c,onChange:w=>f(w.target.value)}),(0,Oe.jsx)("div",{className:i.actions,children:(0,Oe.jsx)("button",{type:"submit",className:(0,Ad.default)(i.button,i.primaryButton),children:s("requestCodeSubmitLabel")})})]}),d===1&&(0,Oe.jsxs)("form",{onSubmit:h,children:[(0,Oe.jsx)("h2",{className:i.subtitle,children:s("verifyCodeTitle")}),(0,Oe.jsx)("p",{className:i.text,children:s("verifyCodeBody")}),(0,Oe.jsx)(Ja,{className:i.input,name:"token",placeholder:s("verifyCodeInputPlaceholder"),disabled:["loading","done"].includes(a)}),y&&(0,Oe.jsx)("div",{className:i.errorMessage,children:y}),(0,Oe.jsxs)("div",{className:i.actions,children:[(0,Oe.jsx)("button",{type:"button",className:(0,Ad.default)(i.button),onClick:m,children:s("back")}),(0,Oe.jsx)("button",{type:"submit",className:(0,Ad.default)(i.button,i.primaryButton),disabled:["loading","done"].includes(a),children:s("verifyCodeSubmitLabel")})]})]})]})})},bE=WL;var TE=x(C()),$L=()=>{let e=M(S1),t=M($1),n=z("adminUrl"),r=Xt(),o=()=>r.send(ai,!1),s=()=>{r.send(ai,!1),r.send(qa)};return(0,TE.jsx)(bE,{isOpen:e,agentEmail:t==null?void 0:t.agentEmail,origin:n,onDismiss:o,onSuccess:s})},CE=$L;var Hb=x(wh()),ft=x(D());var cO={data:null,fetchState:"idle"},AE=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},el=V("knowledgeAssistant/getKnowledgeAssistant",(e,t)=>P(void 0,null,function*(){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");let s=(i=r.profile.data)==null?void 0:i.knowledgeAssistant;return s?n.getKnowledgeAssistant(s):null})),dO=J({name:"knowledgeAssistant",initialState:cO,reducers:{},extraReducers:e=>{e.addCase(el.pending,t=>{t.fetchState="loading"}).addCase(el.rejected,t=>{t.fetchState="error"}).addCase(el.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),IE=dO.reducer;var LE={cues:[],threads:{},fetchState:"idle"},OE=e=>{var t;return(t=e.assistants)==null?void 0:t.cues},Eh=e=>t=>{var n,r;return(r=(n=t.assistants)==null?void 0:n.threads[e])!=null?r:null},Id=Ie("assistants/callToAction"),li=V("assistants/getSummary",(e,t)=>P(void 0,null,function*(){var i,a,l;let r=t.getState().profile.data;if(!r)throw new Error("No Profile is loaded");let{summarizerAssistantNew:o}=r;if(!o){let{deepdeskAPI:u,dynamicThunkObject:c}=t.extra,f=t.getState(),d=(i=f.conversation.current)==null?void 0:i.sessionId,g=(l=(a=f.info)==null?void 0:a.agentInfo)==null?void 0:l.agentId;if(!c.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let y=c.conversationQuery,v=yield y(),p=yield u.getSummary(v,{externalConversationId:d,agentId:g,promptInstruction:r.summarizerPromptInstruction,model:r.summarizerModel});return p.summary?p.summary:Promise.reject(new Error("Summary is not provided"))}let s=yield t.dispatch(tr(T({assistantCode:o,expectFormat:"text",transcript:"in-memory-transcript",skipState:!0},e)));if(s.error)throw new Error(s.error.message);if(typeof s.payload!="string")throw H.warn("Unexpected summary output",s),new Error("Unexpected summary output");return s.payload})),fO=1,bh=V("assistants/evaluateKnowledgeAssistant",(e,t)=>P(void 0,null,function*(){var f,d,g,y;let{threadId:n}=e,{onNewThreadId:r,input:o}=e,{deepdeskAPI:s}=t.extra,i=t.getState(),{platformVariables:a}=i.info;if(!i.profile.data)throw new Error("No Profile is loaded");let{knowledgeAssistantNew:l}=i.profile.data;if(!l){n||(n=fO++,r&&r(n));let v=(f=Eh(n)(i))!=null?f:[],p=AE(i),m=(d=i.conversation.current)==null?void 0:d.sessionId,h=(y=(g=i.info)==null?void 0:g.agentInfo)==null?void 0:y.agentId;if(!p)throw new Error("KnowledgeAssistant is not defined");let S=yield s.knowledgeAssist({customerInstruction:p.customerInstruction,doNotKnowAnswer:p.doNotKnowAnswer,question:o},v,p.code,{agentId:h,conversationId:m});return a&&(S.answer=qe(S.answer,a)),{threadId:n,question:o,answer:S}}n||(n=(yield s.createAssistantThread({assistantCode:l})).id,r&&r(n)),yield s.postMessageToAssistantThread({assistantCode:l,threadId:n,message:e.input});let u=yield t.dispatch(tr(I(T({assistantCode:l,expectFormat:"json-schema:knowledge-assist",skipState:!0},e),{input:{},threadId:n})));if(u.error)throw new Error(u.error.message);let c=u.payload;return{threadId:n,question:e.input,answer:{answer:qe(c.response,a!=null?a:{}),sources:c.sources}}})),tr=V("assistants/evaluate",(e,t)=>P(void 0,null,function*(){var g;let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra,{transcript:o,input:s={},expectFormat:i,threadId:a}=e,l=t.getState(),{platformVariables:u}=l.info,c=(g=l.conversation.current)==null?void 0:g.sessionId,f;if(o==="in-memory-transcript"){if(!r.conversationQuery)throw new Error("Can't include in-memory-transcript, setConversationQuery is not defined");f=yield r.conversationQuery()}else if(o==="stored-transcript"){if(!l.conversation.current)throw new Error("Can't include stored-transcript, no current conversation");f=l.conversation.current.messages.map(y=>({text:y.text,source:y.source}))}else Array.isArray(o)&&(f=o);if(e.includeTags){if(!l.conversation.current)throw new Error("Can't include tags, no current conversation");let{tags:y}=l.conversation.current;Object.assign(s,{tags:y})}let d=yield n.evaluateAssistant(e.assistantCode,{expectFormat:i,input:s,transcript:f,externalConversationId:c,threadId:a});if(!u)return d;switch(i){case"text":return qe(d,u);case"json-schema:cues":return d.map(y=>I(T({},y),{name:qe(y.name,u),response:qe(y.response,u)}));case"json-schema:knowledge-assist":{let y=d;return I(T({},y),{answer:qe(y.response,u)})}case"json-object":default:return d}})),NE=J({name:"assistants",initialState:LE,reducers:{resetCues(e){e.cues=[]},removeCueByCode(e,t){e.cues=e.cues.filter(n=>n.code!==t.payload.code)},removeThreadById(e,t){delete e.threads[t.payload]}},extraReducers:e=>{e.addCase(tr.pending,(t,n)=>{n.meta.arg.skipState||(t.fetchState="loading")}).addCase(tr.rejected,(t,n)=>{n.meta.arg.skipState||(t.fetchState="error")}).addCase(tr.fulfilled,(t,n)=>{if(!n.meta.arg.skipState)switch(n.meta.arg.expectFormat){case"json-schema:cues":{let r=n.payload,o=r.map(i=>i.code),s=t.cues.filter(i=>!o.includes(i.code));t.fetchState="done",t.cues=[...r,...s];break}}}).addCase(bh.fulfilled,(t,n)=>{let s=n.payload,{threadId:r}=s,o=ee(s,["threadId"]);t.threads[r]=[...t.threads[r]||[],o]}).addCase(xe,()=>LE)}}),{removeCueByCode:ME,resetCues:nF,removeThreadById:Ld}=NE.actions,_E=NE.reducer;var pO={data:null,fetchState:"idle"},DE=e=>e.contentTypes.data,tl=V("contentTypes/getContentTypes",(e,t)=>P(void 0,null,function*(){return t.extra.deepdeskAPI.getContentTypes()})),mO=J({name:"contentTypes",initialState:pO,reducers:{},extraReducers:e=>{e.addCase(tl.pending,t=>{t.fetchState="loading"}).addCase(tl.rejected,t=>{t.fetchState="error"}).addCase(tl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),FE=mO.reducer;var gO={data:null,fetchState:"idle"},nr=e=>e.profile.data,Od=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],HE=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,nl=V("profile/getProfile",(e,t)=>P(void 0,null,function*(){var s;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((s=r.profile.data)==null?void 0:s.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)})),hO=J({name:"profile",initialState:gO,reducers:{},extraReducers:e=>{e.addCase(nl.pending,t=>{t.fetchState="loading"}).addCase(nl.rejected,t=>{t.fetchState="error"}).addCase(nl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),UE=hO.reducer;function rr(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 ar=x(D());var zE=x(D()),Nd=x(se());var _t={root:"dd-U2SX4",list:"dd-cYTlj",listWrapper:"dd-GLQFR",listHorizontal:"dd-x-knl",page:"dd-1F4vk",search:"dd-nvbxc",pageNav:"dd-sRUuT",pageTitle:"dd-t-MKS",pageBackButton:"dd-cjptm",listHeader:"dd-Fg666",listHeading:"dd-w-xhJ",listMoreButton:"dd--mKep",listItem:"dd-wpvuA",listItemContent:"dd-V-mKo",listItemText:"dd-ukCHL",listItemDescription:"dd-sSyu4",listItemActions:"dd-xelho",truncate:"dd-IlopJ",lineClamp:"dd-Twaca",listItemTitle:"dd-lMGHq",listItemAction:"dd-xPLAs",listItemSelected:"dd-jFX0Y",sources:"dd-pZx4v",sourcesTitle:"dd-phYVd",source:"dd-DaR6h",sourceShowMore:"dd-M1-8j",icon:"dd-m6yxD",searchIcon:"dd-0AU-O",searchInputWrapper:"dd-DUFcE",searchInput:"dd-ukrlD",select:"dd--Tifv",selectType:"dd-IkZb2",selectWrapper:"dd-J14mx",image:"dd-RQgsB",imageSrc:"dd-jxh8F",imageSrcHidden:"dd-e20Jk",imageSrcStatus:"dd-j50Tt",imageTitle:"dd-qCjfW",actions:"dd-3mfWc",actionsWrapper:"dd-TjDyI",actionsBar:"dd-LiA35",actionButton:"dd-4wk0u",hasShortKeys:"dd-XilV-",actionShortcut:"dd-s4Mla",actionShortcutFixKerning:"dd-lyh5e"};var or={};Xe(or,{enUS:()=>yO,nlNL:()=>vO});var yO={visitUrl:[{type:0,value:"Visit"}],back:[{type:0,value:"Back"}],loading:[{type:0,value:"Loading..."}],imageError:[{type:0,value:"Could not load image"}],showAll:[{type:0,value:"Show more"}],sources:[{type:0,value:"Sources"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},vO={visitUrl:[{type:0,value:"Bekijk"}],back:[{type:0,value:"Terug"}],loading:[{type:0,value:"Laden..."}],imageError:[{type:0,value:"Kan afbeelding niet laden"}],showAll:[{type:0,value:"Toon meer"}],sources:[{type:0,value:"Bronnen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var Zr=x(C()),SO=({src:e,title:t})=>{let n=L("CommandPalette",_t),[r,o]=(0,zE.useState)("loading"),s=Y(or);return(0,Zr.jsxs)("div",{className:n.image,children:[(0,Zr.jsx)("img",{src:e,alt:t,onLoad:()=>o("done"),onError:()=>o("error"),className:(0,Nd.default)(n.imageSrc,{[n.imageSrcHidden]:["loading","error"].includes(r)})}),r==="loading"&&(0,Zr.jsx)("span",{className:(0,Nd.default)(n.imageSrc,n.imageSrcStatus),children:s("loading")}),r==="error"&&(0,Zr.jsx)("span",{className:(0,Nd.default)(n.imageSrc,n.imageSrcStatus),children:(0,Zr.jsx)(Xl,{})}),t&&(0,Zr.jsx)("span",{className:n.imageTitle,children:t})]})},jE=SO;var BE=x(D()),VE=x(se());var Mo=x(C());function Ch({children:e,heading:t,orientation:n,hasMore:r,onShowAll:o}){let s=Y(or),i=L("CommandPalette",_t);return BE.default.Children.count(e)===0?null:(0,Mo.jsxs)("div",{"data-testid":"commandpalette-list",className:i.list,children:[(t||r)&&(0,Mo.jsxs)("div",{className:i.listHeader,children:[t&&(0,Mo.jsx)("h4",{className:i.listHeading,children:t}),r&&o&&(0,Mo.jsx)("button",{onClick:o,className:i.listMoreButton,type:"button",children:s("showAll")})]}),(0,Mo.jsx)("div",{className:(0,VE.default)(i.listWrapper,n==="horizontal"&&i.listHorizontal),children:e})]})}var al=x(se());var Md=x(D());function rl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae=1,kh=2,Ph=4,_e=8,_d=16,ol=32,gn=64,Th={a:{content:ae|_e,self:!1,type:ae|_e|ol|gn},address:{invalid:["h1","h2","h3","h4","h5","h6","address","article","aside","section","div","header","footer"],self:!1},audio:{children:["track","source"]},br:{type:ae|_e,void:!0},body:{content:ae|kh|Ph|_e|_d|ol|gn},button:{content:_e,type:ae|_e|ol|gn},caption:{content:ae,parent:["table"]},col:{parent:["colgroup"],void:!0},colgroup:{children:["col"],parent:["table"]},details:{children:["summary"],type:ae|ol|gn},dd:{content:ae,parent:["dl"]},dl:{children:["dt","dd"],type:ae},dt:{content:ae,invalid:["footer","header"],parent:["dl"]},figcaption:{content:ae,parent:["figure"]},footer:{invalid:["footer","header"]},header:{invalid:["footer","header"]},hr:{type:ae,void:!0},img:{void:!0},li:{content:ae,parent:["ul","ol","menu"]},main:{self:!1},ol:{children:["li"],type:ae},picture:{children:["source","img"],type:ae|_e|_d},rb:{parent:["ruby","rtc"]},rp:{parent:["ruby","rtc"]},rt:{content:_e,parent:["ruby","rtc"]},rtc:{content:_e,parent:["ruby"]},ruby:{children:["rb","rp","rt","rtc"]},source:{parent:["audio","video","picture"],void:!0},summary:{content:_e,parent:["details"]},table:{children:["caption","colgroup","thead","tbody","tfoot","tr"],type:ae},tbody:{parent:["table"],children:["tr"]},td:{content:ae,parent:["tr"]},tfoot:{parent:["table"],children:["tr"]},th:{content:ae,parent:["tr"]},thead:{parent:["table"],children:["tr"]},tr:{parent:["table","tbody","thead","tfoot"],children:["th","td"]},track:{parent:["audio","video"],void:!0},ul:{children:["li"],type:ae},video:{children:["track","source"]},wbr:{type:ae|_e,void:!0}};function Do(e){return t=>{Th[t]=T(T({},e),Th[t])}}["address","main","div","figure","p","pre"].forEach(Do({content:ae,type:ae|gn}));["abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","ruby","samp","strong","sub","sup","time","u","var"].forEach(Do({content:_e,type:ae|_e|gn}));["p","pre"].forEach(Do({content:_e,type:ae|gn}));["s","small","span","del","ins"].forEach(Do({content:_e,type:ae|_e}));["article","aside","footer","header","nav","section","blockquote"].forEach(Do({content:ae,type:ae|kh|gn}));["h1","h2","h3","h4","h5","h6"].forEach(Do({content:_e,type:ae|Ph|gn}));["audio","canvas","iframe","img","video"].forEach(Do({type:ae|_e|_d|gn}));var il=Object.freeze(Th),Rh=["applet","base","body","command","embed","frame","frameset","head","html","link","meta","noscript","object","script","style","title"],Ah=Object.keys(il).filter(e=>e!=="canvas"&&e!=="iframe"),me=1,Ih=2,_o=3,Jr=4,Fd=5,Hd=Object.freeze({alt:me,cite:me,class:me,colspan:_o,controls:Jr,datetime:me,default:Jr,disabled:Jr,dir:me,height:me,href:me,id:me,kind:me,label:me,lang:me,loading:me,loop:Jr,media:me,muted:Jr,poster:me,rel:me,role:me,rowspan:_o,scope:me,sizes:me,span:_o,start:_o,style:Fd,src:me,srclang:me,srcset:me,tabindex:me,target:me,title:me,type:me,width:me}),Lh=Object.freeze({class:"className",colspan:"colSpan",datetime:"dateTime",rowspan:"rowSpan",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex"});function Dd(){return Dd=Object.assign||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},Dd.apply(this,arguments)}function Ud({attributes:e={},className:t,children:n=null,selfClose:r=!1,tagName:o}){let s=o;return r?Md.default.createElement(s,Dd({className:t},e)):Md.default.createElement(s,Dd({className:t},e),n)}var sl=class{attribute(t,n){return n}node(t,n){return n}};function KE(e,t,n,r=!1){let o=e.match(t instanceof RegExp?t:new RegExp(t,"i"));return o?I(T({match:o[0],void:r},n(o)),{index:o.index,length:o[0].length,valid:!0}):null}var sr=class{constructor(t,n,r){rl(this,"greedy",!1),rl(this,"options",void 0),rl(this,"propName",void 0),rl(this,"inverseName",void 0),rl(this,"factory",void 0),this.options=T({},n),this.propName=t,this.inverseName=`no${t.charAt(0).toUpperCase()+t.slice(1)}`,this.factory=r!=null?r:null}createElement(t,n){return this.factory?Md.default.createElement(this.factory,n,t):this.replaceWith(t,n)}doMatch(t,n,r,o=!1){return KE(t,n,r,o)}onBeforeParse(t,n){return t}onAfterParse(t,n){return t}};var Fo=x(D()),GE=x($E());function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EO=/(url|image|image-set)\(/i,Oh=class extends sl{attribute(t,n){return t==="style"&&Object.keys(n).forEach(r=>{String(n[r]).match(EO)&&delete n[r]}),n}},qE=1,bO=3,CO=/^<(!doctype|(html|head|body)(\s|>))/i,TO=/^(aria-|data-|\w+:)/iu,kO=/{{{(\w+)\/?}}}/;function PO(){if(!(typeof window=="undefined"||typeof document=="undefined"))return document.implementation.createHTMLDocument("Interweave")}var zd=class{constructor(t,n={},r=[],o=[]){var s;ir(this,"allowed",void 0),ir(this,"banned",void 0),ir(this,"blocked",void 0),ir(this,"container",void 0),ir(this,"content",[]),ir(this,"props",void 0),ir(this,"matchers",void 0),ir(this,"filters",void 0),ir(this,"keyIndex",void 0),this.props=n,this.matchers=r,this.filters=[...o,new Oh],this.keyIndex=-1,this.container=this.createContainer(t||""),this.allowed=new Set((s=n.allowList)!==null&&s!==void 0?s:Ah),this.banned=new Set(Rh),this.blocked=new Set(n.blockList)}applyAttributeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.attribute=="function"?o.attribute(t,r):r,n)}applyNodeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.node=="function"?o.node(t,r):r,n)}applyMatchers(t,n){let r={},{props:o}=this,s=t,i=0,a=null;return this.matchers.forEach(l=>{let u=l.asTag().toLowerCase(),c=this.getTagConfig(u);if(o[l.inverseName]||!this.isTagAllowed(u)||!this.canRenderChild(n,c))return;let f="";for(;s&&(a=l.match(s));){let d=a,{index:g,length:y,match:v,valid:p,void:m}=d,h=ee(d,["index","length","match","valid","void"]),S=l.propName+String(i);g>0&&(f+=s.slice(0,g)),p?(f+=m?`{{{${S}/}}}`:`{{{${S}}}}${v}{{{/${S}}}}`,this.keyIndex+=1,i+=1,r[S]={children:v,matcher:l,props:I(T(T({},o),h),{key:this.keyIndex})}):f+=v,l.greedy?(s=f+s.slice(g+y),f=""):s=s.slice(g+(y||v.length))}l.greedy||(s=f+s)}),i===0?t:this.replaceTokens(s,r)}canRenderChild(t,n){return!t.tagName||!n.tagName||t.void?!1:t.children.length>0?t.children.includes(n.tagName):t.invalid.length>0&&t.invalid.includes(n.tagName)?!1:n.parent.length>0?n.parent.includes(t.tagName):!t.self&&t.tagName===n.tagName?!1:!!(t&&t.content&n.type)}convertLineBreaks(t){let{noHtml:n,disableLineBreaks:r}=this.props;if(n||r||t.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return t;let o=t.replace(/\r\n/g,`
15
+ `,No.MISSING_INTL_API,i);var w=n.getPluralRules(t,{type:c.pluralType}).select(d-(c.offset||0));S=c.options[w]||c.options.other}if(!S)throw new mh(c.value,d,Object.keys(c.options),i);a.push.apply(a,Za(S.value,t,n,r,o,d-(c.offset||0)));continue}}return NL(a)}function _L(e,t){return t?Mt(Mt(Mt({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=Mt(Mt({},e[r]),t[r]||{}),n},{})):e}function DL(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=_L(e[r],t[r]),n},Mt({},e)):e}function gh(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function FL(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.number),strategy:Td.variadic}),getDateTimeFormat:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.dateTime),strategy:Td.variadic}),getPluralRules:Cd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,pd([void 0],n,!1)))},{cache:gh(e.pluralRules),strategy:Td.variadic})}}var yE=function(){function e(t,n,r,o){n===void 0&&(n=e.defaultLocale);var s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(u){var c=s.formatToParts(u);if(c.length===1)return c[0].value;var f=c.reduce(function(d,g){return!d.length||g.type!==st.literal||typeof d[d.length-1]!="string"?d.push(g.value):d[d.length-1]+=g.value,d},[]);return f.length<=1?f[0]||"":f},this.formatToParts=function(u){return Za(s.ast,s.locales,s.formatters,s.formats,u,void 0,s.message)},this.resolvedOptions=function(){var u;return{locale:((u=s.resolvedLocale)===null||u===void 0?void 0:u.toString())||Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.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 i=o||{},a=i.formatters,l=uE(i,["formatters"]);this.ast=e.__parse(t,Mt(Mt({},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=DL(e.formats,r),this.formatters=o&&o.formatters||FL(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!="undefined"){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=fE,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 HL(e,t){return t.split(".").reduce((n,r)=>n?n[r]:void 0,e)}var UL="dummy",hh=(0,kd.createContext)(null);function Y(e){var r;let t=(0,kd.useContext)(hh);if(!t)throw new Error("useTranslator() may be used only in the context of a <LocaleContext> component.");let n=(r=e[t])!=null?r:{};return(o,s)=>{let i=HL(n,o);return i?new yE(i).format(s):(t!==UL&&console.warn(`${o} does not exist in messages of ${t}`),`[${o}]`)}}var Pd=x(D());var vE={root:"dd-tvkOF",content:"dd-eXA1D"};var yh=x(C()),zL=({isOpen:e,autoFocus:t,children:n,onClose:r,onBack:o,onKeyDown:s,overlayAriaLabel:i,contentAriaLabel:a})=>{let l=(0,Pd.useRef)(null),u=L("Dialog",vE),c=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),o();return}s&&s(d)},f=d=>{d.target===l.current&&e&&r()};return(0,Pd.useEffect)(()=>{var d,g;!l.current||!e||!t||(g=(d=l.current)==null?void 0:d.querySelector("input, textarea"))==null||g.focus()},[e,t,l]),e?(0,yh.jsx)("div",{role:"dialog","data-testid":"dialog",className:u.root,"aria-label":i,ref:l,onKeyDown:c,onMouseDown:f,children:(0,yh.jsx)("div",{"data-testid":"dialog-content",className:u.content,"aria-label":a,children:n})}):null},Rd=zL;var xE=x(se());var SE={root:"dd-ranhW"};var wE=x(C()),jL=r=>{var o=r,{className:e,value:t}=o,n=ee(o,["className","value"]);let s=L("TextInput",SE);return(0,wE.jsx)("input",T({className:(0,xE.default)(e,s.root),type:"text",value:t},n))},Ja=jL;var vh={};Xe(vh,{enUS:()=>BL,nlNL:()=>VL});var BL={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"}]},VL={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 EE={root:"dd-lWxnE",anchorButton:"dd-TZ4in",errorMessage:"dd-fIsPg",title:"dd-pGhJx",subtitle:"dd-f5l29",text:"dd-iamoD",input:"dd-uhQZ3",actions:"dd-lubvx",button:"dd-CJsNI",primaryButton:"dd-MWBfl"};var Oe=x(C());var KL=e=>{try{let t=new URL(e);return new URLSearchParams(t.search).get("token")||void 0}catch(t){return e}},WL=({agentEmail:e,isOpen:t,origin:n="",onSuccess:r,onDismiss:o})=>{let s=Y(vh),i=L("LoginTokenDialog",EE),a=M(v1),l=G(),u=z("productName"),[c,f]=(0,mn.useState)(e||""),[d,g]=(0,mn.useState)(0),[y,v]=(0,mn.useState)(""),p=(0,mn.useCallback)(w=>P(void 0,null,function*(){w.preventDefault(),l(x1({email:c})),g(1)}),[n,c]),m=()=>{v(""),g(0)},h=(0,mn.useCallback)(w=>P(void 0,null,function*(){w.preventDefault();let k=KL(w.target.elements.token.value);if(!k){v(s("verifyCodeError",{login:S}));return}l(Va({token:k}))}),[n]),S=(0,mn.useMemo)(()=>w=>(0,Oe.jsx)("button",{type:"button","data-testid":"login-token-dialog-back-button",className:i.anchorButton,onClick:m,children:w},"back-button"),[]);return(0,mn.useEffect)(()=>{a==="error"&&v(s("verifyCodeError",{login:S})),a==="done"&&r()},[a]),(0,Oe.jsx)(Rd,{autoFocus:!0,isOpen:t,contentAriaLabel:s("promptTitle",{productName:u}),overlayAriaLabel:s("promptTitle",{productName:u}),onClose:o,onBack:o,children:(0,Oe.jsxs)("div",{className:i.root,children:[(0,Oe.jsx)("h1",{className:i.title,children:s("promptTitle",{productName:u})}),d===0&&(0,Oe.jsxs)("form",{onSubmit:p,children:[(0,Oe.jsx)("h2",{className:i.subtitle,children:s("requestCodeTitle")}),(0,Oe.jsx)("p",{className:i.text,children:s("requestCodeBody",{productName:u})}),(0,Oe.jsx)(Ja,{className:i.input,name:"email",placeholder:s("requestCodeInputPlaceholder"),value:c,onChange:w=>f(w.target.value)}),(0,Oe.jsx)("div",{className:i.actions,children:(0,Oe.jsx)("button",{type:"submit",className:(0,Ad.default)(i.button,i.primaryButton),children:s("requestCodeSubmitLabel")})})]}),d===1&&(0,Oe.jsxs)("form",{onSubmit:h,children:[(0,Oe.jsx)("h2",{className:i.subtitle,children:s("verifyCodeTitle")}),(0,Oe.jsx)("p",{className:i.text,children:s("verifyCodeBody")}),(0,Oe.jsx)(Ja,{className:i.input,name:"token",placeholder:s("verifyCodeInputPlaceholder"),disabled:["loading","done"].includes(a)}),y&&(0,Oe.jsx)("div",{className:i.errorMessage,children:y}),(0,Oe.jsxs)("div",{className:i.actions,children:[(0,Oe.jsx)("button",{type:"button",className:(0,Ad.default)(i.button),onClick:m,children:s("back")}),(0,Oe.jsx)("button",{type:"submit",className:(0,Ad.default)(i.button,i.primaryButton),disabled:["loading","done"].includes(a),children:s("verifyCodeSubmitLabel")})]})]})]})})},bE=WL;var TE=x(C()),$L=()=>{let e=M(S1),t=M($1),n=z("adminUrl"),r=Xt(),o=()=>r.send(ai,!1),s=()=>{r.send(ai,!1),r.send(qa)};return(0,TE.jsx)(bE,{isOpen:e,agentEmail:t==null?void 0:t.agentEmail,origin:n,onDismiss:o,onSuccess:s})},CE=$L;var Hb=x(wh()),ft=x(D());var cO={data:null,fetchState:"idle"},AE=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},el=V("knowledgeAssistant/getKnowledgeAssistant",(e,t)=>P(void 0,null,function*(){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");let s=(i=r.profile.data)==null?void 0:i.knowledgeAssistant;return s?n.getKnowledgeAssistant(s):null})),dO=J({name:"knowledgeAssistant",initialState:cO,reducers:{},extraReducers:e=>{e.addCase(el.pending,t=>{t.fetchState="loading"}).addCase(el.rejected,t=>{t.fetchState="error"}).addCase(el.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),IE=dO.reducer;var LE={cues:[],threads:{},fetchState:"idle"},OE=e=>{var t;return(t=e.assistants)==null?void 0:t.cues},Eh=e=>t=>{var n,r;return(r=(n=t.assistants)==null?void 0:n.threads[e])!=null?r:null},Id=Ie("assistants/callToAction"),li=V("assistants/getSummary",(e,t)=>P(void 0,null,function*(){var i,a,l;let r=t.getState().profile.data;if(!r)throw new Error("No Profile is loaded");let{summarizerAssistantNew:o}=r;if(!o){let{deepdeskAPI:u,dynamicThunkObject:c}=t.extra,f=t.getState(),d=(i=f.conversation.current)==null?void 0:i.sessionId,g=(l=(a=f.info)==null?void 0:a.agentInfo)==null?void 0:l.agentId;if(!c.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let y=c.conversationQuery,v=yield y(),p=yield u.getSummary(v,{externalConversationId:d,agentId:g,promptInstruction:r.summarizerPromptInstruction,model:r.summarizerModel});return p.summary?p.summary:Promise.reject(new Error("Summary is not provided"))}let s=yield t.dispatch(tr(T({assistantCode:o,expectFormat:"text",transcript:"in-memory-transcript",skipState:!0},e)));if(s.error)throw new Error(s.error.message);if(typeof s.payload!="string")throw H.warn("Unexpected summary output",s),new Error("Unexpected summary output");return s.payload})),fO=1,bh=V("assistants/evaluateKnowledgeAssistant",(e,t)=>P(void 0,null,function*(){var f,d,g,y;let{threadId:n}=e,{onNewThreadId:r,input:o}=e,{deepdeskAPI:s}=t.extra,i=t.getState(),{platformVariables:a}=i.info;if(!i.profile.data)throw new Error("No Profile is loaded");let{knowledgeAssistantNew:l}=i.profile.data;if(!l){n||(n=fO++,r&&r(n));let v=(f=Eh(n)(i))!=null?f:[],p=AE(i),m=(d=i.conversation.current)==null?void 0:d.sessionId,h=(y=(g=i.info)==null?void 0:g.agentInfo)==null?void 0:y.agentId;if(!p)throw new Error("KnowledgeAssistant is not defined");let S=yield s.knowledgeAssist({customerInstruction:p.customerInstruction,doNotKnowAnswer:p.doNotKnowAnswer,question:o},v,p.code,{agentId:h,conversationId:m});return a&&(S.answer=qe(S.answer,a)),{threadId:n,question:o,answer:S}}n||(n=(yield s.createAssistantThread({assistantCode:l})).id,r&&r(n)),yield s.postMessageToAssistantThread({assistantCode:l,threadId:n,message:e.input});let u=yield t.dispatch(tr(I(T({assistantCode:l,expectFormat:"json-schema:knowledge-assist",skipState:!0},e),{input:{},threadId:n})));if(u.error)throw new Error(u.error.message);let c=u.payload;return{threadId:n,question:e.input,answer:{answer:qe(c.response,a!=null?a:{}),sources:c.sources}}})),tr=V("assistants/evaluate",(e,t)=>P(void 0,null,function*(){var g;let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra,{transcript:o,input:s={},expectFormat:i,threadId:a}=e,l=t.getState(),{platformVariables:u}=l.info,c=(g=l.conversation.current)==null?void 0:g.sessionId,f;if(o==="in-memory-transcript"){if(!r.conversationQuery)throw new Error("Can't include in-memory-transcript, setConversationQuery is not defined");f=yield r.conversationQuery()}else if(o==="stored-transcript"){if(!l.conversation.current)throw new Error("Can't include stored-transcript, no current conversation");f=l.conversation.current.messages.map(y=>({text:y.text,source:y.source}))}else Array.isArray(o)&&(f=o);if(e.includeTags){if(!l.conversation.current)throw new Error("Can't include tags, no current conversation");let{tags:y}=l.conversation.current;Object.assign(s,{tags:y})}let d=yield n.evaluateAssistant(e.assistantCode,{expectFormat:i,input:s,transcript:f,externalConversationId:c,threadId:a});if(!u)return d;switch(i){case"text":return qe(d,u);case"json-schema:cues":return d.map(y=>I(T({},y),{name:qe(y.name,u),response:qe(y.response,u)}));case"json-schema:knowledge-assist":{let y=d;return I(T({},y),{answer:qe(y.response,u)})}case"json-object":default:return d}})),NE=J({name:"assistants",initialState:LE,reducers:{resetCues(e){e.cues=[]},removeCueByCode(e,t){e.cues=e.cues.filter(n=>n.code!==t.payload.code)},removeThreadById(e,t){delete e.threads[t.payload]}},extraReducers:e=>{e.addCase(tr.pending,(t,n)=>{n.meta.arg.skipState||(t.fetchState="loading")}).addCase(tr.rejected,(t,n)=>{n.meta.arg.skipState||(t.fetchState="error")}).addCase(tr.fulfilled,(t,n)=>{if(!n.meta.arg.skipState)switch(n.meta.arg.expectFormat){case"json-schema:cues":{let r=n.payload,o=r.map(i=>i.code),s=t.cues.filter(i=>!o.includes(i.code));t.fetchState="done",t.cues=[...r,...s];break}}}).addCase(bh.fulfilled,(t,n)=>{let s=n.payload,{threadId:r}=s,o=ee(s,["threadId"]);t.threads[r]=[...t.threads[r]||[],o]}).addCase(xe,()=>LE)}}),{removeCueByCode:ME,resetCues:tF,removeThreadById:Ld}=NE.actions,_E=NE.reducer;var pO={data:null,fetchState:"idle"},DE=e=>e.contentTypes.data,tl=V("contentTypes/getContentTypes",(e,t)=>P(void 0,null,function*(){return t.extra.deepdeskAPI.getContentTypes()})),mO=J({name:"contentTypes",initialState:pO,reducers:{},extraReducers:e=>{e.addCase(tl.pending,t=>{t.fetchState="loading"}).addCase(tl.rejected,t=>{t.fetchState="error"}).addCase(tl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),FE=mO.reducer;var gO={data:null,fetchState:"idle"},nr=e=>e.profile.data,Od=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],HE=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,nl=V("profile/getProfile",(e,t)=>P(void 0,null,function*(){var s;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((s=r.profile.data)==null?void 0:s.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)})),hO=J({name:"profile",initialState:gO,reducers:{},extraReducers:e=>{e.addCase(nl.pending,t=>{t.fetchState="loading"}).addCase(nl.rejected,t=>{t.fetchState="error"}).addCase(nl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),UE=hO.reducer;function rr(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 ar=x(D());var zE=x(D()),Nd=x(se());var _t={root:"dd-U2SX4",list:"dd-cYTlj",listWrapper:"dd-GLQFR",listHorizontal:"dd-x-knl",page:"dd-1F4vk",search:"dd-nvbxc",pageNav:"dd-sRUuT",pageTitle:"dd-t-MKS",pageBackButton:"dd-cjptm",listHeader:"dd-Fg666",listHeading:"dd-w-xhJ",listMoreButton:"dd--mKep",listItem:"dd-wpvuA",listItemContent:"dd-V-mKo",listItemText:"dd-ukCHL",listItemDescription:"dd-sSyu4",listItemActions:"dd-xelho",truncate:"dd-IlopJ",lineClamp:"dd-Twaca",listItemTitle:"dd-lMGHq",listItemAction:"dd-xPLAs",listItemSelected:"dd-jFX0Y",sources:"dd-pZx4v",sourcesTitle:"dd-phYVd",source:"dd-DaR6h",sourceShowMore:"dd-M1-8j",icon:"dd-m6yxD",searchIcon:"dd-0AU-O",searchInputWrapper:"dd-DUFcE",searchInput:"dd-ukrlD",select:"dd--Tifv",selectType:"dd-IkZb2",selectWrapper:"dd-J14mx",image:"dd-RQgsB",imageSrc:"dd-jxh8F",imageSrcHidden:"dd-e20Jk",imageSrcStatus:"dd-j50Tt",imageTitle:"dd-qCjfW",actions:"dd-3mfWc",actionsWrapper:"dd-TjDyI",actionsBar:"dd-LiA35",actionButton:"dd-4wk0u",hasShortKeys:"dd-XilV-",actionShortcut:"dd-s4Mla",actionShortcutFixKerning:"dd-lyh5e"};var or={};Xe(or,{enUS:()=>yO,nlNL:()=>vO});var yO={visitUrl:[{type:0,value:"Visit"}],back:[{type:0,value:"Back"}],loading:[{type:0,value:"Loading..."}],imageError:[{type:0,value:"Could not load image"}],showAll:[{type:0,value:"Show more"}],sources:[{type:0,value:"Sources"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},vO={visitUrl:[{type:0,value:"Bekijk"}],back:[{type:0,value:"Terug"}],loading:[{type:0,value:"Laden..."}],imageError:[{type:0,value:"Kan afbeelding niet laden"}],showAll:[{type:0,value:"Toon meer"}],sources:[{type:0,value:"Bronnen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var Zr=x(C()),SO=({src:e,title:t})=>{let n=L("CommandPalette",_t),[r,o]=(0,zE.useState)("loading"),s=Y(or);return(0,Zr.jsxs)("div",{className:n.image,children:[(0,Zr.jsx)("img",{src:e,alt:t,onLoad:()=>o("done"),onError:()=>o("error"),className:(0,Nd.default)(n.imageSrc,{[n.imageSrcHidden]:["loading","error"].includes(r)})}),r==="loading"&&(0,Zr.jsx)("span",{className:(0,Nd.default)(n.imageSrc,n.imageSrcStatus),children:s("loading")}),r==="error"&&(0,Zr.jsx)("span",{className:(0,Nd.default)(n.imageSrc,n.imageSrcStatus),children:(0,Zr.jsx)(Xl,{})}),t&&(0,Zr.jsx)("span",{className:n.imageTitle,children:t})]})},jE=SO;var BE=x(D()),VE=x(se());var Mo=x(C());function Ch({children:e,heading:t,orientation:n,hasMore:r,onShowAll:o}){let s=Y(or),i=L("CommandPalette",_t);return BE.default.Children.count(e)===0?null:(0,Mo.jsxs)("div",{"data-testid":"commandpalette-list",className:i.list,children:[(t||r)&&(0,Mo.jsxs)("div",{className:i.listHeader,children:[t&&(0,Mo.jsx)("h4",{className:i.listHeading,children:t}),r&&o&&(0,Mo.jsx)("button",{onClick:o,className:i.listMoreButton,type:"button",children:s("showAll")})]}),(0,Mo.jsx)("div",{className:(0,VE.default)(i.listWrapper,n==="horizontal"&&i.listHorizontal),children:e})]})}var al=x(se());var Md=x(D());function rl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ae=1,kh=2,Ph=4,_e=8,_d=16,ol=32,gn=64,Th={a:{content:ae|_e,self:!1,type:ae|_e|ol|gn},address:{invalid:["h1","h2","h3","h4","h5","h6","address","article","aside","section","div","header","footer"],self:!1},audio:{children:["track","source"]},br:{type:ae|_e,void:!0},body:{content:ae|kh|Ph|_e|_d|ol|gn},button:{content:_e,type:ae|_e|ol|gn},caption:{content:ae,parent:["table"]},col:{parent:["colgroup"],void:!0},colgroup:{children:["col"],parent:["table"]},details:{children:["summary"],type:ae|ol|gn},dd:{content:ae,parent:["dl"]},dl:{children:["dt","dd"],type:ae},dt:{content:ae,invalid:["footer","header"],parent:["dl"]},figcaption:{content:ae,parent:["figure"]},footer:{invalid:["footer","header"]},header:{invalid:["footer","header"]},hr:{type:ae,void:!0},img:{void:!0},li:{content:ae,parent:["ul","ol","menu"]},main:{self:!1},ol:{children:["li"],type:ae},picture:{children:["source","img"],type:ae|_e|_d},rb:{parent:["ruby","rtc"]},rp:{parent:["ruby","rtc"]},rt:{content:_e,parent:["ruby","rtc"]},rtc:{content:_e,parent:["ruby"]},ruby:{children:["rb","rp","rt","rtc"]},source:{parent:["audio","video","picture"],void:!0},summary:{content:_e,parent:["details"]},table:{children:["caption","colgroup","thead","tbody","tfoot","tr"],type:ae},tbody:{parent:["table"],children:["tr"]},td:{content:ae,parent:["tr"]},tfoot:{parent:["table"],children:["tr"]},th:{content:ae,parent:["tr"]},thead:{parent:["table"],children:["tr"]},tr:{parent:["table","tbody","thead","tfoot"],children:["th","td"]},track:{parent:["audio","video"],void:!0},ul:{children:["li"],type:ae},video:{children:["track","source"]},wbr:{type:ae|_e,void:!0}};function Do(e){return t=>{Th[t]=T(T({},e),Th[t])}}["address","main","div","figure","p","pre"].forEach(Do({content:ae,type:ae|gn}));["abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","ruby","samp","strong","sub","sup","time","u","var"].forEach(Do({content:_e,type:ae|_e|gn}));["p","pre"].forEach(Do({content:_e,type:ae|gn}));["s","small","span","del","ins"].forEach(Do({content:_e,type:ae|_e}));["article","aside","footer","header","nav","section","blockquote"].forEach(Do({content:ae,type:ae|kh|gn}));["h1","h2","h3","h4","h5","h6"].forEach(Do({content:_e,type:ae|Ph|gn}));["audio","canvas","iframe","img","video"].forEach(Do({type:ae|_e|_d|gn}));var il=Object.freeze(Th),Rh=["applet","base","body","command","embed","frame","frameset","head","html","link","meta","noscript","object","script","style","title"],Ah=Object.keys(il).filter(e=>e!=="canvas"&&e!=="iframe"),me=1,Ih=2,_o=3,Jr=4,Fd=5,Hd=Object.freeze({alt:me,cite:me,class:me,colspan:_o,controls:Jr,datetime:me,default:Jr,disabled:Jr,dir:me,height:me,href:me,id:me,kind:me,label:me,lang:me,loading:me,loop:Jr,media:me,muted:Jr,poster:me,rel:me,role:me,rowspan:_o,scope:me,sizes:me,span:_o,start:_o,style:Fd,src:me,srclang:me,srcset:me,tabindex:me,target:me,title:me,type:me,width:me}),Lh=Object.freeze({class:"className",colspan:"colSpan",datetime:"dateTime",rowspan:"rowSpan",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex"});function Dd(){return Dd=Object.assign||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},Dd.apply(this,arguments)}function Ud({attributes:e={},className:t,children:n=null,selfClose:r=!1,tagName:o}){let s=o;return r?Md.default.createElement(s,Dd({className:t},e)):Md.default.createElement(s,Dd({className:t},e),n)}var sl=class{attribute(t,n){return n}node(t,n){return n}};function KE(e,t,n,r=!1){let o=e.match(t instanceof RegExp?t:new RegExp(t,"i"));return o?I(T({match:o[0],void:r},n(o)),{index:o.index,length:o[0].length,valid:!0}):null}var sr=class{constructor(t,n,r){rl(this,"greedy",!1),rl(this,"options",void 0),rl(this,"propName",void 0),rl(this,"inverseName",void 0),rl(this,"factory",void 0),this.options=T({},n),this.propName=t,this.inverseName=`no${t.charAt(0).toUpperCase()+t.slice(1)}`,this.factory=r!=null?r:null}createElement(t,n){return this.factory?Md.default.createElement(this.factory,n,t):this.replaceWith(t,n)}doMatch(t,n,r,o=!1){return KE(t,n,r,o)}onBeforeParse(t,n){return t}onAfterParse(t,n){return t}};var Fo=x(D()),GE=x($E());function ir(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var EO=/(url|image|image-set)\(/i,Oh=class extends sl{attribute(t,n){return t==="style"&&Object.keys(n).forEach(r=>{String(n[r]).match(EO)&&delete n[r]}),n}},qE=1,bO=3,CO=/^<(!doctype|(html|head|body)(\s|>))/i,TO=/^(aria-|data-|\w+:)/iu,kO=/{{{(\w+)\/?}}}/;function PO(){if(!(typeof window=="undefined"||typeof document=="undefined"))return document.implementation.createHTMLDocument("Interweave")}var zd=class{constructor(t,n={},r=[],o=[]){var s;ir(this,"allowed",void 0),ir(this,"banned",void 0),ir(this,"blocked",void 0),ir(this,"container",void 0),ir(this,"content",[]),ir(this,"props",void 0),ir(this,"matchers",void 0),ir(this,"filters",void 0),ir(this,"keyIndex",void 0),this.props=n,this.matchers=r,this.filters=[...o,new Oh],this.keyIndex=-1,this.container=this.createContainer(t||""),this.allowed=new Set((s=n.allowList)!==null&&s!==void 0?s:Ah),this.banned=new Set(Rh),this.blocked=new Set(n.blockList)}applyAttributeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.attribute=="function"?o.attribute(t,r):r,n)}applyNodeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.node=="function"?o.node(t,r):r,n)}applyMatchers(t,n){let r={},{props:o}=this,s=t,i=0,a=null;return this.matchers.forEach(l=>{let u=l.asTag().toLowerCase(),c=this.getTagConfig(u);if(o[l.inverseName]||!this.isTagAllowed(u)||!this.canRenderChild(n,c))return;let f="";for(;s&&(a=l.match(s));){let d=a,{index:g,length:y,match:v,valid:p,void:m}=d,h=ee(d,["index","length","match","valid","void"]),S=l.propName+String(i);g>0&&(f+=s.slice(0,g)),p?(f+=m?`{{{${S}/}}}`:`{{{${S}}}}${v}{{{/${S}}}}`,this.keyIndex+=1,i+=1,r[S]={children:v,matcher:l,props:I(T(T({},o),h),{key:this.keyIndex})}):f+=v,l.greedy?(s=f+s.slice(g+y),f=""):s=s.slice(g+(y||v.length))}l.greedy||(s=f+s)}),i===0?t:this.replaceTokens(s,r)}canRenderChild(t,n){return!t.tagName||!n.tagName||t.void?!1:t.children.length>0?t.children.includes(n.tagName):t.invalid.length>0&&t.invalid.includes(n.tagName)?!1:n.parent.length>0?n.parent.includes(t.tagName):!t.self&&t.tagName===n.tagName?!1:!!(t&&t.content&n.type)}convertLineBreaks(t){let{noHtml:n,disableLineBreaks:r}=this.props;if(n||r||t.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return t;let o=t.replace(/\r\n/g,`
16
16
  `);return o=o.replace(/\n{3,}/g,`
17
17
 
18
18
 
19
- `),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global!="undefined"&&global.INTERWEAVE_SSR_POLYFILL||PO)();if(!o)return;let s=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",i=s==="body"||s==="fragment"?o.body:o.createElement(s);return t.match(CO)||(i.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,GE.default)(t):t)),i}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==qE||!t.attributes||([...t.attributes].forEach(s=>{let{name:i,value:a}=s,l=i.toLowerCase(),u=Hd[l]||Hd[i];if(!this.isSafe(t)||!l.match(TO)&&(!n&&(!u||u===Ih)||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===Jr?c=!0:u===_o?c=Number.parseFloat(String(c)):u!==Fd&&(c=String(c)),r[Lh[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,(s,i)=>String(i).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return il[t]?I(T(T({},n),il[t]),{tagName:t}):n}isSafe(t){if(typeof HTMLAnchorElement!="undefined"&&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:s,transform:i,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===qE){let d=c.nodeName.toLowerCase(),g=this.getTagConfig(d);u&&(l.push(u),u="");let y=this.applyNodeFilters(d,c);if(!y)return;let v;if(i&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;v=this.parseNode(y,g);let m=i(y,v,g);if(m===null)return;if(typeof m!="undefined"){l.push(Fo.default.cloneElement(m,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(s||this.canRenderChild(n,g))){var f;this.keyIndex+=1;let p=this.extractAttributes(y),m={tagName:d};p&&(m.attributes=p),g.void&&(m.selfClose=g.void),l.push(Fo.default.createElement(Ud,I(T({},m),{key:this.keyIndex}),(f=v)!==null&&f!==void 0?f:this.parseNode(y,g)))}else l=[...l,...this.parseNode(y,g.tagName?g:n)]}else if(c.nodeType===bO){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,s=null;for(;s=o.match(kO);){let[i,a]=s,l=s.index,u=i.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],g;if(u)g=i.length,r.push(f.createElement(c,d));else{let y=o.match(new RegExp(`{{{/${a}}}}`));g=y.index+y[0].length,r.push(f.createElement(this.replaceTokens(o.slice(i.length,y.index),n),d))}o=o.slice(g)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function RO(e){var t;let{attributes:n,className:r,containerTagName:o,content:s,emptyContent:i,parsedContent:a,tagName:l,noWrap:u}=e,c=(t=o!=null?o:l)!==null&&t!==void 0?t:"span",f=c==="fragment"?!0:u,d;if(a)d=a;else{let g=new zd(s!=null?s:"",e).parse();g.length>0&&(d=g)}return d||(d=i),f?Fo.default.createElement(Fo.default.Fragment,null,d):Fo.default.createElement(Ud,{attributes:n,className:r,tagName:c},d)}function ui(e){let k=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:s=!1,emptyContent:i=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1}=k,g=ee(k,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),y=s?[]:l,v=o?[]:a,p=c?[c]:[],m=u?[u]:[];y.forEach(b=>{b.onBeforeParse&&p.push(b.onBeforeParse.bind(b)),b.onAfterParse&&m.push(b.onAfterParse.bind(b))});let h=p.reduce((b,R)=>R(b,e),r!=null?r:""),S=new zd(h,g,y,v),w=m.reduce((b,R)=>R(b,e),S.parse());return Fo.default.createElement(RO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:i,noWrap:d,parsedContent:w.length===0?void 0:w,tagName:f})}var tb=x(D());var AO=/[.*+?^${}()|[\]\\]/g,IO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function LO(e){return e.replace(AO,"\\$&")}function OO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function NO(e){return e.search(IO)}function YE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${LO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function QE(e){return e.replace(ou,'<mark data-type="placeholder">$1</mark>')}function ci(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function MO(e,t){return e.split("").map((i,a)=>({char:i,index:a})).filter(({char:i,index:a})=>/\s/.test(i)&&a<=t).map(({index:i})=>i).reverse()[0]}function Nh(e,t,n={}){if(t){let r=OO(t.toLowerCase(),e.toLowerCase()),o=ci(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=NO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let i=t.split(n0).length>3||t.length>30?MO(t.trim(),r):0;return`${`${i>0?"\u2026":""}${ci(e.substring(i,r))}`}<strong>${o}</strong>`}return e}var _O=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function jd(e){return _O.test(e)}function XE(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var Bd=x(D()),eb=x(C()),ZE=Bd.default.createContext(void 0);function eo(){let e=Bd.default.useContext(ZE);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var JE=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s})=>{let i=Bd.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s}),[n,t,o]);return(0,eb.jsx)(ZE.Provider,{value:i,children:e})};var Zt=x(C()),DO=3,nb=({children:e})=>{let t=L("CommandPalette",_t);return(0,Zt.jsx)("div",{className:t.listItemActions,children:e})};function Mh(d){var g=d,{closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,extra:o,onSourceClick:s,description:i,sources:a,id:l,styles:u,defaultSourcesAmount:c=DO}=g,f=ee(g,["closeOnSelect","lineClamp","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var k;let y=Y(or),[v,p]=(0,tb.useState)(!1),{selected:m,onChangeOpen:h}=eo(),S=L("CommandPalette",_t);function w(b){r(b),e&&h(!1)}return(0,Zt.jsxs)("div",{className:(0,al.default)(S.listItem,l===m&&S.listItemSelected),children:[(0,Zt.jsx)("button",I(T({type:"button",className:S.listItemAction,"aria-disabled":(k=f.disabled)!=null?k:!1,onClick:w,"data-command-palette-item":!0,"data-item-id":l},f),{children:(0,Zt.jsxs)("div",{className:S.listItemContent,children:[typeof n=="string"?(0,Zt.jsx)("p",{className:(0,al.default)(S.listItemText,S.truncate,u==null?void 0:u.title),children:n}):n,i&&(0,Zt.jsx)(ui,{tagName:"p",allowList:[],content:jd(i)?XE(i):i,className:(0,al.default)(S.listItemDescription,u==null?void 0:u.description,t?S.lineClamp:S.truncate)})]})})),o,a&&a.length>0&&(0,Zt.jsxs)("div",{className:S.sources,children:[(0,Zt.jsx)("span",{className:S.sourcesTitle,children:y("sources")}),a.slice(0,v?a.length:c).map(b=>(0,Zt.jsx)("a",{className:S.source,href:b.url,target:"_blank",title:b.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>s&&s(b),children:b.name},b.url)),!v&&a.length>c&&(0,Zt.jsx)("button",{className:(0,al.default)(S.source,S.sourceShowMore),type:"button",onClick:()=>p(!0),children:y("showMore",{amount:a.length-c})})]})]})}var ll=x(C()),rb=()=>(0,ll.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,ll.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,ll.jsx)("path",{d:"M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"})]});var Ho=x(C());function _h({children:e,title:t,id:n,onDismiss:r}){let o=Y(or),s=L("CommandPalette",_t),{page:i}=eo();return i!==n?null:(0,Ho.jsxs)("div",{className:s.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,Ho.jsxs)("div",{className:s.pageNav,children:[(0,Ho.jsxs)("button",{className:s.pageBackButton,type:"button",onClick:r,children:[(0,Ho.jsx)(rb,{}),o("back")]}),t&&(0,Ho.jsx)("h3",{className:s.pageTitle,children:t})]}),e]})}var ob=x(D());var ul=x(C()),di=()=>(0,ul.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,ul.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,ul.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 hn=x(C());function FO({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:s,selectedType:i},a){let l=L("CommandPalette",_t);return(0,hn.jsxs)("div",{className:l.search,children:[(0,hn.jsx)("div",{className:l.searchIcon,children:(0,hn.jsx)(di,{})}),(0,hn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,hn.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:s,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,hn.jsx)("div",{className:l.selectWrapper,children:(0,hn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:i||r,children:[r&&(0,hn.jsx)("option",{children:r}),o.map(u=>(0,hn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var sb=(0,ob.forwardRef)(FO);var Dh=x(se());var Vd=x(C()),HO=o=>{var s=o,{onClick:e,shortKeys:t,children:n}=s,r=ee(s,["onClick","shortKeys","children"]);let i=L("CommandPalette",_t);return(0,Vd.jsxs)("button",I(T({type:"button"},r),{onClick:e,className:(0,Dh.default)(i.actionButton,r.className,{[i.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(a=>(0,Vd.jsx)("span",{className:(0,Dh.default)(i.actionShortcut,a===8629&&i.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},ib=HO;var cl=x(C()),UO="[data-command-palette-item]";function Uo({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:s,onChangeType:i,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d,updateDeps:g=[]}){let[y,v]=(0,ar.useState)(),p=(0,ar.useRef)(null),m=()=>{o&&o(n),i(void 0),s(""),a(!1)},h=()=>{var K;if(r!==n&&o){o(n);return}if(l&&i){i(void 0),(K=p.current)==null||K.focus();return}if(d.length>0){s("");return}a(!1)},S=()=>{let K=w();K.length!==0&&v(K[0].dataset.itemId)},w=()=>Array.from(document.querySelectorAll(UO)||[]),k=K=>document.querySelector(`[data-item-id=${K}]`),b=K=>{let W=k(K);W&&v(W.dataset.itemId)},R=K=>{let W=k(K);W&&W.scrollIntoView({behavior:"smooth"})},N=()=>{if(!y)return;let K=w(),W=k(y);if(!W)return;let de=K.indexOf(W),Ye=K[de+1];Ye&&Ye.dataset.itemId?b(Ye.dataset.itemId):S()},_=()=>{if(!y)return;let K=w(),W=k(y);if(!W)return;let de=K.indexOf(W),Ye=K[de-1];Ye&&Ye.dataset.itemId?b(Ye.dataset.itemId):b(K[K.length-1].dataset.itemId)},Q=(0,ar.useCallback)(K=>{switch(K.key){case"ArrowDown":{K.preventDefault(),N();break}case"ArrowUp":{K.preventDefault(),_();break}case"Enter":{if(y){let W=k(y);W==null||W.click()}break}}},[y]);return(0,ar.useEffect)(()=>{S()},[d,r,l,f,...g]),(0,ar.useEffect)(()=>{y&&R(y)},[y]),(0,cl.jsx)(Rd,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:h,onClose:m,onKeyDown:Q,children:(0,cl.jsxs)(JE,{selected:y,setSelected:v,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,cl.jsx)(sb,{ref:p,onChange:s,onChangeType:i,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Uo.Page=_h;Uo.List=Ch;Uo.Image=jE;Uo.ListItem=Mh;Uo.ListItemActions=nb;Uo.Button=ib;var he=Uo;var ab=x(D());function lb(e,t){(0,ab.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 dl=x(D());var ub={data:null,fetchState:"idle"},Kd=e=>{var s,i,a,l;let t=[],{visitorName:n}=(s=e.info.visitorInfo)!=null?s:{},{agentName:r,agentNickname:o}=(i=e.info.agentInfo)!=null?i:{};return r&&r!==n&&t.push(r),o&&o!==n&&t.push(o),(l=(a=e.entities.data)==null?void 0:a.filter(u=>!t.includes(u.text)))!=null?l:null},yn=V("entities/getEntities",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,s=yield o();return s.length===0?Promise.resolve([]):n.getEntities(s)})),zO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),jO=J({name:"entities",initialState:ub,reducers:{},extraReducers:e=>{e.addCase(yn.pending,t=>{t.fetchState="loading"}).addCase(yn.rejected,t=>{t.fetchState="error"}).addCase(yn.fulfilled,(t,n)=>{t.fetchState="done",t.data=zO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(xe,()=>ub)}}),cb=jO.reducer;var Fh={};Xe(Fh,{enUS:()=>BO,nlNL:()=>VO});var BO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},VO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var db={root:"dd-TYTKs",empty:"dd-AU7uT"};var fi=x(C()),KO=({onCopy:e})=>{let t=(0,dl.useRef)(null),n=L("EntitiesList",db),r=M(Kd),{setSelected:o}=eo(),s=Y(Fh),i=G();return(0,dl.useEffect)(()=>{i(yn())},[]),(0,dl.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,fi.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,fi.jsx)(he.List,{children:r.map((a,l)=>(0,fi.jsx)(he.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,fi.jsx)("p",{className:n.empty,children:s("noResults")})]})},fb=KO;var zo=x(D());var pi=x(D());function pb(e,t){let n=(0,pi.useRef)(e);n.current=e;let[r,o]=(0,pi.useState)(void 0),[s,i]=(0,pi.useState)(void 0),[a,l]=(0,pi.useState)("idle"),u=G();return{error:s,state:a,data:r,call:f=>{l("loading"),u(n.current(f)).unwrap().then(d=>{o(d),l("done"),t!=null&&t.onSuccess&&(t==null||t.onSuccess(d))}).catch(d=>{i(d),l("error"),t!=null&&t.onError&&(t==null||t.onError(d))})}}}var Wd=x(se()),yb=x(D());var Hh=x(C()),Uh=e=>(0,Hh.jsx)("svg",I(T({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Hh.jsx)("path",{fillRule:"evenodd",d:"M6.57086468,14.9173453 C6.38997052,14.9711236 6.19835748,15 6,15 L4,15 C2.8954305,15 2,14.1045695 2,13 L2,4 C2,2.8954305 2.8954305,2 4,2 L6,2 C6.68685475,2 7.29284112,2.34623869 7.65294381,2.87370078 C7.95642355,2.67736738 8.29504785,2.51351337 8.66312366,2.3818197 C9.50544052,2.08044754 10.3408482,1.9879107 10.9989281,1.99971266 C11.0150698,2.00005426 13.3487605,2.00015005 18,2 C20.7551411,2 22,6.05643086 22,12 C22,13.6824804 20.8695981,15 19,15 L15.9269768,15 C15.9359266,15.0245465 15.9451954,15.0497804 15.9547911,15.0757271 C16.007193,15.2174219 16.2391583,15.8256341 16.2970775,15.9810953 C16.4872151,16.4914441 16.6259612,16.9026411 16.7382242,17.3098712 C16.9079007,17.9253665 17,18.4798886 17,19 C17,20.4720069 16.091867,21.3862822 14.748281,21.777514 C14.1422801,21.9539723 13.6147967,22.0000922 13.0076976,22.0000008 L12.5204954,22 L12.2202699,21.6261158 C11.2556275,20.4248034 7.64562469,16.4822788 6.57086468,14.9173453 Z M8,13 C8,13.2401953 8.04443154,13.4528921 8.14171093,13.6800176 C8.40663864,14.2985643 11.914268,18.1371493 13.4599624,19.9848695 C13.7113931,19.9660111 13.9483736,19.9273712 14.1891338,19.8572655 C14.7621788,19.6904035 15,19.4509737 15,19 C15,18.6834183 14.9359344,18.2976852 14.8101464,17.8413935 C14.7161494,17.500423 14.5944107,17.1396301 14.4229225,16.6793379 C14.3689242,16.5344009 14.1358033,15.923159 14.0789589,15.7694517 C13.9489218,15.4178313 13.8632547,15.1589343 13.8046536,14.9236885 C13.5555377,13.9236468 13.8054549,13 15,13 L19,13 C19.6912225,13 20,12.6401099 20,12 C20,7.20925475 19.015127,4 18,4 C15.9322103,4 15.9322103,4 10.9655994,3.99940813 C10.5253746,3.99154158 9.91062406,4.05963657 9.33687634,4.2649175 C8.45196659,4.58152894 8,5.09776992 8,6 L8,13 Z M4,4 L4,13 L6,13 L6,4 L4,4 Z"})}));var zh=x(C()),mb=e=>(0,zh.jsx)("svg",I(T({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,zh.jsx)("path",{fillRule:"evenodd",d:"M7.65336736,21.1256786 C7.2933164,21.6534897 6.68712411,22 6,22 L4,22 C2.8954305,22 2,21.1045695 2,20 L2,11 C2,9.8954305 2.8954305,9 4,9 L6,9 C6.198171,9 6.38961023,9.02882212 6.57035446,9.08250314 C7.6444817,7.51807482 11.2554748,3.57449216 12.2202699,2.37298955 L12.5204954,1.99910538 L13,1.99910538 C13.6147967,1.99901314 14.1422801,2.04513312 14.748281,2.22159137 C16.091867,2.61282321 17,3.52709845 17,4.99910538 C17,5.51921677 16.9079007,6.07373891 16.7382242,6.68923415 C16.6259612,7.09646424 16.4872151,7.50766133 16.2970775,8.01801005 C16.2391583,8.17347129 16.007193,8.78168345 15.9547911,8.92337824 C15.9451954,8.94932503 15.9359266,8.9745589 15.9269768,8.99910538 L19,8.99910538 C20.8695981,8.99910538 22,10.316625 22,11.9991054 C22,17.9426745 20.7551411,21.9991054 18,21.9991054 L11.0344006,21.9985135 C10.3408482,22.0111947 9.50544052,21.9186578 8.66312366,21.6172857 C8.29521907,21.4856533 7.9567386,21.3218904 7.65336736,21.1256786 Z M8,17.9991054 C8,18.9013355 8.45196659,19.4175764 9.33687634,19.7341879 C9.91062406,19.9394688 10.5253746,20.0075638 10.963066,19.9997143 C10.9703499,19.9995545 10.9703499,19.9995545 11,19.9991054 L18,19.9991054 C19.015127,19.9991054 20,16.7898506 20,11.9991054 C20,11.3589955 19.6912225,10.9991054 19,10.9991054 L15,10.9991054 C13.8054549,10.9991054 13.5555377,10.0754586 13.8046536,9.07541689 C13.8632547,8.84017106 13.9489218,8.5812741 14.0789589,8.22965366 C14.1358033,8.07594642 14.3689242,7.46470447 14.4229225,7.31976744 C14.5944107,6.85947528 14.7161494,6.4986824 14.8101464,6.1577119 C14.9359344,5.70142019 15,5.31568707 15,4.99910538 C15,4.54813166 14.7621788,4.30870189 14.1891338,4.1418399 C13.9483736,4.07173418 13.7113931,4.0330943 13.4599624,4.01423587 C11.914268,5.86195611 8.40663864,9.70054105 8.14171093,10.3190878 C8.04443154,10.5462133 8,10.7589101 8,10.9991054 L8,17.9991054 Z M4,11 L4,20 L6,20 L6,11 L4,11 Z"})}));function mi(e,t){var o;let n=e.cloneNode(!0);n.style.top=`${e.offsetTop}px`,n.style.left=`${e.offsetLeft}px`,n.style.position="absolute",t.split(" ").forEach(s=>{n.classList.add(s)}),n.addEventListener("animationend",()=>n.remove()),(o=e.parentElement)==null||o.appendChild(n)}var jh={};Xe(jh,{enUS:()=>WO,nlNL:()=>$O});var WO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},$O={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};function gb(e){return V("analytics/logEvent",(t,n)=>{var s,i,a;let r=(i=(s=n.getState())==null?void 0:s.conversation.current)==null?void 0:i.id,o=(a=n.getState())==null?void 0:a.info.agentInfo;return n.extra.deepdeskAPI.sendEvent(t.name,I(T({conversationId:r},o),{data:t.data}))})(e)}function gi(){let e=G();return(t,n)=>P(this,null,function*(){yield e(gb({name:t,data:n}))})}var hb={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var hi=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t,s=o||window.location.origin;return r&&!n?null:r&&n?`${s}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:`${s}${e}`};var lr=x(C()),qO=({eventName:e,eventData:t,feedbackType:n,feedbackText:r})=>{let o=L("FeedbackThumbs",hb),s=z("enableFeedbackForm"),i=M(Yr),a=M(hi(`/admin/feedback?conversationId=${i}&type=${n}&text=${r}&data=${JSON.stringify(t)}`)),l=Y(jh),u=gi(),[c,f]=(0,yb.useState)(null),d=y=>{y.stopPropagation(),mi(y.target,o.fadeup),f("up"),u(e,I(T({},t),{rating:"up"}))},g=y=>{y.stopPropagation(),mi(y.target,o.fadedown),f("down"),u(e,I(T({},t),{rating:"down"}))};return(0,lr.jsxs)("div",{className:o.thumbs,children:[(0,lr.jsx)(re.Button,{title:l("thumbsUp"),onClick:d,icon:(0,lr.jsx)(mb,{}),className:(0,Wd.default)(o.thumbsUp,c==="up"&&o.selected),disabled:!!c}),s&&a?(0,lr.jsx)(re.Button,{as:"a",title:l("thumbsDown"),href:a,target:"_blank",rel:"noreferrer",onClick:g,icon:(0,lr.jsx)(Uh,{}),className:(0,Wd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c}):(0,lr.jsx)(re.Button,{title:l("thumbsDown"),onClick:g,icon:(0,lr.jsx)(Uh,{}),className:(0,Wd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c})]})},yi=qO;var fl=x(C()),vb=()=>(0,fl.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512","aria-labelledby":"paperPlaneTitle",children:[(0,fl.jsx)("title",{id:"paperPlaneTitle",children:"PaperPlane"}),(0,fl.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 Bh={};Xe(Bh,{enUS:()=>GO,nlNL:()=>YO});var GO={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"}]},YO={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 Sb={root:"dd-fxP4c",title:"dd-vDbMh",empty:"dd-sB0lz",status:"dd--oZ1C",form:"dd-t0hnD",input:"dd-i1v3W",submit:"dd-oo2Oa",question:"dd-WvK17",answer:"dd-HAHcU",alignRight:"dd-oxrX3",listItemFeedback:"dd-POUal"};var dt=x(C()),QO=({threadId:e,onNewThreadId:t,onUse:n,onResetQuestion:r,question:o})=>{var p;let[s,i]=zo.default.useState(""),{setSelected:a}=eo(),l=(0,zo.useRef)(null),u=L("KnowledgeSearchStyles",Sb),c=Y(Bh),f=G(),d=(p=M(Eh(e!=null?e:-1)))!=null?p:[],g=pb(m=>bh({input:m,threadId:e,onNewThreadId:h=>t(h)}),{onSuccess(m){f(ct({name:"knowledge assist question answered",data:{question:s||o,sources:m.answer.sources,answer:m.answer.answer,isFollowUpQuestion:d.length>=1},options:{includeConversationData:!0}})),a(`knowledge-assist-${d.length}`),i("")}}),y=m=>P(void 0,null,function*(){m.preventDefault(),m.stopPropagation(),s!==""&&g.call(s)}),v=(m,h)=>{f(ct({name:"knowledge assist source viewed",data:{question:h,sourceViewed:m.url||m.name},options:{includeConversationData:!0}}))};return(0,zo.useEffect)(()=>{var m;o&&g.state==="idle"?g.call(o):(m=l.current)==null||m.focus()},[l,g.state]),(0,zo.useEffect)(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[l,d]),(0,dt.jsxs)("div",{className:u.root,children:[d.length>0&&(0,dt.jsx)("div",{className:u.alignRight,children:(0,dt.jsx)(he.Button,{onClick:r,children:c("reset")})}),d.map(({question:m,answer:h},S)=>(0,dt.jsx)(he.List,{children:(0,dt.jsx)(he.ListItem,{id:`knowledge-assist-${S}`,"data-testid":"knowledge-search-answer",description:h.answer,closeOnSelect:!0,onClick:()=>n(h.answer),onSourceClick:w=>v(w,m),sources:h.sources,styles:{title:u.question,description:u.answer},extra:(0,dt.jsx)("div",{className:u.listItemFeedback,children:(0,dt.jsx)(yi,{feedbackText:h.answer,feedbackType:"knowledge-assist-answer",eventName:"knowledge assist feedback",eventData:T({question:m,isAgent:o!==m,isFollowUpQuestion:d.length>1},h)})}),children:m})},`${h.answer}_${S}`)),g.state==="loading"&&(0,dt.jsx)("p",{className:u.status,children:c("loading")}),g.state==="error"&&(0,dt.jsx)("p",{className:u.status,children:c("error")}),(0,dt.jsxs)("form",{className:u.form,onSubmit:y,children:[(0,dt.jsx)("input",{ref:l,placeholder:c("anotherQuestion"),className:u.input,type:"text",value:s,onFocus:()=>{a(void 0)},onChange:m=>{a(void 0),i(m.target.value)}}),(0,dt.jsx)("button",{type:"submit",className:u.submit,disabled:g.state==="loading",children:(0,dt.jsx)(vb,{})})]})]})},xb=QO;var Ge=x(D()),wb=x(se());var Vh={root:"dd-uVyL0",trigger:"dd-KIzQa",content:"dd-Ly3zO",contentOpen:"dd-O-8fR",contentTop:"dd-q3fGa",contentBottom:"dd-SFrvc",item:"dd-HZNy-"};var jo=x(C()),XO=0,Eb=Ge.default.createContext(null),ZO=()=>{let e=(0,Ge.useContext)(Eb);if(!e)throw new Error("Invalid DropdownContext");return e},bb=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,Ge.useMemo)(()=>++XO,[]),o=(0,Ge.useRef)(null),s=(0,Ge.useRef)(null),i=L("Dropdown",Vh),[a,l]=(0,Ge.useState)(!1),[u,c]=(0,Ge.useState)(n),f=g=>{g.preventDefault(),g.stopPropagation(),l(!a)},d=(0,Ge.useCallback)(([g])=>{!g.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,Ge.useEffect)(()=>{let g=y=>{o.current&&!o.current.contains(y.target)&&l(!1)};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}},[]),(0,Ge.useEffect)(()=>{if(!s.current&&!a)return()=>{};let g=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return s.current&&g.observe(s.current),()=>{s.current&&g.unobserve(s.current)}},[s,a]),(0,jo.jsx)(Eb.Provider,{value:{setIsOpen:l},children:(0,jo.jsxs)("div",{ref:o,className:i.root,children:[(0,jo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:i.trigger,onClick:f,children:e}),(0,jo.jsx)("div",{"data-testid":"dropdown-content",ref:s,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,wb.default)(i.content,{[i.contentOpen]:a,[i.contentTop]:u==="top",[i.contentBottom]:u==="bottom"}),children:t})]})})};function JO(o){var s=o,{as:e,children:t,onClick:n}=s,r=ee(s,["as","children","onClick"]);let i=e||"button",a=L("Dropdown",Vh),{setIsOpen:l}=ZO(),u=c=>{l(!1),n(c),c.stopPropagation()};return(0,jo.jsx)(i,I(T({type:"button",className:a.item,onClick:u},r),{children:t}))}bb.Item=JO;var Kh=bb;var Wh=x(C()),Cb=e=>(0,Wh.jsx)("svg",I(T({xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512"},e),{children:(0,Wh.jsx)("path",{fill:"currentColor",d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"})}));var Bo={};Xe(Bo,{enUS:()=>eN,nlNL:()=>tN});var eN={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"}],giveFeedback:[{type:0,value:"Give feedback"}],answer:[{type:0,value:"Answer"}]},tN={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"}],giveFeedback:[{type:0,value:"Geef feedback"}],answer:[{type:0,value:"Antwoord"}]};var $d=x(C()),nN=({suggestion:e,source:t,context:n})=>{let r=Y(Bo),o=M(Yr),s=G(),i=z("enableSuggestionFeedback"),a=`${e.text}`,l=M(hi(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),u=()=>{s(ct({name:"suggestion feedback",data:{text:e.text,source:t,context:n},options:{includeConversationData:!0}}))};return!i||!l?null:(0,$d.jsx)(Kh,{trigger:(0,$d.jsx)(Cb,{"data-testid":"feedback-dropdown-trigger"}),children:(0,$d.jsx)(Kh.Item,{as:"a",onClick:u,target:"_blank",href:l,children:r("giveFeedback")})})},qd=nN;var Jt=x(D());var $h={};Xe($h,{enUS:()=>rN,nlNL:()=>oN});var rN={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."}]},oN={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 Tb={root:"dd-60NZr",actions:"dd-No1g3",main:"dd-l-xEF",textInput:"dd-nAaiV",loading:"dd-ciFNi",error:"dd-yNp2D"};var Nn=x(C()),sN=({onCopy:e})=>{let t=(0,Jt.useRef)(null),n=L("SummaryForm",Tb),[r,o]=(0,Jt.useState)(""),[s,i]=(0,Jt.useState)(""),[a,l]=(0,Jt.useState)(!1),u=M(nr),c=Y($h),f=G(),d=()=>{f(ct({name:"summary copied to clipboard",data:{originalText:r,finalText:s},options:{includeConversationData:!0}})),e(s)},g=()=>{let y=document.getSelection();y&&f(ct({name:"summary copied to clipboard",data:{originalText:r,finalText:y==null?void 0:y.toString(),assistant:u==null?void 0:u.summarizerAssistantNew},options:{includeConversationData:!0}}))};return(0,Jt.useEffect)(()=>{f(li({})).then(y=>{if(y.error){l(!0);return}o(y.payload||""),i(y.payload||"")})},[]),(0,Jt.useEffect)(()=>{t.current&&r&&t.current.focus()},[t,r]),(0,Jt.useEffect)(()=>{let y=v=>{v.key==="Enter"&&v.shiftKey&&d()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[s]),(0,Nn.jsx)("div",{className:n.root,tabIndex:-1,children:a?(0,Nn.jsx)("p",{className:n.error,children:c("error")}):(0,Nn.jsxs)(Jt.Fragment,{children:[(0,Nn.jsx)("div",{className:n.main,children:(0,Nn.jsx)("textarea",{placeholder:r?void 0:c("loading"),disabled:!r,className:n.textInput,ref:t,value:s,onCopy:g,onChange:y=>i(y.target.value)})}),(0,Nn.jsxs)("div",{className:n.actions,children:[(0,Nn.jsx)(yi,{feedbackText:r||"",feedbackType:"summary",eventName:"summary feedback",eventData:{summary:r}}),(0,Nn.jsx)(he.Button,{shortKeys:[8679,8629],onClick:d,children:c("copy")})]})]})})},kb=sN;var pl={};Xe(pl,{enUS:()=>iN,nlNL:()=>aN});var iN={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?"}]},aN={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 _b=x(D());var lN=["{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}"],uN=new RegExp(lN.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function Pb(e,t){let n=e.split(uN),r=0,o=[];for(let s=0;s<n.length;s++){let i=n[s];if(o.push(i),s===n.length-1)break;if(t.indexOf(i)===-1)return e;let a=n[s+1],l=s===n.length-2;r+=i.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 Rb(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var Ib={suggestions:[],fetchState:"idle"},Ab={default:Ib},Lb=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},Gd=e=>e.textSuggestions,Ob=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},Yd=Ie("textSuggestions/refresh"),vn=V("textSuggestions/recommendations",(e,t)=>P(void 0,null,function*(){var c;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(c=r.conversation.current)==null?void 0:c.id,{platformVariables:s}=r.info,{textSuggestionsCount:i,inlineSuggestions:a}=r.settings,l=si(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getTextSuggestions(o,$a(r),e);if(s&&(u=u.map(f=>T(I(T({},f),{text:qe(f.text,s)}),f.title?{title:qe(f.title,s)}:{}))),e==="default"){let f=a?u.filter(Ob(l)):u;t.dispatch(Qr(f.slice(0,i)))}return u})),ml=V("textSuggestions/autocompletions",(e,t)=>P(void 0,null,function*(){var c;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(c=r.conversation.current)==null?void 0:c.id,{platformVariables:s}=r.info,{textSuggestionsCount:i,deanonymize:a,inlineSuggestions:l}=r.settings;if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getAutocompleteSuggestions(o,I(T({},$a(r)),{input:e}));if(!t.getState().input.text)throw new Error("Abort");return l&&(u=u.filter(Ob(e))),s&&(u=u.map(f=>I(T({},f),{text:qe(f.text,s)}))),a&&(u=u.map(f=>I(T({},f),{text:f.source!=="trie-with-typos"?Pb(f.text,e):f.text}))),u=Rb(u,i),t.dispatch(Qr(u)),u})),Nb=J({name:"textSuggestions",initialState:Ab,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}}}}},extraReducers:e=>{e.addCase(vn.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||Ib;return I(T({},t),{[r]:I(T({},o),{fetchState:"loading"})})}).addCase(vn.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(vn.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(ml.pending,t=>{t.default.fetchState="loading"}).addCase(ml.rejected,t=>{t.default.fetchState="error"}).addCase(ml.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(xe,()=>Ab)}}),{setTextSuggestions:V7}=Nb.actions,Mb=Nb.reducer;var Vo=x(C()),cN=({types:e,commands:t,onClick:n})=>{let r=G(),o=Y(pl),s=M(Gd);return(0,_b.useEffect)(()=>{e.forEach(({type:i})=>{(!s[i]||s[i].suggestions.length===0)&&r(vn(i))})},[]),(0,Vo.jsxs)("div",{children:[t.length>0&&(0,Vo.jsx)(he.List,{heading:o("commands"),children:t.map((i,a)=>(0,Vo.jsx)(he.ListItem,{id:`command-${a}`,closeOnSelect:!1,onClick:i.onClick,children:i.label},i.label))}),e.map(({type:i,title:a})=>{var l;return(0,Vo.jsx)(he.List,{heading:a,orientation:"vertical",children:(l=s[i])==null?void 0:l.suggestions.map((u,c)=>(0,Vo.jsx)(he.ListItem,{id:`${i}-${c}`,closeOnSelect:!1,description:u.title&&u.text,onClick:()=>n(u.text,u),"data-testid":"search-overlay-suggestion",children:u.title||u.text},`${u.id}-${u.text}`))},i)})]})},Db=cN;var De=x(C()),fN=200,pN=5,mN=4,qh=(e,t,n)=>e.slice(0,n?10:t.toLowerCase()==="image"?mN:pN),Fb=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),gN=()=>{var En,xr,we;let e=G(),t=Xt(),n=Y(pl),[r,o]=(0,ft.useState)(!1),[s,i]=(0,ft.useState)(""),[a,l]=(0,ft.useState)(null),u=M(eE),c=M(nr),[f,d]=(0,ft.useState)(),g=M(ut),y=z("showSearch"),v=z("enableSuggestionFeedback"),p=z("showEntitiesCommand"),m=z("showSummaryCommand"),h=z("showKnowledgeSearch"),S=z("showImageSearch"),w=z("searchTriggerKey"),k=M(DE),b=M(tE),R=M(nE),N=M(J1),_=((we=(xr=(En=c==null?void 0:c.uiConfig)==null?void 0:En.search)==null?void 0:xr.initialTypes)==null?void 0:we.filter(({isActive:B})=>B))||[],Q=(0,ft.useMemo)(()=>{let B=Pe=>qh(b.filter(fe=>fe.type===Pe.toUpperCase()),Pe,f),X=(k==null?void 0:k.map(Pe=>({value:Pe.code.toUpperCase(),label:`${Pe.name}s`,list:B(Pe.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[];if(X.push({value:"PERSONAL",label:n("personalSuggestions"),list:B("PERSONAL"),lineClamp:!1,listOrientation:"vertical"},{value:"URL",label:n("urlSuggestions"),list:B("URL"),lineClamp:!1,listOrientation:"vertical"},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:B("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical"}),S&&X.push({value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:B("IMAGE"),listOrientation:"horizontal"}),_.length===0)return X;let yt=_.map(Pe=>X.find(fe=>fe.value.toLowerCase()===Pe.type)).filter(Pe=>!!Pe),ce=X.filter(Pe=>!yt.find(fe=>fe.value===Pe.value));return[...yt,...ce]},[k,_,S,f]),K=[{label:n("entitiesClipboard"),onClick:()=>e(fn("entities")),shouldShow:p&&Fb(n("entitiesClipboard"),s)},{label:n("summaryClipboard"),onClick:()=>e(fn("summary")),shouldShow:m&&Fb(n("summaryClipboard"),s)},{label:s?`${n("knowledgeAssist")}: ${s}`:n("knowledgeAssist"),onClick:()=>e(fn("knowledgeAssist")),shouldShow:h}].filter(B=>B.shouldShow).filter(()=>!f),W=(0,ft.useCallback)((0,Hb.default)((B,X)=>{e(Lo({query:B,type:X,tags:["search-overlay"],size:f?50:20}))},fN),[f]),de=(0,ft.useCallback)((B,X)=>{switch(X.type){case"IMAGE":t.send(lh,{suggestion:X});break;default:t.send(Xr,{text:B,suggestion:X})}e(Nt(!1))},[e]),Ye=B=>{rr(B.text),e(ct({name:"entity copied",data:{entity:B,type:"copy"}})),e(Nt(!1))},Ft=B=>{t.send(Xr,{text:B,suggestion:{source:"knowledge-assist",text:B}}),e(ct({name:"answer used",data:{originalText:B},options:{includeConversationData:!0}})),i(""),a&&e(Ld(a)),e(fn("search")),e(Nt(!1))},ns=B=>{rr(B),e(Nt(!1))};function Ht(B){return X=>{r?window.confirm(n("warning"))&&(B(X),o(!1)):B(X)}}return(0,ft.useEffect)(()=>{s?W(s,f):e(fd())},[s,f]),(0,ft.useEffect)(()=>{g&&e(tl())},[g]),lb(w,()=>e(Nt(!0))),!y||!c?null:(0,De.jsxs)(he,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:i,onChangeOpen:Ht(B=>e(Nt(B))),onChangeType:B=>d(B),onChangePage:Ht(B=>e(fn(B))),selectedType:f,search:s,page:u,isOpen:N,types:Q,updateDeps:[b],children:[(0,De.jsxs)(he.Page,{id:"search",children:[s.length===0&&(0,De.jsx)(Db,{types:_,commands:K,onClick:de}),s.length>0&&(0,De.jsxs)(ft.Fragment,{children:[K.length>0&&(0,De.jsx)(he.List,{heading:n("commands"),children:K.map((B,X)=>(0,De.jsx)(he.ListItem,{closeOnSelect:!1,onClick:B.onClick,id:`commands-${X}`,children:B.label},B.label))}),Q.map(({value:B,label:X,list:yt,lineClamp:ce,listOrientation:Pe})=>(0,De.jsx)(he.List,{heading:X,orientation:Pe==="horizontal"?"horizontal":"vertical",onShowAll:()=>d(B),hasMore:!f&&R[B.toLowerCase()]>qh(yt,B,f).length,children:qh(yt,B,f).map(fe=>(0,De.jsx)(he.ListItem,{id:`${B}-${fe.id}`,closeOnSelect:!1,lineClamp:ce,onClick:()=>de(fe.text,fe),description:B!=="IMAGE"?fe.title&&fe.text:void 0,extra:v&&(0,De.jsx)(he.ListItemActions,{children:(0,De.jsx)(qd,{context:s,source:"search",suggestion:fe})}),children:B==="IMAGE"?(0,De.jsx)(he.Image,{title:fe.title||fe.text,src:fe.image}):fe.title||fe.text},`${fe.id}-${fe.text}`))},B))]})]}),(0,De.jsx)(he.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:Ht(()=>{e(fn("search"))}),children:(0,De.jsx)(fb,{onCopy:Ye})}),(0,De.jsx)(he.Page,{id:"summary",title:n("summaryTitle"),onDismiss:Ht(()=>{e(fn("search"))}),children:(0,De.jsx)(kb,{onCopy:ns})}),(0,De.jsx)(he.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:Ht(()=>{a&&e(Ld(a)),e(fn("search"))}),children:(0,De.jsx)(xb,{threadId:a,onNewThreadId:B=>l(B),question:s,onUse:Ft,onResetQuestion:()=>{a&&e(Ld(a)),i(""),l(null)}})})]})},Ub=gN;var gl=x(C()),hN=()=>{let e=z("showSearch"),t=z("isEmbedded");return(0,gl.jsxs)(zb.Fragment,{children:[e&&(0,gl.jsx)(Ub,{}),t&&(0,gl.jsx)(CE,{})]})},jb=hN;var Wb=x(se());var Qd=x(C()),Bb=({className:e})=>(0,Qd.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512 512",xmlSpace:"preserve",className:e,children:(0,Qd.jsx)("g",{children:(0,Qd.jsx)("path",{d:`M163.4,233h186v-70c0-25.6-9.4-47.8-27.3-65.7C304.2,79.4,282,70,256.4,70s-47.8,9.4-65.7,27.3
19
+ `),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global!="undefined"&&global.INTERWEAVE_SSR_POLYFILL||PO)();if(!o)return;let s=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",i=s==="body"||s==="fragment"?o.body:o.createElement(s);return t.match(CO)||(i.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,GE.default)(t):t)),i}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==qE||!t.attributes||([...t.attributes].forEach(s=>{let{name:i,value:a}=s,l=i.toLowerCase(),u=Hd[l]||Hd[i];if(!this.isSafe(t)||!l.match(TO)&&(!n&&(!u||u===Ih)||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===Jr?c=!0:u===_o?c=Number.parseFloat(String(c)):u!==Fd&&(c=String(c)),r[Lh[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,(s,i)=>String(i).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return il[t]?I(T(T({},n),il[t]),{tagName:t}):n}isSafe(t){if(typeof HTMLAnchorElement!="undefined"&&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:s,transform:i,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===qE){let d=c.nodeName.toLowerCase(),g=this.getTagConfig(d);u&&(l.push(u),u="");let y=this.applyNodeFilters(d,c);if(!y)return;let v;if(i&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;v=this.parseNode(y,g);let m=i(y,v,g);if(m===null)return;if(typeof m!="undefined"){l.push(Fo.default.cloneElement(m,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(s||this.canRenderChild(n,g))){var f;this.keyIndex+=1;let p=this.extractAttributes(y),m={tagName:d};p&&(m.attributes=p),g.void&&(m.selfClose=g.void),l.push(Fo.default.createElement(Ud,I(T({},m),{key:this.keyIndex}),(f=v)!==null&&f!==void 0?f:this.parseNode(y,g)))}else l=[...l,...this.parseNode(y,g.tagName?g:n)]}else if(c.nodeType===bO){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,s=null;for(;s=o.match(kO);){let[i,a]=s,l=s.index,u=i.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],g;if(u)g=i.length,r.push(f.createElement(c,d));else{let y=o.match(new RegExp(`{{{/${a}}}}`));g=y.index+y[0].length,r.push(f.createElement(this.replaceTokens(o.slice(i.length,y.index),n),d))}o=o.slice(g)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function RO(e){var t;let{attributes:n,className:r,containerTagName:o,content:s,emptyContent:i,parsedContent:a,tagName:l,noWrap:u}=e,c=(t=o!=null?o:l)!==null&&t!==void 0?t:"span",f=c==="fragment"?!0:u,d;if(a)d=a;else{let g=new zd(s!=null?s:"",e).parse();g.length>0&&(d=g)}return d||(d=i),f?Fo.default.createElement(Fo.default.Fragment,null,d):Fo.default.createElement(Ud,{attributes:n,className:r,tagName:c},d)}function ui(e){let k=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:s=!1,emptyContent:i=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1}=k,g=ee(k,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),y=s?[]:l,v=o?[]:a,p=c?[c]:[],m=u?[u]:[];y.forEach(b=>{b.onBeforeParse&&p.push(b.onBeforeParse.bind(b)),b.onAfterParse&&m.push(b.onAfterParse.bind(b))});let h=p.reduce((b,R)=>R(b,e),r!=null?r:""),S=new zd(h,g,y,v),w=m.reduce((b,R)=>R(b,e),S.parse());return Fo.default.createElement(RO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:i,noWrap:d,parsedContent:w.length===0?void 0:w,tagName:f})}var tb=x(D());var AO=/[.*+?^${}()|[\]\\]/g,IO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function LO(e){return e.replace(AO,"\\$&")}function OO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function NO(e){return e.search(IO)}function YE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${LO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function QE(e){return e.replace(ou,'<mark data-type="placeholder">$1</mark>')}function ci(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function MO(e,t){return e.split("").map((i,a)=>({char:i,index:a})).filter(({char:i,index:a})=>/\s/.test(i)&&a<=t).map(({index:i})=>i).reverse()[0]}function Nh(e,t,n={}){if(t){let r=OO(t.toLowerCase(),e.toLowerCase()),o=ci(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=NO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let i=t.split(n0).length>3||t.length>30?MO(t.trim(),r):0;return`${`${i>0?"\u2026":""}${ci(e.substring(i,r))}`}<strong>${o}</strong>`}return e}var _O=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function jd(e){return _O.test(e)}function XE(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var Bd=x(D()),eb=x(C()),ZE=Bd.default.createContext(void 0);function eo(){let e=Bd.default.useContext(ZE);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var JE=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s})=>{let i=Bd.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s}),[n,t,o]);return(0,eb.jsx)(ZE.Provider,{value:i,children:e})};var Zt=x(C()),DO=3,nb=({children:e})=>{let t=L("CommandPalette",_t);return(0,Zt.jsx)("div",{className:t.listItemActions,children:e})};function Mh(d){var g=d,{closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,extra:o,onSourceClick:s,description:i,sources:a,id:l,styles:u,defaultSourcesAmount:c=DO}=g,f=ee(g,["closeOnSelect","lineClamp","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var k;let y=Y(or),[v,p]=(0,tb.useState)(!1),{selected:m,onChangeOpen:h}=eo(),S=L("CommandPalette",_t);function w(b){r(b),e&&h(!1)}return(0,Zt.jsxs)("div",{className:(0,al.default)(S.listItem,l===m&&S.listItemSelected),children:[(0,Zt.jsx)("button",I(T({type:"button",className:S.listItemAction,"aria-disabled":(k=f.disabled)!=null?k:!1,onClick:w,"data-command-palette-item":!0,"data-item-id":l},f),{children:(0,Zt.jsxs)("div",{className:S.listItemContent,children:[typeof n=="string"?(0,Zt.jsx)("p",{className:(0,al.default)(S.listItemText,S.truncate,u==null?void 0:u.title),children:n}):n,i&&(0,Zt.jsx)(ui,{tagName:"p",allowList:[],content:jd(i)?XE(i):i,className:(0,al.default)(S.listItemDescription,u==null?void 0:u.description,t?S.lineClamp:S.truncate)})]})})),o,a&&a.length>0&&(0,Zt.jsxs)("div",{className:S.sources,children:[(0,Zt.jsx)("span",{className:S.sourcesTitle,children:y("sources")}),a.slice(0,v?a.length:c).map(b=>(0,Zt.jsx)("a",{className:S.source,href:b.url,target:"_blank",title:b.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>s&&s(b),children:b.name},b.url)),!v&&a.length>c&&(0,Zt.jsx)("button",{className:(0,al.default)(S.source,S.sourceShowMore),type:"button",onClick:()=>p(!0),children:y("showMore",{amount:a.length-c})})]})]})}var ll=x(C()),rb=()=>(0,ll.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,ll.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,ll.jsx)("path",{d:"M192 448c-8.188 0-16.38-3.125-22.62-9.375l-160-160c-12.5-12.5-12.5-32.75 0-45.25l160-160c12.5-12.5 32.75-12.5 45.25 0s12.5 32.75 0 45.25L77.25 256l137.4 137.4c12.5 12.5 12.5 32.75 0 45.25C208.4 444.9 200.2 448 192 448z"})]});var Ho=x(C());function _h({children:e,title:t,id:n,onDismiss:r}){let o=Y(or),s=L("CommandPalette",_t),{page:i}=eo();return i!==n?null:(0,Ho.jsxs)("div",{className:s.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,Ho.jsxs)("div",{className:s.pageNav,children:[(0,Ho.jsxs)("button",{className:s.pageBackButton,type:"button",onClick:r,children:[(0,Ho.jsx)(rb,{}),o("back")]}),t&&(0,Ho.jsx)("h3",{className:s.pageTitle,children:t})]}),e]})}var ob=x(D());var ul=x(C()),di=()=>(0,ul.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,ul.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,ul.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 hn=x(C());function FO({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:s,selectedType:i},a){let l=L("CommandPalette",_t);return(0,hn.jsxs)("div",{className:l.search,children:[(0,hn.jsx)("div",{className:l.searchIcon,children:(0,hn.jsx)(di,{})}),(0,hn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,hn.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:s,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,hn.jsx)("div",{className:l.selectWrapper,children:(0,hn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:i||r,children:[r&&(0,hn.jsx)("option",{children:r}),o.map(u=>(0,hn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var sb=(0,ob.forwardRef)(FO);var Dh=x(se());var Vd=x(C()),HO=o=>{var s=o,{onClick:e,shortKeys:t,children:n}=s,r=ee(s,["onClick","shortKeys","children"]);let i=L("CommandPalette",_t);return(0,Vd.jsxs)("button",I(T({type:"button"},r),{onClick:e,className:(0,Dh.default)(i.actionButton,r.className,{[i.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(a=>(0,Vd.jsx)("span",{className:(0,Dh.default)(i.actionShortcut,a===8629&&i.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},ib=HO;var cl=x(C()),UO="[data-command-palette-item]";function Uo({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:s,onChangeType:i,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d,updateDeps:g=[]}){let[y,v]=(0,ar.useState)(),p=(0,ar.useRef)(null),m=()=>{o&&o(n),i(void 0),s(""),a(!1)},h=()=>{var K;if(r!==n&&o){o(n);return}if(l&&i){i(void 0),(K=p.current)==null||K.focus();return}if(d.length>0){s("");return}a(!1)},S=()=>{let K=w();K.length!==0&&v(K[0].dataset.itemId)},w=()=>Array.from(document.querySelectorAll(UO)||[]),k=K=>document.querySelector(`[data-item-id=${K}]`),b=K=>{let W=k(K);W&&v(W.dataset.itemId)},R=K=>{let W=k(K);W&&W.scrollIntoView({behavior:"smooth"})},N=()=>{if(!y)return;let K=w(),W=k(y);if(!W)return;let de=K.indexOf(W),Ye=K[de+1];Ye&&Ye.dataset.itemId?b(Ye.dataset.itemId):S()},_=()=>{if(!y)return;let K=w(),W=k(y);if(!W)return;let de=K.indexOf(W),Ye=K[de-1];Ye&&Ye.dataset.itemId?b(Ye.dataset.itemId):b(K[K.length-1].dataset.itemId)},Q=(0,ar.useCallback)(K=>{switch(K.key){case"ArrowDown":{K.preventDefault(),N();break}case"ArrowUp":{K.preventDefault(),_();break}case"Enter":{if(y){let W=k(y);W==null||W.click()}break}}},[y]);return(0,ar.useEffect)(()=>{S()},[d,r,l,f,...g]),(0,ar.useEffect)(()=>{y&&R(y)},[y]),(0,cl.jsx)(Rd,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:h,onClose:m,onKeyDown:Q,children:(0,cl.jsxs)(JE,{selected:y,setSelected:v,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,cl.jsx)(sb,{ref:p,onChange:s,onChangeType:i,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Uo.Page=_h;Uo.List=Ch;Uo.Image=jE;Uo.ListItem=Mh;Uo.ListItemActions=nb;Uo.Button=ib;var he=Uo;var ab=x(D());function lb(e,t){(0,ab.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 dl=x(D());var ub={data:null,fetchState:"idle"},Kd=e=>{var s,i,a,l;let t=[],{visitorName:n}=(s=e.info.visitorInfo)!=null?s:{},{agentName:r,agentNickname:o}=(i=e.info.agentInfo)!=null?i:{};return r&&r!==n&&t.push(r),o&&o!==n&&t.push(o),(l=(a=e.entities.data)==null?void 0:a.filter(u=>!t.includes(u.text)))!=null?l:null},yn=V("entities/getEntities",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,s=yield o();return s.length===0?Promise.resolve([]):n.getEntities(s)})),zO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),jO=J({name:"entities",initialState:ub,reducers:{},extraReducers:e=>{e.addCase(yn.pending,t=>{t.fetchState="loading"}).addCase(yn.rejected,t=>{t.fetchState="error"}).addCase(yn.fulfilled,(t,n)=>{t.fetchState="done",t.data=zO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(xe,()=>ub)}}),cb=jO.reducer;var Fh={};Xe(Fh,{enUS:()=>BO,nlNL:()=>VO});var BO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},VO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var db={root:"dd-TYTKs",empty:"dd-AU7uT"};var fi=x(C()),KO=({onCopy:e})=>{let t=(0,dl.useRef)(null),n=L("EntitiesList",db),r=M(Kd),{setSelected:o}=eo(),s=Y(Fh),i=G();return(0,dl.useEffect)(()=>{i(yn())},[]),(0,dl.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,fi.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,fi.jsx)(he.List,{children:r.map((a,l)=>(0,fi.jsx)(he.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,fi.jsx)("p",{className:n.empty,children:s("noResults")})]})},fb=KO;var zo=x(D());var pi=x(D());function pb(e,t){let n=(0,pi.useRef)(e);n.current=e;let[r,o]=(0,pi.useState)(void 0),[s,i]=(0,pi.useState)(void 0),[a,l]=(0,pi.useState)("idle"),u=G();return{error:s,state:a,data:r,call:f=>{l("loading"),u(n.current(f)).unwrap().then(d=>{o(d),l("done"),t!=null&&t.onSuccess&&(t==null||t.onSuccess(d))}).catch(d=>{i(d),l("error"),t!=null&&t.onError&&(t==null||t.onError(d))})}}}var Wd=x(se()),yb=x(D());var Hh=x(C()),Uh=e=>(0,Hh.jsx)("svg",I(T({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Hh.jsx)("path",{fillRule:"evenodd",d:"M6.57086468,14.9173453 C6.38997052,14.9711236 6.19835748,15 6,15 L4,15 C2.8954305,15 2,14.1045695 2,13 L2,4 C2,2.8954305 2.8954305,2 4,2 L6,2 C6.68685475,2 7.29284112,2.34623869 7.65294381,2.87370078 C7.95642355,2.67736738 8.29504785,2.51351337 8.66312366,2.3818197 C9.50544052,2.08044754 10.3408482,1.9879107 10.9989281,1.99971266 C11.0150698,2.00005426 13.3487605,2.00015005 18,2 C20.7551411,2 22,6.05643086 22,12 C22,13.6824804 20.8695981,15 19,15 L15.9269768,15 C15.9359266,15.0245465 15.9451954,15.0497804 15.9547911,15.0757271 C16.007193,15.2174219 16.2391583,15.8256341 16.2970775,15.9810953 C16.4872151,16.4914441 16.6259612,16.9026411 16.7382242,17.3098712 C16.9079007,17.9253665 17,18.4798886 17,19 C17,20.4720069 16.091867,21.3862822 14.748281,21.777514 C14.1422801,21.9539723 13.6147967,22.0000922 13.0076976,22.0000008 L12.5204954,22 L12.2202699,21.6261158 C11.2556275,20.4248034 7.64562469,16.4822788 6.57086468,14.9173453 Z M8,13 C8,13.2401953 8.04443154,13.4528921 8.14171093,13.6800176 C8.40663864,14.2985643 11.914268,18.1371493 13.4599624,19.9848695 C13.7113931,19.9660111 13.9483736,19.9273712 14.1891338,19.8572655 C14.7621788,19.6904035 15,19.4509737 15,19 C15,18.6834183 14.9359344,18.2976852 14.8101464,17.8413935 C14.7161494,17.500423 14.5944107,17.1396301 14.4229225,16.6793379 C14.3689242,16.5344009 14.1358033,15.923159 14.0789589,15.7694517 C13.9489218,15.4178313 13.8632547,15.1589343 13.8046536,14.9236885 C13.5555377,13.9236468 13.8054549,13 15,13 L19,13 C19.6912225,13 20,12.6401099 20,12 C20,7.20925475 19.015127,4 18,4 C15.9322103,4 15.9322103,4 10.9655994,3.99940813 C10.5253746,3.99154158 9.91062406,4.05963657 9.33687634,4.2649175 C8.45196659,4.58152894 8,5.09776992 8,6 L8,13 Z M4,4 L4,13 L6,13 L6,4 L4,4 Z"})}));var zh=x(C()),mb=e=>(0,zh.jsx)("svg",I(T({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,zh.jsx)("path",{fillRule:"evenodd",d:"M7.65336736,21.1256786 C7.2933164,21.6534897 6.68712411,22 6,22 L4,22 C2.8954305,22 2,21.1045695 2,20 L2,11 C2,9.8954305 2.8954305,9 4,9 L6,9 C6.198171,9 6.38961023,9.02882212 6.57035446,9.08250314 C7.6444817,7.51807482 11.2554748,3.57449216 12.2202699,2.37298955 L12.5204954,1.99910538 L13,1.99910538 C13.6147967,1.99901314 14.1422801,2.04513312 14.748281,2.22159137 C16.091867,2.61282321 17,3.52709845 17,4.99910538 C17,5.51921677 16.9079007,6.07373891 16.7382242,6.68923415 C16.6259612,7.09646424 16.4872151,7.50766133 16.2970775,8.01801005 C16.2391583,8.17347129 16.007193,8.78168345 15.9547911,8.92337824 C15.9451954,8.94932503 15.9359266,8.9745589 15.9269768,8.99910538 L19,8.99910538 C20.8695981,8.99910538 22,10.316625 22,11.9991054 C22,17.9426745 20.7551411,21.9991054 18,21.9991054 L11.0344006,21.9985135 C10.3408482,22.0111947 9.50544052,21.9186578 8.66312366,21.6172857 C8.29521907,21.4856533 7.9567386,21.3218904 7.65336736,21.1256786 Z M8,17.9991054 C8,18.9013355 8.45196659,19.4175764 9.33687634,19.7341879 C9.91062406,19.9394688 10.5253746,20.0075638 10.963066,19.9997143 C10.9703499,19.9995545 10.9703499,19.9995545 11,19.9991054 L18,19.9991054 C19.015127,19.9991054 20,16.7898506 20,11.9991054 C20,11.3589955 19.6912225,10.9991054 19,10.9991054 L15,10.9991054 C13.8054549,10.9991054 13.5555377,10.0754586 13.8046536,9.07541689 C13.8632547,8.84017106 13.9489218,8.5812741 14.0789589,8.22965366 C14.1358033,8.07594642 14.3689242,7.46470447 14.4229225,7.31976744 C14.5944107,6.85947528 14.7161494,6.4986824 14.8101464,6.1577119 C14.9359344,5.70142019 15,5.31568707 15,4.99910538 C15,4.54813166 14.7621788,4.30870189 14.1891338,4.1418399 C13.9483736,4.07173418 13.7113931,4.0330943 13.4599624,4.01423587 C11.914268,5.86195611 8.40663864,9.70054105 8.14171093,10.3190878 C8.04443154,10.5462133 8,10.7589101 8,10.9991054 L8,17.9991054 Z M4,11 L4,20 L6,20 L6,11 L4,11 Z"})}));function mi(e,t){var o;let n=e.cloneNode(!0);n.style.top=`${e.offsetTop}px`,n.style.left=`${e.offsetLeft}px`,n.style.position="absolute",t.split(" ").forEach(s=>{n.classList.add(s)}),n.addEventListener("animationend",()=>n.remove()),(o=e.parentElement)==null||o.appendChild(n)}var jh={};Xe(jh,{enUS:()=>WO,nlNL:()=>$O});var WO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},$O={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};function gb(e){return V("analytics/logEvent",(t,n)=>{var s,i,a;let r=(i=(s=n.getState())==null?void 0:s.conversation.current)==null?void 0:i.id,o=(a=n.getState())==null?void 0:a.info.agentInfo;return n.extra.deepdeskAPI.sendEvent(t.name,I(T({conversationId:r},o),{data:t.data}))})(e)}function gi(){let e=G();return(t,n)=>P(this,null,function*(){yield e(gb({name:t,data:n}))})}var hb={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var hi=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t,s=o||window.location.origin;return r&&!n?null:r&&n?`${s}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:`${s}${e}`};var lr=x(C()),qO=({eventName:e,eventData:t,feedbackType:n,feedbackText:r})=>{let o=L("FeedbackThumbs",hb),s=z("enableFeedbackForm"),i=M(Yr),a=M(hi(`/admin/feedback?conversationId=${i}&type=${n}&text=${r}&data=${JSON.stringify(t)}`)),l=Y(jh),u=gi(),[c,f]=(0,yb.useState)(null),d=y=>{y.stopPropagation(),mi(y.target,o.fadeup),f("up"),u(e,I(T({},t),{rating:"up"}))},g=y=>{y.stopPropagation(),mi(y.target,o.fadedown),f("down"),u(e,I(T({},t),{rating:"down"}))};return(0,lr.jsxs)("div",{className:o.thumbs,children:[(0,lr.jsx)(re.Button,{title:l("thumbsUp"),onClick:d,icon:(0,lr.jsx)(mb,{}),className:(0,Wd.default)(o.thumbsUp,c==="up"&&o.selected),disabled:!!c}),s&&a?(0,lr.jsx)(re.Button,{as:"a",title:l("thumbsDown"),href:a,target:"_blank",rel:"noreferrer",onClick:g,icon:(0,lr.jsx)(Uh,{}),className:(0,Wd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c}):(0,lr.jsx)(re.Button,{title:l("thumbsDown"),onClick:g,icon:(0,lr.jsx)(Uh,{}),className:(0,Wd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c})]})},yi=qO;var fl=x(C()),vb=()=>(0,fl.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 512 512","aria-labelledby":"paperPlaneTitle",children:[(0,fl.jsx)("title",{id:"paperPlaneTitle",children:"PaperPlane"}),(0,fl.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 Bh={};Xe(Bh,{enUS:()=>GO,nlNL:()=>YO});var GO={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"}]},YO={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 Sb={root:"dd-fxP4c",title:"dd-vDbMh",empty:"dd-sB0lz",status:"dd--oZ1C",form:"dd-t0hnD",input:"dd-i1v3W",submit:"dd-oo2Oa",question:"dd-WvK17",answer:"dd-HAHcU",alignRight:"dd-oxrX3",listItemFeedback:"dd-POUal"};var dt=x(C()),QO=({threadId:e,onNewThreadId:t,onUse:n,onResetQuestion:r,question:o})=>{var p;let[s,i]=zo.default.useState(""),{setSelected:a}=eo(),l=(0,zo.useRef)(null),u=L("KnowledgeSearchStyles",Sb),c=Y(Bh),f=G(),d=(p=M(Eh(e!=null?e:-1)))!=null?p:[],g=pb(m=>bh({input:m,threadId:e,onNewThreadId:h=>t(h)}),{onSuccess(m){f(ct({name:"knowledge assist question answered",data:{question:s||o,sources:m.answer.sources,answer:m.answer.answer,isFollowUpQuestion:d.length>=1},options:{includeConversationData:!0}})),a(`knowledge-assist-${d.length}`),i("")}}),y=m=>P(void 0,null,function*(){m.preventDefault(),m.stopPropagation(),s!==""&&g.call(s)}),v=(m,h)=>{f(ct({name:"knowledge assist source viewed",data:{question:h,sourceViewed:m.url||m.name},options:{includeConversationData:!0}}))};return(0,zo.useEffect)(()=>{var m;o&&g.state==="idle"?g.call(o):(m=l.current)==null||m.focus()},[l,g.state]),(0,zo.useEffect)(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[l,d]),(0,dt.jsxs)("div",{className:u.root,children:[d.length>0&&(0,dt.jsx)("div",{className:u.alignRight,children:(0,dt.jsx)(he.Button,{onClick:r,children:c("reset")})}),d.map(({question:m,answer:h},S)=>(0,dt.jsx)(he.List,{children:(0,dt.jsx)(he.ListItem,{id:`knowledge-assist-${S}`,"data-testid":"knowledge-search-answer",description:h.answer,closeOnSelect:!0,onClick:()=>n(h.answer),onSourceClick:w=>v(w,m),sources:h.sources,styles:{title:u.question,description:u.answer},extra:(0,dt.jsx)("div",{className:u.listItemFeedback,children:(0,dt.jsx)(yi,{feedbackText:h.answer,feedbackType:"knowledge-assist-answer",eventName:"knowledge assist feedback",eventData:T({question:m,isAgent:o!==m,isFollowUpQuestion:d.length>1},h)})}),children:m})},`${h.answer}_${S}`)),g.state==="loading"&&(0,dt.jsx)("p",{className:u.status,children:c("loading")}),g.state==="error"&&(0,dt.jsx)("p",{className:u.status,children:c("error")}),(0,dt.jsxs)("form",{className:u.form,onSubmit:y,children:[(0,dt.jsx)("input",{ref:l,placeholder:c("anotherQuestion"),className:u.input,type:"text",value:s,onFocus:()=>{a(void 0)},onChange:m=>{a(void 0),i(m.target.value)}}),(0,dt.jsx)("button",{type:"submit",className:u.submit,disabled:g.state==="loading",children:(0,dt.jsx)(vb,{})})]})]})},xb=QO;var Ge=x(D()),wb=x(se());var Vh={root:"dd-uVyL0",trigger:"dd-KIzQa",content:"dd-Ly3zO",contentOpen:"dd-O-8fR",contentTop:"dd-q3fGa",contentBottom:"dd-SFrvc",item:"dd-HZNy-"};var jo=x(C()),XO=0,Eb=Ge.default.createContext(null),ZO=()=>{let e=(0,Ge.useContext)(Eb);if(!e)throw new Error("Invalid DropdownContext");return e},bb=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,Ge.useMemo)(()=>++XO,[]),o=(0,Ge.useRef)(null),s=(0,Ge.useRef)(null),i=L("Dropdown",Vh),[a,l]=(0,Ge.useState)(!1),[u,c]=(0,Ge.useState)(n),f=g=>{g.preventDefault(),g.stopPropagation(),l(!a)},d=(0,Ge.useCallback)(([g])=>{!g.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,Ge.useEffect)(()=>{let g=y=>{o.current&&!o.current.contains(y.target)&&l(!1)};return document.addEventListener("click",g),()=>{document.removeEventListener("click",g)}},[]),(0,Ge.useEffect)(()=>{if(!s.current&&!a)return()=>{};let g=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return s.current&&g.observe(s.current),()=>{s.current&&g.unobserve(s.current)}},[s,a]),(0,jo.jsx)(Eb.Provider,{value:{setIsOpen:l},children:(0,jo.jsxs)("div",{ref:o,className:i.root,children:[(0,jo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:i.trigger,onClick:f,children:e}),(0,jo.jsx)("div",{"data-testid":"dropdown-content",ref:s,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,wb.default)(i.content,{[i.contentOpen]:a,[i.contentTop]:u==="top",[i.contentBottom]:u==="bottom"}),children:t})]})})};function JO(o){var s=o,{as:e,children:t,onClick:n}=s,r=ee(s,["as","children","onClick"]);let i=e||"button",a=L("Dropdown",Vh),{setIsOpen:l}=ZO(),u=c=>{l(!1),n(c),c.stopPropagation()};return(0,jo.jsx)(i,I(T({type:"button",className:a.item,onClick:u},r),{children:t}))}bb.Item=JO;var Kh=bb;var Wh=x(C()),Cb=e=>(0,Wh.jsx)("svg",I(T({xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512"},e),{children:(0,Wh.jsx)("path",{fill:"currentColor",d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"})}));var Bo={};Xe(Bo,{enUS:()=>eN,nlNL:()=>tN});var eN={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"}],giveFeedback:[{type:0,value:"Give feedback"}],answer:[{type:0,value:"Answer"}]},tN={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"}],giveFeedback:[{type:0,value:"Geef feedback"}],answer:[{type:0,value:"Antwoord"}]};var $d=x(C()),nN=({suggestion:e,source:t,context:n})=>{let r=Y(Bo),o=M(Yr),s=G(),i=z("enableSuggestionFeedback"),a=`${e.text}`,l=M(hi(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),u=()=>{s(ct({name:"suggestion feedback",data:{text:e.text,source:t,context:n},options:{includeConversationData:!0}}))};return!i||!l?null:(0,$d.jsx)(Kh,{trigger:(0,$d.jsx)(Cb,{"data-testid":"feedback-dropdown-trigger"}),children:(0,$d.jsx)(Kh.Item,{as:"a",onClick:u,target:"_blank",href:l,children:r("giveFeedback")})})},qd=nN;var Jt=x(D());var $h={};Xe($h,{enUS:()=>rN,nlNL:()=>oN});var rN={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."}]},oN={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 Tb={root:"dd-60NZr",actions:"dd-No1g3",main:"dd-l-xEF",textInput:"dd-nAaiV",loading:"dd-ciFNi",error:"dd-yNp2D"};var Nn=x(C()),sN=({onCopy:e})=>{let t=(0,Jt.useRef)(null),n=L("SummaryForm",Tb),[r,o]=(0,Jt.useState)(""),[s,i]=(0,Jt.useState)(""),[a,l]=(0,Jt.useState)(!1),u=M(nr),c=Y($h),f=G(),d=()=>{f(ct({name:"summary copied to clipboard",data:{originalText:r,finalText:s},options:{includeConversationData:!0}})),e(s)},g=()=>{let y=document.getSelection();y&&f(ct({name:"summary copied to clipboard",data:{originalText:r,finalText:y==null?void 0:y.toString(),assistant:u==null?void 0:u.summarizerAssistantNew},options:{includeConversationData:!0}}))};return(0,Jt.useEffect)(()=>{f(li({})).then(y=>{if(y.error){l(!0);return}o(y.payload||""),i(y.payload||"")})},[]),(0,Jt.useEffect)(()=>{t.current&&r&&t.current.focus()},[t,r]),(0,Jt.useEffect)(()=>{let y=v=>{v.key==="Enter"&&v.shiftKey&&d()};return document.addEventListener("keydown",y),()=>{document.removeEventListener("keydown",y)}},[s]),(0,Nn.jsx)("div",{className:n.root,tabIndex:-1,children:a?(0,Nn.jsx)("p",{className:n.error,children:c("error")}):(0,Nn.jsxs)(Jt.Fragment,{children:[(0,Nn.jsx)("div",{className:n.main,children:(0,Nn.jsx)("textarea",{placeholder:r?void 0:c("loading"),disabled:!r,className:n.textInput,ref:t,value:s,onCopy:g,onChange:y=>i(y.target.value)})}),(0,Nn.jsxs)("div",{className:n.actions,children:[(0,Nn.jsx)(yi,{feedbackText:r||"",feedbackType:"summary",eventName:"summary feedback",eventData:{summary:r}}),(0,Nn.jsx)(he.Button,{shortKeys:[8679,8629],onClick:d,children:c("copy")})]})]})})},kb=sN;var pl={};Xe(pl,{enUS:()=>iN,nlNL:()=>aN});var iN={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?"}]},aN={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 _b=x(D());var lN=["{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}"],uN=new RegExp(lN.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function Pb(e,t){let n=e.split(uN),r=0,o=[];for(let s=0;s<n.length;s++){let i=n[s];if(o.push(i),s===n.length-1)break;if(t.indexOf(i)===-1)return e;let a=n[s+1],l=s===n.length-2;r+=i.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 Rb(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var Ib={suggestions:[],fetchState:"idle"},Ab={default:Ib},Lb=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},Gd=e=>e.textSuggestions,Ob=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},Yd=Ie("textSuggestions/refresh"),vn=V("textSuggestions/recommendations",(e,t)=>P(void 0,null,function*(){var c;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(c=r.conversation.current)==null?void 0:c.id,{platformVariables:s}=r.info,{textSuggestionsCount:i,inlineSuggestions:a}=r.settings,l=si(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getTextSuggestions(o,$a(r),e);if(s&&(u=u.map(f=>T(I(T({},f),{text:qe(f.text,s)}),f.title?{title:qe(f.title,s)}:{}))),e==="default"){let f=a?u.filter(Ob(l)):u;t.dispatch(Qr(f.slice(0,i)))}return u})),ml=V("textSuggestions/autocompletions",(e,t)=>P(void 0,null,function*(){var c;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(c=r.conversation.current)==null?void 0:c.id,{platformVariables:s}=r.info,{textSuggestionsCount:i,deanonymize:a,inlineSuggestions:l}=r.settings;if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getAutocompleteSuggestions(o,I(T({},$a(r)),{input:e}));if(!t.getState().input.text)throw new Error("Abort");return l&&(u=u.filter(Ob(e))),s&&(u=u.map(f=>I(T({},f),{text:qe(f.text,s)}))),a&&(u=u.map(f=>I(T({},f),{text:f.source!=="trie-with-typos"?Pb(f.text,e):f.text}))),u=Rb(u,i),t.dispatch(Qr(u)),u})),Nb=J({name:"textSuggestions",initialState:Ab,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}}}}},extraReducers:e=>{e.addCase(vn.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||Ib;return I(T({},t),{[r]:I(T({},o),{fetchState:"loading"})})}).addCase(vn.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(vn.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(ml.pending,t=>{t.default.fetchState="loading"}).addCase(ml.rejected,t=>{t.default.fetchState="error"}).addCase(ml.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(xe,()=>Ab)}}),{setTextSuggestions:B7}=Nb.actions,Mb=Nb.reducer;var Vo=x(C()),cN=({types:e,commands:t,onClick:n})=>{let r=G(),o=Y(pl),s=M(Gd);return(0,_b.useEffect)(()=>{e.forEach(({type:i})=>{(!s[i]||s[i].suggestions.length===0)&&r(vn(i))})},[]),(0,Vo.jsxs)("div",{children:[t.length>0&&(0,Vo.jsx)(he.List,{heading:o("commands"),children:t.map((i,a)=>(0,Vo.jsx)(he.ListItem,{id:`command-${a}`,closeOnSelect:!1,onClick:i.onClick,children:i.label},i.label))}),e.map(({type:i,title:a})=>{var l;return(0,Vo.jsx)(he.List,{heading:a,orientation:"vertical",children:(l=s[i])==null?void 0:l.suggestions.map((u,c)=>(0,Vo.jsx)(he.ListItem,{id:`${i}-${c}`,closeOnSelect:!1,description:u.title&&u.text,onClick:()=>n(u.text,u),"data-testid":"search-overlay-suggestion",children:u.title||u.text},`${u.id}-${u.text}`))},i)})]})},Db=cN;var De=x(C()),fN=200,pN=5,mN=4,qh=(e,t,n)=>e.slice(0,n?10:t.toLowerCase()==="image"?mN:pN),Fb=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),gN=()=>{var En,xr,we;let e=G(),t=Xt(),n=Y(pl),[r,o]=(0,ft.useState)(!1),[s,i]=(0,ft.useState)(""),[a,l]=(0,ft.useState)(null),u=M(eE),c=M(nr),[f,d]=(0,ft.useState)(),g=M(ut),y=z("showSearch"),v=z("enableSuggestionFeedback"),p=z("showEntitiesCommand"),m=z("showSummaryCommand"),h=z("showKnowledgeSearch"),S=z("showImageSearch"),w=z("searchTriggerKey"),k=M(DE),b=M(tE),R=M(nE),N=M(J1),_=((we=(xr=(En=c==null?void 0:c.uiConfig)==null?void 0:En.search)==null?void 0:xr.initialTypes)==null?void 0:we.filter(({isActive:B})=>B))||[],Q=(0,ft.useMemo)(()=>{let B=Pe=>qh(b.filter(fe=>fe.type===Pe.toUpperCase()),Pe,f),X=(k==null?void 0:k.map(Pe=>({value:Pe.code.toUpperCase(),label:`${Pe.name}s`,list:B(Pe.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[];if(X.push({value:"PERSONAL",label:n("personalSuggestions"),list:B("PERSONAL"),lineClamp:!1,listOrientation:"vertical"},{value:"URL",label:n("urlSuggestions"),list:B("URL"),lineClamp:!1,listOrientation:"vertical"},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:B("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical"}),S&&X.push({value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:B("IMAGE"),listOrientation:"horizontal"}),_.length===0)return X;let yt=_.map(Pe=>X.find(fe=>fe.value.toLowerCase()===Pe.type)).filter(Pe=>!!Pe),ce=X.filter(Pe=>!yt.find(fe=>fe.value===Pe.value));return[...yt,...ce]},[k,_,S,f]),K=[{label:n("entitiesClipboard"),onClick:()=>e(fn("entities")),shouldShow:p&&Fb(n("entitiesClipboard"),s)},{label:n("summaryClipboard"),onClick:()=>e(fn("summary")),shouldShow:m&&Fb(n("summaryClipboard"),s)},{label:s?`${n("knowledgeAssist")}: ${s}`:n("knowledgeAssist"),onClick:()=>e(fn("knowledgeAssist")),shouldShow:h}].filter(B=>B.shouldShow).filter(()=>!f),W=(0,ft.useCallback)((0,Hb.default)((B,X)=>{e(Lo({query:B,type:X,tags:["search-overlay"],size:f?50:20}))},fN),[f]),de=(0,ft.useCallback)((B,X)=>{switch(X.type){case"IMAGE":t.send(lh,{suggestion:X});break;default:t.send(Xr,{text:B,suggestion:X})}e(Nt(!1))},[e]),Ye=B=>{rr(B.text),e(ct({name:"entity copied",data:{entity:B,type:"copy"}})),e(Nt(!1))},Ft=B=>{t.send(Xr,{text:B,suggestion:{source:"knowledge-assist",text:B}}),e(ct({name:"answer used",data:{originalText:B},options:{includeConversationData:!0}})),i(""),a&&e(Ld(a)),e(fn("search")),e(Nt(!1))},ns=B=>{rr(B),e(Nt(!1))};function Ht(B){return X=>{r?window.confirm(n("warning"))&&(B(X),o(!1)):B(X)}}return(0,ft.useEffect)(()=>{s?W(s,f):e(fd())},[s,f]),(0,ft.useEffect)(()=>{g&&e(tl())},[g]),lb(w,()=>e(Nt(!0))),!y||!c?null:(0,De.jsxs)(he,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:i,onChangeOpen:Ht(B=>e(Nt(B))),onChangeType:B=>d(B),onChangePage:Ht(B=>e(fn(B))),selectedType:f,search:s,page:u,isOpen:N,types:Q,updateDeps:[b],children:[(0,De.jsxs)(he.Page,{id:"search",children:[s.length===0&&(0,De.jsx)(Db,{types:_,commands:K,onClick:de}),s.length>0&&(0,De.jsxs)(ft.Fragment,{children:[K.length>0&&(0,De.jsx)(he.List,{heading:n("commands"),children:K.map((B,X)=>(0,De.jsx)(he.ListItem,{closeOnSelect:!1,onClick:B.onClick,id:`commands-${X}`,children:B.label},B.label))}),Q.map(({value:B,label:X,list:yt,lineClamp:ce,listOrientation:Pe})=>(0,De.jsx)(he.List,{heading:X,orientation:Pe==="horizontal"?"horizontal":"vertical",onShowAll:()=>d(B),hasMore:!f&&R[B.toLowerCase()]>qh(yt,B,f).length,children:qh(yt,B,f).map(fe=>(0,De.jsx)(he.ListItem,{id:`${B}-${fe.id}`,closeOnSelect:!1,lineClamp:ce,onClick:()=>de(fe.text,fe),description:B!=="IMAGE"?fe.title&&fe.text:void 0,extra:v&&(0,De.jsx)(he.ListItemActions,{children:(0,De.jsx)(qd,{context:s,source:"search",suggestion:fe})}),children:B==="IMAGE"?(0,De.jsx)(he.Image,{title:fe.title||fe.text,src:fe.image}):fe.title||fe.text},`${fe.id}-${fe.text}`))},B))]})]}),(0,De.jsx)(he.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:Ht(()=>{e(fn("search"))}),children:(0,De.jsx)(fb,{onCopy:Ye})}),(0,De.jsx)(he.Page,{id:"summary",title:n("summaryTitle"),onDismiss:Ht(()=>{e(fn("search"))}),children:(0,De.jsx)(kb,{onCopy:ns})}),(0,De.jsx)(he.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:Ht(()=>{a&&e(Ld(a)),e(fn("search"))}),children:(0,De.jsx)(xb,{threadId:a,onNewThreadId:B=>l(B),question:s,onUse:Ft,onResetQuestion:()=>{a&&e(Ld(a)),i(""),l(null)}})})]})},Ub=gN;var gl=x(C()),hN=()=>{let e=z("showSearch"),t=z("isEmbedded");return(0,gl.jsxs)(zb.Fragment,{children:[e&&(0,gl.jsx)(Ub,{}),t&&(0,gl.jsx)(CE,{})]})},jb=hN;var Wb=x(se());var Qd=x(C()),Bb=({className:e})=>(0,Qd.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 512 512",xmlSpace:"preserve",className:e,children:(0,Qd.jsx)("g",{children:(0,Qd.jsx)("path",{d:`M163.4,233h186v-70c0-25.6-9.4-47.8-27.3-65.7C304.2,79.4,282,70,256.4,70s-47.8,9.4-65.7,27.3
20
20
  c-17.9,17.9-27.3,40.1-27.3,65.7C163.4,163,163.4,233,163.4,233z M465.5,267.9V477c0,9.4-3.4,17.9-10.2,24.7
21
21
  c-6.8,6.8-15.4,10.2-24.7,10.2h-349c-9.4,0-17.9-3.4-24.7-10.2c-6.8-6.8-10.2-15.4-10.2-24.7V267.9c0-9.4,3.4-17.9,10.2-24.7
22
22
  c6.8-6.8,15.4-10.2,24.7-10.2h11.9v-70c0-44.4,16.2-82.8,47.8-115.2S212.1,0,256.4,0s82.8,16.2,115.2,47.8
23
23
  c32.4,32.4,47.8,70,47.8,115.2v70h11.9c9.4,0,17.9,3.4,24.7,10.2C462.1,250,465.5,257.7,465.5,267.9z`})})});var Gh=x(C()),yN={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},Vb=({className:e,color:t})=>(0,Gh.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Gh.jsx)("path",{d:"M172.03 0.0199966H0V86.03C47.5 86.03 86 124.54 86 172.04C86 124.54 124.51 86.03 172.01 86.03C219.51 86.03 258.03 124.54 258.03 172.04C258.03 219.54 219.52 258.05 172.01 258.05C124.5 258.05 86 219.54 86 172.04C86 219.54 47.5 258.05 0 258.05V344.06H172.03C267.04 344.06 344.06 267.04 344.06 172.03C344.06 77.02 267.04 0 172.03 0V0.0199966Z",fill:yN[t||"pink"]})});var Kb={root:"dd-LbeUM",text:"dd-Dpfn1",isLoggedIn:"dd-XvHAn",isLoggedOut:"dd-21y-z",icon:"dd-8rLqS",logo:"dd-slXhD",lock:"dd-ByzlR"};var Yh={};Xe(Yh,{enUS:()=>vN,nlNL:()=>SN});var vN={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},SN={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var Ko=x(C()),$b=({onLogIn:e})=>{let t=Y(Yh),n=z("floatingMenu"),r=z("productName"),o=G(),s=M(ut),i=L("FloatingMenu",Kb);if(s===null||n===!1)return null;let a=()=>{s===!0?o(Nt(!0)):e()};return(0,Ko.jsxs)("button",{className:(0,Wb.default)(i.root,{[i.isLoggedIn]:s,[i.isLoggedOut]:!s}),onClick:a,children:[(0,Ko.jsx)("div",{className:i.text,children:t(s?"search":"signin",{productName:r})}),(0,Ko.jsxs)("div",{className:i.icon,children:[(0,Ko.jsx)(Vb,{className:i.logo,color:"pink"}),s===!1&&(0,Ko.jsx)(Bb,{className:i.lock})]})]})};var tf=x(D());var qb=x(D());function to(e){(0,qb.useEffect)(()=>{let t=n=>{n.isWithinRoot||e(n)};return document.body.addEventListener("mouseup",t),()=>{document.body.removeEventListener("mouseup",t)}},[e])}function Wo(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}function Mn(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:s}=e.input;return s.start!==s.end?!1:s.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(s.end))||r&&new RegExp(r).test(o.substring(0,s.end))?!0:n===!1&&r===!1:!1}var xN={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1},Xd=({ui:e})=>e.overlayCollapsed,Gb=J({name:"ui",initialState:xN,reducers:{setShowTabHint(e,t){e.showTabHint=t.payload},setInputFocus(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:hl,setInputFocus:Zd,setOverlayCollapsed:no,setOpenOverlayWhenTyping:Yb,setOverlayCollapsedUserOverwrite:Qb}=Gb.actions,Xb=Gb.reducer;var Jd=x(D());var vi=x(D());var Zb=x(D());function Jb(e,t,n){(0,Zb.useEffect)(()=>{let r=e.current;return r?(r.addEventListener(t,n),()=>{r.removeEventListener(t,n)}):()=>{}},[e,t,n])}var eC={root:"dd-1MBCO",actions:"dd--x4cy",badge:"dd-4Fpkz",formattedText:"dd-EzvTB"};var $o=x(C()),EN=["search","personal-collection-search","search-autocomplete"];function bN(e,t,n,r={}){var s;let o="";return EN.includes(t)?o=YE(Nh(e,n,{stripAgentPart:!0}),(s=r.searchKeywords)!=null?s:[n]):o=Nh(e,n,r),r.placeholders===!0&&(o=QE(o)),o}var CN=()=>{},TN=({selected:e,suggestion:t})=>{let n=z("inlineSuggestions"),r=M(si),o=z("enableSuggestionFeedback"),s=M(c=>c.input.text),i=G(),a=L("TextSuggestion",eC),l=(0,vi.useRef)(null);(0,vi.useEffect)(()=>{let c=setTimeout(()=>{i(D1({text:t.text,suggestion:t}))},500);return()=>{clearTimeout(c)}},[t]),Jb(l,"click",()=>{i(dn({suggestion:t,text:t.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let u=(0,vi.useMemo)(()=>bN(t.text,t.source,r,{stripAgentPart:n,placeholders:!0,searchKeywords:t.searchKeywords}),[n,t.text,t.source,r,t.searchKeywords]);return t.source==="gpt"&&!n?null:(0,$o.jsxs)("div",{className:a.root,children:[(0,$o.jsx)(re,{ref:l,as:"button","data-testid":"suggestions-overlay-item",selected:e,onClick:CN,children:(0,$o.jsx)(ui,{containerTagName:"div",noWrap:!1,tagName:"span",className:a.formattedText,content:u})}),o&&(0,$o.jsx)("div",{className:a.actions,children:(0,$o.jsx)(qd,{source:"overlay",context:s,suggestion:t})})]})},tC=TN;var Qh=x(C()),kN=({suggestions:e,selectedIndex:t,reverse:n})=>{let r=(0,Jd.useMemo)(()=>{let o=e.map((s,i)=>(0,Qh.jsx)(tC,{index:i,selected:i===t,suggestion:s},`${s.text}-${s.source}`));return n?o.reverse():o},[e,t,n]);return(0,Qh.jsx)(Jd.Fragment,{children:r})},ef=kN;var nC={root:"dd-PfvRI",paper:"dd-HYlyY"};var yl=x(C()),PN=({textSuggestions:e,selectedIndex:t})=>{let n=(0,tf.useRef)(null),r=L("InlineSuggestionsOverlay",nC),o=M(Mn),s=G(),i=M(ut),a=M(oi),l=M(Xd),u=z("showTextSuggestions");return to(()=>{setTimeout(()=>{s(no({collapse:!0,skipWhenInputFocus:!0}))})}),(0,tf.useEffect)(()=>{let c=n.current;if(!c||!c.parentElement)return;c.parentElement.style.left="0px";let f=c.getBoundingClientRect();c.parentElement.style.left=`${Math.min(window.innerWidth-4-f.right,0)}px`}),l||!o||!u||e.length===0||i!==!0||a===!1?null:(0,yl.jsx)("div",{className:r.root,"data-variant":"inline",children:(0,yl.jsx)("div",{ref:n,className:r.paper,children:(0,yl.jsx)(Et,{children:(0,yl.jsx)(ef,{suggestions:e,selectedIndex:t})})})})},RN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),rC=Zn(RN)(PN);var vl=x(C()),AN=({children:e})=>{let n=z("locale").replace("-","");return(0,vl.jsx)(hh.Provider,{value:n,children:e})},IN=({store:e,customStyles:t={},children:n})=>(0,vl.jsx)(Qg,{store:e,children:(0,vl.jsx)(AN,{children:(0,vl.jsx)(_i.Provider,{value:t,children:n})})}),qo=IN;var rf=x(se()),Si=x(D());var oC=x(D());function sC(e,t){let[n,r]=(0,oC.useState)(()=>{if(typeof window=="undefined")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return H.error(s),t}});return[n,s=>{try{let i=s instanceof Function?s(n):s;r(i),typeof window!="undefined"&&window.localStorage.setItem(e,JSON.stringify(i))}catch(i){H.error(i)}}]}var iC=()=>/Mac/i.test(navigator.platform);var lC=x(se()),ur=x(D());var Xh={};Xe(Xh,{enUS:()=>LN,nlNL:()=>ON});var LN={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"}]}]},ON={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 aC={root:"dd-uTPjX",anchor:"dd-C8lsZ",anchorButton:"dd-IoSx9"};var ro=x(C()),Zh=(e,t,n)=>r=>(0,ro.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),NN=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let s=Y(Xh),i=Xt(),a=L("Login",aC),l=z("productName"),u=(0,ur.useCallback)(p=>{p.preventDefault(),r&&r(parseInt(p.target.value,10))},[]),c=(0,ur.useCallback)(p=>{p.preventDefault(),i.send(ai,!0)},[t]),f=(0,ur.useMemo)(()=>p=>(0,ro.jsx)("a",{onClick:h=>{h.preventDefault(),o()},href:t,className:a.anchor,target:"_blank",rel:"noreferrer",children:p},"login"),[t]),d=(0,ur.useCallback)(p=>(0,ro.jsx)("button",{type:"button",className:a.anchorButton,onClick:c,children:p},"prompt"),[c]),{min:g,hour:y,day:v}=(0,ur.useMemo)(()=>({min:Zh(a,60*10,u),hour:Zh(a,60*60,u),day:Zh(a,60*60*12,u)}),[]);return(0,ro.jsxs)("div",{className:(0,lC.default)(e,a.root),children:[s("loginPlease",{login:n?d:f,productName:l}),r&&(0,ro.jsxs)(ur.Fragment,{children:[(0,ro.jsx)("br",{}),s("snooze",{min:g,hour:y,day:v})]})]})},nf=NN;var uC={root:"dd-DoQhb",text:"dd-Jwnev"};var Sl=x(C()),MN=({title:e})=>{let t=L("SearchTrigger",uC),n=G();return(0,Sl.jsxs)("button",{type:"button",className:t.root,onClick:()=>n(Nt(!0)),children:[(0,Sl.jsx)(di,{}),(0,Sl.jsx)("span",{className:t.text,children:e})]})},cC=MN;var Jh={};Xe(Jh,{enUS:()=>_N,nlNL:()=>DN});var _N={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"}]},DN={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 dC={root:"dd-oa7Vc",isInline:"dd-bwk31",toggleButton:"dd-MSB8Z",toggleButtonWrapper:"dd-ZkCzT",toggleButtonWrapperHidden:"dd-Sq66c",isCollapsed:"dd-vkrPk",collapsible:"dd-CWQJe",hints:"dd-IOoo3",hintsHidden:"dd-psVuT",triggers:"dd-toIoo",triggersRight:"dd-mc4l2"};var Ce=x(C()),FN=({textSuggestions:e,selectedIndex:t,onLogIn:n})=>{let r=L("SuggestionsOverlay",dC),o=Y(Jh),s=M(Mn),i=_1(),a=G(),l=(0,Si.useRef)(null),u=z("searchTriggerKey"),c=z("productName"),f=M(Xd),d=M(ut),g=M(oi),[y,v]=(0,Si.useState)(null),p=z("showSearch"),m=z("showTextSuggestions"),h=z("adminUrl"),S=z("isEmbedded"),[w,k]=sC("dd-snooze-until-ms",0),b=f||w>Date.now(),R=e.filter(Q=>Q.source!=="gpt").length,N=()=>{b&&k(0),a(Qb(!b))},_=Q=>{let K=Date.now()+Q*1e3;k(K),H.info(`Snooze until: ${new Date(K)}`),a(no({collapse:!0}))};return(0,Si.useEffect)(()=>{R===0&&v(null)},[e,R]),to(()=>{a(no({collapse:!0,skipWhenInputFocus:!0}))}),d===null||g===!1?null:d===!1?(0,Ce.jsxs)("div",{ref:l,className:(0,rf.default)(r.root,{[r.isCollapsed]:b}),children:[!b&&(0,Ce.jsxs)("div",{className:r.triggers,children:[(0,Ce.jsx)("div",{style:{flex:1}}),(0,Ce.jsx)("div",{className:r.triggersRight,children:(0,Ce.jsx)(fo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})})]}),(0,Ce.jsx)("div",{className:r.toggleButtonWrapper,children:(0,Ce.jsx)(fo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),(0,Ce.jsx)("div",{className:r.collapsible,children:(0,Ce.jsx)(nf,{loginUrl:h,isEmbedded:S,onLogIn:n,onSnooze:_})})]}):!i||!s?null:(0,Ce.jsxs)("div",{ref:l,className:(0,rf.default)(r.root,{[r.isCollapsed]:b}),children:[!b&&(0,Ce.jsxs)("div",{className:r.triggers,children:[(0,Ce.jsx)("div",{style:{flex:1},children:p&&(0,Ce.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>v(o(iC()?"searchHintMac":"searchHintWindows",{searchTriggerKey:u.toUpperCase()})),onMouseLeave:()=>v(null),children:(0,Ce.jsx)(cC,{title:o("search")})})}),(0,Ce.jsxs)("div",{className:r.triggersRight,onFocus:()=>{},children:[(0,Ce.jsx)("div",{className:(0,rf.default)(!y&&r.hintsHidden,r.hints),children:y}),(0,Ce.jsx)(fo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})]})]}),(0,Ce.jsx)("div",{className:r.toggleButtonWrapper,children:(0,Ce.jsx)(fo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),R>0&&m&&(0,Ce.jsx)("div",{className:r.collapsible,onFocus:()=>{},children:(0,Ce.jsx)(Et,{children:(0,Ce.jsx)(ef,{suggestions:e,selectedIndex:t,reverse:!0})})})]})},HN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),fC=Zn(HN)(FN);var Sf=x(se());var pr=x(D());var xi=x(D());function of(e){return e.contentEditable==="true"}function UN(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),s=o.cloneRange();s.selectNodeContents(e),s.setEnd(o.endContainer,o.endOffset),n=s.toString().length,s.selectNodeContents(e),s.setEnd(o.startContainer,o.startOffset),t=s.toString().length}return{selectionStart:t,selectionEnd:n}}function pC(e){let{selectionStart:t,selectionEnd:n}=of(e)?UN(e):e;return[t,n]}function mC(e){let[,t]=(0,xi.useState)(),n=(0,xi.useRef)(null);return n.current=pC(e),(0,xi.useEffect)(()=>{let r=()=>{var a;let[o,s]=(a=n.current)!=null?a:[],i=pC(e);(!i||o!==i[0]||s!==i[1])&&(n.current=i,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 gC(e,t){if(!t)return;let n=e,{value:r}=n,[o,s]=t,i=r.match(ou);if(!i||i.length===0)return;let a=0;i.find(l=>{let u=r.indexOf(l,a);return o>u&&s<u+l.length?(n.selectionStart=u,n.selectionEnd=u+l.length,!0):(a=u+l.length,!1)})}var hC=x(D()),zN=["div","span","mark","strong","b","i","u","em"];function ey(e,t,n=0){var s;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(s=r.props)==null?void 0:s.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(zN.includes(o)){let i=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,hC.cloneElement)(r,{children:ey(i,t,n+1)})]}return[...e,...t]}function Go(e){return e.tagName.toLowerCase()==="textarea"}var yC={root:"dd-7-cgW",container:"dd-PsRQ8",agentText:"dd-qnW-V",tabText:"dd-cUHUr",hint:"dd-v7fSg",matchSelection:"dd-8cr8y",focus:"dd-3tr9l",resetIndent:"dd-TvQfZ",matchKeyword:"dd-oJkRD",matchPlaceholder:"dd-QvNoo",hover:"dd--wi0R",hintText:"dd-7gQQh",popover:"dd-xbRu-",popoverRoot:"dd-rA2x8",popoverContentContainer:"dd-JHICl",popoverContent:"dd--mfkC",selectionOptions:"dd-p52wn",selectionOptionsIsHidden:"dd-sSTDp",selectionOptionsButton:"dd-Q6kRY",caret:"dd-jIhc8",popoverSuggestionsRoot:"dd-iFDbL",suggestionsOverlayInputStyles:"dd-zzENA"};var PC=x(se());var mf=x(D());var wi=x(D());function vC(e,t){let n;return[(...r)=>{window.cancelAnimationFrame(n);let o=t?t(...r):r;n=window.requestAnimationFrame(()=>{e(...o)})},()=>window.cancelAnimationFrame(n)]}function sf(e){let t=(0,wi.useRef)(null),[n,r]=(0,wi.useState)(!1);return(0,wi.useEffect)(()=>{var c;let o=!1,s=parseFloat((c=window.getComputedStyle(document.body).zoom)!=null?c:"1"),[i,a]=vC((f,d)=>{let g=t.current;if(!g)return;let y=f/s,v=d/s,p=g.getBoundingClientRect(),m=y>p.x&&y<p.x+p.width&&v>p.y&&v<p.y+p.height;m&&!o?(o=!0,r(!0)):!m&&o&&(o=!1,r(!1))},({clientX:f,clientY:d})=>[f,d]),[l,u]=vC(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",i),e.addEventListener("mouseleave",l),()=>{a(),u(),e.removeEventListener("mousemove",i),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function SC(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function af(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function xC(e){return e!=null}var ny=x(se()),en=x(D());var lf=x(D()),jN=["bottom","height","left","right","top","width"],BN=(e={},t={})=>jN.some(n=>e[n]!==t[n]),cr=new Map,wC,EC=()=>{let e=[],t=[];cr.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();BN(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{cr.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),wC=window.requestAnimationFrame(EC)};function VN(e,t){return{observe(){let n=cr.size===0;if(cr.has(e)){let r=cr.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else cr.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&EC()},unobserve(){let n=cr.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||cr.delete(e),cr.size||cancelAnimationFrame(wC)}}}}function ty(e){let[t,n]=(0,lf.useState)(null);return(0,lf.useLayoutEffect)(()=>{if(!e.current)return;let r=VN(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var Ei=x(D()),CC=x(vc());var bC={root:"dd-r-dgo"};var TC=({children:e,parentNode:t})=>{let[n,r]=(0,Ei.useState)(null),o=(0,Ei.useContext)(_i);return(0,Ei.useLayoutEffect)(()=>{let s=document.createElement("div");return Wo(s),s.classList.add(bC.root),o!=null&&o.portalRootNode&&s.classList.add(o==null?void 0:o.portalRootNode),(t||document.body).appendChild(s),r(s),()=>{s.isConnected&&s.remove()}},[]),n?(0,CC.createPortal)(e,n):null};var _n={ref:"dd-iz-KP",root:"dd-vEMon",positionAbove:"dd-mUCxM",positionBelow:"dd-7oZI7",positionLeft:"dd-BiWvD",positionRight:"dd-JIWea",alignStart:"dd-5ivu6",alignCenter:"dd-rnVkP",alignEnd:"dd-gZBp4"};var uf=x(C()),cf=(e=!1)=>{let[t,n]=(0,en.useState)(e),r=(0,en.useCallback)(()=>n(!0),[]),o=(0,en.useCallback)(()=>n(!1),[]),s=(0,en.useCallback)(()=>n(a=>!a),[]),i=(0,en.useRef)(null);return{opened:t,open:r,close:o,toggle:s,triggerRef:i}};function ry(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 bi=u=>{var c=u,{className:e,triggerRef:t,boundaryRef:n=(0,en.createRef)(),position:r="above",align:o="center",children:s,toStyle:i=ry,parentNode:a}=c,l=ee(c,["className","triggerRef","boundaryRef","position","align","children","toStyle","parentNode"]);let f=ty(t),d=ty(n),g=(0,en.useMemo)(()=>i(f,d,0),[f,d]);return(0,uf.jsx)(TC,{parentNode:a,children:(0,uf.jsx)("div",I(T({className:(0,ny.default)(_n.ref,{[_n.positionAbove]:r==="above",[_n.positionBelow]:r==="below",[_n.positionLeft]:r==="left",[_n.positionRight]:r==="right",[_n.alignStart]:o==="start",[_n.alignCenter]:o==="center",[_n.alignEnd]:o==="end"}),style:g},l),{role:"dialog",children:(0,uf.jsx)("div",{className:(0,ny.default)(e,_n.root),children:s})}))})};var kC=x(se()),df=x(D());var dr={root:"dd-7-cgW",container:"dd-PsRQ8",agentText:"dd-qnW-V",tabText:"dd-cUHUr",hint:"dd-v7fSg",matchSelection:"dd-8cr8y",focus:"dd-3tr9l",resetIndent:"dd-TvQfZ",matchKeyword:"dd-oJkRD",matchPlaceholder:"dd-QvNoo",hover:"dd--wi0R",hintText:"dd-7gQQh",popover:"dd-xbRu-",popoverRoot:"dd-rA2x8",popoverContentContainer:"dd-JHICl",popoverContent:"dd--mfkC",selectionOptions:"dd-p52wn",selectionOptionsIsHidden:"dd-sSTDp",selectionOptionsButton:"dd-Q6kRY",caret:"dd-jIhc8",popoverSuggestionsRoot:"dd-iFDbL",suggestionsOverlayInputStyles:"dd-zzENA"};var oy=x(C()),ff=(0,df.forwardRef)((o,r)=>{var s=o,{className:e,children:t}=s,n=ee(s,["className","children"]);let i=(0,df.useRef)(null),a=L("TabCompletion",dr);return(0,oy.jsx)("div",I(T({ref:af([i,r]),className:(0,kC.default)(e,a.popoverContentContainer)},n),{children:(0,oy.jsx)("div",{className:a.popoverContent,children:t})}))});var oo=x(C()),KN=e=>t=>{let n=ry(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},WN=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let s=L("TabCompletion",dr),i=cf(),a=(0,mf.useMemo)(()=>KN(e.getBoundingClientRect()),[e]),[l,u]=sf(e);return(0,mf.useEffect)(()=>{u?i.open():i.close()},[u]),(0,oo.jsxs)("span",{children:[(0,oo.jsx)("mark",{ref:af([l,i.triggerRef]),className:(0,PC.default)(s.matchKeyword,{[s.hover]:u}),"aria-haspopup":"dialog","aria-expanded":i.opened?"true":"false",children:r}),i.opened&&(0,oo.jsx)(bi,{className:s.popover,triggerRef:i.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,oo.jsx)(ff,{style:n,children:(0,oo.jsx)("div",{className:s.hintText,children:o})})})]})},pf=class extends sr{constructor(){super(...arguments);this.keywordMatches=[];this.preparedKeywordMatches=[];this.usedKeywordMatches=new Set}onBeforeParse(n,r){return r.keywordMatches&&r.keywordMatches!==this.keywordMatches&&(this.preparedKeywordMatches=r.keywordMatches.map(o=>I(T({},o),{keywordRegex:new RegExp(`\\b${SC(o.keyword)}\\b`,"i")})),this.keywordMatches=r.keywordMatches),this.usedKeywordMatches.clear(),n}match(n){let r=this.preparedKeywordMatches.map(s=>{if(this.usedKeywordMatches.has(s))return null;let i=n.match(s.keywordRegex);if(!i)return null;let a=n.charAt(i.index-1),l=n.charAt(i.index+s.keyword.length);return a==="{"&&l==="}"?null:{index:i.index,length:i[0].length,match:i[0],matchString:i[0],suggestion:s.suggestion,preparedKeywordMatch:s,valid:!0}}).filter(xC);if(r.length===0)return null;let o=r.reduce((s,i)=>i.index<s.index?i:s);return this.usedKeywordMatches.add(o.preparedKeywordMatch),o}replaceWith(n,r){return(0,oo.jsx)(WN,{inputElement:r.inputElement,suggestion:r.suggestion,inputStyle:r.inputStyle,boundaryRef:r.boundaryRef,children:n},`keyword_${r.matchString}_${r.key}`)}asTag(){return"mark"}};var RC=x(se());var sy=x(C()),$N=({inputElement:e,children:t})=>{let n=L("TabCompletion",dr),[r,o]=sf(e);return(0,sy.jsx)("mark",{ref:r,className:(0,RC.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},gf=class extends sr{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,sy.jsx)($N,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var yf=x(se());var mt=x(D());var iy=x(C()),AC=()=>(0,iy.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,iy.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 so=x(D());var LC=x(wh());var IC={root:"dd-ky-Bv",content:"dd-kV5e1"};function hf(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(s){return null}}function ay(e){return e.replace("https://www.","").replace("https://","")}var tn=x(C()),qN=3,GN=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),YN=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=qN})=>{let s=L("LinkSearch",IC),[i,a]=(0,so.useState)(""),l=G(),u=M(Lb("url")),c=M(rE("URL",GN)),[f,d]=(0,so.useState)(c.length-1),g=z("fallbackImage"),y=h=>{let S=h.target;a(S.value)},v=(h,S)=>{h.stopPropagation(),h.preventDefault(),window.open(S,"_blank")},p=h=>{var k;let S=f-1<0?c.length-1:f-1,w=f+1===c.length?0:f+1;h.code==="Escape"&&(a(""),t()),h.code==="ArrowUp"&&d(S),h.code==="ArrowDown"&&d(w),h.code==="Enter"&&e(((k=c[f])==null?void 0:k.text)||i)},m=(0,so.useCallback)((0,LC.default)(h=>{l(Lo({query:h,type:"URL",tags:["link-search"]}))},300),[]);return(0,so.useEffect)(()=>{i&&m(i)},[i]),(0,so.useEffect)(()=>()=>{l(fd())},[]),(0,tn.jsxs)("div",{className:s.root,children:[(0,tn.jsx)(Et,{withDivider:!0,children:(i?c:u).slice(0,o).map((h,S)=>(0,tn.jsx)(re,{selected:f===S,onClick:()=>e(h.text),"data-testid":"linksearch-suggestion",children:(0,tn.jsxs)(ye,{children:[(0,tn.jsx)(ye.Image,{src:hf(h,"small",g||void 0),title:h.title||h.text}),(0,tn.jsxs)(ye.Content,{className:s.content,cropText:!0,children:[(0,tn.jsx)(ye.Title,{children:h.title||ay(h.text)}),h.title&&ay(h.text)]}),(0,tn.jsx)(re.Actions,{children:(0,tn.jsx)(re.ActionButton,{label:r,onClick:w=>v(w,h.text)})})]})},h.text))}),(0,tn.jsx)(Ja,{value:i,onChange:y,autoFocus:!0,placeholder:n,onKeyUp:p})]})},OC=YN;var ly={};Xe(ly,{enUS:()=>QN,nlNL:()=>XN});var QN={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}]},XN={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}]};var pt=x(C()),ZN=(0,mt.forwardRef)((e,t)=>{let n=L("TabCompletion",dr);return(0,pt.jsx)("mark",{ref:t,className:(0,yf.default)(n.matchSelection)},"selection-start")}),JN=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let s=Y(ly),i=L("TabCompletion",dr),a=(0,mt.useRef)(null),l=(0,mt.useRef)(null),[u,c]=(0,mt.useState)(null),f=G(),d=cf(document.activeElement===r),[g]=(0,mt.useState)(()=>document.createRange());d.triggerRef.current=g,(0,mt.useEffect)(()=>()=>g.detach(),[]),(0,mt.useEffect)(()=>{let v=e.current,p=a.current;!v||!p||(g.setStart(v,0),g.setEnd(p,0))},[e.current,a.current]),to(()=>{d.close()});let y=(0,mt.useCallback)(v=>{let p=g.toString(),m=/^http(s?):\/\//.test(v)?v:`https://${v}`;f(id({text:`[${p}](${m})`,replace:"selection"}))},[]);return(0,pt.jsxs)("span",{children:[(0,pt.jsx)("mark",{ref:a,className:(0,yf.default)(i.matchSelection),"aria-haspopup":"dialog","aria-expanded":d.opened?"true":"false",children:o}),d.opened&&(0,pt.jsx)(bi,{className:i.popoverRoot,triggerRef:d.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,pt.jsxs)(ff,{style:n,ref:l,children:[(0,pt.jsx)("div",{className:(0,yf.default)(i.selectionOptions,{[i.selectionOptionsIsHidden]:u!==null}),children:(0,pt.jsxs)("button",{type:"button",tabIndex:u===null?-1:void 0,className:i.selectionOptionsButton,onClick:()=>c("insertLink"),children:[(0,pt.jsx)(AC,{}),(0,pt.jsx)("span",{children:"\xA0"}),(0,pt.jsx)("span",{children:s("insertLink")})]})}),u==="insertLink"&&(0,pt.jsx)(OC,{placeholder:s("linkInputPlaceholder"),visitUrlText:s("visitUrl"),onSelectLink:y,onDismiss:()=>{c(null),d.close()}})]})})]},"selection-end")},vf=class extends sr{constructor(){super(...arguments);this.charCount=0;this.foundIndex=0;this.startRef=null}onBeforeParse(n,r){return this.props=r,this.charCount=0,this.startRef=(0,mt.createRef)(),this.foundIndex=0,n}match(n){if(!this.props||this.props.selection===null||this.foundIndex===2)return null;let[r,o]=this.props.selection;if(r===o)return null;let s=this.foundIndex===0?r:o,i=s>=this.charCount&&s<=this.charCount+n.length?{index:s-this.charCount,length:0,match:"",valid:!0}:null;i&&this.foundIndex++;let a=this.foundIndex===1;return i&&a?this.charCount+=s-this.charCount:this.charCount+=n.length,i?T({isStart:a},i):null}replaceWith(n,r){return r.isStart?(0,pt.jsx)(ZN,{ref:this.startRef}):(0,pt.jsx)(JN,{inputElement:r.inputElement,startRef:this.startRef,boundaryRef:r.boundaryRef,inputStyle:r.inputStyle})}asTag(){return"mark"}};var fr=x(C()),eM=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:s,keywordMatches:i,inputElement:a,source:l})=>{let u=L("TabCompletion",yC),c=z("insertLink"),f=z("showMidSentenceSuggestions"),d=z("inlineSuggestions"),g=mC(a),y=(0,pr.useRef)(null),v=M(ut);(0,pr.useEffect)(()=>{Go(a)&&g&&gC(a,g)},[g]);let p=(0,pr.useCallback)(S=>{if(!o||!n)return S;let w=[(0,fr.jsx)("span",{className:u.resetIndent,children:"\u200B"},"u200B"),(0,fr.jsx)("span",{"data-testid":"tab-completion",className:(0,Sf.default)(u.tabText,u.resetIndent),"data-source":l,children:n},"tabText")];return r&&w.push((0,fr.jsx)("span",{className:(0,Sf.default)(u.hint,u.resetIndent),children:(0,fr.jsx)(eu,{keyCode:"tab"},"tabHint")})),ey(S,w)},[o,n,r]),m=(0,pr.useMemo)(()=>{let S=[];return c&&S.push(new vf("selection")),S.push(new gf("placeholders")),s&&S.push(new pf("keywords")),S},[d,c,s]),h=(0,pr.useMemo)(()=>{let S=window.getComputedStyle(a);return{"--dd-color":S.color,"--dd-font-size":S.fontSize,"--dd-font-family":S.fontFamily,"--dd-font-variant":S.fontVariant}},[]);return!e||!v?null:(0,fr.jsxs)("div",{ref:S=>{S!=null&&S.parentElement&&(y.current=S==null?void 0:S.parentElement)},className:u.root,style:h,children:[(0,fr.jsx)(ui,{tagName:"span",containerTagName:"div",className:(0,Sf.default)(u.container,u.agentText),disableLineBreaks:Go(a),content:t||"\u200B",onAfterParse:p,matchers:m,selection:g,keywordMatches:i,inputElement:a,inputStyle:h,boundaryRef:y,inlineSuggestionsOnlyAtEnd:!f}),(0,fr.jsx)("br",{})]})},tM=e=>{var p,m,h;let{input:t,ui:n,settings:r,styleSuggestions:o,conversation:s}=e,i=ii({input:t}),a=(i==null?void 0:i.text)||"",l=(i==null?void 0:i.source)||"",u=(p=t.html)!=null?p:ci(t.text),c=a.indexOf(t.text)===0?a.slice(t.text.length):"",{showTabHint:f}=n,{isSupported:d}=s,{showTabCompletion:g,visible:y,showStyleSuggestions:v}=r;return{showTabHint:f,showStyleSuggestions:v,showTabCompletion:g&&Mn(e),content:u,tabText:c,source:l,keywordMatches:(h=(m=o.list)==null?void 0:m.keywordMatches)!=null?h:[],enabled:y&&d!==!1}},NC=Zn(tM)(eM);var QT=x(se()),Ci=x(D());var MC={list:[],fetchState:"idle"},DC=e=>e.autoflows.list||[],_C=e=>t=>{var n;return(n=t.list)==null?void 0:n.find(r=>r.triggerPayload===e)},mr=V("autoflows/getAll",(e,t)=>P(void 0,null,function*(){let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getAutoflows(e)})),uy=V("autoflows/start",(e,t)=>P(void 0,null,function*(){let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");yield r.startAutoflowSession(e),yield n(mr(e.platformSessionId))})),cy=V("autoflows/stop",(e,t)=>P(void 0,null,function*(){let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");yield r.stopAutoflowSession(e.platformSessionId),yield n(mr(e.platformSessionId))})),nM=J({name:"autoflows",initialState:MC,reducers:{},extraReducers:e=>{e.addCase(uy.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Started",r.isBusy=!0}),e.addCase(cy.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Aborted",r.isBusy=!0}),e.addCase(mr.pending,t=>{t.fetchState="loading"}),e.addCase(mr.rejected,t=>{t.fetchState="error"}),e.addCase(mr.fulfilled,(t,n)=>{t.list=n.payload,t.fetchState="done"}),e.addCase(xe,()=>MC)}}),FC=V("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(mr(e))}),o.on("sessionCompleted",()=>{n(mr(e))})}),HC=V("autoflows/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),UC=nM.reducer;var zC={list:[],fetchState:"idle",sentSuggestions:[],errorSuggestions:[],answeredSuggestions:[]},jC=e=>e.customMessages.list,BC=e=>t=>!!t.customMessages.sentSuggestions.find(n=>n===e),VC=e=>t=>!!t.customMessages.answeredSuggestions.find(n=>n===e),KC=e=>t=>!!t.customMessages.errorSuggestions.find(n=>n===e),xl=V("customMessages/getAll",(e,t)=>P(void 0,null,function*(){let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");return n.getCustomMessages(e)})),xf=V("customMessages/send",(e,t)=>P(void 0,null,function*(){let{platformSessionId:n,suggestion:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");yield o.sendCustomMessage(n,r)})),wf=V("customMessages/answer",(e,t)=>P(void 0,null,function*(){let{platformSessionId:n,reply:r}=e,{deepdeskBrokerAPI:o}=t.extra;if(!o)throw new Error("Deepdesk Broker not initialized");yield o.answerCustomMessage(n,r)})),WC=J({name:"customMessages",initialState:zC,reducers:{onCustomMessage(e,t){Array.isArray(t.payload)?e.list=t.payload:e.list=[t.payload]}},extraReducers:e=>{e.addCase(xl.pending,t=>{t.fetchState="loading"}).addCase(xl.rejected,t=>{t.fetchState="error"}).addCase(xl.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload||[]}).addCase(xf.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.errorSuggestions=t.errorSuggestions.filter(r=>n.meta.arg.suggestion.text!==r)}).addCase(xf.rejected,(t,n)=>{let r=t.sentSuggestions.indexOf(n.meta.arg.suggestion.text);t.errorSuggestions.push(...t.sentSuggestions.splice(r,1))}).addCase(wf.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.answeredSuggestions.push(n.meta.arg.suggestion.text)}).addCase(wf.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(xe,()=>zC)}}),$C=V("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",s=>{n(WC.actions.onCustomMessage(s))})}),qC=V("customMessages/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),GC=WC.reducer;var rM={token:null,interval:null},dy=V("passwordlessToken/getTemporaryPasswordlessToken",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n}=t.extra;return{token:yield n.requestPasswordlessToken()}})),fy=V("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(dy()),setInterval(()=>r(dy()),n)}),YC=J({name:"passwordlessToken",initialState:rM,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(dy.fulfilled,(t,n)=>{t.token=n.payload.token}),e.addCase(fy.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:QC}=YC.actions,XC=YC.reducer;var ZC={excludeFromWidget:!1},py={cues:[],fetchState:"idle"},JC=e=>{var t;return(t=e.rules)==null?void 0:t.cues},oM=Ie("rules/resetCues"),Yo=V("rules/evaluate",(e,t)=>P(void 0,null,function*(){var n,r;try{let{deepdeskAPI:o}=t.extra,s=t.getState(),{platformVariables:i}=s.info,a=(n=s.conversation.current)==null?void 0:n.id;if(!a)throw new Error("No current conversation to evaluate rules");if(!(yield o.getAccount()).ruleEngine)throw new Error("Rule engine is not enabled for this account");if(!(yield o.getRules()).filter(d=>d.isEnabled).some(d=>d.label===e.label))throw new Error(`No enabled rules found with label: ${e.label}`);let f=yield o.evaluateRule(e.label,a,T({tags:((r=s.conversation.current)==null?void 0:r.tags)||void 0},e.params));return i&&(f=f.map(d=>I(T({},d),{title:qe(d.title,i),text:qe(d.text,i)}))),{cues:f,options:e.options}}catch(o){let s=o.message;return H.warn(s),t.rejectWithValue(s)}})),eT=J({name:"answer",initialState:py,reducers:{removeCue(e,t){e.cues=e.cues.filter(n=>n.rule.id!==t.payload.id)}},extraReducers:e=>{e.addCase(Yo.pending,t=>{t.fetchState="loading"}).addCase(Yo.rejected,t=>{t.fetchState="error"}).addCase(Yo.fulfilled,(t,n)=>{var s;if((s=n.payload.options)!=null&&s.excludeFromWidget){t.fetchState="done";return}let r=n.payload.cues.map(i=>i.rule.id),o=t.cues.filter(i=>!r.includes(i.rule.id));t.fetchState="done",t.cues=[...n.payload.cues,...o]}).addCase(xe,()=>py).addCase(oM.toString(),()=>py)}}),{removeCue:tT}=eT.actions,nT=eT.reducer;function sM(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}var rT=e=>{let t=JC(e),r=OE(e).map(o=>({text:o.response,title:o.name,callToAction:o.callToAction,rule:{id:sM(o.code),label:o.code,name:o.name,description:o.name}}));return[...t,...r]};var fT=x(D());var uT=x(se()),cT=x(D());var sT=x(se());var oT={root:"dd-uszkm"};var aT=x(C()),iM=({className:e,children:t})=>{let n=L("Unicode",oT);return(0,aT.jsx)("span",{className:(0,sT.default)(e,n.root),children:t})},iT=iM;var lT={isDisabled:"dd-Sp--t",root:"dd-maqTG",buttonStop:"dd-rcq8w",stateBadge:"dd-zOnkT",isCompleted:"dd-GA-rt",isStarted:"dd-PZwtX",isAborted:"dd-PAXSE"};var my={};Xe(my,{enUS:()=>aM,nlNL:()=>lM});var aM={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"}]},lM={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 Dt=x(C()),cM=({disabled:e,state:t,displayName:n,description:r,onStartAutoflow:o,onStopAutoflow:s})=>{let i=L("Autoflow",lT),a=Y(my),l=t==="Started"?"stop":"start",u=l==="start"?"\u25B6":l==="stop"?"\u25FC":"";return(0,Dt.jsxs)(re,{className:(0,uT.default)(i.root,{[i.isDisabled]:e,[i.isCompleted]:t==="Completed",[i.isAborted]:t==="Aborted",[i.isStarted]:t==="Started"}),children:[(0,Dt.jsx)(ye,{children:(0,Dt.jsxs)(ye.Content,{children:[(0,Dt.jsxs)(ye.Title,{children:[t&&(0,Dt.jsx)("span",{className:i.stateBadge,children:a(t)}),n]}),(0,Dt.jsx)("span",{children:r})]})}),(0,Dt.jsx)(re.Actions,{fixed:t==="Started",children:(0,Dt.jsx)(re.ActionButton,{primary:!0,className:l==="start"?i.buttonStart:i.buttonStop,onClick:t==="Started"?s:o,disabled:e,label:(0,Dt.jsxs)(cT.Fragment,{children:[(0,Dt.jsx)(iT,{children:u})," ",(0,Dt.jsx)("span",{children:a(l)})]})})})]})},dT=cM;var gy=x(C()),dM=(e,t)=>{let n=t.filter(r=>r.state==="Started");return n.length>0?n.indexOf(e)===-1:!1},fM=({autoflows:e,onStartAutoflow:t,onStopAutoflow:n,platformSessionId:r})=>(0,gy.jsx)(fT.Fragment,{children:e.map(o=>(0,gy.jsx)(dT,{displayName:o.displayName,description:o.description,disabled:o.isBusy||dM(o,e),state:o.state,onStartAutoflow:()=>t({platformSessionId:r,triggerPayload:o.triggerPayload}),onStopAutoflow:()=>n({platformSessionId:r,triggerPayload:o.triggerPayload})},o.displayName))}),pM=({autoflows:e,conversation:t})=>{var n;return{autoflows:e.list,platformSessionId:(n=t.current)==null?void 0:n.sessionId}},mM={onStartAutoflow:uy,onStopAutoflow:cy},pT=Zn(pM,mM)(fM);var mT=x(se()),hy=x(D());var gr={root:"dd-ERsBr",title:"dd-b36p6",isUsed:"dd-fp2IX",quickReplies:"dd--VrvP",quickReply:"dd-wFhWh",label:"dd-R9sND",errorIcon:"dd-8cdcH"};var Pt=x(C()),gM=({suggestion:e})=>{let t=Y(Bo),n=G(),r=M(BC(e.text)),o=M(VC(e.text)),s=M(KC(e.text)),i=M(ri),{replyOptions:a}=e,l=(0,hy.useCallback)(c=>{c.preventDefault(),c.stopPropagation(),!(r||!i)&&n(xf({platformSessionId:i,suggestion:e}))},[e,r,n,i]),u=(0,hy.useCallback)(c=>{if(c.preventDefault(),c.stopPropagation(),!i||!a)return;let f=parseInt(c.target.dataset.index,10),d=a[f];n(wf({platformSessionId:i,reply:d,suggestion:e}))},[e,r,n,i]);return(0,Pt.jsxs)(re,{onClick:l,className:(0,mT.default)(gr.root,{[gr.isUsed]:r,[gr.hasError]:s}),children:[(0,Pt.jsx)(ye,{children:(0,Pt.jsxs)(ye.Content,{children:[(0,Pt.jsxs)(ye.Title,{className:gr.title,children:[e.text," ",(0,Pt.jsx)(tu,{className:gr.label,children:"analyse tool"})," ",s&&(0,Pt.jsx)("span",{className:gr.errorIcon,role:"img","aria-label":t("sendingError"),title:t("sendingError"),children:"!"})]}),a&&a.length>0&&(0,Pt.jsx)("ul",{className:gr.quickReplies,children:a.map(c=>(0,Pt.jsx)("li",{className:gr.quickReply,children:c.title},c.title))})]})}),(0,Pt.jsxs)(re.Actions,{fixed:s||r,children:[a&&a.length>0&&(0,Pt.jsx)(re.DropdownButton,{label:t("answer"),disabled:o,children:a.map((c,f)=>(0,Pt.jsx)(re.DropdownItem,{index:f,label:c.title,onClick:u},c.title))}),(0,Pt.jsx)(re.ActionButton,{primary:!0,disabled:r,onClick:l,label:t(r?"suggestionSent":s?"tryAgain":"sendSuggestion")})]})]})},gT=gM;var Ef=x(D());var vy=x(se());var yy=x(C()),wl=()=>(0,yy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,yy.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 hT={root:"dd-WcEru",entity:"dd-LfP8y",entityText:"dd-L-v0f",iconWrapper:"dd-9Deh1",icon:"dd-tM7E2",iconClicked:"dd-EEdDL"};var Dn=x(C()),hM=({entities:e})=>{let t=L("EntitiesWidgetList",hT),[n,r]=(0,Ef.useState)(void 0),o=G(),s=()=>{r(void 0)},i=a=>{e&&(r(e.indexOf(a)),rr(a.text),o(ct({name:"entity copied",data:{entity:a,type:"copy"}})))};return(0,Ef.useEffect)(()=>{let a=setTimeout(s,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,Dn.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,Dn.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>i(a),children:[(0,Dn.jsx)("span",{className:t.entityText,children:a.text}),(0,Dn.jsxs)("span",{className:t.iconWrapper,children:[(0,Dn.jsx)("span",{className:(0,vy.default)(t.icon),children:(0,Dn.jsx)(wl,{})}),(0,Dn.jsx)("span",{className:(0,vy.default)(t.icon,n===l&&t.iconClicked),children:(0,Dn.jsx)(wl,{})})]})]},a.text))})},yT=hM;var Sy=x(C()),vT=()=>(0,Sy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Sy.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 xy=x(C()),ST=()=>(0,xy.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,xy.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 wy=x(C()),xT=()=>(0,wy.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,wy.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 zT=x(D());var{entries:IT,setPrototypeOf:wT,isFrozen:yM,getPrototypeOf:vM,getOwnPropertyDescriptor:SM}=Object,{freeze:ht,seal:nn,create:LT}=Object,{apply:Py,construct:Ry}=typeof Reflect!="undefined"&&Reflect;ht||(ht=function(t){return t});nn||(nn=function(t){return t});Py||(Py=function(t,n,r){return t.apply(n,r)});Ry||(Ry=function(t,n){return new t(...n)});var bf=Rt(Array.prototype.forEach),ET=Rt(Array.prototype.pop),El=Rt(Array.prototype.push),kf=Rt(String.prototype.toLowerCase),Ey=Rt(String.prototype.toString),bT=Rt(String.prototype.match),bl=Rt(String.prototype.replace),xM=Rt(String.prototype.indexOf),wM=Rt(String.prototype.trim),Sn=Rt(Object.prototype.hasOwnProperty),gt=Rt(RegExp.prototype.test),Cl=EM(TypeError),CT=Rt(Number.isNaN);function Rt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Py(e,t,r)}}function EM(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ry(e,n)}}function te(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:kf;wT&&wT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let s=n(o);s!==o&&(yM(t)||(t[r]=s),o=s)}e[o]=!0}return e}function bM(e){for(let t=0;t<e.length;t++)Sn(e,t)||(e[t]=null);return e}function Xo(e){let t=LT(null);for(let[n,r]of IT(e))Sn(e,n)&&(Array.isArray(r)?t[n]=bM(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Xo(r):t[n]=r);return t}function Cf(e,t){for(;e!==null;){let r=SM(e,t);if(r){if(r.get)return Rt(r.get);if(typeof r.value=="function")return Rt(r.value)}e=vM(e)}function n(){return null}return n}var TT=ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),by=ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Cy=ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),CM=ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ty=ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),TM=ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kT=ht(["#text"]),PT=ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),ky=ht(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),RT=ht(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Tf=ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),kM=nn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PM=nn(/<%[\w\W]*|[\w\W]*%>/gm),RM=nn(/\${[\w\W]*}/gm),AM=nn(/^data-[\-\w.\u00B7-\uFFFF]/),IM=nn(/^aria-[\-\w]+$/),OT=nn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),LM=nn(/^(?:\w+script|data):/i),OM=nn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),NT=nn(/^html$/i),NM=nn(/^[a-z][.\w]*(-[.\w]+)+$/i),AT=Object.freeze({__proto__:null,MUSTACHE_EXPR:kM,ERB_EXPR:PM,TMPLIT_EXPR:RM,DATA_ATTR:AM,ARIA_ATTR:IM,IS_ALLOWED_URI:OT,IS_SCRIPT_OR_DATA:LM,ATTR_WHITESPACE:OM,DOCTYPE_NAME:NT,CUSTOM_ELEMENT:NM}),Qo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},MM=function(){return typeof window=="undefined"?null:window},_M=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));let s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch(i){return console.warn("TrustedTypes policy "+s+" could not be created."),null}};function MT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MM(),t=j=>MT(j);if(t.version="3.1.3",t.removed=[],!e||!e.document||e.document.nodeType!==Qo.document)return t.isSupported=!1,t;let{document:n}=e,r=n,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:i,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:g}=e,y=l.prototype,v=Cf(y,"cloneNode"),p=Cf(y,"nextSibling"),m=Cf(y,"childNodes"),h=Cf(y,"parentNode");if(typeof i=="function"){let j=n.createElement("template");j.content&&j.content.ownerDocument&&(n=j.content.ownerDocument)}let S,w="",{implementation:k,createNodeIterator:b,createDocumentFragment:R,getElementsByTagName:N}=n,{importNode:_}=r,Q={};t.isSupported=typeof IT=="function"&&typeof h=="function"&&k&&k.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:K,ERB_EXPR:W,TMPLIT_EXPR:de,DATA_ATTR:Ye,ARIA_ATTR:Ft,IS_SCRIPT_OR_DATA:ns,ATTR_WHITESPACE:Ht,CUSTOM_ELEMENT:En}=AT,{IS_ALLOWED_URI:xr}=AT,we=null,B=te({},[...TT,...by,...Cy,...Ty,...kT]),X=null,yt=te({},[...PT,...ky,...RT,...Tf]),ce=Object.seal(LT(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,fe=null,rs=!0,os=!0,Hl=!1,lo=!0,bn=!1,Ul=!0,He=!1,Un=!1,Hf=!1,ss=!1,zl=!1,jl=!1,Ky=!0,Wy=!1,Bk="user-content-",Uf=!0,Ii=!1,is={},as=null,$y=te({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),qy=null,Gy=te({},["audio","video","img","source","image","track"]),zf=null,Yy=te({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bl="http://www.w3.org/1998/Math/MathML",Vl="http://www.w3.org/2000/svg",zn="http://www.w3.org/1999/xhtml",ls=zn,jf=!1,Bf=null,Vk=te({},[Bl,Vl,zn],Ey),Li=null,Kk=["application/xhtml+xml","text/html"],Wk="text/html",Ue=null,us=null,Qy=255,$k=n.createElement("form"),Xy=function(E){return E instanceof RegExp||E instanceof Function},Vf=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(us&&us===E)){if((!E||typeof E!="object")&&(E={}),E=Xo(E),Li=Kk.indexOf(E.PARSER_MEDIA_TYPE)===-1?Wk:E.PARSER_MEDIA_TYPE,Ue=Li==="application/xhtml+xml"?Ey:kf,we=Sn(E,"ALLOWED_TAGS")?te({},E.ALLOWED_TAGS,Ue):B,X=Sn(E,"ALLOWED_ATTR")?te({},E.ALLOWED_ATTR,Ue):yt,Bf=Sn(E,"ALLOWED_NAMESPACES")?te({},E.ALLOWED_NAMESPACES,Ey):Vk,zf=Sn(E,"ADD_URI_SAFE_ATTR")?te(Xo(Yy),E.ADD_URI_SAFE_ATTR,Ue):Yy,qy=Sn(E,"ADD_DATA_URI_TAGS")?te(Xo(Gy),E.ADD_DATA_URI_TAGS,Ue):Gy,as=Sn(E,"FORBID_CONTENTS")?te({},E.FORBID_CONTENTS,Ue):$y,Pe=Sn(E,"FORBID_TAGS")?te({},E.FORBID_TAGS,Ue):{},fe=Sn(E,"FORBID_ATTR")?te({},E.FORBID_ATTR,Ue):{},is=Sn(E,"USE_PROFILES")?E.USE_PROFILES:!1,rs=E.ALLOW_ARIA_ATTR!==!1,os=E.ALLOW_DATA_ATTR!==!1,Hl=E.ALLOW_UNKNOWN_PROTOCOLS||!1,lo=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,bn=E.SAFE_FOR_TEMPLATES||!1,Ul=E.SAFE_FOR_XML!==!1,He=E.WHOLE_DOCUMENT||!1,ss=E.RETURN_DOM||!1,zl=E.RETURN_DOM_FRAGMENT||!1,jl=E.RETURN_TRUSTED_TYPE||!1,Hf=E.FORCE_BODY||!1,Ky=E.SANITIZE_DOM!==!1,Wy=E.SANITIZE_NAMED_PROPS||!1,Uf=E.KEEP_CONTENT!==!1,Ii=E.IN_PLACE||!1,xr=E.ALLOWED_URI_REGEXP||OT,ls=E.NAMESPACE||zn,ce=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&Xy(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ce.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&Xy(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ce.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),bn&&(os=!1),zl&&(ss=!0),is&&(we=te({},kT),X=[],is.html===!0&&(te(we,TT),te(X,PT)),is.svg===!0&&(te(we,by),te(X,ky),te(X,Tf)),is.svgFilters===!0&&(te(we,Cy),te(X,ky),te(X,Tf)),is.mathMl===!0&&(te(we,Ty),te(X,RT),te(X,Tf))),E.ADD_TAGS&&(we===B&&(we=Xo(we)),te(we,E.ADD_TAGS,Ue)),E.ADD_ATTR&&(X===yt&&(X=Xo(X)),te(X,E.ADD_ATTR,Ue)),E.ADD_URI_SAFE_ATTR&&te(zf,E.ADD_URI_SAFE_ATTR,Ue),E.FORBID_CONTENTS&&(as===$y&&(as=Xo(as)),te(as,E.FORBID_CONTENTS,Ue)),Uf&&(we["#text"]=!0),He&&te(we,["html","head","body"]),we.table&&(te(we,["tbody"]),delete Pe.tbody),E.TRUSTED_TYPES_POLICY){if(typeof E.TRUSTED_TYPES_POLICY.createHTML!="function")throw Cl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof E.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Cl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=E.TRUSTED_TYPES_POLICY,w=S.createHTML("")}else S===void 0&&(S=_M(g,o)),S!==null&&typeof w=="string"&&(w=S.createHTML(""));ht&&ht(E),us=E}},Zy=te({},["mi","mo","mn","ms","mtext"]),Jy=te({},["foreignobject","annotation-xml"]),qk=te({},["title","style","font","a","script"]),ev=te({},[...by,...Cy,...CM]),tv=te({},[...Ty,...TM]),Gk=function(E){let A=h(E);(!A||!A.tagName)&&(A={namespaceURI:ls,tagName:"template"});let U=kf(E.tagName),Z=kf(A.tagName);return Bf[E.namespaceURI]?E.namespaceURI===Vl?A.namespaceURI===zn?U==="svg":A.namespaceURI===Bl?U==="svg"&&(Z==="annotation-xml"||Zy[Z]):!!ev[U]:E.namespaceURI===Bl?A.namespaceURI===zn?U==="math":A.namespaceURI===Vl?U==="math"&&Jy[Z]:!!tv[U]:E.namespaceURI===zn?A.namespaceURI===Vl&&!Jy[Z]||A.namespaceURI===Bl&&!Zy[Z]?!1:!tv[U]&&(qk[U]||!ev[U]):!!(Li==="application/xhtml+xml"&&Bf[E.namespaceURI]):!1},Ut=function(E){El(t.removed,{element:E});try{E.parentNode.removeChild(E)}catch(A){E.remove()}},Kl=function(E,A){try{El(t.removed,{attribute:A.getAttributeNode(E),from:A})}catch(U){El(t.removed,{attribute:null,from:A})}if(A.removeAttribute(E),E==="is"&&!X[E])if(ss||zl)try{Ut(A)}catch(U){}else try{A.setAttribute(E,"")}catch(U){}},nv=function(E){let A=null,U=null;if(Hf)E="<remove></remove>"+E;else{let Be=bT(E,/^[\r\n\t ]+/);U=Be&&Be[0]}Li==="application/xhtml+xml"&&ls===zn&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let Z=S?S.createHTML(E):E;if(ls===zn)try{A=new d().parseFromString(Z,Li)}catch(Be){}if(!A||!A.documentElement){A=k.createDocument(ls,"template",null);try{A.documentElement.innerHTML=jf?w:Z}catch(Be){}}let Qe=A.body||A.documentElement;return E&&U&&Qe.insertBefore(n.createTextNode(U),Qe.childNodes[0]||null),ls===zn?N.call(A,He?"html":"body")[0]:He?A.documentElement:Qe},rv=function(E){return b.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},ov=function(E){return E instanceof f&&(typeof E.__depth!="undefined"&&typeof E.__depth!="number"||typeof E.__removalCount!="undefined"&&typeof E.__removalCount!="number"||typeof E.nodeName!="string"||typeof E.textContent!="string"||typeof E.removeChild!="function"||!(E.attributes instanceof c)||typeof E.removeAttribute!="function"||typeof E.setAttribute!="function"||typeof E.namespaceURI!="string"||typeof E.insertBefore!="function"||typeof E.hasChildNodes!="function")},sv=function(E){return typeof a=="function"&&E instanceof a},jn=function(E,A,U){Q[E]&&bf(Q[E],Z=>{Z.call(t,A,U,us)})},iv=function(E){let A=null;if(jn("beforeSanitizeElements",E,null),ov(E))return Ut(E),!0;let U=Ue(E.nodeName);if(jn("uponSanitizeElement",E,{tagName:U,allowedTags:we}),E.hasChildNodes()&&!sv(E.firstElementChild)&&gt(/<[/\w]/g,E.innerHTML)&&gt(/<[/\w]/g,E.textContent)||E.nodeType===Qo.progressingInstruction||Ul&&E.nodeType===Qo.comment&&gt(/<[/\w]/g,E.data))return Ut(E),!0;if(!we[U]||Pe[U]){if(!Pe[U]&&lv(U)&&(ce.tagNameCheck instanceof RegExp&&gt(ce.tagNameCheck,U)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(U)))return!1;if(Uf&&!as[U]){let Z=h(E)||E.parentNode,Qe=m(E)||E.childNodes;if(Qe&&Z){let Be=Qe.length;for(let vt=Be-1;vt>=0;--vt){let St=v(Qe[vt],!0);St.__removalCount=(E.__removalCount||0)+1,Z.insertBefore(St,p(E))}}}return Ut(E),!0}return E instanceof l&&!Gk(E)||(U==="noscript"||U==="noembed"||U==="noframes")&&gt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Ut(E),!0):(bn&&E.nodeType===Qo.text&&(A=E.textContent,bf([K,W,de],Z=>{A=bl(A,Z," ")}),E.textContent!==A&&(El(t.removed,{element:E.cloneNode()}),E.textContent=A)),jn("afterSanitizeElements",E,null),!1)},av=function(E,A,U){if(Ky&&(A==="id"||A==="name")&&(U in n||U in $k||U==="__depth"||U==="__removalCount"))return!1;if(!(os&&!fe[A]&&gt(Ye,A))){if(!(rs&&gt(Ft,A))){if(!X[A]||fe[A]){if(!(lv(E)&&(ce.tagNameCheck instanceof RegExp&&gt(ce.tagNameCheck,E)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(E))&&(ce.attributeNameCheck instanceof RegExp&&gt(ce.attributeNameCheck,A)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(A))||A==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&gt(ce.tagNameCheck,U)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(U))))return!1}else if(!zf[A]){if(!gt(xr,bl(U,Ht,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&E!=="script"&&xM(U,"data:")===0&&qy[E])){if(!(Hl&&!gt(ns,bl(U,Ht,"")))){if(U)return!1}}}}}}return!0},lv=function(E){return E!=="annotation-xml"&&bT(E,En)},uv=function(E){jn("beforeSanitizeAttributes",E,null);let{attributes:A}=E;if(!A)return;let U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X},Z=A.length;for(;Z--;){let Qe=A[Z],{name:Be,namespaceURI:vt,value:St}=Qe,Oi=Ue(Be),it=Be==="value"?St:wM(St);if(U.attrName=Oi,U.attrValue=it,U.keepAttr=!0,U.forceKeepAttr=void 0,jn("uponSanitizeAttribute",E,U),it=U.attrValue,U.forceKeepAttr||(Kl(Be,E),!U.keepAttr))continue;if(!lo&&gt(/\/>/i,it)){Kl(Be,E);continue}if(Ul&&gt(/((--!?|])>)|<\/(style|title)/i,it)){Kl(Be,E);continue}bn&&bf([K,W,de],dv=>{it=bl(it,dv," ")});let cv=Ue(E.nodeName);if(av(cv,Oi,it)){if(Wy&&(Oi==="id"||Oi==="name")&&(Kl(Be,E),it=Bk+it),S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!vt)switch(g.getAttributeType(cv,Oi)){case"TrustedHTML":{it=S.createHTML(it);break}case"TrustedScriptURL":{it=S.createScriptURL(it);break}}try{vt?E.setAttributeNS(vt,Be,it):E.setAttribute(Be,it),ov(E)?Ut(E):ET(t.removed)}catch(dv){}}}jn("afterSanitizeAttributes",E,null)},Yk=function j(E){let A=null,U=rv(E);for(jn("beforeSanitizeShadowDOM",E,null);A=U.nextNode();){if(jn("uponSanitizeShadowNode",A,null),iv(A))continue;let Z=h(A);A.nodeType===Qo.element&&(Z&&Z.__depth?A.__depth=(A.__removalCount||0)+Z.__depth+1:A.__depth=1),(A.__depth>=Qy||A.__depth<0||CT(A.__depth))&&Ut(A),A.content instanceof s&&(A.content.__depth=A.__depth,j(A.content)),uv(A)}jn("afterSanitizeShadowDOM",E,null)};return t.sanitize=function(j){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,U=null,Z=null,Qe=null;if(jf=!j,jf&&(j="<!-->"),typeof j!="string"&&!sv(j))if(typeof j.toString=="function"){if(j=j.toString(),typeof j!="string")throw Cl("dirty is not a string, aborting")}else throw Cl("toString is not a function");if(!t.isSupported)return j;if(Un||Vf(E),t.removed=[],typeof j=="string"&&(Ii=!1),Ii){if(j.nodeName){let St=Ue(j.nodeName);if(!we[St]||Pe[St])throw Cl("root node is forbidden and cannot be sanitized in-place")}}else if(j instanceof a)A=nv("<!---->"),U=A.ownerDocument.importNode(j,!0),U.nodeType===Qo.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?A=U:A.appendChild(U);else{if(!ss&&!bn&&!He&&j.indexOf("<")===-1)return S&&jl?S.createHTML(j):j;if(A=nv(j),!A)return ss?null:jl?w:""}A&&Hf&&Ut(A.firstChild);let Be=rv(Ii?j:A);for(;Z=Be.nextNode();){if(iv(Z))continue;let St=h(Z);Z.nodeType===Qo.element&&(St&&St.__depth?Z.__depth=(Z.__removalCount||0)+St.__depth+1:Z.__depth=1),(Z.__depth>=Qy||Z.__depth<0||CT(Z.__depth))&&Ut(Z),Z.content instanceof s&&(Z.content.__depth=Z.__depth,Yk(Z.content)),uv(Z)}if(Ii)return j;if(ss){if(zl)for(Qe=R.call(A.ownerDocument);A.firstChild;)Qe.appendChild(A.firstChild);else Qe=A;return(X.shadowroot||X.shadowrootmode)&&(Qe=_.call(r,Qe,!0)),Qe}let vt=He?A.outerHTML:A.innerHTML;return He&&we["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&gt(NT,A.ownerDocument.doctype.name)&&(vt="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
24
24
  `+vt),bn&&bf([K,W,de],St=>{vt=bl(vt,St," ")}),S&&jl?S.createHTML(vt):vt},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vf(j),Un=!0},t.clearConfig=function(){us=null,Un=!1},t.isValidAttribute=function(j,E,A){us||Vf({});let U=Ue(j),Z=Ue(E);return av(U,Z,A)},t.addHook=function(j,E){typeof E=="function"&&(Q[j]=Q[j]||[],El(Q[j],E))},t.removeHook=function(j){if(Q[j])return ET(Q[j])},t.removeHooks=function(j){Q[j]&&(Q[j]=[])},t.removeAllHooks=function(){Q={}},t}var _T=MT();var hr=x(D());var DM={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function DT(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function Tl(e){return(e+"").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function kl(e,t){var n,r,o,s,i,a=/((?:^|\n+)(?:\n---+|\* \*(?: \*)+)\n)|(?:^``` *(\w*)\n([\s\S]*?)\n```$)|((?:(?:^|\n+)(?:\t| {2,}).+)+\n*)|((?:(?:^|\n)([>*+-]|\d+\.)\s+.*)+)|(?:!\[([^\]]*?)\]\(([^)]+?)\))|(\[)|(\](?:\(([^)]+?)\))?)|(?:(?:^|\n+)([^\s].*)\n(-{3,}|={3,})(?:\n+|$))|(?:(?:^|\n+)(#{1,6})\s*(.+)(?:\n+|$))|(?:`([^`].*?)`)|( \n\n*|\n{2,}|__|\*\*|[_*]|~~)/gm,l=[],u="",c=t||{},f=0;function d(y){var v=DM[y[1]||""],p=l[l.length-1]==y;return v?v[1]?(p?l.pop():l.push(y),v[0|p]):v[0]:y}function g(){for(var y="";l.length;)y+=d(l[l.length-1]);return y}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(y,v,p){return c[v.toLowerCase()]=p,""}).replace(/^\n+|\n+$/g,"");o=a.exec(e);)r=e.substring(f,o.index),f=a.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((i=o[3]||o[4])?n='<pre class="code '+(o[4]?"poetry":o[2].toLowerCase())+'"><code'+(o[2]?' class="language-'+o[2].toLowerCase()+'"':"")+">"+DT(Tl(i).replace(/^\n+|\n+$/g,""))+"</code></pre>":(i=o[6])?(i.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),s=kl(DT(o[5].replace(/^\s*[>*+.-]/gm,""))),i==">"?i="blockquote":(i=i.match(/\./)?"ol":"ul",s=s.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+i+">"+s+"</"+i+">"):o[8]?n='<img src="'+Tl(o[8])+'" alt="'+Tl(o[7])+'">':o[10]?(u=u.replace("<a>",'<a href="'+Tl(o[11]||c[r.toLowerCase()])+'">'),n=g()+"</a>"):o[9]?n="<a>":o[12]||o[14]?n="<"+(i="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+kl(o[12]||o[15],c)+"</"+i+">":o[16]?n="<code>"+Tl(o[16])+"</code>":(o[17]||o[1])&&(n=d(o[17]||"--"))),u+=r,u+=n;return(u+e.substring(f)+g()).replace(/^\n+|\n+$/g,"")}var FT={root:"dd-L7b3z",popover:"dd-OQOTB",options:"dd-Y12RE",arrow:"dd-cv33T",copyIcon:"dd-6xOsH",option:"dd-9oFX4",divider:"dd-aiZf8",fadeup:"dd-Jq9pd"};var xn=x(C());function FM(e){return`<button type="button" data-copy-icon class=${e}><svg version="1.1" x="0px" y="0px" viewBox="0 0 115.77 122.88" width="10px" height="10px" fill="black"><g><path d="M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"/></g></svg></button>`}function Ay(e){var n;let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(r=>r.remove()),(n=t.textContent)!=null?n:""}function HM(e){return e.replace(/\r\n/g,`
25
- `)}function UM(e){return e.replace(new RegExp("(?<!\\]\\()(https?:\\/\\/[^\\s]+)","g"),"[$1]($1)")}var zM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let s=L("Markdown",FT),i=(0,hr.useRef)(null),[a,l]=(0,hr.useState)(null),u=(0,hr.useMemo)(()=>{let v=kl(UM(HM(e)));return _T.sanitize(v).replaceAll("</code>",`${FM(s.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),c=v=>{var h;let p=v.target,m=!!((h=i.current)!=null&&h.querySelector("code"));if(["A","BUTTON"].includes(p.tagName)){l(null);return}a||m&&p.tagName!=="CODE"||!m&&p!==i.current||(p.addEventListener("mouseleave",()=>l(null),{once:!0}),l(p))},f=()=>{if(!a)return;l(null);let v=a.querySelector("button");v&&(mi(v,s.fadeup),r(Ay(a)))},d=v=>{let p=v.target;if(p.tagName==="A"){v.stopPropagation();return}"copyIcon"in p.dataset&&(mi(p,s.fadeup),r(Ay(p.parentElement)))},g=()=>{!a||!o||(l(null),o(Ay(a)))},y=v=>{if(v===null)return;let p=v.getBoundingClientRect();p.left<0?v.style.transform=`translateX(${-p.left+2}px)`:p.right>window.innerWidth&&(v.style.transform=`translateX(${window.innerWidth-p.right-2}px)`)};return(0,xn.jsxs)(hr.Fragment,{children:[a&&(0,xn.jsxs)(bi,{triggerRef:{current:a},className:s.popover,parentNode:a,children:[(0,xn.jsxs)("div",{className:s.options,ref:y,children:[(0,xn.jsx)("button",{type:"button",className:s.option,onClick:f,children:n}),o&&(0,xn.jsxs)(hr.Fragment,{children:[(0,xn.jsx)("div",{className:s.divider}),(0,xn.jsx)("button",{type:"button",className:s.option,onClick:g,children:t})]})]}),(0,xn.jsx)("div",{className:s.arrow})]}),(0,xn.jsx)("div",{ref:i,className:s.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},HT=zM;var Iy={};Xe(Iy,{enUS:()=>jM,nlNL:()=>BM});var jM={useCue:[{type:0,value:"Add to message"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},BM={useCue:[{type:0,value:"Voeg toe aan bericht"}],copyCue:[{type:0,value:"Kopi\xEBren"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var UT={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",actions:"dd-9Iqn9",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l"};var rn=x(C()),VM=({cue:e,onCallToAction:t,onRemove:n,onCopy:r,onUse:o})=>{let s=L("WidgetCue",UT),i=Y(Iy),a=gi(),l=z("hasKeyboardInput"),u=()=>{t&&t(e),n(e)},c=g=>{r&&r(g,e)},f=g=>{o&&o(g,e)},d=g=>{g.preventDefault(),g.stopPropagation(),n(e)};return(0,zT.useEffect)(()=>{a("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label,cueText:e.text})},[]),(0,rn.jsxs)(re,{"data-testid":"cue",children:[(0,rn.jsx)(ye,{children:(0,rn.jsxs)(ye.Content,{children:[e.title&&(0,rn.jsx)(ye.Title,{className:s.title,"data-testid":"widget-cue-title",children:e.title}),(0,rn.jsx)(HT,{content:e.text,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:c,onUse:l?f:void 0})]})}),(0,rn.jsxs)(re.ButtonsContainer,{children:[(0,rn.jsxs)("div",{className:s.actions,children:[e.callToAction&&(0,rn.jsx)(re.Button,{onClick:u,children:e.callToAction.label}),(0,rn.jsx)(re.Button,{onClick:d,children:i("removeCue")})]}),(0,rn.jsx)(yi,{eventName:"Assistant response feedback",eventData:{name:e.rule.name,group:e.rule.label,description:e.rule.description,cueText:e.text},feedbackText:e.text,feedbackType:"assistant"})]})]})},jT=VM;var Pl=x(C()),KM=({cues:e})=>{let t=G(),n=Xt(),r=gi(),o=l=>{t(tT({id:l.rule.id})),t(ME({code:l.rule.label})),r("Assistant response closed",{name:l.rule.name,group:l.rule.label,description:l.rule.description,cueText:l.text})},s=(l,u)=>{rr(l),r("Assistant response copied",{name:u.rule.name,group:u.rule.label,description:u.rule.description,copiedText:l})},i=l=>{l.callToAction&&(t(Id(l)),r("Assistant call to action",{name:l.rule.name,group:l.rule.label,description:l.rule.description,eventName:l.callToAction.event,value:l.callToAction.value}))},a=(l,u)=>{n.send(Xr,{text:l,suggestion:{source:"cue",sourceText:l}}),r("Assistant response used",{name:u.rule.name,group:u.rule.label,description:u.rule.description,usedText:l})};return(0,Pl.jsx)(Pl.Fragment,{children:e.map(l=>(0,Pl.jsx)(jT,{cue:l,onCallToAction:i,onRemove:o,onCopy:s,onUse:a},l.rule.id))})},BT=KM;var Pf=x(D());var VT={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",copyButtonText:"dd-oos-l",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var wn=x(C());function WM(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var KT=({data:e,schema:t})=>{let n=L("WidgetCustomData",VT),r=o=>{rr(o)};return(0,Pf.useEffect)(()=>{H.info("Custom data",e,t)},[e]),(0,wn.jsx)("dl",{className:n.root,children:t.map(o=>{let s=WM(e,o.path);return(0,wn.jsxs)(Pf.Fragment,{children:[(0,wn.jsx)("dt",{className:n.label,children:o.label}),(0,wn.jsx)("dd",{className:n.value,children:o.type==="boolean"&&s?(0,wn.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!s?(0,wn.jsx)("span",{className:n.isFalse,children:o.falseValue}):s?(0,wn.jsxs)("button",{type:"button",onClick:()=>r(s),className:n.copyButton,children:[(0,wn.jsx)("span",{className:n.copyButtonText,children:s}),(0,wn.jsx)(wl,{})]}):"-"})]},o.label)})})};var $T=x(D());var $M=/(https?:\/\/[^\s]+)/,WT=e=>e.split(" ").find(t=>$M.test(t));var on=x(C()),qM=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=WT(r),s=Y(Bo),i=z("showImages"),a=z("fallbackImage"),l=z("hasKeyboardInput"),u=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},c=(0,$T.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,on.jsxs)(re,{onClick:l?u:void 0,"data-testid":"edit-suggestion",children:[(0,on.jsxs)(ye,{children:[i&&e.image&&(0,on.jsx)(ye.Image,{src:hf(e,"small",a||void 0),title:e.title}),(0,on.jsxs)(ye.Content,{children:[e.title&&(0,on.jsx)(ye.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,on.jsx)(re.Labels,{labels:e.searchKeywords}),(0,on.jsx)(ye.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,on.jsxs)(re.Actions,{children:[o&&(0,on.jsx)(re.ActionButton,{onClick:c,label:s("visitUrl")}),l&&(0,on.jsx)(re.ActionButton,{primary:!0,onClick:u,label:s("useSuggestion")})]})]})},qT=qM;var Rl=x(C()),GM=({lines:e,suggestions:t})=>{let n=Xt(),r=(o,s)=>{n.send(Xr,{text:o,suggestion:I(T({},s),{source:s.source,sourceText:s.text})})};return(0,Rl.jsx)(Rl.Fragment,{children:t.map(o=>(0,Rl.jsx)(qT,{suggestion:o,lines:e,onUse:s=>r(s,o)},o.text||o.url||o.message))})},GT=GM;var Al={};Xe(Al,{enUS:()=>YM,nlNL:()=>QM});var YM={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"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"My "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Summarize"}],linkKnowledgeSearch:[{type:0,value:"Knowledge Assist"}],linkSearch:[{type:0,value:"Search"}]},QM={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"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"Mijn "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Gesprek samenvatten"}],linkKnowledgeSearch:[{type:0,value:"Knowledge assist"}],linkSearch:[{type:0,value:"Zoeken"}]};var Il={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",sectionList:"dd-bF9pF",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",link:"dd-DRo0x"};var q=x(C()),Rf=(e,t)=>{let n=M(ut);(0,Ci.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},XM=({onLogIn:e})=>{let t=L("Widget",Il),n=z("isEmbedded"),r=z("adminUrl");return(0,q.jsx)("div",{className:t.loginText,children:(0,q.jsx)("div",{children:(0,q.jsx)(nf,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},YT=({text:e})=>{let t=L("Widget",Il);return(0,q.jsx)("div",{className:t.stateText,children:(0,q.jsx)("div",{children:(0,q.jsx)("p",{children:e})})},"notification")},ZM=()=>{let e=Y(Al),t=G(),n=L("Widget",Il),r=z("showSearch"),o=z("showSummaryCommand"),s=z("showKnowledgeSearch"),i=z("isEmbedded"),a=M(hi("/admin/")),l=Xt(),u=z("productName"),c=z("hasKeyboardInput"),f=r||o||s||a;return Rf(()=>{if(i)return t(fy()),()=>{t(QC())}},[t,i]),!f||!c?null:(0,q.jsx)(Cn,{title:e("actions"),type:"shortcuts",children:(0,q.jsxs)("div",{className:n.shortcutList,children:[r&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-search","aria-label":e("linkSearch"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0}),children:[(0,q.jsx)(di,{}),e("linkSearch")]}),o&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-summary","aria-label":e("linkSummary"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,q.jsx)(xT,{}),e("linkSummary")]}),s&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-knowledge-assist","aria-label":e("linkKnowledgeSearch"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,q.jsx)(ST,{}),e("linkKnowledgeSearch")]}),a&&(0,q.jsxs)("a",{className:n.shortcut,target:"_blank",href:a,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:u}),rel:"noreferrer",children:[(0,q.jsx)(vT,{}),e("linkStudioLogin",{productName:u})]})]})})},JM=()=>{let e=G(),t=z("showCustomMessages"),n=M(jC),r=M(ri);return Rf(()=>(e(xl(r)),e($C(r)),()=>{e(qC(r))}),[e,t,r]),!t||n.length===0?null:(0,q.jsx)(Cn,{type:"custom-messages","data-testid":"custom-messages",children:(0,q.jsx)(Et,{withDivider:!0,children:n.map(o=>(0,q.jsx)(gT,{suggestion:o},o.text))})})},e_=()=>{let e=Y(Al),t=G(),n=z("showAutoflows"),r=M(DC),o=M(ri);return Rf(()=>(t(mr(o)),t(FC(o)),()=>{t(HC(o))}),[t,n,o]),!n||r.length===0?null:(0,q.jsx)(Cn,{type:"autoflows",title:e("titleAutoflows"),"data-testid":"autoflows",children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(pT,{})})})},t_=()=>{let e=G(),t=M(Od),n=M(HE),r=M(rT),o=M(q1),s=M(Kd),i=M(Gd),a=M(nr),l=M(Yr);return(0,Ci.useEffect)(()=>{!!o&&!n&&H.warn("Custom data provided, but no schema.")},[o,n]),Rf(()=>{t.forEach(({type:u})=>{u==="entities"?e(yn()):su.includes(u)||e(vn(u))})},[e,l,a]),(0,Ci.useEffect)(()=>{r.length>0&&!t.some(u=>u.type==="cues")&&H.warn("Received cues, but cues are not configured in widget.")},[t,r]),(0,q.jsx)(Ci.Fragment,{children:t.map(({type:u,title:c,amount:f,lines:d,schema:g})=>{var y,v;switch(u){case"entities":return s&&s.length>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(yT,{entities:s})},u);case"cues":return r&&r.length>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(BT,{cues:r})})},u);case"custom-data":return o&&g&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(KT,{data:o,schema:g})})},u);default:return((v=(y=i[u])==null?void 0:y.suggestions)==null?void 0:v.length)>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(GT,{lines:d,contentType:u,suggestions:i[u].suggestions.slice(0,f)||[]})})},u)}})})},n_=({onLogIn:e})=>{let t=Y(Al),n=L("Widget",Il),r=M(oi),o=M(ut),s=M(ri),i=M(nr);return r===!1?(0,q.jsx)(YT,{text:t("notSupported")}):o===!1?(0,q.jsx)(XM,{onLogIn:e}):!i||!s||o===null?(0,q.jsx)(YT,{text:t("waiting")}):(0,q.jsx)("div",{className:(0,QT.default)(n.root),"data-testid":"widget",children:(0,q.jsxs)(nu,{className:n.sectionList,children:[(0,q.jsx)(ZM,{}),(0,q.jsx)(JM,{}),(0,q.jsx)(e_,{}),(0,q.jsx)(t_,{})]})})},XT=n_;function Ti(e){let t=new Range;return t.selectNodeContents(e),t}function ZT(e,t,n){try{return io(e,t,n),!0}catch(r){return!1}}function Af(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function If(e){return"tagName"in e&&e.tagName==="BR"}var Ll=/[\u200B-\u200D\uFEFF]/g;function io(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,s=!1;function i(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){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(Ll,""),f=o+c.length,d=t>=o&&t<=f,g=n>=o&&n<=f;if(d){let y=i(u,t-o);y===0&&!g?r.setStartBefore(l):r.setStart(l,y)}g&&(r.setEnd(l,i(u,n-o)),s=!0),o=f;break}case Node.ELEMENT_NODE:{if(If(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),s=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!s);c++);let u=l.lastChild;Af(l)&&u&&!Af(u)&&!If(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function Ol(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:s,collapsed:i}=t,a,l,u=0;function c(f){let d=f===e,g=f===n,y=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let v=f.textContent;g&&(a=u+v.substring(0,r).replace(Ll,"").length),y&&(l=u+v.substring(0,s).replace(Ll,"").length),u+=v.replace(Ll,"").length;break}case Node.ELEMENT_NODE:{if(If(f)&&f.nextSibling){u++;break}!d&&Af(f)&&f.previousSibling&&u++;for(let v=0;v<f.childNodes.length;v++){let p=g&&v===r,m=y&&v===s;if(p&&(a=u),m&&(l=u),l!==void 0||((!p||!i)&&c(f.childNodes[v]),y&&v===s-1&&(l=u),l!==void 0))break}y&&(l=u);break}default:break}}if(c(e),l===void 0)throw new Error("Could not determine start and end");return{start:a!=null?a:l,end:l}}function Nl(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:s,collapsed:i}=t,a=0,l="";function u(c){let f=c===e,d=c===n,g=c===o;switch(d&&(a=1),c.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let y=d?r:0,v=g?s:void 0;l+=c.textContent.replace(Ll,"").substring(y,v);break}case Node.ELEMENT_NODE:{if(!i&&a===1&&If(c)&&c.nextSibling){l+=`
25
+ `)}var UM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let s=L("Markdown",FT),i=(0,hr.useRef)(null),[a,l]=(0,hr.useState)(null),u=(0,hr.useMemo)(()=>{let v=kl(HM(e));return _T.sanitize(v).replaceAll("</code>",`${FM(s.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),c=v=>{var h;let p=v.target,m=!!((h=i.current)!=null&&h.querySelector("code"));if(["A","BUTTON"].includes(p.tagName)){l(null);return}a||m&&p.tagName!=="CODE"||!m&&p!==i.current||(p.addEventListener("mouseleave",()=>l(null),{once:!0}),l(p))},f=()=>{if(!a)return;l(null);let v=a.querySelector("button");v&&(mi(v,s.fadeup),r(Ay(a)))},d=v=>{let p=v.target;if(p.tagName==="A"){v.stopPropagation();return}"copyIcon"in p.dataset&&(mi(p,s.fadeup),r(Ay(p.parentElement)))},g=()=>{!a||!o||(l(null),o(Ay(a)))},y=v=>{if(v===null)return;let p=v.getBoundingClientRect();p.left<0?v.style.transform=`translateX(${-p.left+2}px)`:p.right>window.innerWidth&&(v.style.transform=`translateX(${window.innerWidth-p.right-2}px)`)};return(0,xn.jsxs)(hr.Fragment,{children:[a&&(0,xn.jsxs)(bi,{triggerRef:{current:a},className:s.popover,parentNode:a,children:[(0,xn.jsxs)("div",{className:s.options,ref:y,children:[(0,xn.jsx)("button",{type:"button",className:s.option,onClick:f,children:n}),o&&(0,xn.jsxs)(hr.Fragment,{children:[(0,xn.jsx)("div",{className:s.divider}),(0,xn.jsx)("button",{type:"button",className:s.option,onClick:g,children:t})]})]}),(0,xn.jsx)("div",{className:s.arrow})]}),(0,xn.jsx)("div",{ref:i,className:s.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},HT=UM;var Iy={};Xe(Iy,{enUS:()=>zM,nlNL:()=>jM});var zM={useCue:[{type:0,value:"Add to message"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},jM={useCue:[{type:0,value:"Voeg toe aan bericht"}],copyCue:[{type:0,value:"Kopi\xEBren"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var UT={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",actions:"dd-9Iqn9",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l"};var rn=x(C()),BM=({cue:e,onCallToAction:t,onRemove:n,onCopy:r,onUse:o})=>{let s=L("WidgetCue",UT),i=Y(Iy),a=gi(),l=z("hasKeyboardInput"),u=()=>{t&&t(e),n(e)},c=g=>{r&&r(g,e)},f=g=>{o&&o(g,e)},d=g=>{g.preventDefault(),g.stopPropagation(),n(e)};return(0,zT.useEffect)(()=>{a("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label,cueText:e.text})},[]),(0,rn.jsxs)(re,{"data-testid":"cue",children:[(0,rn.jsx)(ye,{children:(0,rn.jsxs)(ye.Content,{children:[e.title&&(0,rn.jsx)(ye.Title,{className:s.title,"data-testid":"widget-cue-title",children:e.title}),(0,rn.jsx)(HT,{content:e.text,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:c,onUse:l?f:void 0})]})}),(0,rn.jsxs)(re.ButtonsContainer,{children:[(0,rn.jsxs)("div",{className:s.actions,children:[e.callToAction&&(0,rn.jsx)(re.Button,{onClick:u,children:e.callToAction.label}),(0,rn.jsx)(re.Button,{onClick:d,children:i("removeCue")})]}),(0,rn.jsx)(yi,{eventName:"Assistant response feedback",eventData:{name:e.rule.name,group:e.rule.label,description:e.rule.description,cueText:e.text},feedbackText:e.text,feedbackType:"assistant"})]})]})},jT=BM;var Pl=x(C()),VM=({cues:e})=>{let t=G(),n=Xt(),r=gi(),o=l=>{t(tT({id:l.rule.id})),t(ME({code:l.rule.label})),r("Assistant response closed",{name:l.rule.name,group:l.rule.label,description:l.rule.description,cueText:l.text})},s=(l,u)=>{rr(l),r("Assistant response copied",{name:u.rule.name,group:u.rule.label,description:u.rule.description,copiedText:l})},i=l=>{l.callToAction&&(t(Id(l)),r("Assistant call to action",{name:l.rule.name,group:l.rule.label,description:l.rule.description,eventName:l.callToAction.event,value:l.callToAction.value}))},a=(l,u)=>{n.send(Xr,{text:l,suggestion:{source:"cue",sourceText:l}}),r("Assistant response used",{name:u.rule.name,group:u.rule.label,description:u.rule.description,usedText:l})};return(0,Pl.jsx)(Pl.Fragment,{children:e.map(l=>(0,Pl.jsx)(jT,{cue:l,onCallToAction:i,onRemove:o,onCopy:s,onUse:a},l.rule.id))})},BT=VM;var Pf=x(D());var VT={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",copyButtonText:"dd-oos-l",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var wn=x(C());function KM(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var KT=({data:e,schema:t})=>{let n=L("WidgetCustomData",VT),r=o=>{rr(o)};return(0,Pf.useEffect)(()=>{H.info("Custom data",e,t)},[e]),(0,wn.jsx)("dl",{className:n.root,children:t.map(o=>{let s=KM(e,o.path);return(0,wn.jsxs)(Pf.Fragment,{children:[(0,wn.jsx)("dt",{className:n.label,children:o.label}),(0,wn.jsx)("dd",{className:n.value,children:o.type==="boolean"&&s?(0,wn.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!s?(0,wn.jsx)("span",{className:n.isFalse,children:o.falseValue}):s?(0,wn.jsxs)("button",{type:"button",onClick:()=>r(s),className:n.copyButton,children:[(0,wn.jsx)("span",{className:n.copyButtonText,children:s}),(0,wn.jsx)(wl,{})]}):"-"})]},o.label)})})};var $T=x(D());var WM=/(https?:\/\/[^\s]+)/,WT=e=>e.split(" ").find(t=>WM.test(t));var on=x(C()),$M=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=WT(r),s=Y(Bo),i=z("showImages"),a=z("fallbackImage"),l=z("hasKeyboardInput"),u=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},c=(0,$T.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,on.jsxs)(re,{onClick:l?u:void 0,"data-testid":"edit-suggestion",children:[(0,on.jsxs)(ye,{children:[i&&e.image&&(0,on.jsx)(ye.Image,{src:hf(e,"small",a||void 0),title:e.title}),(0,on.jsxs)(ye.Content,{children:[e.title&&(0,on.jsx)(ye.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,on.jsx)(re.Labels,{labels:e.searchKeywords}),(0,on.jsx)(ye.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,on.jsxs)(re.Actions,{children:[o&&(0,on.jsx)(re.ActionButton,{onClick:c,label:s("visitUrl")}),l&&(0,on.jsx)(re.ActionButton,{primary:!0,onClick:u,label:s("useSuggestion")})]})]})},qT=$M;var Rl=x(C()),qM=({lines:e,suggestions:t})=>{let n=Xt(),r=(o,s)=>{n.send(Xr,{text:o,suggestion:I(T({},s),{source:s.source,sourceText:s.text})})};return(0,Rl.jsx)(Rl.Fragment,{children:t.map(o=>(0,Rl.jsx)(qT,{suggestion:o,lines:e,onUse:s=>r(s,o)},o.text||o.url||o.message))})},GT=qM;var Al={};Xe(Al,{enUS:()=>GM,nlNL:()=>YM});var GM={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"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"My "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Summarize"}],linkKnowledgeSearch:[{type:0,value:"Knowledge Assist"}],linkSearch:[{type:0,value:"Search"}]},YM={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"}],titleCues:[{type:0,value:"Assistant updates"}],actions:[{type:0,value:"Shortcuts"}],linkStudioLogin:[{type:0,value:"Mijn "},{type:1,value:"productName"}],linkSummary:[{type:0,value:"Gesprek samenvatten"}],linkKnowledgeSearch:[{type:0,value:"Knowledge assist"}],linkSearch:[{type:0,value:"Zoeken"}]};var Il={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",sectionList:"dd-bF9pF",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",link:"dd-DRo0x"};var q=x(C()),Rf=(e,t)=>{let n=M(ut);(0,Ci.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},QM=({onLogIn:e})=>{let t=L("Widget",Il),n=z("isEmbedded"),r=z("adminUrl");return(0,q.jsx)("div",{className:t.loginText,children:(0,q.jsx)("div",{children:(0,q.jsx)(nf,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},YT=({text:e})=>{let t=L("Widget",Il);return(0,q.jsx)("div",{className:t.stateText,children:(0,q.jsx)("div",{children:(0,q.jsx)("p",{children:e})})},"notification")},XM=()=>{let e=Y(Al),t=G(),n=L("Widget",Il),r=z("showSearch"),o=z("showSummaryCommand"),s=z("showKnowledgeSearch"),i=z("isEmbedded"),a=M(hi("/admin/")),l=Xt(),u=z("productName"),c=z("hasKeyboardInput"),f=r||o||s||a;return Rf(()=>{if(i)return t(fy()),()=>{t(QC())}},[t,i]),!f||!c?null:(0,q.jsx)(Cn,{title:e("actions"),type:"shortcuts",children:(0,q.jsxs)("div",{className:n.shortcutList,children:[r&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-search","aria-label":e("linkSearch"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0}),children:[(0,q.jsx)(di,{}),e("linkSearch")]}),o&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-summary","aria-label":e("linkSummary"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,q.jsx)(xT,{}),e("linkSummary")]}),s&&(0,q.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-knowledge-assist","aria-label":e("linkKnowledgeSearch"),onClick:()=>l.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,q.jsx)(ST,{}),e("linkKnowledgeSearch")]}),a&&(0,q.jsxs)("a",{className:n.shortcut,target:"_blank",href:a,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:u}),rel:"noreferrer",children:[(0,q.jsx)(vT,{}),e("linkStudioLogin",{productName:u})]})]})})},ZM=()=>{let e=G(),t=z("showCustomMessages"),n=M(jC),r=M(ri);return Rf(()=>(e(xl(r)),e($C(r)),()=>{e(qC(r))}),[e,t,r]),!t||n.length===0?null:(0,q.jsx)(Cn,{type:"custom-messages","data-testid":"custom-messages",children:(0,q.jsx)(Et,{withDivider:!0,children:n.map(o=>(0,q.jsx)(gT,{suggestion:o},o.text))})})},JM=()=>{let e=Y(Al),t=G(),n=z("showAutoflows"),r=M(DC),o=M(ri);return Rf(()=>(t(mr(o)),t(FC(o)),()=>{t(HC(o))}),[t,n,o]),!n||r.length===0?null:(0,q.jsx)(Cn,{type:"autoflows",title:e("titleAutoflows"),"data-testid":"autoflows",children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(pT,{})})})},e_=()=>{let e=G(),t=M(Od),n=M(HE),r=M(rT),o=M(q1),s=M(Kd),i=M(Gd),a=M(nr),l=M(Yr);return(0,Ci.useEffect)(()=>{!!o&&!n&&H.warn("Custom data provided, but no schema.")},[o,n]),Rf(()=>{t.forEach(({type:u})=>{u==="entities"?e(yn()):su.includes(u)||e(vn(u))})},[e,l,a]),(0,Ci.useEffect)(()=>{r.length>0&&!t.some(u=>u.type==="cues")&&H.warn("Received cues, but cues are not configured in widget.")},[t,r]),(0,q.jsx)(Ci.Fragment,{children:t.map(({type:u,title:c,amount:f,lines:d,schema:g})=>{var y,v;switch(u){case"entities":return s&&s.length>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(yT,{entities:s})},u);case"cues":return r&&r.length>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(BT,{cues:r})})},u);case"custom-data":return o&&g&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(KT,{data:o,schema:g})})},u);default:return((v=(y=i[u])==null?void 0:y.suggestions)==null?void 0:v.length)>0&&(0,q.jsx)(Cn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,q.jsx)(Et,{withDivider:!0,children:(0,q.jsx)(GT,{lines:d,contentType:u,suggestions:i[u].suggestions.slice(0,f)||[]})})},u)}})})},t_=({onLogIn:e})=>{let t=Y(Al),n=L("Widget",Il),r=M(oi),o=M(ut),s=M(ri),i=M(nr);return r===!1?(0,q.jsx)(YT,{text:t("notSupported")}):o===!1?(0,q.jsx)(QM,{onLogIn:e}):!i||!s||o===null?(0,q.jsx)(YT,{text:t("waiting")}):(0,q.jsx)("div",{className:(0,QT.default)(n.root),"data-testid":"widget",children:(0,q.jsxs)(nu,{className:n.sectionList,children:[(0,q.jsx)(XM,{}),(0,q.jsx)(ZM,{}),(0,q.jsx)(JM,{}),(0,q.jsx)(e_,{})]})})},XT=t_;function Ti(e){let t=new Range;return t.selectNodeContents(e),t}function ZT(e,t,n){try{return io(e,t,n),!0}catch(r){return!1}}function Af(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function If(e){return"tagName"in e&&e.tagName==="BR"}var Ll=/[\u200B-\u200D\uFEFF]/g;function io(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,s=!1;function i(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){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(Ll,""),f=o+c.length,d=t>=o&&t<=f,g=n>=o&&n<=f;if(d){let y=i(u,t-o);y===0&&!g?r.setStartBefore(l):r.setStart(l,y)}g&&(r.setEnd(l,i(u,n-o)),s=!0),o=f;break}case Node.ELEMENT_NODE:{if(If(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),s=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!s);c++);let u=l.lastChild;Af(l)&&u&&!Af(u)&&!If(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function Ol(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:s,collapsed:i}=t,a,l,u=0;function c(f){let d=f===e,g=f===n,y=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let v=f.textContent;g&&(a=u+v.substring(0,r).replace(Ll,"").length),y&&(l=u+v.substring(0,s).replace(Ll,"").length),u+=v.replace(Ll,"").length;break}case Node.ELEMENT_NODE:{if(If(f)&&f.nextSibling){u++;break}!d&&Af(f)&&f.previousSibling&&u++;for(let v=0;v<f.childNodes.length;v++){let p=g&&v===r,m=y&&v===s;if(p&&(a=u),m&&(l=u),l!==void 0||((!p||!i)&&c(f.childNodes[v]),y&&v===s-1&&(l=u),l!==void 0))break}y&&(l=u);break}default:break}}if(c(e),l===void 0)throw new Error("Could not determine start and end");return{start:a!=null?a:l,end:l}}function Nl(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:s,collapsed:i}=t,a=0,l="";function u(c){let f=c===e,d=c===n,g=c===o;switch(d&&(a=1),c.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let y=d?r:0,v=g?s:void 0;l+=c.textContent.replace(Ll,"").substring(y,v);break}case Node.ELEMENT_NODE:{if(!i&&a===1&&If(c)&&c.nextSibling){l+=`
26
26
  `;break}!f&&!i&&a===1&&Af(c)&&c.previousSibling&&(l+=`
27
- `);let y=d?r:0,v=g?Math.min(s,c.childNodes.length):c.childNodes.length;for(let p=y;p<v&&(u(c.childNodes[p]),a!==2);p++);break}default:break}g&&(a=2)}return u(e),l}var JT=(i=>(i.CUT="Cut",i.BACKSPACE="Backspace",i.DELETE="Delete",i.ERASEEOF="EraseEof",i.UNDO="Undo",i.CLEAR="Clear",i))(JT||{}),yr=class{constructor(t){this.element=t;this.isFocused=!1;this.isActive=!0;this.isDisposed=!1;this.eventListeners={};this.disposeHandlers=[];this.cachedText="";this.cachedCaretPosition=null;this.cachedSelection={start:0,end:0};this.cachedHTML="";this.isSubmitting=!1;this.isPossibleClearInputAction=!1;this.cachedText=this.getText(),this.cachedHTML=this.getHTML(),this.cachedSelection=this.getSelection(),this.listen()}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)}handleInteraction(){let t=this.getText(),n=this.getHTML(),r=this.getSelection(),o=this.cachedCaretPosition===null;if(!this.isActive||(t===""&&this.cachedText!==""&&!this.isPossibleClearInputAction&&this.emit("submit"),t!==this.cachedText?(this.cachedText=t,this.cachedHTML=n,o=!0,this.emit("change",{plainText:t,rawHTML:n})):n!==null&&n!==this.cachedHTML&&(this.cachedHTML=n,o=!0,this.emit("change",{plainText:t,rawHTML:n})),(r.start!==this.cachedSelection.start||r.end!==this.cachedSelection.end)&&(this.cachedSelection=r,o=!0,this.emit("selection",r)),!o))return;let s=this.getCaretPosition();Gr(s,this.cachedCaretPosition)||(this.cachedCaretPosition=s,this.emit("caretposition",s))}handleClick(){this.handleInteraction()}handleFocus(){let t=!this.isFocused;this.isFocused=!0,t&&this.emit("focus"),this.handleInteraction()}handleBlur(){this.isPossibleClearInputAction=!1;let t=this.isFocused;this.isFocused=!1,t&&this.emit("blur")}handleKeyDown(t){let{key:n,ctrlKey:r,metaKey:o}=t;this.isPossibleClearInputAction=Object.values(JT).includes(n)||n.toLowerCase()==="z"&&(r||o),this.emit("keydown",t)}handleKeyUp(t){this.handleInteraction(),this.emit("keyup",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.handleInteraction()),this.addEventListener("change",()=>this.handleInteraction()),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.handleInteraction()),document.activeElement===this.element&&(this.isFocused=!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.handleInteraction()}deactivate(){this.isActive=!1}dispose(){this.disposeHandlers.forEach(t=>t()),this.eventListeners={},this.isDisposed=!0}};function ek(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Zo=class extends yr{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),Nl(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){var i;let n=this.getRootNode();if(n.activeElement!==this.element)return null;let r="getSelection"in n?n.getSelection():window.getSelection();if(!r)return null;let o="getComposedRanges"in r&&n instanceof ShadowRoot?(i=r.getComposedRanges(n))==null?void 0:i[0]:r.rangeCount>0?r.getRangeAt(0):null;if(!o)return null;let s=this.element.ownerDocument.createRange();return s.setStart(o==null?void 0:o.startContainer,o==null?void 0:o.startOffset),s.setEnd(o==null?void 0:o.endContainer,o==null?void 0:o.endOffset),!s||!this.element.contains(s.startContainer)||!this.element.contains(s.endContainer)?null:s}getCaretPosition(){let n=this.getRange();if(!n||!n.collapsed||!("getBoundingClientRect"in n))return null;let r=n.getBoundingClientRect();return!ek(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!ek(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return Ol(this.element,n);let r=this.lastKnownSelection;if(r&&ZT(this.element,r.start,r.end))return r;let o=Ti(this.element);return o.collapse(!1),Ol(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return Nl(this.element,io(this.element,n,r))}listen(){super.listen();let n=new MutationObserver(s=>{var i,a;s.length===2&&s[0].addedNodes.length===1&&((i=s[0].addedNodes[0])==null?void 0:i.textContent)==="\u2060"&&((a=s[1].removedNodes[0])==null?void 0:a.textContent)==="\u2060"||setTimeout(()=>{this.handleInteraction()},0)});n.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.disposeHandlers.push(()=>n.disconnect());let r=this.element.isContentEditable,o=new MutationObserver(()=>{this.element.isContentEditable!==r&&(r=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>o.disconnect())}};var r_=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function tk(e,t){let n="mozInnerScreenX"in window,r=document.createElement("div");r.id="input-textarea-caret-position-mirror-div";let o=r.style,s=window.getComputedStyle(e),i=e.ownerDocument.body;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.visibility="hidden",r_.forEach(function(c){o[c]=s[c]}),n?e.scrollHeight>parseInt(s.height)&&(o.overflowY="scroll"):o.overflow="hidden",r.textContent=e.value.substring(0,t);let a=document.createElement("span");a.textContent=e.value.substring(t)||".",r.appendChild(a),i.appendChild(r);let l=e.getBoundingClientRect(),u={top:l.top-e.scrollTop+a.offsetTop+parseInt(s.borderTopWidth)+a.offsetHeight,left:l.left-e.scrollLeft+a.offsetLeft+parseInt(s.borderLeftWidth)};return i.removeChild(r),u}var Jo=class extends yr{constructor(){super(...arguments);this.lastKnownSelection=null}getText(){return this.element.value}getHTML(){return null}getSelection(){let{selectionStart:n,selectionEnd:r}=this.element;return{start:n,end:r}}getSelectedText(){let n=this.getSelection();return n?this.getText().slice(n.start,n.end):""}getCaretPosition(){return tk(this.element,this.element.selectionEnd)}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var s;return(s=n==null?void 0:n.get)==null?void 0:s.call(this.element)},set:s=>{var i;(i=n==null?void 0:n.set)==null||i.call(this.element,s),this.handleInteraction()}}),this.addEventListener("scroll",()=>{this.emit("caretposition",this.getCaretPosition())});let r=this.element.disabled,o=new MutationObserver(()=>{this.element.disabled!==r&&(r=this.element.disabled,this.emit(r?"disabled":"enabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>o.disconnect())}};function nk(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let s=document.createElement("iframe"),i=new URL(t);return Object.entries(n).forEach(([a,l])=>{i.searchParams.append(a,l)}),s.style.position="absolute",s.style.left="-999em",s.style.width="0px",s.style.height="0px",s.tabIndex=-1,s.id=r,s.title=`iframe-${e}`,s.src=i.toString(),window.document.body.appendChild(s),s}function o_(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch(t){return e}}var Ly=class{constructor(t){this.name=t;this.disposeHandlers=[];this.broadcastChannel=new BroadcastChannel(t)}onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(JSON.stringify(t))}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},Oy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=nk(t,`${this.targetOrigin}/sdk/proxy/proxy.html`,{channel:this.name,host:window.location.origin,debug:"1"}),document.body.appendChild(this.iframe)}onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(JSON.stringify(t),this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},Ny=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.sessionId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),H.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 Oy(t,this.deepdeskUrl,{debug:!0}):new Ly(t),r=o=>{var i,a;if(o.origin!==this.deepdeskUrl)return;let s=o_(o.data);typeof s!="object"||s.type!=="event"||s.channel!==t||(H.info("Received broadcast event",this.sessionId,o),(a=(i=this.eventMap)[s.name])==null||a.call(i,s.payload))};return n.onMessage(r),n}send(t,n,r){var i,a;H.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(i=this.eventMap)[t])==null||a.call(i,n));let s=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;s==null||s.postMessage(I(T({},o),{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)}},rk=Ny;function s_(e){return e.replace(/(_\w)/g,t=>t[1].toUpperCase())}function oe(e){return Array.isArray(e)?e.map(oe):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(T({},t),{[s_(n)]:oe(e[n])}),{}):e}function My(e){return e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function Le(e){return Array.isArray(e)?e.map(Le):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(T({},t),{[My(n)]:Le(e[n])}),{}):e}var ki=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var _y=e=>new Promise(t=>{setTimeout(t,e)});var Pi=class extends ki{constructor(){super(...arguments);this.name="ClientError"}},Fy=class extends ki{constructor(){super(...arguments);this.name="ServerError"}},Dy=new Map;function i_(e){return P(this,null,function*(){if(e.status===204)return e.text().catch(()=>{}),null;let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();let n=yield e.text();return n===""?null:(H.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var ao=class ao{constructor(t="",n={}){this.baseUrl=t;this.options=n;this.latestRequestByUrl={};this.fetch=window.fetch.bind(window);n.fetch&&(this.fetch=n.fetch)}patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let s={isAborted:!1,reject:o},i=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",b=n,{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:g=!0,retryOnError:y=R=>R instanceof TypeError,retryOnResponse:v=R=>R.status>=500,version:p=null}=b,m=ee(b,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(u)if(l){if(Dy.has(i)){r(Dy.get(i));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h=I(T({credentials:"include"},m),{headers:T({Accept:"application/json","Content-Type":"application/json"},m.headers)});!l&&this.csrfToken&&(h.headers=I(T({},h.headers),{"X-CSRFToken":this.csrfToken})),typeof p=="string"&&(h.headers=I(T({},h.headers),{"X-Deepdesk-API-Version":p}));let S=f,w=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[i]&&c&&(this.latestRequestByUrl[i].isAborted=!0,this.latestRequestByUrl[i].reject(new Error("Aborted"))),this.latestRequestByUrl[i]=s;let k=()=>P(this,null,function*(){return S--,a(i,h).then(R=>P(this,null,function*(){return v(R)&&!s.isAborted&&S>0?(yield _y(d),k()):R.status===401&&g===!0&&w===!1?(w=!0,yield this.refreshToken(),k()):R})).catch(R=>P(this,null,function*(){if(y(R)&&!s.isAborted&&S>0)return yield _y(d),k();throw R}))});k().then(R=>P(this,null,function*(){let N=yield i_(R);if(delete this.latestRequestByUrl[i],R.status>=500){o(new Fy("Server Error",N));return}else if(R.status===401){o(new Pi("Unauthorized",N));return}else if(R.status===403){o(new Pi("Forbidden",N));return}else if(R.status===404){o(new Pi("Not Found",N));return}else if(R.status>=400){o(new Pi("Bad Request",N));return}u&&Dy.set(i,N),r(N)})).catch(R=>{o(R)})})}validateToken(){return P(this,null,function*(){let{has_valid_access_token:t}=yield this.get("/auth/validate");if(!t)try{yield this.refreshToken()}catch(r){return!1}let{is_logged_in:n}=yield this.get("/apis/admin/session/validate/");return!!n})}refreshToken(){return ao.refreshingToken||(ao.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{ao.refreshingToken=null},1e3*60)})),ao.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,T({method:"POST",body:JSON.stringify(n)},r))}patch(t,n,r){return this.request(t,T({method:"PATCH",body:JSON.stringify(n)},r))}put(t,n,r){return this.request(t,T({method:"PUT",body:JSON.stringify(n)},r))}delete(t,n){return this.request(t,T({method:"DELETE"},n))}};ao.refreshingToken=null;var vr=ao;var ok;(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||(t.EventType={}))})(ok||(ok={}));function Lf(e){return I(T({},oe(e)),{tags:e.tags})}var es=class es{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new vr(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,s)=>P(this,null,function*(){let i=yield r(o,s);return this.handleDeepdeskVersionHeaders(i),i}))}preflight(){return P(this,null,function*(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=yield this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(es.exchangeTokenPromise||(es.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),es.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return P(this,null,function*(){yield this.preflight(),H.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=yield this.client.post("/api/conversations",I(T({},Le(t)),{tags:t.tags}),{version:"v2"});return Lf(n)})}getMe(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/me/");return oe(t)})}postIdentity(t){return P(this,null,function*(){yield this.client.post("/apis/admin/session/me/identities/",Le(t))})}patchMe(t){return P(this,null,function*(){let n=yield this.client.patch("/apis/admin/session/me/",Le(t));return oe(n)})}getProfile(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return oe(n)})}getKnowledgeAssistant(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return oe(n)})}getContentTypes(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return oe(t)})}getAccount(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return oe(t)})}getPlatformConfig(t){return P(this,null,function*(){let n=t!==void 0?`/platform/config/${t}/`:"/platform/config/",{config:r}=yield this.client.get(n,{useCache:!0});return oe(r)})}checkUserExists(t){return P(this,null,function*(){let{exists:n}=yield this.client.get(`/apis/admin/users/exists?external_id=${t}`,{version:"v1"});return n})}getConversationBySessionId(r){return P(this,arguments,function*(t,n={}){yield this.preflight(),H.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:s=1e3}=n,i=yield this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return H.info(`Successfully retrieved conversation ${i.id} for session ${t}`),Lf(i)})}isConversationSupported(r){return P(this,arguments,function*(t,n={}){H.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:s=1e3}=n;return(yield this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"})).has_active_profile})}updateConversation(t,n){return P(this,null,function*(){let r=Le(n);n.tags&&(r.tags=n.tags);let o=yield this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return Lf(o)})}postMessages(t,n){return P(this,null,function*(){return(yield this.client.post(`/api/conversations/${t}/messages`,n.map(o=>I(T({},Le(o)),{tags:o.tags})),{version:"v2"})).map(o=>Lf(o))})}sendEvent(t,n){return P(this,null,function*(){let i=n,{data:r}=i,o=ee(i,["data"]),s=Object.entries(this.latestReceivedDeepdeskVersions).reduce((a,[l,u])=>I(T({},a),{[l]:u}),{});return this.client.post("/api/events",Le(I(T(T({},s),o),{data:r,name:t})),{version:"v2"})})}sendEventV1(t,n){return P(this,null,function*(){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[s,i])=>I(T({},o),{[s]:i}),{});return this.client.post("/api/events",{event:t,data:Le(T(T({},n),r))},{version:"v1"})})}getEntities(t){return P(this,null,function*(){return(yield this.client.post("/api/entities",{messages:t.filter(r=>r.text)},{version:"v1"})).entities})}getTemporaryExchangeToken(){return P(this,null,function*(){return(yield this.client.get("/auth/exchange-token")).jwt})}exchangeTokenForAccessCookie(t){return P(this,null,function*(){return this.client.post("/apis/admin/session/jwt/",{jwt:t}).catch(n=>{throw H.warn(`Invalid token '${t}'`),n})})}authenticateWithKey(t,n){return P(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/api-key/",Le(n),{refreshTokenOn401:!1,headers:{apikey:t}})})}getTextSuggestions(o){return P(this,arguments,function*(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(yield this.client.post(`/api/conversations/${t}/recommend/${r}`,Le(n),{abortLatest:!0,version:"v1"})).map(i=>I(T({},oe(i)),{text:i.text||i.url||i.message,source:r,type:r})).filter((i,a,l)=>a===l.findIndex(u=>u.text===i.text))})}isLoggedIn(){return P(this,null,function*(){return yield this.preflight(),this.client.validateToken()})}getAutocompleteSuggestions(t,n){return P(this,null,function*(){return(yield this.client.post(`/api/conversations/${t}/autocomplete`,Le(n),{abortLatest:!0,version:"v1"})).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,s,i)=>s===i.findIndex(a=>a.text===o.text))})}getPinnedMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0,version:"v1"});return oe(n).map(r=>I(T({},r),{text:r.message,source:"sticky-messages",type:"pinned-message"}))})}getStyleSuggestions(t){return P(this,null,function*(){let n=yield this.client.post("/api/style-suggestions",Le(t),{abortLatest:!0,version:"v1"});return oe(n)})}search(t){return P(this,null,function*(){let n=yield this.client.post(`/api/profiles/${t.profile}/search`,Le(t),{version:"v2"});return oe(n)})}knowledgeAssist(s,i,a){return P(this,arguments,function*(t,n,r,o={}){let l=yield this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Le({question:t.question,doNotKnowAnswer:t.doNotKnowAnswer,customerInstruction:t.customerInstruction,chatHistory:n.map(u=>({question:u.question,answer:u.answer.answer})),agentId:o.agentId,conversationId:o.conversationId}),{version:"v2"});return oe(l)})}requestLoginByEmail(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return oe(n)})}requestPasswordlessToken(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return oe(t.token)})}getCsrfToken(){return P(this,null,function*(){let{token:t}=yield this.client.get("/apis/admin/session/csrf/");return t})}verifyLoginToken(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/login/",{token:t});return oe(n)})}evaluateRule(s,i,a){return P(this,arguments,function*(t,n,r,o={}){let l=new URLSearchParams;o.raiseForFailingConditions&&l.set("raise_for_failing_conditions","true");let u=yield this.client.post(`/api/conversations/${n}/rules/${t}/evaluate?${l.toString()}`,r,{version:"v2"});return u?oe(u.cues):[]})}getSummary(r){return P(this,arguments,function*(t,n={}){let o=yield this.client.post("/api/summary",{conversation:{messages:t.filter(s=>s.text&&s.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model},{version:"v1"});return oe(o)})}evaluateAssistant(t,n){return P(this,null,function*(){var a;let r=new URLSearchParams,{expectFormat:o="text"}=n||{};if(o.startsWith("json-schema:")){let l=o.replace("json-schema:","");r.append("expect_response_format","json-schema"),r.append("expect_response_format_schema",l)}else r.append("expect_response_format",o);n!=null&&n.externalConversationId&&r.append("external_conversation_id",n.externalConversationId);let s=n!=null&&n.threadId?`/api/v2/assistants/${t}/threads/${n==null?void 0:n.threadId}/evaluate?${r.toString()}`:`/api/v2/assistants/${t}/evaluate?${r.toString()}`,i=yield this.client.post(s,{input:(a=n==null?void 0:n.input)!=null?a:{},conversation:n==null?void 0:n.transcript});return oe(i.output)})}createAssistantThread(t){return P(this,null,function*(){let{assistantCode:n}=t,r=yield this.client.post(`/apis/admin/assistants/${n}/threads/`,{});return oe(r)})}postMessageToAssistantThread(t){return P(this,null,function*(){let{assistantCode:n,threadId:r,message:o}=t,s=yield this.client.post(`/apis/admin/assistants/${n}/threads/${r}/messages/`,{content:o,role:"user"});return oe(s)})}getRules(){return P(this,null,function*(){let t=new URLSearchParams,n=yield this.client.get(`/apis/admin/rule-engine/rules/?${t.toString()}`,{useCache:!0});return oe(n)})}translateMessages(t){return P(this,null,function*(){let n=yield this.client.post("/api/translate",Le(t),{version:"v2"});return oe(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),s=o.match(r0);if(!n||!s)return;let i=s[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[i];a&&n&&a!==n&&H.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[i]=n})}};es.exchangeTokenPromise=null;var Sr=es;var Ml=class{constructor(t,n){this.url=t;this.eventListeners={};this.options=T({timeout:25e3},n)}proxyEvent(t){this.eventSource.addEventListener(My(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,oe(o))}catch(o){H.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 sk;(t=>{let e;(s=>(s.Started="Started",s.Aborted="Aborted",s.Completed="Completed"))(e=t.AutoflowSessionState||(t.AutoflowSessionState={}))})(sk||(sk={}));var _l=class{constructor(t,n={}){this.apiUrl=t;this.streams={};this.logger=H;this.client=new vr(t,n)}getCustomMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/suggestions`);return oe(n.suggestions)})}sendCustomMessage(t,n){return P(this,null,function*(){let r=yield this.client.post(`/sessions/${t}/messages`,Le(n));return oe(r)})}answerCustomMessage(t,n){return P(this,null,function*(){yield this.client.post(`/sessions/${t}/answers`,Le(n))})}getAutoflows(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/autoflows`);return oe(n.autoflows)})}startAutoflowSession(t){return P(this,null,function*(){let n=yield this.client.post("/autoflow-sessions",Le(t));return oe(n)})}stopAutoflowSession(t){return P(this,null,function*(){yield this.client.delete(`/autoflow-sessions/${t}`)})}openStream(t){return this.streams[t]||(this.streams[t]=new Ml(`${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 ik={startTime:null,stopTime:null},ak=J({name:"handlingTime",initialState:ik,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(xe,()=>ik)}}),{handlingTimeStart:lk,handlingTimeStop:Of,handlingTimeReset:uk}=ak.actions,ck=ak.reducer;var dk=(e={})=>{let t=T({onAuthError:ni(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var Nf={list:{keywordMatches:[]},fetchState:"idle"};var ts=V("styleSuggestions/getAll",(n,r)=>P(void 0,[n,r],function*({text:e},t){var l;let{deepdeskAPI:o}=t.extra,s=t.getState(),{showStyleSuggestions:i}=s.settings,a=(l=s.conversation.current)==null?void 0:l.profileCode;if(!i)return Nf.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),a_=J({name:"styleSuggestions",initialState:Nf,reducers:{},extraReducers:e=>{e.addCase(ts.pending,t=>{t.fetchState="loading"}).addCase(ts.rejected,t=>{t.fetchState="error"}).addCase(ts.fulfilled,(t,n)=>{t.fetchState="done",Gr(t.list,n.payload)||(t.list=n.payload)}).addCase(Io,t=>{t.list=Nf.list}).addCase(xe,()=>Nf)}}),fk=a_.reducer;var pk=(e={})=>{let t,n=!0,r=T({getStyleSuggestions:ts,debounce:500},e);return o=>s=>i=>{var g;let a=o.getState().input.text,l=s(i),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((g=u.conversation.current)==null?void 0:g.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 l_(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var mk=(e={})=>{let t=T({getTextSuggestions:vn,getAutocompleteSuggestions:ml,debounce:200,check:Mn},e),n;return r=>o=>s=>{var v;let{input:i}=r.getState(),a=o(s),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(v=l.conversation.current)==null?void 0:v.id,d=s.type===Yd.toString();if(!f||!u&&!c)return a;let{input:g}=l;return l_(g,i)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=si(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var gk=ts.fulfilled.toString();function u_(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let s=e.keywordMatches.filter(l=>l.keyword===o),i=t.keywordMatches.filter(l=>l.keyword===o),a=i.length-s.length;a<=0||r.push(...i.slice(0,a))}),r}var hk=e=>t=>n=>r=>{var u;if(r.type!==gk){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let s=t.getState(),i=s.styleSuggestions.list,a=(u=s.conversation)==null?void 0:u.current;if(o===i)return;let l=u_(o,i);r.type===gk&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var c_=Tc({assistants:_E,auth:b1,autoflows:UC,conversation:N1,contentTypes:FE,customMessages:GC,passwordlessToken:XC,entities:cb,knowledgeAssistant:IE,handlingTime:ck,info:Z1,input:W1,settings:h1,profile:UE,search:sE,styleSuggestions:fk,ui:Xb,rules:nT,textSuggestions:Mb});function yk(e){return Ew({reducer:c_,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),dk(),mk({debounce:200}),pk({debounce:500}),hk(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var d_=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},f_=e=>t=>n=>r=>{var a,l,u,c,f,d,g;let o=t.getState(),s=Zg("inlineSuggestions")(o);switch(r.type){case ni.toString():{!r.payload&&e.emit("logout",void 0);break}case yn.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:(a=o.conversation.current)==null?void 0:a.id,data:{entities:r.payload}});break;case ct.toString():e.sendEvent(r.payload.name,{conversationId:((l=r.payload.options)==null?void 0:l.includeConversationData)&&((u=o.conversation.current)==null?void 0:u.id),data:r.payload.data});break;case Io.toString():e.logSendMessage(r.payload);break;case Yo.fulfilled.toString():r.isBroadcasted||e.broadcast(ih,r,!1),(c=r.payload.options)!=null&&c.shouldEmit&&e.emit("cues",r.payload.cues);break;case Id.toString():e.emit("call-to-action",{cue:r.payload});break;case tr.fulfilled.toString():r.isBroadcasted||e.broadcast(ah,r,!1);break;default:break}let i=n(r);switch(r.type){case Io.toString():e.handleAfterSendMessage(r.payload);break;case hl.toString():e.onUpdateShowTabHint(r.payload);break;case Of.toString():e.logHandlingTime();break;case"analytics/logEvent/fulfilled":{e.emit("event",r.meta.arg);break}case id.toString():{let{start:y,end:v}=o.input.selection;e.emit("replace",I(T({},r.payload),{replace:r.payload.replace==="selection"?{start:y,end:v}:{start:0,end:v}}));break}case dn.toString():{let{start:y,end:v}=o.input.selection;e.emit("select-suggestion",I(T({type:d_(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:y,end:v}:{start:0,end:v}})),s&&t.dispatch(Qr([]));break}case ad.toString():e.emit("select-image",r.payload),e.sendEvent("Image attached",{conversationId:(f=o.conversation.current)==null?void 0:f.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case Qr.toString():{s&&r.payload.length>0&&t.dispatch(ld(0));break}case li.fulfilled.toString():{e.sendEvent("conversation summarized",{conversationId:(d=o.conversation.current)==null?void 0:d.id,data:{summary:r.payload,assistant:(g=t.getState().profile.data)==null?void 0:g.summarizerAssistantNew}});break}default:break}return i},vk=f_;function Hy(e){return e.toISOString().replace("T"," ").replace("Z","")}function Sk(e,t){var s,i,a,l;let n=(s=e.conversation.current)==null?void 0:s.id;if(!n)return H.warn("No conversationId for handling time metrics"),null;let{startTime:r,stopTime:o}=e.handlingTime;return!r||!o?(H.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:n,clientVersion:t.version,agentId:(i=e.info.agentInfo)==null?void 0:i.agentId,agentName:(a=e.info.agentInfo)==null?void 0:a.agentName,agentEmail:(l=e.info.agentInfo)==null?void 0:l.agentEmail,timeStart:Hy(r),timeStop:Hy(o)}}function xk(e,t,n){var N,_,Q,K;let r=(N=t.conversation.current)==null?void 0:N.id;if(!r)return H.warn("No conversationId for send message metrics"),null;let{text:o,metrics:{numCharsTyped:s,numCharsPasted:i,numCharsCut:a,numCharsDeleted:l,numPaste:u,agentStartedTypingTimestamp:c,externalTimeTotalSeconds:f,pastes:d,cuts:g,deletions:y,textSuggestions:v,offeredTextSuggestions:p}}=t[e],m=o.length,S=v.reduce((W,{text:de,searchTerm:Ye})=>W+de.length-(Ye?Ye.length:0),0),w=c!=null?c:Date.now(),k=(Date.now()-w)/1e3+(f||0),b=s/k,R=v.reduce((W,{searchTerm:de})=>W+(de?de.length:0),0);return{conversationId:r,source:"agent",text:o,clientVersion:n.version,pastes:d,cuts:g,deletions:y,lenTextTyped:s+R,lenTextTotal:m,lenTextAssisted:S,lenTextPasted:i,lenTextCut:a,lenTextDeleted:l,timeTotalSeconds:k,charsPerSecond:b,numPastes:u,textSuggestionsV2:v,suggestionsCounters:[{source:"gpt",countOffered:p.filter(W=>W.source==="gpt").length}],agentId:(_=t.info.agentInfo)==null?void 0:_.agentId,agentName:(Q=t.info.agentInfo)==null?void 0:Q.agentName,agentEmail:(K=t.info.agentInfo)==null?void 0:K.agentEmail}}function Uy(e,t){var s;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return Uy(r,t);let o=(s=e.ownerDocument.defaultView)==null?void 0:s.frameElement;return o?Uy(o,t):null}function wk(e,t){return Uy(e,t)}function Ek(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function p_(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Mf(e){return p_(e)&&(Go(e)||of(e))}var Ck,Fn=new Map,m_=["bottom","height","left","right","top","width"],bk=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:m_.some(n=>e[n]!==t[n]);function Tk(e){var n,r,o;if(e.ownerDocument===document)return[];let t=(o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement)!=null?o:null;return t?[t,...Tk(t)]:[]}function kk(e,t){return!e||!t?null:I(T({},e),{top:e.top+t.top,left:e.left+t.left})}var _f=!1,Pk=()=>{_f=!0;let e=[];if(Fn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),Fn.delete(n);return}let r=n.getBoundingClientRect();bk(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(kk,t.rect):t.rect;bk(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),Fn.size===0){_f=!1;return}Ck=window.requestAnimationFrame(Pk)};function zy(e,t){let n=Tk(e),r=[],o=n.map((s,i)=>zy(s,a=>{r[i]=a;let l=Fn.get(e);if(!l)return;let u=r.reduce(kk,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(s=!0){if(o.forEach(i=>i.observe(!1)),Fn.has(e)){let i=Fn.get(e);i.callbacks.push(t),i.rect&&t(i.rect)}else Fn.set(e,{rect:void 0,callbacks:[t],parentRects:r});s&&!_f&&Pk()},unobserve(){o.forEach(i=>i.unobserve());let s=Fn.get(e);if(s){let i=s.callbacks.indexOf(t);i>=0&&s.callbacks.splice(i,1),s.callbacks.length||Fn.delete(e),Fn.size||(cancelAnimationFrame(Ck),_f=!1)}}}}var Rk,Hn=new Map,Ak=()=>{Hn.forEach((e,t)=>{if(!t.isConnected){Hn.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(s=>s(e.visible)))}),Hn.size!==0&&(Rk=window.requestAnimationFrame(Ak))};function Ik(e,t){return{observe(){let n=Hn.size===0;Hn.has(e)?Hn.get(e).callbacks.push(t):Hn.set(e,{visible:void 0,callbacks:[t]}),n&&Ak()},unobserve(){let n=Hn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Hn.delete(e),Hn.size||cancelAnimationFrame(Rk)}}}}var jy=["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 By(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function Ri(e){return parseFloat(e)}function Df(e){return Math.round(e*1e6)}function Lk(e){return e/1e6}function Vy(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=Ri(e.width),s=Ri(e.borderLeftWidth),i=Ri(e.borderRightWidth),a=Ri(e.paddingRight),l=Lk(Df(o)-Df(s)-Df(i)),u=Lk(Df(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function Dl(e,t={}){var c,f;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=(c=t.position)!=null?c:"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",Wo(n);let r=window.getComputedStyle(e),o=!0,s=()=>{n.scrollTop=e.scrollTop};By(r,n,jy),Vy(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",s));let i=Ik(e,()=>{By(r,n,jy),Vy(r,e,n),s(),setTimeout(s,0)}),a,l=!0,u=zy(e,d=>{if(d===null){t.onRemove&&t.onRemove(),n.remove();return}if(!l&&t.onMoveStart&&(Promise.resolve().then(()=>t.onMoveStart()),l=!0),clearTimeout(a),a=setTimeout(()=>{t.onMoveEnd&&t.onMoveEnd(),l=!1},200),d.height===0&&d.width===0){if(o===!0)return;t.onHide&&t.onHide(),n.style.display="none",o=!0;return}if(By(r,n,jy),Vy(r,e,n),s(),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let g=t.closestScrollElement.getBoundingClientRect(),y=window.getComputedStyle(t.closestScrollElement),v=Ri(y.borderTopWidth),p=Ri(y.borderBottomWidth),m=g.top+v-d.top,h=d.top+d.height+-(g.top+g.height-p);n.style.clipPath=`inset(${m}px 0px ${h}px 0px)`}o&&(n.style.display="block",t.onShow&&t.onShow(),o=!1)});return t.appendTo?t.appendTo.appendChild(n):(f=e.parentElement)==null||f.appendChild(n),u.observe(),i.observe(),[n,()=>{e.removeEventListener("scroll",s),u.unobserve(),i.unobserve()}]}var Ok=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch(r){return t}}catch(n){return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch(r){H.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function g_(e){return e.offsetParent!==null}function Nk(e){if(!g_(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 Ff(e,t,n=100){let r=Nk(e);t({isVisible:r});let o=setInterval(()=>{let s=Nk(e);s!==r&&(r=s,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Fe=x(C());var Mk=Ok("showTabHint",!0),Ai=class Ai{constructor({deepdeskUrl:t,brokerUrl:n,version:r=Ai.version||"unknown",locale:o="en-US",token:s,fetch:i,productName:a,createCustomChannel:l}){this.inputMediator=null;this.eventListeners={};this.unmountHandlers=[];this.widgetRoot=null;this.dynamicThunkObject={};this.isMounted=!1;this.shouldRender=!0;this.loadProfileConfigPromise=null;let u=t.replace(/\/api$/,"");this.deepdeskApi=new Sr(u,{token:s,fetch:i}),this.version=r,this.instanceId=Ai.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[vk({broadcast:(f,d,g)=>{this.broadcastEvents.send(f,d,g)},emit:(f,d)=>this.emit(f,d),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>Mk.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new _l(n)}),this.store=yk(c),this.broadcastEvents=new rk({debug:!0,deepdeskUrl:u,eventMap:iE(this.store),createCustomChannel:l}),this.store.dispatch(hl(Mk.value())),this.store.dispatch(ed({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){var t;return(t=this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex])!=null?t: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?(H.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(H.warn("Profile has not been loaded (yet)"),!0):(H.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(ni(null)),this.store.dispatch(Jn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();ut(r)&&y1(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return P(this,null,function*(){return(yield this.store.dispatch(Jn())).payload})}isConversationSupported(t,n){return P(this,null,function*(){return(yield this.store.dispatch(th({sessionId:t,options:n}))).payload})}createConversation(t){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(yield this.store.dispatch(nd(t))).payload})}getConversationBySessionId(t,n){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(yield this.store.dispatch(rd({sessionId:t,options:n}))).payload})}upsertConversation(t){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(yield this.store.dispatch(nh(t))).payload})}postMessages(t){return P(this,null,function*(){return(yield this.store.dispatch(sd(t))).payload})}updateConversation(t){return P(this,null,function*(){return(yield this.store.dispatch(od(t))).payload})}resetConversation(){this.store.dispatch(xe()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}configure(t){this.store.dispatch(ed(t))}setVisitorInfo(t){this.store.dispatch(Y1(t))}setCustomData(t){this.store.dispatch(Q1(t))}setAgentInfo(t,n){return P(this,null,function*(){yield this.store.dispatch(Wa(T(T({},t),n)))})}setAgentSettings(t){return P(this,null,function*(){yield this.store.dispatch(oh(t))})}getAgentSettings(){return P(this,null,function*(){return(yield this.store.dispatch(sh())).payload})}refresh(){return P(this,null,function*(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.store.dispatch(ud({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()}));let t=[];return this.store.dispatch(Yd()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}notifyExternalSuggestion(t){this.store.dispatch(dn(t))}evaluateRule(o){return P(this,arguments,function*(t,n={},r=ZC){return(yield this.store.dispatch(Yo({label:t,params:n,options:r}))).payload.cues})}evaluateAssistant(t,n){return P(this,null,function*(){let c=n||{},{input:r={},transcript:o,showCuesInWidget:s=!0,includeTags:i,expectFormat:a}=c,l=ee(c,["input","transcript","showCuesInWidget","includeTags","expectFormat"]);Object.assign(r,l);let u=yield this.store.dispatch(tr({assistantCode:t,expectFormat:a||"json-schema:cues",transcript:o,includeTags:i,input:r,skipState:!s}));if(u.error)throw new Error(u.error.message);return u.payload})}evaluateConversationAssistant(t,n){return P(this,null,function*(){yield this.loadProfileConfig();let r={accepted:"conversationAcceptedAssistant","new-message":"conversationNewMessageAssistant",ended:"conversationEndedAssistant"},o=this.state.profile.data[r[t]];if(!o){H.warn(`No assistant set in profile for conversation event "${t}"`);return}yield this.evaluateAssistant(o,T({transcript:"stored-transcript",includeTags:!0},n))})}getSummary(){return P(this,null,function*(){var n;if(!this.hasConversation())return H.warn("No conversation to create summary for."),null;(n=this.state.profile.data)!=null&&n.summarizerAssistantNew||H.warn("No profile loaded yet, or no summarizer assistant set in profile");let t=yield this.store.dispatch(li({}));if(t.error)throw new Error(t.error.message);return t.payload})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:s,selection:i}=this.state.input,{inlineSuggestions:a,showTextSuggestions:l}=this.state.settings,u=a?"below":"above",c=o.length>0;if(!Mn(this.state)||(this.store.dispatch(H1(rh(t))),t.key!=="Tab"&&!l))return;let f=()=>{n||!c||i&&(t.shiftKey||(this.store.dispatch(j1()),t.preventDefault()))},d=()=>{n||!c||a&&s<=0||i&&(t.shiftKey||(this.store.dispatch(B1()),t.preventDefault()))};switch(t.key){case"ArrowUp":u==="below"?d():f();break;case"ArrowDown":{u==="below"?f():d();break}case"Escape":{n||(this.store.dispatch(ld(-1)),this.store.dispatch(no({collapse:!0})),this.store.dispatch(Yb(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let g=ii(this.state);if(!g)return;this.store.dispatch(hl(!1)),this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(this.state.settings.inlineSuggestions||this.state.input.selectedSuggestionIndex===-1)return;let g=ii(this.state);if(!g)return;this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(this.state.settings.inlineSuggestions||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let g=ii(this.state);if(!g)return;this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"enter"},replace:"until-selection-end"})),t.preventDefault();break}default:}n&&r&&this.store.dispatch(no({collapse:!1}))}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(Qr([]))}handlingTimeStart(){this.state.handlingTime.startTime||(H.info("Start handling time"),this.store.dispatch(lk()))}handlingTimeStop(){this.state.handlingTime.startTime&&(H.info("Stop handling time"),this.store.dispatch(Of()))}logSendMessage(t){let n=xk("input",this.state,{version:this.version});n&&(t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n))}logHandlingTime(){let t=Sk(this.state,{version:this.version});t&&(this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(uk()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Io((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(K1()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(s){H.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),H.error(s)}})}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}setPlatformVariables(t){this.store.dispatch(X1(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[s,i]=Dl(n,r);return s.setAttribute("translate","no"),s.dataset.testid=t,o&&s.classList.add(o),this.unmountHandlers.push(()=>{(0,sn.unmountComponentAtNode)(s),i(),s.remove()}),s}createInlineContainer(t,n){var a;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.height="0px",r.style.width="0px";let o=document.createElement("div");o.style.display="none",o.style.position="absolute",o.style.height="0px",o.style.width="0px",o.style.backgroundColor="red",r.appendChild(o);let s=(a=t.ownerDocument.defaultView)==null?void 0:a.frameElement,i=s?s.ownerDocument.defaultView:null;if(s&&(i===window||(i==null?void 0:i.parent)===window)){let[l,u]=Dl(s,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{(0,sn.unmountComponentAtNode)(o),u()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return Wo(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,sn.unmountComponentAtNode)(o),o.remove()}),o}storeMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=JSON.stringify({text:this.state.input.text,metrics:this.state.input.metrics});window.sessionStorage.setItem(t,n),H.info(`Stored analytics for ${this.conversationId()}`)}catch(t){}}restoreMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=window.sessionStorage.getItem(t);if(!n)return;let r=JSON.parse(n);r.text.trim()===this.state.input.text.trim()?(H.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(V1(r.metrics))):H.warn(`Metrics mismatch, disregarding stored metrics for ${this.conversationId()}`),window.sessionStorage.removeItem(t)}catch(t){}}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!Mf(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:s,showTextSuggestions:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:g,inputMediator:y,closestScrollSelector:v,appendOverlayTo:p,inlineSuggestions:m,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:i,insertLink:g,isEmbedded:f,inlineSuggestions:m,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),Wo(t),this.inputMediator=y||(Go(t)?new Jo(t):new Zo(t)),this.inputMediator.on("change",({plainText:k,rawHTML:b})=>{this.store.dispatch(ud({text:k,html:b}))}),this.inputMediator.on("keyup",k=>{this.store.dispatch(U1(rh(k)))}),this.inputMediator.on("keydown",k=>{this.handleKeyDown(k)}),this.inputMediator.on("paste",({pastedText:k,selectionText:b})=>{this.store.dispatch(z1({text:k,selectionText:b}))}),this.inputMediator.on("cut",({selectionText:k})=>{this.store.dispatch(F1(k))});let S;this.inputMediator.on("selection",k=>{clearTimeout(S),k===null?S=setTimeout(()=>{k!==null&&this.store.dispatch(cd(k))},500):this.store.dispatch(cd(k))}),this.inputMediator.on("disabled",()=>{var k;(k=this.inputMediator)==null||k.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(Zd(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(Zd(!0))});let w=v&&wk(t,v)||void 0;if(m){let{customStyles:k,appendOverlayTo:b}=n,R=this.createInlineContainer(t,"deepdesk-caret");(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(rC,{})})}),R),this.inputMediator.on("caretposition",_=>{_?(R.style.display="block",R.style.top=`${_.top}px`,R.style.left=`${_.left}px`):R.style.display="none"});let N=this.overlayContainerFactory("floating-menu",w||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:b},k==null?void 0:k.floatingMenuRootNode);(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)($b,{onLogIn:()=>this.loginViaPopup().catch(_=>H.warn(_.message))})})}),N)}else{let k=this.overlayContainerFactory("deepdesk-tab-completion",w||t,{appendTo:p,closestScrollElement:w,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),b=this.overlayContainerFactory("deepdesk-suggestions-overlay",w||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(NC,{inputElement:t})})}),k),(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(fC,{onLogIn:()=>this.loginViaPopup().catch(R=>H.warn(R.message))})})}),b)}(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(jb,{})})}),this.createContainer("deepdesk-overlays")),this.store.dispatch(ud({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()})),this.store.dispatch(cd(this.inputMediator.getSelection())),this.store.dispatch(Zd(this.inputMediator.isFocused)),this.unmountHandlers.push(()=>{this.state.input.text!==""&&this.storeMetrics()}),this.whenConversationLoaded(()=>{var k;this.restoreMetrics(),this.refresh(),this.broadcastEvents.setSessionId((k=this.state.conversation.current)==null?void 0:k.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&&H.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:s}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:s}),(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(XT,{onLogIn:()=>this.loginViaPopup().catch(i=>H.warn(i.message))})})}),t),this.whenConversationLoaded(()=>{var i;this.broadcastEvents.setSessionId((i=this.state.conversation.current)==null?void 0:i.sessionId)})}unmountWidget(){this.widgetRoot&&(0,sn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Ff(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){Ek(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(()=>P(this,null,function*(){yield this.store.dispatch(nl());let t=nr(this.state);t&&(yield this.store.dispatch(el()),this.store.dispatch(ed({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:!!t.summarizerAssistantNew||t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistantNew||!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))})),this.loadProfileConfigPromise)}loginViaPopup(t){return P(this,null,function*(){return new Promise((n,r)=>{let o=new MessageChannel,s=o.port1,i=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${i}/platform/sso/`);a.searchParams.append("redirect","/sdk/popup/close.html");let l=!1,u=()=>{c&&!c.closed&&c.close(),window.removeEventListener("message",f),clearInterval(d)};s.onmessage=g=>P(this,null,function*(){var y,v;if((y=g.data)!=null&&y.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((v=g.data)==null?void 0:v.jwt),yield this.isLoggedIn(),this.broadcastEvents.send(qa),l=!0,o.port1.close(),n()}catch(p){console.error(p),r(p)}finally{l=!0,u()}});let c=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");c===null&&r(new Error("Popup blocked by browser"));let f=g=>P(this,null,function*(){var y;if(g.origin===a.origin)switch((y=g.data)==null?void 0:y.type){case"deepdesk-popup-loaded":{try{let v=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(v,a.origin,[o.port2])}catch(v){H.error("Error posting message to popup",v),r(v)}break}case"deepdesk-popup-error":{u(),g.data.message==="Timeout"&&H.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(g.data.message));break}}});window.addEventListener("message",f);let d=setInterval(()=>{c&&!c.closed||(u(),l||r(new Error("Popup closed by user")))},200);this.unmountHandlers.push(u)})})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}checkForTrialMode(t){return P(this,null,function*(){try{let{account:n}=yield this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(H.info("Trial is active"),!(yield this.deepdeskApi.checkUserExists(t)))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;H.info(r),this.shouldRender=!1}})}refreshWidgetSuggestions(){return P(this,null,function*(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Od(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(yn()):su.includes(r)||this.store.dispatch(vn(r))})}catch(r){this.handleError(r)}})}};Ai.version="14.2.1-beta.7",Ai.count=0;var Fl=Ai;function h_(e){return P(this,null,function*(){var o,s,i;let n=yield((o=e.fetch)!=null?o:window.fetch)(e.url),r=yield n.blob();return new File([r],e.name,{type:(i=(s=e.mimeType)!=null?s:n.headers.get("Content-Type"))!=null?i:"image/jpeg"})})}function _k(e,t){return P(this,null,function*(){let n=yield h_(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}})}function Dk(e,t,n){return P(this,null,function*(){yield new Sr(e).authenticateWithKey(t,n)})}function Fk(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function Hk(r,o){return P(this,arguments,function*(e,t,n={}){var f,d;let{value:s}=e,{start:i,end:a}=(f=n.replace)!=null?f:{start:0,end:s.length},l=`${s.slice(0,i)}${t}${s.slice(a)}`,u=(d=n.selectionAfter)!=null?d:{start:i+t.length,end:i+t.length},c=()=>{if(n.setValue)return n.setValue(l);e.value=l};return Promise.resolve(c()).then(()=>{e.selectionStart=u.start,e.selectionEnd=u.end,e.blur(),e.focus()})})}function Uk(r,o){return P(this,arguments,function*(e,t,n={}){let s=n.replace?io(e,n.replace.start,n.replace.end):Ti(e),i,a=()=>{if(n.setRange)return n.setRange(s.cloneRange());s.deleteContents(),i=document.createElement("span"),s.insertNode(i),n.insertBRs!==!1?t.split(`
28
- `).reverse().forEach((l,u)=>{u>0&&s.insertNode(document.createElement("br")),s.insertNode(document.createTextNode(l))}):s.insertNode(document.createTextNode(t))};return Promise.resolve(a()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let l=n.selectionAfter?io(e,n.selectionAfter.start,n.selectionAfter.end):(s.collapse(!1),s),u=window.getSelection();u==null||u.removeAllRanges(),u==null||u.addRange(l)}if(!i)return;i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}function y_(e){let t=document.createElement("template");return t.innerHTML=e.replace(/(\[([^\]]+)])\(([^)]+)\)/g,'<a href="$3" target="_blank" rel="noopener noreferrer">$2</a>'),t.content}function v_(e){let t=document.createDocumentFragment();return e.split(`
29
- `).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},s=0;for(;o=n.slice(s).match(/(\[([^\]]+)])\(([^)]+)\)/);){let i=document.createElement("a");i.href=o[3],i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"),i.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(s,s+o.index))),t.appendChild(i),s=s+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(s)))}),t}function zk(e,t){let n=e.parentElement;if(!n){console.warn("No insert point found");return}let{display:r}=window.getComputedStyle(n);r.includes("block")||r==="table-cell"?n==null||n.insertBefore(t,e.nextSibling):zk(n,t)}function jk(o,s){return P(this,arguments,function*(e,t,{isBlock:n,isHTML:r}={}){let i;e.dispatchEvent(new InputEvent("beforeinput",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0}));let a=()=>{var d;let l=(d=e.ownerDocument.defaultView)!=null?d:window,u=l.getSelection();if((!u||u.rangeCount===0)&&(e.focus(),u=l.getSelection()),!u||u.rangeCount===0)return;let c=u.getRangeAt(0);if(!c)return;i=document.createElement("span"),c.insertNode(i);let f=r?y_(t):v_(t);n?zk(c.startContainer,f):(c.insertNode(f),c.collapse(!1))};return Promise.resolve(a()).then(()=>{if(e.dispatchEvent(new InputEvent("input",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0})),e.focus(),!!i)try{i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}return nP(S_);})();
27
+ `);let y=d?r:0,v=g?Math.min(s,c.childNodes.length):c.childNodes.length;for(let p=y;p<v&&(u(c.childNodes[p]),a!==2);p++);break}default:break}g&&(a=2)}return u(e),l}var JT=(i=>(i.CUT="Cut",i.BACKSPACE="Backspace",i.DELETE="Delete",i.ERASEEOF="EraseEof",i.UNDO="Undo",i.CLEAR="Clear",i))(JT||{}),yr=class{constructor(t){this.element=t;this.isFocused=!1;this.isActive=!0;this.isDisposed=!1;this.eventListeners={};this.disposeHandlers=[];this.cachedText="";this.cachedCaretPosition=null;this.cachedSelection={start:0,end:0};this.cachedHTML="";this.isSubmitting=!1;this.isPossibleClearInputAction=!1;this.cachedText=this.getText(),this.cachedHTML=this.getHTML(),this.cachedSelection=this.getSelection(),this.listen()}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)}handleInteraction(){let t=this.getText(),n=this.getHTML(),r=this.getSelection(),o=this.cachedCaretPosition===null;if(!this.isActive||(t===""&&this.cachedText!==""&&!this.isPossibleClearInputAction&&this.emit("submit"),t!==this.cachedText?(this.cachedText=t,this.cachedHTML=n,o=!0,this.emit("change",{plainText:t,rawHTML:n})):n!==null&&n!==this.cachedHTML&&(this.cachedHTML=n,o=!0,this.emit("change",{plainText:t,rawHTML:n})),(r.start!==this.cachedSelection.start||r.end!==this.cachedSelection.end)&&(this.cachedSelection=r,o=!0,this.emit("selection",r)),!o))return;let s=this.getCaretPosition();Gr(s,this.cachedCaretPosition)||(this.cachedCaretPosition=s,this.emit("caretposition",s))}handleClick(){this.handleInteraction()}handleFocus(){let t=!this.isFocused;this.isFocused=!0,t&&this.emit("focus"),this.handleInteraction()}handleBlur(){this.isPossibleClearInputAction=!1;let t=this.isFocused;this.isFocused=!1,t&&this.emit("blur")}handleKeyDown(t){let{key:n,ctrlKey:r,metaKey:o}=t;this.isPossibleClearInputAction=Object.values(JT).includes(n)||n.toLowerCase()==="z"&&(r||o),this.emit("keydown",t)}handleKeyUp(t){this.handleInteraction(),this.emit("keyup",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.handleInteraction()),this.addEventListener("change",()=>this.handleInteraction()),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.handleInteraction()),document.activeElement===this.element&&(this.isFocused=!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.handleInteraction()}deactivate(){this.isActive=!1}dispose(){this.disposeHandlers.forEach(t=>t()),this.eventListeners={},this.isDisposed=!0}};function ek(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Zo=class extends yr{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),Nl(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){var i;let n=this.getRootNode();if(n.activeElement!==this.element)return null;let r="getSelection"in n?n.getSelection():window.getSelection();if(!r)return null;let o="getComposedRanges"in r&&n instanceof ShadowRoot?(i=r.getComposedRanges(n))==null?void 0:i[0]:r.rangeCount>0?r.getRangeAt(0):null;if(!o)return null;let s=this.element.ownerDocument.createRange();return s.setStart(o==null?void 0:o.startContainer,o==null?void 0:o.startOffset),s.setEnd(o==null?void 0:o.endContainer,o==null?void 0:o.endOffset),!s||!this.element.contains(s.startContainer)||!this.element.contains(s.endContainer)?null:s}getCaretPosition(){let n=this.getRange();if(!n||!n.collapsed||!("getBoundingClientRect"in n))return null;let r=n.getBoundingClientRect();return!ek(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!ek(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return Ol(this.element,n);let r=this.lastKnownSelection;if(r&&ZT(this.element,r.start,r.end))return r;let o=Ti(this.element);return o.collapse(!1),Ol(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return Nl(this.element,io(this.element,n,r))}listen(){super.listen();let n=new MutationObserver(s=>{var i,a;s.length===2&&s[0].addedNodes.length===1&&((i=s[0].addedNodes[0])==null?void 0:i.textContent)==="\u2060"&&((a=s[1].removedNodes[0])==null?void 0:a.textContent)==="\u2060"||setTimeout(()=>{this.handleInteraction()},0)});n.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.disposeHandlers.push(()=>n.disconnect());let r=this.element.isContentEditable,o=new MutationObserver(()=>{this.element.isContentEditable!==r&&(r=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>o.disconnect())}};var n_=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function tk(e,t){let n="mozInnerScreenX"in window,r=document.createElement("div");r.id="input-textarea-caret-position-mirror-div";let o=r.style,s=window.getComputedStyle(e),i=e.ownerDocument.body;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.visibility="hidden",n_.forEach(function(c){o[c]=s[c]}),n?e.scrollHeight>parseInt(s.height)&&(o.overflowY="scroll"):o.overflow="hidden",r.textContent=e.value.substring(0,t);let a=document.createElement("span");a.textContent=e.value.substring(t)||".",r.appendChild(a),i.appendChild(r);let l=e.getBoundingClientRect(),u={top:l.top-e.scrollTop+a.offsetTop+parseInt(s.borderTopWidth)+a.offsetHeight,left:l.left-e.scrollLeft+a.offsetLeft+parseInt(s.borderLeftWidth)};return i.removeChild(r),u}var Jo=class extends yr{constructor(){super(...arguments);this.lastKnownSelection=null}getText(){return this.element.value}getHTML(){return null}getSelection(){let{selectionStart:n,selectionEnd:r}=this.element;return{start:n,end:r}}getSelectedText(){let n=this.getSelection();return n?this.getText().slice(n.start,n.end):""}getCaretPosition(){return tk(this.element,this.element.selectionEnd)}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var s;return(s=n==null?void 0:n.get)==null?void 0:s.call(this.element)},set:s=>{var i;(i=n==null?void 0:n.set)==null||i.call(this.element,s),this.handleInteraction()}}),this.addEventListener("scroll",()=>{this.emit("caretposition",this.getCaretPosition())});let r=this.element.disabled,o=new MutationObserver(()=>{this.element.disabled!==r&&(r=this.element.disabled,this.emit(r?"disabled":"enabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>o.disconnect())}};function nk(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let s=document.createElement("iframe"),i=new URL(t);return Object.entries(n).forEach(([a,l])=>{i.searchParams.append(a,l)}),s.style.position="absolute",s.style.left="-999em",s.style.width="0px",s.style.height="0px",s.tabIndex=-1,s.id=r,s.title=`iframe-${e}`,s.src=i.toString(),window.document.body.appendChild(s),s}function r_(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch(t){return e}}var Ly=class{constructor(t){this.name=t;this.disposeHandlers=[];this.broadcastChannel=new BroadcastChannel(t)}onMessage(t){this.broadcastChannel.addEventListener("message",t),this.disposeHandlers.push(()=>{this.broadcastChannel.removeEventListener("message",t)})}postMessage(t){this.broadcastChannel.postMessage(JSON.stringify(t))}close(){this.disposeHandlers.forEach(t=>t()),this.broadcastChannel.close()}},Oy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=nk(t,`${this.targetOrigin}/sdk/proxy/proxy.html`,{channel:this.name,host:window.location.origin,debug:"1"}),document.body.appendChild(this.iframe)}onMessage(t){window.addEventListener("message",t),this.disposeHandlers.push(()=>{window.removeEventListener("message",t)})}postMessage(t){var n;(n=this.iframe.contentWindow)==null||n.postMessage(JSON.stringify(t),this.targetOrigin)}close(){var t;this.disposeHandlers.forEach(n=>n()),(t=this.iframe)==null||t.remove()}},Ny=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.sessionId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setSessionId(t){this.sessionId!==t&&(this.cleanup(),H.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 Oy(t,this.deepdeskUrl,{debug:!0}):new Ly(t),r=o=>{var i,a;if(o.origin!==this.deepdeskUrl)return;let s=r_(o.data);typeof s!="object"||s.type!=="event"||s.channel!==t||(H.info("Received broadcast event",this.sessionId,o),(a=(i=this.eventMap)[s.name])==null||a.call(i,s.payload))};return n.onMessage(r),n}send(t,n,r){var i,a;H.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(i=this.eventMap)[t])==null||a.call(i,n));let s=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;s==null||s.postMessage(I(T({},o),{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)}},rk=Ny;function o_(e){return e.replace(/(_\w)/g,t=>t[1].toUpperCase())}function oe(e){return Array.isArray(e)?e.map(oe):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(T({},t),{[o_(n)]:oe(e[n])}),{}):e}function My(e){return e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function Le(e){return Array.isArray(e)?e.map(Le):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(T({},t),{[My(n)]:Le(e[n])}),{}):e}var ki=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var _y=e=>new Promise(t=>{setTimeout(t,e)});var Pi=class extends ki{constructor(){super(...arguments);this.name="ClientError"}},Fy=class extends ki{constructor(){super(...arguments);this.name="ServerError"}},Dy=new Map;function s_(e){return P(this,null,function*(){if(e.status===204)return e.text().catch(()=>{}),null;let t=e.headers.get("content-type");if(t&&t.includes("application/json"))return e.json();let n=yield e.text();return n===""?null:(H.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var ao=class ao{constructor(t="",n={}){this.baseUrl=t;this.options=n;this.latestRequestByUrl={};this.fetch=window.fetch.bind(window);n.fetch&&(this.fetch=n.fetch)}patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let s={isAborted:!1,reject:o},i=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",b=n,{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:g=!0,retryOnError:y=R=>R instanceof TypeError,retryOnResponse:v=R=>R.status>=500,version:p=null}=b,m=ee(b,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(u)if(l){if(Dy.has(i)){r(Dy.get(i));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h=I(T({credentials:"include"},m),{headers:T({Accept:"application/json","Content-Type":"application/json"},m.headers)});!l&&this.csrfToken&&(h.headers=I(T({},h.headers),{"X-CSRFToken":this.csrfToken})),typeof p=="string"&&(h.headers=I(T({},h.headers),{"X-Deepdesk-API-Version":p}));let S=f,w=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[i]&&c&&(this.latestRequestByUrl[i].isAborted=!0,this.latestRequestByUrl[i].reject(new Error("Aborted"))),this.latestRequestByUrl[i]=s;let k=()=>P(this,null,function*(){return S--,a(i,h).then(R=>P(this,null,function*(){return v(R)&&!s.isAborted&&S>0?(yield _y(d),k()):R.status===401&&g===!0&&w===!1?(w=!0,yield this.refreshToken(),k()):R})).catch(R=>P(this,null,function*(){if(y(R)&&!s.isAborted&&S>0)return yield _y(d),k();throw R}))});k().then(R=>P(this,null,function*(){let N=yield s_(R);if(delete this.latestRequestByUrl[i],R.status>=500){o(new Fy("Server Error",N));return}else if(R.status===401){o(new Pi("Unauthorized",N));return}else if(R.status===403){o(new Pi("Forbidden",N));return}else if(R.status===404){o(new Pi("Not Found",N));return}else if(R.status>=400){o(new Pi("Bad Request",N));return}u&&Dy.set(i,N),r(N)})).catch(R=>{o(R)})})}validateToken(){return P(this,null,function*(){let{has_valid_access_token:t}=yield this.get("/auth/validate");if(!t)try{yield this.refreshToken()}catch(r){return!1}let{is_logged_in:n}=yield this.get("/apis/admin/session/validate/");return!!n})}refreshToken(){return ao.refreshingToken||(ao.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{ao.refreshingToken=null},1e3*60)})),ao.refreshingToken}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,T({method:"POST",body:JSON.stringify(n)},r))}patch(t,n,r){return this.request(t,T({method:"PATCH",body:JSON.stringify(n)},r))}put(t,n,r){return this.request(t,T({method:"PUT",body:JSON.stringify(n)},r))}delete(t,n){return this.request(t,T({method:"DELETE"},n))}};ao.refreshingToken=null;var vr=ao;var ok;(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||(t.EventType={}))})(ok||(ok={}));function Lf(e){return I(T({},oe(e)),{tags:e.tags})}var es=class es{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new vr(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,s)=>P(this,null,function*(){let i=yield r(o,s);return this.handleDeepdeskVersionHeaders(i),i}))}preflight(){return P(this,null,function*(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=yield this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(es.exchangeTokenPromise||(es.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),es.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return P(this,null,function*(){yield this.preflight(),H.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=yield this.client.post("/api/conversations",I(T({},Le(t)),{tags:t.tags}),{version:"v2"});return Lf(n)})}getMe(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/me/");return oe(t)})}postIdentity(t){return P(this,null,function*(){yield this.client.post("/apis/admin/session/me/identities/",Le(t))})}patchMe(t){return P(this,null,function*(){let n=yield this.client.patch("/apis/admin/session/me/",Le(t));return oe(n)})}getProfile(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return oe(n)})}getKnowledgeAssistant(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return oe(n)})}getContentTypes(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return oe(t)})}getAccount(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return oe(t)})}getPlatformConfig(t){return P(this,null,function*(){let n=t!==void 0?`/platform/config/${t}/`:"/platform/config/",{config:r}=yield this.client.get(n,{useCache:!0});return oe(r)})}checkUserExists(t){return P(this,null,function*(){let{exists:n}=yield this.client.get(`/apis/admin/users/exists?external_id=${t}`,{version:"v1"});return n})}getConversationBySessionId(r){return P(this,arguments,function*(t,n={}){yield this.preflight(),H.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:s=1e3}=n,i=yield this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return H.info(`Successfully retrieved conversation ${i.id} for session ${t}`),Lf(i)})}isConversationSupported(r){return P(this,arguments,function*(t,n={}){H.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:s=1e3}=n;return(yield this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"})).has_active_profile})}updateConversation(t,n){return P(this,null,function*(){let r=Le(n);n.tags&&(r.tags=n.tags);let o=yield this.client.put(`/api/conversations/${t}`,r,{version:"v2"});return Lf(o)})}postMessages(t,n){return P(this,null,function*(){return(yield this.client.post(`/api/conversations/${t}/messages`,n.map(o=>I(T({},Le(o)),{tags:o.tags})),{version:"v2"})).map(o=>Lf(o))})}sendEvent(t,n){return P(this,null,function*(){let i=n,{data:r}=i,o=ee(i,["data"]),s=Object.entries(this.latestReceivedDeepdeskVersions).reduce((a,[l,u])=>I(T({},a),{[l]:u}),{});return this.client.post("/api/events",Le(I(T(T({},s),o),{data:r,name:t})),{version:"v2"})})}sendEventV1(t,n){return P(this,null,function*(){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[s,i])=>I(T({},o),{[s]:i}),{});return this.client.post("/api/events",{event:t,data:Le(T(T({},n),r))},{version:"v1"})})}getEntities(t){return P(this,null,function*(){return(yield this.client.post("/api/entities",{messages:t.filter(r=>r.text)},{version:"v1"})).entities})}getTemporaryExchangeToken(){return P(this,null,function*(){return(yield this.client.get("/auth/exchange-token")).jwt})}exchangeTokenForAccessCookie(t){return P(this,null,function*(){return this.client.post("/apis/admin/session/jwt/",{jwt:t}).catch(n=>{throw H.warn(`Invalid token '${t}'`),n})})}authenticateWithKey(t,n){return P(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/api-key/",Le(n),{refreshTokenOn401:!1,headers:{apikey:t}})})}getTextSuggestions(o){return P(this,arguments,function*(t,n={},r){return r==="sticky-messages"?this.getPinnedMessages(t):(yield this.client.post(`/api/conversations/${t}/recommend/${r}`,Le(n),{abortLatest:!0,version:"v1"})).map(i=>I(T({},oe(i)),{text:i.text||i.url||i.message,source:r,type:r})).filter((i,a,l)=>a===l.findIndex(u=>u.text===i.text))})}isLoggedIn(){return P(this,null,function*(){return yield this.preflight(),this.client.validateToken()})}getAutocompleteSuggestions(t,n){return P(this,null,function*(){return(yield this.client.post(`/api/conversations/${t}/autocomplete`,Le(n),{abortLatest:!0,version:"v1"})).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,s,i)=>s===i.findIndex(a=>a.text===o.text))})}getPinnedMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/api/conversations/${t}/sticky-messages`,{abortLatest:!0,version:"v1"});return oe(n).map(r=>I(T({},r),{text:r.message,source:"sticky-messages",type:"pinned-message"}))})}getStyleSuggestions(t){return P(this,null,function*(){let n=yield this.client.post("/api/style-suggestions",Le(t),{abortLatest:!0,version:"v1"});return oe(n)})}search(t){return P(this,null,function*(){let n=yield this.client.post(`/api/profiles/${t.profile}/search`,Le(t),{version:"v2"});return oe(n)})}knowledgeAssist(s,i,a){return P(this,arguments,function*(t,n,r,o={}){let l=yield this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Le({question:t.question,doNotKnowAnswer:t.doNotKnowAnswer,customerInstruction:t.customerInstruction,chatHistory:n.map(u=>({question:u.question,answer:u.answer.answer})),agentId:o.agentId,conversationId:o.conversationId}),{version:"v2"});return oe(l)})}requestLoginByEmail(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return oe(n)})}requestPasswordlessToken(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return oe(t.token)})}getCsrfToken(){return P(this,null,function*(){let{token:t}=yield this.client.get("/apis/admin/session/csrf/");return t})}verifyLoginToken(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/login/",{token:t});return oe(n)})}evaluateRule(s,i,a){return P(this,arguments,function*(t,n,r,o={}){let l=new URLSearchParams;o.raiseForFailingConditions&&l.set("raise_for_failing_conditions","true");let u=yield this.client.post(`/api/conversations/${n}/rules/${t}/evaluate?${l.toString()}`,r,{version:"v2"});return u?oe(u.cues):[]})}getSummary(r){return P(this,arguments,function*(t,n={}){let o=yield this.client.post("/api/summary",{conversation:{messages:t.filter(s=>s.text&&s.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model},{version:"v1"});return oe(o)})}evaluateAssistant(t,n){return P(this,null,function*(){var a;let r=new URLSearchParams,{expectFormat:o="text"}=n||{};if(o.startsWith("json-schema:")){let l=o.replace("json-schema:","");r.append("expect_response_format","json-schema"),r.append("expect_response_format_schema",l)}else r.append("expect_response_format",o);n!=null&&n.externalConversationId&&r.append("external_conversation_id",n.externalConversationId);let s=n!=null&&n.threadId?`/api/v2/assistants/${t}/threads/${n==null?void 0:n.threadId}/evaluate?${r.toString()}`:`/api/v2/assistants/${t}/evaluate?${r.toString()}`,i=yield this.client.post(s,{input:(a=n==null?void 0:n.input)!=null?a:{},conversation:n==null?void 0:n.transcript});return oe(i.output)})}createAssistantThread(t){return P(this,null,function*(){let{assistantCode:n}=t,r=yield this.client.post(`/apis/admin/assistants/${n}/threads/`,{});return oe(r)})}postMessageToAssistantThread(t){return P(this,null,function*(){let{assistantCode:n,threadId:r,message:o}=t,s=yield this.client.post(`/apis/admin/assistants/${n}/threads/${r}/messages/`,{content:o,role:"user"});return oe(s)})}getRules(){return P(this,null,function*(){let t=new URLSearchParams,n=yield this.client.get(`/apis/admin/rule-engine/rules/?${t.toString()}`,{useCache:!0});return oe(n)})}translateMessages(t){return P(this,null,function*(){let n=yield this.client.post("/api/translate",Le(t),{version:"v2"});return oe(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),s=o.match(r0);if(!n||!s)return;let i=s[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[i];a&&n&&a!==n&&H.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[i]=n})}};es.exchangeTokenPromise=null;var Sr=es;var Ml=class{constructor(t,n){this.url=t;this.eventListeners={};this.options=T({timeout:25e3},n)}proxyEvent(t){this.eventSource.addEventListener(My(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,oe(o))}catch(o){H.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 sk;(t=>{let e;(s=>(s.Started="Started",s.Aborted="Aborted",s.Completed="Completed"))(e=t.AutoflowSessionState||(t.AutoflowSessionState={}))})(sk||(sk={}));var _l=class{constructor(t,n={}){this.apiUrl=t;this.streams={};this.logger=H;this.client=new vr(t,n)}getCustomMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/suggestions`);return oe(n.suggestions)})}sendCustomMessage(t,n){return P(this,null,function*(){let r=yield this.client.post(`/sessions/${t}/messages`,Le(n));return oe(r)})}answerCustomMessage(t,n){return P(this,null,function*(){yield this.client.post(`/sessions/${t}/answers`,Le(n))})}getAutoflows(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/autoflows`);return oe(n.autoflows)})}startAutoflowSession(t){return P(this,null,function*(){let n=yield this.client.post("/autoflow-sessions",Le(t));return oe(n)})}stopAutoflowSession(t){return P(this,null,function*(){yield this.client.delete(`/autoflow-sessions/${t}`)})}openStream(t){return this.streams[t]||(this.streams[t]=new Ml(`${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 ik={startTime:null,stopTime:null},ak=J({name:"handlingTime",initialState:ik,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(xe,()=>ik)}}),{handlingTimeStart:lk,handlingTimeStop:Of,handlingTimeReset:uk}=ak.actions,ck=ak.reducer;var dk=(e={})=>{let t=T({onAuthError:ni(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var Nf={list:{keywordMatches:[]},fetchState:"idle"};var ts=V("styleSuggestions/getAll",(n,r)=>P(void 0,[n,r],function*({text:e},t){var l;let{deepdeskAPI:o}=t.extra,s=t.getState(),{showStyleSuggestions:i}=s.settings,a=(l=s.conversation.current)==null?void 0:l.profileCode;if(!i)return Nf.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),i_=J({name:"styleSuggestions",initialState:Nf,reducers:{},extraReducers:e=>{e.addCase(ts.pending,t=>{t.fetchState="loading"}).addCase(ts.rejected,t=>{t.fetchState="error"}).addCase(ts.fulfilled,(t,n)=>{t.fetchState="done",Gr(t.list,n.payload)||(t.list=n.payload)}).addCase(Io,t=>{t.list=Nf.list}).addCase(xe,()=>Nf)}}),fk=i_.reducer;var pk=(e={})=>{let t,n=!0,r=T({getStyleSuggestions:ts,debounce:500},e);return o=>s=>i=>{var g;let a=o.getState().input.text,l=s(i),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((g=u.conversation.current)==null?void 0:g.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 a_(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var mk=(e={})=>{let t=T({getTextSuggestions:vn,getAutocompleteSuggestions:ml,debounce:200,check:Mn},e),n;return r=>o=>s=>{var v;let{input:i}=r.getState(),a=o(s),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(v=l.conversation.current)==null?void 0:v.id,d=s.type===Yd.toString();if(!f||!u&&!c)return a;let{input:g}=l;return a_(g,i)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=si(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var gk=ts.fulfilled.toString();function l_(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let s=e.keywordMatches.filter(l=>l.keyword===o),i=t.keywordMatches.filter(l=>l.keyword===o),a=i.length-s.length;a<=0||r.push(...i.slice(0,a))}),r}var hk=e=>t=>n=>r=>{var u;if(r.type!==gk){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let s=t.getState(),i=s.styleSuggestions.list,a=(u=s.conversation)==null?void 0:u.current;if(o===i)return;let l=l_(o,i);r.type===gk&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var u_=Tc({assistants:_E,auth:b1,autoflows:UC,conversation:N1,contentTypes:FE,customMessages:GC,passwordlessToken:XC,entities:cb,knowledgeAssistant:IE,handlingTime:ck,info:Z1,input:W1,settings:h1,profile:UE,search:sE,styleSuggestions:fk,ui:Xb,rules:nT,textSuggestions:Mb});function yk(e){return Ew({reducer:u_,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),dk(),mk({debounce:200}),pk({debounce:500}),hk(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var c_=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},d_=e=>t=>n=>r=>{var a,l,u,c,f,d,g;let o=t.getState(),s=Zg("inlineSuggestions")(o);switch(r.type){case ni.toString():{!r.payload&&e.emit("logout",void 0);break}case yn.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:(a=o.conversation.current)==null?void 0:a.id,data:{entities:r.payload}});break;case ct.toString():e.sendEvent(r.payload.name,{conversationId:((l=r.payload.options)==null?void 0:l.includeConversationData)&&((u=o.conversation.current)==null?void 0:u.id),data:r.payload.data});break;case Io.toString():e.logSendMessage(r.payload);break;case Yo.fulfilled.toString():r.isBroadcasted||e.broadcast(ih,r,!1),(c=r.payload.options)!=null&&c.shouldEmit&&e.emit("cues",r.payload.cues);break;case Id.toString():e.emit("call-to-action",{cue:r.payload});break;case tr.fulfilled.toString():r.isBroadcasted||e.broadcast(ah,r,!1);break;default:break}let i=n(r);switch(r.type){case Io.toString():e.handleAfterSendMessage(r.payload);break;case hl.toString():e.onUpdateShowTabHint(r.payload);break;case Of.toString():e.logHandlingTime();break;case"analytics/logEvent/fulfilled":{e.emit("event",r.meta.arg);break}case id.toString():{let{start:y,end:v}=o.input.selection;e.emit("replace",I(T({},r.payload),{replace:r.payload.replace==="selection"?{start:y,end:v}:{start:0,end:v}}));break}case dn.toString():{let{start:y,end:v}=o.input.selection;e.emit("select-suggestion",I(T({type:c_(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:y,end:v}:{start:0,end:v}})),s&&t.dispatch(Qr([]));break}case ad.toString():e.emit("select-image",r.payload),e.sendEvent("Image attached",{conversationId:(f=o.conversation.current)==null?void 0:f.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case Qr.toString():{s&&r.payload.length>0&&t.dispatch(ld(0));break}case li.fulfilled.toString():{e.sendEvent("conversation summarized",{conversationId:(d=o.conversation.current)==null?void 0:d.id,data:{summary:r.payload,assistant:(g=t.getState().profile.data)==null?void 0:g.summarizerAssistantNew}});break}default:break}return i},vk=d_;function Hy(e){return e.toISOString().replace("T"," ").replace("Z","")}function Sk(e,t){var s,i,a,l;let n=(s=e.conversation.current)==null?void 0:s.id;if(!n)return H.warn("No conversationId for handling time metrics"),null;let{startTime:r,stopTime:o}=e.handlingTime;return!r||!o?(H.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:n,clientVersion:t.version,agentId:(i=e.info.agentInfo)==null?void 0:i.agentId,agentName:(a=e.info.agentInfo)==null?void 0:a.agentName,agentEmail:(l=e.info.agentInfo)==null?void 0:l.agentEmail,timeStart:Hy(r),timeStop:Hy(o)}}function xk(e,t,n){var N,_,Q,K;let r=(N=t.conversation.current)==null?void 0:N.id;if(!r)return H.warn("No conversationId for send message metrics"),null;let{text:o,metrics:{numCharsTyped:s,numCharsPasted:i,numCharsCut:a,numCharsDeleted:l,numPaste:u,agentStartedTypingTimestamp:c,externalTimeTotalSeconds:f,pastes:d,cuts:g,deletions:y,textSuggestions:v,offeredTextSuggestions:p}}=t[e],m=o.length,S=v.reduce((W,{text:de,searchTerm:Ye})=>W+de.length-(Ye?Ye.length:0),0),w=c!=null?c:Date.now(),k=(Date.now()-w)/1e3+(f||0),b=s/k,R=v.reduce((W,{searchTerm:de})=>W+(de?de.length:0),0);return{conversationId:r,source:"agent",text:o,clientVersion:n.version,pastes:d,cuts:g,deletions:y,lenTextTyped:s+R,lenTextTotal:m,lenTextAssisted:S,lenTextPasted:i,lenTextCut:a,lenTextDeleted:l,timeTotalSeconds:k,charsPerSecond:b,numPastes:u,textSuggestionsV2:v,suggestionsCounters:[{source:"gpt",countOffered:p.filter(W=>W.source==="gpt").length}],agentId:(_=t.info.agentInfo)==null?void 0:_.agentId,agentName:(Q=t.info.agentInfo)==null?void 0:Q.agentName,agentEmail:(K=t.info.agentInfo)==null?void 0:K.agentEmail}}function Uy(e,t){var s;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return Uy(r,t);let o=(s=e.ownerDocument.defaultView)==null?void 0:s.frameElement;return o?Uy(o,t):null}function wk(e,t){return Uy(e,t)}function Ek(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function f_(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Mf(e){return f_(e)&&(Go(e)||of(e))}var Ck,Fn=new Map,p_=["bottom","height","left","right","top","width"],bk=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:p_.some(n=>e[n]!==t[n]);function Tk(e){var n,r,o;if(e.ownerDocument===document)return[];let t=(o=(r=(n=e.ownerDocument)==null?void 0:n.defaultView)==null?void 0:r.frameElement)!=null?o:null;return t?[t,...Tk(t)]:[]}function kk(e,t){return!e||!t?null:I(T({},e),{top:e.top+t.top,left:e.left+t.left})}var _f=!1,Pk=()=>{_f=!0;let e=[];if(Fn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),Fn.delete(n);return}let r=n.getBoundingClientRect();bk(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(kk,t.rect):t.rect;bk(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),Fn.size===0){_f=!1;return}Ck=window.requestAnimationFrame(Pk)};function zy(e,t){let n=Tk(e),r=[],o=n.map((s,i)=>zy(s,a=>{r[i]=a;let l=Fn.get(e);if(!l)return;let u=r.reduce(kk,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(s=!0){if(o.forEach(i=>i.observe(!1)),Fn.has(e)){let i=Fn.get(e);i.callbacks.push(t),i.rect&&t(i.rect)}else Fn.set(e,{rect:void 0,callbacks:[t],parentRects:r});s&&!_f&&Pk()},unobserve(){o.forEach(i=>i.unobserve());let s=Fn.get(e);if(s){let i=s.callbacks.indexOf(t);i>=0&&s.callbacks.splice(i,1),s.callbacks.length||Fn.delete(e),Fn.size||(cancelAnimationFrame(Ck),_f=!1)}}}}var Rk,Hn=new Map,Ak=()=>{Hn.forEach((e,t)=>{if(!t.isConnected){Hn.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(s=>s(e.visible)))}),Hn.size!==0&&(Rk=window.requestAnimationFrame(Ak))};function Ik(e,t){return{observe(){let n=Hn.size===0;Hn.has(e)?Hn.get(e).callbacks.push(t):Hn.set(e,{visible:void 0,callbacks:[t]}),n&&Ak()},unobserve(){let n=Hn.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Hn.delete(e),Hn.size||cancelAnimationFrame(Rk)}}}}var jy=["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 By(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function Ri(e){return parseFloat(e)}function Df(e){return Math.round(e*1e6)}function Lk(e){return e/1e6}function Vy(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=Ri(e.width),s=Ri(e.borderLeftWidth),i=Ri(e.borderRightWidth),a=Ri(e.paddingRight),l=Lk(Df(o)-Df(s)-Df(i)),u=Lk(Df(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function Dl(e,t={}){var c,f;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=(c=t.position)!=null?c:"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",Wo(n);let r=window.getComputedStyle(e),o=!0,s=()=>{n.scrollTop=e.scrollTop};By(r,n,jy),Vy(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",s));let i=Ik(e,()=>{By(r,n,jy),Vy(r,e,n),s(),setTimeout(s,0)}),a,l=!0,u=zy(e,d=>{if(d===null){t.onRemove&&t.onRemove(),n.remove();return}if(!l&&t.onMoveStart&&(Promise.resolve().then(()=>t.onMoveStart()),l=!0),clearTimeout(a),a=setTimeout(()=>{t.onMoveEnd&&t.onMoveEnd(),l=!1},200),d.height===0&&d.width===0){if(o===!0)return;t.onHide&&t.onHide(),n.style.display="none",o=!0;return}if(By(r,n,jy),Vy(r,e,n),s(),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let g=t.closestScrollElement.getBoundingClientRect(),y=window.getComputedStyle(t.closestScrollElement),v=Ri(y.borderTopWidth),p=Ri(y.borderBottomWidth),m=g.top+v-d.top,h=d.top+d.height+-(g.top+g.height-p);n.style.clipPath=`inset(${m}px 0px ${h}px 0px)`}o&&(n.style.display="block",t.onShow&&t.onShow(),o=!1)});return t.appendTo?t.appendTo.appendChild(n):(f=e.parentElement)==null||f.appendChild(n),u.observe(),i.observe(),[n,()=>{e.removeEventListener("scroll",s),u.unobserve(),i.unobserve()}]}var Ok=(e,t)=>({value(){try{let n=sessionStorage.getItem(`dd-${e}`);if(!n)return t;try{return JSON.parse(n)}catch(r){return t}}catch(n){return t}},update(n){try{sessionStorage.setItem(`dd-${e}`,JSON.stringify(n))}catch(r){H.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function m_(e){return e.offsetParent!==null}function Nk(e){if(!m_(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 Ff(e,t,n=100){let r=Nk(e);t({isVisible:r});let o=setInterval(()=>{let s=Nk(e);s!==r&&(r=s,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Fe=x(C());var Mk=Ok("showTabHint",!0),Ai=class Ai{constructor({deepdeskUrl:t,brokerUrl:n,version:r=Ai.version||"unknown",locale:o="en-US",token:s,fetch:i,productName:a,createCustomChannel:l}){this.inputMediator=null;this.eventListeners={};this.unmountHandlers=[];this.widgetRoot=null;this.dynamicThunkObject={};this.isMounted=!1;this.shouldRender=!0;this.loadProfileConfigPromise=null;let u=t.replace(/\/api$/,"");this.deepdeskApi=new Sr(u,{token:s,fetch:i}),this.version=r,this.instanceId=Ai.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[vk({broadcast:(f,d,g)=>{this.broadcastEvents.send(f,d,g)},emit:(f,d)=>this.emit(f,d),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>Mk.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new _l(n)}),this.store=yk(c),this.broadcastEvents=new rk({debug:!0,deepdeskUrl:u,eventMap:iE(this.store),createCustomChannel:l}),this.store.dispatch(hl(Mk.value())),this.store.dispatch(ed({locale:o,adminUrl:u,productName:a}))}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){var t;return(t=this.state.input.textSuggestions[this.state.input.selectedSuggestionIndex])!=null?t: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?(H.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(H.warn("Profile has not been loaded (yet)"),!0):(H.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(ni(null)),this.store.dispatch(Jn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();ut(r)&&y1(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return P(this,null,function*(){return(yield this.store.dispatch(Jn())).payload})}isConversationSupported(t,n){return P(this,null,function*(){return(yield this.store.dispatch(th({sessionId:t,options:n}))).payload})}createConversation(t){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(yield this.store.dispatch(nd(t))).payload})}getConversationBySessionId(t,n){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(yield this.store.dispatch(rd({sessionId:t,options:n}))).payload})}upsertConversation(t){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t.sessionId&&this.resetConversation(),(yield this.store.dispatch(nh(t))).payload})}postMessages(t){return P(this,null,function*(){return(yield this.store.dispatch(sd(t))).payload})}updateConversation(t){return P(this,null,function*(){return(yield this.store.dispatch(od(t))).payload})}resetConversation(){this.store.dispatch(xe()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}configure(t){this.store.dispatch(ed(t))}setVisitorInfo(t){this.store.dispatch(Y1(t))}setCustomData(t){this.store.dispatch(Q1(t))}setAgentInfo(t,n){return P(this,null,function*(){yield this.store.dispatch(Wa(T(T({},t),n)))})}setAgentSettings(t){return P(this,null,function*(){yield this.store.dispatch(oh(t))})}getAgentSettings(){return P(this,null,function*(){return(yield this.store.dispatch(sh())).payload})}refresh(){return P(this,null,function*(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.store.dispatch(ud({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()}));let t=[];return this.store.dispatch(Yd()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}notifyExternalSuggestion(t){this.store.dispatch(dn(t))}evaluateRule(o){return P(this,arguments,function*(t,n={},r=ZC){return(yield this.store.dispatch(Yo({label:t,params:n,options:r}))).payload.cues})}evaluateAssistant(t,n){return P(this,null,function*(){let c=n||{},{input:r={},transcript:o,showCuesInWidget:s=!0,includeTags:i,expectFormat:a}=c,l=ee(c,["input","transcript","showCuesInWidget","includeTags","expectFormat"]);Object.assign(r,l);let u=yield this.store.dispatch(tr({assistantCode:t,expectFormat:a||"json-schema:cues",transcript:o,includeTags:i,input:r,skipState:!s}));if(u.error)throw new Error(u.error.message);return u.payload})}evaluateConversationAssistant(t,n){return P(this,null,function*(){yield this.loadProfileConfig();let r={accepted:"conversationAcceptedAssistant","new-message":"conversationNewMessageAssistant",ended:"conversationEndedAssistant"},o=this.state.profile.data[r[t]];if(!o){H.warn(`No assistant set in profile for conversation event "${t}"`);return}yield this.evaluateAssistant(o,T({transcript:"stored-transcript",includeTags:!0},n))})}getSummary(){return P(this,null,function*(){var n;if(!this.hasConversation())return H.warn("No conversation to create summary for."),null;(n=this.state.profile.data)!=null&&n.summarizerAssistantNew||H.warn("No profile loaded yet, or no summarizer assistant set in profile");let t=yield this.store.dispatch(li({}));if(t.error)throw new Error(t.error.message);return t.payload})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:s,selection:i}=this.state.input,{inlineSuggestions:a,showTextSuggestions:l}=this.state.settings,u=a?"below":"above",c=o.length>0;if(!Mn(this.state)||(this.store.dispatch(H1(rh(t))),t.key!=="Tab"&&!l))return;let f=()=>{n||!c||i&&(t.shiftKey||(this.store.dispatch(j1()),t.preventDefault()))},d=()=>{n||!c||a&&s<=0||i&&(t.shiftKey||(this.store.dispatch(B1()),t.preventDefault()))};switch(t.key){case"ArrowUp":u==="below"?d():f();break;case"ArrowDown":{u==="below"?f():d();break}case"Escape":{n||(this.store.dispatch(ld(-1)),this.store.dispatch(no({collapse:!0})),this.store.dispatch(Yb(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let g=ii(this.state);if(!g)return;this.store.dispatch(hl(!1)),this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(this.state.settings.inlineSuggestions||this.state.input.selectedSuggestionIndex===-1)return;let g=ii(this.state);if(!g)return;this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(this.state.settings.inlineSuggestions||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let g=ii(this.state);if(!g)return;this.store.dispatch(dn({text:g.text,suggestion:g,eventMetrics:{inputType:"enter"},replace:"until-selection-end"})),t.preventDefault();break}default:}n&&r&&this.store.dispatch(no({collapse:!1}))}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(Qr([]))}handlingTimeStart(){this.state.handlingTime.startTime||(H.info("Start handling time"),this.store.dispatch(lk()))}handlingTimeStop(){this.state.handlingTime.startTime&&(H.info("Stop handling time"),this.store.dispatch(Of()))}logSendMessage(t){let n=xk("input",this.state,{version:this.version});n&&(t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEventV1("Send Message",n),this.emit("send-message-event",n))}logHandlingTime(){let t=Sk(this.state,{version:this.version});t&&(this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(uk()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Io((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(K1()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(s){H.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),H.error(s)}})}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}setPlatformVariables(t){this.store.dispatch(X1(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[s,i]=Dl(n,r);return s.setAttribute("translate","no"),s.dataset.testid=t,o&&s.classList.add(o),this.unmountHandlers.push(()=>{(0,sn.unmountComponentAtNode)(s),i(),s.remove()}),s}createInlineContainer(t,n){var a;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.height="0px",r.style.width="0px";let o=document.createElement("div");o.style.display="none",o.style.position="absolute",o.style.height="0px",o.style.width="0px",o.style.backgroundColor="red",r.appendChild(o);let s=(a=t.ownerDocument.defaultView)==null?void 0:a.frameElement,i=s?s.ownerDocument.defaultView:null;if(s&&(i===window||(i==null?void 0:i.parent)===window)){let[l,u]=Dl(s,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{(0,sn.unmountComponentAtNode)(o),u()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return Wo(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,sn.unmountComponentAtNode)(o),o.remove()}),o}storeMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=JSON.stringify({text:this.state.input.text,metrics:this.state.input.metrics});window.sessionStorage.setItem(t,n),H.info(`Stored analytics for ${this.conversationId()}`)}catch(t){}}restoreMetrics(){try{let t=`dd-metrics-${this.conversationId()}`,n=window.sessionStorage.getItem(t);if(!n)return;let r=JSON.parse(n);r.text.trim()===this.state.input.text.trim()?(H.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(V1(r.metrics))):H.warn(`Metrics mismatch, disregarding stored metrics for ${this.conversationId()}`),window.sessionStorage.removeItem(t)}catch(t){}}mount(t,n={}){if(this.isMounted)throw new Error("[Deepdesk] This instance was already mounted. Make sure to unmount before you remount.");if(!Mf(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:s,showTextSuggestions:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:g,inputMediator:y,closestScrollSelector:v,appendOverlayTo:p,inlineSuggestions:m,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:i,insertLink:g,isEmbedded:f,inlineSuggestions:m,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),Wo(t),this.inputMediator=y||(Go(t)?new Jo(t):new Zo(t)),this.inputMediator.on("change",({plainText:k,rawHTML:b})=>{this.store.dispatch(ud({text:k,html:b}))}),this.inputMediator.on("keyup",k=>{this.store.dispatch(U1(rh(k)))}),this.inputMediator.on("keydown",k=>{this.handleKeyDown(k)}),this.inputMediator.on("paste",({pastedText:k,selectionText:b})=>{this.store.dispatch(z1({text:k,selectionText:b}))}),this.inputMediator.on("cut",({selectionText:k})=>{this.store.dispatch(F1(k))});let S;this.inputMediator.on("selection",k=>{clearTimeout(S),k===null?S=setTimeout(()=>{k!==null&&this.store.dispatch(cd(k))},500):this.store.dispatch(cd(k))}),this.inputMediator.on("disabled",()=>{var k;(k=this.inputMediator)==null||k.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(Zd(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(Zd(!0))});let w=v&&wk(t,v)||void 0;if(m){let{customStyles:k,appendOverlayTo:b}=n,R=this.createInlineContainer(t,"deepdesk-caret");(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(rC,{})})}),R),this.inputMediator.on("caretposition",_=>{_?(R.style.display="block",R.style.top=`${_.top}px`,R.style.left=`${_.left}px`):R.style.display="none"});let N=this.overlayContainerFactory("floating-menu",w||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:b},k==null?void 0:k.floatingMenuRootNode);(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)($b,{onLogIn:()=>this.loginViaPopup().catch(_=>H.warn(_.message))})})}),N)}else{let k=this.overlayContainerFactory("deepdesk-tab-completion",w||t,{appendTo:p,closestScrollElement:w,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),b=this.overlayContainerFactory("deepdesk-suggestions-overlay",w||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(NC,{inputElement:t})})}),k),(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(fC,{onLogIn:()=>this.loginViaPopup().catch(R=>H.warn(R.message))})})}),b)}(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(jb,{})})}),this.createContainer("deepdesk-overlays")),this.store.dispatch(ud({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()})),this.store.dispatch(cd(this.inputMediator.getSelection())),this.store.dispatch(Zd(this.inputMediator.isFocused)),this.unmountHandlers.push(()=>{this.state.input.text!==""&&this.storeMetrics()}),this.whenConversationLoaded(()=>{var k;this.restoreMetrics(),this.refresh(),this.broadcastEvents.setSessionId((k=this.state.conversation.current)==null?void 0:k.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&&H.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:s}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:s}),(0,sn.render)((0,Fe.jsx)(qo,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Oo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(XT,{onLogIn:()=>this.loginViaPopup().catch(i=>H.warn(i.message))})})}),t),this.whenConversationLoaded(()=>{var i;this.broadcastEvents.setSessionId((i=this.state.conversation.current)==null?void 0:i.sessionId)})}unmountWidget(){this.widgetRoot&&(0,sn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Ff(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){Ek(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfig(){return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(this.loadProfileConfigPromise=Promise.resolve().then(()=>P(this,null,function*(){yield this.store.dispatch(nl());let t=nr(this.state);t&&(yield this.store.dispatch(el()),this.store.dispatch(ed({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:!!t.summarizerAssistantNew||t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistantNew||!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))})),this.loadProfileConfigPromise)}loginViaPopup(t){return P(this,null,function*(){return new Promise((n,r)=>{let o=new MessageChannel,s=o.port1,i=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${i}/platform/sso/`);a.searchParams.append("redirect","/sdk/popup/close.html");let l=!1,u=()=>{c&&!c.closed&&c.close(),window.removeEventListener("message",f),clearInterval(d)};s.onmessage=g=>P(this,null,function*(){var y,v;if((y=g.data)!=null&&y.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((v=g.data)==null?void 0:v.jwt),yield this.isLoggedIn(),this.broadcastEvents.send(qa),l=!0,o.port1.close(),n()}catch(p){console.error(p),r(p)}finally{l=!0,u()}});let c=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");c===null&&r(new Error("Popup blocked by browser"));let f=g=>P(this,null,function*(){var y;if(g.origin===a.origin)switch((y=g.data)==null?void 0:y.type){case"deepdesk-popup-loaded":{try{let v=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(v,a.origin,[o.port2])}catch(v){H.error("Error posting message to popup",v),r(v)}break}case"deepdesk-popup-error":{u(),g.data.message==="Timeout"&&H.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(g.data.message));break}}});window.addEventListener("message",f);let d=setInterval(()=>{c&&!c.closed||(u(),l||r(new Error("Popup closed by user")))},200);this.unmountHandlers.push(u)})})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}checkForTrialMode(t){return P(this,null,function*(){try{let{account:n}=yield this.deepdeskApi.getPlatformConfig();if(!n.isTrial){this.shouldRender=!0;return}if(H.info("Trial is active"),!(yield this.deepdeskApi.checkUserExists(t)))throw new Error("User is not in trial");this.shouldRender=!0}catch(n){let{message:r}=n;H.info(r),this.shouldRender=!1}})}refreshWidgetSuggestions(){return P(this,null,function*(){if(!this.widgetRoot||this.shouldAbort())return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Od(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(yn()):su.includes(r)||this.store.dispatch(vn(r))})}catch(r){this.handleError(r)}})}};Ai.version="14.3.0",Ai.count=0;var Fl=Ai;function g_(e){return P(this,null,function*(){var o,s,i;let n=yield((o=e.fetch)!=null?o:window.fetch)(e.url),r=yield n.blob();return new File([r],e.name,{type:(i=(s=e.mimeType)!=null?s:n.headers.get("Content-Type"))!=null?i:"image/jpeg"})})}function _k(e,t){return P(this,null,function*(){let n=yield g_(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}})}function Dk(e,t,n){return P(this,null,function*(){yield new Sr(e).authenticateWithKey(t,n)})}function Fk(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function Hk(r,o){return P(this,arguments,function*(e,t,n={}){var f,d;let{value:s}=e,{start:i,end:a}=(f=n.replace)!=null?f:{start:0,end:s.length},l=`${s.slice(0,i)}${t}${s.slice(a)}`,u=(d=n.selectionAfter)!=null?d:{start:i+t.length,end:i+t.length},c=()=>{if(n.setValue)return n.setValue(l);e.value=l};return Promise.resolve(c()).then(()=>{e.selectionStart=u.start,e.selectionEnd=u.end,e.blur(),e.focus()})})}function Uk(r,o){return P(this,arguments,function*(e,t,n={}){let s=n.replace?io(e,n.replace.start,n.replace.end):Ti(e),i,a=()=>{if(n.setRange)return n.setRange(s.cloneRange());s.deleteContents(),i=document.createElement("span"),s.insertNode(i),n.insertBRs!==!1?t.split(`
28
+ `).reverse().forEach((l,u)=>{u>0&&s.insertNode(document.createElement("br")),s.insertNode(document.createTextNode(l))}):s.insertNode(document.createTextNode(t))};return Promise.resolve(a()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let l=n.selectionAfter?io(e,n.selectionAfter.start,n.selectionAfter.end):(s.collapse(!1),s),u=window.getSelection();u==null||u.removeAllRanges(),u==null||u.addRange(l)}if(!i)return;i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}function h_(e){let t=document.createElement("template");return t.innerHTML=e.replace(/(\[([^\]]+)])\(([^)]+)\)/g,'<a href="$3" target="_blank" rel="noopener noreferrer">$2</a>'),t.content}function y_(e){let t=document.createDocumentFragment();return e.split(`
29
+ `).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},s=0;for(;o=n.slice(s).match(/(\[([^\]]+)])\(([^)]+)\)/);){let i=document.createElement("a");i.href=o[3],i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"),i.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(s,s+o.index))),t.appendChild(i),s=s+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(s)))}),t}function zk(e,t){let n=e.parentElement;if(!n){console.warn("No insert point found");return}let{display:r}=window.getComputedStyle(n);r.includes("block")||r==="table-cell"?n==null||n.insertBefore(t,e.nextSibling):zk(n,t)}function jk(o,s){return P(this,arguments,function*(e,t,{isBlock:n,isHTML:r}={}){let i;e.dispatchEvent(new InputEvent("beforeinput",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0}));let a=()=>{var d;let l=(d=e.ownerDocument.defaultView)!=null?d:window,u=l.getSelection();if((!u||u.rangeCount===0)&&(e.focus(),u=l.getSelection()),!u||u.rangeCount===0)return;let c=u.getRangeAt(0);if(!c)return;i=document.createElement("span"),c.insertNode(i);let f=r?h_(t):y_(t);n?zk(c.startContainer,f):(c.insertNode(f),c.collapse(!1))};return Promise.resolve(a()).then(()=>{if(e.dispatchEvent(new InputEvent("input",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0})),e.focus(),!!i)try{i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}return nP(v_);})();
30
30
  /*! Bundled license information:
31
31
 
32
32
  classnames/index.js: