@deepdesk/deepdesk-sdk 14.1.0 → 14.1.1-beta.1
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.
- package/dist/index.cjs.js +7 -7
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.esm.js +7 -7
- package/dist/index.iife.js +8 -8
- package/package.json +1 -1
package/dist/index.iife.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Deepdesk=(()=>{var Jk=Object.create;var Ns=Object.defineProperty,eP=Object.defineProperties,tP=Object.getOwnPropertyDescriptor,nP=Object.getOwnPropertyDescriptors,rP=Object.getOwnPropertyNames,$l=Object.getOwnPropertySymbols,oP=Object.getPrototypeOf,Vf=Object.prototype.hasOwnProperty,dv=Object.prototype.propertyIsEnumerable;var cv=(e,t,n)=>t in e?Ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Vf.call(t,n)&&cv(e,n,t[n]);if($l)for(var n of $l(t))dv.call(t,n)&&cv(e,n,t[n]);return e},I=(e,t)=>eP(e,nP(t));var te=(e,t)=>{var n={};for(var r in e)Vf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$l)for(var r of $l(e))t.indexOf(r)<0&&dv.call(e,r)&&(n[r]=e[r]);return n};var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var n in t)Ns(e,n,{get:t[n],enumerable:!0})},fv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rP(t))!Vf.call(e,o)&&o!==n&&Ns(e,o,{get:()=>t[o],enumerable:!(r=tP(t,o))||r.enumerable});return e};var w=(e,t,n)=>(n=e!=null?Jk(oP(e)):{},fv(t||!e||!e.__esModule?Ns(n,"default",{value:e,enumerable:!0}):n,e)),iP=e=>fv(Ns({},"__esModule",{value:!0}),e);var P=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{a(n.next(l))}catch(u){o(u)}},s=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,s);a((n=n.apply(e,t)).next())});var oe=Ae((b_,ql)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var a=n.apply(null,i);a&&r.push(a)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)e.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}typeof ql!="undefined"&&ql.exports?(n.default=n,ql.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var Gl=Ae((C_,mv)=>{"use strict";var pv=Object.getOwnPropertySymbols,sP=Object.prototype.hasOwnProperty,aP=Object.prototype.propertyIsEnumerable;function lP(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function uP(){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(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch(i){return!1}}mv.exports=uP()?Object.assign:function(e,t){for(var n,r=lP(e),o,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var s in n)sP.call(n,s)&&(r[s]=n[s]);if(pv){o=pv(n);for(var a=0;a<o.length;a++)aP.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var Lv=Ae(ne=>{"use strict";var Wf=Gl(),di=60103,yv=60106;ne.Fragment=60107;ne.StrictMode=60108;ne.Profiler=60114;var vv=60109,Sv=60110,wv=60112;ne.Suspense=60113;var xv=60115,Ev=60116;typeof Symbol=="function"&&Symbol.for&&(Ht=Symbol.for,di=Ht("react.element"),yv=Ht("react.portal"),ne.Fragment=Ht("react.fragment"),ne.StrictMode=Ht("react.strict_mode"),ne.Profiler=Ht("react.profiler"),vv=Ht("react.provider"),Sv=Ht("react.context"),wv=Ht("react.forward_ref"),ne.Suspense=Ht("react.suspense"),xv=Ht("react.memo"),Ev=Ht("react.lazy"));var Ht,gv=typeof Symbol=="function"&&Symbol.iterator;function cP(e){return e===null||typeof e!="object"?null:(e=gv&&e[gv]||e["@@iterator"],typeof e=="function"?e:null)}function Ms(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 bv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cv={};function fi(e,t,n){this.props=e,this.context=t,this.refs=Cv,this.updater=n||bv}fi.prototype.isReactComponent={};fi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(Ms(85));this.updater.enqueueSetState(this,e,t,"setState")};fi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Tv(){}Tv.prototype=fi.prototype;function $f(e,t,n){this.props=e,this.context=t,this.refs=Cv,this.updater=n||bv}var qf=$f.prototype=new Tv;qf.constructor=$f;Wf(qf,fi.prototype);qf.isPureReactComponent=!0;var Gf={current:null},kv=Object.prototype.hasOwnProperty,Pv={key:!0,ref:!0,__self:!0,__source:!0};function Rv(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)kv.call(t,r)&&!Pv.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:di,type:e,key:i,ref:s,props:o,_owner:Gf.current}}function dP(e,t){return{$$typeof:di,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yf(e){return typeof e=="object"&&e!==null&&e.$$typeof===di}function fP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var hv=/\/+/g;function Kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fP(""+e.key):t.toString(36)}function Ql(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case di:case yv:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Kf(s,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace(hv,"$&/")+"/"),Ql(o,t,n,"",function(u){return u})):o!=null&&(Yf(o)&&(o=dP(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(hv,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Kf(i,a);s+=Ql(i,t,n,l,o)}else if(l=cP(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Kf(i,a++),s+=Ql(i,t,n,l,o);else if(i==="object")throw t=""+e,Error(Ms(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function Yl(e,t,n){if(e==null)return e;var r=[],o=0;return Ql(e,r,"","",function(i){return t.call(n,i,o++)}),r}function pP(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 Av={current:null};function Un(){var e=Av.current;if(e===null)throw Error(Ms(321));return e}var mP={ReactCurrentDispatcher:Av,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:Gf,IsSomeRendererActing:{current:!1},assign:Wf};ne.Children={map:Yl,forEach:function(e,t,n){Yl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Yl(e,function(){t++}),t},toArray:function(e){return Yl(e,function(t){return t})||[]},only:function(e){if(!Yf(e))throw Error(Ms(143));return e}};ne.Component=fi;ne.PureComponent=$f;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mP;ne.cloneElement=function(e,t,n){if(e==null)throw Error(Ms(267,e));var r=Wf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Gf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)kv.call(t,l)&&!Pv.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:di,type:e.type,key:o,ref:i,props:r,_owner:s}};ne.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Sv,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:vv,_context:e},e.Consumer=e};ne.createElement=Rv;ne.createFactory=function(e){var t=Rv.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:wv,render:e}};ne.isValidElement=Yf;ne.lazy=function(e){return{$$typeof:Ev,_payload:{_status:-1,_result:e},_init:pP}};ne.memo=function(e,t){return{$$typeof:xv,type:e,compare:t===void 0?null:t}};ne.useCallback=function(e,t){return Un().useCallback(e,t)};ne.useContext=function(e,t){return Un().useContext(e,t)};ne.useDebugValue=function(){};ne.useEffect=function(e,t){return Un().useEffect(e,t)};ne.useImperativeHandle=function(e,t,n){return Un().useImperativeHandle(e,t,n)};ne.useLayoutEffect=function(e,t){return Un().useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Un().useMemo(e,t)};ne.useReducer=function(e,t,n){return Un().useReducer(e,t,n)};ne.useRef=function(e){return Un().useRef(e)};ne.useState=function(e){return Un().useState(e)};ne.version="17.0.2"});var H=Ae((k_,Iv)=>{"use strict";Iv.exports=Lv()});var Dv=Ae(Ds=>{"use strict";Gl();var gP=H(),Mv=60103;Ds.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Qf=Symbol.for,Mv=Qf("react.element"),Ds.Fragment=Qf("react.fragment"));var Qf,hP=gP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,yP=Object.prototype.hasOwnProperty,vP={key:!0,ref:!0,__self:!0,__source:!0};function _v(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)yP.call(t,r)&&!vP.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:Mv,type:e,key:i,ref:s,props:o,_owner:hP.current}}Ds.jsx=_v;Ds.jsxs=_v});var b=Ae((M_,Fv)=>{"use strict";Fv.exports=Dv()});var a0=Ae(se=>{"use strict";var yi,Us,cu,sp;typeof performance=="object"&&typeof performance.now=="function"?(n0=performance,se.unstable_now=function(){return n0.now()}):(ep=Date,r0=ep.now(),se.unstable_now=function(){return ep.now()-r0});var n0,ep,r0;typeof window=="undefined"||typeof MessageChannel!="function"?(hi=null,tp=null,np=function(){if(hi!==null)try{var e=se.unstable_now();hi(!0,e),hi=null}catch(t){throw setTimeout(np,0),t}},yi=function(e){hi!==null?setTimeout(yi,0,e):(hi=e,setTimeout(np,0))},Us=function(e,t){tp=setTimeout(e,t)},cu=function(){clearTimeout(tp)},se.unstable_shouldYield=function(){return!1},sp=se.unstable_forceFrameRate=function(){}):(o0=window.setTimeout,i0=window.clearTimeout,typeof console!="undefined"&&(s0=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 s0!="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")),Fs=!1,Hs=null,au=-1,rp=5,op=0,se.unstable_shouldYield=function(){return se.unstable_now()>=op},sp=function(){},se.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"):rp=0<e?Math.floor(1e3/e):5},ip=new MessageChannel,lu=ip.port2,ip.port1.onmessage=function(){if(Hs!==null){var e=se.unstable_now();op=e+rp;try{Hs(!0,e)?lu.postMessage(null):(Fs=!1,Hs=null)}catch(t){throw lu.postMessage(null),t}}else Fs=!1},yi=function(e){Hs=e,Fs||(Fs=!0,lu.postMessage(null))},Us=function(e,t){au=o0(function(){e(se.unstable_now())},t)},cu=function(){i0(au),au=-1});var hi,tp,np,o0,i0,s0,Fs,Hs,au,rp,op,ip,lu;function ap(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<uu(o,t))e[r]=t,e[n]=o,n=r;else break e}}function nn(e){return e=e[0],e===void 0?null:e}function du(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 i=2*(r+1)-1,s=e[i],a=i+1,l=e[a];if(s!==void 0&&0>uu(s,n))l!==void 0&&0>uu(l,s)?(e[r]=l,e[a]=n,r=a):(e[r]=s,e[i]=n,r=i);else if(l!==void 0&&0>uu(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function uu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var xn=[],br=[],DP=1,zt=null,Qe=3,fu=!1,go=!1,zs=!1;function lp(e){for(var t=nn(br);t!==null;){if(t.callback===null)du(br);else if(t.startTime<=e)du(br),t.sortIndex=t.expirationTime,ap(xn,t);else break;t=nn(br)}}function up(e){if(zs=!1,lp(e),!go)if(nn(xn)!==null)go=!0,yi(cp);else{var t=nn(br);t!==null&&Us(up,t.startTime-e)}}function cp(e,t){go=!1,zs&&(zs=!1,cu()),fu=!0;var n=Qe;try{for(lp(t),zt=nn(xn);zt!==null&&(!(zt.expirationTime>t)||e&&!se.unstable_shouldYield());){var r=zt.callback;if(typeof r=="function"){zt.callback=null,Qe=zt.priorityLevel;var o=r(zt.expirationTime<=t);t=se.unstable_now(),typeof o=="function"?zt.callback=o:zt===nn(xn)&&du(xn),lp(t)}else du(xn);zt=nn(xn)}if(zt!==null)var i=!0;else{var s=nn(br);s!==null&&Us(up,s.startTime-t),i=!1}return i}finally{zt=null,Qe=n,fu=!1}}var FP=sp;se.unstable_IdlePriority=5;se.unstable_ImmediatePriority=1;se.unstable_LowPriority=4;se.unstable_NormalPriority=3;se.unstable_Profiling=null;se.unstable_UserBlockingPriority=2;se.unstable_cancelCallback=function(e){e.callback=null};se.unstable_continueExecution=function(){go||fu||(go=!0,yi(cp))};se.unstable_getCurrentPriorityLevel=function(){return Qe};se.unstable_getFirstCallbackNode=function(){return nn(xn)};se.unstable_next=function(e){switch(Qe){case 1:case 2:case 3:var t=3;break;default:t=Qe}var n=Qe;Qe=t;try{return e()}finally{Qe=n}};se.unstable_pauseExecution=function(){};se.unstable_requestPaint=FP;se.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Qe;Qe=e;try{return t()}finally{Qe=n}};se.unstable_scheduleCallback=function(e,t,n){var r=se.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:DP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,ap(br,e),nn(xn)===null&&e===nn(br)&&(zs?cu():zs=!0,Us(up,n-r))):(e.sortIndex=o,ap(xn,e),go||fu||(go=!0,yi(cp))),e};se.unstable_wrapCallback=function(e){var t=Qe;return function(){var n=Qe;Qe=t;try{return e.apply(this,arguments)}finally{Qe=n}}}});var u0=Ae((eD,l0)=>{"use strict";l0.exports=a0()});var Yw=Ae($t=>{"use strict";var ic=H(),xe=Gl(),ze=u0();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(!ic)throw Error(O(227));var ES=new Set,ha={};function ko(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(ha[e]=t,e=0;e<t.length;e++)ES.add(t[e])}var $n=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),HP=/^[: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]*$/,c0=Object.prototype.hasOwnProperty,d0={},f0={};function UP(e){return c0.call(f0,e)?!0:c0.call(d0,e)?!1:HP.test(e)?f0[e]=!0:(d0[e]=!0,!1)}function zP(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 BP(e,t,n,r){if(t===null||typeof t=="undefined"||zP(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 st(e,t,n,r,o,i,s){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=i,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new st(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){$e[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sm=/[\-:]([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(Sm,wm);$e[t]=new st(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(Sm,wm);$e[t]=new st(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(Sm,wm);$e[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[t]:null,i=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");i||(BP(t,n,o,r)&&(n=null),r||o===null?UP(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 Po=ic.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Js=60103,yo=60106,Tr=60107,Em=60108,oa=60114,bm=60109,Cm=60110,sc=60112,ia=60113,Du=60120,ac=60115,Tm=60116,km=60121,Pm=60128,bS=60129,Rm=60130,Np=60131;typeof Symbol=="function"&&Symbol.for&&(Ne=Symbol.for,Js=Ne("react.element"),yo=Ne("react.portal"),Tr=Ne("react.fragment"),Em=Ne("react.strict_mode"),oa=Ne("react.profiler"),bm=Ne("react.provider"),Cm=Ne("react.context"),sc=Ne("react.forward_ref"),ia=Ne("react.suspense"),Du=Ne("react.suspense_list"),ac=Ne("react.memo"),Tm=Ne("react.lazy"),km=Ne("react.block"),Ne("react.scope"),Pm=Ne("react.opaque.id"),bS=Ne("react.debug_trace_mode"),Rm=Ne("react.offscreen"),Np=Ne("react.legacy_hidden"));var Ne,p0=typeof Symbol=="function"&&Symbol.iterator;function Bs(e){return e===null||typeof e!="object"?null:(e=p0&&e[p0]||e["@@iterator"],typeof e=="function"?e:null)}var dp;function ea(e){if(dp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dp=t&&t[1]||""}return`
|
|
1
|
+
"use strict";var Deepdesk=(()=>{var Jk=Object.create;var Ns=Object.defineProperty,eP=Object.defineProperties,tP=Object.getOwnPropertyDescriptor,nP=Object.getOwnPropertyDescriptors,rP=Object.getOwnPropertyNames,$l=Object.getOwnPropertySymbols,oP=Object.getPrototypeOf,Vf=Object.prototype.hasOwnProperty,dv=Object.prototype.propertyIsEnumerable;var cv=(e,t,n)=>t in e?Ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t)=>{for(var n in t||(t={}))Vf.call(t,n)&&cv(e,n,t[n]);if($l)for(var n of $l(t))dv.call(t,n)&&cv(e,n,t[n]);return e},I=(e,t)=>eP(e,nP(t));var te=(e,t)=>{var n={};for(var r in e)Vf.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&$l)for(var r of $l(e))t.indexOf(r)<0&&dv.call(e,r)&&(n[r]=e[r]);return n};var Ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ye=(e,t)=>{for(var n in t)Ns(e,n,{get:t[n],enumerable:!0})},fv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of rP(t))!Vf.call(e,o)&&o!==n&&Ns(e,o,{get:()=>t[o],enumerable:!(r=tP(t,o))||r.enumerable});return e};var w=(e,t,n)=>(n=e!=null?Jk(oP(e)):{},fv(t||!e||!e.__esModule?Ns(n,"default",{value:e,enumerable:!0}):n,e)),iP=e=>fv(Ns({},"__esModule",{value:!0}),e);var P=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{a(n.next(l))}catch(u){o(u)}},s=l=>{try{a(n.throw(l))}catch(u){o(u)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,s);a((n=n.apply(e,t)).next())});var oe=Ae((C_,ql)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty,t="[native code]";function n(){for(var r=[],o=0;o<arguments.length;o++){var i=arguments[o];if(i){var s=typeof i;if(s==="string"||s==="number")r.push(i);else if(Array.isArray(i)){if(i.length){var a=n.apply(null,i);a&&r.push(a)}}else if(s==="object"){if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]")){r.push(i.toString());continue}for(var l in i)e.call(i,l)&&i[l]&&r.push(l)}}}return r.join(" ")}typeof ql!="undefined"&&ql.exports?(n.default=n,ql.exports=n):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return n}):window.classNames=n})()});var Gl=Ae((T_,mv)=>{"use strict";var pv=Object.getOwnPropertySymbols,sP=Object.prototype.hasOwnProperty,aP=Object.prototype.propertyIsEnumerable;function lP(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function uP(){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(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch(i){return!1}}mv.exports=uP()?Object.assign:function(e,t){for(var n,r=lP(e),o,i=1;i<arguments.length;i++){n=Object(arguments[i]);for(var s in n)sP.call(n,s)&&(r[s]=n[s]);if(pv){o=pv(n);for(var a=0;a<o.length;a++)aP.call(n,o[a])&&(r[o[a]]=n[o[a]])}}return r}});var Lv=Ae(ne=>{"use strict";var Wf=Gl(),di=60103,yv=60106;ne.Fragment=60107;ne.StrictMode=60108;ne.Profiler=60114;var vv=60109,Sv=60110,wv=60112;ne.Suspense=60113;var xv=60115,Ev=60116;typeof Symbol=="function"&&Symbol.for&&(Ht=Symbol.for,di=Ht("react.element"),yv=Ht("react.portal"),ne.Fragment=Ht("react.fragment"),ne.StrictMode=Ht("react.strict_mode"),ne.Profiler=Ht("react.profiler"),vv=Ht("react.provider"),Sv=Ht("react.context"),wv=Ht("react.forward_ref"),ne.Suspense=Ht("react.suspense"),xv=Ht("react.memo"),Ev=Ht("react.lazy"));var Ht,gv=typeof Symbol=="function"&&Symbol.iterator;function cP(e){return e===null||typeof e!="object"?null:(e=gv&&e[gv]||e["@@iterator"],typeof e=="function"?e:null)}function Ms(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 bv={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Cv={};function fi(e,t,n){this.props=e,this.context=t,this.refs=Cv,this.updater=n||bv}fi.prototype.isReactComponent={};fi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(Ms(85));this.updater.enqueueSetState(this,e,t,"setState")};fi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Tv(){}Tv.prototype=fi.prototype;function $f(e,t,n){this.props=e,this.context=t,this.refs=Cv,this.updater=n||bv}var qf=$f.prototype=new Tv;qf.constructor=$f;Wf(qf,fi.prototype);qf.isPureReactComponent=!0;var Gf={current:null},kv=Object.prototype.hasOwnProperty,Pv={key:!0,ref:!0,__self:!0,__source:!0};function Rv(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)kv.call(t,r)&&!Pv.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:di,type:e,key:i,ref:s,props:o,_owner:Gf.current}}function dP(e,t){return{$$typeof:di,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Yf(e){return typeof e=="object"&&e!==null&&e.$$typeof===di}function fP(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var hv=/\/+/g;function Kf(e,t){return typeof e=="object"&&e!==null&&e.key!=null?fP(""+e.key):t.toString(36)}function Ql(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case di:case yv:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Kf(s,0):r,Array.isArray(o)?(n="",e!=null&&(n=e.replace(hv,"$&/")+"/"),Ql(o,t,n,"",function(u){return u})):o!=null&&(Yf(o)&&(o=dP(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(hv,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Array.isArray(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Kf(i,a);s+=Ql(i,t,n,l,o)}else if(l=cP(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Kf(i,a++),s+=Ql(i,t,n,l,o);else if(i==="object")throw t=""+e,Error(Ms(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t));return s}function Yl(e,t,n){if(e==null)return e;var r=[],o=0;return Ql(e,r,"","",function(i){return t.call(n,i,o++)}),r}function pP(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 Av={current:null};function Un(){var e=Av.current;if(e===null)throw Error(Ms(321));return e}var mP={ReactCurrentDispatcher:Av,ReactCurrentBatchConfig:{transition:0},ReactCurrentOwner:Gf,IsSomeRendererActing:{current:!1},assign:Wf};ne.Children={map:Yl,forEach:function(e,t,n){Yl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Yl(e,function(){t++}),t},toArray:function(e){return Yl(e,function(t){return t})||[]},only:function(e){if(!Yf(e))throw Error(Ms(143));return e}};ne.Component=fi;ne.PureComponent=$f;ne.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=mP;ne.cloneElement=function(e,t,n){if(e==null)throw Error(Ms(267,e));var r=Wf({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Gf.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)kv.call(t,l)&&!Pv.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:di,type:e.type,key:o,ref:i,props:r,_owner:s}};ne.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Sv,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:vv,_context:e},e.Consumer=e};ne.createElement=Rv;ne.createFactory=function(e){var t=Rv.bind(null,e);return t.type=e,t};ne.createRef=function(){return{current:null}};ne.forwardRef=function(e){return{$$typeof:wv,render:e}};ne.isValidElement=Yf;ne.lazy=function(e){return{$$typeof:Ev,_payload:{_status:-1,_result:e},_init:pP}};ne.memo=function(e,t){return{$$typeof:xv,type:e,compare:t===void 0?null:t}};ne.useCallback=function(e,t){return Un().useCallback(e,t)};ne.useContext=function(e,t){return Un().useContext(e,t)};ne.useDebugValue=function(){};ne.useEffect=function(e,t){return Un().useEffect(e,t)};ne.useImperativeHandle=function(e,t,n){return Un().useImperativeHandle(e,t,n)};ne.useLayoutEffect=function(e,t){return Un().useLayoutEffect(e,t)};ne.useMemo=function(e,t){return Un().useMemo(e,t)};ne.useReducer=function(e,t,n){return Un().useReducer(e,t,n)};ne.useRef=function(e){return Un().useRef(e)};ne.useState=function(e){return Un().useState(e)};ne.version="17.0.2"});var H=Ae((P_,Iv)=>{"use strict";Iv.exports=Lv()});var Dv=Ae(Ds=>{"use strict";Gl();var gP=H(),Mv=60103;Ds.Fragment=60107;typeof Symbol=="function"&&Symbol.for&&(Qf=Symbol.for,Mv=Qf("react.element"),Ds.Fragment=Qf("react.fragment"));var Qf,hP=gP.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,yP=Object.prototype.hasOwnProperty,vP={key:!0,ref:!0,__self:!0,__source:!0};function _v(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)yP.call(t,r)&&!vP.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:Mv,type:e,key:i,ref:s,props:o,_owner:hP.current}}Ds.jsx=_v;Ds.jsxs=_v});var b=Ae((__,Fv)=>{"use strict";Fv.exports=Dv()});var a0=Ae(se=>{"use strict";var yi,Us,cu,sp;typeof performance=="object"&&typeof performance.now=="function"?(n0=performance,se.unstable_now=function(){return n0.now()}):(ep=Date,r0=ep.now(),se.unstable_now=function(){return ep.now()-r0});var n0,ep,r0;typeof window=="undefined"||typeof MessageChannel!="function"?(hi=null,tp=null,np=function(){if(hi!==null)try{var e=se.unstable_now();hi(!0,e),hi=null}catch(t){throw setTimeout(np,0),t}},yi=function(e){hi!==null?setTimeout(yi,0,e):(hi=e,setTimeout(np,0))},Us=function(e,t){tp=setTimeout(e,t)},cu=function(){clearTimeout(tp)},se.unstable_shouldYield=function(){return!1},sp=se.unstable_forceFrameRate=function(){}):(o0=window.setTimeout,i0=window.clearTimeout,typeof console!="undefined"&&(s0=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 s0!="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")),Fs=!1,Hs=null,au=-1,rp=5,op=0,se.unstable_shouldYield=function(){return se.unstable_now()>=op},sp=function(){},se.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"):rp=0<e?Math.floor(1e3/e):5},ip=new MessageChannel,lu=ip.port2,ip.port1.onmessage=function(){if(Hs!==null){var e=se.unstable_now();op=e+rp;try{Hs(!0,e)?lu.postMessage(null):(Fs=!1,Hs=null)}catch(t){throw lu.postMessage(null),t}}else Fs=!1},yi=function(e){Hs=e,Fs||(Fs=!0,lu.postMessage(null))},Us=function(e,t){au=o0(function(){e(se.unstable_now())},t)},cu=function(){i0(au),au=-1});var hi,tp,np,o0,i0,s0,Fs,Hs,au,rp,op,ip,lu;function ap(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,o=e[r];if(o!==void 0&&0<uu(o,t))e[r]=t,e[n]=o,n=r;else break e}}function nn(e){return e=e[0],e===void 0?null:e}function du(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 i=2*(r+1)-1,s=e[i],a=i+1,l=e[a];if(s!==void 0&&0>uu(s,n))l!==void 0&&0>uu(l,s)?(e[r]=l,e[a]=n,r=a):(e[r]=s,e[i]=n,r=i);else if(l!==void 0&&0>uu(l,n))e[r]=l,e[a]=n,r=a;else break e}}return t}return null}function uu(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var xn=[],br=[],DP=1,zt=null,Qe=3,fu=!1,go=!1,zs=!1;function lp(e){for(var t=nn(br);t!==null;){if(t.callback===null)du(br);else if(t.startTime<=e)du(br),t.sortIndex=t.expirationTime,ap(xn,t);else break;t=nn(br)}}function up(e){if(zs=!1,lp(e),!go)if(nn(xn)!==null)go=!0,yi(cp);else{var t=nn(br);t!==null&&Us(up,t.startTime-e)}}function cp(e,t){go=!1,zs&&(zs=!1,cu()),fu=!0;var n=Qe;try{for(lp(t),zt=nn(xn);zt!==null&&(!(zt.expirationTime>t)||e&&!se.unstable_shouldYield());){var r=zt.callback;if(typeof r=="function"){zt.callback=null,Qe=zt.priorityLevel;var o=r(zt.expirationTime<=t);t=se.unstable_now(),typeof o=="function"?zt.callback=o:zt===nn(xn)&&du(xn),lp(t)}else du(xn);zt=nn(xn)}if(zt!==null)var i=!0;else{var s=nn(br);s!==null&&Us(up,s.startTime-t),i=!1}return i}finally{zt=null,Qe=n,fu=!1}}var FP=sp;se.unstable_IdlePriority=5;se.unstable_ImmediatePriority=1;se.unstable_LowPriority=4;se.unstable_NormalPriority=3;se.unstable_Profiling=null;se.unstable_UserBlockingPriority=2;se.unstable_cancelCallback=function(e){e.callback=null};se.unstable_continueExecution=function(){go||fu||(go=!0,yi(cp))};se.unstable_getCurrentPriorityLevel=function(){return Qe};se.unstable_getFirstCallbackNode=function(){return nn(xn)};se.unstable_next=function(e){switch(Qe){case 1:case 2:case 3:var t=3;break;default:t=Qe}var n=Qe;Qe=t;try{return e()}finally{Qe=n}};se.unstable_pauseExecution=function(){};se.unstable_requestPaint=FP;se.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Qe;Qe=e;try{return t()}finally{Qe=n}};se.unstable_scheduleCallback=function(e,t,n){var r=se.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:DP++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,ap(br,e),nn(xn)===null&&e===nn(br)&&(zs?cu():zs=!0,Us(up,n-r))):(e.sortIndex=o,ap(xn,e),go||fu||(go=!0,yi(cp))),e};se.unstable_wrapCallback=function(e){var t=Qe;return function(){var n=Qe;Qe=t;try{return e.apply(this,arguments)}finally{Qe=n}}}});var u0=Ae((tD,l0)=>{"use strict";l0.exports=a0()});var Yw=Ae($t=>{"use strict";var ic=H(),xe=Gl(),ze=u0();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(!ic)throw Error(O(227));var ES=new Set,ha={};function ko(e,t){Hi(e,t),Hi(e+"Capture",t)}function Hi(e,t){for(ha[e]=t,e=0;e<t.length;e++)ES.add(t[e])}var $n=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),HP=/^[: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]*$/,c0=Object.prototype.hasOwnProperty,d0={},f0={};function UP(e){return c0.call(f0,e)?!0:c0.call(d0,e)?!1:HP.test(e)?f0[e]=!0:(d0[e]=!0,!1)}function zP(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 BP(e,t,n,r){if(t===null||typeof t=="undefined"||zP(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 st(e,t,n,r,o,i,s){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=i,this.removeEmptyString=s}var $e={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$e[e]=new st(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$e[t]=new st(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$e[e]=new st(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$e[e]=new st(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){$e[e]=new st(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$e[e]=new st(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$e[e]=new st(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$e[e]=new st(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$e[e]=new st(e,5,!1,e.toLowerCase(),null,!1,!1)});var Sm=/[\-:]([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(Sm,wm);$e[t]=new st(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(Sm,wm);$e[t]=new st(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(Sm,wm);$e[t]=new st(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$e[e]=new st(e,1,!1,e.toLowerCase(),null,!1,!1)});$e.xlinkHref=new st("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$e[e]=new st(e,1,!1,e.toLowerCase(),null,!0,!0)});function xm(e,t,n,r){var o=$e.hasOwnProperty(t)?$e[t]:null,i=o!==null?o.type===0:r?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");i||(BP(t,n,o,r)&&(n=null),r||o===null?UP(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 Po=ic.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Js=60103,yo=60106,Tr=60107,Em=60108,oa=60114,bm=60109,Cm=60110,sc=60112,ia=60113,Du=60120,ac=60115,Tm=60116,km=60121,Pm=60128,bS=60129,Rm=60130,Np=60131;typeof Symbol=="function"&&Symbol.for&&(Ne=Symbol.for,Js=Ne("react.element"),yo=Ne("react.portal"),Tr=Ne("react.fragment"),Em=Ne("react.strict_mode"),oa=Ne("react.profiler"),bm=Ne("react.provider"),Cm=Ne("react.context"),sc=Ne("react.forward_ref"),ia=Ne("react.suspense"),Du=Ne("react.suspense_list"),ac=Ne("react.memo"),Tm=Ne("react.lazy"),km=Ne("react.block"),Ne("react.scope"),Pm=Ne("react.opaque.id"),bS=Ne("react.debug_trace_mode"),Rm=Ne("react.offscreen"),Np=Ne("react.legacy_hidden"));var Ne,p0=typeof Symbol=="function"&&Symbol.iterator;function Bs(e){return e===null||typeof e!="object"?null:(e=p0&&e[p0]||e["@@iterator"],typeof e=="function"?e:null)}var dp;function ea(e){if(dp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dp=t&&t[1]||""}return`
|
|
2
2
|
`+dp+e}var fp=!1;function pu(e,t){if(!e||fp)return"";fp=!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
|
`),i=r.stack.split(`
|
|
4
4
|
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a])return`
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
Error generating stack: `+i.message+`
|
|
7
7
|
`+i.stack}return{value:e,source:t,stack:o}}function lm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var uA=typeof WeakMap=="function"?WeakMap:Map;function Dw(e,t,n){n=Or(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rc||(rc=!0,mm=r),lm(e,t)},n}function Fw(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 lm(e,t),r(o)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(Cn===null?Cn=new Set([this]):Cn.add(this),lm(e,t));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}var cA=typeof WeakSet=="function"?WeakSet:Set;function pS(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 dA(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:rn(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&jm(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(O(163))}function fA(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&&($w(n,e),wA(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:rn(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&G0(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}G0(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&lw(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&&BS(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(O(163))}function mS(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=LS("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 gS(e,t){if(Eo&&typeof Eo.onCommitFiberUnmount=="function")try{Eo.onCommitFiberUnmount(Vm,t)}catch(i){}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)$w(t,n);else{r=t;try{o()}catch(i){Dr(r,i)}}n=n.next}while(n!==e)}break;case 1:if(pS(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){Dr(t,i)}break;case 5:pS(t);break;case 4:Hw(e,t)}}function hS(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 yS(e){return e.tag===5||e.tag===3||e.tag===4}function vS(e){e:{for(var t=e.return;t!==null;){if(yS(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||yS(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?um(e,n,t):cm(e,n,t)}function um(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(um(e,t,n),e=e.sibling;e!==null;)um(e,t,n),e=e.sibling}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.insertBefore(e,t):n.appendChild(e);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 Hw(e,t){for(var n=t,r=!1,o,i;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(O(160));switch(o=r.stateNode,r.tag){case 5:i=!1;break e;case 3:o=o.containerInfo,i=!0;break e;case 4:o=o.containerInfo,i=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var s=e,a=n,l=a;;)if(gS(s,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===a)break e;for(;l.sibling===null;){if(l.return===null||l.return===a)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}i?(s=o,a=n.stateNode,s.nodeType===8?s.parentNode.removeChild(a):s.removeChild(a)):o.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){o=n.stateNode.containerInfo,i=!0,n.child.return=n,n=n.child;continue}}else if(gS(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 Ap(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var o=e!==null?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,i!==null){for(n[Vu]=r,e==="input"&&r.type==="radio"&&r.name!=null&&kS(n,r),jp(e,o),t=jp(e,r),o=0;o<i.length;o+=2){var s=i[o],a=i[o+1];s==="style"?IS(n,a):s==="dangerouslySetInnerHTML"?AS(n,a):s==="children"?ya(n,a):xm(n,s,a,t)}switch(e){case"input":_p(n,r);break;case"textarea":PS(n,r);break;case"select":e=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!r.multiple,i=r.value,i!=null?Ai(n,!!r.multiple,i,!1):e!==!!r.multiple&&(r.defaultValue!=null?Ai(n,!!r.multiple,r.defaultValue,!0):Ai(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,BS(n.containerInfo));return;case 12:return;case 13:t.memoizedState!==null&&(og=Ze(),mS(t.child,!0)),SS(t);return;case 19:SS(t);return;case 17:return;case 23:case 24:mS(t,t.memoizedState!==null);return}throw Error(O(163))}function SS(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new cA),t.forEach(function(r){var o=bA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function pA(e,t){return e!==null&&(e=e.memoizedState,e===null||e.dehydrated!==null)?(t=t.memoizedState,t!==null&&t.dehydrated===null):!1}var mA=Math.ceil,nc=Po.ReactCurrentDispatcher,ng=Po.ReactCurrentOwner,W=0,it=null,Me=null,Je=0,To=0,dm=jr(0),We=0,hc=null,Ki=0,Na=0,Wi=0,rg=0,fm=null,og=0,pm=1/0;function $i(){pm=Ze()+500}var F=null,rc=!1,mm=null,Cn=null,zr=!1,pa=null,na=90,gm=[],hm=[],Wn=null,ma=0,ym=null,Ou=-1,jn=0,Nu=0,ga=null,Mu=!1;function kt(){return W&48?Ze():Ou!==-1?Ou:Ou=Ze()}function Mr(e){if(e=e.mode,!(e&2))return 1;if(!(e&4))return zi()===99?1:2;if(jn===0&&(jn=Ki),tA.transition!==0){Nu!==0&&(Nu=fm!==null?fm.pendingLanes:0),e=jn;var t=4186112&~Nu;return t&=-t,t===0&&(e=4186112&~e,t=e&-e,t===0&&(t=8192)),t}return e=zi(),W&4&&e===98?e=zu(12,jn):(e=oR(e),e=zu(e,jn)),e}function _r(e,t,n){if(50<ma)throw ma=0,ym=null,Error(O(185));if(e=yc(e,t),e===null)return null;uc(e,t,n),e===it&&(Wi|=t,We===4&&_i(e,Je));var r=zi();t===1?W&8&&!(W&48)?vm(e):(Wt(e,n),W===0&&($i(),Pn())):(!(W&4)||r!==98&&r!==99||(Wn===null?Wn=new Set([e]):Wn.add(e)),Wt(e,n)),fm=e}function yc(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 Wt(e,t){for(var n=e.callbackNode,r=e.suspendedLanes,o=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var a=31-Hr(s),l=1<<a,u=i[a];if(u===-1){if(!(l&r)||l&o){u=t,wi(l);var c=pe;i[a]=10<=c?u+250:6<=c?u+5e3:-1}}else u<=t&&(e.expiredLanes|=l);s&=~l}if(r=xa(e,e===it?Je:0),t=pe,r===0)n!==null&&(n!==Cp&&Jp(n),e.callbackNode=null,e.callbackPriority=0);else{if(n!==null){if(e.callbackPriority===t)return;n!==Cp&&Jp(n)}t===15?(n=vm.bind(null,e),Bn===null?(Bn=[n],Iu=Km(mc,hw)):Bn.push(n),n=Cp):t===14?n=Ta(99,vm.bind(null,e)):(n=iR(t),n=Ta(n,Uw.bind(null,e))),e.callbackPriority=t,e.callbackNode=n}}function Uw(e){if(Ou=-1,Nu=jn=0,W&48)throw Error(O(327));var t=e.callbackNode;if(Vr()&&e.callbackNode!==t)return null;var n=xa(e,e===it?Je:0);if(n===0)return null;var r=n,o=W;W|=16;var i=Vw();(it!==e||Je!==r)&&($i(),Di(e,r));do try{yA();break}catch(a){jw(e,a)}while(1);if(Wm(),nc.current=i,W=o,Me!==null?r=0:(it=null,Je=0,r=We),Ki&Wi)Di(e,0);else if(r!==0){if(r===2&&(W|=64,e.hydrate&&(e.hydrate=!1,jm(e.containerInfo)),n=GS(e),n!==0&&(r=ra(e,n))),r===1)throw t=hc,Di(e,0),_i(e,n),Wt(e,Ze()),t;switch(e.finishedWork=e.current.alternate,e.finishedLanes=n,r){case 0:case 1:throw Error(O(345));case 2:ho(e);break;case 3:if(_i(e,n),(n&62914560)===n&&(r=og+500-Ze(),10<r)){if(xa(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){kt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=z0(ho.bind(null,e),r);break}ho(e);break;case 4:if(_i(e,n),(n&4186112)===n)break;for(r=e.eventTimes,o=-1;0<n;){var s=31-Hr(n);i=1<<s,s=r[s],s>o&&(o=s),n&=~i}if(n=o,n=Ze()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*mA(n/1960))-n,10<n){e.timeoutHandle=z0(ho.bind(null,e),n);break}ho(e);break;case 5:ho(e);break;default:throw Error(O(329))}}return Wt(e,Ze()),e.callbackNode===t?Uw.bind(null,e):null}function _i(e,t){for(t&=~rg,t&=~Wi,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 vm(e){if(W&48)throw Error(O(327));if(Vr(),e===it&&e.expiredLanes&Je){var t=Je,n=ra(e,t);Ki&Wi&&(t=xa(e,t),n=ra(e,t))}else t=xa(e,0),n=ra(e,t);if(e.tag!==0&&n===2&&(W|=64,e.hydrate&&(e.hydrate=!1,jm(e.containerInfo)),t=GS(e),t!==0&&(n=ra(e,t))),n===1)throw n=hc,Di(e,0),_i(e,t),Wt(e,Ze()),n;return e.finishedWork=e.current.alternate,e.finishedLanes=t,ho(e),Wt(e,Ze()),null}function gA(){if(Wn!==null){var e=Wn;Wn=null,e.forEach(function(t){t.expiredLanes|=24&t.pendingLanes,Wt(t,Ze())})}Pn()}function zw(e,t){var n=W;W|=1;try{return e(t)}finally{W=n,W===0&&($i(),Pn())}}function Bw(e,t){var n=W;W&=-2,W|=8;try{return e(t)}finally{W=n,W===0&&($i(),Pn())}}function Tu(e,t){Re(dm,To),To|=t,Ki|=t}function ig(){To=dm.current,ye(dm)}function Di(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,YR(n)),Me!==null)for(n=Me.return;n!==null;){var r=n;switch(r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ku();break;case 3:Bi(),ye(Et),ye(et),Ym();break;case 5:Gm(r);break;case 4:Bi();break;case 13:ye(Pe);break;case 19:ye(Pe);break;case 10:$m(r);break;case 23:case 24:ig()}n=n.return}it=e,Me=Br(e.current,null),Je=To=Ki=t,We=0,hc=null,rg=Wi=Na=0}function jw(e,t){do{var n=Me;try{if(Wm(),da.current=tc,Xu){for(var r=Le.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Xu=!1}if(Aa=0,Ke=Xe=Le=null,fa=!1,ng.current=null,n===null||n.return===null){We=1,hc=t,Me=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Je,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=(Pe.current&1)!==0,d=s;do{var m;if(m=d.tag===13){var S=d.memoizedState;if(S!==null)m=S.dehydrated!==null;else{var y=d.memoizedProps;m=y.fallback===void 0?!1:y.unstable_avoidThisFallback!==!0?!0:!f}}if(m){var p=d.updateQueue;if(p===null){var g=new Set;g.add(u),d.updateQueue=g}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 v=i.pingCache;if(v===null?(v=i.pingCache=new uA,l=new Set,v.set(u,l)):(l=v.get(u),l===void 0&&(l=new Set,v.set(u,l))),!l.has(a)){l.add(a);var x=EA.bind(null,i,u,a);u.then(x,x)}d.flags|=4096,d.lanes=t;break e}d=d.return}while(d!==null);l=Error((Ri(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.`)}We!==5&&(We=2),l=tg(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var k=Dw(d,i,t);q0(d,k);break e;case 1:i=l;var C=d.type,R=d.stateNode;if(!(d.flags&64)&&(typeof C.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(Cn===null||!Cn.has(R)))){d.flags|=4096,t&=-t,d.lanes|=t;var N=Fw(d,i,t);q0(d,N);break e}}d=d.return}while(d!==null)}Ww(n)}catch(_){t=_,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(1)}function Vw(){var e=nc.current;return nc.current=tc,e===null?tc:e}function ra(e,t){var n=W;W|=16;var r=Vw();it===e&&Je===t||Di(e,t);do try{hA();break}catch(o){jw(e,o)}while(1);if(Wm(),W=n,nc.current=r,Me!==null)throw Error(O(261));return it=null,Je=0,We}function hA(){for(;Me!==null;)Kw(Me)}function yA(){for(;Me!==null&&!ZR();)Kw(Me)}function Kw(e){var t=qw(e.alternate,e,To);e.memoizedProps=e.pendingProps,t===null?Ww(e):Me=t,ng.current=null}function Ww(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=lA(t),n!==null){n.flags&=2047,Me=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=aA(n,t,To),n!==null){Me=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||To&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);We===0&&(We=5)}function ho(e){var t=zi();return Co(99,vA.bind(null,e,t)),null}function vA(e,t){do Vr();while(pa!==null);if(W&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,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-Hr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(Wn!==null&&!(r&24)&&Wn.has(e)&&Wn.delete(e),e===it&&(Me=it=null,Je=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=W,W|=32,ng.current=null,xp=Pu,s=M0(),Gp(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch(_){a=null;break e}var c=0,f=-1,d=-1,m=0,S=0,y=s,p=null;t:for(;;){for(var g;y!==a||i!==0&&y.nodeType!==3||(f=c+i),y!==l||u!==0&&y.nodeType!==3||(d=c+u),y.nodeType===3&&(c+=y.nodeValue.length),(g=y.firstChild)!==null;)p=y,y=g;for(;;){if(y===s)break t;if(p===a&&++m===i&&(f=c),p===l&&++S===u&&(d=c),(g=y.nextSibling)!==null)break;y=p,p=y.parentNode}y=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;Ep={focusedElem:s,selectionRange:a},Pu=!1,ga=null,Mu=!1,F=r;do try{SA()}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);ga=null,F=r;do try{for(s=e;F!==null;){var h=F.flags;if(h&16&&ya(F.stateNode,""),h&128){var v=F.alternate;if(v!==null){var x=v.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(h&1038){case 2:vS(F),F.flags&=-3;break;case 6:vS(F),F.flags&=-3,Ap(F.alternate,F);break;case 1024:F.flags&=-1025;break;case 1028:F.flags&=-1025,Ap(F.alternate,F);break;case 4:Ap(F.alternate,F);break;case 8:a=F,Hw(s,a);var k=a.alternate;hS(a),k!==null&&hS(k)}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);if(x=Ep,v=M0(),h=x.focusedElem,s=x.selectionRange,v!==h&&h&&h.ownerDocument&&nw(h.ownerDocument.documentElement,h)){for(s!==null&&Gp(h)&&(v=s.start,x=s.end,x===void 0&&(x=v),"selectionStart"in h?(h.selectionStart=v,h.selectionEnd=Math.min(x,h.value.length)):(x=(v=h.ownerDocument||document)&&v.defaultView||window,x.getSelection&&(x=x.getSelection(),a=h.textContent.length,k=Math.min(s.start,a),s=s.end===void 0?k:Math.min(s.end,a),!x.extend&&k>s&&(a=s,s=k,k=a),a=N0(h,k),i=N0(h,s),a&&i&&(x.rangeCount!==1||x.anchorNode!==a.node||x.anchorOffset!==a.offset||x.focusNode!==i.node||x.focusOffset!==i.offset)&&(v=v.createRange(),v.setStart(a.node,a.offset),x.removeAllRanges(),k>s?(x.addRange(v),x.extend(i.node,i.offset)):(v.setEnd(i.node,i.offset),x.addRange(v)))))),v=[],x=h;x=x.parentNode;)x.nodeType===1&&v.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<v.length;h++)x=v[h],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}Pu=!!xp,Ep=xp=null,e.current=n,F=r;do try{for(h=e;F!==null;){var C=F.flags;if(C&36&&fA(h,F.alternate,F),C&128){v=void 0;var R=F.ref;if(R!==null){var N=F.stateNode;switch(F.tag){case 5:v=N;break;default:v=N}typeof R=="function"?R(v):R.current=v}}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);F=null,eA(),W=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&&(C=F,C.sibling=null,C.stateNode=null),F=t;if(r=e.pendingLanes,r===0&&(Cn=null),r===1?e===ym?ma++:(ma=0,ym=e):ma=0,n=n.stateNode,Eo&&typeof Eo.onCommitFiberRoot=="function")try{Eo.onCommitFiberRoot(Vm,n,void 0,(n.current.flags&64)===64)}catch(_){}if(Wt(e,Ze()),rc)throw rc=!1,e=mm,mm=null,e;return W&8||Pn(),null}function SA(){for(;F!==null;){var e=F.alternate;Mu||ga===null||(F.flags&8?w0(F,ga)&&(Mu=!0):F.tag===13&&pA(e,F)&&w0(F,ga)&&(Mu=!0));var t=F.flags;t&256&&dA(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,Co(e,xA)}return!1}function wA(e,t){gm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function $w(e,t){hm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function xA(){if(pa===null)return!1;var e=pa;if(pa=null,W&48)throw Error(O(331));var t=W;W|=32;var n=hm;hm=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(O(330));Dr(i,l)}}for(n=gm,gm=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(O(330));Dr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return W=t,Pn(),!0}function wS(e,t,n){t=tg(n,t),t=Dw(e,t,1),Nr(e,t),t=kt(),e=yc(e,1),e!==null&&(uc(e,1,t),Wt(e,t))}function Dr(e,t){if(e.tag===3)wS(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){wS(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Cn===null||!Cn.has(r))){e=tg(t,e);var o=Fw(n,e,1);if(Nr(n,o),o=kt(),n=yc(n,1),n!==null)uc(n,1,o),Wt(n,o);else if(typeof r.componentDidCatch=="function"&&(Cn===null||!Cn.has(r)))try{r.componentDidCatch(t,e)}catch(i){}break}}n=n.return}}function EA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=kt(),e.pingedLanes|=e.suspendedLanes&n,it===e&&(Je&n)===n&&(We===4||We===3&&(Je&62914560)===Je&&500>Ze()-og?Di(e,0):rg|=n),Wt(e,t)}function bA(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(jn===0&&(jn=Ki),t=xi(62914560&~jn),t===0&&(t=4194304)):t=zi()===99?1:2:t=1),n=kt(),e=yc(e,t),e!==null&&(uc(e,t,n),Wt(e,n))}var qw;qw=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)on=!0;else if(n&r)on=!!(e.flags&16384);else{switch(on=!1,t.tag){case 3:sS(t),kp();break;case 5:X0(t);break;case 1:bt(t.type)&&Lu(t);break;case 4:nm(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;Re(Wu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?aS(e,t,n):(Re(Pe,Pe.current&1),t=Kn(e,t,n),t!==null?t.sibling:null);Re(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return fS(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Re(Pe,Pe.current),r)break;return null;case 23:case 24:return t.lanes=0,Pp(e,t,n)}return Kn(e,t,n)}else on=!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=Ui(t,et.current),Ni(t,n),o=Xm(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,bt(r)){var i=!0;Lu(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qm(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&Gu(t,r,s,e),o.updater=gc,t.stateNode=o,o._reactInternals=t,tm(t,r,e,n),t=sm(null,t,r,!0,i,n)}else t.tag=0,xt(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=TA(o),e=rn(o,e),i){case 0:t=im(null,t,o,e,n);break e;case 1:t=iS(null,t,o,e,n);break e;case 11:t=rS(null,t,o,e,n);break e;case 14:t=oS(null,t,o,rn(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:rn(r,o),im(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),iS(e,t,r,o,n);case 3:if(sS(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,vw(e,t),ka(t,r,null,n),r=t.memoizedState.element,r===o)kp(),t=Kn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(Rr=Oi(t.stateNode.containerInfo.firstChild),Vn=t,i=kn=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],Mi.push(i);for(n=Ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else xt(e,t,r,n),kp();t=t.child}return t;case 5:return X0(t),e===null&&rm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Xp(r,o)?s=null:i!==null&&Xp(r,i)&&(t.flags|=16),Ow(e,t),xt(e,t,s,n),t.child;case 6:return e===null&&rm(t),null;case 13:return aS(e,t,n);case 4:return nm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Yu(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),rS(e,t,r,o,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(Re(Wu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=Bt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!Et.current){t=Kn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=Or(-1,n&-n),u.tag=2,Nr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),yw(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,Ni(t,n),o=Kt(o,i.unstable_observedBits),r=r(o),t.flags|=1,xt(e,t,r,n),t.child;case 14:return o=t.type,i=rn(o,t.pendingProps),i=rn(o.type,i),oS(e,t,o,i,r,n);case 15:return Iw(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,bt(r)?(e=!0,Lu(t)):e=!1,Ni(t,n),ww(t,r,o),tm(t,r,o,n),sm(null,t,r,!0,e,n);case 19:return fS(e,t,n);case 23:return Pp(e,t,n);case 24:return Pp(e,t,n)}throw Error(O(156,t.tag))};function CA(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 jt(e,t,n,r){return new CA(e,t,n,r)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TA(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===ac)return 14}return 2}function Br(e,t){var n=e.alternate;return n===null?(n=jt(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 _u(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")sg(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Tr:return Fi(n.children,o,i,t);case bS:s=8,o|=16;break;case Em:s=8,o|=1;break;case oa:return e=jt(12,n,t,o|8),e.elementType=oa,e.type=oa,e.lanes=i,e;case ia:return e=jt(13,n,t,o),e.type=ia,e.elementType=ia,e.lanes=i,e;case Du:return e=jt(19,n,t,o),e.elementType=Du,e.lanes=i,e;case Rm:return ag(n,o,i,t);case Np:return e=jt(24,n,t,o),e.elementType=Np,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bm:s=10;break e;case Cm:s=9;break e;case sc:s=11;break e;case ac:s=14;break e;case Tm:s=16,r=null;break e;case km:s=22;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=jt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fi(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function ag(e,t,n,r){return e=jt(23,e,r,t),e.elementType=Rm,e.lanes=n,e}function Lp(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function Ip(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kA(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=gp(0),this.expirationTimes=gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gp(0),this.mutableSourceEagerHydrationData=null}function PA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oc(e,t,n,r){var o=t.current,i=kt(),s=Mr(o);e:if(n){n=n._reactInternals;t:{if(Ro(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(bt(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(bt(l)){n=cw(n,l,a);break e}}n=a}else n=Ur;return t.context===null?t.context=n:t.pendingContext=n,t=Or(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Nr(o,t),_r(o,s,i),s}function Op(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 xS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lg(e,t){xS(e,t),(e=e.alternate)&&xS(e,t)}function RA(){return null}function ug(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new kA(e,t,n!=null&&n.hydrate===!0),t=jt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,qm(t),e[Vi]=n.current,iw(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}ug.prototype.render=function(e){oc(e,this._internalRoot,null,null)};ug.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;oc(null,e,null,function(){t[Vi]=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 AA(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 ug(e,0,t?{hydrate:!0}:void 0)}function vc(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Op(s);a.call(u)}}oc(t,s,e,o)}else{if(i=n._reactRootContainer=AA(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Op(s);l.call(u)}}Bw(function(){oc(t,s,e,o)})}return Op(s)}HS=function(e){if(e.tag===13){var t=kt();_r(e,4,t),lg(e,4)}};Nm=function(e){if(e.tag===13){var t=kt();_r(e,67108864,t),lg(e,67108864)}};US=function(e){if(e.tag===13){var t=kt(),n=Mr(e);_r(e,n,t),lg(e,n)}};zS=function(e,t){return t()};Vp=function(e,t,n){switch(t){case"input":if(_p(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=pc(r);if(!o)throw Error(O(90));TS(r),_p(r,o)}}}break;case"textarea":PS(e,n);break;case"select":t=n.value,t!=null&&Ai(e,!!n.multiple,t,!1)}};Lm=zw;MS=function(e,t,n,r,o){var i=W;W|=4;try{return Co(98,e.bind(null,t,n,r,o))}finally{W=i,W===0&&($i(),Pn())}};Im=function(){!(W&49)&&(gA(),Vr())};_S=function(e,t){var n=W;W|=2;try{return e(t)}finally{W=n,W===0&&($i(),Pn())}};function Gw(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(O(200));return PA(e,t,null,n)}var LA={Events:[Ia,Ti,pc,OS,NS,Vr,{current:!1}]},Xs={findFiberByHostInstance:So,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},IA={bundleType:Xs.bundleType,version:Xs.version,rendererPackageName:Xs.rendererPackageName,rendererConfig:Xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Po.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=FS(e),e===null?null:e.stateNode},findFiberByHostInstance:Xs.findFiberByHostInstance||RA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Zs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Zs.isDisabled&&Zs.supportsFiber))try{Vm=Zs.inject(IA),Eo=Zs}catch(e){}var Zs;$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LA;$t.createPortal=Gw;$t.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=FS(t),e=e===null?null:e.stateNode,e};$t.flushSync=function(e,t){var n=W;if(n&48)return e(t);W|=1;try{if(e)return Co(99,e.bind(null,t))}finally{W=n,Pn()}};$t.hydrate=function(e,t,n){if(!Ma(t))throw Error(O(200));return vc(null,e,t,!0,n)};$t.render=function(e,t,n){if(!Ma(t))throw Error(O(200));return vc(null,e,t,!1,n)};$t.unmountComponentAtNode=function(e){if(!Ma(e))throw Error(O(40));return e._reactRootContainer?(Bw(function(){vc(null,null,e,!1,function(){e._reactRootContainer=null,e[Vi]=null})}),!0):!1};$t.unstable_batchedUpdates=zw;$t.unstable_createPortal=function(e,t){return Gw(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};$t.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 vc(e,t,n,!1,r)};$t.version="17.0.2"});var Sc=Ae((nD,Xw)=>{"use strict";function Qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qw)}catch(e){console.error(e)}}Qw(),Xw.exports=Yw()});var Tx=Ae(Cx=>{"use strict";var Zi=H();function gL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hL=typeof Object.is=="function"?Object.is:gL,yL=Zi.useState,vL=Zi.useEffect,SL=Zi.useLayoutEffect,wL=Zi.useDebugValue;function xL(e,t){var n=t(),r=yL({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return SL(function(){o.value=n,o.getSnapshot=t,Dg(o)&&i({inst:o})},[e,n,t]),vL(function(){return Dg(o)&&i({inst:o}),e(function(){Dg(o)&&i({inst:o})})},[e]),wL(n),n}function Dg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hL(e,n)}catch(r){return!0}}function EL(e,t){return t()}var bL=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?EL:xL;Cx.useSyncExternalStore=Zi.useSyncExternalStore!==void 0?Zi.useSyncExternalStore:bL});var Fg=Ae((VD,kx)=>{"use strict";kx.exports=Tx()});var Rx=Ae(Px=>{"use strict";var Pc=H(),CL=Fg();function TL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kL=typeof Object.is=="function"?Object.is:TL,PL=CL.useSyncExternalStore,RL=Pc.useRef,AL=Pc.useEffect,LL=Pc.useMemo,IL=Pc.useDebugValue;Px.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=RL(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=LL(function(){function l(m){if(!u){if(u=!0,c=m,m=r(m),o!==void 0&&s.hasValue){var S=s.value;if(o(S,m))return f=S}return f=m}if(S=f,kL(c,m))return S;var y=r(m);return o!==void 0&&o(S,y)?S:(c=m,f=y)}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=PL(e,i[0],i[1]);return AL(function(){s.hasValue=!0,s.value=a},[a]),IL(a),a}});var Lx=Ae((WD,Ax)=>{"use strict";Ax.exports=Rx()});var Bx=Ae(le=>{"use strict";var Be=typeof Symbol=="function"&&Symbol.for,Ug=Be?Symbol.for("react.element"):60103,zg=Be?Symbol.for("react.portal"):60106,Ic=Be?Symbol.for("react.fragment"):60107,Oc=Be?Symbol.for("react.strict_mode"):60108,Nc=Be?Symbol.for("react.profiler"):60114,Mc=Be?Symbol.for("react.provider"):60109,_c=Be?Symbol.for("react.context"):60110,Bg=Be?Symbol.for("react.async_mode"):60111,Dc=Be?Symbol.for("react.concurrent_mode"):60111,Fc=Be?Symbol.for("react.forward_ref"):60112,Hc=Be?Symbol.for("react.suspense"):60113,_L=Be?Symbol.for("react.suspense_list"):60120,Uc=Be?Symbol.for("react.memo"):60115,zc=Be?Symbol.for("react.lazy"):60116,DL=Be?Symbol.for("react.block"):60121,FL=Be?Symbol.for("react.fundamental"):60117,HL=Be?Symbol.for("react.responder"):60118,UL=Be?Symbol.for("react.scope"):60119;function At(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ug:switch(e=e.type,e){case Bg:case Dc:case Ic:case Nc:case Oc:case Hc:return e;default:switch(e=e&&e.$$typeof,e){case _c:case Fc:case zc:case Uc:case Mc:return e;default:return t}}case zg:return t}}}function zx(e){return At(e)===Dc}le.AsyncMode=Bg;le.ConcurrentMode=Dc;le.ContextConsumer=_c;le.ContextProvider=Mc;le.Element=Ug;le.ForwardRef=Fc;le.Fragment=Ic;le.Lazy=zc;le.Memo=Uc;le.Portal=zg;le.Profiler=Nc;le.StrictMode=Oc;le.Suspense=Hc;le.isAsyncMode=function(e){return zx(e)||At(e)===Bg};le.isConcurrentMode=zx;le.isContextConsumer=function(e){return At(e)===_c};le.isContextProvider=function(e){return At(e)===Mc};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ug};le.isForwardRef=function(e){return At(e)===Fc};le.isFragment=function(e){return At(e)===Ic};le.isLazy=function(e){return At(e)===zc};le.isMemo=function(e){return At(e)===Uc};le.isPortal=function(e){return At(e)===zg};le.isProfiler=function(e){return At(e)===Nc};le.isStrictMode=function(e){return At(e)===Oc};le.isSuspense=function(e){return At(e)===Hc};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ic||e===Dc||e===Nc||e===Oc||e===Hc||e===_L||typeof e=="object"&&e!==null&&(e.$$typeof===zc||e.$$typeof===Uc||e.$$typeof===Mc||e.$$typeof===_c||e.$$typeof===Fc||e.$$typeof===FL||e.$$typeof===HL||e.$$typeof===UL||e.$$typeof===DL)};le.typeOf=At});var Vx=Ae((i4,jx)=>{"use strict";jx.exports=Bx()});var Qx=Ae((s4,Yx)=>{"use strict";var jg=Vx(),zL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},BL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},jL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Vg={};Vg[jg.ForwardRef]=jL;Vg[jg.Memo]=qx;function Kx(e){return jg.isMemo(e)?qx:Vg[e.$$typeof]||zL}var VL=Object.defineProperty,KL=Object.getOwnPropertyNames,Wx=Object.getOwnPropertySymbols,WL=Object.getOwnPropertyDescriptor,$L=Object.getPrototypeOf,$x=Object.prototype;function Gx(e,t,n){if(typeof t!="string"){if($x){var r=$L(t);r&&r!==$x&&Gx(e,r,n)}var o=KL(t);Wx&&(o=o.concat(Wx(t)));for(var i=Kx(e),s=Kx(t),a=0;a<o.length;++a){var l=o[a];if(!BL[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=WL(t,l);try{VL(e,l,u)}catch(c){}}}}return e}Yx.exports=Gx});var Zx=Ae(ue=>{"use strict";var Kg=Symbol.for("react.element"),Wg=Symbol.for("react.portal"),Bc=Symbol.for("react.fragment"),jc=Symbol.for("react.strict_mode"),Vc=Symbol.for("react.profiler"),Kc=Symbol.for("react.provider"),Wc=Symbol.for("react.context"),qL=Symbol.for("react.server_context"),$c=Symbol.for("react.forward_ref"),qc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Yc=Symbol.for("react.memo"),Qc=Symbol.for("react.lazy"),GL=Symbol.for("react.offscreen"),Xx;Xx=Symbol.for("react.module.reference");function Gt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Kg:switch(e=e.type,e){case Bc:case Vc:case jc:case qc:case Gc:return e;default:switch(e=e&&e.$$typeof,e){case qL:case Wc:case $c:case Qc:case Yc:case Kc:return e;default:return t}}case Wg:return t}}}ue.ContextConsumer=Wc;ue.ContextProvider=Kc;ue.Element=Kg;ue.ForwardRef=$c;ue.Fragment=Bc;ue.Lazy=Qc;ue.Memo=Yc;ue.Portal=Wg;ue.Profiler=Vc;ue.StrictMode=jc;ue.Suspense=qc;ue.SuspenseList=Gc;ue.isAsyncMode=function(){return!1};ue.isConcurrentMode=function(){return!1};ue.isContextConsumer=function(e){return Gt(e)===Wc};ue.isContextProvider=function(e){return Gt(e)===Kc};ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kg};ue.isForwardRef=function(e){return Gt(e)===$c};ue.isFragment=function(e){return Gt(e)===Bc};ue.isLazy=function(e){return Gt(e)===Qc};ue.isMemo=function(e){return Gt(e)===Yc};ue.isPortal=function(e){return Gt(e)===Wg};ue.isProfiler=function(e){return Gt(e)===Vc};ue.isStrictMode=function(e){return Gt(e)===jc};ue.isSuspense=function(e){return Gt(e)===qc};ue.isSuspenseList=function(e){return Gt(e)===Gc};ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Bc||e===Vc||e===jc||e===qc||e===Gc||e===GL||typeof e=="object"&&e!==null&&(e.$$typeof===Qc||e.$$typeof===Yc||e.$$typeof===Kc||e.$$typeof===Wc||e.$$typeof===$c||e.$$typeof===Xx||e.getModuleId!==void 0)};ue.typeOf=Gt});var e1=Ae((l4,Jx)=>{"use strict";Jx.exports=Zx()});var xh=Ae((G6,kE)=>{"use strict";var QI="Expected a function",CE=NaN,XI="[object Symbol]",ZI=/^\s+|\s+$/g,JI=/^[-+]0x[0-9a-f]+$/i,eO=/^0b[01]+$/i,tO=/^0o[0-7]+$/i,nO=parseInt,rO=typeof global=="object"&&global&&global.Object===Object&&global,oO=typeof self=="object"&&self&&self.Object===Object&&self,iO=rO||oO||Function("return this")(),sO=Object.prototype,aO=sO.toString,lO=Math.max,uO=Math.min,Sh=function(){return iO.Date.now()};function cO(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(QI);t=TE(t)||0,wh(n)&&(c=!!n.leading,f="maxWait"in n,i=f?lO(TE(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(C){var R=r,N=o;return r=o=void 0,u=C,s=e.apply(N,R),s}function S(C){return u=C,a=setTimeout(g,t),c?m(C):s}function y(C){var R=C-l,N=C-u,_=t-R;return f?uO(_,i-N):_}function p(C){var R=C-l,N=C-u;return l===void 0||R>=t||R<0||f&&N>=i}function g(){var C=Sh();if(p(C))return h(C);a=setTimeout(g,y(C))}function h(C){return a=void 0,d&&r?m(C):(r=o=void 0,s)}function v(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function x(){return a===void 0?s:h(Sh())}function k(){var C=Sh(),R=p(C);if(r=arguments,o=this,l=C,R){if(a===void 0)return S(l);if(f)return a=setTimeout(g,t),m(l)}return a===void 0&&(a=setTimeout(g,t)),s}return k.cancel=v,k.flush=x,k}function wh(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function dO(e){return!!e&&typeof e=="object"}function fO(e){return typeof e=="symbol"||dO(e)&&aO.call(e)==XI}function TE(e){if(typeof e=="number")return e;if(fO(e))return CE;if(wh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=wh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ZI,"");var n=eO.test(e);return n||tO.test(e)?nO(e.slice(2),n?2:8):JI.test(e)?CE:+e}kE.exports=cO});var _E=Ae((v9,ME)=>{"use strict";var vO=/["'&<>]/;ME.exports=SO;function SO(e){var t=""+e,n=vO.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var x_={};Ye(x_,{Card:()=>ge,ContentEditableInput:()=>Jo,DeepdeskAPI:()=>yr,DeepdeskSDK:()=>Hl,HTTPClient:()=>hr,InputMediator:()=>gr,InputType:()=>gi,KeyboardHint:()=>tu,Label:()=>nu,Locale:()=>ja,Section:()=>wn,SectionList:()=>ru,Sources:()=>zn,Suggestion:()=>re,SuggestionList:()=>St,TextAreaInput:()=>ei,ToggleButton:()=>mo,attachFile:()=>Hk,authenticateWithKey:()=>Uk,createFullRange:()=>Ts,createOverlayContainer:()=>Fl,createRangeFromOffsets:()=>ao,escapeHTML:()=>cs,formatTextMarkup:()=>zk,getRangeOffsets:()=>Nl,getRangeText:()=>Ml,insertCKEditor:()=>Kk,isHTML:()=>Ud,isSupportedInputElement:()=>Nf,updateContentEditable:()=>jk,updateTextArea:()=>Bk,useClickOutsideRoot:()=>to,useStyles:()=>L,waitForElementVisibilityChange:()=>Df});var Zf=w(oe()),Ut=w(H());var Xl=w(H()),Ov=w(oe());var _s=Xl.default.createContext({});function L(e,t){let i=(0,Xl.useContext)(_s),{debug:n}=i,o=te(i,["debug"])[e];return Object.entries(t).reduce((s,[a,l])=>{let u=o==null?void 0:o[a];return I(T({},s),{[a]:(0,Ov.default)(l,u,n?`${e}__${a}`:!1)})},{})}var Nv={root:"dd-4s9wq"};var fo=w(b()),Zl=()=>(0,fo.jsxs)("svg",{className:Nv.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,fo.jsx)("defs",{children:(0,fo.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,fo.jsx)("title",{children:"Failed loading image"}),(0,fo.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 Xf={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var po=w(b()),Jl=(0,Ut.createContext)(Xf),SP=({title:e,src:t})=>{let n=(0,Ut.useContext)(Jl),[r,o]=(0,Ut.useState)(!1);return(0,Ut.useEffect)(()=>{o(!1)},[t]),(0,po.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,po.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,po.jsx)(Zl,{})})},wP=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Ut.useContext)(Jl);return(0,po.jsx)("div",{className:(0,Zf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},xP=i=>{var s=i,{as:e="h1",cropText:t=!1,className:n,children:r}=s,o=te(s,["as","cropText","className","children"]);let a=(0,Ut.useContext)(Jl);return Ut.default.createElement(e,T({className:(0,Zf.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},eu=({children:e})=>{let t=L("Card",Xf);return(0,po.jsx)("div",{className:t.root,children:(0,po.jsx)(Jl.Provider,{value:t,children:e})})};eu.Image=SP;eu.Content=wP;eu.Title=xP;var ge=eu;var Uv=w(oe());var Hv={root:"dd-llBx9"};var zv=w(b());var EP={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},bP=r=>{var o=r,{className:e,keyCode:t}=o,n=te(o,["className","keyCode"]);let i=L("KeyboardHint",Hv);return(0,zv.jsx)("span",T({"data-key":EP[t],className:(0,Uv.default)(e,i.root)},n))},tu=bP;var jv=w(oe());var Bv={root:"dd-e6HXZ"};var Vv=w(b()),CP=r=>{var o=r,{className:e,children:t}=o,n=te(o,["className","children"]);let i=L("Label",Bv);return(0,Vv.jsx)("span",I(T({},n),{className:(0,jv.default)(e,i.root),children:t}))},nu=CP;var Kv={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var pi=w(b()),TP=o=>{var i=o,{title:e,children:t,type:n}=i,r=te(i,["title","children","type"]);let s=L("Section",Kv);return(0,pi.jsxs)("section",I(T({},r),{className:s.root,"data-section-type":n,children:[e&&(0,pi.jsx)("div",{className:s.subTitleContainer,children:(0,pi.jsx)("span",{className:s.subtitle,children:e})}),(0,pi.jsx)("div",{className:s.suggestions,children:t})]}))},wn=TP;var $v=w(oe()),qv=w(H());var Wv={root:"dd-uoTXh"};var Gv=w(b()),kP=qv.default.forwardRef(({className:e,children:t},n)=>{let r=L("SectionList",Wv);return(0,Gv.jsx)("div",{ref:n,className:(0,$v.default)(r.root,e),children:t})}),ru=kP;var mi=w(oe()),vt=w(H());var Jf={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 yt=w(b()),xr=(0,vt.createContext)(Jf),PP=r=>{var o=r,{fixed:e,children:t}=o,n=te(o,["fixed","children"]);let i=(0,vt.useContext)(xr);return(0,yt.jsx)("div",I(T({},n),{className:(0,mi.default)(i.actions,{[i.actionsIsFixed]:e}),children:t}))};function RP(a){var l=a,{as:e,className:t,icon:n,title:r,children:o,disabled:i}=l,s=te(l,["as","className","icon","title","children","disabled"]);let u=(0,vt.useContext)(xr);return(0,yt.jsxs)(e||"button",I(T({type:"button",className:(0,mi.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:i},t),title:r,"aria-label":r},s),{children:[n,o]}))}var AP=({children:e})=>{let t=(0,vt.useContext)(xr);return(0,yt.jsx)("div",{className:t.buttonsContainer,children:e})},LP=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,vt.useContext)(xr);return(0,yt.jsxs)("div",{className:(0,mi.default)(e,i.actionButton,i.dropdownButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[r,(0,yt.jsx)("ul",{className:i.dropdownList,children:o})]})},IP=({index:e,label:t,onClick:n})=>{let r=(0,vt.useContext)(xr);return(0,yt.jsx)("li",{className:r.dropdownItem,children:(0,yt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},OP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,vt.useContext)(xr);return(0,yt.jsx)("button",{type:"button",className:(0,mi.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r!=null?r:s=>s.stopPropagation(),disabled:n,"aria-hidden":n,children:o})},NP=({labels:e})=>{let t=(0,vt.useContext)(xr);return(0,yt.jsx)("div",{className:t.labels,children:e.map(n=>(0,yt.jsx)("span",{className:t.label,children:n},n))})},Er=vt.default.forwardRef((a,s)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,i=te(l,["className","selected","onClick","children","as"]);let u=L("Suggestion",Jf),c=(0,vt.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,yt.jsx)(o,I(T({},i),{ref:s,className:(0,mi.default)(e,u.root,{[u.isSelected]:t,[u.isClickable]:!!n}),onClick:c,children:(0,yt.jsx)(xr.Provider,{value:u,children:r})}))});Er.Labels=NP;Er.Actions=PP;Er.ActionButton=OP;Er.DropdownButton=LP;Er.DropdownItem=IP;Er.ButtonsContainer=AP;Er.Button=RP;var re=Er;var Qv=w(oe());var Yv={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Xv=w(b()),MP=({withDivider:e,children:t})=>{let n=L("SuggestionList",Yv);return(0,Xv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Qv.default)(n.root,{[n.isWithDivider]:e}),children:t})},St=MP;var Jv=w(oe());var Zv={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var ou=w(b()),_P=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=L("ToggleButton",Zv);return(0,ou.jsx)("button",{type:"button",className:(0,Jv.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,ou.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,ou.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},mo=_P;var e0=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,iu=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var t0=/x-deepdesk-(([a-z0-9\-_])+-version)/,su=["cues","custom-data"],zn=(y=>(y.SEARCH="search",y.TEMPLATE="template",y.ELASTIC_SEARCH="search-autocomplete",y.GPT="gpt",y.TRIE="trie",y.TRIE_WITH_TYPOS="trie-with-typos",y.SEMANTIC="semantic",y.TEXT_RECOMMENDATION="text_recommendation",y.URL_RECOMMENDATION="url_recommendation",y.LINK_RECOMMENDATION="link_recommendation",y.PERSONAL_COLLECTION="personal-collection",y.PERSONAL_COLLECTION_SEARCH="personal-collection-search",y.SEARCH_OVERLAY="search-overlay",y.SEARCH_PREVIEW="search-preview",y.SEARCH_URL="search-url",y))(zn||{}),gi=(s=>(s.ENTER="enter",s.TAB="tab",s.ARROW="arrow",s.HOTKEY="hotkey",s.MOUSE="mouse",s.SPACE="space",s))(gi||{});var tn=w(Sc());var zb=w(H());function qt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!1)var o,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function qn(e){return!!e&&!!e[Ee]}function sn(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)===UA}(e)||Array.isArray(e)||!!e[ox]||!!(!((t=e.constructor)===null||t===void 0)&&t[ox])||vg(e)||Sg(e))}function Lo(e,t,n){n===void 0&&(n=!1),Yi(e)===0?(n?Object.keys:Gi)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Yi(e){var t=e[Ee];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:vg(e)?2:Sg(e)?3:0}function qi(e,t){return Yi(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function OA(e,t){return Yi(e)===2?e.get(t):e[t]}function ix(e,t,n){var r=Yi(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function sx(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function vg(e){return FA&&e instanceof Map}function Sg(e){return HA&&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=ux(e);delete t[Ee];for(var n=Gi(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function xg(e,t){return t===void 0&&(t=!1),Eg(e)||qn(e)||!sn(e)||(Yi(e)>1&&(e.set=e.add=e.clear=e.delete=NA),Object.freeze(e),t&&Lo(e,function(n,r){return xg(r,!0)},!0)),e}function NA(){qt(2)}function Eg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Rn(e){var t=yg[e];return t||qt(18,e),t}function MA(e,t){yg[e]||(yg[e]=t)}function mg(){return Da}function cg(e,t){t&&(Rn("Patches"),e.u=[],e.s=[],e.v=t)}function wc(e){gg(e),e.p.forEach(_A),e.p=null}function gg(e){e===Da&&(Da=e.l)}function Zw(e){return Da={p:[],l:Da,h:e,m:!0,_:0}}function _A(e){var t=e[Ee];t.i===0||t.i===1?t.j():t.g=!0}function dg(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||Rn("ES5").S(t,e,r),r?(n[Ee].P&&(wc(t),qt(4)),sn(e)&&(e=xc(t,e),t.l||Ec(t,e)),t.u&&Rn("Patches").M(n[Ee].t,e,t.u,t.s)):e=xc(t,n,[]),wc(t),t.u&&t.v(t.u,t.s),e!==lx?e:void 0}function xc(e,t,n){if(Eg(t))return t;var r=t[Ee];if(!r)return Lo(t,function(a,l){return Jw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ec(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,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),Lo(i,function(a,l){return Jw(e,r,o,a,l,n,s)}),Ec(e,o,!1),n&&e.u&&Rn("Patches").N(r,n,e.u,e.s)}return r.o}function Jw(e,t,n,r,o,i,s){if(qn(o)){var a=xc(e,o,i&&t&&t.i!==3&&!qi(t.R,r)?i.concat(r):void 0);if(ix(n,r,a),!qn(a))return;e.m=!1}else s&&n.add(o);if(sn(o)&&!Eg(o)){if(!e.h.D&&e._<1)return;xc(e,o),t&&t.A.l||Ec(e,o)}}function Ec(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&xg(t,n)}function fg(e,t){var n=e[Ee];return(n?Kr(n):e)[t]}function ex(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 pg(e){e.o||(e.o=wg(e.t))}function hg(e,t,n){var r=vg(t)?Rn("MapSet").F(t,n):Sg(t)?Rn("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:mg(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=a,u=Fa;s&&(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):Rn("ES5").J(t,n);return(n?n.A:mg()).p.push(r),r}function DA(e){return qn(e)||qt(22,e),function t(n){if(!sn(n))return n;var r,o=n[Ee],i=Yi(n);if(o){if(!o.P&&(o.i<4||!Rn("ES5").K(o)))return o.t;o.I=!0,r=tx(n,i),o.I=!1}else r=tx(n,i);return Lo(r,function(s,a){o&&OA(o.t,s)===a||ix(r,s,t(a))}),i===3?new Set(r):r}(e)}function tx(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return wg(e)}function ax(){function e(s,a){var l=i[s];return l?l.enumerable=a:i[s]=l={configurable:!0,enumerable:a,get:function(){var u=this[Ee];return Fa.get(u,s)},set:function(u){var c=this[Ee];Fa.set(c,s,u)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][Ee];if(!l.P)switch(l.i){case 5:r(l)&&Wr(l);break;case 4:n(l)&&Wr(l)}}}function n(s){for(var a=s.t,l=s.k,u=Gi(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==Ee){var d=a[f];if(d===void 0&&!qi(a,f))return!0;var m=l[f],S=m&&m[Ee];if(S?S.t!==d:!sx(m,d))return!0}}var y=!!a[Ee];return u.length!==Gi(a).length+(y?0:1)}function r(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function o(s){s.g&&qt(3,JSON.stringify(Kr(s)))}var i={};MA("ES5",{J:function(s,a){var l=Array.isArray(s),u=function(f,d){if(f){for(var m=Array(d.length),S=0;S<d.length;S++)Object.defineProperty(m,""+S,e(S,!0));return m}var y=ux(d);delete y[Ee];for(var p=Gi(y),g=0;g<p.length;g++){var h=p[g];y[h]=e(h,f||!!y[h].enumerable)}return Object.create(Object.getPrototypeOf(d),y)}(l,s),c={i:l?5:4,A:a?a.A:mg(),P:!1,I:!1,R:{},l:a,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Ee,{value:c,writable:!0}),u},S:function(s,a,l){l?qn(a)&&a[Ee].A===s&&t(s.p):(s.u&&function u(c){if(c&&typeof c=="object"){var f=c[Ee];if(f){var d=f.t,m=f.k,S=f.R,y=f.i;if(y===4)Lo(m,function(x){x!==Ee&&(d[x]!==void 0||qi(d,x)?S[x]||u(m[x]):(S[x]=!0,Wr(f)))}),Lo(d,function(x){m[x]!==void 0||qi(m,x)||(S[x]=!1,Wr(f))});else if(y===5){if(r(f)&&(Wr(f),S.length=!0),m.length<d.length)for(var p=m.length;p<d.length;p++)S[p]=!1;else for(var g=d.length;g<m.length;g++)S[g]=!0;for(var h=Math.min(m.length,d.length),v=0;v<h;v++)m.hasOwnProperty(v)||(S[v]=!0),S[v]===void 0&&u(m[v])}}}}(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):r(s)}})}var nx,Da,bg=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",FA=typeof Map!="undefined",HA=typeof Set!="undefined",rx=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",lx=bg?Symbol.for("immer-nothing"):((nx={})["immer-nothing"]=!0,nx),ox=bg?Symbol.for("immer-draftable"):"__$immer_draftable",Ee=bg?Symbol.for("immer-state"):"__$immer_state";var UA=""+Object.prototype.constructor,Gi=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ux=Object.getOwnPropertyDescriptors||function(e){var t={};return Gi(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},yg={},Fa={get:function(e,t){if(t===Ee)return e;var n=Kr(e);if(!qi(n,t))return function(o,i,s){var a,l=ex(i,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!sn(r)?r:r===fg(e.t,t)?(pg(e),e.o[t]=hg(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=ex(Kr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=fg(Kr(e),t),i=o==null?void 0:o[Ee];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(sx(n,o)&&(n!==void 0||qi(e.t,t)))return!0;pg(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 fg(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,pg(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(){qt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){qt(12)}},_a={};Lo(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 zA=function(){function e(n){var r=this;this.O=rx,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var l=r;return function(y){var p=this;y===void 0&&(y=a);for(var g=arguments.length,h=Array(g>1?g-1:0),v=1;v<g;v++)h[v-1]=arguments[v];return l.produce(y,function(x){var k;return(k=i).call.apply(k,[p,x].concat(h))})}}var u;if(typeof i!="function"&&qt(6),s!==void 0&&typeof s!="function"&&qt(7),sn(o)){var c=Zw(r),f=hg(r,o,void 0),d=!0;try{u=i(f),d=!1}finally{d?wc(c):gg(c)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(y){return cg(c,s),dg(y,c)},function(y){throw wc(c),y}):(cg(c,s),dg(u,c))}if(!o||typeof o!="object"){if((u=i(o))===void 0&&(u=o),u===lx&&(u=void 0),r.D&&xg(u,!0),s){var m=[],S=[];Rn("Patches").M(o,u,m,S),s(m,S)}return u}qt(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(u){for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];return r.produceWithPatches(u,function(m){return o.apply(void 0,[m].concat(f))})};var s,a,l=r.produce(o,i,function(u,c){s=u,a=c});return typeof Promise!="undefined"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){sn(n)||qt(8),qn(n)&&(n=DA(n));var r=Zw(this),o=hg(this,n,void 0);return o[Ee].C=!0,gg(r),o},t.finishDraft=function(n,r){var o=n&&n[Ee],i=o.A;return cg(i,r),dg(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!rx&&qt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=Rn("Patches").$;return qn(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Rt=new zA,BA=Rt.produce,rD=Rt.produceWithPatches.bind(Rt),oD=Rt.setAutoFreeze.bind(Rt),iD=Rt.setUseProxies.bind(Rt),sD=Rt.applyPatches.bind(Rt),aD=Rt.createDraft.bind(Rt),lD=Rt.finishDraft.bind(Rt),bc=BA;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 Cg(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 Tg(e){var t=Cg(e,"string");return $r(t)==="symbol"?t:String(t)}function kg(e,t,n){return t=Tg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cx(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 Cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cx(Object(n),!0).forEach(function(r){kg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tt(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 dx=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Pg=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tc={INIT:"@@redux/INIT"+Pg(),REPLACE:"@@redux/REPLACE"+Pg(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Pg()}};function jA(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 Rg(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(tt(0));if(typeof t=="function"&&typeof n=="undefined"&&(n=t,t=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(tt(1));return n(Rg)(e,t)}if(typeof e!="function")throw new Error(tt(2));var o=e,i=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(tt(3));return i}function f(y){if(typeof y!="function")throw new Error(tt(4));if(l)throw new Error(tt(5));var p=!0;return u(),a.push(y),function(){if(p){if(l)throw new Error(tt(6));p=!1,u();var h=a.indexOf(y);a.splice(h,1),s=null}}}function d(y){if(!jA(y))throw new Error(tt(7));if(typeof y.type=="undefined")throw new Error(tt(8));if(l)throw new Error(tt(9));try{l=!0,i=o(i,y)}finally{l=!1}for(var p=s=a,g=0;g<p.length;g++){var h=p[g];h()}return y}function m(y){if(typeof y!="function")throw new Error(tt(10));o=y,d({type:Tc.REPLACE})}function S(){var y,p=f;return y={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(tt(11));function v(){h.next&&h.next(c())}v();var x=p(v);return{unsubscribe:x}}},y[dx]=function(){return this},y}return d({type:Tc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:m},r[dx]=S,r}function VA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Tc.INIT});if(typeof r=="undefined")throw new Error(tt(12));if(typeof n(void 0,{type:Tc.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(tt(13))})}function kc(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),s,a;try{VA(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,m={},S=0;S<i.length;S++){var y=i[S],p=n[y],g=u[y],h=p(g,c);if(typeof h=="undefined"){var v=c&&c.type;throw new Error(tt(14))}m[y]=h,d=d||h!==g}return d=d||i.length!==Object.keys(u).length,d?m:u}}function Qi(){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 fx(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(tt(15))},s={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return i=Qi.apply(void 0,a)(o.dispatch),Cc(Cc({},o),{},{dispatch:i})}}}function px(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(s){return function(a){return typeof a=="function"?a(o,i,e):s(a)}}};return t}var mx=px();mx.withExtraArgument=px;var Ag=mx;var Sx=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KA=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Xi=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},WA=Object.defineProperty,$A=Object.defineProperties,qA=Object.getOwnPropertyDescriptors,gx=Object.getOwnPropertySymbols,GA=Object.prototype.hasOwnProperty,YA=Object.prototype.propertyIsEnumerable,hx=function(e,t,n){return t in e?WA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qr=function(e,t){for(var n in t||(t={}))GA.call(t,n)&&hx(e,n,t[n]);if(gx)for(var r=0,o=gx(t);r<o.length;r++){var n=o[r];YA.call(t,n)&&hx(e,n,t[n])}return e},Lg=function(e,t){return $A(e,qA(t))},QA=function(e,t,n){return new Promise(function(r,o){var i=function(l){try{a(n.next(l))}catch(u){o(u)}},s=function(l){try{a(n.throw(l))}catch(u){o(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(i,s)};a((n=n.apply(e,t)).next())})};var XA=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qi:Qi.apply(null,arguments)},kD=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function ZA(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 JA=function(e){Sx(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,Xi([void 0],n[0].concat(this)))):new(t.bind.apply(t,Xi([void 0],n.concat(this))))},t}(Array),eL=function(e){Sx(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,Xi([void 0],n[0].concat(this)))):new(t.bind.apply(t,Xi([void 0],n.concat(this))))},t}(Array);function Ng(e){return sn(e)?bc(e,function(){}):e}function tL(e){return typeof e=="boolean"}function nL(){return function(t){return rL(t)}}function rL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,i=e.serializableCheck,s=i===void 0?!0:i,a=new JA;if(n&&(tL(n)?a.push(Ag):a.push(Ag.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(s)var u}return a}var Ig=!0;function wx(e){var t=nL(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,i=n.middleware,s=i===void 0?t():i,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,f=n.enhancers,d=f===void 0?void 0:f,m;if(typeof o=="function")m=o;else if(ZA(o))m=kc(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 S=s;if(typeof S=="function"&&(S=S(t),!Ig&&!Array.isArray(S)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ig&&S.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var y=fx.apply(void 0,S),p=Qi;l&&(p=XA(qr({trace:!Ig},typeof l=="object"&&l)));var g=new eL(y),h=g;Array.isArray(d)?h=Xi([y],d):typeof d=="function"&&(h=d(g));var v=p.apply(void 0,h);return Rg(m,c,v)}function Ce(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return qr(qr({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function xx(e){var t={},n=[],r,o={addCase:function(i,s){var a=typeof i=="string"?i:i.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,o},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase:function(i){return r=i,o}};return e(o),[t,n,r]}function oL(e){return typeof e=="function"}function iL(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?xx(t):[t,n,r],i=o[0],s=o[1],a=o[2],l;if(oL(e))l=function(){return Ng(e())};else{var u=Ng(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var m=Xi([i[d.type]],s.filter(function(S){var y=S.matcher;return y(d)}).map(function(S){var y=S.reducer;return y}));return m.filter(function(S){return!!S}).length===0&&(m=[a]),m.reduce(function(S,y){if(y)if(qn(S)){var p=S,g=y(p,d);return g===void 0?S:g}else{if(sn(S))return bc(S,function(h){return y(h,d)});var g=y(S,d);if(g===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return S},f)}return c.getInitialState=l,c}function sL(e,t){return e+"/"+t}function Y(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:Ng(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},s={},a={};o.forEach(function(c){var f=r[c],d=sL(t,c),m,S;"reducer"in f?(m=f.reducer,S=f.prepare):m=f,i[c]=m,s[d]=m,a[c]=S?Ce(d,S):Ce(d)});function l(){var c=typeof e.extraReducers=="function"?xx(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,m=c[1],S=m===void 0?[]:m,y=c[2],p=y===void 0?void 0:y,g=qr(qr({},d),s);return iL(n,function(h){for(var v in g)h.addCase(v,g[v]);for(var x=0,k=S;x<k.length;x++){var C=k[x];h.addMatcher(C.matcher,C.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:i,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var aL="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lL=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=aL[Math.random()*64|0];return t},uL=["name","message","stack","code"],Og=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),yx=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),cL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=uL;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},K=function(){function e(t,n,r){var o=Ce(t+"/fulfilled",function(c,f,d,m){return{payload:c,meta:Lg(qr({},m||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),i=Ce(t+"/pending",function(c,f,d){return{payload:void 0,meta:Lg(qr({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),s=Ce(t+"/rejected",function(c,f,d,m,S){return{payload:m,error:(r&&r.serializeError||cL)(c||"Rejected"),meta:Lg(qr({},S||{}),{arg:d,requestId:f,rejectedWithValue:!!m,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,m){var S=r!=null&&r.idGenerator?r.idGenerator(c):lL(),y=new l,p,g=!1;function h(x){p=x,y.abort()}var v=function(){return QA(this,null,function(){var x,k,C,R,N,_,D;return KA(this,function(G){switch(G.label){case 0:return G.trys.push([0,4,,5]),R=(x=r==null?void 0:r.condition)==null?void 0:x.call(r,c,{getState:d,extra:m}),fL(R)?[4,R]:[3,2];case 1:R=G.sent(),G.label=2;case 2:if(R===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,N=new Promise(function(Z,ie){return y.signal.addEventListener("abort",function(){return ie({name:"AbortError",message:p||"Aborted"})})}),f(i(S,c,(k=r==null?void 0:r.getPendingMeta)==null?void 0:k.call(r,{requestId:S,arg:c},{getState:d,extra:m}))),[4,Promise.race([N,Promise.resolve(n(c,{dispatch:f,getState:d,extra:m,requestId:S,signal:y.signal,abort:h,rejectWithValue:function(Z,ie){return new Og(Z,ie)},fulfillWithValue:function(Z,ie){return new yx(Z,ie)}})).then(function(Z){if(Z instanceof Og)throw Z;return Z instanceof yx?o(Z.payload,S,c,Z.meta):o(Z,S,c)})])];case 3:return C=G.sent(),[3,5];case 4:return _=G.sent(),C=_ instanceof Og?s(null,S,c,_.payload,_.meta):s(_,S,c),[3,5];case 5:return D=r&&!r.dispatchConditionRejection&&s.match(C)&&C.meta.condition,D||f(C),[2,C]}})})}();return Object.assign(v,{abort:h,requestId:S,arg:c,unwrap:function(){return v.then(dL)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function dL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function fL(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pL="task",Ex="listener",bx="completed",Mg="cancelled",LD="task-"+Mg,ID="task-"+bx,OD=Ex+"-"+Mg,ND=Ex+"-"+bx,MD=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=pL+" "+Mg+" (reason: "+t+")"}return e}();var _g="listenerMiddleware";var _D=Ce(_g+"/add"),DD=Ce(_g+"/removeAll"),FD=Ce(_g+"/remove");var vx,HD=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window!="undefined"?window:typeof global!="undefined"?global:globalThis):function(e){return(vx||(vx=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},mL=function(e){return function(t){setTimeout(t,e)}},UD=typeof window!="undefined"&&window.requestAnimationFrame?window.requestAnimationFrame:mL(10);ax();var d1=w(Fg()),f1=w(Lx());var Hg=w(Sc());function OL(e){e()}var Ix=OL,Ox=e=>Ix=e,Nx=()=>Ix;var Ji=w(H());var Dx=w(H());var Rc=w(H()),Mx=Symbol.for(`react-redux-context-${Rc.version}`),_x=globalThis;function NL(){let e=_x[Mx];return e||(e=(0,Rc.createContext)(null),_x[Mx]=e),e}var nt=new Proxy({},new Proxy({},{get(e,t){let n=NL();return(r,...o)=>Reflect[t](n,...o)}}));function Ha(e=nt){return function(){return(0,Dx.useContext)(e)}}var Ac=Ha();var Lc=()=>{throw new Error("uSES not initialized!")};var Fx=Lc,Hx=e=>{Fx=e},ML=(e,t)=>e===t;function Ux(e=nt){let t=e===nt?Ac:Ha(e);return function(r,o={}){let{equalityFn:i=ML,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),m=(0,Ji.useRef)(!0),S=(0,Ji.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,s]),y=Fx(u.addNestedSub,l.getState,c||l.getState,S,i);return(0,Ji.useDebugValue)(y),y}}var M=Ux();function Gn(){return Gn=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},Gn.apply(this,arguments)}function Ua(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Gg=w(Qx()),de=w(H()),a1=w(e1());var QL=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function XL(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,u,c,f,d;function m(h,v){return l=h,u=v,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function S(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function y(){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),v=!s(h,c);return c=h,v&&(d=n(c,f,u)),d}function g(h,v){let x=!i(v,u),k=!o(h,l,v,u);return l=h,u=v,x&&k?S():x?y():k?p():d}return function(v,x){return a?g(v,x):m(v,x)}}function $g(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,i=Ua(t,QL),s=n(e,i),a=r(e,i),l=o(e,i);return XL(s,a,l,e,i)}function qg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function za(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function t1(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Xc(e,t){return function(r,{displayName:o}){let i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=e,i.dependsOnOwnProps=t1(e);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=t1(u),u=i(a,l)),u},i}}function es(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function n1(e){return e&&typeof e=="object"?za(t=>qg(e,t)):e?typeof e=="function"?Xc(e,"mapDispatchToProps"):es(e,"mapDispatchToProps"):za(t=>({dispatch:t}))}function r1(e){return e?typeof e=="function"?Xc(e,"mapStateToProps"):es(e,"mapStateToProps"):za(()=>({}))}function ZL(e,t,n){return Gn({},n,e,t)}function JL(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,u,c){let f=e(l,u,c);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function o1(e){return e?typeof e=="function"?JL(e):es(e,"mergeProps"):()=>ZL}function eI(){let e=Nx(),t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var i1={notify(){},get:()=>[]};function Zc(e,t){let n,r=i1;function o(f){return l(),r.subscribe(f)}function i(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=eI())}function u(){n&&(n(),n=void 0,r.clear(),r=i1)}let c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Jc=w(H()),tI=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",ts=tI?Jc.useLayoutEffect:Jc.useEffect;function s1(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ns(e,t){if(s1(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])||!s1(e[n[o]],t[n[o]]))return!1;return!0}var nI=["reactReduxForwardedRef"],l1=Lc,u1=e=>{l1=e};var rI=[null,null];function oI(e,t,n){ts(()=>e(...t),n)}function iI(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function sI(e,t,n,r,o,i,s,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,m=()=>{if(f||!a.current)return;let y=t.getState(),p,g;try{p=r(y,o.current)}catch(h){g=h,d=h}g||(d=null),p===i.current?s.current||u():(i.current=p,l.current=p,s.current=!0,c())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function aI(e,t){return e===t}function lI(e,t,n,{pure:r,areStatesEqual:o=aI,areOwnPropsEqual:i=ns,areStatePropsEqual:s=ns,areMergedPropsEqual:a=ns,forwardRef:l=!1,context:u=nt}={}){let c=u,f=r1(e),d=n1(t),m=o1(n),S=!!e;return p=>{let g=p.displayName||p.name||"Component",h=`Connect(${g})`,v={shouldHandleStateChanges:S,displayName:h,wrappedComponentName:g,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:m,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function x(R){let[N,_,D]=(0,de.useMemo)(()=>{let{reactReduxForwardedRef:He}=R,Dn=Ua(R,nI);return[R.context,He,Dn]},[R]),G=(0,de.useMemo)(()=>N&&N.Consumer&&(0,a1.isContextConsumer)(de.default.createElement(N.Consumer,null))?N:c,[N,c]),Z=(0,de.useContext)(G),ie=!!R.store&&!!R.store.getState&&!!R.store.dispatch,vr=!!Z&&!!Z.store,_t=ie?R.store:Z.store,Sr=vr?Z.getServerState:_t.getState,Dt=(0,de.useMemo)(()=>$g(_t.dispatch,v),[_t]),[V,Te]=(0,de.useMemo)(()=>{if(!S)return rI;let He=Zc(_t,ie?void 0:Z.subscription),Dn=He.notifyNestedSubs.bind(He);return[He,Dn]},[_t,ie,Z]),ve=(0,de.useMemo)(()=>ie?Z:Gn({},Z,{subscription:V}),[ie,Z,V]),wr=(0,de.useRef)(),Se=(0,de.useRef)(D),ke=(0,de.useRef)(),we=(0,de.useRef)(!1),ri=(0,de.useRef)(!1),uo=(0,de.useRef)(!1),oi=(0,de.useRef)();ts(()=>(uo.current=!0,()=>{uo.current=!1}),[]);let ii=(0,de.useMemo)(()=>()=>ke.current&&D===Se.current?ke.current:Dt(_t.getState(),D),[_t,D]),Ul=(0,de.useMemo)(()=>Dn=>V?sI(S,_t,V,Dt,Se,wr,we,uo,ke,Te,Dn):()=>{},[V]);oI(iI,[Se,wr,we,D,ke,Te]);let co;try{co=l1(Ul,ii,Sr?()=>Dt(Sr(),D):ii)}catch(He){throw oi.current&&(He.message+=`
|
|
9
|
+
Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`)}We!==5&&(We=2),l=tg(l,a),d=s;do{switch(d.tag){case 3:i=l,d.flags|=4096,t&=-t,d.lanes|=t;var k=Dw(d,i,t);q0(d,k);break e;case 1:i=l;var C=d.type,R=d.stateNode;if(!(d.flags&64)&&(typeof C.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(Cn===null||!Cn.has(R)))){d.flags|=4096,t&=-t,d.lanes|=t;var N=Fw(d,i,t);q0(d,N);break e}}d=d.return}while(d!==null)}Ww(n)}catch(_){t=_,Me===n&&n!==null&&(Me=n=n.return);continue}break}while(1)}function Vw(){var e=nc.current;return nc.current=tc,e===null?tc:e}function ra(e,t){var n=W;W|=16;var r=Vw();it===e&&Je===t||Di(e,t);do try{hA();break}catch(o){jw(e,o)}while(1);if(Wm(),W=n,nc.current=r,Me!==null)throw Error(O(261));return it=null,Je=0,We}function hA(){for(;Me!==null;)Kw(Me)}function yA(){for(;Me!==null&&!ZR();)Kw(Me)}function Kw(e){var t=qw(e.alternate,e,To);e.memoizedProps=e.pendingProps,t===null?Ww(e):Me=t,ng.current=null}function Ww(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&2048){if(n=lA(t),n!==null){n.flags&=2047,Me=n;return}e!==null&&(e.firstEffect=e.lastEffect=null,e.flags|=2048)}else{if(n=aA(n,t,To),n!==null){Me=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||To&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);We===0&&(We=5)}function ho(e){var t=zi();return Co(99,vA.bind(null,e,t)),null}function vA(e,t){do Vr();while(pa!==null);if(W&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,i=e.pendingLanes&~o;e.pendingLanes=o,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=o,e.mutableReadLanes&=o,e.entangledLanes&=o,o=e.entanglements;for(var s=e.eventTimes,a=e.expirationTimes;0<i;){var l=31-Hr(i),u=1<<l;o[l]=0,s[l]=-1,a[l]=-1,i&=~u}if(Wn!==null&&!(r&24)&&Wn.has(e)&&Wn.delete(e),e===it&&(Me=it=null,Je=0),1<n.flags?n.lastEffect!==null?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,r!==null){if(o=W,W|=32,ng.current=null,xp=Pu,s=M0(),Gp(s)){if("selectionStart"in s)a={start:s.selectionStart,end:s.selectionEnd};else e:if(a=(a=s.ownerDocument)&&a.defaultView||window,(u=a.getSelection&&a.getSelection())&&u.rangeCount!==0){a=u.anchorNode,i=u.anchorOffset,l=u.focusNode,u=u.focusOffset;try{a.nodeType,l.nodeType}catch(_){a=null;break e}var c=0,f=-1,d=-1,m=0,S=0,y=s,p=null;t:for(;;){for(var g;y!==a||i!==0&&y.nodeType!==3||(f=c+i),y!==l||u!==0&&y.nodeType!==3||(d=c+u),y.nodeType===3&&(c+=y.nodeValue.length),(g=y.firstChild)!==null;)p=y,y=g;for(;;){if(y===s)break t;if(p===a&&++m===i&&(f=c),p===l&&++S===u&&(d=c),(g=y.nextSibling)!==null)break;y=p,p=y.parentNode}y=g}a=f===-1||d===-1?null:{start:f,end:d}}else a=null;a=a||{start:0,end:0}}else a=null;Ep={focusedElem:s,selectionRange:a},Pu=!1,ga=null,Mu=!1,F=r;do try{SA()}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);ga=null,F=r;do try{for(s=e;F!==null;){var h=F.flags;if(h&16&&ya(F.stateNode,""),h&128){var v=F.alternate;if(v!==null){var x=v.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(h&1038){case 2:vS(F),F.flags&=-3;break;case 6:vS(F),F.flags&=-3,Ap(F.alternate,F);break;case 1024:F.flags&=-1025;break;case 1028:F.flags&=-1025,Ap(F.alternate,F);break;case 4:Ap(F.alternate,F);break;case 8:a=F,Hw(s,a);var k=a.alternate;hS(a),k!==null&&hS(k)}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);if(x=Ep,v=M0(),h=x.focusedElem,s=x.selectionRange,v!==h&&h&&h.ownerDocument&&nw(h.ownerDocument.documentElement,h)){for(s!==null&&Gp(h)&&(v=s.start,x=s.end,x===void 0&&(x=v),"selectionStart"in h?(h.selectionStart=v,h.selectionEnd=Math.min(x,h.value.length)):(x=(v=h.ownerDocument||document)&&v.defaultView||window,x.getSelection&&(x=x.getSelection(),a=h.textContent.length,k=Math.min(s.start,a),s=s.end===void 0?k:Math.min(s.end,a),!x.extend&&k>s&&(a=s,s=k,k=a),a=N0(h,k),i=N0(h,s),a&&i&&(x.rangeCount!==1||x.anchorNode!==a.node||x.anchorOffset!==a.offset||x.focusNode!==i.node||x.focusOffset!==i.offset)&&(v=v.createRange(),v.setStart(a.node,a.offset),x.removeAllRanges(),k>s?(x.addRange(v),x.extend(i.node,i.offset)):(v.setEnd(i.node,i.offset),x.addRange(v)))))),v=[],x=h;x=x.parentNode;)x.nodeType===1&&v.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<v.length;h++)x=v[h],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}Pu=!!xp,Ep=xp=null,e.current=n,F=r;do try{for(h=e;F!==null;){var C=F.flags;if(C&36&&fA(h,F.alternate,F),C&128){v=void 0;var R=F.ref;if(R!==null){var N=F.stateNode;switch(F.tag){case 5:v=N;break;default:v=N}typeof R=="function"?R(v):R.current=v}}F=F.nextEffect}}catch(_){if(F===null)throw Error(O(330));Dr(F,_),F=F.nextEffect}while(F!==null);F=null,eA(),W=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&&(C=F,C.sibling=null,C.stateNode=null),F=t;if(r=e.pendingLanes,r===0&&(Cn=null),r===1?e===ym?ma++:(ma=0,ym=e):ma=0,n=n.stateNode,Eo&&typeof Eo.onCommitFiberRoot=="function")try{Eo.onCommitFiberRoot(Vm,n,void 0,(n.current.flags&64)===64)}catch(_){}if(Wt(e,Ze()),rc)throw rc=!1,e=mm,mm=null,e;return W&8||Pn(),null}function SA(){for(;F!==null;){var e=F.alternate;Mu||ga===null||(F.flags&8?w0(F,ga)&&(Mu=!0):F.tag===13&&pA(e,F)&&w0(F,ga)&&(Mu=!0));var t=F.flags;t&256&&dA(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,Co(e,xA)}return!1}function wA(e,t){gm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function $w(e,t){hm.push(t,e),zr||(zr=!0,Ta(97,function(){return Vr(),null}))}function xA(){if(pa===null)return!1;var e=pa;if(pa=null,W&48)throw Error(O(331));var t=W;W|=32;var n=hm;hm=[];for(var r=0;r<n.length;r+=2){var o=n[r],i=n[r+1],s=o.destroy;if(o.destroy=void 0,typeof s=="function")try{s()}catch(l){if(i===null)throw Error(O(330));Dr(i,l)}}for(n=gm,gm=[],r=0;r<n.length;r+=2){o=n[r],i=n[r+1];try{var a=o.create;o.destroy=a()}catch(l){if(i===null)throw Error(O(330));Dr(i,l)}}for(a=e.current.firstEffect;a!==null;)e=a.nextEffect,a.nextEffect=null,a.flags&8&&(a.sibling=null,a.stateNode=null),a=e;return W=t,Pn(),!0}function wS(e,t,n){t=tg(n,t),t=Dw(e,t,1),Nr(e,t),t=kt(),e=yc(e,1),e!==null&&(uc(e,1,t),Wt(e,t))}function Dr(e,t){if(e.tag===3)wS(e,e,t);else for(var n=e.return;n!==null;){if(n.tag===3){wS(n,e,t);break}else if(n.tag===1){var r=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Cn===null||!Cn.has(r))){e=tg(t,e);var o=Fw(n,e,1);if(Nr(n,o),o=kt(),n=yc(n,1),n!==null)uc(n,1,o),Wt(n,o);else if(typeof r.componentDidCatch=="function"&&(Cn===null||!Cn.has(r)))try{r.componentDidCatch(t,e)}catch(i){}break}}n=n.return}}function EA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=kt(),e.pingedLanes|=e.suspendedLanes&n,it===e&&(Je&n)===n&&(We===4||We===3&&(Je&62914560)===Je&&500>Ze()-og?Di(e,0):rg|=n),Wt(e,t)}function bA(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,t&2?t&4?(jn===0&&(jn=Ki),t=xi(62914560&~jn),t===0&&(t=4194304)):t=zi()===99?1:2:t=1),n=kt(),e=yc(e,t),e!==null&&(uc(e,t,n),Wt(e,n))}var qw;qw=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||Et.current)on=!0;else if(n&r)on=!!(e.flags&16384);else{switch(on=!1,t.tag){case 3:sS(t),kp();break;case 5:X0(t);break;case 1:bt(t.type)&&Lu(t);break;case 4:nm(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;Re(Wu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return n&t.child.childLanes?aS(e,t,n):(Re(Pe,Pe.current&1),t=Kn(e,t,n),t!==null?t.sibling:null);Re(Pe,Pe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&64){if(r)return fS(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Re(Pe,Pe.current),r)break;return null;case 23:case 24:return t.lanes=0,Pp(e,t,n)}return Kn(e,t,n)}else on=!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=Ui(t,et.current),Ni(t,n),o=Xm(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,bt(r)){var i=!0;Lu(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,qm(t);var s=r.getDerivedStateFromProps;typeof s=="function"&&Gu(t,r,s,e),o.updater=gc,t.stateNode=o,o._reactInternals=t,tm(t,r,e,n),t=sm(null,t,r,!0,i,n)}else t.tag=0,xt(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=TA(o),e=rn(o,e),i){case 0:t=im(null,t,o,e,n);break e;case 1:t=iS(null,t,o,e,n);break e;case 11:t=rS(null,t,o,e,n);break e;case 14:t=oS(null,t,o,rn(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:rn(r,o),im(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),iS(e,t,r,o,n);case 3:if(sS(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,vw(e,t),ka(t,r,null,n),r=t.memoizedState.element,r===o)kp(),t=Kn(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(Rr=Oi(t.stateNode.containerInfo.firstChild),Vn=t,i=kn=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o<e.length;o+=2)i=e[o],i._workInProgressVersionPrimary=e[o+1],Mi.push(i);for(n=Ew(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|1024,n=n.sibling}else xt(e,t,r,n),kp();t=t.child}return t;case 5:return X0(t),e===null&&rm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Xp(r,o)?s=null:i!==null&&Xp(r,i)&&(t.flags|=16),Ow(e,t),xt(e,t,s,n),t.child;case 6:return e===null&&rm(t),null;case 13:return aS(e,t,n);case 4:return nm(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Yu(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),rS(e,t,r,o,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value;var a=t.type._context;if(Re(Wu,a._currentValue),a._currentValue=i,s!==null)if(a=s.value,i=Bt(a,i)?0:(typeof r._calculateChangedBits=="function"?r._calculateChangedBits(a,i):1073741823)|0,i===0){if(s.children===o.children&&!Et.current){t=Kn(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){s=a.child;for(var u=l.firstContext;u!==null;){if(u.context===r&&u.observedBits&i){a.tag===1&&(u=Or(-1,n&-n),u.tag=2,Nr(a,u)),a.lanes|=n,u=a.alternate,u!==null&&(u.lanes|=n),yw(a.return,n),l.lanes|=n;break}u=u.next}}else s=a.tag===10&&a.type===t.type?null:a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,i=t.pendingProps,r=i.children,Ni(t,n),o=Kt(o,i.unstable_observedBits),r=r(o),t.flags|=1,xt(e,t,r,n),t.child;case 14:return o=t.type,i=rn(o,t.pendingProps),i=rn(o.type,i),oS(e,t,o,i,r,n);case 15:return Iw(e,t,t.type,t.pendingProps,r,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:rn(r,o),e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),t.tag=1,bt(r)?(e=!0,Lu(t)):e=!1,Ni(t,n),ww(t,r,o),tm(t,r,o,n),sm(null,t,r,!0,e,n);case 19:return fS(e,t,n);case 23:return Pp(e,t,n);case 24:return Pp(e,t,n)}throw Error(O(156,t.tag))};function CA(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 jt(e,t,n,r){return new CA(e,t,n,r)}function sg(e){return e=e.prototype,!(!e||!e.isReactComponent)}function TA(e){if(typeof e=="function")return sg(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===ac)return 14}return 2}function Br(e,t){var n=e.alternate;return n===null?(n=jt(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 _u(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")sg(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Tr:return Fi(n.children,o,i,t);case bS:s=8,o|=16;break;case Em:s=8,o|=1;break;case oa:return e=jt(12,n,t,o|8),e.elementType=oa,e.type=oa,e.lanes=i,e;case ia:return e=jt(13,n,t,o),e.type=ia,e.elementType=ia,e.lanes=i,e;case Du:return e=jt(19,n,t,o),e.elementType=Du,e.lanes=i,e;case Rm:return ag(n,o,i,t);case Np:return e=jt(24,n,t,o),e.elementType=Np,e.lanes=i,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bm:s=10;break e;case Cm:s=9;break e;case sc:s=11;break e;case ac:s=14;break e;case Tm:s=16,r=null;break e;case km:s=22;break e}throw Error(O(130,e==null?e:typeof e,""))}return t=jt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fi(e,t,n,r){return e=jt(7,e,r,t),e.lanes=n,e}function ag(e,t,n,r){return e=jt(23,e,r,t),e.elementType=Rm,e.lanes=n,e}function Lp(e,t,n){return e=jt(6,e,null,t),e.lanes=n,e}function Ip(e,t,n){return t=jt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function kA(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=gp(0),this.expirationTimes=gp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gp(0),this.mutableSourceEagerHydrationData=null}function PA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:yo,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function oc(e,t,n,r){var o=t.current,i=kt(),s=Mr(o);e:if(n){n=n._reactInternals;t:{if(Ro(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(bt(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(bt(l)){n=cw(n,l,a);break e}}n=a}else n=Ur;return t.context===null?t.context=n:t.pendingContext=n,t=Or(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),Nr(o,t),_r(o,s,i),s}function Op(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 xS(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function lg(e,t){xS(e,t),(e=e.alternate)&&xS(e,t)}function RA(){return null}function ug(e,t,n){var r=n!=null&&n.hydrationOptions!=null&&n.hydrationOptions.mutableSources||null;if(n=new kA(e,t,n!=null&&n.hydrate===!0),t=jt(3,null,null,t===2?7:t===1?3:0),n.current=t,t.stateNode=n,qm(t),e[Vi]=n.current,iw(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}ug.prototype.render=function(e){oc(e,this._internalRoot,null,null)};ug.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;oc(null,e,null,function(){t[Vi]=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 AA(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 ug(e,0,t?{hydrate:!0}:void 0)}function vc(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i._internalRoot;if(typeof o=="function"){var a=o;o=function(){var u=Op(s);a.call(u)}}oc(t,s,e,o)}else{if(i=n._reactRootContainer=AA(n,r),s=i._internalRoot,typeof o=="function"){var l=o;o=function(){var u=Op(s);l.call(u)}}Bw(function(){oc(t,s,e,o)})}return Op(s)}HS=function(e){if(e.tag===13){var t=kt();_r(e,4,t),lg(e,4)}};Nm=function(e){if(e.tag===13){var t=kt();_r(e,67108864,t),lg(e,67108864)}};US=function(e){if(e.tag===13){var t=kt(),n=Mr(e);_r(e,n,t),lg(e,n)}};zS=function(e,t){return t()};Vp=function(e,t,n){switch(t){case"input":if(_p(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=pc(r);if(!o)throw Error(O(90));TS(r),_p(r,o)}}}break;case"textarea":PS(e,n);break;case"select":t=n.value,t!=null&&Ai(e,!!n.multiple,t,!1)}};Lm=zw;MS=function(e,t,n,r,o){var i=W;W|=4;try{return Co(98,e.bind(null,t,n,r,o))}finally{W=i,W===0&&($i(),Pn())}};Im=function(){!(W&49)&&(gA(),Vr())};_S=function(e,t){var n=W;W|=2;try{return e(t)}finally{W=n,W===0&&($i(),Pn())}};function Gw(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ma(t))throw Error(O(200));return PA(e,t,null,n)}var LA={Events:[Ia,Ti,pc,OS,NS,Vr,{current:!1}]},Xs={findFiberByHostInstance:So,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"},IA={bundleType:Xs.bundleType,version:Xs.version,rendererPackageName:Xs.rendererPackageName,rendererConfig:Xs.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Po.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=FS(e),e===null?null:e.stateNode},findFiberByHostInstance:Xs.findFiberByHostInstance||RA,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Zs=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Zs.isDisabled&&Zs.supportsFiber))try{Vm=Zs.inject(IA),Eo=Zs}catch(e){}var Zs;$t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=LA;$t.createPortal=Gw;$t.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=FS(t),e=e===null?null:e.stateNode,e};$t.flushSync=function(e,t){var n=W;if(n&48)return e(t);W|=1;try{if(e)return Co(99,e.bind(null,t))}finally{W=n,Pn()}};$t.hydrate=function(e,t,n){if(!Ma(t))throw Error(O(200));return vc(null,e,t,!0,n)};$t.render=function(e,t,n){if(!Ma(t))throw Error(O(200));return vc(null,e,t,!1,n)};$t.unmountComponentAtNode=function(e){if(!Ma(e))throw Error(O(40));return e._reactRootContainer?(Bw(function(){vc(null,null,e,!1,function(){e._reactRootContainer=null,e[Vi]=null})}),!0):!1};$t.unstable_batchedUpdates=zw;$t.unstable_createPortal=function(e,t){return Gw(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};$t.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 vc(e,t,n,!1,r)};$t.version="17.0.2"});var Sc=Ae((rD,Xw)=>{"use strict";function Qw(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qw)}catch(e){console.error(e)}}Qw(),Xw.exports=Yw()});var Tx=Ae(Cx=>{"use strict";var Zi=H();function gL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hL=typeof Object.is=="function"?Object.is:gL,yL=Zi.useState,vL=Zi.useEffect,SL=Zi.useLayoutEffect,wL=Zi.useDebugValue;function xL(e,t){var n=t(),r=yL({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return SL(function(){o.value=n,o.getSnapshot=t,Dg(o)&&i({inst:o})},[e,n,t]),vL(function(){return Dg(o)&&i({inst:o}),e(function(){Dg(o)&&i({inst:o})})},[e]),wL(n),n}function Dg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hL(e,n)}catch(r){return!0}}function EL(e,t){return t()}var bL=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?EL:xL;Cx.useSyncExternalStore=Zi.useSyncExternalStore!==void 0?Zi.useSyncExternalStore:bL});var Fg=Ae((KD,kx)=>{"use strict";kx.exports=Tx()});var Rx=Ae(Px=>{"use strict";var Pc=H(),CL=Fg();function TL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kL=typeof Object.is=="function"?Object.is:TL,PL=CL.useSyncExternalStore,RL=Pc.useRef,AL=Pc.useEffect,LL=Pc.useMemo,IL=Pc.useDebugValue;Px.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=RL(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=LL(function(){function l(m){if(!u){if(u=!0,c=m,m=r(m),o!==void 0&&s.hasValue){var S=s.value;if(o(S,m))return f=S}return f=m}if(S=f,kL(c,m))return S;var y=r(m);return o!==void 0&&o(S,y)?S:(c=m,f=y)}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=PL(e,i[0],i[1]);return AL(function(){s.hasValue=!0,s.value=a},[a]),IL(a),a}});var Lx=Ae(($D,Ax)=>{"use strict";Ax.exports=Rx()});var Bx=Ae(le=>{"use strict";var Be=typeof Symbol=="function"&&Symbol.for,Ug=Be?Symbol.for("react.element"):60103,zg=Be?Symbol.for("react.portal"):60106,Ic=Be?Symbol.for("react.fragment"):60107,Oc=Be?Symbol.for("react.strict_mode"):60108,Nc=Be?Symbol.for("react.profiler"):60114,Mc=Be?Symbol.for("react.provider"):60109,_c=Be?Symbol.for("react.context"):60110,Bg=Be?Symbol.for("react.async_mode"):60111,Dc=Be?Symbol.for("react.concurrent_mode"):60111,Fc=Be?Symbol.for("react.forward_ref"):60112,Hc=Be?Symbol.for("react.suspense"):60113,_L=Be?Symbol.for("react.suspense_list"):60120,Uc=Be?Symbol.for("react.memo"):60115,zc=Be?Symbol.for("react.lazy"):60116,DL=Be?Symbol.for("react.block"):60121,FL=Be?Symbol.for("react.fundamental"):60117,HL=Be?Symbol.for("react.responder"):60118,UL=Be?Symbol.for("react.scope"):60119;function At(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ug:switch(e=e.type,e){case Bg:case Dc:case Ic:case Nc:case Oc:case Hc:return e;default:switch(e=e&&e.$$typeof,e){case _c:case Fc:case zc:case Uc:case Mc:return e;default:return t}}case zg:return t}}}function zx(e){return At(e)===Dc}le.AsyncMode=Bg;le.ConcurrentMode=Dc;le.ContextConsumer=_c;le.ContextProvider=Mc;le.Element=Ug;le.ForwardRef=Fc;le.Fragment=Ic;le.Lazy=zc;le.Memo=Uc;le.Portal=zg;le.Profiler=Nc;le.StrictMode=Oc;le.Suspense=Hc;le.isAsyncMode=function(e){return zx(e)||At(e)===Bg};le.isConcurrentMode=zx;le.isContextConsumer=function(e){return At(e)===_c};le.isContextProvider=function(e){return At(e)===Mc};le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ug};le.isForwardRef=function(e){return At(e)===Fc};le.isFragment=function(e){return At(e)===Ic};le.isLazy=function(e){return At(e)===zc};le.isMemo=function(e){return At(e)===Uc};le.isPortal=function(e){return At(e)===zg};le.isProfiler=function(e){return At(e)===Nc};le.isStrictMode=function(e){return At(e)===Oc};le.isSuspense=function(e){return At(e)===Hc};le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ic||e===Dc||e===Nc||e===Oc||e===Hc||e===_L||typeof e=="object"&&e!==null&&(e.$$typeof===zc||e.$$typeof===Uc||e.$$typeof===Mc||e.$$typeof===_c||e.$$typeof===Fc||e.$$typeof===FL||e.$$typeof===HL||e.$$typeof===UL||e.$$typeof===DL)};le.typeOf=At});var Vx=Ae((s4,jx)=>{"use strict";jx.exports=Bx()});var Qx=Ae((a4,Yx)=>{"use strict";var jg=Vx(),zL={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},BL={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},jL={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},qx={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Vg={};Vg[jg.ForwardRef]=jL;Vg[jg.Memo]=qx;function Kx(e){return jg.isMemo(e)?qx:Vg[e.$$typeof]||zL}var VL=Object.defineProperty,KL=Object.getOwnPropertyNames,Wx=Object.getOwnPropertySymbols,WL=Object.getOwnPropertyDescriptor,$L=Object.getPrototypeOf,$x=Object.prototype;function Gx(e,t,n){if(typeof t!="string"){if($x){var r=$L(t);r&&r!==$x&&Gx(e,r,n)}var o=KL(t);Wx&&(o=o.concat(Wx(t)));for(var i=Kx(e),s=Kx(t),a=0;a<o.length;++a){var l=o[a];if(!BL[l]&&!(n&&n[l])&&!(s&&s[l])&&!(i&&i[l])){var u=WL(t,l);try{VL(e,l,u)}catch(c){}}}}return e}Yx.exports=Gx});var Zx=Ae(ue=>{"use strict";var Kg=Symbol.for("react.element"),Wg=Symbol.for("react.portal"),Bc=Symbol.for("react.fragment"),jc=Symbol.for("react.strict_mode"),Vc=Symbol.for("react.profiler"),Kc=Symbol.for("react.provider"),Wc=Symbol.for("react.context"),qL=Symbol.for("react.server_context"),$c=Symbol.for("react.forward_ref"),qc=Symbol.for("react.suspense"),Gc=Symbol.for("react.suspense_list"),Yc=Symbol.for("react.memo"),Qc=Symbol.for("react.lazy"),GL=Symbol.for("react.offscreen"),Xx;Xx=Symbol.for("react.module.reference");function Gt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Kg:switch(e=e.type,e){case Bc:case Vc:case jc:case qc:case Gc:return e;default:switch(e=e&&e.$$typeof,e){case qL:case Wc:case $c:case Qc:case Yc:case Kc:return e;default:return t}}case Wg:return t}}}ue.ContextConsumer=Wc;ue.ContextProvider=Kc;ue.Element=Kg;ue.ForwardRef=$c;ue.Fragment=Bc;ue.Lazy=Qc;ue.Memo=Yc;ue.Portal=Wg;ue.Profiler=Vc;ue.StrictMode=jc;ue.Suspense=qc;ue.SuspenseList=Gc;ue.isAsyncMode=function(){return!1};ue.isConcurrentMode=function(){return!1};ue.isContextConsumer=function(e){return Gt(e)===Wc};ue.isContextProvider=function(e){return Gt(e)===Kc};ue.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kg};ue.isForwardRef=function(e){return Gt(e)===$c};ue.isFragment=function(e){return Gt(e)===Bc};ue.isLazy=function(e){return Gt(e)===Qc};ue.isMemo=function(e){return Gt(e)===Yc};ue.isPortal=function(e){return Gt(e)===Wg};ue.isProfiler=function(e){return Gt(e)===Vc};ue.isStrictMode=function(e){return Gt(e)===jc};ue.isSuspense=function(e){return Gt(e)===qc};ue.isSuspenseList=function(e){return Gt(e)===Gc};ue.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Bc||e===Vc||e===jc||e===qc||e===Gc||e===GL||typeof e=="object"&&e!==null&&(e.$$typeof===Qc||e.$$typeof===Yc||e.$$typeof===Kc||e.$$typeof===Wc||e.$$typeof===$c||e.$$typeof===Xx||e.getModuleId!==void 0)};ue.typeOf=Gt});var e1=Ae((u4,Jx)=>{"use strict";Jx.exports=Zx()});var xh=Ae((Y6,kE)=>{"use strict";var QI="Expected a function",CE=NaN,XI="[object Symbol]",ZI=/^\s+|\s+$/g,JI=/^[-+]0x[0-9a-f]+$/i,eO=/^0b[01]+$/i,tO=/^0o[0-7]+$/i,nO=parseInt,rO=typeof global=="object"&&global&&global.Object===Object&&global,oO=typeof self=="object"&&self&&self.Object===Object&&self,iO=rO||oO||Function("return this")(),sO=Object.prototype,aO=sO.toString,lO=Math.max,uO=Math.min,Sh=function(){return iO.Date.now()};function cO(e,t,n){var r,o,i,s,a,l,u=0,c=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(QI);t=TE(t)||0,wh(n)&&(c=!!n.leading,f="maxWait"in n,i=f?lO(TE(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function m(C){var R=r,N=o;return r=o=void 0,u=C,s=e.apply(N,R),s}function S(C){return u=C,a=setTimeout(g,t),c?m(C):s}function y(C){var R=C-l,N=C-u,_=t-R;return f?uO(_,i-N):_}function p(C){var R=C-l,N=C-u;return l===void 0||R>=t||R<0||f&&N>=i}function g(){var C=Sh();if(p(C))return h(C);a=setTimeout(g,y(C))}function h(C){return a=void 0,d&&r?m(C):(r=o=void 0,s)}function v(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function x(){return a===void 0?s:h(Sh())}function k(){var C=Sh(),R=p(C);if(r=arguments,o=this,l=C,R){if(a===void 0)return S(l);if(f)return a=setTimeout(g,t),m(l)}return a===void 0&&(a=setTimeout(g,t)),s}return k.cancel=v,k.flush=x,k}function wh(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function dO(e){return!!e&&typeof e=="object"}function fO(e){return typeof e=="symbol"||dO(e)&&aO.call(e)==XI}function TE(e){if(typeof e=="number")return e;if(fO(e))return CE;if(wh(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=wh(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(ZI,"");var n=eO.test(e);return n||tO.test(e)?nO(e.slice(2),n?2:8):JI.test(e)?CE:+e}kE.exports=cO});var _E=Ae((S9,ME)=>{"use strict";var vO=/["'&<>]/;ME.exports=SO;function SO(e){var t=""+e,n=vO.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r=""";break;case 38:r="&";break;case 39:r="'";break;case 60:r="<";break;case 62:r=">";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var E_={};Ye(E_,{Card:()=>ge,ContentEditableInput:()=>Jo,DeepdeskAPI:()=>yr,DeepdeskSDK:()=>Hl,HTTPClient:()=>hr,InputMediator:()=>gr,InputType:()=>gi,KeyboardHint:()=>tu,Label:()=>nu,Locale:()=>ja,Section:()=>wn,SectionList:()=>ru,Sources:()=>zn,Suggestion:()=>re,SuggestionList:()=>St,TextAreaInput:()=>ei,ToggleButton:()=>mo,attachFile:()=>Hk,authenticateWithKey:()=>Uk,createFullRange:()=>Ts,createOverlayContainer:()=>Fl,createRangeFromOffsets:()=>ao,escapeHTML:()=>cs,formatTextMarkup:()=>zk,getRangeOffsets:()=>Nl,getRangeText:()=>Ml,insertCKEditor:()=>Kk,isHTML:()=>Ud,isSupportedInputElement:()=>Nf,updateContentEditable:()=>jk,updateTextArea:()=>Bk,useClickOutsideRoot:()=>to,useStyles:()=>L,waitForElementVisibilityChange:()=>Df});var Zf=w(oe()),Ut=w(H());var Xl=w(H()),Ov=w(oe());var _s=Xl.default.createContext({});function L(e,t){let i=(0,Xl.useContext)(_s),{debug:n}=i,o=te(i,["debug"])[e];return Object.entries(t).reduce((s,[a,l])=>{let u=o==null?void 0:o[a];return I(T({},s),{[a]:(0,Ov.default)(l,u,n?`${e}__${a}`:!1)})},{})}var Nv={root:"dd-4s9wq"};var fo=w(b()),Zl=()=>(0,fo.jsxs)("svg",{className:Nv.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,fo.jsx)("defs",{children:(0,fo.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,fo.jsx)("title",{children:"Failed loading image"}),(0,fo.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 Xf={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var po=w(b()),Jl=(0,Ut.createContext)(Xf),SP=({title:e,src:t})=>{let n=(0,Ut.useContext)(Jl),[r,o]=(0,Ut.useState)(!1);return(0,Ut.useEffect)(()=>{o(!1)},[t]),(0,po.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,po.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,po.jsx)(Zl,{})})},wP=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Ut.useContext)(Jl);return(0,po.jsx)("div",{className:(0,Zf.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},xP=i=>{var s=i,{as:e="h1",cropText:t=!1,className:n,children:r}=s,o=te(s,["as","cropText","className","children"]);let a=(0,Ut.useContext)(Jl);return Ut.default.createElement(e,T({className:(0,Zf.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},eu=({children:e})=>{let t=L("Card",Xf);return(0,po.jsx)("div",{className:t.root,children:(0,po.jsx)(Jl.Provider,{value:t,children:e})})};eu.Image=SP;eu.Content=wP;eu.Title=xP;var ge=eu;var Uv=w(oe());var Hv={root:"dd-llBx9"};var zv=w(b());var EP={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},bP=r=>{var o=r,{className:e,keyCode:t}=o,n=te(o,["className","keyCode"]);let i=L("KeyboardHint",Hv);return(0,zv.jsx)("span",T({"data-key":EP[t],className:(0,Uv.default)(e,i.root)},n))},tu=bP;var jv=w(oe());var Bv={root:"dd-e6HXZ"};var Vv=w(b()),CP=r=>{var o=r,{className:e,children:t}=o,n=te(o,["className","children"]);let i=L("Label",Bv);return(0,Vv.jsx)("span",I(T({},n),{className:(0,jv.default)(e,i.root),children:t}))},nu=CP;var Kv={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var pi=w(b()),TP=o=>{var i=o,{title:e,children:t,type:n}=i,r=te(i,["title","children","type"]);let s=L("Section",Kv);return(0,pi.jsxs)("section",I(T({},r),{className:s.root,"data-section-type":n,children:[e&&(0,pi.jsx)("div",{className:s.subTitleContainer,children:(0,pi.jsx)("span",{className:s.subtitle,children:e})}),(0,pi.jsx)("div",{className:s.suggestions,children:t})]}))},wn=TP;var $v=w(oe()),qv=w(H());var Wv={root:"dd-uoTXh"};var Gv=w(b()),kP=qv.default.forwardRef(({className:e,children:t},n)=>{let r=L("SectionList",Wv);return(0,Gv.jsx)("div",{ref:n,className:(0,$v.default)(r.root,e),children:t})}),ru=kP;var mi=w(oe()),vt=w(H());var Jf={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 yt=w(b()),xr=(0,vt.createContext)(Jf),PP=r=>{var o=r,{fixed:e,children:t}=o,n=te(o,["fixed","children"]);let i=(0,vt.useContext)(xr);return(0,yt.jsx)("div",I(T({},n),{className:(0,mi.default)(i.actions,{[i.actionsIsFixed]:e}),children:t}))};function RP(a){var l=a,{as:e,className:t,icon:n,title:r,children:o,disabled:i}=l,s=te(l,["as","className","icon","title","children","disabled"]);let u=(0,vt.useContext)(xr);return(0,yt.jsxs)(e||"button",I(T({type:"button",className:(0,mi.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:i},t),title:r,"aria-label":r},s),{children:[n,o]}))}var AP=({children:e})=>{let t=(0,vt.useContext)(xr);return(0,yt.jsx)("div",{className:t.buttonsContainer,children:e})},LP=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,vt.useContext)(xr);return(0,yt.jsxs)("div",{className:(0,mi.default)(e,i.actionButton,i.dropdownButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onMouseDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),children:[r,(0,yt.jsx)("ul",{className:i.dropdownList,children:o})]})},IP=({index:e,label:t,onClick:n})=>{let r=(0,vt.useContext)(xr);return(0,yt.jsx)("li",{className:r.dropdownItem,children:(0,yt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},OP=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,vt.useContext)(xr);return(0,yt.jsx)("button",{type:"button",className:(0,mi.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r!=null?r:s=>s.stopPropagation(),disabled:n,"aria-hidden":n,children:o})},NP=({labels:e})=>{let t=(0,vt.useContext)(xr);return(0,yt.jsx)("div",{className:t.labels,children:e.map(n=>(0,yt.jsx)("span",{className:t.label,children:n},n))})},Er=vt.default.forwardRef((a,s)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,i=te(l,["className","selected","onClick","children","as"]);let u=L("Suggestion",Jf),c=(0,vt.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,yt.jsx)(o,I(T({},i),{ref:s,className:(0,mi.default)(e,u.root,{[u.isSelected]:t,[u.isClickable]:!!n}),onClick:c,children:(0,yt.jsx)(xr.Provider,{value:u,children:r})}))});Er.Labels=NP;Er.Actions=PP;Er.ActionButton=OP;Er.DropdownButton=LP;Er.DropdownItem=IP;Er.ButtonsContainer=AP;Er.Button=RP;var re=Er;var Qv=w(oe());var Yv={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Xv=w(b()),MP=({withDivider:e,children:t})=>{let n=L("SuggestionList",Yv);return(0,Xv.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Qv.default)(n.root,{[n.isWithDivider]:e}),children:t})},St=MP;var Jv=w(oe());var Zv={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var ou=w(b()),_P=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=L("ToggleButton",Zv);return(0,ou.jsx)("button",{type:"button",className:(0,Jv.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,ou.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,ou.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},mo=_P;var e0=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,iu=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var t0=/x-deepdesk-(([a-z0-9\-_])+-version)/,su=["cues","custom-data"],zn=(y=>(y.SEARCH="search",y.TEMPLATE="template",y.ELASTIC_SEARCH="search-autocomplete",y.GPT="gpt",y.TRIE="trie",y.TRIE_WITH_TYPOS="trie-with-typos",y.SEMANTIC="semantic",y.TEXT_RECOMMENDATION="text_recommendation",y.URL_RECOMMENDATION="url_recommendation",y.LINK_RECOMMENDATION="link_recommendation",y.PERSONAL_COLLECTION="personal-collection",y.PERSONAL_COLLECTION_SEARCH="personal-collection-search",y.SEARCH_OVERLAY="search-overlay",y.SEARCH_PREVIEW="search-preview",y.SEARCH_URL="search-url",y))(zn||{}),gi=(s=>(s.ENTER="enter",s.TAB="tab",s.ARROW="arrow",s.HOTKEY="hotkey",s.MOUSE="mouse",s.SPACE="space",s))(gi||{});var tn=w(Sc());var zb=w(H());function qt(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if(!1)var o,i;throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map(function(s){return"'"+s+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function qn(e){return!!e&&!!e[Ee]}function sn(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)===UA}(e)||Array.isArray(e)||!!e[ox]||!!(!((t=e.constructor)===null||t===void 0)&&t[ox])||vg(e)||Sg(e))}function Lo(e,t,n){n===void 0&&(n=!1),Yi(e)===0?(n?Object.keys:Gi)(e).forEach(function(r){n&&typeof r=="symbol"||t(r,e[r],e)}):e.forEach(function(r,o){return t(o,r,e)})}function Yi(e){var t=e[Ee];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:vg(e)?2:Sg(e)?3:0}function qi(e,t){return Yi(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function OA(e,t){return Yi(e)===2?e.get(t):e[t]}function ix(e,t,n){var r=Yi(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function sx(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function vg(e){return FA&&e instanceof Map}function Sg(e){return HA&&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=ux(e);delete t[Ee];for(var n=Gi(t),r=0;r<n.length;r++){var o=n[r],i=t[o];i.writable===!1&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function xg(e,t){return t===void 0&&(t=!1),Eg(e)||qn(e)||!sn(e)||(Yi(e)>1&&(e.set=e.add=e.clear=e.delete=NA),Object.freeze(e),t&&Lo(e,function(n,r){return xg(r,!0)},!0)),e}function NA(){qt(2)}function Eg(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function Rn(e){var t=yg[e];return t||qt(18,e),t}function MA(e,t){yg[e]||(yg[e]=t)}function mg(){return Da}function cg(e,t){t&&(Rn("Patches"),e.u=[],e.s=[],e.v=t)}function wc(e){gg(e),e.p.forEach(_A),e.p=null}function gg(e){e===Da&&(Da=e.l)}function Zw(e){return Da={p:[],l:Da,h:e,m:!0,_:0}}function _A(e){var t=e[Ee];t.i===0||t.i===1?t.j():t.g=!0}function dg(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.O||Rn("ES5").S(t,e,r),r?(n[Ee].P&&(wc(t),qt(4)),sn(e)&&(e=xc(t,e),t.l||Ec(t,e)),t.u&&Rn("Patches").M(n[Ee].t,e,t.u,t.s)):e=xc(t,n,[]),wc(t),t.u&&t.v(t.u,t.s),e!==lx?e:void 0}function xc(e,t,n){if(Eg(t))return t;var r=t[Ee];if(!r)return Lo(t,function(a,l){return Jw(e,r,t,a,l,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ec(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,i=o,s=!1;r.i===3&&(i=new Set(o),o.clear(),s=!0),Lo(i,function(a,l){return Jw(e,r,o,a,l,n,s)}),Ec(e,o,!1),n&&e.u&&Rn("Patches").N(r,n,e.u,e.s)}return r.o}function Jw(e,t,n,r,o,i,s){if(qn(o)){var a=xc(e,o,i&&t&&t.i!==3&&!qi(t.R,r)?i.concat(r):void 0);if(ix(n,r,a),!qn(a))return;e.m=!1}else s&&n.add(o);if(sn(o)&&!Eg(o)){if(!e.h.D&&e._<1)return;xc(e,o),t&&t.A.l||Ec(e,o)}}function Ec(e,t,n){n===void 0&&(n=!1),!e.l&&e.h.D&&e.m&&xg(t,n)}function fg(e,t){var n=e[Ee];return(n?Kr(n):e)[t]}function ex(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 pg(e){e.o||(e.o=wg(e.t))}function hg(e,t,n){var r=vg(t)?Rn("MapSet").F(t,n):Sg(t)?Rn("MapSet").T(t,n):e.O?function(o,i){var s=Array.isArray(o),a={i:s?1:0,A:i?i.A:mg(),P:!1,I:!1,R:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=a,u=Fa;s&&(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):Rn("ES5").J(t,n);return(n?n.A:mg()).p.push(r),r}function DA(e){return qn(e)||qt(22,e),function t(n){if(!sn(n))return n;var r,o=n[Ee],i=Yi(n);if(o){if(!o.P&&(o.i<4||!Rn("ES5").K(o)))return o.t;o.I=!0,r=tx(n,i),o.I=!1}else r=tx(n,i);return Lo(r,function(s,a){o&&OA(o.t,s)===a||ix(r,s,t(a))}),i===3?new Set(r):r}(e)}function tx(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return wg(e)}function ax(){function e(s,a){var l=i[s];return l?l.enumerable=a:i[s]=l={configurable:!0,enumerable:a,get:function(){var u=this[Ee];return Fa.get(u,s)},set:function(u){var c=this[Ee];Fa.set(c,s,u)}},l}function t(s){for(var a=s.length-1;a>=0;a--){var l=s[a][Ee];if(!l.P)switch(l.i){case 5:r(l)&&Wr(l);break;case 4:n(l)&&Wr(l)}}}function n(s){for(var a=s.t,l=s.k,u=Gi(l),c=u.length-1;c>=0;c--){var f=u[c];if(f!==Ee){var d=a[f];if(d===void 0&&!qi(a,f))return!0;var m=l[f],S=m&&m[Ee];if(S?S.t!==d:!sx(m,d))return!0}}var y=!!a[Ee];return u.length!==Gi(a).length+(y?0:1)}function r(s){var a=s.k;if(a.length!==s.t.length)return!0;var l=Object.getOwnPropertyDescriptor(a,a.length-1);if(l&&!l.get)return!0;for(var u=0;u<a.length;u++)if(!a.hasOwnProperty(u))return!0;return!1}function o(s){s.g&&qt(3,JSON.stringify(Kr(s)))}var i={};MA("ES5",{J:function(s,a){var l=Array.isArray(s),u=function(f,d){if(f){for(var m=Array(d.length),S=0;S<d.length;S++)Object.defineProperty(m,""+S,e(S,!0));return m}var y=ux(d);delete y[Ee];for(var p=Gi(y),g=0;g<p.length;g++){var h=p[g];y[h]=e(h,f||!!y[h].enumerable)}return Object.create(Object.getPrototypeOf(d),y)}(l,s),c={i:l?5:4,A:a?a.A:mg(),P:!1,I:!1,R:{},l:a,t:s,k:u,o:null,g:!1,C:!1};return Object.defineProperty(u,Ee,{value:c,writable:!0}),u},S:function(s,a,l){l?qn(a)&&a[Ee].A===s&&t(s.p):(s.u&&function u(c){if(c&&typeof c=="object"){var f=c[Ee];if(f){var d=f.t,m=f.k,S=f.R,y=f.i;if(y===4)Lo(m,function(x){x!==Ee&&(d[x]!==void 0||qi(d,x)?S[x]||u(m[x]):(S[x]=!0,Wr(f)))}),Lo(d,function(x){m[x]!==void 0||qi(m,x)||(S[x]=!1,Wr(f))});else if(y===5){if(r(f)&&(Wr(f),S.length=!0),m.length<d.length)for(var p=m.length;p<d.length;p++)S[p]=!1;else for(var g=d.length;g<m.length;g++)S[g]=!0;for(var h=Math.min(m.length,d.length),v=0;v<h;v++)m.hasOwnProperty(v)||(S[v]=!0),S[v]===void 0&&u(m[v])}}}}(s.p[0]),t(s.p))},K:function(s){return s.i===4?n(s):r(s)}})}var nx,Da,bg=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",FA=typeof Map!="undefined",HA=typeof Set!="undefined",rx=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",lx=bg?Symbol.for("immer-nothing"):((nx={})["immer-nothing"]=!0,nx),ox=bg?Symbol.for("immer-draftable"):"__$immer_draftable",Ee=bg?Symbol.for("immer-state"):"__$immer_state";var UA=""+Object.prototype.constructor,Gi=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,ux=Object.getOwnPropertyDescriptors||function(e){var t={};return Gi(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},yg={},Fa={get:function(e,t){if(t===Ee)return e;var n=Kr(e);if(!qi(n,t))return function(o,i,s){var a,l=ex(i,s);return l?"value"in l?l.value:(a=l.get)===null||a===void 0?void 0:a.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!sn(r)?r:r===fg(e.t,t)?(pg(e),e.o[t]=hg(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=ex(Kr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=fg(Kr(e),t),i=o==null?void 0:o[Ee];if(i&&i.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(sx(n,o)&&(n!==void 0||qi(e.t,t)))return!0;pg(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 fg(e.t,t)!==void 0||t in e.t?(e.R[t]=!1,pg(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(){qt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){qt(12)}},_a={};Lo(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 zA=function(){function e(n){var r=this;this.O=rx,this.D=!0,this.produce=function(o,i,s){if(typeof o=="function"&&typeof i!="function"){var a=i;i=o;var l=r;return function(y){var p=this;y===void 0&&(y=a);for(var g=arguments.length,h=Array(g>1?g-1:0),v=1;v<g;v++)h[v-1]=arguments[v];return l.produce(y,function(x){var k;return(k=i).call.apply(k,[p,x].concat(h))})}}var u;if(typeof i!="function"&&qt(6),s!==void 0&&typeof s!="function"&&qt(7),sn(o)){var c=Zw(r),f=hg(r,o,void 0),d=!0;try{u=i(f),d=!1}finally{d?wc(c):gg(c)}return typeof Promise!="undefined"&&u instanceof Promise?u.then(function(y){return cg(c,s),dg(y,c)},function(y){throw wc(c),y}):(cg(c,s),dg(u,c))}if(!o||typeof o!="object"){if((u=i(o))===void 0&&(u=o),u===lx&&(u=void 0),r.D&&xg(u,!0),s){var m=[],S=[];Rn("Patches").M(o,u,m,S),s(m,S)}return u}qt(21,o)},this.produceWithPatches=function(o,i){if(typeof o=="function")return function(u){for(var c=arguments.length,f=Array(c>1?c-1:0),d=1;d<c;d++)f[d-1]=arguments[d];return r.produceWithPatches(u,function(m){return o.apply(void 0,[m].concat(f))})};var s,a,l=r.produce(o,i,function(u,c){s=u,a=c});return typeof Promise!="undefined"&&l instanceof Promise?l.then(function(u){return[u,s,a]}):[l,s,a]},typeof(n==null?void 0:n.useProxies)=="boolean"&&this.setUseProxies(n.useProxies),typeof(n==null?void 0:n.autoFreeze)=="boolean"&&this.setAutoFreeze(n.autoFreeze)}var t=e.prototype;return t.createDraft=function(n){sn(n)||qt(8),qn(n)&&(n=DA(n));var r=Zw(this),o=hg(this,n,void 0);return o[Ee].C=!0,gg(r),o},t.finishDraft=function(n,r){var o=n&&n[Ee],i=o.A;return cg(i,r),dg(void 0,i)},t.setAutoFreeze=function(n){this.D=n},t.setUseProxies=function(n){n&&!rx&&qt(20),this.O=n},t.applyPatches=function(n,r){var o;for(o=r.length-1;o>=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var s=Rn("Patches").$;return qn(n)?s(n,r):this.produce(n,function(a){return s(a,r)})},e}(),Rt=new zA,BA=Rt.produce,oD=Rt.produceWithPatches.bind(Rt),iD=Rt.setAutoFreeze.bind(Rt),sD=Rt.setUseProxies.bind(Rt),aD=Rt.applyPatches.bind(Rt),lD=Rt.createDraft.bind(Rt),uD=Rt.finishDraft.bind(Rt),bc=BA;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 Cg(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 Tg(e){var t=Cg(e,"string");return $r(t)==="symbol"?t:String(t)}function kg(e,t,n){return t=Tg(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cx(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 Cc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?cx(Object(n),!0).forEach(function(r){kg(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cx(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tt(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 dx=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Pg=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tc={INIT:"@@redux/INIT"+Pg(),REPLACE:"@@redux/REPLACE"+Pg(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Pg()}};function jA(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 Rg(e,t,n){var r;if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(tt(0));if(typeof t=="function"&&typeof n=="undefined"&&(n=t,t=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(tt(1));return n(Rg)(e,t)}if(typeof e!="function")throw new Error(tt(2));var o=e,i=t,s=[],a=s,l=!1;function u(){a===s&&(a=s.slice())}function c(){if(l)throw new Error(tt(3));return i}function f(y){if(typeof y!="function")throw new Error(tt(4));if(l)throw new Error(tt(5));var p=!0;return u(),a.push(y),function(){if(p){if(l)throw new Error(tt(6));p=!1,u();var h=a.indexOf(y);a.splice(h,1),s=null}}}function d(y){if(!jA(y))throw new Error(tt(7));if(typeof y.type=="undefined")throw new Error(tt(8));if(l)throw new Error(tt(9));try{l=!0,i=o(i,y)}finally{l=!1}for(var p=s=a,g=0;g<p.length;g++){var h=p[g];h()}return y}function m(y){if(typeof y!="function")throw new Error(tt(10));o=y,d({type:Tc.REPLACE})}function S(){var y,p=f;return y={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(tt(11));function v(){h.next&&h.next(c())}v();var x=p(v);return{unsubscribe:x}}},y[dx]=function(){return this},y}return d({type:Tc.INIT}),r={dispatch:d,subscribe:f,getState:c,replaceReducer:m},r[dx]=S,r}function VA(e){Object.keys(e).forEach(function(t){var n=e[t],r=n(void 0,{type:Tc.INIT});if(typeof r=="undefined")throw new Error(tt(12));if(typeof n(void 0,{type:Tc.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(tt(13))})}function kc(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];typeof e[o]=="function"&&(n[o]=e[o])}var i=Object.keys(n),s,a;try{VA(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,m={},S=0;S<i.length;S++){var y=i[S],p=n[y],g=u[y],h=p(g,c);if(typeof h=="undefined"){var v=c&&c.type;throw new Error(tt(14))}m[y]=h,d=d||h!==g}return d=d||i.length!==Object.keys(u).length,d?m:u}}function Qi(){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 fx(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return function(){var o=r.apply(void 0,arguments),i=function(){throw new Error(tt(15))},s={getState:o.getState,dispatch:function(){return i.apply(void 0,arguments)}},a=t.map(function(l){return l(s)});return i=Qi.apply(void 0,a)(o.dispatch),Cc(Cc({},o),{},{dispatch:i})}}}function px(e){var t=function(r){var o=r.dispatch,i=r.getState;return function(s){return function(a){return typeof a=="function"?a(o,i,e):s(a)}}};return t}var mx=px();mx.withExtraArgument=px;var Ag=mx;var Sx=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KA=function(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(c){return l([u,c])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,o&&(i=u[0]&2?o.return:u[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;switch(o=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,o=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(c){u=[6,c],o=0}finally{r=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},Xi=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},WA=Object.defineProperty,$A=Object.defineProperties,qA=Object.getOwnPropertyDescriptors,gx=Object.getOwnPropertySymbols,GA=Object.prototype.hasOwnProperty,YA=Object.prototype.propertyIsEnumerable,hx=function(e,t,n){return t in e?WA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},qr=function(e,t){for(var n in t||(t={}))GA.call(t,n)&&hx(e,n,t[n]);if(gx)for(var r=0,o=gx(t);r<o.length;r++){var n=o[r];YA.call(t,n)&&hx(e,n,t[n])}return e},Lg=function(e,t){return $A(e,qA(t))},QA=function(e,t,n){return new Promise(function(r,o){var i=function(l){try{a(n.next(l))}catch(u){o(u)}},s=function(l){try{a(n.throw(l))}catch(u){o(u)}},a=function(l){return l.done?r(l.value):Promise.resolve(l.value).then(i,s)};a((n=n.apply(e,t)).next())})};var XA=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Qi:Qi.apply(null,arguments)},PD=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}};function ZA(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 JA=function(e){Sx(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,Xi([void 0],n[0].concat(this)))):new(t.bind.apply(t,Xi([void 0],n.concat(this))))},t}(Array),eL=function(e){Sx(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,Xi([void 0],n[0].concat(this)))):new(t.bind.apply(t,Xi([void 0],n.concat(this))))},t}(Array);function Ng(e){return sn(e)?bc(e,function(){}):e}function tL(e){return typeof e=="boolean"}function nL(){return function(t){return rL(t)}}function rL(e){e===void 0&&(e={});var t=e.thunk,n=t===void 0?!0:t,r=e.immutableCheck,o=r===void 0?!0:r,i=e.serializableCheck,s=i===void 0?!0:i,a=new JA;if(n&&(tL(n)?a.push(Ag):a.push(Ag.withExtraArgument(n.extraArgument))),!1){if(o)var l;if(s)var u}return a}var Ig=!0;function wx(e){var t=nL(),n=e||{},r=n.reducer,o=r===void 0?void 0:r,i=n.middleware,s=i===void 0?t():i,a=n.devTools,l=a===void 0?!0:a,u=n.preloadedState,c=u===void 0?void 0:u,f=n.enhancers,d=f===void 0?void 0:f,m;if(typeof o=="function")m=o;else if(ZA(o))m=kc(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 S=s;if(typeof S=="function"&&(S=S(t),!Ig&&!Array.isArray(S)))throw new Error("when using a middleware builder function, an array of middleware must be returned");if(!Ig&&S.some(function(x){return typeof x!="function"}))throw new Error("each middleware provided to configureStore must be a function");var y=fx.apply(void 0,S),p=Qi;l&&(p=XA(qr({trace:!Ig},typeof l=="object"&&l)));var g=new eL(y),h=g;Array.isArray(d)?h=Xi([y],d):typeof d=="function"&&(h=d(g));var v=p.apply(void 0,h);return Rg(m,c,v)}function Ce(e,t){function n(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(t){var i=t.apply(void 0,r);if(!i)throw new Error("prepareAction did not return an object");return qr(qr({type:e,payload:i.payload},"meta"in i&&{meta:i.meta}),"error"in i&&{error:i.error})}return{type:e,payload:r[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(r){return r.type===e},n}function xx(e){var t={},n=[],r,o={addCase:function(i,s){var a=typeof i=="string"?i:i.type;if(a in t)throw new Error("addCase cannot be called with two reducers for the same action type");return t[a]=s,o},addMatcher:function(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase:function(i){return r=i,o}};return e(o),[t,n,r]}function oL(e){return typeof e=="function"}function iL(e,t,n,r){n===void 0&&(n=[]);var o=typeof t=="function"?xx(t):[t,n,r],i=o[0],s=o[1],a=o[2],l;if(oL(e))l=function(){return Ng(e())};else{var u=Ng(e);l=function(){return u}}function c(f,d){f===void 0&&(f=l());var m=Xi([i[d.type]],s.filter(function(S){var y=S.matcher;return y(d)}).map(function(S){var y=S.reducer;return y}));return m.filter(function(S){return!!S}).length===0&&(m=[a]),m.reduce(function(S,y){if(y)if(qn(S)){var p=S,g=y(p,d);return g===void 0?S:g}else{if(sn(S))return bc(S,function(h){return y(h,d)});var g=y(S,d);if(g===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return g}return S},f)}return c.getInitialState=l,c}function sL(e,t){return e+"/"+t}function Y(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:Ng(e.initialState),r=e.reducers||{},o=Object.keys(r),i={},s={},a={};o.forEach(function(c){var f=r[c],d=sL(t,c),m,S;"reducer"in f?(m=f.reducer,S=f.prepare):m=f,i[c]=m,s[d]=m,a[c]=S?Ce(d,S):Ce(d)});function l(){var c=typeof e.extraReducers=="function"?xx(e.extraReducers):[e.extraReducers],f=c[0],d=f===void 0?{}:f,m=c[1],S=m===void 0?[]:m,y=c[2],p=y===void 0?void 0:y,g=qr(qr({},d),s);return iL(n,function(h){for(var v in g)h.addCase(v,g[v]);for(var x=0,k=S;x<k.length;x++){var C=k[x];h.addMatcher(C.matcher,C.reducer)}p&&h.addDefaultCase(p)})}var u;return{name:t,reducer:function(c,f){return u||(u=l()),u(c,f)},actions:a,caseReducers:i,getInitialState:function(){return u||(u=l()),u.getInitialState()}}}var aL="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",lL=function(e){e===void 0&&(e=21);for(var t="",n=e;n--;)t+=aL[Math.random()*64|0];return t},uL=["name","message","stack","code"],Og=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),yx=function(){function e(t,n){this.payload=t,this.meta=n}return e}(),cL=function(e){if(typeof e=="object"&&e!==null){for(var t={},n=0,r=uL;n<r.length;n++){var o=r[n];typeof e[o]=="string"&&(t[o]=e[o])}return t}return{message:String(e)}},K=function(){function e(t,n,r){var o=Ce(t+"/fulfilled",function(c,f,d,m){return{payload:c,meta:Lg(qr({},m||{}),{arg:d,requestId:f,requestStatus:"fulfilled"})}}),i=Ce(t+"/pending",function(c,f,d){return{payload:void 0,meta:Lg(qr({},d||{}),{arg:f,requestId:c,requestStatus:"pending"})}}),s=Ce(t+"/rejected",function(c,f,d,m,S){return{payload:m,error:(r&&r.serializeError||cL)(c||"Rejected"),meta:Lg(qr({},S||{}),{arg:d,requestId:f,rejectedWithValue:!!m,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,m){var S=r!=null&&r.idGenerator?r.idGenerator(c):lL(),y=new l,p,g=!1;function h(x){p=x,y.abort()}var v=function(){return QA(this,null,function(){var x,k,C,R,N,_,D;return KA(this,function(G){switch(G.label){case 0:return G.trys.push([0,4,,5]),R=(x=r==null?void 0:r.condition)==null?void 0:x.call(r,c,{getState:d,extra:m}),fL(R)?[4,R]:[3,2];case 1:R=G.sent(),G.label=2;case 2:if(R===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return g=!0,N=new Promise(function(Z,ie){return y.signal.addEventListener("abort",function(){return ie({name:"AbortError",message:p||"Aborted"})})}),f(i(S,c,(k=r==null?void 0:r.getPendingMeta)==null?void 0:k.call(r,{requestId:S,arg:c},{getState:d,extra:m}))),[4,Promise.race([N,Promise.resolve(n(c,{dispatch:f,getState:d,extra:m,requestId:S,signal:y.signal,abort:h,rejectWithValue:function(Z,ie){return new Og(Z,ie)},fulfillWithValue:function(Z,ie){return new yx(Z,ie)}})).then(function(Z){if(Z instanceof Og)throw Z;return Z instanceof yx?o(Z.payload,S,c,Z.meta):o(Z,S,c)})])];case 3:return C=G.sent(),[3,5];case 4:return _=G.sent(),C=_ instanceof Og?s(null,S,c,_.payload,_.meta):s(_,S,c),[3,5];case 5:return D=r&&!r.dispatchConditionRejection&&s.match(C)&&C.meta.condition,D||f(C),[2,C]}})})}();return Object.assign(v,{abort:h,requestId:S,arg:c,unwrap:function(){return v.then(dL)}})}}return Object.assign(u,{pending:i,rejected:s,fulfilled:o,typePrefix:t})}return e.withTypes=function(){return e},e}();function dL(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function fL(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var pL="task",Ex="listener",bx="completed",Mg="cancelled",ID="task-"+Mg,OD="task-"+bx,ND=Ex+"-"+Mg,MD=Ex+"-"+bx,_D=function(){function e(t){this.code=t,this.name="TaskAbortError",this.message=pL+" "+Mg+" (reason: "+t+")"}return e}();var _g="listenerMiddleware";var DD=Ce(_g+"/add"),FD=Ce(_g+"/removeAll"),HD=Ce(_g+"/remove");var vx,UD=typeof queueMicrotask=="function"?queueMicrotask.bind(typeof window!="undefined"?window:typeof global!="undefined"?global:globalThis):function(e){return(vx||(vx=Promise.resolve())).then(e).catch(function(t){return setTimeout(function(){throw t},0)})},mL=function(e){return function(t){setTimeout(t,e)}},zD=typeof window!="undefined"&&window.requestAnimationFrame?window.requestAnimationFrame:mL(10);ax();var d1=w(Fg()),f1=w(Lx());var Hg=w(Sc());function OL(e){e()}var Ix=OL,Ox=e=>Ix=e,Nx=()=>Ix;var Ji=w(H());var Dx=w(H());var Rc=w(H()),Mx=Symbol.for(`react-redux-context-${Rc.version}`),_x=globalThis;function NL(){let e=_x[Mx];return e||(e=(0,Rc.createContext)(null),_x[Mx]=e),e}var nt=new Proxy({},new Proxy({},{get(e,t){let n=NL();return(r,...o)=>Reflect[t](n,...o)}}));function Ha(e=nt){return function(){return(0,Dx.useContext)(e)}}var Ac=Ha();var Lc=()=>{throw new Error("uSES not initialized!")};var Fx=Lc,Hx=e=>{Fx=e},ML=(e,t)=>e===t;function Ux(e=nt){let t=e===nt?Ac:Ha(e);return function(r,o={}){let{equalityFn:i=ML,stabilityCheck:s=void 0,noopCheck:a=void 0}=typeof o=="function"?{equalityFn:o}:o,{store:l,subscription:u,getServerState:c,stabilityCheck:f,noopCheck:d}=t(),m=(0,Ji.useRef)(!0),S=(0,Ji.useCallback)({[r.name](p){return r(p)}}[r.name],[r,f,s]),y=Fx(u.addNestedSub,l.getState,c||l.getState,S,i);return(0,Ji.useDebugValue)(y),y}}var M=Ux();function Gn(){return Gn=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},Gn.apply(this,arguments)}function Ua(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var Gg=w(Qx()),de=w(H()),a1=w(e1());var QL=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function XL(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,u,c,f,d;function m(h,v){return l=h,u=v,c=e(l,u),f=t(r,u),d=n(c,f,u),a=!0,d}function S(){return c=e(l,u),t.dependsOnOwnProps&&(f=t(r,u)),d=n(c,f,u),d}function y(){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),v=!s(h,c);return c=h,v&&(d=n(c,f,u)),d}function g(h,v){let x=!i(v,u),k=!o(h,l,v,u);return l=h,u=v,x&&k?S():x?y():k?p():d}return function(v,x){return a?g(v,x):m(v,x)}}function $g(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,i=Ua(t,QL),s=n(e,i),a=r(e,i),l=o(e,i);return XL(s,a,l,e,i)}function qg(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...i)=>t(o(...i)))}return n}function za(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function t1(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Xc(e,t){return function(r,{displayName:o}){let i=function(a,l){return i.dependsOnOwnProps?i.mapToProps(a,l):i.mapToProps(a,void 0)};return i.dependsOnOwnProps=!0,i.mapToProps=function(a,l){i.mapToProps=e,i.dependsOnOwnProps=t1(e);let u=i(a,l);return typeof u=="function"&&(i.mapToProps=u,i.dependsOnOwnProps=t1(u),u=i(a,l)),u},i}}function es(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function n1(e){return e&&typeof e=="object"?za(t=>qg(e,t)):e?typeof e=="function"?Xc(e,"mapDispatchToProps"):es(e,"mapDispatchToProps"):za(t=>({dispatch:t}))}function r1(e){return e?typeof e=="function"?Xc(e,"mapStateToProps"):es(e,"mapStateToProps"):za(()=>({}))}function ZL(e,t,n){return Gn({},n,e,t)}function JL(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,u,c){let f=e(l,u,c);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function o1(e){return e?typeof e=="function"?JL(e):es(e,"mergeProps"):()=>ZL}function eI(){let e=Nx(),t=null,n=null;return{clear(){t=null,n=null},notify(){e(()=>{let r=t;for(;r;)r.callback(),r=r.next})},get(){let r=[],o=t;for(;o;)r.push(o),o=o.next;return r},subscribe(r){let o=!0,i=n={callback:r,next:null,prev:n};return i.prev?i.prev.next=i:t=i,function(){!o||t===null||(o=!1,i.next?i.next.prev=i.prev:n=i.prev,i.prev?i.prev.next=i.next:t=i.next)}}}}var i1={notify(){},get:()=>[]};function Zc(e,t){let n,r=i1;function o(f){return l(),r.subscribe(f)}function i(){r.notify()}function s(){c.onStateChange&&c.onStateChange()}function a(){return!!n}function l(){n||(n=t?t.addNestedSub(s):e.subscribe(s),r=eI())}function u(){n&&(n(),n=void 0,r.clear(),r=i1)}let c={addNestedSub:o,notifyNestedSubs:i,handleChangeWrapper:s,isSubscribed:a,trySubscribe:l,tryUnsubscribe:u,getListeners:()=>r};return c}var Jc=w(H()),tI=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",ts=tI?Jc.useLayoutEffect:Jc.useEffect;function s1(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function ns(e,t){if(s1(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])||!s1(e[n[o]],t[n[o]]))return!1;return!0}var nI=["reactReduxForwardedRef"],l1=Lc,u1=e=>{l1=e};var rI=[null,null];function oI(e,t,n){ts(()=>e(...t),n)}function iI(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function sI(e,t,n,r,o,i,s,a,l,u,c){if(!e)return()=>{};let f=!1,d=null,m=()=>{if(f||!a.current)return;let y=t.getState(),p,g;try{p=r(y,o.current)}catch(h){g=h,d=h}g||(d=null),p===i.current?s.current||u():(i.current=p,l.current=p,s.current=!0,c())};return n.onStateChange=m,n.trySubscribe(),m(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function aI(e,t){return e===t}function lI(e,t,n,{pure:r,areStatesEqual:o=aI,areOwnPropsEqual:i=ns,areStatePropsEqual:s=ns,areMergedPropsEqual:a=ns,forwardRef:l=!1,context:u=nt}={}){let c=u,f=r1(e),d=n1(t),m=o1(n),S=!!e;return p=>{let g=p.displayName||p.name||"Component",h=`Connect(${g})`,v={shouldHandleStateChanges:S,displayName:h,wrappedComponentName:g,WrappedComponent:p,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:m,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function x(R){let[N,_,D]=(0,de.useMemo)(()=>{let{reactReduxForwardedRef:He}=R,Dn=Ua(R,nI);return[R.context,He,Dn]},[R]),G=(0,de.useMemo)(()=>N&&N.Consumer&&(0,a1.isContextConsumer)(de.default.createElement(N.Consumer,null))?N:c,[N,c]),Z=(0,de.useContext)(G),ie=!!R.store&&!!R.store.getState&&!!R.store.dispatch,vr=!!Z&&!!Z.store,_t=ie?R.store:Z.store,Sr=vr?Z.getServerState:_t.getState,Dt=(0,de.useMemo)(()=>$g(_t.dispatch,v),[_t]),[V,Te]=(0,de.useMemo)(()=>{if(!S)return rI;let He=Zc(_t,ie?void 0:Z.subscription),Dn=He.notifyNestedSubs.bind(He);return[He,Dn]},[_t,ie,Z]),ve=(0,de.useMemo)(()=>ie?Z:Gn({},Z,{subscription:V}),[ie,Z,V]),wr=(0,de.useRef)(),Se=(0,de.useRef)(D),ke=(0,de.useRef)(),we=(0,de.useRef)(!1),ri=(0,de.useRef)(!1),uo=(0,de.useRef)(!1),oi=(0,de.useRef)();ts(()=>(uo.current=!0,()=>{uo.current=!1}),[]);let ii=(0,de.useMemo)(()=>()=>ke.current&&D===Se.current?ke.current:Dt(_t.getState(),D),[_t,D]),Ul=(0,de.useMemo)(()=>Dn=>V?sI(S,_t,V,Dt,Se,wr,we,uo,ke,Te,Dn):()=>{},[V]);oI(iI,[Se,wr,we,D,ke,Te]);let co;try{co=l1(Ul,ii,Sr?()=>Dt(Sr(),D):ii)}catch(He){throw oi.current&&(He.message+=`
|
|
10
10
|
The error may be correlated with this previous error:
|
|
11
11
|
${oi.current.stack}
|
|
12
12
|
|
|
@@ -16,17 +16,17 @@ Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
|
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||TO)();if(!o)return;let i=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",s=i==="body"||i==="fragment"?o.body:o.createElement(i);return t.match(EO)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,FE.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==DE||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),u=Dd[l]||Dd[s];if(!this.isSafe(t)||!l.match(bO)&&(!n&&(!u||u===Rh)||l.startsWith("on")||a.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c=l==="style"?this.extractStyleAttribute(t):a;u===Jr?c=!0:u===Fo?c=Number.parseFloat(String(c)):u!==_d&&(c=String(c)),r[Ah[l]||l]=this.applyAttributeFilters(l,c),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(i,s)=>String(s).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return ol[t]?I(T(T({},n),ol[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:i,transform:s,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===DE){let d=c.nodeName.toLowerCase(),m=this.getTagConfig(d);u&&(l.push(u),u="");let S=this.applyNodeFilters(d,c);if(!S)return;let y;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;y=this.parseNode(S,m);let g=s(S,y,m);if(g===null)return;if(typeof g!="undefined"){l.push(Uo.default.cloneElement(g,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,m))){var f;this.keyIndex+=1;let p=this.extractAttributes(S),g={tagName:d};p&&(g.attributes=p),m.void&&(g.selfClose=m.void),l.push(Uo.default.createElement(Fd,I(T({},g),{key:this.keyIndex}),(f=y)!==null&&f!==void 0?f:this.parseNode(S,m)))}else l=[...l,...this.parseNode(S,m.tagName?m:n)]}else if(c.nodeType===xO){let d=r&&!o?c.textContent:this.applyMatchers(c.textContent||"",n);Array.isArray(d)?l=[...l,...d]:u+=d}}),u&&l.push(u),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(CO);){let[s,a]=i,l=i.index,u=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],m;if(u)m=s.length,r.push(f.createElement(c,d));else{let S=o.match(new RegExp(`{{{/${a}}}}`));m=S.index+S[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,S.index),n),d))}o=o.slice(m)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function kO(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,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 m=new Hd(i!=null?i:"",e).parse();m.length>0&&(d=m)}return d||(d=s),f?Uo.default.createElement(Uo.default.Fragment,null,d):Uo.default.createElement(Fd,{attributes:n,className:r,tagName:c},d)}function us(e){let k=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1}=k,m=te(k,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),S=i?[]:l,y=o?[]:a,p=c?[c]:[],g=u?[u]:[];S.forEach(C=>{C.onBeforeParse&&p.push(C.onBeforeParse.bind(C)),C.onAfterParse&&g.push(C.onAfterParse.bind(C))});let h=p.reduce((C,R)=>R(C,e),r!=null?r:""),v=new Hd(h,m,S,y),x=g.reduce((C,R)=>R(C,e),v.parse());return Uo.default.createElement(kO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var KE=w(H());var PO=/[.*+?^${}()|[\]\\]/g,RO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function AO(e){return e.replace(PO,"\\$&")}function LO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function IO(e){return e.search(RO)}function HE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${AO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function UE(e){return e.replace(iu,'<mark data-type="placeholder">$1</mark>')}function cs(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function OO(e,t){return e.split("").map((s,a)=>({char:s,index:a})).filter(({char:s,index:a})=>/\s/.test(s)&&a<=t).map(({index:s})=>s).reverse()[0]}function Ih(e,t,n={}){if(t){let r=LO(t.toLowerCase(),e.toLowerCase()),o=cs(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=IO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let s=t.split(e0).length>3||t.length>30?OO(t.trim(),r):0;return`${`${s>0?"\u2026":""}${cs(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var NO=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function Ud(e){return NO.test(e)}function zE(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var zd=w(H()),VE=w(b()),BE=zd.default.createContext(void 0);function eo(){let e=zd.default.useContext(BE);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:i})=>{let s=zd.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,VE.jsx)(BE.Provider,{value:s,children:e})};var Qt=w(b()),MO=3,WE=({children:e})=>{let t=L("CommandPalette",Ot);return(0,Qt.jsx)("div",{className:t.listItemActions,children:e})};function Oh(d){var m=d,{closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,extra:o,onSourceClick:i,description:s,sources:a,id:l,styles:u,defaultSourcesAmount:c=MO}=m,f=te(m,["closeOnSelect","lineClamp","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var k;let S=q(Jn),[y,p]=(0,KE.useState)(!1),{selected:g,onChangeOpen:h}=eo(),v=L("CommandPalette",Ot);function x(C){r(C),e&&h(!1)}return(0,Qt.jsxs)("div",{className:(0,ds.default)(v.listItem,l===g&&v.listItemSelected),children:[(0,Qt.jsx)("button",I(T({type:"button",className:(0,ds.default)(v.listItemAction,v.listItemPrimaryAction),"aria-disabled":(k=f.disabled)!=null?k:!1,onClick:x,"data-command-palette-item":!0,"data-item-id":l},f),{children:(0,Qt.jsxs)("div",{className:v.listItemContent,children:[typeof n=="string"?(0,Qt.jsx)("p",{className:(0,ds.default)(v.listItemText,v.truncate,u==null?void 0:u.title),children:n}):n,s&&(0,Qt.jsx)(us,{tagName:"p",allowList:[],content:Ud(s)?zE(s):s,className:(0,ds.default)(v.listItemDescription,u==null?void 0:u.description,t?v.lineClamp:v.truncate)})]})})),o,a&&a.length>0&&(0,Qt.jsxs)("div",{className:v.sources,children:[(0,Qt.jsx)("span",{className:v.sourcesTitle,children:S("sources")}),a.slice(0,y?a.length:c).map(C=>(0,Qt.jsx)("a",{className:v.source,href:C.url,target:"_blank",title:C.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>i&&i(C),children:C.name},C.url)),!y&&a.length>c&&(0,Qt.jsx)("button",{className:(0,ds.default)(v.source,v.sourceShowMore),type:"button",onClick:()=>p(!0),children:S("showMore",{amount:a.length-c})})]})]})}var il=w(b()),$E=()=>(0,il.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,il.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,il.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 zo=w(b());function Nh({children:e,title:t,id:n,onDismiss:r}){let o=q(Jn),i=L("CommandPalette",Ot),{page:s}=eo();return s!==n?null:(0,zo.jsxs)("div",{className:i.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,zo.jsxs)("div",{className:i.pageNav,children:[(0,zo.jsxs)("button",{className:i.pageBackButton,type:"button",onClick:r,children:[(0,zo.jsx)($E,{}),o("back")]}),t&&(0,zo.jsx)("h3",{className:i.pageTitle,children:t})]}),e]})}var qE=w(H());var sl=w(b()),fs=()=>(0,sl.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,sl.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,sl.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 fn=w(b());function _O({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=L("CommandPalette",Ot);return(0,fn.jsxs)("div",{className:l.search,children:[(0,fn.jsx)("div",{className:l.searchIcon,children:(0,fn.jsx)(fs,{})}),(0,fn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,fn.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:u=>{e(u.currentTarget.value)},onFocus:u=>{u.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,fn.jsx)("div",{className:l.selectWrapper,children:(0,fn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:s||r,children:[r&&(0,fn.jsx)("option",{children:r}),o.map(u=>(0,fn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var GE=(0,qE.forwardRef)(_O);var Mh=w(oe());var Bd=w(b()),DO=o=>{var i=o,{onClick:e,shortKeys:t,children:n}=i,r=te(i,["onClick","shortKeys","children"]);let s=L("CommandPalette",Ot);return(0,Bd.jsxs)("button",I(T({type:"button"},r),{onClick:e,className:(0,Mh.default)(s.actionButton,r.className,{[s.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(a=>(0,Bd.jsx)("span",{className:(0,Mh.default)(s.actionShortcut,a===8629&&s.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},YE=DO;var al=w(b()),FO="[data-command-palette-item]";function Bo({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:i,onChangeType:s,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d}){let[m,S]=(0,nr.useState)(),y=(0,nr.useRef)(null),p=()=>{o&&o(n),s(void 0),i(""),a(!1)},g=()=>{var D;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(D=y.current)==null||D.focus();return}if(d.length>0){i("");return}a(!1)},h=()=>{let D=v();D.length!==0&&S(D[0].dataset.itemId)},v=()=>Array.from(document.querySelectorAll(FO)||[]),x=D=>document.querySelector(`[data-item-id=${D}]`),k=D=>{let G=x(D);G&&S(G.dataset.itemId)},C=D=>{let G=x(D);G&&G.scrollIntoView({behavior:"smooth"})},R=()=>{if(!m)return;let D=v(),G=x(m);if(!G)return;let Z=D.indexOf(G),ie=D[Z+1];ie&&ie.dataset.itemId?k(ie.dataset.itemId):h()},N=()=>{if(!m)return;let D=v(),G=x(m);if(!G)return;let Z=D.indexOf(G),ie=D[Z-1];ie&&ie.dataset.itemId?k(ie.dataset.itemId):k(D[D.length-1].dataset.itemId)},_=(0,nr.useCallback)(D=>{switch(D.key){case"ArrowDown":{D.preventDefault(),R();break}case"ArrowUp":{D.preventDefault(),N();break}case"Enter":{if(m){let G=x(m);G==null||G.click()}break}}},[m]);return(0,nr.useEffect)(()=>{h()},[d,r,l,f]),(0,nr.useEffect)(()=>{m&&C(m)},[m]),(0,al.jsx)(Ad,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:p,onKeyDown:_,children:(0,al.jsxs)(jE,{selected:m,setSelected:S,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,al.jsx)(GE,{ref:y,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Bo.Page=Nh;Bo.List=Eh;Bo.Image=LE;Bo.ListItem=Oh;Bo.ListItemActions=WE;Bo.Button=YE;var me=Bo;var QE=w(H());function XE(e,t){(0,QE.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 ll=w(H());var ZE={data:null,fetchState:"idle"},jd=e=>{var i,s,a,l;let t=[],{visitorName:n}=(i=e.info.visitorInfo)!=null?i:{},{agentName:r,agentNickname:o}=(s=e.info.agentInfo)!=null?s:{};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},pn=K("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,i=yield o();return i.length===0?Promise.resolve([]):n.getEntities(i)})),HO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),UO=Y({name:"entities",initialState:ZE,reducers:{},extraReducers:e=>{e.addCase(pn.pending,t=>{t.fetchState="loading"}).addCase(pn.rejected,t=>{t.fetchState="error"}).addCase(pn.fulfilled,(t,n)=>{t.fetchState="done",t.data=HO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(ce,()=>ZE)}}),JE=UO.reducer;var _h={};Ye(_h,{enUS:()=>zO,nlNL:()=>BO});var zO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},BO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var eb={root:"dd-TYTKs",empty:"dd-AU7uT"};var ps=w(b()),jO=({onCopy:e})=>{let t=(0,ll.useRef)(null),n=L("EntitiesList",eb),r=M(jd),{setSelected:o}=eo(),i=q(_h),s=Q();return(0,ll.useEffect)(()=>{s(pn())},[]),(0,ll.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,ps.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,ps.jsx)(me.List,{children:r.map((a,l)=>(0,ps.jsx)(me.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,ps.jsx)("p",{className:n.empty,children:i("noResults")})]})},tb=jO;var mn=w(H());var nb={data:null,fetchState:"idle"},rb=e=>e.summary.data,ob=e=>e.summary.fetchState==="error",ib=e=>e.summary.model,rr=K("summary/getSummary",(e,t)=>P(void 0,null,function*(){var c,f,d;let n=t.getState().profile.data,r=(c=t.getState().conversation.current)==null?void 0:c.sessionId,o=(d=(f=t.getState().info)==null?void 0:f.agentInfo)==null?void 0:d.agentId;if(!n)throw new Error("Profile is not defined");let{deepdeskAPI:i,dynamicThunkObject:s}=t.extra;if(!s.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let a=s.conversationQuery,l=yield a();if(l.length===0)return Promise.reject(new Error("No messages are included"));let u=yield i.getSummary(l,{externalConversationId:r,agentId:o,promptInstruction:n.summarizerPromptInstruction,model:n.summarizerModel});return u.summary?u:Promise.reject(new Error("Summary is not provided"))})),VO=Y({name:"summary",initialState:nb,reducers:{},extraReducers:e=>{e.addCase(rr.pending,t=>{t.data=null,t.fetchState="loading"}).addCase(rr.rejected,t=>{t.data=null,t.fetchState="error"}).addCase(rr.fulfilled,(t,n)=>{t.fetchState="done",n.payload&&(t.data=n.payload.summary,t.model=n.payload.model)}).addCase(ce,()=>nb)}}),sb=VO.reducer;var Dh={};Ye(Dh,{enUS:()=>KO,nlNL:()=>WO});var KO={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."}]},WO={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 ab={root:"dd-60NZr",actions:"dd-No1g3",main:"dd-l-xEF",textInput:"dd-nAaiV",loading:"dd-ciFNi",error:"dd-yNp2D"};var Vd=w(oe()),db=w(H());var Fh=w(b()),Hh=e=>(0,Fh.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,Fh.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 Uh=w(b()),lb=e=>(0,Uh.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,Uh.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 ms(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(i=>{n.classList.add(i)}),n.addEventListener("animationend",()=>n.remove()),(o=e.parentElement)==null||o.appendChild(n)}var zh={};Ye(zh,{enUS:()=>$O,nlNL:()=>qO});var $O={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},qO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};function ub(e){return K("analytics/logEvent",(t,n)=>{var i,s,a;let r=(s=(i=n.getState())==null?void 0:i.conversation.current)==null?void 0:s.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 gs(){let e=Q();return(t,n)=>P(this,null,function*(){yield e(ub({name:t,data:n}))})}var cb={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var hs=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t;return o?r?n?`${o}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:null:`${o}${e}`:null};var or=w(b()),GO=({eventName:e,eventData:t,feedbackType:n,feedbackText:r})=>{let o=L("FeedbackThumbs",cb),i=z("enableFeedbackForm"),s=M(Yr),a=M(hs(`/admin/feedback?conversationId=${s}&type=${n}&text=${r}&data=${JSON.stringify(t)}`)),l=q(zh),u=gs(),[c,f]=(0,db.useState)(null),d=S=>{S.stopPropagation(),ms(S.target,o.fadeup),f("up"),u(e,I(T({},t),{rating:"up"}))},m=S=>{S.stopPropagation(),ms(S.target,o.fadedown),f("down"),u(e,I(T({},t),{rating:"down"}))};return(0,or.jsxs)("div",{className:o.thumbs,children:[(0,or.jsx)(re.Button,{title:l("thumbsUp"),onClick:d,icon:(0,or.jsx)(lb,{}),className:(0,Vd.default)(o.thumbsUp,c==="up"&&o.selected),disabled:!!c}),i&&a?(0,or.jsx)(re.Button,{as:"a",title:l("thumbsDown"),href:a,target:"_blank",rel:"noreferrer",onClick:m,icon:(0,or.jsx)(Hh,{}),className:(0,Vd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c}):(0,or.jsx)(re.Button,{title:l("thumbsDown"),onClick:m,icon:(0,or.jsx)(Hh,{}),className:(0,Vd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c})]})},ys=GO;var An=w(b()),YO=({onCopy:e})=>{let t=(0,mn.useRef)(null),n=L("SummaryForm",ab),[r,o]=(0,mn.useState)(""),i=q(Dh),s=M(ib),a=M(rb),l=M(ob),u=Q(),c=()=>{u(lt({name:"summary copied to clipboard",data:{originalText:a,finalText:r,model:s},options:{includeConversationData:!0}})),e(r)},f=()=>{let d=document.getSelection();d&&u(lt({name:"summary copied to clipboard",data:{originalText:a,finalText:d==null?void 0:d.toString(),model:s},options:{includeConversationData:!0}}))};return(0,mn.useEffect)(()=>{u(rr())},[]),(0,mn.useEffect)(()=>{o(a||"")},[a]),(0,mn.useEffect)(()=>{t.current&&a&&t.current.focus()},[t,a]),(0,mn.useEffect)(()=>{let d=m=>{m.key==="Enter"&&m.shiftKey&&c()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[r]),(0,An.jsx)("div",{className:n.root,tabIndex:-1,children:l?(0,An.jsx)("p",{className:n.error,children:i("error")}):(0,An.jsxs)(mn.Fragment,{children:[(0,An.jsx)("div",{className:n.main,children:(0,An.jsx)("textarea",{placeholder:a?void 0:i("loading"),disabled:!a,className:n.textInput,ref:t,value:r,onCopy:f,onChange:d=>o(d.target.value)})}),(0,An.jsxs)("div",{className:n.actions,children:[(0,An.jsx)(ys,{feedbackText:a||"",feedbackType:"summary",eventName:"summary feedback",eventData:{summary:a}}),(0,An.jsx)(me.Button,{shortKeys:[8679,8629],onClick:c,children:i("copy")})]})]})})},fb=YO;var ul={};Ye(ul,{enUS:()=>QO,nlNL:()=>XO});var QO={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?"}]},XO={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 ir=w(H());var Bh={};Ye(Bh,{enUS:()=>ZO,nlNL:()=>JO});var ZO={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"}]},JO={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 pb={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 eN={data:null,fetchState:"idle"},mb=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},cl=K("knowledgeAssistant/getKnowledgeAssistant",(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");let i=(s=r.profile.data)==null?void 0:s.knowledgeAssistant;return i?n.getKnowledgeAssistant(i):null})),tN=Y({name:"knowledgeAssistant",initialState:eN,reducers:{},extraReducers:e=>{e.addCase(cl.pending,t=>{t.fetchState="loading"}).addCase(cl.rejected,t=>{t.fetchState="error"}).addCase(cl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),gb=tN.reducer;var jh={data:[],fetchState:"idle"},hb=e=>{var t;return(t=e.answer)==null?void 0:t.data},yb=e=>e.answer.fetchState,vs=Ce("answer/resetKnowledgeSearch"),dl=K("answer/getAnswer",(e,t)=>P(void 0,null,function*(){var u,c,f;let{deepdeskAPI:n}=t.extra,r=t.getState().answer.data,{platformVariables:o}=t.getState().info,i=mb(t.getState()),s=(u=t.getState().conversation.current)==null?void 0:u.sessionId,a=(f=(c=t.getState().info)==null?void 0:c.agentInfo)==null?void 0:f.agentId;if(!i)throw new Error("KnowledgeAssistant is not defined");let l=yield n.knowledgeAssist({customerInstruction:i.customerInstruction,doNotKnowAnswer:i.doNotKnowAnswer,question:e},r,i.code,{agentId:a,conversationId:s});return o&&(l.answer=ut(l.answer,o)),{question:e,answer:l}})),nN=Y({name:"answer",initialState:jh,reducers:{},extraReducers:e=>{e.addCase(dl.pending,t=>{t.fetchState="loading"}).addCase(dl.rejected,t=>{t.fetchState="error"}).addCase(dl.fulfilled,(t,n)=>{t.fetchState="done",t.data=[...t.data,n.payload]}).addCase(ce,()=>jh).addCase(vs,()=>jh)}}),vb=nN.reducer;var fl=w(b()),Sb=()=>(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 ct=w(b()),rN=({onUse:e,onResetQuestion:t,question:n})=>{let[r,o]=ir.default.useState(""),[i,s]=ir.default.useState(!1),{setSelected:a}=eo(),l=(0,ir.useRef)(null),u=L("KnowledgeSearchStyles",pb),c=q(Bh),f=Q(),d=M(hb),m=M(yb),S=g=>P(void 0,null,function*(){s(!0),yield f(dl(g)),l.current&&s(!1)}),y=g=>P(void 0,null,function*(){g.preventDefault(),g.stopPropagation(),r!==""&&S(r)}),p=(g,h)=>{f(lt({name:"knowledge assist source viewed",data:{question:h,sourceViewed:g.url||g.name},options:{includeConversationData:!0}}))};return(0,ir.useEffect)(()=>{var g;n&&m==="idle"?S(n):(g=l.current)==null||g.focus()},[l,m]),(0,ir.useEffect)(()=>{m==="done"&&(f(lt({name:"knowledge assist question answered",data:{question:r||n,sources:d[d.length-1].answer.sources,answer:d[d.length-1].answer.answer,isFollowUpQuestion:d.length>1},options:{includeConversationData:!0}})),a(`knowledge-assist-${d.length-1}`),o(""))},[m,d]),(0,ir.useEffect)(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[l,d]),(0,ct.jsxs)("div",{className:u.root,children:[d.length>0&&(0,ct.jsx)("div",{className:u.alignRight,children:(0,ct.jsx)(me.Button,{onClick:t,children:c("reset")})}),d.map(({question:g,answer:h},v)=>(0,ct.jsx)(me.List,{children:(0,ct.jsx)(me.ListItem,{id:`knowledge-assist-${v}`,"data-testid":"knowledge-search-answer",description:h.answer,closeOnSelect:!0,onClick:()=>e(h.answer),onSourceClick:x=>p(x,g),sources:h.sources,styles:{title:u.question,description:u.answer},extra:(0,ct.jsx)("div",{className:u.listItemFeedback,children:(0,ct.jsx)(ys,{feedbackText:h.answer,feedbackType:"knowledge-assist-answer",eventName:"knowledge assist feedback",eventData:T({question:g,isAgent:n!==g,isFollowUpQuestion:d.length>1},h)})}),children:g})},`${h.answer}_${v}`)),m==="loading"&&(0,ct.jsx)("p",{className:u.status,children:c("loading")}),m==="error"&&(0,ct.jsx)("p",{className:u.status,children:c("error")}),(0,ct.jsxs)("form",{className:u.form,onSubmit:y,children:[(0,ct.jsx)("input",{ref:l,placeholder:c("anotherQuestion"),className:u.input,type:"text",value:r,onFocus:()=>{a(void 0)},onChange:g=>{a(void 0),o(g.target.value)}}),(0,ct.jsx)("button",{type:"submit",className:u.submit,disabled:i,children:(0,ct.jsx)(Sb,{})})]})]})},wb=rN;var oN={data:null,fetchState:"idle"},sr=e=>e.profile.data,Kd=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],xb=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,pl=K("profile/getProfile",(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");return((i=r.profile.data)==null?void 0:i.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)})),iN=Y({name:"profile",initialState:oN,reducers:{},extraReducers:e=>{e.addCase(pl.pending,t=>{t.fetchState="loading"}).addCase(pl.rejected,t=>{t.fetchState="error"}).addCase(pl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),Eb=iN.reducer;var Ib=w(H());var sN=["{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}"],aN=new RegExp(sN.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function bb(e,t){let n=e.split(aN),r=0,o=[];for(let i=0;i<n.length;i++){let s=n[i];if(o.push(s),i===n.length-1)break;if(t.indexOf(s)===-1)return e;let a=n[i+1],l=i===n.length-2;r+=s.length;let u=r;if(l){let f=a.charAt(0),d=0;do u=f?t.indexOf(f,u+1):-1,d+=1;while(u!==-1&&a.indexOf(t.slice(u))!==0);if(u===-1&&d>2)return e}else u=a&&a!==""?t.indexOf(a,r):-1;let c=u===-1?t.slice(r):t.slice(r,u);o.push(c),r=u}return o.join("")}function Cb(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var kb={suggestions:[],fetchState:"idle"},Tb={default:kb},Pb=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},Wd=e=>e.textSuggestions,Rb=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},$d=Ce("textSuggestions/refresh"),gn=K("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:i}=r.info,{textSuggestionsCount:s,inlineSuggestions:a}=r.settings,l=ss(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getTextSuggestions(o,$a(r),e);if(i&&(u=u.map(f=>T(I(T({},f),{text:ut(f.text,i)}),f.title?{title:ut(f.title,i)}:{}))),e==="default"){let f=a?u.filter(Rb(l)):u;t.dispatch(Qr(f.slice(0,s)))}return u})),ml=K("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:i}=r.info,{textSuggestionsCount:s,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(Rb(e))),i&&(u=u.map(f=>I(T({},f),{text:ut(f.text,i)}))),a&&(u=u.map(f=>I(T({},f),{text:f.source!=="trie-with-typos"?bb(f.text,e):f.text}))),u=Cb(u,s),t.dispatch(Qr(u)),u})),Ab=Y({name:"textSuggestions",initialState:Tb,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(gn.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||kb;return I(T({},t),{[r]:I(T({},o),{fetchState:"loading"})})}).addCase(gn.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(gn.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(ce,()=>Tb)}}),{setTextSuggestions:T7}=Ab.actions,Lb=Ab.reducer;var jo=w(b()),lN=({commands:e,onClick:t})=>{var a,l,u;let n=Q(),r=q(ul),o=M(sr),i=M(Wd),s=((u=(l=(a=o==null?void 0:o.uiConfig)==null?void 0:a.search)==null?void 0:l.initialTypes)==null?void 0:u.filter(({isActive:c})=>c))||[];return(0,Ib.useEffect)(()=>{s.forEach(({type:c})=>{(!i[c]||i[c].suggestions.length===0)&&n(gn(c))})},[]),(0,jo.jsxs)("div",{children:[e.length>0&&(0,jo.jsx)(me.List,{heading:r("commands"),children:e.map((c,f)=>(0,jo.jsx)(me.ListItem,{id:`command-${f}`,closeOnSelect:!1,onClick:c.onClick,children:c.label},c.label))}),s.map(({type:c,title:f})=>{var d;return(0,jo.jsx)(me.List,{heading:f,orientation:"vertical",children:(d=i[c])==null?void 0:d.suggestions.map((m,S)=>(0,jo.jsx)(me.ListItem,{id:`${c}-${S}`,closeOnSelect:!1,description:m.text,onClick:()=>t(m.text,m),"data-testid":"search-overlay-suggestion",children:m.title},`${m.id}-${m.text}`))},c)})]})},Ob=lN;var qe=w(H()),Nb=w(oe());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 Vo=w(b()),uN=0,Mb=qe.default.createContext(null),cN=()=>{let e=(0,qe.useContext)(Mb);if(!e)throw new Error("Invalid DropdownContext");return e},_b=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,qe.useMemo)(()=>++uN,[]),o=(0,qe.useRef)(null),i=(0,qe.useRef)(null),s=L("Dropdown",Vh),[a,l]=(0,qe.useState)(!1),[u,c]=(0,qe.useState)(n),f=m=>{m.preventDefault(),m.stopPropagation(),l(!a)},d=(0,qe.useCallback)(([m])=>{!m.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,qe.useEffect)(()=>{let m=S=>{o.current&&!o.current.contains(S.target)&&l(!1)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),(0,qe.useEffect)(()=>{if(!i.current&&!a)return()=>{};let m=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return i.current&&m.observe(i.current),()=>{i.current&&m.unobserve(i.current)}},[i,a]),(0,Vo.jsx)(Mb.Provider,{value:{setIsOpen:l},children:(0,Vo.jsxs)("div",{ref:o,className:s.root,children:[(0,Vo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:s.trigger,onClick:f,children:e}),(0,Vo.jsx)("div",{"data-testid":"dropdown-content",ref:i,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,Nb.default)(s.content,{[s.contentOpen]:a,[s.contentTop]:u==="top",[s.contentBottom]:u==="bottom"}),children:t})]})})};function dN(o){var i=o,{as:e,children:t,onClick:n}=i,r=te(i,["as","children","onClick"]);let s=e||"button",a=L("Dropdown",Vh),{setIsOpen:l}=cN(),u=c=>{l(!1),n(c),c.stopPropagation()};return(0,Vo.jsx)(s,I(T({type:"button",className:a.item,onClick:u},r),{children:t}))}_b.Item=dN;var Kh=_b;var Wh=w(b()),Db=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 Ko={};Ye(Ko,{enUS:()=>fN,nlNL:()=>pN});var fN={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"}]},pN={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 qd=w(b()),mN=({suggestion:e,source:t,context:n})=>{let r=q(Ko),o=M(Yr),i=Q(),s=z("enableSuggestionFeedback"),a=`${e.text}`,l=M(hs(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),u=()=>{i(lt({name:"suggestion feedback",data:{text:e.text,source:t,context:n},options:{includeConversationData:!0}}))};return!s||!l?null:(0,qd.jsx)(Kh,{trigger:(0,qd.jsx)(Db,{"data-testid":"feedback-dropdown-trigger"}),children:(0,qd.jsx)(Kh.Item,{as:"a",onClick:u,target:"_blank",href:l,children:r("giveFeedback")})})},Gd=mN;var De=w(b()),hN=200,yN=5,vN=4,Fb=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),SN=()=>{let e=Q(),t=Yt(),n=q(ul),[r,o]=(0,Nt.useState)(!1),[i,s]=(0,Nt.useState)(""),a=M(Z1),l=M(sr),[u,c]=(0,Nt.useState)(),f=M(at),d=z("showSearch"),m=z("enableSuggestionFeedback"),S=z("showEntitiesCommand"),y=z("showSummaryCommand"),p=z("showKnowledgeSearch"),g=z("showImageSearch"),h=z("searchTriggerKey"),v=M(PE),x=M(J1),k=M(eE),C=M(X1),R=V=>Sr(x.filter(Te=>Te.type===V.toUpperCase()),V),N=[{value:"PERSONAL",label:n("personalSuggestions"),list:R("PERSONAL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"URL",label:n("urlSuggestions"),list:R("URL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:R("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:R("IMAGE"),listOrientation:"horizontal",shouldShow:g}].filter(V=>V.shouldShow),_=[{label:n("entitiesClipboard"),onClick:()=>e(ln("entities")),shouldShow:S&&Fb(n("entitiesClipboard"),i)},{label:n("summaryClipboard"),onClick:()=>e(ln("summary")),shouldShow:y&&Fb(n("summaryClipboard"),i)},{label:i?`${n("knowledgeAssist")}: ${i}`:n("knowledgeAssist"),onClick:()=>e(ln("knowledgeAssist")),shouldShow:p}].filter(V=>V.shouldShow),D=(v==null?void 0:v.map(V=>({value:V.code.toUpperCase(),label:`${V.name}s`,list:R(V.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[],G=(0,Nt.useCallback)((0,Hb.default)((V,Te)=>{e(No({query:V,type:Te,tags:["search-overlay"],size:u?50:20}))},hN),[u]),Z=(0,Nt.useCallback)((V,Te)=>{switch(Te.type){case"IMAGE":t.send(lh,{suggestion:Te});break;default:t.send(Xr,{text:V,suggestion:Te})}e(Lt(!1))},[e]),ie=V=>{Zn(V.text),e(lt({name:"entity copied",data:{entity:V,type:"copy"}})),e(Lt(!1))},vr=V=>{t.send(Xr,{text:V,suggestion:{source:"knowledge-assist",text:V}}),e(lt({name:"answer used",data:{originalText:V},options:{includeConversationData:!0}})),s(""),e(ln("search")),e(vs()),e(Lt(!1))},_t=V=>{Zn(V),e(Lt(!1))};function Sr(V,Te){return V.slice(0,u?10:Te.toLowerCase()==="image"?vN:yN)}function Dt(V){return Te=>{r?window.confirm(n("warning"))&&(V(Te),o(!1)):V(Te)}}return(0,Nt.useEffect)(()=>{i?G(i,u):e(pd())},[i,u]),(0,Nt.useEffect)(()=>{a==="search"&&e(vs())},[a]),(0,Nt.useEffect)(()=>{f&&e(el())},[f]),XE(h,()=>e(Lt(!0))),!d||!l?null:(0,De.jsxs)(me,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:Dt(V=>e(Lt(V))),onChangeType:V=>c(V),onChangePage:Dt(V=>e(ln(V))),selectedType:u,search:i,page:a,isOpen:C,types:[...D,...N],children:[(0,De.jsxs)(me.Page,{id:"search",children:[i.length===0&&(0,De.jsx)(Ob,{commands:_,onClick:Z}),i.length>0&&(0,De.jsxs)(Nt.Fragment,{children:[_.length>0&&(0,De.jsx)(me.List,{heading:n("commands"),children:_.map((V,Te)=>(0,De.jsx)(me.ListItem,{closeOnSelect:!1,onClick:V.onClick,id:`commands-${Te}`,children:V.label},V.label))}),[...D,...N].map(({value:V,label:Te,list:ve,lineClamp:wr,listOrientation:Se})=>(0,De.jsx)(me.List,{heading:Te,orientation:Se==="horizontal"?"horizontal":"vertical",onShowAll:()=>c(V),hasMore:!u&&k[V.toLowerCase()]>Sr(ve,V).length,children:Sr(ve,V).map(ke=>(0,De.jsx)(me.ListItem,{id:`${V}-${ke.id}`,closeOnSelect:!1,lineClamp:wr,onClick:()=>Z(ke.text,ke),description:V!=="IMAGE"?ke.title&&ke.text:void 0,extra:m&&(0,De.jsx)(me.ListItemActions,{children:(0,De.jsx)(Gd,{context:i,source:"search",suggestion:ke})}),children:V==="IMAGE"?(0,De.jsx)(me.Image,{title:ke.title||ke.text,src:ke.image}):ke.title||ke.text},`${ke.id}-${ke.text}`))},V))]})]}),(0,De.jsx)(me.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:Dt(()=>{e(ln("search"))}),children:(0,De.jsx)(tb,{onCopy:ie})}),(0,De.jsx)(me.Page,{id:"summary",title:n("summaryTitle"),onDismiss:Dt(()=>{e(ln("search"))}),children:(0,De.jsx)(fb,{onCopy:_t})}),(0,De.jsx)(me.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:Dt(()=>{e(vs()),e(ln("search"))}),children:(0,De.jsx)(wb,{question:i,onUse:vr,onResetQuestion:()=>{e(vs()),s("")}})})]})},Ub=SN;var gl=w(b()),wN=()=>{let e=z("showSearch"),t=z("isEmbedded");return(0,gl.jsxs)(zb.Fragment,{children:[e&&(0,gl.jsx)(Ub,{}),t&&(0,gl.jsx)(EE,{})]})},Bb=wN;var Wb=w(oe());var Yd=w(b()),jb=({className:e})=>(0,Yd.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,Yd.jsx)("g",{children:(0,Yd.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||TO)();if(!o)return;let i=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",s=i==="body"||i==="fragment"?o.body:o.createElement(i);return t.match(EO)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,FE.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==DE||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),u=Dd[l]||Dd[s];if(!this.isSafe(t)||!l.match(bO)&&(!n&&(!u||u===Rh)||l.startsWith("on")||a.replace(/(\s|\0|�([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let c=l==="style"?this.extractStyleAttribute(t):a;u===Jr?c=!0:u===Fo?c=Number.parseFloat(String(c)):u!==_d&&(c=String(c)),r[Ah[l]||l]=this.applyAttributeFilters(l,c),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(i,s)=>String(s).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return ol[t]?I(T(T({},n),ol[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:i,transform:s,transformOnlyAllowList:a}=this.props,l=[],u="";return[...t.childNodes].forEach(c=>{if(c.nodeType===DE){let d=c.nodeName.toLowerCase(),m=this.getTagConfig(d);u&&(l.push(u),u="");let S=this.applyNodeFilters(d,c);if(!S)return;let y;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let p=this.keyIndex;y=this.parseNode(S,m);let g=s(S,y,m);if(g===null)return;if(typeof g!="undefined"){l.push(Uo.default.cloneElement(g,{key:p}));return}this.keyIndex=p-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,m))){var f;this.keyIndex+=1;let p=this.extractAttributes(S),g={tagName:d};p&&(g.attributes=p),m.void&&(g.selfClose=m.void),l.push(Uo.default.createElement(Fd,I(T({},g),{key:this.keyIndex}),(f=y)!==null&&f!==void 0?f:this.parseNode(S,m)))}else l=[...l,...this.parseNode(S,m.tagName?m:n)]}else if(c.nodeType===xO){let d=r&&!o?c.textContent:this.applyMatchers(c.textContent||"",n);Array.isArray(d)?l=[...l,...d]:u+=d}}),u&&l.push(u),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(CO);){let[s,a]=i,l=i.index,u=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:c,matcher:f,props:d}=n[a],m;if(u)m=s.length,r.push(f.createElement(c,d));else{let S=o.match(new RegExp(`{{{/${a}}}}`));m=S.index+S[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,S.index),n),d))}o=o.slice(m)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function kO(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,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 m=new Hd(i!=null?i:"",e).parse();m.length>0&&(d=m)}return d||(d=s),f?Uo.default.createElement(Uo.default.Fragment,null,d):Uo.default.createElement(Fd,{attributes:n,className:r,tagName:c},d)}function us(e){let k=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:u=null,onBeforeParse:c=null,tagName:f="span",noWrap:d=!1}=k,m=te(k,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),S=i?[]:l,y=o?[]:a,p=c?[c]:[],g=u?[u]:[];S.forEach(C=>{C.onBeforeParse&&p.push(C.onBeforeParse.bind(C)),C.onAfterParse&&g.push(C.onAfterParse.bind(C))});let h=p.reduce((C,R)=>R(C,e),r!=null?r:""),v=new Hd(h,m,S,y),x=g.reduce((C,R)=>R(C,e),v.parse());return Uo.default.createElement(kO,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var KE=w(H());var PO=/[.*+?^${}()|[\]\\]/g,RO=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function AO(e){return e.replace(PO,"\\$&")}function LO(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function IO(e){return e.search(RO)}function HE(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${AO(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function UE(e){return e.replace(iu,'<mark data-type="placeholder">$1</mark>')}function cs(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function OO(e,t){return e.split("").map((s,a)=>({char:s,index:a})).filter(({char:s,index:a})=>/\s/.test(s)&&a<=t).map(({index:s})=>s).reverse()[0]}function Ih(e,t,n={}){if(t){let r=LO(t.toLowerCase(),e.toLowerCase()),o=cs(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),u=IO(l);return`<span style="opacity: 0.5">${l.substring(u+1)}</span>${o}`}let s=t.split(e0).length>3||t.length>30?OO(t.trim(),r):0;return`${`${s>0?"\u2026":""}${cs(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var NO=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function Ud(e){return NO.test(e)}function zE(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var zd=w(H()),VE=w(b()),BE=zd.default.createContext(void 0);function eo(){let e=zd.default.useContext(BE);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:i})=>{let s=zd.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,VE.jsx)(BE.Provider,{value:s,children:e})};var Qt=w(b()),MO=3,WE=({children:e})=>{let t=L("CommandPalette",Ot);return(0,Qt.jsx)("div",{className:t.listItemActions,children:e})};function Oh(d){var m=d,{closeOnSelect:e=!0,lineClamp:t,children:n,onClick:r,extra:o,onSourceClick:i,description:s,sources:a,id:l,styles:u,defaultSourcesAmount:c=MO}=m,f=te(m,["closeOnSelect","lineClamp","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var k;let S=q(Jn),[y,p]=(0,KE.useState)(!1),{selected:g,onChangeOpen:h}=eo(),v=L("CommandPalette",Ot);function x(C){r(C),e&&h(!1)}return(0,Qt.jsxs)("div",{className:(0,ds.default)(v.listItem,l===g&&v.listItemSelected),children:[(0,Qt.jsx)("button",I(T({type:"button",className:(0,ds.default)(v.listItemAction,v.listItemPrimaryAction),"aria-disabled":(k=f.disabled)!=null?k:!1,onClick:x,"data-command-palette-item":!0,"data-item-id":l},f),{children:(0,Qt.jsxs)("div",{className:v.listItemContent,children:[typeof n=="string"?(0,Qt.jsx)("p",{className:(0,ds.default)(v.listItemText,v.truncate,u==null?void 0:u.title),children:n}):n,s&&(0,Qt.jsx)(us,{tagName:"p",allowList:[],content:Ud(s)?zE(s):s,className:(0,ds.default)(v.listItemDescription,u==null?void 0:u.description,t?v.lineClamp:v.truncate)})]})})),o,a&&a.length>0&&(0,Qt.jsxs)("div",{className:v.sources,children:[(0,Qt.jsx)("span",{className:v.sourcesTitle,children:S("sources")}),a.slice(0,y?a.length:c).map(C=>(0,Qt.jsx)("a",{className:v.source,href:C.url,target:"_blank",title:C.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>i&&i(C),children:C.name},C.url)),!y&&a.length>c&&(0,Qt.jsx)("button",{className:(0,ds.default)(v.source,v.sourceShowMore),type:"button",onClick:()=>p(!0),children:S("showMore",{amount:a.length-c})})]})]})}var il=w(b()),$E=()=>(0,il.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,il.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,il.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 zo=w(b());function Nh({children:e,title:t,id:n,onDismiss:r}){let o=q(Jn),i=L("CommandPalette",Ot),{page:s}=eo();return s!==n?null:(0,zo.jsxs)("div",{className:i.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,zo.jsxs)("div",{className:i.pageNav,children:[(0,zo.jsxs)("button",{className:i.pageBackButton,type:"button",onClick:r,children:[(0,zo.jsx)($E,{}),o("back")]}),t&&(0,zo.jsx)("h3",{className:i.pageTitle,children:t})]}),e]})}var qE=w(H());var sl=w(b()),fs=()=>(0,sl.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,sl.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,sl.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 fn=w(b());function _O({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=L("CommandPalette",Ot);return(0,fn.jsxs)("div",{className:l.search,children:[(0,fn.jsx)("div",{className:l.searchIcon,children:(0,fn.jsx)(fs,{})}),(0,fn.jsxs)("div",{className:l.searchInputWrapper,children:[(0,fn.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:u=>{e(u.currentTarget.value)},onFocus:u=>{u.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,fn.jsx)("div",{className:l.selectWrapper,children:(0,fn.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:u=>t(u.target.value===r?void 0:u.target.value),value:s||r,children:[r&&(0,fn.jsx)("option",{children:r}),o.map(u=>(0,fn.jsx)("option",{value:u.value,children:u.label},u.value))]})})]})]})}var GE=(0,qE.forwardRef)(_O);var Mh=w(oe());var Bd=w(b()),DO=o=>{var i=o,{onClick:e,shortKeys:t,children:n}=i,r=te(i,["onClick","shortKeys","children"]);let s=L("CommandPalette",Ot);return(0,Bd.jsxs)("button",I(T({type:"button"},r),{onClick:e,className:(0,Mh.default)(s.actionButton,r.className,{[s.hasShortKeys]:t&&t.length>0}),children:[n,t&&t.map(a=>(0,Bd.jsx)("span",{className:(0,Mh.default)(s.actionShortcut,a===8629&&s.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},YE=DO;var al=w(b()),FO="[data-command-palette-item]";function Bo({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:i,onChangeType:s,onChangeOpen:a,selectedType:l,types:u,children:c,isOpen:f,search:d}){let[m,S]=(0,nr.useState)(),y=(0,nr.useRef)(null),p=()=>{o&&o(n),s(void 0),i(""),a(!1)},g=()=>{var D;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(D=y.current)==null||D.focus();return}if(d.length>0){i("");return}a(!1)},h=()=>{let D=v();D.length!==0&&S(D[0].dataset.itemId)},v=()=>Array.from(document.querySelectorAll(FO)||[]),x=D=>document.querySelector(`[data-item-id=${D}]`),k=D=>{let G=x(D);G&&S(G.dataset.itemId)},C=D=>{let G=x(D);G&&G.scrollIntoView({behavior:"smooth"})},R=()=>{if(!m)return;let D=v(),G=x(m);if(!G)return;let Z=D.indexOf(G),ie=D[Z+1];ie&&ie.dataset.itemId?k(ie.dataset.itemId):h()},N=()=>{if(!m)return;let D=v(),G=x(m);if(!G)return;let Z=D.indexOf(G),ie=D[Z-1];ie&&ie.dataset.itemId?k(ie.dataset.itemId):k(D[D.length-1].dataset.itemId)},_=(0,nr.useCallback)(D=>{switch(D.key){case"ArrowDown":{D.preventDefault(),R();break}case"ArrowUp":{D.preventDefault(),N();break}case"Enter":{if(m){let G=x(m);G==null||G.click()}break}}},[m]);return(0,nr.useEffect)(()=>{h()},[d,r,l,f]),(0,nr.useEffect)(()=>{m&&C(m)},[m]),(0,al.jsx)(Ad,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:p,onKeyDown:_,children:(0,al.jsxs)(jE,{selected:m,setSelected:S,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,al.jsx)(GE,{ref:y,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:u,typePlaceholder:t}),c]})})}Bo.Page=Nh;Bo.List=Eh;Bo.Image=LE;Bo.ListItem=Oh;Bo.ListItemActions=WE;Bo.Button=YE;var me=Bo;var QE=w(H());function XE(e,t){(0,QE.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 ll=w(H());var ZE={data:null,fetchState:"idle"},jd=e=>{var i,s,a,l;let t=[],{visitorName:n}=(i=e.info.visitorInfo)!=null?i:{},{agentName:r,agentNickname:o}=(s=e.info.agentInfo)!=null?s:{};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},pn=K("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,i=yield o();return i.length===0?Promise.resolve([]):n.getEntities(i)})),HO=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),UO=Y({name:"entities",initialState:ZE,reducers:{},extraReducers:e=>{e.addCase(pn.pending,t=>{t.fetchState="loading"}).addCase(pn.rejected,t=>{t.fetchState="error"}).addCase(pn.fulfilled,(t,n)=>{t.fetchState="done",t.data=HO(t.data?[...t.data,...n.payload]:n.payload)}).addCase(ce,()=>ZE)}}),JE=UO.reducer;var _h={};Ye(_h,{enUS:()=>zO,nlNL:()=>BO});var zO={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},BO={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var eb={root:"dd-TYTKs",empty:"dd-AU7uT"};var ps=w(b()),jO=({onCopy:e})=>{let t=(0,ll.useRef)(null),n=L("EntitiesList",eb),r=M(jd),{setSelected:o}=eo(),i=q(_h),s=Q();return(0,ll.useEffect)(()=>{s(pn())},[]),(0,ll.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,ps.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,ps.jsx)(me.List,{children:r.map((a,l)=>(0,ps.jsx)(me.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,ps.jsx)("p",{className:n.empty,children:i("noResults")})]})},tb=jO;var mn=w(H());var nb={data:null,fetchState:"idle"},rb=e=>e.summary.data,ob=e=>e.summary.fetchState==="error",ib=e=>e.summary.model,rr=K("summary/getSummary",(e,t)=>P(void 0,null,function*(){var c,f,d;let n=t.getState().profile.data,r=(c=t.getState().conversation.current)==null?void 0:c.sessionId,o=(d=(f=t.getState().info)==null?void 0:f.agentInfo)==null?void 0:d.agentId;if(!n)throw new Error("Profile is not defined");let{deepdeskAPI:i,dynamicThunkObject:s}=t.extra;if(!s.conversationQuery)return Promise.reject(new Error("setConversationQuery method is not defined"));let a=s.conversationQuery,l=yield a();if(l.length===0)return Promise.reject(new Error("No messages are included"));let u=yield i.getSummary(l,{externalConversationId:r,agentId:o,promptInstruction:n.summarizerPromptInstruction,model:n.summarizerModel});return u.summary?u:Promise.reject(new Error("Summary is not provided"))})),VO=Y({name:"summary",initialState:nb,reducers:{},extraReducers:e=>{e.addCase(rr.pending,t=>{t.data=null,t.fetchState="loading"}).addCase(rr.rejected,t=>{t.data=null,t.fetchState="error"}).addCase(rr.fulfilled,(t,n)=>{t.fetchState="done",n.payload&&(t.data=n.payload.summary,t.model=n.payload.model)}).addCase(ce,()=>nb)}}),sb=VO.reducer;var Dh={};Ye(Dh,{enUS:()=>KO,nlNL:()=>WO});var KO={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."}]},WO={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 ab={root:"dd-60NZr",actions:"dd-No1g3",main:"dd-l-xEF",textInput:"dd-nAaiV",loading:"dd-ciFNi",error:"dd-yNp2D"};var Vd=w(oe()),db=w(H());var Fh=w(b()),Hh=e=>(0,Fh.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,Fh.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 Uh=w(b()),lb=e=>(0,Uh.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,Uh.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 ms(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(i=>{n.classList.add(i)}),n.addEventListener("animationend",()=>n.remove()),(o=e.parentElement)==null||o.appendChild(n)}var zh={};Ye(zh,{enUS:()=>$O,nlNL:()=>qO});var $O={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},qO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};function ub(e){return K("analytics/logEvent",(t,n)=>{var i,s,a;let r=(s=(i=n.getState())==null?void 0:i.conversation.current)==null?void 0:s.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 gs(){let e=Q();return(t,n)=>P(this,null,function*(){yield e(ub({name:t,data:n}))})}var cb={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var hs=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t;return o?r?n?`${o}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:null:`${o}${e}`:null};var or=w(b()),GO=({eventName:e,eventData:t,feedbackType:n,feedbackText:r})=>{let o=L("FeedbackThumbs",cb),i=z("enableFeedbackForm"),s=M(Yr),a=M(hs(`/admin/feedback?conversationId=${s}&type=${n}&text=${r}&data=${JSON.stringify(t)}`)),l=q(zh),u=gs(),[c,f]=(0,db.useState)(null),d=S=>{S.stopPropagation(),ms(S.target,o.fadeup),f("up"),u(e,I(T({},t),{rating:"up"}))},m=S=>{S.stopPropagation(),ms(S.target,o.fadedown),f("down"),u(e,I(T({},t),{rating:"down"}))};return(0,or.jsxs)("div",{className:o.thumbs,children:[(0,or.jsx)(re.Button,{title:l("thumbsUp"),onClick:d,icon:(0,or.jsx)(lb,{}),className:(0,Vd.default)(o.thumbsUp,c==="up"&&o.selected),disabled:!!c}),i&&a?(0,or.jsx)(re.Button,{as:"a",title:l("thumbsDown"),href:a,target:"_blank",rel:"noreferrer",onClick:m,icon:(0,or.jsx)(Hh,{}),className:(0,Vd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c}):(0,or.jsx)(re.Button,{title:l("thumbsDown"),onClick:m,icon:(0,or.jsx)(Hh,{}),className:(0,Vd.default)(o.thumbsDown,c==="down"&&o.selected),disabled:!!c})]})},ys=GO;var An=w(b()),YO=({onCopy:e})=>{let t=(0,mn.useRef)(null),n=L("SummaryForm",ab),[r,o]=(0,mn.useState)(""),i=q(Dh),s=M(ib),a=M(rb),l=M(ob),u=Q(),c=()=>{u(lt({name:"summary copied to clipboard",data:{originalText:a,finalText:r,model:s},options:{includeConversationData:!0}})),e(r)},f=()=>{let d=document.getSelection();d&&u(lt({name:"summary copied to clipboard",data:{originalText:a,finalText:d==null?void 0:d.toString(),model:s},options:{includeConversationData:!0}}))};return(0,mn.useEffect)(()=>{u(rr())},[]),(0,mn.useEffect)(()=>{o(a||"")},[a]),(0,mn.useEffect)(()=>{t.current&&a&&t.current.focus()},[t,a]),(0,mn.useEffect)(()=>{let d=m=>{m.key==="Enter"&&m.shiftKey&&c()};return document.addEventListener("keydown",d),()=>{document.removeEventListener("keydown",d)}},[r]),(0,An.jsx)("div",{className:n.root,tabIndex:-1,children:l?(0,An.jsx)("p",{className:n.error,children:i("error")}):(0,An.jsxs)(mn.Fragment,{children:[(0,An.jsx)("div",{className:n.main,children:(0,An.jsx)("textarea",{placeholder:a?void 0:i("loading"),disabled:!a,className:n.textInput,ref:t,value:r,onCopy:f,onChange:d=>o(d.target.value)})}),(0,An.jsxs)("div",{className:n.actions,children:[(0,An.jsx)(ys,{feedbackText:a||"",feedbackType:"summary",eventName:"summary feedback",eventData:{summary:a}}),(0,An.jsx)(me.Button,{shortKeys:[8679,8629],onClick:c,children:i("copy")})]})]})})},fb=YO;var ul={};Ye(ul,{enUS:()=>QO,nlNL:()=>XO});var QO={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?"}]},XO={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 ir=w(H());var Bh={};Ye(Bh,{enUS:()=>ZO,nlNL:()=>JO});var ZO={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"}]},JO={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 pb={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 eN={data:null,fetchState:"idle"},mb=e=>{var t;return(t=e.knowledgeAssistant)==null?void 0:t.data},cl=K("knowledgeAssistant/getKnowledgeAssistant",(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");let i=(s=r.profile.data)==null?void 0:s.knowledgeAssistant;return i?n.getKnowledgeAssistant(i):null})),tN=Y({name:"knowledgeAssistant",initialState:eN,reducers:{},extraReducers:e=>{e.addCase(cl.pending,t=>{t.fetchState="loading"}).addCase(cl.rejected,t=>{t.fetchState="error"}).addCase(cl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),gb=tN.reducer;var jh={data:[],fetchState:"idle"},hb=e=>{var t;return(t=e.answer)==null?void 0:t.data},yb=e=>e.answer.fetchState,vs=Ce("answer/resetKnowledgeSearch"),dl=K("answer/getAnswer",(e,t)=>P(void 0,null,function*(){var u,c,f;let{deepdeskAPI:n}=t.extra,r=t.getState().answer.data,{platformVariables:o}=t.getState().info,i=mb(t.getState()),s=(u=t.getState().conversation.current)==null?void 0:u.sessionId,a=(f=(c=t.getState().info)==null?void 0:c.agentInfo)==null?void 0:f.agentId;if(!i)throw new Error("KnowledgeAssistant is not defined");let l=yield n.knowledgeAssist({customerInstruction:i.customerInstruction,doNotKnowAnswer:i.doNotKnowAnswer,question:e},r,i.code,{agentId:a,conversationId:s});return o&&(l.answer=ut(l.answer,o)),{question:e,answer:l}})),nN=Y({name:"answer",initialState:jh,reducers:{},extraReducers:e=>{e.addCase(dl.pending,t=>{t.fetchState="loading"}).addCase(dl.rejected,t=>{t.fetchState="error"}).addCase(dl.fulfilled,(t,n)=>{t.fetchState="done",t.data=[...t.data,n.payload]}).addCase(ce,()=>jh).addCase(vs,()=>jh)}}),vb=nN.reducer;var fl=w(b()),Sb=()=>(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 ct=w(b()),rN=({onUse:e,onResetQuestion:t,question:n})=>{let[r,o]=ir.default.useState(""),[i,s]=ir.default.useState(!1),{setSelected:a}=eo(),l=(0,ir.useRef)(null),u=L("KnowledgeSearchStyles",pb),c=q(Bh),f=Q(),d=M(hb),m=M(yb),S=g=>P(void 0,null,function*(){s(!0),yield f(dl(g)),l.current&&s(!1)}),y=g=>P(void 0,null,function*(){g.preventDefault(),g.stopPropagation(),r!==""&&S(r)}),p=(g,h)=>{f(lt({name:"knowledge assist source viewed",data:{question:h,sourceViewed:g.url||g.name},options:{includeConversationData:!0}}))};return(0,ir.useEffect)(()=>{var g;n&&m==="idle"?S(n):(g=l.current)==null||g.focus()},[l,m]),(0,ir.useEffect)(()=>{m==="done"&&(f(lt({name:"knowledge assist question answered",data:{question:r||n,sources:d[d.length-1].answer.sources,answer:d[d.length-1].answer.answer,isFollowUpQuestion:d.length>1},options:{includeConversationData:!0}})),a(`knowledge-assist-${d.length-1}`),o(""))},[m,d]),(0,ir.useEffect)(()=>{l.current&&l.current.scrollIntoView({behavior:"smooth"})},[l,d]),(0,ct.jsxs)("div",{className:u.root,children:[d.length>0&&(0,ct.jsx)("div",{className:u.alignRight,children:(0,ct.jsx)(me.Button,{onClick:t,children:c("reset")})}),d.map(({question:g,answer:h},v)=>(0,ct.jsx)(me.List,{children:(0,ct.jsx)(me.ListItem,{id:`knowledge-assist-${v}`,"data-testid":"knowledge-search-answer",description:h.answer,closeOnSelect:!0,onClick:()=>e(h.answer),onSourceClick:x=>p(x,g),sources:h.sources,styles:{title:u.question,description:u.answer},extra:(0,ct.jsx)("div",{className:u.listItemFeedback,children:(0,ct.jsx)(ys,{feedbackText:h.answer,feedbackType:"knowledge-assist-answer",eventName:"knowledge assist feedback",eventData:T({question:g,isAgent:n!==g,isFollowUpQuestion:d.length>1},h)})}),children:g})},`${h.answer}_${v}`)),m==="loading"&&(0,ct.jsx)("p",{className:u.status,children:c("loading")}),m==="error"&&(0,ct.jsx)("p",{className:u.status,children:c("error")}),(0,ct.jsxs)("form",{className:u.form,onSubmit:y,children:[(0,ct.jsx)("input",{ref:l,placeholder:c("anotherQuestion"),className:u.input,type:"text",value:r,onFocus:()=>{a(void 0)},onChange:g=>{a(void 0),o(g.target.value)}}),(0,ct.jsx)("button",{type:"submit",className:u.submit,disabled:i,children:(0,ct.jsx)(Sb,{})})]})]})},wb=rN;var oN={data:null,fetchState:"idle"},sr=e=>e.profile.data,Kd=e=>e.profile.data?e.profile.data.uiConfig.widget.types.filter(t=>t.isActive):[],xb=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,pl=K("profile/getProfile",(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");return((i=r.profile.data)==null?void 0:i.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)})),iN=Y({name:"profile",initialState:oN,reducers:{},extraReducers:e=>{e.addCase(pl.pending,t=>{t.fetchState="loading"}).addCase(pl.rejected,t=>{t.fetchState="error"}).addCase(pl.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),Eb=iN.reducer;var Ib=w(H());var sN=["{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}"],aN=new RegExp(sN.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function bb(e,t){let n=e.split(aN),r=0,o=[];for(let i=0;i<n.length;i++){let s=n[i];if(o.push(s),i===n.length-1)break;if(t.indexOf(s)===-1)return e;let a=n[i+1],l=i===n.length-2;r+=s.length;let u=r;if(l){let f=a.charAt(0),d=0;do u=f?t.indexOf(f,u+1):-1,d+=1;while(u!==-1&&a.indexOf(t.slice(u))!==0);if(u===-1&&d>2)return e}else u=a&&a!==""?t.indexOf(a,r):-1;let c=u===-1?t.slice(r):t.slice(r,u);o.push(c),r=u}return o.join("")}function Cb(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var kb={suggestions:[],fetchState:"idle"},Tb={default:kb},Pb=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},Wd=e=>e.textSuggestions,Rb=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},$d=Ce("textSuggestions/refresh"),gn=K("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:i}=r.info,{textSuggestionsCount:s,inlineSuggestions:a}=r.settings,l=ss(r);if(!o)throw new Error("No current conversation to fetch text suggestions");let u=yield n.getTextSuggestions(o,$a(r),e);if(i&&(u=u.map(f=>T(I(T({},f),{text:ut(f.text,i)}),f.title?{title:ut(f.title,i)}:{}))),e==="default"){let f=a?u.filter(Rb(l)):u;t.dispatch(Qr(f.slice(0,s)))}return u})),ml=K("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:i}=r.info,{textSuggestionsCount:s,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(Rb(e))),i&&(u=u.map(f=>I(T({},f),{text:ut(f.text,i)}))),a&&(u=u.map(f=>I(T({},f),{text:f.source!=="trie-with-typos"?bb(f.text,e):f.text}))),u=Cb(u,s),t.dispatch(Qr(u)),u})),Ab=Y({name:"textSuggestions",initialState:Tb,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(gn.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||kb;return I(T({},t),{[r]:I(T({},o),{fetchState:"loading"})})}).addCase(gn.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(gn.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(ce,()=>Tb)}}),{setTextSuggestions:k7}=Ab.actions,Lb=Ab.reducer;var jo=w(b()),lN=({commands:e,onClick:t})=>{var a,l,u;let n=Q(),r=q(ul),o=M(sr),i=M(Wd),s=((u=(l=(a=o==null?void 0:o.uiConfig)==null?void 0:a.search)==null?void 0:l.initialTypes)==null?void 0:u.filter(({isActive:c})=>c))||[];return(0,Ib.useEffect)(()=>{s.forEach(({type:c})=>{(!i[c]||i[c].suggestions.length===0)&&n(gn(c))})},[]),(0,jo.jsxs)("div",{children:[e.length>0&&(0,jo.jsx)(me.List,{heading:r("commands"),children:e.map((c,f)=>(0,jo.jsx)(me.ListItem,{id:`command-${f}`,closeOnSelect:!1,onClick:c.onClick,children:c.label},c.label))}),s.map(({type:c,title:f})=>{var d;return(0,jo.jsx)(me.List,{heading:f,orientation:"vertical",children:(d=i[c])==null?void 0:d.suggestions.map((m,S)=>(0,jo.jsx)(me.ListItem,{id:`${c}-${S}`,closeOnSelect:!1,description:m.text,onClick:()=>t(m.text,m),"data-testid":"search-overlay-suggestion",children:m.title},`${m.id}-${m.text}`))},c)})]})},Ob=lN;var qe=w(H()),Nb=w(oe());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 Vo=w(b()),uN=0,Mb=qe.default.createContext(null),cN=()=>{let e=(0,qe.useContext)(Mb);if(!e)throw new Error("Invalid DropdownContext");return e},_b=({trigger:e,children:t,position:n="bottom"})=>{let r=(0,qe.useMemo)(()=>++uN,[]),o=(0,qe.useRef)(null),i=(0,qe.useRef)(null),s=L("Dropdown",Vh),[a,l]=(0,qe.useState)(!1),[u,c]=(0,qe.useState)(n),f=m=>{m.preventDefault(),m.stopPropagation(),l(!a)},d=(0,qe.useCallback)(([m])=>{!m.isIntersecting&&a&&c(u==="top"?"bottom":"top")},[a]);return(0,qe.useEffect)(()=>{let m=S=>{o.current&&!o.current.contains(S.target)&&l(!1)};return document.addEventListener("click",m),()=>{document.removeEventListener("click",m)}},[]),(0,qe.useEffect)(()=>{if(!i.current&&!a)return()=>{};let m=new IntersectionObserver(d,{root:null,rootMargin:"0px",threshold:1});return i.current&&m.observe(i.current),()=>{i.current&&m.unobserve(i.current)}},[i,a]),(0,Vo.jsx)(Mb.Provider,{value:{setIsOpen:l},children:(0,Vo.jsxs)("div",{ref:o,className:s.root,children:[(0,Vo.jsx)("button",{id:`dropdown-${r}`,"data-testid":"dropdown-trigger","aria-haspopup":"true","aria-expanded":a,"aria-label":"Dropdown trigger",type:"button",className:s.trigger,onClick:f,children:e}),(0,Vo.jsx)("div",{"data-testid":"dropdown-content",ref:i,"aria-hidden":!a,"aria-labelledby":`dropdown-${r}`,className:(0,Nb.default)(s.content,{[s.contentOpen]:a,[s.contentTop]:u==="top",[s.contentBottom]:u==="bottom"}),children:t})]})})};function dN(o){var i=o,{as:e,children:t,onClick:n}=i,r=te(i,["as","children","onClick"]);let s=e||"button",a=L("Dropdown",Vh),{setIsOpen:l}=cN(),u=c=>{l(!1),n(c),c.stopPropagation()};return(0,Vo.jsx)(s,I(T({type:"button",className:a.item,onClick:u},r),{children:t}))}_b.Item=dN;var Kh=_b;var Wh=w(b()),Db=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 Ko={};Ye(Ko,{enUS:()=>fN,nlNL:()=>pN});var fN={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"}]},pN={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 qd=w(b()),mN=({suggestion:e,source:t,context:n})=>{let r=q(Ko),o=M(Yr),i=Q(),s=z("enableSuggestionFeedback"),a=`${e.text}`,l=M(hs(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),u=()=>{i(lt({name:"suggestion feedback",data:{text:e.text,source:t,context:n},options:{includeConversationData:!0}}))};return!s||!l?null:(0,qd.jsx)(Kh,{trigger:(0,qd.jsx)(Db,{"data-testid":"feedback-dropdown-trigger"}),children:(0,qd.jsx)(Kh.Item,{as:"a",onClick:u,target:"_blank",href:l,children:r("giveFeedback")})})},Gd=mN;var De=w(b()),hN=200,yN=5,vN=4,Fb=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),SN=()=>{let e=Q(),t=Yt(),n=q(ul),[r,o]=(0,Nt.useState)(!1),[i,s]=(0,Nt.useState)(""),a=M(Z1),l=M(sr),[u,c]=(0,Nt.useState)(),f=M(at),d=z("showSearch"),m=z("enableSuggestionFeedback"),S=z("showEntitiesCommand"),y=z("showSummaryCommand"),p=z("showKnowledgeSearch"),g=z("showImageSearch"),h=z("searchTriggerKey"),v=M(PE),x=M(J1),k=M(eE),C=M(X1),R=V=>Sr(x.filter(Te=>Te.type===V.toUpperCase()),V),N=[{value:"PERSONAL",label:n("personalSuggestions"),list:R("PERSONAL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"URL",label:n("urlSuggestions"),list:R("URL"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:R("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical",shouldShow:!0},{value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:R("IMAGE"),listOrientation:"horizontal",shouldShow:g}].filter(V=>V.shouldShow),_=[{label:n("entitiesClipboard"),onClick:()=>e(ln("entities")),shouldShow:S&&Fb(n("entitiesClipboard"),i)},{label:n("summaryClipboard"),onClick:()=>e(ln("summary")),shouldShow:y&&Fb(n("summaryClipboard"),i)},{label:i?`${n("knowledgeAssist")}: ${i}`:n("knowledgeAssist"),onClick:()=>e(ln("knowledgeAssist")),shouldShow:p}].filter(V=>V.shouldShow),D=(v==null?void 0:v.map(V=>({value:V.code.toUpperCase(),label:`${V.name}s`,list:R(V.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[],G=(0,Nt.useCallback)((0,Hb.default)((V,Te)=>{e(No({query:V,type:Te,tags:["search-overlay"],size:u?50:20}))},hN),[u]),Z=(0,Nt.useCallback)((V,Te)=>{switch(Te.type){case"IMAGE":t.send(lh,{suggestion:Te});break;default:t.send(Xr,{text:V,suggestion:Te})}e(Lt(!1))},[e]),ie=V=>{Zn(V.text),e(lt({name:"entity copied",data:{entity:V,type:"copy"}})),e(Lt(!1))},vr=V=>{t.send(Xr,{text:V,suggestion:{source:"knowledge-assist",text:V}}),e(lt({name:"answer used",data:{originalText:V},options:{includeConversationData:!0}})),s(""),e(ln("search")),e(vs()),e(Lt(!1))},_t=V=>{Zn(V),e(Lt(!1))};function Sr(V,Te){return V.slice(0,u?10:Te.toLowerCase()==="image"?vN:yN)}function Dt(V){return Te=>{r?window.confirm(n("warning"))&&(V(Te),o(!1)):V(Te)}}return(0,Nt.useEffect)(()=>{i?G(i,u):e(pd())},[i,u]),(0,Nt.useEffect)(()=>{a==="search"&&e(vs())},[a]),(0,Nt.useEffect)(()=>{f&&e(el())},[f]),XE(h,()=>e(Lt(!0))),!d||!l?null:(0,De.jsxs)(me,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:Dt(V=>e(Lt(V))),onChangeType:V=>c(V),onChangePage:Dt(V=>e(ln(V))),selectedType:u,search:i,page:a,isOpen:C,types:[...D,...N],children:[(0,De.jsxs)(me.Page,{id:"search",children:[i.length===0&&(0,De.jsx)(Ob,{commands:_,onClick:Z}),i.length>0&&(0,De.jsxs)(Nt.Fragment,{children:[_.length>0&&(0,De.jsx)(me.List,{heading:n("commands"),children:_.map((V,Te)=>(0,De.jsx)(me.ListItem,{closeOnSelect:!1,onClick:V.onClick,id:`commands-${Te}`,children:V.label},V.label))}),[...D,...N].map(({value:V,label:Te,list:ve,lineClamp:wr,listOrientation:Se})=>(0,De.jsx)(me.List,{heading:Te,orientation:Se==="horizontal"?"horizontal":"vertical",onShowAll:()=>c(V),hasMore:!u&&k[V.toLowerCase()]>Sr(ve,V).length,children:Sr(ve,V).map(ke=>(0,De.jsx)(me.ListItem,{id:`${V}-${ke.id}`,closeOnSelect:!1,lineClamp:wr,onClick:()=>Z(ke.text,ke),description:V!=="IMAGE"?ke.title&&ke.text:void 0,extra:m&&(0,De.jsx)(me.ListItemActions,{children:(0,De.jsx)(Gd,{context:i,source:"search",suggestion:ke})}),children:V==="IMAGE"?(0,De.jsx)(me.Image,{title:ke.title||ke.text,src:ke.image}):ke.title||ke.text},`${ke.id}-${ke.text}`))},V))]})]}),(0,De.jsx)(me.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:Dt(()=>{e(ln("search"))}),children:(0,De.jsx)(tb,{onCopy:ie})}),(0,De.jsx)(me.Page,{id:"summary",title:n("summaryTitle"),onDismiss:Dt(()=>{e(ln("search"))}),children:(0,De.jsx)(fb,{onCopy:_t})}),(0,De.jsx)(me.Page,{id:"knowledgeAssist",title:n("knowledgeAssist"),onDismiss:Dt(()=>{e(vs()),e(ln("search"))}),children:(0,De.jsx)(wb,{question:i,onUse:vr,onResetQuestion:()=>{e(vs()),s("")}})})]})},Ub=SN;var gl=w(b()),wN=()=>{let e=z("showSearch"),t=z("isEmbedded");return(0,gl.jsxs)(zb.Fragment,{children:[e&&(0,gl.jsx)(Ub,{}),t&&(0,gl.jsx)(EE,{})]})},Bb=wN;var Wb=w(oe());var Yd=w(b()),jb=({className:e})=>(0,Yd.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,Yd.jsx)("g",{children:(0,Yd.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
|
-
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 $h=w(b()),xN={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},Vb=({className:e,color:t})=>(0,$h.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,$h.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:xN[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 qh={};Ye(qh,{enUS:()=>EN,nlNL:()=>bN});var EN={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},bN={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var Wo=w(b()),$b=({onLogIn:e})=>{let t=q(qh),n=z("floatingMenu"),r=z("productName"),o=Q(),i=M(at),s=L("FloatingMenu",Kb);if(i===null||n===!1)return null;let a=()=>{i===!0?o(Lt(!0)):e()};return(0,Wo.jsxs)("button",{className:(0,Wb.default)(s.root,{[s.isLoggedIn]:i,[s.isLoggedOut]:!i}),onClick:a,children:[(0,Wo.jsx)("div",{className:s.text,children:t(i?"search":"signin",{productName:r})}),(0,Wo.jsxs)("div",{className:s.icon,children:[(0,Wo.jsx)(Vb,{className:s.logo,color:"pink"}),i===!1&&(0,Wo.jsx)(jb,{className:s.lock})]})]})};var ef=w(H());var qb=w(H());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 $o(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}function Ln(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:i}=e.input;return i.start!==i.end?!1:i.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(i.end))||r&&new RegExp(r).test(o.substring(0,i.end))?!0:n===!1&&r===!1:!1}var CN={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1},Qd=({ui:e})=>e.overlayCollapsed,Gb=Y({name:"ui",initialState:CN,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:Xd,setOverlayCollapsed:no,setOpenOverlayWhenTyping:Yb,setOverlayCollapsedUserOverwrite:Qb}=Gb.actions,Xb=Gb.reducer;var Zd=w(H());var Ss=w(H());var Zb=w(H());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 qo=w(b()),kN=["search","personal-collection-search","search-autocomplete"];function PN(e,t,n,r={}){var i;let o="";return kN.includes(t)?o=HE(Ih(e,n,{stripAgentPart:!0}),(i=r.searchKeywords)!=null?i:[n]):o=Ih(e,n,r),r.placeholders===!0&&(o=UE(o)),o}var RN=()=>{},AN=({selected:e,suggestion:t})=>{let n=z("inlineSuggestions"),r=M(ss),o=z("enableSuggestionFeedback"),i=M(c=>c.input.text),s=Q(),a=L("TextSuggestion",eC),l=(0,Ss.useRef)(null);(0,Ss.useEffect)(()=>{let c=setTimeout(()=>{s(M1({text:t.text,suggestion:t}))},500);return()=>{clearTimeout(c)}},[t]),Jb(l,"click",()=>{s(an({suggestion:t,text:t.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let u=(0,Ss.useMemo)(()=>PN(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,qo.jsxs)("div",{className:a.root,children:[(0,qo.jsx)(re,{ref:l,as:"button","data-testid":"suggestions-overlay-item",selected:e,onClick:RN,children:(0,qo.jsx)(us,{containerTagName:"div",noWrap:!1,tagName:"span",className:a.formattedText,content:u})}),o&&(0,qo.jsx)("div",{className:a.actions,children:(0,qo.jsx)(Gd,{source:"overlay",context:i,suggestion:t})})]})},tC=AN;var Gh=w(b()),LN=({suggestions:e,selectedIndex:t,reverse:n})=>{let r=(0,Zd.useMemo)(()=>{let o=e.map((i,s)=>(0,Gh.jsx)(tC,{index:s,selected:s===t,suggestion:i},`${i.text}-${i.source}`));return n?o.reverse():o},[e,t,n]);return(0,Gh.jsx)(Zd.Fragment,{children:r})},Jd=LN;var nC={root:"dd-PfvRI",paper:"dd-HYlyY"};var yl=w(b()),IN=({textSuggestions:e,selectedIndex:t})=>{let n=(0,ef.useRef)(null),r=L("InlineSuggestionsOverlay",nC),o=M(Ln),i=Q(),s=M(at),a=M(is),l=M(Qd),u=z("showTextSuggestions");return to(()=>{setTimeout(()=>{i(no({collapse:!0,skipWhenInputFocus:!0}))})}),(0,ef.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||s!==!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)(St,{children:(0,yl.jsx)(Jd,{suggestions:e,selectedIndex:t})})})})},ON=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),rC=Yn(ON)(IN);var vl=w(b()),NN=({children:e})=>{let n=z("locale").replace("-","");return(0,vl.jsx)(hh.Provider,{value:n,children:e})},MN=({store:e,customStyles:t={},children:n})=>(0,vl.jsx)(Yg,{store:e,children:(0,vl.jsx)(NN,{children:(0,vl.jsx)(_s.Provider,{value:t,children:n})})}),Go=MN;var nf=w(oe()),ws=w(H());var oC=w(H());function iC(e,t){let[n,r]=(0,oC.useState)(()=>{if(typeof window=="undefined")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return B.error(i),t}});return[n,i=>{try{let s=i instanceof Function?i(n):i;r(s),typeof window!="undefined"&&window.localStorage.setItem(e,JSON.stringify(s))}catch(s){B.error(s)}}]}var sC=()=>/Mac/i.test(navigator.platform);var lC=w(oe()),ar=w(H());var Yh={};Ye(Yh,{enUS:()=>_N,nlNL:()=>DN});var _N={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"}]}]},DN={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=w(b()),Qh=(e,t,n)=>r=>(0,ro.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),FN=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let i=q(Yh),s=Yt(),a=L("Login",aC),l=z("productName"),u=(0,ar.useCallback)(p=>{p.preventDefault(),r&&r(parseInt(p.target.value,10))},[]),c=(0,ar.useCallback)(p=>{p.preventDefault(),s.send(ls,!0)},[t]),f=(0,ar.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,ar.useCallback)(p=>(0,ro.jsx)("button",{type:"button",className:a.anchorButton,onClick:c,children:p},"prompt"),[c]),{min:m,hour:S,day:y}=(0,ar.useMemo)(()=>({min:Qh(a,60*10,u),hour:Qh(a,60*60,u),day:Qh(a,60*60*12,u)}),[]);return(0,ro.jsxs)("div",{className:(0,lC.default)(e,a.root),children:[i("loginPlease",{login:n?d:f,productName:l}),r&&(0,ro.jsxs)(ar.Fragment,{children:[(0,ro.jsx)("br",{}),i("snooze",{min:m,hour:S,day:y})]})]})},tf=FN;var uC={root:"dd-DoQhb",text:"dd-Jwnev"};var Sl=w(b()),HN=({title:e})=>{let t=L("SearchTrigger",uC),n=Q();return(0,Sl.jsxs)("button",{type:"button",className:t.root,onClick:()=>n(Lt(!0)),children:[(0,Sl.jsx)(fs,{}),(0,Sl.jsx)("span",{className:t.text,children:e})]})},cC=HN;var Xh={};Ye(Xh,{enUS:()=>UN,nlNL:()=>zN});var UN={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"}]},zN={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 be=w(b()),BN=({textSuggestions:e,selectedIndex:t,onLogIn:n})=>{let r=L("SuggestionsOverlay",dC),o=q(Xh),i=M(Ln),s=N1(),a=Q(),l=(0,ws.useRef)(null),u=z("searchTriggerKey"),c=z("productName"),f=M(Qd),d=M(at),m=M(is),[S,y]=(0,ws.useState)(null),p=z("showSearch"),g=z("showTextSuggestions"),h=z("adminUrl"),v=z("isEmbedded"),[x,k]=iC("dd-snooze-until-ms",0),C=f||x>Date.now(),R=e.filter(D=>D.source!=="gpt").length,N=()=>{C&&k(0),a(Qb(!C))},_=D=>{let G=Date.now()+D*1e3;k(G),B.info(`Snooze until: ${new Date(G)}`),a(no({collapse:!0}))};return(0,ws.useEffect)(()=>{R===0&&y(null)},[e,R]),to(()=>{a(no({collapse:!0,skipWhenInputFocus:!0}))}),d===null||m===!1?null:d===!1?(0,be.jsxs)("div",{ref:l,className:(0,nf.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,be.jsxs)("div",{className:r.triggers,children:[(0,be.jsx)("div",{style:{flex:1}}),(0,be.jsx)("div",{className:r.triggersRight,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})})]}),(0,be.jsx)("div",{className:r.toggleButtonWrapper,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),(0,be.jsx)("div",{className:r.collapsible,children:(0,be.jsx)(tf,{loginUrl:h,isEmbedded:v,onLogIn:n,onSnooze:_})})]}):!s||!i?null:(0,be.jsxs)("div",{ref:l,className:(0,nf.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,be.jsxs)("div",{className:r.triggers,children:[(0,be.jsx)("div",{style:{flex:1},children:p&&(0,be.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>y(o(sC()?"searchHintMac":"searchHintWindows",{searchTriggerKey:u.toUpperCase()})),onMouseLeave:()=>y(null),children:(0,be.jsx)(cC,{title:o("search")})})}),(0,be.jsxs)("div",{className:r.triggersRight,onFocus:()=>{},children:[(0,be.jsx)("div",{className:(0,nf.default)(!S&&r.hintsHidden,r.hints),children:S}),(0,be.jsx)(mo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})]})]}),(0,be.jsx)("div",{className:r.toggleButtonWrapper,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),R>0&&g&&(0,be.jsx)("div",{className:r.collapsible,onFocus:()=>{},children:(0,be.jsx)(St,{children:(0,be.jsx)(Jd,{suggestions:e,selectedIndex:t,reverse:!0})})})]})},jN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),fC=Yn(jN)(BN);var vf=w(oe());var dr=w(H());var xs=w(H());function rf(e){return e.contentEditable==="true"}function VN(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),n=i.toString().length,i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length}return{selectionStart:t,selectionEnd:n}}function pC(e){let{selectionStart:t,selectionEnd:n}=rf(e)?VN(e):e;return[t,n]}function mC(e){let[,t]=(0,xs.useState)(),n=(0,xs.useRef)(null);return n.current=pC(e),(0,xs.useEffect)(()=>{let r=()=>{var a;let[o,i]=(a=n.current)!=null?a:[],s=pC(e);(!s||o!==s[0]||i!==s[1])&&(n.current=s,t({}))};return e.addEventListener("keyup",r),e.addEventListener("click",r),e.addEventListener("focus",r),document.addEventListener("selectionchange",r),()=>{e.removeEventListener("keyup",r),e.removeEventListener("click",r),e.removeEventListener("focus",r),document.removeEventListener("selectionchange",r)}},[e]),n.current}function gC(e,t){if(!t)return;let n=e,{value:r}=n,[o,i]=t,s=r.match(iu);if(!s||s.length===0)return;let a=0;s.find(l=>{let u=r.indexOf(l,a);return o>u&&i<u+l.length?(n.selectionStart=u,n.selectionEnd=u+l.length,!0):(a=u+l.length,!1)})}var hC=w(H()),KN=["div","span","mark","strong","b","i","u","em"];function Zh(e,t,n=0){var i;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(i=r.props)==null?void 0:i.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(KN.includes(o)){let s=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,hC.cloneElement)(r,{children:Zh(s,t,n+1)})]}return[...e,...t]}function oo(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=w(oe());var pf=w(H());var Es=w(H());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 of(e){let t=(0,Es.useRef)(null),[n,r]=(0,Es.useState)(!1);return(0,Es.useEffect)(()=>{var c;let o=!1,i=parseFloat((c=window.getComputedStyle(document.body).zoom)!=null?c:"1"),[s,a]=vC((f,d)=>{let m=t.current;if(!m)return;let S=f/i,y=d/i,p=m.getBoundingClientRect(),g=S>p.x&&S<p.x+p.width&&y>p.y&&y<p.y+p.height;g&&!o?(o=!0,r(!0)):!g&&o&&(o=!1,r(!1))},({clientX:f,clientY:d})=>[f,d]),[l,u]=vC(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",s),e.addEventListener("mouseleave",l),()=>{a(),u(),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function SC(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function sf(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function wC(e){return e!=null}var ey=w(oe()),Xt=w(H());var af=w(H()),WN=["bottom","height","left","right","top","width"],$N=(e={},t={})=>WN.some(n=>e[n]!==t[n]),lr=new Map,xC,EC=()=>{let e=[],t=[];lr.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();$N(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{lr.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),xC=window.requestAnimationFrame(EC)};function qN(e,t){return{observe(){let n=lr.size===0;if(lr.has(e)){let r=lr.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else lr.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&EC()},unobserve(){let n=lr.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||lr.delete(e),lr.size||cancelAnimationFrame(xC)}}}}function Jh(e){let[t,n]=(0,af.useState)(null);return(0,af.useLayoutEffect)(()=>{if(!e.current)return;let r=qN(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var bs=w(H()),CC=w(Sc());var bC={root:"dd-r-dgo"};var TC=({children:e,parentNode:t})=>{let[n,r]=(0,bs.useState)(null),o=(0,bs.useContext)(_s);return(0,bs.useLayoutEffect)(()=>{let i=document.createElement("div");return $o(i),i.classList.add(bC.root),o!=null&&o.portalRootNode&&i.classList.add(o==null?void 0:o.portalRootNode),(t||document.body).appendChild(i),r(i),()=>{i.isConnected&&i.remove()}},[]),n?(0,CC.createPortal)(e,n):null};var In={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 lf=w(b()),uf=(e=!1)=>{let[t,n]=(0,Xt.useState)(e),r=(0,Xt.useCallback)(()=>n(!0),[]),o=(0,Xt.useCallback)(()=>n(!1),[]),i=(0,Xt.useCallback)(()=>n(a=>!a),[]),s=(0,Xt.useRef)(null);return{opened:t,open:r,close:o,toggle:i,triggerRef:s}};function ty(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 Cs=u=>{var c=u,{className:e,triggerRef:t,boundaryRef:n=(0,Xt.createRef)(),position:r="above",align:o="center",children:i,toStyle:s=ty,parentNode:a}=c,l=te(c,["className","triggerRef","boundaryRef","position","align","children","toStyle","parentNode"]);let f=Jh(t),d=Jh(n),m=(0,Xt.useMemo)(()=>s(f,d,0),[f,d]);return(0,lf.jsx)(TC,{parentNode:a,children:(0,lf.jsx)("div",I(T({className:(0,ey.default)(In.ref,{[In.positionAbove]:r==="above",[In.positionBelow]:r==="below",[In.positionLeft]:r==="left",[In.positionRight]:r==="right",[In.alignStart]:o==="start",[In.alignCenter]:o==="center",[In.alignEnd]:o==="end"}),style:m},l),{role:"dialog",children:(0,lf.jsx)("div",{className:(0,ey.default)(e,In.root),children:i})}))})};var kC=w(oe()),cf=w(H());var ur={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 ny=w(b()),df=(0,cf.forwardRef)((o,r)=>{var i=o,{className:e,children:t}=i,n=te(i,["className","children"]);let s=(0,cf.useRef)(null),a=L("TabCompletion",ur);return(0,ny.jsx)("div",I(T({ref:sf([s,r]),className:(0,kC.default)(e,a.popoverContentContainer)},n),{children:(0,ny.jsx)("div",{className:a.popoverContent,children:t})}))});var io=w(b()),GN=e=>t=>{let n=ty(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},YN=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let i=L("TabCompletion",ur),s=uf(),a=(0,pf.useMemo)(()=>GN(e.getBoundingClientRect()),[e]),[l,u]=of(e);return(0,pf.useEffect)(()=>{u?s.open():s.close()},[u]),(0,io.jsxs)("span",{children:[(0,io.jsx)("mark",{ref:sf([l,s.triggerRef]),className:(0,PC.default)(i.matchKeyword,{[i.hover]:u}),"aria-haspopup":"dialog","aria-expanded":s.opened?"true":"false",children:r}),s.opened&&(0,io.jsx)(Cs,{className:i.popover,triggerRef:s.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,io.jsx)(df,{style:n,children:(0,io.jsx)("div",{className:i.hintText,children:o})})})]})},ff=class extends er{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(i=>{if(this.usedKeywordMatches.has(i))return null;let s=n.match(i.keywordRegex);if(!s)return null;let a=n.charAt(s.index-1),l=n.charAt(s.index+i.keyword.length);return a==="{"&&l==="}"?null:{index:s.index,length:s[0].length,match:s[0],matchString:s[0],suggestion:i.suggestion,preparedKeywordMatch:i,valid:!0}}).filter(wC);if(r.length===0)return null;let o=r.reduce((i,s)=>s.index<i.index?s:i);return this.usedKeywordMatches.add(o.preparedKeywordMatch),o}replaceWith(n,r){return(0,io.jsx)(YN,{inputElement:r.inputElement,suggestion:r.suggestion,inputStyle:r.inputStyle,boundaryRef:r.boundaryRef,children:n},`keyword_${r.matchString}_${r.key}`)}asTag(){return"mark"}};var RC=w(oe());var ry=w(b()),QN=({inputElement:e,children:t})=>{let n=L("TabCompletion",ur),[r,o]=of(e);return(0,ry.jsx)("mark",{ref:r,className:(0,RC.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},mf=class extends er{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,ry.jsx)(QN,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var hf=w(oe());var ft=w(H());var oy=w(b()),AC=()=>(0,oy.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,oy.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=w(H());var IC=w(xh());var LC={root:"dd-ky-Bv",content:"dd-kV5e1"};function gf(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(i){return null}}function iy(e){return e.replace("https://www.","").replace("https://","")}var Zt=w(b()),XN=3,ZN=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),JN=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=XN})=>{let i=L("LinkSearch",LC),[s,a]=(0,so.useState)(""),l=Q(),u=M(Pb("url")),c=M(tE("URL",ZN)),[f,d]=(0,so.useState)(c.length-1),m=z("fallbackImage"),S=h=>{let v=h.target;a(v.value)},y=(h,v)=>{h.stopPropagation(),h.preventDefault(),window.open(v,"_blank")},p=h=>{var k;let v=f-1<0?c.length-1:f-1,x=f+1===c.length?0:f+1;h.code==="Escape"&&(a(""),t()),h.code==="ArrowUp"&&d(v),h.code==="ArrowDown"&&d(x),h.code==="Enter"&&e(((k=c[f])==null?void 0:k.text)||s)},g=(0,so.useCallback)((0,IC.default)(h=>{l(No({query:h,type:"URL",tags:["link-search"]}))},300),[]);return(0,so.useEffect)(()=>{s&&g(s)},[s]),(0,so.useEffect)(()=>()=>{l(pd())},[]),(0,Zt.jsxs)("div",{className:i.root,children:[(0,Zt.jsx)(St,{withDivider:!0,children:(s?c:u).slice(0,o).map((h,v)=>(0,Zt.jsx)(re,{selected:f===v,onClick:()=>e(h.text),"data-testid":"linksearch-suggestion",children:(0,Zt.jsxs)(ge,{children:[(0,Zt.jsx)(ge.Image,{src:gf(h,"small",m||void 0),title:h.title||h.text}),(0,Zt.jsxs)(ge.Content,{className:i.content,cropText:!0,children:[(0,Zt.jsx)(ge.Title,{children:h.title||iy(h.text)}),h.title&&iy(h.text)]}),(0,Zt.jsx)(re.Actions,{children:(0,Zt.jsx)(re.ActionButton,{label:r,onClick:x=>y(x,h.text)})})]})},h.text))}),(0,Zt.jsx)(Ja,{value:s,onChange:S,autoFocus:!0,placeholder:n,onKeyUp:p})]})},OC=JN;var sy={};Ye(sy,{enUS:()=>eM,nlNL:()=>tM});var eM={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}]},tM={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}]};var dt=w(b()),nM=(0,ft.forwardRef)((e,t)=>{let n=L("TabCompletion",ur);return(0,dt.jsx)("mark",{ref:t,className:(0,hf.default)(n.matchSelection)},"selection-start")}),rM=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let i=q(sy),s=L("TabCompletion",ur),a=(0,ft.useRef)(null),l=(0,ft.useRef)(null),[u,c]=(0,ft.useState)(null),f=Q(),d=uf(document.activeElement===r),[m]=(0,ft.useState)(()=>document.createRange());d.triggerRef.current=m,(0,ft.useEffect)(()=>()=>m.detach(),[]),(0,ft.useEffect)(()=>{let y=e.current,p=a.current;!y||!p||(m.setStart(y,0),m.setEnd(p,0))},[e.current,a.current]),to(()=>{d.close()});let S=(0,ft.useCallback)(y=>{let p=m.toString(),g=/^http(s?):\/\//.test(y)?y:`https://${y}`;f(ad({text:`[${p}](${g})`,replace:"selection"}))},[]);return(0,dt.jsxs)("span",{children:[(0,dt.jsx)("mark",{ref:a,className:(0,hf.default)(s.matchSelection),"aria-haspopup":"dialog","aria-expanded":d.opened?"true":"false",children:o}),d.opened&&(0,dt.jsx)(Cs,{className:s.popoverRoot,triggerRef:d.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,dt.jsxs)(df,{style:n,ref:l,children:[(0,dt.jsx)("div",{className:(0,hf.default)(s.selectionOptions,{[s.selectionOptionsIsHidden]:u!==null}),children:(0,dt.jsxs)("button",{type:"button",tabIndex:u===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>c("insertLink"),children:[(0,dt.jsx)(AC,{}),(0,dt.jsx)("span",{children:"\xA0"}),(0,dt.jsx)("span",{children:i("insertLink")})]})}),u==="insertLink"&&(0,dt.jsx)(OC,{placeholder:i("linkInputPlaceholder"),visitUrlText:i("visitUrl"),onSelectLink:S,onDismiss:()=>{c(null),d.close()}})]})})]},"selection-end")},yf=class extends er{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,ft.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 i=this.foundIndex===0?r:o,s=i>=this.charCount&&i<=this.charCount+n.length?{index:i-this.charCount,length:0,match:"",valid:!0}:null;s&&this.foundIndex++;let a=this.foundIndex===1;return s&&a?this.charCount+=i-this.charCount:this.charCount+=n.length,s?T({isStart:a},s):null}replaceWith(n,r){return r.isStart?(0,dt.jsx)(nM,{ref:this.startRef}):(0,dt.jsx)(rM,{inputElement:r.inputElement,startRef:this.startRef,boundaryRef:r.boundaryRef,inputStyle:r.inputStyle})}asTag(){return"mark"}};var cr=w(b()),oM=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:i,keywordMatches:s,inputElement:a,source:l})=>{let u=L("TabCompletion",yC),c=z("insertLink"),f=z("showMidSentenceSuggestions"),d=z("inlineSuggestions"),m=mC(a),S=(0,dr.useRef)(null),y=M(at);(0,dr.useEffect)(()=>{oo(a)&&m&&gC(a,m)},[m]);let p=(0,dr.useCallback)(v=>{if(!o||!n)return v;let x=[(0,cr.jsx)("span",{className:u.resetIndent,children:"\u200B"},"u200B"),(0,cr.jsx)("span",{"data-testid":"tab-completion",className:(0,vf.default)(u.tabText,u.resetIndent),"data-source":l,children:n},"tabText")];return r&&x.push((0,cr.jsx)("span",{className:(0,vf.default)(u.hint,u.resetIndent),children:(0,cr.jsx)(tu,{keyCode:"tab"},"tabHint")})),Zh(v,x)},[o,n,r]),g=(0,dr.useMemo)(()=>{let v=[];return c&&v.push(new yf("selection")),v.push(new mf("placeholders")),i&&v.push(new ff("keywords")),v},[d,c,i]),h=(0,dr.useMemo)(()=>{let v=window.getComputedStyle(a);return{"--dd-color":v.color,"--dd-font-size":v.fontSize,"--dd-font-family":v.fontFamily,"--dd-font-variant":v.fontVariant}},[]);return!e||!y?null:(0,cr.jsxs)("div",{ref:v=>{v!=null&&v.parentElement&&(S.current=v==null?void 0:v.parentElement)},className:u.root,style:h,children:[(0,cr.jsx)(us,{tagName:"span",containerTagName:"div",className:(0,vf.default)(u.container,u.agentText),disableLineBreaks:oo(a),content:t||"\u200B",onAfterParse:p,matchers:g,selection:m,keywordMatches:s,inputElement:a,inputStyle:h,boundaryRef:S,inlineSuggestionsOnlyAtEnd:!f}),(0,cr.jsx)("br",{})]})},iM=e=>{var p,g,h;let{input:t,ui:n,settings:r,styleSuggestions:o,conversation:i}=e,s=as({input:t}),a=(s==null?void 0:s.text)||"",l=(s==null?void 0:s.source)||"",u=(p=t.html)!=null?p:cs(t.text),c=a.indexOf(t.text)===0?a.slice(t.text.length):"",{showTabHint:f}=n,{isSupported:d}=i,{showTabCompletion:m,visible:S,showStyleSuggestions:y}=r;return{showTabHint:f,showStyleSuggestions:y,showTabCompletion:m&&Ln(e),content:u,tabText:c,source:l,keywordMatches:(h=(g=o.list)==null?void 0:g.keywordMatches)!=null?h:[],enabled:S&&d!==!1}},NC=Yn(iM)(oM);var ek=w(oe()),Il=w(H());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)},fr=K("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)})),ay=K("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(fr(e.platformSessionId))})),ly=K("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(fr(e.platformSessionId))})),sM=Y({name:"autoflows",initialState:MC,reducers:{},extraReducers:e=>{e.addCase(ay.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Started",r.isBusy=!0}),e.addCase(ly.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Aborted",r.isBusy=!0}),e.addCase(fr.pending,t=>{t.fetchState="loading"}),e.addCase(fr.rejected,t=>{t.fetchState="error"}),e.addCase(fr.fulfilled,(t,n)=>{t.list=n.payload,t.fetchState="done"}),e.addCase(ce,()=>MC)}}),FC=K("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(fr(e))}),o.on("sessionCompleted",()=>{n(fr(e))})}),HC=K("autoflows/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),UC=sM.reducer;var zC={list:[],fetchState:"idle",sentSuggestions:[],errorSuggestions:[],answeredSuggestions:[]},BC=e=>e.customMessages.list,jC=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),wl=K("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)})),Sf=K("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=K("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=Y({name:"customMessages",initialState:zC,reducers:{onCustomMessage(e,t){Array.isArray(t.payload)?e.list=t.payload:e.list=[t.payload]}},extraReducers:e=>{e.addCase(wl.pending,t=>{t.fetchState="loading"}).addCase(wl.rejected,t=>{t.fetchState="error"}).addCase(wl.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload||[]}).addCase(Sf.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.errorSuggestions=t.errorSuggestions.filter(r=>n.meta.arg.suggestion.text!==r)}).addCase(Sf.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(ce,()=>zC)}}),$C=K("customMessages/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");r.openStream(e).on("customMessageSuggestion",i=>{n(WC.actions.onCustomMessage(i))})}),qC=K("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 aM={token:null,interval:null},uy=K("passwordlessToken/getTemporaryPasswordlessToken",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n}=t.extra;return{token:yield n.requestPasswordlessToken()}})),cy=K("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(uy()),setInterval(()=>r(uy()),n)}),YC=Y({name:"passwordlessToken",initialState:aM,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(uy.fulfilled,(t,n)=>{t.token=n.payload.token}),e.addCase(cy.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:QC}=YC.actions,XC=YC.reducer;var dy={outputs:[],fetchState:"idle"},ZC=e=>{var t;return(t=e.assistants)==null?void 0:t.outputs},lM=Ce("assistants/resetOutputs"),Yo=K("assistants/evaluate",(e,t)=>P(void 0,null,function*(){var n,r;try{let{deepdeskAPI:o}=t.extra,i=t.getState(),{platformVariables:s}=i.info,a=(n=i.conversation.current)==null?void 0:n.sessionId;if(!a)throw new Error("No current conversation to evaluate assistants");let l=yield o.evaluateAssistant(e.assistantCode,T({tags:((r=i.conversation.current)==null?void 0:r.tags)||void 0},e.payload),{conversationId:a});return s&&(l=l.map(u=>I(T({},u),{name:ut(u.name,s),response:ut(u.response,s)}))),l}catch(o){let i=o.message;return B.warn(i),t.rejectWithValue(i)}})),JC=Y({name:"assistants",initialState:dy,reducers:{removeOutputByCode(e,t){e.outputs=e.outputs.filter(n=>n.code!==t.payload.code)}},extraReducers:e=>{e.addCase(Yo.pending,t=>{t.fetchState="loading"}).addCase(Yo.rejected,t=>{t.fetchState="error"}).addCase(Yo.fulfilled,(t,n)=>{let r=n.payload.map(i=>i.name),o=t.outputs.filter(i=>!r.includes(i.name));t.fetchState="done",t.outputs=[...n.payload,...o]}).addCase(ce,()=>dy).addCase(lM.toString(),()=>dy)}}),{removeOutputByCode:eT}=JC.actions,tT=JC.reducer;var nT={shouldEmit:!0},fy={cues:[],fetchState:"idle"},rT=e=>{var t;return(t=e.rules)==null?void 0:t.cues},uM=Ce("rules/resetCues"),Qo=K("rules/evaluate",(e,t)=>P(void 0,null,function*(){var n,r;try{let{deepdeskAPI:o}=t.extra,i=t.getState(),{platformVariables:s}=i.info,a=(n=i.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=i.conversation.current)==null?void 0:r.tags)||void 0},e.params));return s&&(f=f.map(d=>I(T({},d),{title:ut(d.title,s),text:ut(d.text,s)}))),{cues:f,options:e.options}}catch(o){let i=o.message;return B.warn(i),t.rejectWithValue(i)}})),oT=Y({name:"answer",initialState:fy,reducers:{removeCue(e,t){e.cues=e.cues.filter(n=>n.rule.id!==t.payload.id)}},extraReducers:e=>{e.addCase(Qo.pending,t=>{t.fetchState="loading"}).addCase(Qo.rejected,t=>{t.fetchState="error"}).addCase(Qo.fulfilled,(t,n)=>{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(ce,()=>fy).addCase(uM.toString(),()=>fy)}}),{removeCue:iT}=oT.actions,sT=oT.reducer;function cM(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}var aT=e=>{let t=rT(e),r=ZC(e).map(o=>({text:o.response,title:o.name,rule:{id:cM(o.code),label:o.code,name:o.name,description:o.name}}));return[...t,...r]};var hT=w(H());var pT=w(oe()),mT=w(H());var uT=w(oe());var lT={root:"dd-uszkm"};var dT=w(b()),dM=({className:e,children:t})=>{let n=L("Unicode",lT);return(0,dT.jsx)("span",{className:(0,uT.default)(e,n.root),children:t})},cT=dM;var fT={isDisabled:"dd-Sp--t",root:"dd-maqTG",buttonStop:"dd-rcq8w",stateBadge:"dd-zOnkT",isCompleted:"dd-GA-rt",isStarted:"dd-PZwtX",isAborted:"dd-PAXSE"};var py={};Ye(py,{enUS:()=>fM,nlNL:()=>pM});var fM={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"}]},pM={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 Mt=w(b()),gM=({disabled:e,state:t,displayName:n,description:r,onStartAutoflow:o,onStopAutoflow:i})=>{let s=L("Autoflow",fT),a=q(py),l=t==="Started"?"stop":"start",u=l==="start"?"\u25B6":l==="stop"?"\u25FC":"";return(0,Mt.jsxs)(re,{className:(0,pT.default)(s.root,{[s.isDisabled]:e,[s.isCompleted]:t==="Completed",[s.isAborted]:t==="Aborted",[s.isStarted]:t==="Started"}),children:[(0,Mt.jsx)(ge,{children:(0,Mt.jsxs)(ge.Content,{children:[(0,Mt.jsxs)(ge.Title,{children:[t&&(0,Mt.jsx)("span",{className:s.stateBadge,children:a(t)}),n]}),(0,Mt.jsx)("span",{children:r})]})}),(0,Mt.jsx)(re.Actions,{fixed:t==="Started",children:(0,Mt.jsx)(re.ActionButton,{primary:!0,className:l==="start"?s.buttonStart:s.buttonStop,onClick:t==="Started"?i:o,disabled:e,label:(0,Mt.jsxs)(mT.Fragment,{children:[(0,Mt.jsx)(cT,{children:u})," ",(0,Mt.jsx)("span",{children:a(l)})]})})})]})},gT=gM;var my=w(b()),hM=(e,t)=>{let n=t.filter(r=>r.state==="Started");return n.length>0?n.indexOf(e)===-1:!1},yM=({autoflows:e,onStartAutoflow:t,onStopAutoflow:n,platformSessionId:r})=>(0,my.jsx)(hT.Fragment,{children:e.map(o=>(0,my.jsx)(gT,{displayName:o.displayName,description:o.description,disabled:o.isBusy||hM(o,e),state:o.state,onStartAutoflow:()=>t({platformSessionId:r,triggerPayload:o.triggerPayload}),onStopAutoflow:()=>n({platformSessionId:r,triggerPayload:o.triggerPayload})},o.displayName))}),vM=({autoflows:e,conversation:t})=>{var n;return{autoflows:e.list,platformSessionId:(n=t.current)==null?void 0:n.sessionId}},SM={onStartAutoflow:ay,onStopAutoflow:ly},yT=Yn(vM,SM)(yM);var vT=w(oe()),gy=w(H());var pr={root:"dd-ERsBr",title:"dd-b36p6",isUsed:"dd-fp2IX",quickReplies:"dd--VrvP",quickReply:"dd-wFhWh",label:"dd-R9sND",errorIcon:"dd-8cdcH"};var Ct=w(b()),wM=({suggestion:e})=>{let t=q(Ko),n=Q(),r=M(jC(e.text)),o=M(VC(e.text)),i=M(KC(e.text)),s=M(os),{replyOptions:a}=e,l=(0,gy.useCallback)(c=>{c.preventDefault(),c.stopPropagation(),!(r||!s)&&n(Sf({platformSessionId:s,suggestion:e}))},[e,r,n,s]),u=(0,gy.useCallback)(c=>{if(c.preventDefault(),c.stopPropagation(),!s||!a)return;let f=parseInt(c.target.dataset.index,10),d=a[f];n(wf({platformSessionId:s,reply:d,suggestion:e}))},[e,r,n,s]);return(0,Ct.jsxs)(re,{onClick:l,className:(0,vT.default)(pr.root,{[pr.isUsed]:r,[pr.hasError]:i}),children:[(0,Ct.jsx)(ge,{children:(0,Ct.jsxs)(ge.Content,{children:[(0,Ct.jsxs)(ge.Title,{className:pr.title,children:[e.text," ",(0,Ct.jsx)(nu,{className:pr.label,children:"analyse tool"})," ",i&&(0,Ct.jsx)("span",{className:pr.errorIcon,role:"img","aria-label":t("sendingError"),title:t("sendingError"),children:"!"})]}),a&&a.length>0&&(0,Ct.jsx)("ul",{className:pr.quickReplies,children:a.map(c=>(0,Ct.jsx)("li",{className:pr.quickReply,children:c.title},c.title))})]})}),(0,Ct.jsxs)(re.Actions,{fixed:i||r,children:[a&&a.length>0&&(0,Ct.jsx)(re.DropdownButton,{label:t("answer"),disabled:o,children:a.map((c,f)=>(0,Ct.jsx)(re.DropdownItem,{index:f,label:c.title,onClick:u},c.title))}),(0,Ct.jsx)(re.ActionButton,{primary:!0,disabled:r,onClick:l,label:t(r?"suggestionSent":i?"tryAgain":"sendSuggestion")})]})]})},ST=wM;var xf=w(H());var yy=w(oe());var hy=w(b()),xl=()=>(0,hy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,hy.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 wT={root:"dd-WcEru",entity:"dd-LfP8y",entityText:"dd-L-v0f",iconWrapper:"dd-9Deh1",icon:"dd-tM7E2",iconClicked:"dd-EEdDL"};var On=w(b()),xM=({entities:e})=>{let t=L("EntitiesWidgetList",wT),[n,r]=(0,xf.useState)(void 0),o=Q(),i=()=>{r(void 0)},s=a=>{e&&(r(e.indexOf(a)),Zn(a.text),o(lt({name:"entity copied",data:{entity:a,type:"copy"}})))};return(0,xf.useEffect)(()=>{let a=setTimeout(i,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,On.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,On.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>s(a),children:[(0,On.jsx)("span",{className:t.entityText,children:a.text}),(0,On.jsxs)("span",{className:t.iconWrapper,children:[(0,On.jsx)("span",{className:(0,yy.default)(t.icon),children:(0,On.jsx)(xl,{})}),(0,On.jsx)("span",{className:(0,yy.default)(t.icon,n===l&&t.iconClicked),children:(0,On.jsx)(xl,{})})]})]},a.text))})},xT=xM;var vy=w(b()),ET=()=>(0,vy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,vy.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 Sy=w(b()),bT=()=>(0,Sy.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,Sy.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=w(b()),CT=()=>(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 KT=w(H());var{entries:MT,setPrototypeOf:TT,isFrozen:EM,getPrototypeOf:bM,getOwnPropertyDescriptor:CM}=Object,{freeze:mt,seal:Jt,create:_T}=Object,{apply:ky,construct:Py}=typeof Reflect!="undefined"&&Reflect;mt||(mt=function(t){return t});Jt||(Jt=function(t){return t});ky||(ky=function(t,n,r){return t.apply(n,r)});Py||(Py=function(t,n){return new t(...n)});var Ef=Tt(Array.prototype.forEach),kT=Tt(Array.prototype.pop),El=Tt(Array.prototype.push),Tf=Tt(String.prototype.toLowerCase),xy=Tt(String.prototype.toString),PT=Tt(String.prototype.match),bl=Tt(String.prototype.replace),TM=Tt(String.prototype.indexOf),kM=Tt(String.prototype.trim),hn=Tt(Object.prototype.hasOwnProperty),pt=Tt(RegExp.prototype.test),Cl=PM(TypeError),RT=Tt(Number.isNaN);function Tt(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 ky(e,t,r)}}function PM(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Py(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tf;TT&&TT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let i=n(o);i!==o&&(EM(t)||(t[r]=i),o=i)}e[o]=!0}return e}function RM(e){for(let t=0;t<e.length;t++)hn(e,t)||(e[t]=null);return e}function Zo(e){let t=_T(null);for(let[n,r]of MT(e))hn(e,n)&&(Array.isArray(r)?t[n]=RM(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Zo(r):t[n]=r);return t}function bf(e,t){for(;e!==null;){let r=CM(e,t);if(r){if(r.get)return Tt(r.get);if(typeof r.value=="function")return Tt(r.value)}e=bM(e)}function n(){return null}return n}var AT=mt(["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"]),Ey=mt(["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"]),by=mt(["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"]),AM=mt(["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"]),Cy=mt(["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"]),LM=mt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),LT=mt(["#text"]),IT=mt(["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"]),Ty=mt(["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"]),OT=mt(["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"]),Cf=mt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IM=Jt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),OM=Jt(/<%[\w\W]*|[\w\W]*%>/gm),NM=Jt(/\${[\w\W]*}/gm),MM=Jt(/^data-[\-\w.\u00B7-\uFFFF]/),_M=Jt(/^aria-[\-\w]+$/),DT=Jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),DM=Jt(/^(?:\w+script|data):/i),FM=Jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FT=Jt(/^html$/i),HM=Jt(/^[a-z][.\w]*(-[.\w]+)+$/i),NT=Object.freeze({__proto__:null,MUSTACHE_EXPR:IM,ERB_EXPR:OM,TMPLIT_EXPR:NM,DATA_ATTR:MM,ARIA_ATTR:_M,IS_ALLOWED_URI:DT,IS_SCRIPT_OR_DATA:DM,ATTR_WHITESPACE:FM,DOCTYPE_NAME:FT,CUSTOM_ELEMENT:HM}),Xo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},UM=function(){return typeof window=="undefined"?null:window},zM=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 i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch(s){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function HT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UM(),t=j=>HT(j);if(t.version="3.1.3",t.removed=[],!e||!e.document||e.document.nodeType!==Xo.document)return t.isSupported=!1,t;let{document:n}=e,r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:m}=e,S=l.prototype,y=bf(S,"cloneNode"),p=bf(S,"nextSibling"),g=bf(S,"childNodes"),h=bf(S,"parentNode");if(typeof s=="function"){let j=n.createElement("template");j.content&&j.content.ownerDocument&&(n=j.content.ownerDocument)}let v,x="",{implementation:k,createNodeIterator:C,createDocumentFragment:R,getElementsByTagName:N}=n,{importNode:_}=r,D={};t.isSupported=typeof MT=="function"&&typeof h=="function"&&k&&k.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:G,ERB_EXPR:Z,TMPLIT_EXPR:ie,DATA_ATTR:vr,ARIA_ATTR:_t,IS_SCRIPT_OR_DATA:Sr,ATTR_WHITESPACE:Dt,CUSTOM_ELEMENT:V}=NT,{IS_ALLOWED_URI:Te}=NT,ve=null,wr=J({},[...AT,...Ey,...by,...Cy,...LT]),Se=null,ke=J({},[...IT,...Ty,...OT,...Cf]),we=Object.seal(_T(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}})),ri=null,uo=null,oi=!0,ii=!0,Ul=!1,co=!0,Sn=!1,zl=!0,He=!1,Dn=!1,Ff=!1,si=!1,Bl=!1,jl=!1,jy=!0,Vy=!1,Wk="user-content-",Hf=!0,Ls=!1,ai={},li=null,Ky=J({},["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"]),Wy=null,$y=J({},["audio","video","img","source","image","track"]),Uf=null,qy=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vl="http://www.w3.org/1998/Math/MathML",Kl="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",ui=Fn,zf=!1,Bf=null,$k=J({},[Vl,Kl,Fn],xy),Is=null,qk=["application/xhtml+xml","text/html"],Gk="text/html",Ue=null,ci=null,Gy=255,Yk=n.createElement("form"),Yy=function(E){return E instanceof RegExp||E instanceof Function},jf=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ci&&ci===E)){if((!E||typeof E!="object")&&(E={}),E=Zo(E),Is=qk.indexOf(E.PARSER_MEDIA_TYPE)===-1?Gk:E.PARSER_MEDIA_TYPE,Ue=Is==="application/xhtml+xml"?xy:Tf,ve=hn(E,"ALLOWED_TAGS")?J({},E.ALLOWED_TAGS,Ue):wr,Se=hn(E,"ALLOWED_ATTR")?J({},E.ALLOWED_ATTR,Ue):ke,Bf=hn(E,"ALLOWED_NAMESPACES")?J({},E.ALLOWED_NAMESPACES,xy):$k,Uf=hn(E,"ADD_URI_SAFE_ATTR")?J(Zo(qy),E.ADD_URI_SAFE_ATTR,Ue):qy,Wy=hn(E,"ADD_DATA_URI_TAGS")?J(Zo($y),E.ADD_DATA_URI_TAGS,Ue):$y,li=hn(E,"FORBID_CONTENTS")?J({},E.FORBID_CONTENTS,Ue):Ky,ri=hn(E,"FORBID_TAGS")?J({},E.FORBID_TAGS,Ue):{},uo=hn(E,"FORBID_ATTR")?J({},E.FORBID_ATTR,Ue):{},ai=hn(E,"USE_PROFILES")?E.USE_PROFILES:!1,oi=E.ALLOW_ARIA_ATTR!==!1,ii=E.ALLOW_DATA_ATTR!==!1,Ul=E.ALLOW_UNKNOWN_PROTOCOLS||!1,co=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Sn=E.SAFE_FOR_TEMPLATES||!1,zl=E.SAFE_FOR_XML!==!1,He=E.WHOLE_DOCUMENT||!1,si=E.RETURN_DOM||!1,Bl=E.RETURN_DOM_FRAGMENT||!1,jl=E.RETURN_TRUSTED_TYPE||!1,Ff=E.FORCE_BODY||!1,jy=E.SANITIZE_DOM!==!1,Vy=E.SANITIZE_NAMED_PROPS||!1,Hf=E.KEEP_CONTENT!==!1,Ls=E.IN_PLACE||!1,Te=E.ALLOWED_URI_REGEXP||DT,ui=E.NAMESPACE||Fn,we=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&Yy(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&Yy(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Sn&&(ii=!1),Bl&&(si=!0),ai&&(ve=J({},LT),Se=[],ai.html===!0&&(J(ve,AT),J(Se,IT)),ai.svg===!0&&(J(ve,Ey),J(Se,Ty),J(Se,Cf)),ai.svgFilters===!0&&(J(ve,by),J(Se,Ty),J(Se,Cf)),ai.mathMl===!0&&(J(ve,Cy),J(Se,OT),J(Se,Cf))),E.ADD_TAGS&&(ve===wr&&(ve=Zo(ve)),J(ve,E.ADD_TAGS,Ue)),E.ADD_ATTR&&(Se===ke&&(Se=Zo(Se)),J(Se,E.ADD_ATTR,Ue)),E.ADD_URI_SAFE_ATTR&&J(Uf,E.ADD_URI_SAFE_ATTR,Ue),E.FORBID_CONTENTS&&(li===Ky&&(li=Zo(li)),J(li,E.FORBID_CONTENTS,Ue)),Hf&&(ve["#text"]=!0),He&&J(ve,["html","head","body"]),ve.table&&(J(ve,["tbody"]),delete ri.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.');v=E.TRUSTED_TYPES_POLICY,x=v.createHTML("")}else v===void 0&&(v=zM(m,o)),v!==null&&typeof x=="string"&&(x=v.createHTML(""));mt&&mt(E),ci=E}},Qy=J({},["mi","mo","mn","ms","mtext"]),Xy=J({},["foreignobject","annotation-xml"]),Qk=J({},["title","style","font","a","script"]),Zy=J({},[...Ey,...by,...AM]),Jy=J({},[...Cy,...LM]),Xk=function(E){let A=h(E);(!A||!A.tagName)&&(A={namespaceURI:ui,tagName:"template"});let U=Tf(E.tagName),X=Tf(A.tagName);return Bf[E.namespaceURI]?E.namespaceURI===Kl?A.namespaceURI===Fn?U==="svg":A.namespaceURI===Vl?U==="svg"&&(X==="annotation-xml"||Qy[X]):!!Zy[U]:E.namespaceURI===Vl?A.namespaceURI===Fn?U==="math":A.namespaceURI===Kl?U==="math"&&Xy[X]:!!Jy[U]:E.namespaceURI===Fn?A.namespaceURI===Kl&&!Xy[X]||A.namespaceURI===Vl&&!Qy[X]?!1:!Jy[U]&&(Qk[U]||!Zy[U]):!!(Is==="application/xhtml+xml"&&Bf[E.namespaceURI]):!1},Ft=function(E){El(t.removed,{element:E});try{E.parentNode.removeChild(E)}catch(A){E.remove()}},Wl=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"&&!Se[E])if(si||Bl)try{Ft(A)}catch(U){}else try{A.setAttribute(E,"")}catch(U){}},ev=function(E){let A=null,U=null;if(Ff)E="<remove></remove>"+E;else{let Ve=PT(E,/^[\r\n\t ]+/);U=Ve&&Ve[0]}Is==="application/xhtml+xml"&&ui===Fn&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let X=v?v.createHTML(E):E;if(ui===Fn)try{A=new d().parseFromString(X,Is)}catch(Ve){}if(!A||!A.documentElement){A=k.createDocument(ui,"template",null);try{A.documentElement.innerHTML=zf?x:X}catch(Ve){}}let Ge=A.body||A.documentElement;return E&&U&&Ge.insertBefore(n.createTextNode(U),Ge.childNodes[0]||null),ui===Fn?N.call(A,He?"html":"body")[0]:He?A.documentElement:Ge},tv=function(E){return C.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},nv=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")},rv=function(E){return typeof a=="function"&&E instanceof a},Hn=function(E,A,U){D[E]&&Ef(D[E],X=>{X.call(t,A,U,ci)})},ov=function(E){let A=null;if(Hn("beforeSanitizeElements",E,null),nv(E))return Ft(E),!0;let U=Ue(E.nodeName);if(Hn("uponSanitizeElement",E,{tagName:U,allowedTags:ve}),E.hasChildNodes()&&!rv(E.firstElementChild)&&pt(/<[/\w]/g,E.innerHTML)&&pt(/<[/\w]/g,E.textContent)||E.nodeType===Xo.progressingInstruction||zl&&E.nodeType===Xo.comment&&pt(/<[/\w]/g,E.data))return Ft(E),!0;if(!ve[U]||ri[U]){if(!ri[U]&&sv(U)&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,U)||we.tagNameCheck instanceof Function&&we.tagNameCheck(U)))return!1;if(Hf&&!li[U]){let X=h(E)||E.parentNode,Ge=g(E)||E.childNodes;if(Ge&&X){let Ve=Ge.length;for(let gt=Ve-1;gt>=0;--gt){let ht=y(Ge[gt],!0);ht.__removalCount=(E.__removalCount||0)+1,X.insertBefore(ht,p(E))}}}return Ft(E),!0}return E instanceof l&&!Xk(E)||(U==="noscript"||U==="noembed"||U==="noframes")&&pt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Ft(E),!0):(Sn&&E.nodeType===Xo.text&&(A=E.textContent,Ef([G,Z,ie],X=>{A=bl(A,X," ")}),E.textContent!==A&&(El(t.removed,{element:E.cloneNode()}),E.textContent=A)),Hn("afterSanitizeElements",E,null),!1)},iv=function(E,A,U){if(jy&&(A==="id"||A==="name")&&(U in n||U in Yk||U==="__depth"||U==="__removalCount"))return!1;if(!(ii&&!uo[A]&&pt(vr,A))){if(!(oi&&pt(_t,A))){if(!Se[A]||uo[A]){if(!(sv(E)&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,E)||we.tagNameCheck instanceof Function&&we.tagNameCheck(E))&&(we.attributeNameCheck instanceof RegExp&&pt(we.attributeNameCheck,A)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(A))||A==="is"&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,U)||we.tagNameCheck instanceof Function&&we.tagNameCheck(U))))return!1}else if(!Uf[A]){if(!pt(Te,bl(U,Dt,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&E!=="script"&&TM(U,"data:")===0&&Wy[E])){if(!(Ul&&!pt(Sr,bl(U,Dt,"")))){if(U)return!1}}}}}}return!0},sv=function(E){return E!=="annotation-xml"&&PT(E,V)},av=function(E){Hn("beforeSanitizeAttributes",E,null);let{attributes:A}=E;if(!A)return;let U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se},X=A.length;for(;X--;){let Ge=A[X],{name:Ve,namespaceURI:gt,value:ht}=Ge,Os=Ue(Ve),ot=Ve==="value"?ht:kM(ht);if(U.attrName=Os,U.attrValue=ot,U.keepAttr=!0,U.forceKeepAttr=void 0,Hn("uponSanitizeAttribute",E,U),ot=U.attrValue,U.forceKeepAttr||(Wl(Ve,E),!U.keepAttr))continue;if(!co&&pt(/\/>/i,ot)){Wl(Ve,E);continue}if(zl&&pt(/((--!?|])>)|<\/(style|title)/i,ot)){Wl(Ve,E);continue}Sn&&Ef([G,Z,ie],uv=>{ot=bl(ot,uv," ")});let lv=Ue(E.nodeName);if(iv(lv,Os,ot)){if(Vy&&(Os==="id"||Os==="name")&&(Wl(Ve,E),ot=Wk+ot),v&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!gt)switch(m.getAttributeType(lv,Os)){case"TrustedHTML":{ot=v.createHTML(ot);break}case"TrustedScriptURL":{ot=v.createScriptURL(ot);break}}try{gt?E.setAttributeNS(gt,Ve,ot):E.setAttribute(Ve,ot),nv(E)?Ft(E):kT(t.removed)}catch(uv){}}}Hn("afterSanitizeAttributes",E,null)},Zk=function j(E){let A=null,U=tv(E);for(Hn("beforeSanitizeShadowDOM",E,null);A=U.nextNode();){if(Hn("uponSanitizeShadowNode",A,null),ov(A))continue;let X=h(A);A.nodeType===Xo.element&&(X&&X.__depth?A.__depth=(A.__removalCount||0)+X.__depth+1:A.__depth=1),(A.__depth>=Gy||A.__depth<0||RT(A.__depth))&&Ft(A),A.content instanceof i&&(A.content.__depth=A.__depth,j(A.content)),av(A)}Hn("afterSanitizeShadowDOM",E,null)};return t.sanitize=function(j){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,U=null,X=null,Ge=null;if(zf=!j,zf&&(j="<!-->"),typeof j!="string"&&!rv(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(Dn||jf(E),t.removed=[],typeof j=="string"&&(Ls=!1),Ls){if(j.nodeName){let ht=Ue(j.nodeName);if(!ve[ht]||ri[ht])throw Cl("root node is forbidden and cannot be sanitized in-place")}}else if(j instanceof a)A=ev("<!---->"),U=A.ownerDocument.importNode(j,!0),U.nodeType===Xo.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?A=U:A.appendChild(U);else{if(!si&&!Sn&&!He&&j.indexOf("<")===-1)return v&&jl?v.createHTML(j):j;if(A=ev(j),!A)return si?null:jl?x:""}A&&Ff&&Ft(A.firstChild);let Ve=tv(Ls?j:A);for(;X=Ve.nextNode();){if(ov(X))continue;let ht=h(X);X.nodeType===Xo.element&&(ht&&ht.__depth?X.__depth=(X.__removalCount||0)+ht.__depth+1:X.__depth=1),(X.__depth>=Gy||X.__depth<0||RT(X.__depth))&&Ft(X),X.content instanceof i&&(X.content.__depth=X.__depth,Zk(X.content)),av(X)}if(Ls)return j;if(si){if(Bl)for(Ge=R.call(A.ownerDocument);A.firstChild;)Ge.appendChild(A.firstChild);else Ge=A;return(Se.shadowroot||Se.shadowrootmode)&&(Ge=_.call(r,Ge,!0)),Ge}let gt=He?A.outerHTML:A.innerHTML;return He&&ve["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&pt(FT,A.ownerDocument.doctype.name)&&(gt="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
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 $h=w(b()),xN={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},Vb=({className:e,color:t})=>(0,$h.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,$h.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:xN[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 qh={};Ye(qh,{enUS:()=>EN,nlNL:()=>bN});var EN={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},bN={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var Wo=w(b()),$b=({onLogIn:e})=>{let t=q(qh),n=z("floatingMenu"),r=z("productName"),o=Q(),i=M(at),s=L("FloatingMenu",Kb);if(i===null||n===!1)return null;let a=()=>{i===!0?o(Lt(!0)):e()};return(0,Wo.jsxs)("button",{className:(0,Wb.default)(s.root,{[s.isLoggedIn]:i,[s.isLoggedOut]:!i}),onClick:a,children:[(0,Wo.jsx)("div",{className:s.text,children:t(i?"search":"signin",{productName:r})}),(0,Wo.jsxs)("div",{className:s.icon,children:[(0,Wo.jsx)(Vb,{className:s.logo,color:"pink"}),i===!1&&(0,Wo.jsx)(jb,{className:s.lock})]})]})};var ef=w(H());var qb=w(H());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 $o(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}function Ln(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:i}=e.input;return i.start!==i.end?!1:i.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(i.end))||r&&new RegExp(r).test(o.substring(0,i.end))?!0:n===!1&&r===!1:!1}var CN={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1},Qd=({ui:e})=>e.overlayCollapsed,Gb=Y({name:"ui",initialState:CN,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:Xd,setOverlayCollapsed:no,setOpenOverlayWhenTyping:Yb,setOverlayCollapsedUserOverwrite:Qb}=Gb.actions,Xb=Gb.reducer;var Zd=w(H());var Ss=w(H());var Zb=w(H());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 qo=w(b()),kN=["search","personal-collection-search","search-autocomplete"];function PN(e,t,n,r={}){var i;let o="";return kN.includes(t)?o=HE(Ih(e,n,{stripAgentPart:!0}),(i=r.searchKeywords)!=null?i:[n]):o=Ih(e,n,r),r.placeholders===!0&&(o=UE(o)),o}var RN=()=>{},AN=({selected:e,suggestion:t})=>{let n=z("inlineSuggestions"),r=M(ss),o=z("enableSuggestionFeedback"),i=M(c=>c.input.text),s=Q(),a=L("TextSuggestion",eC),l=(0,Ss.useRef)(null);(0,Ss.useEffect)(()=>{let c=setTimeout(()=>{s(M1({text:t.text,suggestion:t}))},500);return()=>{clearTimeout(c)}},[t]),Jb(l,"click",()=>{s(an({suggestion:t,text:t.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let u=(0,Ss.useMemo)(()=>PN(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,qo.jsxs)("div",{className:a.root,children:[(0,qo.jsx)(re,{ref:l,as:"button","data-testid":"suggestions-overlay-item",selected:e,onClick:RN,children:(0,qo.jsx)(us,{containerTagName:"div",noWrap:!1,tagName:"span",className:a.formattedText,content:u})}),o&&(0,qo.jsx)("div",{className:a.actions,children:(0,qo.jsx)(Gd,{source:"overlay",context:i,suggestion:t})})]})},tC=AN;var Gh=w(b()),LN=({suggestions:e,selectedIndex:t,reverse:n})=>{let r=(0,Zd.useMemo)(()=>{let o=e.map((i,s)=>(0,Gh.jsx)(tC,{index:s,selected:s===t,suggestion:i},`${i.text}-${i.source}`));return n?o.reverse():o},[e,t,n]);return(0,Gh.jsx)(Zd.Fragment,{children:r})},Jd=LN;var nC={root:"dd-PfvRI",paper:"dd-HYlyY"};var yl=w(b()),IN=({textSuggestions:e,selectedIndex:t})=>{let n=(0,ef.useRef)(null),r=L("InlineSuggestionsOverlay",nC),o=M(Ln),i=Q(),s=M(at),a=M(is),l=M(Qd),u=z("showTextSuggestions");return to(()=>{setTimeout(()=>{i(no({collapse:!0,skipWhenInputFocus:!0}))})}),(0,ef.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||s!==!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)(St,{children:(0,yl.jsx)(Jd,{suggestions:e,selectedIndex:t})})})})},ON=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),rC=Yn(ON)(IN);var vl=w(b()),NN=({children:e})=>{let n=z("locale").replace("-","");return(0,vl.jsx)(hh.Provider,{value:n,children:e})},MN=({store:e,customStyles:t={},children:n})=>(0,vl.jsx)(Yg,{store:e,children:(0,vl.jsx)(NN,{children:(0,vl.jsx)(_s.Provider,{value:t,children:n})})}),Go=MN;var nf=w(oe()),ws=w(H());var oC=w(H());function iC(e,t){let[n,r]=(0,oC.useState)(()=>{if(typeof window=="undefined")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return B.error(i),t}});return[n,i=>{try{let s=i instanceof Function?i(n):i;r(s),typeof window!="undefined"&&window.localStorage.setItem(e,JSON.stringify(s))}catch(s){B.error(s)}}]}var sC=()=>/Mac/i.test(navigator.platform);var lC=w(oe()),ar=w(H());var Yh={};Ye(Yh,{enUS:()=>_N,nlNL:()=>DN});var _N={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"}]}]},DN={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=w(b()),Qh=(e,t,n)=>r=>(0,ro.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),FN=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let i=q(Yh),s=Yt(),a=L("Login",aC),l=z("productName"),u=(0,ar.useCallback)(p=>{p.preventDefault(),r&&r(parseInt(p.target.value,10))},[]),c=(0,ar.useCallback)(p=>{p.preventDefault(),s.send(ls,!0)},[t]),f=(0,ar.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,ar.useCallback)(p=>(0,ro.jsx)("button",{type:"button",className:a.anchorButton,onClick:c,children:p},"prompt"),[c]),{min:m,hour:S,day:y}=(0,ar.useMemo)(()=>({min:Qh(a,60*10,u),hour:Qh(a,60*60,u),day:Qh(a,60*60*12,u)}),[]);return(0,ro.jsxs)("div",{className:(0,lC.default)(e,a.root),children:[i("loginPlease",{login:n?d:f,productName:l}),r&&(0,ro.jsxs)(ar.Fragment,{children:[(0,ro.jsx)("br",{}),i("snooze",{min:m,hour:S,day:y})]})]})},tf=FN;var uC={root:"dd-DoQhb",text:"dd-Jwnev"};var Sl=w(b()),HN=({title:e})=>{let t=L("SearchTrigger",uC),n=Q();return(0,Sl.jsxs)("button",{type:"button",className:t.root,onClick:()=>n(Lt(!0)),children:[(0,Sl.jsx)(fs,{}),(0,Sl.jsx)("span",{className:t.text,children:e})]})},cC=HN;var Xh={};Ye(Xh,{enUS:()=>UN,nlNL:()=>zN});var UN={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"}]},zN={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 be=w(b()),BN=({textSuggestions:e,selectedIndex:t,onLogIn:n})=>{let r=L("SuggestionsOverlay",dC),o=q(Xh),i=M(Ln),s=N1(),a=Q(),l=(0,ws.useRef)(null),u=z("searchTriggerKey"),c=z("productName"),f=M(Qd),d=M(at),m=M(is),[S,y]=(0,ws.useState)(null),p=z("showSearch"),g=z("showTextSuggestions"),h=z("adminUrl"),v=z("isEmbedded"),[x,k]=iC("dd-snooze-until-ms",0),C=f||x>Date.now(),R=e.filter(D=>D.source!=="gpt").length,N=()=>{C&&k(0),a(Qb(!C))},_=D=>{let G=Date.now()+D*1e3;k(G),B.info(`Snooze until: ${new Date(G)}`),a(no({collapse:!0}))};return(0,ws.useEffect)(()=>{R===0&&y(null)},[e,R]),to(()=>{a(no({collapse:!0,skipWhenInputFocus:!0}))}),d===null||m===!1?null:d===!1?(0,be.jsxs)("div",{ref:l,className:(0,nf.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,be.jsxs)("div",{className:r.triggers,children:[(0,be.jsx)("div",{style:{flex:1}}),(0,be.jsx)("div",{className:r.triggersRight,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})})]}),(0,be.jsx)("div",{className:r.toggleButtonWrapper,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),(0,be.jsx)("div",{className:r.collapsible,children:(0,be.jsx)(tf,{loginUrl:h,isEmbedded:v,onLogIn:n,onSnooze:_})})]}):!s||!i?null:(0,be.jsxs)("div",{ref:l,className:(0,nf.default)(r.root,{[r.isCollapsed]:C}),children:[!C&&(0,be.jsxs)("div",{className:r.triggers,children:[(0,be.jsx)("div",{style:{flex:1},children:p&&(0,be.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>y(o(sC()?"searchHintMac":"searchHintWindows",{searchTriggerKey:u.toUpperCase()})),onMouseLeave:()=>y(null),children:(0,be.jsx)(cC,{title:o("search")})})}),(0,be.jsxs)("div",{className:r.triggersRight,onFocus:()=>{},children:[(0,be.jsx)("div",{className:(0,nf.default)(!S&&r.hintsHidden,r.hints),children:S}),(0,be.jsx)(mo,{className:r.toggleButton,title:o("collapse"),onClick:N,isCollapsed:!1})]})]}),(0,be.jsx)("div",{className:r.toggleButtonWrapper,children:(0,be.jsx)(mo,{className:r.toggleButton,title:o("open",{productName:c}),onClick:N,isCollapsed:!0})}),R>0&&g&&(0,be.jsx)("div",{className:r.collapsible,onFocus:()=>{},children:(0,be.jsx)(St,{children:(0,be.jsx)(Jd,{suggestions:e,selectedIndex:t,reverse:!0})})})]})},jN=({input:e})=>({selectedIndex:e.selectedSuggestionIndex,textSuggestions:e.textSuggestions}),fC=Yn(jN)(BN);var vf=w(oe());var dr=w(H());var xs=w(H());function rf(e){return e.contentEditable==="true"}function VN(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),i=o.cloneRange();i.selectNodeContents(e),i.setEnd(o.endContainer,o.endOffset),n=i.toString().length,i.selectNodeContents(e),i.setEnd(o.startContainer,o.startOffset),t=i.toString().length}return{selectionStart:t,selectionEnd:n}}function pC(e){let{selectionStart:t,selectionEnd:n}=rf(e)?VN(e):e;return[t,n]}function mC(e){let[,t]=(0,xs.useState)(),n=(0,xs.useRef)(null);return n.current=pC(e),(0,xs.useEffect)(()=>{let r=()=>{var a;let[o,i]=(a=n.current)!=null?a:[],s=pC(e);(!s||o!==s[0]||i!==s[1])&&(n.current=s,t({}))};return e.addEventListener("keyup",r),e.addEventListener("click",r),e.addEventListener("focus",r),document.addEventListener("selectionchange",r),()=>{e.removeEventListener("keyup",r),e.removeEventListener("click",r),e.removeEventListener("focus",r),document.removeEventListener("selectionchange",r)}},[e]),n.current}function gC(e,t){if(!t)return;let n=e,{value:r}=n,[o,i]=t,s=r.match(iu);if(!s||s.length===0)return;let a=0;s.find(l=>{let u=r.indexOf(l,a);return o>u&&i<u+l.length?(n.selectionStart=u,n.selectionEnd=u+l.length,!0):(a=u+l.length,!1)})}var hC=w(H()),KN=["div","span","mark","strong","b","i","u","em"];function Zh(e,t,n=0){var i;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(i=r.props)==null?void 0:i.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(KN.includes(o)){let s=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,hC.cloneElement)(r,{children:Zh(s,t,n+1)})]}return[...e,...t]}function oo(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=w(oe());var pf=w(H());var Es=w(H());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 of(e){let t=(0,Es.useRef)(null),[n,r]=(0,Es.useState)(!1);return(0,Es.useEffect)(()=>{var c;let o=!1,i=parseFloat((c=window.getComputedStyle(document.body).zoom)!=null?c:"1"),[s,a]=vC((f,d)=>{let m=t.current;if(!m)return;let S=f/i,y=d/i,p=m.getBoundingClientRect(),g=S>p.x&&S<p.x+p.width&&y>p.y&&y<p.y+p.height;g&&!o?(o=!0,r(!0)):!g&&o&&(o=!1,r(!1))},({clientX:f,clientY:d})=>[f,d]),[l,u]=vC(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",s),e.addEventListener("mouseleave",l),()=>{a(),u(),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function SC(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function sf(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function wC(e){return e!=null}var ey=w(oe()),Xt=w(H());var af=w(H()),WN=["bottom","height","left","right","top","width"],$N=(e={},t={})=>WN.some(n=>e[n]!==t[n]),lr=new Map,xC,EC=()=>{let e=[],t=[];lr.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();$N(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{lr.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),xC=window.requestAnimationFrame(EC)};function qN(e,t){return{observe(){let n=lr.size===0;if(lr.has(e)){let r=lr.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else lr.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&EC()},unobserve(){let n=lr.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||lr.delete(e),lr.size||cancelAnimationFrame(xC)}}}}function Jh(e){let[t,n]=(0,af.useState)(null);return(0,af.useLayoutEffect)(()=>{if(!e.current)return;let r=qN(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var bs=w(H()),CC=w(Sc());var bC={root:"dd-r-dgo"};var TC=({children:e,parentNode:t})=>{let[n,r]=(0,bs.useState)(null),o=(0,bs.useContext)(_s);return(0,bs.useLayoutEffect)(()=>{let i=document.createElement("div");return $o(i),i.classList.add(bC.root),o!=null&&o.portalRootNode&&i.classList.add(o==null?void 0:o.portalRootNode),(t||document.body).appendChild(i),r(i),()=>{i.isConnected&&i.remove()}},[]),n?(0,CC.createPortal)(e,n):null};var In={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 lf=w(b()),uf=(e=!1)=>{let[t,n]=(0,Xt.useState)(e),r=(0,Xt.useCallback)(()=>n(!0),[]),o=(0,Xt.useCallback)(()=>n(!1),[]),i=(0,Xt.useCallback)(()=>n(a=>!a),[]),s=(0,Xt.useRef)(null);return{opened:t,open:r,close:o,toggle:i,triggerRef:s}};function ty(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 Cs=u=>{var c=u,{className:e,triggerRef:t,boundaryRef:n=(0,Xt.createRef)(),position:r="above",align:o="center",children:i,toStyle:s=ty,parentNode:a}=c,l=te(c,["className","triggerRef","boundaryRef","position","align","children","toStyle","parentNode"]);let f=Jh(t),d=Jh(n),m=(0,Xt.useMemo)(()=>s(f,d,0),[f,d]);return(0,lf.jsx)(TC,{parentNode:a,children:(0,lf.jsx)("div",I(T({className:(0,ey.default)(In.ref,{[In.positionAbove]:r==="above",[In.positionBelow]:r==="below",[In.positionLeft]:r==="left",[In.positionRight]:r==="right",[In.alignStart]:o==="start",[In.alignCenter]:o==="center",[In.alignEnd]:o==="end"}),style:m},l),{role:"dialog",children:(0,lf.jsx)("div",{className:(0,ey.default)(e,In.root),children:i})}))})};var kC=w(oe()),cf=w(H());var ur={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 ny=w(b()),df=(0,cf.forwardRef)((o,r)=>{var i=o,{className:e,children:t}=i,n=te(i,["className","children"]);let s=(0,cf.useRef)(null),a=L("TabCompletion",ur);return(0,ny.jsx)("div",I(T({ref:sf([s,r]),className:(0,kC.default)(e,a.popoverContentContainer)},n),{children:(0,ny.jsx)("div",{className:a.popoverContent,children:t})}))});var io=w(b()),GN=e=>t=>{let n=ty(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},YN=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let i=L("TabCompletion",ur),s=uf(),a=(0,pf.useMemo)(()=>GN(e.getBoundingClientRect()),[e]),[l,u]=of(e);return(0,pf.useEffect)(()=>{u?s.open():s.close()},[u]),(0,io.jsxs)("span",{children:[(0,io.jsx)("mark",{ref:sf([l,s.triggerRef]),className:(0,PC.default)(i.matchKeyword,{[i.hover]:u}),"aria-haspopup":"dialog","aria-expanded":s.opened?"true":"false",children:r}),s.opened&&(0,io.jsx)(Cs,{className:i.popover,triggerRef:s.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,io.jsx)(df,{style:n,children:(0,io.jsx)("div",{className:i.hintText,children:o})})})]})},ff=class extends er{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(i=>{if(this.usedKeywordMatches.has(i))return null;let s=n.match(i.keywordRegex);if(!s)return null;let a=n.charAt(s.index-1),l=n.charAt(s.index+i.keyword.length);return a==="{"&&l==="}"?null:{index:s.index,length:s[0].length,match:s[0],matchString:s[0],suggestion:i.suggestion,preparedKeywordMatch:i,valid:!0}}).filter(wC);if(r.length===0)return null;let o=r.reduce((i,s)=>s.index<i.index?s:i);return this.usedKeywordMatches.add(o.preparedKeywordMatch),o}replaceWith(n,r){return(0,io.jsx)(YN,{inputElement:r.inputElement,suggestion:r.suggestion,inputStyle:r.inputStyle,boundaryRef:r.boundaryRef,children:n},`keyword_${r.matchString}_${r.key}`)}asTag(){return"mark"}};var RC=w(oe());var ry=w(b()),QN=({inputElement:e,children:t})=>{let n=L("TabCompletion",ur),[r,o]=of(e);return(0,ry.jsx)("mark",{ref:r,className:(0,RC.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},mf=class extends er{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,ry.jsx)(QN,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var hf=w(oe());var ft=w(H());var oy=w(b()),AC=()=>(0,oy.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,oy.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=w(H());var IC=w(xh());var LC={root:"dd-ky-Bv",content:"dd-kV5e1"};function gf(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(i){return null}}function iy(e){return e.replace("https://www.","").replace("https://","")}var Zt=w(b()),XN=3,ZN=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),JN=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=XN})=>{let i=L("LinkSearch",LC),[s,a]=(0,so.useState)(""),l=Q(),u=M(Pb("url")),c=M(tE("URL",ZN)),[f,d]=(0,so.useState)(c.length-1),m=z("fallbackImage"),S=h=>{let v=h.target;a(v.value)},y=(h,v)=>{h.stopPropagation(),h.preventDefault(),window.open(v,"_blank")},p=h=>{var k;let v=f-1<0?c.length-1:f-1,x=f+1===c.length?0:f+1;h.code==="Escape"&&(a(""),t()),h.code==="ArrowUp"&&d(v),h.code==="ArrowDown"&&d(x),h.code==="Enter"&&e(((k=c[f])==null?void 0:k.text)||s)},g=(0,so.useCallback)((0,IC.default)(h=>{l(No({query:h,type:"URL",tags:["link-search"]}))},300),[]);return(0,so.useEffect)(()=>{s&&g(s)},[s]),(0,so.useEffect)(()=>()=>{l(pd())},[]),(0,Zt.jsxs)("div",{className:i.root,children:[(0,Zt.jsx)(St,{withDivider:!0,children:(s?c:u).slice(0,o).map((h,v)=>(0,Zt.jsx)(re,{selected:f===v,onClick:()=>e(h.text),"data-testid":"linksearch-suggestion",children:(0,Zt.jsxs)(ge,{children:[(0,Zt.jsx)(ge.Image,{src:gf(h,"small",m||void 0),title:h.title||h.text}),(0,Zt.jsxs)(ge.Content,{className:i.content,cropText:!0,children:[(0,Zt.jsx)(ge.Title,{children:h.title||iy(h.text)}),h.title&&iy(h.text)]}),(0,Zt.jsx)(re.Actions,{children:(0,Zt.jsx)(re.ActionButton,{label:r,onClick:x=>y(x,h.text)})})]})},h.text))}),(0,Zt.jsx)(Ja,{value:s,onChange:S,autoFocus:!0,placeholder:n,onKeyUp:p})]})},OC=JN;var sy={};Ye(sy,{enUS:()=>eM,nlNL:()=>tM});var eM={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}]},tM={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}]};var dt=w(b()),nM=(0,ft.forwardRef)((e,t)=>{let n=L("TabCompletion",ur);return(0,dt.jsx)("mark",{ref:t,className:(0,hf.default)(n.matchSelection)},"selection-start")}),rM=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let i=q(sy),s=L("TabCompletion",ur),a=(0,ft.useRef)(null),l=(0,ft.useRef)(null),[u,c]=(0,ft.useState)(null),f=Q(),d=uf(document.activeElement===r),[m]=(0,ft.useState)(()=>document.createRange());d.triggerRef.current=m,(0,ft.useEffect)(()=>()=>m.detach(),[]),(0,ft.useEffect)(()=>{let y=e.current,p=a.current;!y||!p||(m.setStart(y,0),m.setEnd(p,0))},[e.current,a.current]),to(()=>{d.close()});let S=(0,ft.useCallback)(y=>{let p=m.toString(),g=/^http(s?):\/\//.test(y)?y:`https://${y}`;f(ad({text:`[${p}](${g})`,replace:"selection"}))},[]);return(0,dt.jsxs)("span",{children:[(0,dt.jsx)("mark",{ref:a,className:(0,hf.default)(s.matchSelection),"aria-haspopup":"dialog","aria-expanded":d.opened?"true":"false",children:o}),d.opened&&(0,dt.jsx)(Cs,{className:s.popoverRoot,triggerRef:d.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,dt.jsxs)(df,{style:n,ref:l,children:[(0,dt.jsx)("div",{className:(0,hf.default)(s.selectionOptions,{[s.selectionOptionsIsHidden]:u!==null}),children:(0,dt.jsxs)("button",{type:"button",tabIndex:u===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>c("insertLink"),children:[(0,dt.jsx)(AC,{}),(0,dt.jsx)("span",{children:"\xA0"}),(0,dt.jsx)("span",{children:i("insertLink")})]})}),u==="insertLink"&&(0,dt.jsx)(OC,{placeholder:i("linkInputPlaceholder"),visitUrlText:i("visitUrl"),onSelectLink:S,onDismiss:()=>{c(null),d.close()}})]})})]},"selection-end")},yf=class extends er{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,ft.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 i=this.foundIndex===0?r:o,s=i>=this.charCount&&i<=this.charCount+n.length?{index:i-this.charCount,length:0,match:"",valid:!0}:null;s&&this.foundIndex++;let a=this.foundIndex===1;return s&&a?this.charCount+=i-this.charCount:this.charCount+=n.length,s?T({isStart:a},s):null}replaceWith(n,r){return r.isStart?(0,dt.jsx)(nM,{ref:this.startRef}):(0,dt.jsx)(rM,{inputElement:r.inputElement,startRef:this.startRef,boundaryRef:r.boundaryRef,inputStyle:r.inputStyle})}asTag(){return"mark"}};var cr=w(b()),oM=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:i,keywordMatches:s,inputElement:a,source:l})=>{let u=L("TabCompletion",yC),c=z("insertLink"),f=z("showMidSentenceSuggestions"),d=z("inlineSuggestions"),m=mC(a),S=(0,dr.useRef)(null),y=M(at);(0,dr.useEffect)(()=>{oo(a)&&m&&gC(a,m)},[m]);let p=(0,dr.useCallback)(v=>{if(!o||!n)return v;let x=[(0,cr.jsx)("span",{className:u.resetIndent,children:"\u200B"},"u200B"),(0,cr.jsx)("span",{"data-testid":"tab-completion",className:(0,vf.default)(u.tabText,u.resetIndent),"data-source":l,children:n},"tabText")];return r&&x.push((0,cr.jsx)("span",{className:(0,vf.default)(u.hint,u.resetIndent),children:(0,cr.jsx)(tu,{keyCode:"tab"},"tabHint")})),Zh(v,x)},[o,n,r]),g=(0,dr.useMemo)(()=>{let v=[];return c&&v.push(new yf("selection")),v.push(new mf("placeholders")),i&&v.push(new ff("keywords")),v},[d,c,i]),h=(0,dr.useMemo)(()=>{let v=window.getComputedStyle(a);return{"--dd-color":v.color,"--dd-font-size":v.fontSize,"--dd-font-family":v.fontFamily,"--dd-font-variant":v.fontVariant}},[]);return!e||!y?null:(0,cr.jsxs)("div",{ref:v=>{v!=null&&v.parentElement&&(S.current=v==null?void 0:v.parentElement)},className:u.root,style:h,children:[(0,cr.jsx)(us,{tagName:"span",containerTagName:"div",className:(0,vf.default)(u.container,u.agentText),disableLineBreaks:oo(a),content:t||"\u200B",onAfterParse:p,matchers:g,selection:m,keywordMatches:s,inputElement:a,inputStyle:h,boundaryRef:S,inlineSuggestionsOnlyAtEnd:!f}),(0,cr.jsx)("br",{})]})},iM=e=>{var p,g,h;let{input:t,ui:n,settings:r,styleSuggestions:o,conversation:i}=e,s=as({input:t}),a=(s==null?void 0:s.text)||"",l=(s==null?void 0:s.source)||"",u=(p=t.html)!=null?p:cs(t.text),c=a.indexOf(t.text)===0?a.slice(t.text.length):"",{showTabHint:f}=n,{isSupported:d}=i,{showTabCompletion:m,visible:S,showStyleSuggestions:y}=r;return{showTabHint:f,showStyleSuggestions:y,showTabCompletion:m&&Ln(e),content:u,tabText:c,source:l,keywordMatches:(h=(g=o.list)==null?void 0:g.keywordMatches)!=null?h:[],enabled:S&&d!==!1}},NC=Yn(iM)(oM);var ek=w(oe()),Il=w(H());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)},fr=K("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)})),ay=K("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(fr(e.platformSessionId))})),ly=K("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(fr(e.platformSessionId))})),sM=Y({name:"autoflows",initialState:MC,reducers:{},extraReducers:e=>{e.addCase(ay.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Started",r.isBusy=!0}),e.addCase(ly.pending,(t,n)=>{let r=_C(n.meta.arg.triggerPayload)(t);r.state="Aborted",r.isBusy=!0}),e.addCase(fr.pending,t=>{t.fetchState="loading"}),e.addCase(fr.rejected,t=>{t.fetchState="error"}),e.addCase(fr.fulfilled,(t,n)=>{t.list=n.payload,t.fetchState="done"}),e.addCase(ce,()=>MC)}}),FC=K("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(fr(e))}),o.on("sessionCompleted",()=>{n(fr(e))})}),HC=K("autoflows/closeStream",(e,t)=>{let{deepdeskBrokerAPI:n}=t.extra;if(!n)throw new Error("Deepdesk Broker not initialized");n.closeStream(e)}),UC=sM.reducer;var zC={list:[],fetchState:"idle",sentSuggestions:[],errorSuggestions:[],answeredSuggestions:[]},BC=e=>e.customMessages.list,jC=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),wl=K("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)})),Sf=K("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=K("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=Y({name:"customMessages",initialState:zC,reducers:{onCustomMessage(e,t){Array.isArray(t.payload)?e.list=t.payload:e.list=[t.payload]}},extraReducers:e=>{e.addCase(wl.pending,t=>{t.fetchState="loading"}).addCase(wl.rejected,t=>{t.fetchState="error"}).addCase(wl.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload||[]}).addCase(Sf.pending,(t,n)=>{t.sentSuggestions.push(n.meta.arg.suggestion.text),t.errorSuggestions=t.errorSuggestions.filter(r=>n.meta.arg.suggestion.text!==r)}).addCase(Sf.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(ce,()=>zC)}}),$C=K("customMessages/openStream",(e,t)=>{let{dispatch:n}=t,{deepdeskBrokerAPI:r}=t.extra;if(!r)throw new Error("Deepdesk Broker not initialized");r.openStream(e).on("customMessageSuggestion",i=>{n(WC.actions.onCustomMessage(i))})}),qC=K("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 aM={token:null,interval:null},uy=K("passwordlessToken/getTemporaryPasswordlessToken",(e,t)=>P(void 0,null,function*(){let{deepdeskAPI:n}=t.extra;return{token:yield n.requestPasswordlessToken()}})),cy=K("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(uy()),setInterval(()=>r(uy()),n)}),YC=Y({name:"passwordlessToken",initialState:aM,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(uy.fulfilled,(t,n)=>{t.token=n.payload.token}),e.addCase(cy.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:QC}=YC.actions,XC=YC.reducer;var dy={outputs:[],fetchState:"idle"},ZC=e=>{var t;return(t=e.assistants)==null?void 0:t.outputs},lM=Ce("assistants/resetOutputs"),Yo=K("assistants/evaluate",(e,t)=>P(void 0,null,function*(){var n,r;try{let{deepdeskAPI:o}=t.extra,i=t.getState(),{platformVariables:s}=i.info,a=(n=i.conversation.current)==null?void 0:n.sessionId;if(!a)throw new Error("No current conversation to evaluate assistants");let l=yield o.evaluateAssistant(e.assistantCode,T({tags:((r=i.conversation.current)==null?void 0:r.tags)||void 0},e.payload),{conversationId:a});return s&&(l=l.map(u=>I(T({},u),{name:ut(u.name,s),response:ut(u.response,s)}))),l}catch(o){let i=o.message;return B.warn(i),t.rejectWithValue(i)}})),JC=Y({name:"assistants",initialState:dy,reducers:{removeOutputByCode(e,t){e.outputs=e.outputs.filter(n=>n.code!==t.payload.code)}},extraReducers:e=>{e.addCase(Yo.pending,t=>{t.fetchState="loading"}).addCase(Yo.rejected,t=>{t.fetchState="error"}).addCase(Yo.fulfilled,(t,n)=>{let r=n.payload.map(i=>i.name),o=t.outputs.filter(i=>!r.includes(i.name));t.fetchState="done",t.outputs=[...n.payload,...o]}).addCase(ce,()=>dy).addCase(lM.toString(),()=>dy)}}),{removeOutputByCode:eT}=JC.actions,tT=JC.reducer;var nT={excludeFromWidget:!1},fy={cues:[],fetchState:"idle"},rT=e=>{var t;return(t=e.rules)==null?void 0:t.cues},uM=Ce("rules/resetCues"),Qo=K("rules/evaluate",(e,t)=>P(void 0,null,function*(){var n,r;try{let{deepdeskAPI:o}=t.extra,i=t.getState(),{platformVariables:s}=i.info,a=(n=i.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=i.conversation.current)==null?void 0:r.tags)||void 0},e.params));return s&&(f=f.map(d=>I(T({},d),{title:ut(d.title,s),text:ut(d.text,s)}))),{cues:f,options:e.options}}catch(o){let i=o.message;return B.warn(i),t.rejectWithValue(i)}})),oT=Y({name:"answer",initialState:fy,reducers:{removeCue(e,t){e.cues=e.cues.filter(n=>n.rule.id!==t.payload.id)}},extraReducers:e=>{e.addCase(Qo.pending,t=>{t.fetchState="loading"}).addCase(Qo.rejected,t=>{t.fetchState="error"}).addCase(Qo.fulfilled,(t,n)=>{var i;if((i=n.payload.options)!=null&&i.excludeFromWidget){t.fetchState="done";return}let r=n.payload.cues.map(s=>s.rule.id),o=t.cues.filter(s=>!r.includes(s.rule.id));t.fetchState="done",t.cues=[...n.payload.cues,...o]}).addCase(ce,()=>fy).addCase(uM.toString(),()=>fy)}}),{removeCue:iT}=oT.actions,sT=oT.reducer;function cM(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}var aT=e=>{let t=rT(e),r=ZC(e).map(o=>({text:o.response,title:o.name,rule:{id:cM(o.code),label:o.code,name:o.name,description:o.name}}));return[...t,...r]};var hT=w(H());var pT=w(oe()),mT=w(H());var uT=w(oe());var lT={root:"dd-uszkm"};var dT=w(b()),dM=({className:e,children:t})=>{let n=L("Unicode",lT);return(0,dT.jsx)("span",{className:(0,uT.default)(e,n.root),children:t})},cT=dM;var fT={isDisabled:"dd-Sp--t",root:"dd-maqTG",buttonStop:"dd-rcq8w",stateBadge:"dd-zOnkT",isCompleted:"dd-GA-rt",isStarted:"dd-PZwtX",isAborted:"dd-PAXSE"};var py={};Ye(py,{enUS:()=>fM,nlNL:()=>pM});var fM={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"}]},pM={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 Mt=w(b()),gM=({disabled:e,state:t,displayName:n,description:r,onStartAutoflow:o,onStopAutoflow:i})=>{let s=L("Autoflow",fT),a=q(py),l=t==="Started"?"stop":"start",u=l==="start"?"\u25B6":l==="stop"?"\u25FC":"";return(0,Mt.jsxs)(re,{className:(0,pT.default)(s.root,{[s.isDisabled]:e,[s.isCompleted]:t==="Completed",[s.isAborted]:t==="Aborted",[s.isStarted]:t==="Started"}),children:[(0,Mt.jsx)(ge,{children:(0,Mt.jsxs)(ge.Content,{children:[(0,Mt.jsxs)(ge.Title,{children:[t&&(0,Mt.jsx)("span",{className:s.stateBadge,children:a(t)}),n]}),(0,Mt.jsx)("span",{children:r})]})}),(0,Mt.jsx)(re.Actions,{fixed:t==="Started",children:(0,Mt.jsx)(re.ActionButton,{primary:!0,className:l==="start"?s.buttonStart:s.buttonStop,onClick:t==="Started"?i:o,disabled:e,label:(0,Mt.jsxs)(mT.Fragment,{children:[(0,Mt.jsx)(cT,{children:u})," ",(0,Mt.jsx)("span",{children:a(l)})]})})})]})},gT=gM;var my=w(b()),hM=(e,t)=>{let n=t.filter(r=>r.state==="Started");return n.length>0?n.indexOf(e)===-1:!1},yM=({autoflows:e,onStartAutoflow:t,onStopAutoflow:n,platformSessionId:r})=>(0,my.jsx)(hT.Fragment,{children:e.map(o=>(0,my.jsx)(gT,{displayName:o.displayName,description:o.description,disabled:o.isBusy||hM(o,e),state:o.state,onStartAutoflow:()=>t({platformSessionId:r,triggerPayload:o.triggerPayload}),onStopAutoflow:()=>n({platformSessionId:r,triggerPayload:o.triggerPayload})},o.displayName))}),vM=({autoflows:e,conversation:t})=>{var n;return{autoflows:e.list,platformSessionId:(n=t.current)==null?void 0:n.sessionId}},SM={onStartAutoflow:ay,onStopAutoflow:ly},yT=Yn(vM,SM)(yM);var vT=w(oe()),gy=w(H());var pr={root:"dd-ERsBr",title:"dd-b36p6",isUsed:"dd-fp2IX",quickReplies:"dd--VrvP",quickReply:"dd-wFhWh",label:"dd-R9sND",errorIcon:"dd-8cdcH"};var Ct=w(b()),wM=({suggestion:e})=>{let t=q(Ko),n=Q(),r=M(jC(e.text)),o=M(VC(e.text)),i=M(KC(e.text)),s=M(os),{replyOptions:a}=e,l=(0,gy.useCallback)(c=>{c.preventDefault(),c.stopPropagation(),!(r||!s)&&n(Sf({platformSessionId:s,suggestion:e}))},[e,r,n,s]),u=(0,gy.useCallback)(c=>{if(c.preventDefault(),c.stopPropagation(),!s||!a)return;let f=parseInt(c.target.dataset.index,10),d=a[f];n(wf({platformSessionId:s,reply:d,suggestion:e}))},[e,r,n,s]);return(0,Ct.jsxs)(re,{onClick:l,className:(0,vT.default)(pr.root,{[pr.isUsed]:r,[pr.hasError]:i}),children:[(0,Ct.jsx)(ge,{children:(0,Ct.jsxs)(ge.Content,{children:[(0,Ct.jsxs)(ge.Title,{className:pr.title,children:[e.text," ",(0,Ct.jsx)(nu,{className:pr.label,children:"analyse tool"})," ",i&&(0,Ct.jsx)("span",{className:pr.errorIcon,role:"img","aria-label":t("sendingError"),title:t("sendingError"),children:"!"})]}),a&&a.length>0&&(0,Ct.jsx)("ul",{className:pr.quickReplies,children:a.map(c=>(0,Ct.jsx)("li",{className:pr.quickReply,children:c.title},c.title))})]})}),(0,Ct.jsxs)(re.Actions,{fixed:i||r,children:[a&&a.length>0&&(0,Ct.jsx)(re.DropdownButton,{label:t("answer"),disabled:o,children:a.map((c,f)=>(0,Ct.jsx)(re.DropdownItem,{index:f,label:c.title,onClick:u},c.title))}),(0,Ct.jsx)(re.ActionButton,{primary:!0,disabled:r,onClick:l,label:t(r?"suggestionSent":i?"tryAgain":"sendSuggestion")})]})]})},ST=wM;var xf=w(H());var yy=w(oe());var hy=w(b()),xl=()=>(0,hy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,hy.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 wT={root:"dd-WcEru",entity:"dd-LfP8y",entityText:"dd-L-v0f",iconWrapper:"dd-9Deh1",icon:"dd-tM7E2",iconClicked:"dd-EEdDL"};var On=w(b()),xM=({entities:e})=>{let t=L("EntitiesWidgetList",wT),[n,r]=(0,xf.useState)(void 0),o=Q(),i=()=>{r(void 0)},s=a=>{e&&(r(e.indexOf(a)),Zn(a.text),o(lt({name:"entity copied",data:{entity:a,type:"copy"}})))};return(0,xf.useEffect)(()=>{let a=setTimeout(i,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,On.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,On.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>s(a),children:[(0,On.jsx)("span",{className:t.entityText,children:a.text}),(0,On.jsxs)("span",{className:t.iconWrapper,children:[(0,On.jsx)("span",{className:(0,yy.default)(t.icon),children:(0,On.jsx)(xl,{})}),(0,On.jsx)("span",{className:(0,yy.default)(t.icon,n===l&&t.iconClicked),children:(0,On.jsx)(xl,{})})]})]},a.text))})},xT=xM;var vy=w(b()),ET=()=>(0,vy.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,vy.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 Sy=w(b()),bT=()=>(0,Sy.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 -960 960 960",width:"1em",children:(0,Sy.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=w(b()),CT=()=>(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 KT=w(H());var{entries:MT,setPrototypeOf:TT,isFrozen:EM,getPrototypeOf:bM,getOwnPropertyDescriptor:CM}=Object,{freeze:mt,seal:Jt,create:_T}=Object,{apply:ky,construct:Py}=typeof Reflect!="undefined"&&Reflect;mt||(mt=function(t){return t});Jt||(Jt=function(t){return t});ky||(ky=function(t,n,r){return t.apply(n,r)});Py||(Py=function(t,n){return new t(...n)});var Ef=Tt(Array.prototype.forEach),kT=Tt(Array.prototype.pop),El=Tt(Array.prototype.push),Tf=Tt(String.prototype.toLowerCase),xy=Tt(String.prototype.toString),PT=Tt(String.prototype.match),bl=Tt(String.prototype.replace),TM=Tt(String.prototype.indexOf),kM=Tt(String.prototype.trim),hn=Tt(Object.prototype.hasOwnProperty),pt=Tt(RegExp.prototype.test),Cl=PM(TypeError),RT=Tt(Number.isNaN);function Tt(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 ky(e,t,r)}}function PM(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Py(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Tf;TT&&TT(e,null);let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let i=n(o);i!==o&&(EM(t)||(t[r]=i),o=i)}e[o]=!0}return e}function RM(e){for(let t=0;t<e.length;t++)hn(e,t)||(e[t]=null);return e}function Zo(e){let t=_T(null);for(let[n,r]of MT(e))hn(e,n)&&(Array.isArray(r)?t[n]=RM(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=Zo(r):t[n]=r);return t}function bf(e,t){for(;e!==null;){let r=CM(e,t);if(r){if(r.get)return Tt(r.get);if(typeof r.value=="function")return Tt(r.value)}e=bM(e)}function n(){return null}return n}var AT=mt(["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"]),Ey=mt(["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"]),by=mt(["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"]),AM=mt(["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"]),Cy=mt(["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"]),LM=mt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),LT=mt(["#text"]),IT=mt(["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"]),Ty=mt(["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"]),OT=mt(["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"]),Cf=mt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),IM=Jt(/\{\{[\w\W]*|[\w\W]*\}\}/gm),OM=Jt(/<%[\w\W]*|[\w\W]*%>/gm),NM=Jt(/\${[\w\W]*}/gm),MM=Jt(/^data-[\-\w.\u00B7-\uFFFF]/),_M=Jt(/^aria-[\-\w]+$/),DT=Jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),DM=Jt(/^(?:\w+script|data):/i),FM=Jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),FT=Jt(/^html$/i),HM=Jt(/^[a-z][.\w]*(-[.\w]+)+$/i),NT=Object.freeze({__proto__:null,MUSTACHE_EXPR:IM,ERB_EXPR:OM,TMPLIT_EXPR:NM,DATA_ATTR:MM,ARIA_ATTR:_M,IS_ALLOWED_URI:DT,IS_SCRIPT_OR_DATA:DM,ATTR_WHITESPACE:FM,DOCTYPE_NAME:FT,CUSTOM_ELEMENT:HM}),Xo={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},UM=function(){return typeof window=="undefined"?null:window},zM=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 i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(s){return s},createScriptURL(s){return s}})}catch(s){return console.warn("TrustedTypes policy "+i+" could not be created."),null}};function HT(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:UM(),t=j=>HT(j);if(t.version="3.1.3",t.removed=[],!e||!e.document||e.document.nodeType!==Xo.document)return t.isSupported=!1,t;let{document:n}=e,r=n,o=r.currentScript,{DocumentFragment:i,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:c=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:f,DOMParser:d,trustedTypes:m}=e,S=l.prototype,y=bf(S,"cloneNode"),p=bf(S,"nextSibling"),g=bf(S,"childNodes"),h=bf(S,"parentNode");if(typeof s=="function"){let j=n.createElement("template");j.content&&j.content.ownerDocument&&(n=j.content.ownerDocument)}let v,x="",{implementation:k,createNodeIterator:C,createDocumentFragment:R,getElementsByTagName:N}=n,{importNode:_}=r,D={};t.isSupported=typeof MT=="function"&&typeof h=="function"&&k&&k.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:G,ERB_EXPR:Z,TMPLIT_EXPR:ie,DATA_ATTR:vr,ARIA_ATTR:_t,IS_SCRIPT_OR_DATA:Sr,ATTR_WHITESPACE:Dt,CUSTOM_ELEMENT:V}=NT,{IS_ALLOWED_URI:Te}=NT,ve=null,wr=J({},[...AT,...Ey,...by,...Cy,...LT]),Se=null,ke=J({},[...IT,...Ty,...OT,...Cf]),we=Object.seal(_T(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}})),ri=null,uo=null,oi=!0,ii=!0,Ul=!1,co=!0,Sn=!1,zl=!0,He=!1,Dn=!1,Ff=!1,si=!1,Bl=!1,jl=!1,jy=!0,Vy=!1,Wk="user-content-",Hf=!0,Ls=!1,ai={},li=null,Ky=J({},["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"]),Wy=null,$y=J({},["audio","video","img","source","image","track"]),Uf=null,qy=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vl="http://www.w3.org/1998/Math/MathML",Kl="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",ui=Fn,zf=!1,Bf=null,$k=J({},[Vl,Kl,Fn],xy),Is=null,qk=["application/xhtml+xml","text/html"],Gk="text/html",Ue=null,ci=null,Gy=255,Yk=n.createElement("form"),Yy=function(E){return E instanceof RegExp||E instanceof Function},jf=function(){let E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ci&&ci===E)){if((!E||typeof E!="object")&&(E={}),E=Zo(E),Is=qk.indexOf(E.PARSER_MEDIA_TYPE)===-1?Gk:E.PARSER_MEDIA_TYPE,Ue=Is==="application/xhtml+xml"?xy:Tf,ve=hn(E,"ALLOWED_TAGS")?J({},E.ALLOWED_TAGS,Ue):wr,Se=hn(E,"ALLOWED_ATTR")?J({},E.ALLOWED_ATTR,Ue):ke,Bf=hn(E,"ALLOWED_NAMESPACES")?J({},E.ALLOWED_NAMESPACES,xy):$k,Uf=hn(E,"ADD_URI_SAFE_ATTR")?J(Zo(qy),E.ADD_URI_SAFE_ATTR,Ue):qy,Wy=hn(E,"ADD_DATA_URI_TAGS")?J(Zo($y),E.ADD_DATA_URI_TAGS,Ue):$y,li=hn(E,"FORBID_CONTENTS")?J({},E.FORBID_CONTENTS,Ue):Ky,ri=hn(E,"FORBID_TAGS")?J({},E.FORBID_TAGS,Ue):{},uo=hn(E,"FORBID_ATTR")?J({},E.FORBID_ATTR,Ue):{},ai=hn(E,"USE_PROFILES")?E.USE_PROFILES:!1,oi=E.ALLOW_ARIA_ATTR!==!1,ii=E.ALLOW_DATA_ATTR!==!1,Ul=E.ALLOW_UNKNOWN_PROTOCOLS||!1,co=E.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Sn=E.SAFE_FOR_TEMPLATES||!1,zl=E.SAFE_FOR_XML!==!1,He=E.WHOLE_DOCUMENT||!1,si=E.RETURN_DOM||!1,Bl=E.RETURN_DOM_FRAGMENT||!1,jl=E.RETURN_TRUSTED_TYPE||!1,Ff=E.FORCE_BODY||!1,jy=E.SANITIZE_DOM!==!1,Vy=E.SANITIZE_NAMED_PROPS||!1,Hf=E.KEEP_CONTENT!==!1,Ls=E.IN_PLACE||!1,Te=E.ALLOWED_URI_REGEXP||DT,ui=E.NAMESPACE||Fn,we=E.CUSTOM_ELEMENT_HANDLING||{},E.CUSTOM_ELEMENT_HANDLING&&Yy(E.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(we.tagNameCheck=E.CUSTOM_ELEMENT_HANDLING.tagNameCheck),E.CUSTOM_ELEMENT_HANDLING&&Yy(E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(we.attributeNameCheck=E.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),E.CUSTOM_ELEMENT_HANDLING&&typeof E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=E.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Sn&&(ii=!1),Bl&&(si=!0),ai&&(ve=J({},LT),Se=[],ai.html===!0&&(J(ve,AT),J(Se,IT)),ai.svg===!0&&(J(ve,Ey),J(Se,Ty),J(Se,Cf)),ai.svgFilters===!0&&(J(ve,by),J(Se,Ty),J(Se,Cf)),ai.mathMl===!0&&(J(ve,Cy),J(Se,OT),J(Se,Cf))),E.ADD_TAGS&&(ve===wr&&(ve=Zo(ve)),J(ve,E.ADD_TAGS,Ue)),E.ADD_ATTR&&(Se===ke&&(Se=Zo(Se)),J(Se,E.ADD_ATTR,Ue)),E.ADD_URI_SAFE_ATTR&&J(Uf,E.ADD_URI_SAFE_ATTR,Ue),E.FORBID_CONTENTS&&(li===Ky&&(li=Zo(li)),J(li,E.FORBID_CONTENTS,Ue)),Hf&&(ve["#text"]=!0),He&&J(ve,["html","head","body"]),ve.table&&(J(ve,["tbody"]),delete ri.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.');v=E.TRUSTED_TYPES_POLICY,x=v.createHTML("")}else v===void 0&&(v=zM(m,o)),v!==null&&typeof x=="string"&&(x=v.createHTML(""));mt&&mt(E),ci=E}},Qy=J({},["mi","mo","mn","ms","mtext"]),Xy=J({},["foreignobject","annotation-xml"]),Qk=J({},["title","style","font","a","script"]),Zy=J({},[...Ey,...by,...AM]),Jy=J({},[...Cy,...LM]),Xk=function(E){let A=h(E);(!A||!A.tagName)&&(A={namespaceURI:ui,tagName:"template"});let U=Tf(E.tagName),X=Tf(A.tagName);return Bf[E.namespaceURI]?E.namespaceURI===Kl?A.namespaceURI===Fn?U==="svg":A.namespaceURI===Vl?U==="svg"&&(X==="annotation-xml"||Qy[X]):!!Zy[U]:E.namespaceURI===Vl?A.namespaceURI===Fn?U==="math":A.namespaceURI===Kl?U==="math"&&Xy[X]:!!Jy[U]:E.namespaceURI===Fn?A.namespaceURI===Kl&&!Xy[X]||A.namespaceURI===Vl&&!Qy[X]?!1:!Jy[U]&&(Qk[U]||!Zy[U]):!!(Is==="application/xhtml+xml"&&Bf[E.namespaceURI]):!1},Ft=function(E){El(t.removed,{element:E});try{E.parentNode.removeChild(E)}catch(A){E.remove()}},Wl=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"&&!Se[E])if(si||Bl)try{Ft(A)}catch(U){}else try{A.setAttribute(E,"")}catch(U){}},ev=function(E){let A=null,U=null;if(Ff)E="<remove></remove>"+E;else{let Ve=PT(E,/^[\r\n\t ]+/);U=Ve&&Ve[0]}Is==="application/xhtml+xml"&&ui===Fn&&(E='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+E+"</body></html>");let X=v?v.createHTML(E):E;if(ui===Fn)try{A=new d().parseFromString(X,Is)}catch(Ve){}if(!A||!A.documentElement){A=k.createDocument(ui,"template",null);try{A.documentElement.innerHTML=zf?x:X}catch(Ve){}}let Ge=A.body||A.documentElement;return E&&U&&Ge.insertBefore(n.createTextNode(U),Ge.childNodes[0]||null),ui===Fn?N.call(A,He?"html":"body")[0]:He?A.documentElement:Ge},tv=function(E){return C.call(E.ownerDocument||E,E,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},nv=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")},rv=function(E){return typeof a=="function"&&E instanceof a},Hn=function(E,A,U){D[E]&&Ef(D[E],X=>{X.call(t,A,U,ci)})},ov=function(E){let A=null;if(Hn("beforeSanitizeElements",E,null),nv(E))return Ft(E),!0;let U=Ue(E.nodeName);if(Hn("uponSanitizeElement",E,{tagName:U,allowedTags:ve}),E.hasChildNodes()&&!rv(E.firstElementChild)&&pt(/<[/\w]/g,E.innerHTML)&&pt(/<[/\w]/g,E.textContent)||E.nodeType===Xo.progressingInstruction||zl&&E.nodeType===Xo.comment&&pt(/<[/\w]/g,E.data))return Ft(E),!0;if(!ve[U]||ri[U]){if(!ri[U]&&sv(U)&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,U)||we.tagNameCheck instanceof Function&&we.tagNameCheck(U)))return!1;if(Hf&&!li[U]){let X=h(E)||E.parentNode,Ge=g(E)||E.childNodes;if(Ge&&X){let Ve=Ge.length;for(let gt=Ve-1;gt>=0;--gt){let ht=y(Ge[gt],!0);ht.__removalCount=(E.__removalCount||0)+1,X.insertBefore(ht,p(E))}}}return Ft(E),!0}return E instanceof l&&!Xk(E)||(U==="noscript"||U==="noembed"||U==="noframes")&&pt(/<\/no(script|embed|frames)/i,E.innerHTML)?(Ft(E),!0):(Sn&&E.nodeType===Xo.text&&(A=E.textContent,Ef([G,Z,ie],X=>{A=bl(A,X," ")}),E.textContent!==A&&(El(t.removed,{element:E.cloneNode()}),E.textContent=A)),Hn("afterSanitizeElements",E,null),!1)},iv=function(E,A,U){if(jy&&(A==="id"||A==="name")&&(U in n||U in Yk||U==="__depth"||U==="__removalCount"))return!1;if(!(ii&&!uo[A]&&pt(vr,A))){if(!(oi&&pt(_t,A))){if(!Se[A]||uo[A]){if(!(sv(E)&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,E)||we.tagNameCheck instanceof Function&&we.tagNameCheck(E))&&(we.attributeNameCheck instanceof RegExp&&pt(we.attributeNameCheck,A)||we.attributeNameCheck instanceof Function&&we.attributeNameCheck(A))||A==="is"&&we.allowCustomizedBuiltInElements&&(we.tagNameCheck instanceof RegExp&&pt(we.tagNameCheck,U)||we.tagNameCheck instanceof Function&&we.tagNameCheck(U))))return!1}else if(!Uf[A]){if(!pt(Te,bl(U,Dt,""))){if(!((A==="src"||A==="xlink:href"||A==="href")&&E!=="script"&&TM(U,"data:")===0&&Wy[E])){if(!(Ul&&!pt(Sr,bl(U,Dt,"")))){if(U)return!1}}}}}}return!0},sv=function(E){return E!=="annotation-xml"&&PT(E,V)},av=function(E){Hn("beforeSanitizeAttributes",E,null);let{attributes:A}=E;if(!A)return;let U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se},X=A.length;for(;X--;){let Ge=A[X],{name:Ve,namespaceURI:gt,value:ht}=Ge,Os=Ue(Ve),ot=Ve==="value"?ht:kM(ht);if(U.attrName=Os,U.attrValue=ot,U.keepAttr=!0,U.forceKeepAttr=void 0,Hn("uponSanitizeAttribute",E,U),ot=U.attrValue,U.forceKeepAttr||(Wl(Ve,E),!U.keepAttr))continue;if(!co&&pt(/\/>/i,ot)){Wl(Ve,E);continue}if(zl&&pt(/((--!?|])>)|<\/(style|title)/i,ot)){Wl(Ve,E);continue}Sn&&Ef([G,Z,ie],uv=>{ot=bl(ot,uv," ")});let lv=Ue(E.nodeName);if(iv(lv,Os,ot)){if(Vy&&(Os==="id"||Os==="name")&&(Wl(Ve,E),ot=Wk+ot),v&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!gt)switch(m.getAttributeType(lv,Os)){case"TrustedHTML":{ot=v.createHTML(ot);break}case"TrustedScriptURL":{ot=v.createScriptURL(ot);break}}try{gt?E.setAttributeNS(gt,Ve,ot):E.setAttribute(Ve,ot),nv(E)?Ft(E):kT(t.removed)}catch(uv){}}}Hn("afterSanitizeAttributes",E,null)},Zk=function j(E){let A=null,U=tv(E);for(Hn("beforeSanitizeShadowDOM",E,null);A=U.nextNode();){if(Hn("uponSanitizeShadowNode",A,null),ov(A))continue;let X=h(A);A.nodeType===Xo.element&&(X&&X.__depth?A.__depth=(A.__removalCount||0)+X.__depth+1:A.__depth=1),(A.__depth>=Gy||A.__depth<0||RT(A.__depth))&&Ft(A),A.content instanceof i&&(A.content.__depth=A.__depth,j(A.content)),av(A)}Hn("afterSanitizeShadowDOM",E,null)};return t.sanitize=function(j){let E=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,U=null,X=null,Ge=null;if(zf=!j,zf&&(j="<!-->"),typeof j!="string"&&!rv(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(Dn||jf(E),t.removed=[],typeof j=="string"&&(Ls=!1),Ls){if(j.nodeName){let ht=Ue(j.nodeName);if(!ve[ht]||ri[ht])throw Cl("root node is forbidden and cannot be sanitized in-place")}}else if(j instanceof a)A=ev("<!---->"),U=A.ownerDocument.importNode(j,!0),U.nodeType===Xo.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?A=U:A.appendChild(U);else{if(!si&&!Sn&&!He&&j.indexOf("<")===-1)return v&&jl?v.createHTML(j):j;if(A=ev(j),!A)return si?null:jl?x:""}A&&Ff&&Ft(A.firstChild);let Ve=tv(Ls?j:A);for(;X=Ve.nextNode();){if(ov(X))continue;let ht=h(X);X.nodeType===Xo.element&&(ht&&ht.__depth?X.__depth=(X.__removalCount||0)+ht.__depth+1:X.__depth=1),(X.__depth>=Gy||X.__depth<0||RT(X.__depth))&&Ft(X),X.content instanceof i&&(X.content.__depth=X.__depth,Zk(X.content)),av(X)}if(Ls)return j;if(si){if(Bl)for(Ge=R.call(A.ownerDocument);A.firstChild;)Ge.appendChild(A.firstChild);else Ge=A;return(Se.shadowroot||Se.shadowrootmode)&&(Ge=_.call(r,Ge,!0)),Ge}let gt=He?A.outerHTML:A.innerHTML;return He&&ve["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&pt(FT,A.ownerDocument.doctype.name)&&(gt="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
24
24
|
`+gt),Sn&&Ef([G,Z,ie],ht=>{gt=bl(gt,ht," ")}),v&&jl?v.createHTML(gt):gt},t.setConfig=function(){let j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jf(j),Dn=!0},t.clearConfig=function(){ci=null,Dn=!1},t.isValidAttribute=function(j,E,A){ci||jf({});let U=Ue(j),X=Ue(E);return iv(U,X,A)},t.addHook=function(j,E){typeof E=="function"&&(D[j]=D[j]||[],El(D[j],E))},t.removeHook=function(j){if(D[j])return kT(D[j])},t.removeHooks=function(j){D[j]&&(D[j]=[])},t.removeAllHooks=function(){D={}},t}var UT=HT();var mr=w(H());var BM={"":["<em>","</em>"],_:["<strong>","</strong>"],"*":["<strong>","</strong>"],"~":["<s>","</s>"],"\n":["<br />"]," ":["<br />"],"-":["<hr />"]};function zT(e){return e.replace(RegExp("^"+(e.match(/^(\t| )+/)||"")[0],"gm"),"")}function Tl(e){return(e+"").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function kl(e,t){var n,r,o,i,s,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(S){var y=BM[S[1]||""],p=l[l.length-1]==S;return y?y[1]?(p?l.pop():l.push(S),y[0|p]):y[0]:S}function m(){for(var S="";l.length;)S+=d(l[l.length-1]);return S}for(e=e.replace(/^\[(.+?)\]:\s*(.+)$/gm,function(S,y,p){return c[y.toLowerCase()]=p,""}).replace(/^\n+|\n+$/g,"");o=a.exec(e);)r=e.substring(f,o.index),f=a.lastIndex,n=o[0],r.match(/[^\\](\\\\)*\\$/)||((s=o[3]||o[4])?n='<pre class="code '+(o[4]?"poetry":o[2].toLowerCase())+'"><code'+(o[2]?' class="language-'+o[2].toLowerCase()+'"':"")+">"+zT(Tl(s).replace(/^\n+|\n+$/g,""))+"</code></pre>":(s=o[6])?(s.match(/\./)&&(o[5]=o[5].replace(/^\d+/gm,"")),i=kl(zT(o[5].replace(/^\s*[>*+.-]/gm,""))),s==">"?s="blockquote":(s=s.match(/\./)?"ol":"ul",i=i.replace(/^(.*)(\n|$)/gm,"<li>$1</li>")),n="<"+s+">"+i+"</"+s+">"):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=m()+"</a>"):o[9]?n="<a>":o[12]||o[14]?n="<"+(s="h"+(o[14]?o[14].length:o[13]>"="?1:2))+">"+kl(o[12]||o[15],c)+"</"+s+">":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)+m()).replace(/^\n+|\n+$/g,"")}var BT={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 yn=w(b());function jM(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 Ry(e){var n;let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(r=>r.remove()),(n=t.textContent)!=null?n:""}function VM(e){return e.replace(/\r\n/g,`
|
|
25
|
-
`)}var KM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let i=L("Markdown",BT),s=(0,mr.useRef)(null),[a,l]=(0,mr.useState)(null),u=(0,mr.useMemo)(()=>{let y=kl(VM(e));return UT.sanitize(y).replaceAll("</code>",`${jM(i.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),c=y=>{var h;let p=y.target,g=!!((h=s.current)!=null&&h.querySelector("code"));if(["A","BUTTON"].includes(p.tagName)){l(null);return}a||g&&p.tagName!=="CODE"||!g&&p!==s.current||(p.addEventListener("mouseleave",()=>l(null),{once:!0}),l(p))},f=()=>{if(!a)return;l(null);let y=a.querySelector("button");y&&(ms(y,i.fadeup),r(Ry(a)))},d=y=>{let p=y.target;if(p.tagName==="A"){y.stopPropagation();return}"copyIcon"in p.dataset&&(ms(p,i.fadeup),r(Ry(p.parentElement)))},m=()=>{!a||!o||(l(null),o(Ry(a)))},S=y=>{if(y===null)return;let p=y.getBoundingClientRect();p.left<0?y.style.transform=`translateX(${-p.left+2}px)`:p.right>window.innerWidth&&(y.style.transform=`translateX(${window.innerWidth-p.right-2}px)`)};return(0,yn.jsxs)(mr.Fragment,{children:[a&&(0,yn.jsxs)(Cs,{triggerRef:{current:a},className:i.popover,parentNode:a,children:[(0,yn.jsxs)("div",{className:i.options,ref:S,children:[(0,yn.jsx)("button",{type:"button",className:i.option,onClick:f,children:n}),o&&(0,yn.jsxs)(mr.Fragment,{children:[(0,yn.jsx)("div",{className:i.divider}),(0,yn.jsx)("button",{type:"button",className:i.option,onClick:m,children:t})]})]}),(0,yn.jsx)("div",{className:i.arrow})]}),(0,yn.jsx)("div",{ref:s,className:i.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},jT=KM;var Ay={};Ye(Ay,{enUS:()=>WM,nlNL:()=>$M});var WM={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"}]},$M={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 VT={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l"};var Nn=w(b()),qM=({cue:e,onRemove:t,onCopy:n,onUse:r})=>{let o=L("WidgetCue",VT),i=q(Ay),s=gs(),a=z("hasKeyboardInput"),l=f=>{n&&n(f,e)},u=f=>{r&&r(f,e)},c=f=>{f.preventDefault(),f.stopPropagation(),t(e)};return(0,KT.useEffect)(()=>{s("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label,cueText:e.text})},[]),(0,Nn.jsxs)(re,{"data-testid":"cue",children:[(0,Nn.jsx)(ge,{children:(0,Nn.jsxs)(ge.Content,{children:[e.title&&(0,Nn.jsx)(ge.Title,{className:o.title,"data-testid":"widget-cue-title",children:e.title}),(0,Nn.jsx)(jT,{content:e.text,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:l,onUse:a?u:void 0})]})}),(0,Nn.jsxs)(re.ButtonsContainer,{children:[(0,Nn.jsx)(re.Button,{onClick:c,children:i("removeCue")}),(0,Nn.jsx)(ys,{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"})]})]})},WT=qM;var Pl=w(b()),GM=({cues:e})=>{let t=Q(),n=Yt(),r=gs(),o=a=>{t(iT({id:a.rule.id})),t(eT({code:a.rule.label})),r("Assistant response closed",{name:a.rule.name,group:a.rule.label,description:a.rule.description,cueText:a.text})},i=(a,l)=>{Zn(a),r("Assistant response copied",{name:l.rule.name,group:l.rule.label,description:l.rule.description,copiedText:a})},s=(a,l)=>{n.send(Xr,{text:a,suggestion:{source:"cue",sourceText:a}}),r("Assistant response used",{name:l.rule.name,group:l.rule.label,description:l.rule.description,usedText:a})};return(0,Pl.jsx)(Pl.Fragment,{children:e.map(a=>(0,Pl.jsx)(WT,{cue:a,onRemove:o,onCopy:i,onUse:s},a.rule.id))})},$T=GM;var kf=w(H());var qT={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var vn=w(b());function YM(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var GT=({data:e,schema:t})=>{let n=L("WidgetCustomData",qT),r=o=>{Zn(o)};return(0,kf.useEffect)(()=>{B.info("Custom data",e,t)},[e]),(0,vn.jsx)("dl",{className:n.root,children:t.map(o=>{let i=YM(e,o.path);return(0,vn.jsxs)(kf.Fragment,{children:[(0,vn.jsx)("dt",{className:n.label,children:o.label}),(0,vn.jsx)("dd",{className:n.value,children:o.type==="boolean"&&i?(0,vn.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!i?(0,vn.jsx)("span",{className:n.isFalse,children:o.falseValue}):i?(0,vn.jsxs)("button",{type:"button",onClick:()=>r(i),className:n.copyButton,children:[(0,vn.jsx)("span",{children:i}),(0,vn.jsx)(xl,{})]}):"-"})]},o.label)})})};var QT=w(H());var QM=/(https?:\/\/[^\s]+)/,YT=e=>e.split(" ").find(t=>QM.test(t));var en=w(b()),XM=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=YT(r),i=q(Ko),s=z("showImages"),a=z("fallbackImage"),l=z("hasKeyboardInput"),u=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},c=(0,QT.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,en.jsxs)(re,{onClick:l?u:void 0,"data-testid":"edit-suggestion",children:[(0,en.jsxs)(ge,{children:[s&&e.image&&(0,en.jsx)(ge.Image,{src:gf(e,"small",a||void 0),title:e.title}),(0,en.jsxs)(ge.Content,{children:[e.title&&(0,en.jsx)(ge.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,en.jsx)(re.Labels,{labels:e.searchKeywords}),(0,en.jsx)(ge.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,en.jsxs)(re.Actions,{children:[o&&(0,en.jsx)(re.ActionButton,{onClick:c,label:i("visitUrl")}),l&&(0,en.jsx)(re.ActionButton,{primary:!0,onClick:u,label:i("useSuggestion")})]})]})},XT=XM;var Rl=w(b()),ZM=({lines:e,suggestions:t})=>{let n=Yt(),r=(o,i)=>{n.send(Xr,{text:o,suggestion:I(T({},i),{source:i.source,sourceText:i.text})})};return(0,Rl.jsx)(Rl.Fragment,{children:t.map(o=>(0,Rl.jsx)(XT,{suggestion:o,lines:e,onUse:i=>r(i,o)},o.text||o.url||o.message))})},ZT=ZM;var Al={};Ye(Al,{enUS:()=>JM,nlNL:()=>e_});var JM={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"}]},e_={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 Ll={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",sectionList:"dd-bF9pF",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",link:"dd-DRo0x"};var $=w(b()),Pf=(e,t)=>{let n=M(at);(0,Il.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},t_=({onLogIn:e})=>{let t=L("Widget",Ll),n=z("isEmbedded"),r=z("adminUrl");return(0,$.jsx)("div",{className:t.loginText,children:(0,$.jsx)("div",{children:(0,$.jsx)(tf,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},JT=({text:e})=>{let t=L("Widget",Ll);return(0,$.jsx)("div",{className:t.stateText,children:(0,$.jsx)("div",{children:(0,$.jsx)("p",{children:e})})},"notification")},n_=()=>{let e=q(Al),t=Q(),n=L("Widget",Ll),r=z("showSearch"),o=z("showSummaryCommand"),i=z("showKnowledgeSearch"),s=M(hs("/admin/")),a=Yt(),l=z("productName"),u=z("hasKeyboardInput"),c=r||o||i||s;return Pf(()=>(t(cy()),()=>{t(QC())}),[t]),!c||!u?null:(0,$.jsx)(wn,{title:e("actions"),type:"shortcuts",children:(0,$.jsxs)("div",{className:n.shortcutList,children:[r&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-search","aria-label":e("linkSearch"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0}),children:[(0,$.jsx)(fs,{}),e("linkSearch")]}),o&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-summary","aria-label":e("linkSummary"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,$.jsx)(CT,{}),e("linkSummary")]}),i&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-knowledge-assist","aria-label":e("linkKnowledgeSearch"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,$.jsx)(bT,{}),e("linkKnowledgeSearch")]}),s&&(0,$.jsxs)("a",{className:n.shortcut,target:"_blank",href:s,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:l}),rel:"noreferrer",children:[(0,$.jsx)(ET,{}),e("linkStudioLogin",{productName:l})]})]})})},r_=()=>{let e=Q(),t=z("showCustomMessages"),n=M(BC),r=M(os);return Pf(()=>(e(wl(r)),e($C(r)),()=>{e(qC(r))}),[e,t,r]),!t||n.length===0?null:(0,$.jsx)(wn,{type:"custom-messages","data-testid":"custom-messages",children:(0,$.jsx)(St,{withDivider:!0,children:n.map(o=>(0,$.jsx)(ST,{suggestion:o},o.text))})})},o_=()=>{let e=q(Al),t=Q(),n=z("showAutoflows"),r=M(DC),o=M(os);return Pf(()=>(t(fr(o)),t(FC(o)),()=>{t(HC(o))}),[t,n,o]),!n||r.length===0?null:(0,$.jsx)(wn,{type:"autoflows",title:e("titleAutoflows"),"data-testid":"autoflows",children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(yT,{})})})},i_=()=>{let e=Q(),t=M(Kd),n=M(xb),r=M(aT),o=M(W1),i=M(jd),s=M(Wd),a=M(sr),l=M(Yr);return(0,Il.useEffect)(()=>{!!o&&!n&&B.warn("Custom data provided, but no schema.")},[o,n]),Pf(()=>{t.forEach(({type:u})=>{u==="entities"?e(pn()):su.includes(u)||e(gn(u))})},[e,l,a]),(0,$.jsx)(Il.Fragment,{children:t.map(({type:u,title:c,amount:f,lines:d,schema:m})=>{var S,y;switch(u){case"entities":return i&&i.length>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(xT,{entities:i})},u);case"cues":return r&&r.length>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)($T,{cues:r})})},u);case"custom-data":return o&&m&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(GT,{data:o,schema:m})})},u);default:return((y=(S=s[u])==null?void 0:S.suggestions)==null?void 0:y.length)>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(ZT,{lines:d,contentType:u,suggestions:s[u].suggestions.slice(0,f)||[]})})},u)}})})},s_=({onLogIn:e})=>{let t=q(Al),n=L("Widget",Ll),r=M(is),o=M(at),i=M(os),s=M(sr);return r===!1?(0,$.jsx)(JT,{text:t("notSupported")}):o===!1?(0,$.jsx)(t_,{onLogIn:e}):!s||!i||o===null?(0,$.jsx)(JT,{text:t("waiting")}):(0,$.jsx)("div",{className:(0,ek.default)(n.root),"data-testid":"widget",children:(0,$.jsxs)(ru,{className:n.sectionList,children:[(0,$.jsx)(n_,{}),(0,$.jsx)(r_,{}),(0,$.jsx)(o_,{}),(0,$.jsx)(i_,{})]})})},tk=s_;function Ts(e){let t=new Range;return t.selectNodeContents(e),t}function nk(e,t,n){try{return ao(e,t,n),!0}catch(r){return!1}}function Rf(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function Af(e){return"tagName"in e&&e.tagName==="BR"}var Ol=/[\u200B-\u200D\uFEFF]/g;function ao(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,i=!1;function s(l,u){let c=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return u;for(let d=0;d<=l.length;d++)if(f.test(l[d])||c++,c===u)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(Ol,""),f=o+c.length,d=t>=o&&t<=f,m=n>=o&&n<=f;if(d){let S=s(u,t-o);S===0&&!m?r.setStartBefore(l):r.setStart(l,S)}m&&(r.setEnd(l,s(u,n-o)),i=!0),o=f;break}case Node.ELEMENT_NODE:{if(Af(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!i);c++);let u=l.lastChild;Rf(l)&&u&&!Rf(u)&&!Af(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}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:i,collapsed:s}=t,a,l,u=0;function c(f){let d=f===e,m=f===n,S=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let y=f.textContent;m&&(a=u+y.substring(0,r).replace(Ol,"").length),S&&(l=u+y.substring(0,i).replace(Ol,"").length),u+=y.replace(Ol,"").length;break}case Node.ELEMENT_NODE:{if(Af(f)&&f.nextSibling){u++;break}!d&&Rf(f)&&f.previousSibling&&u++;for(let y=0;y<f.childNodes.length;y++){let p=m&&y===r,g=S&&y===i;if(p&&(a=u),g&&(l=u),l!==void 0||((!p||!s)&&c(f.childNodes[y]),S&&y===i-1&&(l=u),l!==void 0))break}S&&(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 Ml(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i,collapsed:s}=t,a=0,l="";function u(c){let f=c===e,d=c===n,m=c===o;switch(d&&(a=1),c.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let S=d?r:0,y=m?i:void 0;l+=c.textContent.replace(Ol,"").substring(S,y);break}case Node.ELEMENT_NODE:{if(!s&&a===1&&Af(c)&&c.nextSibling){l+=`
|
|
25
|
+
`)}function KM(e){return e.replace(new RegExp("(?<!\\]\\()(https?:\\/\\/[^\\s]+)","g"),"[$1]($1)")}var WM=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let i=L("Markdown",BT),s=(0,mr.useRef)(null),[a,l]=(0,mr.useState)(null),u=(0,mr.useMemo)(()=>{let y=kl(KM(VM(e)));return UT.sanitize(y).replaceAll("</code>",`${jM(i.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),c=y=>{var h;let p=y.target,g=!!((h=s.current)!=null&&h.querySelector("code"));if(["A","BUTTON"].includes(p.tagName)){l(null);return}a||g&&p.tagName!=="CODE"||!g&&p!==s.current||(p.addEventListener("mouseleave",()=>l(null),{once:!0}),l(p))},f=()=>{if(!a)return;l(null);let y=a.querySelector("button");y&&(ms(y,i.fadeup),r(Ry(a)))},d=y=>{let p=y.target;if(p.tagName==="A"){y.stopPropagation();return}"copyIcon"in p.dataset&&(ms(p,i.fadeup),r(Ry(p.parentElement)))},m=()=>{!a||!o||(l(null),o(Ry(a)))},S=y=>{if(y===null)return;let p=y.getBoundingClientRect();p.left<0?y.style.transform=`translateX(${-p.left+2}px)`:p.right>window.innerWidth&&(y.style.transform=`translateX(${window.innerWidth-p.right-2}px)`)};return(0,yn.jsxs)(mr.Fragment,{children:[a&&(0,yn.jsxs)(Cs,{triggerRef:{current:a},className:i.popover,parentNode:a,children:[(0,yn.jsxs)("div",{className:i.options,ref:S,children:[(0,yn.jsx)("button",{type:"button",className:i.option,onClick:f,children:n}),o&&(0,yn.jsxs)(mr.Fragment,{children:[(0,yn.jsx)("div",{className:i.divider}),(0,yn.jsx)("button",{type:"button",className:i.option,onClick:m,children:t})]})]}),(0,yn.jsx)("div",{className:i.arrow})]}),(0,yn.jsx)("div",{ref:s,className:i.root,dangerouslySetInnerHTML:{__html:u},onMouseOver:c,onClick:d})]})},jT=WM;var Ay={};Ye(Ay,{enUS:()=>$M,nlNL:()=>qM});var $M={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"}]},qM={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 VT={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l"};var Nn=w(b()),GM=({cue:e,onRemove:t,onCopy:n,onUse:r})=>{let o=L("WidgetCue",VT),i=q(Ay),s=gs(),a=z("hasKeyboardInput"),l=f=>{n&&n(f,e)},u=f=>{r&&r(f,e)},c=f=>{f.preventDefault(),f.stopPropagation(),t(e)};return(0,KT.useEffect)(()=>{s("Assistant response displayed",{name:e.rule.name,description:e.rule.description,group:e.rule.label,cueText:e.text})},[]),(0,Nn.jsxs)(re,{"data-testid":"cue",children:[(0,Nn.jsx)(ge,{children:(0,Nn.jsxs)(ge.Content,{children:[e.title&&(0,Nn.jsx)(ge.Title,{className:o.title,"data-testid":"widget-cue-title",children:e.title}),(0,Nn.jsx)(jT,{content:e.text,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:l,onUse:a?u:void 0})]})}),(0,Nn.jsxs)(re.ButtonsContainer,{children:[(0,Nn.jsx)(re.Button,{onClick:c,children:i("removeCue")}),(0,Nn.jsx)(ys,{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"})]})]})},WT=GM;var Pl=w(b()),YM=({cues:e})=>{let t=Q(),n=Yt(),r=gs(),o=a=>{t(iT({id:a.rule.id})),t(eT({code:a.rule.label})),r("Assistant response closed",{name:a.rule.name,group:a.rule.label,description:a.rule.description,cueText:a.text})},i=(a,l)=>{Zn(a),r("Assistant response copied",{name:l.rule.name,group:l.rule.label,description:l.rule.description,copiedText:a})},s=(a,l)=>{n.send(Xr,{text:a,suggestion:{source:"cue",sourceText:a}}),r("Assistant response used",{name:l.rule.name,group:l.rule.label,description:l.rule.description,usedText:a})};return(0,Pl.jsx)(Pl.Fragment,{children:e.map(a=>(0,Pl.jsx)(WT,{cue:a,onRemove:o,onCopy:i,onUse:s},a.rule.id))})},$T=YM;var kf=w(H());var qT={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var vn=w(b());function QM(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var GT=({data:e,schema:t})=>{let n=L("WidgetCustomData",qT),r=o=>{Zn(o)};return(0,kf.useEffect)(()=>{B.info("Custom data",e,t)},[e]),(0,vn.jsx)("dl",{className:n.root,children:t.map(o=>{let i=QM(e,o.path);return(0,vn.jsxs)(kf.Fragment,{children:[(0,vn.jsx)("dt",{className:n.label,children:o.label}),(0,vn.jsx)("dd",{className:n.value,children:o.type==="boolean"&&i?(0,vn.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!i?(0,vn.jsx)("span",{className:n.isFalse,children:o.falseValue}):i?(0,vn.jsxs)("button",{type:"button",onClick:()=>r(i),className:n.copyButton,children:[(0,vn.jsx)("span",{children:i}),(0,vn.jsx)(xl,{})]}):"-"})]},o.label)})})};var QT=w(H());var XM=/(https?:\/\/[^\s]+)/,YT=e=>e.split(" ").find(t=>XM.test(t));var en=w(b()),ZM=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=YT(r),i=q(Ko),s=z("showImages"),a=z("fallbackImage"),l=z("hasKeyboardInput"),u=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},c=(0,QT.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,en.jsxs)(re,{onClick:l?u:void 0,"data-testid":"edit-suggestion",children:[(0,en.jsxs)(ge,{children:[s&&e.image&&(0,en.jsx)(ge.Image,{src:gf(e,"small",a||void 0),title:e.title}),(0,en.jsxs)(ge.Content,{children:[e.title&&(0,en.jsx)(ge.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,en.jsx)(re.Labels,{labels:e.searchKeywords}),(0,en.jsx)(ge.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,en.jsxs)(re.Actions,{children:[o&&(0,en.jsx)(re.ActionButton,{onClick:c,label:i("visitUrl")}),l&&(0,en.jsx)(re.ActionButton,{primary:!0,onClick:u,label:i("useSuggestion")})]})]})},XT=ZM;var Rl=w(b()),JM=({lines:e,suggestions:t})=>{let n=Yt(),r=(o,i)=>{n.send(Xr,{text:o,suggestion:I(T({},i),{source:i.source,sourceText:i.text})})};return(0,Rl.jsx)(Rl.Fragment,{children:t.map(o=>(0,Rl.jsx)(XT,{suggestion:o,lines:e,onUse:i=>r(i,o)},o.text||o.url||o.message))})},ZT=JM;var Al={};Ye(Al,{enUS:()=>e_,nlNL:()=>t_});var e_={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"}]},t_={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 Ll={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",sectionList:"dd-bF9pF",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",link:"dd-DRo0x"};var $=w(b()),Pf=(e,t)=>{let n=M(at);(0,Il.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},n_=({onLogIn:e})=>{let t=L("Widget",Ll),n=z("isEmbedded"),r=z("adminUrl");return(0,$.jsx)("div",{className:t.loginText,children:(0,$.jsx)("div",{children:(0,$.jsx)(tf,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},JT=({text:e})=>{let t=L("Widget",Ll);return(0,$.jsx)("div",{className:t.stateText,children:(0,$.jsx)("div",{children:(0,$.jsx)("p",{children:e})})},"notification")},r_=()=>{let e=q(Al),t=Q(),n=L("Widget",Ll),r=z("showSearch"),o=z("showSummaryCommand"),i=z("showKnowledgeSearch"),s=M(hs("/admin/")),a=Yt(),l=z("productName"),u=z("hasKeyboardInput"),c=r||o||i||s;return Pf(()=>(t(cy()),()=>{t(QC())}),[t]),!c||!u?null:(0,$.jsx)(wn,{title:e("actions"),type:"shortcuts",children:(0,$.jsxs)("div",{className:n.shortcutList,children:[r&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-search","aria-label":e("linkSearch"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0}),children:[(0,$.jsx)(fs,{}),e("linkSearch")]}),o&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-summary","aria-label":e("linkSummary"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0,page:"summary"}),children:[(0,$.jsx)(CT,{}),e("linkSummary")]}),i&&(0,$.jsxs)("button",{type:"button",className:n.shortcut,"data-testid":"shortcut-knowledge-assist","aria-label":e("linkKnowledgeSearch"),onClick:()=>a.send("ShowCommandPalette",{isOpen:!0,page:"knowledgeAssist"}),children:[(0,$.jsx)(bT,{}),e("linkKnowledgeSearch")]}),s&&(0,$.jsxs)("a",{className:n.shortcut,target:"_blank",href:s,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:l}),rel:"noreferrer",children:[(0,$.jsx)(ET,{}),e("linkStudioLogin",{productName:l})]})]})})},o_=()=>{let e=Q(),t=z("showCustomMessages"),n=M(BC),r=M(os);return Pf(()=>(e(wl(r)),e($C(r)),()=>{e(qC(r))}),[e,t,r]),!t||n.length===0?null:(0,$.jsx)(wn,{type:"custom-messages","data-testid":"custom-messages",children:(0,$.jsx)(St,{withDivider:!0,children:n.map(o=>(0,$.jsx)(ST,{suggestion:o},o.text))})})},i_=()=>{let e=q(Al),t=Q(),n=z("showAutoflows"),r=M(DC),o=M(os);return Pf(()=>(t(fr(o)),t(FC(o)),()=>{t(HC(o))}),[t,n,o]),!n||r.length===0?null:(0,$.jsx)(wn,{type:"autoflows",title:e("titleAutoflows"),"data-testid":"autoflows",children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(yT,{})})})},s_=()=>{let e=Q(),t=M(Kd),n=M(xb),r=M(aT),o=M(W1),i=M(jd),s=M(Wd),a=M(sr),l=M(Yr);return(0,Il.useEffect)(()=>{!!o&&!n&&B.warn("Custom data provided, but no schema.")},[o,n]),Pf(()=>{t.forEach(({type:u})=>{u==="entities"?e(pn()):su.includes(u)||e(gn(u))})},[e,l,a]),(0,$.jsx)(Il.Fragment,{children:t.map(({type:u,title:c,amount:f,lines:d,schema:m})=>{var S,y;switch(u){case"entities":return i&&i.length>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(xT,{entities:i})},u);case"cues":return r&&r.length>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)($T,{cues:r})})},u);case"custom-data":return o&&m&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(GT,{data:o,schema:m})})},u);default:return((y=(S=s[u])==null?void 0:S.suggestions)==null?void 0:y.length)>0&&(0,$.jsx)(wn,{type:u,title:c,"data-testid":`type-${u}`,children:(0,$.jsx)(St,{withDivider:!0,children:(0,$.jsx)(ZT,{lines:d,contentType:u,suggestions:s[u].suggestions.slice(0,f)||[]})})},u)}})})},a_=({onLogIn:e})=>{let t=q(Al),n=L("Widget",Ll),r=M(is),o=M(at),i=M(os),s=M(sr);return r===!1?(0,$.jsx)(JT,{text:t("notSupported")}):o===!1?(0,$.jsx)(n_,{onLogIn:e}):!s||!i||o===null?(0,$.jsx)(JT,{text:t("waiting")}):(0,$.jsx)("div",{className:(0,ek.default)(n.root),"data-testid":"widget",children:(0,$.jsxs)(ru,{className:n.sectionList,children:[(0,$.jsx)(r_,{}),(0,$.jsx)(o_,{}),(0,$.jsx)(i_,{}),(0,$.jsx)(s_,{})]})})},tk=a_;function Ts(e){let t=new Range;return t.selectNodeContents(e),t}function nk(e,t,n){try{return ao(e,t,n),!0}catch(r){return!1}}function Rf(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function Af(e){return"tagName"in e&&e.tagName==="BR"}var Ol=/[\u200B-\u200D\uFEFF]/g;function ao(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,i=!1;function s(l,u){let c=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return u;for(let d=0;d<=l.length;d++)if(f.test(l[d])||c++,c===u)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let u=l.textContent,c=u.replace(Ol,""),f=o+c.length,d=t>=o&&t<=f,m=n>=o&&n<=f;if(d){let S=s(u,t-o);S===0&&!m?r.setStartBefore(l):r.setStart(l,S)}m&&(r.setEnd(l,s(u,n-o)),i=!0),o=f;break}case Node.ELEMENT_NODE:{if(Af(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let c=0;c<l.childNodes.length&&(a(l.childNodes[c]),!i);c++);let u=l.lastChild;Rf(l)&&u&&!Rf(u)&&!Af(u)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}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:i,collapsed:s}=t,a,l,u=0;function c(f){let d=f===e,m=f===n,S=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let y=f.textContent;m&&(a=u+y.substring(0,r).replace(Ol,"").length),S&&(l=u+y.substring(0,i).replace(Ol,"").length),u+=y.replace(Ol,"").length;break}case Node.ELEMENT_NODE:{if(Af(f)&&f.nextSibling){u++;break}!d&&Rf(f)&&f.previousSibling&&u++;for(let y=0;y<f.childNodes.length;y++){let p=m&&y===r,g=S&&y===i;if(p&&(a=u),g&&(l=u),l!==void 0||((!p||!s)&&c(f.childNodes[y]),S&&y===i-1&&(l=u),l!==void 0))break}S&&(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 Ml(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:i,collapsed:s}=t,a=0,l="";function u(c){let f=c===e,d=c===n,m=c===o;switch(d&&(a=1),c.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let S=d?r:0,y=m?i:void 0;l+=c.textContent.replace(Ol,"").substring(S,y);break}case Node.ELEMENT_NODE:{if(!s&&a===1&&Af(c)&&c.nextSibling){l+=`
|
|
26
26
|
`;break}!f&&!s&&a===1&&Rf(c)&&c.previousSibling&&(l+=`
|
|
27
|
-
`);let S=d?r:0,y=m?Math.min(i,c.childNodes.length):c.childNodes.length;for(let p=S;p<y&&(u(c.childNodes[p]),a!==2);p++);break}default:break}m&&(a=2)}return u(e),l}var rk=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(rk||{}),gr=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 i=this.getCaretPosition();Gr(i,this.cachedCaretPosition)||(this.cachedCaretPosition=i,this.emit("caretposition",i))}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(rk).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 ok(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Jo=class extends gr{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),Ml(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){var s;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?(s=r.getComposedRanges(n))==null?void 0:s[0]:r.rangeCount>0?r.getRangeAt(0):null;if(!o)return null;let i=this.element.ownerDocument.createRange();return i.setStart(o==null?void 0:o.startContainer,o==null?void 0:o.startOffset),i.setEnd(o==null?void 0:o.endContainer,o==null?void 0:o.endOffset),!i||!this.element.contains(i.startContainer)||!this.element.contains(i.endContainer)?null:i}getCaretPosition(){let n=this.getRange();if(!n||!n.collapsed||!("getBoundingClientRect"in n))return null;let r=n.getBoundingClientRect();return!ok(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!ok(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return Nl(this.element,n);let r=this.lastKnownSelection;if(r&&nk(this.element,r.start,r.end))return r;let o=Ts(this.element);return o.collapse(!1),Nl(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return Ml(this.element,ao(this.element,n,r))}listen(){super.listen();let n=new MutationObserver(i=>{var s,a;i.length===2&&i[0].addedNodes.length===1&&((s=i[0].addedNodes[0])==null?void 0:s.textContent)==="\u2060"&&((a=i[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 ei=class extends gr{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 null}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var i;return(i=n==null?void 0:n.get)==null?void 0:i.call(this.element)},set:i=>{var s;(s=n==null?void 0:n.set)==null||s.call(this.element,i),this.handleInteraction()}});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 ik(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let i=document.createElement("iframe"),s=new URL(t);return Object.entries(n).forEach(([a,l])=>{s.searchParams.append(a,l)}),i.style.position="absolute",i.style.left="-999em",i.style.width="0px",i.style.height="0px",i.tabIndex=-1,i.id=r,i.title=`iframe-${e}`,i.src=s.toString(),window.document.body.appendChild(i),i}function a_(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()}},Iy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=ik(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()}},Oy=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(),B.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 Iy(t,this.deepdeskUrl,{debug:!0}):new Ly(t),r=o=>{var s,a;if(o.origin!==this.deepdeskUrl)return;let i=a_(o.data);typeof i!="object"||i.type!=="event"||i.channel!==t||(B.info("Received broadcast event",this.sessionId,o),(a=(s=this.eventMap)[i.name])==null||a.call(s,i.payload))};return n.onMessage(r),n}send(t,n,r){var s,a;B.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(s=this.eventMap)[t])==null||a.call(s,n));let i=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;i==null||i.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)}},sk=Oy;var ks=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var Ny=e=>new Promise(t=>{setTimeout(t,e)});var Ps=class extends ks{constructor(){super(...arguments);this.name="ClientError"}},_y=class extends ks{constructor(){super(...arguments);this.name="ServerError"}},My=new Map;function l_(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:(B.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var lo=class lo{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 i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",C=n,{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:m=!0,retryOnError:S=R=>R instanceof TypeError,retryOnResponse:y=R=>R.status>=500,version:p=null}=C,g=te(C,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(u)if(l){if(My.has(s)){r(My.get(s));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h=I(T({credentials:"include"},g),{headers:T({Accept:"application/json","Content-Type":"application/json"},g.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 v=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&c&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let k=()=>P(this,null,function*(){return v--,a(s,h).then(R=>P(this,null,function*(){return y(R)&&!i.isAborted&&v>0?(yield Ny(d),k()):R.status===401&&m===!0&&x===!1?(x=!0,yield this.refreshToken(),k()):R})).catch(R=>P(this,null,function*(){if(S(R)&&!i.isAborted&&v>0)return yield Ny(d),k();throw R}))});k().then(R=>P(this,null,function*(){let N=yield l_(R);if(delete this.latestRequestByUrl[s],R.status>=500){o(new _y("Server Error",N));return}else if(R.status===401){o(new Ps("Unauthorized",N));return}else if(R.status===403){o(new Ps("Forbidden",N));return}else if(R.status===404){o(new Ps("Not Found",N));return}else if(R.status>=400){o(new Ps("Bad Request",N));return}u&&My.set(s,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 lo.refreshingToken||(lo.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{lo.refreshingToken=null},1e3*60)})),lo.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))}};lo.refreshingToken=null;var hr=lo;var ak;(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={}))})(ak||(ak={}));function Lf(e){return I(T({},ee(e)),{tags:e.tags})}var ti=class ti{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new hr(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,i)=>P(this,null,function*(){let s=yield r(o,i);return this.handleDeepdeskVersionHeaders(s),s}))}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?(ti.exchangeTokenPromise||(ti.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),ti.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return P(this,null,function*(){yield this.preflight(),B.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=yield this.client.post("/api/conversations",I(T({},Ie(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 ee(t)})}patchMe(t){return P(this,null,function*(){let n=yield this.client.patch("/apis/admin/session/me/",Ie(t));return ee(n)})}getProfile(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return ee(n)})}getKnowledgeAssistant(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return ee(n)})}getContentTypes(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return ee(t)})}getAccount(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return ee(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 ee(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(),B.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:i=1e3}=n,s=yield this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return B.info(`Successfully retrieved conversation ${s.id} for session ${t}`),Lf(s)})}isConversationSupported(r){return P(this,arguments,function*(t,n={}){B.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:i=1e3}=n;return(yield this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"})).has_active_profile})}updateConversation(t,n){return P(this,null,function*(){let r=Ie(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({},Ie(o)),{tags:o.tags})),{version:"v2"})).map(o=>Lf(o))})}sendEvent(t,n){return P(this,null,function*(){let s=n,{data:r}=s,o=te(s,["data"]),i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((a,[l,u])=>I(T({},a),{[l]:u}),{});return this.client.post("/api/events",Ie(I(T(T({},i),o),{data:r,name:t})),{version:"v2"})})}sendEventV1(t,n){return P(this,null,function*(){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>I(T({},o),{[i]:s}),{});return this.client.post("/api/events",{event:t,data:Ie(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})}getSummary(r){return P(this,arguments,function*(t,n={}){let o=yield this.client.post("/api/summary",{conversation:{messages:t.filter(i=>i.text&&i.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model},{version:"v1"});return ee(o)})}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 B.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/",Ie(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}`,Ie(n),{abortLatest:!0,version:"v1"})).map(s=>I(T({},ee(s)),{text:s.text||s.url||s.message,source:r,type:r})).filter((s,a,l)=>a===l.findIndex(u=>u.text===s.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`,Ie(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,i,s)=>i===s.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 ee(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",Ie(t),{abortLatest:!0,version:"v1"});return ee(n)})}search(t){return P(this,null,function*(){let n=yield this.client.post(`/api/profiles/${t.profile}/search`,Ie(t),{version:"v2"});return ee(n)})}knowledgeAssist(i,s,a){return P(this,arguments,function*(t,n,r,o={}){let l=yield this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Ie({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 ee(l)})}requestLoginByEmail(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return ee(n)})}requestPasswordlessToken(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return ee(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 ee(n)})}evaluateRule(i,s,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?ee(u.cues):[]})}evaluateAssistant(t,n,r){return P(this,null,function*(){let o=new URLSearchParams;o.append("enforce_cues_schema","true"),r!=null&&r.conversationId&&o.append("conversation_id",r==null?void 0:r.conversationId);let i=yield this.client.post(`/api/v2/assistants/${t}/evaluate?${o.toString()}`,{input:n});return ee(i.output)})}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 ee(n)})}translateMessages(t){return P(this,null,function*(){let n=yield this.client.post("/api/translate",Ie(t),{version:"v2"});return ee(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(t0);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&B.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};ti.exchangeTokenPromise=null;var yr=ti;var _l=class{constructor(t,n){this.url=t;this.eventListeners={};this.options=T({timeout:25e3},n)}proxyEvent(t){this.eventSource.addEventListener(rh(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,ee(o))}catch(o){B.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 lk;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||(t.AutoflowSessionState={}))})(lk||(lk={}));var Dl=class{constructor(t,n={}){this.apiUrl=t;this.streams={};this.logger=B;this.client=new hr(t,n)}getCustomMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/suggestions`);return ee(n.suggestions)})}sendCustomMessage(t,n){return P(this,null,function*(){let r=yield this.client.post(`/sessions/${t}/messages`,Ie(n));return ee(r)})}answerCustomMessage(t,n){return P(this,null,function*(){yield this.client.post(`/sessions/${t}/answers`,Ie(n))})}getAutoflows(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/autoflows`);return ee(n.autoflows)})}startAutoflowSession(t){return P(this,null,function*(){let n=yield this.client.post("/autoflow-sessions",Ie(t));return ee(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 _l(`${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 uk={startTime:null,stopTime:null},ck=Y({name:"handlingTime",initialState:uk,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(ce,()=>uk)}}),{handlingTimeStart:dk,handlingTimeStop:If,handlingTimeReset:fk}=ck.actions,pk=ck.reducer;var mk=(e={})=>{let t=T({onAuthError:rs(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var Of={list:{keywordMatches:[]},fetchState:"idle"};var ni=K("styleSuggestions/getAll",(n,r)=>P(void 0,[n,r],function*({text:e},t){var l;let{deepdeskAPI:o}=t.extra,i=t.getState(),{showStyleSuggestions:s}=i.settings,a=(l=i.conversation.current)==null?void 0:l.profileCode;if(!s)return Of.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),u_=Y({name:"styleSuggestions",initialState:Of,reducers:{},extraReducers:e=>{e.addCase(ni.pending,t=>{t.fetchState="loading"}).addCase(ni.rejected,t=>{t.fetchState="error"}).addCase(ni.fulfilled,(t,n)=>{t.fetchState="done",Gr(t.list,n.payload)||(t.list=n.payload)}).addCase(Oo,t=>{t.list=Of.list}).addCase(ce,()=>Of)}}),gk=u_.reducer;var hk=(e={})=>{let t,n=!0,r=T({getStyleSuggestions:ni,debounce:500},e);return o=>i=>s=>{var m;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((m=u.conversation.current)==null?void 0:m.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 c_(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var yk=(e={})=>{let t=T({getTextSuggestions:gn,getAutocompleteSuggestions:ml,debounce:200,check:Ln},e),n;return r=>o=>i=>{var y;let{input:s}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(y=l.conversation.current)==null?void 0:y.id,d=i.type===$d.toString();if(!f||!u&&!c)return a;let{input:m}=l;return c_(m,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=ss(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var vk=ni.fulfilled.toString();function d_(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var Sk=e=>t=>n=>r=>{var u;if(r.type!==vk){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=d_(o,s);r.type===vk&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var f_=kc({assistants:tT,answer:vb,auth:x1,autoflows:UC,conversation:I1,contentTypes:RE,customMessages:GC,passwordlessToken:XC,entities:JE,knowledgeAssistant:gb,handlingTime:pk,info:Q1,input:V1,settings:m1,profile:Eb,search:rE,summary:sb,styleSuggestions:gk,ui:Xb,rules:sT,textSuggestions:Lb});function wk(e){return wx({reducer:f_,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),mk(),yk({debounce:200}),hk({debounce:500}),Sk(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var p_=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},m_=e=>t=>n=>r=>{var a,l,u,c,f,d;let o=t.getState(),i=Xg("inlineSuggestions")(o);switch(r.type){case rs.toString():{!r.payload&&e.emit("logout",void 0);break}case pn.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 lt.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 Oo.toString():e.logSendMessage(r.payload);break;case Qo.fulfilled.toString():r.isBroadcasted||e.broadcast(sh,r,!1),(c=r.payload.options)!=null&&c.shouldEmit&&e.emit("cues",r.payload.cues);break;case Yo.fulfilled.toString():r.isBroadcasted||e.broadcast(ah,r,!1);break;default:break}let s=n(r);switch(r.type){case Oo.toString():e.handleAfterSendMessage(r.payload);break;case hl.toString():e.onUpdateShowTabHint(r.payload);break;case If.toString():e.logHandlingTime();break;case"analytics/logEvent/fulfilled":{e.emit("event",r.meta.arg);break}case ad.toString():{let{start:m,end:S}=o.input.selection;e.emit("replace",I(T({},r.payload),{replace:r.payload.replace==="selection"?{start:m,end:S}:{start:0,end:S}}));break}case an.toString():{let{start:m,end:S}=o.input.selection;e.emit("select-suggestion",I(T({type:p_(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:m,end:S}:{start:0,end:S}})),i&&t.dispatch(Qr([]));break}case ld.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():{i&&r.payload.length>0&&t.dispatch(ud(0));break}case rr.fulfilled.toString():{e.sendEvent("conversation summarized",{conversationId:(d=o.conversation.current)==null?void 0:d.id,data:{summary:r.payload.summary,model:t.getState().summary.model}});break}default:break}return s},xk=m_;function Dy(e){return e.toISOString().replace("T"," ").replace("Z","")}function Ek(e,t){var i,s,a,l;let n=(i=e.conversation.current)==null?void 0:i.id;if(!n)return B.warn("No conversationId for handling time metrics"),null;let{startTime:r,stopTime:o}=e.handlingTime;return!r||!o?(B.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:n,clientVersion:t.version,agentId:(s=e.info.agentInfo)==null?void 0:s.agentId,agentName:(a=e.info.agentInfo)==null?void 0:a.agentName,agentEmail:(l=e.info.agentInfo)==null?void 0:l.agentEmail,timeStart:Dy(r),timeStop:Dy(o)}}function bk(e,t,n){var N,_,D,G;let r=(N=t.conversation.current)==null?void 0:N.id;if(!r)return B.warn("No conversationId for send message metrics"),null;let{text:o,metrics:{numCharsTyped:i,numCharsPasted:s,numCharsCut:a,numCharsDeleted:l,numPaste:u,agentStartedTypingTimestamp:c,externalTimeTotalSeconds:f,pastes:d,cuts:m,deletions:S,textSuggestions:y,offeredTextSuggestions:p}}=t[e],g=o.length,v=y.reduce((Z,{text:ie,searchTerm:vr})=>Z+ie.length-(vr?vr.length:0),0),x=c!=null?c:Date.now(),k=(Date.now()-x)/1e3+(f||0),C=i/k,R=y.reduce((Z,{searchTerm:ie})=>Z+(ie?ie.length:0),0);return{conversationId:r,source:"agent",text:o,clientVersion:n.version,pastes:d,cuts:m,deletions:S,lenTextTyped:i+R,lenTextTotal:g,lenTextAssisted:v,lenTextPasted:s,lenTextCut:a,lenTextDeleted:l,timeTotalSeconds:k,charsPerSecond:C,numPastes:u,textSuggestionsV2:y,suggestionsCounters:[{source:"gpt",countOffered:p.filter(Z=>Z.source==="gpt").length}],agentId:(_=t.info.agentInfo)==null?void 0:_.agentId,agentName:(D=t.info.agentInfo)==null?void 0:D.agentName,agentEmail:(G=t.info.agentInfo)==null?void 0:G.agentEmail}}function Fy(e,t){var i;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return Fy(r,t);let o=(i=e.ownerDocument.defaultView)==null?void 0:i.frameElement;return o?Fy(o,t):null}function Ck(e,t){return Fy(e,t)}function Tk(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function g_(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Nf(e){return g_(e)&&(oo(e)||rf(e))}var Pk,Mn=new Map,h_=["bottom","height","left","right","top","width"],kk=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:h_.some(n=>e[n]!==t[n]);function Rk(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,...Rk(t)]:[]}function Ak(e,t){return!e||!t?null:I(T({},e),{top:e.top+t.top,left:e.left+t.left})}var Mf=!1,Lk=()=>{Mf=!0;let e=[];if(Mn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),Mn.delete(n);return}let r=n.getBoundingClientRect();kk(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(Ak,t.rect):t.rect;kk(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),Mn.size===0){Mf=!1;return}Pk=window.requestAnimationFrame(Lk)};function Hy(e,t){let n=Rk(e),r=[],o=n.map((i,s)=>Hy(i,a=>{r[s]=a;let l=Mn.get(e);if(!l)return;let u=r.reduce(Ak,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(i=!0){if(o.forEach(s=>s.observe(!1)),Mn.has(e)){let s=Mn.get(e);s.callbacks.push(t),s.rect&&t(s.rect)}else Mn.set(e,{rect:void 0,callbacks:[t],parentRects:r});i&&!Mf&&Lk()},unobserve(){o.forEach(s=>s.unobserve());let i=Mn.get(e);if(i){let s=i.callbacks.indexOf(t);s>=0&&i.callbacks.splice(s,1),i.callbacks.length||Mn.delete(e),Mn.size||(cancelAnimationFrame(Pk),Mf=!1)}}}}var Ik,_n=new Map,Ok=()=>{_n.forEach((e,t)=>{if(!t.isConnected){_n.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(i=>i(e.visible)))}),_n.size!==0&&(Ik=window.requestAnimationFrame(Ok))};function Nk(e,t){return{observe(){let n=_n.size===0;_n.has(e)?_n.get(e).callbacks.push(t):_n.set(e,{visible:void 0,callbacks:[t]}),n&&Ok()},unobserve(){let n=_n.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||_n.delete(e),_n.size||cancelAnimationFrame(Ik)}}}}var Uy=["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 zy(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function Rs(e){return parseFloat(e)}function _f(e){return Math.round(e*1e6)}function Mk(e){return e/1e6}function By(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=Rs(e.width),i=Rs(e.borderLeftWidth),s=Rs(e.borderRightWidth),a=Rs(e.paddingRight),l=Mk(_f(o)-_f(i)-_f(s)),u=Mk(_f(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function Fl(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",$o(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};zy(r,n,Uy),By(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=Nk(e,()=>{zy(r,n,Uy),By(r,e,n),i(),setTimeout(i,0)}),a,l=!0,u=Hy(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(zy(r,n,Uy),By(r,e,n),i(),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let m=t.closestScrollElement.getBoundingClientRect(),S=window.getComputedStyle(t.closestScrollElement),y=Rs(S.borderTopWidth),p=Rs(S.borderBottomWidth),g=m.top+y-d.top,h=d.top+d.height+-(m.top+m.height-p);n.style.clipPath=`inset(${g}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(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),u.unobserve(),s.unobserve()}]}var _k=(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){B.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function y_(e){return e.offsetParent!==null}function Dk(e){if(!y_(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 Df(e,t,n=100){let r=Dk(e);t({isVisible:r});let o=setInterval(()=>{let i=Dk(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Fe=w(b());var Fk=_k("showTabHint",!0),As=class As{constructor({deepdeskUrl:t,brokerUrl:n,version:r=As.version||"unknown",locale:o="en-US",token:i,fetch:s,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 yr(u,{token:i,fetch:s}),this.version=r,this.instanceId=As.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[xk({broadcast:(f,d,m)=>{this.broadcastEvents.send(f,d,m)},emit:(f,d)=>this.emit(f,d),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>Fk.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new Dl(n)}),this.store=wk(c),this.broadcastEvents=new sk({debug:!0,deepdeskUrl:u,eventMap:oE(this.store),createCustomChannel:l}),this.store.dispatch(hl(Fk.value())),this.store.dispatch(td({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?(B.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(B.warn("Profile has not been loaded (yet)"),!0):(B.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(rs(null)),this.store.dispatch(Qn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();at(r)&&g1(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return P(this,null,function*(){return(yield this.store.dispatch(Qn())).payload})}isConversationSupported(t,n){return P(this,null,function*(){return(yield this.store.dispatch(eh({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(rd(t))).payload})}getConversationBySessionId(t,n){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(yield this.store.dispatch(od({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(th(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(id(t))).payload})}resetConversation(){this.store.dispatch(ce()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}getSummary(){return P(this,null,function*(){let t=yield this.store.dispatch(rr());if(t.error)throw new Error(t.error.message);return t.payload.summary})}configure(t){this.store.dispatch(td(t))}setVisitorInfo(t){this.store.dispatch(q1(t))}setCustomData(t){this.store.dispatch(G1(t))}setAgentInfo(t){return P(this,null,function*(){yield this.store.dispatch(Wa(t))})}setAgentSettings(t){return P(this,null,function*(){yield this.store.dispatch(oh(t))})}getAgentSettings(){return P(this,null,function*(){return(yield this.store.dispatch(ih())).payload})}refresh(){return P(this,null,function*(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()}));let t=[];return this.store.dispatch($d()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}notifyExternalSuggestion(t){this.store.dispatch(an(t))}evaluateRule(o){return P(this,arguments,function*(t,n={},r=nT){return(yield this.store.dispatch(Qo({label:t,params:n,options:r}))).payload.cues})}evaluateAssistant(r){return P(this,arguments,function*(t,n={}){yield this.store.dispatch(Yo({assistantCode:t,payload:n}))})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:i,selection:s}=this.state.input,{inlineSuggestions:a,showTextSuggestions:l}=this.state.settings,u=a?"below":"above",c=o.length>0;if(!Ln(this.state)||(this.store.dispatch(D1(nh(t))),t.key!=="Tab"&&!l))return;let f=()=>{n||!c||s&&(t.shiftKey||(this.store.dispatch(U1()),t.preventDefault()))},d=()=>{n||!c||a&&i<=0||s&&(t.shiftKey||(this.store.dispatch(z1()),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(ud(-1)),this.store.dispatch(no({collapse:!0})),this.store.dispatch(Yb(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let m=as(this.state);if(!m)return;this.store.dispatch(hl(!1)),this.store.dispatch(an({text:m.text,suggestion:m,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(this.state.settings.inlineSuggestions||this.state.input.selectedSuggestionIndex===-1)return;let m=as(this.state);if(!m)return;this.store.dispatch(an({text:m.text,suggestion:m,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(this.state.settings.inlineSuggestions||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let m=as(this.state);if(!m)return;this.store.dispatch(an({text:m.text,suggestion:m,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||(B.info("Start handling time"),this.store.dispatch(dk()))}handlingTimeStop(){this.state.handlingTime.startTime&&(B.info("Stop handling time"),this.store.dispatch(If()))}logSendMessage(t){let n=bk("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=Ek(this.state,{version:this.version});t&&(this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(fk()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Oo((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(j1()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(i){B.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),B.error(i)}})}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(Y1(t))}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=Fl(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,tn.unmountComponentAtNode)(i),s(),i.remove()}),i}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 i=(a=t.ownerDocument.defaultView)==null?void 0:a.frameElement,s=i?i.ownerDocument.defaultView:null;if(i&&(s===window||(s==null?void 0:s.parent)===window)){let[l,u]=Fl(i,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{(0,tn.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 $o(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,tn.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),B.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()?(B.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(B1(r.metrics))):B.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(!Nf(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:m,inputMediator:S,closestScrollSelector:y,appendOverlayTo:p,inlineSuggestions:g,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:m,isEmbedded:f,inlineSuggestions:g,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),$o(t),this.inputMediator=S||(oo(t)?new ei(t):new Jo(t)),this.inputMediator.on("change",({plainText:k,rawHTML:C})=>{this.store.dispatch(cd({text:k,html:C}))}),this.inputMediator.on("keyup",k=>{this.store.dispatch(F1(nh(k)))}),this.inputMediator.on("keydown",k=>{this.handleKeyDown(k)}),this.inputMediator.on("paste",({pastedText:k,selectionText:C})=>{this.store.dispatch(H1({text:k,selectionText:C}))}),this.inputMediator.on("cut",({selectionText:k})=>{this.store.dispatch(_1(k))});let v;this.inputMediator.on("selection",k=>{clearTimeout(v),k===null?v=setTimeout(()=>{k!==null&&this.store.dispatch(dd(k))},500):this.store.dispatch(dd(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(Xd(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(Xd(!0))});let x=y&&Ck(t,y)||void 0;if(g){let{customStyles:k,appendOverlayTo:C}=n;if(oo(t))throw new Error("[Deepdesk] Inline suggestion is not supported for textarea yet.");let R=this.createInlineContainer(t,"deepdesk-caret");(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Mo,{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",x||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:C},k==null?void 0:k.floatingMenuRootNode);(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)($b,{onLogIn:()=>this.loginViaPopup().catch(_=>B.warn(_.message))})})}),N)}else{let k=this.overlayContainerFactory("deepdesk-tab-completion",x||t,{appendTo:p,closestScrollElement:x,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),C=this.overlayContainerFactory("deepdesk-suggestions-overlay",x||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(NC,{inputElement:t})})}),k),(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(fC,{onLogIn:()=>this.loginViaPopup().catch(R=>B.warn(R.message))})})}),C)}(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(Bb,{})})}),this.createContainer("deepdesk-overlays")),this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()})),this.store.dispatch(dd(this.inputMediator.getSelection())),this.store.dispatch(Xd(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&&B.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:i}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:i}),(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(tk,{onLogIn:()=>this.loginViaPopup().catch(s=>B.warn(s.message))})})}),t),this.whenConversationLoaded(()=>{var s;this.broadcastEvents.setSessionId((s=this.state.conversation.current)==null?void 0:s.sessionId)})}unmountWidget(){this.widgetRoot&&(0,tn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Df(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){Tk(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(pl());let t=sr(this.state);t&&(yield this.store.dispatch(cl()),this.store.dispatch(td({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))})),this.loadProfileConfigPromise)}loginViaPopup(t){return P(this,null,function*(){return new Promise((n,r)=>{let o=new MessageChannel,i=o.port1,s=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${s}/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)};i.onmessage=m=>P(this,null,function*(){var S,y;if((S=m.data)!=null&&S.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((y=m.data)==null?void 0:y.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=m=>P(this,null,function*(){var S;if(m.origin===a.origin)switch((S=m.data)==null?void 0:S.type){case"deepdesk-popup-loaded":{try{let y=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(y,a.origin,[o.port2])}catch(y){B.error("Error posting message to popup",y),r(y)}break}case"deepdesk-popup-error":{u(),m.data.message==="Timeout"&&B.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(m.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(B.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;B.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=Kd(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(pn()):su.includes(r)||this.store.dispatch(gn(r))})}catch(r){this.handleError(r)}})}};As.version="14.1.0",As.count=0;var Hl=As;function v_(e){return P(this,null,function*(){var o,i,s;let n=yield((o=e.fetch)!=null?o:window.fetch)(e.url),r=yield n.blob();return new File([r],e.name,{type:(s=(i=e.mimeType)!=null?i:n.headers.get("Content-Type"))!=null?s:"image/jpeg"})})}function Hk(e,t){return P(this,null,function*(){let n=yield v_(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 Uk(e,t,n){return P(this,null,function*(){yield new yr(e).authenticateWithKey(t,n)})}function zk(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function Bk(r,o){return P(this,arguments,function*(e,t,n={}){var f,d;let{value:i}=e,{start:s,end:a}=(f=n.replace)!=null?f:{start:0,end:i.length},l=`${i.slice(0,s)}${t}${i.slice(a)}`,u=(d=n.selectionAfter)!=null?d:{start:s+t.length,end:s+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 jk(r,o){return P(this,arguments,function*(e,t,n={}){let i=n.replace?ao(e,n.replace.start,n.replace.end):Ts(e),s,a=()=>{if(n.setRange)return n.setRange(i.cloneRange());i.deleteContents(),s=document.createElement("span"),i.insertNode(s),n.insertBRs!==!1?t.split(`
|
|
28
|
-
`).reverse().forEach((l,u)=>{u>0&&i.insertNode(document.createElement("br")),i.insertNode(document.createTextNode(l))}):i.insertNode(document.createTextNode(t))};return Promise.resolve(a()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let l=n.selectionAfter?ao(e,n.selectionAfter.start,n.selectionAfter.end):(i.collapse(!1),i),u=window.getSelection();u==null||u.removeAllRanges(),u==null||u.addRange(l)}if(!s)return;s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"})}finally{s&&s.remove()}})})}function
|
|
29
|
-
`).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},i=0;for(;o=n.slice(i).match(/(\[([^\]]+)])\(([^)]+)\)/);){let s=document.createElement("a");s.href=o[3],s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"),s.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(i,i+o.index))),t.appendChild(s),i=i+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(i)))}),t}function Vk(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):Vk(n,t)}function Kk(o,i){return P(this,arguments,function*(e,t,{isBlock:n,isHTML:r}={}){let s;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;s=document.createElement("span"),c.insertNode(s);let f=r?
|
|
27
|
+
`);let S=d?r:0,y=m?Math.min(i,c.childNodes.length):c.childNodes.length;for(let p=S;p<y&&(u(c.childNodes[p]),a!==2);p++);break}default:break}m&&(a=2)}return u(e),l}var rk=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(rk||{}),gr=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 i=this.getCaretPosition();Gr(i,this.cachedCaretPosition)||(this.cachedCaretPosition=i,this.emit("caretposition",i))}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(rk).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 ok(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Jo=class extends gr{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),Ml(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){var s;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?(s=r.getComposedRanges(n))==null?void 0:s[0]:r.rangeCount>0?r.getRangeAt(0):null;if(!o)return null;let i=this.element.ownerDocument.createRange();return i.setStart(o==null?void 0:o.startContainer,o==null?void 0:o.startOffset),i.setEnd(o==null?void 0:o.endContainer,o==null?void 0:o.endOffset),!i||!this.element.contains(i.startContainer)||!this.element.contains(i.endContainer)?null:i}getCaretPosition(){let n=this.getRange();if(!n||!n.collapsed||!("getBoundingClientRect"in n))return null;let r=n.getBoundingClientRect();return!ok(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!ok(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return Nl(this.element,n);let r=this.lastKnownSelection;if(r&&nk(this.element,r.start,r.end))return r;let o=Ts(this.element);return o.collapse(!1),Nl(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return Ml(this.element,ao(this.element,n,r))}listen(){super.listen();let n=new MutationObserver(i=>{var s,a;i.length===2&&i[0].addedNodes.length===1&&((s=i[0].addedNodes[0])==null?void 0:s.textContent)==="\u2060"&&((a=i[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 ei=class extends gr{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 null}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var i;return(i=n==null?void 0:n.get)==null?void 0:i.call(this.element)},set:i=>{var s;(s=n==null?void 0:n.set)==null||s.call(this.element,i),this.handleInteraction()}});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 ik(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let i=document.createElement("iframe"),s=new URL(t);return Object.entries(n).forEach(([a,l])=>{s.searchParams.append(a,l)}),i.style.position="absolute",i.style.left="-999em",i.style.width="0px",i.style.height="0px",i.tabIndex=-1,i.id=r,i.title=`iframe-${e}`,i.src=s.toString(),window.document.body.appendChild(i),i}function l_(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()}},Iy=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=ik(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()}},Oy=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(),B.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 Iy(t,this.deepdeskUrl,{debug:!0}):new Ly(t),r=o=>{var s,a;if(o.origin!==this.deepdeskUrl)return;let i=l_(o.data);typeof i!="object"||i.type!=="event"||i.channel!==t||(B.info("Received broadcast event",this.sessionId,o),(a=(s=this.eventMap)[i.name])==null||a.call(s,i.payload))};return n.onMessage(r),n}send(t,n,r){var s,a;B.info("Broadcast event",{sessionId:this.sessionId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(s=this.eventMap)[t])==null||a.call(s,n));let i=this.sessionId==="deepdesk-general"?this.defaultChannel:this.channel;i==null||i.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)}},sk=Oy;var ks=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var Ny=e=>new Promise(t=>{setTimeout(t,e)});var Ps=class extends ks{constructor(){super(...arguments);this.name="ClientError"}},_y=class extends ks{constructor(){super(...arguments);this.name="ServerError"}},My=new Map;function u_(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:(B.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var lo=class lo{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 i={isAborted:!1,reject:o},s=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",C=n,{useCache:u=!1,abortLatest:c=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:m=!0,retryOnError:S=R=>R instanceof TypeError,retryOnResponse:y=R=>R.status>=500,version:p=null}=C,g=te(C,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(u)if(l){if(My.has(s)){r(My.get(s));return}}else throw new Error(`Can't use 'useCache' for ${n.method}`);let h=I(T({credentials:"include"},g),{headers:T({Accept:"application/json","Content-Type":"application/json"},g.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 v=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&c&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let k=()=>P(this,null,function*(){return v--,a(s,h).then(R=>P(this,null,function*(){return y(R)&&!i.isAborted&&v>0?(yield Ny(d),k()):R.status===401&&m===!0&&x===!1?(x=!0,yield this.refreshToken(),k()):R})).catch(R=>P(this,null,function*(){if(S(R)&&!i.isAborted&&v>0)return yield Ny(d),k();throw R}))});k().then(R=>P(this,null,function*(){let N=yield u_(R);if(delete this.latestRequestByUrl[s],R.status>=500){o(new _y("Server Error",N));return}else if(R.status===401){o(new Ps("Unauthorized",N));return}else if(R.status===403){o(new Ps("Forbidden",N));return}else if(R.status===404){o(new Ps("Not Found",N));return}else if(R.status>=400){o(new Ps("Bad Request",N));return}u&&My.set(s,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 lo.refreshingToken||(lo.refreshingToken=this.get("/auth/refresh",{refreshTokenOn401:!1}).finally(()=>{setTimeout(()=>{lo.refreshingToken=null},1e3*60)})),lo.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))}};lo.refreshingToken=null;var hr=lo;var ak;(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={}))})(ak||(ak={}));function Lf(e){return I(T({},ee(e)),{tags:e.tags})}var ti=class ti{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new hr(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,i)=>P(this,null,function*(){let s=yield r(o,i);return this.handleDeepdeskVersionHeaders(s),s}))}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?(ti.exchangeTokenPromise||(ti.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),ti.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return P(this,null,function*(){yield this.preflight(),B.info(`Creating conversation for session ${t.sessionId} and agent ${t.agentId}`);let n=yield this.client.post("/api/conversations",I(T({},Ie(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 ee(t)})}patchMe(t){return P(this,null,function*(){let n=yield this.client.patch("/apis/admin/session/me/",Ie(t));return ee(n)})}getProfile(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return ee(n)})}getKnowledgeAssistant(t){return P(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return ee(n)})}getContentTypes(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return ee(t)})}getAccount(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return ee(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 ee(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(),B.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:i=1e3}=n,s=yield this.client.get(`/api/conversations/by_session_id/${t}`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return B.info(`Successfully retrieved conversation ${s.id} for session ${t}`),Lf(s)})}isConversationSupported(r){return P(this,arguments,function*(t,n={}){B.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:i=1e3}=n;return(yield this.client.get(`/api/conversations/by_session_id/${t}/active_profile`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"})).has_active_profile})}updateConversation(t,n){return P(this,null,function*(){let r=Ie(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({},Ie(o)),{tags:o.tags})),{version:"v2"})).map(o=>Lf(o))})}sendEvent(t,n){return P(this,null,function*(){let s=n,{data:r}=s,o=te(s,["data"]),i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((a,[l,u])=>I(T({},a),{[l]:u}),{});return this.client.post("/api/events",Ie(I(T(T({},i),o),{data:r,name:t})),{version:"v2"})})}sendEventV1(t,n){return P(this,null,function*(){let r=Object.entries(this.latestReceivedDeepdeskVersions).reduce((o,[i,s])=>I(T({},o),{[i]:s}),{});return this.client.post("/api/events",{event:t,data:Ie(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})}getSummary(r){return P(this,arguments,function*(t,n={}){let o=yield this.client.post("/api/summary",{conversation:{messages:t.filter(i=>i.text&&i.source),agent_id:n.agentId,id:n.externalConversationId},prompt_instruction:n.promptInstruction,model:n.model},{version:"v1"});return ee(o)})}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 B.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/",Ie(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}`,Ie(n),{abortLatest:!0,version:"v1"})).map(s=>I(T({},ee(s)),{text:s.text||s.url||s.message,source:r,type:r})).filter((s,a,l)=>a===l.findIndex(u=>u.text===s.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`,Ie(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,i,s)=>i===s.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 ee(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",Ie(t),{abortLatest:!0,version:"v1"});return ee(n)})}search(t){return P(this,null,function*(){let n=yield this.client.post(`/api/profiles/${t.profile}/search`,Ie(t),{version:"v2"});return ee(n)})}knowledgeAssist(i,s,a){return P(this,arguments,function*(t,n,r,o={}){let l=yield this.client.post(`/api/knowledge-assist/assistants/${r}/search`,Ie({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 ee(l)})}requestLoginByEmail(t){return P(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return ee(n)})}requestPasswordlessToken(){return P(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return ee(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 ee(n)})}evaluateRule(i,s,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?ee(u.cues):[]})}evaluateAssistant(t,n,r){return P(this,null,function*(){let o=new URLSearchParams;o.append("enforce_cues_schema","true"),r!=null&&r.conversationId&&o.append("conversation_id",r==null?void 0:r.conversationId);let i=yield this.client.post(`/api/v2/assistants/${t}/evaluate?${o.toString()}`,{input:n});return ee(i.output)})}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 ee(n)})}translateMessages(t){return P(this,null,function*(){let n=yield this.client.post("/api/translate",Ie(t),{version:"v2"});return ee(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(t0);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&B.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};ti.exchangeTokenPromise=null;var yr=ti;var _l=class{constructor(t,n){this.url=t;this.eventListeners={};this.options=T({timeout:25e3},n)}proxyEvent(t){this.eventSource.addEventListener(rh(t),n=>{let{data:r}=n;try{let o=JSON.parse(r);this.emit(t,ee(o))}catch(o){B.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 lk;(t=>{let e;(i=>(i.Started="Started",i.Aborted="Aborted",i.Completed="Completed"))(e=t.AutoflowSessionState||(t.AutoflowSessionState={}))})(lk||(lk={}));var Dl=class{constructor(t,n={}){this.apiUrl=t;this.streams={};this.logger=B;this.client=new hr(t,n)}getCustomMessages(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/suggestions`);return ee(n.suggestions)})}sendCustomMessage(t,n){return P(this,null,function*(){let r=yield this.client.post(`/sessions/${t}/messages`,Ie(n));return ee(r)})}answerCustomMessage(t,n){return P(this,null,function*(){yield this.client.post(`/sessions/${t}/answers`,Ie(n))})}getAutoflows(t){return P(this,null,function*(){let n=yield this.client.get(`/sessions/${t}/autoflows`);return ee(n.autoflows)})}startAutoflowSession(t){return P(this,null,function*(){let n=yield this.client.post("/autoflow-sessions",Ie(t));return ee(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 _l(`${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 uk={startTime:null,stopTime:null},ck=Y({name:"handlingTime",initialState:uk,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(ce,()=>uk)}}),{handlingTimeStart:dk,handlingTimeStop:If,handlingTimeReset:fk}=ck.actions,pk=ck.reducer;var mk=(e={})=>{let t=T({onAuthError:rs(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var Of={list:{keywordMatches:[]},fetchState:"idle"};var ni=K("styleSuggestions/getAll",(n,r)=>P(void 0,[n,r],function*({text:e},t){var l;let{deepdeskAPI:o}=t.extra,i=t.getState(),{showStyleSuggestions:s}=i.settings,a=(l=i.conversation.current)==null?void 0:l.profileCode;if(!s)return Of.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),c_=Y({name:"styleSuggestions",initialState:Of,reducers:{},extraReducers:e=>{e.addCase(ni.pending,t=>{t.fetchState="loading"}).addCase(ni.rejected,t=>{t.fetchState="error"}).addCase(ni.fulfilled,(t,n)=>{t.fetchState="done",Gr(t.list,n.payload)||(t.list=n.payload)}).addCase(Oo,t=>{t.list=Of.list}).addCase(ce,()=>Of)}}),gk=c_.reducer;var hk=(e={})=>{let t,n=!0,r=T({getStyleSuggestions:ni,debounce:500},e);return o=>i=>s=>{var m;let a=o.getState().input.text,l=i(s),u=o.getState();if(u.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:c}=u.settings;if(!((m=u.conversation.current)==null?void 0:m.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 d_(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end}var yk=(e={})=>{let t=T({getTextSuggestions:gn,getAutocompleteSuggestions:ml,debounce:200,check:Ln},e),n;return r=>o=>i=>{var y;let{input:s}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:u,showTabCompletion:c}=l.settings,f=(y=l.conversation.current)==null?void 0:y.id,d=i.type===$d.toString();if(!f||!u&&!c)return a;let{input:m}=l;return d_(m,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let p=ss(l);p===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(p))},d?0:t.debounce)),a}};var vk=ni.fulfilled.toString();function f_(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let i=e.keywordMatches.filter(l=>l.keyword===o),s=t.keywordMatches.filter(l=>l.keyword===o),a=s.length-i.length;a<=0||r.push(...s.slice(0,a))}),r}var Sk=e=>t=>n=>r=>{var u;if(r.type!==vk){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(u=i.conversation)==null?void 0:u.current;if(o===s)return;let l=f_(o,s);r.type===vk&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var p_=kc({assistants:tT,answer:vb,auth:x1,autoflows:UC,conversation:I1,contentTypes:RE,customMessages:GC,passwordlessToken:XC,entities:JE,knowledgeAssistant:gb,handlingTime:pk,info:Q1,input:V1,settings:m1,profile:Eb,search:rE,summary:sb,styleSuggestions:gk,ui:Xb,rules:sT,textSuggestions:Lb});function wk(e){return wx({reducer:p_,middleware:t=>[...t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI,deepdeskBrokerAPI:e.deepdeskBrokerAPI}},serializableCheck:!1}),mk(),yk({debounce:200}),hk({debounce:500}),Sk(e.deepdeskAPI),...e.middleware?e.middleware:[]],preloadedState:e.preloadedState})}var m_=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},g_=e=>t=>n=>r=>{var a,l,u,c,f,d;let o=t.getState(),i=Xg("inlineSuggestions")(o);switch(r.type){case rs.toString():{!r.payload&&e.emit("logout",void 0);break}case pn.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 lt.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 Oo.toString():e.logSendMessage(r.payload);break;case Qo.fulfilled.toString():r.isBroadcasted||e.broadcast(sh,r,!1),(c=r.payload.options)!=null&&c.shouldEmit&&e.emit("cues",r.payload.cues);break;case Yo.fulfilled.toString():r.isBroadcasted||e.broadcast(ah,r,!1);break;default:break}let s=n(r);switch(r.type){case Oo.toString():e.handleAfterSendMessage(r.payload);break;case hl.toString():e.onUpdateShowTabHint(r.payload);break;case If.toString():e.logHandlingTime();break;case"analytics/logEvent/fulfilled":{e.emit("event",r.meta.arg);break}case ad.toString():{let{start:m,end:S}=o.input.selection;e.emit("replace",I(T({},r.payload),{replace:r.payload.replace==="selection"?{start:m,end:S}:{start:0,end:S}}));break}case an.toString():{let{start:m,end:S}=o.input.selection;e.emit("select-suggestion",I(T({type:m_(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:m,end:S}:{start:0,end:S}})),i&&t.dispatch(Qr([]));break}case ld.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():{i&&r.payload.length>0&&t.dispatch(ud(0));break}case rr.fulfilled.toString():{e.sendEvent("conversation summarized",{conversationId:(d=o.conversation.current)==null?void 0:d.id,data:{summary:r.payload.summary,model:t.getState().summary.model}});break}default:break}return s},xk=g_;function Dy(e){return e.toISOString().replace("T"," ").replace("Z","")}function Ek(e,t){var i,s,a,l;let n=(i=e.conversation.current)==null?void 0:i.id;if(!n)return B.warn("No conversationId for handling time metrics"),null;let{startTime:r,stopTime:o}=e.handlingTime;return!r||!o?(B.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:n,clientVersion:t.version,agentId:(s=e.info.agentInfo)==null?void 0:s.agentId,agentName:(a=e.info.agentInfo)==null?void 0:a.agentName,agentEmail:(l=e.info.agentInfo)==null?void 0:l.agentEmail,timeStart:Dy(r),timeStop:Dy(o)}}function bk(e,t,n){var N,_,D,G;let r=(N=t.conversation.current)==null?void 0:N.id;if(!r)return B.warn("No conversationId for send message metrics"),null;let{text:o,metrics:{numCharsTyped:i,numCharsPasted:s,numCharsCut:a,numCharsDeleted:l,numPaste:u,agentStartedTypingTimestamp:c,externalTimeTotalSeconds:f,pastes:d,cuts:m,deletions:S,textSuggestions:y,offeredTextSuggestions:p}}=t[e],g=o.length,v=y.reduce((Z,{text:ie,searchTerm:vr})=>Z+ie.length-(vr?vr.length:0),0),x=c!=null?c:Date.now(),k=(Date.now()-x)/1e3+(f||0),C=i/k,R=y.reduce((Z,{searchTerm:ie})=>Z+(ie?ie.length:0),0);return{conversationId:r,source:"agent",text:o,clientVersion:n.version,pastes:d,cuts:m,deletions:S,lenTextTyped:i+R,lenTextTotal:g,lenTextAssisted:v,lenTextPasted:s,lenTextCut:a,lenTextDeleted:l,timeTotalSeconds:k,charsPerSecond:C,numPastes:u,textSuggestionsV2:y,suggestionsCounters:[{source:"gpt",countOffered:p.filter(Z=>Z.source==="gpt").length}],agentId:(_=t.info.agentInfo)==null?void 0:_.agentId,agentName:(D=t.info.agentInfo)==null?void 0:D.agentName,agentEmail:(G=t.info.agentInfo)==null?void 0:G.agentEmail}}function Fy(e,t){var i;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return Fy(r,t);let o=(i=e.ownerDocument.defaultView)==null?void 0:i.frameElement;return o?Fy(o,t):null}function Ck(e,t){return Fy(e,t)}function Tk(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function h_(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Nf(e){return h_(e)&&(oo(e)||rf(e))}var Pk,Mn=new Map,y_=["bottom","height","left","right","top","width"],kk=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:y_.some(n=>e[n]!==t[n]);function Rk(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,...Rk(t)]:[]}function Ak(e,t){return!e||!t?null:I(T({},e),{top:e.top+t.top,left:e.left+t.left})}var Mf=!1,Lk=()=>{Mf=!0;let e=[];if(Mn.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),Mn.delete(n);return}let r=n.getBoundingClientRect();kk(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(Ak,t.rect):t.rect;kk(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),Mn.size===0){Mf=!1;return}Pk=window.requestAnimationFrame(Lk)};function Hy(e,t){let n=Rk(e),r=[],o=n.map((i,s)=>Hy(i,a=>{r[s]=a;let l=Mn.get(e);if(!l)return;let u=r.reduce(Ak,l.rect);l.callbacks.forEach(c=>c(u))}));return{observe(i=!0){if(o.forEach(s=>s.observe(!1)),Mn.has(e)){let s=Mn.get(e);s.callbacks.push(t),s.rect&&t(s.rect)}else Mn.set(e,{rect:void 0,callbacks:[t],parentRects:r});i&&!Mf&&Lk()},unobserve(){o.forEach(s=>s.unobserve());let i=Mn.get(e);if(i){let s=i.callbacks.indexOf(t);s>=0&&i.callbacks.splice(s,1),i.callbacks.length||Mn.delete(e),Mn.size||(cancelAnimationFrame(Pk),Mf=!1)}}}}var Ik,_n=new Map,Ok=()=>{_n.forEach((e,t)=>{if(!t.isConnected){_n.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(i=>i(e.visible)))}),_n.size!==0&&(Ik=window.requestAnimationFrame(Ok))};function Nk(e,t){return{observe(){let n=_n.size===0;_n.has(e)?_n.get(e).callbacks.push(t):_n.set(e,{visible:void 0,callbacks:[t]}),n&&Ok()},unobserve(){let n=_n.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||_n.delete(e),_n.size||cancelAnimationFrame(Ik)}}}}var Uy=["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 zy(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function Rs(e){return parseFloat(e)}function _f(e){return Math.round(e*1e6)}function Mk(e){return e/1e6}function By(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=Rs(e.width),i=Rs(e.borderLeftWidth),s=Rs(e.borderRightWidth),a=Rs(e.paddingRight),l=Mk(_f(o)-_f(i)-_f(s)),u=Mk(_f(r));if(l-u>2){let c=l-u;n.style.paddingRight=`${a+c}px`}}function Fl(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",$o(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};zy(r,n,Uy),By(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=Nk(e,()=>{zy(r,n,Uy),By(r,e,n),i(),setTimeout(i,0)}),a,l=!0,u=Hy(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(zy(r,n,Uy),By(r,e,n),i(),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let m=t.closestScrollElement.getBoundingClientRect(),S=window.getComputedStyle(t.closestScrollElement),y=Rs(S.borderTopWidth),p=Rs(S.borderBottomWidth),g=m.top+y-d.top,h=d.top+d.height+-(m.top+m.height-p);n.style.clipPath=`inset(${g}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(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),u.unobserve(),s.unobserve()}]}var _k=(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){B.warn("[Deepdesk] SessionStorage is blocked by browser")}}});function v_(e){return e.offsetParent!==null}function Dk(e){if(!v_(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 Df(e,t,n=100){let r=Dk(e);t({isVisible:r});let o=setInterval(()=>{let i=Dk(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var Fe=w(b());var Fk=_k("showTabHint",!0),As=class As{constructor({deepdeskUrl:t,brokerUrl:n,version:r=As.version||"unknown",locale:o="en-US",token:i,fetch:s,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 yr(u,{token:i,fetch:s}),this.version=r,this.instanceId=As.count++;let c={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[xk({broadcast:(f,d,m)=>{this.broadcastEvents.send(f,d,m)},emit:(f,d)=>this.emit(f,d),handleAfterSendMessage:f=>this.handleAfterSendMessage(f),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:f=>this.logSendMessage(f),onUpdateShowTabHint:f=>Fk.update(f),sendEvent:(f,d)=>this.deepdeskApi.sendEvent(f,d)})]};n&&Object.assign(c,{deepdeskBrokerAPI:new Dl(n)}),this.store=wk(c),this.broadcastEvents=new sk({debug:!0,deepdeskUrl:u,eventMap:oE(this.store),createCustomChannel:l}),this.store.dispatch(hl(Fk.value())),this.store.dispatch(td({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?(B.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(B.warn("Profile has not been loaded (yet)"),!0):(B.warn("No conversation loaded (yet)"),!0)}login(){return this.store.dispatch(rs(null)),this.store.dispatch(Qn()),new Promise(t=>{let n=this.store.subscribe(()=>{let r=this.store.getState();at(r)&&g1(r)!=="loading"&&(n(),t())});this.unmountHandlers.push(()=>{n()})})}isLoggedIn(){return P(this,null,function*(){return(yield this.store.dispatch(Qn())).payload})}isConversationSupported(t,n){return P(this,null,function*(){return(yield this.store.dispatch(eh({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(rd(t))).payload})}getConversationBySessionId(t,n){return P(this,null,function*(){return this.hasConversation()&&this.sessionId()!==t&&this.resetConversation(),(yield this.store.dispatch(od({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(th(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(id(t))).payload})}resetConversation(){this.store.dispatch(ce()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}getSummary(){return P(this,null,function*(){let t=yield this.store.dispatch(rr());if(t.error)throw new Error(t.error.message);return t.payload.summary})}configure(t){this.store.dispatch(td(t))}setVisitorInfo(t){this.store.dispatch(q1(t))}setCustomData(t){this.store.dispatch(G1(t))}setAgentInfo(t){return P(this,null,function*(){yield this.store.dispatch(Wa(t))})}setAgentSettings(t){return P(this,null,function*(){yield this.store.dispatch(oh(t))})}getAgentSettings(){return P(this,null,function*(){return(yield this.store.dispatch(ih())).payload})}refresh(){return P(this,null,function*(){if(this.shouldAbort())return Promise.resolve();this.inputMediator&&this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()}));let t=[];return this.store.dispatch($d()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}notifyExternalSuggestion(t){this.store.dispatch(an(t))}evaluateRule(o){return P(this,arguments,function*(t,n={},r=nT){return(yield this.store.dispatch(Qo({label:t,params:n,options:r}))).payload.cues})}evaluateAssistant(r){return P(this,arguments,function*(t,n={}){yield this.store.dispatch(Yo({assistantCode:t,payload:n}))})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:i,selection:s}=this.state.input,{inlineSuggestions:a,showTextSuggestions:l}=this.state.settings,u=a?"below":"above",c=o.length>0;if(!Ln(this.state)||(this.store.dispatch(D1(nh(t))),t.key!=="Tab"&&!l))return;let f=()=>{n||!c||s&&(t.shiftKey||(this.store.dispatch(U1()),t.preventDefault()))},d=()=>{n||!c||a&&i<=0||s&&(t.shiftKey||(this.store.dispatch(z1()),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(ud(-1)),this.store.dispatch(no({collapse:!0})),this.store.dispatch(Yb(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let m=as(this.state);if(!m)return;this.store.dispatch(hl(!1)),this.store.dispatch(an({text:m.text,suggestion:m,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(this.state.settings.inlineSuggestions||this.state.input.selectedSuggestionIndex===-1)return;let m=as(this.state);if(!m)return;this.store.dispatch(an({text:m.text,suggestion:m,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(this.state.settings.inlineSuggestions||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let m=as(this.state);if(!m)return;this.store.dispatch(an({text:m.text,suggestion:m,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||(B.info("Start handling time"),this.store.dispatch(dk()))}handlingTimeStop(){this.state.handlingTime.startTime&&(B.info("Stop handling time"),this.store.dispatch(If()))}logSendMessage(t){let n=bk("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=Ek(this.state,{version:this.version});t&&(this.deepdeskApi.sendEventV1("Handling Time",t),this.store.dispatch(fk()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Oo((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(j1()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(i){B.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),B.error(i)}})}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(Y1(t))}whenConversationLoaded(t){let n=()=>this.loadProfileConfig().then(()=>t());this.hasConversation()&&n();let r=this.hasConversation();this.store.subscribe(()=>{this.hasConversation()!==r&&(r=this.hasConversation(),r&&n())})}overlayContainerFactory(t,n,r,o){let[i,s]=Fl(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),this.unmountHandlers.push(()=>{(0,tn.unmountComponentAtNode)(i),s(),i.remove()}),i}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 i=(a=t.ownerDocument.defaultView)==null?void 0:a.frameElement,s=i?i.ownerDocument.defaultView:null;if(i&&(s===window||(s==null?void 0:s.parent)===window)){let[l,u]=Fl(i,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{(0,tn.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 $o(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,tn.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),B.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()?(B.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(B1(r.metrics))):B.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(!Nf(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let{customStyles:r={},showStyleSuggestions:o,showTabCompletion:i,showTextSuggestions:s,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,isEmbedded:f,detectSubmit:d,insertLink:m,inputMediator:S,closestScrollSelector:y,appendOverlayTo:p,inlineSuggestions:g,floatingMenu:h}=n;this.configure({showStyleSuggestions:o,showTabCompletion:i,textSuggestionsCount:a,showMidSentenceSuggestions:l,showSuggestionsBeforePattern:u,showSuggestionsAfterPattern:c,showTextSuggestions:s,insertLink:m,isEmbedded:f,inlineSuggestions:g,floatingMenu:!!h}),n.automaticHandlingTime&&this.setupHandlingTime(t),$o(t),this.inputMediator=S||(oo(t)?new ei(t):new Jo(t)),this.inputMediator.on("change",({plainText:k,rawHTML:C})=>{this.store.dispatch(cd({text:k,html:C}))}),this.inputMediator.on("keyup",k=>{this.store.dispatch(F1(nh(k)))}),this.inputMediator.on("keydown",k=>{this.handleKeyDown(k)}),this.inputMediator.on("paste",({pastedText:k,selectionText:C})=>{this.store.dispatch(H1({text:k,selectionText:C}))}),this.inputMediator.on("cut",({selectionText:k})=>{this.store.dispatch(_1(k))});let v;this.inputMediator.on("selection",k=>{clearTimeout(v),k===null?v=setTimeout(()=>{k!==null&&this.store.dispatch(dd(k))},500):this.store.dispatch(dd(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(Xd(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(Xd(!0))});let x=y&&Ck(t,y)||void 0;if(g){let{customStyles:k,appendOverlayTo:C}=n;if(oo(t))throw new Error("[Deepdesk] Inline suggestion is not supported for textarea yet.");let R=this.createInlineContainer(t,"deepdesk-caret");(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Mo,{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",x||t,{appendTo:typeof h=="object"&&"appendOverlayTo"in h?h.appendOverlayTo:C},k==null?void 0:k.floatingMenuRootNode);(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:k,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)($b,{onLogIn:()=>this.loginViaPopup().catch(_=>B.warn(_.message))})})}),N)}else{let k=this.overlayContainerFactory("deepdesk-tab-completion",x||t,{appendTo:p,closestScrollElement:x,mirrorOverflow:!0,onRemove:()=>this.unmount()},r==null?void 0:r.rootNode),C=this.overlayContainerFactory("deepdesk-suggestions-overlay",x||t,{appendTo:p},r==null?void 0:r.suggestionsRootNode);(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(NC,{inputElement:t})})}),k),(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(fC,{onLogIn:()=>this.loginViaPopup().catch(R=>B.warn(R.message))})})}),C)}(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(Bb,{})})}),this.createContainer("deepdesk-overlays")),this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML()})),this.store.dispatch(dd(this.inputMediator.getSelection())),this.store.dispatch(Xd(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&&B.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:i}=n;this.widgetRoot=t,this.configure({showImages:o,isEmbedded:i}),(0,tn.render)((0,Fe.jsx)(Go,{store:this.store,customStyles:r,children:(0,Fe.jsx)(Mo,{broadcastEvents:this.broadcastEvents,children:(0,Fe.jsx)(tk,{onLogIn:()=>this.loginViaPopup().catch(s=>B.warn(s.message))})})}),t),this.whenConversationLoaded(()=>{var s;this.broadcastEvents.setSessionId((s=this.state.conversation.current)==null?void 0:s.sessionId)})}unmountWidget(){this.widgetRoot&&(0,tn.unmountComponentAtNode)(this.widgetRoot),this.widgetRoot=null}setupHandlingTime(t){let n=Df(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){Tk(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(pl());let t=sr(this.state);t&&(yield this.store.dispatch(cl()),this.store.dispatch(td({showSearch:t.search,showAutoflows:t.autoflows,showCustomMessages:t.customMessages,showImageSearch:t.imageSearch,showEntitiesCommand:t.entitiesCommand,showSummaryCommand:t.summarizer,showKnowledgeSearch:!!t.knowledgeAssistant,recommendTextSuggestions:t.recommendTextSuggestions})))})),this.loadProfileConfigPromise)}loginViaPopup(t){return P(this,null,function*(){return new Promise((n,r)=>{let o=new MessageChannel,i=o.port1,s=this.state.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${s}/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)};i.onmessage=m=>P(this,null,function*(){var S,y;if((S=m.data)!=null&&S.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((y=m.data)==null?void 0:y.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=m=>P(this,null,function*(){var S;if(m.origin===a.origin)switch((S=m.data)==null?void 0:S.type){case"deepdesk-popup-loaded":{try{let y=JSON.stringify({type:"deepdesk-popup-create-channel"});c==null||c.postMessage(y,a.origin,[o.port2])}catch(y){B.error("Error posting message to popup",y),r(y)}break}case"deepdesk-popup-error":{u(),m.data.message==="Timeout"&&B.warn("Popup timed out. Check if the account's platform url is configured correctly."),r(new Error(m.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(B.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;B.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=Kd(this.state);try{n.forEach(({type:r})=>{r==="entities"?this.store.dispatch(pn()):su.includes(r)||this.store.dispatch(gn(r))})}catch(r){this.handleError(r)}})}};As.version="14.1.1-beta.1",As.count=0;var Hl=As;function S_(e){return P(this,null,function*(){var o,i,s;let n=yield((o=e.fetch)!=null?o:window.fetch)(e.url),r=yield n.blob();return new File([r],e.name,{type:(s=(i=e.mimeType)!=null?i:n.headers.get("Content-Type"))!=null?s:"image/jpeg"})})}function Hk(e,t){return P(this,null,function*(){let n=yield S_(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 Uk(e,t,n){return P(this,null,function*(){yield new yr(e).authenticateWithKey(t,n)})}function zk(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function Bk(r,o){return P(this,arguments,function*(e,t,n={}){var f,d;let{value:i}=e,{start:s,end:a}=(f=n.replace)!=null?f:{start:0,end:i.length},l=`${i.slice(0,s)}${t}${i.slice(a)}`,u=(d=n.selectionAfter)!=null?d:{start:s+t.length,end:s+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 jk(r,o){return P(this,arguments,function*(e,t,n={}){let i=n.replace?ao(e,n.replace.start,n.replace.end):Ts(e),s,a=()=>{if(n.setRange)return n.setRange(i.cloneRange());i.deleteContents(),s=document.createElement("span"),i.insertNode(s),n.insertBRs!==!1?t.split(`
|
|
28
|
+
`).reverse().forEach((l,u)=>{u>0&&i.insertNode(document.createElement("br")),i.insertNode(document.createTextNode(l))}):i.insertNode(document.createTextNode(t))};return Promise.resolve(a()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let l=n.selectionAfter?ao(e,n.selectionAfter.start,n.selectionAfter.end):(i.collapse(!1),i),u=window.getSelection();u==null||u.removeAllRanges(),u==null||u.addRange(l)}if(!s)return;s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"})}finally{s&&s.remove()}})})}function w_(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 x_(e){let t=document.createDocumentFragment();return e.split(`
|
|
29
|
+
`).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},i=0;for(;o=n.slice(i).match(/(\[([^\]]+)])\(([^)]+)\)/);){let s=document.createElement("a");s.href=o[3],s.setAttribute("target","_blank"),s.setAttribute("rel","noopener noreferrer"),s.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(i,i+o.index))),t.appendChild(s),i=i+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(i)))}),t}function Vk(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):Vk(n,t)}function Kk(o,i){return P(this,arguments,function*(e,t,{isBlock:n,isHTML:r}={}){let s;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;s=document.createElement("span"),c.insertNode(s);let f=r?w_(t):x_(t);n?Vk(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(),!!s)try{s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"})}finally{s&&s.remove()}})})}return iP(E_);})();
|
|
30
30
|
/*! Bundled license information:
|
|
31
31
|
|
|
32
32
|
classnames/index.js:
|