@deepdesk/deepdesk-sdk 19.3.2-beta.4 → 19.3.2-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,88 +1,88 @@
1
- "use strict";var Deepdesk=(()=>{var f_=Object.create;var nl=Object.defineProperty,p_=Object.defineProperties,m_=Object.getOwnPropertyDescriptor,g_=Object.getOwnPropertyDescriptors,h_=Object.getOwnPropertyNames,ku=Object.getOwnPropertySymbols,y_=Object.getPrototypeOf,eg=Object.prototype.hasOwnProperty,JS=Object.prototype.propertyIsEnumerable;var tg=Math.pow,Jm=(e,t,n)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))eg.call(t,n)&&Jm(e,n,t[n]);if(ku)for(var n of ku(t))JS.call(t,n)&&Jm(e,n,t[n]);return e},I=(e,t)=>p_(e,g_(t));var ng=e=>typeof e=="symbol"?e:e+"",se=(e,t)=>{var n={};for(var r in e)eg.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ku)for(var r of ku(e))t.indexOf(r)<0&&JS.call(e,r)&&(n[r]=e[r]);return n};var cn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),yt=(e,t)=>{for(var n in t)nl(e,n,{get:t[n],enumerable:!0})},ex=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of h_(t))!eg.call(e,o)&&o!==n&&nl(e,o,{get:()=>t[o],enumerable:!(r=m_(t,o))||r.enumerable});return e};var E=(e,t,n)=>(n=e!=null?f_(y_(e)):{},ex(t||!e||!e.__esModule?nl(n,"default",{value:e,enumerable:!0}):n,e)),v_=e=>ex(nl({},"__esModule",{value:!0}),e);var Te=(e,t,n)=>Jm(e,typeof t!="symbol"?t+"":t,n);var N=(e,t,n)=>new Promise((r,o)=>{var s=l=>{try{a(n.next(l))}catch(c){o(c)}},i=l=>{try{a(n.throw(l))}catch(c){o(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(s,i);a((n=n.apply(e,t)).next())});var De=cn((Q6,Ru)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty;function t(){for(var o="",s=0;s<arguments.length;s++){var i=arguments[s];i&&(o=r(o,n(i)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var s="";for(var i in o)e.call(o,i)&&o[i]&&(s=r(s,i));return s}function r(o,s){return s?o?o+" "+s:o+s:o}typeof Ru!="undefined"&&Ru.exports?(t.default=t,Ru.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});var fx=cn(ge=>{"use strict";var rl=Symbol.for("react.element"),S_=Symbol.for("react.portal"),x_=Symbol.for("react.fragment"),w_=Symbol.for("react.strict_mode"),b_=Symbol.for("react.profiler"),E_=Symbol.for("react.provider"),C_=Symbol.for("react.context"),T_=Symbol.for("react.forward_ref"),k_=Symbol.for("react.suspense"),R_=Symbol.for("react.memo"),P_=Symbol.for("react.lazy"),tx=Symbol.iterator;function I_(e){return e===null||typeof e!="object"?null:(e=tx&&e[tx]||e["@@iterator"],typeof e=="function"?e:null)}var ox={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},sx=Object.assign,ix={};function Mi(e,t,n){this.props=e,this.context=t,this.refs=ix,this.updater=n||ox}Mi.prototype.isReactComponent={};Mi.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Mi.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ax(){}ax.prototype=Mi.prototype;function og(e,t,n){this.props=e,this.context=t,this.refs=ix,this.updater=n||ox}var sg=og.prototype=new ax;sg.constructor=og;sx(sg,Mi.prototype);sg.isPureReactComponent=!0;var nx=Array.isArray,lx=Object.prototype.hasOwnProperty,ig={current:null},cx={key:!0,ref:!0,__self:!0,__source:!0};function ux(e,t,n){var r,o={},s=null,i=null;if(t!=null)for(r in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(s=""+t.key),t)lx.call(t,r)&&!cx.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),c=0;c<a;c++)l[c]=arguments[c+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:rl,type:e,key:s,ref:i,props:o,_owner:ig.current}}function A_(e,t){return{$$typeof:rl,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ag(e){return typeof e=="object"&&e!==null&&e.$$typeof===rl}function __(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var rx=/\/+/g;function rg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?__(""+e.key):t.toString(36)}function Iu(e,t,n,r,o){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case rl:case S_:i=!0}}if(i)return i=e,o=o(i),e=r===""?"."+rg(i,0):r,nx(o)?(n="",e!=null&&(n=e.replace(rx,"$&/")+"/"),Iu(o,t,n,"",function(c){return c})):o!=null&&(ag(o)&&(o=A_(o,n+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(rx,"$&/")+"/")+e)),t.push(o)),1;if(i=0,r=r===""?".":r+":",nx(e))for(var a=0;a<e.length;a++){s=e[a];var l=r+rg(s,a);i+=Iu(s,t,n,l,o)}else if(l=I_(e),typeof l=="function")for(e=l.call(e),a=0;!(s=e.next()).done;)s=s.value,l=r+rg(s,a++),i+=Iu(s,t,n,l,o);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Pu(e,t,n){if(e==null)return e;var r=[],o=0;return Iu(e,r,"","",function(s){return t.call(n,s,o++)}),r}function N_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var $t={current:null},Au={transition:null},M_={ReactCurrentDispatcher:$t,ReactCurrentBatchConfig:Au,ReactCurrentOwner:ig};function dx(){throw Error("act(...) is not supported in production builds of React.")}ge.Children={map:Pu,forEach:function(e,t,n){Pu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Pu(e,function(){t++}),t},toArray:function(e){return Pu(e,function(t){return t})||[]},only:function(e){if(!ag(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ge.Component=Mi;ge.Fragment=x_;ge.Profiler=b_;ge.PureComponent=og;ge.StrictMode=w_;ge.Suspense=k_;ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=M_;ge.act=dx;ge.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=sx({},e.props),o=e.key,s=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,i=ig.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)lx.call(t,l)&&!cx.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 c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:rl,type:e.type,key:o,ref:s,props:r,_owner:i}};ge.createContext=function(e){return e={$$typeof:C_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:E_,_context:e},e.Consumer=e};ge.createElement=ux;ge.createFactory=function(e){var t=ux.bind(null,e);return t.type=e,t};ge.createRef=function(){return{current:null}};ge.forwardRef=function(e){return{$$typeof:T_,render:e}};ge.isValidElement=ag;ge.lazy=function(e){return{$$typeof:P_,_payload:{_status:-1,_result:e},_init:N_}};ge.memo=function(e,t){return{$$typeof:R_,type:e,compare:t===void 0?null:t}};ge.startTransition=function(e){var t=Au.transition;Au.transition={};try{e()}finally{Au.transition=t}};ge.unstable_act=dx;ge.useCallback=function(e,t){return $t.current.useCallback(e,t)};ge.useContext=function(e){return $t.current.useContext(e)};ge.useDebugValue=function(){};ge.useDeferredValue=function(e){return $t.current.useDeferredValue(e)};ge.useEffect=function(e,t){return $t.current.useEffect(e,t)};ge.useId=function(){return $t.current.useId()};ge.useImperativeHandle=function(e,t,n){return $t.current.useImperativeHandle(e,t,n)};ge.useInsertionEffect=function(e,t){return $t.current.useInsertionEffect(e,t)};ge.useLayoutEffect=function(e,t){return $t.current.useLayoutEffect(e,t)};ge.useMemo=function(e,t){return $t.current.useMemo(e,t)};ge.useReducer=function(e,t,n){return $t.current.useReducer(e,t,n)};ge.useRef=function(e){return $t.current.useRef(e)};ge.useState=function(e){return $t.current.useState(e)};ge.useSyncExternalStore=function(e,t,n){return $t.current.useSyncExternalStore(e,t,n)};ge.useTransition=function(){return $t.current.useTransition()};ge.version="18.3.1"});var Z=cn((J6,px)=>{"use strict";px.exports=fx()});var yx=cn(Nu=>{"use strict";var L_=Z(),O_=Symbol.for("react.element"),D_=Symbol.for("react.fragment"),F_=Object.prototype.hasOwnProperty,z_=L_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,H_={key:!0,ref:!0,__self:!0,__source:!0};function hx(e,t,n){var r,o={},s=null,i=null;n!==void 0&&(s=""+n),t.key!==void 0&&(s=""+t.key),t.ref!==void 0&&(i=t.ref);for(r in t)F_.call(t,r)&&!H_.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:O_,type:e,key:s,ref:i,props:o,_owner:z_.current}}Nu.Fragment=D_;Nu.jsx=hx;Nu.jsxs=hx});var P=cn((az,vx)=>{"use strict";vx.exports=yx()});var Vx=cn(Ux=>{"use strict";var sl=Z();function rN(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var oN=typeof Object.is=="function"?Object.is:rN,sN=sl.useSyncExternalStore,iN=sl.useRef,aN=sl.useEffect,lN=sl.useMemo,cN=sl.useDebugValue;Ux.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var s=iN(null);if(s.current===null){var i={hasValue:!1,value:null};s.current=i}else i=s.current;s=lN(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),o!==void 0&&i.hasValue){var h=i.value;if(o(h,p))return f=h}return f=p}if(h=f,oN(u,p))return h;var m=r(p);return o!==void 0&&o(h,m)?(u=p,h):(u=p,f=m)}var c=!1,u,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=sN(e,s[0],s[1]);return aN(function(){i.hasValue=!0,i.value=a},[a]),cN(a),a}});var Wx=cn((M9,jx)=>{"use strict";jx.exports=Vx()});var jE=cn(Fe=>{"use strict";function Mh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<Bd(o,t))e[r]=t,e[n]=o,n=r;else break e}}function nr(e){return e.length===0?null:e[0]}function Vd(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,s=o>>>1;r<s;){var i=2*(r+1)-1,a=e[i],l=i+1,c=e[l];if(0>Bd(a,n))l<o&&0>Bd(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[i]=n,r=i);else if(l<o&&0>Bd(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function Bd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(LE=performance,Fe.unstable_now=function(){return LE.now()}):(Ah=Date,OE=Ah.now(),Fe.unstable_now=function(){return Ah.now()-OE});var LE,Ah,OE,Nr=[],Uo=[],t2=1,Hn=null,Ft=3,jd=!1,Vs=!1,Bl=!1,zE=typeof setTimeout=="function"?setTimeout:null,HE=typeof clearTimeout=="function"?clearTimeout:null,DE=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Lh(e){for(var t=nr(Uo);t!==null;){if(t.callback===null)Vd(Uo);else if(t.startTime<=e)Vd(Uo),t.sortIndex=t.expirationTime,Mh(Nr,t);else break;t=nr(Uo)}}function Oh(e){if(Bl=!1,Lh(e),!Vs)if(nr(Nr)!==null)Vs=!0,Fh(Dh);else{var t=nr(Uo);t!==null&&zh(Oh,t.startTime-e)}}function Dh(e,t){Vs=!1,Bl&&(Bl=!1,HE(Ul),Ul=-1),jd=!0;var n=Ft;try{for(Lh(t),Hn=nr(Nr);Hn!==null&&(!(Hn.expirationTime>t)||e&&!VE());){var r=Hn.callback;if(typeof r=="function"){Hn.callback=null,Ft=Hn.priorityLevel;var o=r(Hn.expirationTime<=t);t=Fe.unstable_now(),typeof o=="function"?Hn.callback=o:Hn===nr(Nr)&&Vd(Nr),Lh(t)}else Vd(Nr);Hn=nr(Nr)}if(Hn!==null)var s=!0;else{var i=nr(Uo);i!==null&&zh(Oh,i.startTime-t),s=!1}return s}finally{Hn=null,Ft=n,jd=!1}}var Wd=!1,Ud=null,Ul=-1,BE=5,UE=-1;function VE(){return!(Fe.unstable_now()-UE<BE)}function _h(){if(Ud!==null){var e=Fe.unstable_now();UE=e;var t=!0;try{t=Ud(!0,e)}finally{t?Hl():(Wd=!1,Ud=null)}}else Wd=!1}var Hl;typeof DE=="function"?Hl=function(){DE(_h)}:typeof MessageChannel!="undefined"?(Nh=new MessageChannel,FE=Nh.port2,Nh.port1.onmessage=_h,Hl=function(){FE.postMessage(null)}):Hl=function(){zE(_h,0)};var Nh,FE;function Fh(e){Ud=e,Wd||(Wd=!0,Hl())}function zh(e,t){Ul=zE(function(){e(Fe.unstable_now())},t)}Fe.unstable_IdlePriority=5;Fe.unstable_ImmediatePriority=1;Fe.unstable_LowPriority=4;Fe.unstable_NormalPriority=3;Fe.unstable_Profiling=null;Fe.unstable_UserBlockingPriority=2;Fe.unstable_cancelCallback=function(e){e.callback=null};Fe.unstable_continueExecution=function(){Vs||jd||(Vs=!0,Fh(Dh))};Fe.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"):BE=0<e?Math.floor(1e3/e):5};Fe.unstable_getCurrentPriorityLevel=function(){return Ft};Fe.unstable_getFirstCallbackNode=function(){return nr(Nr)};Fe.unstable_next=function(e){switch(Ft){case 1:case 2:case 3:var t=3;break;default:t=Ft}var n=Ft;Ft=t;try{return e()}finally{Ft=n}};Fe.unstable_pauseExecution=function(){};Fe.unstable_requestPaint=function(){};Fe.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ft;Ft=e;try{return t()}finally{Ft=n}};Fe.unstable_scheduleCallback=function(e,t,n){var r=Fe.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:t2++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Mh(Uo,e),nr(Nr)===null&&e===nr(Uo)&&(Bl?(HE(Ul),Ul=-1):Bl=!0,zh(Oh,n-r))):(e.sortIndex=o,Mh(Nr,e),Vs||jd||(Vs=!0,Fh(Dh))),e};Fe.unstable_shouldYield=VE;Fe.unstable_wrapCallback=function(e){var t=Ft;return function(){var n=Ft;Ft=t;try{return e.apply(this,arguments)}finally{Ft=n}}}});var $E=cn((S7,WE)=>{"use strict";WE.exports=jE()});var Y1=cn(_n=>{"use strict";var n2=Z(),In=$E();function F(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 ZC=new Set,cc={};function ti(e,t){pa(e,t),pa(e+"Capture",t)}function pa(e,t){for(cc[e]=t,e=0;e<t.length;e++)ZC.add(t[e])}var ao=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),ay=Object.prototype.hasOwnProperty,r2=/^[: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]*$/,KE={},GE={};function o2(e){return ay.call(GE,e)?!0:ay.call(KE,e)?!1:r2.test(e)?GE[e]=!0:(KE[e]=!0,!1)}function s2(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 i2(e,t,n,r){if(t===null||typeof t=="undefined"||s2(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 Zt(e,t,n,r,o,s,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=i}var Mt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Mt[e]=new Zt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Mt[t]=new Zt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Mt[e]=new Zt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Mt[e]=new Zt(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){Mt[e]=new Zt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Mt[e]=new Zt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Mt[e]=new Zt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Mt[e]=new Zt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Mt[e]=new Zt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Jy=/[\-:]([a-z])/g;function ev(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(Jy,ev);Mt[t]=new Zt(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(Jy,ev);Mt[t]=new Zt(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(Jy,ev);Mt[t]=new Zt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Mt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!1,!1)});Mt.xlinkHref=new Zt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Mt[e]=new Zt(e,1,!1,e.toLowerCase(),null,!0,!0)});function tv(e,t,n,r){var o=Mt.hasOwnProperty(t)?Mt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(i2(t,n,o,r)&&(n=null),r||o===null?o2(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 fo=n2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$d=Symbol.for("react.element"),Yi=Symbol.for("react.portal"),Xi=Symbol.for("react.fragment"),nv=Symbol.for("react.strict_mode"),ly=Symbol.for("react.profiler"),JC=Symbol.for("react.provider"),eT=Symbol.for("react.context"),rv=Symbol.for("react.forward_ref"),cy=Symbol.for("react.suspense"),uy=Symbol.for("react.suspense_list"),ov=Symbol.for("react.memo"),jo=Symbol.for("react.lazy"),tT=Symbol.for("react.offscreen"),qE=Symbol.iterator;function Vl(e){return e===null||typeof e!="object"?null:(e=qE&&e[qE]||e["@@iterator"],typeof e=="function"?e:null)}var Ge=Object.assign,Hh;function Xl(e){if(Hh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Hh=t&&t[1]||""}return`
2
- `+Hh+e}var Bh=!1;function Uh(e,t){if(!e||Bh)return"";Bh=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
3
- `),s=r.stack.split(`
4
- `),i=o.length-1,a=s.length-1;1<=i&&0<=a&&o[i]!==s[a];)a--;for(;1<=i&&0<=a;i--,a--)if(o[i]!==s[a]){if(i!==1||a!==1)do if(i--,a--,0>a||o[i]!==s[a]){var l=`
5
- `+o[i].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=i&&0<=a);break}}}finally{Bh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Xl(e):""}function a2(e){switch(e.tag){case 5:return Xl(e.type);case 16:return Xl("Lazy");case 13:return Xl("Suspense");case 19:return Xl("SuspenseList");case 0:case 2:case 15:return e=Uh(e.type,!1),e;case 11:return e=Uh(e.type.render,!1),e;case 1:return e=Uh(e.type,!0),e;default:return""}}function dy(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Xi:return"Fragment";case Yi:return"Portal";case ly:return"Profiler";case nv:return"StrictMode";case cy:return"Suspense";case uy:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case eT:return(e.displayName||"Context")+".Consumer";case JC:return(e._context.displayName||"Context")+".Provider";case rv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ov:return t=e.displayName||null,t!==null?t:dy(e.type)||"Memo";case jo:t=e._payload,e=e._init;try{return dy(e(t))}catch(n){}}return null}function l2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return dy(t);case 8:return t===nv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function rs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c2(e){var t=nT(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n!="undefined"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){r=""+i,s.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kd(e){e._valueTracker||(e._valueTracker=c2(e))}function rT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nT(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function wf(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function fy(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function YE(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=rs(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function oT(e,t){t=t.checked,t!=null&&tv(e,"checked",t,!1)}function py(e,t){oT(e,t);var n=rs(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?my(e,t.type,n):t.hasOwnProperty("defaultValue")&&my(e,t.type,rs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function XE(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function my(e,t,n){(t!=="number"||wf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ql=Array.isArray;function aa(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+rs(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function gy(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(F(91));return Ge({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function QE(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(F(92));if(Ql(n)){if(1<n.length)throw Error(F(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:rs(n)}}function sT(e,t){var n=rs(t.value),r=rs(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function ZE(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function iT(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function hy(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?iT(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gd,aT=(function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gd=Gd||document.createElement("div"),Gd.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function uc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ec={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},u2=["Webkit","ms","Moz","O"];Object.keys(ec).forEach(function(e){u2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ec[t]=ec[e]})});function lT(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ec.hasOwnProperty(e)&&ec[e]?(""+t).trim():t+"px"}function cT(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=lT(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var d2=Ge({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yy(e,t){if(t){if(d2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function vy(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Sy=null;function sv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xy=null,la=null,ca=null;function JE(e){if(e=Pc(e)){if(typeof xy!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Yf(t),xy(e.stateNode,e.type,t))}}function uT(e){la?ca?ca.push(e):ca=[e]:la=e}function dT(){if(la){var e=la,t=ca;if(ca=la=null,JE(e),t)for(e=0;e<t.length;e++)JE(t[e])}}function fT(e,t){return e(t)}function pT(){}var Vh=!1;function mT(e,t,n){if(Vh)return e(t,n);Vh=!0;try{return fT(e,t,n)}finally{Vh=!1,(la!==null||ca!==null)&&(pT(),dT())}}function dc(e,t){var n=e.stateNode;if(n===null)return null;var r=Yf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(F(231,t,typeof n));return n}var wy=!1;if(ao)try{Gi={},Object.defineProperty(Gi,"passive",{get:function(){wy=!0}}),window.addEventListener("test",Gi,Gi),window.removeEventListener("test",Gi,Gi)}catch(e){wy=!1}var Gi;function f2(e,t,n,r,o,s,i,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var tc=!1,bf=null,Ef=!1,by=null,p2={onError:function(e){tc=!0,bf=e}};function m2(e,t,n,r,o,s,i,a,l){tc=!1,bf=null,f2.apply(p2,arguments)}function g2(e,t,n,r,o,s,i,a,l){if(m2.apply(this,arguments),tc){if(tc){var c=bf;tc=!1,bf=null}else throw Error(F(198));Ef||(Ef=!0,by=c)}}function ni(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function gT(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function eC(e){if(ni(e)!==e)throw Error(F(188))}function h2(e){var t=e.alternate;if(!t){if(t=ni(e),t===null)throw Error(F(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var s=o.alternate;if(s===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===s.child){for(s=o.child;s;){if(s===n)return eC(o),e;if(s===r)return eC(o),t;s=s.sibling}throw Error(F(188))}if(n.return!==r.return)n=o,r=s;else{for(var i=!1,a=o.child;a;){if(a===n){i=!0,n=o,r=s;break}if(a===r){i=!0,r=o,n=s;break}a=a.sibling}if(!i){for(a=s.child;a;){if(a===n){i=!0,n=s,r=o;break}if(a===r){i=!0,r=s,n=o;break}a=a.sibling}if(!i)throw Error(F(189))}}if(n.alternate!==r)throw Error(F(190))}if(n.tag!==3)throw Error(F(188));return n.stateNode.current===n?e:t}function hT(e){return e=h2(e),e!==null?yT(e):null}function yT(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=yT(e);if(t!==null)return t;e=e.sibling}return null}var vT=In.unstable_scheduleCallback,tC=In.unstable_cancelCallback,y2=In.unstable_shouldYield,v2=In.unstable_requestPaint,Je=In.unstable_now,S2=In.unstable_getCurrentPriorityLevel,iv=In.unstable_ImmediatePriority,ST=In.unstable_UserBlockingPriority,Cf=In.unstable_NormalPriority,x2=In.unstable_LowPriority,xT=In.unstable_IdlePriority,$f=null,Dr=null;function w2(e){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot($f,e,void 0,(e.current.flags&128)===128)}catch(t){}}var ar=Math.clz32?Math.clz32:C2,b2=Math.log,E2=Math.LN2;function C2(e){return e>>>=0,e===0?32:31-(b2(e)/E2|0)|0}var qd=64,Yd=4194304;function Zl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Tf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,s=e.pingedLanes,i=n&268435455;if(i!==0){var a=i&~o;a!==0?r=Zl(a):(s&=i,s!==0&&(r=Zl(s)))}else i=n&~o,i!==0?r=Zl(i):s!==0&&(r=Zl(s));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,s=t&-t,o>=s||o===16&&(s&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ar(t),o=1<<n,r|=e[n],t&=~o;return r}function T2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function k2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,s=e.pendingLanes;0<s;){var i=31-ar(s),a=1<<i,l=o[i];l===-1?((a&n)===0||(a&r)!==0)&&(o[i]=T2(a,t)):l<=t&&(e.expiredLanes|=a),s&=~a}}function Ey(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function wT(){var e=qd;return qd<<=1,(qd&4194240)===0&&(qd=64),e}function jh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function kc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ar(t),e[t]=n}function R2(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-ar(n),s=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~s}}function av(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ar(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var _e=0;function bT(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var ET,lv,CT,TT,kT,Cy=!1,Xd=[],Yo=null,Xo=null,Qo=null,fc=new Map,pc=new Map,$o=[],P2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function nC(e,t){switch(e){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Xo=null;break;case"mouseover":case"mouseout":Qo=null;break;case"pointerover":case"pointerout":fc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pc.delete(t.pointerId)}}function jl(e,t,n,r,o,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[o]},t!==null&&(t=Pc(t),t!==null&&lv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function I2(e,t,n,r,o){switch(t){case"focusin":return Yo=jl(Yo,e,t,n,r,o),!0;case"dragenter":return Xo=jl(Xo,e,t,n,r,o),!0;case"mouseover":return Qo=jl(Qo,e,t,n,r,o),!0;case"pointerover":var s=o.pointerId;return fc.set(s,jl(fc.get(s)||null,e,t,n,r,o)),!0;case"gotpointercapture":return s=o.pointerId,pc.set(s,jl(pc.get(s)||null,e,t,n,r,o)),!0}return!1}function RT(e){var t=$s(e.target);if(t!==null){var n=ni(t);if(n!==null){if(t=n.tag,t===13){if(t=gT(n),t!==null){e.blockedOn=t,kT(e.priority,function(){CT(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function df(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ty(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Sy=r,n.target.dispatchEvent(r),Sy=null}else return t=Pc(n),t!==null&&lv(t),e.blockedOn=n,!1;t.shift()}return!0}function rC(e,t,n){df(e)&&n.delete(t)}function A2(){Cy=!1,Yo!==null&&df(Yo)&&(Yo=null),Xo!==null&&df(Xo)&&(Xo=null),Qo!==null&&df(Qo)&&(Qo=null),fc.forEach(rC),pc.forEach(rC)}function Wl(e,t){e.blockedOn===t&&(e.blockedOn=null,Cy||(Cy=!0,In.unstable_scheduleCallback(In.unstable_NormalPriority,A2)))}function mc(e){function t(o){return Wl(o,e)}if(0<Xd.length){Wl(Xd[0],e);for(var n=1;n<Xd.length;n++){var r=Xd[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yo!==null&&Wl(Yo,e),Xo!==null&&Wl(Xo,e),Qo!==null&&Wl(Qo,e),fc.forEach(t),pc.forEach(t),n=0;n<$o.length;n++)r=$o[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<$o.length&&(n=$o[0],n.blockedOn===null);)RT(n),n.blockedOn===null&&$o.shift()}var ua=fo.ReactCurrentBatchConfig,kf=!0;function _2(e,t,n,r){var o=_e,s=ua.transition;ua.transition=null;try{_e=1,cv(e,t,n,r)}finally{_e=o,ua.transition=s}}function N2(e,t,n,r){var o=_e,s=ua.transition;ua.transition=null;try{_e=4,cv(e,t,n,r)}finally{_e=o,ua.transition=s}}function cv(e,t,n,r){if(kf){var o=Ty(e,t,n,r);if(o===null)Xh(e,t,r,Rf,n),nC(e,r);else if(I2(o,e,t,n,r))r.stopPropagation();else if(nC(e,r),t&4&&-1<P2.indexOf(e)){for(;o!==null;){var s=Pc(o);if(s!==null&&ET(s),s=Ty(e,t,n,r),s===null&&Xh(e,t,r,Rf,n),s===o)break;o=s}o!==null&&r.stopPropagation()}else Xh(e,t,r,null,n)}}var Rf=null;function Ty(e,t,n,r){if(Rf=null,e=sv(r),e=$s(e),e!==null)if(t=ni(e),t===null)e=null;else if(n=t.tag,n===13){if(e=gT(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Rf=e,null}function PT(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(S2()){case iv:return 1;case ST:return 4;case Cf:case x2:return 16;case xT:return 536870912;default:return 16}default:return 16}}var Go=null,uv=null,ff=null;function IT(){if(ff)return ff;var e,t=uv,n=t.length,r,o="value"in Go?Go.value:Go.textContent,s=o.length;for(e=0;e<n&&t[e]===o[e];e++);var i=n-e;for(r=1;r<=i&&t[n-r]===o[s-r];r++);return ff=o.slice(e,1<r?1-r:void 0)}function pf(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qd(){return!0}function oC(){return!1}function An(e){function t(n,r,o,s,i){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=s,this.target=i,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Qd:oC,this.isPropagationStopped=oC,this}return Ge(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Qd)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Qd)},persist:function(){},isPersistent:Qd}),t}var xa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dv=An(xa),Rc=Ge({},xa,{view:0,detail:0}),M2=An(Rc),Wh,$h,$l,Kf=Ge({},Rc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:fv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$l&&($l&&e.type==="mousemove"?(Wh=e.screenX-$l.screenX,$h=e.screenY-$l.screenY):$h=Wh=0,$l=e),Wh)},movementY:function(e){return"movementY"in e?e.movementY:$h}}),sC=An(Kf),L2=Ge({},Kf,{dataTransfer:0}),O2=An(L2),D2=Ge({},Rc,{relatedTarget:0}),Kh=An(D2),F2=Ge({},xa,{animationName:0,elapsedTime:0,pseudoElement:0}),z2=An(F2),H2=Ge({},xa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),B2=An(H2),U2=Ge({},xa,{data:0}),iC=An(U2),V2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},j2={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},W2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $2(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=W2[e])?!!t[e]:!1}function fv(){return $2}var K2=Ge({},Rc,{key:function(e){if(e.key){var t=V2[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=pf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?j2[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:fv,charCode:function(e){return e.type==="keypress"?pf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?pf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),G2=An(K2),q2=Ge({},Kf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),aC=An(q2),Y2=Ge({},Rc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:fv}),X2=An(Y2),Q2=Ge({},xa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Z2=An(Q2),J2=Ge({},Kf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),eD=An(J2),tD=[9,13,27,32],pv=ao&&"CompositionEvent"in window,nc=null;ao&&"documentMode"in document&&(nc=document.documentMode);var nD=ao&&"TextEvent"in window&&!nc,AT=ao&&(!pv||nc&&8<nc&&11>=nc),lC=" ",cC=!1;function _T(e,t){switch(e){case"keyup":return tD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function NT(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qi=!1;function rD(e,t){switch(e){case"compositionend":return NT(t);case"keypress":return t.which!==32?null:(cC=!0,lC);case"textInput":return e=t.data,e===lC&&cC?null:e;default:return null}}function oD(e,t){if(Qi)return e==="compositionend"||!pv&&_T(e,t)?(e=IT(),ff=uv=Go=null,Qi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return AT&&t.locale!=="ko"?null:t.data;default:return null}}var sD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function uC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!sD[e.type]:t==="textarea"}function MT(e,t,n,r){uT(r),t=Pf(t,"onChange"),0<t.length&&(n=new dv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var rc=null,gc=null;function iD(e){WT(e,0)}function Gf(e){var t=ea(e);if(rT(t))return e}function aD(e,t){if(e==="change")return t}var LT=!1;ao&&(ao?(Jd="oninput"in document,Jd||(Gh=document.createElement("div"),Gh.setAttribute("oninput","return;"),Jd=typeof Gh.oninput=="function"),Zd=Jd):Zd=!1,LT=Zd&&(!document.documentMode||9<document.documentMode));var Zd,Jd,Gh;function dC(){rc&&(rc.detachEvent("onpropertychange",OT),gc=rc=null)}function OT(e){if(e.propertyName==="value"&&Gf(gc)){var t=[];MT(t,gc,e,sv(e)),mT(iD,t)}}function lD(e,t,n){e==="focusin"?(dC(),rc=t,gc=n,rc.attachEvent("onpropertychange",OT)):e==="focusout"&&dC()}function cD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Gf(gc)}function uD(e,t){if(e==="click")return Gf(t)}function dD(e,t){if(e==="input"||e==="change")return Gf(t)}function fD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var cr=typeof Object.is=="function"?Object.is:fD;function hc(e,t){if(cr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!ay.call(t,o)||!cr(e[o],t[o]))return!1}return!0}function fC(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pC(e,t){var n=fC(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=fC(n)}}function DT(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?DT(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function FT(){for(var e=window,t=wf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=wf(e.document)}return t}function mv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function pD(e){var t=FT(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&DT(n.ownerDocument.documentElement,n)){if(r!==null&&mv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,s=Math.min(r.start,o);r=r.end===void 0?s:Math.min(r.end,o),!e.extend&&s>r&&(o=r,r=s,s=o),o=pC(n,s);var i=pC(n,r);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var mD=ao&&"documentMode"in document&&11>=document.documentMode,Zi=null,ky=null,oc=null,Ry=!1;function mC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ry||Zi==null||Zi!==wf(r)||(r=Zi,"selectionStart"in r&&mv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),oc&&hc(oc,r)||(oc=r,r=Pf(ky,"onSelect"),0<r.length&&(t=new dv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zi)))}function ef(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ji={animationend:ef("Animation","AnimationEnd"),animationiteration:ef("Animation","AnimationIteration"),animationstart:ef("Animation","AnimationStart"),transitionend:ef("Transition","TransitionEnd")},qh={},zT={};ao&&(zT=document.createElement("div").style,"AnimationEvent"in window||(delete Ji.animationend.animation,delete Ji.animationiteration.animation,delete Ji.animationstart.animation),"TransitionEvent"in window||delete Ji.transitionend.transition);function qf(e){if(qh[e])return qh[e];if(!Ji[e])return e;var t=Ji[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zT)return qh[e]=t[n];return e}var HT=qf("animationend"),BT=qf("animationiteration"),UT=qf("animationstart"),VT=qf("transitionend"),jT=new Map,gC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function ss(e,t){jT.set(e,t),ti(t,[e])}for(tf=0;tf<gC.length;tf++)nf=gC[tf],hC=nf.toLowerCase(),yC=nf[0].toUpperCase()+nf.slice(1),ss(hC,"on"+yC);var nf,hC,yC,tf;ss(HT,"onAnimationEnd");ss(BT,"onAnimationIteration");ss(UT,"onAnimationStart");ss("dblclick","onDoubleClick");ss("focusin","onFocus");ss("focusout","onBlur");ss(VT,"onTransitionEnd");pa("onMouseEnter",["mouseout","mouseover"]);pa("onMouseLeave",["mouseout","mouseover"]);pa("onPointerEnter",["pointerout","pointerover"]);pa("onPointerLeave",["pointerout","pointerover"]);ti("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ti("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ti("onBeforeInput",["compositionend","keypress","textInput","paste"]);ti("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ti("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ti("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),gD=new Set("cancel close invalid load scroll toggle".split(" ").concat(Jl));function vC(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,g2(r,t,void 0,e),e.currentTarget=null}function WT(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var i=r.length-1;0<=i;i--){var a=r[i],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==s&&o.isPropagationStopped())break e;vC(o,a,c),s=l}else for(i=0;i<r.length;i++){if(a=r[i],l=a.instance,c=a.currentTarget,a=a.listener,l!==s&&o.isPropagationStopped())break e;vC(o,a,c),s=l}}}if(Ef)throw e=by,Ef=!1,by=null,e}function Be(e,t){var n=t[Ny];n===void 0&&(n=t[Ny]=new Set);var r=e+"__bubble";n.has(r)||($T(t,e,2,!1),n.add(r))}function Yh(e,t,n){var r=0;t&&(r|=4),$T(n,e,r,t)}var rf="_reactListening"+Math.random().toString(36).slice(2);function yc(e){if(!e[rf]){e[rf]=!0,ZC.forEach(function(n){n!=="selectionchange"&&(gD.has(n)||Yh(n,!1,e),Yh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[rf]||(t[rf]=!0,Yh("selectionchange",!1,t))}}function $T(e,t,n,r){switch(PT(t)){case 1:var o=_2;break;case 4:o=N2;break;default:o=cv}n=o.bind(null,t,n,e),o=void 0,!wy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Xh(e,t,n,r,o){var s=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var i=r.tag;if(i===3||i===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(i===4)for(i=r.return;i!==null;){var l=i.tag;if((l===3||l===4)&&(l=i.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;i=i.return}for(;a!==null;){if(i=$s(a),i===null)return;if(l=i.tag,l===5||l===6){r=s=i;continue e}a=a.parentNode}}r=r.return}mT(function(){var c=s,u=sv(n),f=[];e:{var d=jT.get(e);if(d!==void 0){var p=dv,h=e;switch(e){case"keypress":if(pf(n)===0)break e;case"keydown":case"keyup":p=G2;break;case"focusin":h="focus",p=Kh;break;case"focusout":h="blur",p=Kh;break;case"beforeblur":case"afterblur":p=Kh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=sC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=O2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=X2;break;case HT:case BT:case UT:p=z2;break;case VT:p=Z2;break;case"scroll":p=M2;break;case"wheel":p=eD;break;case"copy":case"cut":case"paste":p=B2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=aC}var m=(t&4)!==0,S=!m&&e==="scroll",y=m?d!==null?d+"Capture":null:d;m=[];for(var g=c,v;g!==null;){v=g;var x=v.stateNode;if(v.tag===5&&x!==null&&(v=x,y!==null&&(x=dc(g,y),x!=null&&m.push(vc(g,x,v)))),S)break;g=g.return}0<m.length&&(d=new p(d,h,null,n,u),f.push({event:d,listeners:m}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",d&&n!==Sy&&(h=n.relatedTarget||n.fromElement)&&($s(h)||h[lo]))break e;if((p||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,p?(h=n.relatedTarget||n.toElement,p=c,h=h?$s(h):null,h!==null&&(S=ni(h),h!==S||h.tag!==5&&h.tag!==6)&&(h=null)):(p=null,h=c),p!==h)){if(m=sC,x="onMouseLeave",y="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=aC,x="onPointerLeave",y="onPointerEnter",g="pointer"),S=p==null?d:ea(p),v=h==null?d:ea(h),d=new m(x,g+"leave",p,n,u),d.target=S,d.relatedTarget=v,x=null,$s(u)===c&&(m=new m(y,g+"enter",h,n,u),m.target=v,m.relatedTarget=S,x=m),S=x,p&&h)t:{for(m=p,y=h,g=0,v=m;v;v=qi(v))g++;for(v=0,x=y;x;x=qi(x))v++;for(;0<g-v;)m=qi(m),g--;for(;0<v-g;)y=qi(y),v--;for(;g--;){if(m===y||y!==null&&m===y.alternate)break t;m=qi(m),y=qi(y)}m=null}else m=null;p!==null&&SC(f,d,p,m,!1),h!==null&&S!==null&&SC(f,S,h,m,!0)}}e:{if(d=c?ea(c):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var C=aD;else if(uC(d))if(LT)C=dD;else{C=cD;var T=lD}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(C=uD);if(C&&(C=C(e,c))){MT(f,C,n,u);break e}T&&T(e,d,c),e==="focusout"&&(T=d._wrapperState)&&T.controlled&&d.type==="number"&&my(d,"number",d.value)}switch(T=c?ea(c):window,e){case"focusin":(uC(T)||T.contentEditable==="true")&&(Zi=T,ky=c,oc=null);break;case"focusout":oc=ky=Zi=null;break;case"mousedown":Ry=!0;break;case"contextmenu":case"mouseup":case"dragend":Ry=!1,mC(f,n,u);break;case"selectionchange":if(mD)break;case"keydown":case"keyup":mC(f,n,u)}var k;if(pv)e:{switch(e){case"compositionstart":var A="onCompositionStart";break e;case"compositionend":A="onCompositionEnd";break e;case"compositionupdate":A="onCompositionUpdate";break e}A=void 0}else Qi?_T(e,n)&&(A="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(A="onCompositionStart");A&&(AT&&n.locale!=="ko"&&(Qi||A!=="onCompositionStart"?A==="onCompositionEnd"&&Qi&&(k=IT()):(Go=u,uv="value"in Go?Go.value:Go.textContent,Qi=!0)),T=Pf(c,A),0<T.length&&(A=new iC(A,e,null,n,u),f.push({event:A,listeners:T}),k?A.data=k:(k=NT(n),k!==null&&(A.data=k)))),(k=nD?rD(e,n):oD(e,n))&&(c=Pf(c,"onBeforeInput"),0<c.length&&(u=new iC("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=k))}WT(f,t)})}function vc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Pf(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,s=o.stateNode;o.tag===5&&s!==null&&(o=s,s=dc(e,n),s!=null&&r.unshift(vc(e,s,o)),s=dc(e,t),s!=null&&r.push(vc(e,s,o))),e=e.return}return r}function qi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function SC(e,t,n,r,o){for(var s=t._reactName,i=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=dc(n,s),l!=null&&i.unshift(vc(n,l,a))):o||(l=dc(n,s),l!=null&&i.push(vc(n,l,a)))),n=n.return}i.length!==0&&e.push({event:t,listeners:i})}var hD=/\r\n?/g,yD=/\u0000|\uFFFD/g;function xC(e){return(typeof e=="string"?e:""+e).replace(hD,`
6
- `).replace(yD,"")}function of(e,t,n){if(t=xC(t),xC(e)!==t&&n)throw Error(F(425))}function If(){}var Py=null,Iy=null;function Ay(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var _y=typeof setTimeout=="function"?setTimeout:void 0,vD=typeof clearTimeout=="function"?clearTimeout:void 0,wC=typeof Promise=="function"?Promise:void 0,SD=typeof queueMicrotask=="function"?queueMicrotask:typeof wC!="undefined"?function(e){return wC.resolve(null).then(e).catch(xD)}:_y;function xD(e){setTimeout(function(){throw e})}function Qh(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),mc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);mc(t)}function Zo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function bC(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var wa=Math.random().toString(36).slice(2),Or="__reactFiber$"+wa,Sc="__reactProps$"+wa,lo="__reactContainer$"+wa,Ny="__reactEvents$"+wa,wD="__reactListeners$"+wa,bD="__reactHandles$"+wa;function $s(e){var t=e[Or];if(t)return t;for(var n=e.parentNode;n;){if(t=n[lo]||n[Or]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=bC(e);e!==null;){if(n=e[Or])return n;e=bC(e)}return t}e=n,n=e.parentNode}return null}function Pc(e){return e=e[Or]||e[lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ea(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(F(33))}function Yf(e){return e[Sc]||null}var My=[],ta=-1;function is(e){return{current:e}}function Ue(e){0>ta||(e.current=My[ta],My[ta]=null,ta--)}function ze(e,t){ta++,My[ta]=e.current,e.current=t}var os={},Ut=is(os),gn=is(!1),Xs=os;function ma(e,t){var n=e.type.contextTypes;if(!n)return os;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},s;for(s in n)o[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function hn(e){return e=e.childContextTypes,e!=null}function Af(){Ue(gn),Ue(Ut)}function EC(e,t,n){if(Ut.current!==os)throw Error(F(168));ze(Ut,t),ze(gn,n)}function KT(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(F(108,l2(e)||"Unknown",o));return Ge({},n,r)}function _f(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||os,Xs=Ut.current,ze(Ut,e),ze(gn,gn.current),!0}function CC(e,t,n){var r=e.stateNode;if(!r)throw Error(F(169));n?(e=KT(e,t,Xs),r.__reactInternalMemoizedMergedChildContext=e,Ue(gn),Ue(Ut),ze(Ut,e)):Ue(gn),ze(gn,n)}var ro=null,Xf=!1,Zh=!1;function GT(e){ro===null?ro=[e]:ro.push(e)}function ED(e){Xf=!0,GT(e)}function as(){if(!Zh&&ro!==null){Zh=!0;var e=0,t=_e;try{var n=ro;for(_e=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ro=null,Xf=!1}catch(o){throw ro!==null&&(ro=ro.slice(e+1)),vT(iv,as),o}finally{_e=t,Zh=!1}}return null}var na=[],ra=0,Nf=null,Mf=0,Bn=[],Un=0,Qs=null,oo=1,so="";function js(e,t){na[ra++]=Mf,na[ra++]=Nf,Nf=e,Mf=t}function qT(e,t,n){Bn[Un++]=oo,Bn[Un++]=so,Bn[Un++]=Qs,Qs=e;var r=oo;e=so;var o=32-ar(r)-1;r&=~(1<<o),n+=1;var s=32-ar(t)+o;if(30<s){var i=o-o%5;s=(r&(1<<i)-1).toString(32),r>>=i,o-=i,oo=1<<32-ar(t)+o|n<<o|r,so=s+e}else oo=1<<s|n<<o|r,so=e}function gv(e){e.return!==null&&(js(e,1),qT(e,1,0))}function hv(e){for(;e===Nf;)Nf=na[--ra],na[ra]=null,Mf=na[--ra],na[ra]=null;for(;e===Qs;)Qs=Bn[--Un],Bn[Un]=null,so=Bn[--Un],Bn[Un]=null,oo=Bn[--Un],Bn[Un]=null}var Pn=null,Rn=null,je=!1,ir=null;function YT(e,t){var n=Vn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function TC(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Pn=e,Rn=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Pn=e,Rn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Qs!==null?{id:oo,overflow:so}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Vn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Pn=e,Rn=null,!0):!1;default:return!1}}function Ly(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Oy(e){if(je){var t=Rn;if(t){var n=t;if(!TC(e,t)){if(Ly(e))throw Error(F(418));t=Zo(n.nextSibling);var r=Pn;t&&TC(e,t)?YT(r,n):(e.flags=e.flags&-4097|2,je=!1,Pn=e)}}else{if(Ly(e))throw Error(F(418));e.flags=e.flags&-4097|2,je=!1,Pn=e}}}function kC(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Pn=e}function sf(e){if(e!==Pn)return!1;if(!je)return kC(e),je=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Ay(e.type,e.memoizedProps)),t&&(t=Rn)){if(Ly(e))throw XT(),Error(F(418));for(;t;)YT(e,t),t=Zo(t.nextSibling)}if(kC(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(F(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Rn=Zo(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Rn=null}}else Rn=Pn?Zo(e.stateNode.nextSibling):null;return!0}function XT(){for(var e=Rn;e;)e=Zo(e.nextSibling)}function ga(){Rn=Pn=null,je=!1}function yv(e){ir===null?ir=[e]:ir.push(e)}var CD=fo.ReactCurrentBatchConfig;function Kl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(F(309));var r=n.stateNode}if(!r)throw Error(F(147,e));var o=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(i){var a=o.refs;i===null?delete a[s]:a[s]=i},t._stringRef=s,t)}if(typeof e!="string")throw Error(F(284));if(!n._owner)throw Error(F(290,e))}return e}function af(e,t){throw e=Object.prototype.toString.call(t),Error(F(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function RC(e){var t=e._init;return t(e._payload)}function QT(e){function t(y,g){if(e){var v=y.deletions;v===null?(y.deletions=[g],y.flags|=16):v.push(g)}}function n(y,g){if(!e)return null;for(;g!==null;)t(y,g),g=g.sibling;return null}function r(y,g){for(y=new Map;g!==null;)g.key!==null?y.set(g.key,g):y.set(g.index,g),g=g.sibling;return y}function o(y,g){return y=ns(y,g),y.index=0,y.sibling=null,y}function s(y,g,v){return y.index=v,e?(v=y.alternate,v!==null?(v=v.index,v<g?(y.flags|=2,g):v):(y.flags|=2,g)):(y.flags|=1048576,g)}function i(y){return e&&y.alternate===null&&(y.flags|=2),y}function a(y,g,v,x){return g===null||g.tag!==6?(g=sy(v,y.mode,x),g.return=y,g):(g=o(g,v),g.return=y,g)}function l(y,g,v,x){var C=v.type;return C===Xi?u(y,g,v.props.children,x,v.key):g!==null&&(g.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jo&&RC(C)===g.type)?(x=o(g,v.props),x.ref=Kl(y,g,v),x.return=y,x):(x=xf(v.type,v.key,v.props,null,y.mode,x),x.ref=Kl(y,g,v),x.return=y,x)}function c(y,g,v,x){return g===null||g.tag!==4||g.stateNode.containerInfo!==v.containerInfo||g.stateNode.implementation!==v.implementation?(g=iy(v,y.mode,x),g.return=y,g):(g=o(g,v.children||[]),g.return=y,g)}function u(y,g,v,x,C){return g===null||g.tag!==7?(g=Ys(v,y.mode,x,C),g.return=y,g):(g=o(g,v),g.return=y,g)}function f(y,g,v){if(typeof g=="string"&&g!==""||typeof g=="number")return g=sy(""+g,y.mode,v),g.return=y,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case $d:return v=xf(g.type,g.key,g.props,null,y.mode,v),v.ref=Kl(y,null,g),v.return=y,v;case Yi:return g=iy(g,y.mode,v),g.return=y,g;case jo:var x=g._init;return f(y,x(g._payload),v)}if(Ql(g)||Vl(g))return g=Ys(g,y.mode,v,null),g.return=y,g;af(y,g)}return null}function d(y,g,v,x){var C=g!==null?g.key:null;if(typeof v=="string"&&v!==""||typeof v=="number")return C!==null?null:a(y,g,""+v,x);if(typeof v=="object"&&v!==null){switch(v.$$typeof){case $d:return v.key===C?l(y,g,v,x):null;case Yi:return v.key===C?c(y,g,v,x):null;case jo:return C=v._init,d(y,g,C(v._payload),x)}if(Ql(v)||Vl(v))return C!==null?null:u(y,g,v,x,null);af(y,v)}return null}function p(y,g,v,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return y=y.get(v)||null,a(g,y,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case $d:return y=y.get(x.key===null?v:x.key)||null,l(g,y,x,C);case Yi:return y=y.get(x.key===null?v:x.key)||null,c(g,y,x,C);case jo:var T=x._init;return p(y,g,v,T(x._payload),C)}if(Ql(x)||Vl(x))return y=y.get(v)||null,u(g,y,x,C,null);af(g,x)}return null}function h(y,g,v,x){for(var C=null,T=null,k=g,A=g=0,H=null;k!==null&&A<v.length;A++){k.index>A?(H=k,k=null):H=k.sibling;var D=d(y,k,v[A],x);if(D===null){k===null&&(k=H);break}e&&k&&D.alternate===null&&t(y,k),g=s(D,g,A),T===null?C=D:T.sibling=D,T=D,k=H}if(A===v.length)return n(y,k),je&&js(y,A),C;if(k===null){for(;A<v.length;A++)k=f(y,v[A],x),k!==null&&(g=s(k,g,A),T===null?C=k:T.sibling=k,T=k);return je&&js(y,A),C}for(k=r(y,k);A<v.length;A++)H=p(k,y,A,v[A],x),H!==null&&(e&&H.alternate!==null&&k.delete(H.key===null?A:H.key),g=s(H,g,A),T===null?C=H:T.sibling=H,T=H);return e&&k.forEach(function(B){return t(y,B)}),je&&js(y,A),C}function m(y,g,v,x){var C=Vl(v);if(typeof C!="function")throw Error(F(150));if(v=C.call(v),v==null)throw Error(F(151));for(var T=C=null,k=g,A=g=0,H=null,D=v.next();k!==null&&!D.done;A++,D=v.next()){k.index>A?(H=k,k=null):H=k.sibling;var B=d(y,k,D.value,x);if(B===null){k===null&&(k=H);break}e&&k&&B.alternate===null&&t(y,k),g=s(B,g,A),T===null?C=B:T.sibling=B,T=B,k=H}if(D.done)return n(y,k),je&&js(y,A),C;if(k===null){for(;!D.done;A++,D=v.next())D=f(y,D.value,x),D!==null&&(g=s(D,g,A),T===null?C=D:T.sibling=D,T=D);return je&&js(y,A),C}for(k=r(y,k);!D.done;A++,D=v.next())D=p(k,y,A,D.value,x),D!==null&&(e&&D.alternate!==null&&k.delete(D.key===null?A:D.key),g=s(D,g,A),T===null?C=D:T.sibling=D,T=D);return e&&k.forEach(function(J){return t(y,J)}),je&&js(y,A),C}function S(y,g,v,x){if(typeof v=="object"&&v!==null&&v.type===Xi&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case $d:e:{for(var C=v.key,T=g;T!==null;){if(T.key===C){if(C=v.type,C===Xi){if(T.tag===7){n(y,T.sibling),g=o(T,v.props.children),g.return=y,y=g;break e}}else if(T.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===jo&&RC(C)===T.type){n(y,T.sibling),g=o(T,v.props),g.ref=Kl(y,T,v),g.return=y,y=g;break e}n(y,T);break}else t(y,T);T=T.sibling}v.type===Xi?(g=Ys(v.props.children,y.mode,x,v.key),g.return=y,y=g):(x=xf(v.type,v.key,v.props,null,y.mode,x),x.ref=Kl(y,g,v),x.return=y,y=x)}return i(y);case Yi:e:{for(T=v.key;g!==null;){if(g.key===T)if(g.tag===4&&g.stateNode.containerInfo===v.containerInfo&&g.stateNode.implementation===v.implementation){n(y,g.sibling),g=o(g,v.children||[]),g.return=y,y=g;break e}else{n(y,g);break}else t(y,g);g=g.sibling}g=iy(v,y.mode,x),g.return=y,y=g}return i(y);case jo:return T=v._init,S(y,g,T(v._payload),x)}if(Ql(v))return h(y,g,v,x);if(Vl(v))return m(y,g,v,x);af(y,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,g!==null&&g.tag===6?(n(y,g.sibling),g=o(g,v),g.return=y,y=g):(n(y,g),g=sy(v,y.mode,x),g.return=y,y=g),i(y)):n(y,g)}return S}var ha=QT(!0),ZT=QT(!1),Lf=is(null),Of=null,oa=null,vv=null;function Sv(){vv=oa=Of=null}function xv(e){var t=Lf.current;Ue(Lf),e._currentValue=t}function Dy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function da(e,t){Of=e,vv=oa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(mn=!0),e.firstContext=null)}function Wn(e){var t=e._currentValue;if(vv!==e)if(e={context:e,memoizedValue:t,next:null},oa===null){if(Of===null)throw Error(F(308));oa=e,Of.dependencies={lanes:0,firstContext:e}}else oa=oa.next=e;return t}var Ks=null;function wv(e){Ks===null?Ks=[e]:Ks.push(e)}function JT(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,wv(t)):(n.next=o.next,o.next=n),t.interleaved=n,co(e,r)}function co(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}var Wo=!1;function bv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function io(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Jo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ee&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,co(e,n)}return o=r.interleaved,o===null?(t.next=t,wv(r)):(t.next=o.next,o.next=t),r.interleaved=t,co(e,n)}function mf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,av(e,n)}}function PC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var i={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?o=s=i:s=s.next=i,n=n.next}while(n!==null);s===null?o=s=t:s=s.next=t}else o=s=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Df(e,t,n,r){var o=e.updateQueue;Wo=!1;var s=o.firstBaseUpdate,i=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,i===null?s=c:i.next=c,i=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==i&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(s!==null){var f=o.baseState;i=0,u=c=l=null,a=s;do{var d=a.lane,p=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var h=e,m=a;switch(d=t,p=n,m.tag){case 1:if(h=m.payload,typeof h=="function"){f=h.call(p,f,d);break e}f=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,d=typeof h=="function"?h.call(p,f,d):h,d==null)break e;f=Ge({},f,d);break e;case 2:Wo=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[a]:d.push(a))}else p={eventTime:p,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,i|=d;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;d=a,a=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(u===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else s===null&&(o.shared.lanes=0);Js|=i,e.lanes=i,e.memoizedState=f}}function IC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(F(191,o));o.call(r)}}}var Ic={},Fr=is(Ic),xc=is(Ic),wc=is(Ic);function Gs(e){if(e===Ic)throw Error(F(174));return e}function Ev(e,t){switch(ze(wc,t),ze(xc,e),ze(Fr,Ic),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:hy(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=hy(t,e)}Ue(Fr),ze(Fr,t)}function ya(){Ue(Fr),Ue(xc),Ue(wc)}function t1(e){Gs(wc.current);var t=Gs(Fr.current),n=hy(t,e.type);t!==n&&(ze(xc,e),ze(Fr,n))}function Cv(e){xc.current===e&&(Ue(Fr),Ue(xc))}var $e=is(0);function Ff(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Jh=[];function Tv(){for(var e=0;e<Jh.length;e++)Jh[e]._workInProgressVersionPrimary=null;Jh.length=0}var gf=fo.ReactCurrentDispatcher,ey=fo.ReactCurrentBatchConfig,Zs=0,Ke=null,ct=null,St=null,zf=!1,sc=!1,bc=0,TD=0;function zt(){throw Error(F(321))}function kv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!cr(e[n],t[n]))return!1;return!0}function Rv(e,t,n,r,o,s){if(Zs=s,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,gf.current=e===null||e.memoizedState===null?ID:AD,e=n(r,o),sc){s=0;do{if(sc=!1,bc=0,25<=s)throw Error(F(301));s+=1,St=ct=null,t.updateQueue=null,gf.current=_D,e=n(r,o)}while(sc)}if(gf.current=Hf,t=ct!==null&&ct.next!==null,Zs=0,St=ct=Ke=null,zf=!1,t)throw Error(F(300));return e}function Pv(){var e=bc!==0;return bc=0,e}function Lr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Ke.memoizedState=St=e:St=St.next=e,St}function $n(){if(ct===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=St===null?Ke.memoizedState:St.next;if(t!==null)St=t,ct=e;else{if(e===null)throw Error(F(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},St===null?Ke.memoizedState=St=e:St=St.next=e}return St}function Ec(e,t){return typeof t=="function"?t(e):t}function ty(e){var t=$n(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=ct,o=r.baseQueue,s=n.pending;if(s!==null){if(o!==null){var i=o.next;o.next=s.next,s.next=i}r.baseQueue=o=s,n.pending=null}if(o!==null){s=o.next,r=r.baseState;var a=i=null,l=null,c=s;do{var u=c.lane;if((Zs&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,i=r):l=l.next=f,Ke.lanes|=u,Js|=u}c=c.next}while(c!==null&&c!==s);l===null?i=r:l.next=a,cr(r,t.memoizedState)||(mn=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do s=o.lane,Ke.lanes|=s,Js|=s,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ny(e){var t=$n(),n=t.queue;if(n===null)throw Error(F(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,s=t.memoizedState;if(o!==null){n.pending=null;var i=o=o.next;do s=e(s,i.action),i=i.next;while(i!==o);cr(s,t.memoizedState)||(mn=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function n1(){}function r1(e,t){var n=Ke,r=$n(),o=t(),s=!cr(r.memoizedState,o);if(s&&(r.memoizedState=o,mn=!0),r=r.queue,Iv(i1.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||St!==null&&St.memoizedState.tag&1){if(n.flags|=2048,Cc(9,s1.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(F(349));(Zs&30)!==0||o1(n,t,o)}return o}function o1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function s1(e,t,n,r){t.value=n,t.getSnapshot=r,a1(t)&&l1(e)}function i1(e,t,n){return n(function(){a1(t)&&l1(e)})}function a1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!cr(e,n)}catch(r){return!0}}function l1(e){var t=co(e,1);t!==null&&lr(t,e,1,-1)}function AC(e){var t=Lr();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ec,lastRenderedState:e},t.queue=e,e=e.dispatch=PD.bind(null,Ke,e),[t.memoizedState,e]}function Cc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ke.updateQueue,t===null?(t={lastEffect:null,stores:null},Ke.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function c1(){return $n().memoizedState}function hf(e,t,n,r){var o=Lr();Ke.flags|=e,o.memoizedState=Cc(1|t,n,void 0,r===void 0?null:r)}function Qf(e,t,n,r){var o=$n();r=r===void 0?null:r;var s=void 0;if(ct!==null){var i=ct.memoizedState;if(s=i.destroy,r!==null&&kv(r,i.deps)){o.memoizedState=Cc(t,n,s,r);return}}Ke.flags|=e,o.memoizedState=Cc(1|t,n,s,r)}function _C(e,t){return hf(8390656,8,e,t)}function Iv(e,t){return Qf(2048,8,e,t)}function u1(e,t){return Qf(4,2,e,t)}function d1(e,t){return Qf(4,4,e,t)}function f1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function p1(e,t,n){return n=n!=null?n.concat([e]):null,Qf(4,4,f1.bind(null,t,e),n)}function Av(){}function m1(e,t){var n=$n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function g1(e,t){var n=$n();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&kv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function h1(e,t,n){return(Zs&21)===0?(e.baseState&&(e.baseState=!1,mn=!0),e.memoizedState=n):(cr(n,t)||(n=wT(),Ke.lanes|=n,Js|=n,e.baseState=!0),t)}function kD(e,t){var n=_e;_e=n!==0&&4>n?n:4,e(!0);var r=ey.transition;ey.transition={};try{e(!1),t()}finally{_e=n,ey.transition=r}}function y1(){return $n().memoizedState}function RD(e,t,n){var r=ts(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},v1(e))S1(t,n);else if(n=JT(e,t,n,r),n!==null){var o=Qt();lr(n,e,r,o),x1(n,t,r)}}function PD(e,t,n){var r=ts(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(v1(e))S1(t,o);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var i=t.lastRenderedState,a=s(i,n);if(o.hasEagerState=!0,o.eagerState=a,cr(a,i)){var l=t.interleaved;l===null?(o.next=o,wv(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch(c){}n=JT(e,t,o,r),n!==null&&(o=Qt(),lr(n,e,r,o),x1(n,t,r))}}function v1(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function S1(e,t){sc=zf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function x1(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,av(e,n)}}var Hf={readContext:Wn,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},ID={readContext:Wn,useCallback:function(e,t){return Lr().memoizedState=[e,t===void 0?null:t],e},useContext:Wn,useEffect:_C,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hf(4194308,4,f1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hf(4194308,4,e,t)},useInsertionEffect:function(e,t){return hf(4,2,e,t)},useMemo:function(e,t){var n=Lr();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Lr();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=RD.bind(null,Ke,e),[r.memoizedState,e]},useRef:function(e){var t=Lr();return e={current:e},t.memoizedState=e},useState:AC,useDebugValue:Av,useDeferredValue:function(e){return Lr().memoizedState=e},useTransition:function(){var e=AC(!1),t=e[0];return e=kD.bind(null,e[1]),Lr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ke,o=Lr();if(je){if(n===void 0)throw Error(F(407));n=n()}else{if(n=t(),xt===null)throw Error(F(349));(Zs&30)!==0||o1(r,t,n)}o.memoizedState=n;var s={value:n,getSnapshot:t};return o.queue=s,_C(i1.bind(null,r,s,e),[e]),r.flags|=2048,Cc(9,s1.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=Lr(),t=xt.identifierPrefix;if(je){var n=so,r=oo;n=(r&~(1<<32-ar(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=bc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=TD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},AD={readContext:Wn,useCallback:m1,useContext:Wn,useEffect:Iv,useImperativeHandle:p1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:g1,useReducer:ty,useRef:c1,useState:function(){return ty(Ec)},useDebugValue:Av,useDeferredValue:function(e){var t=$n();return h1(t,ct.memoizedState,e)},useTransition:function(){var e=ty(Ec)[0],t=$n().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1},_D={readContext:Wn,useCallback:m1,useContext:Wn,useEffect:Iv,useImperativeHandle:p1,useInsertionEffect:u1,useLayoutEffect:d1,useMemo:g1,useReducer:ny,useRef:c1,useState:function(){return ny(Ec)},useDebugValue:Av,useDeferredValue:function(e){var t=$n();return ct===null?t.memoizedState=e:h1(t,ct.memoizedState,e)},useTransition:function(){var e=ny(Ec)[0],t=$n().memoizedState;return[e,t]},useMutableSource:n1,useSyncExternalStore:r1,useId:y1,unstable_isNewReconciler:!1};function or(e,t){if(e&&e.defaultProps){t=Ge({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Fy(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ge({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zf={isMounted:function(e){return(e=e._reactInternals)?ni(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Qt(),o=ts(e),s=io(r,o);s.payload=t,n!=null&&(s.callback=n),t=Jo(e,s,o),t!==null&&(lr(t,e,o,r),mf(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Qt(),o=ts(e),s=io(r,o);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=Jo(e,s,o),t!==null&&(lr(t,e,o,r),mf(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Qt(),r=ts(e),o=io(n,r);o.tag=2,t!=null&&(o.callback=t),t=Jo(e,o,r),t!==null&&(lr(t,e,r,n),mf(t,e,r))}};function NC(e,t,n,r,o,s,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,i):t.prototype&&t.prototype.isPureReactComponent?!hc(n,r)||!hc(o,s):!0}function w1(e,t,n){var r=!1,o=os,s=t.contextType;return typeof s=="object"&&s!==null?s=Wn(s):(o=hn(t)?Xs:Ut.current,r=t.contextTypes,s=(r=r!=null)?ma(e,o):os),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=s),t}function MC(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zf.enqueueReplaceState(t,t.state,null)}function zy(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},bv(e);var s=t.contextType;typeof s=="object"&&s!==null?o.context=Wn(s):(s=hn(t)?Xs:Ut.current,o.context=ma(e,s)),o.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(Fy(e,t,s,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Zf.enqueueReplaceState(o,o.state,null),Df(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function va(e,t){try{var n="",r=t;do n+=a2(r),r=r.return;while(r);var o=n}catch(s){o=`
7
- Error generating stack: `+s.message+`
8
- `+s.stack}return{value:e,source:t,stack:o,digest:null}}function ry(e,t,n){return{value:e,source:null,stack:n!=null?n:null,digest:t!=null?t:null}}function Hy(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ND=typeof WeakMap=="function"?WeakMap:Map;function b1(e,t,n){n=io(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Uf||(Uf=!0,Yy=r),Hy(e,t)},n}function E1(e,t,n){n=io(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Hy(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){Hy(e,t),typeof r!="function"&&(es===null?es=new Set([this]):es.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function LC(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ND;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=KD.bind(null,e,t,n),t.then(e,e))}function OC(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function DC(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=io(-1,1),t.tag=2,Jo(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var MD=fo.ReactCurrentOwner,mn=!1;function Xt(e,t,n,r){t.child=e===null?ZT(t,null,n,r):ha(t,e.child,n,r)}function FC(e,t,n,r,o){n=n.render;var s=t.ref;return da(t,o),r=Rv(e,t,n,r,s,o),n=Pv(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(je&&n&&gv(t),t.flags|=1,Xt(e,t,r,o),t.child)}function zC(e,t,n,r,o){if(e===null){var s=n.type;return typeof s=="function"&&!zv(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,C1(e,t,s,r,o)):(e=xf(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,(e.lanes&o)===0){var i=s.memoizedProps;if(n=n.compare,n=n!==null?n:hc,n(i,r)&&e.ref===t.ref)return uo(e,t,o)}return t.flags|=1,e=ns(s,r),e.ref=t.ref,e.return=t,t.child=e}function C1(e,t,n,r,o){if(e!==null){var s=e.memoizedProps;if(hc(s,r)&&e.ref===t.ref)if(mn=!1,t.pendingProps=r=s,(e.lanes&o)!==0)(e.flags&131072)!==0&&(mn=!0);else return t.lanes=e.lanes,uo(e,t,o)}return By(e,t,n,r,o)}function T1(e,t,n){var r=t.pendingProps,o=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(ia,kn),kn|=n;else{if((n&1073741824)===0)return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(ia,kn),kn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,ze(ia,kn),kn|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,ze(ia,kn),kn|=r;return Xt(e,t,o,n),t.child}function k1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function By(e,t,n,r,o){var s=hn(n)?Xs:Ut.current;return s=ma(t,s),da(t,o),n=Rv(e,t,n,r,s,o),r=Pv(),e!==null&&!mn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,uo(e,t,o)):(je&&r&&gv(t),t.flags|=1,Xt(e,t,n,o),t.child)}function HC(e,t,n,r,o){if(hn(n)){var s=!0;_f(t)}else s=!1;if(da(t,o),t.stateNode===null)yf(e,t),w1(t,n,r),zy(t,n,r,o),r=!0;else if(e===null){var i=t.stateNode,a=t.memoizedProps;i.props=a;var l=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Wn(c):(c=hn(n)?Xs:Ut.current,c=ma(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof i.getSnapshotBeforeUpdate=="function";f||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==r||l!==c)&&MC(t,i,r,c),Wo=!1;var d=t.memoizedState;i.state=d,Df(t,r,i,o),l=t.memoizedState,a!==r||d!==l||gn.current||Wo?(typeof u=="function"&&(Fy(t,n,u,r),l=t.memoizedState),(a=Wo||NC(t,n,a,r,d,l,c))?(f||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),i.props=r,i.state=l,i.context=c,r=a):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,e1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:or(t.type,a),i.props=c,f=t.pendingProps,d=i.context,l=n.contextType,typeof l=="object"&&l!==null?l=Wn(l):(l=hn(n)?Xs:Ut.current,l=ma(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(a!==f||d!==l)&&MC(t,i,r,l),Wo=!1,d=t.memoizedState,i.state=d,Df(t,r,i,o);var h=t.memoizedState;a!==f||d!==h||gn.current||Wo?(typeof p=="function"&&(Fy(t,n,p,r),h=t.memoizedState),(c=Wo||NC(t,n,c,r,d,h,l)||!1)?(u||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,h,l),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,h,l)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=h),i.props=r,i.state=h,i.context=l,r=c):(typeof i.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return Uy(e,t,n,r,s,o)}function Uy(e,t,n,r,o,s){k1(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return o&&CC(t,n,!1),uo(e,t,s);r=t.stateNode,MD.current=t;var a=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=ha(t,e.child,null,s),t.child=ha(t,null,a,s)):Xt(e,t,a,s),t.memoizedState=r.state,o&&CC(t,n,!0),t.child}function R1(e){var t=e.stateNode;t.pendingContext?EC(e,t.pendingContext,t.pendingContext!==t.context):t.context&&EC(e,t.context,!1),Ev(e,t.containerInfo)}function BC(e,t,n,r,o){return ga(),yv(o),t.flags|=256,Xt(e,t,n,r),t.child}var Vy={dehydrated:null,treeContext:null,retryLane:0};function jy(e){return{baseLanes:e,cachePool:null,transitions:null}}function P1(e,t,n){var r=t.pendingProps,o=$e.current,s=!1,i=(t.flags&128)!==0,a;if((a=i)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ze($e,o&1),e===null)return Oy(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(i=r.children,e=r.fallback,s?(r=t.mode,s=t.child,i={mode:"hidden",children:i},(r&1)===0&&s!==null?(s.childLanes=0,s.pendingProps=i):s=tp(i,r,0,null),e=Ys(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=jy(n),t.memoizedState=Vy,e):_v(t,i));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return LD(e,t,i,r,a,o,n);if(s){s=r.fallback,i=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return(i&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ns(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?s=ns(a,s):(s=Ys(s,i,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,i=e.child.memoizedState,i=i===null?jy(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},s.memoizedState=i,s.childLanes=e.childLanes&~n,t.memoizedState=Vy,r}return s=e.child,e=s.sibling,r=ns(s,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function _v(e,t){return t=tp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function lf(e,t,n,r){return r!==null&&yv(r),ha(t,e.child,null,n),e=_v(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function LD(e,t,n,r,o,s,i){if(n)return t.flags&256?(t.flags&=-257,r=ry(Error(F(422))),lf(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,o=t.mode,r=tp({mode:"visible",children:r.children},o,0,null),s=Ys(s,o,i,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,(t.mode&1)!==0&&ha(t,e.child,null,i),t.child.memoizedState=jy(i),t.memoizedState=Vy,s);if((t.mode&1)===0)return lf(e,t,i,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(F(419)),r=ry(s,r,void 0),lf(e,t,i,r)}if(a=(i&e.childLanes)!==0,mn||a){if(r=xt,r!==null){switch(i&-i){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|i))!==0?0:o,o!==0&&o!==s.retryLane&&(s.retryLane=o,co(e,o),lr(r,e,o,-1))}return Fv(),r=ry(Error(F(421))),lf(e,t,i,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=GD.bind(null,e),o._reactRetry=t,null):(e=s.treeContext,Rn=Zo(o.nextSibling),Pn=t,je=!0,ir=null,e!==null&&(Bn[Un++]=oo,Bn[Un++]=so,Bn[Un++]=Qs,oo=e.id,so=e.overflow,Qs=t),t=_v(t,r.children),t.flags|=4096,t)}function UC(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Dy(e.return,t,n)}function oy(e,t,n,r,o){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=o)}function I1(e,t,n){var r=t.pendingProps,o=r.revealOrder,s=r.tail;if(Xt(e,t,r.children,n),r=$e.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&UC(e,n,t);else if(e.tag===19)UC(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ze($e,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ff(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),oy(t,!1,o,n,s);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ff(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}oy(t,!0,n,null,s);break;case"together":oy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function yf(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function uo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Js|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,n=ns(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ns(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function OD(e,t,n){switch(t.tag){case 3:R1(t),ga();break;case 5:t1(t);break;case 1:hn(t.type)&&_f(t);break;case 4:Ev(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ze(Lf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze($e,$e.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?P1(e,t,n):(ze($e,$e.current&1),e=uo(e,t,n),e!==null?e.sibling:null);ze($e,$e.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return I1(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ze($e,$e.current),r)break;return null;case 22:case 23:return t.lanes=0,T1(e,t,n)}return uo(e,t,n)}var A1,Wy,_1,N1;A1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};Wy=function(){};_1=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Gs(Fr.current);var s=null;switch(n){case"input":o=fy(e,o),r=fy(e,r),s=[];break;case"select":o=Ge({},o,{value:void 0}),r=Ge({},r,{value:void 0}),s=[];break;case"textarea":o=gy(e,o),r=gy(e,r),s=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=If)}yy(n,r);var i;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(i in a)a.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(cc.hasOwnProperty(c)?s||(s=[]):(s=s||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(i in a)!a.hasOwnProperty(i)||l&&l.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in l)l.hasOwnProperty(i)&&a[i]!==l[i]&&(n||(n={}),n[i]=l[i])}else n||(s||(s=[]),s.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(s=s||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(s=s||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(cc.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Be("scroll",e),s||a===l||(s=[])):(s=s||[]).push(c,l))}n&&(s=s||[]).push("style",n);var c=s;(t.updateQueue=c)&&(t.flags|=4)}};N1=function(e,t,n,r){n!==r&&(t.flags|=4)};function Gl(e,t){if(!je)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function DD(e,t,n){var r=t.pendingProps;switch(hv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ht(t),null;case 1:return hn(t.type)&&Af(),Ht(t),null;case 3:return r=t.stateNode,ya(),Ue(gn),Ue(Ut),Tv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(sf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ir!==null&&(Zy(ir),ir=null))),Wy(e,t),Ht(t),null;case 5:Cv(t);var o=Gs(wc.current);if(n=t.type,e!==null&&t.stateNode!=null)_1(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(F(166));return Ht(t),null}if(e=Gs(Fr.current),sf(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[Or]=t,r[Sc]=s,e=(t.mode&1)!==0,n){case"dialog":Be("cancel",r),Be("close",r);break;case"iframe":case"object":case"embed":Be("load",r);break;case"video":case"audio":for(o=0;o<Jl.length;o++)Be(Jl[o],r);break;case"source":Be("error",r);break;case"img":case"image":case"link":Be("error",r),Be("load",r);break;case"details":Be("toggle",r);break;case"input":YE(r,s),Be("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},Be("invalid",r);break;case"textarea":QE(r,s),Be("invalid",r)}yy(n,s),o=null;for(var i in s)if(s.hasOwnProperty(i)){var a=s[i];i==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&of(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&of(r.textContent,a,e),o=["children",""+a]):cc.hasOwnProperty(i)&&a!=null&&i==="onScroll"&&Be("scroll",r)}switch(n){case"input":Kd(r),XE(r,s,!0);break;case"textarea":Kd(r),ZE(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=If)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=iT(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=i.createElement("div"),e.innerHTML="<script></script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Or]=t,e[Sc]=r,A1(e,t,!1,!1),t.stateNode=e;e:{switch(i=vy(n,r),n){case"dialog":Be("cancel",e),Be("close",e),o=r;break;case"iframe":case"object":case"embed":Be("load",e),o=r;break;case"video":case"audio":for(o=0;o<Jl.length;o++)Be(Jl[o],e);o=r;break;case"source":Be("error",e),o=r;break;case"img":case"image":case"link":Be("error",e),Be("load",e),o=r;break;case"details":Be("toggle",e),o=r;break;case"input":YE(e,r),o=fy(e,r),Be("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Ge({},r,{value:void 0}),Be("invalid",e);break;case"textarea":QE(e,r),o=gy(e,r),Be("invalid",e);break;default:o=r}yy(n,o),a=o;for(s in a)if(a.hasOwnProperty(s)){var l=a[s];s==="style"?cT(e,l):s==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&aT(e,l)):s==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&uc(e,l):typeof l=="number"&&uc(e,""+l):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(cc.hasOwnProperty(s)?l!=null&&s==="onScroll"&&Be("scroll",e):l!=null&&tv(e,s,l,i))}switch(n){case"input":Kd(e),XE(e,r,!1);break;case"textarea":Kd(e),ZE(e);break;case"option":r.value!=null&&e.setAttribute("value",""+rs(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?aa(e,!!r.multiple,s,!1):r.defaultValue!=null&&aa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=If)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ht(t),null;case 6:if(e&&t.stateNode!=null)N1(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(F(166));if(n=Gs(wc.current),Gs(Fr.current),sf(t)){if(r=t.stateNode,n=t.memoizedProps,r[Or]=t,(s=r.nodeValue!==n)&&(e=Pn,e!==null))switch(e.tag){case 3:of(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&of(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Or]=t,t.stateNode=r}return Ht(t),null;case 13:if(Ue($e),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(je&&Rn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)XT(),ga(),t.flags|=98560,s=!1;else if(s=sf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(F(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(F(317));s[Or]=t}else ga(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ht(t),s=!1}else ir!==null&&(Zy(ir),ir=null),s=!0;if(!s)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||($e.current&1)!==0?ut===0&&(ut=3):Fv())),t.updateQueue!==null&&(t.flags|=4),Ht(t),null);case 4:return ya(),Wy(e,t),e===null&&yc(t.stateNode.containerInfo),Ht(t),null;case 10:return xv(t.type._context),Ht(t),null;case 17:return hn(t.type)&&Af(),Ht(t),null;case 19:if(Ue($e),s=t.memoizedState,s===null)return Ht(t),null;if(r=(t.flags&128)!==0,i=s.rendering,i===null)if(r)Gl(s,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(i=Ff(e),i!==null){for(t.flags|=128,Gl(s,!1),r=i.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,i=s.alternate,i===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,s.type=i.type,e=i.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze($e,$e.current&1|2),t.child}e=e.sibling}s.tail!==null&&Je()>Sa&&(t.flags|=128,r=!0,Gl(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ff(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Gl(s,!0),s.tail===null&&s.tailMode==="hidden"&&!i.alternate&&!je)return Ht(t),null}else 2*Je()-s.renderingStartTime>Sa&&n!==1073741824&&(t.flags|=128,r=!0,Gl(s,!1),t.lanes=4194304);s.isBackwards?(i.sibling=t.child,t.child=i):(n=s.last,n!==null?n.sibling=i:t.child=i,s.last=i)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=Je(),t.sibling=null,n=$e.current,ze($e,r?n&1|2:n&1),t):(Ht(t),null);case 22:case 23:return Dv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(kn&1073741824)!==0&&(Ht(t),t.subtreeFlags&6&&(t.flags|=8192)):Ht(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function FD(e,t){switch(hv(t),t.tag){case 1:return hn(t.type)&&Af(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(),Ue(gn),Ue(Ut),Tv(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Cv(t),null;case 13:if(Ue($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ue($e),null;case 4:return ya(),null;case 10:return xv(t.type._context),null;case 22:case 23:return Dv(),null;case 24:return null;default:return null}}var cf=!1,Bt=!1,zD=typeof WeakSet=="function"?WeakSet:Set,Q=null;function sa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ye(e,t,r)}else n.current=null}function $y(e,t,n){try{n()}catch(r){Ye(e,t,r)}}var VC=!1;function HD(e,t){if(Py=kf,e=FT(),mv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch(x){n=null;break e}var i=0,a=-1,l=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var p;f!==n||o!==0&&f.nodeType!==3||(a=i+o),f!==s||r!==0&&f.nodeType!==3||(l=i+r),f.nodeType===3&&(i+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++c===o&&(a=i),d===s&&++u===r&&(l=i),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Iy={focusedElem:e,selectionRange:n},kf=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var h=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,S=h.memoizedState,y=t.stateNode,g=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:or(t.type,m),S);y.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(x){Ye(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return h=VC,VC=!1,h}function ic(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var s=o.destroy;o.destroy=void 0,s!==void 0&&$y(t,n,s)}o=o.next}while(o!==r)}}function Jf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ky(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function M1(e){var t=e.alternate;t!==null&&(e.alternate=null,M1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Or],delete t[Sc],delete t[Ny],delete t[wD],delete t[bD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function L1(e){return e.tag===5||e.tag===3||e.tag===4}function jC(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||L1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,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=If));else if(r!==4&&(e=e.child,e!==null))for(Gy(e,t,n),e=e.sibling;e!==null;)Gy(e,t,n),e=e.sibling}function qy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qy(e,t,n),e=e.sibling;e!==null;)qy(e,t,n),e=e.sibling}var _t=null,sr=!1;function Vo(e,t,n){for(n=n.child;n!==null;)O1(e,t,n),n=n.sibling}function O1(e,t,n){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount($f,n)}catch(a){}switch(n.tag){case 5:Bt||sa(n,t);case 6:var r=_t,o=sr;_t=null,Vo(e,t,n),_t=r,sr=o,_t!==null&&(sr?(e=_t,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_t.removeChild(n.stateNode));break;case 18:_t!==null&&(sr?(e=_t,n=n.stateNode,e.nodeType===8?Qh(e.parentNode,n):e.nodeType===1&&Qh(e,n),mc(e)):Qh(_t,n.stateNode));break;case 4:r=_t,o=sr,_t=n.stateNode.containerInfo,sr=!0,Vo(e,t,n),_t=r,sr=o;break;case 0:case 11:case 14:case 15:if(!Bt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var s=o,i=s.destroy;s=s.tag,i!==void 0&&((s&2)!==0||(s&4)!==0)&&$y(n,t,i),o=o.next}while(o!==r)}Vo(e,t,n);break;case 1:if(!Bt&&(sa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ye(n,t,a)}Vo(e,t,n);break;case 21:Vo(e,t,n);break;case 22:n.mode&1?(Bt=(r=Bt)||n.memoizedState!==null,Vo(e,t,n),Bt=r):Vo(e,t,n);break;default:Vo(e,t,n)}}function WC(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new zD),t.forEach(function(r){var o=qD.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function rr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var s=e,i=t,a=i;e:for(;a!==null;){switch(a.tag){case 5:_t=a.stateNode,sr=!1;break e;case 3:_t=a.stateNode.containerInfo,sr=!0;break e;case 4:_t=a.stateNode.containerInfo,sr=!0;break e}a=a.return}if(_t===null)throw Error(F(160));O1(s,i,o),_t=null,sr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Ye(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)D1(t,e),t=t.sibling}function D1(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(rr(t,e),Mr(e),r&4){try{ic(3,e,e.return),Jf(3,e)}catch(m){Ye(e,e.return,m)}try{ic(5,e,e.return)}catch(m){Ye(e,e.return,m)}}break;case 1:rr(t,e),Mr(e),r&512&&n!==null&&sa(n,n.return);break;case 5:if(rr(t,e),Mr(e),r&512&&n!==null&&sa(n,n.return),e.flags&32){var o=e.stateNode;try{uc(o,"")}catch(m){Ye(e,e.return,m)}}if(r&4&&(o=e.stateNode,o!=null)){var s=e.memoizedProps,i=n!==null?n.memoizedProps:s,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&oT(o,s),vy(a,i);var c=vy(a,s);for(i=0;i<l.length;i+=2){var u=l[i],f=l[i+1];u==="style"?cT(o,f):u==="dangerouslySetInnerHTML"?aT(o,f):u==="children"?uc(o,f):tv(o,u,f,c)}switch(a){case"input":py(o,s);break;case"textarea":sT(o,s);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!s.multiple;var p=s.value;p!=null?aa(o,!!s.multiple,p,!1):d!==!!s.multiple&&(s.defaultValue!=null?aa(o,!!s.multiple,s.defaultValue,!0):aa(o,!!s.multiple,s.multiple?[]:"",!1))}o[Sc]=s}catch(m){Ye(e,e.return,m)}}break;case 6:if(rr(t,e),Mr(e),r&4){if(e.stateNode===null)throw Error(F(162));o=e.stateNode,s=e.memoizedProps;try{o.nodeValue=s}catch(m){Ye(e,e.return,m)}}break;case 3:if(rr(t,e),Mr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{mc(t.containerInfo)}catch(m){Ye(e,e.return,m)}break;case 4:rr(t,e),Mr(e);break;case 13:rr(t,e),Mr(e),o=e.child,o.flags&8192&&(s=o.memoizedState!==null,o.stateNode.isHidden=s,!s||o.alternate!==null&&o.alternate.memoizedState!==null||(Lv=Je())),r&4&&WC(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Bt=(c=Bt)||u,rr(t,e),Bt=c):rr(t,e),Mr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(Q=e,u=e.child;u!==null;){for(f=Q=u;Q!==null;){switch(d=Q,p=d.child,d.tag){case 0:case 11:case 14:case 15:ic(4,d,d.return);break;case 1:sa(d,d.return);var h=d.stateNode;if(typeof h.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(m){Ye(r,n,m)}}break;case 5:sa(d,d.return);break;case 22:if(d.memoizedState!==null){KC(f);continue}}p!==null?(p.return=d,Q=p):KC(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(s=o.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=f.stateNode,l=f.memoizedProps.style,i=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=lT("display",i))}catch(m){Ye(e,e.return,m)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){Ye(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:rr(t,e),Mr(e),r&4&&WC(e);break;case 21:break;default:rr(t,e),Mr(e)}}function Mr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(L1(n)){var r=n;break e}n=n.return}throw Error(F(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(uc(o,""),r.flags&=-33);var s=jC(e);qy(e,s,o);break;case 3:case 4:var i=r.stateNode.containerInfo,a=jC(e);Gy(e,a,i);break;default:throw Error(F(161))}}catch(l){Ye(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function BD(e,t,n){Q=e,F1(e,t,n)}function F1(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var o=Q,s=o.child;if(o.tag===22&&r){var i=o.memoizedState!==null||cf;if(!i){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Bt;a=cf;var c=Bt;if(cf=i,(Bt=l)&&!c)for(Q=o;Q!==null;)i=Q,l=i.child,i.tag===22&&i.memoizedState!==null?GC(o):l!==null?(l.return=i,Q=l):GC(o);for(;s!==null;)Q=s,F1(s,t,n),s=s.sibling;Q=o,cf=a,Bt=c}$C(e,t,n)}else(o.subtreeFlags&8772)!==0&&s!==null?(s.return=o,Q=s):$C(e,t,n)}}function $C(e){for(;Q!==null;){var t=Q;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Bt||Jf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Bt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:or(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&IC(t,s,r);break;case 3:var i=t.updateQueue;if(i!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}IC(t,i,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&mc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(F(163))}Bt||t.flags&512&&Ky(t)}catch(d){Ye(t,t.return,d)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function KC(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function GC(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Jf(4,t)}catch(l){Ye(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ye(t,o,l)}}var s=t.return;try{Ky(t)}catch(l){Ye(t,s,l)}break;case 5:var i=t.return;try{Ky(t)}catch(l){Ye(t,i,l)}}}catch(l){Ye(t,t.return,l)}if(t===e){Q=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Q=a;break}Q=t.return}}var UD=Math.ceil,Bf=fo.ReactCurrentDispatcher,Nv=fo.ReactCurrentOwner,jn=fo.ReactCurrentBatchConfig,Ee=0,xt=null,ot=null,Nt=0,kn=0,ia=is(0),ut=0,Tc=null,Js=0,ep=0,Mv=0,ac=null,pn=null,Lv=0,Sa=1/0,no=null,Uf=!1,Yy=null,es=null,uf=!1,qo=null,Vf=0,lc=0,Xy=null,vf=-1,Sf=0;function Qt(){return(Ee&6)!==0?Je():vf!==-1?vf:vf=Je()}function ts(e){return(e.mode&1)===0?1:(Ee&2)!==0&&Nt!==0?Nt&-Nt:CD.transition!==null?(Sf===0&&(Sf=wT()),Sf):(e=_e,e!==0||(e=window.event,e=e===void 0?16:PT(e.type)),e)}function lr(e,t,n,r){if(50<lc)throw lc=0,Xy=null,Error(F(185));kc(e,n,r),((Ee&2)===0||e!==xt)&&(e===xt&&((Ee&2)===0&&(ep|=n),ut===4&&Ko(e,Nt)),yn(e,r),n===1&&Ee===0&&(t.mode&1)===0&&(Sa=Je()+500,Xf&&as()))}function yn(e,t){var n=e.callbackNode;k2(e,t);var r=Tf(e,e===xt?Nt:0);if(r===0)n!==null&&tC(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&tC(n),t===1)e.tag===0?ED(qC.bind(null,e)):GT(qC.bind(null,e)),SD(function(){(Ee&6)===0&&as()}),n=null;else{switch(bT(r)){case 1:n=iv;break;case 4:n=ST;break;case 16:n=Cf;break;case 536870912:n=xT;break;default:n=Cf}n=$1(n,z1.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function z1(e,t){if(vf=-1,Sf=0,(Ee&6)!==0)throw Error(F(327));var n=e.callbackNode;if(fa()&&e.callbackNode!==n)return null;var r=Tf(e,e===xt?Nt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=jf(e,r);else{t=r;var o=Ee;Ee|=2;var s=B1();(xt!==e||Nt!==t)&&(no=null,Sa=Je()+500,qs(e,t));do try{WD();break}catch(a){H1(e,a)}while(!0);Sv(),Bf.current=s,Ee=o,ot!==null?t=0:(xt=null,Nt=0,t=ut)}if(t!==0){if(t===2&&(o=Ey(e),o!==0&&(r=o,t=Qy(e,o))),t===1)throw n=Tc,qs(e,0),Ko(e,r),yn(e,Je()),n;if(t===6)Ko(e,r);else{if(o=e.current.alternate,(r&30)===0&&!VD(o)&&(t=jf(e,r),t===2&&(s=Ey(e),s!==0&&(r=s,t=Qy(e,s))),t===1))throw n=Tc,qs(e,0),Ko(e,r),yn(e,Je()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(F(345));case 2:Ws(e,pn,no);break;case 3:if(Ko(e,r),(r&130023424)===r&&(t=Lv+500-Je(),10<t)){if(Tf(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Qt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=_y(Ws.bind(null,e,pn,no),t);break}Ws(e,pn,no);break;case 4:if(Ko(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var i=31-ar(r);s=1<<i,i=t[i],i>o&&(o=i),r&=~s}if(r=o,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UD(r/1960))-r,10<r){e.timeoutHandle=_y(Ws.bind(null,e,pn,no),r);break}Ws(e,pn,no);break;case 5:Ws(e,pn,no);break;default:throw Error(F(329))}}}return yn(e,Je()),e.callbackNode===n?z1.bind(null,e):null}function Qy(e,t){var n=ac;return e.current.memoizedState.isDehydrated&&(qs(e,t).flags|=256),e=jf(e,t),e!==2&&(t=pn,pn=n,t!==null&&Zy(t)),e}function Zy(e){pn===null?pn=e:pn.push.apply(pn,e)}function VD(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],s=o.getSnapshot;o=o.value;try{if(!cr(s(),o))return!1}catch(i){return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ko(e,t){for(t&=~Mv,t&=~ep,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ar(t),r=1<<n;e[n]=-1,t&=~r}}function qC(e){if((Ee&6)!==0)throw Error(F(327));fa();var t=Tf(e,0);if((t&1)===0)return yn(e,Je()),null;var n=jf(e,t);if(e.tag!==0&&n===2){var r=Ey(e);r!==0&&(t=r,n=Qy(e,r))}if(n===1)throw n=Tc,qs(e,0),Ko(e,t),yn(e,Je()),n;if(n===6)throw Error(F(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ws(e,pn,no),yn(e,Je()),null}function Ov(e,t){var n=Ee;Ee|=1;try{return e(t)}finally{Ee=n,Ee===0&&(Sa=Je()+500,Xf&&as())}}function ei(e){qo!==null&&qo.tag===0&&(Ee&6)===0&&fa();var t=Ee;Ee|=1;var n=jn.transition,r=_e;try{if(jn.transition=null,_e=1,e)return e()}finally{_e=r,jn.transition=n,Ee=t,(Ee&6)===0&&as()}}function Dv(){kn=ia.current,Ue(ia)}function qs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,vD(n)),ot!==null)for(n=ot.return;n!==null;){var r=n;switch(hv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Af();break;case 3:ya(),Ue(gn),Ue(Ut),Tv();break;case 5:Cv(r);break;case 4:ya();break;case 13:Ue($e);break;case 19:Ue($e);break;case 10:xv(r.type._context);break;case 22:case 23:Dv()}n=n.return}if(xt=e,ot=e=ns(e.current,null),Nt=kn=t,ut=0,Tc=null,Mv=ep=Js=0,pn=ac=null,Ks!==null){for(t=0;t<Ks.length;t++)if(n=Ks[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,s=n.pending;if(s!==null){var i=s.next;s.next=o,r.next=i}n.pending=r}Ks=null}return e}function H1(e,t){do{var n=ot;try{if(Sv(),gf.current=Hf,zf){for(var r=Ke.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}zf=!1}if(Zs=0,St=ct=Ke=null,sc=!1,bc=0,Nv.current=null,n===null||n.return===null){ut=1,Tc=t,ot=null;break}e:{var s=e,i=n.return,a=n,l=t;if(t=Nt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=OC(i);if(p!==null){p.flags&=-257,DC(p,i,a,s,t),p.mode&1&&LC(s,c,t),t=p,l=c;var h=t.updateQueue;if(h===null){var m=new Set;m.add(l),t.updateQueue=m}else h.add(l);break e}else{if((t&1)===0){LC(s,c,t),Fv();break e}l=Error(F(426))}}else if(je&&a.mode&1){var S=OC(i);if(S!==null){(S.flags&65536)===0&&(S.flags|=256),DC(S,i,a,s,t),yv(va(l,a));break e}}s=l=va(l,a),ut!==4&&(ut=2),ac===null?ac=[s]:ac.push(s),s=i;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var y=b1(s,l,t);PC(s,y);break e;case 1:a=l;var g=s.type,v=s.stateNode;if((s.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(es===null||!es.has(v)))){s.flags|=65536,t&=-t,s.lanes|=t;var x=E1(s,a,t);PC(s,x);break e}}s=s.return}while(s!==null)}V1(n)}catch(C){t=C,ot===n&&n!==null&&(ot=n=n.return);continue}break}while(!0)}function B1(){var e=Bf.current;return Bf.current=Hf,e===null?Hf:e}function Fv(){(ut===0||ut===3||ut===2)&&(ut=4),xt===null||(Js&268435455)===0&&(ep&268435455)===0||Ko(xt,Nt)}function jf(e,t){var n=Ee;Ee|=2;var r=B1();(xt!==e||Nt!==t)&&(no=null,qs(e,t));do try{jD();break}catch(o){H1(e,o)}while(!0);if(Sv(),Ee=n,Bf.current=r,ot!==null)throw Error(F(261));return xt=null,Nt=0,ut}function jD(){for(;ot!==null;)U1(ot)}function WD(){for(;ot!==null&&!y2();)U1(ot)}function U1(e){var t=W1(e.alternate,e,kn);e.memoizedProps=e.pendingProps,t===null?V1(e):ot=t,Nv.current=null}function V1(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=DD(n,t,kn),n!==null){ot=n;return}}else{if(n=FD(n,t),n!==null){n.flags&=32767,ot=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,ot=null;return}}if(t=t.sibling,t!==null){ot=t;return}ot=t=e}while(t!==null);ut===0&&(ut=5)}function Ws(e,t,n){var r=_e,o=jn.transition;try{jn.transition=null,_e=1,$D(e,t,n,r)}finally{jn.transition=o,_e=r}return null}function $D(e,t,n,r){do fa();while(qo!==null);if((Ee&6)!==0)throw Error(F(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(F(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(R2(e,s),e===xt&&(ot=xt=null,Nt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||uf||(uf=!0,$1(Cf,function(){return fa(),null})),s=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||s){s=jn.transition,jn.transition=null;var i=_e;_e=1;var a=Ee;Ee|=4,Nv.current=null,HD(e,n),D1(n,e),pD(Iy),kf=!!Py,Iy=Py=null,e.current=n,BD(n,e,o),v2(),Ee=a,_e=i,jn.transition=s}else e.current=n;if(uf&&(uf=!1,qo=e,Vf=o),s=e.pendingLanes,s===0&&(es=null),w2(n.stateNode,r),yn(e,Je()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Uf)throw Uf=!1,e=Yy,Yy=null,e;return(Vf&1)!==0&&e.tag!==0&&fa(),s=e.pendingLanes,(s&1)!==0?e===Xy?lc++:(lc=0,Xy=e):lc=0,as(),null}function fa(){if(qo!==null){var e=bT(Vf),t=jn.transition,n=_e;try{if(jn.transition=null,_e=16>e?16:e,qo===null)var r=!1;else{if(e=qo,qo=null,Vf=0,(Ee&6)!==0)throw Error(F(331));var o=Ee;for(Ee|=4,Q=e.current;Q!==null;){var s=Q,i=s.child;if((Q.flags&16)!==0){var a=s.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Q=c;Q!==null;){var u=Q;switch(u.tag){case 0:case 11:case 15:ic(8,u,s)}var f=u.child;if(f!==null)f.return=u,Q=f;else for(;Q!==null;){u=Q;var d=u.sibling,p=u.return;if(M1(u),u===c){Q=null;break}if(d!==null){d.return=p,Q=d;break}Q=p}}}var h=s.alternate;if(h!==null){var m=h.child;if(m!==null){h.child=null;do{var S=m.sibling;m.sibling=null,m=S}while(m!==null)}}Q=s}}if((s.subtreeFlags&2064)!==0&&i!==null)i.return=s,Q=i;else e:for(;Q!==null;){if(s=Q,(s.flags&2048)!==0)switch(s.tag){case 0:case 11:case 15:ic(9,s,s.return)}var y=s.sibling;if(y!==null){y.return=s.return,Q=y;break e}Q=s.return}}var g=e.current;for(Q=g;Q!==null;){i=Q;var v=i.child;if((i.subtreeFlags&2064)!==0&&v!==null)v.return=i,Q=v;else e:for(i=g;Q!==null;){if(a=Q,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:Jf(9,a)}}catch(C){Ye(a,a.return,C)}if(a===i){Q=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,Q=x;break e}Q=a.return}}if(Ee=o,as(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot($f,e)}catch(C){}r=!0}return r}finally{_e=n,jn.transition=t}}return!1}function YC(e,t,n){t=va(n,t),t=b1(e,t,1),e=Jo(e,t,1),t=Qt(),e!==null&&(kc(e,1,t),yn(e,t))}function Ye(e,t,n){if(e.tag===3)YC(e,e,n);else for(;t!==null;){if(t.tag===3){YC(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(es===null||!es.has(r))){e=va(n,e),e=E1(t,e,1),t=Jo(t,e,1),e=Qt(),t!==null&&(kc(t,1,e),yn(t,e));break}}t=t.return}}function KD(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Qt(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Nt&n)===n&&(ut===4||ut===3&&(Nt&130023424)===Nt&&500>Je()-Lv?qs(e,0):Mv|=n),yn(e,t)}function j1(e,t){t===0&&((e.mode&1)===0?t=1:(t=Yd,Yd<<=1,(Yd&130023424)===0&&(Yd=4194304)));var n=Qt();e=co(e,t),e!==null&&(kc(e,t,n),yn(e,n))}function GD(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),j1(e,n)}function qD(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(F(314))}r!==null&&r.delete(t),j1(e,n)}var W1;W1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||gn.current)mn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return mn=!1,OD(e,t,n);mn=(e.flags&131072)!==0}else mn=!1,je&&(t.flags&1048576)!==0&&qT(t,Mf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;yf(e,t),e=t.pendingProps;var o=ma(t,Ut.current);da(t,n),o=Rv(null,t,r,e,o,n);var s=Pv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,hn(r)?(s=!0,_f(t)):s=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,bv(t),o.updater=Zf,t.stateNode=o,o._reactInternals=t,zy(t,r,e,n),t=Uy(null,t,r,!0,s,n)):(t.tag=0,je&&s&&gv(t),Xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(yf(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=XD(r),e=or(r,e),o){case 0:t=By(null,t,r,e,n);break e;case 1:t=HC(null,t,r,e,n);break e;case 11:t=FC(null,t,r,e,n);break e;case 14:t=zC(null,t,r,or(r.type,e),n);break e}throw Error(F(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:or(r,o),By(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:or(r,o),HC(e,t,r,o,n);case 3:e:{if(R1(t),e===null)throw Error(F(387));r=t.pendingProps,s=t.memoizedState,o=s.element,e1(e,t),Df(t,r,null,n);var i=t.memoizedState;if(r=i.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){o=va(Error(F(423)),t),t=BC(e,t,r,n,o);break e}else if(r!==o){o=va(Error(F(424)),t),t=BC(e,t,r,n,o);break e}else for(Rn=Zo(t.stateNode.containerInfo.firstChild),Pn=t,je=!0,ir=null,n=ZT(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ga(),r===o){t=uo(e,t,n);break e}Xt(e,t,r,n)}t=t.child}return t;case 5:return t1(t),e===null&&Oy(t),r=t.type,o=t.pendingProps,s=e!==null?e.memoizedProps:null,i=o.children,Ay(r,o)?i=null:s!==null&&Ay(r,s)&&(t.flags|=32),k1(e,t),Xt(e,t,i,n),t.child;case 6:return e===null&&Oy(t),null;case 13:return P1(e,t,n);case 4:return Ev(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ha(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:or(r,o),FC(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:{if(r=t.type._context,o=t.pendingProps,s=t.memoizedProps,i=o.value,ze(Lf,r._currentValue),r._currentValue=i,s!==null)if(cr(s.value,i)){if(s.children===o.children&&!gn.current){t=uo(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){i=s.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(s.tag===1){l=io(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Dy(s.return,n,t),a.lanes|=n;break}l=l.next}}else if(s.tag===10)i=s.type===t.type?null:s.child;else if(s.tag===18){if(i=s.return,i===null)throw Error(F(341));i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Dy(i,n,t),i=s.sibling}else i=s.child;if(i!==null)i.return=s;else for(i=s;i!==null;){if(i===t){i=null;break}if(s=i.sibling,s!==null){s.return=i.return,i=s;break}i=i.return}s=i}Xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,da(t,n),o=Wn(o),r=r(o),t.flags|=1,Xt(e,t,r,n),t.child;case 14:return r=t.type,o=or(r,t.pendingProps),o=or(r.type,o),zC(e,t,r,o,n);case 15:return C1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:or(r,o),yf(e,t),t.tag=1,hn(r)?(e=!0,_f(t)):e=!1,da(t,n),w1(t,r,o),zy(t,r,o,n),Uy(null,t,r,!0,e,n);case 19:return I1(e,t,n);case 22:return T1(e,t,n)}throw Error(F(156,t.tag))};function $1(e,t){return vT(e,t)}function YD(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.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vn(e,t,n,r){return new YD(e,t,n,r)}function zv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XD(e){if(typeof e=="function")return zv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rv)return 11;if(e===ov)return 14}return 2}function ns(e,t){var n=e.alternate;return n===null?(n=Vn(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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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 xf(e,t,n,r,o,s){var i=2;if(r=e,typeof e=="function")zv(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Xi:return Ys(n.children,o,s,t);case nv:i=8,o|=8;break;case ly:return e=Vn(12,n,t,o|2),e.elementType=ly,e.lanes=s,e;case cy:return e=Vn(13,n,t,o),e.elementType=cy,e.lanes=s,e;case uy:return e=Vn(19,n,t,o),e.elementType=uy,e.lanes=s,e;case tT:return tp(n,o,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case JC:i=10;break e;case eT:i=9;break e;case rv:i=11;break e;case ov:i=14;break e;case jo:i=16,r=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Vn(i,n,t,o),t.elementType=e,t.type=r,t.lanes=s,t}function Ys(e,t,n,r){return e=Vn(7,e,r,t),e.lanes=n,e}function tp(e,t,n,r){return e=Vn(22,e,r,t),e.elementType=tT,e.lanes=n,e.stateNode={isHidden:!1},e}function sy(e,t,n){return e=Vn(6,e,null,t),e.lanes=n,e}function iy(e,t,n){return t=Vn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function QD(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jh(0),this.expirationTimes=jh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Hv(e,t,n,r,o,s,i,a,l){return e=new QD(e,t,n,a,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Vn(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},bv(s),e}function ZD(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Yi,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function K1(e){if(!e)return os;e=e._reactInternals;e:{if(ni(e)!==e||e.tag!==1)throw Error(F(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(hn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(F(171))}if(e.tag===1){var n=e.type;if(hn(n))return KT(e,n,t)}return t}function G1(e,t,n,r,o,s,i,a,l){return e=Hv(n,r,!0,e,o,s,i,a,l),e.context=K1(null),n=e.current,r=Qt(),o=ts(n),s=io(r,o),s.callback=t!=null?t:null,Jo(n,s,o),e.current.lanes=o,kc(e,o,r),yn(e,r),e}function np(e,t,n,r){var o=t.current,s=Qt(),i=ts(o);return n=K1(n),t.context===null?t.context=n:t.pendingContext=n,t=io(s,i),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Jo(o,t,i),e!==null&&(lr(e,o,i,s),mf(e,o,i)),i}function Wf(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function XC(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bv(e,t){XC(e,t),(e=e.alternate)&&XC(e,t)}function JD(){return null}var q1=typeof reportError=="function"?reportError:function(e){console.error(e)};function Uv(e){this._internalRoot=e}rp.prototype.render=Uv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(F(409));np(e,t,null,null)};rp.prototype.unmount=Uv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ei(function(){np(null,e,null,null)}),t[lo]=null}};function rp(e){this._internalRoot=e}rp.prototype.unstable_scheduleHydration=function(e){if(e){var t=TT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<$o.length&&t!==0&&t<$o[n].priority;n++);$o.splice(n,0,e),n===0&&RT(e)}};function Vv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function op(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function QC(){}function e3(e,t,n,r,o){if(o){if(typeof r=="function"){var s=r;r=function(){var c=Wf(i);s.call(c)}}var i=G1(t,r,e,0,null,!1,!1,"",QC);return e._reactRootContainer=i,e[lo]=i.current,yc(e.nodeType===8?e.parentNode:e),ei(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=Wf(l);a.call(c)}}var l=Hv(e,0,!1,null,null,!1,!1,"",QC);return e._reactRootContainer=l,e[lo]=l.current,yc(e.nodeType===8?e.parentNode:e),ei(function(){np(t,l,n,r)}),l}function sp(e,t,n,r,o){var s=n._reactRootContainer;if(s){var i=s;if(typeof o=="function"){var a=o;o=function(){var l=Wf(i);a.call(l)}}np(t,i,e,o)}else i=e3(n,t,e,o,r);return Wf(i)}ET=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Zl(t.pendingLanes);n!==0&&(av(t,n|1),yn(t,Je()),(Ee&6)===0&&(Sa=Je()+500,as()))}break;case 13:ei(function(){var r=co(e,1);if(r!==null){var o=Qt();lr(r,e,1,o)}}),Bv(e,1)}};lv=function(e){if(e.tag===13){var t=co(e,134217728);if(t!==null){var n=Qt();lr(t,e,134217728,n)}Bv(e,134217728)}};CT=function(e){if(e.tag===13){var t=ts(e),n=co(e,t);if(n!==null){var r=Qt();lr(n,e,t,r)}Bv(e,t)}};TT=function(){return _e};kT=function(e,t){var n=_e;try{return _e=e,t()}finally{_e=n}};xy=function(e,t,n){switch(t){case"input":if(py(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=Yf(r);if(!o)throw Error(F(90));rT(r),py(r,o)}}}break;case"textarea":sT(e,n);break;case"select":t=n.value,t!=null&&aa(e,!!n.multiple,t,!1)}};fT=Ov;pT=ei;var t3={usingClientEntryPoint:!1,Events:[Pc,ea,Yf,uT,dT,Ov]},ql={findFiberByHostInstance:$s,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},n3={bundleType:ql.bundleType,version:ql.version,rendererPackageName:ql.rendererPackageName,rendererConfig:ql.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hT(e),e===null?null:e.stateNode},findFiberByHostInstance:ql.findFiberByHostInstance||JD,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Yl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Yl.isDisabled&&Yl.supportsFiber))try{$f=Yl.inject(n3),Dr=Yl}catch(e){}var Yl;_n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=t3;_n.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vv(t))throw Error(F(200));return ZD(e,t,null,n)};_n.createRoot=function(e,t){if(!Vv(e))throw Error(F(299));var n=!1,r="",o=q1;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Hv(e,1,!1,null,null,n,!1,r,o),e[lo]=t.current,yc(e.nodeType===8?e.parentNode:e),new Uv(t)};_n.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(F(188)):(e=Object.keys(e).join(","),Error(F(268,e)));return e=hT(t),e=e===null?null:e.stateNode,e};_n.flushSync=function(e){return ei(e)};_n.hydrate=function(e,t,n){if(!op(t))throw Error(F(200));return sp(null,e,t,!0,n)};_n.hydrateRoot=function(e,t,n){if(!Vv(e))throw Error(F(405));var r=n!=null&&n.hydratedSources||null,o=!1,s="",i=q1;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(i=n.onRecoverableError)),t=G1(t,null,e,1,n!=null?n:null,o,!1,s,i),e[lo]=t.current,yc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new rp(t)};_n.render=function(e,t,n){if(!op(t))throw Error(F(200));return sp(null,e,t,!1,n)};_n.unmountComponentAtNode=function(e){if(!op(e))throw Error(F(40));return e._reactRootContainer?(ei(function(){sp(null,null,e,!1,function(){e._reactRootContainer=null,e[lo]=null})}),!0):!1};_n.unstable_batchedUpdates=Ov;_n.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!op(n))throw Error(F(200));if(e==null||e._reactInternals===void 0)throw Error(F(38));return sp(e,t,n,!1,r)};_n.version="18.3.1-next-f1338f8080-20240426"});var Ac=cn((w7,Q1)=>{"use strict";function X1(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(X1)}catch(e){console.error(e)}}X1(),Q1.exports=Y1()});var DR=cn(P0=>{"use strict";var OR=Ac();P0.createRoot=OR.createRoot,P0.hydrateRoot=OR.hydrateRoot;var Tj});var M0=cn((pW,GR)=>{"use strict";var nF="Expected a function",$R=NaN,rF="[object Symbol]",oF=/^\s+|\s+$/g,sF=/^[-+]0x[0-9a-f]+$/i,iF=/^0b[01]+$/i,aF=/^0o[0-7]+$/i,lF=parseInt,cF=typeof global=="object"&&global&&global.Object===Object&&global,uF=typeof self=="object"&&self&&self.Object===Object&&self,dF=cF||uF||Function("return this")(),fF=Object.prototype,pF=fF.toString,mF=Math.max,gF=Math.min,_0=function(){return dF.Date.now()};function hF(e,t,n){var r,o,s,i,a,l,c=0,u=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(nF);t=KR(t)||0,N0(n)&&(u=!!n.leading,f="maxWait"in n,s=f?mF(KR(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d);function p(T){var k=r,A=o;return r=o=void 0,c=T,i=e.apply(A,k),i}function h(T){return c=T,a=setTimeout(y,t),u?p(T):i}function m(T){var k=T-l,A=T-c,H=t-k;return f?gF(H,s-A):H}function S(T){var k=T-l,A=T-c;return l===void 0||k>=t||k<0||f&&A>=s}function y(){var T=_0();if(S(T))return g(T);a=setTimeout(y,m(T))}function g(T){return a=void 0,d&&r?p(T):(r=o=void 0,i)}function v(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function x(){return a===void 0?i:g(_0())}function C(){var T=_0(),k=S(T);if(r=arguments,o=this,l=T,k){if(a===void 0)return h(l);if(f)return a=setTimeout(y,t),p(l)}return a===void 0&&(a=setTimeout(y,t)),i}return C.cancel=v,C.flush=x,C}function N0(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function yF(e){return!!e&&typeof e=="object"}function vF(e){return typeof e=="symbol"||yF(e)&&pF.call(e)==rF}function KR(e){if(typeof e=="number")return e;if(vF(e))return $R;if(N0(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=N0(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(oF,"");var n=iF.test(e);return n||aF.test(e)?lF(e.slice(2),n?2:8):sF.test(e)?$R:+e}GR.exports=hF});var aP=cn((UW,iP)=>{"use strict";var PF=/["'&<>]/;iP.exports=IF;function IF(e){var t=""+e,n=PF.exec(t);if(!n)return t;var r,o="",s=0,i=0;for(s=n.index;s<t.length;s++){switch(t.charCodeAt(s)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}i!==s&&(o+=t.substring(i,s)),i=s+1,o+=r}return i!==s?o+t.substring(i,s):o}});var Y6={};yt(Y6,{Card:()=>Se,ContentEditableInput:()=>Ei,DeepdeskAPI:()=>Po,DeepdeskSDK:()=>vu,HTTPClient:()=>ki,InputMediator:()=>Ro,InputType:()=>Ps,KeyboardHint:()=>Du,Label:()=>Cx,Locale:()=>fl,Section:()=>Cr,SectionList:()=>Oi,Sources:()=>Tr,Suggestion:()=>de,SuggestionList:()=>Ct,TextAreaInput:()=>Ci,ToggleButton:()=>Rs,attachFile:()=>jA,authenticateWithKey:()=>WA,createFullRange:()=>Xa,createOverlayContainer:()=>yu,createRangeFromOffsets:()=>Es,escapeHTML:()=>Ba,formatTextMarkup:()=>$A,getRangeOffsets:()=>mu,getRangeText:()=>gu,insertCKEditor:()=>YA,isHTML:()=>qc,isSupportedInputElement:()=>Mm,logEvent:()=>gd,updateContentEditable:()=>GA,updateTextArea:()=>KA,useClickOutsideRoot:()=>ls,useStyles:()=>O,waitForElementVisibilityChange:()=>Dm});var cg=E(De()),Fn=E(Z());var _u=E(Z()),mx=E(De());var ol=_u.default.createContext({});function O(e,t){let s=(0,_u.useContext)(ol),{debug:n}=s,o=se(s,["debug"])[e];return Object.entries(t).reduce((i,[a,l])=>{let c=o==null?void 0:o[a];return I(b({},i),{[a]:(0,mx.default)(l,c,n?`${e}__${a}`:!1)})},{})}var gx={root:"dd-4s9wq"};var Ts=E(P()),Mu=()=>(0,Ts.jsxs)("svg",{className:gx.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ts.jsx)("defs",{children:(0,Ts.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Ts.jsx)("title",{children:"Failed loading image"}),(0,Ts.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 lg={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var ks=E(P()),Lu=(0,Fn.createContext)(lg),B_=({title:e,src:t})=>{let n=(0,Fn.useContext)(Lu),[r,o]=(0,Fn.useState)(!1);return(0,Fn.useEffect)(()=>{o(!1)},[t]),(0,ks.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,ks.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,ks.jsx)(Mu,{})})},U_=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Fn.useContext)(Lu);return(0,ks.jsx)("div",{className:(0,cg.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},V_=s=>{var i=s,{as:e="h1",cropText:t=!1,className:n,children:r}=i,o=se(i,["as","cropText","className","children"]);let a=(0,Fn.useContext)(Lu);return Fn.default.createElement(e,b({className:(0,cg.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},Ou=({children:e})=>{let t=O("Card",lg);return(0,ks.jsx)("div",{className:t.root,children:(0,ks.jsx)(Lu.Provider,{value:t,children:e})})};Ou.Image=B_;Ou.Content=U_;Ou.Title=V_;var Se=Ou;var xx=E(De());var Sx={root:"dd-llBx9"};var wx=E(P());var j_={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},W_=r=>{var o=r,{className:e,keyCode:t}=o,n=se(o,["className","keyCode"]);let s=O("KeyboardHint",Sx);return(0,wx.jsx)("span",b({"data-key":j_[t],className:(0,xx.default)(e,s.root)},n))},Du=W_;var Ex=E(De());var bx={root:"dd-e6HXZ"};var Tx=E(P()),$_=r=>{var o=r,{className:e,children:t}=o,n=se(o,["className","children"]);let s=O("Label",bx);return(0,Tx.jsx)("span",I(b({},n),{className:(0,Ex.default)(e,s.root),children:t}))},Cx=$_;var kx={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var Li=E(P()),K_=o=>{var s=o,{title:e,children:t,type:n}=s,r=se(s,["title","children","type"]);let i=O("Section",kx);return(0,Li.jsxs)("section",I(b({},r),{className:i.root,"data-section-type":n,children:[e&&(0,Li.jsx)("div",{className:i.subTitleContainer,children:(0,Li.jsx)("span",{className:i.subtitle,children:e})}),(0,Li.jsx)("div",{className:i.suggestions,children:t})]}))},Cr=K_;var _x=E(De()),Nx=E(Z());var _o=E(Z()),Ix=E(P()),Rx=(0,_o.createContext)(null),Px=({scrollContainerRef:e,children:t})=>{let n=(0,_o.useCallback)(r=>{let o=e.current;if(!o||o.scrollHeight<=o.clientHeight)return;let{top:s}=o.getBoundingClientRect(),{top:i}=r.getBoundingClientRect(),a=o.scrollTop+(i-s);typeof o.scrollTo=="function"?o.scrollTo({top:a}):o.scrollTop=a},[]);return(0,Ix.jsx)(Rx.Provider,{value:n,children:t})},Fu=e=>{let t=(0,_o.useContext)(Rx);(0,_o.useEffect)(()=>{let n=e.current;n&&t(n)},[])};var Ax={root:"dd-uoTXh"};var ug=E(P()),G_=({className:e,children:t})=>{let n=O("SectionList",Ax),r=(0,Nx.useRef)(null);return(0,ug.jsx)(Px,{scrollContainerRef:r,children:(0,ug.jsx)("div",{ref:r,className:(0,_x.default)(n.root,e),children:t})})},Oi=G_;var Di=E(De()),un=E(Z());var dg={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",buttonPrimary:"dd-aYDCB",buttonSecondary:"dd--cpPL",buttonWithIcon:"dd-MQVt5",icon:"dd-Jr-ww",buttonDisabled:"dd-agTuH"};var Kt=E(P()),No=(0,un.createContext)(dg),q_=r=>{var o=r,{fixed:e,children:t}=o,n=se(o,["fixed","children"]);let s=(0,un.useContext)(No);return(0,Kt.jsx)("div",I(b({},n),{className:(0,Di.default)(s.actions,{[s.actionsIsFixed]:e}),children:t}))};function Y_(l){var c=l,{as:e,className:t,icon:n,title:r,children:o,disabled:s,variant:i}=c,a=se(c,["as","className","icon","title","children","disabled","variant"]);let u=(0,un.useContext)(No);return(0,Kt.jsxs)(e||"button",I(b({type:"button",className:(0,Di.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:s,[u.buttonPrimary]:i==="primary",[u.buttonSecondary]:i==="secondary"},t),title:r,"aria-label":r},a),{children:[n&&(0,Kt.jsx)("span",{className:u.icon,children:n}),o]}))}var X_=({children:e})=>{let t=(0,un.useContext)(No);return(0,Kt.jsx)("div",{className:t.buttonsContainer,children:e})},Q_=({className:e,primary:t,disabled:n,label:r,children:o})=>{let s=(0,un.useContext)(No);return(0,Kt.jsxs)("div",{className:(0,Di.default)(e,s.actionButton,s.dropdownButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onMouseDown:i=>i.stopPropagation(),onClick:i=>i.stopPropagation(),children:[r,(0,Kt.jsx)("ul",{className:s.dropdownList,children:o})]})},Z_=({index:e,label:t,onClick:n})=>{let r=(0,un.useContext)(No);return(0,Kt.jsx)("li",{className:r.dropdownItem,children:(0,Kt.jsx)("button",{className:r.dropdownItemButton,type:"button","data-index":e,onClick:n,children:t})})},J_=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let s=(0,un.useContext)(No);return(0,Kt.jsx)("button",{type:"button",className:(0,Di.default)(e,s.actionButton,{[s.actionButtonIsPrimary]:t,[s.actionButtonIsDisabled]:n}),onClick:r!=null?r:(i=>i.stopPropagation()),disabled:n,"aria-hidden":n,children:o})},eN=({labels:e})=>{let t=(0,un.useContext)(No);return(0,Kt.jsx)("div",{className:t.labels,children:e.map(n=>(0,Kt.jsx)("span",{className:t.label,children:n},n))})},Mo=un.default.forwardRef((a,i)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,s=se(l,["className","selected","onClick","children","as"]);let c=O("Suggestion",dg),u=(0,un.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,Kt.jsx)(o,I(b({},s),{ref:i,className:(0,Di.default)(e,c.root,{[c.isSelected]:t,[c.isClickable]:!!n}),onClick:u,children:(0,Kt.jsx)(No.Provider,{value:c,children:r})}))});Mo.Labels=eN;Mo.Actions=q_;Mo.ActionButton=J_;Mo.DropdownButton=Q_;Mo.DropdownItem=Z_;Mo.ButtonsContainer=X_;Mo.Button=Y_;var de=Mo;var Lx=E(De());var Mx={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Ox=E(P()),tN=({withDivider:e,children:t})=>{let n=O("SuggestionList",Mx);return(0,Ox.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Lx.default)(n.root,{[n.isWithDivider]:e}),children:t})},Ct=tN;var Fx=E(De());var Dx={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var zu=E(P()),nN=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=O("ToggleButton",Dx);return(0,zu.jsx)("button",{type:"button",className:(0,Fx.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,zu.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,zu.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},Rs=nN;var zx=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,Hu=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var Hx=/x-deepdesk-(([a-z0-9\-_])+-version)/,Bu=["cues","custom-data","custom-data-banner","knowledge-assist"],Bx=Intl.DateTimeFormat().resolvedOptions().timeZone,Tr=(S=>(S.SEARCH="search",S.TEMPLATE="template",S.ELASTIC_SEARCH="search-autocomplete",S.GPT="gpt",S.TRIE="trie",S.TRIE_WITH_TYPOS="trie-with-typos",S.SEMANTIC="semantic",S.TEXT_RECOMMENDATION="text_recommendation",S.URL_RECOMMENDATION="url_recommendation",S.LINK_RECOMMENDATION="link_recommendation",S.PERSONAL_COLLECTION="personal-collection",S.PERSONAL_COLLECTION_SEARCH="personal-collection-search",S.SEARCH_OVERLAY="search-overlay",S.SEARCH_PREVIEW="search-preview",S.SEARCH_URL="search-url",S.STYLE="style",S))(Tr||{}),Ps=(i=>(i.ENTER="enter",i.TAB="tab",i.ARROW="arrow",i.HOTKEY="hotkey",i.MOUSE="mouse",i.SPACE="space",i))(Ps||{});var et=E(Z());var ae=E(Z(),1),sw=E(Wx(),1);var uN=ae.version.startsWith("19"),dN=Symbol.for(uN?"react.transitional.element":"react.element"),fN=Symbol.for("react.portal"),pN=Symbol.for("react.fragment"),mN=Symbol.for("react.strict_mode"),gN=Symbol.for("react.profiler"),hN=Symbol.for("react.consumer"),yN=Symbol.for("react.context"),Qx=Symbol.for("react.forward_ref"),vN=Symbol.for("react.suspense"),SN=Symbol.for("react.suspense_list"),yg=Symbol.for("react.memo"),xN=Symbol.for("react.lazy");var wN=Qx,bN=yg;function EN(e){if(typeof e=="object"&&e!==null){let{$$typeof:t}=e;switch(t){case dN:switch(e=e.type,e){case pN:case gN:case mN:case vN:case SN:return e;default:switch(e=e&&e.$$typeof,e){case yN:case Qx:case xN:case yg:return e;case hN:return e;default:return t}}case fN:return t}}}function CN(e){return EN(e)===yg}function TN(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:s,areStatePropsEqual:i}){let a=!1,l,c,u,f,d;function p(g,v){return l=g,c=v,u=e(l,c),f=t(r,c),d=n(u,f,c),a=!0,d}function h(){return u=e(l,c),t.dependsOnOwnProps&&(f=t(r,c)),d=n(u,f,c),d}function m(){return e.dependsOnOwnProps&&(u=e(l,c)),t.dependsOnOwnProps&&(f=t(r,c)),d=n(u,f,c),d}function S(){let g=e(l,c),v=!i(g,u);return u=g,v&&(d=n(u,f,c)),d}function y(g,v){let x=!s(v,c),C=!o(g,l,v,c);return l=g,c=v,x&&C?h():x?m():C?S():d}return function(v,x){return a?y(v,x):p(v,x)}}function kN(e,s){var i=s,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r}=i,o=se(i,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]);let a=t(e,o),l=n(e,o),c=r(e,o);return TN(a,l,c,e,o)}function RN(e,t){let n={};for(let r in e){let o=e[r];typeof o=="function"&&(n[r]=(...s)=>t(o(...s)))}return n}function gg(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function $x(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function Zx(e,t){return function(r,{displayName:o}){let s=function(a,l){return s.dependsOnOwnProps?s.mapToProps(a,l):s.mapToProps(a,void 0)};return s.dependsOnOwnProps=!0,s.mapToProps=function(a,l){s.mapToProps=e,s.dependsOnOwnProps=$x(e);let c=s(a,l);return typeof c=="function"&&(s.mapToProps=c,s.dependsOnOwnProps=$x(c),c=s(a,l)),c},s}}function vg(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function PN(e){return e&&typeof e=="object"?gg(t=>RN(e,t)):e?typeof e=="function"?Zx(e,"mapDispatchToProps"):vg(e,"mapDispatchToProps"):gg(t=>({dispatch:t}))}function IN(e){return e?typeof e=="function"?Zx(e,"mapStateToProps"):vg(e,"mapStateToProps"):gg(()=>({}))}function AN(e,t,n){return b(b(b({},n),e),t)}function _N(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let s=!1,i;return function(l,c,u){let f=e(l,c,u);return s?o(f,i)||(i=f):(s=!0,i=f),i}}}function NN(e){return e?typeof e=="function"?_N(e):vg(e,"mergeProps"):()=>AN}function MN(e){e()}function LN(){let e=null,t=null;return{clear(){e=null,t=null},notify(){MN(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var Kx={notify(){},get:()=>[]};function Jx(e,t){let n,r=Kx,o=0,s=!1;function i(m){u();let S=r.subscribe(m),y=!1;return()=>{y||(y=!0,S(),f())}}function a(){r.notify()}function l(){h.onStateChange&&h.onStateChange()}function c(){return s}function u(){o++,n||(n=t?t.addNestedSub(l):e.subscribe(l),r=LN())}function f(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=Kx)}function d(){s||(s=!0,u())}function p(){s&&(s=!1,f())}let h={addNestedSub:i,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:p,getListeners:()=>r};return h}var ON=()=>typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",DN=ON(),FN=()=>typeof navigator!="undefined"&&navigator.product==="ReactNative",zN=FN(),HN=()=>DN||zN?ae.useLayoutEffect:ae.useEffect,Uu=HN();function Gx(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function fg(e,t){if(Gx(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])||!Gx(e[n[o]],t[n[o]]))return!1;return!0}var BN={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},UN={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},VN={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ew={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},jN={[wN]:VN,[bN]:ew};function qx(e){return CN(e)?ew:jN[e.$$typeof]||BN}var WN=Object.defineProperty,$N=Object.getOwnPropertyNames,Yx=Object.getOwnPropertySymbols,KN=Object.getOwnPropertyDescriptor,GN=Object.getPrototypeOf,Xx=Object.prototype;function hg(e,t){if(typeof t!="string"){if(Xx){let s=GN(t);s&&s!==Xx&&hg(e,s)}let n=$N(t);Yx&&(n=n.concat(Yx(t)));let r=qx(e),o=qx(t);for(let s=0;s<n.length;++s){let i=n[s];if(!UN[i]&&!(o&&o[i])&&!(r&&r[i])){let a=KN(t,i);try{WN(e,i,a)}catch(l){}}}}return e}var pg=Symbol.for("react-redux-context"),mg=typeof globalThis!="undefined"?globalThis:{};function qN(){var n;if(!ae.createContext)return{};let e=(n=mg[pg])!=null?n:mg[pg]=new Map,t=e.get(ae.createContext);return t||(t=ae.createContext(null),e.set(ae.createContext,t)),t}var Gr=qN(),YN=[null,null];function XN(e,t,n){Uu(()=>e(...t),n)}function QN(e,t,n,r,o,s){e.current=r,n.current=!1,o.current&&(o.current=null,s())}function ZN(e,t,n,r,o,s,i,a,l,c,u){if(!e)return()=>{};let f=!1,d=null,p=()=>{if(f||!a.current)return;let m=t.getState(),S,y;try{S=r(m,o.current)}catch(g){y=g,d=g}y||(d=null),S===s.current?i.current||c():(s.current=S,l.current=S,i.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function JN(e,t){return e===t}function eM(e,t,n,{pure:r,areStatesEqual:o=JN,areOwnPropsEqual:s=fg,areStatePropsEqual:i=fg,areMergedPropsEqual:a=fg,forwardRef:l=!1,context:c=Gr}={}){let u=c,f=IN(e),d=PN(t),p=NN(n),h=!!e;return S=>{let y=S.displayName||S.name||"Component",g=`Connect(${y})`,v={shouldHandleStateChanges:h,displayName:g,wrappedComponentName:y,WrappedComponent:S,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:p,areStatesEqual:o,areStatePropsEqual:i,areOwnPropsEqual:s,areMergedPropsEqual:a};function x(k){let[A,H,D]=ae.useMemo(()=>{let fe=k,{reactReduxForwardedRef:oe}=fe,ne=se(fe,["reactReduxForwardedRef"]);return[k.context,oe,ne]},[k]),B=ae.useMemo(()=>{let oe=u;return A!=null&&A.Consumer,oe},[A,u]),J=ae.useContext(B),Y=!!k.store&&!!k.store.getState&&!!k.store.dispatch,_=!!J&&!!J.store,V=Y?k.store:J.store,z=_?J.getServerState:V.getState,U=ae.useMemo(()=>kN(V.dispatch,v),[V]),[M,q]=ae.useMemo(()=>{if(!h)return YN;let oe=Jx(V,Y?void 0:J.subscription),ne=oe.notifyNestedSubs.bind(oe);return[oe,ne]},[V,Y,J]),$=ae.useMemo(()=>Y?J:I(b({},J),{subscription:M}),[Y,J,M]),K=ae.useRef(void 0),ce=ae.useRef(D),te=ae.useRef(void 0),Qe=ae.useRef(!1),ve=ae.useRef(!1),tt=ae.useRef(void 0);Uu(()=>(ve.current=!0,()=>{ve.current=!1}),[]);let pt=ae.useMemo(()=>()=>te.current&&D===ce.current?te.current:U(V.getState(),D),[V,D]),Oe=ae.useMemo(()=>ne=>M?ZN(h,V,M,U,ce,K,Qe,ve,te,q,ne):()=>{},[M]);XN(QN,[ce,K,Qe,D,te,q]);let Me;try{Me=ae.useSyncExternalStore(Oe,pt,z?()=>U(z(),D):pt)}catch(oe){throw tt.current&&(oe.message+=`
1
+ "use strict";var Deepdesk=(()=>{var O_=Object.create;var al=Object.defineProperty,L_=Object.defineProperties,D_=Object.getOwnPropertyDescriptor,F_=Object.getOwnPropertyDescriptors,z_=Object.getOwnPropertyNames,_u=Object.getOwnPropertySymbols,H_=Object.getPrototypeOf,mg=Object.prototype.hasOwnProperty,gx=Object.prototype.propertyIsEnumerable;var gg=Math.pow,pg=(e,t,n)=>t in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t)=>{for(var n in t||(t={}))mg.call(t,n)&&pg(e,n,t[n]);if(_u)for(var n of _u(t))gx.call(t,n)&&pg(e,n,t[n]);return e},A=(e,t)=>L_(e,F_(t));var hg=e=>typeof e=="symbol"?e:e+"",ie=(e,t)=>{var n={};for(var r in e)mg.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&_u)for(var r of _u(e))t.indexOf(r)<0&&gx.call(e,r)&&(n[r]=e[r]);return n};var un=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},ht=(e,t)=>{for(var n in t)al(e,n,{get:t[n],enumerable:!0})},hx=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of z_(t))!mg.call(e,o)&&o!==n&&al(e,o,{get:()=>t[o],enumerable:!(r=D_(t,o))||r.enumerable});return e};var b=(e,t,n)=>(n=e!=null?O_(H_(e)):{},hx(t||!e||!e.__esModule?al(n,"default",{value:e,enumerable:!0}):n,e)),B_=e=>hx(al({},"__esModule",{value:!0}),e);var xe=(e,t,n)=>pg(e,typeof t!="symbol"?t+"":t,n);var M=(e,t,n)=>new Promise((r,o)=>{var i=l=>{try{a(n.next(l))}catch(c){o(c)}},s=l=>{try{a(n.throw(l))}catch(c){o(c)}},a=l=>l.done?r(l.value):Promise.resolve(l.value).then(i,s);a((n=n.apply(e,t)).next())});var De=un((Sz,Mu)=>{"use strict";(function(){"use strict";var e={}.hasOwnProperty;function t(){for(var o="",i=0;i<arguments.length;i++){var s=arguments[i];s&&(o=r(o,n(s)))}return o}function n(o){if(typeof o=="string"||typeof o=="number")return o;if(typeof o!="object")return"";if(Array.isArray(o))return t.apply(null,o);if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]"))return o.toString();var i="";for(var s in o)e.call(o,s)&&o[s]&&(i=r(i,s));return i}function r(o,i){return i?o?o+" "+i:o+i:o}typeof Mu!="undefined"&&Mu.exports?(t.default=t,Mu.exports=t):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return t}):window.classNames=t})()});var Px=un(he=>{"use strict";var ll=Symbol.for("react.element"),U_=Symbol.for("react.portal"),V_=Symbol.for("react.fragment"),W_=Symbol.for("react.strict_mode"),$_=Symbol.for("react.profiler"),j_=Symbol.for("react.provider"),K_=Symbol.for("react.context"),G_=Symbol.for("react.forward_ref"),q_=Symbol.for("react.suspense"),Y_=Symbol.for("react.memo"),X_=Symbol.for("react.lazy"),yx=Symbol.iterator;function Q_(e){return e===null||typeof e!="object"?null:(e=yx&&e[yx]||e["@@iterator"],typeof e=="function"?e:null)}var xx={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},wx=Object.assign,bx={};function Fs(e,t,n){this.props=e,this.context=t,this.refs=bx,this.updater=n||xx}Fs.prototype.isReactComponent={};Fs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Fs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ex(){}Ex.prototype=Fs.prototype;function vg(e,t,n){this.props=e,this.context=t,this.refs=bx,this.updater=n||xx}var Sg=vg.prototype=new Ex;Sg.constructor=vg;wx(Sg,Fs.prototype);Sg.isPureReactComponent=!0;var vx=Array.isArray,Cx=Object.prototype.hasOwnProperty,xg={current:null},Tx={key:!0,ref:!0,__self:!0,__source:!0};function kx(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)Cx.call(t,r)&&!Tx.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),c=0;c<a;c++)l[c]=arguments[c+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:ll,type:e,key:i,ref:s,props:o,_owner:xg.current}}function Z_(e,t){return{$$typeof:ll,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function wg(e){return typeof e=="object"&&e!==null&&e.$$typeof===ll}function J_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Sx=/\/+/g;function yg(e,t){return typeof e=="object"&&e!==null&&e.key!=null?J_(""+e.key):t.toString(36)}function Ou(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 ll:case U_:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+yg(s,0):r,vx(o)?(n="",e!=null&&(n=e.replace(Sx,"$&/")+"/"),Ou(o,t,n,"",function(c){return c})):o!=null&&(wg(o)&&(o=Z_(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Sx,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",vx(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+yg(i,a);s+=Ou(i,t,n,l,o)}else if(l=Q_(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+yg(i,a++),s+=Ou(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function Nu(e,t,n){if(e==null)return e;var r=[],o=0;return Ou(e,r,"","",function(i){return t.call(n,i,o++)}),r}function eM(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qt={current:null},Lu={transition:null},tM={ReactCurrentDispatcher:qt,ReactCurrentBatchConfig:Lu,ReactCurrentOwner:xg};function Rx(){throw Error("act(...) is not supported in production builds of React.")}he.Children={map:Nu,forEach:function(e,t,n){Nu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Nu(e,function(){t++}),t},toArray:function(e){return Nu(e,function(t){return t})||[]},only:function(e){if(!wg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};he.Component=Fs;he.Fragment=V_;he.Profiler=$_;he.PureComponent=vg;he.StrictMode=W_;he.Suspense=q_;he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tM;he.act=Rx;he.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=wx({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=xg.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Cx.call(t,l)&&!Tx.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 c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:ll,type:e.type,key:o,ref:i,props:r,_owner:s}};he.createContext=function(e){return e={$$typeof:K_,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:j_,_context:e},e.Consumer=e};he.createElement=kx;he.createFactory=function(e){var t=kx.bind(null,e);return t.type=e,t};he.createRef=function(){return{current:null}};he.forwardRef=function(e){return{$$typeof:G_,render:e}};he.isValidElement=wg;he.lazy=function(e){return{$$typeof:X_,_payload:{_status:-1,_result:e},_init:eM}};he.memo=function(e,t){return{$$typeof:Y_,type:e,compare:t===void 0?null:t}};he.startTransition=function(e){var t=Lu.transition;Lu.transition={};try{e()}finally{Lu.transition=t}};he.unstable_act=Rx;he.useCallback=function(e,t){return qt.current.useCallback(e,t)};he.useContext=function(e){return qt.current.useContext(e)};he.useDebugValue=function(){};he.useDeferredValue=function(e){return qt.current.useDeferredValue(e)};he.useEffect=function(e,t){return qt.current.useEffect(e,t)};he.useId=function(){return qt.current.useId()};he.useImperativeHandle=function(e,t,n){return qt.current.useImperativeHandle(e,t,n)};he.useInsertionEffect=function(e,t){return qt.current.useInsertionEffect(e,t)};he.useLayoutEffect=function(e,t){return qt.current.useLayoutEffect(e,t)};he.useMemo=function(e,t){return qt.current.useMemo(e,t)};he.useReducer=function(e,t,n){return qt.current.useReducer(e,t,n)};he.useRef=function(e){return qt.current.useRef(e)};he.useState=function(e){return qt.current.useState(e)};he.useSyncExternalStore=function(e,t,n){return qt.current.useSyncExternalStore(e,t,n)};he.useTransition=function(){return qt.current.useTransition()};he.version="18.3.1"});var Z=un((wz,Ix)=>{"use strict";Ix.exports=Px()});var Nx=un(Fu=>{"use strict";var nM=Z(),rM=Symbol.for("react.element"),oM=Symbol.for("react.fragment"),iM=Object.prototype.hasOwnProperty,sM=nM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,aM={key:!0,ref:!0,__self:!0,__source:!0};function Mx(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)iM.call(t,r)&&!aM.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:rM,type:e,key:i,ref:s,props:o,_owner:sM.current}}Fu.Fragment=oM;Fu.jsx=Mx;Fu.jsxs=Mx});var I=un((Iz,Ox)=>{"use strict";Ox.exports=Nx()});var ow=un(rw=>{"use strict";var ul=Z();function TM(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kM=typeof Object.is=="function"?Object.is:TM,RM=ul.useSyncExternalStore,PM=ul.useRef,IM=ul.useEffect,AM=ul.useMemo,_M=ul.useDebugValue;rw.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=PM(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=AM(function(){function l(p){if(!c){if(c=!0,u=p,p=r(p),o!==void 0&&s.hasValue){var m=s.value;if(o(m,p))return f=m}return f=p}if(m=f,kM(u,p))return m;var g=r(p);return o!==void 0&&o(m,g)?(u=p,m):(u=p,f=g)}var c=!1,u,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=RM(e,i[0],i[1]);return IM(function(){s.hasValue=!0,s.value=a},[a]),_M(a),a}});var sw=un((t8,iw)=>{"use strict";iw.exports=ow()});var dC=un(Fe=>{"use strict";function Xh(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<ef(o,t))e[r]=t,e[n]=o,n=r;else break e}}function sr(e){return e.length===0?null:e[0]}function nf(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,o=e.length,i=o>>>1;r<i;){var s=2*(r+1)-1,a=e[s],l=s+1,c=e[l];if(0>ef(a,n))l<o&&0>ef(c,a)?(e[r]=c,e[l]=n,r=l):(e[r]=a,e[s]=n,r=s);else if(l<o&&0>ef(c,n))e[r]=c,e[l]=n,r=l;else break e}}return t}function ef(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(nC=performance,Fe.unstable_now=function(){return nC.now()}):(Gh=Date,rC=Gh.now(),Fe.unstable_now=function(){return Gh.now()-rC});var nC,Gh,rC,Mr=[],$o=[],P2=1,Vn=null,Ht=3,rf=!1,Wi=!1,$l=!1,sC=typeof setTimeout=="function"?setTimeout:null,aC=typeof clearTimeout=="function"?clearTimeout:null,oC=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Qh(e){for(var t=sr($o);t!==null;){if(t.callback===null)nf($o);else if(t.startTime<=e)nf($o),t.sortIndex=t.expirationTime,Xh(Mr,t);else break;t=sr($o)}}function Zh(e){if($l=!1,Qh(e),!Wi)if(sr(Mr)!==null)Wi=!0,ey(Jh);else{var t=sr($o);t!==null&&ty(Zh,t.startTime-e)}}function Jh(e,t){Wi=!1,$l&&($l=!1,aC(jl),jl=-1),rf=!0;var n=Ht;try{for(Qh(t),Vn=sr(Mr);Vn!==null&&(!(Vn.expirationTime>t)||e&&!uC());){var r=Vn.callback;if(typeof r=="function"){Vn.callback=null,Ht=Vn.priorityLevel;var o=r(Vn.expirationTime<=t);t=Fe.unstable_now(),typeof o=="function"?Vn.callback=o:Vn===sr(Mr)&&nf(Mr),Qh(t)}else nf(Mr);Vn=sr(Mr)}if(Vn!==null)var i=!0;else{var s=sr($o);s!==null&&ty(Zh,s.startTime-t),i=!1}return i}finally{Vn=null,Ht=n,rf=!1}}var of=!1,tf=null,jl=-1,lC=5,cC=-1;function uC(){return!(Fe.unstable_now()-cC<lC)}function qh(){if(tf!==null){var e=Fe.unstable_now();cC=e;var t=!0;try{t=tf(!0,e)}finally{t?Wl():(of=!1,tf=null)}}else of=!1}var Wl;typeof oC=="function"?Wl=function(){oC(qh)}:typeof MessageChannel!="undefined"?(Yh=new MessageChannel,iC=Yh.port2,Yh.port1.onmessage=qh,Wl=function(){iC.postMessage(null)}):Wl=function(){sC(qh,0)};var Yh,iC;function ey(e){tf=e,of||(of=!0,Wl())}function ty(e,t){jl=sC(function(){e(Fe.unstable_now())},t)}Fe.unstable_IdlePriority=5;Fe.unstable_ImmediatePriority=1;Fe.unstable_LowPriority=4;Fe.unstable_NormalPriority=3;Fe.unstable_Profiling=null;Fe.unstable_UserBlockingPriority=2;Fe.unstable_cancelCallback=function(e){e.callback=null};Fe.unstable_continueExecution=function(){Wi||rf||(Wi=!0,ey(Jh))};Fe.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"):lC=0<e?Math.floor(1e3/e):5};Fe.unstable_getCurrentPriorityLevel=function(){return Ht};Fe.unstable_getFirstCallbackNode=function(){return sr(Mr)};Fe.unstable_next=function(e){switch(Ht){case 1:case 2:case 3:var t=3;break;default:t=Ht}var n=Ht;Ht=t;try{return e()}finally{Ht=n}};Fe.unstable_pauseExecution=function(){};Fe.unstable_requestPaint=function(){};Fe.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=Ht;Ht=e;try{return t()}finally{Ht=n}};Fe.unstable_scheduleCallback=function(e,t,n){var r=Fe.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:P2++,callback:t,priorityLevel:e,startTime:n,expirationTime:o,sortIndex:-1},n>r?(e.sortIndex=n,Xh($o,e),sr(Mr)===null&&e===sr($o)&&($l?(aC(jl),jl=-1):$l=!0,ty(Zh,n-r))):(e.sortIndex=o,Xh(Mr,e),Wi||rf||(Wi=!0,ey(Jh))),e};Fe.unstable_shouldYield=uC;Fe.unstable_wrapCallback=function(e){var t=Ht;return function(){var n=Ht;Ht=t;try{return e.apply(this,arguments)}finally{Ht=n}}}});var pC=un((UU,fC)=>{"use strict";fC.exports=dC()});var yk=un(On=>{"use strict";var I2=Z(),Mn=pC();function H(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 xT=new Set,pc={};function ns(e,t){xa(e,t),xa(e+"Capture",t)}function xa(e,t){for(pc[e]=t,e=0;e<t.length;e++)xT.add(t[e])}var fo=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Cy=Object.prototype.hasOwnProperty,A2=/^[: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]*$/,mC={},gC={};function _2(e){return Cy.call(gC,e)?!0:Cy.call(mC,e)?!1:A2.test(e)?gC[e]=!0:(mC[e]=!0,!1)}function M2(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 N2(e,t,n,r){if(t===null||typeof t=="undefined"||M2(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 en(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 Nt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Nt[e]=new en(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Nt[t]=new en(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Nt[e]=new en(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Nt[e]=new en(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){Nt[e]=new en(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Nt[e]=new en(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Nt[e]=new en(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Nt[e]=new en(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Nt[e]=new en(e,5,!1,e.toLowerCase(),null,!1,!1)});var hv=/[\-:]([a-z])/g;function yv(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(hv,yv);Nt[t]=new en(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(hv,yv);Nt[t]=new en(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(hv,yv);Nt[t]=new en(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Nt[e]=new en(e,1,!1,e.toLowerCase(),null,!1,!1)});Nt.xlinkHref=new en("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Nt[e]=new en(e,1,!1,e.toLowerCase(),null,!0,!0)});function vv(e,t,n,r){var o=Nt.hasOwnProperty(t)?Nt[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(N2(t,n,o,r)&&(n=null),r||o===null?_2(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 ho=I2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,sf=Symbol.for("react.element"),na=Symbol.for("react.portal"),ra=Symbol.for("react.fragment"),Sv=Symbol.for("react.strict_mode"),Ty=Symbol.for("react.profiler"),wT=Symbol.for("react.provider"),bT=Symbol.for("react.context"),xv=Symbol.for("react.forward_ref"),ky=Symbol.for("react.suspense"),Ry=Symbol.for("react.suspense_list"),wv=Symbol.for("react.memo"),Ko=Symbol.for("react.lazy"),ET=Symbol.for("react.offscreen"),hC=Symbol.iterator;function Kl(e){return e===null||typeof e!="object"?null:(e=hC&&e[hC]||e["@@iterator"],typeof e=="function"?e:null)}var qe=Object.assign,ny;function ec(e){if(ny===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ny=t&&t[1]||""}return`
2
+ `+ny+e}var ry=!1;function oy(e,t){if(!e||ry)return"";ry=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
3
+ `),i=r.stack.split(`
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]){var l=`
5
+ `+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{ry=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ec(e):""}function O2(e){switch(e.tag){case 5:return ec(e.type);case 16:return ec("Lazy");case 13:return ec("Suspense");case 19:return ec("SuspenseList");case 0:case 2:case 15:return e=oy(e.type,!1),e;case 11:return e=oy(e.type.render,!1),e;case 1:return e=oy(e.type,!0),e;default:return""}}function Py(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ra:return"Fragment";case na:return"Portal";case Ty:return"Profiler";case Sv:return"StrictMode";case ky:return"Suspense";case Ry:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case bT:return(e.displayName||"Context")+".Consumer";case wT:return(e._context.displayName||"Context")+".Provider";case xv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wv:return t=e.displayName||null,t!==null?t:Py(e.type)||"Memo";case Ko:t=e._payload,e=e._init;try{return Py(e(t))}catch(n){}}return null}function L2(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Py(t);case 8:return t===Sv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function si(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function CT(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function D2(e){var t=CT(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n!="undefined"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function af(e){e._valueTracker||(e._valueTracker=D2(e))}function TT(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=CT(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lf(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Iy(e,t){var n=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function yC(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=si(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function kT(e,t){t=t.checked,t!=null&&vv(e,"checked",t,!1)}function Ay(e,t){kT(e,t);var n=si(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?_y(e,t.type,n):t.hasOwnProperty("defaultValue")&&_y(e,t.type,si(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function vC(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function _y(e,t,n){(t!=="number"||Lf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var tc=Array.isArray;function ma(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+si(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function My(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(H(91));return qe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function SC(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(H(92));if(tc(n)){if(1<n.length)throw Error(H(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:si(n)}}function RT(e,t){var n=si(t.value),r=si(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function xC(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function PT(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ny(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?PT(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var lf,IT=(function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(lf=lf||document.createElement("div"),lf.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=lf.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function mc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var oc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},F2=["Webkit","ms","Moz","O"];Object.keys(oc).forEach(function(e){F2.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oc[t]=oc[e]})});function AT(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||oc.hasOwnProperty(e)&&oc[e]?(""+t).trim():t+"px"}function _T(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=AT(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var z2=qe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Oy(e,t){if(t){if(z2[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(H(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(H(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(H(61))}if(t.style!=null&&typeof t.style!="object")throw Error(H(62))}}function Ly(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Dy=null;function bv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fy=null,ga=null,ha=null;function wC(e){if(e=Mc(e)){if(typeof Fy!="function")throw Error(H(280));var t=e.stateNode;t&&(t=cp(t),Fy(e.stateNode,e.type,t))}}function MT(e){ga?ha?ha.push(e):ha=[e]:ga=e}function NT(){if(ga){var e=ga,t=ha;if(ha=ga=null,wC(e),t)for(e=0;e<t.length;e++)wC(t[e])}}function OT(e,t){return e(t)}function LT(){}var iy=!1;function DT(e,t,n){if(iy)return e(t,n);iy=!0;try{return OT(e,t,n)}finally{iy=!1,(ga!==null||ha!==null)&&(LT(),NT())}}function gc(e,t){var n=e.stateNode;if(n===null)return null;var r=cp(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(H(231,t,typeof n));return n}var zy=!1;if(fo)try{ea={},Object.defineProperty(ea,"passive",{get:function(){zy=!0}}),window.addEventListener("test",ea,ea),window.removeEventListener("test",ea,ea)}catch(e){zy=!1}var ea;function H2(e,t,n,r,o,i,s,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var ic=!1,Df=null,Ff=!1,Hy=null,B2={onError:function(e){ic=!0,Df=e}};function U2(e,t,n,r,o,i,s,a,l){ic=!1,Df=null,H2.apply(B2,arguments)}function V2(e,t,n,r,o,i,s,a,l){if(U2.apply(this,arguments),ic){if(ic){var c=Df;ic=!1,Df=null}else throw Error(H(198));Ff||(Ff=!0,Hy=c)}}function rs(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function FT(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function bC(e){if(rs(e)!==e)throw Error(H(188))}function W2(e){var t=e.alternate;if(!t){if(t=rs(e),t===null)throw Error(H(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return bC(o),e;if(i===r)return bC(o),t;i=i.sibling}throw Error(H(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(H(189))}}if(n.alternate!==r)throw Error(H(190))}if(n.tag!==3)throw Error(H(188));return n.stateNode.current===n?e:t}function zT(e){return e=W2(e),e!==null?HT(e):null}function HT(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=HT(e);if(t!==null)return t;e=e.sibling}return null}var BT=Mn.unstable_scheduleCallback,EC=Mn.unstable_cancelCallback,$2=Mn.unstable_shouldYield,j2=Mn.unstable_requestPaint,Je=Mn.unstable_now,K2=Mn.unstable_getCurrentPriorityLevel,Ev=Mn.unstable_ImmediatePriority,UT=Mn.unstable_UserBlockingPriority,zf=Mn.unstable_NormalPriority,G2=Mn.unstable_LowPriority,VT=Mn.unstable_IdlePriority,ip=null,Dr=null;function q2(e){if(Dr&&typeof Dr.onCommitFiberRoot=="function")try{Dr.onCommitFiberRoot(ip,e,void 0,(e.current.flags&128)===128)}catch(t){}}var dr=Math.clz32?Math.clz32:Q2,Y2=Math.log,X2=Math.LN2;function Q2(e){return e>>>=0,e===0?32:31-(Y2(e)/X2|0)|0}var cf=64,uf=4194304;function nc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=nc(a):(i&=s,i!==0&&(r=nc(i)))}else s=n&~o,s!==0?r=nc(s):i!==0&&(r=nc(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-dr(t),o=1<<n,r|=e[n],t&=~o;return r}function Z2(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function J2(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-dr(i),a=1<<s,l=o[s];l===-1?((a&n)===0||(a&r)!==0)&&(o[s]=Z2(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function By(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function WT(){var e=cf;return cf<<=1,(cf&4194240)===0&&(cf=64),e}function sy(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ac(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dr(t),e[t]=n}function eD(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-dr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Cv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var _e=0;function $T(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var jT,Tv,KT,GT,qT,Uy=!1,df=[],Zo=null,Jo=null,ei=null,hc=new Map,yc=new Map,qo=[],tD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function CC(e,t){switch(e){case"focusin":case"focusout":Zo=null;break;case"dragenter":case"dragleave":Jo=null;break;case"mouseover":case"mouseout":ei=null;break;case"pointerover":case"pointerout":hc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":yc.delete(t.pointerId)}}function Gl(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Mc(t),t!==null&&Tv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nD(e,t,n,r,o){switch(t){case"focusin":return Zo=Gl(Zo,e,t,n,r,o),!0;case"dragenter":return Jo=Gl(Jo,e,t,n,r,o),!0;case"mouseover":return ei=Gl(ei,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return hc.set(i,Gl(hc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,yc.set(i,Gl(yc.get(i)||null,e,t,n,r,o)),!0}return!1}function YT(e){var t=Ki(e.target);if(t!==null){var n=rs(t);if(n!==null){if(t=n.tag,t===13){if(t=FT(n),t!==null){e.blockedOn=t,qT(e.priority,function(){KT(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Tf(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Vy(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dy=r,n.target.dispatchEvent(r),Dy=null}else return t=Mc(n),t!==null&&Tv(t),e.blockedOn=n,!1;t.shift()}return!0}function TC(e,t,n){Tf(e)&&n.delete(t)}function rD(){Uy=!1,Zo!==null&&Tf(Zo)&&(Zo=null),Jo!==null&&Tf(Jo)&&(Jo=null),ei!==null&&Tf(ei)&&(ei=null),hc.forEach(TC),yc.forEach(TC)}function ql(e,t){e.blockedOn===t&&(e.blockedOn=null,Uy||(Uy=!0,Mn.unstable_scheduleCallback(Mn.unstable_NormalPriority,rD)))}function vc(e){function t(o){return ql(o,e)}if(0<df.length){ql(df[0],e);for(var n=1;n<df.length;n++){var r=df[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Zo!==null&&ql(Zo,e),Jo!==null&&ql(Jo,e),ei!==null&&ql(ei,e),hc.forEach(t),yc.forEach(t),n=0;n<qo.length;n++)r=qo[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<qo.length&&(n=qo[0],n.blockedOn===null);)YT(n),n.blockedOn===null&&qo.shift()}var ya=ho.ReactCurrentBatchConfig,Bf=!0;function oD(e,t,n,r){var o=_e,i=ya.transition;ya.transition=null;try{_e=1,kv(e,t,n,r)}finally{_e=o,ya.transition=i}}function iD(e,t,n,r){var o=_e,i=ya.transition;ya.transition=null;try{_e=4,kv(e,t,n,r)}finally{_e=o,ya.transition=i}}function kv(e,t,n,r){if(Bf){var o=Vy(e,t,n,r);if(o===null)py(e,t,r,Uf,n),CC(e,r);else if(nD(o,e,t,n,r))r.stopPropagation();else if(CC(e,r),t&4&&-1<tD.indexOf(e)){for(;o!==null;){var i=Mc(o);if(i!==null&&jT(i),i=Vy(e,t,n,r),i===null&&py(e,t,r,Uf,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else py(e,t,r,null,n)}}var Uf=null;function Vy(e,t,n,r){if(Uf=null,e=bv(r),e=Ki(e),e!==null)if(t=rs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=FT(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Uf=e,null}function XT(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(K2()){case Ev:return 1;case UT:return 4;case zf:case G2:return 16;case VT:return 536870912;default:return 16}default:return 16}}var Xo=null,Rv=null,kf=null;function QT(){if(kf)return kf;var e,t=Rv,n=t.length,r,o="value"in Xo?Xo.value:Xo.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return kf=o.slice(e,1<r?1-r:void 0)}function Rf(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function ff(){return!0}function kC(){return!1}function Nn(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ff:kC,this.isPropagationStopped=kC,this}return qe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ff)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ff)},persist:function(){},isPersistent:ff}),t}var Ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pv=Nn(Ra),_c=qe({},Ra,{view:0,detail:0}),sD=Nn(_c),ay,ly,Yl,sp=qe({},_c,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Iv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Yl&&(Yl&&e.type==="mousemove"?(ay=e.screenX-Yl.screenX,ly=e.screenY-Yl.screenY):ly=ay=0,Yl=e),ay)},movementY:function(e){return"movementY"in e?e.movementY:ly}}),RC=Nn(sp),aD=qe({},sp,{dataTransfer:0}),lD=Nn(aD),cD=qe({},_c,{relatedTarget:0}),cy=Nn(cD),uD=qe({},Ra,{animationName:0,elapsedTime:0,pseudoElement:0}),dD=Nn(uD),fD=qe({},Ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),pD=Nn(fD),mD=qe({},Ra,{data:0}),PC=Nn(mD),gD={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hD={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yD={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vD(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=yD[e])?!!t[e]:!1}function Iv(){return vD}var SD=qe({},_c,{key:function(e){if(e.key){var t=gD[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rf(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?hD[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Iv,charCode:function(e){return e.type==="keypress"?Rf(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rf(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),xD=Nn(SD),wD=qe({},sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),IC=Nn(wD),bD=qe({},_c,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Iv}),ED=Nn(bD),CD=qe({},Ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),TD=Nn(CD),kD=qe({},sp,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),RD=Nn(kD),PD=[9,13,27,32],Av=fo&&"CompositionEvent"in window,sc=null;fo&&"documentMode"in document&&(sc=document.documentMode);var ID=fo&&"TextEvent"in window&&!sc,ZT=fo&&(!Av||sc&&8<sc&&11>=sc),AC=" ",_C=!1;function JT(e,t){switch(e){case"keyup":return PD.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function e1(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var oa=!1;function AD(e,t){switch(e){case"compositionend":return e1(t);case"keypress":return t.which!==32?null:(_C=!0,AC);case"textInput":return e=t.data,e===AC&&_C?null:e;default:return null}}function _D(e,t){if(oa)return e==="compositionend"||!Av&&JT(e,t)?(e=QT(),kf=Rv=Xo=null,oa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return ZT&&t.locale!=="ko"?null:t.data;default:return null}}var MD={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function MC(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!MD[e.type]:t==="textarea"}function t1(e,t,n,r){MT(r),t=Vf(t,"onChange"),0<t.length&&(n=new Pv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var ac=null,Sc=null;function ND(e){f1(e,0)}function ap(e){var t=aa(e);if(TT(t))return e}function OD(e,t){if(e==="change")return t}var n1=!1;fo&&(fo?(mf="oninput"in document,mf||(uy=document.createElement("div"),uy.setAttribute("oninput","return;"),mf=typeof uy.oninput=="function"),pf=mf):pf=!1,n1=pf&&(!document.documentMode||9<document.documentMode));var pf,mf,uy;function NC(){ac&&(ac.detachEvent("onpropertychange",r1),Sc=ac=null)}function r1(e){if(e.propertyName==="value"&&ap(Sc)){var t=[];t1(t,Sc,e,bv(e)),DT(ND,t)}}function LD(e,t,n){e==="focusin"?(NC(),ac=t,Sc=n,ac.attachEvent("onpropertychange",r1)):e==="focusout"&&NC()}function DD(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ap(Sc)}function FD(e,t){if(e==="click")return ap(t)}function zD(e,t){if(e==="input"||e==="change")return ap(t)}function HD(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var pr=typeof Object.is=="function"?Object.is:HD;function xc(e,t){if(pr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Cy.call(t,o)||!pr(e[o],t[o]))return!1}return!0}function OC(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function LC(e,t){var n=OC(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=OC(n)}}function o1(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?o1(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function i1(){for(var e=window,t=Lf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch(r){n=!1}if(n)e=t.contentWindow;else break;t=Lf(e.document)}return t}function _v(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function BD(e){var t=i1(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&o1(n.ownerDocument.documentElement,n)){if(r!==null&&_v(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=LC(n,i);var s=LC(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var UD=fo&&"documentMode"in document&&11>=document.documentMode,ia=null,Wy=null,lc=null,$y=!1;function DC(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;$y||ia==null||ia!==Lf(r)||(r=ia,"selectionStart"in r&&_v(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),lc&&xc(lc,r)||(lc=r,r=Vf(Wy,"onSelect"),0<r.length&&(t=new Pv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ia)))}function gf(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sa={animationend:gf("Animation","AnimationEnd"),animationiteration:gf("Animation","AnimationIteration"),animationstart:gf("Animation","AnimationStart"),transitionend:gf("Transition","TransitionEnd")},dy={},s1={};fo&&(s1=document.createElement("div").style,"AnimationEvent"in window||(delete sa.animationend.animation,delete sa.animationiteration.animation,delete sa.animationstart.animation),"TransitionEvent"in window||delete sa.transitionend.transition);function lp(e){if(dy[e])return dy[e];if(!sa[e])return e;var t=sa[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in s1)return dy[e]=t[n];return e}var a1=lp("animationend"),l1=lp("animationiteration"),c1=lp("animationstart"),u1=lp("transitionend"),d1=new Map,FC="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function li(e,t){d1.set(e,t),ns(t,[e])}for(hf=0;hf<FC.length;hf++)yf=FC[hf],zC=yf.toLowerCase(),HC=yf[0].toUpperCase()+yf.slice(1),li(zC,"on"+HC);var yf,zC,HC,hf;li(a1,"onAnimationEnd");li(l1,"onAnimationIteration");li(c1,"onAnimationStart");li("dblclick","onDoubleClick");li("focusin","onFocus");li("focusout","onBlur");li(u1,"onTransitionEnd");xa("onMouseEnter",["mouseout","mouseover"]);xa("onMouseLeave",["mouseout","mouseover"]);xa("onPointerEnter",["pointerout","pointerover"]);xa("onPointerLeave",["pointerout","pointerover"]);ns("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ns("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ns("onBeforeInput",["compositionend","keypress","textInput","paste"]);ns("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ns("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ns("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),VD=new Set("cancel close invalid load scroll toggle".split(" ").concat(rc));function BC(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,V2(r,t,void 0,e),e.currentTarget=null}function f1(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;BC(o,a,c),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;BC(o,a,c),i=l}}}if(Ff)throw e=Hy,Ff=!1,Hy=null,e}function He(e,t){var n=t[Yy];n===void 0&&(n=t[Yy]=new Set);var r=e+"__bubble";n.has(r)||(p1(t,e,2,!1),n.add(r))}function fy(e,t,n){var r=0;t&&(r|=4),p1(n,e,r,t)}var vf="_reactListening"+Math.random().toString(36).slice(2);function wc(e){if(!e[vf]){e[vf]=!0,xT.forEach(function(n){n!=="selectionchange"&&(VD.has(n)||fy(n,!1,e),fy(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[vf]||(t[vf]=!0,fy("selectionchange",!1,t))}}function p1(e,t,n,r){switch(XT(t)){case 1:var o=oD;break;case 4:o=iD;break;default:o=kv}n=o.bind(null,t,n,e),o=void 0,!zy||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function py(e,t,n,r,o){var i=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Ki(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}DT(function(){var c=i,u=bv(n),f=[];e:{var d=d1.get(e);if(d!==void 0){var p=Pv,m=e;switch(e){case"keypress":if(Rf(n)===0)break e;case"keydown":case"keyup":p=xD;break;case"focusin":m="focus",p=cy;break;case"focusout":m="blur",p=cy;break;case"beforeblur":case"afterblur":p=cy;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=RC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=lD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=ED;break;case a1:case l1:case c1:p=dD;break;case u1:p=TD;break;case"scroll":p=sD;break;case"wheel":p=RD;break;case"copy":case"cut":case"paste":p=pD;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=IC}var g=(t&4)!==0,v=!g&&e==="scroll",h=g?d!==null?d+"Capture":null:d;g=[];for(var y=c,S;y!==null;){S=y;var x=S.stateNode;if(S.tag===5&&x!==null&&(S=x,h!==null&&(x=gc(y,h),x!=null&&g.push(bc(y,x,S)))),v)break;y=y.return}0<g.length&&(d=new p(d,m,null,n,u),f.push({event:d,listeners:g}))}}if((t&7)===0){e:{if(d=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",d&&n!==Dy&&(m=n.relatedTarget||n.fromElement)&&(Ki(m)||m[po]))break e;if((p||d)&&(d=u.window===u?u:(d=u.ownerDocument)?d.defaultView||d.parentWindow:window,p?(m=n.relatedTarget||n.toElement,p=c,m=m?Ki(m):null,m!==null&&(v=rs(m),m!==v||m.tag!==5&&m.tag!==6)&&(m=null)):(p=null,m=c),p!==m)){if(g=RC,x="onMouseLeave",h="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(g=IC,x="onPointerLeave",h="onPointerEnter",y="pointer"),v=p==null?d:aa(p),S=m==null?d:aa(m),d=new g(x,y+"leave",p,n,u),d.target=v,d.relatedTarget=S,x=null,Ki(u)===c&&(g=new g(h,y+"enter",m,n,u),g.target=S,g.relatedTarget=v,x=g),v=x,p&&m)t:{for(g=p,h=m,y=0,S=g;S;S=ta(S))y++;for(S=0,x=h;x;x=ta(x))S++;for(;0<y-S;)g=ta(g),y--;for(;0<S-y;)h=ta(h),S--;for(;y--;){if(g===h||h!==null&&g===h.alternate)break t;g=ta(g),h=ta(h)}g=null}else g=null;p!==null&&UC(f,d,p,g,!1),m!==null&&v!==null&&UC(f,v,m,g,!0)}}e:{if(d=c?aa(c):window,p=d.nodeName&&d.nodeName.toLowerCase(),p==="select"||p==="input"&&d.type==="file")var T=OD;else if(MC(d))if(n1)T=zD;else{T=DD;var C=LD}else(p=d.nodeName)&&p.toLowerCase()==="input"&&(d.type==="checkbox"||d.type==="radio")&&(T=FD);if(T&&(T=T(e,c))){t1(f,T,n,u);break e}C&&C(e,d,c),e==="focusout"&&(C=d._wrapperState)&&C.controlled&&d.type==="number"&&_y(d,"number",d.value)}switch(C=c?aa(c):window,e){case"focusin":(MC(C)||C.contentEditable==="true")&&(ia=C,Wy=c,lc=null);break;case"focusout":lc=Wy=ia=null;break;case"mousedown":$y=!0;break;case"contextmenu":case"mouseup":case"dragend":$y=!1,DC(f,n,u);break;case"selectionchange":if(UD)break;case"keydown":case"keyup":DC(f,n,u)}var k;if(Av)e:{switch(e){case"compositionstart":var R="onCompositionStart";break e;case"compositionend":R="onCompositionEnd";break e;case"compositionupdate":R="onCompositionUpdate";break e}R=void 0}else oa?JT(e,n)&&(R="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(R="onCompositionStart");R&&(ZT&&n.locale!=="ko"&&(oa||R!=="onCompositionStart"?R==="onCompositionEnd"&&oa&&(k=QT()):(Xo=u,Rv="value"in Xo?Xo.value:Xo.textContent,oa=!0)),C=Vf(c,R),0<C.length&&(R=new PC(R,e,null,n,u),f.push({event:R,listeners:C}),k?R.data=k:(k=e1(n),k!==null&&(R.data=k)))),(k=ID?AD(e,n):_D(e,n))&&(c=Vf(c,"onBeforeInput"),0<c.length&&(u=new PC("onBeforeInput","beforeinput",null,n,u),f.push({event:u,listeners:c}),u.data=k))}f1(f,t)})}function bc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Vf(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=gc(e,n),i!=null&&r.unshift(bc(e,i,o)),i=gc(e,t),i!=null&&r.push(bc(e,i,o))),e=e.return}return r}function ta(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function UC(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,o?(l=gc(n,i),l!=null&&s.unshift(bc(n,l,a))):o||(l=gc(n,i),l!=null&&s.push(bc(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var WD=/\r\n?/g,$D=/\u0000|\uFFFD/g;function VC(e){return(typeof e=="string"?e:""+e).replace(WD,`
6
+ `).replace($D,"")}function Sf(e,t,n){if(t=VC(t),VC(e)!==t&&n)throw Error(H(425))}function Wf(){}var jy=null,Ky=null;function Gy(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qy=typeof setTimeout=="function"?setTimeout:void 0,jD=typeof clearTimeout=="function"?clearTimeout:void 0,WC=typeof Promise=="function"?Promise:void 0,KD=typeof queueMicrotask=="function"?queueMicrotask:typeof WC!="undefined"?function(e){return WC.resolve(null).then(e).catch(GD)}:qy;function GD(e){setTimeout(function(){throw e})}function my(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),vc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);vc(t)}function ti(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function $C(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Pa=Math.random().toString(36).slice(2),Lr="__reactFiber$"+Pa,Ec="__reactProps$"+Pa,po="__reactContainer$"+Pa,Yy="__reactEvents$"+Pa,qD="__reactListeners$"+Pa,YD="__reactHandles$"+Pa;function Ki(e){var t=e[Lr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[po]||n[Lr]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$C(e);e!==null;){if(n=e[Lr])return n;e=$C(e)}return t}e=n,n=e.parentNode}return null}function Mc(e){return e=e[Lr]||e[po],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function aa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(H(33))}function cp(e){return e[Ec]||null}var Xy=[],la=-1;function ci(e){return{current:e}}function Be(e){0>la||(e.current=Xy[la],Xy[la]=null,la--)}function ze(e,t){la++,Xy[la]=e.current,e.current=t}var ai={},Wt=ci(ai),yn=ci(!1),Qi=ai;function wa(e,t){var n=e.type.contextTypes;if(!n)return ai;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function vn(e){return e=e.childContextTypes,e!=null}function $f(){Be(yn),Be(Wt)}function jC(e,t,n){if(Wt.current!==ai)throw Error(H(168));ze(Wt,t),ze(yn,n)}function m1(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(H(108,L2(e)||"Unknown",o));return qe({},n,r)}function jf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ai,Qi=Wt.current,ze(Wt,e),ze(yn,yn.current),!0}function KC(e,t,n){var r=e.stateNode;if(!r)throw Error(H(169));n?(e=m1(e,t,Qi),r.__reactInternalMemoizedMergedChildContext=e,Be(yn),Be(Wt),ze(Wt,e)):Be(yn),ze(yn,n)}var ao=null,up=!1,gy=!1;function g1(e){ao===null?ao=[e]:ao.push(e)}function XD(e){up=!0,g1(e)}function ui(){if(!gy&&ao!==null){gy=!0;var e=0,t=_e;try{var n=ao;for(_e=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ao=null,up=!1}catch(o){throw ao!==null&&(ao=ao.slice(e+1)),BT(Ev,ui),o}finally{_e=t,gy=!1}}return null}var ca=[],ua=0,Kf=null,Gf=0,Wn=[],$n=0,Zi=null,lo=1,co="";function $i(e,t){ca[ua++]=Gf,ca[ua++]=Kf,Kf=e,Gf=t}function h1(e,t,n){Wn[$n++]=lo,Wn[$n++]=co,Wn[$n++]=Zi,Zi=e;var r=lo;e=co;var o=32-dr(r)-1;r&=~(1<<o),n+=1;var i=32-dr(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,lo=1<<32-dr(t)+o|n<<o|r,co=i+e}else lo=1<<i|n<<o|r,co=e}function Mv(e){e.return!==null&&($i(e,1),h1(e,1,0))}function Nv(e){for(;e===Kf;)Kf=ca[--ua],ca[ua]=null,Gf=ca[--ua],ca[ua]=null;for(;e===Zi;)Zi=Wn[--$n],Wn[$n]=null,co=Wn[--$n],Wn[$n]=null,lo=Wn[--$n],Wn[$n]=null}var _n=null,An=null,We=!1,ur=null;function y1(e,t){var n=jn(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function GC(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,_n=e,An=ti(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,_n=e,An=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Zi!==null?{id:lo,overflow:co}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=jn(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,_n=e,An=null,!0):!1;default:return!1}}function Qy(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Zy(e){if(We){var t=An;if(t){var n=t;if(!GC(e,t)){if(Qy(e))throw Error(H(418));t=ti(n.nextSibling);var r=_n;t&&GC(e,t)?y1(r,n):(e.flags=e.flags&-4097|2,We=!1,_n=e)}}else{if(Qy(e))throw Error(H(418));e.flags=e.flags&-4097|2,We=!1,_n=e}}}function qC(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;_n=e}function xf(e){if(e!==_n)return!1;if(!We)return qC(e),We=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Gy(e.type,e.memoizedProps)),t&&(t=An)){if(Qy(e))throw v1(),Error(H(418));for(;t;)y1(e,t),t=ti(t.nextSibling)}if(qC(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(H(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){An=ti(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}An=null}}else An=_n?ti(e.stateNode.nextSibling):null;return!0}function v1(){for(var e=An;e;)e=ti(e.nextSibling)}function ba(){An=_n=null,We=!1}function Ov(e){ur===null?ur=[e]:ur.push(e)}var QD=ho.ReactCurrentBatchConfig;function Xl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(H(309));var r=n.stateNode}if(!r)throw Error(H(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(H(284));if(!n._owner)throw Error(H(290,e))}return e}function wf(e,t){throw e=Object.prototype.toString.call(t),Error(H(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function YC(e){var t=e._init;return t(e._payload)}function S1(e){function t(h,y){if(e){var S=h.deletions;S===null?(h.deletions=[y],h.flags|=16):S.push(y)}}function n(h,y){if(!e)return null;for(;y!==null;)t(h,y),y=y.sibling;return null}function r(h,y){for(h=new Map;y!==null;)y.key!==null?h.set(y.key,y):h.set(y.index,y),y=y.sibling;return h}function o(h,y){return h=ii(h,y),h.index=0,h.sibling=null,h}function i(h,y,S){return h.index=S,e?(S=h.alternate,S!==null?(S=S.index,S<y?(h.flags|=2,y):S):(h.flags|=2,y)):(h.flags|=1048576,y)}function s(h){return e&&h.alternate===null&&(h.flags|=2),h}function a(h,y,S,x){return y===null||y.tag!==6?(y=by(S,h.mode,x),y.return=h,y):(y=o(y,S),y.return=h,y)}function l(h,y,S,x){var T=S.type;return T===ra?u(h,y,S.props.children,x,S.key):y!==null&&(y.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Ko&&YC(T)===y.type)?(x=o(y,S.props),x.ref=Xl(h,y,S),x.return=h,x):(x=Of(S.type,S.key,S.props,null,h.mode,x),x.ref=Xl(h,y,S),x.return=h,x)}function c(h,y,S,x){return y===null||y.tag!==4||y.stateNode.containerInfo!==S.containerInfo||y.stateNode.implementation!==S.implementation?(y=Ey(S,h.mode,x),y.return=h,y):(y=o(y,S.children||[]),y.return=h,y)}function u(h,y,S,x,T){return y===null||y.tag!==7?(y=Xi(S,h.mode,x,T),y.return=h,y):(y=o(y,S),y.return=h,y)}function f(h,y,S){if(typeof y=="string"&&y!==""||typeof y=="number")return y=by(""+y,h.mode,S),y.return=h,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case sf:return S=Of(y.type,y.key,y.props,null,h.mode,S),S.ref=Xl(h,null,y),S.return=h,S;case na:return y=Ey(y,h.mode,S),y.return=h,y;case Ko:var x=y._init;return f(h,x(y._payload),S)}if(tc(y)||Kl(y))return y=Xi(y,h.mode,S,null),y.return=h,y;wf(h,y)}return null}function d(h,y,S,x){var T=y!==null?y.key:null;if(typeof S=="string"&&S!==""||typeof S=="number")return T!==null?null:a(h,y,""+S,x);if(typeof S=="object"&&S!==null){switch(S.$$typeof){case sf:return S.key===T?l(h,y,S,x):null;case na:return S.key===T?c(h,y,S,x):null;case Ko:return T=S._init,d(h,y,T(S._payload),x)}if(tc(S)||Kl(S))return T!==null?null:u(h,y,S,x,null);wf(h,S)}return null}function p(h,y,S,x,T){if(typeof x=="string"&&x!==""||typeof x=="number")return h=h.get(S)||null,a(y,h,""+x,T);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case sf:return h=h.get(x.key===null?S:x.key)||null,l(y,h,x,T);case na:return h=h.get(x.key===null?S:x.key)||null,c(y,h,x,T);case Ko:var C=x._init;return p(h,y,S,C(x._payload),T)}if(tc(x)||Kl(x))return h=h.get(S)||null,u(y,h,x,T,null);wf(y,x)}return null}function m(h,y,S,x){for(var T=null,C=null,k=y,R=y=0,F=null;k!==null&&R<S.length;R++){k.index>R?(F=k,k=null):F=k.sibling;var O=d(h,k,S[R],x);if(O===null){k===null&&(k=F);break}e&&k&&O.alternate===null&&t(h,k),y=i(O,y,R),C===null?T=O:C.sibling=O,C=O,k=F}if(R===S.length)return n(h,k),We&&$i(h,R),T;if(k===null){for(;R<S.length;R++)k=f(h,S[R],x),k!==null&&(y=i(k,y,R),C===null?T=k:C.sibling=k,C=k);return We&&$i(h,R),T}for(k=r(h,k);R<S.length;R++)F=p(k,h,R,S[R],x),F!==null&&(e&&F.alternate!==null&&k.delete(F.key===null?R:F.key),y=i(F,y,R),C===null?T=F:C.sibling=F,C=F);return e&&k.forEach(function(U){return t(h,U)}),We&&$i(h,R),T}function g(h,y,S,x){var T=Kl(S);if(typeof T!="function")throw Error(H(150));if(S=T.call(S),S==null)throw Error(H(151));for(var C=T=null,k=y,R=y=0,F=null,O=S.next();k!==null&&!O.done;R++,O=S.next()){k.index>R?(F=k,k=null):F=k.sibling;var U=d(h,k,O.value,x);if(U===null){k===null&&(k=F);break}e&&k&&U.alternate===null&&t(h,k),y=i(U,y,R),C===null?T=U:C.sibling=U,C=U,k=F}if(O.done)return n(h,k),We&&$i(h,R),T;if(k===null){for(;!O.done;R++,O=S.next())O=f(h,O.value,x),O!==null&&(y=i(O,y,R),C===null?T=O:C.sibling=O,C=O);return We&&$i(h,R),T}for(k=r(h,k);!O.done;R++,O=S.next())O=p(k,h,R,O.value,x),O!==null&&(e&&O.alternate!==null&&k.delete(O.key===null?R:O.key),y=i(O,y,R),C===null?T=O:C.sibling=O,C=O);return e&&k.forEach(function(J){return t(h,J)}),We&&$i(h,R),T}function v(h,y,S,x){if(typeof S=="object"&&S!==null&&S.type===ra&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case sf:e:{for(var T=S.key,C=y;C!==null;){if(C.key===T){if(T=S.type,T===ra){if(C.tag===7){n(h,C.sibling),y=o(C,S.props.children),y.return=h,h=y;break e}}else if(C.elementType===T||typeof T=="object"&&T!==null&&T.$$typeof===Ko&&YC(T)===C.type){n(h,C.sibling),y=o(C,S.props),y.ref=Xl(h,C,S),y.return=h,h=y;break e}n(h,C);break}else t(h,C);C=C.sibling}S.type===ra?(y=Xi(S.props.children,h.mode,x,S.key),y.return=h,h=y):(x=Of(S.type,S.key,S.props,null,h.mode,x),x.ref=Xl(h,y,S),x.return=h,h=x)}return s(h);case na:e:{for(C=S.key;y!==null;){if(y.key===C)if(y.tag===4&&y.stateNode.containerInfo===S.containerInfo&&y.stateNode.implementation===S.implementation){n(h,y.sibling),y=o(y,S.children||[]),y.return=h,h=y;break e}else{n(h,y);break}else t(h,y);y=y.sibling}y=Ey(S,h.mode,x),y.return=h,h=y}return s(h);case Ko:return C=S._init,v(h,y,C(S._payload),x)}if(tc(S))return m(h,y,S,x);if(Kl(S))return g(h,y,S,x);wf(h,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,y!==null&&y.tag===6?(n(h,y.sibling),y=o(y,S),y.return=h,h=y):(n(h,y),y=by(S,h.mode,x),y.return=h,h=y),s(h)):n(h,y)}return v}var Ea=S1(!0),x1=S1(!1),qf=ci(null),Yf=null,da=null,Lv=null;function Dv(){Lv=da=Yf=null}function Fv(e){var t=qf.current;Be(qf),e._currentValue=t}function Jy(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function va(e,t){Yf=e,Lv=da=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(hn=!0),e.firstContext=null)}function Gn(e){var t=e._currentValue;if(Lv!==e)if(e={context:e,memoizedValue:t,next:null},da===null){if(Yf===null)throw Error(H(308));da=e,Yf.dependencies={lanes:0,firstContext:e}}else da=da.next=e;return t}var Gi=null;function zv(e){Gi===null?Gi=[e]:Gi.push(e)}function w1(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,zv(t)):(n.next=o.next,o.next=n),t.interleaved=n,mo(e,r)}function mo(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}var Go=!1;function Hv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function b1(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function uo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ni(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ce&2)!==0){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,mo(e,n)}return o=r.interleaved,o===null?(t.next=t,zv(r)):(t.next=o.next,o.next=t),r.interleaved=t,mo(e,n)}function Pf(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cv(e,n)}}function XC(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xf(e,t,n,r){var o=e.updateQueue;Go=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,c=l.next;l.next=null,s===null?i=c:s.next=c,s=l;var u=e.alternate;u!==null&&(u=u.updateQueue,a=u.lastBaseUpdate,a!==s&&(a===null?u.firstBaseUpdate=c:a.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=o.baseState;s=0,u=c=l=null,a=i;do{var d=a.lane,p=a.eventTime;if((r&d)===d){u!==null&&(u=u.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var m=e,g=a;switch(d=t,p=n,g.tag){case 1:if(m=g.payload,typeof m=="function"){f=m.call(p,f,d);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,d=typeof m=="function"?m.call(p,f,d):m,d==null)break e;f=qe({},f,d);break e;case 2:Go=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,d=o.effects,d===null?o.effects=[a]:d.push(a))}else p={eventTime:p,lane:d,tag:a.tag,payload:a.payload,callback:a.callback,next:null},u===null?(c=u=p,l=f):u=u.next=p,s|=d;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;d=a,a=d.next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}while(!0);if(u===null&&(l=f),o.baseState=l,o.firstBaseUpdate=c,o.lastBaseUpdate=u,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);es|=s,e.lanes=s,e.memoizedState=f}}function QC(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(H(191,o));o.call(r)}}}var Nc={},Fr=ci(Nc),Cc=ci(Nc),Tc=ci(Nc);function qi(e){if(e===Nc)throw Error(H(174));return e}function Bv(e,t){switch(ze(Tc,t),ze(Cc,e),ze(Fr,Nc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ny(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ny(t,e)}Be(Fr),ze(Fr,t)}function Ca(){Be(Fr),Be(Cc),Be(Tc)}function E1(e){qi(Tc.current);var t=qi(Fr.current),n=Ny(t,e.type);t!==n&&(ze(Cc,e),ze(Fr,n))}function Uv(e){Cc.current===e&&(Be(Fr),Be(Cc))}var Ke=ci(0);function Qf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var hy=[];function Vv(){for(var e=0;e<hy.length;e++)hy[e]._workInProgressVersionPrimary=null;hy.length=0}var If=ho.ReactCurrentDispatcher,yy=ho.ReactCurrentBatchConfig,Ji=0,Ge=null,ct=null,St=null,Zf=!1,cc=!1,kc=0,ZD=0;function Bt(){throw Error(H(321))}function Wv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function $v(e,t,n,r,o,i){if(Ji=i,Ge=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,If.current=e===null||e.memoizedState===null?n3:r3,e=n(r,o),cc){i=0;do{if(cc=!1,kc=0,25<=i)throw Error(H(301));i+=1,St=ct=null,t.updateQueue=null,If.current=o3,e=n(r,o)}while(cc)}if(If.current=Jf,t=ct!==null&&ct.next!==null,Ji=0,St=ct=Ge=null,Zf=!1,t)throw Error(H(300));return e}function jv(){var e=kc!==0;return kc=0,e}function Or(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?Ge.memoizedState=St=e:St=St.next=e,St}function qn(){if(ct===null){var e=Ge.alternate;e=e!==null?e.memoizedState:null}else e=ct.next;var t=St===null?Ge.memoizedState:St.next;if(t!==null)St=t,ct=e;else{if(e===null)throw Error(H(310));ct=e,e={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},St===null?Ge.memoizedState=St=e:St=St.next=e}return St}function Rc(e,t){return typeof t=="function"?t(e):t}function vy(e){var t=qn(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=ct,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,c=i;do{var u=c.lane;if((Ji&u)===u)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:u,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,s=r):l=l.next=f,Ge.lanes|=u,es|=u}c=c.next}while(c!==null&&c!==i);l===null?s=r:l.next=a,pr(r,t.memoizedState)||(hn=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ge.lanes|=i,es|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sy(e){var t=qn(),n=t.queue;if(n===null)throw Error(H(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);pr(i,t.memoizedState)||(hn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function C1(){}function T1(e,t){var n=Ge,r=qn(),o=t(),i=!pr(r.memoizedState,o);if(i&&(r.memoizedState=o,hn=!0),r=r.queue,Kv(P1.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||St!==null&&St.memoizedState.tag&1){if(n.flags|=2048,Pc(9,R1.bind(null,n,r,o,t),void 0,null),xt===null)throw Error(H(349));(Ji&30)!==0||k1(n,t,o)}return o}function k1(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function R1(e,t,n,r){t.value=n,t.getSnapshot=r,I1(t)&&A1(e)}function P1(e,t,n){return n(function(){I1(t)&&A1(e)})}function I1(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch(r){return!0}}function A1(e){var t=mo(e,1);t!==null&&fr(t,e,1,-1)}function ZC(e){var t=Or();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Rc,lastRenderedState:e},t.queue=e,e=e.dispatch=t3.bind(null,Ge,e),[t.memoizedState,e]}function Pc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ge.updateQueue,t===null?(t={lastEffect:null,stores:null},Ge.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function _1(){return qn().memoizedState}function Af(e,t,n,r){var o=Or();Ge.flags|=e,o.memoizedState=Pc(1|t,n,void 0,r===void 0?null:r)}function dp(e,t,n,r){var o=qn();r=r===void 0?null:r;var i=void 0;if(ct!==null){var s=ct.memoizedState;if(i=s.destroy,r!==null&&Wv(r,s.deps)){o.memoizedState=Pc(t,n,i,r);return}}Ge.flags|=e,o.memoizedState=Pc(1|t,n,i,r)}function JC(e,t){return Af(8390656,8,e,t)}function Kv(e,t){return dp(2048,8,e,t)}function M1(e,t){return dp(4,2,e,t)}function N1(e,t){return dp(4,4,e,t)}function O1(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function L1(e,t,n){return n=n!=null?n.concat([e]):null,dp(4,4,O1.bind(null,t,e),n)}function Gv(){}function D1(e,t){var n=qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function F1(e,t){var n=qn();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Wv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function z1(e,t,n){return(Ji&21)===0?(e.baseState&&(e.baseState=!1,hn=!0),e.memoizedState=n):(pr(n,t)||(n=WT(),Ge.lanes|=n,es|=n,e.baseState=!0),t)}function JD(e,t){var n=_e;_e=n!==0&&4>n?n:4,e(!0);var r=yy.transition;yy.transition={};try{e(!1),t()}finally{_e=n,yy.transition=r}}function H1(){return qn().memoizedState}function e3(e,t,n){var r=oi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},B1(e))U1(t,n);else if(n=w1(e,t,n,r),n!==null){var o=Jt();fr(n,e,r,o),V1(n,t,r)}}function t3(e,t,n){var r=oi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(B1(e))U1(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,pr(a,s)){var l=t.interleaved;l===null?(o.next=o,zv(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch(c){}n=w1(e,t,o,r),n!==null&&(o=Jt(),fr(n,e,r,o),V1(n,t,r))}}function B1(e){var t=e.alternate;return e===Ge||t!==null&&t===Ge}function U1(e,t){cc=Zf=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function V1(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cv(e,n)}}var Jf={readContext:Gn,useCallback:Bt,useContext:Bt,useEffect:Bt,useImperativeHandle:Bt,useInsertionEffect:Bt,useLayoutEffect:Bt,useMemo:Bt,useReducer:Bt,useRef:Bt,useState:Bt,useDebugValue:Bt,useDeferredValue:Bt,useTransition:Bt,useMutableSource:Bt,useSyncExternalStore:Bt,useId:Bt,unstable_isNewReconciler:!1},n3={readContext:Gn,useCallback:function(e,t){return Or().memoizedState=[e,t===void 0?null:t],e},useContext:Gn,useEffect:JC,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Af(4194308,4,O1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Af(4194308,4,e,t)},useInsertionEffect:function(e,t){return Af(4,2,e,t)},useMemo:function(e,t){var n=Or();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Or();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=e3.bind(null,Ge,e),[r.memoizedState,e]},useRef:function(e){var t=Or();return e={current:e},t.memoizedState=e},useState:ZC,useDebugValue:Gv,useDeferredValue:function(e){return Or().memoizedState=e},useTransition:function(){var e=ZC(!1),t=e[0];return e=JD.bind(null,e[1]),Or().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ge,o=Or();if(We){if(n===void 0)throw Error(H(407));n=n()}else{if(n=t(),xt===null)throw Error(H(349));(Ji&30)!==0||k1(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,JC(P1.bind(null,r,i,e),[e]),r.flags|=2048,Pc(9,R1.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Or(),t=xt.identifierPrefix;if(We){var n=co,r=lo;n=(r&~(1<<32-dr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=kc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=ZD++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},r3={readContext:Gn,useCallback:D1,useContext:Gn,useEffect:Kv,useImperativeHandle:L1,useInsertionEffect:M1,useLayoutEffect:N1,useMemo:F1,useReducer:vy,useRef:_1,useState:function(){return vy(Rc)},useDebugValue:Gv,useDeferredValue:function(e){var t=qn();return z1(t,ct.memoizedState,e)},useTransition:function(){var e=vy(Rc)[0],t=qn().memoizedState;return[e,t]},useMutableSource:C1,useSyncExternalStore:T1,useId:H1,unstable_isNewReconciler:!1},o3={readContext:Gn,useCallback:D1,useContext:Gn,useEffect:Kv,useImperativeHandle:L1,useInsertionEffect:M1,useLayoutEffect:N1,useMemo:F1,useReducer:Sy,useRef:_1,useState:function(){return Sy(Rc)},useDebugValue:Gv,useDeferredValue:function(e){var t=qn();return ct===null?t.memoizedState=e:z1(t,ct.memoizedState,e)},useTransition:function(){var e=Sy(Rc)[0],t=qn().memoizedState;return[e,t]},useMutableSource:C1,useSyncExternalStore:T1,useId:H1,unstable_isNewReconciler:!1};function lr(e,t){if(e&&e.defaultProps){t=qe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function ev(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:qe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var fp={isMounted:function(e){return(e=e._reactInternals)?rs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Jt(),o=oi(e),i=uo(r,o);i.payload=t,n!=null&&(i.callback=n),t=ni(e,i,o),t!==null&&(fr(t,e,o,r),Pf(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Jt(),o=oi(e),i=uo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ni(e,i,o),t!==null&&(fr(t,e,o,r),Pf(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Jt(),r=oi(e),o=uo(n,r);o.tag=2,t!=null&&(o.callback=t),t=ni(e,o,r),t!==null&&(fr(t,e,r,n),Pf(t,e,r))}};function eT(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!xc(n,r)||!xc(o,i):!0}function W1(e,t,n){var r=!1,o=ai,i=t.contextType;return typeof i=="object"&&i!==null?i=Gn(i):(o=vn(t)?Qi:Wt.current,r=t.contextTypes,i=(r=r!=null)?wa(e,o):ai),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=fp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function tT(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&fp.enqueueReplaceState(t,t.state,null)}function tv(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},Hv(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Gn(i):(i=vn(t)?Qi:Wt.current,o.context=wa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(ev(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&fp.enqueueReplaceState(o,o.state,null),Xf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ta(e,t){try{var n="",r=t;do n+=O2(r),r=r.return;while(r);var o=n}catch(i){o=`
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function xy(e,t,n){return{value:e,source:null,stack:n!=null?n:null,digest:t!=null?t:null}}function nv(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var i3=typeof WeakMap=="function"?WeakMap:Map;function $1(e,t,n){n=uo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){tp||(tp=!0,fv=r),nv(e,t)},n}function j1(e,t,n){n=uo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){nv(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){nv(e,t),typeof r!="function"&&(ri===null?ri=new Set([this]):ri.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function nT(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new i3;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=S3.bind(null,e,t,n),t.then(e,e))}function rT(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function oT(e,t,n,r,o){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=uo(-1,1),t.tag=2,ni(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=o,e)}var s3=ho.ReactCurrentOwner,hn=!1;function Zt(e,t,n,r){t.child=e===null?x1(t,null,n,r):Ea(t,e.child,n,r)}function iT(e,t,n,r,o){n=n.render;var i=t.ref;return va(t,o),r=$v(e,t,n,r,i,o),n=jv(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,go(e,t,o)):(We&&n&&Mv(t),t.flags|=1,Zt(e,t,r,o),t.child)}function sT(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!t0(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,K1(e,t,i,r,o)):(e=Of(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&o)===0){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:xc,n(s,r)&&e.ref===t.ref)return go(e,t,o)}return t.flags|=1,e=ii(i,r),e.ref=t.ref,e.return=t,t.child=e}function K1(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(xc(i,r)&&e.ref===t.ref)if(hn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)(e.flags&131072)!==0&&(hn=!0);else return t.lanes=e.lanes,go(e,t,o)}return rv(e,t,n,r,o)}function G1(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ze(pa,In),In|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ze(pa,In),In|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ze(pa,In),In|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ze(pa,In),In|=r;return Zt(e,t,o,n),t.child}function q1(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function rv(e,t,n,r,o){var i=vn(n)?Qi:Wt.current;return i=wa(t,i),va(t,o),n=$v(e,t,n,r,i,o),r=jv(),e!==null&&!hn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,go(e,t,o)):(We&&r&&Mv(t),t.flags|=1,Zt(e,t,n,o),t.child)}function aT(e,t,n,r,o){if(vn(n)){var i=!0;jf(t)}else i=!1;if(va(t,o),t.stateNode===null)_f(e,t),W1(t,n,r),tv(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,c=n.contextType;typeof c=="object"&&c!==null?c=Gn(c):(c=vn(n)?Qi:Wt.current,c=wa(t,c));var u=n.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==c)&&tT(t,s,r,c),Go=!1;var d=t.memoizedState;s.state=d,Xf(t,r,s,o),l=t.memoizedState,a!==r||d!==l||yn.current||Go?(typeof u=="function"&&(ev(t,n,u,r),l=t.memoizedState),(a=Go||eT(t,n,a,r,d,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=c,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,b1(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:lr(t.type,a),s.props=c,f=t.pendingProps,d=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Gn(l):(l=vn(n)?Qi:Wt.current,l=wa(t,l));var p=n.getDerivedStateFromProps;(u=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==f||d!==l)&&tT(t,s,r,l),Go=!1,d=t.memoizedState,s.state=d,Xf(t,r,s,o);var m=t.memoizedState;a!==f||d!==m||yn.current||Go?(typeof p=="function"&&(ev(t,n,p,r),m=t.memoizedState),(c=Go||eT(t,n,c,r,d,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,m,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),s.props=r,s.state=m,s.context=l,r=c):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&d===e.memoizedState||(t.flags|=1024),r=!1)}return ov(e,t,n,r,i,o)}function ov(e,t,n,r,o,i){q1(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&KC(t,n,!1),go(e,t,i);r=t.stateNode,s3.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Ea(t,e.child,null,i),t.child=Ea(t,null,a,i)):Zt(e,t,a,i),t.memoizedState=r.state,o&&KC(t,n,!0),t.child}function Y1(e){var t=e.stateNode;t.pendingContext?jC(e,t.pendingContext,t.pendingContext!==t.context):t.context&&jC(e,t.context,!1),Bv(e,t.containerInfo)}function lT(e,t,n,r,o){return ba(),Ov(o),t.flags|=256,Zt(e,t,n,r),t.child}var iv={dehydrated:null,treeContext:null,retryLane:0};function sv(e){return{baseLanes:e,cachePool:null,transitions:null}}function X1(e,t,n){var r=t.pendingProps,o=Ke.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ze(Ke,o&1),e===null)return Zy(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},(r&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=s):i=gp(s,r,0,null),e=Xi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=sv(n),t.memoizedState=iv,e):qv(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return a3(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return(s&1)===0&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=ii(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=ii(a,i):(i=Xi(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?sv(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=iv,r}return i=e.child,e=i.sibling,r=ii(i,{mode:"visible",children:r.children}),(t.mode&1)===0&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function qv(e,t){return t=gp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function bf(e,t,n,r){return r!==null&&Ov(r),Ea(t,e.child,null,n),e=qv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function a3(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=xy(Error(H(422))),bf(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=gp({mode:"visible",children:r.children},o,0,null),i=Xi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,(t.mode&1)!==0&&Ea(t,e.child,null,s),t.child.memoizedState=sv(s),t.memoizedState=iv,i);if((t.mode&1)===0)return bf(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(H(419)),r=xy(i,r,void 0),bf(e,t,s,r)}if(a=(s&e.childLanes)!==0,hn||a){if(r=xt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=(o&(r.suspendedLanes|s))!==0?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,mo(e,o),fr(r,e,o,-1))}return e0(),r=xy(Error(H(421))),bf(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=x3.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,An=ti(o.nextSibling),_n=t,We=!0,ur=null,e!==null&&(Wn[$n++]=lo,Wn[$n++]=co,Wn[$n++]=Zi,lo=e.id,co=e.overflow,Zi=t),t=qv(t,r.children),t.flags|=4096,t)}function cT(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Jy(e.return,t,n)}function wy(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function Q1(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Zt(e,t,r.children,n),r=Ke.current,(r&2)!==0)r=r&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cT(e,n,t);else if(e.tag===19)cT(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ze(Ke,r),(t.mode&1)===0)t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Qf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),wy(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Qf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}wy(t,!0,n,null,i);break;case"together":wy(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function _f(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function go(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),es|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(H(153));if(t.child!==null){for(e=t.child,n=ii(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ii(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function l3(e,t,n){switch(t.tag){case 3:Y1(t),ba();break;case 5:E1(t);break;case 1:vn(t.type)&&jf(t);break;case 4:Bv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ze(qf,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ze(Ke,Ke.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?X1(e,t,n):(ze(Ke,Ke.current&1),e=go(e,t,n),e!==null?e.sibling:null);ze(Ke,Ke.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&128)!==0){if(r)return Q1(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ze(Ke,Ke.current),r)break;return null;case 22:case 23:return t.lanes=0,G1(e,t,n)}return go(e,t,n)}var Z1,av,J1,ek;Z1=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};av=function(){};J1=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,qi(Fr.current);var i=null;switch(n){case"input":o=Iy(e,o),r=Iy(e,r),i=[];break;case"select":o=qe({},o,{value:void 0}),r=qe({},r,{value:void 0}),i=[];break;case"textarea":o=My(e,o),r=My(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Wf)}Oy(n,r);var s;n=null;for(c in o)if(!r.hasOwnProperty(c)&&o.hasOwnProperty(c)&&o[c]!=null)if(c==="style"){var a=o[c];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(pc.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=o!=null?o[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(pc.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&He("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};ek=function(e,t,n,r){n!==r&&(t.flags|=4)};function Ql(e,t){if(!We)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ut(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function c3(e,t,n){var r=t.pendingProps;switch(Nv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ut(t),null;case 1:return vn(t.type)&&$f(),Ut(t),null;case 3:return r=t.stateNode,Ca(),Be(yn),Be(Wt),Vv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xf(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ur!==null&&(gv(ur),ur=null))),av(e,t),Ut(t),null;case 5:Uv(t);var o=qi(Tc.current);if(n=t.type,e!==null&&t.stateNode!=null)J1(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(H(166));return Ut(t),null}if(e=qi(Fr.current),xf(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Lr]=t,r[Ec]=i,e=(t.mode&1)!==0,n){case"dialog":He("cancel",r),He("close",r);break;case"iframe":case"object":case"embed":He("load",r);break;case"video":case"audio":for(o=0;o<rc.length;o++)He(rc[o],r);break;case"source":He("error",r);break;case"img":case"image":case"link":He("error",r),He("load",r);break;case"details":He("toggle",r);break;case"input":yC(r,i),He("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},He("invalid",r);break;case"textarea":SC(r,i),He("invalid",r)}Oy(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Sf(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Sf(r.textContent,a,e),o=["children",""+a]):pc.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&He("scroll",r)}switch(n){case"input":af(r),vC(r,i,!0);break;case"textarea":af(r),xC(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Wf)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=PT(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script></script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Lr]=t,e[Ec]=r,Z1(e,t,!1,!1),t.stateNode=e;e:{switch(s=Ly(n,r),n){case"dialog":He("cancel",e),He("close",e),o=r;break;case"iframe":case"object":case"embed":He("load",e),o=r;break;case"video":case"audio":for(o=0;o<rc.length;o++)He(rc[o],e);o=r;break;case"source":He("error",e),o=r;break;case"img":case"image":case"link":He("error",e),He("load",e),o=r;break;case"details":He("toggle",e),o=r;break;case"input":yC(e,r),o=Iy(e,r),He("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=qe({},r,{value:void 0}),He("invalid",e);break;case"textarea":SC(e,r),o=My(e,r),He("invalid",e);break;default:o=r}Oy(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?_T(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&IT(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&mc(e,l):typeof l=="number"&&mc(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(pc.hasOwnProperty(i)?l!=null&&i==="onScroll"&&He("scroll",e):l!=null&&vv(e,i,l,s))}switch(n){case"input":af(e),vC(e,r,!1);break;case"textarea":af(e),xC(e);break;case"option":r.value!=null&&e.setAttribute("value",""+si(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ma(e,!!r.multiple,i,!1):r.defaultValue!=null&&ma(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Wf)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ut(t),null;case 6:if(e&&t.stateNode!=null)ek(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(H(166));if(n=qi(Tc.current),qi(Fr.current),xf(t)){if(r=t.stateNode,n=t.memoizedProps,r[Lr]=t,(i=r.nodeValue!==n)&&(e=_n,e!==null))switch(e.tag){case 3:Sf(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Sf(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Lr]=t,t.stateNode=r}return Ut(t),null;case 13:if(Be(Ke),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(We&&An!==null&&(t.mode&1)!==0&&(t.flags&128)===0)v1(),ba(),t.flags|=98560,i=!1;else if(i=xf(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(H(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(H(317));i[Lr]=t}else ba(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ut(t),i=!1}else ur!==null&&(gv(ur),ur=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(Ke.current&1)!==0?ut===0&&(ut=3):e0())),t.updateQueue!==null&&(t.flags|=4),Ut(t),null);case 4:return Ca(),av(e,t),e===null&&wc(t.stateNode.containerInfo),Ut(t),null;case 10:return Fv(t.type._context),Ut(t),null;case 17:return vn(t.type)&&$f(),Ut(t),null;case 19:if(Be(Ke),i=t.memoizedState,i===null)return Ut(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)Ql(i,!1);else{if(ut!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(s=Qf(e),s!==null){for(t.flags|=128,Ql(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ze(Ke,Ke.current&1|2),t.child}e=e.sibling}i.tail!==null&&Je()>ka&&(t.flags|=128,r=!0,Ql(i,!1),t.lanes=4194304)}else{if(!r)if(e=Qf(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ql(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!We)return Ut(t),null}else 2*Je()-i.renderingStartTime>ka&&n!==1073741824&&(t.flags|=128,r=!0,Ql(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Je(),t.sibling=null,n=Ke.current,ze(Ke,r?n&1|2:n&1),t):(Ut(t),null);case 22:case 23:return Jv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(In&1073741824)!==0&&(Ut(t),t.subtreeFlags&6&&(t.flags|=8192)):Ut(t),null;case 24:return null;case 25:return null}throw Error(H(156,t.tag))}function u3(e,t){switch(Nv(t),t.tag){case 1:return vn(t.type)&&$f(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(),Be(yn),Be(Wt),Vv(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Uv(t),null;case 13:if(Be(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(H(340));ba()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Ke),null;case 4:return Ca(),null;case 10:return Fv(t.type._context),null;case 22:case 23:return Jv(),null;case 24:return null;default:return null}}var Ef=!1,Vt=!1,d3=typeof WeakSet=="function"?WeakSet:Set,Q=null;function fa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Xe(e,t,r)}else n.current=null}function lv(e,t,n){try{n()}catch(r){Xe(e,t,r)}}var uT=!1;function f3(e,t){if(jy=Bf,e=i1(),_v(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch(x){n=null;break e}var s=0,a=-1,l=-1,c=0,u=0,f=e,d=null;t:for(;;){for(var p;f!==n||o!==0&&f.nodeType!==3||(a=s+o),f!==i||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(p=f.firstChild)!==null;)d=f,f=p;for(;;){if(f===e)break t;if(d===n&&++c===o&&(a=s),d===i&&++u===r&&(l=s),(p=f.nextSibling)!==null)break;f=d,d=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ky={focusedElem:e,selectionRange:n},Bf=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var m=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var g=m.memoizedProps,v=m.memoizedState,h=t.stateNode,y=h.getSnapshotBeforeUpdate(t.elementType===t.type?g:lr(t.type,g),v);h.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(H(163))}}catch(x){Xe(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return m=uT,uT=!1,m}function uc(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&lv(t,n,i)}o=o.next}while(o!==r)}}function pp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function cv(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function tk(e){var t=e.alternate;t!==null&&(e.alternate=null,tk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lr],delete t[Ec],delete t[Yy],delete t[qD],delete t[YD])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nk(e){return e.tag===5||e.tag===3||e.tag===4}function dT(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nk(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function uv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,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=Wf));else if(r!==4&&(e=e.child,e!==null))for(uv(e,t,n),e=e.sibling;e!==null;)uv(e,t,n),e=e.sibling}function dv(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(dv(e,t,n),e=e.sibling;e!==null;)dv(e,t,n),e=e.sibling}var _t=null,cr=!1;function jo(e,t,n){for(n=n.child;n!==null;)rk(e,t,n),n=n.sibling}function rk(e,t,n){if(Dr&&typeof Dr.onCommitFiberUnmount=="function")try{Dr.onCommitFiberUnmount(ip,n)}catch(a){}switch(n.tag){case 5:Vt||fa(n,t);case 6:var r=_t,o=cr;_t=null,jo(e,t,n),_t=r,cr=o,_t!==null&&(cr?(e=_t,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):_t.removeChild(n.stateNode));break;case 18:_t!==null&&(cr?(e=_t,n=n.stateNode,e.nodeType===8?my(e.parentNode,n):e.nodeType===1&&my(e,n),vc(e)):my(_t,n.stateNode));break;case 4:r=_t,o=cr,_t=n.stateNode.containerInfo,cr=!0,jo(e,t,n),_t=r,cr=o;break;case 0:case 11:case 14:case 15:if(!Vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&((i&2)!==0||(i&4)!==0)&&lv(n,t,s),o=o.next}while(o!==r)}jo(e,t,n);break;case 1:if(!Vt&&(fa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Xe(n,t,a)}jo(e,t,n);break;case 21:jo(e,t,n);break;case 22:n.mode&1?(Vt=(r=Vt)||n.memoizedState!==null,jo(e,t,n),Vt=r):jo(e,t,n);break;default:jo(e,t,n)}}function fT(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new d3),t.forEach(function(r){var o=w3.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function ar(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:_t=a.stateNode,cr=!1;break e;case 3:_t=a.stateNode.containerInfo,cr=!0;break e;case 4:_t=a.stateNode.containerInfo,cr=!0;break e}a=a.return}if(_t===null)throw Error(H(160));rk(i,s,o),_t=null,cr=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(c){Xe(o,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)ok(t,e),t=t.sibling}function ok(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ar(t,e),Nr(e),r&4){try{uc(3,e,e.return),pp(3,e)}catch(g){Xe(e,e.return,g)}try{uc(5,e,e.return)}catch(g){Xe(e,e.return,g)}}break;case 1:ar(t,e),Nr(e),r&512&&n!==null&&fa(n,n.return);break;case 5:if(ar(t,e),Nr(e),r&512&&n!==null&&fa(n,n.return),e.flags&32){var o=e.stateNode;try{mc(o,"")}catch(g){Xe(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&kT(o,i),Ly(a,s);var c=Ly(a,i);for(s=0;s<l.length;s+=2){var u=l[s],f=l[s+1];u==="style"?_T(o,f):u==="dangerouslySetInnerHTML"?IT(o,f):u==="children"?mc(o,f):vv(o,u,f,c)}switch(a){case"input":Ay(o,i);break;case"textarea":RT(o,i);break;case"select":var d=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ma(o,!!i.multiple,p,!1):d!==!!i.multiple&&(i.defaultValue!=null?ma(o,!!i.multiple,i.defaultValue,!0):ma(o,!!i.multiple,i.multiple?[]:"",!1))}o[Ec]=i}catch(g){Xe(e,e.return,g)}}break;case 6:if(ar(t,e),Nr(e),r&4){if(e.stateNode===null)throw Error(H(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){Xe(e,e.return,g)}}break;case 3:if(ar(t,e),Nr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vc(t.containerInfo)}catch(g){Xe(e,e.return,g)}break;case 4:ar(t,e),Nr(e);break;case 13:ar(t,e),Nr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Qv=Je())),r&4&&fT(e);break;case 22:if(u=n!==null&&n.memoizedState!==null,e.mode&1?(Vt=(c=Vt)||u,ar(t,e),Vt=c):ar(t,e),Nr(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!u&&(e.mode&1)!==0)for(Q=e,u=e.child;u!==null;){for(f=Q=u;Q!==null;){switch(d=Q,p=d.child,d.tag){case 0:case 11:case 14:case 15:uc(4,d,d.return);break;case 1:fa(d,d.return);var m=d.stateNode;if(typeof m.componentWillUnmount=="function"){r=d,n=d.return;try{t=r,m.props=t.memoizedProps,m.state=t.memoizedState,m.componentWillUnmount()}catch(g){Xe(r,n,g)}}break;case 5:fa(d,d.return);break;case 22:if(d.memoizedState!==null){mT(f);continue}}p!==null?(p.return=d,Q=p):mT(f)}u=u.sibling}e:for(u=null,f=e;;){if(f.tag===5){if(u===null){u=f;try{o=f.stateNode,c?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=AT("display",s))}catch(g){Xe(e,e.return,g)}}}else if(f.tag===6){if(u===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(g){Xe(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;u===f&&(u=null),f=f.return}u===f&&(u=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:ar(t,e),Nr(e),r&4&&fT(e);break;case 21:break;default:ar(t,e),Nr(e)}}function Nr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(nk(n)){var r=n;break e}n=n.return}throw Error(H(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(mc(o,""),r.flags&=-33);var i=dT(e);dv(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=dT(e);uv(e,a,s);break;default:throw Error(H(161))}}catch(l){Xe(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function p3(e,t,n){Q=e,ik(e,t,n)}function ik(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var o=Q,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Ef;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||Vt;a=Ef;var c=Vt;if(Ef=s,(Vt=l)&&!c)for(Q=o;Q!==null;)s=Q,l=s.child,s.tag===22&&s.memoizedState!==null?gT(o):l!==null?(l.return=s,Q=l):gT(o);for(;i!==null;)Q=i,ik(i,t,n),i=i.sibling;Q=o,Ef=a,Vt=c}pT(e,t,n)}else(o.subtreeFlags&8772)!==0&&i!==null?(i.return=o,Q=i):pT(e,t,n)}}function pT(e){for(;Q!==null;){var t=Q;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:Vt||pp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Vt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:lr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&QC(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}QC(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var c=t.alternate;if(c!==null){var u=c.memoizedState;if(u!==null){var f=u.dehydrated;f!==null&&vc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(H(163))}Vt||t.flags&512&&cv(t)}catch(d){Xe(t,t.return,d)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function mT(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function gT(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{pp(4,t)}catch(l){Xe(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Xe(t,o,l)}}var i=t.return;try{cv(t)}catch(l){Xe(t,i,l)}break;case 5:var s=t.return;try{cv(t)}catch(l){Xe(t,s,l)}}}catch(l){Xe(t,t.return,l)}if(t===e){Q=null;break}var a=t.sibling;if(a!==null){a.return=t.return,Q=a;break}Q=t.return}}var m3=Math.ceil,ep=ho.ReactCurrentDispatcher,Yv=ho.ReactCurrentOwner,Kn=ho.ReactCurrentBatchConfig,Ce=0,xt=null,rt=null,Mt=0,In=0,pa=ci(0),ut=0,Ic=null,es=0,mp=0,Xv=0,dc=null,gn=null,Qv=0,ka=1/0,so=null,tp=!1,fv=null,ri=null,Cf=!1,Qo=null,np=0,fc=0,pv=null,Mf=-1,Nf=0;function Jt(){return(Ce&6)!==0?Je():Mf!==-1?Mf:Mf=Je()}function oi(e){return(e.mode&1)===0?1:(Ce&2)!==0&&Mt!==0?Mt&-Mt:QD.transition!==null?(Nf===0&&(Nf=WT()),Nf):(e=_e,e!==0||(e=window.event,e=e===void 0?16:XT(e.type)),e)}function fr(e,t,n,r){if(50<fc)throw fc=0,pv=null,Error(H(185));Ac(e,n,r),((Ce&2)===0||e!==xt)&&(e===xt&&((Ce&2)===0&&(mp|=n),ut===4&&Yo(e,Mt)),Sn(e,r),n===1&&Ce===0&&(t.mode&1)===0&&(ka=Je()+500,up&&ui()))}function Sn(e,t){var n=e.callbackNode;J2(e,t);var r=Hf(e,e===xt?Mt:0);if(r===0)n!==null&&EC(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&EC(n),t===1)e.tag===0?XD(hT.bind(null,e)):g1(hT.bind(null,e)),KD(function(){(Ce&6)===0&&ui()}),n=null;else{switch($T(r)){case 1:n=Ev;break;case 4:n=UT;break;case 16:n=zf;break;case 536870912:n=VT;break;default:n=zf}n=pk(n,sk.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function sk(e,t){if(Mf=-1,Nf=0,(Ce&6)!==0)throw Error(H(327));var n=e.callbackNode;if(Sa()&&e.callbackNode!==n)return null;var r=Hf(e,e===xt?Mt:0);if(r===0)return null;if((r&30)!==0||(r&e.expiredLanes)!==0||t)t=rp(e,r);else{t=r;var o=Ce;Ce|=2;var i=lk();(xt!==e||Mt!==t)&&(so=null,ka=Je()+500,Yi(e,t));do try{y3();break}catch(a){ak(e,a)}while(!0);Dv(),ep.current=i,Ce=o,rt!==null?t=0:(xt=null,Mt=0,t=ut)}if(t!==0){if(t===2&&(o=By(e),o!==0&&(r=o,t=mv(e,o))),t===1)throw n=Ic,Yi(e,0),Yo(e,r),Sn(e,Je()),n;if(t===6)Yo(e,r);else{if(o=e.current.alternate,(r&30)===0&&!g3(o)&&(t=rp(e,r),t===2&&(i=By(e),i!==0&&(r=i,t=mv(e,i))),t===1))throw n=Ic,Yi(e,0),Yo(e,r),Sn(e,Je()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(H(345));case 2:ji(e,gn,so);break;case 3:if(Yo(e,r),(r&130023424)===r&&(t=Qv+500-Je(),10<t)){if(Hf(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Jt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=qy(ji.bind(null,e,gn,so),t);break}ji(e,gn,so);break;case 4:if(Yo(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-dr(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*m3(r/1960))-r,10<r){e.timeoutHandle=qy(ji.bind(null,e,gn,so),r);break}ji(e,gn,so);break;case 5:ji(e,gn,so);break;default:throw Error(H(329))}}}return Sn(e,Je()),e.callbackNode===n?sk.bind(null,e):null}function mv(e,t){var n=dc;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=rp(e,t),e!==2&&(t=gn,gn=n,t!==null&&gv(t)),e}function gv(e){gn===null?gn=e:gn.push.apply(gn,e)}function g3(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!pr(i(),o))return!1}catch(s){return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Yo(e,t){for(t&=~Xv,t&=~mp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dr(t),r=1<<n;e[n]=-1,t&=~r}}function hT(e){if((Ce&6)!==0)throw Error(H(327));Sa();var t=Hf(e,0);if((t&1)===0)return Sn(e,Je()),null;var n=rp(e,t);if(e.tag!==0&&n===2){var r=By(e);r!==0&&(t=r,n=mv(e,r))}if(n===1)throw n=Ic,Yi(e,0),Yo(e,t),Sn(e,Je()),n;if(n===6)throw Error(H(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ji(e,gn,so),Sn(e,Je()),null}function Zv(e,t){var n=Ce;Ce|=1;try{return e(t)}finally{Ce=n,Ce===0&&(ka=Je()+500,up&&ui())}}function ts(e){Qo!==null&&Qo.tag===0&&(Ce&6)===0&&Sa();var t=Ce;Ce|=1;var n=Kn.transition,r=_e;try{if(Kn.transition=null,_e=1,e)return e()}finally{_e=r,Kn.transition=n,Ce=t,(Ce&6)===0&&ui()}}function Jv(){In=pa.current,Be(pa)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jD(n)),rt!==null)for(n=rt.return;n!==null;){var r=n;switch(Nv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&$f();break;case 3:Ca(),Be(yn),Be(Wt),Vv();break;case 5:Uv(r);break;case 4:Ca();break;case 13:Be(Ke);break;case 19:Be(Ke);break;case 10:Fv(r.type._context);break;case 22:case 23:Jv()}n=n.return}if(xt=e,rt=e=ii(e.current,null),Mt=In=t,ut=0,Ic=null,Xv=mp=es=0,gn=dc=null,Gi!==null){for(t=0;t<Gi.length;t++)if(n=Gi[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}Gi=null}return e}function ak(e,t){do{var n=rt;try{if(Dv(),If.current=Jf,Zf){for(var r=Ge.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Zf=!1}if(Ji=0,St=ct=Ge=null,cc=!1,kc=0,Yv.current=null,n===null||n.return===null){ut=1,Ic=t,rt=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=Mt,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,u=a,f=u.tag;if((u.mode&1)===0&&(f===0||f===11||f===15)){var d=u.alternate;d?(u.updateQueue=d.updateQueue,u.memoizedState=d.memoizedState,u.lanes=d.lanes):(u.updateQueue=null,u.memoizedState=null)}var p=rT(s);if(p!==null){p.flags&=-257,oT(p,s,a,i,t),p.mode&1&&nT(i,c,t),t=p,l=c;var m=t.updateQueue;if(m===null){var g=new Set;g.add(l),t.updateQueue=g}else m.add(l);break e}else{if((t&1)===0){nT(i,c,t),e0();break e}l=Error(H(426))}}else if(We&&a.mode&1){var v=rT(s);if(v!==null){(v.flags&65536)===0&&(v.flags|=256),oT(v,s,a,i,t),Ov(Ta(l,a));break e}}i=l=Ta(l,a),ut!==4&&(ut=2),dc===null?dc=[i]:dc.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var h=$1(i,l,t);XC(i,h);break e;case 1:a=l;var y=i.type,S=i.stateNode;if((i.flags&128)===0&&(typeof y.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(ri===null||!ri.has(S)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=j1(i,a,t);XC(i,x);break e}}i=i.return}while(i!==null)}uk(n)}catch(T){t=T,rt===n&&n!==null&&(rt=n=n.return);continue}break}while(!0)}function lk(){var e=ep.current;return ep.current=Jf,e===null?Jf:e}function e0(){(ut===0||ut===3||ut===2)&&(ut=4),xt===null||(es&268435455)===0&&(mp&268435455)===0||Yo(xt,Mt)}function rp(e,t){var n=Ce;Ce|=2;var r=lk();(xt!==e||Mt!==t)&&(so=null,Yi(e,t));do try{h3();break}catch(o){ak(e,o)}while(!0);if(Dv(),Ce=n,ep.current=r,rt!==null)throw Error(H(261));return xt=null,Mt=0,ut}function h3(){for(;rt!==null;)ck(rt)}function y3(){for(;rt!==null&&!$2();)ck(rt)}function ck(e){var t=fk(e.alternate,e,In);e.memoizedProps=e.pendingProps,t===null?uk(e):rt=t,Yv.current=null}function uk(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=c3(n,t,In),n!==null){rt=n;return}}else{if(n=u3(n,t),n!==null){n.flags&=32767,rt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ut=6,rt=null;return}}if(t=t.sibling,t!==null){rt=t;return}rt=t=e}while(t!==null);ut===0&&(ut=5)}function ji(e,t,n){var r=_e,o=Kn.transition;try{Kn.transition=null,_e=1,v3(e,t,n,r)}finally{Kn.transition=o,_e=r}return null}function v3(e,t,n,r){do Sa();while(Qo!==null);if((Ce&6)!==0)throw Error(H(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(H(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eD(e,i),e===xt&&(rt=xt=null,Mt=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Cf||(Cf=!0,pk(zf,function(){return Sa(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=Kn.transition,Kn.transition=null;var s=_e;_e=1;var a=Ce;Ce|=4,Yv.current=null,f3(e,n),ok(n,e),BD(Ky),Bf=!!jy,Ky=jy=null,e.current=n,p3(n,e,o),j2(),Ce=a,_e=s,Kn.transition=i}else e.current=n;if(Cf&&(Cf=!1,Qo=e,np=o),i=e.pendingLanes,i===0&&(ri=null),q2(n.stateNode,r),Sn(e,Je()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(tp)throw tp=!1,e=fv,fv=null,e;return(np&1)!==0&&e.tag!==0&&Sa(),i=e.pendingLanes,(i&1)!==0?e===pv?fc++:(fc=0,pv=e):fc=0,ui(),null}function Sa(){if(Qo!==null){var e=$T(np),t=Kn.transition,n=_e;try{if(Kn.transition=null,_e=16>e?16:e,Qo===null)var r=!1;else{if(e=Qo,Qo=null,np=0,(Ce&6)!==0)throw Error(H(331));var o=Ce;for(Ce|=4,Q=e.current;Q!==null;){var i=Q,s=i.child;if((Q.flags&16)!==0){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(Q=c;Q!==null;){var u=Q;switch(u.tag){case 0:case 11:case 15:uc(8,u,i)}var f=u.child;if(f!==null)f.return=u,Q=f;else for(;Q!==null;){u=Q;var d=u.sibling,p=u.return;if(tk(u),u===c){Q=null;break}if(d!==null){d.return=p,Q=d;break}Q=p}}}var m=i.alternate;if(m!==null){var g=m.child;if(g!==null){m.child=null;do{var v=g.sibling;g.sibling=null,g=v}while(g!==null)}}Q=i}}if((i.subtreeFlags&2064)!==0&&s!==null)s.return=i,Q=s;else e:for(;Q!==null;){if(i=Q,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:uc(9,i,i.return)}var h=i.sibling;if(h!==null){h.return=i.return,Q=h;break e}Q=i.return}}var y=e.current;for(Q=y;Q!==null;){s=Q;var S=s.child;if((s.subtreeFlags&2064)!==0&&S!==null)S.return=s,Q=S;else e:for(s=y;Q!==null;){if(a=Q,(a.flags&2048)!==0)try{switch(a.tag){case 0:case 11:case 15:pp(9,a)}}catch(T){Xe(a,a.return,T)}if(a===s){Q=null;break e}var x=a.sibling;if(x!==null){x.return=a.return,Q=x;break e}Q=a.return}}if(Ce=o,ui(),Dr&&typeof Dr.onPostCommitFiberRoot=="function")try{Dr.onPostCommitFiberRoot(ip,e)}catch(T){}r=!0}return r}finally{_e=n,Kn.transition=t}}return!1}function yT(e,t,n){t=Ta(n,t),t=$1(e,t,1),e=ni(e,t,1),t=Jt(),e!==null&&(Ac(e,1,t),Sn(e,t))}function Xe(e,t,n){if(e.tag===3)yT(e,e,n);else for(;t!==null;){if(t.tag===3){yT(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(ri===null||!ri.has(r))){e=Ta(n,e),e=j1(t,e,1),t=ni(t,e,1),e=Jt(),t!==null&&(Ac(t,1,e),Sn(t,e));break}}t=t.return}}function S3(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Jt(),e.pingedLanes|=e.suspendedLanes&n,xt===e&&(Mt&n)===n&&(ut===4||ut===3&&(Mt&130023424)===Mt&&500>Je()-Qv?Yi(e,0):Xv|=n),Sn(e,t)}function dk(e,t){t===0&&((e.mode&1)===0?t=1:(t=uf,uf<<=1,(uf&130023424)===0&&(uf=4194304)));var n=Jt();e=mo(e,t),e!==null&&(Ac(e,t,n),Sn(e,n))}function x3(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dk(e,n)}function w3(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(H(314))}r!==null&&r.delete(t),dk(e,n)}var fk;fk=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||yn.current)hn=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return hn=!1,l3(e,t,n);hn=(e.flags&131072)!==0}else hn=!1,We&&(t.flags&1048576)!==0&&h1(t,Gf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;_f(e,t),e=t.pendingProps;var o=wa(t,Wt.current);va(t,n),o=$v(null,t,r,e,o,n);var i=jv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vn(r)?(i=!0,jf(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Hv(t),o.updater=fp,t.stateNode=o,o._reactInternals=t,tv(t,r,e,n),t=ov(null,t,r,!0,i,n)):(t.tag=0,We&&i&&Mv(t),Zt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(_f(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=E3(r),e=lr(r,e),o){case 0:t=rv(null,t,r,e,n);break e;case 1:t=aT(null,t,r,e,n);break e;case 11:t=iT(null,t,r,e,n);break e;case 14:t=sT(null,t,r,lr(r.type,e),n);break e}throw Error(H(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),rv(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),aT(e,t,r,o,n);case 3:e:{if(Y1(t),e===null)throw Error(H(387));r=t.pendingProps,i=t.memoizedState,o=i.element,b1(e,t),Xf(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ta(Error(H(423)),t),t=lT(e,t,r,n,o);break e}else if(r!==o){o=Ta(Error(H(424)),t),t=lT(e,t,r,n,o);break e}else for(An=ti(t.stateNode.containerInfo.firstChild),_n=t,We=!0,ur=null,n=x1(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ba(),r===o){t=go(e,t,n);break e}Zt(e,t,r,n)}t=t.child}return t;case 5:return E1(t),e===null&&Zy(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Gy(r,o)?s=null:i!==null&&Gy(r,i)&&(t.flags|=32),q1(e,t),Zt(e,t,s,n),t.child;case 6:return e===null&&Zy(t),null;case 13:return X1(e,t,n);case 4:return Bv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ea(t,null,r,n):Zt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),iT(e,t,r,o,n);case 7:return Zt(e,t,t.pendingProps,n),t.child;case 8:return Zt(e,t,t.pendingProps.children,n),t.child;case 12:return Zt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ze(qf,r._currentValue),r._currentValue=s,i!==null)if(pr(i.value,s)){if(i.children===o.children&&!yn.current){t=go(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=uo(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Jy(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(H(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Jy(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}Zt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,va(t,n),o=Gn(o),r=r(o),t.flags|=1,Zt(e,t,r,n),t.child;case 14:return r=t.type,o=lr(r,t.pendingProps),o=lr(r.type,o),sT(e,t,r,o,n);case 15:return K1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:lr(r,o),_f(e,t),t.tag=1,vn(r)?(e=!0,jf(t)):e=!1,va(t,n),W1(t,r,o),tv(t,r,o,n),ov(null,t,r,!0,e,n);case 19:return Q1(e,t,n);case 22:return G1(e,t,n)}throw Error(H(156,t.tag))};function pk(e,t){return BT(e,t)}function b3(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.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(e,t,n,r){return new b3(e,t,n,r)}function t0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function E3(e){if(typeof e=="function")return t0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xv)return 11;if(e===wv)return 14}return 2}function ii(e,t){var n=e.alternate;return n===null?(n=jn(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.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,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 Of(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")t0(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ra:return Xi(n.children,o,i,t);case Sv:s=8,o|=8;break;case Ty:return e=jn(12,n,t,o|2),e.elementType=Ty,e.lanes=i,e;case ky:return e=jn(13,n,t,o),e.elementType=ky,e.lanes=i,e;case Ry:return e=jn(19,n,t,o),e.elementType=Ry,e.lanes=i,e;case ET:return gp(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case wT:s=10;break e;case bT:s=9;break e;case xv:s=11;break e;case wv:s=14;break e;case Ko:s=16,r=null;break e}throw Error(H(130,e==null?e:typeof e,""))}return t=jn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Xi(e,t,n,r){return e=jn(7,e,r,t),e.lanes=n,e}function gp(e,t,n,r){return e=jn(22,e,r,t),e.elementType=ET,e.lanes=n,e.stateNode={isHidden:!1},e}function by(e,t,n){return e=jn(6,e,null,t),e.lanes=n,e}function Ey(e,t,n){return t=jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function C3(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=sy(0),this.expirationTimes=sy(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sy(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function n0(e,t,n,r,o,i,s,a,l){return e=new C3(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=jn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hv(i),e}function T3(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:na,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function mk(e){if(!e)return ai;e=e._reactInternals;e:{if(rs(e)!==e||e.tag!==1)throw Error(H(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(H(171))}if(e.tag===1){var n=e.type;if(vn(n))return m1(e,n,t)}return t}function gk(e,t,n,r,o,i,s,a,l){return e=n0(n,r,!0,e,o,i,s,a,l),e.context=mk(null),n=e.current,r=Jt(),o=oi(n),i=uo(r,o),i.callback=t!=null?t:null,ni(n,i,o),e.current.lanes=o,Ac(e,o,r),Sn(e,r),e}function hp(e,t,n,r){var o=t.current,i=Jt(),s=oi(o);return n=mk(n),t.context===null?t.context=n:t.pendingContext=n,t=uo(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ni(o,t,s),e!==null&&(fr(e,o,s,i),Pf(e,o,s)),s}function op(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function vT(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function r0(e,t){vT(e,t),(e=e.alternate)&&vT(e,t)}function k3(){return null}var hk=typeof reportError=="function"?reportError:function(e){console.error(e)};function o0(e){this._internalRoot=e}yp.prototype.render=o0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(H(409));hp(e,t,null,null)};yp.prototype.unmount=o0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ts(function(){hp(null,e,null,null)}),t[po]=null}};function yp(e){this._internalRoot=e}yp.prototype.unstable_scheduleHydration=function(e){if(e){var t=GT();e={blockedOn:null,target:e,priority:t};for(var n=0;n<qo.length&&t!==0&&t<qo[n].priority;n++);qo.splice(n,0,e),n===0&&YT(e)}};function i0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ST(){}function R3(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var c=op(s);i.call(c)}}var s=gk(t,r,e,0,null,!1,!1,"",ST);return e._reactRootContainer=s,e[po]=s.current,wc(e.nodeType===8?e.parentNode:e),ts(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var c=op(l);a.call(c)}}var l=n0(e,0,!1,null,null,!1,!1,"",ST);return e._reactRootContainer=l,e[po]=l.current,wc(e.nodeType===8?e.parentNode:e),ts(function(){hp(t,l,n,r)}),l}function Sp(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=op(s);a.call(l)}}hp(t,s,e,o)}else s=R3(n,t,e,o,r);return op(s)}jT=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=nc(t.pendingLanes);n!==0&&(Cv(t,n|1),Sn(t,Je()),(Ce&6)===0&&(ka=Je()+500,ui()))}break;case 13:ts(function(){var r=mo(e,1);if(r!==null){var o=Jt();fr(r,e,1,o)}}),r0(e,1)}};Tv=function(e){if(e.tag===13){var t=mo(e,134217728);if(t!==null){var n=Jt();fr(t,e,134217728,n)}r0(e,134217728)}};KT=function(e){if(e.tag===13){var t=oi(e),n=mo(e,t);if(n!==null){var r=Jt();fr(n,e,t,r)}r0(e,t)}};GT=function(){return _e};qT=function(e,t){var n=_e;try{return _e=e,t()}finally{_e=n}};Fy=function(e,t,n){switch(t){case"input":if(Ay(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=cp(r);if(!o)throw Error(H(90));TT(r),Ay(r,o)}}}break;case"textarea":RT(e,n);break;case"select":t=n.value,t!=null&&ma(e,!!n.multiple,t,!1)}};OT=Zv;LT=ts;var P3={usingClientEntryPoint:!1,Events:[Mc,aa,cp,MT,NT,Zv]},Zl={findFiberByHostInstance:Ki,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},I3={bundleType:Zl.bundleType,version:Zl.version,rendererPackageName:Zl.rendererPackageName,rendererConfig:Zl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ho.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=zT(e),e===null?null:e.stateNode},findFiberByHostInstance:Zl.findFiberByHostInstance||k3,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__!="undefined"&&(Jl=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Jl.isDisabled&&Jl.supportsFiber))try{ip=Jl.inject(I3),Dr=Jl}catch(e){}var Jl;On.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P3;On.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!i0(t))throw Error(H(200));return T3(e,t,null,n)};On.createRoot=function(e,t){if(!i0(e))throw Error(H(299));var n=!1,r="",o=hk;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=n0(e,1,!1,null,null,n,!1,r,o),e[po]=t.current,wc(e.nodeType===8?e.parentNode:e),new o0(t)};On.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(H(188)):(e=Object.keys(e).join(","),Error(H(268,e)));return e=zT(t),e=e===null?null:e.stateNode,e};On.flushSync=function(e){return ts(e)};On.hydrate=function(e,t,n){if(!vp(t))throw Error(H(200));return Sp(null,e,t,!0,n)};On.hydrateRoot=function(e,t,n){if(!i0(e))throw Error(H(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=hk;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=gk(t,null,e,1,n!=null?n:null,o,!1,i,s),e[po]=t.current,wc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new yp(t)};On.render=function(e,t,n){if(!vp(t))throw Error(H(200));return Sp(null,e,t,!1,n)};On.unmountComponentAtNode=function(e){if(!vp(e))throw Error(H(40));return e._reactRootContainer?(ts(function(){Sp(null,null,e,!1,function(){e._reactRootContainer=null,e[po]=null})}),!0):!1};On.unstable_batchedUpdates=Zv;On.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vp(n))throw Error(H(200));if(e==null||e._reactInternals===void 0)throw Error(H(38));return Sp(e,t,n,!1,r)};On.version="18.3.1-next-f1338f8080-20240426"});var Oc=un((WU,Sk)=>{"use strict";function vk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(vk)}catch(e){console.error(e)}}vk(),Sk.exports=yk()});var oP=un(j0=>{"use strict";var rP=Oc();j0.createRoot=rP.createRoot,j0.hydrateRoot=rP.hydrateRoot;var KW});var X0=un((O$,gP)=>{"use strict";var CF="Expected a function",pP=NaN,TF="[object Symbol]",kF=/^\s+|\s+$/g,RF=/^[-+]0x[0-9a-f]+$/i,PF=/^0b[01]+$/i,IF=/^0o[0-7]+$/i,AF=parseInt,_F=typeof global=="object"&&global&&global.Object===Object&&global,MF=typeof self=="object"&&self&&self.Object===Object&&self,NF=_F||MF||Function("return this")(),OF=Object.prototype,LF=OF.toString,DF=Math.max,FF=Math.min,q0=function(){return NF.Date.now()};function zF(e,t,n){var r,o,i,s,a,l,c=0,u=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(CF);t=mP(t)||0,Y0(n)&&(u=!!n.leading,f="maxWait"in n,i=f?DF(mP(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function p(C){var k=r,R=o;return r=o=void 0,c=C,s=e.apply(R,k),s}function m(C){return c=C,a=setTimeout(h,t),u?p(C):s}function g(C){var k=C-l,R=C-c,F=t-k;return f?FF(F,i-R):F}function v(C){var k=C-l,R=C-c;return l===void 0||k>=t||k<0||f&&R>=i}function h(){var C=q0();if(v(C))return y(C);a=setTimeout(h,g(C))}function y(C){return a=void 0,d&&r?p(C):(r=o=void 0,s)}function S(){a!==void 0&&clearTimeout(a),c=0,r=l=o=a=void 0}function x(){return a===void 0?s:y(q0())}function T(){var C=q0(),k=v(C);if(r=arguments,o=this,l=C,k){if(a===void 0)return m(l);if(f)return a=setTimeout(h,t),p(l)}return a===void 0&&(a=setTimeout(h,t)),s}return T.cancel=S,T.flush=x,T}function Y0(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function HF(e){return!!e&&typeof e=="object"}function BF(e){return typeof e=="symbol"||HF(e)&&LF.call(e)==TF}function mP(e){if(typeof e=="number")return e;if(BF(e))return pP;if(Y0(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Y0(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(kF,"");var n=PF.test(e);return n||IF.test(e)?AF(e.slice(2),n?2:8):RF.test(e)?pP:+e}gP.exports=zF});var IP=un((lj,PP)=>{"use strict";var XF=/["'&<>]/;PP.exports=QF;function QF(e){var t=""+e,n=XF.exec(t);if(!n)return t;var r,o="",i=0,s=0;for(i=n.index;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r="&quot;";break;case 38:r="&amp;";break;case 39:r="&#39;";break;case 60:r="&lt;";break;case 62:r="&gt;";break;default:continue}s!==i&&(o+=t.substring(s,i)),s=i+1,o+=r}return s!==i?o+t.substring(s,i):o}});var yz={};ht(yz,{Card:()=>we,ContentEditableInput:()=>Rs,DeepdeskAPI:()=>Mo,DeepdeskSDK:()=>bu,HTTPClient:()=>As,InputMediator:()=>_o,InputType:()=>Ai,KeyboardHint:()=>Uu,Label:()=>Bx,Locale:()=>yl,Section:()=>Tr,SectionList:()=>Hs,Sources:()=>kr,Suggestion:()=>pe,SuggestionList:()=>Tt,TextAreaInput:()=>Ps,ToggleButton:()=>Ii,attachFile:()=>d_,authenticateWithKey:()=>f_,createFullRange:()=>tl,createOverlayContainer:()=>wu,createRangeFromOffsets:()=>Ti,escapeHTML:()=>ja,formatTextMarkup:()=>p_,getRangeOffsets:()=>vu,getRangeText:()=>Su,insertCKEditor:()=>y_,isHTML:()=>Zc,isSupportedInputElement:()=>Gm,logEvent:()=>Id,updateContentEditable:()=>g_,updateTextArea:()=>m_,useClickOutsideRoot:()=>di,useStyles:()=>z,waitForElementVisibilityChange:()=>Xm});var Eg=b(De()),Bn=b(Z());var Du=b(Z()),Ax=b(De());var cl=Du.default.createContext({});function z(e,t){let i=(0,Du.useContext)(cl),{debug:n}=i,o=ie(i,["debug"])[e];return Object.entries(t).reduce((s,[a,l])=>{let c=o==null?void 0:o[a];return A(E({},s),{[a]:(0,Ax.default)(l,c,n?`${e}__${a}`:!1)})},{})}var _x={root:"dd-4s9wq"};var Ri=b(I()),zu=()=>(0,Ri.jsxs)("svg",{className:_x.root,width:"185",height:"170",viewBox:"0 0 185 170",xmlns:"http://www.w3.org/2000/svg",children:[(0,Ri.jsx)("defs",{children:(0,Ri.jsx)("style",{children:".cls-1 { fill: #b3b3b3; }"})}),(0,Ri.jsx)("title",{children:"Failed loading image"}),(0,Ri.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 bg={root:"dd-c9KvZ",imageWrapper:"dd-sE7D9",image:"dd-bEGMz",content:"dd-oFIQa",title:"dd-mSgoo",contentIsCropped:"dd-Uvjv4",lineClamp:"dd-ApQo-"};var Pi=b(I()),Hu=(0,Bn.createContext)(bg),lM=({title:e,src:t})=>{let n=(0,Bn.useContext)(Hu),[r,o]=(0,Bn.useState)(!1);return(0,Bn.useEffect)(()=>{o(!1)},[t]),(0,Pi.jsx)("div",{className:n.imageWrapper,children:t&&!r?(0,Pi.jsx)("img",{className:n.image,alt:e,src:t,onError:()=>o(!0)}):(0,Pi.jsx)(zu,{})})},cM=({className:e,lineClamp:t=!1,cropText:n=!1,children:r})=>{let o=(0,Bn.useContext)(Hu);return(0,Pi.jsx)("div",{className:(0,Eg.default)(o.content,e,{[o.contentIsCropped]:n,[o.lineClamp]:t}),children:r})},uM=i=>{var s=i,{as:e="h1",cropText:t=!1,className:n,children:r}=s,o=ie(s,["as","cropText","className","children"]);let a=(0,Bn.useContext)(Hu);return Bn.default.createElement(e,E({className:(0,Eg.default)(a.title,n,{[a.contentIsCropped]:t})},o),r)},Bu=({children:e})=>{let t=z("Card",bg);return(0,Pi.jsx)("div",{className:t.root,children:(0,Pi.jsx)(Hu.Provider,{value:t,children:e})})};Bu.Image=lM;Bu.Content=cM;Bu.Title=uM;var we=Bu;var Dx=b(De());var Lx={root:"dd-llBx9"};var Fx=b(I());var dM={"arrow-up":"\u25B2","arrow-down":"\u25BC",tab:"tab",esc:"Esc",enter:"\u21B5"},fM=r=>{var o=r,{className:e,keyCode:t}=o,n=ie(o,["className","keyCode"]);let i=z("KeyboardHint",Lx);return(0,Fx.jsx)("span",E({"data-key":dM[t],className:(0,Dx.default)(e,i.root)},n))},Uu=fM;var Hx=b(De());var zx={root:"dd-e6HXZ"};var Ux=b(I()),pM=r=>{var o=r,{className:e,children:t}=o,n=ie(o,["className","children"]);let i=z("Label",zx);return(0,Ux.jsx)("span",A(E({},n),{className:(0,Hx.default)(e,i.root),children:t}))},Bx=pM;var Vx={root:"dd-FiMI7",subTitleContainer:"dd-98jc7",subtitle:"dd-3MnW8",suggestions:"dd-0SGL8"};var zs=b(I()),mM=o=>{var i=o,{title:e,children:t,type:n}=i,r=ie(i,["title","children","type"]);let s=z("Section",Vx);return(0,zs.jsxs)("section",A(E({},r),{className:s.root,"data-section-type":n,children:[e&&(0,zs.jsx)("div",{className:s.subTitleContainer,children:(0,zs.jsx)("span",{className:s.subtitle,children:e})}),(0,zs.jsx)("div",{className:s.suggestions,children:t})]}))},Tr=mM;var Gx=b(De()),qx=b(Z());var Lo=b(Z()),jx=b(I()),Wx=(0,Lo.createContext)(null),$x=({scrollContainerRef:e,children:t})=>{let n=(0,Lo.useCallback)(r=>{let o=e.current;if(!o||o.scrollHeight<=o.clientHeight)return;let{top:i}=o.getBoundingClientRect(),{top:s}=r.getBoundingClientRect(),a=o.scrollTop+(s-i);typeof o.scrollTo=="function"?o.scrollTo({top:a}):o.scrollTop=a},[]);return(0,jx.jsx)(Wx.Provider,{value:n,children:t})},Vu=e=>{let t=(0,Lo.useContext)(Wx);(0,Lo.useEffect)(()=>{let n=e.current;n&&t(n)},[])};var Kx={root:"dd-uoTXh"};var Cg=b(I()),gM=({className:e,children:t})=>{let n=z("SectionList",Kx),r=(0,qx.useRef)(null);return(0,Cg.jsx)($x,{scrollContainerRef:r,children:(0,Cg.jsx)("div",{ref:r,className:(0,Gx.default)(n.root,e),children:t})})},Hs=gM;var Bs=b(De()),dn=b(Z());var Tg={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",buttonPrimary:"dd-aYDCB",buttonSecondary:"dd--cpPL",buttonWithIcon:"dd-MQVt5",icon:"dd-Jr-ww",buttonDisabled:"dd-agTuH"};var Yt=b(I()),Do=(0,dn.createContext)(Tg),hM=r=>{var o=r,{fixed:e,children:t}=o,n=ie(o,["fixed","children"]);let i=(0,dn.useContext)(Do);return(0,Yt.jsx)("div",A(E({},n),{className:(0,Bs.default)(i.actions,{[i.actionsIsFixed]:e}),children:t}))};function yM(l){var c=l,{as:e,className:t,icon:n,title:r,children:o,disabled:i,variant:s}=c,a=ie(c,["as","className","icon","title","children","disabled","variant"]);let u=(0,dn.useContext)(Do);return(0,Yt.jsxs)(e||"button",A(E({type:"button",className:(0,Bs.default)(u.button,{[u.buttonWithIcon]:n,[u.buttonDisabled]:i,[u.buttonPrimary]:s==="primary",[u.buttonSecondary]:s==="secondary"},t),title:r,"aria-label":r},a),{children:[n&&(0,Yt.jsx)("span",{className:u.icon,children:n}),o]}))}var vM=({children:e})=>{let t=(0,dn.useContext)(Do);return(0,Yt.jsx)("div",{className:t.buttonsContainer,children:e})},SM=({className:e,primary:t,disabled:n,label:r,children:o})=>{let i=(0,dn.useContext)(Do);return(0,Yt.jsxs)("div",{className:(0,Bs.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})]})},xM=({index:e,label:t,onClick:n})=>{let r=(0,dn.useContext)(Do);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})})},wM=({className:e,primary:t,disabled:n,onClick:r,label:o})=>{let i=(0,dn.useContext)(Do);return(0,Yt.jsx)("button",{type:"button",className:(0,Bs.default)(e,i.actionButton,{[i.actionButtonIsPrimary]:t,[i.actionButtonIsDisabled]:n}),onClick:r!=null?r:(s=>s.stopPropagation()),disabled:n,"aria-hidden":n,children:o})},bM=({labels:e})=>{let t=(0,dn.useContext)(Do);return(0,Yt.jsx)("div",{className:t.labels,children:e.map(n=>(0,Yt.jsx)("span",{className:t.label,children:n},n))})},Fo=dn.default.forwardRef((a,s)=>{var l=a,{className:e,selected:t,onClick:n,children:r,as:o="div"}=l,i=ie(l,["className","selected","onClick","children","as"]);let c=z("Suggestion",Tg),u=(0,dn.useCallback)(f=>{f.preventDefault(),n&&n(f)},[n]);return(0,Yt.jsx)(o,A(E({},i),{ref:s,className:(0,Bs.default)(e,c.root,{[c.isSelected]:t,[c.isClickable]:!!n}),onClick:u,children:(0,Yt.jsx)(Do.Provider,{value:c,children:r})}))});Fo.Labels=bM;Fo.Actions=hM;Fo.ActionButton=wM;Fo.DropdownButton=SM;Fo.DropdownItem=xM;Fo.ButtonsContainer=vM;Fo.Button=yM;var pe=Fo;var Xx=b(De());var Yx={root:"dd-W35K-",isWithDivider:"dd-sscOy"};var Qx=b(I()),EM=({withDivider:e,children:t})=>{let n=z("SuggestionList",Yx);return(0,Qx.jsx)("div",{"data-testid":"suggestions-overlay-list",className:(0,Xx.default)(n.root,{[n.isWithDivider]:e}),children:t})},Tt=EM;var Jx=b(De());var Zx={root:"dd-oWarc",isCollapsed:"dd-tfZI0"};var Wu=b(I()),CM=({className:e,isCollapsed:t,title:n,onClick:r})=>{let o=z("ToggleButton",Zx);return(0,Wu.jsx)("button",{type:"button",className:(0,Jx.default)(o.root,e,{[o.isCollapsed]:t}),onClick:r,title:n,children:(0,Wu.jsx)("svg",{width:"14",height:"8",viewBox:"-2.5 -5 75 60",preserveAspectRatio:"none",children:(0,Wu.jsx)("path",{d:"M0,0 l35,50 l35,-50",fill:"none",stroke:"grey",strokeLinecap:"round",strokeWidth:"6"})})})},Ii=CM;var ew=/(?:[.,;:!?\\n]|:\\)|:\\(|:-\\)|:-\\()/g,$u=/(((\$!\{)|(\{))[a-zA-Z0-9_.]+\})/g;var tw=/x-deepdesk-(([a-z0-9\-_])+-version)/,ju=["cues","custom-data","custom-data-banner","knowledge-assist"],nw=Intl.DateTimeFormat().resolvedOptions().timeZone,kr=(v=>(v.SEARCH="search",v.TEMPLATE="template",v.ELASTIC_SEARCH="search-autocomplete",v.GPT="gpt",v.TRIE="trie",v.TRIE_WITH_TYPOS="trie-with-typos",v.SEMANTIC="semantic",v.TEXT_RECOMMENDATION="text_recommendation",v.URL_RECOMMENDATION="url_recommendation",v.LINK_RECOMMENDATION="link_recommendation",v.PERSONAL_COLLECTION="personal-collection",v.PERSONAL_COLLECTION_SEARCH="personal-collection-search",v.SEARCH_OVERLAY="search-overlay",v.SEARCH_PREVIEW="search-preview",v.SEARCH_URL="search-url",v.STYLE="style",v))(kr||{}),Ai=(s=>(s.ENTER="enter",s.TAB="tab",s.ARROW="arrow",s.HOTKEY="hotkey",s.MOUSE="mouse",s.SPACE="space",s))(Ai||{});var et=b(Z());var le=b(Z(),1),ww=b(sw(),1);var MM=le.version.startsWith("19"),NM=Symbol.for(MM?"react.transitional.element":"react.element"),OM=Symbol.for("react.portal"),LM=Symbol.for("react.fragment"),DM=Symbol.for("react.strict_mode"),FM=Symbol.for("react.profiler"),zM=Symbol.for("react.consumer"),HM=Symbol.for("react.context"),pw=Symbol.for("react.forward_ref"),BM=Symbol.for("react.suspense"),UM=Symbol.for("react.suspense_list"),_g=Symbol.for("react.memo"),VM=Symbol.for("react.lazy");var WM=pw,$M=_g;function jM(e){if(typeof e=="object"&&e!==null){let{$$typeof:t}=e;switch(t){case NM:switch(e=e.type,e){case LM:case FM:case DM:case BM:case UM:return e;default:switch(e=e&&e.$$typeof,e){case HM:case pw:case VM:case _g:return e;case zM:return e;default:return t}}case OM:return t}}}function KM(e){return jM(e)===_g}function GM(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:i,areStatePropsEqual:s}){let a=!1,l,c,u,f,d;function p(y,S){return l=y,c=S,u=e(l,c),f=t(r,c),d=n(u,f,c),a=!0,d}function m(){return u=e(l,c),t.dependsOnOwnProps&&(f=t(r,c)),d=n(u,f,c),d}function g(){return e.dependsOnOwnProps&&(u=e(l,c)),t.dependsOnOwnProps&&(f=t(r,c)),d=n(u,f,c),d}function v(){let y=e(l,c),S=!s(y,u);return u=y,S&&(d=n(u,f,c)),d}function h(y,S){let x=!i(S,c),T=!o(y,l,S,c);return l=y,c=S,x&&T?m():x?g():T?v():d}return function(S,x){return a?h(S,x):p(S,x)}}function qM(e,i){var s=i,{initMapStateToProps:t,initMapDispatchToProps:n,initMergeProps:r}=s,o=ie(s,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]);let a=t(e,o),l=n(e,o),c=r(e,o);return GM(a,l,c,e,o)}function YM(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 Ig(e){return function(n){let r=e(n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function aw(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:e.length!==1}function mw(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=aw(e);let c=i(a,l);return typeof c=="function"&&(i.mapToProps=c,i.dependsOnOwnProps=aw(c),c=i(a,l)),c},i}}function Mg(e,t){return(n,r)=>{throw new Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function XM(e){return e&&typeof e=="object"?Ig(t=>YM(e,t)):e?typeof e=="function"?mw(e,"mapDispatchToProps"):Mg(e,"mapDispatchToProps"):Ig(t=>({dispatch:t}))}function QM(e){return e?typeof e=="function"?mw(e,"mapStateToProps"):Mg(e,"mapStateToProps"):Ig(()=>({}))}function ZM(e,t,n){return E(E(E({},n),e),t)}function JM(e){return function(n,{displayName:r,areMergedPropsEqual:o}){let i=!1,s;return function(l,c,u){let f=e(l,c,u);return i?o(f,s)||(s=f):(i=!0,s=f),s}}}function eN(e){return e?typeof e=="function"?JM(e):Mg(e,"mergeProps"):()=>ZM}function tN(e){e()}function nN(){let e=null,t=null;return{clear(){e=null,t=null},notify(){tN(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){let n=[],r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0,o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!r||e===null||(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var lw={notify(){},get:()=>[]};function gw(e,t){let n,r=lw,o=0,i=!1;function s(g){u();let v=r.subscribe(g),h=!1;return()=>{h||(h=!0,v(),f())}}function a(){r.notify()}function l(){m.onStateChange&&m.onStateChange()}function c(){return i}function u(){o++,n||(n=t?t.addNestedSub(l):e.subscribe(l),r=nN())}function f(){o--,n&&o===0&&(n(),n=void 0,r.clear(),r=lw)}function d(){i||(i=!0,u())}function p(){i&&(i=!1,f())}let m={addNestedSub:s,notifyNestedSubs:a,handleChangeWrapper:l,isSubscribed:c,trySubscribe:d,tryUnsubscribe:p,getListeners:()=>r};return m}var rN=()=>typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",oN=rN(),iN=()=>typeof navigator!="undefined"&&navigator.product==="ReactNative",sN=iN(),aN=()=>oN||sN?le.useLayoutEffect:le.useEffect,Ku=aN();function cw(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function kg(e,t){if(cw(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])||!cw(e[n[o]],t[n[o]]))return!1;return!0}var lN={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cN={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},uN={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},hw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},dN={[WM]:uN,[$M]:hw};function uw(e){return KM(e)?hw:dN[e.$$typeof]||lN}var fN=Object.defineProperty,pN=Object.getOwnPropertyNames,dw=Object.getOwnPropertySymbols,mN=Object.getOwnPropertyDescriptor,gN=Object.getPrototypeOf,fw=Object.prototype;function Ag(e,t){if(typeof t!="string"){if(fw){let i=gN(t);i&&i!==fw&&Ag(e,i)}let n=pN(t);dw&&(n=n.concat(dw(t)));let r=uw(e),o=uw(t);for(let i=0;i<n.length;++i){let s=n[i];if(!cN[s]&&!(o&&o[s])&&!(r&&r[s])){let a=mN(t,s);try{fN(e,s,a)}catch(l){}}}}return e}var Rg=Symbol.for("react-redux-context"),Pg=typeof globalThis!="undefined"?globalThis:{};function hN(){var n;if(!le.createContext)return{};let e=(n=Pg[Rg])!=null?n:Pg[Rg]=new Map,t=e.get(le.createContext);return t||(t=le.createContext(null),e.set(le.createContext,t)),t}var Xr=hN(),yN=[null,null];function vN(e,t,n){Ku(()=>e(...t),n)}function SN(e,t,n,r,o,i){e.current=r,n.current=!1,o.current&&(o.current=null,i())}function xN(e,t,n,r,o,i,s,a,l,c,u){if(!e)return()=>{};let f=!1,d=null,p=()=>{if(f||!a.current)return;let g=t.getState(),v,h;try{v=r(g,o.current)}catch(y){h=y,d=y}h||(d=null),v===i.current?s.current||c():(i.current=v,l.current=v,s.current=!0,u())};return n.onStateChange=p,n.trySubscribe(),p(),()=>{if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}function wN(e,t){return e===t}function bN(e,t,n,{pure:r,areStatesEqual:o=wN,areOwnPropsEqual:i=kg,areStatePropsEqual:s=kg,areMergedPropsEqual:a=kg,forwardRef:l=!1,context:c=Xr}={}){let u=c,f=QM(e),d=XM(t),p=eN(n),m=!!e;return v=>{let h=v.displayName||v.name||"Component",y=`Connect(${h})`,S={shouldHandleStateChanges:m,displayName:y,wrappedComponentName:h,WrappedComponent:v,initMapStateToProps:f,initMapDispatchToProps:d,initMergeProps:p,areStatesEqual:o,areStatePropsEqual:s,areOwnPropsEqual:i,areMergedPropsEqual:a};function x(k){let[R,F,O]=le.useMemo(()=>{let me=k,{reactReduxForwardedRef:oe}=me,re=ie(me,["reactReduxForwardedRef"]);return[k.context,oe,re]},[k]),U=le.useMemo(()=>{let oe=u;return R!=null&&R.Consumer,oe},[R,u]),J=le.useContext(U),Y=!!k.store&&!!k.store.getState&&!!k.store.dispatch,_=!!J&&!!J.store,V=Y?k.store:J.store,B=_?J.getServerState:V.getState,W=le.useMemo(()=>qM(V.dispatch,S),[V]),[N,q]=le.useMemo(()=>{if(!m)return yN;let oe=gw(V,Y?void 0:J.subscription),re=oe.notifyNestedSubs.bind(oe);return[oe,re]},[V,Y,J]),j=le.useMemo(()=>Y?J:A(E({},J),{subscription:N}),[Y,J,N]),K=le.useRef(void 0),ue=le.useRef(O),ne=le.useRef(void 0),Qe=le.useRef(!1),Se=le.useRef(!1),tt=le.useRef(void 0);Ku(()=>(Se.current=!0,()=>{Se.current=!1}),[]);let pt=le.useMemo(()=>()=>ne.current&&O===ue.current?ne.current:W(V.getState(),O),[V,O]),Le=le.useMemo(()=>re=>N?xN(m,V,N,W,ue,K,Qe,Se,ne,q,re):()=>{},[N]);vN(SN,[ue,K,Qe,O,ne,q]);let Ne;try{Ne=le.useSyncExternalStore(Le,pt,B?()=>W(B(),O):pt)}catch(oe){throw tt.current&&(oe.message+=`
9
9
  The error may be correlated with this previous error:
10
10
  ${tt.current.stack}
11
11
 
12
- `),oe}Uu(()=>{tt.current=void 0,te.current=void 0,K.current=Me});let at=ae.useMemo(()=>ae.createElement(S,I(b({},Me),{ref:H})),[H,S,Me]);return ae.useMemo(()=>h?ae.createElement(B.Provider,{value:$},at):at,[B,at,$])}let T=ae.memo(x);if(T.WrappedComponent=S,T.displayName=x.displayName=g,l){let A=ae.forwardRef(function(D,B){return ae.createElement(T,I(b({},D),{reactReduxForwardedRef:B}))});return A.displayName=g,A.WrappedComponent=S,hg(A,S)}return hg(T,S)}}var tw=eM;function tM(e){let{children:t,context:n,serverState:r,store:o}=e,s=ae.useMemo(()=>{let l=Jx(o);return{store:o,subscription:l,getServerState:r?()=>r:void 0}},[o,r]),i=ae.useMemo(()=>o.getState(),[o]);return Uu(()=>{let{subscription:l}=s;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),i!==o.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[s,i]),ae.createElement((n||Gr).Provider,{value:s},t)}var nw=tM;function Sg(e=Gr){return function(){return ae.useContext(e)}}var rw=Sg();function ow(e=Gr){let t=e===Gr?rw:Sg(e),n=()=>{let{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var nM=ow();function rM(e=Gr){let t=e===Gr?nM:ow(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var be=rM(),oM=(e,t)=>e===t;function sM(e=Gr){let t=e===Gr?rw:Sg(e),n=(r,o={})=>{let{equalityFn:s=oM}=typeof o=="function"?{equalityFn:o}:o,i=t(),{store:a,subscription:l,getServerState:c}=i,u=ae.useRef(!0),f=ae.useCallback({[r.name](p){return r(p)}}[r.name],[r]),d=(0,sw.useSyncExternalStoreWithSelector)(l.addNestedSub,a.getState,c||a.getState,f,s);return ae.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var G=sM();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 iM=typeof Symbol=="function"&&Symbol.observable||"@@observable",iw=iM,xg=()=>Math.random().toString(36).substring(7).split("").join("."),aM={INIT:`@@redux/INIT${xg()}`,REPLACE:`@@redux/REPLACE${xg()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${xg()}`},Vu=aM;function ju(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function wg(e,t,n){if(typeof e!="function")throw new Error(Tt(2));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(wg)(e,t)}let r=e,o=t,s=new Map,i=s,a=0,l=!1;function c(){i===s&&(i=new Map,s.forEach((S,y)=>{i.set(y,S)}))}function u(){if(l)throw new Error(Tt(3));return o}function f(S){if(typeof S!="function")throw new Error(Tt(4));if(l)throw new Error(Tt(5));let y=!0;c();let g=a++;return i.set(g,S),function(){if(y){if(l)throw new Error(Tt(6));y=!1,c(),i.delete(g),s=null}}}function d(S){if(!ju(S))throw new Error(Tt(7));if(typeof S.type=="undefined")throw new Error(Tt(8));if(typeof S.type!="string")throw new Error(Tt(17));if(l)throw new Error(Tt(9));try{l=!0,o=r(o,S)}finally{l=!1}return(s=i).forEach(g=>{g()}),S}function p(S){if(typeof S!="function")throw new Error(Tt(10));r=S,d({type:Vu.REPLACE})}function h(){let S=f;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Tt(11));function g(){let x=y;x.next&&x.next(u())}return g(),{unsubscribe:S(g)}},[iw](){return this}}}return d({type:Vu.INIT}),{dispatch:d,subscribe:f,getState:u,replaceReducer:p,[iw]:h}}function lM(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:Vu.INIT})=="undefined")throw new Error(Tt(12));if(typeof n(void 0,{type:Vu.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(Tt(13))})}function Wu(e){let t=Object.keys(e),n={};for(let i=0;i<t.length;i++){let a=t[i];typeof e[a]=="function"&&(n[a]=e[a])}let r=Object.keys(n),o,s;try{lM(n)}catch(i){s=i}return function(a={},l){if(s)throw s;let c=!1,u={};for(let f=0;f<r.length;f++){let d=r[f],p=n[d],h=a[d],m=p(h,l);if(typeof m=="undefined"){let S=l&&l.type;throw new Error(Tt(14))}u[d]=m,c=c||m!==h}return c=c||r.length!==Object.keys(a).length,c?u:a}}function il(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function aw(...e){return t=>(n,r)=>{let o=t(n,r),s=()=>{throw new Error(Tt(15))},i={getState:o.getState,dispatch:(l,...c)=>s(l,...c)},a=e.map(l=>l(i));return s=il(...a)(o.dispatch),I(b({},o),{dispatch:s})}}function lw(e){return ju(e)&&"type"in e&&typeof e.type=="string"}var gw=Symbol.for("immer-nothing"),cw=Symbol.for("immer-draftable"),En=Symbol.for("immer-state");function Zn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var al=Object.getPrototypeOf;function Lo(e){return!!e&&!!e[En]}function kr(e){var t;return e?hw(e)||Array.isArray(e)||!!e[cw]||!!((t=e.constructor)!=null&&t[cw])||ul(e)||Xu(e):!1}var cM=Object.prototype.constructor.toString(),uw=new WeakMap;function hw(e){if(!e||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;let n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=uw.get(n);return r===void 0&&(r=Function.toString.call(n),uw.set(n,r)),r===cM}function Ku(e,t,n=!0){Yu(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((r,o)=>t(o,r,e))}function Yu(e){let t=e[En];return t?t.type_:Array.isArray(e)?1:ul(e)?2:Xu(e)?3:0}function Cg(e,t){return Yu(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function yw(e,t,n){let r=Yu(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function uM(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ul(e){return e instanceof Map}function Xu(e){return e instanceof Set}function Is(e){return e.copy_||e.base_}function Tg(e,t){if(ul(e))return new Map(e);if(Xu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let n=hw(e);if(t===!0||t==="class_only"&&!n){let r=Object.getOwnPropertyDescriptors(e);delete r[En];let o=Reflect.ownKeys(r);for(let s=0;s<o.length;s++){let i=o[s],a=r[i];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(r[i]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[i]})}return Object.create(al(e),r)}else{let r=al(e);if(r!==null&&n)return b({},e);let o=Object.create(r);return Object.assign(o,e)}}function _g(e,t=!1){return Qu(e)||Lo(e)||!kr(e)||(Yu(e)>1&&Object.defineProperties(e,{set:$u,add:$u,clear:$u,delete:$u}),Object.freeze(e),t&&Object.values(e).forEach(n=>_g(n,!0))),e}function dM(){Zn(2)}var $u={value:dM};function Qu(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var fM={};function As(e){let t=fM[e];return t||Zn(0,e),t}var ll;function vw(){return ll}function pM(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function dw(e,t){t&&(As("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function kg(e){Rg(e),e.drafts_.forEach(mM),e.drafts_=null}function Rg(e){e===ll&&(ll=e.parent_)}function fw(e){return ll=pM(ll,e)}function mM(e){let t=e[En];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function pw(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];return e!==void 0&&e!==n?(n[En].modified_&&(kg(t),Zn(4)),kr(e)&&(e=Gu(t,e),t.parent_||qu(t,e)),t.patches_&&As("Patches").generateReplacementPatches_(n[En].base_,e,t.patches_,t.inversePatches_)):e=Gu(t,n,[]),kg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gw?e:void 0}function Gu(e,t,n){if(Qu(t))return t;let r=e.immer_.shouldUseStrictIteration(),o=t[En];if(!o)return Ku(t,(s,i)=>mw(e,o,t,s,i,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return qu(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;let s=o.copy_,i=s,a=!1;o.type_===3&&(i=new Set(s),s.clear(),a=!0),Ku(i,(l,c)=>mw(e,o,s,l,c,n,a),r),qu(e,s,!1),n&&e.patches_&&As("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function mw(e,t,n,r,o,s,i){if(o==null||typeof o!="object"&&!i)return;let a=Qu(o);if(!(a&&!i)){if(Lo(o)){let l=s&&t&&t.type_!==3&&!Cg(t.assigned_,r)?s.concat(r):void 0,c=Gu(e,o,l);if(yw(n,r,c),Lo(c))e.canAutoFreeze_=!1;else return}else i&&n.add(o);if(kr(o)&&!a){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===o&&a)return;Gu(e,o),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(ul(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&qu(e,o)}}}function qu(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_g(t,n)}function gM(e,t){let n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:vw(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=r,s=Ng;n&&(o=[r],s=cl);let{revoke:i,proxy:a}=Proxy.revocable(o,s);return r.draft_=a,r.revoke_=i,a}var Ng={get(e,t){if(t===En)return e;let n=Is(e);if(!Cg(n,t))return hM(e,n,t);let r=n[t];return e.finalized_||!kr(r)?r:r===bg(e.base_,t)?(Eg(e),e.copy_[t]=Ig(r,e)):r},has(e,t){return t in Is(e)},ownKeys(e){return Reflect.ownKeys(Is(e))},set(e,t,n){let r=Sw(Is(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let o=bg(Is(e),t),s=o==null?void 0:o[En];if(s&&s.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(uM(n,o)&&(n!==void 0||Cg(e.base_,t)))return!0;Eg(e),Pg(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return bg(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Eg(e),Pg(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Is(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Zn(11)},getPrototypeOf(e){return al(e.base_)},setPrototypeOf(){Zn(12)}},cl={};Ku(Ng,(e,t)=>{cl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});cl.deleteProperty=function(e,t){return cl.set.call(this,e,t,void 0)};cl.set=function(e,t,n){return Ng.set.call(this,e[0],t,n,e[0])};function bg(e,t){let n=e[En];return(n?Is(n):e)[t]}function hM(e,t,n){var o;let r=Sw(t,n);return r?"value"in r?r.value:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function Sw(e,t){if(!(t in e))return;let n=al(e);for(;n;){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=al(n)}}function Pg(e){e.modified_||(e.modified_=!0,e.parent_&&Pg(e.parent_))}function Eg(e){e.copy_||(e.copy_=Tg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var yM=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){let s=n;n=t;let i=this;return function(l=s,...c){return i.produce(l,u=>n.call(this,u,...c))}}typeof n!="function"&&Zn(6),r!==void 0&&typeof r!="function"&&Zn(7);let o;if(kr(t)){let s=fw(this),i=Ig(t,void 0),a=!0;try{o=n(i),a=!1}finally{a?kg(s):Rg(s)}return dw(s,r),pw(o,s)}else if(!t||typeof t!="object"){if(o=n(t),o===void 0&&(o=t),o===gw&&(o=void 0),this.autoFreeze_&&_g(o,!0),r){let s=[],i=[];As("Patches").generateReplacementPatches_(t,o,s,i),r(s,i)}return o}else Zn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(i,...a)=>this.produceWithPatches(i,l=>t(l,...a));let r,o;return[this.produce(t,n,(i,a)=>{r=i,o=a}),r,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){kr(e)||Zn(8),Lo(e)&&(e=xw(e));let t=fw(this),n=Ig(e,void 0);return n[En].isManual_=!0,Rg(t),n}finishDraft(e,t){let n=e&&e[En];(!n||!n.isManual_)&&Zn(9);let{scope_:r}=n;return dw(r,t),pw(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let r=As("Patches").applyPatches_;return Lo(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Ig(e,t){let n=ul(e)?As("MapSet").proxyMap_(e,t):Xu(e)?As("MapSet").proxySet_(e,t):gM(e,t);return(t?t.scope_:vw()).drafts_.push(n),n}function xw(e){return Lo(e)||Zn(10,e),ww(e)}function ww(e){if(!kr(e)||Qu(e))return e;let t=e[En],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Tg(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Tg(e,!0);return Ku(n,(o,s)=>{yw(n,o,ww(s))},r),t&&(t.finalized_=!1),n}var Ag=new yM,Mg=Ag.produce;var bw=Ag.setUseStrictIteration.bind(Ag);function vM(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function SM(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function xM(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){let n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Ew=e=>Array.isArray(e)?e:[e];function wM(e){let t=Array.isArray(e[0])?e[0]:e;return xM(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function bM(e,t){let n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var U9=Object.getPrototypeOf({});var EM=class{constructor(e){this.value=e}deref(){return this.value}},CM=typeof WeakRef!="undefined"?WeakRef:EM,TM=0,Cw=1;function Zu(){return{s:TM,v:void 0,o:null,p:null}}function Tw(e,t={}){let n=Zu(),{resultEqualityCheck:r}=t,o,s=0;function i(){var f,d;let a=n,{length:l}=arguments;for(let p=0,h=l;p<h;p++){let m=arguments[p];if(typeof m=="function"||typeof m=="object"&&m!==null){let S=a.o;S===null&&(a.o=S=new WeakMap);let y=S.get(m);y===void 0?(a=Zu(),S.set(m,a)):a=y}else{let S=a.p;S===null&&(a.p=S=new Map);let y=S.get(m);y===void 0?(a=Zu(),S.set(m,a)):a=y}}let c=a,u;if(a.s===Cw)u=a.v;else if(u=e.apply(null,arguments),s++,r){let p=(d=(f=o==null?void 0:o.deref)==null?void 0:f.call(o))!=null?d:o;p!=null&&r(p,u)&&(u=p,s!==0&&s--),o=typeof u=="object"&&u!==null||typeof u=="function"?new CM(u):u}return c.s=Cw,c.v=u,u}return i.clearCache=()=>{n=Zu(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function kM(e,...t){let n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let s=0,i=0,a,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),vM(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let u=b(b({},n),l),{memoize:f,memoizeOptions:d=[],argsMemoize:p=Tw,argsMemoizeOptions:h=[],devModeChecks:m={}}=u,S=Ew(d),y=Ew(h),g=wM(o),v=f(function(){return s++,c.apply(null,arguments)},...S),x=!0,C=p(function(){i++;let k=bM(g,arguments);return a=v.apply(null,k),a},...y);return Object.assign(C,{resultFunc:c,memoizedResultFunc:v,dependencies:g,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var Gt=kM(Tw),RM=Object.assign((e,t=Gt)=>{SM(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e),r=n.map(s=>e[s]);return t(r,(...s)=>s.reduce((i,a,l)=>(i[n[l]]=a,i),{}))},{withTypes:()=>RM});function kw(e){return({dispatch:n,getState:r})=>o=>s=>typeof s=="function"?s(n,r,e):o(s)}var Rw=kw(),Pw=kw;var PM=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?il:il.apply(null,arguments)},X9=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},IM=e=>e&&typeof e.match=="function";function kt(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(qr(0));return b(b({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>lw(r)&&r.type===e,n}var Mw=class dl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,dl.prototype)}static get[Symbol.species](){return dl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new dl(...t[0].concat(this)):new dl(...t.concat(this))}};function Iw(e){return kr(e)?Mg(e,()=>{}):e}function Ju(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function AM(e){return typeof e=="boolean"}var _M=()=>function(t){let{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:s=!0}=t!=null?t:{},i=new Mw;return n&&(AM(n)?i.push(Rw):i.push(Pw(n.extraArgument))),i},NM="RTK_autoBatch";var Aw=e=>t=>{setTimeout(t,e)},MM=(e={type:"raf"})=>t=>(...n)=>{let r=t(...n),o=!0,s=!1,i=!1,a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window!="undefined"&&window.requestAnimationFrame?window.requestAnimationFrame:Aw(10):e.type==="callback"?e.queueNotification:Aw(e.timeout),c=()=>{i=!1,s&&(s=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){let f=()=>o&&u(),d=r.subscribe(f);return a.add(u),()=>{d(),a.delete(u)}},dispatch(u){var f;try{return o=!((f=u==null?void 0:u.meta)!=null&&f[NM]),s=!o,s&&(i||(i=!0,l(c))),r.dispatch(u)}finally{o=!0}}})},LM=e=>function(n){let{autoBatch:r=!0}=n!=null?n:{},o=new Mw(e);return r&&o.push(MM(typeof r=="object"?r:void 0)),o};function Lw(e){let t=_M(),{reducer:n=void 0,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{},l;if(typeof n=="function")l=n;else if(ju(n))l=Wu(n);else throw new Error(qr(1));let c;typeof r=="function"?c=r(t):c=t();let u=il;o&&(u=PM(b({trace:!1},typeof o=="object"&&o)));let f=aw(...c),d=LM(f),p=typeof a=="function"?a(d):d(),h=u(...p);return wg(l,i,h)}function Ow(e){let t={},n=[],r,o={addCase(s,i){let a=typeof s=="string"?s:s.type;if(!a)throw new Error(qr(28));if(a in t)throw new Error(qr(29));return t[a]=i,o},addAsyncThunk(s,i){return i.pending&&(t[s.pending.type]=i.pending),i.rejected&&(t[s.rejected.type]=i.rejected),i.fulfilled&&(t[s.fulfilled.type]=i.fulfilled),i.settled&&n.push({matcher:s.settled,reducer:i.settled}),o},addMatcher(s,i){return n.push({matcher:s,reducer:i}),o},addDefaultCase(s){return r=s,o}};return e(o),[t,n,r]}bw(!1);function OM(e){return typeof e=="function"}function DM(e,t){let[n,r,o]=Ow(t),s;if(OM(e))s=()=>Iw(e());else{let a=Iw(e);s=()=>a}function i(a=s(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[o]),c.reduce((u,f)=>{if(f)if(Lo(u)){let p=f(u,l);return p===void 0?u:p}else{if(kr(u))return Mg(u,d=>f(d,l));{let d=f(u,l);if(d===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return u},a)}return i.getInitialState=s,i}var FM=(e,t)=>IM(e)?e.match(t):e(t);function zM(...e){return t=>e.some(n=>FM(n,t))}var HM="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",BM=(e=21)=>{let t="",n=e;for(;n--;)t+=HM[Math.random()*64|0];return t},UM=["name","message","stack","code"],Lg=class{constructor(e,t){Te(this,"_type");this.payload=e,this.meta=t}},_w=class{constructor(e,t){Te(this,"_type");this.payload=e,this.meta=t}},VM=e=>{if(typeof e=="object"&&e!==null){let t={};for(let n of UM)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Nw="External signal was aborted",pe=(()=>{function e(t,n,r){let o=kt(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:I(b({},f||{}),{arg:u,requestId:c,requestStatus:"fulfilled"})})),s=kt(t+"/pending",(l,c,u)=>({payload:void 0,meta:I(b({},u||{}),{arg:c,requestId:l,requestStatus:"pending"})})),i=kt(t+"/rejected",(l,c,u,f,d)=>({payload:f,error:(r&&r.serializeError||VM)(l||"Rejected"),meta:I(b({},d||{}),{arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"})}));function a(l,{signal:c}={}){return(u,f,d)=>{let p=r!=null&&r.idGenerator?r.idGenerator(l):BM(),h=new AbortController,m,S;function y(v){S=v,h.abort()}c&&(c.aborted?y(Nw):c.addEventListener("abort",()=>y(Nw),{once:!0}));let g=(function(){return N(this,null,function*(){var C,T;let v;try{let k=(C=r==null?void 0:r.condition)==null?void 0:C.call(r,l,{getState:f,extra:d});if(WM(k)&&(k=yield k),k===!1||h.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let A=new Promise((H,D)=>{m=()=>{D({name:"AbortError",message:S||"Aborted"})},h.signal.addEventListener("abort",m)});u(s(p,l,(T=r==null?void 0:r.getPendingMeta)==null?void 0:T.call(r,{requestId:p,arg:l},{getState:f,extra:d}))),v=yield Promise.race([A,Promise.resolve(n(l,{dispatch:u,getState:f,extra:d,requestId:p,signal:h.signal,abort:y,rejectWithValue:(H,D)=>new Lg(H,D),fulfillWithValue:(H,D)=>new _w(H,D)})).then(H=>{if(H instanceof Lg)throw H;return H instanceof _w?o(H.payload,p,l,H.meta):o(H,p,l)})])}catch(k){v=k instanceof Lg?i(null,p,l,k.payload,k.meta):i(k,p,l)}finally{m&&h.signal.removeEventListener("abort",m)}return r&&!r.dispatchConditionRejection&&i.match(v)&&v.meta.condition||u(v),v})})();return Object.assign(g,{abort:y,requestId:p,arg:l,unwrap(){return g.then(jM)}})}}return Object.assign(a,{pending:s,rejected:i,fulfilled:o,settled:zM(i,o),typePrefix:t})}return e.withTypes=()=>e,e})();function jM(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function WM(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var Dw=Symbol.for("rtk-slice-createasyncthunk"),Z9={[Dw]:pe};function $M(e,t){return`${e}/${t}`}function KM({creators:e}={}){var n;let t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[Dw];return function(o){let{name:s,reducerPath:i=s}=o;if(!s)throw new Error(qr(11));let a=(typeof o.reducers=="function"?o.reducers(qM()):o.reducers)||{},l=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(x,C){let T=typeof x=="string"?x:x.type;if(!T)throw new Error(qr(12));if(T in c.sliceCaseReducersByType)throw new Error(qr(13));return c.sliceCaseReducersByType[T]=C,u},addMatcher(x,C){return c.sliceMatchers.push({matcher:x,reducer:C}),u},exposeAction(x,C){return c.actionCreators[x]=C,u},exposeCaseReducer(x,C){return c.sliceCaseReducersByName[x]=C,u}};l.forEach(x=>{let C=a[x],T={reducerName:x,type:$M(s,x),createNotation:typeof o.reducers=="function"};XM(C)?ZM(T,C,u,t):YM(T,C,u)});function f(){let[x={},C=[],T=void 0]=typeof o.extraReducers=="function"?Ow(o.extraReducers):[o.extraReducers],k=b(b({},x),c.sliceCaseReducersByType);return DM(o.initialState,A=>{for(let H in k)A.addCase(H,k[H]);for(let H of c.sliceMatchers)A.addMatcher(H.matcher,H.reducer);for(let H of C)A.addMatcher(H.matcher,H.reducer);T&&A.addDefaultCase(T)})}let d=x=>x,p=new Map,h=new WeakMap,m;function S(x,C){return m||(m=f()),m(x,C)}function y(){return m||(m=f()),m.getInitialState()}function g(x,C=!1){function T(A){let H=A[x];return typeof H=="undefined"&&C&&(H=Ju(h,T,y)),H}function k(A=d){let H=Ju(p,C,()=>new WeakMap);return Ju(H,A,()=>{var B;let D={};for(let[J,Y]of Object.entries((B=o.selectors)!=null?B:{}))D[J]=GM(Y,A,()=>Ju(h,A,y),C);return D})}return{reducerPath:x,getSelectors:k,get selectors(){return k(T)},selectSlice:T}}let v=I(b({name:s,reducer:S,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y},g(i)),{injectInto(x,k={}){var A=k,{reducerPath:C}=A,T=se(A,["reducerPath"]);let H=C!=null?C:i;return x.inject({reducerPath:H,reducer:S},T),b(b({},v),g(H,!0))}});return v}}function GM(e,t,n,r){function o(s,...i){let a=t(s);return typeof a=="undefined"&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var Re=KM();function qM(){function e(t,n){return b({_reducerDefinitionType:"asyncThunk",payloadCreator:t},n)}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function YM({type:e,reducerName:t,createNotation:n},r,o){let s,i;if("reducer"in r){if(n&&!QM(r))throw new Error(qr(17));s=r.reducer,i=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,i?kt(e,i):kt(e))}function XM(e){return e._reducerDefinitionType==="asyncThunk"}function QM(e){return e._reducerDefinitionType==="reducerWithPrepare"}function ZM({type:e,reducerName:t},n,r,o){if(!o)throw new Error(qr(18));let{payloadCreator:s,fulfilled:i,pending:a,rejected:l,settled:c,options:u}=n,f=o(e,s,u);r.exposeAction(t,f),i&&r.addCase(f.fulfilled,i),a&&r.addCase(f.pending,a),l&&r.addCase(f.rejected,l),c&&r.addMatcher(f.settled,c),r.exposeCaseReducer(t,{fulfilled:i||ed,pending:a||ed,rejected:l||ed,settled:c||ed})}function ed(){}var Fw="listener",zw="completed",Hw="cancelled",J9=`task-${Hw}`,e8=`task-${zw}`,t8=`${Fw}-${Hw}`,n8=`${Fw}-${zw}`;var{assign:Bw}=Object;var Og="listenerMiddleware";var JM=Bw(kt(`${Og}/add`),{withTypes:()=>JM}),r8=kt(`${Og}/removeAll`),eL=Bw(kt(`${Og}/remove`),{withTypes:()=>eL});function qr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var fl=(n=>(n.NL_NL="nl-NL",n.EN_US="en-US",n))(fl||{});var tL={isLoggedIn:null,loginFetchState:"idle",verifyFetchState:"idle",showLoginOverlay:!1,loginError:null},Rt=e=>e.auth.isLoggedIn;var Uw=e=>e.auth.verifyFetchState,Vw=e=>e.auth.showLoginOverlay,jw=e=>e.auth.loginError,Yr=pe("auth/validate",(e,t)=>N(null,null,function*(){return t.extra.deepdeskAPI.isLoggedIn()})),Ww=pe("auth/requestLogin",(n,r)=>N(null,[n,r],function*({email:e},t){let{deepdeskAPI:o}=t.extra;return o.requestLoginByEmail(e)})),Dg=pe("auth/loginWithPassword",(r,o)=>N(null,[r,o],function*({username:e,password:t},n){let{deepdeskAPI:s}=n.extra;return s.loginWithPassword(e,t)})),td=pe("auth/logout",(e,t)=>N(null,null,function*(){let{deepdeskAPI:n}=t.extra;yield n.logout()})),pl=pe("auth/verifyLoginToken",(n,r)=>N(null,[n,r],function*({token:e},t){let{deepdeskAPI:o}=t.extra;return o.verifyLoginToken(e)})),$w=Re({name:"auth",initialState:tL,reducers:{setIsLoggedIn(e,t){e.isLoggedIn=t.payload},setShowLoginOverlay(e,t){e.showLoginOverlay=t.payload},setLoginError(e,t){e.loginError=t.payload},clearLoginError(e){e.loginError=null}},extraReducers:e=>{e.addCase(Yr.pending,t=>{t.loginFetchState="loading"}),e.addCase(Yr.fulfilled,(t,{payload:n})=>{t.isLoggedIn=n,t.loginFetchState="done"}),e.addCase(Yr.rejected,t=>{t.loginFetchState="error",t.isLoggedIn=!1}),e.addCase(Dg.pending,t=>{t.loginFetchState="loading",t.loginError=null}),e.addCase(Dg.fulfilled,t=>{t.isLoggedIn=!0,t.loginFetchState="done",t.loginError=null,t.showLoginOverlay=!1}),e.addCase(Dg.rejected,(t,n)=>{t.loginFetchState="error",t.isLoggedIn=!1,t.loginError=n.error.message==="Bad Request"?"Invalid credentials":"Login failed"}),e.addCase(td.fulfilled,t=>{t.isLoggedIn=!1,t.loginFetchState="idle",t.loginError=null}),e.addCase(td.rejected,t=>{t.isLoggedIn=!1,t.loginFetchState="error"}),e.addCase(pl.pending,t=>{t.verifyFetchState="loading"}),e.addCase(pl.rejected,t=>{t.verifyFetchState="error"}),e.addCase(pl.fulfilled,(t,n)=>{n.payload.isLoggedIn?t.verifyFetchState="done":t.verifyFetchState="error"})}}),{setIsLoggedIn:Fi,setShowLoginOverlay:Kw,setLoginError:Fg,clearLoginError:nd}=$w.actions,Gw=$w.reducer;var ml=class{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);let s=this.castInput(t,r),i=this.castInput(n,r),a=this.removeEmpty(this.tokenize(s,r)),l=this.removeEmpty(this.tokenize(i,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var s;let i=g=>{if(g=this.postProcess(g,r),o){setTimeout(function(){o(g)},0);return}else return g},a=n.length,l=t.length,c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));let f=(s=r.timeout)!==null&&s!==void 0?s:1/0,d=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(p[0],n,t,0,r);if(p[0].oldPos+1>=l&&h+1>=a)return i(this.buildValues(p[0].lastComponent,n,t));let m=-1/0,S=1/0,y=()=>{for(let g=Math.max(m,-c);g<=Math.min(S,c);g+=2){let v,x=p[g-1],C=p[g+1];x&&(p[g-1]=void 0);let T=!1;if(C){let A=C.oldPos-g;T=C&&0<=A&&A<a}let k=x&&x.oldPos+1<l;if(!T&&!k){p[g]=void 0;continue}if(!k||T&&x.oldPos<C.oldPos?v=this.addToPath(C,!0,!1,0,r):v=this.addToPath(x,!1,!0,1,r),h=this.extractCommon(v,n,t,g,r),v.oldPos+1>=l&&h+1>=a)return i(this.buildValues(v.lastComponent,n,t))||!0;p[g]=v,v.oldPos+1>=l&&(S=Math.min(S,g-1)),h+1>=a&&(m=Math.max(m,g+1))}c++};if(o)(function g(){setTimeout(function(){if(c>u||Date.now()>d)return o(void 0);y()||g()},0)})();else for(;c<=u&&Date.now()<=d;){let g=y();if(g)return g}}addToPath(t,n,r,o,s){let i=t.lastComponent;return i&&!s.oneChangePerToken&&i.added===n&&i.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:i.count+1,added:n,removed:r,previousComponent:i.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:i}}}extractCommon(t,n,r,o,s){let i=n.length,a=r.length,l=t.oldPos,c=l-o,u=0;for(;c+1<i&&l+1<a&&this.equals(r[l+1],n[c+1],s);)c++,l++,u++,s.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!s.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let o=[],s;for(;t;)o.push(t),s=t.previousComponent,delete t.previousComponent,t=s;o.reverse();let i=o.length,a=0,l=0,c=0;for(;a<i;a++){let u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=n.slice(l,l+u.count);f=f.map(function(d,p){let h=r[c+p];return h.length>d.length?h:d}),u.value=this.join(f)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}};var zg=class extends ml{},qw=new zg;function Hg(e,t,n){return qw.diff(e,t,n)}function Yw(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function Oo(e,t,n=10){let r=typeof e,o=typeof t;if(n===0)throw new Error("Max depth deepEqual, possible circular references?");return r!==o?!1:e==null||r==="string"||r==="number"||r==="boolean"?e===t:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:e.every((s,i)=>Oo(s,t[i],n-1)):Yw(e)&&Yw(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(i=>Oo(e[i],t[i],n-1)):!1}function nL(e){return Math.max(...e.map(t=>t.length))}function rL(e,t){let n=e.reduce((r,o)=>{if(o){let s=r[o]?r[o]+1:1;return I(b({},r),{[o]:s})}return r},{});return Object.keys(n).reduce((r,o)=>(n[o]<t&&r.push(o),r),[])}function Xw(e,t){let r=[...e.map(({text:o})=>o.split(/\b(\w+)\b/))];for(let o=0;o<nL(r);o++){let s=rL(r.map(a=>a[o]),t),i=r.filter(a=>!s.includes(a[o]));if(i.length>=t)r=i;else return{text:r[0].slice(0,o).join("").replace(/ (\?| |!|\.|,|\n)/g,"$1").trimEnd(),source:"mixed"}}}var oL=2;function Qw(e,t=""){if(e.length===0)return;if(e.length===1)return e[0];let n=Xw(e,oL);return n&&n.text!==t?n:e[0]}var sL={info(...e){console.info("[Deepdesk]",...e)},warn(...e){console.warn("[Deepdesk]",...e)},error(...e){console.error("[Deepdesk]",...e)}},ee=sL;var Zw={current:null,isSupported:null},lt=kt("resetConversation"),rd=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.externalId)||null},Rr=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.id)||null},zi=e=>e.conversation.isSupported,Bg=pe("conversation/isSupported",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.isConversationSupported(e.externalId,e.options)}),od=pe("conversation/create",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.createConversation(e)}),sd=pe("conversation/byExternalId",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationByExternalId(e.externalId,e.options)}),id=pe("conversation/update",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Rr(t.getState());if(!r)throw new Error("No current conversation to update");return n.updateConversation(r,e)}),Ug=pe("conversation/upsert",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationByExternalId(e.externalId).catch(()=>null).then(r=>{if(!r)return n.createConversation(e);let{agentId:o,agentName:s,agentEmail:i,agentNickname:a,metadata:l}=e;return n.updateConversation(r.id,{agentId:o,agentEmail:i,agentName:s,agentNickname:a,metadata:l})})}),Vg=pe("conversation/postMessages",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Rr(t.getState());if(!r)throw new Error("No current conversation to update messages");return n.postMessages(r,e.map(o=>b({},o)))}),iL=[od.rejected,sd.rejected,id.rejected,Vg.rejected].map(e=>e==null?void 0:e.toString());function aL(e){return iL.includes(e.type)}var lL=Re({name:"conversation",initialState:Zw,reducers:{},extraReducers:e=>{e.addCase(Bg.fulfilled,(t,n)=>{t.isSupported=n.payload}).addCase(od.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(sd.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(Ug.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(id.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(lt,()=>Zw).addMatcher(aL,(t,n)=>{var r;throw ee.info("Conversation action rejected",n.type,((r=n.error)==null?void 0:r.message)||"No message"),new Error(n.error.message)})}}),Jw=lL.reducer;var _s={text:"",html:null,suggestionTextStart:0,selection:{start:0,end:0},beforeInputChange:null,mixedSuggestion:null,textSuggestions:[],pinnedSuggestions:[],selectedSuggestionIndex:-1,metrics:{numCharsTyped:0,numCharsPasted:0,numCharsCut:0,numCharsDeleted:0,numPaste:0,agentStartedTypingTimestamp:null,externalTimeTotalSeconds:null,pastes:[],deletions:[],offeredTextSuggestions:[],textSuggestions:[],cuts:[]}};function jg(e){let{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:s}=e;return{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:s}}var ad=kt("input/applyImageSuggestion"),eb=Re({name:"input",initialState:_s,reducers:{setInput(e,t){var i,a;let{beforeInputChange:n}=e,{text:r,html:o,suggestionTextStart:s}=t.payload;if(e.text=r,e.html=o!=null?o:null,e.suggestionTextStart=r===""?0:Math.max(0,s!=null?s:0),r==="")e.metrics=_s.metrics,e.textSuggestions=[],e.mixedSuggestion=null;else if(n!==null&&e.text!==n.text){let{key:l,shiftKey:c,ctrlKey:u,metaKey:f,altKey:d}=n.keyDown;switch(l){case"Enter":c&&(e.metrics.numCharsTyped+=1);break;case"Backspace":case"Delete":{let{text:p}=e,h=Hg(n.text,p);n.text.length-p.length>1&&e.metrics.deletions.push(...h.filter(m=>m.removed).map(m=>m.value)),e.metrics.numCharsDeleted+=n.text.length-p.length;break}case"Shift":case"Meta":case"Tab":break;case"C":case"V":case"X":case"c":case"v":case"x":if(u||f)break;default:if(!u&&!f&&!d){e.metrics.numCharsTyped+=1;let p=((i=n.selection)==null?void 0:i.start)!==void 0&&((a=n.selection)==null?void 0:a.end)!==void 0?n.text.substring(n.selection.start,n.selection.end):null;p&&p.length>0&&(e.metrics.numCharsDeleted+=p.length,e.metrics.deletions.push(p))}}e.metrics.agentStartedTypingTimestamp||(e.metrics.agentStartedTypingTimestamp=Date.now())}e.beforeInputChange=null},sendMessage(e,t){e.pinnedSuggestions=e.pinnedSuggestions.filter(n=>!e.metrics.textSuggestions.some(r=>r.text===n.text&&r.source===n.source))},setSelection(e,t){t.payload!==null&&(Oo(e.selection,t.payload)||(e.selection=t.payload))},commitSuggestion(e,t){let n=t.payload,{text:r,suggestion:{source:o,abVariant:s,abTestName:i,trainingJobs:a,sourceText:l,searchTerm:c,assistantCode:u,text:f},eventMetrics:{inputType:d},replace:p}=n,h=o==="search"||o==="personal-collection-search",m=r.slice(e.text.substring(0,e.selection.start).length);(h||p==="selection")&&(m=r),n.suggestion.source==="search-overlay"&&(m=f),e.metrics.textSuggestions.push({text:m,source:o,assistantCode:u,abVariant:s,abTestName:i,inputType:d,sourceText:l,trainingJobs:a||[],searchTerm:h?e.text:c}),e.textSuggestions=[],e.selectedSuggestionIndex=-1},offeredTextSuggestion(e,t){let{text:n,suggestion:{source:r}}=t.payload;e.metrics.offeredTextSuggestions.find(s=>s.text===n)||e.metrics.offeredTextSuggestions.push({text:n,source:r})},registerKeyDown(e,t){let{key:n}=t.payload;["Control","Meta","Shift","Alt"].includes(n)||(e.beforeInputChange={text:e.text,selection:e.selection,keyDown:t.payload})},registerKeyUp(e,t){},registerCut(e,t){let{metrics:n}=e,r=t.payload;e.metrics=I(b({},e.metrics),{numCharsCut:n.numCharsCut+r.length,cuts:[...n.cuts,r]})},registerPaste(e,t){let{metrics:n}=e,{text:r,selectionText:o}=t.payload,s=n.numCharsDeleted+(o!=null&&o.length?o.length:0),i=o!=null&&o.length?[...n.deletions,o]:n.deletions;e.metrics=I(b({},e.metrics),{numCharsDeleted:s,deletions:i,numCharsPasted:n.numCharsPasted+r.length,numPaste:n.numPaste+1,pastes:[...n.pastes,r]})},selectNextTextSuggestion(e){let t=e.textSuggestions.length+e.pinnedSuggestions.length;e.selectedSuggestionIndex=e.selectedSuggestionIndex<t-1?e.selectedSuggestionIndex+1:e.selectedSuggestionIndex},selectPreviousTextSuggestion(e){e.selectedSuggestionIndex=e.selectedSuggestionIndex>=0?e.selectedSuggestionIndex-1:e.selectedSuggestionIndex},selectTextSuggestionByIndex(e,t){e.selectedSuggestionIndex=t.payload},setTextSuggestions(e,t){if(e.selectedSuggestionIndex=-1,e.textSuggestions=t.payload,t.payload.length===0){e.mixedSuggestion=null;return}let n=Ns({input:e}),r=Qw(t.payload,n);e.mixedSuggestion=r!=null&&r.text.includes(n)?r:null},setPinnedSuggestions(e,t){e.pinnedSuggestions=t.payload},removePinnedSuggestions(e,t){e.pinnedSuggestions=e.pinnedSuggestions.filter(r=>r.source!==t.payload.source||t.payload.assistantCode&&r.assistantCode!==t.payload.assistantCode?!0:t.payload.text?r.text!==t.payload.text:!1);let n=e.textSuggestions.length+e.pinnedSuggestions.length;e.selectedSuggestionIndex>n-1&&(e.selectedSuggestionIndex=-1)},setMetrics(e,{payload:t}){e.metrics=t},resetMetrics(e){e.metrics=_s.metrics}},extraReducers:e=>{e.addCase(lt,t=>{t.mixedSuggestion=_s.mixedSuggestion,t.textSuggestions=_s.textSuggestions,t.selectedSuggestionIndex=_s.selectedSuggestionIndex,t.metrics=_s.metrics})}}),Ns=e=>{let{text:t,selection:n,suggestionTextStart:r}=e.input;return t.slice(r,n.end)},cL=e=>e.input.mixedSuggestion,uL=e=>e.input.pinnedSuggestions,dL=e=>e.input.textSuggestions,gl=e=>e.input.selectedSuggestionIndex,Ms=Gt([dL,uL],(e,t)=>[...e,...t]),Hi=Gt([Ms,cL,gl],(e,t,n)=>n>-1?e[n]:t),tb=e=>e.input.selection,{commitSuggestion:Cn,offeredTextSuggestion:nb,registerCut:rb,registerKeyDown:ob,registerKeyUp:sb,registerPaste:ib,selectNextTextSuggestion:ab,selectPreviousTextSuggestion:lb,selectTextSuggestionByIndex:ld,setInput:cd,setMetrics:cb,setPinnedSuggestions:Bi,removePinnedSuggestions:Ls,setSelection:ud,setTextSuggestions:Do,resetMetrics:ub,sendMessage:Os}=eb.actions,db=eb.reducer;function fb(e){try{return Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch(t){return!1}}var fL={agentInfo:void 0,agentSettings:{},visitorInfo:void 0,customData:void 0,platformVariables:void 0,fetchState:"idle",showNicknameDialog:!1},Ui=e=>{var t;return(t=e.info.agentInfo)!=null?t:null},pb=e=>{var t;return(t=e.info.visitorInfo)!=null?t:null},mb=e=>{var t;return(t=e.info.customData)!=null?t:null},yl=({info:{visitorInfo:e,agentInfo:t}})=>{var n,r;return{timezone:e!=null&&e.visitorTimeZone&&fb(e.visitorTimeZone)?e.visitorTimeZone:Bx,agentName:(n=t==null?void 0:t.agentNickname)!=null?n:"",visitorName:(r=e==null?void 0:e.visitorName)!=null?r:""}},pL=[["agentNickname","nickname"],["agentDefaultLocale","defaultLocale"],["agentEmail","email"]],gb=pe("info/setAgentNickname",(n,r)=>N(null,[n,r],function*({agentNickname:e},t){var i;let{deepdeskAPI:o}=t.extra,s=yield o.patchMe({nickname:e});return{agentNickname:(i=s==null?void 0:s.nickname)!=null?i:e}})),hl=pe("info/setAgentInfo",(e,t)=>N(null,null,function*(){var s,i,a;let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=[];if(e.agentId&&e.skipSync!==!0&&o.push(n.postIdentity({externalId:e.agentId})),e.skipSync!==!0){let l=pL.reduce((c,[u,f])=>!r[f]&&u in e?I(b({},c),{[f]:e[u]}):c,{});Object.keys(l).length>0&&o.push(n.patchMe(l).then(c=>r=c))}return o.length>0&&(yield Promise.all(o)),{agentId:e.agentId,agentName:e.agentName,agentNickname:(s=r.nickname)!=null?s:e.agentNickname,agentEmail:(i=r.email)!=null?i:e.agentEmail,agentDefaultLocale:(a=r.defaultLocale)!=null?a:e.agentDefaultLocale,agentTimeZone:e.agentTimeZone}})),Wg=pe("info/setAgentSettings",(e,t)=>N(null,null,function*(){let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=b(b({},typeof r.uiConfig=="object"?r.uiConfig:{}),e);return yield n.patchMe({uiConfig:o}),o})),$g=pe("info/getAgentSettings",(e,t)=>N(null,null,function*(){let{deepdeskAPI:n}=t.extra;return(yield n.getMe()).uiConfig})),hb=Re({name:"info",initialState:fL,reducers:{setVisitorInfo(e,t){e.visitorInfo=b(b({},e.visitorInfo),t.payload)},setCustomData(e,t){e.customData=t.payload},setPlatformVariables(e,t){e.platformVariables=t.payload},setShowNicknameDialog(e,t){e.showNicknameDialog=t.payload}},extraReducers:e=>{e.addCase(hl.pending,(t,n)=>{t.fetchState="loading",t.agentInfo=b(b({},t.agentInfo),n.meta.arg)}).addCase(hl.rejected,t=>{t.fetchState="error"}).addCase(hl.fulfilled,(t,n)=>{t.fetchState="done",t.agentInfo=n.payload}).addCase(Wg.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase($g.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(lt,t=>{t.visitorInfo=void 0})}}),{setVisitorInfo:yb,setCustomData:vb,setPlatformVariables:Sb,setShowNicknameDialog:xb}=hb.actions,wb=hb.reducer;function er(e,t){return t?e==null?(ee.warn("replaceVars called with non-string text; upstream contract violation",{keys:Object.keys(t)}),e):Object.entries(t).reduce((n,[r,o])=>n.replaceAll(r,o),e):e}var dd={list:[],fetchState:"idle",isOpen:!1,page:"search",aggregates:{}},bb=e=>e.search.isOpen,Eb=e=>e.search.page,Kg=e=>e.search.list,Cb=e=>e.search.aggregates,mL=Gt([Kg,(e,t)=>t],(e,t)=>e.filter(n=>n.type===t)),Tb=e=>t=>mL(t,e),Ds=pe("search/getAll",(e,t)=>N(null,null,function*(){var l;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(l=r.conversation.current)==null?void 0:l.profileCode,{platformVariables:s}=r.info;if(!o)throw new Error("Profile should be provided in order to be able to search");let{results:i,aggregates:a}=yield n.search({profile:o,query:e.query,tags:e.tags,size:e.size,current:e.current,filters:{type:e.type},params:yl(r)});return{results:i.map(c=>I(b(b({},c),c.title&&s?{title:er(c.title,s)}:{}),{text:er(c.text,s!=null?s:{}),source:`search-${c.type.toLowerCase()}`,searchTerm:e.query})),aggregates:a}})),kb=Re({name:"search",initialState:dd,reducers:{setIsOpen(e,t){e.isOpen=t.payload},setPage(e,t){e.page=t.payload},resetSearch(e){e.fetchState=dd.fetchState,e.list=dd.list}},extraReducers:e=>{e.addCase(Ds.pending,t=>{t.fetchState="loading"}).addCase(Ds.rejected,(t,n)=>{t.fetchState="error",ee.error(n.error)}).addCase(Ds.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload.results,t.aggregates=n.payload.aggregates||{}}).addCase(lt,()=>dd)}}),{resetSearch:fd,setIsOpen:tr,setPage:Vi}=kb.actions,Rb=kb.reducer;var Gg="SetOutputs",ji="ShowLoginOverlay",vl="UserLoggedIn",gL="UserLoggedOut",Xr="ApplySuggestion",qg="ApplyImageSuggestion",hL="ShowCommandPalette",pd="ShowNicknameDialog",md="ReduxAction",yL="RemovePinnedSuggestion",vL=e=>({[Gg]:t=>{var o,s;let n=(o=e.getState().conversation.current)==null?void 0:o.externalId,r=(s=t==null?void 0:t.payload)==null?void 0:s.externalConversationId;r&&r!==n||e.dispatch(I(b({},t),{isBroadcasted:!0}))},[md]:t=>{t.isBroadcasted||e.dispatch(I(b({},t),{isBroadcasted:!0}))},[yL]:t=>{e.dispatch(Ls(t))},[hL]:t=>{e.dispatch(tr(t.isOpen)),t.page&&e.dispatch(Vi(t.page))},[pd]:t=>{e.dispatch(xb(t.showNicknameDialog))},[ji]:t=>{e.dispatch(Kw(t))},[vl]:()=>{e.dispatch(Yr())},[gL]:()=>{e.dispatch(Yr())},[qg]:t=>{e.dispatch(ad({suggestion:t.suggestion}))},[Xr]:t=>{e.dispatch(Cn(I(b({},t),{eventMetrics:{inputType:"mouse"},replace:"selection"})))}}),Pb=vL;function gd(e){return pe("analytics/logEvent",(t,n)=>{var s,i,a;let r=(i=(s=n.getState())==null?void 0:s.conversation.current)==null?void 0:i.id,o=(a=n.getState())==null?void 0:a.info.agentInfo;return n.extra.deepdeskAPI.sendEvent(t.name,I(b({conversationId:r},o),{data:t.data}))})(e)}function Ze(){let e=be();return(t,n)=>N(null,null,function*(){yield e(gd({name:t,data:n}))})}var Wi=E(Z());function hd(e,t){let n=(0,Wi.useRef)(e);n.current=e;let[r,o]=(0,Wi.useState)(void 0),[s,i]=(0,Wi.useState)(void 0),[a,l]=(0,Wi.useState)("idle"),c=be();return{error:s,state:a,data:r,call:d=>N(null,null,function*(){l("loading"),yield c(n.current(d)).unwrap().then(p=>{o(p),l("done"),t!=null&&t.onSuccess&&(t==null||t.onSuccess(p))}).catch(p=>{i(p),l("error"),t!=null&&t.onError&&(t==null||t.onError(p))})}),reset:()=>{l("idle"),o(void 0),i(void 0)}}}var Sl=E(Z()),Ab=E(P()),Ib=Sl.default.createContext(null),Qr=({broadcastEvents:e,children:t})=>{let n=Sl.default.useMemo(()=>e,[]);return(0,Ab.jsx)(Ib.Provider,{value:n,children:t})},dn=()=>{let e=(0,Sl.useContext)(Ib);if(!e)throw new Error("You should use the useBroadcastEvents within a BroadcastEventsProvider");return e};var Cd=E(Z());var Yg=function(e,t){return Yg=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},Yg(e,t)};function xl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Yg(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Tn=function(){return Tn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Tn.apply(this,arguments)};function _b(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function yd(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,s;r<o;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}function vd(e,t){var n=t&&t.cache?t.cache:TL,r=t&&t.serializer?t.serializer:EL,o=t&&t.strategy?t.strategy:xL;return o(e,{cache:n,serializer:r})}function SL(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Nb(e,t,n,r){var o=SL(r)?r:n(r),s=t.get(o);return typeof s=="undefined"&&(s=e.call(this,r),t.set(o,s)),s}function Mb(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),s=t.get(o);return typeof s=="undefined"&&(s=e.apply(this,r),t.set(o,s)),s}function Xg(e,t,n,r,o){return n.bind(t,e,r,o)}function xL(e,t){var n=e.length===1?Nb:Mb;return Xg(e,this,n,t.cache.create(),t.serializer)}function wL(e,t){return Xg(e,this,Mb,t.cache.create(),t.serializer)}function bL(e,t){return Xg(e,this,Nb,t.cache.create(),t.serializer)}var EL=function(){return JSON.stringify(arguments)},CL=(function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,n){this.cache[t]=n},e})(),TL={create:function(){return new CL}},Sd={variadic:wL,monadic:bL};var xd;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(xd||(xd={}));var wd=class{constructor(t){console.warn(`[vite-messages-plugin]: Message "${t}" was not precompiled. Did you use the correct extenstion *.messages.ts?`)}};var zn;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(zn||(zn={}));var bd;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(bd||(bd={}));function Qg(e){return e.type===zn.literal}function Zg(e){return e.type===zn.argument}function wl(e){return e.type===zn.number}function bl(e){return e.type===zn.date}function El(e){return e.type===zn.time}function Cl(e){return e.type===zn.select}function Tl(e){return e.type===zn.plural}function Lb(e){return e.type===zn.pound}function kl(e){return e.type===zn.tag}function Ed(e){return!!(e&&typeof e=="object"&&e.type===bd.number)}function Rl(e){return!!(e&&typeof e=="object"&&e.type===bd.dateTime)}function Jg(e){e.forEach(function(t){if(delete t.location,Cl(t)||Tl(t))for(var n in t.options)delete t.options[n].location,Jg(t.options[n].value);else wl(t)&&Ed(t.style)||(bl(t)||El(t))&&Rl(t.style)?delete t.style.location:kl(t)&&Jg(t.children)})}function Ob(e,t){t===void 0&&(t={}),t=Tn({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new wd(e,t).parse();if(n.err){var r=SyntaxError(xd[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||Jg(n.val),n.val}var Fs;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(Fs||(Fs={}));var Pl=(function(e){xl(t,e);function t(n,r,o){var s=e.call(this,n)||this;return s.code=r,s.originalMessage=o,s}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error);var eh=(function(e){xl(t,e);function t(n,r,o,s){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(o).join('", "'),'"'),Fs.INVALID_VALUE,s)||this}return t})(Pl);var Db=(function(e){xl(t,e);function t(n,r,o){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),Fs.INVALID_VALUE,o)||this}return t})(Pl);var Fb=(function(e){xl(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),Fs.MISSING_VALUE,r)||this}return t})(Pl);var Dt;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(Dt||(Dt={}));function kL(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==Dt.literal||n.type!==Dt.literal?t.push(n):r.value+=n.value,t},[])}function RL(e){return typeof e=="function"}function Il(e,t,n,r,o,s,i){if(e.length===1&&Qg(e[0]))return[{type:Dt.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];if(Qg(u)){a.push({type:Dt.literal,value:u.value});continue}if(Lb(u)){typeof s=="number"&&a.push({type:Dt.literal,value:n.getNumberFormat(t).format(s)});continue}var f=u.value;if(!(o&&f in o))throw new Fb(f,i);var d=o[f];if(Zg(u)){(!d||typeof d=="string"||typeof d=="number")&&(d=typeof d=="string"||typeof d=="number"?String(d):""),a.push({type:typeof d=="string"?Dt.literal:Dt.object,value:d});continue}if(bl(u)){var p=typeof u.style=="string"?r.date[u.style]:Rl(u.style)?u.style.parsedOptions:void 0;a.push({type:Dt.literal,value:n.getDateTimeFormat(t,p).format(d)});continue}if(El(u)){var p=typeof u.style=="string"?r.time[u.style]:Rl(u.style)?u.style.parsedOptions:r.time.medium;a.push({type:Dt.literal,value:n.getDateTimeFormat(t,p).format(d)});continue}if(wl(u)){var p=typeof u.style=="string"?r.number[u.style]:Ed(u.style)?u.style.parsedOptions:void 0;p&&p.scale&&(d=d*(p.scale||1)),a.push({type:Dt.literal,value:n.getNumberFormat(t,p).format(d)});continue}if(kl(u)){var h=u.children,m=u.value,S=o[m];if(!RL(S))throw new Db(m,"function",i);var y=Il(h,t,n,r,o,s),g=S(y.map(function(C){return C.value}));Array.isArray(g)||(g=[g]),a.push.apply(a,g.map(function(C){return{type:typeof C=="string"?Dt.literal:Dt.object,value:C}}))}if(Cl(u)){var v=u.options[d]||u.options.other;if(!v)throw new eh(u.value,d,Object.keys(u.options),i);a.push.apply(a,Il(v.value,t,n,r,o));continue}if(Tl(u)){var v=u.options["=".concat(d)];if(!v){if(!Intl.PluralRules)throw new Pl(`Intl.PluralRules is not available in this environment.
12
+ `),oe}Ku(()=>{tt.current=void 0,ne.current=void 0,K.current=Ne});let at=le.useMemo(()=>le.createElement(v,A(E({},Ne),{ref:F})),[F,v,Ne]);return le.useMemo(()=>m?le.createElement(U.Provider,{value:j},at):at,[U,at,j])}let C=le.memo(x);if(C.WrappedComponent=v,C.displayName=x.displayName=y,l){let R=le.forwardRef(function(O,U){return le.createElement(C,A(E({},O),{reactReduxForwardedRef:U}))});return R.displayName=y,R.WrappedComponent=v,Ag(R,v)}return Ag(C,v)}}var yw=bN;function EN(e){let{children:t,context:n,serverState:r,store:o}=e,i=le.useMemo(()=>{let l=gw(o);return{store:o,subscription:l,getServerState:r?()=>r:void 0}},[o,r]),s=le.useMemo(()=>o.getState(),[o]);return Ku(()=>{let{subscription:l}=i;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),s!==o.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[i,s]),le.createElement((n||Xr).Provider,{value:i},t)}var vw=EN;function Ng(e=Xr){return function(){return le.useContext(e)}}var Sw=Ng();function xw(e=Xr){let t=e===Xr?Sw:Ng(e),n=()=>{let{store:r}=t();return r};return Object.assign(n,{withTypes:()=>n}),n}var CN=xw();function TN(e=Xr){let t=e===Xr?CN:xw(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Ee=TN(),kN=(e,t)=>e===t;function RN(e=Xr){let t=e===Xr?Sw:Ng(e),n=(r,o={})=>{let{equalityFn:i=kN}=typeof o=="function"?{equalityFn:o}:o,s=t(),{store:a,subscription:l,getServerState:c}=s,u=le.useRef(!0),f=le.useCallback({[r.name](p){return r(p)}}[r.name],[r]),d=(0,ww.useSyncExternalStoreWithSelector)(l.addNestedSub,a.getState,c||a.getState,f,i);return le.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var G=RN();function kt(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 PN=typeof Symbol=="function"&&Symbol.observable||"@@observable",bw=PN,Og=()=>Math.random().toString(36).substring(7).split("").join("."),IN={INIT:`@@redux/INIT${Og()}`,REPLACE:`@@redux/REPLACE${Og()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Og()}`},Gu=IN;function qu(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function Lg(e,t,n){if(typeof e!="function")throw new Error(kt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(kt(0));if(typeof t=="function"&&typeof n=="undefined"&&(n=t,t=void 0),typeof n!="undefined"){if(typeof n!="function")throw new Error(kt(1));return n(Lg)(e,t)}let r=e,o=t,i=new Map,s=i,a=0,l=!1;function c(){s===i&&(s=new Map,i.forEach((v,h)=>{s.set(h,v)}))}function u(){if(l)throw new Error(kt(3));return o}function f(v){if(typeof v!="function")throw new Error(kt(4));if(l)throw new Error(kt(5));let h=!0;c();let y=a++;return s.set(y,v),function(){if(h){if(l)throw new Error(kt(6));h=!1,c(),s.delete(y),i=null}}}function d(v){if(!qu(v))throw new Error(kt(7));if(typeof v.type=="undefined")throw new Error(kt(8));if(typeof v.type!="string")throw new Error(kt(17));if(l)throw new Error(kt(9));try{l=!0,o=r(o,v)}finally{l=!1}return(i=s).forEach(y=>{y()}),v}function p(v){if(typeof v!="function")throw new Error(kt(10));r=v,d({type:Gu.REPLACE})}function m(){let v=f;return{subscribe(h){if(typeof h!="object"||h===null)throw new Error(kt(11));function y(){let x=h;x.next&&x.next(u())}return y(),{unsubscribe:v(y)}},[bw](){return this}}}return d({type:Gu.INIT}),{dispatch:d,subscribe:f,getState:u,replaceReducer:p,[bw]:m}}function AN(e){Object.keys(e).forEach(t=>{let n=e[t];if(typeof n(void 0,{type:Gu.INIT})=="undefined")throw new Error(kt(12));if(typeof n(void 0,{type:Gu.PROBE_UNKNOWN_ACTION()})=="undefined")throw new Error(kt(13))})}function Yu(e){let t=Object.keys(e),n={};for(let s=0;s<t.length;s++){let a=t[s];typeof e[a]=="function"&&(n[a]=e[a])}let r=Object.keys(n),o,i;try{AN(n)}catch(s){i=s}return function(a={},l){if(i)throw i;let c=!1,u={};for(let f=0;f<r.length;f++){let d=r[f],p=n[d],m=a[d],g=p(m,l);if(typeof g=="undefined"){let v=l&&l.type;throw new Error(kt(14))}u[d]=g,c=c||g!==m}return c=c||r.length!==Object.keys(a).length,c?u:a}}function dl(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function Ew(...e){return t=>(n,r)=>{let o=t(n,r),i=()=>{throw new Error(kt(15))},s={getState:o.getState,dispatch:(l,...c)=>i(l,...c)},a=e.map(l=>l(s));return i=dl(...a)(o.dispatch),A(E({},o),{dispatch:i})}}function Cw(e){return qu(e)&&"type"in e&&typeof e.type=="string"}var Nw=Symbol.for("immer-nothing"),Tw=Symbol.for("immer-draftable"),Ft=Symbol.for("immer-state");function nr(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cn=Object,Vs=Cn.getPrototypeOf,Ju="constructor",id="prototype",Hg="configurable",ed="enumerable",Qu="writable",fl="value",Rr=e=>!!e&&!!e[Ft];function Tn(e){var t;return e?Ow(e)||ad(e)||!!e[Tw]||!!((t=e[Ju])!=null&&t[Tw])||ld(e)||cd(e):!1}var _N=Cn[id][Ju].toString(),kw=new WeakMap;function Ow(e){if(!e||!Gg(e))return!1;let t=Vs(e);if(t===null||t===Cn[id])return!0;let n=Cn.hasOwnProperty.call(t,Ju)&&t[Ju];if(n===Object)return!0;if(!Us(n))return!1;let r=kw.get(n);return r===void 0&&(r=Function.toString.call(n),kw.set(n,r)),r===_N}function sd(e,t,n=!0){gl(e)===0?(n?Reflect.ownKeys(e):Cn.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((r,o)=>t(o,r,e))}function gl(e){let t=e[Ft];return t?t.type_:ad(e)?1:ld(e)?2:cd(e)?3:0}var Dg=(e,t,n=gl(e))=>n===2?e.has(t):Cn[id].hasOwnProperty.call(e,t),Bg=(e,t,n=gl(e))=>n===2?e.get(t):e[t],td=(e,t,n,r=gl(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function MN(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var ad=Array.isArray,ld=e=>e instanceof Map,cd=e=>e instanceof Set,Gg=e=>typeof e=="object",Us=e=>typeof e=="function",Fg=e=>typeof e=="boolean";function NN(e){let t=+e;return Number.isInteger(t)&&String(t)===e}var Qr=e=>e.copy_||e.base_;var qg=e=>e.modified_?e.copy_:e.base_;function Ug(e,t){if(ld(e))return new Map(e);if(cd(e))return new Set(e);if(ad(e))return Array[id].slice.call(e);let n=Ow(e);if(t===!0||t==="class_only"&&!n){let r=Cn.getOwnPropertyDescriptors(e);delete r[Ft];let o=Reflect.ownKeys(r);for(let i=0;i<o.length;i++){let s=o[i],a=r[s];a[Qu]===!1&&(a[Qu]=!0,a[Hg]=!0),(a.get||a.set)&&(r[s]={[Hg]:!0,[Qu]:!0,[ed]:a[ed],[fl]:e[s]})}return Cn.create(Vs(e),r)}else{let r=Vs(e);if(r!==null&&n)return E({},e);let o=Cn.create(r);return Cn.assign(o,e)}}function Yg(e,t=!1){return ud(e)||Rr(e)||!Tn(e)||(gl(e)>1&&Cn.defineProperties(e,{set:Xu,add:Xu,clear:Xu,delete:Xu}),Cn.freeze(e),t&&sd(e,(n,r)=>{Yg(r,!0)},!1)),e}function ON(){nr(2)}var Xu={[fl]:ON};function ud(e){return e===null||!Gg(e)?!0:Cn.isFrozen(e)}var nd="MapSet",Vg="Patches",Rw="ArrayMethods",Lw={};function _i(e){let t=Lw[e];return t||nr(0,e),t}var Pw=e=>!!Lw[e];var pl,Dw=()=>pl,LN=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Pw(nd)?_i(nd):void 0,arrayMethodsPlugin_:Pw(Rw)?_i(Rw):void 0});function Iw(e,t){t&&(e.patchPlugin_=_i(Vg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Wg(e){$g(e),e.drafts_.forEach(DN),e.drafts_=null}function $g(e){e===pl&&(pl=e.parent_)}var Aw=e=>pl=LN(pl,e);function DN(e){let t=e[Ft];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _w(e,t){t.unfinalizedDrafts_=t.drafts_.length;let n=t.drafts_[0];if(e!==void 0&&e!==n){n[Ft].modified_&&(Wg(t),nr(4)),Tn(e)&&(e=Mw(t,e));let{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(n[Ft].base_,e,t)}else e=Mw(t,n);return FN(t,e,!0),Wg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Nw?e:void 0}function Mw(e,t){if(ud(t))return t;let n=t[Ft];if(!n)return rd(t,e.handledSet_,e);if(!dd(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){let{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Hw(n,e)}return n.copy_}function FN(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Yg(t,n)}function Fw(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dd=(e,t)=>e.scope_===t,zN=[];function zw(e,t,n,r){var a;let o=Qr(e),i=e.type_;if(r!==void 0&&Bg(o,r,i)===t){td(o,r,n,i);return}if(!e.draftLocations_){let l=e.draftLocations_=new Map;sd(o,(c,u)=>{if(Rr(u)){let f=l.get(u)||[];f.push(c),l.set(u,f)}})}let s=(a=e.draftLocations_.get(t))!=null?a:zN;for(let l of s)td(o,l,n,i)}function HN(e,t,n){e.callbacks_.push(function(o){var a,l;let i=t;if(!i||!dd(i,o))return;(a=o.mapSetPlugin_)==null||a.fixSetContents(i);let s=qg(i);zw(e,(l=i.draft_)!=null?l:i,s,n),Hw(i,o)})}function Hw(e,t){var r,o;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||((o=(r=e.assigned_)==null?void 0:r.size)!=null?o:0)>0)){let{patchPlugin_:i}=t;if(i){let s=i.getPath(e);s&&i.generatePatches_(e,s,t)}Fw(e)}}function BN(e,t,n){let{scope_:r}=e;if(Rr(n)){let o=n[Ft];dd(o,r)&&o.callbacks_.push(function(){Zu(e);let s=qg(o);zw(e,n,s,t)})}else Tn(n)&&e.callbacks_.push(function(){var s;let i=Qr(e);e.type_===3?i.has(n)&&rd(n,r.handledSet_,r):Bg(i,t,e.type_)===n&&r.drafts_.length>1&&((s=e.assigned_.get(t))!=null?s:!1)===!0&&e.copy_&&rd(Bg(e.copy_,t,e.type_),r.handledSet_,r)})}function rd(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Rr(e)||t.has(e)||!Tn(e)||ud(e)||(t.add(e),sd(e,(r,o)=>{if(Rr(o)){let i=o[Ft];if(dd(i,n)){let s=qg(i);td(e,r,s,e.type_),Fw(i)}}else Tn(o)&&rd(o,t,n)})),e}function UN(e,t){let n=ad(e),r={type_:n?1:0,scope_:t?t.scope_:Dw(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0},o=r,i=od;n&&(o=[r],i=ml);let{revoke:s,proxy:a}=Proxy.revocable(o,i);return r.draft_=a,r.revoke_=s,[a,r]}var od={get(e,t){if(t===Ft)return e;let n=e.scope_.arrayMethodsPlugin_,r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);let o=Qr(e);if(!Dg(o,t,e.type_))return WN(e,o,t);let i=o[t];if(e.finalized_||!Tn(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&NN(t))return i;if(i===zg(e.base_,t)||VN(e,t,i)){Zu(e);let s=e.type_===1?+t:t,a=Kg(e.scope_,i,e,s);return e.copy_[s]=a}return i},has(e,t){return t in Qr(e)},ownKeys(e){return Reflect.ownKeys(Qr(e))},set(e,t,n){let r=Bw(Qr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){let o=zg(Qr(e),t),i=o==null?void 0:o[Ft];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(MN(n,o)&&(n!==void 0||Dg(e.base_,t,e.type_)))return!0;Zu(e),jg(e)}return e.copy_[t]===n&&(n!==void 0||Dg(e.copy_,t,e.type_))||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),BN(e,t,n)),!0},deleteProperty(e,t){return Zu(e),zg(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),jg(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let n=Qr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Qu]:!0,[Hg]:e.type_!==1||t!=="length",[ed]:r[ed],[fl]:n[t]}},defineProperty(){nr(11)},getPrototypeOf(e){return Vs(e.base_)},setPrototypeOf(){nr(12)}},ml={};for(let e in od){let t=od[e];ml[e]=function(){let n=arguments;return n[0]=n[0][0],t.apply(this,n)}}ml.deleteProperty=function(e,t){return ml.set.call(this,e,t,void 0)};ml.set=function(e,t,n){return od.set.call(this,e[0],t,n,e[0])};function zg(e,t){let n=e[Ft];return(n?Qr(n):e)[t]}function VN(e,t,n){var r;return e.type_!==1||!e.allIndicesReassigned_||(r=e.assigned_)!=null&&r.get(t)||!Tn(n)||n[Ft]?!1:e.baseRefs_.has(n)}function WN(e,t,n){var o;let r=Bw(t,n);return r?fl in r?r[fl]:(o=r.get)==null?void 0:o.call(e.draft_):void 0}function Bw(e,t){if(!(t in e))return;let n=Vs(e);for(;n;){let r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Vs(n)}}function jg(e){e.modified_||(e.modified_=!0,e.parent_&&jg(e.parent_))}function Zu(e){e.copy_||(e.assigned_=new Map,e.copy_=Ug(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $N=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Us(t)&&!Us(n)){let i=n;n=t;let s=this;return function(l=i,...c){return s.produce(l,u=>n.call(this,u,...c))}}Us(n)||nr(6),r!==void 0&&!Us(r)&&nr(7);let o;if(Tn(t)){let i=Aw(this),s=Kg(i,t,void 0),a=!0;try{o=n(s),a=!1}finally{a?Wg(i):$g(i)}return Iw(i,r),_w(o,i)}else if(!t||!Gg(t)){if(o=n(t),o===void 0&&(o=t),o===Nw&&(o=void 0),this.autoFreeze_&&Yg(o,!0),r){let i=[],s=[];_i(Vg).generateReplacementPatches_(t,o,{patches_:i,inversePatches_:s}),r(i,s)}return o}else nr(1,t)},this.produceWithPatches=(t,n)=>{if(Us(t))return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,o;return[this.produce(t,n,(s,a)=>{r=s,o=a}),r,o]},Fg(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Fg(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Fg(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Tn(e)||nr(8),Rr(e)&&(e=Uw(e));let t=Aw(this),n=Kg(t,e,void 0);return n[Ft].isManual_=!0,$g(t),n}finishDraft(e,t){let n=e&&e[Ft];(!n||!n.isManual_)&&nr(9);let{scope_:r}=n;return Iw(r,t),_w(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){let o=t[n];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}n>-1&&(t=t.slice(n+1));let r=_i(Vg).applyPatches_;return Rr(e)?r(e,t):this.produce(e,o=>r(o,t))}};function Kg(e,t,n,r){var a,l;let[o,i]=ld(t)?_i(nd).proxyMap_(t,n):cd(t)?_i(nd).proxySet_(t,n):UN(t,n);return((a=n==null?void 0:n.scope_)!=null?a:Dw()).drafts_.push(o),i.callbacks_=(l=n==null?void 0:n.callbacks_)!=null?l:[],i.key_=r,n&&r!==void 0?HN(n,i,r):i.callbacks_.push(function(u){var d;(d=u.mapSetPlugin_)==null||d.fixSetContents(i);let{patchPlugin_:f}=u;i.modified_&&f&&f.generatePatches_(i,[],u)}),o}function Uw(e){return Rr(e)||nr(10,e),Vw(e)}function Vw(e){if(!Tn(e)||ud(e))return e;let t=e[Ft],n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ug(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ug(e,!0);return sd(n,(o,i)=>{td(n,o,Vw(i))},r),t&&(t.finalized_=!1),n}var jN=new $N,Xg=jN.produce;function KN(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function GN(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){let n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Ww=e=>Array.isArray(e)?e:[e];function qN(e){let t=Array.isArray(e[0])?e[0]:e;return GN(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function YN(e,t){let n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}var XN=class{constructor(e){this.value=e}deref(){return this.value}},QN=()=>typeof WeakRef=="undefined"?XN:WeakRef,jw=QN(),ZN=0,$w=1;function fd(){return{s:ZN,v:void 0,o:null,p:null}}function JN(e){return e instanceof jw?e.deref():e}function Kw(e,t={}){let n=fd(),{resultEqualityCheck:r}=t,o,i=0;function s(){let a=n,{length:l}=arguments;for(let f=0,d=l;f<d;f++){let p=arguments[f];if(typeof p=="function"||typeof p=="object"&&p!==null){let m=a.o;m===null&&(a.o=m=new WeakMap);let g=m.get(p);g===void 0?(a=fd(),m.set(p,a)):a=g}else{let m=a.p;m===null&&(a.p=m=new Map);let g=m.get(p);g===void 0?(a=fd(),m.set(p,a)):a=g}}let c=a,u;if(a.s===$w)u=a.v;else if(u=e.apply(null,arguments),i++,r){let f=JN(o);f!=null&&r(f,u)&&(u=f,i!==0&&i--),o=typeof u=="object"&&u!==null||typeof u=="function"?new jw(u):u}return c.s=$w,c.v=u,u}return s.clearCache=()=>{n=fd(),s.resetResultsCount()},s.resultsCount=()=>i,s.resetResultsCount=()=>{i=0},s}function eO(e,...t){let n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...o)=>{let i=0,s=0,a,l={},c=o.pop();typeof c=="object"&&(l=c,c=o.pop()),KN(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);let u=E(E({},n),l),{memoize:f,memoizeOptions:d=[],argsMemoize:p=Kw,argsMemoizeOptions:m=[]}=u,g=Ww(d),v=Ww(m),h=qN(o),y=f(function(){return i++,c.apply(null,arguments)},...g),S=!0,x=p(function(){s++;let C=YN(h,arguments);return a=y.apply(null,C),a},...v);return Object.assign(x,{resultFunc:c,memoizedResultFunc:y,dependencies:h,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:f,argsMemoize:p})};return Object.assign(r,{withTypes:()=>r}),r}var fn=eO(Kw);function Gw(e){return({dispatch:n,getState:r})=>o=>i=>typeof i=="function"?i(n,r,e):o(i)}var qw=Gw(),Yw=Gw;var tO=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?dl:dl.apply(null,arguments)},v8=typeof window!="undefined"&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__:function(){return function(e){return e}},nO=e=>e&&typeof e.match=="function";function Rt(e,t){function n(...r){if(t){let o=t(...r);if(!o)throw new Error(Zr(0));return E(E({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Cw(r)&&r.type===e,n}var eb=class hl extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,hl.prototype)}static get[Symbol.species](){return hl}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new hl(...t[0].concat(this)):new hl(...t.concat(this))}};function Xw(e){return Tn(e)?Xg(e,()=>{}):e}function pd(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function rO(e){return typeof e=="boolean"}var oO=()=>function(t){let{thunk:n=!0,immutableCheck:r=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t!=null?t:{},s=new eb;return n&&(rO(n)?s.push(qw):s.push(Yw(n.extraArgument))),s},iO="RTK_autoBatch";var Qw=e=>t=>{setTimeout(t,e)},sO=(e,t)=>n=>{let r=!1,o=()=>{r||(r=!0,cancelAnimationFrame(i),clearTimeout(s),n())},i=e(o),s=setTimeout(o,t)},aO=(e={type:"raf"})=>t=>(...n)=>{let r=t(...n),o=!0,i=!1,s=!1,a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window!="undefined"&&window.requestAnimationFrame?sO(window.requestAnimationFrame,100):Qw(10):e.type==="callback"?e.queueNotification:Qw(e.timeout),c=()=>{s=!1,i&&(i=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){let f=()=>o&&u(),d=r.subscribe(f);return a.add(u),()=>{d(),a.delete(u)}},dispatch(u){var f;try{return o=!((f=u==null?void 0:u.meta)!=null&&f[iO]),i=!o,i&&(s||(s=!0,l(c))),r.dispatch(u)}finally{o=!0}}})},lO=e=>function(n){let{autoBatch:r=!0}=n!=null?n:{},o=new eb(e);return r&&o.push(aO(typeof r=="object"?r:void 0)),o};function tb(e){let t=oO(),{reducer:n=void 0,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:i=!0,preloadedState:s=void 0,enhancers:a=void 0}=e||{},l;if(typeof n=="function")l=n;else if(qu(n))l=Yu(n);else throw new Error(Zr(1));let c;typeof r=="function"?c=r(t):c=t();let u=dl;o&&(u=tO(E({trace:!1},typeof o=="object"&&o)));let f=Ew(...c),d=lO(f),p=typeof a=="function"?a(d):d(),m=u(...p);return Lg(l,s,m)}function nb(e){let t={},n=[],r,o={addCase(i,s){let a=typeof i=="string"?i:i.type;if(!a)throw new Error(Zr(28));if(a in t)throw new Error(Zr(29));return t[a]=s,o},addAsyncThunk(i,s){return s.pending&&(t[i.pending.type]=s.pending),s.rejected&&(t[i.rejected.type]=s.rejected),s.fulfilled&&(t[i.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:i.settled,reducer:s.settled}),o},addMatcher(i,s){return n.push({matcher:i,reducer:s}),o},addDefaultCase(i){return r=i,o}};return e(o),[t,n,r]}function cO(e){return typeof e=="function"}function uO(e,t){let[n,r,o]=nb(t),i;if(cO(e))i=()=>Xw(e());else{let a=Xw(e);i=()=>a}function s(a=i(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[o]),c.reduce((u,f)=>{if(f)if(Rr(u)){let p=f(u,l);return p===void 0?u:p}else{if(Tn(u))return Xg(u,d=>f(d,l));{let d=f(u,l);if(d===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return d}}return u},a)}return s.getInitialState=i,s}var dO=(e,t)=>nO(e)?e.match(t):e(t);function fO(...e){return t=>e.some(n=>dO(n,t))}var pO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",mO=(e=21)=>{let t="",n=e;for(;n--;)t+=pO[Math.random()*64|0];return t},gO=["name","message","stack","code"],Qg=class{constructor(e,t){xe(this,"payload");xe(this,"meta");xe(this,"_type");this.payload=e,this.meta=t}},Zw=class{constructor(e,t){xe(this,"payload");xe(this,"meta");xe(this,"_type");this.payload=e,this.meta=t}},hO=e=>{if(typeof e=="object"&&e!==null){let t={};for(let n of gO)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},Jw="External signal was aborted",ge=(()=>{function e(t,n,r){let o=Rt(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:A(E({},f||{}),{arg:u,requestId:c,requestStatus:"fulfilled"})})),i=Rt(t+"/pending",(l,c,u)=>({payload:void 0,meta:A(E({},u||{}),{arg:c,requestId:l,requestStatus:"pending"})})),s=Rt(t+"/rejected",(l,c,u,f,d)=>({payload:f,error:(r&&r.serializeError||hO)(l||"Rejected"),meta:A(E({},d||{}),{arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:(l==null?void 0:l.name)==="AbortError",condition:(l==null?void 0:l.name)==="ConditionError"})}));function a(l,{signal:c}={}){return(u,f,d)=>{let p=r!=null&&r.idGenerator?r.idGenerator(l):mO(),m=new AbortController,g,v;function h(S){v=S,m.abort()}c&&(c.aborted?h(Jw):c.addEventListener("abort",()=>h(Jw),{once:!0}));let y=(function(){return M(this,null,function*(){var T,C;let S;try{let k=(T=r==null?void 0:r.condition)==null?void 0:T.call(r,l,{getState:f,extra:d});if(vO(k)&&(k=yield k),k===!1||m.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};let R=new Promise((F,O)=>{g=()=>{O({name:"AbortError",message:v||"Aborted"})},m.signal.addEventListener("abort",g,{once:!0})});u(i(p,l,(C=r==null?void 0:r.getPendingMeta)==null?void 0:C.call(r,{requestId:p,arg:l},{getState:f,extra:d}))),S=yield Promise.race([R,Promise.resolve(n(l,{dispatch:u,getState:f,extra:d,requestId:p,signal:m.signal,abort:h,rejectWithValue:((F,O)=>new Qg(F,O)),fulfillWithValue:((F,O)=>new Zw(F,O))})).then(F=>{if(F instanceof Qg)throw F;return F instanceof Zw?o(F.payload,p,l,F.meta):o(F,p,l)})])}catch(k){S=k instanceof Qg?s(null,p,l,k.payload,k.meta):s(k,p,l)}finally{g&&m.signal.removeEventListener("abort",g)}return r&&!r.dispatchConditionRejection&&s.match(S)&&S.meta.condition||u(S),S})})();return Object.assign(y,{abort:h,requestId:p,arg:l,unwrap(){return y.then(yO)}})}}return Object.assign(a,{pending:i,rejected:s,fulfilled:o,settled:fO(s,o),typePrefix:t})}return e.withTypes=()=>e,e})();function yO(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function vO(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}var rb=Symbol.for("rtk-slice-createasyncthunk"),x8={[rb]:ge};function SO(e,t){return`${e}/${t}`}function xO({creators:e}={}){var n;let t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[rb];return function(o){let{name:i,reducerPath:s=i}=o;if(!i)throw new Error(Zr(11));let a=(typeof o.reducers=="function"?o.reducers(bO()):o.reducers)||{},l=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},u={addCase(x,T){let C=typeof x=="string"?x:x.type;if(!C)throw new Error(Zr(12));if(C in c.sliceCaseReducersByType)throw new Error(Zr(13));return c.sliceCaseReducersByType[C]=T,u},addMatcher(x,T){return c.sliceMatchers.push({matcher:x,reducer:T}),u},exposeAction(x,T){return c.actionCreators[x]=T,u},exposeCaseReducer(x,T){return c.sliceCaseReducersByName[x]=T,u}};l.forEach(x=>{let T=a[x],C={reducerName:x,type:SO(i,x),createNotation:typeof o.reducers=="function"};CO(T)?kO(C,T,u,t):EO(C,T,u)});function f(){let[x={},T=[],C=void 0]=typeof o.extraReducers=="function"?nb(o.extraReducers):[o.extraReducers],k=E(E({},x),c.sliceCaseReducersByType);return uO(o.initialState,R=>{for(let F in k)R.addCase(F,k[F]);for(let F of c.sliceMatchers)R.addMatcher(F.matcher,F.reducer);for(let F of T)R.addMatcher(F.matcher,F.reducer);C&&R.addDefaultCase(C)})}let d=x=>x,p=new Map,m=new WeakMap,g;function v(x,T){return g||(g=f()),g(x,T)}function h(){return g||(g=f()),g.getInitialState()}function y(x,T=!1){function C(R){let F=R[x];return typeof F=="undefined"&&T&&(F=pd(m,C,h)),F}function k(R=d){let F=pd(p,T,()=>new WeakMap);return pd(F,R,()=>{var U;let O={};for(let[J,Y]of Object.entries((U=o.selectors)!=null?U:{}))O[J]=wO(Y,R,()=>pd(m,R,h),T);return O})}return{reducerPath:x,getSelectors:k,get selectors(){return k(C)},selectSlice:C}}let S=A(E({name:i,reducer:v,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:h},y(s)),{injectInto(x,k={}){var R=k,{reducerPath:T}=R,C=ie(R,["reducerPath"]);let F=T!=null?T:s;return x.inject({reducerPath:F,reducer:v},C),E(E({},S),y(F,!0))}});return S}}function wO(e,t,n,r){function o(i,...s){let a=t(i);return typeof a=="undefined"&&r&&(a=n()),e(a,...s)}return o.unwrapped=e,o}var Re=xO();function bO(){function e(t,n){return E({_reducerDefinitionType:"asyncThunk",payloadCreator:t},n)}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function EO({type:e,reducerName:t,createNotation:n},r,o){let i,s;if("reducer"in r){if(n&&!TO(r))throw new Error(Zr(17));i=r.reducer,s=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,s?Rt(e,s):Rt(e))}function CO(e){return e._reducerDefinitionType==="asyncThunk"}function TO(e){return e._reducerDefinitionType==="reducerWithPrepare"}function kO({type:e,reducerName:t},n,r,o){if(!o)throw new Error(Zr(18));let{payloadCreator:i,fulfilled:s,pending:a,rejected:l,settled:c,options:u}=n,f=o(e,i,u);r.exposeAction(t,f),s&&r.addCase(f.fulfilled,s),a&&r.addCase(f.pending,a),l&&r.addCase(f.rejected,l),c&&r.addMatcher(f.settled,c),r.exposeCaseReducer(t,{fulfilled:s||md,pending:a||md,rejected:l||md,settled:c||md})}function md(){}var ob="listener",ib="completed",sb="cancelled",w8=`task-${sb}`,b8=`task-${ib}`,E8=`${ob}-${sb}`,C8=`${ob}-${ib}`;var{assign:ab}=Object;var Zg="listenerMiddleware";var RO=ab(Rt(`${Zg}/add`),{withTypes:()=>RO}),T8=Rt(`${Zg}/removeAll`),PO=ab(Rt(`${Zg}/remove`),{withTypes:()=>PO});function Zr(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var yl=(n=>(n.NL_NL="nl-NL",n.EN_US="en-US",n))(yl||{});var IO={isLoggedIn:null,loginFetchState:"idle",verifyFetchState:"idle",showLoginOverlay:!1,loginError:null},Pt=e=>e.auth.isLoggedIn;var lb=e=>e.auth.verifyFetchState,cb=e=>e.auth.showLoginOverlay,ub=e=>e.auth.loginError,Jr=ge("auth/validate",(e,t)=>M(null,null,function*(){return t.extra.deepdeskAPI.isLoggedIn()})),db=ge("auth/requestLogin",(n,r)=>M(null,[n,r],function*({email:e},t){let{deepdeskAPI:o}=t.extra;return o.requestLoginByEmail(e)})),Jg=ge("auth/loginWithPassword",(r,o)=>M(null,[r,o],function*({username:e,password:t},n){let{deepdeskAPI:i}=n.extra;return i.loginWithPassword(e,t)})),gd=ge("auth/logout",(e,t)=>M(null,null,function*(){let{deepdeskAPI:n}=t.extra;yield n.logout()})),vl=ge("auth/verifyLoginToken",(n,r)=>M(null,[n,r],function*({token:e},t){let{deepdeskAPI:o}=t.extra;return o.verifyLoginToken(e)})),fb=Re({name:"auth",initialState:IO,reducers:{setIsLoggedIn(e,t){e.isLoggedIn=t.payload},setShowLoginOverlay(e,t){e.showLoginOverlay=t.payload},setLoginError(e,t){e.loginError=t.payload},clearLoginError(e){e.loginError=null}},extraReducers:e=>{e.addCase(Jr.pending,t=>{t.loginFetchState="loading"}),e.addCase(Jr.fulfilled,(t,{payload:n})=>{t.isLoggedIn=n,t.loginFetchState="done"}),e.addCase(Jr.rejected,t=>{t.loginFetchState="error",t.isLoggedIn=!1}),e.addCase(Jg.pending,t=>{t.loginFetchState="loading",t.loginError=null}),e.addCase(Jg.fulfilled,t=>{t.isLoggedIn=!0,t.loginFetchState="done",t.loginError=null,t.showLoginOverlay=!1}),e.addCase(Jg.rejected,(t,n)=>{t.loginFetchState="error",t.isLoggedIn=!1,t.loginError=n.error.message==="Bad Request"?"Invalid credentials":"Login failed"}),e.addCase(gd.fulfilled,t=>{t.isLoggedIn=!1,t.loginFetchState="idle",t.loginError=null}),e.addCase(gd.rejected,t=>{t.isLoggedIn=!1,t.loginFetchState="error"}),e.addCase(vl.pending,t=>{t.verifyFetchState="loading"}),e.addCase(vl.rejected,t=>{t.verifyFetchState="error"}),e.addCase(vl.fulfilled,(t,n)=>{n.payload.isLoggedIn?t.verifyFetchState="done":t.verifyFetchState="error"})}}),{setIsLoggedIn:Ws,setShowLoginOverlay:pb,setLoginError:eh,clearLoginError:hd}=fb.actions,mb=fb.reducer;var Sl=class{diff(t,n,r={}){let o;typeof r=="function"?(o=r,r={}):"callback"in r&&(o=r.callback);let i=this.castInput(t,r),s=this.castInput(n,r),a=this.removeEmpty(this.tokenize(i,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(a,l,r,o)}diffWithOptionsObj(t,n,r,o){var i;let s=y=>{if(y=this.postProcess(y,r),o){setTimeout(function(){o(y)},0);return}else return y},a=n.length,l=t.length,c=1,u=a+l;r.maxEditLength!=null&&(u=Math.min(u,r.maxEditLength));let f=(i=r.timeout)!==null&&i!==void 0?i:1/0,d=Date.now()+f,p=[{oldPos:-1,lastComponent:void 0}],m=this.extractCommon(p[0],n,t,0,r);if(p[0].oldPos+1>=l&&m+1>=a)return s(this.buildValues(p[0].lastComponent,n,t));let g=-1/0,v=1/0,h=()=>{for(let y=Math.max(g,-c);y<=Math.min(v,c);y+=2){let S,x=p[y-1],T=p[y+1];x&&(p[y-1]=void 0);let C=!1;if(T){let R=T.oldPos-y;C=T&&0<=R&&R<a}let k=x&&x.oldPos+1<l;if(!C&&!k){p[y]=void 0;continue}if(!k||C&&x.oldPos<T.oldPos?S=this.addToPath(T,!0,!1,0,r):S=this.addToPath(x,!1,!0,1,r),m=this.extractCommon(S,n,t,y,r),S.oldPos+1>=l&&m+1>=a)return s(this.buildValues(S.lastComponent,n,t))||!0;p[y]=S,S.oldPos+1>=l&&(v=Math.min(v,y-1)),m+1>=a&&(g=Math.max(g,y+1))}c++};if(o)(function y(){setTimeout(function(){if(c>u||Date.now()>d)return o(void 0);h()||y()},0)})();else for(;c<=u&&Date.now()<=d;){let y=h();if(y)return y}}addToPath(t,n,r,o,i){let s=t.lastComponent;return s&&!i.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:t.oldPos+o,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+o,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(t,n,r,o,i){let s=n.length,a=r.length,l=t.oldPos,c=l-o,u=0;for(;c+1<s&&l+1<a&&this.equals(r[l+1],n[c+1],i);)c++,l++,u++,i.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!i.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=l,c}equals(t,n,r){return r.comparator?r.comparator(t,n):t===n||!!r.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){let n=[];for(let r=0;r<t.length;r++)t[r]&&n.push(t[r]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,r){let o=[],i;for(;t;)o.push(t),i=t.previousComponent,delete t.previousComponent,t=i;o.reverse();let s=o.length,a=0,l=0,c=0;for(;a<s;a++){let u=o[a];if(u.removed)u.value=this.join(r.slice(c,c+u.count)),c+=u.count;else{if(!u.added&&this.useLongestToken){let f=n.slice(l,l+u.count);f=f.map(function(d,p){let m=r[c+p];return m.length>d.length?m:d}),u.value=this.join(f)}else u.value=this.join(n.slice(l,l+u.count));l+=u.count,u.added||(c+=u.count)}}return o}};var th=class extends Sl{},gb=new th;function nh(e,t,n){return gb.diff(e,t,n)}function hb(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}function zo(e,t,n=10){let r=typeof e,o=typeof t;if(n===0)throw new Error("Max depth deepEqual, possible circular references?");return r!==o?!1:e==null||r==="string"||r==="number"||r==="boolean"?e===t:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:e.every((i,s)=>zo(i,t[s],n-1)):hb(e)&&hb(t)?Object.keys(e).length!==Object.keys(t).length?!1:Object.keys(e).every(s=>zo(e[s],t[s],n-1)):!1}function AO(e){return Math.max(...e.map(t=>t.length))}function _O(e,t){let n=e.reduce((r,o)=>{if(o){let i=r[o]?r[o]+1:1;return A(E({},r),{[o]:i})}return r},{});return Object.keys(n).reduce((r,o)=>(n[o]<t&&r.push(o),r),[])}function yb(e,t){let r=[...e.map(({text:o})=>o.split(/\b(\w+)\b/))];for(let o=0;o<AO(r);o++){let i=_O(r.map(a=>a[o]),t),s=r.filter(a=>!i.includes(a[o]));if(s.length>=t)r=s;else return{text:r[0].slice(0,o).join("").replace(/ (\?| |!|\.|,|\n)/g,"$1").trimEnd(),source:"mixed"}}}var MO=2;function vb(e,t=""){if(e.length===0)return;if(e.length===1)return e[0];let n=yb(e,MO);return n&&n.text!==t?n:e[0]}var NO={info(...e){console.info("[Deepdesk]",...e)},warn(...e){console.warn("[Deepdesk]",...e)},error(...e){console.error("[Deepdesk]",...e)}},te=NO;var Sb={current:null,isSupported:null},lt=Rt("resetConversation"),yd=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.externalId)||null},Pr=e=>{let{current:t}=e.conversation;return(t==null?void 0:t.id)||null},$s=e=>e.conversation.isSupported,rh=ge("conversation/isSupported",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.isConversationSupported(e.externalId,e.options)}),vd=ge("conversation/create",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.createConversation(e)}),Sd=ge("conversation/byExternalId",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationByExternalId(e.externalId,e.options)}),xd=ge("conversation/update",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Pr(t.getState());if(!r)throw new Error("No current conversation to update");return n.updateConversation(r,e)}),oh=ge("conversation/upsert",(e,t)=>{let{deepdeskAPI:n}=t.extra;return n.getConversationByExternalId(e.externalId).catch(()=>null).then(r=>{if(!r)return n.createConversation(e);let{agentId:o,agentName:i,agentEmail:s,agentNickname:a,metadata:l}=e;return n.updateConversation(r.id,{agentId:o,agentEmail:s,agentName:i,agentNickname:a,metadata:l})})}),ih=ge("conversation/postMessages",(e,t)=>{let{deepdeskAPI:n}=t.extra,r=Pr(t.getState());if(!r)throw new Error("No current conversation to update messages");return n.postMessages(r,e.map(o=>E({},o)))}),OO=[vd.rejected,Sd.rejected,xd.rejected,ih.rejected].map(e=>e==null?void 0:e.toString());function LO(e){return OO.includes(e.type)}var DO=Re({name:"conversation",initialState:Sb,reducers:{},extraReducers:e=>{e.addCase(rh.fulfilled,(t,n)=>{t.isSupported=n.payload}).addCase(vd.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(Sd.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(oh.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(xd.fulfilled,(t,n)=>{var r;t.current=n.payload,t.isSupported=!!((r=n.payload)!=null&&r.profileCode)}).addCase(lt,()=>Sb).addMatcher(LO,(t,n)=>{var r;throw te.info("Conversation action rejected",n.type,((r=n.error)==null?void 0:r.message)||"No message"),new Error(n.error.message)})}}),xb=DO.reducer;var Mi={text:"",html:null,suggestionTextStart:0,selection:{start:0,end:0},beforeInputChange:null,mixedSuggestion:null,textSuggestions:[],pinnedSuggestions:[],selectedSuggestionIndex:-1,metrics:{numCharsTyped:0,numCharsPasted:0,numCharsCut:0,numCharsDeleted:0,numPaste:0,agentStartedTypingTimestamp:null,externalTimeTotalSeconds:null,pastes:[],deletions:[],offeredTextSuggestions:[],textSuggestions:[],cuts:[]}};function sh(e){let{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:i}=e;return{key:t,shiftKey:n,ctrlKey:r,metaKey:o,altKey:i}}var wd=Rt("input/applyImageSuggestion"),wb=Re({name:"input",initialState:Mi,reducers:{setInput(e,t){var s,a;let{beforeInputChange:n}=e,{text:r,html:o,suggestionTextStart:i}=t.payload;if(e.text=r,e.html=o!=null?o:null,e.suggestionTextStart=r===""?0:Math.max(0,i!=null?i:0),r==="")e.metrics=Mi.metrics,e.textSuggestions=[],e.mixedSuggestion=null;else if(n!==null&&e.text!==n.text){let{key:l,shiftKey:c,ctrlKey:u,metaKey:f,altKey:d}=n.keyDown;switch(l){case"Enter":c&&(e.metrics.numCharsTyped+=1);break;case"Backspace":case"Delete":{let{text:p}=e,m=nh(n.text,p);n.text.length-p.length>1&&e.metrics.deletions.push(...m.filter(g=>g.removed).map(g=>g.value)),e.metrics.numCharsDeleted+=n.text.length-p.length;break}case"Shift":case"Meta":case"Tab":break;case"C":case"V":case"X":case"c":case"v":case"x":if(u||f)break;default:if(!u&&!f&&!d){e.metrics.numCharsTyped+=1;let p=((s=n.selection)==null?void 0:s.start)!==void 0&&((a=n.selection)==null?void 0:a.end)!==void 0?n.text.substring(n.selection.start,n.selection.end):null;p&&p.length>0&&(e.metrics.numCharsDeleted+=p.length,e.metrics.deletions.push(p))}}e.metrics.agentStartedTypingTimestamp||(e.metrics.agentStartedTypingTimestamp=Date.now())}e.beforeInputChange=null},sendMessage(e,t){e.pinnedSuggestions=e.pinnedSuggestions.filter(n=>!e.metrics.textSuggestions.some(r=>r.text===n.text&&r.source===n.source))},setSelection(e,t){t.payload!==null&&(zo(e.selection,t.payload)||(e.selection=t.payload))},commitSuggestion(e,t){let n=t.payload,{text:r,suggestion:{source:o,abVariant:i,abTestName:s,trainingJobs:a,sourceText:l,searchTerm:c,assistantCode:u,text:f},eventMetrics:{inputType:d},replace:p}=n,m=o==="search"||o==="personal-collection-search",g=r.slice(e.text.substring(0,e.selection.start).length);(m||p==="selection")&&(g=r),n.suggestion.source==="search-overlay"&&(g=f),e.metrics.textSuggestions.push({text:g,source:o,assistantCode:u,abVariant:i,abTestName:s,inputType:d,sourceText:l,trainingJobs:a||[],searchTerm:m?e.text:c}),e.textSuggestions=[],e.selectedSuggestionIndex=-1},offeredTextSuggestion(e,t){let{text:n,suggestion:{source:r}}=t.payload;e.metrics.offeredTextSuggestions.find(i=>i.text===n)||e.metrics.offeredTextSuggestions.push({text:n,source:r})},registerKeyDown(e,t){let{key:n}=t.payload;["Control","Meta","Shift","Alt"].includes(n)||(e.beforeInputChange={text:e.text,selection:e.selection,keyDown:t.payload})},registerKeyUp(e,t){},registerCut(e,t){let{metrics:n}=e,r=t.payload;e.metrics=A(E({},e.metrics),{numCharsCut:n.numCharsCut+r.length,cuts:[...n.cuts,r]})},registerPaste(e,t){let{metrics:n}=e,{text:r,selectionText:o}=t.payload,i=n.numCharsDeleted+(o!=null&&o.length?o.length:0),s=o!=null&&o.length?[...n.deletions,o]:n.deletions;e.metrics=A(E({},e.metrics),{numCharsDeleted:i,deletions:s,numCharsPasted:n.numCharsPasted+r.length,numPaste:n.numPaste+1,pastes:[...n.pastes,r]})},selectNextTextSuggestion(e){let t=e.textSuggestions.length+e.pinnedSuggestions.length;e.selectedSuggestionIndex=e.selectedSuggestionIndex<t-1?e.selectedSuggestionIndex+1:e.selectedSuggestionIndex},selectPreviousTextSuggestion(e){e.selectedSuggestionIndex=e.selectedSuggestionIndex>=0?e.selectedSuggestionIndex-1:e.selectedSuggestionIndex},selectTextSuggestionByIndex(e,t){e.selectedSuggestionIndex=t.payload},setTextSuggestions(e,t){if(e.selectedSuggestionIndex=-1,e.textSuggestions=t.payload,t.payload.length===0){e.mixedSuggestion=null;return}let n=Ni({input:e}),r=vb(t.payload,n);e.mixedSuggestion=r!=null&&r.text.includes(n)?r:null},setPinnedSuggestions(e,t){e.pinnedSuggestions=t.payload},removePinnedSuggestions(e,t){e.pinnedSuggestions=e.pinnedSuggestions.filter(r=>r.source!==t.payload.source||t.payload.assistantCode&&r.assistantCode!==t.payload.assistantCode?!0:t.payload.text?r.text!==t.payload.text:!1);let n=e.textSuggestions.length+e.pinnedSuggestions.length;e.selectedSuggestionIndex>n-1&&(e.selectedSuggestionIndex=-1)},setMetrics(e,{payload:t}){e.metrics=t},resetMetrics(e){e.metrics=Mi.metrics}},extraReducers:e=>{e.addCase(lt,t=>{t.mixedSuggestion=Mi.mixedSuggestion,t.textSuggestions=Mi.textSuggestions,t.selectedSuggestionIndex=Mi.selectedSuggestionIndex,t.metrics=Mi.metrics})}}),Ni=e=>{let{text:t,selection:n,suggestionTextStart:r}=e.input;return t.slice(r,n.end)},FO=e=>e.input.mixedSuggestion,zO=e=>e.input.pinnedSuggestions,HO=e=>e.input.textSuggestions,xl=e=>e.input.selectedSuggestionIndex,Oi=fn([HO,zO],(e,t)=>[...e,...t]),js=fn([Oi,FO,xl],(e,t,n)=>n>-1?e[n]:t),bb=e=>e.input.selection,{commitSuggestion:kn,offeredTextSuggestion:Eb,registerCut:Cb,registerKeyDown:Tb,registerKeyUp:kb,registerPaste:Rb,selectNextTextSuggestion:Pb,selectPreviousTextSuggestion:Ib,selectTextSuggestionByIndex:bd,setInput:Ed,setMetrics:Ab,setPinnedSuggestions:Ks,removePinnedSuggestions:Li,setSelection:Cd,setTextSuggestions:Ho,resetMetrics:_b,sendMessage:Di}=wb.actions,Mb=wb.reducer;function Nb(e){try{return Intl.DateTimeFormat(void 0,{timeZone:e}),!0}catch(t){return!1}}var BO={agentInfo:void 0,agentSettings:{},visitorInfo:void 0,customData:void 0,platformVariables:void 0,fetchState:"idle",showNicknameDialog:!1},Gs=e=>{var t;return(t=e.info.agentInfo)!=null?t:null},Ob=e=>{var t;return(t=e.info.visitorInfo)!=null?t:null},Lb=e=>{var t;return(t=e.info.customData)!=null?t:null},bl=({info:{visitorInfo:e,agentInfo:t}})=>{var n,r;return{timezone:e!=null&&e.visitorTimeZone&&Nb(e.visitorTimeZone)?e.visitorTimeZone:nw,agentName:(n=t==null?void 0:t.agentNickname)!=null?n:"",visitorName:(r=e==null?void 0:e.visitorName)!=null?r:""}},UO=[["agentNickname","nickname"],["agentDefaultLocale","defaultLocale"],["agentEmail","email"]],Db=ge("info/setAgentNickname",(n,r)=>M(null,[n,r],function*({agentNickname:e},t){var s;let{deepdeskAPI:o}=t.extra,i=yield o.patchMe({nickname:e});return{agentNickname:(s=i==null?void 0:i.nickname)!=null?s:e}})),wl=ge("info/setAgentInfo",(e,t)=>M(null,null,function*(){var i,s,a;let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=[];if(e.agentId&&e.skipSync!==!0&&o.push(n.postIdentity({externalId:e.agentId})),e.skipSync!==!0){let l=UO.reduce((c,[u,f])=>!r[f]&&u in e?A(E({},c),{[f]:e[u]}):c,{});Object.keys(l).length>0&&o.push(n.patchMe(l).then(c=>r=c))}return o.length>0&&(yield Promise.all(o)),{agentId:e.agentId,agentName:e.agentName,agentNickname:(i=r.nickname)!=null?i:e.agentNickname,agentEmail:(s=r.email)!=null?s:e.agentEmail,agentDefaultLocale:(a=r.defaultLocale)!=null?a:e.agentDefaultLocale,agentTimeZone:e.agentTimeZone}})),ah=ge("info/setAgentSettings",(e,t)=>M(null,null,function*(){let{deepdeskAPI:n}=t.extra,r=yield n.getMe(),o=E(E({},typeof r.uiConfig=="object"?r.uiConfig:{}),e);return yield n.patchMe({uiConfig:o}),o})),lh=ge("info/getAgentSettings",(e,t)=>M(null,null,function*(){let{deepdeskAPI:n}=t.extra;return(yield n.getMe()).uiConfig})),Fb=Re({name:"info",initialState:BO,reducers:{setVisitorInfo(e,t){e.visitorInfo=E(E({},e.visitorInfo),t.payload)},setCustomData(e,t){e.customData=t.payload},setPlatformVariables(e,t){e.platformVariables=t.payload},setShowNicknameDialog(e,t){e.showNicknameDialog=t.payload}},extraReducers:e=>{e.addCase(wl.pending,(t,n)=>{t.fetchState="loading",t.agentInfo=E(E({},t.agentInfo),n.meta.arg)}).addCase(wl.rejected,t=>{t.fetchState="error"}).addCase(wl.fulfilled,(t,n)=>{t.fetchState="done",t.agentInfo=n.payload}).addCase(ah.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(lh.fulfilled,(t,n)=>{t.agentSettings=n.payload}).addCase(lt,t=>{t.visitorInfo=void 0})}}),{setVisitorInfo:zb,setCustomData:Hb,setPlatformVariables:Bb,setShowNicknameDialog:Ub}=Fb.actions,Vb=Fb.reducer;function or(e,t){return t?e==null?(te.warn("replaceVars called with non-string text; upstream contract violation",{keys:Object.keys(t)}),e):Object.entries(t).reduce((n,[r,o])=>n.replaceAll(r,o),e):e}var Td={list:[],fetchState:"idle",isOpen:!1,page:"search",aggregates:{}},Wb=e=>e.search.isOpen,$b=e=>e.search.page,ch=e=>e.search.list,jb=e=>e.search.aggregates,VO=fn([ch,(e,t)=>t],(e,t)=>e.filter(n=>n.type===t)),Kb=e=>t=>VO(t,e),Fi=ge("search/getAll",(e,t)=>M(null,null,function*(){var l;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(l=r.conversation.current)==null?void 0:l.profileCode,{platformVariables:i}=r.info;if(!o)throw new Error("Profile should be provided in order to be able to search");let{results:s,aggregates:a}=yield n.search({profile:o,query:e.query,tags:e.tags,size:e.size,current:e.current,filters:{type:e.type},params:bl(r)});return{results:s.map(c=>A(E(E({},c),c.title&&i?{title:or(c.title,i)}:{}),{text:or(c.text,i!=null?i:{}),source:`search-${c.type.toLowerCase()}`,searchTerm:e.query})),aggregates:a}})),Gb=Re({name:"search",initialState:Td,reducers:{setIsOpen(e,t){e.isOpen=t.payload},setPage(e,t){e.page=t.payload},resetSearch(e){e.fetchState=Td.fetchState,e.list=Td.list}},extraReducers:e=>{e.addCase(Fi.pending,t=>{t.fetchState="loading"}).addCase(Fi.rejected,(t,n)=>{t.fetchState="error",te.error(n.error)}).addCase(Fi.fulfilled,(t,n)=>{t.fetchState="done",t.list=n.payload.results,t.aggregates=n.payload.aggregates||{}}).addCase(lt,()=>Td)}}),{resetSearch:kd,setIsOpen:ir,setPage:qs}=Gb.actions,qb=Gb.reducer;var uh="SetOutputs",Ys="ShowLoginOverlay",El="UserLoggedIn",WO="UserLoggedOut",eo="ApplySuggestion",dh="ApplyImageSuggestion",$O="ShowCommandPalette",Rd="ShowNicknameDialog",Pd="ReduxAction",jO="RemovePinnedSuggestion",KO=e=>({[uh]:t=>{var o,i;let n=(o=e.getState().conversation.current)==null?void 0:o.externalId,r=(i=t==null?void 0:t.payload)==null?void 0:i.externalConversationId;r&&r!==n||e.dispatch(A(E({},t),{isBroadcasted:!0}))},[Pd]:t=>{t.isBroadcasted||e.dispatch(A(E({},t),{isBroadcasted:!0}))},[jO]:t=>{e.dispatch(Li(t))},[$O]:t=>{e.dispatch(ir(t.isOpen)),t.page&&e.dispatch(qs(t.page))},[Rd]:t=>{e.dispatch(Ub(t.showNicknameDialog))},[Ys]:t=>{e.dispatch(pb(t))},[El]:()=>{e.dispatch(Jr())},[WO]:()=>{e.dispatch(Jr())},[dh]:t=>{e.dispatch(wd({suggestion:t.suggestion}))},[eo]:t=>{e.dispatch(kn(A(E({},t),{eventMetrics:{inputType:"mouse"},replace:"selection"})))}}),Yb=KO;function Id(e){return ge("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,A(E({conversationId:r},o),{data:t.data}))})(e)}function Ze(){let e=Ee();return(t,n)=>M(null,null,function*(){yield e(Id({name:t,data:n}))})}var Xs=b(Z());function Ad(e,t){let n=(0,Xs.useRef)(e);n.current=e;let[r,o]=(0,Xs.useState)(void 0),[i,s]=(0,Xs.useState)(void 0),[a,l]=(0,Xs.useState)("idle"),c=Ee();return{error:i,state:a,data:r,call:d=>M(null,null,function*(){l("loading"),yield c(n.current(d)).unwrap().then(p=>{o(p),l("done"),t!=null&&t.onSuccess&&(t==null||t.onSuccess(p))}).catch(p=>{s(p),l("error"),t!=null&&t.onError&&(t==null||t.onError(p))})}),reset:()=>{l("idle"),o(void 0),s(void 0)}}}var Cl=b(Z()),Qb=b(I()),Xb=Cl.default.createContext(null),to=({broadcastEvents:e,children:t})=>{let n=Cl.default.useMemo(()=>e,[]);return(0,Qb.jsx)(Xb.Provider,{value:n,children:t})},pn=()=>{let e=(0,Cl.useContext)(Xb);if(!e)throw new Error("You should use the useBroadcastEvents within a BroadcastEventsProvider");return e};var zd=b(Z());var fh=function(e,t){return fh=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[o]=r[o])},fh(e,t)};function Tl(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fh(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Rn=function(){return Rn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Rn.apply(this,arguments)};function Zb(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function _d(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Md(e,t){var n=t&&t.cache?t.cache:JO,r=t&&t.serializer?t.serializer:QO,o=t&&t.strategy?t.strategy:qO;return o(e,{cache:n,serializer:r})}function GO(e){return e==null||typeof e=="number"||typeof e=="boolean"}function Jb(e,t,n,r){var o=GO(r)?r:n(r),i=t.get(o);return typeof i=="undefined"&&(i=e.call(this,r),t.set(o,i)),i}function eE(e,t,n){var r=Array.prototype.slice.call(arguments,3),o=n(r),i=t.get(o);return typeof i=="undefined"&&(i=e.apply(this,r),t.set(o,i)),i}function ph(e,t,n,r,o){return n.bind(t,e,r,o)}function qO(e,t){var n=e.length===1?Jb:eE;return ph(e,this,n,t.cache.create(),t.serializer)}function YO(e,t){return ph(e,this,eE,t.cache.create(),t.serializer)}function XO(e,t){return ph(e,this,Jb,t.cache.create(),t.serializer)}var QO=function(){return JSON.stringify(arguments)},ZO=(function(){function e(){this.cache=Object.create(null)}return e.prototype.get=function(t){return this.cache[t]},e.prototype.set=function(t,n){this.cache[t]=n},e})(),JO={create:function(){return new ZO}},Nd={variadic:YO,monadic:XO};var Od;(function(e){e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]="EXPECT_ARGUMENT_CLOSING_BRACE",e[e.EMPTY_ARGUMENT=2]="EMPTY_ARGUMENT",e[e.MALFORMED_ARGUMENT=3]="MALFORMED_ARGUMENT",e[e.EXPECT_ARGUMENT_TYPE=4]="EXPECT_ARGUMENT_TYPE",e[e.INVALID_ARGUMENT_TYPE=5]="INVALID_ARGUMENT_TYPE",e[e.EXPECT_ARGUMENT_STYLE=6]="EXPECT_ARGUMENT_STYLE",e[e.INVALID_NUMBER_SKELETON=7]="INVALID_NUMBER_SKELETON",e[e.INVALID_DATE_TIME_SKELETON=8]="INVALID_DATE_TIME_SKELETON",e[e.EXPECT_NUMBER_SKELETON=9]="EXPECT_NUMBER_SKELETON",e[e.EXPECT_DATE_TIME_SKELETON=10]="EXPECT_DATE_TIME_SKELETON",e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]="UNCLOSED_QUOTE_IN_ARGUMENT_STYLE",e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]="EXPECT_SELECT_ARGUMENT_OPTIONS",e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]="EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]="INVALID_PLURAL_ARGUMENT_OFFSET_VALUE",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]="EXPECT_SELECT_ARGUMENT_SELECTOR",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]="EXPECT_PLURAL_ARGUMENT_SELECTOR",e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]="EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT",e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]="EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT",e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]="INVALID_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]="DUPLICATE_PLURAL_ARGUMENT_SELECTOR",e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]="DUPLICATE_SELECT_ARGUMENT_SELECTOR",e[e.MISSING_OTHER_CLAUSE=22]="MISSING_OTHER_CLAUSE",e[e.INVALID_TAG=23]="INVALID_TAG",e[e.INVALID_TAG_NAME=25]="INVALID_TAG_NAME",e[e.UNMATCHED_CLOSING_TAG=26]="UNMATCHED_CLOSING_TAG",e[e.UNCLOSED_TAG=27]="UNCLOSED_TAG"})(Od||(Od={}));var Ld=class{constructor(t){console.warn(`[vite-messages-plugin]: Message "${t}" was not precompiled. Did you use the correct extenstion *.messages.ts?`)}};var Un;(function(e){e[e.literal=0]="literal",e[e.argument=1]="argument",e[e.number=2]="number",e[e.date=3]="date",e[e.time=4]="time",e[e.select=5]="select",e[e.plural=6]="plural",e[e.pound=7]="pound",e[e.tag=8]="tag"})(Un||(Un={}));var Dd;(function(e){e[e.number=0]="number",e[e.dateTime=1]="dateTime"})(Dd||(Dd={}));function mh(e){return e.type===Un.literal}function gh(e){return e.type===Un.argument}function kl(e){return e.type===Un.number}function Rl(e){return e.type===Un.date}function Pl(e){return e.type===Un.time}function Il(e){return e.type===Un.select}function Al(e){return e.type===Un.plural}function tE(e){return e.type===Un.pound}function _l(e){return e.type===Un.tag}function Fd(e){return!!(e&&typeof e=="object"&&e.type===Dd.number)}function Ml(e){return!!(e&&typeof e=="object"&&e.type===Dd.dateTime)}function hh(e){e.forEach(function(t){if(delete t.location,Il(t)||Al(t))for(var n in t.options)delete t.options[n].location,hh(t.options[n].value);else kl(t)&&Fd(t.style)||(Rl(t)||Pl(t))&&Ml(t.style)?delete t.style.location:_l(t)&&hh(t.children)})}function nE(e,t){t===void 0&&(t={}),t=Rn({shouldParseSkeletons:!0,requiresOtherClause:!0},t);var n=new Ld(e,t).parse();if(n.err){var r=SyntaxError(Od[n.err.kind]);throw r.location=n.err.location,r.originalMessage=n.err.message,r}return t!=null&&t.captureLocation||hh(n.val),n.val}var zi;(function(e){e.MISSING_VALUE="MISSING_VALUE",e.INVALID_VALUE="INVALID_VALUE",e.MISSING_INTL_API="MISSING_INTL_API"})(zi||(zi={}));var Nl=(function(e){Tl(t,e);function t(n,r,o){var i=e.call(this,n)||this;return i.code=r,i.originalMessage=o,i}return t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t})(Error);var yh=(function(e){Tl(t,e);function t(n,r,o,i){return e.call(this,'Invalid values for "'.concat(n,'": "').concat(r,'". Options are "').concat(Object.keys(o).join('", "'),'"'),zi.INVALID_VALUE,i)||this}return t})(Nl);var rE=(function(e){Tl(t,e);function t(n,r,o){return e.call(this,'Value for "'.concat(n,'" must be of type ').concat(r),zi.INVALID_VALUE,o)||this}return t})(Nl);var oE=(function(e){Tl(t,e);function t(n,r){return e.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(r,'"'),zi.MISSING_VALUE,r)||this}return t})(Nl);var zt;(function(e){e[e.literal=0]="literal",e[e.object=1]="object"})(zt||(zt={}));function eL(e){return e.length<2?e:e.reduce(function(t,n){var r=t[t.length-1];return!r||r.type!==zt.literal||n.type!==zt.literal?t.push(n):r.value+=n.value,t},[])}function tL(e){return typeof e=="function"}function Ol(e,t,n,r,o,i,s){if(e.length===1&&mh(e[0]))return[{type:zt.literal,value:e[0].value}];for(var a=[],l=0,c=e;l<c.length;l++){var u=c[l];if(mh(u)){a.push({type:zt.literal,value:u.value});continue}if(tE(u)){typeof i=="number"&&a.push({type:zt.literal,value:n.getNumberFormat(t).format(i)});continue}var f=u.value;if(!(o&&f in o))throw new oE(f,s);var d=o[f];if(gh(u)){(!d||typeof d=="string"||typeof d=="number")&&(d=typeof d=="string"||typeof d=="number"?String(d):""),a.push({type:typeof d=="string"?zt.literal:zt.object,value:d});continue}if(Rl(u)){var p=typeof u.style=="string"?r.date[u.style]:Ml(u.style)?u.style.parsedOptions:void 0;a.push({type:zt.literal,value:n.getDateTimeFormat(t,p).format(d)});continue}if(Pl(u)){var p=typeof u.style=="string"?r.time[u.style]:Ml(u.style)?u.style.parsedOptions:r.time.medium;a.push({type:zt.literal,value:n.getDateTimeFormat(t,p).format(d)});continue}if(kl(u)){var p=typeof u.style=="string"?r.number[u.style]:Fd(u.style)?u.style.parsedOptions:void 0;p&&p.scale&&(d=d*(p.scale||1)),a.push({type:zt.literal,value:n.getNumberFormat(t,p).format(d)});continue}if(_l(u)){var m=u.children,g=u.value,v=o[g];if(!tL(v))throw new rE(g,"function",s);var h=Ol(m,t,n,r,o,i),y=v(h.map(function(T){return T.value}));Array.isArray(y)||(y=[y]),a.push.apply(a,y.map(function(T){return{type:typeof T=="string"?zt.literal:zt.object,value:T}}))}if(Il(u)){var S=u.options[d]||u.options.other;if(!S)throw new yh(u.value,d,Object.keys(u.options),s);a.push.apply(a,Ol(S.value,t,n,r,o));continue}if(Al(u)){var S=u.options["=".concat(d)];if(!S){if(!Intl.PluralRules)throw new Nl(`Intl.PluralRules is not available in this environment.
13
13
  Try polyfilling it using "@formatjs/intl-pluralrules"
14
- `,Fs.MISSING_INTL_API,i);var x=n.getPluralRules(t,{type:u.pluralType}).select(d-(u.offset||0));v=u.options[x]||u.options.other}if(!v)throw new eh(u.value,d,Object.keys(u.options),i);a.push.apply(a,Il(v.value,t,n,r,o,d-(u.offset||0)));continue}}return kL(a)}function PL(e,t){return t?Tn(Tn(Tn({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=Tn(Tn({},e[r]),t[r]||{}),n},{})):e}function IL(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=PL(e[r],t[r]),n},Tn({},e)):e}function th(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function AL(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:vd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,yd([void 0],n,!1)))},{cache:th(e.number),strategy:Sd.variadic}),getDateTimeFormat:vd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,yd([void 0],n,!1)))},{cache:th(e.dateTime),strategy:Sd.variadic}),getPluralRules:vd(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,yd([void 0],n,!1)))},{cache:th(e.pluralRules),strategy:Sd.variadic})}}var nh=(function(){function e(t,n,r,o){n===void 0&&(n=e.defaultLocale);var s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(c){var u=s.formatToParts(c);if(u.length===1)return u[0].value;var f=u.reduce(function(d,p){return!d.length||p.type!==Dt.literal||typeof d[d.length-1]!="string"?d.push(p.value):d[d.length-1]+=p.value,d},[]);return f.length<=1?f[0]||"":f},this.formatToParts=function(c){return Il(s.ast,s.locales,s.formatters,s.formats,c,void 0,s.message)},this.resolvedOptions=function(){var c;return{locale:((c=s.resolvedLocale)===null||c===void 0?void 0:c.toString())||Intl.NumberFormat.supportedLocalesOf(s.locales)[0]}},this.getAst=function(){return s.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var i=o||{},a=i.formatters,l=_b(i,["formatters"]);this.ast=e.__parse(t,Tn(Tn({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=IL(e.formats,r),this.formatters=o&&o.formatters||AL(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(typeof Intl.Locale!="undefined"){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=Ob,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();function _L(e,t){return t.split(".").reduce((n,r)=>n?n[r]:void 0,e)}var NL="dummy",rh=(0,Cd.createContext)(null);function ie(e){var r;let t=(0,Cd.useContext)(rh);if(!t)throw new Error("useTranslator() may be used only in the context of a <LocaleContext> component.");let n=(r=e[t])!=null?r:{};return(o,s)=>{let i=_L(n,o);return i?new nh(i).format(s):(t!==NL&&console.warn(`${o} does not exist in messages of ${t}`),`[${o}]`)}}function lh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Hs=lh();function jb(e){Hs=e}var Nl={exec:()=>null};function Ie(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,s)=>{let i=typeof s=="string"?s:s.source;return i=i.replace(qt.caret,"$1"),n=n.replace(o,i),r},getRegex:()=>new RegExp(n,t)};return r}var qt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},ML=/^(?:[ \t]*(?:\n|$))+/,LL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,OL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ml=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,DL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ch=/(?:[*+-]|\d{1,9}[.)])/,Wb=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$b=Ie(Wb).replace(/bull/g,ch).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),FL=Ie(Wb).replace(/bull/g,ch).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),uh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zL=/^[^\n]+/,dh=/(?!\s*\])(?:\\.|[^\[\]\\])+/,HL=Ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),BL=Ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ch).getRegex(),Ad="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,UL=Ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fh).replace("tag",Ad).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Kb=Ie(uh).replace("hr",Ml).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ad).getRegex(),VL=Ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Kb).getRegex(),ph={blockquote:VL,code:LL,def:HL,fences:OL,heading:DL,hr:Ml,html:UL,lheading:$b,list:BL,newline:ML,paragraph:Kb,table:Nl,text:zL},zb=Ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ml).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ad).getRegex(),jL=I(b({},ph),{lheading:FL,table:zb,paragraph:Ie(uh).replace("hr",Ml).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",zb).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ad).getRegex()}),WL=I(b({},ph),{html:Ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Nl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ie(uh).replace("hr",Ml).replace("heading",` *#{1,6} *[^
15
- ]`).replace("lheading",$b).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),$L=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,KL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Gb=/^( {2,}|\\)\n(?!\s*$)/,GL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_d=/[\p{P}\p{S}]/u,mh=/[\s\p{P}\p{S}]/u,qb=/[^\s\p{P}\p{S}]/u,qL=Ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mh).getRegex(),Yb=/(?!~)[\p{P}\p{S}]/u,YL=/(?!~)[\s\p{P}\p{S}]/u,XL=/(?:[^\s\p{P}\p{S}]|~)/u,QL=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Xb=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ZL=Ie(Xb,"u").replace(/punct/g,_d).getRegex(),JL=Ie(Xb,"u").replace(/punct/g,Yb).getRegex(),Qb="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",eO=Ie(Qb,"gu").replace(/notPunctSpace/g,qb).replace(/punctSpace/g,mh).replace(/punct/g,_d).getRegex(),tO=Ie(Qb,"gu").replace(/notPunctSpace/g,XL).replace(/punctSpace/g,YL).replace(/punct/g,Yb).getRegex(),nO=Ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,qb).replace(/punctSpace/g,mh).replace(/punct/g,_d).getRegex(),rO=Ie(/\\(punct)/,"gu").replace(/punct/g,_d).getRegex(),oO=Ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),sO=Ie(fh).replace("(?:-->|$)","-->").getRegex(),iO=Ie("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",sO).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rd=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,aO=Ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Rd).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zb=Ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Rd).replace("ref",dh).getRegex(),Jb=Ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",dh).getRegex(),lO=Ie("reflink|nolink(?!\\()","g").replace("reflink",Zb).replace("nolink",Jb).getRegex(),gh={_backpedal:Nl,anyPunctuation:rO,autolink:oO,blockSkip:QL,br:Gb,code:KL,del:Nl,emStrongLDelim:ZL,emStrongRDelimAst:eO,emStrongRDelimUnd:nO,escape:$L,link:aO,nolink:Jb,punctuation:qL,reflink:Zb,reflinkSearch:lO,tag:iO,text:GL,url:Nl},cO=I(b({},gh),{link:Ie(/^!?\[(label)\]\((.*?)\)/).replace("label",Rd).getRegex(),reflink:Ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rd).getRegex()}),sh=I(b({},gh),{emStrongRDelimAst:tO,emStrongLDelim:JL,url:Ie(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),uO=I(b({},sh),{br:Ie(Gb).replace("{2,}","*").getRegex(),text:Ie(sh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Td={normal:ph,gfm:jL,pedantic:WL},Al={normal:gh,gfm:sh,breaks:uO,pedantic:cO},dO={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hb=e=>dO[e];function Pr(e,t){if(t){if(qt.escapeTest.test(e))return e.replace(qt.escapeReplace,Hb)}else if(qt.escapeTestNoEncode.test(e))return e.replace(qt.escapeReplaceNoEncode,Hb);return e}function Bb(e){try{e=encodeURI(e).replace(qt.percentDecode,"%")}catch(t){return null}return e}function Ub(e,t){var s;let n=e.replace(qt.findPipe,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(qt.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(qt.slashPipe,"|");return r}function _l(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let s=e.charAt(r-o-1);if(s===t&&!n)o++;else if(s!==t&&n)o++;else break}return e.slice(0,r-o)}function fO(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Vb(e,t,n,r,o){let s=t.href,i=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function pO(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
16
- `).map(s=>{let i=s.match(n.other.beginningSpace);if(i===null)return s;let[a]=i;return a.length>=o.length?s.slice(o.length):s}).join(`
17
- `)}var Pd=class{constructor(e){Te(this,"options");Te(this,"rules");Te(this,"lexer");this.options=e||Hs}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:_l(n,`
18
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=pO(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=_l(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:_l(t[0],`
19
- `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=_l(t[0],`
14
+ `,zi.MISSING_INTL_API,s);var x=n.getPluralRules(t,{type:u.pluralType}).select(d-(u.offset||0));S=u.options[x]||u.options.other}if(!S)throw new yh(u.value,d,Object.keys(u.options),s);a.push.apply(a,Ol(S.value,t,n,r,o,d-(u.offset||0)));continue}}return eL(a)}function nL(e,t){return t?Rn(Rn(Rn({},e||{}),t||{}),Object.keys(e).reduce(function(n,r){return n[r]=Rn(Rn({},e[r]),t[r]||{}),n},{})):e}function rL(e,t){return t?Object.keys(e).reduce(function(n,r){return n[r]=nL(e[r],t[r]),n},Rn({},e)):e}function vh(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,n){e[t]=n}}}}}function oL(e){return e===void 0&&(e={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:Md(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.NumberFormat).bind.apply(t,_d([void 0],n,!1)))},{cache:vh(e.number),strategy:Nd.variadic}),getDateTimeFormat:Md(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.DateTimeFormat).bind.apply(t,_d([void 0],n,!1)))},{cache:vh(e.dateTime),strategy:Nd.variadic}),getPluralRules:Md(function(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new((t=Intl.PluralRules).bind.apply(t,_d([void 0],n,!1)))},{cache:vh(e.pluralRules),strategy:Nd.variadic})}}var Sh=(function(){function e(t,n,r,o){n===void 0&&(n=e.defaultLocale);var i=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(c){var u=i.formatToParts(c);if(u.length===1)return u[0].value;var f=u.reduce(function(d,p){return!d.length||p.type!==zt.literal||typeof d[d.length-1]!="string"?d.push(p.value):d[d.length-1]+=p.value,d},[]);return f.length<=1?f[0]||"":f},this.formatToParts=function(c){return Ol(i.ast,i.locales,i.formatters,i.formats,c,void 0,i.message)},this.resolvedOptions=function(){var c;return{locale:((c=i.resolvedLocale)===null||c===void 0?void 0:c.toString())||Intl.NumberFormat.supportedLocalesOf(i.locales)[0]}},this.getAst=function(){return i.ast},this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t=="string"){if(this.message=t,!e.__parse)throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");var s=o||{},a=s.formatters,l=Zb(s,["formatters"]);this.ast=e.__parse(t,Rn(Rn({},l),{locale:this.resolvedLocale}))}else this.ast=t;if(!Array.isArray(this.ast))throw new TypeError("A message must be provided as a String or AST.");this.formats=rL(e.formats,r),this.formatters=o&&o.formatters||oL(this.formatterCache)}return Object.defineProperty(e,"defaultLocale",{get:function(){return e.memoizedDefaultLocale||(e.memoizedDefaultLocale=new Intl.NumberFormat().resolvedOptions().locale),e.memoizedDefaultLocale},enumerable:!1,configurable:!0}),e.memoizedDefaultLocale=null,e.resolveLocale=function(t){if(typeof Intl.Locale!="undefined"){var n=Intl.NumberFormat.supportedLocalesOf(t);return n.length>0?new Intl.Locale(n[0]):new Intl.Locale(typeof t=="string"?t:t[0])}},e.__parse=nE,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e})();function iL(e,t){return t.split(".").reduce((n,r)=>n?n[r]:void 0,e)}var sL="dummy",xh=(0,zd.createContext)(null);function se(e){var r;let t=(0,zd.useContext)(xh);if(!t)throw new Error("useTranslator() may be used only in the context of a <LocaleContext> component.");let n=(r=e[t])!=null?r:{};return(o,i)=>{let s=iL(n,o);return s?new Sh(s).format(i):(t!==sL&&console.warn(`${o} does not exist in messages of ${t}`),`[${o}]`)}}function Th(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Bi=Th();function uE(e){Bi=e}var Fl={exec:()=>null};function Ie(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(o,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Xt.caret,"$1"),n=n.replace(o,s),r},getRegex:()=>new RegExp(n,t)};return r}var Xt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},aL=/^(?:[ \t]*(?:\n|$))+/,lL=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,cL=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,uL=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,kh=/(?:[*+-]|\d{1,9}[.)])/,dE=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fE=Ie(dE).replace(/bull/g,kh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),dL=Ie(dE).replace(/bull/g,kh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Rh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,fL=/^[^\n]+/,Ph=/(?!\s*\])(?:\\.|[^\[\]\\])+/,pL=Ie(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ph).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),mL=Ie(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,kh).getRegex(),$d="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ih=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,gL=Ie("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ih).replace("tag",$d).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pE=Ie(Rh).replace("hr",zl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$d).getRegex(),hL=Ie(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",pE).getRegex(),Ah={blockquote:hL,code:lL,def:pL,fences:cL,heading:uL,hr:zl,html:gL,lheading:fE,list:mL,newline:aL,paragraph:pE,table:Fl,text:fL},iE=Ie("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$d).getRegex(),yL=A(E({},Ah),{lheading:dL,table:iE,paragraph:Ie(Rh).replace("hr",zl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",iE).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",$d).getRegex()}),vL=A(E({},Ah),{html:Ie(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ih).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ie(Rh).replace("hr",zl).replace("heading",` *#{1,6} *[^
15
+ ]`).replace("lheading",fE).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),SL=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mE=/^( {2,}|\\)\n(?!\s*$)/,wL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,jd=/[\p{P}\p{S}]/u,_h=/[\s\p{P}\p{S}]/u,gE=/[^\s\p{P}\p{S}]/u,bL=Ie(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_h).getRegex(),hE=/(?!~)[\p{P}\p{S}]/u,EL=/(?!~)[\s\p{P}\p{S}]/u,CL=/(?:[^\s\p{P}\p{S}]|~)/u,TL=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,yE=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,kL=Ie(yE,"u").replace(/punct/g,jd).getRegex(),RL=Ie(yE,"u").replace(/punct/g,hE).getRegex(),vE="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",PL=Ie(vE,"gu").replace(/notPunctSpace/g,gE).replace(/punctSpace/g,_h).replace(/punct/g,jd).getRegex(),IL=Ie(vE,"gu").replace(/notPunctSpace/g,CL).replace(/punctSpace/g,EL).replace(/punct/g,hE).getRegex(),AL=Ie("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,gE).replace(/punctSpace/g,_h).replace(/punct/g,jd).getRegex(),_L=Ie(/\\(punct)/,"gu").replace(/punct/g,jd).getRegex(),ML=Ie(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),NL=Ie(Ih).replace("(?:-->|$)","-->").getRegex(),OL=Ie("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",NL).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ud=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,LL=Ie(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ud).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),SE=Ie(/^!?\[(label)\]\[(ref)\]/).replace("label",Ud).replace("ref",Ph).getRegex(),xE=Ie(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ph).getRegex(),DL=Ie("reflink|nolink(?!\\()","g").replace("reflink",SE).replace("nolink",xE).getRegex(),Mh={_backpedal:Fl,anyPunctuation:_L,autolink:ML,blockSkip:TL,br:mE,code:xL,del:Fl,emStrongLDelim:kL,emStrongRDelimAst:PL,emStrongRDelimUnd:AL,escape:SL,link:LL,nolink:xE,punctuation:bL,reflink:SE,reflinkSearch:DL,tag:OL,text:wL,url:Fl},FL=A(E({},Mh),{link:Ie(/^!?\[(label)\]\((.*?)\)/).replace("label",Ud).getRegex(),reflink:Ie(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ud).getRegex()}),bh=A(E({},Mh),{emStrongRDelimAst:IL,emStrongLDelim:RL,url:Ie(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),zL=A(E({},bh),{br:Ie(mE).replace("{2,}","*").getRegex(),text:Ie(bh.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),Hd={normal:Ah,gfm:yL,pedantic:vL},Ll={normal:Mh,gfm:bh,breaks:zL,pedantic:FL},HL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},sE=e=>HL[e];function Ir(e,t){if(t){if(Xt.escapeTest.test(e))return e.replace(Xt.escapeReplace,sE)}else if(Xt.escapeTestNoEncode.test(e))return e.replace(Xt.escapeReplaceNoEncode,sE);return e}function aE(e){try{e=encodeURI(e).replace(Xt.percentDecode,"%")}catch(t){return null}return e}function lE(e,t){var i;let n=e.replace(Xt.findPipe,(s,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),r=n.split(Xt.splitPipe),o=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;o<r.length;o++)r[o]=r[o].trim().replace(Xt.slashPipe,"|");return r}function Dl(e,t,n){let r=e.length;if(r===0)return"";let o=0;for(;o<r;){let i=e.charAt(r-o-1);if(i===t&&!n)o++;else if(i!==t&&n)o++;else break}return e.slice(0,r-o)}function BL(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function cE(e,t,n,r,o){let i=t.href,s=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}function UL(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let o=r[1];return t.split(`
16
+ `).map(i=>{let s=i.match(n.other.beginningSpace);if(s===null)return i;let[a]=s;return a.length>=o.length?i.slice(o.length):i}).join(`
17
+ `)}var Vd=class{constructor(e){xe(this,"options");xe(this,"rules");xe(this,"lexer");this.options=e||Bi}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Dl(n,`
18
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let n=t[0],r=UL(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){let r=Dl(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Dl(t[0],`
19
+ `)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let n=Dl(t[0],`
20
20
  `).split(`
21
- `),r="",o="",s=[];for(;n.length>0;){let i=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),i=!0;else if(!i)a.push(n[l]);else break;n=n.slice(l);let c=a.join(`
21
+ `),r="",o="",i=[];for(;n.length>0;){let s=!1,a=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))a.push(n[l]),s=!0;else if(!s)a.push(n[l]);else break;n=n.slice(l);let c=a.join(`
22
22
  `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
23
23
  $1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
24
24
  ${c}`:c,o=o?`${o}
25
- ${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=f,n.length===0)break;let d=s.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){let p=d,h=p.raw+`
25
+ ${u}`:u;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,i,!0),this.lexer.state.top=f,n.length===0)break;let d=i.at(-1);if((d==null?void 0:d.type)==="code")break;if((d==null?void 0:d.type)==="blockquote"){let p=d,m=p.raw+`
26
26
  `+n.join(`
27
- `),m=this.blockquote(h);s[s.length-1]=m,r=r.substring(0,r.length-p.raw.length)+m.raw,o=o.substring(0,o.length-p.text.length)+m.text;break}else if((d==null?void 0:d.type)==="list"){let p=d,h=p.raw+`
27
+ `),g=this.blockquote(m);i[i.length-1]=g,r=r.substring(0,r.length-p.raw.length)+g.raw,o=o.substring(0,o.length-p.text.length)+g.text;break}else if((d==null?void 0:d.type)==="list"){let p=d,m=p.raw+`
28
28
  `+n.join(`
29
- `),m=this.list(h);s[s.length-1]=m,r=r.substring(0,r.length-d.raw.length)+m.raw,o=o.substring(0,o.length-p.raw.length)+m.raw,n=h.substring(s.at(-1).raw.length).split(`
30
- `);continue}}return{type:"blockquote",raw:r,tokens:s,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),i=!1;for(;e;){let l=!1,c="",u="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
31
- `,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),d=e.split(`
32
- `,1)[0],p=!f.trim(),h=0;if(this.options.pedantic?(h=2,u=f.trimStart()):p?h=t[1].length+1:(h=t[2].search(this.rules.other.nonSpaceChar),h=h>4?1:h,u=f.slice(h),h+=t[1].length),p&&this.rules.other.blankLine.test(d)&&(c+=d+`
33
- `,e=e.substring(d.length+1),l=!0),!l){let y=this.rules.other.nextBulletRegex(h),g=this.rules.other.hrRegex(h),v=this.rules.other.fencesBeginRegex(h),x=this.rules.other.headingBeginRegex(h),C=this.rules.other.htmlBeginRegex(h);for(;e;){let T=e.split(`
34
- `,1)[0],k;if(d=T,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),k=d):k=d.replace(this.rules.other.tabCharGlobal," "),v.test(d)||x.test(d)||C.test(d)||y.test(d)||g.test(d))break;if(k.search(this.rules.other.nonSpaceChar)>=h||!d.trim())u+=`
35
- `+k.slice(h);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(f)||x.test(f)||g.test(f))break;u+=`
36
- `+d}!p&&!d.trim()&&(p=!0),c+=T+`
37
- `,e=e.substring(T.length+1),f=k.slice(h)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let m=null,S;this.options.gfm&&(m=this.rules.other.listIsTask.exec(u),m&&(S=m[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!m,checked:S,loose:!1,text:u,tokens:[]}),o.raw+=c}let a=o.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){let c=o.items[l].tokens.filter(f=>f.type==="space"),u=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=u}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:o}}}table(e){var i;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Ub(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
38
- `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of o)s.rows.push(Ub(a,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
39
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=_l(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=fO(t[2],"()");if(s===-2)return;if(s>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Vb(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return Vb(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let s=[...r[0]].length-1,i,a,l=s,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(r=u.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let f=[...r[0]][0].length,d=e.slice(0,s+r.index+f+a);if(Math.min(s,a)%2){let h=d.slice(1,-1);return{type:"em",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,r;let t;if(t=this.rules.inline.url.exec(e)){let o,s;if(t[2]==="@")o=t[0],s="mailto:"+o;else{let i;do i=t[0],t[0]=(r=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?r:"";while(i!==t[0]);o=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:o,href:s,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Zr=class ih{constructor(t){Te(this,"tokens");Te(this,"options");Te(this,"state");Te(this,"tokenizer");Te(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Hs,this.options.tokenizer=this.options.tokenizer||new Pd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:qt,block:Td.normal,inline:Al.normal};this.options.pedantic?(n.block=Td.pedantic,n.inline=Al.pedantic):this.options.gfm&&(n.block=Td.gfm,this.options.breaks?n.inline=Al.breaks:n.inline=Al.gfm),this.tokenizer.rules=n}static get rules(){return{block:Td,inline:Al}}static lex(t,n){return new ih(n).lex(t)}static lexInline(t,n){return new ih(n).inlineTokens(t)}lex(t){t=t.replace(qt.carriageReturn,`
40
- `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var o,s,i;for(this.options.pedantic&&(t=t.replace(qt.tabCharGlobal," ").replace(qt.spaceLine,""));t;){let a;if((s=(o=this.options.extensions)==null?void 0:o.block)!=null&&s.some(c=>(a=c.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let c=n.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
29
+ `),g=this.list(m);i[i.length-1]=g,r=r.substring(0,r.length-d.raw.length)+g.raw,o=o.substring(0,o.length-p.raw.length)+g.raw,n=m.substring(i.at(-1).raw.length).split(`
30
+ `);continue}}return{type:"blockquote",raw:r,tokens:i,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let i=this.rules.other.listItemRegex(n),s=!1;for(;e;){let l=!1,c="",u="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let f=t[2].split(`
31
+ `,1)[0].replace(this.rules.other.listReplaceTabs,h=>" ".repeat(3*h.length)),d=e.split(`
32
+ `,1)[0],p=!f.trim(),m=0;if(this.options.pedantic?(m=2,u=f.trimStart()):p?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,u=f.slice(m),m+=t[1].length),p&&this.rules.other.blankLine.test(d)&&(c+=d+`
33
+ `,e=e.substring(d.length+1),l=!0),!l){let h=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),S=this.rules.other.fencesBeginRegex(m),x=this.rules.other.headingBeginRegex(m),T=this.rules.other.htmlBeginRegex(m);for(;e;){let C=e.split(`
34
+ `,1)[0],k;if(d=C,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),k=d):k=d.replace(this.rules.other.tabCharGlobal," "),S.test(d)||x.test(d)||T.test(d)||h.test(d)||y.test(d))break;if(k.search(this.rules.other.nonSpaceChar)>=m||!d.trim())u+=`
35
+ `+k.slice(m);else{if(p||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||x.test(f)||y.test(f))break;u+=`
36
+ `+d}!p&&!d.trim()&&(p=!0),c+=C+`
37
+ `,e=e.substring(C.length+1),f=k.slice(m)}}o.loose||(s?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(s=!0));let g=null,v;this.options.gfm&&(g=this.rules.other.listIsTask.exec(u),g&&(v=g[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!g,checked:v,loose:!1,text:u,tokens:[]}),o.raw+=c}let a=o.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){let c=o.items[l].tokens.filter(f=>f.type==="space"),u=c.length>0&&c.some(f=>this.rules.other.anyLine.test(f.raw));o.loose=u}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:o}}}table(e){var s;let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=lE(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(s=t[3])!=null&&s.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
38
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?i.align.push("right"):this.rules.other.tableAlignCenter.test(a)?i.align.push("center"):this.rules.other.tableAlignLeft.test(a)?i.align.push("left"):i.align.push(null);for(let a=0;a<n.length;a++)i.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:i.align[a]});for(let a of o)i.rows.push(lE(a,i.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:i.align[c]})));return i}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let n=t[1].charAt(t[1].length-1)===`
39
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let i=Dl(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{let i=BL(t[2],"()");if(i===-2)return;if(i>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],o=i[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),cE(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[r.toLowerCase()];if(!o){let i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return cE(n,o,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let i=[...r[0]].length-1,s,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+i);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let f=[...r[0]][0].length,d=e.slice(0,i+r.index+f+a);if(Math.min(i,a)%2){let m=d.slice(1,-1);return{type:"em",raw:d,text:m,tokens:this.lexer.inlineTokens(m)}}let p=d.slice(2,-2);return{type:"strong",raw:d,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),o=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&o&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let n,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,r;let t;if(t=this.rules.inline.url.exec(e)){let o,i;if(t[2]==="@")o=t[0],i="mailto:"+o;else{let s;do s=t[0],t[0]=(r=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?r:"";while(s!==t[0]);o=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:o,href:i,tokens:[{type:"text",raw:o,text:o}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},no=class Eh{constructor(t){xe(this,"tokens");xe(this,"options");xe(this,"state");xe(this,"tokenizer");xe(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Bi,this.options.tokenizer=this.options.tokenizer||new Vd,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:Xt,block:Hd.normal,inline:Ll.normal};this.options.pedantic?(n.block=Hd.pedantic,n.inline=Ll.pedantic):this.options.gfm&&(n.block=Hd.gfm,this.options.breaks?n.inline=Ll.breaks:n.inline=Ll.gfm),this.tokenizer.rules=n}static get rules(){return{block:Hd,inline:Ll}}static lex(t,n){return new Eh(n).lex(t)}static lexInline(t,n){return new Eh(n).inlineTokens(t)}lex(t){t=t.replace(Xt.carriageReturn,`
40
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var o,i,s;for(this.options.pedantic&&(t=t.replace(Xt.tabCharGlobal," ").replace(Xt.spaceLine,""));t;){let a;if((i=(o=this.options.extensions)==null?void 0:o.block)!=null&&i.some(c=>(a=c.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);let c=n.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
41
41
  `:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
42
42
  `+a.raw,c.text+=`
43
43
  `+a.text,this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
44
44
  `+a.raw,c.text+=`
45
- `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let l=t;if((i=this.options.extensions)!=null&&i.startBlock){let c=1/0,u=t.slice(1),f;this.options.extensions.startBlock.forEach(d=>{f=d.call({lexer:this},u),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=n.at(-1);r&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
45
+ `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let l=t;if((s=this.options.extensions)!=null&&s.startBlock){let c=1/0,u=t.slice(1),f;this.options.extensions.startBlock.forEach(d=>{f=d.call({lexer:this},u),typeof f=="number"&&f>=0&&(c=Math.min(c,f))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){let c=n.at(-1);r&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
46
46
  `+a.raw,c.text+=`
47
47
  `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a),r=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);let c=n.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
48
48
  `+a.raw,c.text+=`
49
- `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var a,l,c;let r=t,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;t;){s||(i=""),s=!1;let u;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(d=>(u=d.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);let d=n.at(-1);u.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,i)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let f=t;if((c=this.options.extensions)!=null&&c.startInline){let d=1/0,p=t.slice(1),h;this.options.extensions.startInline.forEach(m=>{h=m.call({lexer:this},p),typeof h=="number"&&h>=0&&(d=Math.min(d,h))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(u=this.tokenizer.inlineText(f)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(i=u.raw.slice(-1)),s=!0;let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},Id=class{constructor(e){Te(this,"options");Te(this,"parser");this.options=e||Hs}space(e){return""}code({text:e,lang:t,escaped:n}){var s;let r=(s=(t||"").match(qt.notSpaceStart))==null?void 0:s[0],o=e.replace(qt.endingNewline,"")+`
50
- `;return r?'<pre><code class="language-'+Pr(r)+'">'+(n?o:Pr(o,!0))+`</code></pre>
51
- `:"<pre><code>"+(n?o:Pr(o,!0))+`</code></pre>
49
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(a);continue}if(t){let c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var a,l,c;let r=t,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,s="";for(;t;){i||(s=""),i=!1;let u;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(d=>(u=d.call({lexer:this},t,n))?(t=t.substring(u.raw.length),n.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);let d=n.at(-1);u.type==="text"&&(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(u=this.tokenizer.emStrong(t,r,s)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),n.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),n.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),n.push(u);continue}let f=t;if((c=this.options.extensions)!=null&&c.startInline){let d=1/0,p=t.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},p),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(f=t.substring(0,d+1))}if(u=this.tokenizer.inlineText(f)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(s=u.raw.slice(-1)),i=!0;let d=n.at(-1);(d==null?void 0:d.type)==="text"?(d.raw+=u.raw,d.text+=u.text):n.push(u);continue}if(t){let d="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},Wd=class{constructor(e){xe(this,"options");xe(this,"parser");this.options=e||Bi}space(e){return""}code({text:e,lang:t,escaped:n}){var i;let r=(i=(t||"").match(Xt.notSpaceStart))==null?void 0:i[0],o=e.replace(Xt.endingNewline,"")+`
50
+ `;return r?'<pre><code class="language-'+Ir(r)+'">'+(n?o:Ir(o,!0))+`</code></pre>
51
+ `:"<pre><code>"+(n?o:Ir(o,!0))+`</code></pre>
52
52
  `}blockquote({tokens:e}){return`<blockquote>
53
53
  ${this.parser.parse(e)}</blockquote>
54
54
  `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
55
55
  `}hr(e){return`<hr>
56
- `}list(e){let t=e.ordered,n=e.start,r="";for(let i=0;i<e.items.length;i++){let a=e.items[i];r+=this.listitem(a)}let o=t?"ol":"ul",s=t&&n!==1?' start="'+n+'"':"";return"<"+o+s+`>
56
+ `}list(e){let t=e.ordered,n=e.start,r="";for(let s=0;s<e.items.length;s++){let a=e.items[s];r+=this.listitem(a)}let o=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+o+i+`>
57
57
  `+r+"</"+o+`>
58
- `}listitem(e){var n;let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Pr(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
58
+ `}listitem(e){var n;let t="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Ir(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
59
59
  `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
60
- `}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){let s=e.rows[o];n="";for(let i=0;i<s.length;i++)n+=this.tablecell(s[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
60
+ `}table(e){let t="",n="";for(let o=0;o<e.header.length;o++)n+=this.tablecell(e.header[o]);t+=this.tablerow({text:n});let r="";for(let o=0;o<e.rows.length;o++){let i=e.rows[o];n="";for(let s=0;s<i.length;s++)n+=this.tablecell(i[s]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
61
61
  <thead>
62
62
  `+t+`</thead>
63
63
  `+r+`</table>
64
64
  `}tablerow({text:e}){return`<tr>
65
65
  ${e}</tr>
66
66
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
67
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Pr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=Bb(e);if(o===null)return r;e=o;let s='<a href="'+e+'"';return t&&(s+=' title="'+Pr(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=Bb(e);if(o===null)return Pr(n);e=o;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${Pr(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Pr(e.text)}},hh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Jr=class ah{constructor(t){Te(this,"options");Te(this,"renderer");Te(this,"textRenderer");this.options=t||Hs,this.options.renderer=this.options.renderer||new Id,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new hh}static parse(t,n){return new ah(n).parse(t)}static parseInline(t,n){return new ah(n).parseInline(t)}parse(t,n=!0){var o,s;let r="";for(let i=0;i<t.length;i++){let a=t[i];if((s=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&s[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){r+=u||"";continue}}let l=a;switch(l.type){case"space":{r+=this.renderer.space(l);continue}case"hr":{r+=this.renderer.hr(l);continue}case"heading":{r+=this.renderer.heading(l);continue}case"code":{r+=this.renderer.code(l);continue}case"table":{r+=this.renderer.table(l);continue}case"blockquote":{r+=this.renderer.blockquote(l);continue}case"list":{r+=this.renderer.list(l);continue}case"html":{r+=this.renderer.html(l);continue}case"paragraph":{r+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;i+1<t.length&&t[i+1].type==="text";)c=t[++i],u+=`
68
- `+this.renderer.text(c);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,n=this.renderer){var o,s;let r="";for(let i=0;i<t.length;i++){let a=t[i];if((s=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&s[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},oh,kd=(oh=class{constructor(e){Te(this,"options");Te(this,"block");this.options=e||Hs}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Zr.lex:Zr.lexInline}provideParser(){return this.block?Jr.parse:Jr.parseInline}},Te(oh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),oh),yh=class{constructor(...e){Te(this,"defaults",lh());Te(this,"options",this.setOptions);Te(this,"parse",this.parseMarkdown(!0));Te(this,"parseInline",this.parseMarkdown(!1));Te(this,"Parser",Jr);Te(this,"Renderer",Id);Te(this,"TextRenderer",hh);Te(this,"Lexer",Zr);Te(this,"Tokenizer",Pd);Te(this,"Hooks",kd);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let s of e)switch(n=n.concat(t.call(this,s)),s.type){case"table":{let i=s;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of i.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=s;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let l=i[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r=b({},n);if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let s=t.renderers[o.name];s?t.renderers[o.name]=function(...i){let a=o.renderer.apply(this,i);return a===!1&&(a=s.apply(this,i)),a}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[o.level];s?s.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new Id(this.defaults);for(let s in n.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let i=s,a=n.renderer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new Pd(this.defaults);for(let s in n.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let i=s,a=n.tokenizer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new kd;for(let s in n.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let i=s,a=n.hooks[i],l=o[i];kd.passThroughHooks.has(s)?o[i]=c=>{if(this.defaults.async)return Promise.resolve(a.call(o,c)).then(f=>l.call(o,f));let u=a.call(o,c);return l.call(o,u)}:o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),o&&(a=a.concat(o.call(this,i))),a}}this.defaults=b(b({},this.defaults),r)}),this}setOptions(e){return this.defaults=b(b({},this.defaults),e),this}lexer(e,t){return Zr.lex(e,t!=null?t:this.defaults)}parser(e,t){return Jr.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(n,r)=>{let o=b({},r),s=b(b({},this.defaults),o),i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n=="undefined"||n===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);let a=s.hooks?s.hooks.provideLexer():e?Zr.lex:Zr.lexInline,l=s.hooks?s.hooks.provideParser():e?Jr.parse:Jr.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(n):n).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(n=s.hooks.preprocess(n));let c=a(n,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let u=l(c,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(c){return i(c)}}}onError(e,t){return n=>{if(n.message+=`
69
- Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Pr(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},zs=new yh;function Pe(e,t){return zs.parse(e,t)}Pe.options=Pe.setOptions=function(e){return zs.setOptions(e),Pe.defaults=zs.defaults,jb(Pe.defaults),Pe};Pe.getDefaults=lh;Pe.defaults=Hs;Pe.use=function(...e){return zs.use(...e),Pe.defaults=zs.defaults,jb(Pe.defaults),Pe};Pe.walkTokens=function(e,t){return zs.walkTokens(e,t)};Pe.parseInline=zs.parseInline;Pe.Parser=Jr;Pe.parser=Jr.parse;Pe.Renderer=Id;Pe.TextRenderer=hh;Pe.Lexer=Zr;Pe.lexer=Zr.lex;Pe.Tokenizer=Pd;Pe.Hooks=kd;Pe.parse=Pe;var uB=Pe.options,dB=Pe.setOptions,fB=Pe.use,pB=Pe.walkTokens,mB=Pe.parseInline;var gB=Jr.parse,hB=Zr.lex;var Nd=(e,t)=>{let n=[],r=new yh,o=s=>{s.type==="code"&&s.lang===t&&n.push(s.text)};return r.use({walkTokens:o}),r.parse(e),n};var eE={cues:[],threads:{},pending:[]},tE=e=>{var t;return(t=e.assistants)==null?void 0:t.cues};var nE=e=>t=>{var n,r;return(r=(n=t.assistants)==null?void 0:n.threads[e])!=null?r:null},Md=kt("assistants/callToAction"),Ll=pe("assistants/evaluateKnowledgeAssistant",(e,t)=>N(null,null,function*(){var c,u,f;let{threadId:n}=e,{onNewThreadId:r}=e,{deepdeskAPI:o}=t.extra,s=t.getState(),{platformVariables:i}=s.info;n||(n=(yield o.createAssistantThread({assistantCode:e.assistantCode})).id,r&&r(n)),yield o.postMessageToAssistantThread({assistantCode:e.assistantCode,threadId:n,message:e.input});let a=yield t.dispatch(fn(I(b({skipState:!0},e),{input:{},threadId:n})));if(a.error)throw new Error(a.error.message);let l=(c=a.payload.output[0])!=null?c:{response:"",sources:[]};return{threadId:n,question:e.input,evaluationId:a.payload.evaluationId,answer:{answer:(u=er(l.response,i!=null?i:{}))!=null?u:"",sources:(f=l.sources)!=null?f:[]}}})),LB=kt("assistants/extractedTextSuggestions");function mO(e,t){var n,r;return Array.isArray(e.output)?e.output:typeof e.output=="string"?[{code:t,name:t,response:e.output}]:[I(b({code:t,name:t},e.output&&typeof e.output=="object"?e.output:{}),{response:(r=(n=e.output)==null?void 0:n.response)!=null?r:""})]}var fn=pe("assistants/evaluate",(e,t)=>N(null,null,function*(){var S,y,g,v,x;let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra,{transcript:o,input:s={},threadId:i}=e,a=t.getState(),{platformVariables:l}=a.info,c=(y=(S=a.conversation.current)==null?void 0:S.externalId)!=null?y:null,u=(v=(g=e.externalConversationId)!=null?g:c)!=null?v:void 0,f;if(o==="in-memory-transcript"){if(!r.conversationQuery)throw new Error("Can't include in-memory-transcript, setConversationQuery is not defined");f=yield r.conversationQuery()}else Array.isArray(o)&&(f=o);if(e.includeMetadata&&a.conversation.current&&((x=e.externalConversationId)!=null?x:c)===c){let{metadata:T}=a.conversation.current;Object.assign(s,{metadata:T})}let d=yield n.evaluateAssistant(e.assistantCode,{input:s,transcript:f,externalConversationId:u,threadId:i});if(d.evaluationStatus!=="success")return t.rejectWithValue(`Assistant ${e.assistantCode} evaluation failed: ${d.evaluationStatus}`);let h=mO(d,e.assistantCode).map(C=>I(b({},C),{name:er(C.name,l),response:er(C.response,l)||""})),m=[];return h.forEach(C=>{if(!C.response)return;let T=Nd(C.response,"reply");T.length!==0&&m.push(...T.map(k=>({text:k,type:"text",source:"assistant",assistantCode:C.code,sourceLabel:C.name})))}),m.length>0&&t.dispatch(Bi(m)),I(b({},d),{output:h,externalConversationId:u,currentExternalIdAtRequest:c})}));function rE(e){return e!=null&&e.length?e.map(t=>t.response).filter(Boolean).join(`
70
- `):""}var oE=Re({name:"assistants",initialState:eE,reducers:{resetCues(e){e.cues=[]},removeCueByCode(e,t){e.cues=e.cues.filter(n=>n.code!==t.payload.code)},removeThreadById(e,t){delete e.threads[t.payload]},receiveChunk(e,t){let{code:n,name:r,payload:o,evaluationId:s}=t.payload,i=e.cues.findIndex(a=>a.code===n);i!==-1?e.cues[i].response+=o.text:e.cues.push({code:n,name:r,evaluationId:s,response:o.text})},userNotification(e,t){let n=e.cues.filter(l=>l.code!==t.payload.code),{code:r,name:o,evaluationId:s,payload:i}=t.payload,{callToAction:a}=i;e.cues=[...n,{code:r,name:o,evaluationId:s,response:i.message,editable:i.editableMessage,callToAction:a&&{label:a.displayName,event:a.onClickEvent,value:a.eventPayload}}]}},extraReducers:e=>{e.addCase(fn.pending,(t,n)=>{t.pending.includes(n.meta.arg.assistantCode)&&ee.warn(`Assistant ${n.meta.arg.assistantCode} already evaluating`),t.pending.push(n.meta.arg.assistantCode)}).addCase(fn.rejected,(t,n)=>{var o;ee.warn((o=n.error)==null?void 0:o.message);let r=t.pending.indexOf(n.meta.arg.assistantCode);r!==-1&&t.pending.splice(r,1)}).addCase(fn.fulfilled,(t,n)=>{let r=t.pending.indexOf(n.meta.arg.assistantCode);if(r!==-1&&t.pending.splice(r,1),n.meta.arg.skipState)return;let{evaluationId:o,output:s,externalConversationId:i,currentExternalIdAtRequest:a}=n.payload;if(i&&a&&i!==a)return;let l=s.map(f=>f.code),c=t.cues.filter(f=>!l.includes(f.code)),u=s.map(f=>b(I(b({},f),{evaluationId:o}),i?{externalConversationId:i}:{}));t.cues=[...c,...u]}).addCase(Ll.fulfilled,(t,n)=>{let s=n.payload,{threadId:r}=s,o=se(s,["threadId"]);t.threads[r]=[...t.threads[r]||[],o]}).addCase(lt,()=>eE)}}),{removeCueByCode:Ld,resetCues:OB,removeThreadById:sE,receiveChunk:iE,userNotification:aE}=oE.actions,lE=oE.reducer;var gO={locale:"en-US",deanonymize:!1,fallbackImage:!1,isEmbedded:!1,showImages:!1,showSearch:!1,showImageSearch:!1,showStyleSuggestions:!1,showStyleSuggestionList:!1,showMidSentenceSuggestions:!1,showSuggestionsBeforePattern:!1,showSuggestionsAfterPattern:!1,showTabCompletion:!0,showTextSuggestions:!0,showEntitiesCommand:!1,showSummaryCommand:!1,showKnowledgeSearch:!1,textSuggestionsCount:3,recommendTextSuggestions:!0,searchTriggerKey:"k",visible:!0,insertLink:!1,addToPersonalCollection:!1,inlineSuggestions:!1,autoSelectSuggestion:!1,suggestionsPlacement:"above",floatingMenu:!1,detectSubmit:!1,automaticHandlingTime:!1,enableSuggestionFeedback:!1,enableFeedbackForm:!0,adminUrl:void 0,productName:"Deepdesk",hasKeyboardInput:!0},cE=Re({name:"settings",initialState:gO,reducers:{set(e,t){Object.entries(t.payload).forEach(n=>{let[r,o]=n;typeof o!="undefined"&&(e[r]=o)})}}}),{set:Od}=cE.actions,Bs=e=>t=>t.settings[e],X=e=>G(Bs(e)),uE=cE.reducer;function Ir(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),t.remove()}var Dd=E(De()),pE=E(Z());var vh=E(P()),Sh=e=>(0,vh.jsx)("svg",I(b({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,vh.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 xh=E(P()),dE=e=>(0,xh.jsx)("svg",I(b({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,xh.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 Fo(e,t){var o;let n=e.cloneNode(!0);n.style.top=`${e.offsetTop}px`,n.style.left=`${e.offsetLeft}px`,n.style.position="absolute",t.split(" ").forEach(s=>{n.classList.add(s)}),n.addEventListener("animationend",()=>n.remove()),(o=e.parentElement)==null||o.appendChild(n)}var wh={};yt(wh,{enUS:()=>hO,nlNL:()=>yO});var hO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},yO={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var fE={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var zo=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t,s=o||window.location.origin;return r&&!n?null:r&&n?`${s}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:`${s}${e}`};var eo=E(P()),vO=({assistantCode:e,assistantOutput:t,evaluationId:n,feedbackType:r,feedbackText:o})=>{let s=O("FeedbackThumbs",fE),i=X("enableFeedbackForm"),a=G(Rr),l=G(zo(`/admin/feedback?conversationId=${a}&evaluationId=${n}&type=${r}&text=${o}&assistantCode=${e}&assistantOutput=${t}`)),c=ie(wh),u=Ze(),[f,d]=(0,pE.useState)(null),p=S=>{u("Assistant response feedback",{assistantCode:e,assistantOutput:t,evaluationId:n,rating:S})},h=S=>{S.stopPropagation(),Fo(S.target,s.fadeup),d("up"),p("up")},m=S=>{S.stopPropagation(),Fo(S.target,s.fadedown),d("down"),p("down")};return(0,eo.jsxs)("div",{className:s.thumbs,children:[(0,eo.jsx)(de.Button,{title:c("thumbsUp"),onClick:h,icon:(0,eo.jsx)(dE,{}),className:(0,Dd.default)(s.thumbsUp,f==="up"&&s.selected),disabled:!!f}),i&&l?(0,eo.jsx)(de.Button,{as:"a",title:c("thumbsDown"),href:l,target:"_blank",rel:"noreferrer",onClick:m,icon:(0,eo.jsx)(Sh,{}),className:(0,Dd.default)(s.thumbsDown,f==="down"&&s.selected),disabled:!!f}):(0,eo.jsx)(de.Button,{title:c("thumbsDown"),onClick:m,icon:(0,eo.jsx)(Sh,{}),className:(0,Dd.default)(s.thumbsDown,f==="down"&&s.selected),disabled:!!f})]})},Fd=vO;function mE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function SO(e){if(Array.isArray(e))return e}function xO(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,s,i,a=[],l=!0,c=!1;try{if(s=(n=n.call(e)).next,t!==0)for(;!(l=(r=s.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}function wO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
71
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bO(e,t){return SO(e)||xO(e,t)||EO(e,t)||wO()}function EO(e,t){if(e){if(typeof e=="string")return mE(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mE(e,t):void 0}}var PE=Object.entries,gE=Object.setPrototypeOf,CO=Object.isFrozen,TO=Object.getPrototypeOf,kO=Object.getOwnPropertyDescriptor,It=Object.freeze,At=Object.seal,Ki=Object.create,IE=typeof Reflect!="undefined"&&Reflect,Rh=IE.apply,Ph=IE.construct;It||(It=function(t){return t});At||(At=function(t){return t});Rh||(Rh=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];return t.apply(n,o)});Ph||(Ph=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 new t(...r)});var Ol=rt(Array.prototype.forEach),RO=rt(Array.prototype.lastIndexOf),hE=rt(Array.prototype.pop),$i=rt(Array.prototype.push),PO=rt(Array.prototype.splice),Bo=Array.isArray,zl=rt(String.prototype.toLowerCase),bh=rt(String.prototype.toString),yE=rt(String.prototype.match),Dl=rt(String.prototype.replace),vE=rt(String.prototype.indexOf),IO=rt(String.prototype.trim),AO=rt(Number.prototype.toString),_O=rt(Boolean.prototype.toString),SE=typeof BigInt=="undefined"?null:rt(BigInt.prototype.toString),xE=typeof Symbol=="undefined"?null:rt(Symbol.prototype.toString),vt=rt(Object.prototype.hasOwnProperty),Fl=rt(Object.prototype.toString),Pt=rt(RegExp.prototype.test),Us=NO(TypeError);function rt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Rh(e,t,r)}}function NO(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Ph(e,n)}}function xe(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zl;if(gE&&gE(e,null),!Bo(t))return e;let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let s=n(o);s!==o&&(CO(t)||(t[r]=s),o=s)}e[o]=!0}return e}function MO(e){for(let t=0;t<e.length;t++)vt(e,t)||(e[t]=null);return e}function Yt(e){let t=Ki(null);for(let r of PE(e)){var n=bO(r,2);let o=n[0],s=n[1];vt(e,o)&&(Bo(s)?t[o]=MO(s):s&&typeof s=="object"&&s.constructor===Object?t[o]=Yt(s):t[o]=s)}return t}function LO(e){switch(typeof e){case"string":return e;case"number":return AO(e);case"boolean":return _O(e);case"bigint":return SE?SE(e):"0";case"symbol":return xE?xE(e):"Symbol()";case"undefined":return Fl(e);case"function":case"object":{if(e===null)return Fl(e);let t=e,n=_r(t,"toString");if(typeof n=="function"){let r=n(t);return typeof r=="string"?r:Fl(r)}return Fl(e)}default:return Fl(e)}}function _r(e,t){for(;e!==null;){let r=kO(e,t);if(r){if(r.get)return rt(r.get);if(typeof r.value=="function")return rt(r.value)}e=TO(e)}function n(){return null}return n}function OO(e){try{return Pt(e,""),!0}catch(t){return!1}}var wE=It(["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","search","section","select","shadow","slot","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"]),Eh=It(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ch=It(["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"]),DO=It(["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"]),Th=It(["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"]),FO=It(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),bE=It(["#text"]),EE=It(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),kh=It(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","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"]),CE=It(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),zd=It(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zO=At(/{{[\w\W]*|^[\w\W]*}}/g),HO=At(/<%[\w\W]*|^[\w\W]*%>/g),BO=At(/\${[\w\W]*/g),UO=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),VO=At(/^aria-[\-\w]+$/),TE=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jO=At(/^(?:\w+script|data):/i),WO=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$O=At(/^html$/i),KO=At(/^[a-z][.\w]*(-[.\w]+)+$/i),kE=At(/<[/\w!]/g),GO=At(/<[/\w]/g),qO=At(/<\/no(script|embed|frames)/i),YO=At(/\/>/i),Ar={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},XO=function(){return typeof window=="undefined"?null:window},QO=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(r=n.getAttribute(o));let s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(i){return i},createScriptURL(i){return i}})}catch(i){return console.warn("TrustedTypes policy "+s+" could not be created."),null}},RE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ho=function(t,n,r,o){return vt(t,n)&&Bo(t[n])?xe(o.base?Yt(o.base):{},t[n],o.transform):r};function AE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XO(),t=W=>AE(W);if(t.version="3.4.11",t.removed=[],!e||!e.document||e.document.nodeType!==Ar.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,o=r.currentScript;e.DocumentFragment;let s=e.HTMLTemplateElement,i=e.Node,a=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,f=e.trustedTypes,d=a.prototype,p=_r(d,"cloneNode"),h=_r(d,"remove"),m=_r(d,"nextSibling"),S=_r(d,"childNodes"),y=_r(d,"parentNode"),g=_r(d,"shadowRoot"),v=_r(d,"attributes"),x=i&&i.prototype?_r(i.prototype,"nodeType"):null,C=i&&i.prototype?_r(i.prototype,"nodeName"):null;if(typeof s=="function"){let W=n.createElement("template");W.content&&W.content.ownerDocument&&(n=W.content.ownerDocument)}let T,k="",A,H=!1,D=0,B=function(){if(D>0)throw Us('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},J=function(w){B(),D++;try{return T.createHTML(w)}finally{D--}},Y=function(w){B(),D++;try{return T.createScriptURL(w)}finally{D--}},_=function(){return H||(A=QO(f,o),H=!0),A},V=n,z=V.implementation,U=V.createNodeIterator,M=V.createDocumentFragment,q=V.getElementsByTagName,$=r.importNode,K=RE();t.isSupported=typeof PE=="function"&&typeof y=="function"&&z&&z.createHTMLDocument!==void 0;let ce=zO,te=HO,Qe=BO,ve=UO,tt=VO,pt=jO,Oe=WO,Me=KO,at=TE,he=null,oe=xe({},[...wE,...Eh,...Ch,...Th,...bE]),ne=null,fe=xe({},[...EE,...kh,...CE,...zd]),ue=Object.seal(Ki(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}})),We=null,Ce=null,mt=Object.seal(Ki(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),jt=!0,Et=!0,xr=!1,Xn=!0,gt=!1,ln=!0,wr=!1,Fm=!1,zm=null,Hm=null,Bm=!1,Pi=!1,Su=!1,xu=!1,OS=!0,DS=!1,FS="user-content-",Um=!0,Vm=!1,Ii={},br=null,jm=xe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),zS=null,HS=xe({},["audio","video","img","source","image","track"]),Wm=null,BS=xe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),wu="http://www.w3.org/1998/Math/MathML",bu="http://www.w3.org/2000/svg",Er="http://www.w3.org/1999/xhtml",Ai=Er,$m=!1,Km=null,XA=xe({},[wu,bu,Er],bh),US=It(["mi","mo","mn","ms","mtext"]),Gm=xe({},US),VS=It(["annotation-xml"]),qm=xe({},VS),QA=xe({},["title","style","font","a","script"]),el=null,ZA=["application/xhtml+xml","text/html"],JA="text/html",qe=null,_i=null,e_=n.createElement("form"),jS=function(w){return w instanceof RegExp||w instanceof Function},Ym=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_i&&_i===w)return;(!w||typeof w!="object")&&(w={}),w=Yt(w),el=ZA.indexOf(w.PARSER_MEDIA_TYPE)===-1?JA:w.PARSER_MEDIA_TYPE,qe=el==="application/xhtml+xml"?bh:zl,he=Ho(w,"ALLOWED_TAGS",oe,{transform:qe}),ne=Ho(w,"ALLOWED_ATTR",fe,{transform:qe}),Km=Ho(w,"ALLOWED_NAMESPACES",XA,{transform:bh}),Wm=Ho(w,"ADD_URI_SAFE_ATTR",BS,{transform:qe,base:BS}),zS=Ho(w,"ADD_DATA_URI_TAGS",HS,{transform:qe,base:HS}),br=Ho(w,"FORBID_CONTENTS",jm,{transform:qe}),We=Ho(w,"FORBID_TAGS",Yt({}),{transform:qe}),Ce=Ho(w,"FORBID_ATTR",Yt({}),{transform:qe}),Ii=vt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Yt(w.USE_PROFILES):w.USE_PROFILES:!1,jt=w.ALLOW_ARIA_ATTR!==!1,Et=w.ALLOW_DATA_ATTR!==!1,xr=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Xn=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gt=w.SAFE_FOR_TEMPLATES||!1,ln=w.SAFE_FOR_XML!==!1,wr=w.WHOLE_DOCUMENT||!1,Pi=w.RETURN_DOM||!1,Su=w.RETURN_DOM_FRAGMENT||!1,xu=w.RETURN_TRUSTED_TYPE||!1,Bm=w.FORCE_BODY||!1,OS=w.SANITIZE_DOM!==!1,DS=w.SANITIZE_NAMED_PROPS||!1,Um=w.KEEP_CONTENT!==!1,Vm=w.IN_PLACE||!1,at=OO(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:TE,Ai=typeof w.NAMESPACE=="string"?w.NAMESPACE:Er,Gm=vt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?Yt(w.MATHML_TEXT_INTEGRATION_POINTS):xe({},US),qm=vt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?Yt(w.HTML_INTEGRATION_POINTS):xe({},VS);let R=vt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?Yt(w.CUSTOM_ELEMENT_HANDLING):Ki(null);if(ue=Ki(null),vt(R,"tagNameCheck")&&jS(R.tagNameCheck)&&(ue.tagNameCheck=R.tagNameCheck),vt(R,"attributeNameCheck")&&jS(R.attributeNameCheck)&&(ue.attributeNameCheck=R.attributeNameCheck),vt(R,"allowCustomizedBuiltInElements")&&typeof R.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=R.allowCustomizedBuiltInElements),At(ue),gt&&(Et=!1),Su&&(Pi=!0),Ii&&(he=xe({},bE),ne=Ki(null),Ii.html===!0&&(xe(he,wE),xe(ne,EE)),Ii.svg===!0&&(xe(he,Eh),xe(ne,kh),xe(ne,zd)),Ii.svgFilters===!0&&(xe(he,Ch),xe(ne,kh),xe(ne,zd)),Ii.mathMl===!0&&(xe(he,Th),xe(ne,CE),xe(ne,zd))),mt.tagCheck=null,mt.attributeCheck=null,vt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?mt.tagCheck=w.ADD_TAGS:Bo(w.ADD_TAGS)&&(he===oe&&(he=Yt(he)),xe(he,w.ADD_TAGS,qe))),vt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?mt.attributeCheck=w.ADD_ATTR:Bo(w.ADD_ATTR)&&(ne===fe&&(ne=Yt(ne)),xe(ne,w.ADD_ATTR,qe))),vt(w,"ADD_URI_SAFE_ATTR")&&Bo(w.ADD_URI_SAFE_ATTR)&&xe(Wm,w.ADD_URI_SAFE_ATTR,qe),vt(w,"FORBID_CONTENTS")&&Bo(w.FORBID_CONTENTS)&&(br===jm&&(br=Yt(br)),xe(br,w.FORBID_CONTENTS,qe)),vt(w,"ADD_FORBID_CONTENTS")&&Bo(w.ADD_FORBID_CONTENTS)&&(br===jm&&(br=Yt(br)),xe(br,w.ADD_FORBID_CONTENTS,qe)),Um&&(he["#text"]=!0),wr&&xe(he,["html","head","body"]),he.table&&(xe(he,["tbody"]),delete We.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Us('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Us('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let j=T;T=w.TRUSTED_TYPES_POLICY;try{k=J("")}catch(re){throw T=j,re}}else w.TRUSTED_TYPES_POLICY===null?(T=void 0,k=""):(T===void 0&&(T=_()),T&&typeof k=="string"&&(k=J("")));It&&It(w),_i=w},WS=xe({},[...Eh,...Ch,...DO]),$S=xe({},[...Th,...FO]),t_=function(w,R,j){return R.namespaceURI===Er?w==="svg":R.namespaceURI===wu?w==="svg"&&(j==="annotation-xml"||Gm[j]):!!WS[w]},n_=function(w,R,j){return R.namespaceURI===Er?w==="math":R.namespaceURI===bu?w==="math"&&qm[j]:!!$S[w]},r_=function(w,R,j){return R.namespaceURI===bu&&!qm[j]||R.namespaceURI===wu&&!Gm[j]?!1:!$S[w]&&(QA[w]||!WS[w])},o_=function(w){let R=y(w);(!R||!R.tagName)&&(R={namespaceURI:Ai,tagName:"template"});let j=zl(w.tagName),re=zl(R.tagName);return Km[w.namespaceURI]?w.namespaceURI===bu?t_(j,R,re):w.namespaceURI===wu?n_(j,R,re):w.namespaceURI===Er?r_(j,R,re):!!(el==="application/xhtml+xml"&&Km[w.namespaceURI]):!1},Ao=function(w){$i(t.removed,{element:w});try{y(w).removeChild(w)}catch(R){if(h(w),!y(w))throw Us("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},KS=function(w){let R=S(w);if(R){let re=[];Ol(R,me=>{$i(re,me)}),Ol(re,me=>{try{h(me)}catch(we){}})}let j=v(w);if(j)for(let re=j.length-1;re>=0;--re){let me=j[re],we=me&&me.name;if(typeof we=="string")try{w.removeAttribute(we)}catch(ht){}}},Cs=function(w,R){try{$i(t.removed,{attribute:R.getAttributeNode(w),from:R})}catch(j){$i(t.removed,{attribute:null,from:R})}if(R.removeAttribute(w),w==="is")if(Pi||Su)try{Ao(R)}catch(j){}else try{R.setAttribute(w,"")}catch(j){}},s_=function(w){let R=v(w);if(R)for(let j=R.length-1;j>=0;--j){let re=R[j],me=re&&re.name;if(!(typeof me!="string"||ne[qe(me)]))try{w.removeAttribute(me)}catch(we){}}},i_=function(w){let R=[w];for(;R.length>0;){let j=R.pop();(x?x(j):j.nodeType)===Ar.element&&s_(j);let me=S(j);if(me)for(let we=me.length-1;we>=0;--we)R.push(me[we])}},GS=function(w){let R=null,j=null;if(Bm)w="<remove></remove>"+w;else{let we=yE(w,/^[\r\n\t ]+/);j=we&&we[0]}el==="application/xhtml+xml"&&Ai===Er&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");let re=T?J(w):w;if(Ai===Er)try{R=new u().parseFromString(re,el)}catch(we){}if(!R||!R.documentElement){R=z.createDocument(Ai,"template",null);try{R.documentElement.innerHTML=$m?k:re}catch(we){}}let me=R.body||R.documentElement;return w&&j&&me.insertBefore(n.createTextNode(j),me.childNodes[0]||null),Ai===Er?q.call(R,wr?"html":"body")[0]:wr?R.documentElement:me},qS=function(w){return U.call(w.ownerDocument||w,w,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Eu=function(w){return w=Dl(w,ce," "),w=Dl(w,te," "),w=Dl(w,Qe," "),w},Xm=function(w){var R;w.normalize();let j=U.call(w.ownerDocument||w,w,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),re=j.nextNode();for(;re;)re.data=Eu(re.data),re=j.nextNode();let me=(R=w.querySelectorAll)===null||R===void 0?void 0:R.call(w,"template");me&&Ol(me,we=>{Ni(we.content)&&Xm(we.content)})},Cu=function(w){let R=C?C(w):null;return typeof R!="string"||qe(R)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==v(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==x(w)||w.childNodes!==S(w)},Ni=function(w){if(!x||typeof w!="object"||w===null)return!1;try{return x(w)===Ar.documentFragment}catch(R){return!1}},tl=function(w){if(!x||typeof w!="object"||w===null)return!1;try{return typeof x(w)=="number"}catch(R){return!1}};function Kr(W,w,R){W.length!==0&&Ol(W,j=>{j.call(t,w,R,_i)})}let a_=function(w,R){return!!(ln&&w.hasChildNodes()&&!tl(w.firstElementChild)&&Pt(kE,w.textContent)&&Pt(kE,w.innerHTML)||ln&&w.namespaceURI===Er&&R==="style"&&tl(w.firstElementChild)||w.nodeType===Ar.processingInstruction||ln&&w.nodeType===Ar.comment&&Pt(GO,w.data))},l_=function(w,R){if(!We[R]&&QS(R)&&(ue.tagNameCheck instanceof RegExp&&Pt(ue.tagNameCheck,R)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(R)))return!1;if(Um&&!br[R]){let j=y(w),re=S(w);if(re&&j){let me=re.length;for(let we=me-1;we>=0;--we){let ht=Vm?re[we]:p(re[we],!0);j.insertBefore(ht,m(w))}}}return Ao(w),!0},YS=function(w){if(Kr(K.beforeSanitizeElements,w,null),Cu(w))return Ao(w),!0;let R=qe(C?C(w):w.nodeName);if(Kr(K.uponSanitizeElement,w,{tagName:R,allowedTags:he}),a_(w,R))return Ao(w),!0;if(We[R]||!(mt.tagCheck instanceof Function&&mt.tagCheck(R))&&!he[R])return l_(w,R);if((x?x(w):w.nodeType)===Ar.element&&!o_(w)||(R==="noscript"||R==="noembed"||R==="noframes")&&Pt(qO,w.innerHTML))return Ao(w),!0;if(gt&&w.nodeType===Ar.text){let re=Eu(w.textContent);w.textContent!==re&&($i(t.removed,{element:w.cloneNode()}),w.textContent=re)}return Kr(K.afterSanitizeElements,w,null),!1},XS=function(w,R,j){if(Ce[R]||OS&&(R==="id"||R==="name")&&(j in n||j in e_))return!1;let re=ne[R]||mt.attributeCheck instanceof Function&&mt.attributeCheck(R,w);if(!(Et&&Pt(ve,R))){if(!(jt&&Pt(tt,R))){if(re){if(!Wm[R]){if(!Pt(at,Dl(j,Oe,""))){if(!((R==="src"||R==="xlink:href"||R==="href")&&w!=="script"&&vE(j,"data:")===0&&zS[w])){if(!(xr&&!Pt(pt,Dl(j,Oe,"")))){if(j)return!1}}}}}else if(!(QS(w)&&(ue.tagNameCheck instanceof RegExp&&Pt(ue.tagNameCheck,w)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(w))&&(ue.attributeNameCheck instanceof RegExp&&Pt(ue.attributeNameCheck,R)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(R,w))||R==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&Pt(ue.tagNameCheck,j)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(j))))return!1}}return!0},c_=xe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),QS=function(w){return!c_[zl(w)]&&Pt(Me,w)},u_=function(w,R,j,re){if(T&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!j)switch(f.getAttributeType(w,R)){case"TrustedHTML":return J(re);case"TrustedScriptURL":return Y(re)}return re},d_=function(w,R,j,re){try{j?w.setAttributeNS(j,R,re):w.setAttribute(R,re),Cu(w)?Ao(w):hE(t.removed)}catch(me){Cs(R,w)}},ZS=function(w){Kr(K.beforeSanitizeAttributes,w,null);let R=w.attributes;if(!R||Cu(w))return;let j={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne,forceKeepAttr:void 0},re=R.length,me=qe(w.nodeName);for(;re--;){let we=R[re],ht=we.name,nt=we.namespaceURI,Dn=we.value,Qn=qe(ht),Zm=Dn,Wt=ht==="value"?Zm:IO(Zm);if(j.attrName=Qn,j.attrValue=Wt,j.keepAttr=!0,j.forceKeepAttr=void 0,Kr(K.uponSanitizeAttribute,w,j),Wt=j.attrValue,DS&&(Qn==="id"||Qn==="name")&&vE(Wt,FS)!==0&&(Cs(ht,w),Wt=FS+Wt),ln&&Pt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wt)){Cs(ht,w);continue}if(Qn==="attributename"&&yE(Wt,"href")){Cs(ht,w);continue}if(!j.forceKeepAttr){if(!j.keepAttr){Cs(ht,w);continue}if(!Xn&&Pt(YO,Wt)){Cs(ht,w);continue}if(gt&&(Wt=Eu(Wt)),!XS(me,Qn,Wt)){Cs(ht,w);continue}Wt=u_(me,Qn,nt,Wt),Wt!==Zm&&d_(w,ht,nt,Wt)}}Kr(K.afterSanitizeAttributes,w,null)},Tu=function(w){let R=null,j=qS(w);for(Kr(K.beforeSanitizeShadowDOM,w,null);R=j.nextNode();)if(Kr(K.uponSanitizeShadowNode,R,null),YS(R),ZS(R),Ni(R.content)&&Tu(R.content),(x?x(R):R.nodeType)===Ar.element){let me=g(R);Ni(me)&&(Qm(me),Tu(me))}Kr(K.afterSanitizeShadowDOM,w,null)},Qm=function(w){let R=[{node:w,shadow:null}];for(;R.length>0;){let j=R.pop();if(j.shadow){Tu(j.shadow);continue}let re=j.node,we=(x?x(re):re.nodeType)===Ar.element,ht=S(re);if(ht)for(let nt=ht.length-1;nt>=0;--nt)R.push({node:ht[nt],shadow:null});if(we){let nt=C?C(re):null;if(typeof nt=="string"&&qe(nt)==="template"){let Dn=re.content;Ni(Dn)&&R.push({node:Dn,shadow:null})}}if(we){let nt=g(re);Ni(nt)&&R.push({node:null,shadow:nt},{node:nt,shadow:null})}}};return t.sanitize=function(W){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},R=null,j=null,re=null,me=null;if($m=!W,$m&&(W="<!-->"),typeof W!="string"&&!tl(W)&&(W=LO(W),typeof W!="string"))throw Us("dirty is not a string, aborting");if(!t.isSupported)return W;Fm?(he=zm,ne=Hm):Ym(w),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(he=Yt(he)),K.uponSanitizeAttribute.length>0&&(ne=Yt(ne)),t.removed=[];let we=Vm&&typeof W!="string"&&tl(W);if(we){let Dn=C?C(W):W.nodeName;if(typeof Dn=="string"){let Qn=qe(Dn);if(!he[Qn]||We[Qn])throw Us("root node is forbidden and cannot be sanitized in-place")}if(Cu(W))throw Us("root node is clobbered and cannot be sanitized in-place");try{Qm(W)}catch(Qn){throw KS(W),Qn}}else if(tl(W))R=GS("<!---->"),j=R.ownerDocument.importNode(W,!0),j.nodeType===Ar.element&&j.nodeName==="BODY"||j.nodeName==="HTML"?R=j:R.appendChild(j),Qm(j);else{if(!Pi&&!gt&&!wr&&W.indexOf("<")===-1)return T&&xu?J(W):W;if(R=GS(W),!R)return Pi?null:xu?k:""}R&&Bm&&Ao(R.firstChild);let ht=qS(we?W:R);try{for(;re=ht.nextNode();)YS(re),ZS(re),Ni(re.content)&&Tu(re.content)}catch(Dn){throw we&&KS(W),Dn}if(we)return Ol(t.removed,Dn=>{Dn.element&&i_(Dn.element)}),gt&&Xm(W),W;if(Pi){if(gt&&Xm(R),Su)for(me=M.call(R.ownerDocument);R.firstChild;)me.appendChild(R.firstChild);else me=R;return(ne.shadowroot||ne.shadowrootmode)&&(me=$.call(r,me,!0)),me}let nt=wr?R.outerHTML:R.innerHTML;return wr&&he["!doctype"]&&R.ownerDocument&&R.ownerDocument.doctype&&R.ownerDocument.doctype.name&&Pt($O,R.ownerDocument.doctype.name)&&(nt="<!DOCTYPE "+R.ownerDocument.doctype.name+`>
72
- `+nt),gt&&(nt=Eu(nt)),T&&xu?J(nt):nt},t.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ym(W),Fm=!0,zm=he,Hm=ne},t.clearConfig=function(){_i=null,Fm=!1,zm=null,Hm=null,T=A,k=""},t.isValidAttribute=function(W,w,R){_i||Ym({});let j=qe(W),re=qe(w);return XS(j,re,R)},t.addHook=function(W,w){typeof w=="function"&&vt(K,W)&&$i(K[W],w)},t.removeHook=function(W,w){if(vt(K,W)){if(w!==void 0){let R=RO(K[W],w);return R===-1?void 0:PO(K[W],R,1)[0]}return hE(K[W])}},t.removeHooks=function(W){vt(K,W)&&(K[W]=[])},t.removeAllHooks=function(){K=RE()},t}var _E=AE();var po=E(Z());var jv=E(De()),Kn=E(Z());var Hd=E(Z()),ZO=["bottom","height","left","right","top","width"],JO=(e={},t={})=>ZO.some(n=>e[n]!==t[n]),to=new Map,NE,ME=()=>{let e=[],t=[];to.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();JO(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{to.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),NE=window.requestAnimationFrame(ME)};function e2(e,t){return{observe(){let n=to.size===0;if(to.has(e)){let r=to.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else to.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&ME()},unobserve(){let n=to.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||to.delete(e),to.size||cancelAnimationFrame(NE)}}}}function Ih(e){let[t,n]=(0,Hd.useState)(null);return(0,Hd.useLayoutEffect)(()=>{if(!e.current)return;let r=e2(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var ba=E(Z()),ek=E(Ac());var Z1=E(Z());function ls(e){(0,Z1.useEffect)(()=>{let t=n=>{n.isWithinRoot||e(n)};return document.body.addEventListener("mouseup",t),()=>{document.body.removeEventListener("mouseup",t)}},[e])}function ri(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}var J1={root:"dd-r-dgo"};var tk=({children:e,parentNode:t})=>{let[n,r]=(0,ba.useState)(null),o=(0,ba.useContext)(ol);return(0,ba.useLayoutEffect)(()=>{let s=document.createElement("div");return ri(s),s.classList.add(J1.root),o!=null&&o.portalRootNode&&s.classList.add(o==null?void 0:o.portalRootNode),(t||document.body).appendChild(s),r(s),()=>{s.isConnected&&s.remove()}},[]),n?(0,ek.createPortal)(e,n):null};var zr={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 ip=E(P()),ap=(e=!1)=>{let[t,n]=(0,Kn.useState)(e),r=(0,Kn.useCallback)(()=>n(!0),[]),o=(0,Kn.useCallback)(()=>n(!1),[]),s=(0,Kn.useCallback)(()=>n(a=>!a),[]),i=(0,Kn.useRef)(null);return{opened:t,open:r,close:o,toggle:s,triggerRef:i}};function Wv(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 Ea=c=>{var u=c,{className:e,triggerRef:t,boundaryRef:n=(0,Kn.createRef)(),position:r="above",align:o="center",children:s,toStyle:i=Wv,parentNode:a}=u,l=se(u,["className","triggerRef","boundaryRef","position","align","children","toStyle","parentNode"]);let f=Ih(t),d=Ih(n),p=(0,Kn.useMemo)(()=>i(f,d,0),[f,d]);return(0,ip.jsx)(tk,{parentNode:a,children:(0,ip.jsx)("div",I(b({className:(0,jv.default)(zr.ref,{[zr.positionAbove]:r==="above",[zr.positionBelow]:r==="below",[zr.positionLeft]:r==="left",[zr.positionRight]:r==="right",[zr.alignStart]:o==="start",[zr.alignCenter]:o==="center",[zr.alignEnd]:o==="end"}),style:p},l),{role:"dialog",children:(0,ip.jsx)("div",{className:(0,jv.default)(e,zr.root),children:s})}))})};var nk={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 ur=E(P());function r3(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 $v(e){var n,r;let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(o=>o.remove()),(r=(n=t.textContent)==null?void 0:n.trim())!=null?r:""}function o3(e){return e.replace(/\r\n/g,`
73
- `)}var s3=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let s=O("Markdown",nk),i=(0,po.useRef)(null),[a,l]=(0,po.useState)(null),c=(0,po.useMemo)(()=>{let m=Pe.parse(o3(e));return _E.sanitize(m.toString()).replaceAll("</code>",`${r3(s.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),u=m=>{var g;let S=m.target,y=!!((g=i.current)!=null&&g.querySelector("code"));if(["A","BUTTON"].includes(S.tagName)){l(null);return}a||y&&S.tagName!=="CODE"||!y&&S!==i.current||(S.addEventListener("mouseleave",()=>l(null),{once:!0}),l(S))},f=()=>{if(!a)return;l(null);let m=a.querySelector("button");m&&(Fo(m,s.fadeup),r==null||r($v(a)))},d=m=>{let S=m.target,y=S instanceof HTMLElement?S:null;if(S instanceof Element?S.closest("a"):null){m.stopPropagation();return}y&&"copyIcon"in y.dataset&&(Fo(y,s.fadeup),r==null||r($v(y.parentElement)))},p=()=>{!a||!o||(l(null),o($v(a)))},h=m=>{if(m===null)return;let S=m.getBoundingClientRect();S.left<0?m.style.transform=`translateX(${-S.left+2}px)`:S.right>window.innerWidth&&(m.style.transform=`translateX(${window.innerWidth-S.right-2}px)`)};return(0,ur.jsxs)(po.Fragment,{children:[a&&(r||o)&&(0,ur.jsxs)(Ea,{triggerRef:{current:a},className:s.popover,parentNode:a,children:[(0,ur.jsxs)("div",{className:s.options,ref:h,children:[r&&(a==null?void 0:a.tagName)==="CODE"&&(0,ur.jsx)("button",{type:"button",className:s.option,onClick:f,children:n}),o&&(0,ur.jsxs)(po.Fragment,{children:[(0,ur.jsx)("div",{className:s.divider}),(0,ur.jsx)("button",{type:"button",className:s.option,onClick:p,children:t})]})]}),(0,ur.jsx)("div",{className:s.arrow})]}),(0,ur.jsx)("div",{ref:i,"data-testid":"widget-markdown-content",className:s.root,dangerouslySetInnerHTML:{__html:c},onMouseOver:u,onClick:d})]})},oi=s3;var sk=E(Z());var rk={loadingBar:"dd-6as-V",placeHolderShimmer:"dd-TFYmA"};var ok=E(P()),i3=({width:e})=>{let t=O("LoadingProgressBar",rk);return(0,ok.jsx)("div",{className:t.loadingBar,style:{width:e}})},lp=i3;var mo=E(P()),cp=({title:e})=>{let t=(0,sk.useRef)(null);return Fu(t),(0,mo.jsx)(de,{ref:t,children:(0,mo.jsx)(Se,{children:(0,mo.jsxs)(Se.Content,{children:[(0,mo.jsx)(Se.Title,{children:e}),(0,mo.jsx)(lp,{width:"60%"}),(0,mo.jsx)(lp,{width:"90%"}),(0,mo.jsx)(lp,{width:"50%"})]})})})};var Ca={};yt(Ca,{enUS:()=>a3,nlNL:()=>l3});var a3={inputPlaceholder:[{type:0,value:"What is your question?"}],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"}],submitLabel:[{type:0,value:"Submit"}],resetLabel:[{type:0,value:"Reset"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},l3={inputPlaceholder:[{type:0,value:"Wat is je vraag?"}],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"}],submitLabel:[{type:0,value:"Verzend"}],resetLabel:[{type:0,value:"Gesprek wissen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var up={form:"dd-pleCH",formInput:"dd-pGJMY",formSubmit:"dd--gkRg",actionButton:"dd-I2NEH",resetContainer:"dd-qKIDX",sources:"dd-xf9c6",source:"dd-a-vyX",tooltip:"dd-EsgcZ",linkContent:"dd-gARDA",showMoreSources:"dd-uDGi-"};var Br=E(Z());var L=E(Z(),1);function dp(){return typeof window!="undefined"}function Hr(e){return fp(e)?(e.nodeName||"").toLowerCase():"#document"}function Jt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fr(e){var t;return(t=(fp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fp(e){return dp()?e instanceof Node||e instanceof Jt(e).Node:!1}function He(e){return dp()?e instanceof Element||e instanceof Jt(e).Element:!1}function Xe(e){return dp()?e instanceof HTMLElement||e instanceof Jt(e).HTMLElement:!1}function Ta(e){return!dp()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof Jt(e).ShadowRoot}var c3=new Set(["inline","contents"]);function ka(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!c3.has(o)}var u3=new Set(["table","td","th"]);function ik(e){return u3.has(Hr(e))}var d3=[":popover-open",":modal"];function _c(e){return d3.some(t=>{try{return e.matches(t)}catch(n){return!1}})}var f3=["transform","translate","scale","rotate","perspective"],p3=["transform","translate","scale","rotate","perspective","filter"],m3=["paint","layout","strict","content"];function pp(e){let t=Ra(),n=He(e)?vn(e):e;return f3.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||p3.some(r=>(n.willChange||"").includes(r))||m3.some(r=>(n.contain||"").includes(r))}function ak(e){let t=dr(e);for(;Xe(t)&&!pr(t);){if(pp(t))return t;if(_c(t))return null;t=dr(t)}return null}function Ra(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}var g3=new Set(["html","body","#document"]);function pr(e){return g3.has(Hr(e))}function vn(e){return Jt(e).getComputedStyle(e)}function Nc(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function dr(e){if(Hr(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Ta(e)&&e.host||fr(e);return Ta(t)?t.host:t}function lk(e){let t=dr(e);return pr(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xe(t)&&ka(t)?t:lk(t)}function Nn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let o=lk(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=Jt(o);if(s){let a=mp(i);return t.concat(i,i.visualViewport||[],ka(o)?o:[],a&&n?Nn(a):[])}return t.concat(o,Nn(o,[],n))}function mp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var _a=E(Z(),1),Ck=E(Z(),1);var Pa=Math.min,go=Math.max,Lc=Math.round,Oc=Math.floor,mr=e=>({x:e,y:e}),h3={left:"right",right:"left",bottom:"top",top:"bottom"},y3={start:"end",end:"start"};function Kv(e,t,n){return go(e,Pa(t,n))}function Dc(e,t){return typeof e=="function"?e(t):e}function cs(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function Gv(e){return e==="x"?"y":"x"}function qv(e){return e==="y"?"height":"width"}var v3=new Set(["top","bottom"]);function ho(e){return v3.has(cs(e))?"y":"x"}function Yv(e){return Gv(ho(e))}function dk(e,t,n){n===void 0&&(n=!1);let r=Fc(e),o=Yv(e),s=qv(o),i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Mc(i)),[i,Mc(i)]}function fk(e){let t=Mc(e);return[gp(e),t,gp(t)]}function gp(e){return e.replace(/start|end/g,t=>y3[t])}var ck=["left","right"],uk=["right","left"],S3=["top","bottom"],x3=["bottom","top"];function w3(e,t,n){switch(e){case"top":case"bottom":return n?t?uk:ck:t?ck:uk;case"left":case"right":return t?S3:x3;default:return[]}}function pk(e,t,n,r){let o=Fc(e),s=w3(cs(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(gp)))),s}function Mc(e){return e.replace(/left|right|bottom|top/g,t=>h3[t])}function b3(e){return b({top:0,right:0,bottom:0,left:0},e)}function mk(e){return typeof e!="number"?b3(e):{top:e,right:e,bottom:e,left:e}}function si(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var E3=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],hp=E3.join(","),hk=typeof Element=="undefined",Ia=hk?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,yp=!hk&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},zc=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),s=o===""||o==="true",i=s||n&&t&&zc(t.parentNode);return i},C3=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},yk=function(t,n,r){if(zc(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(hp));return n&&Ia.call(t,hp)&&o.unshift(t),o=o.filter(r),o},vp=function(t,n,r){for(var o=[],s=Array.from(t);s.length;){var i=s.shift();if(!zc(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,c=vp(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{var u=Ia.call(i,hp);u&&r.filter(i)&&(n||!t.includes(i))&&o.push(i);var f=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),d=!zc(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(f&&d){var p=vp(f===!0?i.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:i,candidates:p})}else s.unshift.apply(s,i.children)}}return o},vk=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Sk=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||C3(t))&&!vk(t)?0:t.tabIndex},T3=function(t,n){var r=Sk(t);return r<0&&n&&!vk(t)?0:r},k3=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},xk=function(t){return t.tagName==="INPUT"},R3=function(t){return xk(t)&&t.type==="hidden"},P3=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},I3=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},A3=function(t){if(!t.name)return!0;var n=t.form||yp(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window!="undefined"&&typeof window.CSS!="undefined"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=I3(o,t.form);return!s||s===t},_3=function(t){return xk(t)&&t.type==="radio"},N3=function(t){return _3(t)&&!A3(t)},M3=function(t){var n,r=t&&yp(t),o=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==t){var i,a,l;for(s=!!((i=o)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!s&&o;){var c,u,f;r=yp(o),o=(c=r)===null||c===void 0?void 0:c.host,s=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return s},gk=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},L3=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Ia.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Ia.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var l=t;t;){var c=t.parentElement,u=yp(t);if(c&&!c.shadowRoot&&o(c)===!0)return gk(t);t.assignedSlot?t=t.assignedSlot:!c&&u!==t.ownerDocument?t=u.host:t=c}t=l}if(M3(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return gk(t);return!1},O3=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Ia.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},Xv=function(t,n){return!(n.disabled||zc(n)||R3(n)||L3(n,t)||P3(n)||O3(n))},Qv=function(t,n){return!(N3(n)||Sk(n)<0||!Xv(t,n))},D3=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},wk=function(t){var n=[],r=[];return t.forEach(function(o,s){var i=!!o.scopeParent,a=i?o.scopeParent:o,l=T3(a,i),c=i?wk(o.candidates):a;l===0?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:s,tabIndex:l,item:o,isScope:i,content:c})}),r.sort(k3).reduce(function(o,s){return s.isScope?o.push.apply(o,s.content):o.push(s.content),o},[]).concat(n)},Aa=function(t,n){n=n||{};var r;return n.getShadowRoot?r=vp([t],n.includeContainer,{filter:Qv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:D3}):r=yk(t,n.includeContainer,Qv.bind(null,n)),wk(r)},bk=function(t,n){n=n||{};var r;return n.getShadowRoot?r=vp([t],n.includeContainer,{filter:Xv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=yk(t,n.includeContainer,Xv.bind(null,n)),r},Zv=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Ia.call(t,hp)===!1?!1:Qv(n,t)};function Tk(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function e0(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function kk(){return/apple/i.test(navigator.vendor)}function Jv(){let e=/android/i;return e.test(Tk())||e.test(e0())}function F3(){return e0().includes("jsdom/")}var Ek="data-floating-ui-focusable",z3="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ii(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function en(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ta(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function yo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Sp(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Rk(e){return e.matches("html,body")}function Vt(e){return(e==null?void 0:e.ownerDocument)||document}function t0(e){return Xe(e)&&e.matches(z3)}function n0(e){return e?e.getAttribute("role")==="combobox"&&t0(e):!1}function xp(e){return e?e.hasAttribute(Ek)?e:e.querySelector("["+Ek+"]")||e:null}function ai(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...ai(e,o.id,n)])}function r0(e,t){var n;let r=[],o=(n=e.find(s=>s.id===t))==null?void 0:n.parentId;for(;o;){let s=e.find(i=>i.id===o);o=s==null?void 0:s.parentId,s&&(r=r.concat(s))}return r}function wp(e){e.preventDefault(),e.stopPropagation()}function Pk(e){return"nativeEvent"in e}function Ik(e){return e.mozInputSource===0&&e.isTrusted?!0:Jv()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Ak(e){return F3()?!1:!Jv()&&e.width===0&&e.height===0||Jv()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Na(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var H3=typeof document!="undefined",B3=function(){},tn=H3?Ck.useLayoutEffect:B3,U3=b({},_a);function us(e){let t=_a.useRef(e);return tn(()=>{t.current=e}),t}var V3=U3.useInsertionEffect,j3=V3||(e=>e());function nn(e){let t=_a.useRef(()=>{});return j3(()=>{t.current=e}),_a.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Ma=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _k(e,t){let n=Aa(e,Ma()),r=n.length;if(r===0)return;let o=ii(Vt(e)),s=n.indexOf(o),i=s===-1?t===1?0:r-1:s+t;return n[i]}function o0(e){return _k(Vt(e).body,1)||e}function s0(e){return _k(Vt(e).body,-1)||e}function La(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!en(n,r)}function Nk(e){Aa(e,Ma()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function i0(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{let r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}var xn=E(P(),1);var w0=E(Ac(),1);function Mk(e,t,n){let{reference:r,floating:o}=e,s=ho(t),i=Yv(t),a=qv(i),l=cs(t),c=s==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2,p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Fc(t)){case"start":p[i]-=d*(n&&c?-1:1);break;case"end":p[i]+=d*(n&&c?-1:1);break}return p}var Lk=(e,t,n)=>N(null,null,function*(){let{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),l=yield i.isRTL==null?void 0:i.isRTL(t),c=yield i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Mk(c,r,l),d=r,p={},h=0;for(let m=0;m<a.length;m++){let{name:S,fn:y}=a[m],{x:g,y:v,data:x,reset:C}=yield y({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=g!=null?g:u,f=v!=null?v:f,p=I(b({},p),{[S]:b(b({},p[S]),x)}),C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?yield i.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=Mk(c,d,l)),m=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:p}});function a0(e,t){return N(this,null,function*(){var n;t===void 0&&(t={});let{x:r,y:o,platform:s,rects:i,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Dc(t,e),h=mk(p),S=a[d?f==="floating"?"reference":"floating":f],y=si(yield s.getClippingRect({element:(n=yield s.isElement==null?void 0:s.isElement(S))==null||n?S:S.contextElement||(yield s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),g=f==="floating"?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=yield s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating),x=(yield s.isElement==null?void 0:s.isElement(v))?(yield s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},C=si(s.convertOffsetParentRelativeRectToViewportRelativeRect?yield s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:v,strategy:l}):g);return{top:(y.top-C.top+h.top)/x.y,bottom:(C.bottom-y.bottom+h.bottom)/x.y,left:(y.left-C.left+h.left)/x.x,right:(C.right-y.right+h.right)/x.x}})}var Ok=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return N(this,null,function*(){var r,o;let{placement:s,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=n,V=Dc(e,n),{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:S=!0}=V,y=se(V,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=i.arrow)!=null&&r.alignmentOffset)return{};let g=cs(s),v=ho(l),x=cs(l)===l,C=yield c.isRTL==null?void 0:c.isRTL(u.floating),T=p||(x||!S?[Mc(l)]:fk(l)),k=m!=="none";!p&&k&&T.push(...pk(l,S,m,C));let A=[l,...T],H=yield a0(n,y),D=[],B=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&D.push(H[g]),d){let z=dk(s,a,C);D.push(H[z[0]],H[z[1]])}if(B=[...B,{placement:s,overflows:D}],!D.every(z=>z<=0)){var J,Y;let z=(((J=i.flip)==null?void 0:J.index)||0)+1,U=A[z];if(U&&(!(d==="alignment"?v!==ho(U):!1)||B.every($=>ho($.placement)===v?$.overflows[0]>0:!0)))return{data:{index:z,overflows:B},reset:{placement:U}};let M=(Y=B.filter(q=>q.overflows[0]<=0).sort((q,$)=>q.overflows[1]-$.overflows[1])[0])==null?void 0:Y.placement;if(!M)switch(h){case"bestFit":{var _;let q=(_=B.filter($=>{if(k){let K=ho($.placement);return K===v||K==="y"}return!0}).map($=>[$.placement,$.overflows.filter(K=>K>0).reduce((K,ce)=>K+ce,0)]).sort(($,K)=>$[1]-K[1])[0])==null?void 0:_[0];q&&(M=q);break}case"initialPlacement":M=l;break}if(s!==M)return{reset:{placement:M}}}return{}})}}};var W3=new Set(["left","top"]);function $3(e,t){return N(this,null,function*(){let{placement:n,platform:r,elements:o}=e,s=yield r.isRTL==null?void 0:r.isRTL(o.floating),i=cs(n),a=Fc(n),l=ho(n)==="y",c=W3.has(i)?-1:1,u=s&&l?-1:1,f=Dc(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof h=="number"&&(p=a==="end"?h*-1:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}})}var Dk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return N(this,null,function*(){var r,o;let{x:s,y:i,placement:a,middlewareData:l}=n,c=yield $3(n,e);return a===((r=l.offset)==null?void 0:r.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+c.x,y:i+c.y,data:I(b({},c),{placement:a})}})}}},Fk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return N(this,null,function*(){let{x:r,y:o,placement:s}=n,y=Dc(e,n),{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:g=>{let{x:v,y:x}=g;return{x:v,y:x}}}}=y,c=se(y,["mainAxis","crossAxis","limiter"]),u={x:r,y:o},f=yield a0(n,c),d=ho(cs(s)),p=Gv(d),h=u[p],m=u[d];if(i){let g=p==="y"?"top":"left",v=p==="y"?"bottom":"right",x=h+f[g],C=h-f[v];h=Kv(x,h,C)}if(a){let g=d==="y"?"top":"left",v=d==="y"?"bottom":"right",x=m+f[g],C=m-f[v];m=Kv(x,m,C)}let S=l.fn(I(b({},n),{[p]:h,[d]:m}));return I(b({},S),{data:{x:S.x-r,y:S.y-o,enabled:{[p]:i,[d]:a}}})})}}};function Uk(e){let t=vn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=Xe(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,a=Lc(n)!==s||Lc(r)!==i;return a&&(n=s,r=i),{width:n,height:r,$:a}}function c0(e){return He(e)?e:e.contextElement}function Oa(e){let t=c0(e);if(!Xe(t))return mr(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Uk(t),i=(s?Lc(n.width):n.width)/r,a=(s?Lc(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}var K3=mr(0);function Vk(e){let t=Jt(e);return!Ra()||!t.visualViewport?K3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function G3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jt(e)?!1:t}function li(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),s=c0(e),i=mr(1);t&&(r?He(r)&&(i=Oa(r)):i=Oa(e));let a=G3(s,n,r)?Vk(s):mr(0),l=(o.left+a.x)/i.x,c=(o.top+a.y)/i.y,u=o.width/i.x,f=o.height/i.y;if(s){let d=Jt(s),p=r&&He(r)?Jt(r):r,h=d,m=mp(h);for(;m&&r&&p!==h;){let S=Oa(m),y=m.getBoundingClientRect(),g=vn(m),v=y.left+(m.clientLeft+parseFloat(g.paddingLeft))*S.x,x=y.top+(m.clientTop+parseFloat(g.paddingTop))*S.y;l*=S.x,c*=S.y,u*=S.x,f*=S.y,l+=v,c+=x,h=Jt(m),m=mp(h)}}return si({width:u,height:f,x:l,y:c})}function bp(e,t){let n=Nc(e).scrollLeft;return t?t.left+n:li(fr(e)).left+n}function jk(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-bp(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function q3(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,s=o==="fixed",i=fr(r),a=t?_c(t.floating):!1;if(r===i||a&&s)return n;let l={scrollLeft:0,scrollTop:0},c=mr(1),u=mr(0),f=Xe(r);if((f||!f&&!s)&&((Hr(r)!=="body"||ka(i))&&(l=Nc(r)),Xe(r))){let p=li(r);c=Oa(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}let d=i&&!f&&!s?jk(i,l):mr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function Y3(e){return Array.from(e.getClientRects())}function X3(e){let t=fr(e),n=Nc(e),r=e.ownerDocument.body,o=go(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=go(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),i=-n.scrollLeft+bp(e),a=-n.scrollTop;return vn(r).direction==="rtl"&&(i+=go(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:a}}var zk=25;function Q3(e,t){let n=Jt(e),r=fr(e),o=n.visualViewport,s=r.clientWidth,i=r.clientHeight,a=0,l=0;if(o){s=o.width,i=o.height;let u=Ra();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}let c=bp(r);if(c<=0){let u=r.ownerDocument,f=u.body,d=getComputedStyle(f),p=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,h=Math.abs(r.clientWidth-f.clientWidth-p);h<=zk&&(s-=h)}else c<=zk&&(s+=c);return{width:s,height:i,x:a,y:l}}var Z3=new Set(["absolute","fixed"]);function J3(e,t){let n=li(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Xe(e)?Oa(e):mr(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,c=r*s.y;return{width:i,height:a,x:l,y:c}}function Hk(e,t,n){let r;if(t==="viewport")r=Q3(e,n);else if(t==="document")r=X3(fr(e));else if(He(t))r=J3(t,n);else{let o=Vk(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return si(r)}function Wk(e,t){let n=dr(e);return n===t||!He(n)||pr(n)?!1:vn(n).position==="fixed"||Wk(n,t)}function e4(e,t){let n=t.get(e);if(n)return n;let r=Nn(e,[],!1).filter(a=>He(a)&&Hr(a)!=="body"),o=null,s=vn(e).position==="fixed",i=s?dr(e):e;for(;He(i)&&!pr(i);){let a=vn(i),l=pp(i);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&!!o&&Z3.has(o.position)||ka(i)&&!l&&Wk(e,i))?r=r.filter(u=>u!==i):o=a,i=dr(i)}return t.set(e,r),r}function t4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,i=[...n==="clippingAncestors"?_c(t)?[]:e4(t,this._c):[].concat(n),r],a=i[0],l=i.reduce((c,u)=>{let f=Hk(t,u,o);return c.top=go(f.top,c.top),c.right=Pa(f.right,c.right),c.bottom=Pa(f.bottom,c.bottom),c.left=go(f.left,c.left),c},Hk(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function n4(e){let{width:t,height:n}=Uk(e);return{width:t,height:n}}function r4(e,t,n){let r=Xe(t),o=fr(t),s=n==="fixed",i=li(e,!0,s,t),a={scrollLeft:0,scrollTop:0},l=mr(0);function c(){l.x=bp(o)}if(r||!r&&!s)if((Hr(t)!=="body"||ka(o))&&(a=Nc(t)),r){let p=li(t,!0,s,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}else o&&c();s&&!r&&o&&c();let u=o&&!r&&!s?jk(o,a):mr(0),f=i.left+a.scrollLeft-l.x-u.x,d=i.top+a.scrollTop-l.y-u.y;return{x:f,y:d,width:i.width,height:i.height}}function l0(e){return vn(e).position==="static"}function Bk(e,t){if(!Xe(e)||vn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fr(e)===n&&(n=n.ownerDocument.body),n}function $k(e,t){let n=Jt(e);if(_c(e))return n;if(!Xe(e)){let o=dr(e);for(;o&&!pr(o);){if(He(o)&&!l0(o))return o;o=dr(o)}return n}let r=Bk(e,t);for(;r&&ik(r)&&l0(r);)r=Bk(r,t);return r&&pr(r)&&l0(r)&&!pp(r)?n:r||ak(e)||n}var o4=function(e){return N(this,null,function*(){let t=this.getOffsetParent||$k,n=this.getDimensions,r=yield n(e.floating);return{reference:r4(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function s4(e){return vn(e).direction==="rtl"}var u0={convertOffsetParentRelativeRectToViewportRelativeRect:q3,getDocumentElement:fr,getClippingRect:t4,getOffsetParent:$k,getElementRects:o4,getClientRects:Y3,getDimensions:n4,getScale:Oa,isElement:He,isRTL:s4};function Kk(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function i4(e,t){let n=null,r,o=fr(e);function s(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),s();let c=e.getBoundingClientRect(),{left:u,top:f,width:d,height:p}=c;if(a||t(),!d||!p)return;let h=Oc(f),m=Oc(o.clientWidth-(u+d)),S=Oc(o.clientHeight-(f+p)),y=Oc(u),v={rootMargin:-h+"px "+-m+"px "+-S+"px "+-y+"px",threshold:go(0,Pa(1,l))||1},x=!0;function C(T){let k=T[0].intersectionRatio;if(k!==l){if(!x)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}k===1&&!Kk(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(C,I(b({},v),{root:o.ownerDocument}))}catch(T){n=new IntersectionObserver(C,v)}n.observe(e)}return i(!0),s}function Ep(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=c0(e),u=o||s?[...c?Nn(c):[],...Nn(t)]:[];u.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),s&&y.addEventListener("resize",n)});let f=c&&a?i4(c,n):null,d=-1,p=null;i&&(p=new ResizeObserver(y=>{let[g]=y;g&&g.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=p)==null||v.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let h,m=l?li(e):null;l&&S();function S(){let y=li(e);m&&!Kk(m,y)&&n(),m=y,h=requestAnimationFrame(S)}return n(),()=>{var y;u.forEach(g=>{o&&g.removeEventListener("scroll",n),s&&g.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,l&&cancelAnimationFrame(h)}}var Gk=Dk;var qk=Fk,Yk=Ok;var Cp=(e,t,n)=>{let r=new Map,o=b({platform:u0},n),s=I(b({},o.platform),{_c:r});return Lk(e,t,I(b({},o),{platform:s}))};var st=E(Z(),1),Zk=E(Z(),1),Jk=E(Ac(),1);var a4=typeof document!="undefined",l4=function(){},Tp=a4?Zk.useLayoutEffect:l4;function kp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!kp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){let s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!kp(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function eR(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xk(e,t){let n=eR(e);return Math.round(t*n)/n}function d0(e){let t=st.useRef(e);return Tp(()=>{t.current=e}),t}function tR(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=st.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=st.useState(r);kp(d,r)||p(r);let[h,m]=st.useState(null),[S,y]=st.useState(null),g=st.useCallback(M=>{M!==T.current&&(T.current=M,m(M))},[]),v=st.useCallback(M=>{M!==k.current&&(k.current=M,y(M))},[]),x=s||h,C=i||S,T=st.useRef(null),k=st.useRef(null),A=st.useRef(u),H=l!=null,D=d0(l),B=d0(o),J=d0(c),Y=st.useCallback(()=>{if(!T.current||!k.current)return;let M={placement:t,strategy:n,middleware:d};B.current&&(M.platform=B.current),Cp(T.current,k.current,M).then(q=>{let $=I(b({},q),{isPositioned:J.current!==!1});_.current&&!kp(A.current,$)&&(A.current=$,Jk.flushSync(()=>{f($)}))})},[d,t,n,B,J]);Tp(()=>{c===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,f(M=>I(b({},M),{isPositioned:!1})))},[c]);let _=st.useRef(!1);Tp(()=>(_.current=!0,()=>{_.current=!1}),[]),Tp(()=>{if(x&&(T.current=x),C&&(k.current=C),x&&C){if(D.current)return D.current(x,C,Y);Y()}},[x,C,Y,D,H]);let V=st.useMemo(()=>({reference:T,floating:k,setReference:g,setFloating:v}),[g,v]),z=st.useMemo(()=>({reference:x,floating:C}),[x,C]),U=st.useMemo(()=>{let M={position:n,left:0,top:0};if(!z.floating)return M;let q=Xk(z.floating,u.x),$=Xk(z.floating,u.y);return a?b(I(b({},M),{transform:"translate("+q+"px, "+$+"px)"}),eR(z.floating)>=1.5&&{willChange:"transform"}):{position:n,left:q,top:$}},[n,a,z.floating,u.x,u.y]);return st.useMemo(()=>I(b({},u),{update:Y,refs:V,elements:z,floatingStyles:U}),[u,Y,V,z,U])}var Rp=(e,t)=>I(b({},Gk(e)),{options:[e,t]}),f0=(e,t)=>I(b({},qk(e)),{options:[e,t]});var p0=(e,t)=>I(b({},Yk(e)),{options:[e,t]});function b0(e){let t=L.useRef(void 0),n=L.useCallback(r=>{let o=e.map(s=>{if(s!=null){if(typeof s=="function"){let i=s,a=i(r);return typeof a=="function"?a:()=>{i(null)}}return s.current=r,()=>{s.current=null}}});return()=>{o.forEach(s=>s==null?void 0:s())}},e);return L.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}var c4="data-floating-ui-focusable",m0="active",g0="selected",u4="ArrowLeft",d4="ArrowRight",f4="ArrowUp",p4="ArrowDown";var m4=[u4,d4],g4=[f4,p4],TV=[...m4,...g4];var h4=b({},L),nR=!1,y4=0,rR=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+y4++;function v4(){let[e,t]=L.useState(()=>nR?rR():void 0);return tn(()=>{e==null&&t(rR())},[]),L.useEffect(()=>{nR=!0},[]),e}var S4=h4.useId,E0=S4||v4;function x4(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var w4=L.createContext(null),b4=L.createContext(null),C0=()=>{var e;return((e=L.useContext(w4))==null?void 0:e.id)||null},_p=()=>L.useContext(b4);function za(e){return"data-floating-ui-"+e}function Sn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var oR=za("safe-polygon");function h0(e,t,n){if(n&&!Na(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){let r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function y0(e){return typeof e=="function"?e():e}function hR(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:o,events:s,elements:i}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,p=_p(),h=C0(),m=us(c),S=us(l),y=us(n),g=us(f),v=L.useRef(),x=L.useRef(-1),C=L.useRef(),T=L.useRef(-1),k=L.useRef(!0),A=L.useRef(!1),H=L.useRef(()=>{}),D=L.useRef(!1),B=nn(()=>{var U;let M=(U=o.current.openEvent)==null?void 0:U.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"});L.useEffect(()=>{if(!a)return;function U(M){let{open:q}=M;q||(Sn(x),Sn(T),k.current=!0,D.current=!1)}return s.on("openchange",U),()=>{s.off("openchange",U)}},[a,s]),L.useEffect(()=>{if(!a||!m.current||!n)return;function U(q){B()&&r(!1,q,"hover")}let M=Vt(i.floating).documentElement;return M.addEventListener("mouseleave",U),()=>{M.removeEventListener("mouseleave",U)}},[i.floating,n,r,a,m,B]);let J=L.useCallback(function(U,M,q){M===void 0&&(M=!0),q===void 0&&(q="hover");let $=h0(S.current,"close",v.current);$&&!C.current?(Sn(x),x.current=window.setTimeout(()=>r(!1,U,q),$)):M&&(Sn(x),r(!1,U,q))},[S,r]),Y=nn(()=>{H.current(),C.current=void 0}),_=nn(()=>{if(A.current){let U=Vt(i.floating).body;U.style.pointerEvents="",U.removeAttribute(oR),A.current=!1}}),V=nn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);L.useEffect(()=>{if(!a)return;function U(ce){if(Sn(x),k.current=!1,u&&!Na(v.current)||y0(g.current)>0&&!h0(S.current,"open"))return;let te=h0(S.current,"open",v.current);te?x.current=window.setTimeout(()=>{y.current||r(!0,ce,"hover")},te):n||r(!0,ce,"hover")}function M(ce){if(V()){_();return}H.current();let te=Vt(i.floating);if(Sn(T),D.current=!1,m.current&&o.current.floatingContext){n||Sn(x),C.current=m.current(I(b({},o.current.floatingContext),{tree:p,x:ce.clientX,y:ce.clientY,onClose(){_(),Y(),V()||J(ce,!0,"safe-polygon")}}));let ve=C.current;te.addEventListener("mousemove",ve),H.current=()=>{te.removeEventListener("mousemove",ve)};return}(v.current!=="touch"||!en(i.floating,ce.relatedTarget))&&J(ce)}function q(ce){V()||o.current.floatingContext&&(m.current==null||m.current(I(b({},o.current.floatingContext),{tree:p,x:ce.clientX,y:ce.clientY,onClose(){_(),Y(),V()||J(ce)}}))(ce))}function $(){Sn(x)}function K(ce){V()||J(ce,!1)}if(He(i.domReference)){let ce=i.domReference,te=i.floating;return n&&ce.addEventListener("mouseleave",q),d&&ce.addEventListener("mousemove",U,{once:!0}),ce.addEventListener("mouseenter",U),ce.addEventListener("mouseleave",M),te&&(te.addEventListener("mouseleave",q),te.addEventListener("mouseenter",$),te.addEventListener("mouseleave",K)),()=>{n&&ce.removeEventListener("mouseleave",q),d&&ce.removeEventListener("mousemove",U),ce.removeEventListener("mouseenter",U),ce.removeEventListener("mouseleave",M),te&&(te.removeEventListener("mouseleave",q),te.removeEventListener("mouseenter",$),te.removeEventListener("mouseleave",K))}}},[i,a,e,u,d,J,Y,_,r,n,y,p,S,m,o,V,g]),tn(()=>{var U;if(a&&n&&(U=m.current)!=null&&(U=U.__options)!=null&&U.blockPointerEvents&&B()){A.current=!0;let q=i.floating;if(He(i.domReference)&&q){var M;let $=Vt(i.floating).body;$.setAttribute(oR,"");let K=i.domReference,ce=p==null||(M=p.nodesRef.current.find(te=>te.id===h))==null||(M=M.context)==null?void 0:M.elements.floating;return ce&&(ce.style.pointerEvents=""),$.style.pointerEvents="none",K.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{$.style.pointerEvents="",K.style.pointerEvents="",q.style.pointerEvents=""}}}},[a,n,h,i,p,m,B]),tn(()=>{n||(v.current=void 0,D.current=!1,Y(),_())},[n,Y,_]),L.useEffect(()=>()=>{Y(),Sn(x),Sn(T),_()},[a,i.domReference,Y,_]);let z=L.useMemo(()=>{function U(M){v.current=M.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove(M){let{nativeEvent:q}=M;function $(){!k.current&&!y.current&&r(!0,q,"hover")}u&&!Na(v.current)||n||y0(g.current)===0||D.current&&tg(M.movementX,2)+tg(M.movementY,2)<2||(Sn(T),v.current==="touch"?$():(D.current=!0,T.current=window.setTimeout($,y0(g.current))))}}},[u,r,n,y,g]);return L.useMemo(()=>a?{reference:z}:{},[a,z])}var sR=0;function Da(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(sR);let s=()=>e==null?void 0:e.focus({preventScroll:n});o?s():sR=requestAnimationFrame(s)}function v0(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ta(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function E4(e){return"composedPath"in e?e.composedPath()[0]:e.target}function C4(e){return(e==null?void 0:e.ownerDocument)||document}var Fa={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function iR(e){return e==="inert"?Fa.inert:e==="aria-hidden"?Fa["aria-hidden"]:Fa.none}var Pp=new WeakSet,Ip={},S0=0,T4=()=>typeof HTMLElement!="undefined"&&"inert"in HTMLElement.prototype,yR=e=>e&&(e.host||yR(e.parentNode)),k4=(e,t)=>t.map(n=>{if(e.contains(n))return n;let r=yR(n);return e.contains(r)?r:null}).filter(n=>n!=null);function R4(e,t,n,r){let o="data-floating-ui-inert",s=r?"inert":n?"aria-hidden":null,i=k4(t,e),a=new Set,l=new Set(i),c=[];Ip[o]||(Ip[o]=new WeakMap);let u=Ip[o];i.forEach(f),d(t),a.clear();function f(p){!p||a.has(p)||(a.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||l.has(p)||[].forEach.call(p.children,h=>{if(Hr(h)!=="script")if(a.has(h))d(h);else{let m=s?h.getAttribute(s):null,S=m!==null&&m!=="false",y=iR(s),g=(y.get(h)||0)+1,v=(u.get(h)||0)+1;y.set(h,g),u.set(h,v),c.push(h),g===1&&S&&Pp.add(h),v===1&&h.setAttribute(o,""),!S&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return S0++,()=>{c.forEach(p=>{let h=iR(s),S=(h.get(p)||0)-1,y=(u.get(p)||0)-1;h.set(p,S),u.set(p,y),S||(!Pp.has(p)&&s&&p.removeAttribute(s),Pp.delete(p)),y||p.removeAttribute(o)}),S0--,S0||(Fa.inert=new WeakMap,Fa["aria-hidden"]=new WeakMap,Fa.none=new WeakMap,Pp=new WeakSet,Ip={})}}function aR(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=C4(e[0]).body;return R4(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}var Np={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},Ap=L.forwardRef(function(t,n){let[r,o]=L.useState();tn(()=>{kk()&&o("button")},[]);let s={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[za("focus-guard")]:"",style:Np};return(0,xn.jsx)("span",b(b({},t),s))}),vR=L.createContext(null),lR=za("portal");function P4(e){e===void 0&&(e={});let{id:t,root:n}=e,r=E0(),o=xR(),[s,i]=L.useState(null),a=L.useRef(null);return tn(()=>()=>{s==null||s.remove(),queueMicrotask(()=>{a.current=null})},[s]),tn(()=>{if(!r||a.current)return;let l=t?document.getElementById(t):null;if(!l)return;let c=document.createElement("div");c.id=r,c.setAttribute(lR,""),l.appendChild(c),a.current=c,i(c)},[t,r]),tn(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!fp(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));let u=document.createElement("div");u.id=r,u.setAttribute(lR,""),l=c||l,l.appendChild(u),a.current=u,i(u)},[t,n,r,o]),s}function SR(e){let{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,s=P4({id:n,root:r}),[i,a]=L.useState(null),l=L.useRef(null),c=L.useRef(null),u=L.useRef(null),f=L.useRef(null),d=i==null?void 0:i.modal,p=i==null?void 0:i.open,h=!!i&&!i.modal&&i.open&&o&&!!(r||s);return L.useEffect(()=>{if(!s||!o||d)return;function m(S){s&&La(S)&&(S.type==="focusin"?i0:Nk)(s)}return s.addEventListener("focusin",m,!0),s.addEventListener("focusout",m,!0),()=>{s.removeEventListener("focusin",m,!0),s.removeEventListener("focusout",m,!0)}},[s,o,d]),L.useEffect(()=>{s&&(p||i0(s))},[p,s]),(0,xn.jsxs)(vR.Provider,{value:L.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:f,portalNode:s,setFocusManagerState:a}),[o,s]),children:[h&&s&&(0,xn.jsx)(Ap,{"data-type":"outside",ref:l,onFocus:m=>{if(La(m,s)){var S;(S=u.current)==null||S.focus()}else{let y=i?i.domReference:null,g=s0(y);g==null||g.focus()}}}),h&&s&&(0,xn.jsx)("span",{"aria-owns":s.id,style:Np}),s&&w0.createPortal(t,s),h&&s&&(0,xn.jsx)(Ap,{"data-type":"outside",ref:c,onFocus:m=>{if(La(m,s)){var S;(S=f.current)==null||S.focus()}else{let y=i?i.domReference:null,g=o0(y);g==null||g.focus(),i!=null&&i.closeOnFocusOut&&(i==null||i.onOpenChange(!1,m.nativeEvent,"focus-out"))}}})]})}var xR=()=>L.useContext(vR);function cR(e){return L.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}var I4=20,ds=[];function T0(){ds=ds.filter(e=>e.isConnected)}function A4(e){T0(),e&&Hr(e)!=="body"&&(ds.push(e),ds.length>I4&&(ds=ds.slice(-20)))}function uR(){return T0(),ds[ds.length-1]}function _4(e){let t=Ma();return Zv(e,t)?e:Aa(e,t)[0]||e}function dR(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;let r=Ma(),s=bk(e,r).filter(a=>{let l=a.getAttribute("data-tabindex")||"";return Zv(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}var N4=L.forwardRef(function(t,n){return(0,xn.jsx)("button",I(b({},t),{type:"button",ref:n,tabIndex:-1,style:Np}))});function wR(e){let{context:t,children:n,disabled:r=!1,order:o=["content"],guards:s=!0,initialFocus:i=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:h,onOpenChange:m,events:S,dataRef:y,elements:{domReference:g,floating:v}}=t,x=nn(()=>{var oe;return(oe=y.current.floatingContext)==null?void 0:oe.nodeId}),C=nn(p),T=typeof i=="number"&&i<0,k=n0(g)&&T,A=T4(),H=A?s:!0,D=!H||A&&d,B=us(o),J=us(i),Y=us(a),_=_p(),V=xR(),z=L.useRef(null),U=L.useRef(null),M=L.useRef(!1),q=L.useRef(!1),$=L.useRef(-1),K=L.useRef(-1),ce=V!=null,te=xp(v),Qe=nn(function(oe){return oe===void 0&&(oe=te),oe?Aa(oe,Ma()):[]}),ve=nn(oe=>{let ne=Qe(oe);return B.current.map(fe=>g&&fe==="reference"?g:te&&fe==="floating"?te:ne).filter(Boolean).flat()});L.useEffect(()=>{if(r||!c)return;function oe(fe){if(fe.key==="Tab"){en(te,ii(Vt(te)))&&Qe().length===0&&!k&&wp(fe);let ue=ve(),We=yo(fe);B.current[0]==="reference"&&We===g&&(wp(fe),fe.shiftKey?Da(ue[ue.length-1]):Da(ue[1])),B.current[1]==="floating"&&We===te&&fe.shiftKey&&(wp(fe),Da(ue[0]))}}let ne=Vt(te);return ne.addEventListener("keydown",oe),()=>{ne.removeEventListener("keydown",oe)}},[r,g,te,c,B,k,Qe,ve]),L.useEffect(()=>{if(r||!v)return;function oe(ne){let fe=yo(ne),We=Qe().indexOf(fe);We!==-1&&($.current=We)}return v.addEventListener("focusin",oe),()=>{v.removeEventListener("focusin",oe)}},[r,v,Qe]),L.useEffect(()=>{if(r||!f)return;function oe(){q.current=!0,setTimeout(()=>{q.current=!1})}function ne(We){let Ce=We.relatedTarget,mt=We.currentTarget,jt=yo(We);queueMicrotask(()=>{let Et=x(),xr=!(en(g,Ce)||en(v,Ce)||en(Ce,v)||en(V==null?void 0:V.portalNode,Ce)||Ce!=null&&Ce.hasAttribute(za("focus-guard"))||_&&(ai(_.nodesRef.current,Et).find(Xn=>{var gt,ln;return en((gt=Xn.context)==null?void 0:gt.elements.floating,Ce)||en((ln=Xn.context)==null?void 0:ln.elements.domReference,Ce)})||r0(_.nodesRef.current,Et).find(Xn=>{var gt,ln,wr;return[(gt=Xn.context)==null?void 0:gt.elements.floating,xp((ln=Xn.context)==null?void 0:ln.elements.floating)].includes(Ce)||((wr=Xn.context)==null?void 0:wr.elements.domReference)===Ce})));if(mt===g&&te&&dR(te,B),l&&mt!==g&&!(jt!=null&&jt.isConnected)&&ii(Vt(te))===Vt(te).body){Xe(te)&&te.focus();let Xn=$.current,gt=Qe(),ln=gt[Xn]||gt[gt.length-1]||te;Xe(ln)&&ln.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(k||!c)&&Ce&&xr&&!q.current&&Ce!==uR()&&(M.current=!0,m(!1,We,"focus-out"))})}let fe=!!(!_&&V);function ue(){Sn(K),y.current.insideReactTree=!0,K.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(v&&Xe(g))return g.addEventListener("focusout",ne),g.addEventListener("pointerdown",oe),v.addEventListener("focusout",ne),fe&&v.addEventListener("focusout",ue,!0),()=>{g.removeEventListener("focusout",ne),g.removeEventListener("pointerdown",oe),v.removeEventListener("focusout",ne),fe&&v.removeEventListener("focusout",ue,!0)}},[r,g,v,te,c,_,V,m,f,l,Qe,k,x,B,y]);let tt=L.useRef(null),pt=L.useRef(null),Oe=cR([tt,V==null?void 0:V.beforeInsideRef]),Me=cR([pt,V==null?void 0:V.afterInsideRef]);L.useEffect(()=>{var oe,ne;if(r||!v)return;let fe=Array.from((V==null||(oe=V.portalNode)==null?void 0:oe.querySelectorAll("["+za("portal")+"]"))||[]),We=(ne=(_?r0(_.nodesRef.current,x()):[]).find(jt=>{var Et;return n0(((Et=jt.context)==null?void 0:Et.elements.domReference)||null)}))==null||(ne=ne.context)==null?void 0:ne.elements.domReference,Ce=[v,We,...fe,...C(),z.current,U.current,tt.current,pt.current,V==null?void 0:V.beforeOutsideRef.current,V==null?void 0:V.afterOutsideRef.current,B.current.includes("reference")||k?g:null].filter(jt=>jt!=null),mt=c||k?aR(Ce,!D,D):aR(Ce);return()=>{mt()}},[r,g,v,c,B,V,k,H,D,_,x,C]),tn(()=>{if(r||!Xe(te))return;let oe=Vt(te),ne=ii(oe);queueMicrotask(()=>{let fe=ve(te),ue=J.current,We=(typeof ue=="number"?fe[ue]:ue.current)||te,Ce=en(te,ne);!T&&!Ce&&h&&Da(We,{preventScroll:We===te})})},[r,h,te,T,ve,J]),tn(()=>{if(r||!te)return;let oe=Vt(te),ne=ii(oe);A4(ne);function fe(Ce){let{reason:mt,event:jt,nested:Et}=Ce;if(["hover","safe-polygon"].includes(mt)&&jt.type==="mouseleave"&&(M.current=!0),mt==="outside-press")if(Et)M.current=!1;else if(Ik(jt)||Ak(jt))M.current=!1;else{let xr=!1;document.createElement("div").focus({get preventScroll(){return xr=!0,!1}}),xr?M.current=!1:M.current=!0}}S.on("openchange",fe);let ue=oe.createElement("span");ue.setAttribute("tabindex","-1"),ue.setAttribute("aria-hidden","true"),Object.assign(ue.style,Np),ce&&g&&g.insertAdjacentElement("afterend",ue);function We(){if(typeof Y.current=="boolean"){let Ce=g||uR();return Ce&&Ce.isConnected?Ce:ue}return Y.current.current||ue}return()=>{S.off("openchange",fe);let Ce=ii(oe),mt=en(v,Ce)||_&&ai(_.nodesRef.current,x(),!1).some(Et=>{var xr;return en((xr=Et.context)==null?void 0:xr.elements.floating,Ce)}),jt=We();queueMicrotask(()=>{let Et=_4(jt);Y.current&&!M.current&&Xe(Et)&&(!(Et!==Ce&&Ce!==oe.body)||mt)&&Et.focus({preventScroll:!0}),ue.remove()})}},[r,v,te,Y,y,S,_,ce,g,x]),L.useEffect(()=>(queueMicrotask(()=>{M.current=!1}),()=>{queueMicrotask(T0)}),[r]),tn(()=>{if(!r&&V)return V.setFocusManagerState({modal:c,closeOnFocusOut:f,open:h,onOpenChange:m,domReference:g}),()=>{V.setFocusManagerState(null)}},[r,V,c,h,m,f,g]),tn(()=>{r||te&&dR(te,B)},[r,te,B]);function at(oe){return r||!u||!c?null:(0,xn.jsx)(N4,{ref:oe==="start"?z:U,onClick:ne=>m(!1,ne.nativeEvent),children:typeof u=="string"?u:"Dismiss"})}let he=!r&&H&&(c?!k:!0)&&(ce||c);return(0,xn.jsxs)(xn.Fragment,{children:[he&&(0,xn.jsx)(Ap,{"data-type":"inside",ref:Oe,onFocus:oe=>{if(c){let fe=ve();Da(o[0]==="reference"?fe[0]:fe[fe.length-1])}else if(V!=null&&V.preserveTabOrder&&V.portalNode)if(M.current=!1,La(oe,V.portalNode)){let fe=o0(g);fe==null||fe.focus()}else{var ne;(ne=V.beforeOutsideRef.current)==null||ne.focus()}}}),!k&&at("start"),n,at("end"),he&&(0,xn.jsx)(Ap,{"data-type":"inside",ref:Me,onFocus:oe=>{if(c)Da(ve()[0]);else if(V!=null&&V.preserveTabOrder&&V.portalNode)if(f&&(M.current=!0),La(oe,V.portalNode)){let fe=s0(g);fe==null||fe.focus()}else{var ne;(ne=V.afterOutsideRef.current)==null||ne.focus()}}})]})}function fR(e){return Xe(e.target)&&e.target.tagName==="BUTTON"}function M4(e){return Xe(e.target)&&e.target.tagName==="A"}function pR(e){return t0(e)}function bR(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:o,elements:{domReference:s}}=e,{enabled:i=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=L.useRef(),p=L.useRef(!1),h=L.useMemo(()=>({onPointerDown(m){d.current=m.pointerType},onMouseDown(m){let S=d.current;m.button===0&&a!=="click"&&(Na(S,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,m.nativeEvent,"click"):(m.preventDefault(),r(!0,m.nativeEvent,"click"))))},onClick(m){let S=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Na(S,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,m.nativeEvent,"click"):r(!0,m.nativeEvent,"click"))},onKeyDown(m){d.current=void 0,!(m.defaultPrevented||!u||fR(m))&&(m.key===" "&&!pR(s)&&(m.preventDefault(),p.current=!0),!M4(m)&&m.key==="Enter"&&r(!(n&&l),m.nativeEvent,"click"))},onKeyUp(m){m.defaultPrevented||!u||fR(m)||pR(s)||m.key===" "&&p.current&&(p.current=!1,r(!(n&&l),m.nativeEvent,"click"))}}),[o,s,a,c,u,r,n,f,l]);return L.useMemo(()=>i?{reference:h}:{},[i,h])}var L4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},O4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mR=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function ER(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:o,dataRef:s}=e,{enabled:i=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:h}=t,m=_p(),S=nn(typeof l=="function"?l:()=>!1),y=typeof l=="function"?S:l,g=L.useRef(!1),{escapeKey:v,outsidePress:x}=mR(p),{escapeKey:C,outsidePress:T}=mR(h),k=L.useRef(!1),A=nn(_=>{var V;if(!n||!i||!a||_.key!=="Escape"||k.current)return;let z=(V=s.current.floatingContext)==null?void 0:V.nodeId,U=m?ai(m.nodesRef.current,z):[];if(!v&&(_.stopPropagation(),U.length>0)){let M=!0;if(U.forEach(q=>{var $;if(($=q.context)!=null&&$.open&&!q.context.dataRef.current.__escapeKeyBubbles){M=!1;return}}),!M)return}r(!1,Pk(_)?_.nativeEvent:_,"escape-key")}),H=nn(_=>{var V;let z=()=>{var U;A(_),(U=yo(_))==null||U.removeEventListener("keydown",z)};(V=yo(_))==null||V.addEventListener("keydown",z)}),D=nn(_=>{var V;let z=s.current.insideReactTree;s.current.insideReactTree=!1;let U=g.current;if(g.current=!1,c==="click"&&U||z||typeof y=="function"&&!y(_))return;let M=yo(_),q="["+za("inert")+"]",$=Vt(o.floating).querySelectorAll(q),K=He(M)?M:null;for(;K&&!pr(K);){let ve=dr(K);if(pr(ve)||!He(ve))break;K=ve}if($.length&&He(M)&&!Rk(M)&&!en(M,o.floating)&&Array.from($).every(ve=>!en(K,ve)))return;if(Xe(M)&&Y){let ve=pr(M),tt=vn(M),pt=/auto|scroll/,Oe=ve||pt.test(tt.overflowX),Me=ve||pt.test(tt.overflowY),at=Oe&&M.clientWidth>0&&M.scrollWidth>M.clientWidth,he=Me&&M.clientHeight>0&&M.scrollHeight>M.clientHeight,oe=tt.direction==="rtl",ne=he&&(oe?_.offsetX<=M.offsetWidth-M.clientWidth:_.offsetX>M.clientWidth),fe=at&&_.offsetY>M.clientHeight;if(ne||fe)return}let ce=(V=s.current.floatingContext)==null?void 0:V.nodeId,te=m&&ai(m.nodesRef.current,ce).some(ve=>{var tt;return Sp(_,(tt=ve.context)==null?void 0:tt.elements.floating)});if(Sp(_,o.floating)||Sp(_,o.domReference)||te)return;let Qe=m?ai(m.nodesRef.current,ce):[];if(Qe.length>0){let ve=!0;if(Qe.forEach(tt=>{var pt;if((pt=tt.context)!=null&&pt.open&&!tt.context.dataRef.current.__outsidePressBubbles){ve=!1;return}}),!ve)return}r(!1,_,"outside-press")}),B=nn(_=>{var V;let z=()=>{var U;D(_),(U=yo(_))==null||U.removeEventListener(c,z)};(V=yo(_))==null||V.addEventListener(c,z)});L.useEffect(()=>{if(!n||!i)return;s.current.__escapeKeyBubbles=v,s.current.__outsidePressBubbles=x;let _=-1;function V($){r(!1,$,"ancestor-scroll")}function z(){window.clearTimeout(_),k.current=!0}function U(){_=window.setTimeout(()=>{k.current=!1},Ra()?5:0)}let M=Vt(o.floating);a&&(M.addEventListener("keydown",C?H:A,C),M.addEventListener("compositionstart",z),M.addEventListener("compositionend",U)),y&&M.addEventListener(c,T?B:D,T);let q=[];return d&&(He(o.domReference)&&(q=Nn(o.domReference)),He(o.floating)&&(q=q.concat(Nn(o.floating))),!He(o.reference)&&o.reference&&o.reference.contextElement&&(q=q.concat(Nn(o.reference.contextElement)))),q=q.filter($=>{var K;return $!==((K=M.defaultView)==null?void 0:K.visualViewport)}),q.forEach($=>{$.addEventListener("scroll",V,{passive:!0})}),()=>{a&&(M.removeEventListener("keydown",C?H:A,C),M.removeEventListener("compositionstart",z),M.removeEventListener("compositionend",U)),y&&M.removeEventListener(c,T?B:D,T),q.forEach($=>{$.removeEventListener("scroll",V)}),window.clearTimeout(_)}},[s,o,a,y,c,n,r,d,i,v,x,A,C,H,D,T,B]),L.useEffect(()=>{s.current.insideReactTree=!1},[s,y,c]);let J=L.useMemo(()=>b({onKeyDown:A},u&&b({[L4[f]]:_=>{r(!1,_.nativeEvent,"reference-press")}},f!=="click"&&{onClick(_){r(!1,_.nativeEvent,"reference-press")}})),[A,r,u,f]),Y=L.useMemo(()=>({onKeyDown:A,onMouseDown(){g.current=!0},onMouseUp(){g.current=!0},[O4[c]]:()=>{s.current.insideReactTree=!0}}),[A,c,s]);return L.useMemo(()=>i?{reference:J,floating:Y}:{},[i,J,Y])}function D4(e){let{open:t=!1,onOpenChange:n,elements:r}=e,o=E0(),s=L.useRef({}),[i]=L.useState(()=>x4()),a=C0()!=null,[l,c]=L.useState(r.reference),u=nn((p,h,m)=>{s.current.openEvent=p?h:void 0,i.emit("openchange",{open:p,event:h,reason:m,nested:a}),n==null||n(p,h,m)}),f=L.useMemo(()=>({setPositionReference:c}),[]),d=L.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return L.useMemo(()=>({dataRef:s,open:t,onOpenChange:u,elements:d,events:i,floatingId:o,refs:f}),[t,u,d,i,o,f])}function CR(e){e===void 0&&(e={});let{nodeId:t}=e,n=D4(I(b({},e),{elements:b({reference:null,floating:null},e.elements)})),r=e.rootContext||n,o=r.elements,[s,i]=L.useState(null),[a,l]=L.useState(null),u=(o==null?void 0:o.domReference)||s,f=L.useRef(null),d=_p();tn(()=>{u&&(f.current=u)},[u]);let p=tR(I(b({},e),{elements:b(b({},o),a&&{reference:a})})),h=L.useCallback(v=>{let x=He(v)?{getBoundingClientRect:()=>v.getBoundingClientRect(),getClientRects:()=>v.getClientRects(),contextElement:v}:v;l(x),p.refs.setReference(x)},[p.refs]),m=L.useCallback(v=>{(He(v)||v===null)&&(f.current=v,i(v)),(He(p.refs.reference.current)||p.refs.reference.current===null||v!==null&&!He(v))&&p.refs.setReference(v)},[p.refs]),S=L.useMemo(()=>I(b({},p.refs),{setReference:m,setPositionReference:h,domReference:f}),[p.refs,m,h]),y=L.useMemo(()=>I(b({},p.elements),{domReference:u}),[p.elements,u]),g=L.useMemo(()=>I(b(b({},p),r),{refs:S,elements:y,nodeId:t}),[p,S,y,t,r]);return tn(()=>{r.dataRef.current.floatingContext=g;let v=d==null?void 0:d.nodesRef.current.find(x=>x.id===t);v&&(v.context=g)}),L.useMemo(()=>I(b({},p),{context:g,refs:S,elements:y}),[p,S,y,g])}function x0(e,t,n){let r=new Map,o=n==="item",s=e;if(o&&e){let i=e,{[m0]:a,[g0]:l}=i;s=se(i,[ng(m0),ng(g0)])}return b(b(b({},n==="floating"&&{tabIndex:-1,[c4]:""}),s),t.map(a=>{let l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(c=>{let[u,f]=c;if(!(o&&[m0,g0].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof f=="function"){var d;(d=r.get(u))==null||d.push(f),a[u]=function(){for(var p,h=arguments.length,m=new Array(h),S=0;S<h;S++)m[S]=arguments[S];return(p=r.get(u))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)}}}else a[u]=f}),a),{}))}function TR(e){e===void 0&&(e=[]);let t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=L.useCallback(a=>x0(a,e,"reference"),t),s=L.useCallback(a=>x0(a,e,"floating"),n),i=L.useCallback(a=>x0(a,e,"item"),r);return L.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:i}),[o,s,i])}var F4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function kR(e,t){var n,r;t===void 0&&(t={});let{open:o,elements:s,floatingId:i}=e,{enabled:a=!0,role:l="dialog"}=t,c=E0(),u=((n=s.domReference)==null?void 0:n.id)||c,f=L.useMemo(()=>{var g;return((g=xp(s.floating))==null?void 0:g.id)||i},[s.floating,i]),d=(r=F4.get(l))!=null?r:l,h=C0()!=null,m=L.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:b(b(b(b(b({"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0},d==="listbox"&&{role:"combobox"}),d==="menu"&&{id:u}),d==="menu"&&h&&{role:"menuitem"}),l==="select"&&{"aria-autocomplete":"none"}),l==="combobox"&&{"aria-autocomplete":"list"}),[d,f,h,o,u,l]),S=L.useMemo(()=>{let g=b({id:f},d&&{role:d});return d==="tooltip"||l==="label"?g:b(b({},g),d==="menu"&&{"aria-labelledby":u})},[d,f,u,l]),y=L.useCallback(g=>{let{active:v,selected:x}=g,C=b({role:"option"},v&&{id:f+"-fui-option"});switch(l){case"select":case"combobox":return I(b({},C),{"aria-selected":x})}return{}},[f,l]);return L.useMemo(()=>a?{reference:m,floating:S,item:y}:{},[a,m,S,y])}function RR(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var s;return o.parentId===t&&(!n||((s=o.context)==null?void 0:s.open))}).flatMap(o=>[o,...RR(e,o.id,n)])}function gR(e,t){let[n,r]=e,o=!1,s=t.length;for(let i=0,a=s-1;i<s;a=i++){let[l,c]=t[i]||[0,0],[u,f]=t[a]||[0,0];c>=r!=f>=r&&n<=(u-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function z4(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function PR(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1},s=!1,i=null,a=null,l=typeof performance!="undefined"?performance.now():0;function c(f,d){let p=performance.now(),h=p-l;if(i===null||a===null||h===0)return i=f,a=d,l=p,null;let m=f-i,S=d-a,g=Math.sqrt(m*m+S*S)/h;return i=f,a=d,l=p,g}let u=f=>{let{x:d,y:p,placement:h,elements:m,onClose:S,nodeId:y,tree:g}=f;return function(x){function C(){Sn(o),S()}if(Sn(o),!m.domReference||!m.floating||h==null||d==null||p==null)return;let{clientX:T,clientY:k}=x,A=[T,k],H=E4(x),D=x.type==="mouseleave",B=v0(m.floating,H),J=v0(m.domReference,H),Y=m.domReference.getBoundingClientRect(),_=m.floating.getBoundingClientRect(),V=h.split("-")[0],z=d>_.right-_.width/2,U=p>_.bottom-_.height/2,M=z4(A,Y),q=_.width>Y.width,$=_.height>Y.height,K=(q?Y:_).left,ce=(q?Y:_).right,te=($?Y:_).top,Qe=($?Y:_).bottom;if(B&&(s=!0,!D))return;if(J&&(s=!1),J&&!D){s=!0;return}if(D&&He(x.relatedTarget)&&v0(m.floating,x.relatedTarget)||g&&RR(g.nodesRef.current,y).length)return;if(V==="top"&&p>=Y.bottom-1||V==="bottom"&&p<=Y.top+1||V==="left"&&d>=Y.right-1||V==="right"&&d<=Y.left+1)return C();let ve=[];switch(V){case"top":ve=[[K,Y.top+1],[K,_.bottom-1],[ce,_.bottom-1],[ce,Y.top+1]];break;case"bottom":ve=[[K,_.top+1],[K,Y.bottom-1],[ce,Y.bottom-1],[ce,_.top+1]];break;case"left":ve=[[_.right-1,Qe],[_.right-1,te],[Y.left+1,te],[Y.left+1,Qe]];break;case"right":ve=[[Y.right-1,Qe],[Y.right-1,te],[_.left+1,te],[_.left+1,Qe]];break}function tt(pt){let[Oe,Me]=pt;switch(V){case"top":{let at=[q?Oe+t/2:z?Oe+t*4:Oe-t*4,Me+t+1],he=[q?Oe-t/2:z?Oe+t*4:Oe-t*4,Me+t+1],oe=[[_.left,z||q?_.bottom-t:_.top],[_.right,z?q?_.bottom-t:_.top:_.bottom-t]];return[at,he,...oe]}case"bottom":{let at=[q?Oe+t/2:z?Oe+t*4:Oe-t*4,Me-t],he=[q?Oe-t/2:z?Oe+t*4:Oe-t*4,Me-t],oe=[[_.left,z||q?_.top+t:_.bottom],[_.right,z?q?_.top+t:_.bottom:_.top+t]];return[at,he,...oe]}case"left":{let at=[Oe+t+1,$?Me+t/2:U?Me+t*4:Me-t*4],he=[Oe+t+1,$?Me-t/2:U?Me+t*4:Me-t*4];return[...[[U||$?_.right-t:_.left,_.top],[U?$?_.right-t:_.left:_.right-t,_.bottom]],at,he]}case"right":{let at=[Oe-t,$?Me+t/2:U?Me+t*4:Me-t*4],he=[Oe-t,$?Me-t/2:U?Me+t*4:Me-t*4],oe=[[U||$?_.left+t:_.right,_.top],[U?$?_.left+t:_.right:_.left+t,_.bottom]];return[at,he,...oe]}}}if(!gR([T,k],ve)){if(s&&!M)return C();if(!D&&r){let pt=c(x.clientX,x.clientY);if(pt!==null&&pt<.1)return C()}gR([T,k],tt([d,p]))?!s&&r&&(o.current=window.setTimeout(C,40)):C()}}};return u.__options={blockPointerEvents:n},u}var Mp={tooltip:"dd-XpCXd",tooltipTrigger:"dd-8TKeF",arrow:"dd-ZEu2Y"};var Gn=E(P());function H4({initialOpen:e=!1,placement:t="bottom",modal:n,tooltip:r,open:o,onOpenChange:s}={}){let[i,a]=Br.useState(e),l=o!=null?o:i,c=s!=null?s:a,u=CR({placement:t,open:l,onOpenChange:c,whileElementsMounted:Ep,middleware:[Rp(5),p0({crossAxis:t.includes("-"),fallbackAxisSideDirection:"end",padding:5}),f0({padding:10})]}),f=u.context,d=bR(f,{enabled:o==null}),p=ER(f),h=kR(f),m=hR(f,{enabled:r!=null?r:!1,handleClose:PR()}),S=TR([d,p,h,m]);return Br.useMemo(()=>I(b(b({open:l,setOpen:c},S),u),{modal:n}),[l,c,S,u,n])}var IR=Br.createContext(null),k0=()=>{let e=Br.useContext(IR);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},ci=r=>{var o=r,{children:e,modal:t=!1}=o,n=se(o,["children","modal"]);let s=H4(b({modal:t},n));return(0,Gn.jsx)(IR.Provider,{value:s,children:e})};function B4(r){var o=r,{as:e,children:t}=o,n=se(o,["as","children"]);let s=k0(),i=e||"button",a=t.ref,l=b0([s.refs.setReference,a]);return(0,Gn.jsx)(i,I(b({ref:l,type:"button"},s.getReferenceProps(n)),{children:t}))}var U4=Br.forwardRef(function(o,r){var s=o,{style:t}=s,n=se(s,["style"]);let c=k0(),{context:i}=c,a=se(c,["context"]),l=b0([a.refs.setFloating,r]);return i.open?(0,Gn.jsx)(SR,{children:(0,Gn.jsx)(wR,{context:i,modal:a.modal,disabled:n.disableFocusManager,children:(0,Gn.jsx)("div",I(b({ref:l,style:b(I(b({},a.floatingStyles),{zIndex:1e7}),t)},a.getFloatingProps(n)),{children:n.children}))})}):null});function V4(o){var s=o,{as:e,children:t,onClick:n}=s,r=se(s,["as","children","onClick"]);let{setOpen:i}=k0();return(0,Gn.jsx)(e||"button",I(b({type:"button",onClick:c=>{n(c),i(!1),c.stopPropagation()}},r),{children:t}))}function AR({trigger:e,children:t,placement:n="top"}){return(0,Gn.jsxs)(ci,{tooltip:!0,placement:n,children:[(0,Gn.jsxs)(ci.Content,{className:Mp.tooltip,children:[t,(0,Gn.jsx)("div",{className:Mp.arrow})]}),(0,Gn.jsx)(ci.Trigger,{className:Mp.tooltipTrigger,children:e})]})}ci.Trigger=B4;ci.Content=U4;ci.Button=V4;var wt=ci;var NR=E(Z());var _R={error:"dd-CoAuB"};var R0={};yt(R0,{enUS:()=>j4,nlNL:()=>W4});var j4={errorPrefix:[{type:0,value:"Error:"}]},W4={errorPrefix:[{type:0,value:"Foutmelding:"}]};var Hc=E(P()),MR=({message:e})=>{let t=(0,NR.useRef)(null),n=O("WidgetCardError",_R),r=ie(R0);return Fu(t),(0,Hc.jsx)(de,{ref:t,children:(0,Hc.jsx)(Se,{children:(0,Hc.jsxs)(Se.Content,{className:n.error,children:[r("errorPrefix")," ",e]})})})};var ye=E(P()),$4=3,K4=({sources:e,onClick:t})=>{let n=ie(Ca),r=O("WidgetKnowledgeAssistant",up),[o,s]=(0,et.useState)(!1),i=o?e:e.slice(0,$4);return i.length===0?null:(0,ye.jsxs)("ul",{className:r.sources,children:[i.map(a=>(0,ye.jsx)("li",{className:r.source,"data-testid":"knowledge-assist-source",children:(0,ye.jsxs)(wt,{tooltip:!0,placement:"top-start",children:[(0,ye.jsx)(wt.Trigger,{as:"a",rel:"noreferrer",target:"_blank",href:a.url,onClick:l=>{l.stopPropagation(),t(a)},children:(0,ye.jsx)("span",{className:r.linkContent,children:a.name})}),a.url&&(0,ye.jsx)(wt.Content,{className:r.tooltip,children:decodeURIComponent(a.url)})]})},a.name)),i<e&&(0,ye.jsx)("button",{type:"button",className:r.showMoreSources,onClick:()=>s(!0),children:n("showMore",{amount:e.length-i.length})})]})},G4=({title:e,description:t})=>(0,ye.jsx)(de,{"data-testid":"knowledge-assist-empty-state",children:(0,ye.jsx)(Se,{children:(0,ye.jsxs)(Se.Content,{children:[(0,ye.jsx)(Se.Title,{children:e}),(0,ye.jsx)(oi,{content:t})]})})}),q4=({innerRef:e,item:t,hasKeyboardInput:n,onCopy:r,onUse:o,onSourceClick:s})=>{var l;let i=ie(Ca),a=(0,et.useContext)(Lp);return(0,ye.jsxs)(de,{"data-testid":"knowledge-assist-answer",ref:e,children:[(0,ye.jsx)(Se,{children:(0,ye.jsxs)(Se.Content,{children:[(0,ye.jsx)(Se.Title,{children:t.question}),(0,ye.jsx)(oi,{content:t.answer.answer,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:r,onUse:n?o:void 0}),(0,ye.jsx)(K4,{sources:(l=t.answer.sources)!=null?l:[],onClick:s})]})}),a.assistantCode&&(0,ye.jsxs)(de.ButtonsContainer,{children:[(0,ye.jsx)("div",{}),(0,ye.jsx)(Fd,{evaluationId:t.evaluationId,feedbackType:"assistant",assistantCode:a.assistantCode,assistantOutput:t.answer.answer,feedbackText:t.answer.answer})]})]})},Lp=(0,et.createContext)(null),Op=({assistantCode:e,evaluateKnowledgeAssistFn:t,initialQuestion:n,children:r})=>{let[o,s]=(0,et.useState)(null),[i,a]=(0,et.useState)(!1),[l,c]=(0,et.useState)(null),[u,f]=(0,et.useState)(!!n),[d,p]=(0,et.useState)(null),h=be(),m=Ze(),S=hd(v=>{if(!e)throw new Error("No knowledge assistant was defined");return c(null),t({assistantCode:e,input:v,threadId:o,onNewThreadId(x){s(x)}})},{onSuccess(v){var x;m("Assistant response displayed",{evaluationId:v.evaluationId,assistantCode:e,assistantOutput:v.answer.answer,input:v.question,sources:(x=v.answer.sources)!=null?x:[]}),f(!1)},onError(v){var x;c((x=v.message)!=null?x:"Unknown error")}}),y=v=>N(null,null,function*(){a(!0),p(v),yield S.call(v),a(!1),p(null)}),g={isEnabled:!!e,assistantCode:e,isSubmitting:i,threadId:o,pendingInput:d,errorMessage:l,onSubmit:y,onReset(){o&&h(sE(o)),c(null),s(null),e&&m("Assistant thread reset",{threadId:o!=null?o:void 0,assistantCode:e})}};return(0,et.useEffect)(()=>{n&&g.isEnabled&&y(n)},[n]),(0,ye.jsx)(Lp.Provider,{value:g,children:r})},Dp=()=>{let e=ie(Ca),t=O("WidgetKnowledgeAssistant",up),n=(0,et.useContext)(Lp),r=(0,et.useRef)(null),[o,s]=(0,et.useState)(""),i=l=>{s(l.target.value)},a=l=>{l.preventDefault(),n.onSubmit(o).then(()=>{var c;r.current&&((c=r.current)==null||c.focus(),s(""))})};return n.isEnabled?(0,ye.jsxs)("form",{className:t.form,onSubmit:a,children:[(0,ye.jsx)("input",{ref:r,className:t.formInput,placeholder:e("inputPlaceholder"),type:"text",disabled:n.isSubmitting,value:o,onChange:i}),(0,ye.jsx)("button",{type:"submit",disabled:n.isSubmitting||o==="",className:t.formSubmit,children:e("submitLabel")})]}):null},Fp=({title:e,emptyState:t})=>{var h,m;let n=ie(Ca),r=Ze(),o=O("WidgetKnowledgeAssistant",up),s=(0,et.useRef)(null),i=(0,et.useContext)(Lp),a=(m=G(nE((h=i.threadId)!=null?h:-1)))!=null?m:[],l=X("hasKeyboardInput"),c=dn(),u=(S,y)=>{Ir(S),i.assistantCode&&r("Assistant response copied",{assistantCode:i.assistantCode,assistantOutput:S,copiedText:S,evaluationId:y.evaluationId})},f=(S,y)=>{i.assistantCode&&r("Assistant source clicked",{evaluationId:y.evaluationId,assistantCode:i.assistantCode,source:S})},d=S=>{S.preventDefault(),i.onReset()},p=(S,y)=>{c.send(Xr,{text:S,suggestion:{source:"assistant",sourceText:S}}),i.assistantCode&&r("Assistant response used",{assistantCode:i.assistantCode,evaluationId:y.evaluationId,assistantOutput:y.answer.answer,usedText:S})};return!i.isEnabled||(a==null?void 0:a.length)===0&&!i.isSubmitting&&!t&&!i.errorMessage?null:(0,ye.jsxs)(et.Fragment,{children:[(0,ye.jsx)(Cr,{type:"knowledge",title:e,"data-testid":"knowledge",children:(0,ye.jsxs)(Ct,{withDivider:!0,children:[t&&a.length===0&&!i.pendingInput&&(0,ye.jsx)(G4,b({},t)),a.map((S,y)=>(0,ye.jsx)(q4,{innerRef:y===a.length-1?s:void 0,item:S,hasKeyboardInput:l,onCopy:g=>u(g,S),onUse:g=>p(g,S),onSourceClick:g=>f(g,S)},`${S.question}_${S.answer}_${y}`)),i.pendingInput&&(0,ye.jsx)(cp,{title:i.pendingInput}),i.errorMessage&&(0,ye.jsx)(MR,{message:i.errorMessage})]})}),a.length>0&&(0,ye.jsx)("div",{className:o.resetContainer,children:(0,ye.jsx)(de.Button,{disabled:i.threadId===null||i.isSubmitting,onClick:d,children:n("resetLabel")})})]})};var Io=E(DR());var zP=E(Z());var Hp=E(De()),gr=E(Z());var zp=E(Z());var FR={root:"dd-tvkOF",content:"dd-eXA1D"};var I0=E(P()),Y4=({isOpen:e,autoFocus:t,children:n,onClose:r,onBack:o,onKeyDown:s,overlayAriaLabel:i,contentAriaLabel:a})=>{let l=(0,zp.useRef)(null),c=O("Dialog",FR),u=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),o();return}s&&s(d)},f=d=>{d.target===l.current&&e&&r()};return(0,zp.useEffect)(()=>{var d,p;!l.current||!e||!t||(p=(d=l.current)==null?void 0:d.querySelector("input, textarea"))==null||p.focus()},[e,t,l]),e?(0,I0.jsx)("div",{role:"dialog","data-testid":"dialog",className:c.root,"aria-label":i,ref:l,onKeyDown:u,onMouseDown:f,children:(0,I0.jsx)("div",{"data-testid":"dialog-content",className:c.content,"aria-label":a,children:n})}):null},Ha=Y4;var HR=E(De());var zR={root:"dd-ranhW"};var BR=E(P()),X4=r=>{var o=r,{className:e,value:t}=o,n=se(o,["className","value"]);let s=O("TextInput",zR);return(0,BR.jsx)("input",b({className:(0,HR.default)(e,s.root),type:"text",value:t},n))},Bc=X4;var A0={};yt(A0,{enUS:()=>Q4,nlNL:()=>Z4});var Q4={back:[{type:0,value:"Back"}],promptTitle:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Paste the code from your email"}],verifyCodeBody:[{type:0,value:"Copy the code from the email you just received and paste it here."}],verifyCodeInputPlaceholder:[{type:0,value:"Paste link or code here"}],verifyCodeSubmitLabel:[{type:0,value:"Sign in"}],verifyCodeError:[{type:0,value:"Sign in failed. The code is probably no longer valid. Please "},{type:8,value:"login",children:[{type:0,value:"request new code"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Have a code sent to your email"}],requestCodeBody:[{type:0,value:"Enter your email and request a code. If you are an existing "},{type:1,value:"productName"},{type:0,value:" user you will receive an email with a code. If you are a new user you will receive an email asking to request access to "},{type:1,value:"productName"},{type:0,value:" first."}],requestCodeInputPlaceholder:[{type:0,value:"Enter your email"}],requestCodeSubmitLabel:[{type:0,value:"Request code"}]},Z4={back:[{type:0,value:"Terug"}],promptTitle:[{type:0,value:"Login bij "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Plak de code uit je email"}],verifyCodeBody:[{type:0,value:"Kopieer de code uit de email en plak deze hier."}],verifyCodeInputPlaceholder:[{type:0,value:"Plak hier de code"}],verifyCodeSubmitLabel:[{type:0,value:"Inloggen"}],verifyCodeError:[{type:0,value:"Inloggen is niet gelukt. De code is waarschijnlijk niet meer geldig. "},{type:8,value:"login",children:[{type:0,value:"Vraag een nieuwe code aan"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Verstuur een login code naar je email"}],requestCodeBody:[{type:0,value:"Voer je e-mailadres in en krijg een login code. Als je een bestaande "},{type:1,value:"productName"},{type:0,value:" gebruiker bent krijg je een email met een code. Als je een nieuwe gebruiker bent wordt er een email verstuurd met een toegangsverzoek voor "},{type:1,value:"productName"},{type:0,value:"."}],requestCodeInputPlaceholder:[{type:0,value:"Typ hier je e-mailadres"}],requestCodeSubmitLabel:[{type:0,value:"Code aanvragen"}]};var UR={root:"dd-lWxnE",anchorButton:"dd-TZ4in",errorMessage:"dd-fIsPg",title:"dd-pGhJx",subtitle:"dd-f5l29",text:"dd-iamoD",input:"dd-uhQZ3",actions:"dd-lubvx",button:"dd-CJsNI",primaryButton:"dd-MWBfl"};var it=E(P());var J4=e=>{try{let t=new URL(e);return new URLSearchParams(t.search).get("token")||void 0}catch(t){return e}},eF=({agentEmail:e,isOpen:t,origin:n="",onSuccess:r,onDismiss:o})=>{let s=ie(A0),i=O("LoginTokenDialog",UR),a=G(Uw),l=be(),c=X("productName"),[u,f]=(0,gr.useState)(e||""),[d,p]=(0,gr.useState)(0),[h,m]=(0,gr.useState)(""),S=(0,gr.useCallback)(x=>N(null,null,function*(){x.preventDefault(),l(Ww({email:u})),p(1)}),[n,u]),y=()=>{m(""),p(0)},g=(0,gr.useCallback)(x=>N(null,null,function*(){x.preventDefault();let C=J4(x.target.elements.token.value);if(!C){m(s("verifyCodeError",{login:v}));return}l(pl({token:C}))}),[n]),v=(0,gr.useMemo)(()=>x=>(0,it.jsx)("button",{type:"button","data-testid":"login-token-dialog-back-button",className:i.anchorButton,onClick:y,children:x},"back-button"),[]);return(0,gr.useEffect)(()=>{a==="error"&&m(s("verifyCodeError",{login:v})),a==="done"&&r()},[a]),(0,it.jsx)(Ha,{autoFocus:!0,isOpen:t,contentAriaLabel:s("promptTitle",{productName:c}),overlayAriaLabel:s("promptTitle",{productName:c}),onClose:o,onBack:o,children:(0,it.jsxs)("div",{className:i.root,children:[(0,it.jsx)("h1",{className:i.title,children:s("promptTitle",{productName:c})}),d===0&&(0,it.jsxs)("form",{onSubmit:S,children:[(0,it.jsx)("h2",{className:i.subtitle,children:s("requestCodeTitle")}),(0,it.jsx)("p",{className:i.text,children:s("requestCodeBody",{productName:c})}),(0,it.jsx)(Bc,{className:i.input,name:"email",placeholder:s("requestCodeInputPlaceholder"),value:u,onChange:x=>f(x.target.value)}),(0,it.jsx)("div",{className:i.actions,children:(0,it.jsx)("button",{type:"submit",className:(0,Hp.default)(i.button,i.primaryButton),children:s("requestCodeSubmitLabel")})})]}),d===1&&(0,it.jsxs)("form",{onSubmit:g,children:[(0,it.jsx)("h2",{className:i.subtitle,children:s("verifyCodeTitle")}),(0,it.jsx)("p",{className:i.text,children:s("verifyCodeBody")}),(0,it.jsx)(Bc,{className:i.input,name:"token",placeholder:s("verifyCodeInputPlaceholder"),disabled:["loading","done"].includes(a)}),h&&(0,it.jsx)("div",{className:i.errorMessage,children:h}),(0,it.jsxs)("div",{className:i.actions,children:[(0,it.jsx)("button",{type:"button",className:(0,Hp.default)(i.button),onClick:y,children:s("back")}),(0,it.jsx)("button",{type:"submit",className:(0,Hp.default)(i.button,i.primaryButton),disabled:["loading","done"].includes(a),children:s("verifyCodeSubmitLabel")})]})]})]})})},VR=eF;var WR=E(P()),tF=()=>{let e=G(Vw),t=G(Ui),n=X("adminUrl"),r=dn(),o=()=>r.send(ji,!1),s=()=>{r.send(ji,!1),r.send(vl)};return(0,WR.jsx)(VR,{isOpen:e,agentEmail:t==null?void 0:t.agentEmail,origin:n,onDismiss:o,onSuccess:s})},jR=tF;var DP=E(M0()),wn=E(Z());var SF={data:null,fetchState:"idle"},qR=e=>e.contentTypes.data,Uc=pe("contentTypes/getContentTypes",(e,t)=>N(null,null,function*(){return t.extra.deepdeskAPI.getContentTypes()})),xF=Re({name:"contentTypes",initialState:SF,reducers:{},extraReducers:e=>{e.addCase(Uc.pending,t=>{t.fetchState="loading"}).addCase(Uc.rejected,t=>{t.fetchState="error"}).addCase(Uc.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),YR=xF.reducer;var wF={data:null,fetchState:"idle"},bF=[],fs=e=>e.profile.data,EF=e=>e.profile.data?e.profile.data.uiConfig.widget.types:bF,jc=Gt([EF],e=>e.filter(t=>t.isActive)),XR=e=>{var t;return((t=e.profile.data)==null?void 0:t.onDemandAssistants)||[]},QR=e=>t=>jc(t).find(n=>n.type===e),ZR=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,JR=e=>{var t,n;return(n=(t=e.profile.data)==null?void 0:t.knowledgeAssistantNew)!=null?n:null},Vc=pe("profile/getProfile",(e,t)=>N(null,null,function*(){var s;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=r.conversation.current;if(!o||!o.profileCode)throw new Error("No conversation of conversation profileCode found");return((s=r.profile.data)==null?void 0:s.code)===o.profileCode?r.profile.data:n.getProfile(o.profileCode)})),CF=Re({name:"profile",initialState:wF,reducers:{},extraReducers:e=>{e.addCase(Vc.pending,t=>{t.fetchState="loading"}).addCase(Vc.rejected,t=>{t.fetchState="error"}).addCase(Vc.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),eP=CF.reducer;var wo=E(Z());var tP=E(Z()),Bp=E(De());var Mn={root:"dd-U2SX4",list:"dd-cYTlj",listWrapper:"dd-GLQFR",listHorizontal:"dd-x-knl",page:"dd-1F4vk",search:"dd-nvbxc",pageNav:"dd-sRUuT",pageTitle:"dd-t-MKS",pageBackButton:"dd-cjptm",listHeader:"dd-Fg666",listHeading:"dd-w-xhJ",listMoreButton:"dd--mKep",listItem:"dd-wpvuA",listItemContent:"dd-V-mKo",listItemText:"dd-ukCHL",listItemDescription:"dd-sSyu4",listItemActions:"dd-xelho",listItemTooltip:"dd-SWFsE",listItemTooltipContent:"dd-I7J9N",truncate:"dd-IlopJ",lineClamp:"dd-Twaca",listItemTitle:"dd-lMGHq",listItemAction:"dd-xPLAs",listItemSelected:"dd-jFX0Y",sources:"dd-pZx4v",sourcesTitle:"dd-phYVd",source:"dd-DaR6h",sourceShowMore:"dd-M1-8j",icon:"dd-m6yxD",searchIcon:"dd-0AU-O",searchInputWrapper:"dd-DUFcE",searchInput:"dd-ukrlD",select:"dd--Tifv",selectType:"dd-IkZb2",selectWrapper:"dd-J14mx",image:"dd-RQgsB",imageSrc:"dd-jxh8F",imageSrcHidden:"dd-e20Jk",imageSrcStatus:"dd-j50Tt",imageTitle:"dd-qCjfW",actions:"dd-3mfWc",actionsWrapper:"dd-TjDyI",actionsBar:"dd-LiA35",actionButton:"dd-4wk0u",hasShortKeys:"dd-XilV-",actionShortcut:"dd-s4Mla",actionShortcutFixKerning:"dd-lyh5e"};var vo={};yt(vo,{enUS:()=>TF,nlNL:()=>kF});var TF={visitUrl:[{type:0,value:"Visit"}],back:[{type:0,value:"Back"}],loading:[{type:0,value:"Loading..."}],imageError:[{type:0,value:"Could not load image"}],showAll:[{type:0,value:"Show more"}],sources:[{type:0,value:"Sources"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},kF={visitUrl:[{type:0,value:"Bekijk"}],back:[{type:0,value:"Terug"}],loading:[{type:0,value:"Laden..."}],imageError:[{type:0,value:"Kan afbeelding niet laden"}],showAll:[{type:0,value:"Toon meer"}],sources:[{type:0,value:"Bronnen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var ps=E(P()),RF=({src:e,title:t})=>{let n=O("CommandPalette",Mn),[r,o]=(0,tP.useState)("loading"),s=ie(vo);return(0,ps.jsxs)("div",{className:n.image,children:[(0,ps.jsx)("img",{src:e,alt:t,onLoad:()=>o("done"),onError:()=>o("error"),className:(0,Bp.default)(n.imageSrc,{[n.imageSrcHidden]:["loading","error"].includes(r)})}),r==="loading"&&(0,ps.jsx)("span",{className:(0,Bp.default)(n.imageSrc,n.imageSrcStatus),children:s("loading")}),r==="error"&&(0,ps.jsx)("span",{className:(0,Bp.default)(n.imageSrc,n.imageSrcStatus),children:(0,ps.jsx)(Mu,{})}),t&&(0,ps.jsx)("span",{className:n.imageTitle,children:t})]})},nP=RF;var rP=E(Z()),oP=E(De());var ui=E(P());function L0({children:e,heading:t,orientation:n,hasMore:r,onShowAll:o}){let s=ie(vo),i=O("CommandPalette",Mn);return rP.default.Children.count(e)===0?null:(0,ui.jsxs)("div",{"data-testid":"commandpalette-list",className:i.list,children:[(t||r)&&(0,ui.jsxs)("div",{className:i.listHeader,children:[t&&(0,ui.jsx)("h4",{className:i.listHeading,children:t}),r&&o&&(0,ui.jsx)("button",{onClick:o,className:i.listMoreButton,type:"button",children:s("showAll")})]}),(0,ui.jsx)("div",{className:(0,oP.default)(i.listWrapper,n==="horizontal"&&i.listHorizontal),children:e})]})}var Yc=E(De());var Up=E(Z());function Wc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ae=1,D0=2,F0=4,dt=8,Vp=16,$c=32,hr=64,O0={a:{content:Ae|dt,self:!1,type:Ae|dt|$c|hr},address:{invalid:["h1","h2","h3","h4","h5","h6","address","article","aside","section","div","header","footer"],self:!1},audio:{children:["track","source"]},br:{type:Ae|dt,void:!0},body:{content:Ae|D0|F0|dt|Vp|$c|hr},button:{content:dt,type:Ae|dt|$c|hr},caption:{content:Ae,parent:["table"]},col:{parent:["colgroup"],void:!0},colgroup:{children:["col"],parent:["table"]},details:{children:["summary"],type:Ae|$c|hr},dd:{content:Ae,parent:["dl"]},dl:{children:["dt","dd"],type:Ae},dt:{content:Ae,invalid:["footer","header"],parent:["dl"]},figcaption:{content:Ae,parent:["figure"]},footer:{invalid:["footer","header"]},header:{invalid:["footer","header"]},hr:{type:Ae,void:!0},img:{void:!0},li:{content:Ae,parent:["ul","ol","menu"]},main:{self:!1},ol:{children:["li"],type:Ae},picture:{children:["source","img"],type:Ae|dt|Vp},rb:{parent:["ruby","rtc"]},rp:{parent:["ruby","rtc"]},rt:{content:dt,parent:["ruby","rtc"]},rtc:{content:dt,parent:["ruby"]},ruby:{children:["rb","rp","rt","rtc"]},source:{parent:["audio","video","picture"],void:!0},summary:{content:dt,parent:["details"]},table:{children:["caption","colgroup","thead","tbody","tfoot","tr"],type:Ae},tbody:{parent:["table"],children:["tr"]},td:{content:Ae,parent:["tr"]},tfoot:{parent:["table"],children:["tr"]},th:{content:Ae,parent:["tr"]},thead:{parent:["table"],children:["tr"]},tr:{parent:["table","tbody","thead","tfoot"],children:["th","td"]},track:{parent:["audio","video"],void:!0},ul:{children:["li"],type:Ae},video:{children:["track","source"]},wbr:{type:Ae|dt,void:!0}};function fi(e){return t=>{O0[t]=b(b({},e),O0[t])}}["address","main","div","figure","p","pre"].forEach(fi({content:Ae,type:Ae|hr}));["abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","ruby","samp","strong","sub","sup","time","u","var"].forEach(fi({content:dt,type:Ae|dt|hr}));["p","pre"].forEach(fi({content:dt,type:Ae|hr}));["s","small","span","del","ins"].forEach(fi({content:dt,type:Ae|dt}));["article","aside","footer","header","nav","section","blockquote"].forEach(fi({content:Ae,type:Ae|D0|hr}));["h1","h2","h3","h4","h5","h6"].forEach(fi({content:dt,type:Ae|F0|hr}));["audio","canvas","iframe","img","video"].forEach(fi({type:Ae|dt|Vp|hr}));var Gc=Object.freeze(O0),z0=["applet","base","body","command","embed","frame","frameset","head","html","link","meta","noscript","object","script","style","title"],H0=Object.keys(Gc).filter(e=>e!=="canvas"&&e!=="iframe"),Le=1,B0=2,di=3,ms=4,Wp=5,$p=Object.freeze({alt:Le,cite:Le,class:Le,colspan:di,controls:ms,datetime:Le,default:ms,disabled:ms,dir:Le,height:Le,href:Le,id:Le,kind:Le,label:Le,lang:Le,loading:Le,loop:ms,media:Le,muted:ms,poster:Le,rel:Le,role:Le,rowspan:di,scope:Le,sizes:Le,span:di,start:di,style:Wp,src:Le,srclang:Le,srcset:Le,tabindex:Le,target:Le,title:Le,type:Le,width:Le}),U0=Object.freeze({class:"className",colspan:"colSpan",datetime:"dateTime",rowspan:"rowSpan",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex"});function jp(){return jp=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jp.apply(this,arguments)}function Kp({attributes:e={},className:t,children:n=null,selfClose:r=!1,tagName:o}){let s=o;return r?Up.default.createElement(s,jp({className:t},e)):Up.default.createElement(s,jp({className:t},e),n)}var Kc=class{attribute(t,n){return n}node(t,n){return n}};function sP(e,t,n,r=!1){let o=e.match(t instanceof RegExp?t:new RegExp(t,"i"));return o?I(b({match:o[0],void:r},n(o)),{index:o.index,length:o[0].length,valid:!0}):null}var So=class{constructor(t,n,r){Wc(this,"greedy",!1),Wc(this,"options",void 0),Wc(this,"propName",void 0),Wc(this,"inverseName",void 0),Wc(this,"factory",void 0),this.options=b({},n),this.propName=t,this.inverseName=`no${t.charAt(0).toUpperCase()+t.slice(1)}`,this.factory=r!=null?r:null}createElement(t,n){return this.factory?Up.default.createElement(this.factory,n,t):this.replaceWith(t,n)}doMatch(t,n,r,o=!1){return sP(t,n,r,o)}onBeforeParse(t,n){return t}onAfterParse(t,n){return t}};var pi=E(Z()),cP=E(aP());function xo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var AF=/(url|image|image-set)\(/i,V0=class extends Kc{attribute(t,n){return t==="style"&&Object.keys(n).forEach(r=>{String(n[r]).match(AF)&&delete n[r]}),n}},lP=1,_F=3,NF=/^<(!doctype|(html|head|body)(\s|>))/i,MF=/^(aria-|data-|\w+:)/iu,LF=/{{{(\w+)\/?}}}/;function OF(){if(!(typeof window=="undefined"||typeof document=="undefined"))return document.implementation.createHTMLDocument("Interweave")}var Gp=class{constructor(t,n={},r=[],o=[]){var s;xo(this,"allowed",void 0),xo(this,"banned",void 0),xo(this,"blocked",void 0),xo(this,"container",void 0),xo(this,"content",[]),xo(this,"props",void 0),xo(this,"matchers",void 0),xo(this,"filters",void 0),xo(this,"keyIndex",void 0),this.props=n,this.matchers=r,this.filters=[...o,new V0],this.keyIndex=-1,this.container=this.createContainer(t||""),this.allowed=new Set((s=n.allowList)!==null&&s!==void 0?s:H0),this.banned=new Set(z0),this.blocked=new Set(n.blockList)}applyAttributeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.attribute=="function"?o.attribute(t,r):r,n)}applyNodeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.node=="function"?o.node(t,r):r,n)}applyMatchers(t,n){let r={},{props:o}=this,s=t,i=0,a=null;return this.matchers.forEach(l=>{let c=l.asTag().toLowerCase(),u=this.getTagConfig(c);if(o[l.inverseName]||!this.isTagAllowed(c)||!this.canRenderChild(n,u))return;let f="";for(;s&&(a=l.match(s));){let d=a,{index:p,length:h,match:m,valid:S,void:y}=d,g=se(d,["index","length","match","valid","void"]),v=l.propName+String(i);p>0&&(f+=s.slice(0,p)),S?(f+=y?`{{{${v}/}}}`:`{{{${v}}}}${m}{{{/${v}}}}`,this.keyIndex+=1,i+=1,r[v]={children:m,matcher:l,props:I(b(b({},o),g),{key:this.keyIndex})}):f+=m,l.greedy?(s=f+s.slice(p+h),f=""):s=s.slice(p+(h||m.length))}l.greedy||(s=f+s)}),i===0?t:this.replaceTokens(s,r)}canRenderChild(t,n){return!t.tagName||!n.tagName||t.void?!1:t.children.length>0?t.children.includes(n.tagName):t.invalid.length>0&&t.invalid.includes(n.tagName)?!1:n.parent.length>0?n.parent.includes(t.tagName):!t.self&&t.tagName===n.tagName?!1:!!(t&&t.content&n.type)}convertLineBreaks(t){let{noHtml:n,disableLineBreaks:r}=this.props;if(n||r||t.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return t;let o=t.replace(/\r\n/g,`
67
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ir(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),o=aE(e);if(o===null)return r;e=o;let i='<a href="'+e+'"';return t&&(i+=' title="'+Ir(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let o=aE(e);if(o===null)return Ir(n);e=o;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${Ir(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ir(e.text)}},Nh=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},ro=class Ch{constructor(t){xe(this,"options");xe(this,"renderer");xe(this,"textRenderer");this.options=t||Bi,this.options.renderer=this.options.renderer||new Wd,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Nh}static parse(t,n){return new Ch(n).parse(t)}static parseInline(t,n){return new Ch(n).parseInline(t)}parse(t,n=!0){var o,i;let r="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){r+=u||"";continue}}let l=a;switch(l.type){case"space":{r+=this.renderer.space(l);continue}case"hr":{r+=this.renderer.hr(l);continue}case"heading":{r+=this.renderer.heading(l);continue}case"code":{r+=this.renderer.code(l);continue}case"table":{r+=this.renderer.table(l);continue}case"blockquote":{r+=this.renderer.blockquote(l);continue}case"list":{r+=this.renderer.list(l);continue}case"html":{r+=this.renderer.html(l);continue}case"paragraph":{r+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;s+1<t.length&&t[s+1].type==="text";)c=t[++s],u+=`
68
+ `+this.renderer.text(c);n?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}parseInline(t,n=this.renderer){var o,i;let r="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&i[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=c||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},wh,Bd=(wh=class{constructor(e){xe(this,"options");xe(this,"block");this.options=e||Bi}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?no.lex:no.lexInline}provideParser(){return this.block?ro.parse:ro.parseInline}},xe(wh,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),wh),Oh=class{constructor(...e){xe(this,"defaults",Th());xe(this,"options",this.setOptions);xe(this,"parse",this.parseMarkdown(!0));xe(this,"parseInline",this.parseMarkdown(!1));xe(this,"Parser",ro);xe(this,"Renderer",Wd);xe(this,"TextRenderer",Nh);xe(this,"Lexer",no);xe(this,"Tokenizer",Vd);xe(this,"Hooks",Bd);this.use(...e)}walkTokens(e,t){var r,o;let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let s=i;for(let a of s.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of s.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let s=i;n=n.concat(this.walkTokens(s.items,t));break}default:{let s=i;(o=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&o[s.type]?this.defaults.extensions.childTokens[s.type].forEach(a=>{let l=s[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r=E({},n);if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){let i=t.renderers[o.name];i?t.renderers[o.name]=function(...s){let a=o.renderer.apply(this,s);return a===!1&&(a=i.apply(this,s)),a}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=t[o.level];i?i.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),r.extensions=t),n.renderer){let o=this.defaults.renderer||new Wd(this.defaults);for(let i in n.renderer){if(!(i in o))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let s=i,a=n.renderer[s],l=o[s];o[s]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}r.renderer=o}if(n.tokenizer){let o=this.defaults.tokenizer||new Vd(this.defaults);for(let i in n.tokenizer){if(!(i in o))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let s=i,a=n.tokenizer[s],l=o[s];o[s]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.tokenizer=o}if(n.hooks){let o=this.defaults.hooks||new Bd;for(let i in n.hooks){if(!(i in o))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let s=i,a=n.hooks[s],l=o[s];Bd.passThroughHooks.has(i)?o[s]=c=>{if(this.defaults.async)return Promise.resolve(a.call(o,c)).then(f=>l.call(o,f));let u=a.call(o,c);return l.call(o,u)}:o[s]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}r.hooks=o}if(n.walkTokens){let o=this.defaults.walkTokens,i=n.walkTokens;r.walkTokens=function(s){let a=[];return a.push(i.call(this,s)),o&&(a=a.concat(o.call(this,s))),a}}this.defaults=E(E({},this.defaults),r)}),this}setOptions(e){return this.defaults=E(E({},this.defaults),e),this}lexer(e,t){return no.lex(e,t!=null?t:this.defaults)}parser(e,t){return ro.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(n,r)=>{let o=E({},r),i=E(E({},this.defaults),o),s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&o.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n=="undefined"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);let a=i.hooks?i.hooks.provideLexer():e?no.lex:no.lexInline,l=i.hooks?i.hooks.provideParser():e?ro.parse:ro.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>a(c,i)).then(c=>i.hooks?i.hooks.processAllTokens(c):c).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>l(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(s);try{i.hooks&&(n=i.hooks.preprocess(n));let c=a(n,i);i.hooks&&(c=i.hooks.processAllTokens(c)),i.walkTokens&&this.walkTokens(c,i.walkTokens);let u=l(c,i);return i.hooks&&(u=i.hooks.postprocess(u)),u}catch(c){return s(c)}}}onError(e,t){return n=>{if(n.message+=`
69
+ Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+Ir(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Hi=new Oh;function Pe(e,t){return Hi.parse(e,t)}Pe.options=Pe.setOptions=function(e){return Hi.setOptions(e),Pe.defaults=Hi.defaults,uE(Pe.defaults),Pe};Pe.getDefaults=Th;Pe.defaults=Bi;Pe.use=function(...e){return Hi.use(...e),Pe.defaults=Hi.defaults,uE(Pe.defaults),Pe};Pe.walkTokens=function(e,t){return Hi.walkTokens(e,t)};Pe.parseInline=Hi.parseInline;Pe.Parser=ro;Pe.parser=ro.parse;Pe.Renderer=Wd;Pe.TextRenderer=Nh;Pe.Lexer=no;Pe.lexer=no.lex;Pe.Tokenizer=Vd;Pe.Hooks=Bd;Pe.parse=Pe;var MB=Pe.options,NB=Pe.setOptions,OB=Pe.use,LB=Pe.walkTokens,DB=Pe.parseInline;var FB=ro.parse,zB=no.lex;var Kd=(e,t)=>{let n=[],r=new Oh,o=i=>{i.type==="code"&&i.lang===t&&n.push(i.text)};return r.use({walkTokens:o}),r.parse(e),n};var wE={cues:[],threads:{},pending:[]},bE=e=>{var t;return(t=e.assistants)==null?void 0:t.cues};var EE=e=>t=>{var n,r;return(r=(n=t.assistants)==null?void 0:n.threads[e])!=null?r:null},Gd=Rt("assistants/callToAction"),Hl=ge("assistants/evaluateKnowledgeAssistant",(e,t)=>M(null,null,function*(){var c,u,f;let{threadId:n}=e,{onNewThreadId:r}=e,{deepdeskAPI:o}=t.extra,i=t.getState(),{platformVariables:s}=i.info;n||(n=(yield o.createAssistantThread({assistantCode:e.assistantCode})).id,r&&r(n)),yield o.postMessageToAssistantThread({assistantCode:e.assistantCode,threadId:n,message:e.input});let a=yield t.dispatch(mn(A(E({skipState:!0},e),{input:{},threadId:n})));if(a.error)throw new Error(a.error.message);let l=(c=a.payload.output[0])!=null?c:{response:"",sources:[]};return{threadId:n,question:e.input,evaluationId:a.payload.evaluationId,answer:{answer:(u=or(l.response,s!=null?s:{}))!=null?u:"",sources:(f=l.sources)!=null?f:[]}}})),nU=Rt("assistants/extractedTextSuggestions");function VL(e,t){var n,r;return Array.isArray(e.output)?e.output:typeof e.output=="string"?[{code:t,name:t,response:e.output}]:[A(E({code:t,name:t},e.output&&typeof e.output=="object"?e.output:{}),{response:(r=(n=e.output)==null?void 0:n.response)!=null?r:""})]}var mn=ge("assistants/evaluate",(e,t)=>M(null,null,function*(){var v,h,y,S,x;let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra,{transcript:o,input:i={},threadId:s}=e,a=t.getState(),{platformVariables:l}=a.info,c=(h=(v=a.conversation.current)==null?void 0:v.externalId)!=null?h:null,u=(S=(y=e.externalConversationId)!=null?y:c)!=null?S:void 0,f;if(o==="in-memory-transcript"){if(!r.conversationQuery)throw new Error("Can't include in-memory-transcript, setConversationQuery is not defined");f=yield r.conversationQuery()}else Array.isArray(o)&&(f=o);if(e.includeMetadata&&a.conversation.current&&((x=e.externalConversationId)!=null?x:c)===c){let{metadata:C}=a.conversation.current;Object.assign(i,{metadata:C})}let d=yield n.evaluateAssistant(e.assistantCode,{input:i,transcript:f,externalConversationId:u,threadId:s});if(d.evaluationStatus!=="success")return t.rejectWithValue(`Assistant ${e.assistantCode} evaluation failed: ${d.evaluationStatus}`);let m=VL(d,e.assistantCode).map(T=>A(E({},T),{name:or(T.name,l),response:or(T.response,l)||""})),g=[];return m.forEach(T=>{if(!T.response)return;let C=Kd(T.response,"reply");C.length!==0&&g.push(...C.map(k=>({text:k,type:"text",source:"assistant",assistantCode:T.code,sourceLabel:T.name})))}),g.length>0&&t.dispatch(Ks(g)),A(E({},d),{output:m,externalConversationId:u,currentExternalIdAtRequest:c})}));function CE(e){return e!=null&&e.length?e.map(t=>t.response).filter(Boolean).join(`
70
+ `):""}var TE=Re({name:"assistants",initialState:wE,reducers:{resetCues(e){e.cues=[]},removeCueByCode(e,t){e.cues=e.cues.filter(n=>n.code!==t.payload.code)},removeThreadById(e,t){delete e.threads[t.payload]},receiveChunk(e,t){let{code:n,name:r,payload:o,evaluationId:i}=t.payload,s=e.cues.findIndex(a=>a.code===n);s!==-1?e.cues[s].response+=o.text:e.cues.push({code:n,name:r,evaluationId:i,response:o.text})},userNotification(e,t){let n=e.cues.filter(l=>l.code!==t.payload.code),{code:r,name:o,evaluationId:i,payload:s}=t.payload,{callToAction:a}=s;e.cues=[...n,{code:r,name:o,evaluationId:i,response:s.message,editable:s.editableMessage,callToAction:a&&{label:a.displayName,event:a.onClickEvent,value:a.eventPayload}}]}},extraReducers:e=>{e.addCase(mn.pending,(t,n)=>{t.pending.includes(n.meta.arg.assistantCode)&&te.warn(`Assistant ${n.meta.arg.assistantCode} already evaluating`),t.pending.push(n.meta.arg.assistantCode)}).addCase(mn.rejected,(t,n)=>{var o;te.warn((o=n.error)==null?void 0:o.message);let r=t.pending.indexOf(n.meta.arg.assistantCode);r!==-1&&t.pending.splice(r,1)}).addCase(mn.fulfilled,(t,n)=>{let r=t.pending.indexOf(n.meta.arg.assistantCode);if(r!==-1&&t.pending.splice(r,1),n.meta.arg.skipState)return;let{evaluationId:o,output:i,externalConversationId:s,currentExternalIdAtRequest:a}=n.payload;if(s&&a&&s!==a)return;let l=i.map(f=>f.code),c=t.cues.filter(f=>!l.includes(f.code)),u=i.map(f=>E(A(E({},f),{evaluationId:o}),s?{externalConversationId:s}:{}));t.cues=[...c,...u]}).addCase(Hl.fulfilled,(t,n)=>{let i=n.payload,{threadId:r}=i,o=ie(i,["threadId"]);t.threads[r]=[...t.threads[r]||[],o]}).addCase(lt,()=>wE)}}),{removeCueByCode:qd,resetCues:rU,removeThreadById:kE,receiveChunk:RE,userNotification:PE}=TE.actions,IE=TE.reducer;var WL={locale:"en-US",deanonymize:!1,fallbackImage:!1,isEmbedded:!1,showImages:!1,showSearch:!1,showImageSearch:!1,showStyleSuggestions:!1,showStyleSuggestionList:!1,showMidSentenceSuggestions:!1,showSuggestionsBeforePattern:!1,showSuggestionsAfterPattern:!1,showTabCompletion:!0,showTextSuggestions:!0,showEntitiesCommand:!1,showSummaryCommand:!1,showKnowledgeSearch:!1,textSuggestionsCount:3,recommendTextSuggestions:!0,searchTriggerKey:"k",visible:!0,insertLink:!1,addToPersonalCollection:!1,inlineSuggestions:!1,autoSelectSuggestion:!1,suggestionsPlacement:"above",floatingMenu:!1,detectSubmit:!1,automaticHandlingTime:!1,enableSuggestionFeedback:!1,enableFeedbackForm:!0,adminUrl:void 0,productName:"Deepdesk",hasKeyboardInput:!0},AE=Re({name:"settings",initialState:WL,reducers:{set(e,t){Object.entries(t.payload).forEach(n=>{let[r,o]=n;typeof o!="undefined"&&(e[r]=o)})}}}),{set:Yd}=AE.actions,Ui=e=>t=>t.settings[e],X=e=>G(Ui(e)),_E=AE.reducer;function Ar(e){let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),t.remove()}var Xd=b(De()),OE=b(Z());var Lh=b(I()),Dh=e=>(0,Lh.jsx)("svg",A(E({width:"16",height:"16",fill:"#000000"},e),{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,Lh.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 Fh=b(I()),ME=e=>(0,Fh.jsx)("svg",A(E({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:"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 Bo(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={};ht(zh,{enUS:()=>$L,nlNL:()=>jL});var $L={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},jL={thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var NE={thumbs:"dd-5F1zq",fadeup:"dd-eTmY-",fadedown:"dd-sS85z",selected:"dd-rid-f",thumbsUp:"dd-4poEf",thumbsDown:"dd-3KozS"};var Uo=e=>t=>{let{passwordlessToken:{token:n},settings:{isEmbedded:r,adminUrl:o}}=t,i=o||window.location.origin;return r&&!n?null:r&&n?`${i}/apis/admin/session/passwordless/login/?token=${n}&redirect=${encodeURIComponent(e)}`:`${i}${e}`};var oo=b(I()),KL=({assistantCode:e,assistantOutput:t,evaluationId:n,feedbackType:r,feedbackText:o})=>{let i=z("FeedbackThumbs",NE),s=X("enableFeedbackForm"),a=G(Pr),l=G(Uo(`/admin/feedback?conversationId=${a}&evaluationId=${n}&type=${r}&text=${o}&assistantCode=${e}&assistantOutput=${t}`)),c=se(zh),u=Ze(),[f,d]=(0,OE.useState)(null),p=v=>{u("Assistant response feedback",{assistantCode:e,assistantOutput:t,evaluationId:n,rating:v})},m=v=>{v.stopPropagation(),Bo(v.target,i.fadeup),d("up"),p("up")},g=v=>{v.stopPropagation(),Bo(v.target,i.fadedown),d("down"),p("down")};return(0,oo.jsxs)("div",{className:i.thumbs,children:[(0,oo.jsx)(pe.Button,{title:c("thumbsUp"),onClick:m,icon:(0,oo.jsx)(ME,{}),className:(0,Xd.default)(i.thumbsUp,f==="up"&&i.selected),disabled:!!f}),s&&l?(0,oo.jsx)(pe.Button,{as:"a",title:c("thumbsDown"),href:l,target:"_blank",rel:"noreferrer",onClick:g,icon:(0,oo.jsx)(Dh,{}),className:(0,Xd.default)(i.thumbsDown,f==="down"&&i.selected),disabled:!!f}):(0,oo.jsx)(pe.Button,{title:c("thumbsDown"),onClick:g,icon:(0,oo.jsx)(Dh,{}),className:(0,Xd.default)(i.thumbsDown,f==="down"&&i.selected),disabled:!!f})]})},Qd=KL;function LE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function GL(e){if(Array.isArray(e))return e}function qL(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function YL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
71
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XL(e,t){return GL(e)||qL(e,t)||QL(e,t)||YL()}function QL(e,t){if(e){if(typeof e=="string")return LE(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?LE(e,t):void 0}}var XE=Object.entries,DE=Object.setPrototypeOf,ZL=Object.isFrozen,JL=Object.getPrototypeOf,e2=Object.getOwnPropertyDescriptor,It=Object.freeze,At=Object.seal,Js=Object.create,QE=typeof Reflect!="undefined"&&Reflect,$h=QE.apply,jh=QE.construct;It||(It=function(t){return t});At||(At=function(t){return t});$h||($h=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;i<r;i++)o[i-2]=arguments[i];return t.apply(n,o)});jh||(jh=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 new t(...r)});var Qs=nt(Array.prototype.forEach),t2=nt(Array.prototype.lastIndexOf),FE=nt(Array.prototype.pop),Zs=nt(Array.prototype.push),n2=nt(Array.prototype.splice),Wo=Array.isArray,Vl=nt(String.prototype.toLowerCase),Hh=nt(String.prototype.toString),zE=nt(String.prototype.match),Bl=nt(String.prototype.replace),HE=nt(String.prototype.indexOf),r2=nt(String.prototype.trim),o2=nt(Number.prototype.toString),i2=nt(Boolean.prototype.toString),BE=typeof BigInt=="undefined"?null:nt(BigInt.prototype.toString),UE=typeof Symbol=="undefined"?null:nt(Symbol.prototype.toString),vt=nt(Object.prototype.hasOwnProperty),Ul=nt(Object.prototype.toString),yt=nt(RegExp.prototype.test),Vi=s2(TypeError);function nt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return $h(e,t,r)}}function s2(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return jh(e,n)}}function be(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vl;if(DE&&DE(e,null),!Wo(t))return e;let r=t.length;for(;r--;){let o=t[r];if(typeof o=="string"){let i=n(o);i!==o&&(ZL(t)||(t[r]=i),o=i)}e[o]=!0}return e}function a2(e){for(let t=0;t<e.length;t++)vt(e,t)||(e[t]=null);return e}function Qt(e){let t=Js(null);for(let r of XE(e)){var n=XL(r,2);let o=n[0],i=n[1];vt(e,o)&&(Wo(i)?t[o]=a2(i):i&&typeof i=="object"&&i.constructor===Object?t[o]=Qt(i):t[o]=i)}return t}function l2(e){switch(typeof e){case"string":return e;case"number":return o2(e);case"boolean":return i2(e);case"bigint":return BE?BE(e):"0";case"symbol":return UE?UE(e):"Symbol()";case"undefined":return Ul(e);case"function":case"object":{if(e===null)return Ul(e);let t=e,n=_r(t,"toString");if(typeof n=="function"){let r=n(t);return typeof r=="string"?r:Ul(r)}return Ul(e)}default:return Ul(e)}}function _r(e,t){for(;e!==null;){let r=e2(e,t);if(r){if(r.get)return nt(r.get);if(typeof r.value=="function")return nt(r.value)}e=JL(e)}function n(){return null}return n}function c2(e){try{return yt(e,""),!0}catch(t){return!1}}var VE=It(["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","search","section","select","shadow","slot","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"]),Bh=It(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Uh=It(["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"]),u2=It(["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"]),Vh=It(["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"]),d2=It(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),WE=It(["#text"]),$E=It(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","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","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Wh=It(["accent-height","accumulate","additive","alignment-baseline","amplitude","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","dominant-baseline","dur","edgemode","elevation","end","exponent","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","intercept","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","mask-type","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","slope","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","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","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"]),jE=It(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),Zd=It(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),f2=At(/{{[\w\W]*|^[\w\W]*}}/g),p2=At(/<%[\w\W]*|^[\w\W]*%>/g),m2=At(/\${[\w\W]*/g),g2=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),h2=At(/^aria-[\-\w]+$/),KE=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),y2=At(/^(?:\w+script|data):/i),v2=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),S2=At(/^html$/i),x2=At(/^[a-z][.\w]*(-[.\w]+)+$/i),GE=At(/<[/\w!]/g),qE=At(/<[/\w]/g),w2=At(/<\/no(script|embed|frames)/i),b2=At(/\/>/i),Pn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},E2=function(){return typeof window=="undefined"?null:window},C2=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}},YE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Vo=function(t,n,r,o){return vt(t,n)&&Wo(t[n])?be(o.base?Qt(o.base):{},t[n],o.transform):r};function ZE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:E2(),t=$=>ZE($);if(t.version="3.4.12",t.removed=[],!e||!e.document||e.document.nodeType!==Pn.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,o=r.currentScript;e.DocumentFragment;let i=e.HTMLTemplateElement,s=e.Node,a=e.Element,l=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,f=e.trustedTypes,d=a.prototype,p=_r(d,"cloneNode"),m=_r(d,"remove"),g=_r(d,"nextSibling"),v=_r(d,"childNodes"),h=_r(d,"parentNode"),y=_r(d,"shadowRoot"),S=_r(d,"attributes"),x=s&&s.prototype?_r(s.prototype,"nodeType"):null,T=s&&s.prototype?_r(s.prototype,"nodeName"):null;if(typeof i=="function"){let $=n.createElement("template");$.content&&$.content.ownerDocument&&(n=$.content.ownerDocument)}let C,k="",R,F=!1,O=0,U=function(){if(O>0)throw Vi('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},J=function(w){U(),O++;try{return C.createHTML(w)}finally{O--}},Y=function(w){U(),O++;try{return C.createScriptURL(w)}finally{O--}},_=function(){return F||(R=C2(f,o),F=!0),R},V=n,B=V.implementation,W=V.createNodeIterator,N=V.createDocumentFragment,q=V.getElementsByTagName,j=r.importNode,K=YE();t.isSupported=typeof XE=="function"&&typeof h=="function"&&B&&B.createHTMLDocument!==void 0;let ue=f2,ne=p2,Qe=m2,Se=g2,tt=h2,pt=y2,Le=v2,Ne=x2,at=KE,ye=null,oe=be({},[...VE,...Bh,...Uh,...Vh,...WE]),re=null,me=be({},[...$E,...Wh,...jE,...Zd]),fe=Object.seal(Js(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}})),$e=null,Te=null,mt=Object.seal(Js(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Kt=!0,Et=!0,xr=!1,Jn=!0,gt=!1,Ct=!0,wr=!1,Qm=!1,Zm=null,Jm=null,eg=!1,Ms=!1,Eu=!1,Cu=!1,ZS=!0,JS=!1,ex="user-content-",tg=!0,ng=!1,Ns={},br=null,rg=be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),tx=null,nx=be({},["audio","video","img","source","image","track"]),og=null,rx=be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Tu="http://www.w3.org/1998/Math/MathML",ku="http://www.w3.org/2000/svg",Er="http://www.w3.org/1999/xhtml",Os=Er,ig=!1,sg=null,v_=be({},[Tu,ku,Er],Hh),ox=It(["mi","mo","mn","ms","mtext"]),ag=be({},ox),ix=It(["annotation-xml"]),lg=be({},ix),S_=be({},["title","style","font","a","script"]),il=null,x_=["application/xhtml+xml","text/html"],w_="text/html",je=null,Ls=null,b_=n.createElement("form"),sx=function(w){return w instanceof RegExp||w instanceof Function},cg=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ls&&Ls===w)return;(!w||typeof w!="object")&&(w={}),w=Qt(w),il=x_.indexOf(w.PARSER_MEDIA_TYPE)===-1?w_:w.PARSER_MEDIA_TYPE,je=il==="application/xhtml+xml"?Hh:Vl,ye=Vo(w,"ALLOWED_TAGS",oe,{transform:je}),re=Vo(w,"ALLOWED_ATTR",me,{transform:je}),sg=Vo(w,"ALLOWED_NAMESPACES",v_,{transform:Hh}),og=Vo(w,"ADD_URI_SAFE_ATTR",rx,{transform:je,base:rx}),tx=Vo(w,"ADD_DATA_URI_TAGS",nx,{transform:je,base:nx}),br=Vo(w,"FORBID_CONTENTS",rg,{transform:je}),$e=Vo(w,"FORBID_TAGS",Qt({}),{transform:je}),Te=Vo(w,"FORBID_ATTR",Qt({}),{transform:je}),Ns=vt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?Qt(w.USE_PROFILES):w.USE_PROFILES:!1,Kt=w.ALLOW_ARIA_ATTR!==!1,Et=w.ALLOW_DATA_ATTR!==!1,xr=w.ALLOW_UNKNOWN_PROTOCOLS||!1,Jn=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,gt=w.SAFE_FOR_TEMPLATES||!1,Ct=w.SAFE_FOR_XML!==!1,wr=w.WHOLE_DOCUMENT||!1,Ms=w.RETURN_DOM||!1,Eu=w.RETURN_DOM_FRAGMENT||!1,Cu=w.RETURN_TRUSTED_TYPE||!1,eg=w.FORCE_BODY||!1,ZS=w.SANITIZE_DOM!==!1,JS=w.SANITIZE_NAMED_PROPS||!1,tg=w.KEEP_CONTENT!==!1,ng=w.IN_PLACE||!1,at=c2(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:KE,Os=typeof w.NAMESPACE=="string"?w.NAMESPACE:Er,ag=vt(w,"MATHML_TEXT_INTEGRATION_POINTS")&&w.MATHML_TEXT_INTEGRATION_POINTS&&typeof w.MATHML_TEXT_INTEGRATION_POINTS=="object"?Qt(w.MATHML_TEXT_INTEGRATION_POINTS):be({},ox),lg=vt(w,"HTML_INTEGRATION_POINTS")&&w.HTML_INTEGRATION_POINTS&&typeof w.HTML_INTEGRATION_POINTS=="object"?Qt(w.HTML_INTEGRATION_POINTS):be({},ix);let P=vt(w,"CUSTOM_ELEMENT_HANDLING")&&w.CUSTOM_ELEMENT_HANDLING&&typeof w.CUSTOM_ELEMENT_HANDLING=="object"?Qt(w.CUSTOM_ELEMENT_HANDLING):Js(null);if(fe=Js(null),vt(P,"tagNameCheck")&&sx(P.tagNameCheck)&&(fe.tagNameCheck=P.tagNameCheck),vt(P,"attributeNameCheck")&&sx(P.attributeNameCheck)&&(fe.attributeNameCheck=P.attributeNameCheck),vt(P,"allowCustomizedBuiltInElements")&&typeof P.allowCustomizedBuiltInElements=="boolean"&&(fe.allowCustomizedBuiltInElements=P.allowCustomizedBuiltInElements),At(fe),gt&&(Et=!1),Eu&&(Ms=!0),Ns&&(ye=be({},WE),re=Js(null),Ns.html===!0&&(be(ye,VE),be(re,$E)),Ns.svg===!0&&(be(ye,Bh),be(re,Wh),be(re,Zd)),Ns.svgFilters===!0&&(be(ye,Uh),be(re,Wh),be(re,Zd)),Ns.mathMl===!0&&(be(ye,Vh),be(re,jE),be(re,Zd))),mt.tagCheck=null,mt.attributeCheck=null,vt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?mt.tagCheck=w.ADD_TAGS:Wo(w.ADD_TAGS)&&(ye===oe&&(ye=Qt(ye)),be(ye,w.ADD_TAGS,je))),vt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?mt.attributeCheck=w.ADD_ATTR:Wo(w.ADD_ATTR)&&(re===me&&(re=Qt(re)),be(re,w.ADD_ATTR,je))),vt(w,"ADD_URI_SAFE_ATTR")&&Wo(w.ADD_URI_SAFE_ATTR)&&be(og,w.ADD_URI_SAFE_ATTR,je),vt(w,"FORBID_CONTENTS")&&Wo(w.FORBID_CONTENTS)&&(br===rg&&(br=Qt(br)),be(br,w.FORBID_CONTENTS,je)),vt(w,"ADD_FORBID_CONTENTS")&&Wo(w.ADD_FORBID_CONTENTS)&&(br===rg&&(br=Qt(br)),be(br,w.ADD_FORBID_CONTENTS,je)),tg&&(ye["#text"]=!0),wr&&be(ye,["html","head","body"]),ye.table&&(be(ye,["tbody"]),delete $e.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let L=C;C=w.TRUSTED_TYPES_POLICY;try{k=J("")}catch(ee){throw C=L,ee}}else w.TRUSTED_TYPES_POLICY===null?(C=void 0,k=""):(C===void 0&&(C=_()),C&&typeof k=="string"&&(k=J("")));It&&It(w),Ls=w},ax=be({},[...Bh,...Uh,...u2]),lx=be({},[...Vh,...d2]),E_=function(w,P,L){return P.namespaceURI===Er?w==="svg":P.namespaceURI===Tu?w==="svg"&&(L==="annotation-xml"||ag[L]):!!ax[w]},C_=function(w,P,L){return P.namespaceURI===Er?w==="math":P.namespaceURI===ku?w==="math"&&lg[L]:!!lx[w]},T_=function(w,P,L){return P.namespaceURI===ku&&!lg[L]||P.namespaceURI===Tu&&!ag[L]?!1:!lx[w]&&(S_[w]||!ax[w])},k_=function(w){let P=h(w);(!P||!P.tagName)&&(P={namespaceURI:Os,tagName:"template"});let L=Vl(w.tagName),ee=Vl(P.tagName);return sg[w.namespaceURI]?w.namespaceURI===ku?E_(L,P,ee):w.namespaceURI===Tu?C_(L,P,ee):w.namespaceURI===Er?T_(L,P,ee):!!(il==="application/xhtml+xml"&&sg[w.namespaceURI]):!1},Oo=function(w){Zs(t.removed,{element:w});try{h(w).removeChild(w)}catch(P){if(m(w),!h(w))throw Vi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ru=function(w){ug(w);let P=v(w);if(P){let ee=[];Qs(P,ae=>{Zs(ee,ae)}),Qs(ee,ae=>{try{m(ae)}catch(de){}})}let L=S(w);if(L)for(let ee=L.length-1;ee>=0;--ee){let ae=L[ee],de=ae&&ae.name;if(typeof de=="string")try{w.removeAttribute(de)}catch(Ye){}}},ki=function(w,P){try{Zs(t.removed,{attribute:P.getAttributeNode(w),from:P})}catch(L){Zs(t.removed,{attribute:null,from:P})}if(P.removeAttribute(w),w==="is")if(Ms||Eu)try{Oo(P)}catch(L){}else try{P.setAttribute(w,"")}catch(L){}},R_=function(w){let P=S(w);if(P)for(let L=P.length-1;L>=0;--L){let ee=P[L],ae=ee&&ee.name;if(!(typeof ae!="string"||re[je(ae)]))try{w.removeAttribute(ae)}catch(de){}}},ug=function(w){let P=[w];for(;P.length>0;){let L=P.pop();(x?x(L):L.nodeType)===Pn.element&&R_(L);let ae=v(L);if(ae)for(let de=ae.length-1;de>=0;--de)P.push(ae[de])}},P_=function(w){if(!Ct)return;let P=[w];for(;P.length>0;){let L=P.pop(),ee=x?x(L):L.nodeType;if(ee===Pn.processingInstruction||ee===Pn.comment&&yt(qE,L.data)){try{m(L)}catch(de){}continue}if(ee===Pn.element){let de=L,Ye=je(T?T(L):L.nodeName);try{de.hasAttribute&&de.hasAttribute("patchsrc")&&de.removeAttribute("patchsrc"),de.hasAttribute&&de.hasAttribute("for")&&Ye!=="label"&&Ye!=="output"&&de.removeAttribute("for")}catch(Dt){}}let ae=v(L);if(ae)for(let de=ae.length-1;de>=0;--de)P.push(ae[de])}},cx=function(w){let P=null,L=null;if(eg)w="<remove></remove>"+w;else{let de=zE(w,/^[\r\n\t ]+/);L=de&&de[0]}il==="application/xhtml+xml"&&Os===Er&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");let ee=C?J(w):w;if(Os===Er)try{P=new u().parseFromString(ee,il)}catch(de){}if(!P||!P.documentElement){P=B.createDocument(Os,"template",null);try{P.documentElement.innerHTML=ig?k:ee}catch(de){}}let ae=P.body||P.documentElement;return w&&L&&ae.insertBefore(n.createTextNode(L),ae.childNodes[0]||null),Os===Er?q.call(P,wr?"html":"body")[0]:wr?P.documentElement:ae},ux=function(w){return W.call(w.ownerDocument||w,w,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Pu=function(w){return w=Bl(w,ue," "),w=Bl(w,ne," "),w=Bl(w,Qe," "),w},dg=function(w){var P;w.normalize();let L=W.call(w.ownerDocument||w,w,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),ee=L.nextNode();for(;ee;)ee.data=Pu(ee.data),ee=L.nextNode();let ae=(P=w.querySelectorAll)===null||P===void 0?void 0:P.call(w,"template");ae&&Qs(ae,de=>{Ds(de.content)&&dg(de.content)})},Iu=function(w){let P=T?T(w):null;return typeof P!="string"||je(P)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==S(w)||typeof w.removeAttribute!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==x(w)||w.childNodes!==v(w)},Ds=function(w){if(!x||typeof w!="object"||w===null)return!1;try{return x(w)===Pn.documentFragment}catch(P){return!1}},sl=function(w){if(!x||typeof w!="object"||w===null)return!1;try{return typeof x(w)=="number"}catch(P){return!1}};function Cr($,w,P){$.length!==0&&Qs($,L=>{L.call(t,w,P,Ls)})}let I_=function(w,P){return!!(Ct&&w.hasChildNodes()&&!sl(w.firstElementChild)&&yt(GE,w.textContent)&&yt(GE,w.innerHTML)||Ct&&w.namespaceURI===Er&&P==="style"&&sl(w.firstElementChild)||w.nodeType===Pn.processingInstruction||Ct&&w.nodeType===Pn.comment&&yt(qE,w.data))},A_=function(w,P){if(!$e[P]&&px(P)&&(fe.tagNameCheck instanceof RegExp&&yt(fe.tagNameCheck,P)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(P)))return!1;if(tg&&!br[P]){let L=h(w),ee=v(w);if(ee&&L){let ae=ee.length;for(let de=ae-1;de>=0;--de){let Ye=ng?ee[de]:p(ee[de],!0);L.insertBefore(Ye,g(w))}}}return Oo(w),!0},dx=function(w,P){if(Cr(K.beforeSanitizeElements,w,null),w!==P&&h(w)===null)return!0;if(Iu(w))return Oo(w),!0;let L=je(T?T(w):w.nodeName);if(Cr(K.uponSanitizeElement,w,{tagName:L,allowedTags:ye}),w!==P&&h(w)===null)return!0;if(I_(w,L))return Oo(w),!0;if($e[L]||!(mt.tagCheck instanceof Function&&mt.tagCheck(L))&&!ye[L]){let ae=A_(w,L);return ae===!1&&Cr(K.afterSanitizeElements,w,null),ae}if((x?x(w):w.nodeType)===Pn.element&&!k_(w)||(L==="noscript"||L==="noembed"||L==="noframes")&&yt(w2,w.innerHTML))return Oo(w),!0;if(gt&&w.nodeType===Pn.text){let ae=Pu(w.textContent);w.textContent!==ae&&(Zs(t.removed,{element:w.cloneNode()}),w.textContent=ae)}return Cr(K.afterSanitizeElements,w,null),!1},fx=function(w,P,L){if(Te[P]||Ct&&P==="patchsrc"||Ct&&P==="for"&&w!=="label"&&w!=="output"||ZS&&(P==="id"||P==="name")&&(L in n||L in b_))return!1;let ee=re[P]||mt.attributeCheck instanceof Function&&mt.attributeCheck(P,w);if(!(Et&&yt(Se,P))){if(!(Kt&&yt(tt,P))){if(ee){if(!og[P]){if(!yt(at,Bl(L,Le,""))){if(!((P==="src"||P==="xlink:href"||P==="href")&&w!=="script"&&HE(L,"data:")===0&&tx[w])){if(!(xr&&!yt(pt,Bl(L,Le,"")))){if(L)return!1}}}}}else if(!(px(w)&&(fe.tagNameCheck instanceof RegExp&&yt(fe.tagNameCheck,w)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(w))&&(fe.attributeNameCheck instanceof RegExp&&yt(fe.attributeNameCheck,P)||fe.attributeNameCheck instanceof Function&&fe.attributeNameCheck(P,w))||P==="is"&&fe.allowCustomizedBuiltInElements&&(fe.tagNameCheck instanceof RegExp&&yt(fe.tagNameCheck,L)||fe.tagNameCheck instanceof Function&&fe.tagNameCheck(L))))return!1}}return!0},__=be({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),px=function(w){return!__[Vl(w)]&&yt(Ne,w)},M_=function(w,P,L,ee){if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!L)switch(f.getAttributeType(w,P)){case"TrustedHTML":return J(ee);case"TrustedScriptURL":return Y(ee)}return ee},N_=function(w,P,L,ee){try{L?w.setAttributeNS(L,P,ee):w.setAttribute(P,ee),Iu(w)?Oo(w):FE(t.removed)}catch(ae){ki(P,w)}},mx=function(w){Cr(K.beforeSanitizeAttributes,w,null);let P=w.attributes;if(!P||Iu(w))return;let L={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:re,forceKeepAttr:void 0},ee=P.length,ae=je(w.nodeName);for(;ee--;){let de=P[ee],Ye=de.name,Dt=de.namespaceURI,er=de.value,cn=je(Ye),tr=er,Gt=Ye==="value"?tr:r2(tr);if(L.attrName=cn,L.attrValue=Gt,L.keepAttr=!0,L.forceKeepAttr=void 0,Cr(K.uponSanitizeAttribute,w,L),Gt=L.attrValue,JS&&(cn==="id"||cn==="name")&&HE(Gt,ex)!==0&&(ki(Ye,w),Gt=ex+Gt),Ct&&yt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Gt)){ki(Ye,w);continue}if(cn==="attributename"&&zE(Gt,"href")){ki(Ye,w);continue}if(!L.forceKeepAttr){if(!L.keepAttr){ki(Ye,w);continue}if(!Jn&&yt(b2,Gt)){ki(Ye,w);continue}if(gt&&(Gt=Pu(Gt)),!fx(ae,cn,Gt)){ki(Ye,w);continue}Gt=M_(ae,cn,Dt,Gt),Gt!==tr&&N_(w,Ye,Dt,Gt)}}Cr(K.afterSanitizeAttributes,w,null)},Au=function(w){let P=null,L=ux(w);for(Cr(K.beforeSanitizeShadowDOM,w,null);P=L.nextNode();)if(Cr(K.uponSanitizeShadowNode,P,null),dx(P,w),mx(P),Ds(P.content)&&Au(P.content),(x?x(P):P.nodeType)===Pn.element){let ae=y(P);Ds(ae)&&(fg(ae),Au(ae))}Cr(K.afterSanitizeShadowDOM,w,null)},fg=function(w){let P=[{node:w,shadow:null}];for(;P.length>0;){let L=P.pop();if(L.shadow){Au(L.shadow);continue}let ee=L.node,de=(x?x(ee):ee.nodeType)===Pn.element,Ye=v(ee);if(Ye)for(let Dt=Ye.length-1;Dt>=0;--Dt)P.push({node:Ye[Dt],shadow:null});if(de){let Dt=T?T(ee):null;if(typeof Dt=="string"&&je(Dt)==="template"){let er=ee.content;Ds(er)&&P.push({node:er,shadow:null})}}if(de){let Dt=y(ee);Ds(Dt)&&P.push({node:null,shadow:Dt},{node:Dt,shadow:null})}}};return t.sanitize=function($){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=null,L=null,ee=null,ae=null;if(ig=!$,ig&&($="<!-->"),typeof $!="string"&&!sl($)&&($=l2($),typeof $!="string"))throw Vi("dirty is not a string, aborting");if(!t.isSupported)return $;Qm?(ye=Zm,re=Jm):cg(w),(K.uponSanitizeElement.length>0||K.uponSanitizeAttribute.length>0)&&(ye=Qt(ye)),K.uponSanitizeAttribute.length>0&&(re=Qt(re)),t.removed=[];let de=ng&&typeof $!="string"&&sl($);if(de){P_($);let cn=T?T($):$.nodeName;if(typeof cn=="string"){let tr=je(cn);if(!ye[tr]||$e[tr])throw Ru($),Vi("root node is forbidden and cannot be sanitized in-place")}if(Iu($))throw Ru($),Vi("root node is clobbered and cannot be sanitized in-place");try{fg($)}catch(tr){throw Ru($),tr}}else if(sl($))P=cx("<!---->"),L=P.ownerDocument.importNode($,!0),L.nodeType===Pn.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?P=L:P.appendChild(L),fg(L);else{if(!Ms&&!gt&&!wr&&$.indexOf("<")===-1)return C&&Cu?J($):$;if(P=cx($),!P)return Ms?null:Cu?k:""}P&&eg&&Oo(P.firstChild);let Ye=de?$:P,Dt=ux(Ye);try{for(;ee=Dt.nextNode();)dx(ee,Ye),mx(ee),Ds(ee.content)&&Au(ee.content)}catch(cn){throw de&&(Ru($),Qs(t.removed,tr=>{tr.element&&ug(tr.element)})),cn}if(de)return Qs(t.removed,cn=>{cn.element&&ug(cn.element)}),gt&&dg($),$;if(Ms){if(gt&&dg(P),Eu)for(ae=N.call(P.ownerDocument);P.firstChild;)ae.appendChild(P.firstChild);else ae=P;return(re.shadowroot||re.shadowrootmode)&&(ae=j.call(r,ae,!0)),ae}let er=wr?P.outerHTML:P.innerHTML;return wr&&ye["!doctype"]&&P.ownerDocument&&P.ownerDocument.doctype&&P.ownerDocument.doctype.name&&yt(S2,P.ownerDocument.doctype.name)&&(er="<!DOCTYPE "+P.ownerDocument.doctype.name+`>
72
+ `+er),gt&&(er=Pu(er)),C&&Cu?J(er):er},t.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};cg($),Qm=!0,Zm=ye,Jm=re},t.clearConfig=function(){Ls=null,Qm=!1,Zm=null,Jm=null,C=R,k=""},t.isValidAttribute=function($,w,P){Ls||cg({});let L=je($),ee=je(w);return fx(L,ee,P)},t.addHook=function($,w){typeof w=="function"&&vt(K,$)&&Zs(K[$],w)},t.removeHook=function($,w){if(vt(K,$)){if(w!==void 0){let P=t2(K[$],w);return P===-1?void 0:n2(K[$],P,1)[0]}return FE(K[$])}},t.removeHooks=function($){vt(K,$)&&(K[$]=[])},t.removeAllHooks=function(){K=YE()},t}var JE=ZE();var yo=b(Z());var s0=b(De()),Yn=b(Z());var Jd=b(Z()),T2=["bottom","height","left","right","top","width"],k2=(e={},t={})=>T2.some(n=>e[n]!==t[n]),io=new Map,eC,tC=()=>{let e=[],t=[];io.forEach((n,r)=>{if(r instanceof Element&&!r.isConnected){t.push(r);return}let o=r.getBoundingClientRect();k2(o,n.rect)&&(n.rect=o,e.push(n))}),t.forEach(n=>{io.delete(n)}),e.forEach(n=>{n.callbacks.forEach(r=>r(n.rect))}),eC=window.requestAnimationFrame(tC)};function R2(e,t){return{observe(){let n=io.size===0;if(io.has(e)){let r=io.get(e);r.callbacks.push(t),r.rect&&t(r.rect)}else io.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]});n&&tC()},unobserve(){let n=io.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||io.delete(e),io.size||cancelAnimationFrame(eC)}}}}function Kh(e){let[t,n]=(0,Jd.useState)(null);return(0,Jd.useLayoutEffect)(()=>{if(!e.current)return;let r=R2(e.current,o=>{n(o)});return r.observe(),()=>{r.unobserve()}},[e]),t}var Ia=b(Z()),bk=b(Oc());var xk=b(Z());function di(e){(0,xk.useEffect)(()=>{let t=n=>{n.isWithinRoot||e(n)};return document.body.addEventListener("mouseup",t),()=>{document.body.removeEventListener("mouseup",t)}},[e])}function os(e){e.addEventListener("mouseup",t=>{t.isWithinRoot=!0},!0)}var wk={root:"dd-r-dgo"};var Ek=({children:e,parentNode:t})=>{let[n,r]=(0,Ia.useState)(null),o=(0,Ia.useContext)(cl);return(0,Ia.useLayoutEffect)(()=>{let i=document.createElement("div");return os(i),i.classList.add(wk.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,bk.createPortal)(e,n):null};var zr={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 xp=b(I()),wp=(e=!1)=>{let[t,n]=(0,Yn.useState)(e),r=(0,Yn.useCallback)(()=>n(!0),[]),o=(0,Yn.useCallback)(()=>n(!1),[]),i=(0,Yn.useCallback)(()=>n(a=>!a),[]),s=(0,Yn.useRef)(null);return{opened:t,open:r,close:o,toggle:i,triggerRef:s}};function a0(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 Aa=c=>{var u=c,{className:e,triggerRef:t,boundaryRef:n=(0,Yn.createRef)(),position:r="above",align:o="center",children:i,toStyle:s=a0,parentNode:a}=u,l=ie(u,["className","triggerRef","boundaryRef","position","align","children","toStyle","parentNode"]);let f=Kh(t),d=Kh(n),p=(0,Yn.useMemo)(()=>s(f,d,0),[f,d]);return(0,xp.jsx)(Ek,{parentNode:a,children:(0,xp.jsx)("div",A(E({className:(0,s0.default)(zr.ref,{[zr.positionAbove]:r==="above",[zr.positionBelow]:r==="below",[zr.positionLeft]:r==="left",[zr.positionRight]:r==="right",[zr.alignStart]:o==="start",[zr.alignCenter]:o==="center",[zr.alignEnd]:o==="end"}),style:p},l),{role:"dialog",children:(0,xp.jsx)("div",{className:(0,s0.default)(e,zr.root),children:i})}))})};var Ck={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 mr=b(I());function A3(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 l0(e){var n,r;let t=e.cloneNode(!0);return t.querySelectorAll("div,button").forEach(o=>o.remove()),(r=(n=t.textContent)==null?void 0:n.trim())!=null?r:""}function _3(e){return e.replace(/\r\n/g,`
73
+ `)}var M3=({content:e,useLabel:t,copyLabel:n,onCopy:r,onUse:o})=>{let i=z("Markdown",Ck),s=(0,yo.useRef)(null),[a,l]=(0,yo.useState)(null),c=(0,yo.useMemo)(()=>{let g=Pe.parse(_3(e));return JE.sanitize(g.toString()).replaceAll("</code>",`${A3(i.copyIcon)}</code>`).replaceAll('<a href="','<a target="_blank" rel="noreferrer noopener" href="')},[e]),u=g=>{var y;let v=g.target,h=!!((y=s.current)!=null&&y.querySelector("code"));if(["A","BUTTON"].includes(v.tagName)){l(null);return}a||h&&v.tagName!=="CODE"||!h&&v!==s.current||(v.addEventListener("mouseleave",()=>l(null),{once:!0}),l(v))},f=()=>{if(!a)return;l(null);let g=a.querySelector("button");g&&(Bo(g,i.fadeup),r==null||r(l0(a)))},d=g=>{let v=g.target,h=v instanceof HTMLElement?v:null;if(v instanceof Element?v.closest("a"):null){g.stopPropagation();return}h&&"copyIcon"in h.dataset&&(Bo(h,i.fadeup),r==null||r(l0(h.parentElement)))},p=()=>{!a||!o||(l(null),o(l0(a)))},m=g=>{if(g===null)return;let v=g.getBoundingClientRect();v.left<0?g.style.transform=`translateX(${-v.left+2}px)`:v.right>window.innerWidth&&(g.style.transform=`translateX(${window.innerWidth-v.right-2}px)`)};return(0,mr.jsxs)(yo.Fragment,{children:[a&&(r||o)&&(0,mr.jsxs)(Aa,{triggerRef:{current:a},className:i.popover,parentNode:a,children:[(0,mr.jsxs)("div",{className:i.options,ref:m,children:[r&&(a==null?void 0:a.tagName)==="CODE"&&(0,mr.jsx)("button",{type:"button",className:i.option,onClick:f,children:n}),o&&(0,mr.jsxs)(yo.Fragment,{children:[(0,mr.jsx)("div",{className:i.divider}),(0,mr.jsx)("button",{type:"button",className:i.option,onClick:p,children:t})]})]}),(0,mr.jsx)("div",{className:i.arrow})]}),(0,mr.jsx)("div",{ref:s,"data-testid":"widget-markdown-content",className:i.root,dangerouslySetInnerHTML:{__html:c},onMouseOver:u,onClick:d})]})},is=M3;var Rk=b(Z());var Tk={loadingBar:"dd-6as-V",placeHolderShimmer:"dd-TFYmA"};var kk=b(I()),N3=({width:e})=>{let t=z("LoadingProgressBar",Tk);return(0,kk.jsx)("div",{className:t.loadingBar,style:{width:e}})},bp=N3;var vo=b(I()),Ep=({title:e})=>{let t=(0,Rk.useRef)(null);return Vu(t),(0,vo.jsx)(pe,{ref:t,children:(0,vo.jsx)(we,{children:(0,vo.jsxs)(we.Content,{children:[(0,vo.jsx)(we.Title,{children:e}),(0,vo.jsx)(bp,{width:"60%"}),(0,vo.jsx)(bp,{width:"90%"}),(0,vo.jsx)(bp,{width:"50%"})]})})})};var _a={};ht(_a,{enUS:()=>O3,nlNL:()=>L3});var O3={inputPlaceholder:[{type:0,value:"What is your question?"}],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"}],submitLabel:[{type:0,value:"Submit"}],resetLabel:[{type:0,value:"Reset"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},L3={inputPlaceholder:[{type:0,value:"Wat is je vraag?"}],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"}],submitLabel:[{type:0,value:"Verzend"}],resetLabel:[{type:0,value:"Gesprek wissen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var Cp={form:"dd-pleCH",formInput:"dd-pGJMY",formSubmit:"dd--gkRg",actionButton:"dd-I2NEH",resetContainer:"dd-qKIDX",sources:"dd-xf9c6",source:"dd-a-vyX",tooltip:"dd-EsgcZ",linkContent:"dd-gARDA",showMoreSources:"dd-uDGi-"};var $r=b(Z());var D=b(Z(),1);function Tp(){return typeof window!="undefined"}function Br(e){return kp(e)?(e.nodeName||"").toLowerCase():"#document"}function $t(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ur(e){var t;return(t=(kp(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kp(e){return Tp()?e instanceof Node||e instanceof $t(e).Node:!1}function Ue(e){return Tp()?e instanceof Element||e instanceof $t(e).Element:!1}function ot(e){return Tp()?e instanceof HTMLElement||e instanceof $t(e).HTMLElement:!1}function as(e){return!Tp()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof $t(e).ShadowRoot}function Lc(e){let{overflow:t,overflowX:n,overflowY:r,display:o}=Dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function Pk(e){return/^(table|td|th)$/.test(Br(e))}function Dc(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var D3=/transform|translate|scale|rotate|perspective|filter/,F3=/paint|layout|strict|content/,ss=e=>!!e&&e!=="none",c0;function Rp(e){let t=Ue(e)?Dn(e):e;return ss(t.transform)||ss(t.translate)||ss(t.scale)||ss(t.rotate)||ss(t.perspective)||!Ma()&&(ss(t.backdropFilter)||ss(t.filter))||D3.test(t.willChange||"")||F3.test(t.contain||"")}function Ik(e){let t=Hr(e);for(;ot(t)&&!Vr(t);){if(Rp(t))return t;if(Dc(t))return null;t=Hr(t)}return null}function Ma(){return c0==null&&(c0=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),c0}function Vr(e){return/^(html|body|#document)$/.test(Br(e))}function Dn(e){return $t(e).getComputedStyle(e)}function Fc(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hr(e){if(Br(e)==="html")return e;let t=e.assignedSlot||e.parentNode||as(e)&&e.host||Ur(e);return as(t)?t.host:t}function Ak(e){let t=Hr(e);return Vr(t)?(e.ownerDocument||e).body:ot(t)&&Lc(t)?t:Ak(t)}function Ln(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);let o=Ak(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=$t(o);if(i){let a=Pp(s);return t.concat(s,s.visualViewport||[],Lc(o)?o:[],a&&n?Ln(a):[])}else return t.concat(o,Ln(o,[],n))}function Pp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Da=b(Z(),1),Gk=b(Z(),1);var Na=Math.min,So=Math.max,Hc=Math.round,Bc=Math.floor,Wr=e=>({x:e,y:e}),z3={left:"right",right:"left",bottom:"top",top:"bottom"};function Nk(e,t,n){return So(e,Na(t,n))}function Uc(e,t){return typeof e=="function"?e(t):e}function ls(e){return e.split("-")[0]}function Vc(e){return e.split("-")[1]}function u0(e){return e==="x"?"y":"x"}function d0(e){return e==="y"?"height":"width"}function xo(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function f0(e){return u0(xo(e))}function Ok(e,t,n){n===void 0&&(n=!1);let r=Vc(e),o=f0(e),i=d0(o),s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=zc(s)),[s,zc(s)]}function Lk(e){let t=zc(e);return[Ip(e),t,Ip(t)]}function Ip(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var _k=["left","right"],Mk=["right","left"],H3=["top","bottom"],B3=["bottom","top"];function U3(e,t,n){switch(e){case"top":case"bottom":return n?t?Mk:_k:t?_k:Mk;case"left":case"right":return t?H3:B3;default:return[]}}function Dk(e,t,n,r){let o=Vc(e),i=U3(ls(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ip)))),i}function zc(e){let t=ls(e);return z3[t]+e.slice(t.length)}function V3(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function Fk(e){return typeof e!="number"?V3(e):{top:e,right:e,bottom:e,left:e}}function cs(e){let{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}var W3=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Ap=W3.join(","),Hk=typeof Element=="undefined",Oa=Hk?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_p=!Hk&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Mp=function(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Mp(t.parentNode));return s},$3=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},Bk=function(t,n,r){if(Mp(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Ap));return n&&Oa.call(t,Ap)&&o.unshift(t),o=o.filter(r),o},Np=function(t,n,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!Mp(s,!1))if(s.tagName==="SLOT"){var a=s.assignedElements(),l=a.length?a:s.children,c=Np(l,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:s,candidates:c})}else{var u=Oa.call(s,Ap);u&&r.filter(s)&&(n||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),d=!Mp(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&d){var p=Np(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:s,candidates:p})}else i.unshift.apply(i,s.children)}}return o},Uk=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Vk=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$3(t))&&!Uk(t)?0:t.tabIndex},j3=function(t,n){var r=Vk(t);return r<0&&n&&!Uk(t)?0:r},K3=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Wk=function(t){return t.tagName==="INPUT"},G3=function(t){return Wk(t)&&t.type==="hidden"},q3=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},Y3=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},X3=function(t){if(!t.name)return!0;var n=t.form||_p(t),r=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},o;if(typeof window!="undefined"&&typeof window.CSS!="undefined"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=Y3(o,t.form);return!i||i===t},Q3=function(t){return Wk(t)&&t.type==="radio"},Z3=function(t){return Q3(t)&&!X3(t)},J3=function(t){var n,r=t&&_p(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var s,a,l;for(i=!!((s=o)!==null&&s!==void 0&&(a=s.ownerDocument)!==null&&a!==void 0&&a.contains(o)||t!=null&&(l=t.ownerDocument)!==null&&l!==void 0&&l.contains(t));!i&&o;){var c,u,f;r=_p(o),o=(c=r)===null||c===void 0?void 0:c.host,i=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},zk=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},e4=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}var s=getComputedStyle(t),a=s.visibility;if(a==="hidden"||a==="collapse")return!0;var l=Oa.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(Oa.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var f=t.parentElement,d=_p(t);if(f&&!f.shadowRoot&&o(f)===!0)return zk(t);t.assignedSlot?t=t.assignedSlot:!f&&d!==t.ownerDocument?t=d.host:t=f}t=u}if(J3(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return zk(t);return!1},t4=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Oa.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},p0=function(t,n){return!(n.disabled||G3(n)||e4(n,t)||q3(n)||t4(n))},m0=function(t,n){return!(Z3(n)||Vk(n)<0||!p0(t,n))},n4=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},$k=function(t){var n=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,a=s?o.scopeParent:o,l=j3(a,s),c=s?$k(o.candidates):a;l===0?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:i,tabIndex:l,item:o,isScope:s,content:c})}),r.sort(K3).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},La=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Np([t],n.includeContainer,{filter:m0.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:n4}):r=Bk(t,n.includeContainer,m0.bind(null,n)),$k(r)},jk=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Np([t],n.includeContainer,{filter:p0.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Bk(t,n.includeContainer,p0.bind(null,n)),r},g0=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Oa.call(t,Ap)===!1?!1:m0(n,t)};function qk(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function y0(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Yk(){return/apple/i.test(navigator.vendor)}function h0(){let e=/android/i;return e.test(qk())||e.test(y0())}function r4(){return y0().includes("jsdom/")}var Kk="data-floating-ui-focusable",o4="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function us(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function tn(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&as(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wo(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Op(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Xk(e){return e.matches("html,body")}function jt(e){return(e==null?void 0:e.ownerDocument)||document}function v0(e){return ot(e)&&e.matches(o4)}function S0(e){return e?e.getAttribute("role")==="combobox"&&v0(e):!1}function Lp(e){return e?e.hasAttribute(Kk)?e:e.querySelector("["+Kk+"]")||e:null}function ds(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...ds(e,o.id,n)])}function x0(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){let i=e.find(s=>s.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function Dp(e){e.preventDefault(),e.stopPropagation()}function Qk(e){return"nativeEvent"in e}function Zk(e){return e.mozInputSource===0&&e.isTrusted?!0:h0()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Jk(e){return r4()?!1:!h0()&&e.width===0&&e.height===0||h0()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Fa(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var i4=typeof document!="undefined",s4=function(){},nn=i4?Gk.useLayoutEffect:s4,a4=E({},Da);function fi(e){let t=Da.useRef(e);return nn(()=>{t.current=e}),t}var l4=a4.useInsertionEffect,c4=l4||(e=>e());function rn(e){let t=Da.useRef(()=>{});return c4(()=>{t.current=e}),Da.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var za=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eR(e,t){let n=La(e,za()),r=n.length;if(r===0)return;let o=us(jt(e)),i=n.indexOf(o),s=i===-1?t===1?0:r-1:i+t;return n[s]}function w0(e){return eR(jt(e).body,1)||e}function b0(e){return eR(jt(e).body,-1)||e}function Ha(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!tn(n,r)}function tR(e){La(e,za()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function E0(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{let r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}var wn=b(I(),1);var F0=b(Oc(),1);function nR(e,t,n){let{reference:r,floating:o}=e,i=xo(t),s=f0(t),a=d0(s),l=ls(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2,p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}let m=Vc(t);return m&&(p[s]+=d*(m==="end"?1:-1)*(n&&c?-1:1)),p}function rR(e,t){return M(this,null,function*(){var n;t===void 0&&(t={});let{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Uc(t,e),m=Fk(p),v=a[d?f==="floating"?"reference":"floating":f],h=cs(yield i.getClippingRect({element:(n=yield i.isElement==null?void 0:i.isElement(v))==null||n?v:v.contextElement||(yield i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=yield i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating),x=(yield i.isElement==null?void 0:i.isElement(S))&&(yield i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},T=cs(i.convertOffsetParentRelativeRectToViewportRelativeRect?yield i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:S,strategy:l}):y);return{top:(h.top-T.top+m.top)/x.y,bottom:(T.bottom-h.bottom+m.bottom)/x.y,left:(h.left-T.left+m.left)/x.x,right:(T.right-h.right+m.right)/x.x}})}var u4=50,oR=(e,t,n)=>M(null,null,function*(){let{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:A(E({},s),{detectOverflow:rR}),l=yield s.isRTL==null?void 0:s.isRTL(t),c=yield s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=nR(c,r,l),d=r,p=0,m={};for(let g=0;g<i.length;g++){let v=i[g];if(!v)continue;let{name:h,fn:y}=v,{x:S,y:x,data:T,reset:C}=yield y({x:u,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:c,platform:a,elements:{reference:e,floating:t}});u=S!=null?S:u,f=x!=null?x:f,m[h]=E(E({},m[h]),T),C&&p<u4&&(p++,typeof C=="object"&&(C.placement&&(d=C.placement),C.rects&&(c=C.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:u,y:f}=nR(c,d,l)),g=-1)}return{x:u,y:f,placement:d,strategy:o,middlewareData:m}});var iR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(n){return M(this,null,function*(){var r,o;let{placement:i,middlewareData:s,rects:a,initialPlacement:l,platform:c,elements:u}=n,V=Uc(e,n),{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0}=V,h=ie(V,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=s.arrow)!=null&&r.alignmentOffset)return{};let y=ls(i),S=xo(l),x=ls(l)===l,T=yield c.isRTL==null?void 0:c.isRTL(u.floating),C=p||(x||!v?[zc(l)]:Lk(l)),k=g!=="none";!p&&k&&C.push(...Dk(l,v,g,T));let R=[l,...C],F=yield c.detectOverflow(n,h),O=[],U=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&O.push(F[y]),d){let B=Ok(i,a,T);O.push(F[B[0]],F[B[1]])}if(U=[...U,{placement:i,overflows:O}],!O.every(B=>B<=0)){var J,Y;let B=(((J=s.flip)==null?void 0:J.index)||0)+1,W=R[B];if(W&&(!(d==="alignment"?S!==xo(W):!1)||U.every(j=>xo(j.placement)===S?j.overflows[0]>0:!0)))return{data:{index:B,overflows:U},reset:{placement:W}};let N=(Y=U.filter(q=>q.overflows[0]<=0).sort((q,j)=>q.overflows[1]-j.overflows[1])[0])==null?void 0:Y.placement;if(!N)switch(m){case"bestFit":{var _;let q=(_=U.filter(j=>{if(k){let K=xo(j.placement);return K===S||K==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(K=>K>0).reduce((K,ue)=>K+ue,0)]).sort((j,K)=>j[1]-K[1])[0])==null?void 0:_[0];q&&(N=q);break}case"initialPlacement":N=l;break}if(i!==N)return{reset:{placement:N}}}return{}})}}};var d4=new Set(["left","top"]);function f4(e,t){return M(this,null,function*(){let{placement:n,platform:r,elements:o}=e,i=yield r.isRTL==null?void 0:r.isRTL(o.floating),s=ls(n),a=Vc(n),l=xo(n)==="y",c=d4.has(s)?-1:1,u=i&&l?-1:1,f=Uc(t,e),{mainAxis:d,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&typeof m=="number"&&(p=a==="end"?m*-1:m),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}})}var sR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(n){return M(this,null,function*(){var r,o;let{x:i,y:s,placement:a,middlewareData:l}=n,c=yield f4(n,e);return a===((r=l.offset)==null?void 0:r.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+c.x,y:s+c.y,data:A(E({},c),{placement:a})}})}}},aR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(n){return M(this,null,function*(){let{x:r,y:o,placement:i,platform:s}=n,S=Uc(e,n),{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:x=>{let{x:T,y:C}=x;return{x:T,y:C}}}}=S,u=ie(S,["mainAxis","crossAxis","limiter"]),f={x:r,y:o},d=yield s.detectOverflow(n,u),p=xo(i),m=u0(p),g=f[m],v=f[p],h=(x,T)=>Nk(T+d[x==="y"?"top":"left"],T,T-d[x==="y"?"bottom":"right"]);a&&(g=h(m,g)),l&&(v=h(p,v));let y=c.fn(A(E({},n),{[m]:g,[p]:v}));return A(E({},y),{data:{x:y.x-r,y:y.y-o,enabled:{[m]:a,[p]:l}}})})}}};function uR(e){let t=Dn(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,o=ot(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Hc(n)!==i||Hc(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function T0(e){return Ue(e)?e:e.contextElement}function Ba(e){let t=T0(e);if(!ot(t))return Wr(1);let n=t.getBoundingClientRect(),{width:r,height:o,$:i}=uR(t),s=(i?Hc(n.width):n.width)/r,a=(i?Hc(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}var p4=Wr(0);function dR(e){let t=$t(e);return!Ma()||!t.visualViewport?p4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function m4(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===$t(e)}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let o=e.getBoundingClientRect(),i=T0(e),s=Wr(1);t&&(r?Ue(r)&&(s=Ba(r)):s=Ba(e));let a=m4(i,n,r)?dR(i):Wr(0),l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,f=o.height/s.y;if(i&&r){let d=$t(i),p=Ue(r)?$t(r):r,m=d,g=Pp(m);for(;g&&p!==m;){let v=Ba(g),h=g.getBoundingClientRect(),y=Dn(g),S=h.left+(g.clientLeft+parseFloat(y.paddingLeft))*v.x,x=h.top+(g.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,c*=v.y,u*=v.x,f*=v.y,l+=S,c+=x,m=$t(g),g=Pp(m)}}return cs({width:u,height:f,x:l,y:c})}function Fp(e,t){let n=Fc(e).scrollLeft;return t?t.left+n:fs(Ur(e)).left+n}function fR(e,t){let n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Fp(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function g4(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e,i=o==="fixed",s=Ur(r),a=t?Dc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=Wr(1),u=Wr(0),f=ot(r);if((f||!i)&&((Br(r)!=="body"||Lc(s))&&(l=Fc(r)),f)){let p=fs(r);c=Ba(r),u.x=p.x+r.clientLeft,u.y=p.y+r.clientTop}let d=s&&!f&&!i?fR(s,l):Wr(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:n.y*c.y-l.scrollTop*c.y+u.y+d.y}}function h4(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function y4(e){let t=Fc(e),n=e.ownerDocument.body,r=So(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=So(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),i=-t.scrollLeft+Fp(e),s=-t.scrollTop;return Dn(n).direction==="rtl"&&(i+=So(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:s}}var v4=25;function S4(e,t,n){n===void 0&&(n="viewport");let r=n==="layoutViewport",o=$t(e),i=Ur(e),s=o.visualViewport,a=i.clientWidth,l=i.clientHeight,c=0,u=0;if(s){let d=!Ma()||t==="fixed";r?d||(c=-s.offsetLeft,u=-s.offsetTop):(a=s.width,l=s.height,d&&(c=s.offsetLeft,u=s.offsetTop))}if(Fp(i)<=0){let d=i.ownerDocument,p=d.body,m=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,v=Math.abs(i.clientWidth-p.clientWidth-g),h=getComputedStyle(i).scrollbarGutter==="stable both-edges"?v/2:v;h<=v4&&(a-=h)}return{width:a,height:l,x:c,y:u}}function x4(e,t){let n=fs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ba(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function lR(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=S4(e,n,t);else if(t==="document")r=y4(Ur(e));else if(Ue(t))r=x4(t,n);else{let o=dR(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return cs(r)}function w4(e,t){let n=t.get(e);if(n)return n;let r=Ln(e,[],!1).filter(a=>Ue(a)&&Br(a)!=="body"),o=null,i=Dn(e).position==="fixed",s=i?Hr(e):e;for(;Ue(s)&&!Vr(s);){let a=Dn(s),l=Rp(s),c=o?o.position:i?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?r=r.filter(f=>f!==s):o=a,s=Hr(s)}return t.set(e,r),r}function b4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e,s=[...n==="clippingAncestors"?Dc(t)?[]:w4(t,this._c):[].concat(n),r],a=lR(t,s[0],o),l=a.top,c=a.right,u=a.bottom,f=a.left;for(let d=1;d<s.length;d++){let p=lR(t,s[d],o);l=So(p.top,l),c=Na(p.right,c),u=Na(p.bottom,u),f=So(p.left,f)}return{width:c-f,height:u-l,x:f,y:l}}function E4(e){let{width:t,height:n}=uR(e);return{width:t,height:n}}function C4(e,t,n){let r=ot(t),o=Ur(t),i=n==="fixed",s=fs(e,!0,i,t),a={scrollLeft:0,scrollTop:0},l=Wr(0);if((r||!i)&&((Br(t)!=="body"||Lc(o))&&(a=Fc(t)),r)){let d=fs(t,!0,i,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}!r&&o&&(l.x=Fp(o));let c=o&&!r&&!i?fR(o,a):Wr(0),u=s.left+a.scrollLeft-l.x-c.x,f=s.top+a.scrollTop-l.y-c.y;return{x:u,y:f,width:s.width,height:s.height}}function C0(e){return Dn(e).position==="static"}function cR(e,t){if(!ot(e)||Dn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ur(e)===n&&(n=n.ownerDocument.body),n}function pR(e,t){let n=$t(e);if(Dc(e))return n;if(!ot(e)){let o=Hr(e);for(;o&&!Vr(o);){if(Ue(o)&&!C0(o))return o;o=Hr(o)}return n}let r=cR(e,t);for(;r&&Pk(r)&&C0(r);)r=cR(r,t);return r&&Vr(r)&&C0(r)&&!Rp(r)?n:r||Ik(e)||n}var T4=function(e){return M(this,null,function*(){let t=this.getOffsetParent||pR,n=this.getDimensions,r=yield n(e.floating);return{reference:C4(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function k4(e){return Dn(e).direction==="rtl"}var k0={convertOffsetParentRelativeRectToViewportRelativeRect:g4,getDocumentElement:Ur,getClippingRect:b4,getOffsetParent:pR,getElementRects:T4,getClientRects:h4,getDimensions:E4,getScale:Ba,isElement:Ue,isRTL:k4};function mR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function R4(e,t,n){let r=null,o,i=Ur(e);function s(){var u;clearTimeout(o),(u=r)==null||u.disconnect(),r=null}function a(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),s();let d=e.getBoundingClientRect(),{left:p,top:m,width:g,height:v}=d;if(u||t(),!g||!v)return;let h=Bc(m),y=Bc(i.clientWidth-(p+g)),S=Bc(i.clientHeight-(m+v)),x=Bc(p),C={rootMargin:-h+"px "+-y+"px "+-S+"px "+-x+"px",threshold:So(0,Na(1,f))||1},k=!0;function R(F){let O=F[0].intersectionRatio;if(!mR(d,e.getBoundingClientRect()))return a();if(O!==f){if(!k)return a();O?a(!1,O):o=setTimeout(()=>{a(!1,1e-7)},1e3)}k=!1}try{r=new IntersectionObserver(R,A(E({},C),{root:i.ownerDocument}))}catch(F){r=new IntersectionObserver(R,C)}r.observe(e)}let l=$t(e),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),s()}}function zp(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=T0(e),u=o||i?[...c?Ln(c):[],...t?Ln(t):[]]:[];u.forEach(h=>{o&&h.addEventListener("scroll",n),i&&h.addEventListener("resize",n)});let f=c&&a?R4(c,n,i):null,d=-1,p=null;s&&(p=new ResizeObserver(h=>{let[y]=h;y&&y.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let m,g=l?fs(e):null;l&&v();function v(){let h=fs(e);g&&!mR(g,h)&&n(),g=h,m=requestAnimationFrame(v)}return n(),()=>{var h;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),f==null||f(),(h=p)==null||h.disconnect(),p=null,l&&cancelAnimationFrame(m)}}var gR=sR;var hR=aR,yR=iR;var Hp=(e,t,n)=>{let r=new Map,o=n!=null?n:{},i=A(E(E({},k0),o.platform),{_c:r});return oR(e,t,A(E({},o),{platform:i}))};var it=b(Z(),1),SR=b(Z(),1),xR=b(Oc(),1);var I4=typeof document!="undefined",A4=function(){},Bp=I4?SR.useLayoutEffect:A4;function Up(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Up(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){let i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Up(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wR(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vR(e,t){let n=wR(e);return Math.round(t*n)/n}function R0(e){let t=it.useRef(e);return Bp(()=>{t.current=e}),t}function bR(e){e===void 0&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,f]=it.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=it.useState(r);Up(d,r)||p(r);let[m,g]=it.useState(null),[v,h]=it.useState(null),y=it.useCallback(N=>{N!==C.current&&(C.current=N,g(N))},[]),S=it.useCallback(N=>{N!==k.current&&(k.current=N,h(N))},[]),x=i||m,T=s||v,C=it.useRef(null),k=it.useRef(null),R=it.useRef(u),F=l!=null,O=R0(l),U=R0(o),J=R0(c),Y=it.useCallback(()=>{if(!C.current||!k.current)return;let N={placement:t,strategy:n,middleware:d};U.current&&(N.platform=U.current),Hp(C.current,k.current,N).then(q=>{let j=A(E({},q),{isPositioned:J.current!==!1});_.current&&!Up(R.current,j)&&(R.current=j,xR.flushSync(()=>{f(j)}))})},[d,t,n,U,J]);Bp(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,f(N=>A(E({},N),{isPositioned:!1})))},[c]);let _=it.useRef(!1);Bp(()=>(_.current=!0,()=>{_.current=!1}),[]),Bp(()=>{if(x&&(C.current=x),T&&(k.current=T),x&&T){if(O.current)return O.current(x,T,Y);Y()}},[x,T,Y,O,F]);let V=it.useMemo(()=>({reference:C,floating:k,setReference:y,setFloating:S}),[y,S]),B=it.useMemo(()=>({reference:x,floating:T}),[x,T]),W=it.useMemo(()=>{let N={position:n,left:0,top:0};if(!B.floating)return N;let q=vR(B.floating,u.x),j=vR(B.floating,u.y);return a?E(A(E({},N),{transform:"translate("+q+"px, "+j+"px)"}),wR(B.floating)>=1.5&&{willChange:"transform"}):{position:n,left:q,top:j}},[n,a,B.floating,u.x,u.y]);return it.useMemo(()=>A(E({},u),{update:Y,refs:V,elements:B,floatingStyles:W}),[u,Y,V,B,W])}var Vp=(e,t)=>{let n=gR(e);return{name:n.name,fn:n.fn,options:[e,t]}},P0=(e,t)=>{let n=hR(e);return{name:n.name,fn:n.fn,options:[e,t]}};var I0=(e,t)=>{let n=yR(e);return{name:n.name,fn:n.fn,options:[e,t]}};function z0(e){let t=D.useRef(void 0),n=D.useCallback(r=>{let o=e.map(i=>{if(i!=null){if(typeof i=="function"){let s=i,a=s(r);return typeof a=="function"?a:()=>{s(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}var _4="data-floating-ui-focusable",A0="active",_0="selected",M4="ArrowLeft",N4="ArrowRight",O4="ArrowUp",L4="ArrowDown";var D4=[M4,N4],F4=[O4,L4],KV=[...D4,...F4];var z4=E({},D),ER=!1,H4=0,CR=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+H4++;function B4(){let[e,t]=D.useState(()=>ER?CR():void 0);return nn(()=>{e==null&&t(CR())},[]),D.useEffect(()=>{ER=!0},[]),e}var U4=z4.useId,H0=U4||B4;function V4(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var W4=D.createContext(null),$4=D.createContext(null),B0=()=>{var e;return((e=D.useContext(W4))==null?void 0:e.id)||null},Kp=()=>D.useContext($4);function Wa(e){return"data-floating-ui-"+e}function xn(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var TR=Wa("safe-polygon");function M0(e,t,n){if(n&&!Fa(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){let r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}function N0(e){return typeof e=="function"?e():e}function zR(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:o,events:i,elements:s}=e,{enabled:a=!0,delay:l=0,handleClose:c=null,mouseOnly:u=!1,restMs:f=0,move:d=!0}=t,p=Kp(),m=B0(),g=fi(c),v=fi(l),h=fi(n),y=fi(f),S=D.useRef(),x=D.useRef(-1),T=D.useRef(),C=D.useRef(-1),k=D.useRef(!0),R=D.useRef(!1),F=D.useRef(()=>{}),O=D.useRef(!1),U=rn(()=>{var W;let N=(W=o.current.openEvent)==null?void 0:W.type;return(N==null?void 0:N.includes("mouse"))&&N!=="mousedown"});D.useEffect(()=>{if(!a)return;function W(N){let{open:q}=N;q||(xn(x),xn(C),k.current=!0,O.current=!1)}return i.on("openchange",W),()=>{i.off("openchange",W)}},[a,i]),D.useEffect(()=>{if(!a||!g.current||!n)return;function W(q){U()&&r(!1,q,"hover")}let N=jt(s.floating).documentElement;return N.addEventListener("mouseleave",W),()=>{N.removeEventListener("mouseleave",W)}},[s.floating,n,r,a,g,U]);let J=D.useCallback(function(W,N,q){N===void 0&&(N=!0),q===void 0&&(q="hover");let j=M0(v.current,"close",S.current);j&&!T.current?(xn(x),x.current=window.setTimeout(()=>r(!1,W,q),j)):N&&(xn(x),r(!1,W,q))},[v,r]),Y=rn(()=>{F.current(),T.current=void 0}),_=rn(()=>{if(R.current){let W=jt(s.floating).body;W.style.pointerEvents="",W.removeAttribute(TR),R.current=!1}}),V=rn(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);D.useEffect(()=>{if(!a)return;function W(ue){if(xn(x),k.current=!1,u&&!Fa(S.current)||N0(y.current)>0&&!M0(v.current,"open"))return;let ne=M0(v.current,"open",S.current);ne?x.current=window.setTimeout(()=>{h.current||r(!0,ue,"hover")},ne):n||r(!0,ue,"hover")}function N(ue){if(V()){_();return}F.current();let ne=jt(s.floating);if(xn(C),O.current=!1,g.current&&o.current.floatingContext){n||xn(x),T.current=g.current(A(E({},o.current.floatingContext),{tree:p,x:ue.clientX,y:ue.clientY,onClose(){_(),Y(),V()||J(ue,!0,"safe-polygon")}}));let Se=T.current;ne.addEventListener("mousemove",Se),F.current=()=>{ne.removeEventListener("mousemove",Se)};return}(S.current!=="touch"||!tn(s.floating,ue.relatedTarget))&&J(ue)}function q(ue){V()||o.current.floatingContext&&(g.current==null||g.current(A(E({},o.current.floatingContext),{tree:p,x:ue.clientX,y:ue.clientY,onClose(){_(),Y(),V()||J(ue)}}))(ue))}function j(){xn(x)}function K(ue){V()||J(ue,!1)}if(Ue(s.domReference)){let ue=s.domReference,ne=s.floating;return n&&ue.addEventListener("mouseleave",q),d&&ue.addEventListener("mousemove",W,{once:!0}),ue.addEventListener("mouseenter",W),ue.addEventListener("mouseleave",N),ne&&(ne.addEventListener("mouseleave",q),ne.addEventListener("mouseenter",j),ne.addEventListener("mouseleave",K)),()=>{n&&ue.removeEventListener("mouseleave",q),d&&ue.removeEventListener("mousemove",W),ue.removeEventListener("mouseenter",W),ue.removeEventListener("mouseleave",N),ne&&(ne.removeEventListener("mouseleave",q),ne.removeEventListener("mouseenter",j),ne.removeEventListener("mouseleave",K))}}},[s,a,e,u,d,J,Y,_,r,n,h,p,v,g,o,V,y]),nn(()=>{var W;if(a&&n&&(W=g.current)!=null&&(W=W.__options)!=null&&W.blockPointerEvents&&U()){R.current=!0;let q=s.floating;if(Ue(s.domReference)&&q){var N;let j=jt(s.floating).body;j.setAttribute(TR,"");let K=s.domReference,ue=p==null||(N=p.nodesRef.current.find(ne=>ne.id===m))==null||(N=N.context)==null?void 0:N.elements.floating;return ue&&(ue.style.pointerEvents=""),j.style.pointerEvents="none",K.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{j.style.pointerEvents="",K.style.pointerEvents="",q.style.pointerEvents=""}}}},[a,n,m,s,p,g,U]),nn(()=>{n||(S.current=void 0,O.current=!1,Y(),_())},[n,Y,_]),D.useEffect(()=>()=>{Y(),xn(x),xn(C),_()},[a,s.domReference,Y,_]);let B=D.useMemo(()=>{function W(N){S.current=N.pointerType}return{onPointerDown:W,onPointerEnter:W,onMouseMove(N){let{nativeEvent:q}=N;function j(){!k.current&&!h.current&&r(!0,q,"hover")}u&&!Fa(S.current)||n||N0(y.current)===0||O.current&&gg(N.movementX,2)+gg(N.movementY,2)<2||(xn(C),S.current==="touch"?j():(O.current=!0,C.current=window.setTimeout(j,N0(y.current))))}}},[u,r,n,h,y]);return D.useMemo(()=>a?{reference:B}:{},[a,B])}var kR=0;function Ua(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(kR);let i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():kR=requestAnimationFrame(i)}function O0(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&as(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function j4(e){return"composedPath"in e?e.composedPath()[0]:e.target}function K4(e){return(e==null?void 0:e.ownerDocument)||document}var Va={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function RR(e){return e==="inert"?Va.inert:e==="aria-hidden"?Va["aria-hidden"]:Va.none}var Wp=new WeakSet,$p={},L0=0,G4=()=>typeof HTMLElement!="undefined"&&"inert"in HTMLElement.prototype;function HR(e){return e?as(e)?e.host:HR(e.parentNode):null}var q4=(e,t)=>t.map(n=>{if(e.contains(n))return n;let r=HR(n);return e.contains(r)?r:null}).filter(n=>n!=null);function Y4(e,t,n,r){let o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,s=q4(t,e),a=new Set,l=new Set(s),c=[];$p[o]||($p[o]=new WeakMap);let u=$p[o];s.forEach(f),d(t),a.clear();function f(p){!p||a.has(p)||(a.add(p),p.parentNode&&f(p.parentNode))}function d(p){!p||l.has(p)||[].forEach.call(p.children,m=>{if(Br(m)!=="script")if(a.has(m))d(m);else{let g=i?m.getAttribute(i):null,v=g!==null&&g!=="false",h=RR(i),y=(h.get(m)||0)+1,S=(u.get(m)||0)+1;h.set(m,y),u.set(m,S),c.push(m),y===1&&v&&Wp.add(m),S===1&&m.setAttribute(o,""),!v&&i&&m.setAttribute(i,i==="inert"?"":"true")}})}return L0++,()=>{c.forEach(p=>{let m=RR(i),v=(m.get(p)||0)-1,h=(u.get(p)||0)-1;m.set(p,v),u.set(p,h),v||(!Wp.has(p)&&i&&p.removeAttribute(i),Wp.delete(p)),h||p.removeAttribute(o)}),L0--,L0||(Va.inert=new WeakMap,Va["aria-hidden"]=new WeakMap,Va.none=new WeakMap,Wp=new WeakSet,$p={})}}function PR(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=K4(e[0]).body;return Y4(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}var U0={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},jp=D.forwardRef(function(t,n){let[r,o]=D.useState();nn(()=>{Yk()&&o("button")},[]);let i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Wa("focus-guard")]:"",style:U0};return(0,wn.jsx)("span",E(E({},t),i))}),X4={clipPath:"inset(50%)",position:"fixed",top:0,left:0},BR=D.createContext(null),IR=Wa("portal");function Q4(e){e===void 0&&(e={});let{id:t,root:n}=e,r=H0(),o=VR(),[i,s]=D.useState(null),a=D.useRef(null);return nn(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{a.current=null})},[i]),nn(()=>{if(!r||a.current)return;let l=t?document.getElementById(t):null;if(!l)return;let c=document.createElement("div");c.id=r,c.setAttribute(IR,""),l.appendChild(c),a.current=c,s(c)},[t,r]),nn(()=>{if(n===null||!r||a.current)return;let l=n||(o==null?void 0:o.portalNode);l&&!kp(l)&&(l=l.current),l=l||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,l.appendChild(c));let u=document.createElement("div");u.id=r,u.setAttribute(IR,""),l=c||l,l.appendChild(u),a.current=u,s(u)},[t,n,r,o]),i}function UR(e){let{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=Q4({id:n,root:r}),[s,a]=D.useState(null),l=D.useRef(null),c=D.useRef(null),u=D.useRef(null),f=D.useRef(null),d=s==null?void 0:s.modal,p=s==null?void 0:s.open,m=!!s&&!s.modal&&s.open&&o&&!!(r||i);return D.useEffect(()=>{if(!i||!o||d)return;function g(v){i&&Ha(v)&&(v.type==="focusin"?E0:tR)(i)}return i.addEventListener("focusin",g,!0),i.addEventListener("focusout",g,!0),()=>{i.removeEventListener("focusin",g,!0),i.removeEventListener("focusout",g,!0)}},[i,o,d]),D.useEffect(()=>{i&&(p||E0(i))},[p,i]),(0,wn.jsxs)(BR.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:l,afterOutsideRef:c,beforeInsideRef:u,afterInsideRef:f,portalNode:i,setFocusManagerState:a}),[o,i]),children:[m&&i&&(0,wn.jsx)(jp,{"data-type":"outside",ref:l,onFocus:g=>{if(Ha(g,i)){var v;(v=u.current)==null||v.focus()}else{let h=s?s.domReference:null,y=b0(h);y==null||y.focus()}}}),m&&i&&(0,wn.jsx)("span",{"aria-owns":i.id,style:X4}),i&&F0.createPortal(t,i),m&&i&&(0,wn.jsx)(jp,{"data-type":"outside",ref:c,onFocus:g=>{if(Ha(g,i)){var v;(v=f.current)==null||v.focus()}else{let h=s?s.domReference:null,y=w0(h);y==null||y.focus(),s!=null&&s.closeOnFocusOut&&(s==null||s.onOpenChange(!1,g.nativeEvent,"focus-out"))}}})]})}var VR=()=>D.useContext(BR);function AR(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}var _R=20,pi=[];function V0(){pi=pi.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function Z4(e){V0(),e&&Br(e)!=="body"&&(pi.push(new WeakRef(e)),pi.length>_R&&(pi=pi.slice(-_R)))}function MR(){V0();let e=pi[pi.length-1];return e==null?void 0:e.deref()}function J4(e){let t=za();return g0(e,t)?e:La(e,t)[0]||e}function NR(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;let r=za(),i=jk(e,r).filter(a=>{let l=a.getAttribute("data-tabindex")||"";return g0(a,r)||a.hasAttribute("data-tabindex")&&!l.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}var eF=D.forwardRef(function(t,n){return(0,wn.jsx)("button",A(E({},t),{type:"button",ref:n,tabIndex:-1,style:U0}))});function WR(e){let{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:s=0,returnFocus:a=!0,restoreFocus:l=!1,modal:c=!0,visuallyHiddenDismiss:u=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:g,events:v,dataRef:h,elements:{domReference:y,floating:S}}=t,x=rn(()=>{var oe;return(oe=h.current.floatingContext)==null?void 0:oe.nodeId}),T=rn(p),C=typeof s=="number"&&s<0,k=S0(y)&&C,R=G4(),F=R?i:!0,O=!F||R&&d,U=fi(o),J=fi(s),Y=fi(a),_=Kp(),V=VR(),B=D.useRef(null),W=D.useRef(null),N=D.useRef(!1),q=D.useRef(!1),j=D.useRef(-1),K=D.useRef(-1),ue=V!=null,ne=Lp(S),Qe=rn(function(oe){return oe===void 0&&(oe=ne),oe?La(oe,za()):[]}),Se=rn(oe=>{let re=Qe(oe);return U.current.map(me=>y&&me==="reference"?y:ne&&me==="floating"?ne:re).filter(Boolean).flat()});D.useEffect(()=>{if(r||!c)return;function oe(me){if(me.key==="Tab"){tn(ne,us(jt(ne)))&&Qe().length===0&&!k&&Dp(me);let fe=Se(),$e=wo(me);U.current[0]==="reference"&&$e===y&&(Dp(me),me.shiftKey?Ua(fe[fe.length-1]):Ua(fe[1])),U.current[1]==="floating"&&$e===ne&&me.shiftKey&&(Dp(me),Ua(fe[0]))}}let re=jt(ne);return re.addEventListener("keydown",oe),()=>{re.removeEventListener("keydown",oe)}},[r,y,ne,c,U,k,Qe,Se]),D.useEffect(()=>{if(r||!S)return;function oe(re){let me=wo(re),$e=Qe().indexOf(me);$e!==-1&&(j.current=$e)}return S.addEventListener("focusin",oe),()=>{S.removeEventListener("focusin",oe)}},[r,S,Qe]),D.useEffect(()=>{if(r||!f)return;function oe(){q.current=!0,setTimeout(()=>{q.current=!1})}function re($e){let Te=$e.relatedTarget,mt=$e.currentTarget,Kt=wo($e);queueMicrotask(()=>{let Et=x(),xr=!(tn(y,Te)||tn(S,Te)||tn(Te,S)||tn(V==null?void 0:V.portalNode,Te)||Te!=null&&Te.hasAttribute(Wa("focus-guard"))||_&&(ds(_.nodesRef.current,Et).find(Jn=>{var gt,Ct;return tn((gt=Jn.context)==null?void 0:gt.elements.floating,Te)||tn((Ct=Jn.context)==null?void 0:Ct.elements.domReference,Te)})||x0(_.nodesRef.current,Et).find(Jn=>{var gt,Ct,wr;return[(gt=Jn.context)==null?void 0:gt.elements.floating,Lp((Ct=Jn.context)==null?void 0:Ct.elements.floating)].includes(Te)||((wr=Jn.context)==null?void 0:wr.elements.domReference)===Te})));if(mt===y&&ne&&NR(ne,U),l&&mt!==y&&!(Kt!=null&&Kt.isConnected)&&us(jt(ne))===jt(ne).body){ot(ne)&&ne.focus();let Jn=j.current,gt=Qe(),Ct=gt[Jn]||gt[gt.length-1]||ne;ot(Ct)&&Ct.focus()}if(h.current.insideReactTree){h.current.insideReactTree=!1;return}(k||!c)&&Te&&xr&&!q.current&&Te!==MR()&&(N.current=!0,g(!1,$e,"focus-out"))})}let me=!!(!_&&V);function fe(){xn(K),h.current.insideReactTree=!0,K.current=window.setTimeout(()=>{h.current.insideReactTree=!1})}if(S&&ot(y))return y.addEventListener("focusout",re),y.addEventListener("pointerdown",oe),S.addEventListener("focusout",re),me&&S.addEventListener("focusout",fe,!0),()=>{y.removeEventListener("focusout",re),y.removeEventListener("pointerdown",oe),S.removeEventListener("focusout",re),me&&S.removeEventListener("focusout",fe,!0)}},[r,y,S,ne,c,_,V,g,f,l,Qe,k,x,U,h]);let tt=D.useRef(null),pt=D.useRef(null),Le=AR([tt,V==null?void 0:V.beforeInsideRef]),Ne=AR([pt,V==null?void 0:V.afterInsideRef]);D.useEffect(()=>{var oe,re;if(r||!S)return;let me=Array.from((V==null||(oe=V.portalNode)==null?void 0:oe.querySelectorAll("["+Wa("portal")+"]"))||[]),$e=(re=(_?x0(_.nodesRef.current,x()):[]).find(Kt=>{var Et;return S0(((Et=Kt.context)==null?void 0:Et.elements.domReference)||null)}))==null||(re=re.context)==null?void 0:re.elements.domReference,Te=[S,$e,...me,...T(),B.current,W.current,tt.current,pt.current,V==null?void 0:V.beforeOutsideRef.current,V==null?void 0:V.afterOutsideRef.current,U.current.includes("reference")||k?y:null].filter(Kt=>Kt!=null),mt=c||k?PR(Te,!O,O):PR(Te);return()=>{mt()}},[r,y,S,c,U,V,k,F,O,_,x,T]),nn(()=>{if(r||!ot(ne))return;let oe=jt(ne),re=us(oe);queueMicrotask(()=>{let me=Se(ne),fe=J.current,$e=(typeof fe=="number"?me[fe]:fe.current)||ne,Te=tn(ne,re);!C&&!Te&&m&&Ua($e,{preventScroll:$e===ne})})},[r,m,ne,C,Se,J]),nn(()=>{if(r||!ne)return;let oe=jt(ne),re=us(oe);Z4(re);function me(Te){let{reason:mt,event:Kt,nested:Et}=Te;if(["hover","safe-polygon"].includes(mt)&&Kt.type==="mouseleave"&&(N.current=!0),mt==="outside-press")if(Et)N.current=!1;else if(Zk(Kt)||Jk(Kt))N.current=!1;else{let xr=!1;document.createElement("div").focus({get preventScroll(){return xr=!0,!1}}),xr?N.current=!1:N.current=!0}}v.on("openchange",me);let fe=oe.createElement("span");fe.setAttribute("tabindex","-1"),fe.setAttribute("aria-hidden","true"),Object.assign(fe.style,U0),ue&&y&&y.insertAdjacentElement("afterend",fe);function $e(){if(typeof Y.current=="boolean"){let Te=y||MR();return Te&&Te.isConnected?Te:fe}return Y.current.current||fe}return()=>{v.off("openchange",me);let Te=us(oe),mt=tn(S,Te)||_&&ds(_.nodesRef.current,x(),!1).some(Et=>{var xr;return tn((xr=Et.context)==null?void 0:xr.elements.floating,Te)}),Kt=$e();queueMicrotask(()=>{let Et=J4(Kt);Y.current&&!N.current&&ot(Et)&&(!(Et!==Te&&Te!==oe.body)||mt)&&Et.focus({preventScroll:!0}),fe.remove()})}},[r,S,ne,Y,h,v,_,ue,y,x]),D.useEffect(()=>(queueMicrotask(()=>{N.current=!1}),()=>{queueMicrotask(V0)}),[r]),nn(()=>{if(!r&&V)return V.setFocusManagerState({modal:c,closeOnFocusOut:f,open:m,onOpenChange:g,domReference:y}),()=>{V.setFocusManagerState(null)}},[r,V,c,m,g,f,y]),nn(()=>{r||ne&&NR(ne,U)},[r,ne,U]);function at(oe){return r||!u||!c?null:(0,wn.jsx)(eF,{ref:oe==="start"?B:W,onClick:re=>g(!1,re.nativeEvent),children:typeof u=="string"?u:"Dismiss"})}let ye=!r&&F&&(c?!k:!0)&&(ue||c);return(0,wn.jsxs)(wn.Fragment,{children:[ye&&(0,wn.jsx)(jp,{"data-type":"inside",ref:Le,onFocus:oe=>{if(c){let me=Se();Ua(o[0]==="reference"?me[0]:me[me.length-1])}else if(V!=null&&V.preserveTabOrder&&V.portalNode)if(N.current=!1,Ha(oe,V.portalNode)){let me=w0(y);me==null||me.focus()}else{var re;(re=V.beforeOutsideRef.current)==null||re.focus()}}}),!k&&at("start"),n,at("end"),ye&&(0,wn.jsx)(jp,{"data-type":"inside",ref:Ne,onFocus:oe=>{if(c)Ua(Se()[0]);else if(V!=null&&V.preserveTabOrder&&V.portalNode)if(f&&(N.current=!0),Ha(oe,V.portalNode)){let me=b0(y);me==null||me.focus()}else{var re;(re=V.afterOutsideRef.current)==null||re.focus()}}})]})}function OR(e){return ot(e.target)&&e.target.tagName==="BUTTON"}function tF(e){return ot(e.target)&&e.target.tagName==="A"}function LR(e){return v0(e)}function $R(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:s=!0,event:a="click",toggle:l=!0,ignoreMouse:c=!1,keyboardHandlers:u=!0,stickIfOpen:f=!0}=t,d=D.useRef(),p=D.useRef(!1),m=D.useMemo(()=>({onPointerDown(g){d.current=g.pointerType},onMouseDown(g){let v=d.current;g.button===0&&a!=="click"&&(Fa(v,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="mousedown")?r(!1,g.nativeEvent,"click"):(g.preventDefault(),r(!0,g.nativeEvent,"click"))))},onClick(g){let v=d.current;if(a==="mousedown"&&d.current){d.current=void 0;return}Fa(v,!0)&&c||(n&&l&&(!(o.current.openEvent&&f)||o.current.openEvent.type==="click")?r(!1,g.nativeEvent,"click"):r(!0,g.nativeEvent,"click"))},onKeyDown(g){d.current=void 0,!(g.defaultPrevented||!u||OR(g))&&(g.key===" "&&!LR(i)&&(g.preventDefault(),p.current=!0),!tF(g)&&g.key==="Enter"&&r(!(n&&l),g.nativeEvent,"click"))},onKeyUp(g){g.defaultPrevented||!u||OR(g)||LR(i)||g.key===" "&&p.current&&(p.current=!1,r(!(n&&l),g.nativeEvent,"click"))}}),[o,i,a,c,u,r,n,f,l]);return D.useMemo(()=>s?{reference:m}:{},[s,m])}var nF={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rF={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},DR=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function jR(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:l=!0,outsidePressEvent:c="pointerdown",referencePress:u=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:m}=t,g=Kp(),v=rn(typeof l=="function"?l:()=>!1),h=typeof l=="function"?v:l,y=D.useRef(!1),{escapeKey:S,outsidePress:x}=DR(p),{escapeKey:T,outsidePress:C}=DR(m),k=D.useRef(!1),R=rn(_=>{var V;if(!n||!s||!a||_.key!=="Escape"||k.current)return;let B=(V=i.current.floatingContext)==null?void 0:V.nodeId,W=g?ds(g.nodesRef.current,B):[];if(!S&&(_.stopPropagation(),W.length>0)){let N=!0;if(W.forEach(q=>{var j;if((j=q.context)!=null&&j.open&&!q.context.dataRef.current.__escapeKeyBubbles){N=!1;return}}),!N)return}r(!1,Qk(_)?_.nativeEvent:_,"escape-key")}),F=rn(_=>{var V;let B=()=>{var W;R(_),(W=wo(_))==null||W.removeEventListener("keydown",B)};(V=wo(_))==null||V.addEventListener("keydown",B)}),O=rn(_=>{var V;let B=i.current.insideReactTree;i.current.insideReactTree=!1;let W=y.current;if(y.current=!1,c==="click"&&W||B||typeof h=="function"&&!h(_))return;let N=wo(_),q="["+Wa("inert")+"]",j=jt(o.floating).querySelectorAll(q),K=Ue(N)?N:null;for(;K&&!Vr(K);){let Se=Hr(K);if(Vr(Se)||!Ue(Se))break;K=Se}if(j.length&&Ue(N)&&!Xk(N)&&!tn(N,o.floating)&&Array.from(j).every(Se=>!tn(K,Se)))return;if(ot(N)&&Y){let Se=Vr(N),tt=Dn(N),pt=/auto|scroll/,Le=Se||pt.test(tt.overflowX),Ne=Se||pt.test(tt.overflowY),at=Le&&N.clientWidth>0&&N.scrollWidth>N.clientWidth,ye=Ne&&N.clientHeight>0&&N.scrollHeight>N.clientHeight,oe=tt.direction==="rtl",re=ye&&(oe?_.offsetX<=N.offsetWidth-N.clientWidth:_.offsetX>N.clientWidth),me=at&&_.offsetY>N.clientHeight;if(re||me)return}let ue=(V=i.current.floatingContext)==null?void 0:V.nodeId,ne=g&&ds(g.nodesRef.current,ue).some(Se=>{var tt;return Op(_,(tt=Se.context)==null?void 0:tt.elements.floating)});if(Op(_,o.floating)||Op(_,o.domReference)||ne)return;let Qe=g?ds(g.nodesRef.current,ue):[];if(Qe.length>0){let Se=!0;if(Qe.forEach(tt=>{var pt;if((pt=tt.context)!=null&&pt.open&&!tt.context.dataRef.current.__outsidePressBubbles){Se=!1;return}}),!Se)return}r(!1,_,"outside-press")}),U=rn(_=>{var V;let B=()=>{var W;O(_),(W=wo(_))==null||W.removeEventListener(c,B)};(V=wo(_))==null||V.addEventListener(c,B)});D.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=S,i.current.__outsidePressBubbles=x;let _=-1;function V(j){r(!1,j,"ancestor-scroll")}function B(){window.clearTimeout(_),k.current=!0}function W(){_=window.setTimeout(()=>{k.current=!1},Ma()?5:0)}let N=jt(o.floating);a&&(N.addEventListener("keydown",T?F:R,T),N.addEventListener("compositionstart",B),N.addEventListener("compositionend",W)),h&&N.addEventListener(c,C?U:O,C);let q=[];return d&&(Ue(o.domReference)&&(q=Ln(o.domReference)),Ue(o.floating)&&(q=q.concat(Ln(o.floating))),!Ue(o.reference)&&o.reference&&o.reference.contextElement&&(q=q.concat(Ln(o.reference.contextElement)))),q=q.filter(j=>{var K;return j!==((K=N.defaultView)==null?void 0:K.visualViewport)}),q.forEach(j=>{j.addEventListener("scroll",V)}),()=>{a&&(N.removeEventListener("keydown",T?F:R,T),N.removeEventListener("compositionstart",B),N.removeEventListener("compositionend",W)),h&&N.removeEventListener(c,C?U:O,C),q.forEach(j=>{j.removeEventListener("scroll",V)}),window.clearTimeout(_)}},[i,o,a,h,c,n,r,d,s,S,x,R,T,F,O,C,U]),D.useEffect(()=>{i.current.insideReactTree=!1},[i,h,c]);let J=D.useMemo(()=>E({onKeyDown:R},u&&E({[nF[f]]:_=>{r(!1,_.nativeEvent,"reference-press")}},f!=="click"&&{onClick(_){r(!1,_.nativeEvent,"reference-press")}})),[R,r,u,f]),Y=D.useMemo(()=>{function _(V){V.button===0&&(y.current=!0)}return{onKeyDown:R,onMouseDown:_,onMouseUp:_,[rF[c]]:()=>{i.current.insideReactTree=!0}}},[R,c,i]);return D.useMemo(()=>s?{reference:J,floating:Y}:{},[s,J,Y])}function oF(e){let{open:t=!1,onOpenChange:n,elements:r}=e,o=H0(),i=D.useRef({}),[s]=D.useState(()=>V4()),a=B0()!=null,[l,c]=D.useState(r.reference),u=rn((p,m,g)=>{i.current.openEvent=p?m:void 0,s.emit("openchange",{open:p,event:m,reason:g,nested:a}),n==null||n(p,m,g)}),f=D.useMemo(()=>({setPositionReference:c}),[]),d=D.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return D.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:o,refs:f}),[t,u,d,s,o,f])}function KR(e){var t,n;let k=e===void 0?{}:e,{elements:r}=k,o=ie(k,["elements"]),{nodeId:i}=o,s=oF(A(E({},o),{elements:{reference:(t=r==null?void 0:r.reference)!=null?t:null,floating:(n=r==null?void 0:r.floating)!=null?n:null}})),a=o.rootContext||s,l=a.elements,[c,u]=D.useState(null),[f,d]=D.useState(null),m=(l==null?void 0:l.domReference)||c,g=D.useRef(null),v=Kp();nn(()=>{m&&(g.current=m)},[m]);let h=bR(A(E({},o),{elements:E(E({},l),f&&{reference:f})})),y=D.useCallback(R=>{let F=Ue(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;d(F),h.refs.setReference(F)},[h.refs]),S=D.useCallback(R=>{(Ue(R)||R===null)&&(g.current=R,u(R)),(Ue(h.refs.reference.current)||h.refs.reference.current===null||R!==null&&!Ue(R))&&h.refs.setReference(R)},[h.refs]),x=D.useMemo(()=>A(E({},h.refs),{setReference:S,setPositionReference:y,domReference:g}),[h.refs,S,y]),T=D.useMemo(()=>A(E({},h.elements),{domReference:m}),[h.elements,m]),C=D.useMemo(()=>A(E(E({},h),a),{refs:x,elements:T,nodeId:i}),[h,x,T,i,a]);return nn(()=>{a.dataRef.current.floatingContext=C;let R=v==null?void 0:v.nodesRef.current.find(F=>F.id===i);R&&(R.context=C)}),D.useMemo(()=>A(E({},h),{context:C,refs:x,elements:T}),[h,x,T,C])}function D0(e,t,n){let r=new Map,o=n==="item",i=e;if(o&&e){let s=e,{[A0]:a,[_0]:l}=s;i=ie(s,[hg(A0),hg(_0)])}return E(E(E({},n==="floating"&&{tabIndex:-1,[_4]:""}),i),t.map(a=>{let l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(c=>{let[u,f]=c;if(!(o&&[A0,_0].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof f=="function"){var d;(d=r.get(u))==null||d.push(f),a[u]=function(){for(var p,m=arguments.length,g=new Array(m),v=0;v<m;v++)g[v]=arguments[v];return(p=r.get(u))==null?void 0:p.map(h=>h(...g)).find(h=>h!==void 0)}}}else a[u]=f}),a),{}))}function GR(e){e===void 0&&(e=[]);let t=e.map(a=>a==null?void 0:a.reference),n=e.map(a=>a==null?void 0:a.floating),r=e.map(a=>a==null?void 0:a.item),o=D.useCallback(a=>D0(a,e,"reference"),t),i=D.useCallback(a=>D0(a,e,"floating"),n),s=D.useCallback(a=>D0(a,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:s}),[o,i,s])}var iF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function qR(e,t){var n,r;t===void 0&&(t={});let{open:o,elements:i,floatingId:s}=e,{enabled:a=!0,role:l="dialog"}=t,c=H0(),u=((n=i.domReference)==null?void 0:n.id)||c,f=D.useMemo(()=>{var y;return((y=Lp(i.floating))==null?void 0:y.id)||s},[i.floating,s]),d=(r=iF.get(l))!=null?r:l,m=B0()!=null,g=D.useMemo(()=>d==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:o?f:void 0}:E(E(E(E(E({"aria-expanded":o?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":o?f:void 0},d==="listbox"&&{role:"combobox"}),d==="menu"&&{id:u}),d==="menu"&&m&&{role:"menuitem"}),l==="select"&&{"aria-autocomplete":"none"}),l==="combobox"&&{"aria-autocomplete":"list"}),[d,f,m,o,u,l]),v=D.useMemo(()=>{let y=E({id:f},d&&{role:d});return d==="tooltip"||l==="label"?y:E(E({},y),d==="menu"&&{"aria-labelledby":u})},[d,f,u,l]),h=D.useCallback(y=>{let{active:S,selected:x}=y,T=E({role:"option"},S&&{id:f+"-fui-option"});switch(l){case"select":case"combobox":return A(E({},T),{"aria-selected":x})}return{}},[f,l]);return D.useMemo(()=>a?{reference:g,floating:v,item:h}:{},[a,g,v,h])}function YR(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var i;return o.parentId===t&&(!n||((i=o.context)==null?void 0:i.open))}).flatMap(o=>[o,...YR(e,o.id,n)])}function FR(e,t){let[n,r]=e,o=!1,i=t.length;for(let s=0,a=i-1;s<i;a=s++){let[l,c]=t[s]||[0,0],[u,f]=t[a]||[0,0];c>=r!=f>=r&&n<=(u-l)*(r-c)/(f-c)+l&&(o=!o)}return o}function sF(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function XR(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1},i=!1,s=null,a=null,l=typeof performance!="undefined"?performance.now():0;function c(f,d){let p=performance.now(),m=p-l;if(s===null||a===null||m===0)return s=f,a=d,l=p,null;let g=f-s,v=d-a,y=Math.sqrt(g*g+v*v)/m;return s=f,a=d,l=p,y}let u=f=>{let{x:d,y:p,placement:m,elements:g,onClose:v,nodeId:h,tree:y}=f;return function(x){function T(){xn(o),v()}if(xn(o),!g.domReference||!g.floating||m==null||d==null||p==null)return;let{clientX:C,clientY:k}=x,R=[C,k],F=j4(x),O=x.type==="mouseleave",U=O0(g.floating,F),J=O0(g.domReference,F),Y=g.domReference.getBoundingClientRect(),_=g.floating.getBoundingClientRect(),V=m.split("-")[0],B=d>_.right-_.width/2,W=p>_.bottom-_.height/2,N=sF(R,Y),q=_.width>Y.width,j=_.height>Y.height,K=(q?Y:_).left,ue=(q?Y:_).right,ne=(j?Y:_).top,Qe=(j?Y:_).bottom;if(U&&(i=!0,!O))return;if(J&&(i=!1),J&&!O){i=!0;return}if(O&&Ue(x.relatedTarget)&&O0(g.floating,x.relatedTarget)||y&&YR(y.nodesRef.current,h).length)return;if(V==="top"&&p>=Y.bottom-1||V==="bottom"&&p<=Y.top+1||V==="left"&&d>=Y.right-1||V==="right"&&d<=Y.left+1)return T();let Se=[];switch(V){case"top":Se=[[K,Y.top+1],[K,_.bottom-1],[ue,_.bottom-1],[ue,Y.top+1]];break;case"bottom":Se=[[K,_.top+1],[K,Y.bottom-1],[ue,Y.bottom-1],[ue,_.top+1]];break;case"left":Se=[[_.right-1,Qe],[_.right-1,ne],[Y.left+1,ne],[Y.left+1,Qe]];break;case"right":Se=[[Y.right-1,Qe],[Y.right-1,ne],[_.left+1,ne],[_.left+1,Qe]];break}function tt(pt){let[Le,Ne]=pt;switch(V){case"top":{let at=[q?Le+t/2:B?Le+t*4:Le-t*4,Ne+t+1],ye=[q?Le-t/2:B?Le+t*4:Le-t*4,Ne+t+1],oe=[[_.left,B||q?_.bottom-t:_.top],[_.right,B?q?_.bottom-t:_.top:_.bottom-t]];return[at,ye,...oe]}case"bottom":{let at=[q?Le+t/2:B?Le+t*4:Le-t*4,Ne-t],ye=[q?Le-t/2:B?Le+t*4:Le-t*4,Ne-t],oe=[[_.left,B||q?_.top+t:_.bottom],[_.right,B?q?_.top+t:_.bottom:_.top+t]];return[at,ye,...oe]}case"left":{let at=[Le+t+1,j?Ne+t/2:W?Ne+t*4:Ne-t*4],ye=[Le+t+1,j?Ne-t/2:W?Ne+t*4:Ne-t*4];return[...[[W||j?_.right-t:_.left,_.top],[W?j?_.right-t:_.left:_.right-t,_.bottom]],at,ye]}case"right":{let at=[Le-t,j?Ne+t/2:W?Ne+t*4:Ne-t*4],ye=[Le-t,j?Ne-t/2:W?Ne+t*4:Ne-t*4],oe=[[W||j?_.left+t:_.right,_.top],[W?j?_.left+t:_.right:_.left+t,_.bottom]];return[at,ye,...oe]}}}if(!FR([C,k],Se)){if(i&&!N)return T();if(!O&&r){let pt=c(x.clientX,x.clientY);if(pt!==null&&pt<.1)return T()}FR([C,k],tt([d,p]))?!i&&r&&(o.current=window.setTimeout(T,40)):T()}}};return u.__options={blockPointerEvents:n},u}var Gp={tooltip:"dd-XpCXd",tooltipTrigger:"dd-8TKeF",arrow:"dd-ZEu2Y"};var Xn=b(I());function aF({initialOpen:e=!1,placement:t="bottom",modal:n,tooltip:r,open:o,onOpenChange:i}={}){let[s,a]=$r.useState(e),l=o!=null?o:s,c=i!=null?i:a,u=KR({placement:t,open:l,onOpenChange:c,whileElementsMounted:zp,middleware:[Vp(5),I0({crossAxis:t.includes("-"),fallbackAxisSideDirection:"end",padding:5}),P0({padding:10})]}),f=u.context,d=$R(f,{enabled:o==null}),p=jR(f),m=qR(f),g=zR(f,{enabled:r!=null?r:!1,handleClose:XR()}),v=GR([d,p,m,g]);return $r.useMemo(()=>A(E(E({open:l,setOpen:c},v),u),{modal:n}),[l,c,v,u,n])}var QR=$r.createContext(null),W0=()=>{let e=$r.useContext(QR);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e},ps=r=>{var o=r,{children:e,modal:t=!1}=o,n=ie(o,["children","modal"]);let i=aF(E({modal:t},n));return(0,Xn.jsx)(QR.Provider,{value:i,children:e})};function lF(r){var o=r,{as:e,children:t}=o,n=ie(o,["as","children"]);let i=W0(),s=e||"button",a=t.ref,l=z0([i.refs.setReference,a]);return(0,Xn.jsx)(s,A(E({ref:l,type:"button"},i.getReferenceProps(n)),{children:t}))}var cF=$r.forwardRef(function(o,r){var i=o,{style:t}=i,n=ie(i,["style"]);let c=W0(),{context:s}=c,a=ie(c,["context"]),l=z0([a.refs.setFloating,r]);return s.open?(0,Xn.jsx)(UR,{children:(0,Xn.jsx)(WR,{context:s,modal:a.modal,disabled:n.disableFocusManager,children:(0,Xn.jsx)("div",A(E({ref:l,style:E(A(E({},a.floatingStyles),{zIndex:1e7}),t)},a.getFloatingProps(n)),{children:n.children}))})}):null});function uF(o){var i=o,{as:e,children:t,onClick:n}=i,r=ie(i,["as","children","onClick"]);let{setOpen:s}=W0();return(0,Xn.jsx)(e||"button",A(E({type:"button",onClick:c=>{n(c),s(!1),c.stopPropagation()}},r),{children:t}))}function ZR({trigger:e,children:t,placement:n="top"}){return(0,Xn.jsxs)(ps,{tooltip:!0,placement:n,children:[(0,Xn.jsxs)(ps.Content,{className:Gp.tooltip,children:[t,(0,Xn.jsx)("div",{className:Gp.arrow})]}),(0,Xn.jsx)(ps.Trigger,{className:Gp.tooltipTrigger,children:e})]})}ps.Trigger=lF;ps.Content=cF;ps.Button=uF;var wt=ps;var eP=b(Z());var JR={error:"dd-CoAuB"};var $0={};ht($0,{enUS:()=>dF,nlNL:()=>fF});var dF={errorPrefix:[{type:0,value:"Error:"}]},fF={errorPrefix:[{type:0,value:"Foutmelding:"}]};var Wc=b(I()),tP=({message:e})=>{let t=(0,eP.useRef)(null),n=z("WidgetCardError",JR),r=se($0);return Vu(t),(0,Wc.jsx)(pe,{ref:t,children:(0,Wc.jsx)(we,{children:(0,Wc.jsxs)(we.Content,{className:n.error,children:[r("errorPrefix")," ",e]})})})};var ve=b(I()),pF=3,mF=({sources:e,onClick:t})=>{let n=se(_a),r=z("WidgetKnowledgeAssistant",Cp),[o,i]=(0,et.useState)(!1),s=o?e:e.slice(0,pF);return s.length===0?null:(0,ve.jsxs)("ul",{className:r.sources,children:[s.map(a=>(0,ve.jsx)("li",{className:r.source,"data-testid":"knowledge-assist-source",children:(0,ve.jsxs)(wt,{tooltip:!0,placement:"top-start",children:[(0,ve.jsx)(wt.Trigger,{as:"a",rel:"noreferrer",target:"_blank",href:a.url,onClick:l=>{l.stopPropagation(),t(a)},children:(0,ve.jsx)("span",{className:r.linkContent,children:a.name})}),a.url&&(0,ve.jsx)(wt.Content,{className:r.tooltip,children:decodeURIComponent(a.url)})]})},a.name)),s<e&&(0,ve.jsx)("button",{type:"button",className:r.showMoreSources,onClick:()=>i(!0),children:n("showMore",{amount:e.length-s.length})})]})},gF=({title:e,description:t})=>(0,ve.jsx)(pe,{"data-testid":"knowledge-assist-empty-state",children:(0,ve.jsx)(we,{children:(0,ve.jsxs)(we.Content,{children:[(0,ve.jsx)(we.Title,{children:e}),(0,ve.jsx)(is,{content:t})]})})}),hF=({innerRef:e,item:t,hasKeyboardInput:n,onCopy:r,onUse:o,onSourceClick:i})=>{var l;let s=se(_a),a=(0,et.useContext)(qp);return(0,ve.jsxs)(pe,{"data-testid":"knowledge-assist-answer",ref:e,children:[(0,ve.jsx)(we,{children:(0,ve.jsxs)(we.Content,{children:[(0,ve.jsx)(we.Title,{children:t.question}),(0,ve.jsx)(is,{content:t.answer.answer,useLabel:s("useCue"),copyLabel:s("copyCue"),onCopy:r,onUse:n?o:void 0}),(0,ve.jsx)(mF,{sources:(l=t.answer.sources)!=null?l:[],onClick:i})]})}),a.assistantCode&&(0,ve.jsxs)(pe.ButtonsContainer,{children:[(0,ve.jsx)("div",{}),(0,ve.jsx)(Qd,{evaluationId:t.evaluationId,feedbackType:"assistant",assistantCode:a.assistantCode,assistantOutput:t.answer.answer,feedbackText:t.answer.answer})]})]})},qp=(0,et.createContext)(null),Yp=({assistantCode:e,evaluateKnowledgeAssistFn:t,initialQuestion:n,children:r})=>{let[o,i]=(0,et.useState)(null),[s,a]=(0,et.useState)(!1),[l,c]=(0,et.useState)(null),[u,f]=(0,et.useState)(!!n),[d,p]=(0,et.useState)(null),m=Ee(),g=Ze(),v=Ad(S=>{if(!e)throw new Error("No knowledge assistant was defined");return c(null),t({assistantCode:e,input:S,threadId:o,onNewThreadId(x){i(x)}})},{onSuccess(S){var x;g("Assistant response displayed",{evaluationId:S.evaluationId,assistantCode:e,assistantOutput:S.answer.answer,input:S.question,sources:(x=S.answer.sources)!=null?x:[]}),f(!1)},onError(S){var x;c((x=S.message)!=null?x:"Unknown error")}}),h=S=>M(null,null,function*(){a(!0),p(S),yield v.call(S),a(!1),p(null)}),y={isEnabled:!!e,assistantCode:e,isSubmitting:s,threadId:o,pendingInput:d,errorMessage:l,onSubmit:h,onReset(){o&&m(kE(o)),c(null),i(null),e&&g("Assistant thread reset",{threadId:o!=null?o:void 0,assistantCode:e})}};return(0,et.useEffect)(()=>{n&&y.isEnabled&&h(n)},[n]),(0,ve.jsx)(qp.Provider,{value:y,children:r})},Xp=()=>{let e=se(_a),t=z("WidgetKnowledgeAssistant",Cp),n=(0,et.useContext)(qp),r=(0,et.useRef)(null),[o,i]=(0,et.useState)(""),s=l=>{i(l.target.value)},a=l=>{l.preventDefault(),n.onSubmit(o).then(()=>{var c;r.current&&((c=r.current)==null||c.focus(),i(""))})};return n.isEnabled?(0,ve.jsxs)("form",{className:t.form,onSubmit:a,children:[(0,ve.jsx)("input",{ref:r,className:t.formInput,placeholder:e("inputPlaceholder"),type:"text",disabled:n.isSubmitting,value:o,onChange:s}),(0,ve.jsx)("button",{type:"submit",disabled:n.isSubmitting||o==="",className:t.formSubmit,children:e("submitLabel")})]}):null},Qp=({title:e,emptyState:t})=>{var m,g;let n=se(_a),r=Ze(),o=z("WidgetKnowledgeAssistant",Cp),i=(0,et.useRef)(null),s=(0,et.useContext)(qp),a=(g=G(EE((m=s.threadId)!=null?m:-1)))!=null?g:[],l=X("hasKeyboardInput"),c=pn(),u=(v,h)=>{Ar(v),s.assistantCode&&r("Assistant response copied",{assistantCode:s.assistantCode,assistantOutput:v,copiedText:v,evaluationId:h.evaluationId})},f=(v,h)=>{s.assistantCode&&r("Assistant source clicked",{evaluationId:h.evaluationId,assistantCode:s.assistantCode,source:v})},d=v=>{v.preventDefault(),s.onReset()},p=(v,h)=>{c.send(eo,{text:v,suggestion:{source:"assistant",sourceText:v}}),s.assistantCode&&r("Assistant response used",{assistantCode:s.assistantCode,evaluationId:h.evaluationId,assistantOutput:h.answer.answer,usedText:v})};return!s.isEnabled||(a==null?void 0:a.length)===0&&!s.isSubmitting&&!t&&!s.errorMessage?null:(0,ve.jsxs)(et.Fragment,{children:[(0,ve.jsx)(Tr,{type:"knowledge",title:e,"data-testid":"knowledge",children:(0,ve.jsxs)(Tt,{withDivider:!0,children:[t&&a.length===0&&!s.pendingInput&&(0,ve.jsx)(gF,E({},t)),a.map((v,h)=>(0,ve.jsx)(hF,{innerRef:h===a.length-1?i:void 0,item:v,hasKeyboardInput:l,onCopy:y=>u(y,v),onUse:y=>p(y,v),onSourceClick:y=>f(y,v)},`${v.question}_${v.answer}_${h}`)),s.pendingInput&&(0,ve.jsx)(Ep,{title:s.pendingInput}),s.errorMessage&&(0,ve.jsx)(tP,{message:s.errorMessage})]})}),a.length>0&&(0,ve.jsx)("div",{className:o.resetContainer,children:(0,ve.jsx)(pe.Button,{disabled:s.threadId===null||s.isSubmitting,onClick:d,children:n("resetLabel")})})]})};var No=b(oP());var sI=b(Z());var Jp=b(De()),gr=b(Z());var Zp=b(Z());var iP={root:"dd-tvkOF",content:"dd-eXA1D"};var K0=b(I()),yF=({isOpen:e,autoFocus:t,children:n,onClose:r,onBack:o,onKeyDown:i,overlayAriaLabel:s,contentAriaLabel:a})=>{let l=(0,Zp.useRef)(null),c=z("Dialog",iP),u=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),o();return}i&&i(d)},f=d=>{d.target===l.current&&e&&r()};return(0,Zp.useEffect)(()=>{var d,p;!l.current||!e||!t||(p=(d=l.current)==null?void 0:d.querySelector("input, textarea"))==null||p.focus()},[e,t,l]),e?(0,K0.jsx)("div",{role:"dialog","data-testid":"dialog",className:c.root,"aria-label":s,ref:l,onKeyDown:u,onMouseDown:f,children:(0,K0.jsx)("div",{"data-testid":"dialog-content",className:c.content,"aria-label":a,children:n})}):null},$a=yF;var aP=b(De());var sP={root:"dd-ranhW"};var lP=b(I()),vF=r=>{var o=r,{className:e,value:t}=o,n=ie(o,["className","value"]);let i=z("TextInput",sP);return(0,lP.jsx)("input",E({className:(0,aP.default)(e,i.root),type:"text",value:t},n))},$c=vF;var G0={};ht(G0,{enUS:()=>SF,nlNL:()=>xF});var SF={back:[{type:0,value:"Back"}],promptTitle:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Paste the code from your email"}],verifyCodeBody:[{type:0,value:"Copy the code from the email you just received and paste it here."}],verifyCodeInputPlaceholder:[{type:0,value:"Paste link or code here"}],verifyCodeSubmitLabel:[{type:0,value:"Sign in"}],verifyCodeError:[{type:0,value:"Sign in failed. The code is probably no longer valid. Please "},{type:8,value:"login",children:[{type:0,value:"request new code"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Have a code sent to your email"}],requestCodeBody:[{type:0,value:"Enter your email and request a code. If you are an existing "},{type:1,value:"productName"},{type:0,value:" user you will receive an email with a code. If you are a new user you will receive an email asking to request access to "},{type:1,value:"productName"},{type:0,value:" first."}],requestCodeInputPlaceholder:[{type:0,value:"Enter your email"}],requestCodeSubmitLabel:[{type:0,value:"Request code"}]},xF={back:[{type:0,value:"Terug"}],promptTitle:[{type:0,value:"Login bij "},{type:1,value:"productName"}],verifyCodeTitle:[{type:0,value:"Plak de code uit je email"}],verifyCodeBody:[{type:0,value:"Kopieer de code uit de email en plak deze hier."}],verifyCodeInputPlaceholder:[{type:0,value:"Plak hier de code"}],verifyCodeSubmitLabel:[{type:0,value:"Inloggen"}],verifyCodeError:[{type:0,value:"Inloggen is niet gelukt. De code is waarschijnlijk niet meer geldig. "},{type:8,value:"login",children:[{type:0,value:"Vraag een nieuwe code aan"}]},{type:0,value:"."}],requestCodeTitle:[{type:0,value:"Verstuur een login code naar je email"}],requestCodeBody:[{type:0,value:"Voer je e-mailadres in en krijg een login code. Als je een bestaande "},{type:1,value:"productName"},{type:0,value:" gebruiker bent krijg je een email met een code. Als je een nieuwe gebruiker bent wordt er een email verstuurd met een toegangsverzoek voor "},{type:1,value:"productName"},{type:0,value:"."}],requestCodeInputPlaceholder:[{type:0,value:"Typ hier je e-mailadres"}],requestCodeSubmitLabel:[{type:0,value:"Code aanvragen"}]};var cP={root:"dd-lWxnE",anchorButton:"dd-TZ4in",errorMessage:"dd-fIsPg",title:"dd-pGhJx",subtitle:"dd-f5l29",text:"dd-iamoD",input:"dd-uhQZ3",actions:"dd-lubvx",button:"dd-CJsNI",primaryButton:"dd-MWBfl"};var st=b(I());var wF=e=>{try{let t=new URL(e);return new URLSearchParams(t.search).get("token")||void 0}catch(t){return e}},bF=({agentEmail:e,isOpen:t,origin:n="",onSuccess:r,onDismiss:o})=>{let i=se(G0),s=z("LoginTokenDialog",cP),a=G(lb),l=Ee(),c=X("productName"),[u,f]=(0,gr.useState)(e||""),[d,p]=(0,gr.useState)(0),[m,g]=(0,gr.useState)(""),v=(0,gr.useCallback)(x=>M(null,null,function*(){x.preventDefault(),l(db({email:u})),p(1)}),[n,u]),h=()=>{g(""),p(0)},y=(0,gr.useCallback)(x=>M(null,null,function*(){x.preventDefault();let T=wF(x.target.elements.token.value);if(!T){g(i("verifyCodeError",{login:S}));return}l(vl({token:T}))}),[n]),S=(0,gr.useMemo)(()=>x=>(0,st.jsx)("button",{type:"button","data-testid":"login-token-dialog-back-button",className:s.anchorButton,onClick:h,children:x},"back-button"),[]);return(0,gr.useEffect)(()=>{a==="error"&&g(i("verifyCodeError",{login:S})),a==="done"&&r()},[a]),(0,st.jsx)($a,{autoFocus:!0,isOpen:t,contentAriaLabel:i("promptTitle",{productName:c}),overlayAriaLabel:i("promptTitle",{productName:c}),onClose:o,onBack:o,children:(0,st.jsxs)("div",{className:s.root,children:[(0,st.jsx)("h1",{className:s.title,children:i("promptTitle",{productName:c})}),d===0&&(0,st.jsxs)("form",{onSubmit:v,children:[(0,st.jsx)("h2",{className:s.subtitle,children:i("requestCodeTitle")}),(0,st.jsx)("p",{className:s.text,children:i("requestCodeBody",{productName:c})}),(0,st.jsx)($c,{className:s.input,name:"email",placeholder:i("requestCodeInputPlaceholder"),value:u,onChange:x=>f(x.target.value)}),(0,st.jsx)("div",{className:s.actions,children:(0,st.jsx)("button",{type:"submit",className:(0,Jp.default)(s.button,s.primaryButton),children:i("requestCodeSubmitLabel")})})]}),d===1&&(0,st.jsxs)("form",{onSubmit:y,children:[(0,st.jsx)("h2",{className:s.subtitle,children:i("verifyCodeTitle")}),(0,st.jsx)("p",{className:s.text,children:i("verifyCodeBody")}),(0,st.jsx)($c,{className:s.input,name:"token",placeholder:i("verifyCodeInputPlaceholder"),disabled:["loading","done"].includes(a)}),m&&(0,st.jsx)("div",{className:s.errorMessage,children:m}),(0,st.jsxs)("div",{className:s.actions,children:[(0,st.jsx)("button",{type:"button",className:(0,Jp.default)(s.button),onClick:h,children:i("back")}),(0,st.jsx)("button",{type:"submit",className:(0,Jp.default)(s.button,s.primaryButton),disabled:["loading","done"].includes(a),children:i("verifyCodeSubmitLabel")})]})]})]})})},uP=bF;var fP=b(I()),EF=()=>{let e=G(cb),t=G(Gs),n=X("adminUrl"),r=pn(),o=()=>r.send(Ys,!1),i=()=>{r.send(Ys,!1),r.send(El)};return(0,fP.jsx)(uP,{isOpen:e,agentEmail:t==null?void 0:t.agentEmail,origin:n,onDismiss:o,onSuccess:i})},dP=EF;var oI=b(X0()),bn=b(Z());var UF={data:null,fetchState:"idle"},hP=e=>e.contentTypes.data,jc=ge("contentTypes/getContentTypes",(e,t)=>M(null,null,function*(){return t.extra.deepdeskAPI.getContentTypes()})),VF=Re({name:"contentTypes",initialState:UF,reducers:{},extraReducers:e=>{e.addCase(jc.pending,t=>{t.fetchState="loading"}).addCase(jc.rejected,t=>{t.fetchState="error"}).addCase(jc.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),yP=VF.reducer;var WF={data:null,fetchState:"idle"},$F=[],mi=e=>e.profile.data,jF=e=>e.profile.data?e.profile.data.uiConfig.widget.types:$F,Gc=fn([jF],e=>e.filter(t=>t.isActive)),vP=e=>{var t;return((t=e.profile.data)==null?void 0:t.onDemandAssistants)||[]},SP=e=>t=>Gc(t).find(n=>n.type===e),xP=e=>e.profile.data?!!e.profile.data.uiConfig.widget.types.find(t=>t.type==="custom-data"):!1,wP=e=>{var t,n;return(n=(t=e.profile.data)==null?void 0:t.knowledgeAssistantNew)!=null?n:null},Kc=ge("profile/getProfile",(e,t)=>M(null,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)})),KF=Re({name:"profile",initialState:WF,reducers:{},extraReducers:e=>{e.addCase(Kc.pending,t=>{t.fetchState="loading"}).addCase(Kc.rejected,t=>{t.fetchState="error"}).addCase(Kc.fulfilled,(t,n)=>{t.fetchState="done",t.data=n.payload})}}),bP=KF.reducer;var To=b(Z());var EP=b(Z()),em=b(De());var Fn={root:"dd-U2SX4",list:"dd-cYTlj",listWrapper:"dd-GLQFR",listHorizontal:"dd-x-knl",page:"dd-1F4vk",search:"dd-nvbxc",pageNav:"dd-sRUuT",pageTitle:"dd-t-MKS",pageBackButton:"dd-cjptm",listHeader:"dd-Fg666",listHeading:"dd-w-xhJ",listMoreButton:"dd--mKep",listItem:"dd-wpvuA",listItemContent:"dd-V-mKo",listItemText:"dd-ukCHL",listItemDescription:"dd-sSyu4",listItemActions:"dd-xelho",listItemTooltip:"dd-SWFsE",listItemTooltipContent:"dd-I7J9N",truncate:"dd-IlopJ",lineClamp:"dd-Twaca",listItemTitle:"dd-lMGHq",listItemAction:"dd-xPLAs",listItemSelected:"dd-jFX0Y",sources:"dd-pZx4v",sourcesTitle:"dd-phYVd",source:"dd-DaR6h",sourceShowMore:"dd-M1-8j",icon:"dd-m6yxD",searchIcon:"dd-0AU-O",searchInputWrapper:"dd-DUFcE",searchInput:"dd-ukrlD",select:"dd--Tifv",selectType:"dd-IkZb2",selectWrapper:"dd-J14mx",image:"dd-RQgsB",imageSrc:"dd-jxh8F",imageSrcHidden:"dd-e20Jk",imageSrcStatus:"dd-j50Tt",imageTitle:"dd-qCjfW",actions:"dd-3mfWc",actionsWrapper:"dd-TjDyI",actionsBar:"dd-LiA35",actionButton:"dd-4wk0u",hasShortKeys:"dd-XilV-",actionShortcut:"dd-s4Mla",actionShortcutFixKerning:"dd-lyh5e"};var bo={};ht(bo,{enUS:()=>GF,nlNL:()=>qF});var GF={visitUrl:[{type:0,value:"Visit"}],back:[{type:0,value:"Back"}],loading:[{type:0,value:"Loading..."}],imageError:[{type:0,value:"Could not load image"}],showAll:[{type:0,value:"Show more"}],sources:[{type:0,value:"Sources"}],showMore:[{type:0,value:"Show "},{type:1,value:"amount"},{type:0,value:" more"}]},qF={visitUrl:[{type:0,value:"Bekijk"}],back:[{type:0,value:"Terug"}],loading:[{type:0,value:"Laden..."}],imageError:[{type:0,value:"Kan afbeelding niet laden"}],showAll:[{type:0,value:"Toon meer"}],sources:[{type:0,value:"Bronnen"}],showMore:[{type:0,value:"Toon "},{type:1,value:"amount"},{type:0,value:" meer"}]};var gi=b(I()),YF=({src:e,title:t})=>{let n=z("CommandPalette",Fn),[r,o]=(0,EP.useState)("loading"),i=se(bo);return(0,gi.jsxs)("div",{className:n.image,children:[(0,gi.jsx)("img",{src:e,alt:t,onLoad:()=>o("done"),onError:()=>o("error"),className:(0,em.default)(n.imageSrc,{[n.imageSrcHidden]:["loading","error"].includes(r)})}),r==="loading"&&(0,gi.jsx)("span",{className:(0,em.default)(n.imageSrc,n.imageSrcStatus),children:i("loading")}),r==="error"&&(0,gi.jsx)("span",{className:(0,em.default)(n.imageSrc,n.imageSrcStatus),children:(0,gi.jsx)(zu,{})}),t&&(0,gi.jsx)("span",{className:n.imageTitle,children:t})]})},CP=YF;var TP=b(Z()),kP=b(De());var ms=b(I());function Q0({children:e,heading:t,orientation:n,hasMore:r,onShowAll:o}){let i=se(bo),s=z("CommandPalette",Fn);return TP.default.Children.count(e)===0?null:(0,ms.jsxs)("div",{"data-testid":"commandpalette-list",className:s.list,children:[(t||r)&&(0,ms.jsxs)("div",{className:s.listHeader,children:[t&&(0,ms.jsx)("h4",{className:s.listHeading,children:t}),r&&o&&(0,ms.jsx)("button",{onClick:o,className:s.listMoreButton,type:"button",children:i("showAll")})]}),(0,ms.jsx)("div",{className:(0,kP.default)(s.listWrapper,n==="horizontal"&&s.listHorizontal),children:e})]})}var Jc=b(De());var tm=b(Z());function qc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Ae=1,J0=2,eS=4,dt=8,nm=16,Yc=32,hr=64,Z0={a:{content:Ae|dt,self:!1,type:Ae|dt|Yc|hr},address:{invalid:["h1","h2","h3","h4","h5","h6","address","article","aside","section","div","header","footer"],self:!1},audio:{children:["track","source"]},br:{type:Ae|dt,void:!0},body:{content:Ae|J0|eS|dt|nm|Yc|hr},button:{content:dt,type:Ae|dt|Yc|hr},caption:{content:Ae,parent:["table"]},col:{parent:["colgroup"],void:!0},colgroup:{children:["col"],parent:["table"]},details:{children:["summary"],type:Ae|Yc|hr},dd:{content:Ae,parent:["dl"]},dl:{children:["dt","dd"],type:Ae},dt:{content:Ae,invalid:["footer","header"],parent:["dl"]},figcaption:{content:Ae,parent:["figure"]},footer:{invalid:["footer","header"]},header:{invalid:["footer","header"]},hr:{type:Ae,void:!0},img:{void:!0},li:{content:Ae,parent:["ul","ol","menu"]},main:{self:!1},ol:{children:["li"],type:Ae},picture:{children:["source","img"],type:Ae|dt|nm},rb:{parent:["ruby","rtc"]},rp:{parent:["ruby","rtc"]},rt:{content:dt,parent:["ruby","rtc"]},rtc:{content:dt,parent:["ruby"]},ruby:{children:["rb","rp","rt","rtc"]},source:{parent:["audio","video","picture"],void:!0},summary:{content:dt,parent:["details"]},table:{children:["caption","colgroup","thead","tbody","tfoot","tr"],type:Ae},tbody:{parent:["table"],children:["tr"]},td:{content:Ae,parent:["tr"]},tfoot:{parent:["table"],children:["tr"]},th:{content:Ae,parent:["tr"]},thead:{parent:["table"],children:["tr"]},tr:{parent:["table","tbody","thead","tfoot"],children:["th","td"]},track:{parent:["audio","video"],void:!0},ul:{children:["li"],type:Ae},video:{children:["track","source"]},wbr:{type:Ae|dt,void:!0}};function hs(e){return t=>{Z0[t]=E(E({},e),Z0[t])}}["address","main","div","figure","p","pre"].forEach(hs({content:Ae,type:Ae|hr}));["abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","ruby","samp","strong","sub","sup","time","u","var"].forEach(hs({content:dt,type:Ae|dt|hr}));["p","pre"].forEach(hs({content:dt,type:Ae|hr}));["s","small","span","del","ins"].forEach(hs({content:dt,type:Ae|dt}));["article","aside","footer","header","nav","section","blockquote"].forEach(hs({content:Ae,type:Ae|J0|hr}));["h1","h2","h3","h4","h5","h6"].forEach(hs({content:dt,type:Ae|eS|hr}));["audio","canvas","iframe","img","video"].forEach(hs({type:Ae|dt|nm|hr}));var Qc=Object.freeze(Z0),tS=["applet","base","body","command","embed","frame","frameset","head","html","link","meta","noscript","object","script","style","title"],nS=Object.keys(Qc).filter(e=>e!=="canvas"&&e!=="iframe"),Oe=1,rS=2,gs=3,hi=4,om=5,im=Object.freeze({alt:Oe,cite:Oe,class:Oe,colspan:gs,controls:hi,datetime:Oe,default:hi,disabled:hi,dir:Oe,height:Oe,href:Oe,id:Oe,kind:Oe,label:Oe,lang:Oe,loading:Oe,loop:hi,media:Oe,muted:hi,poster:Oe,rel:Oe,role:Oe,rowspan:gs,scope:Oe,sizes:Oe,span:gs,start:gs,style:om,src:Oe,srclang:Oe,srcset:Oe,tabindex:Oe,target:Oe,title:Oe,type:Oe,width:Oe}),oS=Object.freeze({class:"className",colspan:"colSpan",datetime:"dateTime",rowspan:"rowSpan",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex"});function rm(){return rm=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rm.apply(this,arguments)}function sm({attributes:e={},className:t,children:n=null,selfClose:r=!1,tagName:o}){let i=o;return r?tm.default.createElement(i,rm({className:t},e)):tm.default.createElement(i,rm({className:t},e),n)}var Xc=class{attribute(t,n){return n}node(t,n){return n}};function RP(e,t,n,r=!1){let o=e.match(t instanceof RegExp?t:new RegExp(t,"i"));return o?A(E({match:o[0],void:r},n(o)),{index:o.index,length:o[0].length,valid:!0}):null}var Eo=class{constructor(t,n,r){qc(this,"greedy",!1),qc(this,"options",void 0),qc(this,"propName",void 0),qc(this,"inverseName",void 0),qc(this,"factory",void 0),this.options=E({},n),this.propName=t,this.inverseName=`no${t.charAt(0).toUpperCase()+t.slice(1)}`,this.factory=r!=null?r:null}createElement(t,n){return this.factory?tm.default.createElement(this.factory,n,t):this.replaceWith(t,n)}doMatch(t,n,r,o=!1){return RP(t,n,r,o)}onBeforeParse(t,n){return t}onAfterParse(t,n){return t}};var ys=b(Z()),_P=b(IP());function Co(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ZF=/(url|image|image-set)\(/i,iS=class extends Xc{attribute(t,n){return t==="style"&&Object.keys(n).forEach(r=>{String(n[r]).match(ZF)&&delete n[r]}),n}},AP=1,JF=3,e5=/^<(!doctype|(html|head|body)(\s|>))/i,t5=/^(aria-|data-|\w+:)/iu,n5=/{{{(\w+)\/?}}}/;function r5(){if(!(typeof window=="undefined"||typeof document=="undefined"))return document.implementation.createHTMLDocument("Interweave")}var am=class{constructor(t,n={},r=[],o=[]){var i;Co(this,"allowed",void 0),Co(this,"banned",void 0),Co(this,"blocked",void 0),Co(this,"container",void 0),Co(this,"content",[]),Co(this,"props",void 0),Co(this,"matchers",void 0),Co(this,"filters",void 0),Co(this,"keyIndex",void 0),this.props=n,this.matchers=r,this.filters=[...o,new iS],this.keyIndex=-1,this.container=this.createContainer(t||""),this.allowed=new Set((i=n.allowList)!==null&&i!==void 0?i:nS),this.banned=new Set(tS),this.blocked=new Set(n.blockList)}applyAttributeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.attribute=="function"?o.attribute(t,r):r,n)}applyNodeFilters(t,n){return this.filters.reduce((r,o)=>r!==null&&typeof o.node=="function"?o.node(t,r):r,n)}applyMatchers(t,n){let r={},{props:o}=this,i=t,s=0,a=null;return this.matchers.forEach(l=>{let c=l.asTag().toLowerCase(),u=this.getTagConfig(c);if(o[l.inverseName]||!this.isTagAllowed(c)||!this.canRenderChild(n,u))return;let f="";for(;i&&(a=l.match(i));){let d=a,{index:p,length:m,match:g,valid:v,void:h}=d,y=ie(d,["index","length","match","valid","void"]),S=l.propName+String(s);p>0&&(f+=i.slice(0,p)),v?(f+=h?`{{{${S}/}}}`:`{{{${S}}}}${g}{{{/${S}}}}`,this.keyIndex+=1,s+=1,r[S]={children:g,matcher:l,props:A(E(E({},o),y),{key:this.keyIndex})}):f+=g,l.greedy?(i=f+i.slice(p+m),f=""):i=i.slice(p+(m||g.length))}l.greedy||(i=f+i)}),s===0?t:this.replaceTokens(i,r)}canRenderChild(t,n){return!t.tagName||!n.tagName||t.void?!1:t.children.length>0?t.children.includes(n.tagName):t.invalid.length>0&&t.invalid.includes(n.tagName)?!1:n.parent.length>0?n.parent.includes(t.tagName):!t.self&&t.tagName===n.tagName?!1:!!(t&&t.content&n.type)}convertLineBreaks(t){let{noHtml:n,disableLineBreaks:r}=this.props;if(n||r||t.match(/<((?:\/[ a-z]+)|(?:[ a-z]+\/))>/gi))return t;let o=t.replace(/\r\n/g,`
74
74
  `);return o=o.replace(/\n{3,}/g,`
75
75
 
76
76
 
77
- `),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global!="undefined"&&global.INTERWEAVE_SSR_POLYFILL||OF)();if(!o)return;let s=(n=this.props.containerTagName)!==null&&n!==void 0?n:"body",i=s==="body"||s==="fragment"?o.body:o.createElement(s);return t.match(NF)||(i.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,cP.default)(t):t)),i}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==lP||!t.attributes||([...t.attributes].forEach(s=>{let{name:i,value:a}=s,l=i.toLowerCase(),c=$p[l]||$p[i];if(!this.isSafe(t)||!l.match(MF)&&(!n&&(!c||c===B0)||l.startsWith("on")||a.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let u=l==="style"?this.extractStyleAttribute(t):a;c===ms?u=!0:c===di?u=Number.parseFloat(String(u)):c!==Wp&&(u=String(u)),r[U0[l]||l]=this.applyAttributeFilters(l,u),o+=1}),o===0)?null:r}extractStyleAttribute(t){let n={};return Array.from(t.style).forEach(r=>{let o=t.style[r];(typeof o=="string"||typeof o=="number")&&(n[r.replace(/-([a-z])/g,(s,i)=>String(i).toUpperCase())]=o)}),n}getTagConfig(t){let n={children:[],content:0,invalid:[],parent:[],self:!0,tagName:"",type:0,void:!1};return Gc[t]?I(b(b({},n),Gc[t]),{tagName:t}):n}isSafe(t){if(typeof HTMLAnchorElement!="undefined"&&t instanceof HTMLAnchorElement){let n=t.getAttribute("href");if(n!=null&&n.startsWith("#"))return!0;let r=t.protocol.toLowerCase();return r===":"||r==="http:"||r==="https:"||r==="mailto:"||r==="tel:"}return!0}isTagAllowed(t){return this.banned.has(t)||this.blocked.has(t)?!1:this.props.allowElements||this.allowed.has(t)}parse(){return this.container?this.parseNode(this.container,this.getTagConfig(this.container.nodeName.toLowerCase())):[]}parseNode(t,n){let{noHtml:r,noHtmlExceptMatchers:o,allowElements:s,transform:i,transformOnlyAllowList:a}=this.props,l=[],c="";return[...t.childNodes].forEach(u=>{if(u.nodeType===lP){let d=u.nodeName.toLowerCase(),p=this.getTagConfig(d);c&&(l.push(c),c="");let h=this.applyNodeFilters(d,u);if(!h)return;let m;if(i&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let S=this.keyIndex;m=this.parseNode(h,p);let y=i(h,m,p);if(y===null)return;if(typeof y!="undefined"){l.push(pi.default.cloneElement(y,{key:S}));return}this.keyIndex=S-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(s||this.canRenderChild(n,p))){var f;this.keyIndex+=1;let S=this.extractAttributes(h),y={tagName:d};S&&(y.attributes=S),p.void&&(y.selfClose=p.void),l.push(pi.default.createElement(Kp,I(b({},y),{key:this.keyIndex}),(f=m)!==null&&f!==void 0?f:this.parseNode(h,p)))}else l=[...l,...this.parseNode(h,p.tagName?p:n)]}else if(u.nodeType===_F){let d=r&&!o?u.textContent:this.applyMatchers(u.textContent||"",n);Array.isArray(d)?l=[...l,...d]:c+=d}}),c&&l.push(c),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,s=null;for(;s=o.match(LF);){let[i,a]=s,l=s.index,c=i.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:u,matcher:f,props:d}=n[a],p;if(c)p=i.length,r.push(f.createElement(u,d));else{let h=o.match(new RegExp(`{{{/${a}}}}`));p=h.index+h[0].length,r.push(f.createElement(this.replaceTokens(o.slice(i.length,h.index),n),d))}o=o.slice(p)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function DF(e){var t;let{attributes:n,className:r,containerTagName:o,content:s,emptyContent:i,parsedContent:a,tagName:l,noWrap:c}=e,u=(t=o!=null?o:l)!==null&&t!==void 0?t:"span",f=u==="fragment"?!0:c,d;if(a)d=a;else{let p=new Gp(s!=null?s:"",e).parse();p.length>0&&(d=p)}return d||(d=i),f?pi.default.createElement(pi.default.Fragment,null,d):pi.default.createElement(Kp,{attributes:n,className:r,tagName:u},d)}function gs(e){let C=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:s=!1,emptyContent:i=null,filters:a=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:f="span",noWrap:d=!1}=C,p=se(C,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),h=s?[]:l,m=o?[]:a,S=u?[u]:[],y=c?[c]:[];h.forEach(T=>{T.onBeforeParse&&S.push(T.onBeforeParse.bind(T)),T.onAfterParse&&y.push(T.onAfterParse.bind(T))});let g=S.reduce((T,k)=>k(T,e),r!=null?r:""),v=new Gp(g,p,h,m),x=y.reduce((T,k)=>k(T,e),v.parse());return pi.default.createElement(DF,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:i,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var hs=E(Z());var FF=/[.*+?^${}()|[\]\\]/g,zF=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function HF(e){return e.replace(FF,"\\$&")}function BF(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function UF(e){return e.search(zF)}function uP(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${HF(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function dP(e){return e.replace(Hu,'<mark data-type="placeholder">$1</mark>')}function Ba(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function VF(e,t){return e.split("").map((i,a)=>({char:i,index:a})).filter(({char:i,index:a})=>/\s/.test(i)&&a<=t).map(({index:i})=>i).reverse()[0]}function j0(e,t,n={}){if(t){let r=BF(t.toLowerCase(),e.toLowerCase()),o=Ba(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),c=UF(l);return`<span style="opacity: 0.5">${l.substring(c+1)}</span>${o}`}let i=t.split(zx).length>3||t.length>30?VF(t.trim(),r):0;return`${`${i>0?"\u2026":""}${Ba(e.substring(i,r))}`}<strong>${o}</strong>`}return e}var jF=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function qc(e){return jF.test(e)}function W0(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var qp=E(Z()),mP=E(P()),fP=qp.default.createContext(void 0);function Ua(){let e=qp.default.useContext(fP);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var pP=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s})=>{let i=qp.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:s}),[n,t,o]);return(0,mP.jsx)(fP.Provider,{value:i,children:e})};var rn=E(P()),WF=3,$F=90,gP=({children:e})=>{let t=O("CommandPalette",Mn);return(0,rn.jsx)("div",{className:t.listItemActions,children:e})};function $0(p){var h=p,{closeOnSelect:e=!0,lineClamp:t,tooltip:n,children:r,onClick:o,extra:s,onSourceClick:i,description:a,sources:l,id:c,styles:u,defaultSourcesAmount:f=WF}=h,d=se(h,["closeOnSelect","lineClamp","tooltip","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var D;let m=ie(vo),[S,y]=(0,hs.useState)(!1),{selected:g,onChangeOpen:v}=Ua(),[x,C]=(0,hs.useState)(!1),T=O("CommandPalette",Mn);function k(B){o(B),e&&v(!1)}let A=(0,hs.useMemo)(()=>typeof a!="string"?a:qc(a)?W0(a).trim():a,[a]),H=(0,hs.useMemo)(()=>typeof n!="string"?n:qc(n)?W0(n).trim():n,[n]);return(0,hs.useEffect)(()=>{C(g===c)},[g]),(0,rn.jsxs)("div",{className:(0,Yc.default)(T.listItem,c===g&&T.listItemSelected),children:[(0,rn.jsxs)(wt,{placement:"right-start",tooltip:!0,onOpenChange:C,open:x,children:[(0,rn.jsx)(wt.Trigger,I(b({className:T.listItemAction,"aria-disabled":(D=d.disabled)!=null?D:!1,onClick:k,"data-command-palette-item":!0,"data-item-id":c},d),{children:(0,rn.jsxs)("div",{className:T.listItemContent,children:[typeof r=="string"?(0,rn.jsx)("p",{className:(0,Yc.default)(T.listItemText,T.truncate,u==null?void 0:u.title),children:r}):r,A&&typeof A=="string"?(0,rn.jsx)(gs,{tagName:"p",allowList:[],content:A,className:(0,Yc.default)(T.listItemDescription,u==null?void 0:u.description,t?T.lineClamp:T.truncate)}):a]})})),H&&H.length>$F&&(0,rn.jsx)(wt.Content,{className:T.listItemTooltip,disableFocusManager:!0,children:(0,rn.jsx)(gs,{className:T.listItemTooltipContent,allowList:["h1","h2","h3","h4","h5","h6","a","p","br"],tagName:"div",content:H.replace(/\n/g,"<br />")})})]}),c===g&&s,l&&l.length>0&&(0,rn.jsxs)("div",{className:T.sources,children:[(0,rn.jsx)("span",{className:T.sourcesTitle,children:m("sources")}),l.slice(0,S?l.length:f).map(B=>(0,rn.jsx)("a",{className:T.source,href:B.url,target:"_blank",title:B.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>i==null?void 0:i(B),children:B.name},B.url)),!S&&l.length>f&&(0,rn.jsx)("button",{className:(0,Yc.default)(T.source,T.sourceShowMore),type:"button",onClick:()=>y(!0),children:m("showMore",{amount:l.length-f})})]})]})}var Xc=E(P()),hP=()=>(0,Xc.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,Xc.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,Xc.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 mi=E(P());function K0({children:e,title:t,id:n,onDismiss:r}){let o=ie(vo),s=O("CommandPalette",Mn),{page:i}=Ua();return i!==n?null:(0,mi.jsxs)("div",{className:s.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,mi.jsxs)("div",{className:s.pageNav,children:[(0,mi.jsxs)("button",{className:s.pageBackButton,type:"button",onClick:r,children:[(0,mi.jsx)(hP,{}),o("back")]}),t&&(0,mi.jsx)("h3",{className:s.pageTitle,children:t})]}),e]})}var yP=E(Z());var Qc=E(P()),Va=()=>(0,Qc.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,Qc.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,Qc.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 yr=E(P());function KF({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:s,selectedType:i},a){let l=O("CommandPalette",Mn);return(0,yr.jsxs)("div",{className:l.search,children:[(0,yr.jsx)("div",{className:l.searchIcon,children:(0,yr.jsx)(Va,{})}),(0,yr.jsxs)("div",{className:l.searchInputWrapper,children:[(0,yr.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:c=>{e(c.currentTarget.value)},onFocus:c=>{c.currentTarget.select()},className:l.searchInput,placeholder:n,value:s,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,yr.jsx)("div",{className:l.selectWrapper,children:(0,yr.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:c=>t(c.target.value===r?void 0:c.target.value),value:i||r,children:[r&&(0,yr.jsx)("option",{children:r}),o.map(c=>(0,yr.jsx)("option",{value:c.value,children:c.label},c.value))]})})]})]})}var vP=(0,yP.forwardRef)(KF);var G0=E(De());var Yp=E(P()),GF=o=>{var s=o,{onClick:e,shortKeys:t,children:n}=s,r=se(s,["onClick","shortKeys","children"]);let i=O("CommandPalette",Mn);return(0,Yp.jsxs)("button",I(b({type:"button"},r),{onClick:e,className:(0,G0.default)(i.actionButton,r.className,{[i.hasShortKeys]:t&&t.length>0}),children:[n,t==null?void 0:t.map(a=>(0,Yp.jsx)("span",{className:(0,G0.default)(i.actionShortcut,a===8629&&i.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},SP=GF;var Zc=E(P()),qF="[data-command-palette-item]";function gi({placeholder:e="Start typing to search...",typePlaceholder:t="All types",defaultPage:n="search",page:r,onChangePage:o,onChangeSearch:s,onChangeType:i,onChangeOpen:a,selectedType:l,types:c,children:u,isOpen:f,search:d,updateDeps:p=[]}){let[h,m]=(0,wo.useState)(),S=(0,wo.useRef)(null),y=()=>{o&&o(n),i(void 0),s(""),a(!1)},g=()=>{var B;if(r!==n&&o){o(n);return}if(l&&i){i(void 0),(B=S.current)==null||B.focus();return}if(d.length>0){s("");return}a(!1)},v=()=>{let B=x();B.length!==0&&m(B[0].dataset.itemId)},x=()=>Array.from(document.querySelectorAll(qF)||[]),C=B=>document.querySelector(`[data-item-id=${B}]`),T=B=>{let J=C(B);J&&m(J.dataset.itemId)},k=B=>{let J=C(B);J&&J.scrollIntoView({behavior:"smooth"})},A=()=>{if(!h)return;let B=x(),J=C(h);if(!J)return;let Y=B.indexOf(J),_=B[Y+1];_!=null&&_.dataset.itemId?T(_.dataset.itemId):v()},H=()=>{if(!h)return;let B=x(),J=C(h);if(!J)return;let Y=B.indexOf(J),_=B[Y-1];_!=null&&_.dataset.itemId?T(_.dataset.itemId):T(B[B.length-1].dataset.itemId)},D=(0,wo.useCallback)(B=>{switch(B.key){case"ArrowDown":{B.preventDefault(),A();break}case"ArrowUp":{B.preventDefault(),H();break}case"Enter":{if(h){let J=C(h);J==null||J.click()}break}}},[h]);return(0,wo.useEffect)(()=>{v()},[d,r,l,f,...p]),(0,wo.useEffect)(()=>{h&&k(h)},[h]),(0,Zc.jsx)(Ha,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:g,onClose:y,onKeyDown:D,children:(0,Zc.jsxs)(pP,{selected:h,setSelected:m,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,Zc.jsx)(vP,{ref:S,onChange:s,onChangeType:i,placeholder:e,value:d,selectedType:l,types:c,typePlaceholder:t}),u]})})}gi.Page=K0;gi.List=L0;gi.Image=nP;gi.ListItem=$0;gi.ListItemActions=gP;gi.Button=SP;var bt=gi;var xP=E(Z());function wP(e,t){(0,xP.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 Jc=E(Z());var bP={data:null,fetchState:"idle"},YF=e=>{var t;return(t=e.entities.data)!=null?t:null},Xp=Gt([YF,Ui,pb],(e,t,n)=>{var a;let r=[],{visitorName:o}=n!=null?n:{},{agentName:s,agentNickname:i}=t!=null?t:{};return s&&s!==o&&r.push(s),i&&i!==o&&r.push(i),(a=e==null?void 0:e.filter(l=>!r.includes(l.text)))!=null?a:null}),vr=pe("entities/getEntities",(e,t)=>N(null,null,function*(){let{deepdeskAPI:n,dynamicThunkObject:r}=t.extra;if(!r.conversationQuery)return Promise.resolve([]);let o=r.conversationQuery,s=yield o();return s.length===0?Promise.resolve([]):n.getEntities(s)})),XF=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),QF=Re({name:"entities",initialState:bP,reducers:{},extraReducers:e=>{e.addCase(vr.pending,t=>{t.fetchState="loading"}).addCase(vr.rejected,t=>{t.fetchState="error"}).addCase(vr.fulfilled,(t,n)=>{t.fetchState="done",t.data=XF(t.data?[...t.data,...n.payload]:n.payload)}).addCase(lt,()=>bP)}}),EP=QF.reducer;var q0={};yt(q0,{enUS:()=>ZF,nlNL:()=>JF});var ZF={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},JF={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var CP={root:"dd-TYTKs",empty:"dd-AU7uT"};var ja=E(P()),e5=({onCopy:e})=>{let t=(0,Jc.useRef)(null),n=O("EntitiesList",CP),r=G(Xp),{setSelected:o}=Ua(),s=ie(q0),i=be();return(0,Jc.useEffect)(()=>{i(vr())},[]),(0,Jc.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,ja.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,ja.jsx)(bt.List,{children:r.map((a,l)=>(0,ja.jsx)(bt.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,ja.jsx)("p",{className:n.empty,children:s("noResults")})]})},TP=e5;var Y0=E(P()),Qp=e=>(0,Y0.jsx)("svg",I(b({xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512"},e),{children:(0,Y0.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 eu={};yt(eu,{enUS:()=>t5,nlNL:()=>n5});var t5={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"}]},n5={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 Zp={trigger:"dd-dQ-OH",content:"dd-9k0N3",item:"dd-va6pa"};var hi=E(P()),r5=({suggestion:e,source:t,context:n})=>{let r=ie(eu),o=G(Rr),s=Ze(),i=X("enableSuggestionFeedback"),a=`${e.text}`,l=G(zo(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),c=()=>{s("suggestion feedback",{text:e.text,source:t,context:n})};return!i||!l?null:(0,hi.jsxs)(wt,{placement:"top-end",children:[(0,hi.jsx)(wt.Trigger,{className:Zp.trigger,children:(0,hi.jsx)(Qp,{"data-testid":"feedback-dropdown-trigger"})}),(0,hi.jsx)(wt.Content,{className:Zp.content,children:(0,hi.jsx)(wt.Button,{className:Zp.item,as:"a",onClick:c,target:"_blank",href:l,children:r("giveFeedback")})})]})},Jp=r5;var tu={};yt(tu,{enUS:()=>o5,nlNL:()=>s5});var o5={personalCollectionLink:[{type:0,value:"Go to Personal Collection"}],searchPlaceholder:[{type:0,value:"Start typing to search..."}],urlSuggestions:[{type:0,value:"URL 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"}],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?"}]},s5={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:"URL 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"}],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 LP=E(Z());var i5=["{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}"],a5=new RegExp(i5.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function kP(e,t){let n=e.split(a5),r=0,o=[];for(let s=0;s<n.length;s++){let i=n[s];if(o.push(i),s===n.length-1)break;if(t.indexOf(i)===-1)return e;let a=n[s+1],l=s===n.length-2;r+=i.length;let c=r;if(l){let f=a.charAt(0),d=0;do c=f?t.indexOf(f,c+1):-1,d+=1;while(c!==-1&&a.indexOf(t.slice(c))!==0);if(c===-1&&d>2)return e}else c=a&&a!==""?t.indexOf(a,r):-1;let u=c===-1?t.slice(r):t.slice(r,c);o.push(u),r=c}return o.join("")}function RP(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var IP={suggestions:[],fetchState:"idle"},PP={default:IP},AP=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},em=e=>e.textSuggestions,_P=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},tm=kt("textSuggestions/refresh"),Sr=pe("textSuggestions/recommendations",(e,t)=>N(null,null,function*(){var u,f,d;let{deepdeskAPI:n}=t.extra,r=t.getState(),{platformVariables:o}=r.info,{textSuggestionsCount:s,inlineSuggestions:i}=r.settings,a=Ns(r),l=(u=r.conversation.current)==null?void 0:u.id;if(!l)throw new Error("No current conversation to fetch text suggestions");if(!((f=r.profile.data)!=null&&f.recommendationEngine))return[];let c=[];if(e==="sticky-messages"){let p=(d=r.profile.data)==null?void 0:d.code;if(!p)throw new Error("No current profile to fetch pinned messages");c=yield n.getPinnedMessages(p)}else c=yield n.getTextSuggestions(l,yl(r),e);if(o&&(c=c.map(p=>b(I(b({},p),{text:er(p.text,o)}),p.title?{title:er(p.title,o)}:{}))),e==="default"){let p=i?c.filter(_P(a)):c;t.dispatch(Do(p.slice(0,s)))}return c})),nu=pe("textSuggestions/autocompletions",(e,t)=>N(null,null,function*(){var u,f;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{platformVariables:s}=r.info,{textSuggestionsCount:i,deanonymize:a,inlineSuggestions:l}=r.settings;if(!((f=r.profile.data)!=null&&f.recommendationEngine))return[];if(!o)throw new Error("No current conversation to fetch text suggestions");let c=yield n.getAutocompleteSuggestions(o,I(b({},yl(r)),{input:e}));if(!t.getState().input.text)throw new Error("Abort");return l&&(c=c.filter(_P(e))),s&&(c=c.map(d=>I(b({},d),{text:er(d.text,s)}))),a&&(c=c.map(d=>I(b({},d),{text:d.source!=="trie-with-typos"?kP(d.text,e):d.text}))),c=RP(c,i),t.dispatch(Do(c)),c})),NP=Re({name:"textSuggestions",initialState:PP,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(Sr.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||IP;return I(b({},t),{[r]:I(b({},o),{fetchState:"loading"})})}).addCase(Sr.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(Sr.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(nu.pending,t=>{t.default.fetchState="loading"}).addCase(nu.rejected,t=>{t.default.fetchState="error"}).addCase(nu.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(lt,()=>PP)}}),{setTextSuggestions:NK}=NP.actions,MP=NP.reducer;var yi=E(P()),l5=({types:e,commands:t,onClick:n})=>{let r=be(),o=ie(tu),s=G(em);return(0,LP.useEffect)(()=>{e.forEach(({type:i})=>{(!s[i]||s[i].suggestions.length===0)&&r(Sr(i))})},[]),(0,yi.jsxs)("div",{children:[t.length>0&&(0,yi.jsx)(bt.List,{heading:o("commands"),children:t.map((i,a)=>(0,yi.jsx)(bt.ListItem,{id:`command-${a}`,closeOnSelect:!1,onClick:i.onClick,children:i.label},i.label))}),e.map(({type:i,title:a})=>{var l;return(0,yi.jsx)(bt.List,{heading:a,orientation:"vertical",children:(l=s[i])==null?void 0:l.suggestions.map((c,u)=>(0,yi.jsx)(bt.ListItem,{id:`${i}-${u}`,closeOnSelect:!1,description:c.title&&c.text,onClick:()=>n(c.text,c),"data-testid":"search-overlay-suggestion",children:c.title||c.text},`${c.id}-${c.text}`))},i)})]})},OP=l5;var on=E(P()),u5=200,d5=5,f5=4,X0=(e,t,n)=>e.slice(0,n?10:t.toLowerCase()==="image"?f5:d5),p5=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),m5=()=>{var Y,_,V;let e=be(),t=dn(),n=ie(tu),[r,o]=(0,wn.useState)(!1),[s,i]=(0,wn.useState)(""),a=G(Eb),l=G(fs),[c,u]=(0,wn.useState)(),f=G(Rt),d=X("showSearch"),p=X("enableSuggestionFeedback"),h=X("showEntitiesCommand"),m=X("showImageSearch"),S=X("searchTriggerKey"),y=G(qR),g=G(Kg),v=G(Cb),x=G(bb),C=((V=(_=(Y=l==null?void 0:l.uiConfig)==null?void 0:Y.search)==null?void 0:_.initialTypes)==null?void 0:V.filter(({isActive:z})=>z))||[],T=Ze(),k=(0,wn.useMemo)(()=>{let z=$=>X0(g.filter(K=>K.type===$.toUpperCase()),$,c),U=(y==null?void 0:y.map($=>({value:$.code.toUpperCase(),label:`${$.name}s`,list:z($.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[];if(U.push({value:"PERSONAL",label:n("personalSuggestions"),list:z("PERSONAL"),lineClamp:!1,listOrientation:"vertical"},{value:"URL",label:n("urlSuggestions"),list:z("URL"),lineClamp:!1,listOrientation:"vertical"},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:z("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical"}),m&&U.push({value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:z("IMAGE"),listOrientation:"horizontal"}),C.length===0)return U;let M=C.map($=>U.find(K=>K.value.toLowerCase()===$.type)).filter($=>!!$),q=U.filter($=>!M.find(K=>K.value===$.value));return[...M,...q]},[y,C,m,c]),A=[{label:n("entitiesClipboard"),onClick:()=>e(Vi("entities")),shouldShow:h&&p5(n("entitiesClipboard"),s)}].filter(z=>z.shouldShow).filter(()=>!c),H=(0,wn.useCallback)((0,DP.default)((z,U)=>{e(Ds({query:z,type:U,tags:["search-overlay"],size:c?50:20}))},u5),[c]),D=(0,wn.useCallback)((z,U)=>{U.type==="IMAGE"?t.send(qg,{suggestion:U}):t.send(Xr,{text:z,suggestion:U}),e(tr(!1))},[e]),B=z=>{Ir(z.text),T("entity copied",{entity:z,type:"copy"}),e(tr(!1))};function J(z){return U=>{r?window.confirm(n("warning"))&&(z(U),o(!1)):z(U)}}return(0,wn.useEffect)(()=>{s?H(s,c):e(fd())},[s,c]),(0,wn.useEffect)(()=>{f&&e(Uc())},[f]),wP(S,()=>{e(tr(!0)),T("open search",{via:"ctrl+k"})}),!d||!l?null:(0,on.jsxs)(bt,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:i,onChangeOpen:J(z=>e(tr(z))),onChangeType:z=>u(z),onChangePage:J(z=>e(Vi(z))),selectedType:c,search:s,page:a,isOpen:x,types:k,updateDeps:[g],children:[(0,on.jsxs)(bt.Page,{id:"search",children:[s.length===0&&(0,on.jsx)(OP,{types:C,commands:A,onClick:D}),s.length>0&&(0,on.jsxs)(wn.Fragment,{children:[A.length>0&&(0,on.jsx)(bt.List,{heading:n("commands"),children:A.map((z,U)=>(0,on.jsx)(bt.ListItem,{closeOnSelect:!1,onClick:z.onClick,id:`commands-${U}`,children:z.label},z.label))}),k.map(({value:z,label:U,list:M,lineClamp:q,listOrientation:$})=>(0,on.jsx)(bt.List,{heading:U,orientation:$==="horizontal"?"horizontal":"vertical",onShowAll:()=>u(z),hasMore:!c&&v[z.toLowerCase()]>X0(M,z,c).length,children:X0(M,z,c).map(K=>(0,on.jsx)(bt.ListItem,{id:`${z}-${K.id}`,closeOnSelect:!1,lineClamp:q,onClick:()=>D(K.text,K),description:z!=="IMAGE"?K.title&&K.text:void 0,tooltip:K.text,extra:p&&(0,on.jsx)(bt.ListItemActions,{children:(0,on.jsx)(Jp,{context:s,source:"search",suggestion:K})}),children:z==="IMAGE"?(0,on.jsx)(bt.Image,{title:K.title||K.text,src:K.image}):K.title||K.text},`${K.id}-${K.text}`))},z))]})]}),(0,on.jsx)(bt.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:J(()=>{e(Vi("search"))}),children:(0,on.jsx)(TP,{onCopy:B})})]})},FP=m5;var ru=E(P()),g5=()=>{let e=X("showSearch"),t=X("isEmbedded");return(0,ru.jsxs)(zP.Fragment,{children:[e&&(0,ru.jsx)(FP,{}),t&&(0,ru.jsx)(jR,{})]})},HP=g5;var jP=E(De());var nm=E(P()),BP=({className:e})=>(0,nm.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,nm.jsx)("g",{children:(0,nm.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
77
+ `),o=o.replace(/\n/g,"<br/>"),o}createContainer(t){var n;let o=(typeof global!="undefined"&&global.INTERWEAVE_SSR_POLYFILL||r5)();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(e5)||(s.innerHTML=this.convertLineBreaks(this.props.escapeHtml?(0,_P.default)(t):t)),s}extractAttributes(t){let{allowAttributes:n}=this.props,r={},o=0;return t.nodeType!==AP||!t.attributes||([...t.attributes].forEach(i=>{let{name:s,value:a}=i,l=s.toLowerCase(),c=im[l]||im[s];if(!this.isSafe(t)||!l.match(t5)&&(!n&&(!c||c===rS)||l.startsWith("on")||a.replace(/(\s|\0|&#x0([9AD]);)/,"").match(/(javascript|vbscript|livescript|xss):/i)))return;let u=l==="style"?this.extractStyleAttribute(t):a;c===hi?u=!0:c===gs?u=Number.parseFloat(String(u)):c!==om&&(u=String(u)),r[oS[l]||l]=this.applyAttributeFilters(l,u),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 Qc[t]?A(E(E({},n),Qc[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=[],c="";return[...t.childNodes].forEach(u=>{if(u.nodeType===AP){let d=u.nodeName.toLowerCase(),p=this.getTagConfig(d);c&&(l.push(c),c="");let m=this.applyNodeFilters(d,u);if(!m)return;let g;if(s&&!(a&&!this.isTagAllowed(d))){this.keyIndex+=1;let v=this.keyIndex;g=this.parseNode(m,p);let h=s(m,g,p);if(h===null)return;if(typeof h!="undefined"){l.push(ys.default.cloneElement(h,{key:v}));return}this.keyIndex=v-1}if(this.banned.has(d))return;if(!(r||o&&d!=="br")&&this.isTagAllowed(d)&&(i||this.canRenderChild(n,p))){var f;this.keyIndex+=1;let v=this.extractAttributes(m),h={tagName:d};v&&(h.attributes=v),p.void&&(h.selfClose=p.void),l.push(ys.default.createElement(sm,A(E({},h),{key:this.keyIndex}),(f=g)!==null&&f!==void 0?f:this.parseNode(m,p)))}else l=[...l,...this.parseNode(m,p.tagName?p:n)]}else if(u.nodeType===JF){let d=r&&!o?u.textContent:this.applyMatchers(u.textContent||"",n);Array.isArray(d)?l=[...l,...d]:c+=d}}),c&&l.push(c),l}replaceTokens(t,n){if(!t.includes("{{{"))return t;let r=[],o=t,i=null;for(;i=o.match(n5);){let[s,a]=i,l=i.index,c=s.includes("/");l>0&&(r.push(o.slice(0,l)),o=o.slice(l));let{children:u,matcher:f,props:d}=n[a],p;if(c)p=s.length,r.push(f.createElement(u,d));else{let m=o.match(new RegExp(`{{{/${a}}}}`));p=m.index+m[0].length,r.push(f.createElement(this.replaceTokens(o.slice(s.length,m.index),n),d))}o=o.slice(p)}return o.length>0&&r.push(o),r.length===0?"":r.length===1&&typeof r[0]=="string"?r[0]:r}};function o5(e){var t;let{attributes:n,className:r,containerTagName:o,content:i,emptyContent:s,parsedContent:a,tagName:l,noWrap:c}=e,u=(t=o!=null?o:l)!==null&&t!==void 0?t:"span",f=u==="fragment"?!0:c,d;if(a)d=a;else{let p=new am(i!=null?i:"",e).parse();p.length>0&&(d=p)}return d||(d=s),f?ys.default.createElement(ys.default.Fragment,null,d):ys.default.createElement(sm,{attributes:n,className:r,tagName:u},d)}function yi(e){let T=e,{attributes:t,className:n,content:r="",disableFilters:o=!1,disableMatchers:i=!1,emptyContent:s=null,filters:a=[],matchers:l=[],onAfterParse:c=null,onBeforeParse:u=null,tagName:f="span",noWrap:d=!1}=T,p=ie(T,["attributes","className","content","disableFilters","disableMatchers","emptyContent","filters","matchers","onAfterParse","onBeforeParse","tagName","noWrap"]),m=i?[]:l,g=o?[]:a,v=u?[u]:[],h=c?[c]:[];m.forEach(C=>{C.onBeforeParse&&v.push(C.onBeforeParse.bind(C)),C.onAfterParse&&h.push(C.onAfterParse.bind(C))});let y=v.reduce((C,k)=>k(C,e),r!=null?r:""),S=new am(y,p,m,g),x=h.reduce((C,k)=>k(C,e),S.parse());return ys.default.createElement(o5,{attributes:t,className:n,containerTagName:e.containerTagName,emptyContent:s,noWrap:d,parsedContent:x.length===0?void 0:x,tagName:f})}var vi=b(Z());var i5=/[.*+?^${}()|[\]\\]/g,s5=/[^0-9A-Za-zÀ-ÖØ-öø-ÿ](?=[0-9A-Za-zÀ-ÖØ-öø-ÿ]*$)/;function a5(e){return e.replace(i5,"\\$&")}function l5(e,t){let n=e.split("").findIndex((r,o)=>r!==t[o]);return n>-1?n:Math.min(e.length,t.length)}function c5(e){return e.search(s5)}function MP(e,t=[]){let n=e;return t.forEach(r=>{if(!r)return;let o=new RegExp(`\\b(${a5(r)})\\b`,"gi");n=n.replace(o,"<strong>$1</strong>")}),n}function NP(e){return e.replace($u,'<mark data-type="placeholder">$1</mark>')}function ja(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function u5(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 sS(e,t,n={}){if(t){let r=l5(t.toLowerCase(),e.toLowerCase()),o=ja(e.substring(r,e.length));if(n.stripAgentPart){let l=e.substring(0,r),c=c5(l);return`<span style="opacity: 0.5">${l.substring(c+1)}</span>${o}`}let s=t.split(ew).length>3||t.length>30?u5(t.trim(),r):0;return`${`${s>0?"\u2026":""}${ja(e.substring(s,r))}`}<strong>${o}</strong>`}return e}var d5=/(<\/[a-zA-Z]+[0-9]?>|<[a-zA-Z]+\s?\/>|<br>)/i;function Zc(e){return d5.test(e)}function aS(e){var n;let t=document.createElement("template");return t.innerHTML=e,(n=t.content.textContent)!=null?n:""}var lm=b(Z()),DP=b(I()),OP=lm.default.createContext(void 0);function Ka(){let e=lm.default.useContext(OP);if(e===void 0)throw new Error("useCommandPalette must be used within the CommandPalette component");return e}var LP=({children:e,page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i})=>{let s=lm.default.useMemo(()=>({page:t,isOpen:n,onChangeOpen:r,selected:o,setSelected:i}),[n,t,o]);return(0,DP.jsx)(OP.Provider,{value:s,children:e})};var on=b(I()),f5=3,p5=90,FP=({children:e})=>{let t=z("CommandPalette",Fn);return(0,on.jsx)("div",{className:t.listItemActions,children:e})};function lS(p){var m=p,{closeOnSelect:e=!0,lineClamp:t,tooltip:n,children:r,onClick:o,extra:i,onSourceClick:s,description:a,sources:l,id:c,styles:u,defaultSourcesAmount:f=f5}=m,d=ie(m,["closeOnSelect","lineClamp","tooltip","children","onClick","extra","onSourceClick","description","sources","id","styles","defaultSourcesAmount"]);var O;let g=se(bo),[v,h]=(0,vi.useState)(!1),{selected:y,onChangeOpen:S}=Ka(),[x,T]=(0,vi.useState)(!1),C=z("CommandPalette",Fn);function k(U){o(U),e&&S(!1)}let R=(0,vi.useMemo)(()=>typeof a!="string"?a:Zc(a)?aS(a).trim():a,[a]),F=(0,vi.useMemo)(()=>typeof n!="string"?n:Zc(n)?aS(n).trim():n,[n]);return(0,vi.useEffect)(()=>{T(y===c)},[y]),(0,on.jsxs)("div",{className:(0,Jc.default)(C.listItem,c===y&&C.listItemSelected),children:[(0,on.jsxs)(wt,{placement:"right-start",tooltip:!0,onOpenChange:T,open:x,children:[(0,on.jsx)(wt.Trigger,A(E({className:C.listItemAction,"aria-disabled":(O=d.disabled)!=null?O:!1,onClick:k,"data-command-palette-item":!0,"data-item-id":c},d),{children:(0,on.jsxs)("div",{className:C.listItemContent,children:[typeof r=="string"?(0,on.jsx)("p",{className:(0,Jc.default)(C.listItemText,C.truncate,u==null?void 0:u.title),children:r}):r,R&&typeof R=="string"?(0,on.jsx)(yi,{tagName:"p",allowList:[],content:R,className:(0,Jc.default)(C.listItemDescription,u==null?void 0:u.description,t?C.lineClamp:C.truncate)}):a]})})),F&&F.length>p5&&(0,on.jsx)(wt.Content,{className:C.listItemTooltip,disableFocusManager:!0,children:(0,on.jsx)(yi,{className:C.listItemTooltipContent,allowList:["h1","h2","h3","h4","h5","h6","a","p","br"],tagName:"div",content:F.replace(/\n/g,"<br />")})})]}),c===y&&i,l&&l.length>0&&(0,on.jsxs)("div",{className:C.sources,children:[(0,on.jsx)("span",{className:C.sourcesTitle,children:g("sources")}),l.slice(0,v?l.length:f).map(U=>(0,on.jsx)("a",{className:C.source,href:U.url,target:"_blank",title:U.url,rel:"noopener noreferrer","data-testid":"source",onClick:()=>s==null?void 0:s(U),children:U.name},U.url)),!v&&l.length>f&&(0,on.jsx)("button",{className:(0,Jc.default)(C.source,C.sourceShowMore),type:"button",onClick:()=>h(!0),children:g("showMore",{amount:l.length-f})})]})]})}var eu=b(I()),zP=()=>(0,eu.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 256 512","aria-labelledby":"angleLeftTitle",children:[(0,eu.jsx)("title",{id:"angleLeftTitle",children:"AngleLeft"}),(0,eu.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 vs=b(I());function cS({children:e,title:t,id:n,onDismiss:r}){let o=se(bo),i=z("CommandPalette",Fn),{page:s}=Ka();return s!==n?null:(0,vs.jsxs)("div",{className:i.page,id:`page_${n}`,tabIndex:-1,children:[r&&(0,vs.jsxs)("div",{className:i.pageNav,children:[(0,vs.jsxs)("button",{className:i.pageBackButton,type:"button",onClick:r,children:[(0,vs.jsx)(zP,{}),o("back")]}),t&&(0,vs.jsx)("h3",{className:i.pageTitle,children:t})]}),e]})}var HP=b(Z());var tu=b(I()),Ga=()=>(0,tu.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 24 24",width:"1em",fill:"currentColor",children:[(0,tu.jsx)("path",{d:"M0 0h24v24H0z",fill:"none"}),(0,tu.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 yr=b(I());function m5({onChange:e,onChangeType:t,placeholder:n,typePlaceholder:r,types:o,value:i,selectedType:s},a){let l=z("CommandPalette",Fn);return(0,yr.jsxs)("div",{className:l.search,children:[(0,yr.jsx)("div",{className:l.searchIcon,children:(0,yr.jsx)(Ga,{})}),(0,yr.jsxs)("div",{className:l.searchInputWrapper,children:[(0,yr.jsx)("input",{ref:a,spellCheck:!1,autoComplete:"off",onChange:c=>{e(c.currentTarget.value)},onFocus:c=>{c.currentTarget.select()},className:l.searchInput,placeholder:n,value:i,type:"text",id:"command-palette-search-input",autoFocus:!0}),o&&o.length>0&&(0,yr.jsx)("div",{className:l.selectWrapper,children:(0,yr.jsxs)("select",{"data-testid":"command-palette-type-select",className:l.select,onChange:c=>t(c.target.value===r?void 0:c.target.value),value:s||r,children:[r&&(0,yr.jsx)("option",{children:r}),o.map(c=>(0,yr.jsx)("option",{value:c.value,children:c.label},c.value))]})})]})]})}var BP=(0,HP.forwardRef)(m5);var uS=b(De());var cm=b(I()),g5=o=>{var i=o,{onClick:e,shortKeys:t,children:n}=i,r=ie(i,["onClick","shortKeys","children"]);let s=z("CommandPalette",Fn);return(0,cm.jsxs)("button",A(E({type:"button"},r),{onClick:e,className:(0,uS.default)(s.actionButton,r.className,{[s.hasShortKeys]:t&&t.length>0}),children:[n,t==null?void 0:t.map(a=>(0,cm.jsx)("span",{className:(0,uS.default)(s.actionShortcut,a===8629&&s.actionShortcutFixKerning),children:typeof a=="number"?String.fromCharCode(a):a},a))]}))},UP=g5;var nu=b(I()),h5="[data-command-palette-item]";function Ss({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:c,children:u,isOpen:f,search:d,updateDeps:p=[]}){let[m,g]=(0,To.useState)(),v=(0,To.useRef)(null),h=()=>{o&&o(n),s(void 0),i(""),a(!1)},y=()=>{var U;if(r!==n&&o){o(n);return}if(l&&s){s(void 0),(U=v.current)==null||U.focus();return}if(d.length>0){i("");return}a(!1)},S=()=>{let U=x();U.length!==0&&g(U[0].dataset.itemId)},x=()=>Array.from(document.querySelectorAll(h5)||[]),T=U=>document.querySelector(`[data-item-id=${U}]`),C=U=>{let J=T(U);J&&g(J.dataset.itemId)},k=U=>{let J=T(U);J&&J.scrollIntoView({behavior:"smooth"})},R=()=>{if(!m)return;let U=x(),J=T(m);if(!J)return;let Y=U.indexOf(J),_=U[Y+1];_!=null&&_.dataset.itemId?C(_.dataset.itemId):S()},F=()=>{if(!m)return;let U=x(),J=T(m);if(!J)return;let Y=U.indexOf(J),_=U[Y-1];_!=null&&_.dataset.itemId?C(_.dataset.itemId):C(U[U.length-1].dataset.itemId)},O=(0,To.useCallback)(U=>{switch(U.key){case"ArrowDown":{U.preventDefault(),R();break}case"ArrowUp":{U.preventDefault(),F();break}case"Enter":{if(m){let J=T(m);J==null||J.click()}break}}},[m]);return(0,To.useEffect)(()=>{S()},[d,r,l,f,...p]),(0,To.useEffect)(()=>{m&&k(m)},[m]),(0,nu.jsx)($a,{autoFocus:!0,contentAriaLabel:"Search Results",overlayAriaLabel:"Command Palette",isOpen:f,onBack:y,onClose:h,onKeyDown:O,children:(0,nu.jsxs)(LP,{selected:m,setSelected:g,isOpen:f,onChangeOpen:a,page:r,children:[r===n&&(0,nu.jsx)(BP,{ref:v,onChange:i,onChangeType:s,placeholder:e,value:d,selectedType:l,types:c,typePlaceholder:t}),u]})})}Ss.Page=cS;Ss.List=Q0;Ss.Image=CP;Ss.ListItem=lS;Ss.ListItemActions=FP;Ss.Button=UP;var bt=Ss;var VP=b(Z());function WP(e,t){(0,VP.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 ru=b(Z());var $P={data:null,fetchState:"idle"},y5=e=>{var t;return(t=e.entities.data)!=null?t:null},um=fn([y5,Gs,Ob],(e,t,n)=>{var a;let r=[],{visitorName:o}=n!=null?n:{},{agentName:i,agentNickname:s}=t!=null?t:{};return i&&i!==o&&r.push(i),s&&s!==o&&r.push(s),(a=e==null?void 0:e.filter(l=>!r.includes(l.text)))!=null?a:null}),vr=ge("entities/getEntities",(e,t)=>M(null,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)})),v5=e=>e.filter((t,n)=>n===e.findIndex(r=>r.text===t.text)),S5=Re({name:"entities",initialState:$P,reducers:{},extraReducers:e=>{e.addCase(vr.pending,t=>{t.fetchState="loading"}).addCase(vr.rejected,t=>{t.fetchState="error"}).addCase(vr.fulfilled,(t,n)=>{t.fetchState="done",t.data=v5(t.data?[...t.data,...n.payload]:n.payload)}).addCase(lt,()=>$P)}}),jP=S5.reducer;var dS={};ht(dS,{enUS:()=>x5,nlNL:()=>w5});var x5={noResults:[{type:0,value:"No entities have been found"}],copy:[{type:0,value:"Copy"}],use:[{type:0,value:"Use"}]},w5={noResults:[{type:0,value:"Er zijn geen entiteiten gevonden"}],copy:[{type:0,value:"Kopieer"}],use:[{type:0,value:"Gebruik"}]};var KP={root:"dd-TYTKs",empty:"dd-AU7uT"};var qa=b(I()),b5=({onCopy:e})=>{let t=(0,ru.useRef)(null),n=z("EntitiesList",KP),r=G(um),{setSelected:o}=Ka(),i=se(dS),s=Ee();return(0,ru.useEffect)(()=>{s(vr())},[]),(0,ru.useEffect)(()=>{t.current&&(t.current.focus(),o("entity-0"))},[t]),(0,qa.jsxs)("div",{className:n.root,ref:t,tabIndex:-1,children:[r&&r.length>0&&(0,qa.jsx)(bt.List,{children:r.map((a,l)=>(0,qa.jsx)(bt.ListItem,{id:`entity-${l}`,closeOnSelect:!0,onClick:()=>e(a),children:a.text},a.text))},"entities"),r&&r.length===0&&(0,qa.jsx)("p",{className:n.empty,children:i("noResults")})]})},GP=b5;var fS=b(I()),dm=e=>(0,fS.jsx)("svg",A(E({xmlns:"http://www.w3.org/2000/svg",height:"16",width:"14",viewBox:"0 0 448 512"},e),{children:(0,fS.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 ou={};ht(ou,{enUS:()=>E5,nlNL:()=>C5});var E5={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"}]},C5={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 fm={trigger:"dd-dQ-OH",content:"dd-9k0N3",item:"dd-va6pa"};var xs=b(I()),T5=({suggestion:e,source:t,context:n})=>{let r=se(ou),o=G(Pr),i=Ze(),s=X("enableSuggestionFeedback"),a=`${e.text}`,l=G(Uo(`/admin/feedback?conversationId=${o}&type=${t}&text=${a}&data=${JSON.stringify({context:n})}`)),c=()=>{i("suggestion feedback",{text:e.text,source:t,context:n})};return!s||!l?null:(0,xs.jsxs)(wt,{placement:"top-end",children:[(0,xs.jsx)(wt.Trigger,{className:fm.trigger,children:(0,xs.jsx)(dm,{"data-testid":"feedback-dropdown-trigger"})}),(0,xs.jsx)(wt.Content,{className:fm.content,children:(0,xs.jsx)(wt.Button,{className:fm.item,as:"a",onClick:c,target:"_blank",href:l,children:r("giveFeedback")})})]})},pm=T5;var iu={};ht(iu,{enUS:()=>k5,nlNL:()=>R5});var k5={personalCollectionLink:[{type:0,value:"Go to Personal Collection"}],searchPlaceholder:[{type:0,value:"Start typing to search..."}],urlSuggestions:[{type:0,value:"URL 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"}],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?"}]},R5={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:"URL 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"}],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 nI=b(Z());var P5=["{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}"],I5=new RegExp(P5.map(e=>`(?:${e.replace("{","\\{").replace("}","\\}")})`).join("|"));function qP(e,t){let n=e.split(I5),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 c=r;if(l){let f=a.charAt(0),d=0;do c=f?t.indexOf(f,c+1):-1,d+=1;while(c!==-1&&a.indexOf(t.slice(c))!==0);if(c===-1&&d>2)return e}else c=a&&a!==""?t.indexOf(a,r):-1;let u=c===-1?t.slice(r):t.slice(r,c);o.push(u),r=c}return o.join("")}function YP(e,t){return typeof t=="boolean"?e:e.slice(0,t)}var QP={suggestions:[],fetchState:"idle"},XP={default:QP},ZP=e=>t=>{var n,r;return(r=(n=t.textSuggestions[e])==null?void 0:n.suggestions)!=null?r:[]},mm=e=>e.textSuggestions,JP=e=>{let t=e.toLowerCase();return n=>{let r=n.text.toLowerCase();return r.startsWith(t)&&r.length>t.length}},gm=Rt("textSuggestions/refresh"),Sr=ge("textSuggestions/recommendations",(e,t)=>M(null,null,function*(){var u,f,d;let{deepdeskAPI:n}=t.extra,r=t.getState(),{platformVariables:o}=r.info,{textSuggestionsCount:i,inlineSuggestions:s}=r.settings,a=Ni(r),l=(u=r.conversation.current)==null?void 0:u.id;if(!l)throw new Error("No current conversation to fetch text suggestions");if(!((f=r.profile.data)!=null&&f.recommendationEngine))return[];let c=[];if(e==="sticky-messages"){let p=(d=r.profile.data)==null?void 0:d.code;if(!p)throw new Error("No current profile to fetch pinned messages");c=yield n.getPinnedMessages(p)}else c=yield n.getTextSuggestions(l,bl(r),e);if(o&&(c=c.map(p=>E(A(E({},p),{text:or(p.text,o)}),p.title?{title:or(p.title,o)}:{}))),e==="default"){let p=s?c.filter(JP(a)):c;t.dispatch(Ho(p.slice(0,i)))}return c})),su=ge("textSuggestions/autocompletions",(e,t)=>M(null,null,function*(){var u,f;let{deepdeskAPI:n}=t.extra,r=t.getState(),o=(u=r.conversation.current)==null?void 0:u.id,{platformVariables:i}=r.info,{textSuggestionsCount:s,deanonymize:a,inlineSuggestions:l}=r.settings;if(!((f=r.profile.data)!=null&&f.recommendationEngine))return[];if(!o)throw new Error("No current conversation to fetch text suggestions");let c=yield n.getAutocompleteSuggestions(o,A(E({},bl(r)),{input:e}));if(!t.getState().input.text)throw new Error("Abort");return l&&(c=c.filter(JP(e))),i&&(c=c.map(d=>A(E({},d),{text:or(d.text,i)}))),a&&(c=c.map(d=>A(E({},d),{text:d.source!=="trie-with-typos"?qP(d.text,e):d.text}))),c=YP(c,s),t.dispatch(Ho(c)),c})),eI=Re({name:"textSuggestions",initialState:XP,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(Sr.pending,(t,n)=>{let r=n.meta.arg,o=t[r]||QP;return A(E({},t),{[r]:A(E({},o),{fetchState:"loading"})})}).addCase(Sr.rejected,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="error")}).addCase(Sr.fulfilled,(t,n)=>{let r=n.meta.arg;t[r]&&(t[r].fetchState="done",t[r].suggestions=n.payload)}).addCase(su.pending,t=>{t.default.fetchState="loading"}).addCase(su.rejected,t=>{t.default.fetchState="error"}).addCase(su.fulfilled,(t,n)=>{t.default.fetchState="done",t.default.suggestions=n.payload}).addCase(lt,()=>XP)}}),{setTextSuggestions:JK}=eI.actions,tI=eI.reducer;var ws=b(I()),A5=({types:e,commands:t,onClick:n})=>{let r=Ee(),o=se(iu),i=G(mm);return(0,nI.useEffect)(()=>{e.forEach(({type:s})=>{(!i[s]||i[s].suggestions.length===0)&&r(Sr(s))})},[]),(0,ws.jsxs)("div",{children:[t.length>0&&(0,ws.jsx)(bt.List,{heading:o("commands"),children:t.map((s,a)=>(0,ws.jsx)(bt.ListItem,{id:`command-${a}`,closeOnSelect:!1,onClick:s.onClick,children:s.label},s.label))}),e.map(({type:s,title:a})=>{var l;return(0,ws.jsx)(bt.List,{heading:a,orientation:"vertical",children:(l=i[s])==null?void 0:l.suggestions.map((c,u)=>(0,ws.jsx)(bt.ListItem,{id:`${s}-${u}`,closeOnSelect:!1,description:c.title&&c.text,onClick:()=>n(c.text,c),"data-testid":"search-overlay-suggestion",children:c.title||c.text},`${c.id}-${c.text}`))},s)})]})},rI=A5;var sn=b(I()),M5=200,N5=5,O5=4,pS=(e,t,n)=>e.slice(0,n?10:t.toLowerCase()==="image"?O5:N5),L5=(e,t)=>!t||e.toLowerCase().includes(t.toLowerCase()),D5=()=>{var Y,_,V;let e=Ee(),t=pn(),n=se(iu),[r,o]=(0,bn.useState)(!1),[i,s]=(0,bn.useState)(""),a=G($b),l=G(mi),[c,u]=(0,bn.useState)(),f=G(Pt),d=X("showSearch"),p=X("enableSuggestionFeedback"),m=X("showEntitiesCommand"),g=X("showImageSearch"),v=X("searchTriggerKey"),h=G(hP),y=G(ch),S=G(jb),x=G(Wb),T=((V=(_=(Y=l==null?void 0:l.uiConfig)==null?void 0:Y.search)==null?void 0:_.initialTypes)==null?void 0:V.filter(({isActive:B})=>B))||[],C=Ze(),k=(0,bn.useMemo)(()=>{let B=j=>pS(y.filter(K=>K.type===j.toUpperCase()),j,c),W=(h==null?void 0:h.map(j=>({value:j.code.toUpperCase(),label:`${j.name}s`,list:B(j.code.toUpperCase()),listOrientation:"vertical",lineClamp:!0})))||[];if(W.push({value:"PERSONAL",label:n("personalSuggestions"),list:B("PERSONAL"),lineClamp:!1,listOrientation:"vertical"},{value:"URL",label:n("urlSuggestions"),list:B("URL"),lineClamp:!1,listOrientation:"vertical"},{value:"STICKYMESSAGE",label:n("pinnedMessages"),list:B("STICKYMESSAGE"),lineClamp:!1,listOrientation:"vertical"}),g&&W.push({value:"IMAGE",label:n("imageSuggestions"),lineClamp:!1,list:B("IMAGE"),listOrientation:"horizontal"}),T.length===0)return W;let N=T.map(j=>W.find(K=>K.value.toLowerCase()===j.type)).filter(j=>!!j),q=W.filter(j=>!N.find(K=>K.value===j.value));return[...N,...q]},[h,T,g,c]),R=[{label:n("entitiesClipboard"),onClick:()=>e(qs("entities")),shouldShow:m&&L5(n("entitiesClipboard"),i)}].filter(B=>B.shouldShow).filter(()=>!c),F=(0,bn.useCallback)((0,oI.default)((B,W)=>{e(Fi({query:B,type:W,tags:["search-overlay"],size:c?50:20}))},M5),[c]),O=(0,bn.useCallback)((B,W)=>{W.type==="IMAGE"?t.send(dh,{suggestion:W}):t.send(eo,{text:B,suggestion:W}),e(ir(!1))},[e]),U=B=>{Ar(B.text),C("entity copied",{entity:B,type:"copy"}),e(ir(!1))};function J(B){return W=>{r?window.confirm(n("warning"))&&(B(W),o(!1)):B(W)}}return(0,bn.useEffect)(()=>{i?F(i,c):e(kd())},[i,c]),(0,bn.useEffect)(()=>{f&&e(jc())},[f]),WP(v,()=>{e(ir(!0)),C("open search",{via:"ctrl+k"})}),!d||!l?null:(0,sn.jsxs)(bt,{placeholder:n("searchPlaceholder"),typePlaceholder:n("typePlaceholder"),onChangeSearch:s,onChangeOpen:J(B=>e(ir(B))),onChangeType:B=>u(B),onChangePage:J(B=>e(qs(B))),selectedType:c,search:i,page:a,isOpen:x,types:k,updateDeps:[y],children:[(0,sn.jsxs)(bt.Page,{id:"search",children:[i.length===0&&(0,sn.jsx)(rI,{types:T,commands:R,onClick:O}),i.length>0&&(0,sn.jsxs)(bn.Fragment,{children:[R.length>0&&(0,sn.jsx)(bt.List,{heading:n("commands"),children:R.map((B,W)=>(0,sn.jsx)(bt.ListItem,{closeOnSelect:!1,onClick:B.onClick,id:`commands-${W}`,children:B.label},B.label))}),k.map(({value:B,label:W,list:N,lineClamp:q,listOrientation:j})=>(0,sn.jsx)(bt.List,{heading:W,orientation:j==="horizontal"?"horizontal":"vertical",onShowAll:()=>u(B),hasMore:!c&&S[B.toLowerCase()]>pS(N,B,c).length,children:pS(N,B,c).map(K=>(0,sn.jsx)(bt.ListItem,{id:`${B}-${K.id}`,closeOnSelect:!1,lineClamp:q,onClick:()=>O(K.text,K),description:B!=="IMAGE"?K.title&&K.text:void 0,tooltip:K.text,extra:p&&(0,sn.jsx)(bt.ListItemActions,{children:(0,sn.jsx)(pm,{context:i,source:"search",suggestion:K})}),children:B==="IMAGE"?(0,sn.jsx)(bt.Image,{title:K.title||K.text,src:K.image}):K.title||K.text},`${K.id}-${K.text}`))},B))]})]}),(0,sn.jsx)(bt.Page,{id:"entities",title:n("entitiesTitle"),onDismiss:J(()=>{e(qs("search"))}),children:(0,sn.jsx)(GP,{onCopy:U})})]})},iI=D5;var au=b(I()),F5=()=>{let e=X("showSearch"),t=X("isEmbedded");return(0,au.jsxs)(sI.Fragment,{children:[e&&(0,au.jsx)(iI,{}),t&&(0,au.jsx)(dP,{})]})},aI=F5;var dI=b(De());var hm=b(I()),lI=({className:e})=>(0,hm.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,hm.jsx)("g",{children:(0,hm.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
78
78
  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
79
79
  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
80
80
  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
81
- 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 Q0=E(P()),h5={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},UP=({className:e,color:t})=>(0,Q0.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,Q0.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:h5[t||"pink"]})});var VP={root:"dd-LbeUM",text:"dd-Dpfn1",isLoggedIn:"dd-XvHAn",isLoggedOut:"dd-21y-z",icon:"dd-8rLqS",logo:"dd-slXhD",lock:"dd-ByzlR"};var Z0={};yt(Z0,{enUS:()=>y5,nlNL:()=>v5});var y5={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},v5={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var vi=E(P()),WP=({onLogIn:e})=>{let t=ie(Z0),n=X("floatingMenu"),r=X("productName"),o=be(),s=G(Rt),i=O("FloatingMenu",VP);if(s===null||n===!1)return null;let a=()=>{s===!0?o(tr(!0)):e()};return(0,vi.jsxs)("button",{type:"button",className:(0,jP.default)(i.root,{[i.isLoggedIn]:s,[i.isLoggedOut]:!s}),onClick:a,children:[(0,vi.jsx)("div",{className:i.text,children:t(s?"search":"signin",{productName:r})}),(0,vi.jsxs)("div",{className:i.icon,children:[(0,vi.jsx)(UP,{className:i.logo,color:"pink"}),s===!1&&(0,vi.jsx)(BP,{className:i.lock})]})]})};var um=E(Z());function Ur(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:s}=e.input;return s.end<e.input.suggestionTextStart||s.start!==s.end?!1:s.end>=o.length?!0:t?n&&new RegExp(n).test(o.substring(s.end))||r&&new RegExp(r).test(o.substring(0,s.end))?!0:n===!1&&r===!1:!1}var S5={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1},rm=({ui:e})=>e.overlayCollapsed,$P=Re({name:"ui",initialState:S5,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:ou,setInputFocus:om,setOverlayCollapsed:ys,setOpenOverlayWhenTyping:KP,setOverlayCollapsedUserOverwrite:GP}=$P.actions,qP=$P.reducer;var YP={styleRow:"dd-prYfH",styleSuggestion:"dd-JTmXy"};var su=E(P()),x5=({match:e,selected:t,styles:n})=>(0,su.jsx)(de,{as:"button",selected:t,className:n.styleRow,"data-testid":"style-suggestion-item",title:e.suggestion,children:(0,su.jsx)("span",{className:n.styleSuggestion,children:e.suggestion})}),w5=({matches:e,selectedIndex:t})=>{let n=O("StyleSuggestionList",YP);return(0,su.jsx)(Ct,{children:e.map((r,o)=>(0,su.jsx)(x5,{match:r,selected:t===o,styles:n},`${r.keyword}-${o}`))})},sm=w5;var tI=E(Z());var vs=E(Z());var XP=E(Z());function QP(e,t,n){(0,XP.useEffect)(()=>{let r=e.current;return r?(r.addEventListener(t,n),()=>{r.removeEventListener(t,n)}):()=>{}},[e,t,n])}var ZP={root:"dd-1MBCO",actions:"dd--x4cy",closeIconContainer:"dd-1z5NR",closeIcon:"dd-8qMF-",badge:"dd-4Fpkz",formattedText:"dd-EzvTB",assistantContainer:"dd-j6o8F",formattedTextTruncated:"dd-fv169",assistantBadge:"dd-VD57E"};var iu=E(P()),JP=({title:e})=>(0,iu.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18px",height:"18px",viewBox:"0 0 24 24","aria-labelledby":"closeTitle",children:[(0,iu.jsx)("title",{id:"closeTitle",children:e}),(0,iu.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]});var J0={};yt(J0,{enUS:()=>b5,nlNL:()=>E5});var b5={assistant:[{type:0,value:"Assistant"}],close:[{type:0,value:"Close"}]},E5={assistant:[{type:0,value:"Assistent"}],close:[{type:0,value:"Sluiten"}]};var Ln=E(P()),T5=["search","personal-collection-search","search-autocomplete"];function k5(e,t,n,r={}){var s;let o="";return T5.includes(t)?o=uP(j0(e,n,{stripAgentPart:!0}),(s=r.searchKeywords)!=null?s:[n]):o=j0(e,n,r),r.placeholders===!0&&(o=dP(o)),o}var R5=()=>{},P5=({selected:e,suggestion:t})=>{let n=ie(J0),r=X("inlineSuggestions"),o=G(Ns),[s,i]=(0,vs.useState)(!1),a=X("enableSuggestionFeedback"),l=G(S=>S.input.text),c=be(),u=O("TextSuggestion",ZP),f=(0,vs.useRef)(null),d=t.source==="assistant",p=a&&!d;(0,vs.useEffect)(()=>{let S=setTimeout(()=>{c(nb({text:t.text,suggestion:t}))},500);return()=>{clearTimeout(S)}},[t]),QP(f,"click",()=>{c(Cn({suggestion:t,text:t.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let h=()=>{c(Ls({source:t.source,text:t.text,assistantCode:t.assistantCode}))},m=(0,vs.useMemo)(()=>k5(t.text,t.source,o,{stripAgentPart:r,placeholders:!0,searchKeywords:t.searchKeywords}),[r,t.text,t.source,o,t.searchKeywords]);return t.source==="gpt"&&!r?null:(0,Ln.jsxs)("div",{className:u.root,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),children:[(0,Ln.jsx)(de,{ref:f,as:"button","data-testid":"suggestions-overlay-item",selected:e,onClick:R5,children:t.source==="assistant"?(0,Ln.jsxs)("div",{className:u.assistantContainer,children:[(0,Ln.jsx)(gs,{containerTagName:"div",tagName:"span",className:u.formattedTextTruncated,content:m}),(0,Ln.jsx)("span",{className:u.assistantBadge,children:n("assistant")})]}):(0,Ln.jsx)(gs,{containerTagName:"div",tagName:"span",className:u.formattedText,content:m})}),p&&s&&(0,Ln.jsx)("div",{className:u.actions,children:(0,Ln.jsx)(Jp,{source:"overlay",context:l,suggestion:t})}),d&&s&&(0,Ln.jsx)("div",{className:u.closeIconContainer,children:(0,Ln.jsx)("button",{type:"button",className:u.closeIcon,onClick:h,title:n("close"),children:(0,Ln.jsx)(JP,{title:n("close")})})})]})},eI=P5;var nI=E(P()),I5=({suggestions:e,selectedIndex:t,reverse:n})=>(0,tI.useMemo)(()=>{let o=e.map((s,i)=>(0,nI.jsx)(eI,{index:i,selected:i===t,suggestion:s},`${s.text}-${s.source}`));return n?o.reverse():o},[e,t,n]),im=I5;var rI={root:"dd-PfvRI",paper:"dd-HYlyY"};var am={list:{keywordMatches:[]},fetchState:"idle"},lm=e=>e.styleSuggestions.list,Si=pe("styleSuggestions/getAll",(n,r)=>N(null,[n,r],function*({text:e},t){var l;let{deepdeskAPI:o}=t.extra,s=t.getState(),{showStyleSuggestions:i}=s.settings,a=(l=s.conversation.current)==null?void 0:l.profileCode;if(!i)return am.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),oI=Re({name:"styleSuggestions",initialState:am,reducers:{commitStyleSuggestion(e,t){let{keyword:n,suggestion:r}=t.payload;e.list.keywordMatches=e.list.keywordMatches.filter(o=>o.keyword.toLowerCase()!==n.toLowerCase()||o.suggestion!==r)}},extraReducers:e=>{e.addCase(Si.pending,t=>{t.fetchState="loading"}).addCase(Si.rejected,t=>{t.fetchState="error"}).addCase(Si.fulfilled,(t,n)=>{t.fetchState="done",Oo(t.list,n.payload)||(t.list=n.payload)}).addCase(Os,t=>{t.list=am.list}).addCase(lt,()=>am)}}),{commitStyleSuggestion:sI}=oI.actions,iI=oI.reducer;var cm=e=>{let t=new Set;return e.filter(({keyword:n,suggestion:r})=>{let o=JSON.stringify([n.toLowerCase(),r]);return t.has(o)?!1:(t.add(o),!0)})};var xi=E(P()),A5=()=>{var S;let e=(0,um.useRef)(null),t=O("InlineSuggestionsOverlay",rI),n=G(Ur),r=be(),o=G(Rt),s=G(zi),i=G(rm),a=X("showTextSuggestions"),l=G(Ms),c=G(gl),u=X("showStyleSuggestions"),f=X("showStyleSuggestionList"),d=G(lm),p=u&&f?cm((S=d.keywordMatches)!=null?S:[]):[],h=p.length>0,m=a&&l.length>0;return ls(()=>{setTimeout(()=>{r(ys({collapse:!0,skipWhenInputFocus:!0}))})}),(0,um.useEffect)(()=>{let y=e.current;if(!y||!y.parentElement)return;y.parentElement.style.left="0px";let g=y.getBoundingClientRect();y.parentElement.style.left=`${Math.min(window.innerWidth-4-g.right,0)}px`}),i||o!==!0||s===!1||!n&&!h||!m&&!h?null:(0,xi.jsx)("div",{className:t.root,"data-variant":"inline",children:(0,xi.jsxs)("div",{ref:e,className:t.paper,children:[h&&(0,xi.jsx)(sm,{matches:p,selectedIndex:-1}),m&&(0,xi.jsx)(Ct,{children:(0,xi.jsx)(im,{suggestions:l,selectedIndex:c})})]})})},aI=A5;var Ss=E(Z());var lI={root:"dd-7zvcP",dialogContent:"dd-4C0lK",continueButton:"dd-YUPQW",buttonContinueWrapper:"dd-IKpYs",nicknameInput:"dd-rxhGp",titleWrapper:"dd-nw3nD",title:"dd-5iof5",closeButtonWrapper:"dd-UUAzA",closeButton:"dd-7rjP5",buttonsWrapper:"dd-5e9Xb",errorMessage:"dd--5VgX",errorLink:"dd-u461n"};var eS={};yt(eS,{enUS:()=>_5,nlNL:()=>N5});var _5={title:[{type:0,value:"Enter your nickname"}],close:[{type:0,value:"Close"}],nicknameDialogTitle:[{type:0,value:"Please enter the name you'd like customers to see during chat conversations. This nickname will be used across your Deepdesk environment."}],nicknameDialogInputPlaceholder:[{type:0,value:"Enter your nickname"}],nicknameDialogContinueButton:[{type:0,value:"Continue"}],nicknameDialogError:[{type:0,value:"Nickname cannot be empty or spaces only"}],nicknameDialogEmojiError:[{type:0,value:"You cannot use emojis in this field."}],nicknameDialogSaveError:[{type:0,value:"We couldn't save your details just now. Please try again, or update it at "},{type:1,value:"account"},{type:0,value:".deepdesk.com/admin/user-settings"}],nicknameDialogSaveErrorWithoutLink:[{type:0,value:"We couldn\u2019t save your details just now. Please try again later, or update them in My Deepdesk \u2192 Settings."}]},N5={title:[{type:0,value:"Voer je bijnaam in"}],close:[{type:0,value:"Sluiten"}],nicknameDialogTitle:[{type:0,value:"Voer de naam in die je wilt dat klanten zien tijdens chatgesprekken. Deze bijnaam wordt gebruikt in je Deepdesk-omgeving."}],nicknameDialogInputPlaceholder:[{type:0,value:"Voer je bijnaam in"}],nicknameDialogContinueButton:[{type:0,value:"Doorgaan"}],nicknameDialogError:[{type:0,value:"Bijnaam mag niet leeg of alleen spaties zijn"}],nicknameDialogEmojiError:[{type:0,value:"Je kunt geen emoji's gebruiken in dit veld."}],nicknameDialogSaveError:[{type:0,value:"We konden je gegevens nu niet opslaan. Probeer het opnieuw of werk het bij op "},{type:1,value:"account"},{type:0,value:".deepdesk.com/admin/user-settings"}],nicknameDialogSaveErrorWithoutLink:[{type:0,value:"We konden je gegevens nu niet opslaan. Probeer het opnieuw later, of werk ze bij in My Deepdesk \u2192 Instellingen."}]};var ft=E(P()),cI=({onClose:e,onSave:t,id:n,error:r})=>{let[o,s]=(0,Ss.useState)(""),[i,a]=(0,Ss.useState)(!1),[l,c]=(0,Ss.useState)(!1),u=O("Nickname",lI),f=Ss.default.useRef(null),d=G(y=>y.info.showNicknameDialog),p=ie(eS),h=X("adminUrl");(0,Ss.useEffect)(()=>{r&&a(!0)},[r]);let m=()=>{if(!f.current)return;o.trim()?f.current.setCustomValidity(""):f.current.setCustomValidity(p("nicknameDialogError")),f.current.reportValidity()},S=y=>{y.preventDefault();let g=o.trim(),v=y.currentTarget.querySelector("#nickname-input");if(!g){v.setCustomValidity(p("nicknameDialogError")),v.reportValidity();return}v.setCustomValidity(""),t(g)};return(0,ft.jsxs)(Ha,{isOpen:d,"datatest-id":n,onClose:e||(()=>{}),onBack:e||(()=>{}),children:[(0,ft.jsx)("div",{className:u.titleWrapper,children:(0,ft.jsx)("h1",{className:u.title,children:p("title")})}),(0,ft.jsxs)("form",{className:u.dialogContent,onSubmit:S,children:[(0,ft.jsx)("p",{children:p("nicknameDialogTitle")}),i&&r&&(0,ft.jsx)("div",{className:u.errorMessage,children:h?(()=>{let y=p("nicknameDialogSaveError",{account:h}),g=`${h}.deepdesk.com/admin/user-settings`,v=y.indexOf(g);if(v!==-1){let x=y.substring(0,v),C=y.substring(v+g.length);return(0,ft.jsxs)(ft.Fragment,{children:[x,(0,ft.jsx)("a",{href:g,target:"_blank",rel:"noopener noreferrer",className:u.errorLink,children:g}),C]})}return y})():p("nicknameDialogSaveErrorWithoutLink")}),(0,ft.jsx)("input",{required:!0,minLength:1,maxLength:20,"data-testid":"nickname-input",id:"nickname-input",className:u.nicknameInput,type:"text",placeholder:p("nicknameDialogInputPlaceholder"),value:o,onChange:y=>{c(new RegExp("\\p{Extended_Pictographic}","u").test(y.target.value)),s(y.target.value)},onBlur:m,ref:f}),l&&(0,ft.jsx)("div",{className:u.errorMessage,role:"alert",children:p("nicknameDialogEmojiError")}),(0,ft.jsxs)("div",{className:u.buttonsWrapper,children:[r?(0,ft.jsx)("div",{className:u.closeButtonWrapper,children:(0,ft.jsx)("button",{type:"button",className:u.closeButton,onClick:()=>e==null?void 0:e(),children:p("close")})}):null,(0,ft.jsx)("div",{className:u.buttonContinueWrapper,children:(0,ft.jsx)("button",{type:"submit",className:u.continueButton,disabled:!o.trim()||new RegExp("\\p{Extended_Pictographic}","u").test(o),children:p("nicknameDialogContinueButton")})})]})]})]})};var au=E(P()),M5=({children:e})=>{let n=X("locale").replace("-","");return(0,au.jsx)(rh.Provider,{value:n,children:e})},L5=({store:e,customStyles:t={},children:n})=>(0,au.jsx)(nw,{store:e,children:(0,au.jsx)(M5,{children:(0,au.jsx)(ol.Provider,{value:t,children:n})})}),bo=L5;var fm=E(De()),Wa=E(Z());var uI=E(Z());function dI(e,t){let[n,r]=(0,uI.useState)(()=>{if(typeof window=="undefined")return t;try{let s=window.localStorage.getItem(e);return s?JSON.parse(s):t}catch(s){return ee.error(s),t}});return[n,s=>{try{let i=s instanceof Function?s(n):s;r(i),typeof window!="undefined"&&window.localStorage.setItem(e,JSON.stringify(i))}catch(i){ee.error(i)}}]}var fI=()=>/Mac/i.test(navigator.platform);var mI=E(De()),Eo=E(Z());var tS={};yt(tS,{enUS:()=>O5,nlNL:()=>D5});var O5={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"}]}]},D5={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 pI={root:"dd-uTPjX",anchor:"dd-C8lsZ",anchorButton:"dd-IoSx9"};var xs=E(P()),nS=(e,t,n)=>r=>(0,xs.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),F5=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let s=ie(tS),i=dn(),a=O("Login",pI),l=X("productName"),c=(0,Eo.useCallback)(S=>{S.preventDefault(),r&&r(Number.parseInt(S.target.value,10))},[]),u=(0,Eo.useCallback)(S=>{S.preventDefault(),i.send(ji,!0)},[t]),f=(0,Eo.useMemo)(()=>S=>(0,xs.jsx)("a",{onClick:g=>{g.preventDefault(),o()},href:t,className:a.anchor,target:"_blank",rel:"noreferrer",children:S},"login"),[t]),d=(0,Eo.useCallback)(S=>(0,xs.jsx)("button",{type:"button",className:a.anchorButton,onClick:u,children:S},"prompt"),[u]),{min:p,hour:h,day:m}=(0,Eo.useMemo)(()=>({min:nS(a,600,c),hour:nS(a,3600,c),day:nS(a,3600*12,c)}),[]);return(0,xs.jsxs)("div",{className:(0,mI.default)(e,a.root),children:[s("loginPlease",{login:n?d:f,productName:l}),r&&(0,xs.jsxs)(Eo.Fragment,{children:[(0,xs.jsx)("br",{}),s("snooze",{min:p,hour:h,day:m})]})]})},dm=F5;var gI={root:"dd-DoQhb",text:"dd-Jwnev"};var lu=E(P()),z5=({title:e})=>{let t=O("SearchTrigger",gI),n=be(),r=Ze();return(0,lu.jsxs)("button",{type:"button",className:t.root,onClick:()=>{n(tr(!0)),r("open search",{via:"autocomplete-overlay"})},children:[(0,lu.jsx)(Va,{}),(0,lu.jsx)("span",{className:t.text,children:e})]})},hI=z5;var rS={};yt(rS,{enUS:()=>H5,nlNL:()=>B5});var H5={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"}],dismiss:[{type:0,value:"Dismiss"}],dismissError:[{type:0,value:"Dismiss error"}]},B5={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"}],dismiss:[{type:0,value:"Sluiten"}],dismissError:[{type:0,value:"Foutmelding sluiten"}]};var yI={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",loginError:"dd-KCXeb",loginErrorMessage:"dd-Bv-BG",loginErrorDismiss:"dd-iSCjU"};var Ne=E(P()),U5=({onLogIn:e})=>{var U;let t=O("SuggestionsOverlay",yI),n=ie(rS),r=G(Ur),o=G(tb),s=be(),i=(0,Wa.useRef)(null),a=X("searchTriggerKey"),l=X("productName"),c=G(rm),u=G(Rt),f=G(jw),d=G(zi),[p,h]=(0,Wa.useState)(null),m=X("showSearch"),S=X("showTextSuggestions"),y=X("adminUrl"),g=X("isEmbedded"),v=X("suggestionsPlacement"),[x,C]=dI("dd-snooze-until-ms",0),T=c||x>Date.now(),k=G(Ms),A=G(gl),H=X("showStyleSuggestions"),D=X("showStyleSuggestionList"),B=G(lm),J=H&&D?cm((U=B.keywordMatches)!=null?U:[]):[],Y=J.length>0,_=k.filter(M=>M.source!=="gpt").length,V=()=>{T&&C(0),s(GP(!T))},z=M=>{let q=Date.now()+M*1e3;C(q),ee.info(`Snooze until: ${new Date(q)}`),s(ys({collapse:!0}))};return(0,Wa.useEffect)(()=>{_===0&&h(null)},[k,_]),ls(()=>{s(ys({collapse:!0,skipWhenInputFocus:!0}))}),u===null||d===!1?null:u===!1?(0,Ne.jsxs)("div",{ref:i,className:(0,fm.default)(t.root,{[t.isCollapsed]:T}),children:[!T&&(0,Ne.jsxs)("div",{className:t.triggers,children:[(0,Ne.jsx)("div",{style:{flex:1}}),(0,Ne.jsx)("div",{className:t.triggersRight,children:(0,Ne.jsx)(Rs,{className:t.toggleButton,title:n("collapse"),onClick:V,isCollapsed:!1})})]}),(0,Ne.jsx)("div",{className:t.toggleButtonWrapper,children:(0,Ne.jsx)(Rs,{className:t.toggleButton,title:n("open",{productName:l}),onClick:V,isCollapsed:!0})}),(0,Ne.jsxs)("div",{className:t.collapsible,children:[f&&(0,Ne.jsxs)("div",{className:t.loginError,children:[(0,Ne.jsx)("span",{className:t.loginErrorMessage,children:f}),(0,Ne.jsx)("button",{type:"button",className:t.loginErrorDismiss,onClick:()=>s(nd()),"aria-label":n("dismissError"),children:n("dismiss")})]}),(0,Ne.jsx)(dm,{loginUrl:y,isEmbedded:g,onLogIn:e,onSnooze:z})]})]}):!o||!r&&!Y?null:(0,Ne.jsxs)("div",{ref:i,className:(0,fm.default)(t.root,{[t.isCollapsed]:T}),children:[!T&&(0,Ne.jsxs)("div",{className:t.triggers,children:[(0,Ne.jsx)("div",{style:{flex:1},children:m&&(0,Ne.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>h(n(fI()?"searchHintMac":"searchHintWindows",{searchTriggerKey:a.toUpperCase()})),onMouseLeave:()=>h(null),children:(0,Ne.jsx)(hI,{title:n("search")})})}),(0,Ne.jsxs)("div",{className:t.triggersRight,onFocus:()=>{},children:[(0,Ne.jsx)("div",{className:(0,fm.default)(!p&&t.hintsHidden,t.hints),children:p}),(0,Ne.jsx)(Rs,{className:t.toggleButton,title:n("collapse"),onClick:V,isCollapsed:!1})]})]}),(0,Ne.jsx)("div",{className:t.toggleButtonWrapper,children:(0,Ne.jsx)(Rs,{className:t.toggleButton,title:n("open",{productName:l}),onClick:V,isCollapsed:!0})}),(Y||_>0&&S)&&(0,Ne.jsxs)("div",{className:t.collapsible,onFocus:()=>{},children:[Y&&(0,Ne.jsx)(sm,{matches:J,selectedIndex:-1}),_>0&&S&&(0,Ne.jsx)(Ct,{children:(0,Ne.jsx)(im,{suggestions:k,selectedIndex:A,reverse:v==="above"})})]})]})},vI=U5;var Tm=E(De());var ko=E(Z());var $a=E(Z());function pm(e){return e.contentEditable==="true"}function V5(e){let t=0,n=0,r=window.getSelection();if(r.rangeCount!==0){let o=r.getRangeAt(0),s=o.cloneRange();s.selectNodeContents(e),s.setEnd(o.endContainer,o.endOffset),n=s.toString().length,s.selectNodeContents(e),s.setEnd(o.startContainer,o.startOffset),t=s.toString().length}return{selectionStart:t,selectionEnd:n}}function SI(e){let{selectionStart:t,selectionEnd:n}=pm(e)?V5(e):e;return[t,n]}function xI(e){let[,t]=(0,$a.useState)(),n=(0,$a.useRef)(null);return n.current=SI(e),(0,$a.useEffect)(()=>{let r=()=>{var a;let[o,s]=(a=n.current)!=null?a:[],i=SI(e);(!i||o!==i[0]||s!==i[1])&&(n.current=i,t({}))};return e.addEventListener("keyup",r),e.addEventListener("click",r),e.addEventListener("focus",r),document.addEventListener("selectionchange",r),()=>{e.removeEventListener("keyup",r),e.removeEventListener("click",r),e.removeEventListener("focus",r),document.removeEventListener("selectionchange",r)}},[e]),n.current}function wI(e,t){if(!t)return;let n=e,{value:r}=n,[o,s]=t,i=r.match(Hu);if(!i||i.length===0)return;let a=0;i.find(l=>{let c=r.indexOf(l,a);return o>c&&s<c+l.length?(n.selectionStart=c,n.selectionEnd=c+l.length,!0):(a=c+l.length,!1)})}var bI=E(Z()),j5=["div","span","mark","strong","b","i","u","em"];function oS(e,t,n=0){var s;let r=e[e.length-1],o=typeof r=="object"&&r!==null?(s=r.props)==null?void 0:s.tagName:void 0;if(o==="br")return e.pop(),[...e,...t,r];if(j5.includes(o)){let i=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,bI.cloneElement)(r,{children:oS(i,t,n+1)})]}return[...e,...t]}function wi(e){return e.tagName.toLowerCase()==="textarea"}var EI={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 RI=E(De());var xm=E(Z());var Ka=E(Z());function CI(e,t){let n;return[(...r)=>{window.cancelAnimationFrame(n);let o=t?t(...r):r;n=window.requestAnimationFrame(()=>{e(...o)})},()=>window.cancelAnimationFrame(n)]}function mm(e){let t=(0,Ka.useRef)(null),[n,r]=(0,Ka.useState)(!1);return(0,Ka.useEffect)(()=>{var u;let o=!1,s=Number.parseFloat((u=window.getComputedStyle(document.body).zoom)!=null?u:"1"),[i,a]=CI((f,d)=>{let p=t.current;if(!p)return;let h=f/s,m=d/s,S=p.getBoundingClientRect(),y=h>S.x&&h<S.x+S.width&&m>S.y&&m<S.y+S.height;y&&!o?(o=!0,r(!0)):!y&&o&&(o=!1,r(!1))},({clientX:f,clientY:d})=>[f,d]),[l,c]=CI(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",i),e.addEventListener("mouseleave",l),()=>{a(),c(),e.removeEventListener("mousemove",i),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function gm(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function hm(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function TI(e){return e!=null}var kI=E(De()),ym=E(Z());var Co={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 sS=E(P()),vm=(0,ym.forwardRef)((o,r)=>{var s=o,{className:e,children:t}=s,n=se(s,["className","children"]);let i=(0,ym.useRef)(null),a=O("TabCompletion",Co);return(0,sS.jsx)("div",I(b({ref:hm([i,r]),className:(0,kI.default)(e,a.popoverContentContainer)},n),{children:(0,sS.jsx)("div",{className:a.popoverContent,children:t})}))});var ws=E(P()),W5=e=>t=>{let n=Wv(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},$5=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let s=O("TabCompletion",Co),i=ap(),a=(0,xm.useMemo)(()=>W5(e.getBoundingClientRect()),[e]),[l,c]=mm(e);return(0,xm.useEffect)(()=>{c?i.open():i.close()},[c]),(0,ws.jsxs)("span",{children:[(0,ws.jsx)("mark",{ref:hm([l,i.triggerRef]),className:(0,RI.default)(s.matchKeyword,{[s.hover]:c}),"aria-haspopup":"dialog","aria-expanded":i.opened?"true":"false",children:r}),i.opened&&(0,ws.jsx)(Ea,{className:s.popover,triggerRef:i.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,ws.jsx)(vm,{style:n,children:(0,ws.jsx)("div",{className:s.hintText,children:o})})})]})},Sm=class extends So{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(b({},o),{keywordRegex:new RegExp(`\\b${gm(o.keyword)}\\b`,"i")})),this.keywordMatches=r.keywordMatches),this.usedKeywordMatches.clear(),n}match(n){let r=this.preparedKeywordMatches.map(s=>{if(this.usedKeywordMatches.has(s))return null;let i=n.match(s.keywordRegex);if(!i)return null;let a=n.charAt(i.index-1),l=n.charAt(i.index+s.keyword.length);return a==="{"&&l==="}"?null:{index:i.index,length:i[0].length,match:i[0],matchString:i[0],suggestion:s.suggestion,preparedKeywordMatch:s,valid:!0}}).filter(TI);if(r.length===0)return null;let o=r.reduce((s,i)=>i.index<s.index?i:s);return this.usedKeywordMatches.add(o.preparedKeywordMatch),o}replaceWith(n,r){return(0,ws.jsx)($5,{inputElement:r.inputElement,suggestion:r.suggestion,inputStyle:r.inputStyle,boundaryRef:r.boundaryRef,children:n},`keyword_${r.matchString}_${r.key}`)}asTag(){return"mark"}};var PI=E(De());var iS=E(P()),K5=({inputElement:e,children:t})=>{let n=O("TabCompletion",Co),[r,o]=mm(e);return(0,iS.jsx)("mark",{ref:r,className:(0,PI.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},wm=class extends So{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,iS.jsx)(K5,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var Em=E(De());var sn=E(Z());var aS=E(P()),II=()=>(0,aS.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,aS.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 Vr=E(Z());var _I=E(M0());var AI={root:"dd-ky-Bv",content:"dd-kV5e1"};function bm(e,t,n){var o;let r=((o=e.imageSizes)==null?void 0:o[t])||e.image||n;if(!r)return null;try{return new URL(r).toString()}catch(s){return null}}function lS(e){return e.replace("https://www.","").replace("https://","")}var qn=E(P()),G5=3,q5=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),Y5=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=G5})=>{let s=O("LinkSearch",AI),[i,a]=(0,Vr.useState)(""),l=be(),c=G(AP("url")),u=G(Tb("URL")),f=(0,Vr.useMemo)(()=>u.map(q5),[u]),[d,p]=(0,Vr.useState)(f.length-1),h=X("fallbackImage"),m=v=>{let x=v.target;a(x.value)},S=(v,x)=>{v.stopPropagation(),v.preventDefault(),window.open(x,"_blank")},y=v=>{var T;let x=d-1<0?f.length-1:d-1,C=d+1===f.length?0:d+1;v.code==="Escape"&&(a(""),t()),v.code==="ArrowUp"&&p(x),v.code==="ArrowDown"&&p(C),v.code==="Enter"&&e(((T=f[d])==null?void 0:T.text)||i)},g=(0,Vr.useCallback)((0,_I.default)(v=>{l(Ds({query:v,type:"URL",tags:["link-search"]}))},300),[]);return(0,Vr.useEffect)(()=>{i&&g(i)},[i]),(0,Vr.useEffect)(()=>()=>{l(fd())},[]),(0,qn.jsxs)("div",{className:s.root,children:[(0,qn.jsx)(Ct,{withDivider:!0,children:(i?f:c).slice(0,o).map((v,x)=>(0,qn.jsx)(de,{selected:d===x,onClick:()=>e(v.text),"data-testid":"linksearch-suggestion",children:(0,qn.jsxs)(Se,{children:[(0,qn.jsx)(Se.Image,{src:bm(v,"small",h||void 0),title:v.title||v.text}),(0,qn.jsxs)(Se.Content,{className:s.content,cropText:!0,children:[(0,qn.jsx)(Se.Title,{children:v.title||lS(v.text)}),v.title&&lS(v.text)]}),(0,qn.jsx)(de.Actions,{children:(0,qn.jsx)(de.ActionButton,{label:r,onClick:C=>S(C,v.text)})})]})},v.text))}),(0,qn.jsx)(Bc,{value:i,onChange:m,autoFocus:!0,placeholder:n,onKeyUp:y})]})},NI=Y5;var cS={};yt(cS,{enUS:()=>X5,nlNL:()=>Q5});var X5={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}],addToPersonalCollection:[{type:0,value:"Add to Personal Collection"}]},Q5={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}],addToPersonalCollection:[{type:0,value:"Toevoegen aan Personal Collection"}]};var Lt=E(P()),Z5=(0,sn.forwardRef)((e,t)=>{let n=O("TabCompletion",Co);return(0,Lt.jsx)("mark",{ref:t,className:(0,Em.default)(n.matchSelection)},"selection-start")}),J5=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let s=ie(cS),i=O("TabCompletion",Co),a=X("addToPersonalCollection"),l=G(zo("/admin/personal-collection/new")),c=(0,sn.useRef)(null),u=(0,sn.useRef)(null),[f,d]=(0,sn.useState)(null),p=be(),h=ap(document.activeElement===r),[m]=(0,sn.useState)(()=>document.createRange());h.triggerRef.current=m,(0,sn.useEffect)(()=>()=>m.detach(),[]),(0,sn.useEffect)(()=>{let y=e.current,g=c.current;!y||!g||(m.setStart(y,0),m.setEnd(g,0))},[e.current,c.current]),ls(()=>{h.close()});let S=(0,sn.useCallback)(y=>{let g=m.toString(),v=/^http(s?):\/\//.test(y)?y:`https://${y}`,x=`[${g}](${v})`;p(Cn({text:x,suggestion:{text:x,source:"search-url",type:"url"},eventMetrics:{inputType:"mouse"},replace:"selection"}))},[]);return(0,Lt.jsxs)("span",{children:[(0,Lt.jsx)("mark",{ref:c,className:(0,Em.default)(i.matchSelection),"aria-haspopup":"dialog","aria-expanded":h.opened?"true":"false",children:o}),h.opened&&(0,Lt.jsx)(Ea,{className:i.popoverRoot,triggerRef:h.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,Lt.jsxs)(vm,{style:n,ref:u,children:[(0,Lt.jsxs)("div",{className:(0,Em.default)(i.selectionOptions,{[i.selectionOptionsIsHidden]:f!==null}),children:[(0,Lt.jsxs)("button",{type:"button",tabIndex:f===null?-1:void 0,className:i.selectionOptionsButton,onClick:()=>d("insertLink"),children:[(0,Lt.jsx)(II,{}),(0,Lt.jsx)("span",{children:"\xA0"}),(0,Lt.jsx)("span",{children:s("insertLink")})]}),a&&l&&(0,Lt.jsx)("button",{type:"button",tabIndex:f===null?-1:void 0,className:i.selectionOptionsButton,onClick:()=>{let y=m.toString(),g=`${l}?text=${encodeURIComponent(y)}`;window.open(g,"_blank")},children:(0,Lt.jsx)("span",{children:s("addToPersonalCollection")})})]}),f==="insertLink"&&(0,Lt.jsx)(NI,{placeholder:s("linkInputPlaceholder"),visitUrlText:s("visitUrl"),onSelectLink:S,onDismiss:()=>{d(null),h.close()}})]})})]},"selection-end")},Cm=class extends So{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,sn.createRef)(),this.foundIndex=0,n}match(n){if(!this.props||this.props.selection===null||this.foundIndex===2)return null;let[r,o]=this.props.selection;if(r===o)return null;let s=this.foundIndex===0?r:o,i=s>=this.charCount&&s<=this.charCount+n.length?{index:s-this.charCount,length:0,match:"",valid:!0}:null;i&&this.foundIndex++;let a=this.foundIndex===1;return i&&a?this.charCount+=s-this.charCount:this.charCount+=n.length,i?b({isStart:a},i):null}replaceWith(n,r){return r.isStart?(0,Lt.jsx)(Z5,{ref:this.startRef}):(0,Lt.jsx)(J5,{inputElement:r.inputElement,startRef:this.startRef,boundaryRef:r.boundaryRef,inputStyle:r.inputStyle})}asTag(){return"mark"}};var To=E(P()),e6=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:s,keywordMatches:i,inputElement:a,source:l})=>{let c=O("TabCompletion",EI),u=X("insertLink"),f=X("addToPersonalCollection"),d=X("showMidSentenceSuggestions"),p=X("inlineSuggestions"),h=xI(a),m=(0,ko.useRef)(null),S=G(Rt);(0,ko.useEffect)(()=>{wi(a)&&h&&wI(a,h)},[h]);let y=(0,ko.useCallback)(x=>{if(!o||!n)return x;let C=[(0,To.jsx)("span",{className:c.resetIndent,children:"\u200B"},"u200B"),(0,To.jsx)("span",{"data-testid":"tab-completion",className:(0,Tm.default)(c.tabText,c.resetIndent),"data-source":l,children:n},"tabText")];return r&&C.push((0,To.jsx)("span",{className:(0,Tm.default)(c.hint,c.resetIndent),children:(0,To.jsx)(Du,{keyCode:"tab"},"tabHint")},"tabHint")),oS(x,C)},[o,n,r]),g=(0,ko.useMemo)(()=>{let x=[];return(u||f)&&x.push(new Cm("selection")),x.push(new wm("placeholders")),s&&x.push(new Sm("keywords")),x},[p,u,f,s]),v=(0,ko.useMemo)(()=>{let x=window.getComputedStyle(a);return{"--dd-color":x.color,"--dd-font-size":x.fontSize,"--dd-font-family":x.fontFamily,"--dd-font-variant":x.fontVariant}},[]);return!e||!S?null:(0,To.jsxs)("div",{ref:x=>{x!=null&&x.parentElement&&(m.current=x==null?void 0:x.parentElement)},className:c.root,style:v,children:[(0,To.jsx)(gs,{tagName:"span",containerTagName:"div",className:(0,Tm.default)(c.container,c.agentText),disableLineBreaks:wi(a),content:t||"\u200B",onAfterParse:y,matchers:g,selection:h,keywordMatches:i,inputElement:a,inputStyle:v,boundaryRef:m,inlineSuggestionsOnlyAtEnd:!d}),(0,To.jsx)("br",{})]},"tab-completion")},t6=e=>{var y,g,v;let{input:t,ui:n,settings:r,styleSuggestions:o,conversation:s}=e,i=Hi({input:t}),a=(i==null?void 0:i.text)||"",l=(i==null?void 0:i.source)||"",c=(y=t.html)!=null?y:Ba(t.text),u=t.text.slice(t.suggestionTextStart,t.selection.end),f=a.indexOf(u)===0?a.slice(u.length):"",{showTabHint:d}=n,{isSupported:p}=s,{showTabCompletion:h,visible:m,showStyleSuggestions:S}=r;return{showTabHint:d,showStyleSuggestions:S,showTabCompletion:h&&Ur(e),content:c,tabText:f,source:l,keywordMatches:(v=(g=o.list)==null?void 0:g.keywordMatches)!=null?v:[],enabled:m&&p!==!1}},MI=tw(t6)(e6);var bs=E(Z());var n6={token:null,interval:null},uS=pe("passwordlessToken/getTemporaryPasswordlessToken",(e,t)=>N(null,null,function*(){let{deepdeskAPI:n}=t.extra;return{token:yield n.requestPasswordlessToken()}})),dS=pe("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(uS()),setInterval(()=>r(uS()),n)}),LI=Re({name:"passwordlessToken",initialState:n6,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(uS.fulfilled,(t,n)=>{t.token=n.payload.token}),e.addCase(dS.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:OI}=LI.actions,DI=LI.reducer;function r6(e){return"buttonText"in e&&"eventName"in e}function FI(e){if(e)return r6(e)?{label:e.buttonText,event:e.eventName,value:e.payload}:e}function o6(e){return e==null?void 0:e.map(t=>FI(t))}function s6(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}var zI=Gt([tE,rd],(e,t)=>(t?e.filter(o=>!o.externalConversationId||o.externalConversationId===t):e).map(o=>{let s=FI(o.callToAction),i=o6(o.callToActions);return I(b(b(b({text:o.response,title:o.name},s?{callToAction:s}:{}),i!=null&&i.length?{callToActions:i}:{}),o.message!==void 0?{message:o.message}:{}),{editable:o.editable,isLoading:o.isLoading,evaluationId:o.evaluationId,rule:{id:s6(o.code),label:o.code,name:o.name,description:o.name}})}));var km=E(Z()),pS=E(De());var fS=E(P()),Ga=()=>(0,fS.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,fS.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 HI={root:"dd-WcEru",entity:"dd-LfP8y",entityText:"dd-L-v0f",iconWrapper:"dd-9Deh1",icon:"dd-tM7E2",iconClicked:"dd-EEdDL"};var jr=E(P()),i6=({entities:e})=>{let t=O("EntitiesWidgetList",HI),[n,r]=(0,km.useState)(void 0),o=Ze(),s=()=>{r(void 0)},i=a=>{e&&(r(e.indexOf(a)),Ir(a.text),o("entity copied",{entity:a,type:"copy"}))};return(0,km.useEffect)(()=>{let a=setTimeout(s,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,jr.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,jr.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>i(a),children:[(0,jr.jsx)("span",{className:t.entityText,children:a.text}),(0,jr.jsxs)("span",{className:t.iconWrapper,children:[(0,jr.jsx)("span",{className:(0,pS.default)(t.icon),children:(0,jr.jsx)(Ga,{})}),(0,jr.jsx)("span",{className:(0,pS.default)(t.icon,n===l&&t.iconClicked),children:(0,jr.jsx)(Ga,{})})]})]},a.text))})},BI=i6;var mS=E(P()),UI=()=>(0,mS.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,mS.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 qI=E(Z());var VI={root:"dd-ohnXe",trigger:"dd-7i-S3",button:"dd-t53Cg",nav:"dd-qZFnm",item:"dd-FZC0F"};var jI={root:"dd-nazq3",rotation:"dd-3EHTv"};var $I=E(P()),a6=({size:e=12})=>{let t=O("LoadingSpinner",jI);return(0,$I.jsx)("span",{"data-testid":"loading-spinner",style:{width:`${e}px`,height:`${e}px`},className:t.root})},WI=a6;var gS=E(P()),KI=()=>(0,gS.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",fill:"currentColor",children:(0,gS.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32z"})});var cu=E(P()),GI=e=>(0,cu.jsxs)("svg",I(b({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 448 512","aria-labelledby":"checkTitle"},e),{children:[(0,cu.jsx)("title",{id:"checkTitle",children:"Check"}),(0,cu.jsx)("path",{fill:"#666",d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})]}));var hS={};yt(hS,{enUS:()=>l6,nlNL:()=>c6});var l6={error:[{type:0,value:"Something went wrong"}]},c6={error:[{type:0,value:"Er ging iets fout"}]};var On=E(P()),u6=3e3,d6=({assistantOptions:e})=>{let t=O("OnDemandAssistants",VI),n=ie(hS),r=(0,qI.useRef)(),o=hd(fn),s=G(XR),i=Ze(),a=s.filter(u=>u.isPinned),l=s.filter(u=>!u.isPinned),c=u=>N(null,null,function*(){clearTimeout(r.current),i("trigger on demand assistant",{assistantCode:u}),yield o.call(I(b({},e),{assistantCode:u})),r.current=setTimeout(()=>o.reset(),u6)});return s.length===0?null:(0,On.jsxs)("div",{className:t.root,children:[a.map(({assistant:u,assistantName:f,displayName:d})=>(0,On.jsx)("button",{type:"button",className:t.button,disabled:o.state==="loading",onClick:()=>c(u),children:d||f},u)),l.length>0&&(0,On.jsxs)(wt,{placement:"top-end",children:[(0,On.jsx)(wt.Trigger,{className:t.trigger,disabled:o.state==="loading",children:(0,On.jsx)(Qp,{"data-testid":"trigger"})}),(0,On.jsx)(wt.Content,{className:t.nav,"data-testid":"popover",children:l.map(({assistant:u,assistantName:f,displayName:d})=>(0,On.jsx)(wt.Button,{className:t.item,disabled:o.state==="loading",onClick:()=>c(u),children:d||f},u))})]}),o.state==="loading"&&(0,On.jsx)(WI,{}),o.state==="done"&&(0,On.jsx)(GI,{"data-testid":"trigger-done"}),o.state==="error"&&(0,On.jsx)(AR,{trigger:(0,On.jsx)(KI,{}),children:n("error")})]})},YI=d6;var uu={};yt(uu,{enUS:()=>f6,nlNL:()=>p6});var f6={useCue:[{type:0,value:"Add to message"}],__summarizerAssistant__:[{type:0,value:"Summary"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},p6={useCue:[{type:0,value:"Voeg toe aan bericht"}],__summarizerAssistant__:[{type:0,value:"Samenvatting"}],copyCue:[{type:0,value:"Kopi\xEBren"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var bi=E(Z());var yS={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",actions:"dd-9Iqn9",ctaMessage:"dd-ge8nB",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l",form:"dd-sPNU2",formInput:"dd-F3E4I",formSubmit:"dd-vw5S0",actionButton:"dd-cCWyJ",editableCue:"dd-nWSD-",inputSpace:"dd-DGYB1"};var Ot=E(P()),m6=500,g6=100,h6=({content:e,onChange:t,onCopy:n})=>{let r=(0,bi.useRef)(null),o=O("WidgetCue",yS);return(0,bi.useEffect)(()=>{let s=r.current;if(!s)return;s.style.setProperty("height","0px");let i=Math.min(Math.max(s.scrollHeight,g6),m6);s.style.setProperty("height",`${i}px`)},[e]),(0,Ot.jsx)("textarea",{ref:r,className:o.editableCue,onCopy:n,onChange:t,value:e})},y6=({cue:e,onCallToAction:t,onRemove:n,onCopy:r,onUse:o})=>{var m;let s=O("WidgetCue",yS),i=ie(uu),a=Ze(),l=X("hasKeyboardInput"),[c,u]=(0,bi.useState)(e.text),f=S=>{let y=S?I(b({},e),{callToAction:S}):e;t&&t(c,y),n(e)},d=(S,y)=>{r&&r(S,e),y&&Fo(y,s.fadeup)},p=S=>{o&&o(S,e)},h=S=>{S.preventDefault(),S.stopPropagation(),n(e)};return(0,bi.useEffect)(()=>{a("Assistant response displayed",{evaluationId:e.evaluationId,assistantCode:e.rule.label,assistantOutput:e.text})},[]),(0,Ot.jsxs)(de,{"data-testid":"cue",children:[(0,Ot.jsx)(Se,{children:(0,Ot.jsxs)(Se.Content,{children:[e.title&&(0,Ot.jsx)(Se.Title,{className:s.title,"data-testid":"widget-cue-title",children:e.rule.label.startsWith("__")?i(e.rule.label):e.title}),e.message&&(0,Ot.jsx)("p",{className:s.ctaMessage,children:e.message}),e.editable?(0,Ot.jsx)(h6,{content:c,onCopy:()=>{let S=document.getSelection();S&&d(S.toString())},onChange:S=>{var y;return u((y=S.target.value)!=null?y:"")}}):(0,Ot.jsx)(oi,{content:e.text,useLabel:i("useCue"),copyLabel:i("copyCue"),onCopy:d,onUse:l?p:void 0})]})}),(0,Ot.jsxs)(de.ButtonsContainer,{children:[(0,Ot.jsxs)("div",{className:s.actions,children:[(0,Ot.jsx)(de.Button,{onClick:S=>{var y;return d((y=Nd(c,"reply")[0])!=null?y:c,S.target)},variant:"primary",children:i("copyCue")}),e.callToAction&&(0,Ot.jsx)(de.Button,{onClick:()=>f(),variant:"primary",children:e.callToAction.label}),(m=e.callToActions)==null?void 0:m.map((S,y)=>(0,Ot.jsx)(de.Button,{onClick:()=>f(S),variant:"primary",children:S.label},`${S.event}-${S.label}-${y}`)),(0,Ot.jsx)(de.Button,{onClick:h,variant:"secondary",children:i("removeCue")})]}),(0,Ot.jsx)(Fd,{evaluationId:e.evaluationId,assistantCode:e.rule.label,assistantOutput:e.text,feedbackText:e.text,feedbackType:"assistant"})]})]})},XI=y6;var qa=E(P()),v6=({cues:e})=>{let t=be(),n=dn(),r=ie(uu),o=Ze(),s=c=>{t(Ld({code:c.rule.label})),o("Assistant response closed",{evaluationId:c.evaluationId,assistantCode:c.rule.label,assistantOutput:c.text})},i=(c,u)=>{Ir(c),o("Assistant response copied",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,copiedText:c})},a=(c,u)=>{var f;u.callToAction&&(t(Md(u)),o("Assistant call to action",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,eventName:u.callToAction.event,value:(f=u.callToAction.value)!=null?f:c}))},l=(c,u)=>{var f;n.send(Xr,{text:c,suggestion:{source:"assistant",assistantCode:(f=u.rule)==null?void 0:f.label,sourceText:c}}),o("Assistant response used",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,usedText:c})};return(0,qa.jsx)(qa.Fragment,{children:e.map(c=>c.isLoading?(0,qa.jsx)(cp,{title:c.rule.label.startsWith("__")?r(c.rule.label):c.title},c.rule.id):(0,qa.jsx)(XI,{cue:c,onCallToAction:a,onRemove:s,onCopy:i,onUse:l},c.evaluationId))})},QI=v6;var Rm=E(Z());var ZI={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",copyButtonText:"dd-oos-l",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var bn=E(P());function S6(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var JI=({data:e,schema:t})=>{let n=O("WidgetCustomData",ZI),r=o=>{Ir(o)};return(0,Rm.useEffect)(()=>{ee.info("Custom data",e,t)},[e]),(0,bn.jsx)("dl",{className:n.root,children:t.map(o=>{let s=S6(e,o.path);return(0,bn.jsxs)(Rm.Fragment,{children:[(0,bn.jsx)("dt",{className:n.label,children:o.label}),(0,bn.jsx)("dd",{className:n.value,children:o.type==="boolean"&&s?(0,bn.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!s?(0,bn.jsx)("span",{className:n.isFalse,children:o.falseValue}):o.type==="array"&&Array.isArray(s)&&s.length>0?(0,bn.jsxs)("button",{type:"button",onClick:()=>r(s.join(", ")),className:n.copyButton,children:[(0,bn.jsx)("span",{className:n.copyButtonText,children:s.join(", ")}),(0,bn.jsx)(Ga,{})]}):typeof s=="string"||typeof s=="number"?(0,bn.jsxs)("button",{type:"button",onClick:()=>r(`${s}`),className:n.copyButton,children:[(0,bn.jsx)("span",{className:n.copyButtonText,children:s}),(0,bn.jsx)(Ga,{})]}):"-"})]},o.label)})})};var tA=E(Z());var x6=/(https?:\/\/[^\s]+)/,eA=e=>e.split(" ").find(t=>x6.test(t));var Yn=E(P()),w6=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=eA(r),s=ie(eu),i=X("showImages"),a=X("fallbackImage"),l=X("hasKeyboardInput"),c=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},u=(0,tA.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,Yn.jsxs)(de,{onClick:l?c:void 0,"data-testid":"edit-suggestion",children:[(0,Yn.jsxs)(Se,{children:[i&&e.image&&(0,Yn.jsx)(Se.Image,{src:bm(e,"small",a||void 0),title:e.title}),(0,Yn.jsxs)(Se.Content,{children:[e.title&&(0,Yn.jsx)(Se.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,Yn.jsx)(de.Labels,{labels:e.searchKeywords}),(0,Yn.jsx)(Se.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,Yn.jsxs)(de.Actions,{children:[o&&(0,Yn.jsx)(de.ActionButton,{onClick:u,label:s("visitUrl")}),l&&(0,Yn.jsx)(de.ActionButton,{primary:!0,onClick:c,label:s("useSuggestion")})]})]})},nA=w6;var du=E(P()),b6=({lines:e,suggestions:t})=>{let n=dn(),r=(o,s)=>{n.send(Xr,{text:o,suggestion:I(b({},s),{source:s.source,sourceText:s.text})})};return(0,du.jsx)(du.Fragment,{children:t.map(o=>(0,du.jsx)(nA,{suggestion:o,lines:e,onUse:s=>r(s,o)},o.text||o.url||o.message))})},rA=b6;var fu={};yt(fu,{enUS:()=>E6,nlNL:()=>C6});var E6={waiting:[{type:0,value:"Loading\u2026"}],waitingForConversation:[{type:0,value:"Waiting for conversation\u2026"}],notSupported:[{type:0,value:"This conversation is not supported"}],noResults:[{type:0,value:"No results found\u2026"}],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"}],close:[{type:0,value:"Close"}]},C6={waiting:[{type:0,value:"Laden\u2026"}],waitingForConversation:[{type:0,value:"Wachten op gesprek\u2026"}],notSupported:[{type:0,value:"Dit gesprek wordt niet ondersteund"}],noResults:[{type:0,value:"Geen resultaten gevonden\u2026"}],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"}],close:[{type:0,value:"Sluiten"}]};var Ya={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",footer:"dd-tvofr",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",footerShortcut:"dd-dH7XJ",link:"dd-DRo0x"};var le=E(P()),oA=(e,t)=>{let n=G(Rt);(0,bs.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},T6=({onLogIn:e})=>{let t=O("Widget",Ya),n=X("isEmbedded"),r=X("adminUrl");return(0,le.jsx)("div",{className:t.loginText,children:(0,le.jsx)("div",{children:(0,le.jsx)(dm,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},vS=({text:e})=>{let t=O("Widget",Ya);return(0,le.jsx)("div",{className:t.stateText,children:(0,le.jsx)("div",{children:(0,le.jsx)("p",{children:e})})},"notification")},k6=()=>{let e=ie(fu),t=be(),n=O("Widget",Ya),r=X("showSearch"),o=X("isEmbedded"),s=G(zo("/admin/")),i=dn(),a=X("productName"),l=Ze();return oA(()=>{if(o)return t(dS()),()=>{t(OI())}},[t,o]),!r&&!s?null:(0,le.jsxs)("div",{className:n.shortcutList,children:[r&&(0,le.jsx)(de.Button,{"data-testid":"shortcut-search","aria-label":e("linkSearch"),className:n.shortcut,icon:(0,le.jsx)(Va,{}),onClick:()=>{i.send("ShowCommandPalette",{isOpen:!0}),l("open search",{via:"widget-shortcut"})},children:e("linkSearch")}),s&&(0,le.jsx)(de.Button,{as:"a",target:"_blank",icon:(0,le.jsx)(UI,{}),href:s,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:a}),className:n.shortcut,rel:"noreferrer",onClick:()=>{l("open my deepdesk",{via:"widget-shortcut"})},children:e("linkStudioLogin",{productName:a})})]})},R6=({title:e,content:t})=>{let n=ie(fu),[r,o]=(0,bs.useState)(!0);return r?(0,le.jsx)(Cr,{"data-testid":"custom-data-banner",type:"custom-data-banner",title:e,children:(0,le.jsx)(Ct,{withDivider:!0,children:(0,le.jsxs)(de,{children:[(0,le.jsx)(Se,{children:(0,le.jsx)(Se.Content,{children:(0,le.jsx)(oi,{content:t})})}),(0,le.jsx)(de.ButtonsContainer,{children:(0,le.jsx)(de.Button,{onClick:()=>o(!1),children:n("close")})})]})})}):null},P6=()=>{let e=be(),t=G(jc),n=G(ZR),r=G(zI),o=G(mb),s=G(Xp),i=G(em),a=G(fs),l=G(Rr);return(0,bs.useEffect)(()=>{o&&!n&&ee.warn("Custom data provided, but no schema.")},[o,n]),oA(()=>{t.forEach(({type:c})=>{c==="entities"?e(vr()):Bu.includes(c)||e(Sr(c))})},[e,l,a]),(0,bs.useEffect)(()=>{r.length>0&&!t.some(c=>c.type==="cues")&&ee.warn("Received cues, but cues are not configured in widget.")},[t,r]),(0,le.jsx)(bs.Fragment,{children:t.map(({type:c,title:u,amount:f,lines:d,schema:p,property:h})=>{var m,S;switch(c){case"entities":return s&&s.length>0&&(0,le.jsx)(Cr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,le.jsx)(BI,{entities:s})},c);case"cues":return r&&r.length>0&&(0,le.jsx)(Cr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,le.jsx)(Ct,{withDivider:!0,children:(0,le.jsx)(QI,{cues:r})})},c);case"custom-data-banner":return o&&h&&o[h]&&(0,le.jsx)(R6,{title:u,content:String(o[h])},c);case"custom-data":return o&&p&&(0,le.jsx)(Cr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,le.jsx)(Ct,{withDivider:!0,children:(0,le.jsx)(JI,{data:o,schema:p})})},c);default:return((S=(m=i[c])==null?void 0:m.suggestions)==null?void 0:S.length)>0&&(0,le.jsx)(Cr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,le.jsx)(Ct,{withDivider:!0,children:(0,le.jsx)(rA,{lines:d,contentType:c,suggestions:i[c].suggestions.slice(0,f)||[]})})},c)}})})},SS=({children:e})=>{let t=O("Widget",Ya);return(0,le.jsx)("div",{className:t.footer,children:e})},xS=({children:e})=>{let t=O("Widget",Ya);return(0,le.jsx)("div",{className:t.root,"data-testid":"widget",children:e})},I6=({onLogIn:e,knowledgeAssistOptions:t={},assistantOptions:n={transcript:"in-memory-transcript"}})=>{let r=ie(fu),o=G(zi),s=G(Rt),i=G(rd),a=G(fs),l=G(QR("knowledge-assist")),c=G(JR);return o===!1?(0,le.jsx)(vS,{text:r("notSupported")}):s===!1?(0,le.jsx)(T6,{onLogIn:e}):s===null?(0,le.jsx)(vS,{text:r("waiting")}):!i||!a?(0,le.jsx)(vS,{text:r("waitingForConversation")}):(0,le.jsx)(xS,{children:(0,le.jsxs)(Op,{initialQuestion:t.initialQuestion,assistantCode:c!=null?c:void 0,evaluateKnowledgeAssistFn:Ll,children:[(0,le.jsxs)(Oi,{children:[(0,le.jsx)(k6,{}),(0,le.jsx)(P6,{}),l&&(0,le.jsx)(Fp,{title:l.title,emptyState:t.emptyState})]}),(0,le.jsxs)(SS,{children:[l&&(0,le.jsx)(Dp,{}),(0,le.jsx)(YI,{assistantOptions:n})]})]})})},sA=I6;function Xa(e){let t=new Range;return t.selectNodeContents(e),t}function iA(e,t,n){try{return Es(e,t,n),!0}catch(r){return!1}}function Pm(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function Im(e){return"tagName"in e&&e.tagName==="BR"}var pu=/[\u200B-\u200D\uFEFF]/g;function Es(e,t,n){let r=new Range;if(e.firstChild===null&&t===0&&n===0)return r.selectNodeContents(e),r;let o=0,s=!1;function i(l,c){let u=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return c;for(let d=0;d<=l.length;d++)if(f.test(l[d])||u++,u===c)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let c=l.textContent,u=c.replace(pu,""),f=o+u.length,d=t>=o&&t<=f,p=n>=o&&n<=f;if(d){let h=i(c,t-o);h===0&&!p?r.setStartBefore(l):r.setStart(l,h)}p&&(r.setEnd(l,i(c,n-o)),s=!0),o=f;break}case Node.ELEMENT_NODE:{if(Im(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),s=!0;return}for(let u=0;u<l.childNodes.length&&(a(l.childNodes[u]),!s);u++);let c=l.lastChild;Pm(l)&&c&&!Pm(c)&&!Im(c)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function mu(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:s,collapsed:i}=t,a,l,c=0;function u(f){let d=f===e,p=f===n,h=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let m=f.textContent;p&&(a=c+m.substring(0,r).replace(pu,"").length),h&&(l=c+m.substring(0,s).replace(pu,"").length),c+=m.replace(pu,"").length;break}case Node.ELEMENT_NODE:{if(Im(f)&&f.nextSibling){c++;break}!d&&Pm(f)&&f.previousSibling&&c++;for(let m=0;m<f.childNodes.length;m++){let S=p&&m===r,y=h&&m===s;if(S&&(a=c),y&&(l=c),l!==void 0||((!S||!i)&&u(f.childNodes[m]),h&&m===s-1&&(l=c),l!==void 0))break}h&&(l=c);break}default:break}}if(u(e),l===void 0)throw new Error("Could not determine start and end");return{start:a!=null?a:l,end:l}}function gu(e,t){if(!e.contains(t.startContainer)||!e.contains(t.endContainer))throw new Error("Range not within root element");let{startContainer:n,startOffset:r,endContainer:o,endOffset:s,collapsed:i}=t,a=0,l="";function c(u){let f=u===e,d=u===n,p=u===o;switch(d&&(a=1),u.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let h=d?r:0,m=p?s:void 0;l+=u.textContent.replace(pu,"").substring(h,m);break}case Node.ELEMENT_NODE:{if(!i&&a===1&&Im(u)&&u.nextSibling){l+=`
82
- `;break}!f&&!i&&a===1&&Pm(u)&&u.previousSibling&&(l+=`
83
- `);let h=d?r:0,m=p?Math.min(s,u.childNodes.length):u.childNodes.length;for(let S=h;S<m&&(c(u.childNodes[S]),a!==2);S++);break}default:break}p&&(a=2)}return c(e),l}var aA=(i=>(i.CUT="Cut",i.BACKSPACE="Backspace",i.DELETE="Delete",i.ERASEEOF="EraseEof",i.UNDO="Undo",i.CLEAR="Clear",i))(aA||{}),Ro=class{constructor(t){this.element=t;this.isFocused=!1;this.isActive=!0;this.isDisposed=!1;this.eventListeners={};this.disposeHandlers=[];this.cachedText="";this.cachedSuggestionTextStart=0;this.cachedCaretPosition=null;this.cachedSelection={start:0,end:0};this.cachedHTML="";this.isSubmitting=!1;this.isPossibleClearInputAction=!1;this.cachedText=this.getText(),this.cachedSuggestionTextStart=this.getSuggestionTextStart(),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.getSuggestionTextStart(),s=this.cachedCaretPosition===null;if(!this.isActive)return;t===""&&this.cachedText!==""&&!this.isPossibleClearInputAction&&this.emit("submit");let i=t!==this.cachedText,a=n!==null&&n!==this.cachedHTML,l=o!==this.cachedSuggestionTextStart;if((i||a||l)&&(i?(this.cachedText=t,this.cachedHTML=n):a&&(this.cachedHTML=n),this.cachedSuggestionTextStart=o,s=!0,this.emit("change",{plainText:t,rawHTML:n,suggestionTextStart:o})),(r.start!==this.cachedSelection.start||r.end!==this.cachedSelection.end)&&(this.cachedSelection=r,s=!0,this.emit("selection",r)),!s)return;let c=this.getCaretPosition();Oo(c,this.cachedCaretPosition)||(this.cachedCaretPosition=c,this.emit("caretposition",c))}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(aA).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()})}getSuggestionTextStart(){return 0}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))}off(t,n){if(!this.eventListeners[t])return;let r=this.eventListeners[t].indexOf(n);r!==-1&&this.eventListeners[t].splice(r,1)}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 lA(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Ei=class extends Ro{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),gu(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){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=r.rangeCount>0?r.getRangeAt(0):null;if(!o)return null;let s=this.element.ownerDocument.createRange();return s.setStart(o==null?void 0:o.startContainer,o==null?void 0:o.startOffset),s.setEnd(o==null?void 0:o.endContainer,o==null?void 0:o.endOffset),!s||!this.element.contains(s.startContainer)||!this.element.contains(s.endContainer)?null:s}getCaretPosition(){let n=this.getRange();if(!n||!n.collapsed||!("getBoundingClientRect"in n))return null;let r=n.getBoundingClientRect();return!lA(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!lA(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return mu(this.element,n);let r=this.lastKnownSelection;if(r&&iA(this.element,r.start,r.end))return r;let o=Xa(this.element);return o.collapse(!1),mu(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return gu(this.element,Es(this.element,n,r))}listen(){super.listen();let n=new MutationObserver(s=>{var i,a;s.length===2&&s[0].addedNodes.length===1&&((i=s[0].addedNodes[0])==null?void 0:i.textContent)==="\u2060"&&((a=s[1].removedNodes[0])==null?void 0:a.textContent)==="\u2060"||setTimeout(()=>{this.handleInteraction()},0)});n.observe(this.element,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),this.disposeHandlers.push(()=>n.disconnect());let r=this.element.isContentEditable,o=new MutationObserver(()=>{this.element.isContentEditable!==r&&(r=this.element.isContentEditable,this.emit(this.element.isContentEditable?"enabled":"disabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["contenteditable"]}),this.disposeHandlers.push(()=>o.disconnect())}};var A6=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function cA(e,t){let n="mozInnerScreenX"in window,r=document.createElement("div");r.id="input-textarea-caret-position-mirror-div";let o=r.style,s=window.getComputedStyle(e),i=e.ownerDocument.body;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.visibility="hidden",A6.forEach(u=>{o[u]=s[u]}),n?e.scrollHeight>Number.parseInt(s.height)&&(o.overflowY="scroll"):o.overflow="hidden",r.textContent=e.value.substring(0,t);let a=document.createElement("span");a.textContent=e.value.substring(t)||".",r.appendChild(a),i.appendChild(r);let l=e.getBoundingClientRect(),c={top:l.top-e.scrollTop+a.offsetTop+Number.parseInt(s.borderTopWidth)+a.offsetHeight,left:l.left-e.scrollLeft+a.offsetLeft+Number.parseInt(s.borderLeftWidth)};return i.removeChild(r),c}var Ci=class extends Ro{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 cA(this.element,this.element.selectionEnd)}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var s;return(s=n==null?void 0:n.get)==null?void 0:s.call(this.element)},set:s=>{var i;(i=n==null?void 0:n.set)==null||i.call(this.element,s),this.handleInteraction()}}),this.addEventListener("scroll",()=>{this.emit("caretposition",this.getCaretPosition())});let r=this.element.disabled,o=new MutationObserver(()=>{this.element.disabled!==r&&(r=this.element.disabled,this.emit(r?"disabled":"enabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>o.disconnect())}};function uA(e,t,n){let r=`deepdesk-iframe-${e}`,o=document.getElementById(r);if(o)return o;let s=document.createElement("iframe"),i=new URL(t);return Object.entries(n).forEach(([a,l])=>{i.searchParams.append(a,l)}),s.style.position="absolute",s.style.left="-999em",s.style.width="0px",s.style.height="0px",s.tabIndex=-1,s.id=r,s.title=`iframe-${e}`,s.src=i.toString(),window.document.body.appendChild(s),s}function _6(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch(t){return e}}var wS=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()}},bS=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=uA(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()}},ES=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.externalId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setExternalId(t){this.externalId!==t&&(this.cleanup(),ee.info("Set externalId",t),this.externalId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new bS(t,this.deepdeskUrl,{debug:!0}):new wS(t),r=o=>{var i,a;if(o.origin!==this.deepdeskUrl)return;let s=_6(o.data);typeof s!="object"||s.type!=="event"||s.channel!==t||(ee.info("Received broadcast event",this.externalId,o),(a=(i=this.eventMap)[s.name])==null||a.call(i,s.payload))};return n.onMessage(r),n}send(t,n,r){var i,a;ee.info("Broadcast event",{externalId:this.externalId,name:t,payload:n});let o={type:"event",name:t,payload:n};r!==!1&&((a=(i=this.eventMap)[t])==null||a.call(i,n));let s=this.externalId==="deepdesk-general"?this.defaultChannel:this.channel;s==null||s.postMessage(I(b({},o),{channel:this.externalId}))}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),this.channel=void 0,t&&((r=this.defaultChannel)==null||r.close(),this.defaultChannel=void 0)}},dA=ES;function N6(e){return e.replace(/(_\w)/g,t=>t[1].toUpperCase())}function Ve(e){return Array.isArray(e)?e.map(Ve):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(b({},t),{[N6(n)]:Ve(e[n])}),{}):e}function M6(e){return e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function an(e){return Array.isArray(e)?e.map(an):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>I(b({},t),{[M6(n)]:an(e[n])}),{}):e}var Qa=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var CS=e=>new Promise(t=>{setTimeout(t,e)});var Ti=class extends Qa{constructor(){super(...arguments);this.name="ClientError"}},kS=class extends Qa{constructor(){super(...arguments);this.name="ServerError"}},TS=new Map;function L6(e){return N(this,null,function*(){if(e.status===204)return e.text().catch(()=>{}),null;let t=e.headers.get("content-type");if(t!=null&&t.includes("application/json"))return e.json();let n=yield e.text();return n===""?null:(ee.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var ki=class{constructor(t="",n={}){this.baseUrl=t;this.options=n;this.latestRequestByUrl={};this.refreshingToken=null;this.lastFailedRefreshAt=null;this.failedRefreshCooldown=1e4;var r;this.fetch=(r=n.fetch)!=null?r:window.fetch.bind(window)}patchFetch(t){this.fetch=t(this.fetch)}setCsrfToken(t){this.csrfToken=t}request(t,n={}){return new Promise((r,o)=>{let s={isAborted:!1,reject:o},i=`${this.baseUrl}${t}`,a=this.fetch,l=n.method===void 0||n.method.toLowerCase()==="get",T=n,{useCache:c=!1,abortLatest:u=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:p=!0,retryOnError:h=k=>k instanceof TypeError,retryOnResponse:m=k=>k.status>=500,version:S=null}=T,y=se(T,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(c){if(!l)throw new Error(`Can't use 'useCache' for ${n.method}`);if(TS.has(i)){r(TS.get(i));return}}let g=I(b({credentials:"include"},y),{headers:b({Accept:"application/json","Content-Type":"application/json"},y.headers)});!l&&this.csrfToken&&(g.headers=I(b({},g.headers),{"X-CSRFToken":this.csrfToken})),typeof S=="string"&&(g.headers=I(b({},g.headers),{"X-Deepdesk-API-Version":S}));let v=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[i]&&u&&(this.latestRequestByUrl[i].isAborted=!0,this.latestRequestByUrl[i].reject(new Error("Aborted"))),this.latestRequestByUrl[i]=s;let C=()=>N(this,null,function*(){return v--,a(i,g).then(k=>N(this,null,function*(){return m(k)&&!s.isAborted&&v>0?(yield CS(d),C()):k.status===401&&p===!0&&x===!1?(x=!0,yield this.refreshToken(),C()):k})).catch(k=>N(this,null,function*(){if(h(k)&&!s.isAborted&&v>0)return yield CS(d),C();throw k}))});C().then(k=>N(this,null,function*(){let A=yield L6(k);if(delete this.latestRequestByUrl[i],k.status>=500){o(new kS("Server Error",A));return}if(k.status===401){o(new Ti("Unauthorized",A));return}if(k.status===403){o(new Ti("Forbidden",A));return}if(k.status===404){o(new Ti("Not Found",A));return}if(k.status>=400){o(new Ti("Bad Request",A));return}c&&TS.set(i,A),r(A)})).catch(k=>{o(k)})})}validateToken(){return N(this,null,function*(){let t,n,r;try{({has_valid_access_token:t,is_logged_in:n,has_valid_refresh_token:r}=yield this.get("/apis/admin/session/validate/",{refreshTokenOn401:!1}))}catch(o){return!1}if(!t){if(!r)return!1;try{yield this.refreshToken();let{is_logged_in:o}=yield this.get("/apis/admin/session/validate/",{refreshTokenOn401:!1});return o}catch(o){return!1}}return n})}refreshToken(){let t=Date.now();return this.lastFailedRefreshAt&&t-this.lastFailedRefreshAt<this.failedRefreshCooldown?Promise.reject(new Ti("Unauthorized","Failed to refresh token")):this.refreshingToken?this.refreshingToken:(this.refreshingToken=this.get("/apis/admin/session/refresh/",{refreshTokenOn401:!1}).catch(n=>{throw(n==null?void 0:n.message)==="Unauthorized"&&(this.lastFailedRefreshAt=Date.now()),n}).finally(()=>{this.refreshingToken=null}),this.refreshingToken)}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,b({method:"POST",body:JSON.stringify(n)},r))}patch(t,n,r){return this.request(t,b({method:"PATCH",body:JSON.stringify(n)},r))}put(t,n,r){return this.request(t,b({method:"PUT",body:JSON.stringify(n)},r))}delete(t,n){return this.request(t,b({method:"DELETE"},n))}};var fA;(t=>{let e;(a=>(a.SUCCESS="success",a.FAILURE="failure",a.CONDITIONS_NOT_MET="conditions_not_met",a.MAX_RECURSION_LEVEL="max_recursion_level",a.NO_ACCESS_TO_ASSISTANT="no_access_to_assistant"))(e=t.EvaluationStatus||(t.EvaluationStatus={}))})(fA||(fA={}));function RS(e){return I(b({},Ve(e)),{metadata:e.metadata})}var Ri=class Ri{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new ki(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,s)=>N(this,null,function*(){let i=yield r(o,s);return this.handleDeepdeskVersionHeaders(i),i}))}preflight(){return N(this,null,function*(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=yield this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(Ri.exchangeTokenPromise||(Ri.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),Ri.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return N(this,null,function*(){var r;yield this.preflight(),ee.info(`Creating conversation for session ${t.externalId} and agent ${t.agentId}`);let n=yield this.client.post("/api/v2/conversations",I(b({chat_start_time:new Date().toISOString()},an(t)),{metadata:(r=t.metadata)!=null?r:{}}));return RS(n)})}getMe(){return N(this,null,function*(){let t=yield this.client.get("/apis/admin/session/me/");return Ve(t)})}postIdentity(t){return N(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/me/identities/",an(t))})}patchMe(t){return N(this,null,function*(){yield this.preflight();let n=yield this.client.patch("/apis/admin/session/me/",an(t));return Ve(n)})}getProfile(t){return N(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return Ve(n)})}getKnowledgeAssistant(t){return N(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return Ve(n)})}getContentTypes(){return N(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return Ve(t)})}getAccount(){return N(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return Ve(t)})}getPlatformConfig(t){return N(this,null,function*(){let n=t!==void 0?`/platform/config/${t}/`:"/platform/config/",{config:r}=yield this.client.get(n,{useCache:!0});return Ve(r)})}checkUserExists(t){return N(this,null,function*(){let{exists:n}=yield this.client.get(`/apis/admin/users/exists?external_id=${t}`,{version:"v1"});return n})}getConversationByExternalId(r){return N(this,arguments,function*(t,n={}){yield this.preflight(),ee.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:s=1e3}=n,i=yield this.client.get(`/api/v2/conversations/by_external_id/${t}`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return ee.info(`Successfully retrieved conversation ${i.id} for session ${t}`),RS(i)})}isConversationSupported(r){return N(this,arguments,function*(t,n={}){ee.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:s=1e3}=n;return(yield this.client.get(`/api/v2/conversations/by_external_id/${t}/has_active_profile`,{attempts:o,retryDelay:s,retryOnResponse:a=>a.status===404||a.status>=500})).has_active_profile})}updateConversation(t,n){return N(this,null,function*(){var s;yield this.preflight();let r=an(n);n.metadata&&(r.metadata=(s=n.metadata)!=null?s:{});let o=yield this.client.put(`/api/v2/conversations/${t}`,r);return RS(o)})}postMessages(t,n){return N(this,null,function*(){yield this.preflight(),yield this.client.post(`/api/v2/conversations/${t}/messages`,n.map(r=>I(b({},an(r)),{metadata:r.metadata})))})}sendEvent(t,n){return N(this,null,function*(){yield this.preflight();let a=n,{data:r}=a,o=se(a,["data"]),s=Object.entries(this.latestReceivedDeepdeskVersions).reduce((l,[c,u])=>I(b({},l),{[c]:u}),{}),i=["platform","agentId","agentName","agentEmail","conversationId"].reduce((l,c)=>(o[c]&&(l[c]=o[c]),l),{});return this.client.post("/api/v2/events",an(I(b(b({},s),i),{data:r,name:t})),{version:"v2"})})}getEntities(t){return N(this,null,function*(){return yield this.preflight(),yield this.client.post("/api/v2/entities",{messages:t.filter(r=>r.text)})})}getTemporaryExchangeToken(){return N(this,null,function*(){return(yield this.client.get("/apis/admin/session/exchange-token/")).jwt})}exchangeTokenForAccessCookie(t){return N(this,null,function*(){return this.client.post("/apis/admin/session/jwt/",{jwt:t}).catch(n=>{throw ee.warn(`Invalid token '${t}'`),n})})}authenticateWithKey(t,n){return N(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/api-key/",an(n),{refreshTokenOn401:!1,headers:{apikey:t}})})}getTextSuggestions(o){return N(this,arguments,function*(t,n={},r){if(yield this.preflight(),r==="sticky-messages")throw new Error("Use getPinnedMessages instead");return(yield this.client.post(`/api/v2/conversations/${t}/recommend/${r}`,an(n),{abortLatest:!0})).map(i=>I(b({},Ve(i)),{text:i.text||i.url||i.message,source:r,type:r})).filter((i,a,l)=>a===l.findIndex(c=>c.text===i.text))})}isLoggedIn(){return N(this,null,function*(){return yield this.preflight(),this.client.validateToken()})}getAutocompleteSuggestions(t,n){return N(this,null,function*(){return yield this.preflight(),(yield this.client.post(`/api/v2/conversations/${t}/autocomplete`,an(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,s,i)=>s===i.findIndex(a=>a.text===o.text))})}getPinnedMessages(t){return N(this,null,function*(){let n=yield this.client.get(`/api/v2/profiles/${t}/pinned-messages`,{abortLatest:!0});return Ve(n).map(r=>I(b({},r),{text:r.message,source:"sticky-messages",type:"pinned-message"}))})}getStyleSuggestions(t){return N(this,null,function*(){let n=yield this.client.post("/api/v2/style-suggestions",an(t),{abortLatest:!0,version:"v2"});return Ve(n)})}search(t){return N(this,null,function*(){let n=yield this.client.post(`/api/v2/profiles/${t.profile}/search`,an(t));return Ve(n)})}loginWithPassword(t,n){return N(this,null,function*(){yield this.preflight();let r=yield this.client.post("/apis/admin/session/login/",{username:t,password:n},{refreshTokenOn401:!1});return Ve(r)})}logout(){return N(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/logout/",{},{refreshTokenOn401:!1})})}requestLoginByEmail(t){return N(this,null,function*(){yield this.preflight();let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return Ve(n)})}requestPasswordlessToken(){return N(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return Ve(t.token)})}getCsrfToken(){return N(this,null,function*(){let{token:t}=yield this.client.get("/apis/admin/session/csrf/");return t})}verifyLoginToken(t){return N(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/login/",{token:t});return Ve(n)})}evaluateAssistant(t,n){return N(this,null,function*(){var i;yield this.preflight();let r=new URLSearchParams;n!=null&&n.externalConversationId&&r.append("external_conversation_id",n.externalConversationId);let o=n!=null&&n.threadId?`/api/v2/assistants/${t}/threads/${n==null?void 0:n.threadId}/evaluate?${r.toString()}`:`/api/v2/assistants/${t}/evaluate?${r.toString()}`,s=yield this.client.post(o,{input:(i=n==null?void 0:n.input)!=null?i:{},conversation:n==null?void 0:n.transcript});return Ve(s)})}createAssistantThread(t){return N(this,null,function*(){yield this.preflight();let{assistantCode:n}=t,r=yield this.client.post(`/apis/admin/assistants/${n}/threads/`,{});return Ve(r)})}postMessageToAssistantThread(t){return N(this,null,function*(){yield this.preflight();let{assistantCode:n,threadId:r,message:o}=t,s=yield this.client.post(`/apis/admin/assistants/${n}/threads/${r}/messages/`,{content:o,role:"user"});return Ve(s)})}translateMessages(t){return N(this,null,function*(){yield this.preflight();let n=yield this.client.post("/api/v2/translate",an(t));return Ve(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),s=o.match(Hx);if(!n||!s)return;let i=s[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[i];a&&n&&a!==n&&ee.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[i]=n})}};Ri.exchangeTokenPromise=null;var Po=Ri;var Am=class{constructor(t){this.options=t;this.socket=null;this.maxReconnectAttempts=5;this.reconnectInterval=25e3;this.cleanupCallbacks=[];var n,r;this.socket,this.eventListeners=new Map,this.url=t.url,this.maxReconnectAttempts=(n=t.maxReconnectAttempts)!=null?n:this.maxReconnectAttempts,this.reconnectInterval=(r=t.reconnectInterval)!=null?r:this.reconnectInterval,this.shouldReconnect=t.shouldReconnect}connect(){let t=()=>this.cleanup();window.addEventListener("beforeunload",t),this.cleanupCallbacks.push(()=>window.removeEventListener("beforeunload",t)),this.reconnect()}setupListeners(){this.socket&&(this.socket.onmessage=t=>{var n;try{let r=Ve(JSON.parse(t.data));r.event&&this.eventListeners.has(r.event)&&((n=this.eventListeners.get(r.event))==null||n.forEach(o=>o(r.data)))}catch(r){console.error("Error parsing WebSocket message:",r)}},this.socket.onclose=t=>{console.log("WebSocket connection closed:",t),setTimeout(()=>{this.reconnect()},this.reconnectInterval)},this.socket.onerror=t=>{console.error("WebSocket error:",t)})}reconnect(){var t,n;if(this.maxReconnectAttempts<=0){console.error("Max reconnect attempts reached, closing WebSocket connection."),(t=this.socket)==null||t.close();return}if(!this.shouldReconnect()){console.error("Should not reconnect, closing WebSocket connection."),(n=this.socket)==null||n.close();return}this.socket&&(this.socket.onmessage=null,this.socket.onclose=null,this.socket.onerror=null,this.socket.close()),this.socket=new WebSocket(this.url),this.setupListeners(),this.maxReconnectAttempts--}send(t,n){if(!this.socket){console.error("WebSocket connection is not open.");return}this.socket.send(JSON.stringify({event:t,data:n}))}on(t,n){this.eventListeners.has(t)||this.eventListeners.set(t,[]);let r=this.eventListeners.get(t);r&&!r.includes(n)&&r.push(n)}close(){var t;(t=this.socket)==null||t.close()}cleanup(){this.close(),this.cleanupCallbacks.forEach(t=>t()),this.cleanupCallbacks=[]}};var pA={startTime:null,stopTime:null},mA=e=>e.handlingTime,gA=Re({name:"handlingTime",initialState:pA,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(lt,()=>pA)}}),{handlingTimeStart:hA,handlingTimeStop:_m,handlingTimeReset:yA}=gA.actions,vA=gA.reducer;var SA=(e={})=>{let t=b({onAuthError:Fi(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var xA=(e={})=>{let t,n=!0,r=b({getStyleSuggestions:Si,debounce:500},e);return o=>s=>i=>{var p;let a=o.getState().input.text,l=s(i),c=o.getState();if(c.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:u}=c.settings;if(!((p=c.conversation.current)==null?void 0:p.id)||!u)return l;let{text:d}=c.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function O6(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end&&e.suggestionTextStart===t.suggestionTextStart}var wA=(e={})=>{let t=b({getTextSuggestions:Sr,getAutocompleteSuggestions:nu,debounce:200,check:Ur},e),n;return r=>o=>s=>{var m;let{input:i}=r.getState(),a=o(s),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:c,showTabCompletion:u}=l.settings,f=(m=l.conversation.current)==null?void 0:m.id,d=s.type===tm.toString();if(!f||!c&&!u)return a;let{input:p}=l;return O6(p,i)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let S=Ns(l);S===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(S))},d?0:t.debounce)),a}};var bA=Si.fulfilled.toString();function D6(e,t){let n=new Set([...t.keywordMatches.map(o=>o.keyword)]),r=[];return n.forEach(o=>{let s=e.keywordMatches.filter(l=>l.keyword===o),i=t.keywordMatches.filter(l=>l.keyword===o),a=i.length-s.length;a<=0||r.push(...i.slice(0,a))}),r}var EA=e=>t=>n=>r=>{var c;if(r.type!==bA){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let s=t.getState(),i=s.styleSuggestions.list,a=(c=s.conversation)==null?void 0:c.current;if(o===i)return;let l=D6(o,i);r.type===bA&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var F6=Wu({assistants:lE,auth:Gw,conversation:Jw,contentTypes:YR,passwordlessToken:DI,entities:EP,handlingTime:vA,info:wb,input:db,settings:uE,profile:eP,search:Rb,styleSuggestions:iI,ui:qP,textSuggestions:MP});function CA(e){return Lw({reducer:F6,middleware:t=>{var r;let n=t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI}},serializableCheck:!1}).concat(SA()).concat(wA({debounce:200})).concat(xA({debounce:500})).concat(EA(e.deepdeskAPI));return((r=e.middleware)!=null?r:[]).reduce((o,s)=>o.concat(s),n)},preloadedState:e.preloadedState})}function TA(e,t,n){if(t==="")return null;let r=new RegExp(`\\b${gm(t)}\\b`,"gi"),o,s=null;for(;(o=r.exec(e))!==null&&!(o.index>n);)s={start:o.index,end:o.index+o[0].length};return s}var z6=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},H6=e=>t=>n=>r=>{var l,c,u,f,d,p;let o=t.getState(),s=Bs("inlineSuggestions")(o),i=Bs("autoSelectSuggestion")(o)||s;switch(r.type){case Fi.toString():{!r.payload&&e.emit("logout",void 0);break}case td.fulfilled.toString():{e.emit("logout",void 0);break}case vr.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:(l=o.conversation.current)==null?void 0:l.id,data:{entities:r.payload}});break;case Os.toString():e.logSendMessage(r.payload);break;case Md.toString():e.emit("call-to-action",{cue:r.payload});break;case fn.fulfilled.toString():if(!r.isBroadcasted){let{externalConversationId:h,currentExternalIdAtRequest:m}=(c=r.payload)!=null?c:{};(!h||!m||h===m)&&e.broadcast(Gg,r,!1)}break;case fn.rejected.toString():break;default:break}let a=n(r);switch(r.type){case Os.toString():e.handleAfterSendMessage(r.payload);break;case ou.toString():e.onUpdateShowTabHint(r.payload);break;case _m.toString():e.logHandlingTime();break;case Bi.toString():e.broadcast(md,r);break;case Ls.toString():e.broadcast(md,r);break;case Ld.toString():t.dispatch(Ls({source:"assistant",assistantCode:r.payload.code}));break;case"analytics/logEvent/fulfilled":{let h=o.assistants.cues.find(m=>m.code===r.meta.arg.data.assistantCode);e.emit("event",I(b({},r.meta.arg),{cue:h}));break}case Cn.toString():{let{start:h,end:m}=o.input.selection;e.emit("select-suggestion",I(b({type:z6(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:h,end:m}:{start:0,end:m}})),s&&t.dispatch(Do([]));break}case sI.toString():{let{keyword:h,suggestion:m,eventMetrics:S}=r.payload,{text:y,selection:g}=o.input,v=TA(y,h,(u=g==null?void 0:g.end)!=null?u:y.length);if(!v)break;e.emit("select-suggestion",{text:m,type:"style",replace:v,suggestion:{text:m,source:"style"},eventMetrics:S});break}case ad.toString():e.emit("select-image",r.payload),e.sendEvent("Image attached",{conversationId:(f=o.conversation.current)==null?void 0:f.id,data:{path:r.payload.suggestion.image,title:r.payload.suggestion.title}});break;case Do.toString():{i&&r.payload.length>0&&t.dispatch(ld(0));break}case fn.fulfilled.toString():{let{evaluationId:h,output:m,externalConversationId:S}=r.payload,y=r.meta.arg.assistantCode;if(e.emit("event",{name:"Assistant evaluation completed",data:{evaluationId:h,assistantCode:y,assistantOutput:rE(m),externalConversationId:S,evaluationStatus:"success"}}),!r.meta.arg.skipState){let g=t.getState().assistants.cues;e.emit("cues",g)}break}case fn.rejected.toString():{let h=r.meta.arg.assistantCode,m=(p=r.meta.arg.externalConversationId)!=null?p:(d=t.getState().conversation.current)==null?void 0:d.externalId;e.emit("event",{name:"Assistant evaluation completed",data:{evaluationId:"",assistantCode:h,assistantOutput:"",externalConversationId:m,evaluationStatus:"failed"}});break}default:break}return a},kA=H6;function PS(e){return e.toISOString().replace("T"," ").replace("Z","")}var B6=(e,t)=>t.version,RA=Gt([Ui,Rr,mA,B6],(e,t,n,r)=>{if(!t)return ee.warn("No conversationId for handling time metrics"),null;let{startTime:o,stopTime:s}=n;return!o||!s?(ee.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:t,clientVersion:r,agentId:e==null?void 0:e.agentId,agentName:e==null?void 0:e.agentName,agentEmail:e==null?void 0:e.agentEmail,timeStart:PS(o),timeStop:PS(s)}});function PA(e,t){let{text:n,metrics:{numPaste:r,pastes:o,textSuggestions:s}}=e.input,i=n.length;return{source:"agent",clientVersion:t.version,pastes:o,lenTextTotal:i,numPastes:r,suggestions:s}}var hu=class extends Error{};function U6(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}var Nm=class{constructor(){this.queues={}}push(t,n){let r=()=>{let s=this.queues[t][1];s?(this.queues[t]=[s.promise,null],s.resolve()):delete this.queues[t]};if(!this.queues[t]){let s=n().finally(r);return this.queues[t]=[s,null],s}this.queues[t][1]&&this.queues[t][1].reject(new hu("Queued async function is outdated"));let o=U6();return this.queues[t][1]=o,o.promise.then(()=>n().finally(r))}};function IS(e,t){var s;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return IS(r,t);let o=(s=e.ownerDocument.defaultView)==null?void 0:s.frameElement;return o?IS(o,t):null}function AS(e,t){return IS(e,t)}var V6={accepted:"onConversationAcceptedAssistants","new-message":"onConversationNewMessageAssistants",ended:"onConversationEndedAssistants"},IA=(e,t)=>{var o,s,i;if(!((i=(s=(o=e.uiConfig)==null?void 0:o.widget)==null?void 0:s.types.find(a=>a.type==="cues"))==null?void 0:i.isActive))return ee.warn("Triggered a conversation assistant, but cues are not configured in widget."),[];let r=e[V6[t]];return r&&r.length>0?r.map(a=>a.code):(ee.warn(`No assistant set in profile for conversation event "${t}"`),[])};function AA(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function j6(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Mm(e){return j6(e)&&(wi(e)||pm(e))}var NA,Wr=new Map,W6=["bottom","height","left","right","top","width"],_A=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:W6.some(n=>e[n]!==t[n]);function MA(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,...MA(t)]:[]}function LA(e,t){return!e||!t?null:I(b({},e),{top:e.top+t.top,left:e.left+t.left})}var Lm=!1,OA=()=>{Lm=!0;let e=[];if(Wr.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),Wr.delete(n);return}let r=n.getBoundingClientRect();_A(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(LA,t.rect):t.rect;_A(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),Wr.size===0){Lm=!1;return}NA=window.requestAnimationFrame(OA)};function _S(e,t){let n=MA(e),r=[],o=n.map((s,i)=>_S(s,a=>{r[i]=a;let l=Wr.get(e);if(!l)return;let c=r.reduce(LA,l.rect);l.callbacks.forEach(u=>u(c))}));return{observe(s=!0){if(o.forEach(i=>i.observe(!1)),Wr.has(e)){let i=Wr.get(e);i.callbacks.push(t),i.rect&&t(i.rect)}else Wr.set(e,{rect:void 0,callbacks:[t],parentRects:r});s&&!Lm&&OA()},unobserve(){o.forEach(i=>i.unobserve());let s=Wr.get(e);if(s){let i=s.callbacks.indexOf(t);i>=0&&s.callbacks.splice(i,1),s.callbacks.length||Wr.delete(e),Wr.size||(cancelAnimationFrame(NA),Lm=!1)}}}}var DA,$r=new Map,FA=()=>{$r.forEach((e,t)=>{if(!t.isConnected){$r.delete(t);return}let{clientHeight:n,scrollHeight:r}=t,o=r>n;e.visible!==o&&(e.visible=o,e.callbacks.forEach(s=>s(e.visible)))}),$r.size!==0&&(DA=window.requestAnimationFrame(FA))};function zA(e,t){return{observe(){let n=$r.size===0;$r.has(e)?$r.get(e).callbacks.push(t):$r.set(e,{visible:void 0,callbacks:[t]}),n&&FA()},unobserve(){let n=$r.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||$r.delete(e),$r.size||cancelAnimationFrame(DA)}}}}var NS=["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 MS(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function Za(e){return Number.parseFloat(e)}function Om(e){return Math.round(e*1e6)}function HA(e){return e/1e6}function LS(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=Za(e.width),s=Za(e.borderLeftWidth),i=Za(e.borderRightWidth),a=Za(e.paddingRight),l=HA(Om(o)-Om(s)-Om(i)),c=HA(Om(r));if(l-c>2){let u=l-c;n.style.paddingRight=`${a+u}px`}}function yu(e,t={}){var u,f;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=(u=t.position)!=null?u:"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",ri(n);let r=window.getComputedStyle(e),o=!0,s=()=>{n.scrollTop=e.scrollTop};MS(r,n,NS),LS(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",s));let i=zA(e,()=>{MS(r,n,NS),LS(r,e,n),s(),setTimeout(s,0)}),a,l=!0,c=_S(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(MS(r,n,NS),LS(r,e,n),s(),t.placement==="below"&&n.classList.add("below"),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let p=t.closestScrollElement.getBoundingClientRect(),h=window.getComputedStyle(t.closestScrollElement),m=Za(h.borderTopWidth),S=Za(h.borderBottomWidth),y=p.top+m-d.top,g=d.top+d.height+-(p.top+p.height-S);n.style.clipPath=`inset(${y}px 0px ${g}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),c.observe(),i.observe(),[n,()=>{e.removeEventListener("scroll",s),c.unobserve(),i.unobserve(),n.remove()}]}function $6(e){return e.offsetParent!==null}function BA(e){if(!$6(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 Dm(e,t,n=100){let r=BA(e);t({isVisible:r});let o=setInterval(()=>{let s=BA(e);s!==r&&(r=s,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var UA=(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){ee.warn("[Deepdesk] SessionStorage is blocked by browser")}}});var ke=E(P());var VA=UA("showTabHint",!0),Ja=class Ja{constructor({deepdeskUrl:t,version:n=Ja.version||"unknown",locale:r="en-US",token:o,fetch:s,productName:i,createCustomChannel:a,websocketClient:l=Am}){this.inputMediator=null;this.eventListeners={};this.unmountHandlers=[];this.disposeHandlers=[];this.inlineSuggestions=null;this.aboveSuggestions=null;this.belowSuggestions=null;this.floatingMenu=null;this.widgetElement=null;this.widgetRoot=null;this.nicknameDialogUnsubscribe=null;this.nicknameDialogFailed=!1;this.dynamicThunkObject={};this.queues=new Nm;this.isMounted=!1;this.shouldRender=!0;this.loadProfileConfigPromise=null;let c=t.replace(/\/api$/,"");this.deepdeskApi=new Po(c,{token:o,fetch:s}),this.version=n,this.instanceId=Ja.count++;let u={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[kA({broadcast:(h,m,S)=>{this.broadcastEvents.send(h,m,S)},emit:(h,m)=>this.emit(h,m),handleAfterSendMessage:h=>this.handleAfterSendMessage(h),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:h=>this.logSendMessage(h),onUpdateShowTabHint:h=>VA.update(h),sendEvent:(h,m)=>this.deepdeskApi.sendEvent(h,m)})]};this.store=CA(u),this.broadcastEvents=new dA({debug:!0,deepdeskUrl:c,eventMap:Pb(this.store),createCustomChannel:a}),this.disposeHandlers.push(()=>{this.broadcastEvents.cleanup()}),this.ws=new l({url:`${c}/api/v2/me/realtime`.replace("https","wss"),reconnectInterval:25e3,shouldReconnect:()=>N(this,null,function*(){var h;return(h=Rt(this.state))!=null?h:!1})}),this.whenLoggedIn(()=>this.ws.connect()),this.store.dispatch(ou(VA.value())),this.store.dispatch(Od({locale:r,adminUrl:c,productName:i}));let f=[],d=h=>{if(!h.conversationId)return;let m=()=>{this.conversationId()===h.conversationId&&this.store.dispatch(aE(h))};this.hasConversation()?m():f.push(m)};this.ws.on("assistants::direct_response",d),this.ws.on("assistants::user_notification",d),this.ws.on("assistants::response_chunk",h=>{if(!h.conversationId)return;let m=()=>{this.conversationId()===h.conversationId&&this.store.dispatch(iE(h))};this.hasConversation()?m():f.push(m)}),this.ws.on("assistants::suggest_as_reply",h=>{if(!h.conversationId)return;let m=()=>{this.conversationId()===h.conversationId&&this.store.dispatch(Bi([{text:h.payload.message,type:"text",source:"assistant",assistantCode:h.code,sourceLabel:h.name}]))};this.hasConversation()?m():f.push(m)});let p=this.whenConversationLoaded(()=>{var h;this.broadcastEvents.setExternalId((h=this.state.conversation.current)==null?void 0:h.externalId),f.forEach(m=>m()),f.length=0});this.disposeHandlers.push(()=>{this.ws.cleanup(),f.length=0,p()})}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){var t;return(t=Ms(this.state)[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}externalId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.externalId}shouldAbort(){return this.state.conversation.isSupported===!1?(ee.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(ee.warn("Profile has not been loaded (yet)"),!0):(ee.warn("No conversation loaded (yet)"),!0)}whenLoggedIn(t){if(Rt(this.state))t();else{let n=this.subscribe(Rt,r=>{r&&t()});this.disposeHandlers.push(()=>{n()})}}login(){return this.store.dispatch(Fi(null)),this.store.dispatch(Yr()),new Promise(t=>{this.whenLoggedIn(()=>t())})}isLoggedIn(){return N(this,null,function*(){return(yield this.store.dispatch(Yr())).payload})}isConversationSupported(t,n){return N(this,null,function*(){return(yield this.store.dispatch(Bg({externalId:t,options:n}))).payload})}createConversation(t){return N(this,null,function*(){var r;return this.hasConversation()&&this.externalId()!==t.externalId&&this.resetConversation(),(yield this.store.dispatch(od(I(b({},t),{metadata:(r=t.metadata)!=null?r:{}})))).payload})}getConversationByExternalId(t,n){return N(this,null,function*(){return this.hasConversation()&&this.externalId()!==t&&this.resetConversation(),(yield this.store.dispatch(sd({externalId:t,options:n}))).payload})}upsertConversation(t){return N(this,null,function*(){var r;return this.hasConversation()&&this.externalId()!==t.externalId&&this.resetConversation(),(yield this.store.dispatch(Ug(I(b({},t),{metadata:(r=t.metadata)!=null?r:{}})))).payload})}postMessages(t){return N(this,null,function*(){yield this.store.dispatch(Vg(t))})}updateConversation(t){return N(this,null,function*(){return(yield this.store.dispatch(id(t))).payload})}resetConversation(){this.store.dispatch(lt()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}configure(t){this.store.dispatch(Od(t))}setVisitorInfo(t){this.store.dispatch(yb(t))}setCustomData(t){this.store.dispatch(vb(t))}setAgentInfo(t,n){return N(this,null,function*(){var o;yield this.store.dispatch(hl(b(b({},t),n))),(o=this.state.info.agentInfo)!=null&&o.agentNickname||this.broadcastEvents.send(pd,{showNicknameDialog:!0})})}setAgentSettings(t){return N(this,null,function*(){yield this.store.dispatch(Wg(t))})}getAgentSettings(){return N(this,null,function*(){return(yield this.store.dispatch($g())).payload})}refresh(){return N(this,null,function*(){if(this.shouldAbort())return Promise.resolve();let t=[];return t.push(this.refreshTextSuggestions()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}syncInputMediator(){this.inputMediator&&this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),suggestionTextStart:this.inputMediator.getSuggestionTextStart()}))}notifyExternalSuggestion(t){this.store.dispatch(Cn(t))}evaluateAssistant(t,n){return N(this,null,function*(){var c;let{input:r={},transcript:o,showCuesInWidget:s=!0,includeMetadata:i,externalConversationId:a}=n||{},l=yield this.store.dispatch(fn({assistantCode:t,transcript:o,includeMetadata:i,input:r,externalConversationId:a,skipState:!s}));if(l.error)throw new Error(`Assistant evaluation failed: ${(c=l.payload)!=null?c:l.error.message}`);return l.payload.output})}evaluateConversationAssistant(t,n){return N(this,null,function*(){var u,f,p;yield this.loadProfileConfig();let r=this.state.profile.data;if(!r&&((u=this.state.conversation.current)!=null&&u.profileCode)&&(yield this.loadProfileConfig(),r=this.state.profile.data),!r){ee.warn("Can't evaluate assistant when profile is not loaded yet.");return}let o=IA(r,t),s=(f=n==null?void 0:n.showCuesInWidget)!=null?f:!0,d=n!=null?n:{},{showCuesInWidget:i}=d,a=se(d,["showCuesInWidget"]),l=(p=n==null?void 0:n.externalConversationId)!=null?p:this.hasConversation()?this.externalId():"",c=yield Promise.all(o.map(h=>this.queues.push(h,()=>N(this,null,function*(){var S,y;let m=yield this.store.dispatch(fn(I(b({assistantCode:h,includeMetadata:!0},a),{skipState:!s})));if(m.error)throw new Error(`Assistant evaluation failed: ${(S=m.payload)!=null?S:m.error.message}`);return{assistantCode:h,evaluationId:m.payload.evaluationId,output:m.payload.output,externalConversationId:(y=m.payload.externalConversationId)!=null?y:l}})).catch(m=>{if(m instanceof hu)return ee.warn(`Queued assistant "${h}" was outdated and dropped`),null;throw m})));if(!s)return c.filter(h=>h!==null)})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:s,selection:i}=this.state.input,{inlineSuggestions:a,autoSelectSuggestion:l,showTextSuggestions:c,suggestionsPlacement:u}=this.settings,f=a||l,d=u==="inline"||u==="below"?"below":"above",p=o.length>0;if(this.store.dispatch(ob(jg(t))),!Ur(this.state)||t.key!=="Tab"&&!c)return;let h=()=>{n||!p||i&&(t.shiftKey||(this.store.dispatch(ab()),t.preventDefault()))},m=()=>{n||!p||f&&s<=0||i&&(t.shiftKey||(this.store.dispatch(lb()),t.preventDefault()))};switch(t.key){case"ArrowUp":d==="below"?m():h();break;case"ArrowDown":{d==="below"?h():m();break}case"Escape":{n||(this.store.dispatch(ld(-1)),this.store.dispatch(ys({collapse:!0})),this.store.dispatch(KP(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let S=Hi(this.state);if(!S)return;this.store.dispatch(ou(!1)),this.store.dispatch(Cn({text:S.text,suggestion:S,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(f||this.state.input.selectedSuggestionIndex===-1)return;let S=Hi(this.state);if(!S)return;this.store.dispatch(Cn({text:S.text,suggestion:S,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(f||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let S=Hi(this.state);if(!S)return;this.store.dispatch(Cn({text:S.text,suggestion:S,eventMetrics:{inputType:"enter"},replace:"until-selection-end"})),t.preventDefault();break}default:}n&&r&&this.store.dispatch(ys({collapse:!1}))}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(Do([]))}handlingTimeStart(){this.state.handlingTime.startTime||(ee.info("Start handling time"),this.store.dispatch(hA()))}handlingTimeStop(){this.state.handlingTime.startTime&&(ee.info("Stop handling time"),this.store.dispatch(_m()))}logSendMessage(t){let n=PA(this.state,{version:this.version});n&&(t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEvent("Send Message",{conversationId:this.conversationId(),data:n}),this.emit("send-message-event",n))}logHandlingTime(){let t=RA(this.state,{version:this.version});t&&(this.deepdeskApi.sendEvent("Handling Time",{conversationId:this.conversationId(),data:t}),this.store.dispatch(yA()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Os((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(ub()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(s){ee.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),ee.error(s)}})}on(t,n){return this.eventListeners[t]||(this.eventListeners[t]=[]),this.eventListeners[t].push(n),()=>{this.off(t,n)}}off(t,n){if(!t&&!n){this.eventListeners={};return}let r;this.eventListeners[t]&&(r=this.eventListeners[t].indexOf(n),r>-1&&this.eventListeners[t].splice(r,1))}setConversationQuery(t){this.dynamicThunkObject.conversationQuery=t}setPlatformVariables(t){this.store.dispatch(Sb(t))}whenConversationLoaded(t){let n=s=>{var i;return(i=s.conversation.current)==null?void 0:i.id},r=()=>this.loadProfileConfig().then(()=>t());return n(this.state)&&r(),this.subscribe(n,s=>{s&&r()})}overlayContainerFactory(t,n,r,o){let[s,i]=yu(n,r);return s.setAttribute("translate","no"),s.dataset.testid=t,o&&s.classList.add(o),[s,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 s=(a=t.ownerDocument.defaultView)==null?void 0:a.frameElement,i=s?s.ownerDocument.defaultView:null;if(s&&(i===window||(i==null?void 0:i.parent)===window)){let[l,c]=yu(s,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{c()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return ri(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),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),ee.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()?(ee.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(cb(r.metrics))):ee.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(!Mm(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let d=n,{customStyles:r,closestScrollSelector:o,floatingMenuParent:s,appendOverlayTo:i,inputMediator:a}=d,l=se(d,["customStyles","closestScrollSelector","floatingMenuParent","appendOverlayTo","inputMediator"]),c={customStyles:r,closestScrollSelector:o,floatingMenuParent:s,appendOverlayTo:i};this.configure(l),this.settings.automaticHandlingTime&&this.setupHandlingTime(t),ri(t),this.inputMediator=a||(wi(t)?new Ci(t):new Ei(t)),this.inputMediator.on("change",({plainText:p,rawHTML:h,suggestionTextStart:m})=>{this.store.dispatch(cd({text:p,html:h,suggestionTextStart:m}))}),this.inputMediator.on("keyup",p=>{this.store.dispatch(sb(jg(p)))}),this.inputMediator.on("keydown",p=>{this.handleKeyDown(p)}),this.inputMediator.on("paste",({pastedText:p,selectionText:h})=>{this.store.dispatch(ib({text:p,selectionText:h}))}),this.inputMediator.on("cut",({selectionText:p})=>{this.store.dispatch(rb(p))});let u;this.inputMediator.on("selection",p=>{clearTimeout(u),p===null?u=setTimeout(()=>{p!==null&&this.store.dispatch(ud(p))},500):this.store.dispatch(ud(p))}),this.unmountHandlers.push(()=>{clearTimeout(u)}),this.inputMediator.on("disabled",()=>{var p;(p=this.inputMediator)==null||p.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{this.settings.detectSubmit&&this.notifySubmit()}),this.inputMediator.on("blur",()=>{this.store.dispatch(om(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(om(!0))}),this.renderSuggestions(t,c),this.subscribe(Bs("inlineSuggestions"),()=>{this.renderSuggestions(t,c)}),this.subscribe(Bs("suggestionsPlacement"),()=>{this.renderSuggestions(t,c)});let f=this.renderOverlays(n);this.unmountHandlers.push(()=>{f.unmount()}),this.store.dispatch(cd({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),suggestionTextStart:this.inputMediator.getSuggestionTextStart()})),this.store.dispatch(ud(this.inputMediator.getSelection())),this.store.dispatch(om(this.inputMediator.isFocused)),this.unmountHandlers.push(()=>{this.state.input.text!==""&&this.storeMetrics()}),this.whenConversationLoaded(()=>{this.restoreMetrics(),this.syncInputMediator(),this.refreshTextSuggestions(),this.promptForNickname()}),this.isMounted=!0}promptForNickname(t){if(this.nicknameDialogUnsubscribe||this.nicknameDialogFailed)return;let n=this.createContainer("nickname-dialog",document.body);document.body.appendChild(n);let r=(0,Io.createRoot)(n),o=null,s=a=>{o=a,i()},i=()=>{r==null||r.render((0,ke.jsx)(bo,{store:this.store,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(cI,{id:"deepdesk-nickname-dialog",error:o,onSave:a=>N(this,null,function*(){try{yield this.store.dispatch(gb({agentNickname:a})).unwrap(),console.log("setAgentNickname",a),this.broadcastEvents.send(pd,{showNicknameDialog:!1}),this.nicknameDialogUnsubscribe&&this.nicknameDialogUnsubscribe()}catch(l){ee.error("Error setting agent nickname",l),s("error"),this.nicknameDialogFailed=!0}})})})}))};i(),this.nicknameDialogUnsubscribe=()=>{r.unmount(),n.remove(),this.nicknameDialogUnsubscribe=null}}subscribe(t,n){let r=t(this.store.getState());return this.store.subscribe(()=>{let o=t(this.store.getState());o!==r&&(r=o,n(r))})}unmount(){var t,n,r,o,s;(t=this.inlineSuggestions)==null||t.unmount(),(n=this.aboveSuggestions)==null||n.unmount(),(r=this.belowSuggestions)==null||r.unmount(),(o=this.floatingMenu)==null||o.unmount(),this.unmountHandlers.forEach(i=>i()),this.unmountHandlers=[],(s=this.inputMediator)==null||s.dispose(),this.nicknameDialogUnsubscribe&&this.nicknameDialogUnsubscribe(),this.isMounted=!1}dispose(){this.unmount(),this.unmountWidget(),this.disposeHandlers.forEach(t=>t()),this.disposeHandlers=[],this.off()}renderSuggestions(t,n){var r,o,s,i;(r=this.floatingMenu)==null||r.unmount(),(o=this.inlineSuggestions)==null||o.unmount(),(s=this.aboveSuggestions)==null||s.unmount(),(i=this.belowSuggestions)==null||i.unmount(),this.settings.floatingMenu&&(this.floatingMenu=this.renderFloatingMenu(t,n)),this.settings.inlineSuggestions||this.settings.suggestionsPlacement==="inline"?this.inlineSuggestions=this.renderInlineSuggestions(t,n):this.settings.suggestionsPlacement==="below"?this.belowSuggestions=this.renderAboveOrBelowSuggestions(t,n,"below"):this.aboveSuggestions=this.renderAboveOrBelowSuggestions(t,n,"above")}renderInlineSuggestions(t,n){let{customStyles:r}=n,o=this.createInlineContainer(t,"deepdesk-caret"),s=(0,Io.createRoot)(o);s.render((0,ke.jsx)(bo,{store:this.store,customStyles:r,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(aI,{})})}));let i=a=>{a?(o.style.display="block",o.style.top=`${a.top}px`,o.style.left=`${a.left}px`):o.style.display="none"};return this.inputMediator.on("caretposition",i),{unmount:()=>{var a;(a=this.inputMediator)==null||a.off("caretposition",i),s.unmount(),o.remove()}}}renderAboveOrBelowSuggestions(t,n,r){let{customStyles:o,closestScrollSelector:s,appendOverlayTo:i}=n,a=s&&AS(t,s)||void 0,[l,c]=this.overlayContainerFactory("deepdesk-tab-completion",a||t,{appendTo:i,closestScrollElement:a,mirrorOverflow:!0,onRemove:()=>this.unmount()},o==null?void 0:o.rootNode),[u,f]=this.overlayContainerFactory("deepdesk-suggestions-overlay",a||t,{appendTo:i,placement:r},o==null?void 0:o.suggestionsRootNode),d=(0,Io.createRoot)(l);d.render((0,ke.jsx)(bo,{store:this.store,customStyles:o,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(MI,{inputElement:t})})}));let p=(0,Io.createRoot)(u);return p.render((0,ke.jsx)(bo,{store:this.store,customStyles:o,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(vI,{onLogIn:()=>this.loginViaPopup().catch(h=>ee.warn(h.message))})})})),{unmount(){d.unmount(),p.unmount(),c(),f()}}}renderFloatingMenu(t,n){let{customStyles:r,closestScrollSelector:o,appendOverlayTo:s,floatingMenuParent:i}=n,a=o&&AS(t,o)||void 0,[l,c]=this.overlayContainerFactory("floating-menu",a||t,{appendTo:i!=null?i:s},r==null?void 0:r.floatingMenuParent),u=(0,Io.createRoot)(l);return u.render((0,ke.jsx)(bo,{store:this.store,customStyles:r,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(WP,{onLogIn:()=>this.loginViaPopup().catch(f=>ee.warn(f.message))})})})),{unmount(){u.unmount(),c()}}}renderOverlays(t){let{customStyles:n}=t,r=this.createContainer("deepdesk-overlays"),o=(0,Io.createRoot)(r);return o.render((0,ke.jsx)(bo,{store:this.store,customStyles:n,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(HP,{})})})),{unmount(){o.unmount(),r.remove()}}}renderWidget(t,n={}){if(this.widgetElement&&ee.warn("A widget was already rendered for this instance. Make sure to unmountWidget before rerendering"),!this.shouldRender)return;let{customStyles:r,showImages:o,isEmbedded:s}=n;this.widgetElement=t,this.configure({showImages:o,isEmbedded:s}),this.widgetRoot=(0,Io.createRoot)(t),this.widgetRoot.render((0,ke.jsx)(bo,{store:this.store,customStyles:r,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(sA,{assistantOptions:n.assistantOptions,knowledgeAssistOptions:n.knowledgeAssist,onLogIn:()=>this.loginViaPopup().catch(i=>ee.warn(i.message))})})}))}unmountWidget(){var t,n;(n=(t=this.widgetRoot)==null?void 0:t.unmount)==null||n.call(t),this.widgetRoot=null,this.widgetElement=null}renderKnowledgeAssistantWidget(t,n,r={}){let{customStyles:o,initialQuestion:s}=r,i=(0,Io.createRoot)(n);return i.render((0,ke.jsx)(bo,{store:this.store,customStyles:o,children:(0,ke.jsx)(Qr,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(xS,{children:(0,ke.jsxs)(Op,{assistantCode:t,initialQuestion:s,evaluateKnowledgeAssistFn:Ll,children:[(0,ke.jsx)(Oi,{children:(0,ke.jsx)(Fp,{title:r.title,emptyState:r.emptyState})}),(0,ke.jsx)(SS,{children:(0,ke.jsx)(Dp,{})})]})})})})),{unmount(){i.unmount()}}}setupHandlingTime(t){let n=Dm(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){AA(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfig(){var t;return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(t=this.state.conversation.current)!=null&&t.profileCode?(this.loadProfileConfigPromise=Promise.resolve().then(()=>N(this,null,function*(){yield this.store.dispatch(Vc()).unwrap();let n=fs(this.state);n&&this.store.dispatch(Od({showSearch:n.search,showImageSearch:n.imageSearch,showEntitiesCommand:n.entitiesCommand,showSummaryCommand:!!n.summarizerAssistantNew,showKnowledgeSearch:!!n.knowledgeAssistantNew||!!n.knowledgeAssistant,recommendTextSuggestions:n.recommendTextSuggestions}))})).finally(()=>{fs(this.state)||(this.loadProfileConfigPromise=null)}),this.loadProfileConfigPromise):Promise.resolve()}loginViaPopup(t){return N(this,null,function*(){return new Promise((n,r)=>{this.store.dispatch(nd());let o=new MessageChannel,s=o.port1,i=this.settings.adminUrl,a=new URL(t!=null&&t.url?t==null?void 0:t.url:`${i}/platform/sso/`);a.searchParams.append("redirect","/sdk/popup/close.html");let l=!1,c=()=>{u&&!u.closed&&u.close(),window.removeEventListener("message",f),clearInterval(d)};s.onmessage=p=>N(this,null,function*(){var h,m;if((h=p.data)!=null&&h.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((m=p.data)==null?void 0:m.jwt),yield this.isLoggedIn(),this.broadcastEvents.send(vl),l=!0,o.port1.close(),n()}catch(S){console.error(S),r(S)}finally{l=!0,c()}});let u=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");u===null&&r(new Error("Popup blocked by browser"));let f=p=>N(this,null,function*(){var h;if(p.origin===a.origin)switch((h=p.data)==null?void 0:h.type){case"deepdesk-popup-request-origin":{try{let m=JSON.stringify({type:"deepdesk-popup-parent-origin"});u==null||u.postMessage(m,a.origin)}catch(m){ee.error("Error posting message to popup",m),r(m)}break}case"deepdesk-popup-loaded":{try{let m=JSON.stringify({type:"deepdesk-popup-create-channel"});u==null||u.postMessage(m,a.origin,[o.port2])}catch(m){ee.error("Error posting message to popup",m),r(m)}break}case"deepdesk-popup-error":{if(c(),p.data.message==="Platform account url mismatch"){let m=`Please contact your administrator: The platform account url (${p.data.targetOrigin}) is misconfigured as it differs from the origin of the page that opened the popup (${p.data.openerOrigin}).`;ee.warn(m),this.store.dispatch(Fg(m)),r(new Error(m))}if(p.data.message==="Timeout"){let m="Please contact your administrator: Popup timed out. Check if the account's platform url is configured correctly.";ee.warn(m),this.store.dispatch(Fg(m)),r(new Error(m))}r(new Error(p.data.message));break}}});window.addEventListener("message",f);let d=setInterval(()=>{u&&!u.closed||(c(),l||r(new Error("Popup closed by user")))},200);this.disposeHandlers.push(c)})})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}refreshTextSuggestions(){return N(this,null,function*(){this.isMounted&&(yield this.store.dispatch(tm()))})}refreshWidgetSuggestions(){return N(this,null,function*(){if(!this.widgetRoot)return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=jc(this.state);try{n.forEach(({type:r})=>{switch(r){case"entities":this.store.dispatch(vr());break;case"pinned-messages":case"sticky-messages":break;default:Bu.includes(r)||this.store.dispatch(Sr(r))}})}catch(r){this.handleError(r)}})}};Ja.version="19.3.2-beta.4",Ja.count=0;var vu=Ja;function K6(e){return N(this,null,function*(){var o,s,i;let n=yield((o=e.fetch)!=null?o:window.fetch)(e.url),r=yield n.blob();return new File([r],e.name,{type:(i=(s=e.mimeType)!=null?s:n.headers.get("Content-Type"))!=null?i:"image/jpeg"})})}function jA(e,t){return N(this,null,function*(){let n=yield K6(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 WA(e,t,n){return N(this,null,function*(){yield new Po(e).authenticateWithKey(t,n)})}function $A(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function KA(r,o){return N(this,arguments,function*(e,t,n={}){var f,d;let{value:s}=e,{start:i,end:a}=(f=n.replace)!=null?f:{start:0,end:s.length},l=`${s.slice(0,i)}${t}${s.slice(a)}`,c=(d=n.selectionAfter)!=null?d:{start:i+t.length,end:i+t.length},u=()=>{if(n.setValue)return n.setValue(l);e.value=l};return Promise.resolve(u()).then(()=>{e.selectionStart=c.start,e.selectionEnd=c.end,e.blur(),e.focus()})})}function GA(r,o){return N(this,arguments,function*(e,t,n={}){let s=n.replace?Es(e,n.replace.start,n.replace.end):Xa(e),i,a=()=>{if(n.setRange)return n.setRange(s.cloneRange());s.deleteContents(),i=document.createElement("span"),s.insertNode(i),n.insertBRs!==!1?t.split(`
84
- `).reverse().forEach((l,c)=>{c>0&&s.insertNode(document.createElement("br")),s.insertNode(document.createTextNode(l))}):s.insertNode(document.createTextNode(t))};return Promise.resolve(a()).then(()=>{try{if(n.selectionAfter!==!1){e.focus();let l=n.selectionAfter?Es(e,n.selectionAfter.start,n.selectionAfter.end):(s.collapse(!1),s),c=window.getSelection();c==null||c.removeAllRanges(),c==null||c.addRange(l)}if(!i)return;i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}function G6(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 q6(e){let t=document.createDocumentFragment();return e.split(`
85
- `).forEach((n,r)=>{r>0&&t.appendChild(document.createElement("br"));let o={index:0},s=0;for(;o=n.slice(s).match(/(\[([^\]]+)])\(([^)]+)\)/);){let i=document.createElement("a");i.href=o[3],i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"),i.appendChild(document.createTextNode(o[2])),t.appendChild(document.createTextNode(n.slice(s,s+o.index))),t.appendChild(i),s=s+o.index+o[0].length}t.appendChild(document.createTextNode(n.slice(s)))}),t}function qA(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):qA(n,t)}function YA(o,s){return N(this,arguments,function*(e,t,{isBlock:n,isHTML:r}={}){let i;e.dispatchEvent(new InputEvent("beforeinput",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0}));let a=()=>{var d;let l=(d=e.ownerDocument.defaultView)!=null?d:window,c=l.getSelection();if((!c||c.rangeCount===0)&&(e.focus(),c=l.getSelection()),!c||c.rangeCount===0)return;let u=c.getRangeAt(0);if(!u)return;i=document.createElement("span"),u.insertNode(i);let f=r?G6(t):q6(t);n?qA(u.startContainer,f):(u.insertNode(f),u.collapse(!1))};return Promise.resolve(a()).then(()=>{if(e.dispatchEvent(new InputEvent("input",{inputType:"insertText",data:t,bubbles:!0,cancelable:!0})),e.focus(),!!i)try{i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"})}finally{i&&i.remove()}})})}return v_(Y6);})();
81
+ 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 mS=b(I()),z5={green:"#0A5E52",pink:"#CD8EF2",red:"#DF341D",yellow:"#DEBD00"},cI=({className:e,color:t})=>(0,mS.jsx)("svg",{className:e,viewBox:"0 0 345 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,mS.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:z5[t||"pink"]})});var uI={root:"dd-LbeUM",text:"dd-Dpfn1",isLoggedIn:"dd-XvHAn",isLoggedOut:"dd-21y-z",icon:"dd-8rLqS",logo:"dd-slXhD",lock:"dd-ByzlR"};var gS={};ht(gS,{enUS:()=>H5,nlNL:()=>B5});var H5={signin:[{type:0,value:"Sign in to "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Search"}]},B5={signin:[{type:0,value:"Log in bij "},{type:1,value:"productName"}],search:[{type:1,value:"productName"},{type:0,value:" Zoeken"}]};var bs=b(I()),fI=({onLogIn:e})=>{let t=se(gS),n=X("floatingMenu"),r=X("productName"),o=Ee(),i=G(Pt),s=z("FloatingMenu",uI);if(i===null||n===!1)return null;let a=()=>{i===!0?o(ir(!0)):e()};return(0,bs.jsxs)("button",{type:"button",className:(0,dI.default)(s.root,{[s.isLoggedIn]:i,[s.isLoggedOut]:!i}),onClick:a,children:[(0,bs.jsx)("div",{className:s.text,children:t(i?"search":"signin",{productName:r})}),(0,bs.jsxs)("div",{className:s.icon,children:[(0,bs.jsx)(cI,{className:s.logo,color:"pink"}),i===!1&&(0,bs.jsx)(lI,{className:s.lock})]})]})};var Cm=b(Z());function jr(e){let{showMidSentenceSuggestions:t,showSuggestionsBeforePattern:n,showSuggestionsAfterPattern:r}=e.settings,{text:o,selection:i}=e.input;return i.end<e.input.suggestionTextStart||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 U5={showTabHint:!1,inputHasFocus:!1,overlayCollapsed:!1,openOverlayWhenTyping:!1,overlayCollapsedUserOverwrite:!1},ym=({ui:e})=>e.overlayCollapsed,pI=Re({name:"ui",initialState:U5,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:lu,setInputFocus:vm,setOverlayCollapsed:Si,setOpenOverlayWhenTyping:mI,setOverlayCollapsedUserOverwrite:gI}=pI.actions,hI=pI.reducer;var yI={styleRow:"dd-prYfH",styleSuggestion:"dd-JTmXy"};var cu=b(I()),V5=({match:e,selected:t,styles:n})=>(0,cu.jsx)(pe,{as:"button",selected:t,className:n.styleRow,"data-testid":"style-suggestion-item",title:e.suggestion,children:(0,cu.jsx)("span",{className:n.styleSuggestion,children:e.suggestion})}),W5=({matches:e,selectedIndex:t})=>{let n=z("StyleSuggestionList",yI);return(0,cu.jsx)(Tt,{children:e.map((r,o)=>(0,cu.jsx)(V5,{match:r,selected:t===o,styles:n},`${r.keyword}-${o}`))})},Sm=W5;var EI=b(Z());var xi=b(Z());var vI=b(Z());function SI(e,t,n){(0,vI.useEffect)(()=>{let r=e.current;return r?(r.addEventListener(t,n),()=>{r.removeEventListener(t,n)}):()=>{}},[e,t,n])}var xI={root:"dd-1MBCO",actions:"dd--x4cy",closeIconContainer:"dd-1z5NR",closeIcon:"dd-8qMF-",badge:"dd-4Fpkz",formattedText:"dd-EzvTB",assistantContainer:"dd-j6o8F",formattedTextTruncated:"dd-fv169",assistantBadge:"dd-VD57E"};var uu=b(I()),wI=({title:e})=>(0,uu.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18px",height:"18px",viewBox:"0 0 24 24","aria-labelledby":"closeTitle",children:[(0,uu.jsx)("title",{id:"closeTitle",children:e}),(0,uu.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})]});var hS={};ht(hS,{enUS:()=>$5,nlNL:()=>j5});var $5={assistant:[{type:0,value:"Assistant"}],close:[{type:0,value:"Close"}]},j5={assistant:[{type:0,value:"Assistent"}],close:[{type:0,value:"Sluiten"}]};var zn=b(I()),G5=["search","personal-collection-search","search-autocomplete"];function q5(e,t,n,r={}){var i;let o="";return G5.includes(t)?o=MP(sS(e,n,{stripAgentPart:!0}),(i=r.searchKeywords)!=null?i:[n]):o=sS(e,n,r),r.placeholders===!0&&(o=NP(o)),o}var Y5=()=>{},X5=({selected:e,suggestion:t})=>{let n=se(hS),r=X("inlineSuggestions"),o=G(Ni),[i,s]=(0,xi.useState)(!1),a=X("enableSuggestionFeedback"),l=G(v=>v.input.text),c=Ee(),u=z("TextSuggestion",xI),f=(0,xi.useRef)(null),d=t.source==="assistant",p=a&&!d;(0,xi.useEffect)(()=>{let v=setTimeout(()=>{c(Eb({text:t.text,suggestion:t}))},500);return()=>{clearTimeout(v)}},[t]),SI(f,"click",()=>{c(kn({suggestion:t,text:t.text,eventMetrics:{inputType:"mouse"},replace:"until-selection-end"}))});let m=()=>{c(Li({source:t.source,text:t.text,assistantCode:t.assistantCode}))},g=(0,xi.useMemo)(()=>q5(t.text,t.source,o,{stripAgentPart:r,placeholders:!0,searchKeywords:t.searchKeywords}),[r,t.text,t.source,o,t.searchKeywords]);return t.source==="gpt"&&!r?null:(0,zn.jsxs)("div",{className:u.root,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[(0,zn.jsx)(pe,{ref:f,as:"button","data-testid":"suggestions-overlay-item",selected:e,onClick:Y5,children:t.source==="assistant"?(0,zn.jsxs)("div",{className:u.assistantContainer,children:[(0,zn.jsx)(yi,{containerTagName:"div",tagName:"span",className:u.formattedTextTruncated,content:g}),(0,zn.jsx)("span",{className:u.assistantBadge,children:n("assistant")})]}):(0,zn.jsx)(yi,{containerTagName:"div",tagName:"span",className:u.formattedText,content:g})}),p&&i&&(0,zn.jsx)("div",{className:u.actions,children:(0,zn.jsx)(pm,{source:"overlay",context:l,suggestion:t})}),d&&i&&(0,zn.jsx)("div",{className:u.closeIconContainer,children:(0,zn.jsx)("button",{type:"button",className:u.closeIcon,onClick:m,title:n("close"),children:(0,zn.jsx)(wI,{title:n("close")})})})]})},bI=X5;var CI=b(I()),Q5=({suggestions:e,selectedIndex:t,reverse:n})=>(0,EI.useMemo)(()=>{let o=e.map((i,s)=>(0,CI.jsx)(bI,{index:s,selected:s===t,suggestion:i},`${i.text}-${i.source}`));return n?o.reverse():o},[e,t,n]),xm=Q5;var TI={root:"dd-PfvRI",paper:"dd-HYlyY"};var wm={list:{keywordMatches:[]},fetchState:"idle"},bm=e=>e.styleSuggestions.list,Es=ge("styleSuggestions/getAll",(n,r)=>M(null,[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 wm.list;if(!a)throw new Error("No current conversation to fetch pinned messages");return o.getStyleSuggestions({profileCode:a,message:e})})),kI=Re({name:"styleSuggestions",initialState:wm,reducers:{commitStyleSuggestion(e,t){let{keyword:n,suggestion:r}=t.payload;e.list.keywordMatches=e.list.keywordMatches.filter(o=>o.keyword.toLowerCase()!==n.toLowerCase()||o.suggestion!==r)}},extraReducers:e=>{e.addCase(Es.pending,t=>{t.fetchState="loading"}).addCase(Es.rejected,t=>{t.fetchState="error"}).addCase(Es.fulfilled,(t,n)=>{t.fetchState="done",zo(t.list,n.payload)||(t.list=n.payload)}).addCase(Di,t=>{t.list=wm.list}).addCase(lt,()=>wm)}}),{commitStyleSuggestion:RI}=kI.actions,PI=kI.reducer;var Em=e=>{let t=new Set;return e.filter(({keyword:n,suggestion:r})=>{let o=JSON.stringify([n.toLowerCase(),r]);return t.has(o)?!1:(t.add(o),!0)})};var Cs=b(I()),Z5=()=>{var v;let e=(0,Cm.useRef)(null),t=z("InlineSuggestionsOverlay",TI),n=G(jr),r=Ee(),o=G(Pt),i=G($s),s=G(ym),a=X("showTextSuggestions"),l=G(Oi),c=G(xl),u=X("showStyleSuggestions"),f=X("showStyleSuggestionList"),d=G(bm),p=u&&f?Em((v=d.keywordMatches)!=null?v:[]):[],m=p.length>0,g=a&&l.length>0;return di(()=>{setTimeout(()=>{r(Si({collapse:!0,skipWhenInputFocus:!0}))})}),(0,Cm.useEffect)(()=>{let h=e.current;if(!h||!h.parentElement)return;h.parentElement.style.left="0px";let y=h.getBoundingClientRect();h.parentElement.style.left=`${Math.min(window.innerWidth-4-y.right,0)}px`}),s||o!==!0||i===!1||!n&&!m||!g&&!m?null:(0,Cs.jsx)("div",{className:t.root,"data-variant":"inline",children:(0,Cs.jsxs)("div",{ref:e,className:t.paper,children:[m&&(0,Cs.jsx)(Sm,{matches:p,selectedIndex:-1}),g&&(0,Cs.jsx)(Tt,{children:(0,Cs.jsx)(xm,{suggestions:l,selectedIndex:c})})]})})},II=Z5;var wi=b(Z());var AI={root:"dd-7zvcP",dialogContent:"dd-4C0lK",continueButton:"dd-YUPQW",buttonContinueWrapper:"dd-IKpYs",nicknameInput:"dd-rxhGp",titleWrapper:"dd-nw3nD",title:"dd-5iof5",closeButtonWrapper:"dd-UUAzA",closeButton:"dd-7rjP5",buttonsWrapper:"dd-5e9Xb",errorMessage:"dd--5VgX",errorLink:"dd-u461n"};var yS={};ht(yS,{enUS:()=>J5,nlNL:()=>e6});var J5={title:[{type:0,value:"Enter your nickname"}],close:[{type:0,value:"Close"}],nicknameDialogTitle:[{type:0,value:"Please enter the name you'd like customers to see during chat conversations. This nickname will be used across your Deepdesk environment."}],nicknameDialogInputPlaceholder:[{type:0,value:"Enter your nickname"}],nicknameDialogContinueButton:[{type:0,value:"Continue"}],nicknameDialogError:[{type:0,value:"Nickname cannot be empty or spaces only"}],nicknameDialogEmojiError:[{type:0,value:"You cannot use emojis in this field."}],nicknameDialogSaveError:[{type:0,value:"We couldn't save your details just now. Please try again, or update it at "},{type:1,value:"account"},{type:0,value:".deepdesk.com/admin/user-settings"}],nicknameDialogSaveErrorWithoutLink:[{type:0,value:"We couldn\u2019t save your details just now. Please try again later, or update them in My Deepdesk \u2192 Settings."}]},e6={title:[{type:0,value:"Voer je bijnaam in"}],close:[{type:0,value:"Sluiten"}],nicknameDialogTitle:[{type:0,value:"Voer de naam in die je wilt dat klanten zien tijdens chatgesprekken. Deze bijnaam wordt gebruikt in je Deepdesk-omgeving."}],nicknameDialogInputPlaceholder:[{type:0,value:"Voer je bijnaam in"}],nicknameDialogContinueButton:[{type:0,value:"Doorgaan"}],nicknameDialogError:[{type:0,value:"Bijnaam mag niet leeg of alleen spaties zijn"}],nicknameDialogEmojiError:[{type:0,value:"Je kunt geen emoji's gebruiken in dit veld."}],nicknameDialogSaveError:[{type:0,value:"We konden je gegevens nu niet opslaan. Probeer het opnieuw of werk het bij op "},{type:1,value:"account"},{type:0,value:".deepdesk.com/admin/user-settings"}],nicknameDialogSaveErrorWithoutLink:[{type:0,value:"We konden je gegevens nu niet opslaan. Probeer het opnieuw later, of werk ze bij in My Deepdesk \u2192 Instellingen."}]};var ft=b(I()),_I=({onClose:e,onSave:t,id:n,error:r})=>{let[o,i]=(0,wi.useState)(""),[s,a]=(0,wi.useState)(!1),[l,c]=(0,wi.useState)(!1),u=z("Nickname",AI),f=wi.default.useRef(null),d=G(h=>h.info.showNicknameDialog),p=se(yS),m=X("adminUrl");(0,wi.useEffect)(()=>{r&&a(!0)},[r]);let g=()=>{if(!f.current)return;o.trim()?f.current.setCustomValidity(""):f.current.setCustomValidity(p("nicknameDialogError")),f.current.reportValidity()},v=h=>{h.preventDefault();let y=o.trim(),S=h.currentTarget.querySelector("#nickname-input");if(!y){S.setCustomValidity(p("nicknameDialogError")),S.reportValidity();return}S.setCustomValidity(""),t(y)};return(0,ft.jsxs)($a,{isOpen:d,"datatest-id":n,onClose:e||(()=>{}),onBack:e||(()=>{}),children:[(0,ft.jsx)("div",{className:u.titleWrapper,children:(0,ft.jsx)("h1",{className:u.title,children:p("title")})}),(0,ft.jsxs)("form",{className:u.dialogContent,onSubmit:v,children:[(0,ft.jsx)("p",{children:p("nicknameDialogTitle")}),s&&r&&(0,ft.jsx)("div",{className:u.errorMessage,children:m?(()=>{let h=p("nicknameDialogSaveError",{account:m}),y=`${m}.deepdesk.com/admin/user-settings`,S=h.indexOf(y);if(S!==-1){let x=h.substring(0,S),T=h.substring(S+y.length);return(0,ft.jsxs)(ft.Fragment,{children:[x,(0,ft.jsx)("a",{href:y,target:"_blank",rel:"noopener noreferrer",className:u.errorLink,children:y}),T]})}return h})():p("nicknameDialogSaveErrorWithoutLink")}),(0,ft.jsx)("input",{required:!0,minLength:1,maxLength:20,"data-testid":"nickname-input",id:"nickname-input",className:u.nicknameInput,type:"text",placeholder:p("nicknameDialogInputPlaceholder"),value:o,onChange:h=>{c(new RegExp("\\p{Extended_Pictographic}","u").test(h.target.value)),i(h.target.value)},onBlur:g,ref:f}),l&&(0,ft.jsx)("div",{className:u.errorMessage,role:"alert",children:p("nicknameDialogEmojiError")}),(0,ft.jsxs)("div",{className:u.buttonsWrapper,children:[r?(0,ft.jsx)("div",{className:u.closeButtonWrapper,children:(0,ft.jsx)("button",{type:"button",className:u.closeButton,onClick:()=>e==null?void 0:e(),children:p("close")})}):null,(0,ft.jsx)("div",{className:u.buttonContinueWrapper,children:(0,ft.jsx)("button",{type:"submit",className:u.continueButton,disabled:!o.trim()||new RegExp("\\p{Extended_Pictographic}","u").test(o),children:p("nicknameDialogContinueButton")})})]})]})]})};var du=b(I()),t6=({children:e})=>{let n=X("locale").replace("-","");return(0,du.jsx)(xh.Provider,{value:n,children:e})},n6=({store:e,customStyles:t={},children:n})=>(0,du.jsx)(vw,{store:e,children:(0,du.jsx)(t6,{children:(0,du.jsx)(cl.Provider,{value:t,children:n})})}),ko=n6;var km=b(De()),Ya=b(Z());var MI=b(Z());function NI(e,t){let[n,r]=(0,MI.useState)(()=>{if(typeof window=="undefined")return t;try{let i=window.localStorage.getItem(e);return i?JSON.parse(i):t}catch(i){return te.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){te.error(s)}}]}var OI=()=>/Mac/i.test(navigator.platform);var DI=b(De()),Ro=b(Z());var vS={};ht(vS,{enUS:()=>r6,nlNL:()=>o6});var r6={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"}]}]},o6={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 LI={root:"dd-uTPjX",anchor:"dd-C8lsZ",anchorButton:"dd-IoSx9"};var bi=b(I()),SS=(e,t,n)=>r=>(0,bi.jsx)("button",{className:e.anchorButton,type:"button",value:t,onClick:n,children:r},t),i6=({className:e,loginUrl:t,isEmbedded:n,onSnooze:r,onLogIn:o})=>{let i=se(vS),s=pn(),a=z("Login",LI),l=X("productName"),c=(0,Ro.useCallback)(v=>{v.preventDefault(),r&&r(Number.parseInt(v.target.value,10))},[]),u=(0,Ro.useCallback)(v=>{v.preventDefault(),s.send(Ys,!0)},[t]),f=(0,Ro.useMemo)(()=>v=>(0,bi.jsx)("a",{onClick:y=>{y.preventDefault(),o()},href:t,className:a.anchor,target:"_blank",rel:"noreferrer",children:v},"login"),[t]),d=(0,Ro.useCallback)(v=>(0,bi.jsx)("button",{type:"button",className:a.anchorButton,onClick:u,children:v},"prompt"),[u]),{min:p,hour:m,day:g}=(0,Ro.useMemo)(()=>({min:SS(a,600,c),hour:SS(a,3600,c),day:SS(a,3600*12,c)}),[]);return(0,bi.jsxs)("div",{className:(0,DI.default)(e,a.root),children:[i("loginPlease",{login:n?d:f,productName:l}),r&&(0,bi.jsxs)(Ro.Fragment,{children:[(0,bi.jsx)("br",{}),i("snooze",{min:p,hour:m,day:g})]})]})},Tm=i6;var FI={root:"dd-DoQhb",text:"dd-Jwnev"};var fu=b(I()),s6=({title:e})=>{let t=z("SearchTrigger",FI),n=Ee(),r=Ze();return(0,fu.jsxs)("button",{type:"button",className:t.root,onClick:()=>{n(ir(!0)),r("open search",{via:"autocomplete-overlay"})},children:[(0,fu.jsx)(Ga,{}),(0,fu.jsx)("span",{className:t.text,children:e})]})},zI=s6;var xS={};ht(xS,{enUS:()=>a6,nlNL:()=>l6});var a6={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"}],dismiss:[{type:0,value:"Dismiss"}],dismissError:[{type:0,value:"Dismiss error"}]},l6={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"}],dismiss:[{type:0,value:"Sluiten"}],dismissError:[{type:0,value:"Foutmelding sluiten"}]};var HI={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",loginError:"dd-KCXeb",loginErrorMessage:"dd-Bv-BG",loginErrorDismiss:"dd-iSCjU"};var Me=b(I()),c6=({onLogIn:e})=>{var W;let t=z("SuggestionsOverlay",HI),n=se(xS),r=G(jr),o=G(bb),i=Ee(),s=(0,Ya.useRef)(null),a=X("searchTriggerKey"),l=X("productName"),c=G(ym),u=G(Pt),f=G(ub),d=G($s),[p,m]=(0,Ya.useState)(null),g=X("showSearch"),v=X("showTextSuggestions"),h=X("adminUrl"),y=X("isEmbedded"),S=X("suggestionsPlacement"),[x,T]=NI("dd-snooze-until-ms",0),C=c||x>Date.now(),k=G(Oi),R=G(xl),F=X("showStyleSuggestions"),O=X("showStyleSuggestionList"),U=G(bm),J=F&&O?Em((W=U.keywordMatches)!=null?W:[]):[],Y=J.length>0,_=k.filter(N=>N.source!=="gpt").length,V=()=>{C&&T(0),i(gI(!C))},B=N=>{let q=Date.now()+N*1e3;T(q),te.info(`Snooze until: ${new Date(q)}`),i(Si({collapse:!0}))};return(0,Ya.useEffect)(()=>{_===0&&m(null)},[k,_]),di(()=>{i(Si({collapse:!0,skipWhenInputFocus:!0}))}),u===null||d===!1?null:u===!1?(0,Me.jsxs)("div",{ref:s,className:(0,km.default)(t.root,{[t.isCollapsed]:C}),children:[!C&&(0,Me.jsxs)("div",{className:t.triggers,children:[(0,Me.jsx)("div",{style:{flex:1}}),(0,Me.jsx)("div",{className:t.triggersRight,children:(0,Me.jsx)(Ii,{className:t.toggleButton,title:n("collapse"),onClick:V,isCollapsed:!1})})]}),(0,Me.jsx)("div",{className:t.toggleButtonWrapper,children:(0,Me.jsx)(Ii,{className:t.toggleButton,title:n("open",{productName:l}),onClick:V,isCollapsed:!0})}),(0,Me.jsxs)("div",{className:t.collapsible,children:[f&&(0,Me.jsxs)("div",{className:t.loginError,children:[(0,Me.jsx)("span",{className:t.loginErrorMessage,children:f}),(0,Me.jsx)("button",{type:"button",className:t.loginErrorDismiss,onClick:()=>i(hd()),"aria-label":n("dismissError"),children:n("dismiss")})]}),(0,Me.jsx)(Tm,{loginUrl:h,isEmbedded:y,onLogIn:e,onSnooze:B})]})]}):!o||!r&&!Y?null:(0,Me.jsxs)("div",{ref:s,className:(0,km.default)(t.root,{[t.isCollapsed]:C}),children:[!C&&(0,Me.jsxs)("div",{className:t.triggers,children:[(0,Me.jsx)("div",{style:{flex:1},children:g&&(0,Me.jsx)("div",{style:{display:"inline-block"},onFocus:()=>{},onMouseOver:()=>m(n(OI()?"searchHintMac":"searchHintWindows",{searchTriggerKey:a.toUpperCase()})),onMouseLeave:()=>m(null),children:(0,Me.jsx)(zI,{title:n("search")})})}),(0,Me.jsxs)("div",{className:t.triggersRight,onFocus:()=>{},children:[(0,Me.jsx)("div",{className:(0,km.default)(!p&&t.hintsHidden,t.hints),children:p}),(0,Me.jsx)(Ii,{className:t.toggleButton,title:n("collapse"),onClick:V,isCollapsed:!1})]})]}),(0,Me.jsx)("div",{className:t.toggleButtonWrapper,children:(0,Me.jsx)(Ii,{className:t.toggleButton,title:n("open",{productName:l}),onClick:V,isCollapsed:!0})}),(Y||_>0&&v)&&(0,Me.jsxs)("div",{className:t.collapsible,onFocus:()=>{},children:[Y&&(0,Me.jsx)(Sm,{matches:J,selectedIndex:-1}),_>0&&v&&(0,Me.jsx)(Tt,{children:(0,Me.jsx)(xm,{suggestions:k,selectedIndex:R,reverse:S==="above"})})]})]})},BI=c6;var Hm=b(De());var Ao=b(Z());var Xa=b(Z());function Rm(e){return e.contentEditable==="true"}function u6(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 UI(e){let{selectionStart:t,selectionEnd:n}=Rm(e)?u6(e):e;return[t,n]}function VI(e){let[,t]=(0,Xa.useState)(),n=(0,Xa.useRef)(null);return n.current=UI(e),(0,Xa.useEffect)(()=>{let r=()=>{var a;let[o,i]=(a=n.current)!=null?a:[],s=UI(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 WI(e,t){if(!t)return;let n=e,{value:r}=n,[o,i]=t,s=r.match($u);if(!s||s.length===0)return;let a=0;s.find(l=>{let c=r.indexOf(l,a);return o>c&&i<c+l.length?(n.selectionStart=c,n.selectionEnd=c+l.length,!0):(a=c+l.length,!1)})}var $I=b(Z()),d6=["div","span","mark","strong","b","i","u","em"];function wS(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(d6.includes(o)){let s=Array.isArray(r.props.children)?r.props.children:[r.props.children];return[...e.slice(0,e.length-1),(0,$I.cloneElement)(r,{children:wS(s,t,n+1)})]}return[...e,...t]}function Ts(e){return e.tagName.toLowerCase()==="textarea"}var jI={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 YI=b(De());var Om=b(Z());var Qa=b(Z());function KI(e,t){let n;return[(...r)=>{window.cancelAnimationFrame(n);let o=t?t(...r):r;n=window.requestAnimationFrame(()=>{e(...o)})},()=>window.cancelAnimationFrame(n)]}function Pm(e){let t=(0,Qa.useRef)(null),[n,r]=(0,Qa.useState)(!1);return(0,Qa.useEffect)(()=>{var u;let o=!1,i=Number.parseFloat((u=window.getComputedStyle(document.body).zoom)!=null?u:"1"),[s,a]=KI((f,d)=>{let p=t.current;if(!p)return;let m=f/i,g=d/i,v=p.getBoundingClientRect(),h=m>v.x&&m<v.x+v.width&&g>v.y&&g<v.y+v.height;h&&!o?(o=!0,r(!0)):!h&&o&&(o=!1,r(!1))},({clientX:f,clientY:d})=>[f,d]),[l,c]=KI(()=>{o=!1,r(!1)});return e.addEventListener("mousemove",s),e.addEventListener("mouseleave",l),()=>{a(),c(),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",l)}},[t]),[t,n]}function Im(e){return e.replace(/[.*+^${}()|[\]\\]/g,"\\$&")}function Am(e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}function GI(e){return e!=null}var qI=b(De()),_m=b(Z());var Po={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 bS=b(I()),Mm=(0,_m.forwardRef)((o,r)=>{var i=o,{className:e,children:t}=i,n=ie(i,["className","children"]);let s=(0,_m.useRef)(null),a=z("TabCompletion",Po);return(0,bS.jsx)("div",A(E({ref:Am([s,r]),className:(0,qI.default)(e,a.popoverContentContainer)},n),{children:(0,bS.jsx)("div",{className:a.popoverContent,children:t})}))});var Ei=b(I()),f6=e=>t=>{let n=a0(t);return"top"in n&&(n.width=e.width-(t.left-e.left)-10),n},p6=({inputElement:e,boundaryRef:t,inputStyle:n,children:r,suggestion:o})=>{let i=z("TabCompletion",Po),s=wp(),a=(0,Om.useMemo)(()=>f6(e.getBoundingClientRect()),[e]),[l,c]=Pm(e);return(0,Om.useEffect)(()=>{c?s.open():s.close()},[c]),(0,Ei.jsxs)("span",{children:[(0,Ei.jsx)("mark",{ref:Am([l,s.triggerRef]),className:(0,YI.default)(i.matchKeyword,{[i.hover]:c}),"aria-haspopup":"dialog","aria-expanded":s.opened?"true":"false",children:r}),s.opened&&(0,Ei.jsx)(Aa,{className:i.popover,triggerRef:s.triggerRef,boundaryRef:t,position:"below",align:"start",toStyle:a,children:(0,Ei.jsx)(Mm,{style:n,children:(0,Ei.jsx)("div",{className:i.hintText,children:o})})})]})},Nm=class extends Eo{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=>A(E({},o),{keywordRegex:new RegExp(`\\b${Im(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(GI);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,Ei.jsx)(p6,{inputElement:r.inputElement,suggestion:r.suggestion,inputStyle:r.inputStyle,boundaryRef:r.boundaryRef,children:n},`keyword_${r.matchString}_${r.key}`)}asTag(){return"mark"}};var XI=b(De());var ES=b(I()),m6=({inputElement:e,children:t})=>{let n=z("TabCompletion",Po),[r,o]=Pm(e);return(0,ES.jsx)("mark",{ref:r,className:(0,XI.default)(n.matchPlaceholder,{[n.hover]:o}),children:t})},Lm=class extends Eo{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,ES.jsx)(m6,{inputElement:n.inputElement,children:t},`placeholder_${n.matchString}_${n.key}`)}asTag(){return"mark"}};var Fm=b(De());var an=b(Z());var CS=b(I()),QI=()=>(0,CS.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,CS.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 Kr=b(Z());var JI=b(X0());var ZI={root:"dd-ky-Bv",content:"dd-kV5e1"};function Dm(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 TS(e){return e.replace("https://www.","").replace("https://","")}var Qn=b(I()),g6=3,h6=e=>({image:e.image||"",text:e.text,id:e.id,title:e.title}),y6=({onSelectLink:e,onDismiss:t,placeholder:n,visitUrlText:r,linkCount:o=g6})=>{let i=z("LinkSearch",ZI),[s,a]=(0,Kr.useState)(""),l=Ee(),c=G(ZP("url")),u=G(Kb("URL")),f=(0,Kr.useMemo)(()=>u.map(h6),[u]),[d,p]=(0,Kr.useState)(f.length-1),m=X("fallbackImage"),g=S=>{let x=S.target;a(x.value)},v=(S,x)=>{S.stopPropagation(),S.preventDefault(),window.open(x,"_blank")},h=S=>{var C;let x=d-1<0?f.length-1:d-1,T=d+1===f.length?0:d+1;S.code==="Escape"&&(a(""),t()),S.code==="ArrowUp"&&p(x),S.code==="ArrowDown"&&p(T),S.code==="Enter"&&e(((C=f[d])==null?void 0:C.text)||s)},y=(0,Kr.useCallback)((0,JI.default)(S=>{l(Fi({query:S,type:"URL",tags:["link-search"]}))},300),[]);return(0,Kr.useEffect)(()=>{s&&y(s)},[s]),(0,Kr.useEffect)(()=>()=>{l(kd())},[]),(0,Qn.jsxs)("div",{className:i.root,children:[(0,Qn.jsx)(Tt,{withDivider:!0,children:(s?f:c).slice(0,o).map((S,x)=>(0,Qn.jsx)(pe,{selected:d===x,onClick:()=>e(S.text),"data-testid":"linksearch-suggestion",children:(0,Qn.jsxs)(we,{children:[(0,Qn.jsx)(we.Image,{src:Dm(S,"small",m||void 0),title:S.title||S.text}),(0,Qn.jsxs)(we.Content,{className:i.content,cropText:!0,children:[(0,Qn.jsx)(we.Title,{children:S.title||TS(S.text)}),S.title&&TS(S.text)]}),(0,Qn.jsx)(pe.Actions,{children:(0,Qn.jsx)(pe.ActionButton,{label:r,onClick:T=>v(T,S.text)})})]})},S.text))}),(0,Qn.jsx)($c,{value:s,onChange:g,autoFocus:!0,placeholder:n,onKeyUp:h})]})},eA=y6;var kS={};ht(kS,{enUS:()=>v6,nlNL:()=>S6});var v6={insertLink:[{type:0,value:"Insert link"}],linkInputPlaceholder:[{type:0,value:"Search, type or paste link"}],visitUrl:[{type:0,value:"Visit"}],addToPersonalCollection:[{type:0,value:"Add to Personal Collection"}]},S6={insertLink:[{type:0,value:"Voeg link toe"}],linkInputPlaceholder:[{type:0,value:"Zoek, typ of plak link"}],visitUrl:[{type:0,value:"Bekijk"}],addToPersonalCollection:[{type:0,value:"Toevoegen aan Personal Collection"}]};var Ot=b(I()),x6=(0,an.forwardRef)((e,t)=>{let n=z("TabCompletion",Po);return(0,Ot.jsx)("mark",{ref:t,className:(0,Fm.default)(n.matchSelection)},"selection-start")}),w6=({startRef:e,boundaryRef:t,inputStyle:n,inputElement:r,children:o})=>{let i=se(kS),s=z("TabCompletion",Po),a=X("addToPersonalCollection"),l=G(Uo("/admin/personal-collection/new")),c=(0,an.useRef)(null),u=(0,an.useRef)(null),[f,d]=(0,an.useState)(null),p=Ee(),m=wp(document.activeElement===r),[g]=(0,an.useState)(()=>document.createRange());m.triggerRef.current=g,(0,an.useEffect)(()=>()=>g.detach(),[]),(0,an.useEffect)(()=>{let h=e.current,y=c.current;!h||!y||(g.setStart(h,0),g.setEnd(y,0))},[e.current,c.current]),di(()=>{m.close()});let v=(0,an.useCallback)(h=>{let y=g.toString(),S=/^http(s?):\/\//.test(h)?h:`https://${h}`,x=`[${y}](${S})`;p(kn({text:x,suggestion:{text:x,source:"search-url",type:"url"},eventMetrics:{inputType:"mouse"},replace:"selection"}))},[]);return(0,Ot.jsxs)("span",{children:[(0,Ot.jsx)("mark",{ref:c,className:(0,Fm.default)(s.matchSelection),"aria-haspopup":"dialog","aria-expanded":m.opened?"true":"false",children:o}),m.opened&&(0,Ot.jsx)(Aa,{className:s.popoverRoot,triggerRef:m.triggerRef,boundaryRef:t,position:"above",align:"start",children:(0,Ot.jsxs)(Mm,{style:n,ref:u,children:[(0,Ot.jsxs)("div",{className:(0,Fm.default)(s.selectionOptions,{[s.selectionOptionsIsHidden]:f!==null}),children:[(0,Ot.jsxs)("button",{type:"button",tabIndex:f===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>d("insertLink"),children:[(0,Ot.jsx)(QI,{}),(0,Ot.jsx)("span",{children:"\xA0"}),(0,Ot.jsx)("span",{children:i("insertLink")})]}),a&&l&&(0,Ot.jsx)("button",{type:"button",tabIndex:f===null?-1:void 0,className:s.selectionOptionsButton,onClick:()=>{let h=g.toString(),y=`${l}?text=${encodeURIComponent(h)}`;window.open(y,"_blank")},children:(0,Ot.jsx)("span",{children:i("addToPersonalCollection")})})]}),f==="insertLink"&&(0,Ot.jsx)(eA,{placeholder:i("linkInputPlaceholder"),visitUrlText:i("visitUrl"),onSelectLink:v,onDismiss:()=>{d(null),m.close()}})]})})]},"selection-end")},zm=class extends Eo{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,an.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?E({isStart:a},s):null}replaceWith(n,r){return r.isStart?(0,Ot.jsx)(x6,{ref:this.startRef}):(0,Ot.jsx)(w6,{inputElement:r.inputElement,startRef:this.startRef,boundaryRef:r.boundaryRef,inputStyle:r.inputStyle})}asTag(){return"mark"}};var Io=b(I()),b6=({enabled:e,content:t,tabText:n,showTabHint:r,showTabCompletion:o,showStyleSuggestions:i,keywordMatches:s,inputElement:a,source:l})=>{let c=z("TabCompletion",jI),u=X("insertLink"),f=X("addToPersonalCollection"),d=X("showMidSentenceSuggestions"),p=X("inlineSuggestions"),m=VI(a),g=(0,Ao.useRef)(null),v=G(Pt);(0,Ao.useEffect)(()=>{Ts(a)&&m&&WI(a,m)},[m]);let h=(0,Ao.useCallback)(x=>{if(!o||!n)return x;let T=[(0,Io.jsx)("span",{className:c.resetIndent,children:"\u200B"},"u200B"),(0,Io.jsx)("span",{"data-testid":"tab-completion",className:(0,Hm.default)(c.tabText,c.resetIndent),"data-source":l,children:n},"tabText")];return r&&T.push((0,Io.jsx)("span",{className:(0,Hm.default)(c.hint,c.resetIndent),children:(0,Io.jsx)(Uu,{keyCode:"tab"},"tabHint")},"tabHint")),wS(x,T)},[o,n,r]),y=(0,Ao.useMemo)(()=>{let x=[];return(u||f)&&x.push(new zm("selection")),x.push(new Lm("placeholders")),i&&x.push(new Nm("keywords")),x},[p,u,f,i]),S=(0,Ao.useMemo)(()=>{let x=window.getComputedStyle(a);return{"--dd-color":x.color,"--dd-font-size":x.fontSize,"--dd-font-family":x.fontFamily,"--dd-font-variant":x.fontVariant}},[]);return!e||!v?null:(0,Io.jsxs)("div",{ref:x=>{x!=null&&x.parentElement&&(g.current=x==null?void 0:x.parentElement)},className:c.root,style:S,children:[(0,Io.jsx)(yi,{tagName:"span",containerTagName:"div",className:(0,Hm.default)(c.container,c.agentText),disableLineBreaks:Ts(a),content:t||"\u200B",onAfterParse:h,matchers:y,selection:m,keywordMatches:s,inputElement:a,inputStyle:S,boundaryRef:g,inlineSuggestionsOnlyAtEnd:!d}),(0,Io.jsx)("br",{})]},"tab-completion")},E6=e=>{var h,y,S;let{input:t,ui:n,settings:r,styleSuggestions:o,conversation:i}=e,s=js({input:t}),a=(s==null?void 0:s.text)||"",l=(s==null?void 0:s.source)||"",c=(h=t.html)!=null?h:ja(t.text),u=t.text.slice(t.suggestionTextStart,t.selection.end),f=a.indexOf(u)===0?a.slice(u.length):"",{showTabHint:d}=n,{isSupported:p}=i,{showTabCompletion:m,visible:g,showStyleSuggestions:v}=r;return{showTabHint:d,showStyleSuggestions:v,showTabCompletion:m&&jr(e),content:c,tabText:f,source:l,keywordMatches:(S=(y=o.list)==null?void 0:y.keywordMatches)!=null?S:[],enabled:g&&p!==!1}},tA=yw(E6)(b6);var Ci=b(Z());var C6={token:null,interval:null},RS=ge("passwordlessToken/getTemporaryPasswordlessToken",(e,t)=>M(null,null,function*(){let{deepdeskAPI:n}=t.extra;return{token:yield n.requestPasswordlessToken()}})),PS=ge("passwordlessToken/pollPasswordlessToken",(e={},t)=>{let{interval:n=1e3*60*10}=e,{dispatch:r}=t;return r(RS()),setInterval(()=>r(RS()),n)}),nA=Re({name:"passwordlessToken",initialState:C6,reducers:{stopPollPasswordlessToken(e){e.interval&&clearInterval(e.interval),e.interval=null}},extraReducers:e=>{e.addCase(RS.fulfilled,(t,n)=>{t.token=n.payload.token}),e.addCase(PS.fulfilled,(t,n)=>{t.interval=n.payload})}}),{stopPollPasswordlessToken:rA}=nA.actions,oA=nA.reducer;function T6(e){return"buttonText"in e&&"eventName"in e}function iA(e){if(e)return T6(e)?{label:e.buttonText,event:e.eventName,value:e.payload}:e}function k6(e){return e==null?void 0:e.map(t=>iA(t))}function R6(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}var sA=fn([bE,yd],(e,t)=>(t?e.filter(o=>!o.externalConversationId||o.externalConversationId===t):e).map(o=>{let i=iA(o.callToAction),s=k6(o.callToActions);return A(E(E(E({text:o.response,title:o.name},i?{callToAction:i}:{}),s!=null&&s.length?{callToActions:s}:{}),o.message!==void 0?{message:o.message}:{}),{editable:o.editable,isLoading:o.isLoading,evaluationId:o.evaluationId,rule:{id:R6(o.code),label:o.code,name:o.name,description:o.name}})}));var Bm=b(Z()),AS=b(De());var IS=b(I()),Za=()=>(0,IS.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",children:(0,IS.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 aA={root:"dd-WcEru",entity:"dd-LfP8y",entityText:"dd-L-v0f",iconWrapper:"dd-9Deh1",icon:"dd-tM7E2",iconClicked:"dd-EEdDL"};var Gr=b(I()),P6=({entities:e})=>{let t=z("EntitiesWidgetList",aA),[n,r]=(0,Bm.useState)(void 0),o=Ze(),i=()=>{r(void 0)},s=a=>{e&&(r(e.indexOf(a)),Ar(a.text),o("entity copied",{entity:a,type:"copy"}))};return(0,Bm.useEffect)(()=>{let a=setTimeout(i,500);return()=>{clearTimeout(a)}},[n]),!e||e.length===0?null:(0,Gr.jsx)("div",{className:t.root,"data-testid":"widget-entities-list",children:e.map((a,l)=>(0,Gr.jsxs)("button",{title:a.text,className:t.entity,type:"button",onClick:()=>s(a),children:[(0,Gr.jsx)("span",{className:t.entityText,children:a.text}),(0,Gr.jsxs)("span",{className:t.iconWrapper,children:[(0,Gr.jsx)("span",{className:(0,AS.default)(t.icon),children:(0,Gr.jsx)(Za,{})}),(0,Gr.jsx)("span",{className:(0,AS.default)(t.icon,n===l&&t.iconClicked),children:(0,Gr.jsx)(Za,{})})]})]},a.text))})},lA=P6;var _S=b(I()),cA=()=>(0,_S.jsx)("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,_S.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 hA=b(Z());var uA={root:"dd-ohnXe",trigger:"dd-7i-S3",button:"dd-t53Cg",nav:"dd-qZFnm",item:"dd-FZC0F"};var dA={root:"dd-nazq3",rotation:"dd-3EHTv"};var pA=b(I()),I6=({size:e=12})=>{let t=z("LoadingSpinner",dA);return(0,pA.jsx)("span",{"data-testid":"loading-spinner",style:{width:`${e}px`,height:`${e}px`},className:t.root})},fA=I6;var MS=b(I()),mA=()=>(0,MS.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",height:"1em",viewBox:"0 0 512 512",fill:"currentColor",children:(0,MS.jsx)("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224c0-17.7-14.3-32-32-32s-32 14.3-32 32s14.3 32 32 32s32-14.3 32-32z"})});var pu=b(I()),gA=e=>(0,pu.jsxs)("svg",A(E({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 448 512","aria-labelledby":"checkTitle"},e),{children:[(0,pu.jsx)("title",{id:"checkTitle",children:"Check"}),(0,pu.jsx)("path",{fill:"#666",d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})]}));var NS={};ht(NS,{enUS:()=>A6,nlNL:()=>_6});var A6={error:[{type:0,value:"Something went wrong"}]},_6={error:[{type:0,value:"Er ging iets fout"}]};var Hn=b(I()),M6=3e3,N6=({assistantOptions:e})=>{let t=z("OnDemandAssistants",uA),n=se(NS),r=(0,hA.useRef)(),o=Ad(mn),i=G(vP),s=Ze(),a=i.filter(u=>u.isPinned),l=i.filter(u=>!u.isPinned),c=u=>M(null,null,function*(){clearTimeout(r.current),s("trigger on demand assistant",{assistantCode:u}),yield o.call(A(E({},e),{assistantCode:u})),r.current=setTimeout(()=>o.reset(),M6)});return i.length===0?null:(0,Hn.jsxs)("div",{className:t.root,children:[a.map(({assistant:u,assistantName:f,displayName:d})=>(0,Hn.jsx)("button",{type:"button",className:t.button,disabled:o.state==="loading",onClick:()=>c(u),children:d||f},u)),l.length>0&&(0,Hn.jsxs)(wt,{placement:"top-end",children:[(0,Hn.jsx)(wt.Trigger,{className:t.trigger,disabled:o.state==="loading",children:(0,Hn.jsx)(dm,{"data-testid":"trigger"})}),(0,Hn.jsx)(wt.Content,{className:t.nav,"data-testid":"popover",children:l.map(({assistant:u,assistantName:f,displayName:d})=>(0,Hn.jsx)(wt.Button,{className:t.item,disabled:o.state==="loading",onClick:()=>c(u),children:d||f},u))})]}),o.state==="loading"&&(0,Hn.jsx)(fA,{}),o.state==="done"&&(0,Hn.jsx)(gA,{"data-testid":"trigger-done"}),o.state==="error"&&(0,Hn.jsx)(ZR,{trigger:(0,Hn.jsx)(mA,{}),children:n("error")})]})},yA=N6;var mu={};ht(mu,{enUS:()=>O6,nlNL:()=>L6});var O6={useCue:[{type:0,value:"Add to message"}],__summarizerAssistant__:[{type:0,value:"Summary"}],copyCue:[{type:0,value:"Copy"}],removeCue:[{type:0,value:"Close"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]},L6={useCue:[{type:0,value:"Voeg toe aan bericht"}],__summarizerAssistant__:[{type:0,value:"Samenvatting"}],copyCue:[{type:0,value:"Kopi\xEBren"}],removeCue:[{type:0,value:"Sluiten"}],thumbsUp:[{type:0,value:"Thumbs up"}],thumbsDown:[{type:0,value:"Thumbs down"}]};var ks=b(Z());var OS={title:"dd-YBHrC",fadeup:"dd-cRM0K",fadedown:"dd-7D4Pq",selected:"dd-bueui",actions:"dd-9Iqn9",ctaMessage:"dd-ge8nB",thumbsUp:"dd-6QwVx",thumbsDown:"dd-d3E8l",form:"dd-sPNU2",formInput:"dd-F3E4I",formSubmit:"dd-vw5S0",actionButton:"dd-cCWyJ",editableCue:"dd-nWSD-",inputSpace:"dd-DGYB1"};var Lt=b(I()),D6=500,F6=100,z6=({content:e,onChange:t,onCopy:n})=>{let r=(0,ks.useRef)(null),o=z("WidgetCue",OS);return(0,ks.useEffect)(()=>{let i=r.current;if(!i)return;i.style.setProperty("height","0px");let s=Math.min(Math.max(i.scrollHeight,F6),D6);i.style.setProperty("height",`${s}px`)},[e]),(0,Lt.jsx)("textarea",{ref:r,className:o.editableCue,onCopy:n,onChange:t,value:e})},H6=({cue:e,onCallToAction:t,onRemove:n,onCopy:r,onUse:o})=>{var g;let i=z("WidgetCue",OS),s=se(mu),a=Ze(),l=X("hasKeyboardInput"),[c,u]=(0,ks.useState)(e.text),f=v=>{let h=v?A(E({},e),{callToAction:v}):e;t&&t(c,h),n(e)},d=(v,h)=>{r&&r(v,e),h&&Bo(h,i.fadeup)},p=v=>{o&&o(v,e)},m=v=>{v.preventDefault(),v.stopPropagation(),n(e)};return(0,ks.useEffect)(()=>{a("Assistant response displayed",{evaluationId:e.evaluationId,assistantCode:e.rule.label,assistantOutput:e.text})},[]),(0,Lt.jsxs)(pe,{"data-testid":"cue",children:[(0,Lt.jsx)(we,{children:(0,Lt.jsxs)(we.Content,{children:[e.title&&(0,Lt.jsx)(we.Title,{className:i.title,"data-testid":"widget-cue-title",children:e.rule.label.startsWith("__")?s(e.rule.label):e.title}),e.message&&(0,Lt.jsx)("p",{className:i.ctaMessage,children:e.message}),e.editable?(0,Lt.jsx)(z6,{content:c,onCopy:()=>{let v=document.getSelection();v&&d(v.toString())},onChange:v=>{var h;return u((h=v.target.value)!=null?h:"")}}):(0,Lt.jsx)(is,{content:e.text,useLabel:s("useCue"),copyLabel:s("copyCue"),onCopy:d,onUse:l?p:void 0})]})}),(0,Lt.jsxs)(pe.ButtonsContainer,{children:[(0,Lt.jsxs)("div",{className:i.actions,children:[(0,Lt.jsx)(pe.Button,{onClick:v=>{var h;return d((h=Kd(c,"reply")[0])!=null?h:c,v.target)},variant:"primary",children:s("copyCue")}),e.callToAction&&(0,Lt.jsx)(pe.Button,{onClick:()=>f(),variant:"primary",children:e.callToAction.label}),(g=e.callToActions)==null?void 0:g.map((v,h)=>(0,Lt.jsx)(pe.Button,{onClick:()=>f(v),variant:"primary",children:v.label},`${v.event}-${v.label}-${h}`)),(0,Lt.jsx)(pe.Button,{onClick:m,variant:"secondary",children:s("removeCue")})]}),(0,Lt.jsx)(Qd,{evaluationId:e.evaluationId,assistantCode:e.rule.label,assistantOutput:e.text,feedbackText:e.text,feedbackType:"assistant"})]})]})},vA=H6;var Ja=b(I()),B6=({cues:e})=>{let t=Ee(),n=pn(),r=se(mu),o=Ze(),i=c=>{t(qd({code:c.rule.label})),o("Assistant response closed",{evaluationId:c.evaluationId,assistantCode:c.rule.label,assistantOutput:c.text})},s=(c,u)=>{Ar(c),o("Assistant response copied",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,copiedText:c})},a=(c,u)=>{var f;u.callToAction&&(t(Gd(u)),o("Assistant call to action",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,eventName:u.callToAction.event,value:(f=u.callToAction.value)!=null?f:c}))},l=(c,u)=>{var f;n.send(eo,{text:c,suggestion:{source:"assistant",assistantCode:(f=u.rule)==null?void 0:f.label,sourceText:c}}),o("Assistant response used",{evaluationId:u.evaluationId,assistantCode:u.rule.label,assistantOutput:u.text,usedText:c})};return(0,Ja.jsx)(Ja.Fragment,{children:e.map(c=>c.isLoading?(0,Ja.jsx)(Ep,{title:c.rule.label.startsWith("__")?r(c.rule.label):c.title},c.rule.id):(0,Ja.jsx)(vA,{cue:c,onCallToAction:a,onRemove:i,onCopy:s,onUse:l},c.evaluationId))})},SA=B6;var Um=b(Z());var xA={root:"dd-cvTAY",label:"dd-QWQxD",value:"dd-WSUHF",copyButton:"dd-67o9H",copyButtonText:"dd-oos-l",isTrue:"dd--1g2O",isFalse:"dd-sz2ir"};var En=b(I());function U6(e,t){return t.split(".").reduce((n,r)=>!n||typeof n!="object"||!(r in n)?null:n[r],e)}var wA=({data:e,schema:t})=>{let n=z("WidgetCustomData",xA),r=o=>{Ar(o)};return(0,Um.useEffect)(()=>{te.info("Custom data",e,t)},[e]),(0,En.jsx)("dl",{className:n.root,children:t.map(o=>{let i=U6(e,o.path);return(0,En.jsxs)(Um.Fragment,{children:[(0,En.jsx)("dt",{className:n.label,children:o.label}),(0,En.jsx)("dd",{className:n.value,children:o.type==="boolean"&&i?(0,En.jsx)("span",{className:n.isTrue,children:o.trueValue}):o.type==="boolean"&&!i?(0,En.jsx)("span",{className:n.isFalse,children:o.falseValue}):o.type==="array"&&Array.isArray(i)&&i.length>0?(0,En.jsxs)("button",{type:"button",onClick:()=>r(i.join(", ")),className:n.copyButton,children:[(0,En.jsx)("span",{className:n.copyButtonText,children:i.join(", ")}),(0,En.jsx)(Za,{})]}):typeof i=="string"||typeof i=="number"?(0,En.jsxs)("button",{type:"button",onClick:()=>r(`${i}`),className:n.copyButton,children:[(0,En.jsx)("span",{className:n.copyButtonText,children:i}),(0,En.jsx)(Za,{})]}):"-"})]},o.label)})})};var EA=b(Z());var V6=/(https?:\/\/[^\s]+)/,bA=e=>e.split(" ").find(t=>V6.test(t));var Zn=b(I()),W6=({suggestion:e,lines:t,onUse:n})=>{var f;let r=e.text||e.url||e.message,o=bA(r),i=se(ou),s=X("showImages"),a=X("fallbackImage"),l=X("hasKeyboardInput"),c=d=>{d.preventDefault(),d.stopPropagation(),l&&n(r)},u=(0,EA.useCallback)(d=>{window.open(o,"_blank"),d.stopPropagation(),d.preventDefault()},[o]);return(0,Zn.jsxs)(pe,{onClick:l?c:void 0,"data-testid":"edit-suggestion",children:[(0,Zn.jsxs)(we,{children:[s&&e.image&&(0,Zn.jsx)(we.Image,{src:Dm(e,"small",a||void 0),title:e.title}),(0,Zn.jsxs)(we.Content,{children:[e.title&&(0,Zn.jsx)(we.Title,{"data-testid":"widget-suggestion-title",children:e.title}),e.searchKeywords&&((f=e.searchKeywords)==null?void 0:f.length)>0&&(0,Zn.jsx)(pe.Labels,{labels:e.searchKeywords}),(0,Zn.jsx)(we.Content,{cropText:t==="single",lineClamp:t==="multiple",children:r})]})]}),(0,Zn.jsxs)(pe.Actions,{children:[o&&(0,Zn.jsx)(pe.ActionButton,{onClick:u,label:i("visitUrl")}),l&&(0,Zn.jsx)(pe.ActionButton,{primary:!0,onClick:c,label:i("useSuggestion")})]})]})},CA=W6;var gu=b(I()),$6=({lines:e,suggestions:t})=>{let n=pn(),r=(o,i)=>{n.send(eo,{text:o,suggestion:A(E({},i),{source:i.source,sourceText:i.text})})};return(0,gu.jsx)(gu.Fragment,{children:t.map(o=>(0,gu.jsx)(CA,{suggestion:o,lines:e,onUse:i=>r(i,o)},o.text||o.url||o.message))})},TA=$6;var hu={};ht(hu,{enUS:()=>j6,nlNL:()=>K6});var j6={waiting:[{type:0,value:"Loading\u2026"}],waitingForConversation:[{type:0,value:"Waiting for conversation\u2026"}],notSupported:[{type:0,value:"This conversation is not supported"}],noResults:[{type:0,value:"No results found\u2026"}],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"}],close:[{type:0,value:"Close"}]},K6={waiting:[{type:0,value:"Laden\u2026"}],waitingForConversation:[{type:0,value:"Wachten op gesprek\u2026"}],notSupported:[{type:0,value:"Dit gesprek wordt niet ondersteund"}],noResults:[{type:0,value:"Geen resultaten gevonden\u2026"}],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"}],close:[{type:0,value:"Sluiten"}]};var el={root:"dd-W9VCG",loginText:"dd--dS6t",stateText:"dd-348OC",footer:"dd-tvofr",shortcutList:"dd-MuKK-",shortcut:"dd-5CnK9",footerShortcut:"dd-dH7XJ",link:"dd-DRo0x"};var ce=b(I()),kA=(e,t)=>{let n=G(Pt);(0,Ci.useEffect)(()=>n?t.every(r=>!!r)?e():()=>{}:()=>{},[...t,n])},G6=({onLogIn:e})=>{let t=z("Widget",el),n=X("isEmbedded"),r=X("adminUrl");return(0,ce.jsx)("div",{className:t.loginText,children:(0,ce.jsx)("div",{children:(0,ce.jsx)(Tm,{isEmbedded:n,loginUrl:r,onLogIn:e})})},"login")},LS=({text:e})=>{let t=z("Widget",el);return(0,ce.jsx)("div",{className:t.stateText,children:(0,ce.jsx)("div",{children:(0,ce.jsx)("p",{children:e})})},"notification")},q6=()=>{let e=se(hu),t=Ee(),n=z("Widget",el),r=X("showSearch"),o=X("isEmbedded"),i=G(Uo("/admin/")),s=pn(),a=X("productName"),l=Ze();return kA(()=>{if(o)return t(PS()),()=>{t(rA())}},[t,o]),!r&&!i?null:(0,ce.jsxs)("div",{className:n.shortcutList,children:[r&&(0,ce.jsx)(pe.Button,{"data-testid":"shortcut-search","aria-label":e("linkSearch"),className:n.shortcut,icon:(0,ce.jsx)(Ga,{}),onClick:()=>{s.send("ShowCommandPalette",{isOpen:!0}),l("open search",{via:"widget-shortcut"})},children:e("linkSearch")}),i&&(0,ce.jsx)(pe.Button,{as:"a",target:"_blank",icon:(0,ce.jsx)(cA,{}),href:i,"data-testid":"shortcut-studio-login","aria-label":e("linkStudioLogin",{productName:a}),className:n.shortcut,rel:"noreferrer",onClick:()=>{l("open my deepdesk",{via:"widget-shortcut"})},children:e("linkStudioLogin",{productName:a})})]})},Y6=({title:e,content:t})=>{let n=se(hu),[r,o]=(0,Ci.useState)(!0);return r?(0,ce.jsx)(Tr,{"data-testid":"custom-data-banner",type:"custom-data-banner",title:e,children:(0,ce.jsx)(Tt,{withDivider:!0,children:(0,ce.jsxs)(pe,{children:[(0,ce.jsx)(we,{children:(0,ce.jsx)(we.Content,{children:(0,ce.jsx)(is,{content:t})})}),(0,ce.jsx)(pe.ButtonsContainer,{children:(0,ce.jsx)(pe.Button,{onClick:()=>o(!1),children:n("close")})})]})})}):null},X6=()=>{let e=Ee(),t=G(Gc),n=G(xP),r=G(sA),o=G(Lb),i=G(um),s=G(mm),a=G(mi),l=G(Pr);return(0,Ci.useEffect)(()=>{o&&!n&&te.warn("Custom data provided, but no schema.")},[o,n]),kA(()=>{t.forEach(({type:c})=>{c==="entities"?e(vr()):ju.includes(c)||e(Sr(c))})},[e,l,a]),(0,Ci.useEffect)(()=>{r.length>0&&!t.some(c=>c.type==="cues")&&te.warn("Received cues, but cues are not configured in widget.")},[t,r]),(0,ce.jsx)(Ci.Fragment,{children:t.map(({type:c,title:u,amount:f,lines:d,schema:p,property:m})=>{var g,v;switch(c){case"entities":return i&&i.length>0&&(0,ce.jsx)(Tr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,ce.jsx)(lA,{entities:i})},c);case"cues":return r&&r.length>0&&(0,ce.jsx)(Tr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,ce.jsx)(Tt,{withDivider:!0,children:(0,ce.jsx)(SA,{cues:r})})},c);case"custom-data-banner":return o&&m&&o[m]&&(0,ce.jsx)(Y6,{title:u,content:String(o[m])},c);case"custom-data":return o&&p&&(0,ce.jsx)(Tr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,ce.jsx)(Tt,{withDivider:!0,children:(0,ce.jsx)(wA,{data:o,schema:p})})},c);default:return((v=(g=s[c])==null?void 0:g.suggestions)==null?void 0:v.length)>0&&(0,ce.jsx)(Tr,{type:c,title:u,"data-testid":`type-${c}`,children:(0,ce.jsx)(Tt,{withDivider:!0,children:(0,ce.jsx)(TA,{lines:d,contentType:c,suggestions:s[c].suggestions.slice(0,f)||[]})})},c)}})})},DS=({children:e})=>{let t=z("Widget",el);return(0,ce.jsx)("div",{className:t.footer,children:e})},FS=({children:e})=>{let t=z("Widget",el);return(0,ce.jsx)("div",{className:t.root,"data-testid":"widget",children:e})},Q6=({onLogIn:e,knowledgeAssistOptions:t={},assistantOptions:n={transcript:"in-memory-transcript"}})=>{let r=se(hu),o=G($s),i=G(Pt),s=G(yd),a=G(mi),l=G(SP("knowledge-assist")),c=G(wP);return o===!1?(0,ce.jsx)(LS,{text:r("notSupported")}):i===!1?(0,ce.jsx)(G6,{onLogIn:e}):i===null?(0,ce.jsx)(LS,{text:r("waiting")}):!s||!a?(0,ce.jsx)(LS,{text:r("waitingForConversation")}):(0,ce.jsx)(FS,{children:(0,ce.jsxs)(Yp,{initialQuestion:t.initialQuestion,assistantCode:c!=null?c:void 0,evaluateKnowledgeAssistFn:Hl,children:[(0,ce.jsxs)(Hs,{children:[(0,ce.jsx)(q6,{}),(0,ce.jsx)(X6,{}),l&&(0,ce.jsx)(Qp,{title:l.title,emptyState:t.emptyState})]}),(0,ce.jsxs)(DS,{children:[l&&(0,ce.jsx)(Xp,{}),(0,ce.jsx)(yA,{assistantOptions:n})]})]})})},RA=Q6;function tl(e){let t=new Range;return t.selectNodeContents(e),t}function PA(e,t,n){try{return Ti(e,t,n),!0}catch(r){return!1}}function Vm(e){return"tagName"in e&&(e.tagName==="DIV"||e.tagName==="P")}function Wm(e){return"tagName"in e&&e.tagName==="BR"}var yu=/[\u200B-\u200D\uFEFF]/g;function Ti(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,c){let u=-1,f=/[\u200B-\u200D\uFEFF]/;if(!f.test(l))return c;for(let d=0;d<=l.length;d++)if(f.test(l[d])||u++,u===c)return d;throw new Error("Offset out of range")}function a(l){switch(l.nodeType){case Node.TEXT_NODE:{let c=l.textContent,u=c.replace(yu,""),f=o+u.length,d=t>=o&&t<=f,p=n>=o&&n<=f;if(d){let m=s(c,t-o);m===0&&!p?r.setStartBefore(l):r.setStart(l,m)}p&&(r.setEnd(l,s(c,n-o)),i=!0),o=f;break}case Node.ELEMENT_NODE:{if(Wm(l)&&(o===t&&r.setStartBefore(l),o++,o===n)){r.setEndAfter(l),i=!0;return}for(let u=0;u<l.childNodes.length&&(a(l.childNodes[u]),!i);u++);let c=l.lastChild;Vm(l)&&c&&!Vm(c)&&!Wm(c)&&o++;break}default:break}}if(a(e),r.startContainer===document)throw new Error("Offsets out of bound");return r}function vu(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,c=0;function u(f){let d=f===e,p=f===n,m=f===o;switch(f.nodeType){case Node.TEXT_NODE:{let g=f.textContent;p&&(a=c+g.substring(0,r).replace(yu,"").length),m&&(l=c+g.substring(0,i).replace(yu,"").length),c+=g.replace(yu,"").length;break}case Node.ELEMENT_NODE:{if(Wm(f)&&f.nextSibling){c++;break}!d&&Vm(f)&&f.previousSibling&&c++;for(let g=0;g<f.childNodes.length;g++){let v=p&&g===r,h=m&&g===i;if(v&&(a=c),h&&(l=c),l!==void 0||((!v||!s)&&u(f.childNodes[g]),m&&g===i-1&&(l=c),l!==void 0))break}m&&(l=c);break}default:break}}if(u(e),l===void 0)throw new Error("Could not determine start and end");return{start:a!=null?a:l,end:l}}function Su(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 c(u){let f=u===e,d=u===n,p=u===o;switch(d&&(a=1),u.nodeType){case Node.TEXT_NODE:{if(a!==1)return;let m=d?r:0,g=p?i:void 0;l+=u.textContent.replace(yu,"").substring(m,g);break}case Node.ELEMENT_NODE:{if(!s&&a===1&&Wm(u)&&u.nextSibling){l+=`
82
+ `;break}!f&&!s&&a===1&&Vm(u)&&u.previousSibling&&(l+=`
83
+ `);let m=d?r:0,g=p?Math.min(i,u.childNodes.length):u.childNodes.length;for(let v=m;v<g&&(c(u.childNodes[v]),a!==2);v++);break}default:break}p&&(a=2)}return c(e),l}var IA=(s=>(s.CUT="Cut",s.BACKSPACE="Backspace",s.DELETE="Delete",s.ERASEEOF="EraseEof",s.UNDO="Undo",s.CLEAR="Clear",s))(IA||{}),_o=class{constructor(t){this.element=t;this.isFocused=!1;this.isActive=!0;this.isDisposed=!1;this.eventListeners={};this.disposeHandlers=[];this.cachedText="";this.cachedSuggestionTextStart=0;this.cachedCaretPosition=null;this.cachedSelection={start:0,end:0};this.cachedHTML="";this.isSubmitting=!1;this.isPossibleClearInputAction=!1;this.cachedText=this.getText(),this.cachedSuggestionTextStart=this.getSuggestionTextStart(),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.getSuggestionTextStart(),i=this.cachedCaretPosition===null;if(!this.isActive)return;t===""&&this.cachedText!==""&&!this.isPossibleClearInputAction&&this.emit("submit");let s=t!==this.cachedText,a=n!==null&&n!==this.cachedHTML,l=o!==this.cachedSuggestionTextStart;if((s||a||l)&&(s?(this.cachedText=t,this.cachedHTML=n):a&&(this.cachedHTML=n),this.cachedSuggestionTextStart=o,i=!0,this.emit("change",{plainText:t,rawHTML:n,suggestionTextStart:o})),(r.start!==this.cachedSelection.start||r.end!==this.cachedSelection.end)&&(this.cachedSelection=r,i=!0,this.emit("selection",r)),!i)return;let c=this.getCaretPosition();zo(c,this.cachedCaretPosition)||(this.cachedCaretPosition=c,this.emit("caretposition",c))}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(IA).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()})}getSuggestionTextStart(){return 0}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))}off(t,n){if(!this.eventListeners[t])return;let r=this.eventListeners[t].indexOf(n);r!==-1&&this.eventListeners[t].splice(r,1)}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 AA(e){return e.top!==0||e.left!==0||e.height!==0||e.width!==0}var Rs=class extends _o{constructor(){super(...arguments);this.lastKnownSelection=null}getRootNode(){return this.element.getRootNode()}getText(){let n=new Range;return n.selectNodeContents(this.element),Su(this.element,n)}getHTML(){return this.element.innerHTML||""}getRange(){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=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!AA(r)&&(n.insertNode(this.element.ownerDocument.createTextNode("\u2060")),r=n.getBoundingClientRect(),n.deleteContents(),!AA(r))?null:{top:r.top+r.height,left:r.left}}getSelection(){let n=this.getRange();if(n)return vu(this.element,n);let r=this.lastKnownSelection;if(r&&PA(this.element,r.start,r.end))return r;let o=tl(this.element);return o.collapse(!1),vu(this.element,o)}getSelectedText(){let{start:n,end:r}=this.getSelection();return Su(this.element,Ti(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 Z6=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize"];function _A(e,t){let n="mozInnerScreenX"in window,r=document.createElement("div");r.id="input-textarea-caret-position-mirror-div";let o=r.style,i=window.getComputedStyle(e),s=e.ownerDocument.body;o.whiteSpace="pre-wrap",o.wordWrap="break-word",o.position="absolute",o.visibility="hidden",Z6.forEach(u=>{o[u]=i[u]}),n?e.scrollHeight>Number.parseInt(i.height)&&(o.overflowY="scroll"):o.overflow="hidden",r.textContent=e.value.substring(0,t);let a=document.createElement("span");a.textContent=e.value.substring(t)||".",r.appendChild(a),s.appendChild(r);let l=e.getBoundingClientRect(),c={top:l.top-e.scrollTop+a.offsetTop+Number.parseInt(i.borderTopWidth)+a.offsetHeight,left:l.left-e.scrollLeft+a.offsetLeft+Number.parseInt(i.borderLeftWidth)};return s.removeChild(r),c}var Ps=class extends _o{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 _A(this.element,this.element.selectionEnd)}listen(){super.listen();let n=Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype,"value");Object.defineProperty(this.element,"value",{configurable:!0,get:()=>{var 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()}}),this.addEventListener("scroll",()=>{this.emit("caretposition",this.getCaretPosition())});let r=this.element.disabled,o=new MutationObserver(()=>{this.element.disabled!==r&&(r=this.element.disabled,this.emit(r?"disabled":"enabled"))});o.observe(this.element,{attributes:!0,attributeFilter:["disabled"]}),this.disposeHandlers.push(()=>o.disconnect())}};function MA(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 J6(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch(t){return e}}var zS=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()}},HS=class{constructor(t,n,r){this.name=t;this.targetOrigin=n;this.options=r;this.disposeHandlers=[];this.iframe=MA(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()}},BS=class{constructor(t){this.params=t;this.deepdeskUrl=t.deepdeskUrl,this.eventMap=t.eventMap,this.externalId="deepdesk-general",this.defaultChannel=this.createChannel("deepdesk-general")}get isCrossOrigin(){return this.params.deepdeskUrl!==(this.params.origin||window.location.origin)}setExternalId(t){this.externalId!==t&&(this.cleanup(),te.info("Set externalId",t),this.externalId=t,this.channel=this.createChannel(t))}createChannel(t){let n=this.params.createCustomChannel?this.params.createCustomChannel(t):this.isCrossOrigin?new HS(t,this.deepdeskUrl,{debug:!0}):new zS(t),r=o=>{var s,a;if(o.origin!==this.deepdeskUrl)return;let i=J6(o.data);typeof i!="object"||i.type!=="event"||i.channel!==t||(te.info("Received broadcast event",this.externalId,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;te.info("Broadcast event",{externalId:this.externalId,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.externalId==="deepdesk-general"?this.defaultChannel:this.channel;i==null||i.postMessage(A(E({},o),{channel:this.externalId}))}cleanup(t=!1){var n,r;(n=this.channel)==null||n.close(),this.channel=void 0,t&&((r=this.defaultChannel)==null||r.close(),this.defaultChannel=void 0)}},NA=BS;function ez(e){return e.replace(/(_\w)/g,t=>t[1].toUpperCase())}function Ve(e){return Array.isArray(e)?e.map(Ve):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>A(E({},t),{[ez(n)]:Ve(e[n])}),{}):e}function tz(e){return e.replace(/[A-Z]/g,t=>`_${t.toLowerCase()}`)}function ln(e){return Array.isArray(e)?e.map(ln):typeof e=="object"&&e!==null?Object.keys(e).reduce((t,n)=>A(E({},t),{[tz(n)]:ln(e[n])}),{}):e}var nl=class extends Error{constructor(n,r){super(n);this.body=r;this.name="CustomError"}};var US=e=>new Promise(t=>{setTimeout(t,e)});var Is=class extends nl{constructor(){super(...arguments);this.name="ClientError"}},WS=class extends nl{constructor(){super(...arguments);this.name="ServerError"}},VS=new Map;function nz(e){return M(this,null,function*(){if(e.status===204)return e.text().catch(()=>{}),null;let t=e.headers.get("content-type");if(t!=null&&t.includes("application/json"))return e.json();let n=yield e.text();return n===""?null:(te.warn("Unexpected response body:",n.slice(0,20)),JSON.parse(n))})}var As=class{constructor(t="",n={}){this.baseUrl=t;this.options=n;this.latestRequestByUrl={};this.refreshingToken=null;this.lastFailedRefreshAt=null;this.failedRefreshCooldown=1e4;var r;this.fetch=(r=n.fetch)!=null?r:window.fetch.bind(window)}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:c=!1,abortLatest:u=!1,attempts:f=1,retryDelay:d=500,refreshTokenOn401:p=!0,retryOnError:m=k=>k instanceof TypeError,retryOnResponse:g=k=>k.status>=500,version:v=null}=C,h=ie(C,["useCache","abortLatest","attempts","retryDelay","refreshTokenOn401","retryOnError","retryOnResponse","version"]);if(c){if(!l)throw new Error(`Can't use 'useCache' for ${n.method}`);if(VS.has(s)){r(VS.get(s));return}}let y=A(E({credentials:"include"},h),{headers:E({Accept:"application/json","Content-Type":"application/json"},h.headers)});!l&&this.csrfToken&&(y.headers=A(E({},y.headers),{"X-CSRFToken":this.csrfToken})),typeof v=="string"&&(y.headers=A(E({},y.headers),{"X-Deepdesk-API-Version":v}));let S=f,x=!1;if(!a)throw new Error("fetch is not set");this.latestRequestByUrl[s]&&u&&(this.latestRequestByUrl[s].isAborted=!0,this.latestRequestByUrl[s].reject(new Error("Aborted"))),this.latestRequestByUrl[s]=i;let T=()=>M(this,null,function*(){return S--,a(s,y).then(k=>M(this,null,function*(){return g(k)&&!i.isAborted&&S>0?(yield US(d),T()):k.status===401&&p===!0&&x===!1?(x=!0,yield this.refreshToken(),T()):k})).catch(k=>M(this,null,function*(){if(m(k)&&!i.isAborted&&S>0)return yield US(d),T();throw k}))});T().then(k=>M(this,null,function*(){let R=yield nz(k);if(delete this.latestRequestByUrl[s],k.status>=500){o(new WS("Server Error",R));return}if(k.status===401){o(new Is("Unauthorized",R));return}if(k.status===403){o(new Is("Forbidden",R));return}if(k.status===404){o(new Is("Not Found",R));return}if(k.status>=400){o(new Is("Bad Request",R));return}c&&VS.set(s,R),r(R)})).catch(k=>{o(k)})})}validateToken(){return M(this,null,function*(){let t,n,r;try{({has_valid_access_token:t,is_logged_in:n,has_valid_refresh_token:r}=yield this.get("/apis/admin/session/validate/",{refreshTokenOn401:!1}))}catch(o){return!1}if(!t){if(!r)return!1;try{yield this.refreshToken();let{is_logged_in:o}=yield this.get("/apis/admin/session/validate/",{refreshTokenOn401:!1});return o}catch(o){return!1}}return n})}refreshToken(){let t=Date.now();return this.lastFailedRefreshAt&&t-this.lastFailedRefreshAt<this.failedRefreshCooldown?Promise.reject(new Is("Unauthorized","Failed to refresh token")):this.refreshingToken?this.refreshingToken:(this.refreshingToken=this.get("/apis/admin/session/refresh/",{refreshTokenOn401:!1}).catch(n=>{throw(n==null?void 0:n.message)==="Unauthorized"&&(this.lastFailedRefreshAt=Date.now()),n}).finally(()=>{this.refreshingToken=null}),this.refreshingToken)}get(t,n){return this.request(t,n)}post(t,n,r){return this.request(t,E({method:"POST",body:JSON.stringify(n)},r))}patch(t,n,r){return this.request(t,E({method:"PATCH",body:JSON.stringify(n)},r))}put(t,n,r){return this.request(t,E({method:"PUT",body:JSON.stringify(n)},r))}delete(t,n){return this.request(t,E({method:"DELETE"},n))}};var OA;(t=>{let e;(a=>(a.SUCCESS="success",a.FAILURE="failure",a.CONDITIONS_NOT_MET="conditions_not_met",a.MAX_RECURSION_LEVEL="max_recursion_level",a.NO_ACCESS_TO_ASSISTANT="no_access_to_assistant"))(e=t.EvaluationStatus||(t.EvaluationStatus={}))})(OA||(OA={}));function $S(e){return A(E({},Ve(e)),{metadata:e.metadata})}var _s=class _s{constructor(t,n={}){this.options=n;this.latestReceivedDeepdeskVersions={};this.shouldFetchCsrfToken=!0;this.client=new As(t,{fetch:n.fetch}),this.client.patchFetch(r=>(o,i)=>M(this,null,function*(){let s=yield r(o,i);return this.handleDeepdeskVersionHeaders(s),s}))}preflight(){return M(this,null,function*(){if(this.shouldFetchCsrfToken){this.shouldFetchCsrfToken=!1;let t=yield this.getCsrfToken();this.client.setCsrfToken(t)}return this.options.token?(_s.exchangeTokenPromise||(_s.exchangeTokenPromise=this.exchangeTokenForAccessCookie(this.options.token)),_s.exchangeTokenPromise):Promise.resolve()})}createConversation(t){return M(this,null,function*(){var r;yield this.preflight(),te.info(`Creating conversation for session ${t.externalId} and agent ${t.agentId}`);let n=yield this.client.post("/api/v2/conversations",A(E({chat_start_time:new Date().toISOString()},ln(t)),{metadata:(r=t.metadata)!=null?r:{}}));return $S(n)})}getMe(){return M(this,null,function*(){let t=yield this.client.get("/apis/admin/session/me/");return Ve(t)})}postIdentity(t){return M(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/me/identities/",ln(t))})}patchMe(t){return M(this,null,function*(){yield this.preflight();let n=yield this.client.patch("/apis/admin/session/me/",ln(t));return Ve(n)})}getProfile(t){return M(this,null,function*(){let n=yield this.client.get(`/apis/admin/profiles/${t}/`,{useCache:!0});return Ve(n)})}getKnowledgeAssistant(t){return M(this,null,function*(){let n=yield this.client.get(`/apis/admin/knowledge-assist/assistants/${t}/`,{useCache:!0});return Ve(n)})}getContentTypes(){return M(this,null,function*(){let t=yield this.client.get("/apis/admin/content-types/",{useCache:!0});return Ve(t)})}getAccount(){return M(this,null,function*(){let t=yield this.client.get("/apis/admin/account/",{useCache:!0});return Ve(t)})}getPlatformConfig(t){return M(this,null,function*(){let n=t!==void 0?`/platform/config/${t}/`:"/platform/config/",{config:r}=yield this.client.get(n,{useCache:!0});return Ve(r)})}checkUserExists(t){return M(this,null,function*(){let{exists:n}=yield this.client.get(`/apis/admin/users/exists?external_id=${t}`,{version:"v1"});return n})}getConversationByExternalId(r){return M(this,arguments,function*(t,n={}){yield this.preflight(),te.info(`Getting conversation for session ${t}`);let{attempts:o=1,retryDelay:i=1e3}=n,s=yield this.client.get(`/api/v2/conversations/by_external_id/${t}`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500,version:"v2"});return te.info(`Successfully retrieved conversation ${s.id} for session ${t}`),$S(s)})}isConversationSupported(r){return M(this,arguments,function*(t,n={}){te.info(`Check if conversation for session ${t} is supported`);let{attempts:o=1,retryDelay:i=1e3}=n;return(yield this.client.get(`/api/v2/conversations/by_external_id/${t}/has_active_profile`,{attempts:o,retryDelay:i,retryOnResponse:a=>a.status===404||a.status>=500})).has_active_profile})}updateConversation(t,n){return M(this,null,function*(){var i;yield this.preflight();let r=ln(n);n.metadata&&(r.metadata=(i=n.metadata)!=null?i:{});let o=yield this.client.put(`/api/v2/conversations/${t}`,r);return $S(o)})}postMessages(t,n){return M(this,null,function*(){yield this.preflight(),yield this.client.post(`/api/v2/conversations/${t}/messages`,n.map(r=>A(E({},ln(r)),{metadata:r.metadata})))})}sendEvent(t,n){return M(this,null,function*(){yield this.preflight();let a=n,{data:r}=a,o=ie(a,["data"]),i=Object.entries(this.latestReceivedDeepdeskVersions).reduce((l,[c,u])=>A(E({},l),{[c]:u}),{}),s=["platform","agentId","agentName","agentEmail","conversationId"].reduce((l,c)=>(o[c]&&(l[c]=o[c]),l),{});return this.client.post("/api/v2/events",ln(A(E(E({},i),s),{data:r,name:t})),{version:"v2"})})}getEntities(t){return M(this,null,function*(){return yield this.preflight(),yield this.client.post("/api/v2/entities",{messages:t.filter(r=>r.text)})})}getTemporaryExchangeToken(){return M(this,null,function*(){return(yield this.client.get("/apis/admin/session/exchange-token/")).jwt})}exchangeTokenForAccessCookie(t){return M(this,null,function*(){return this.client.post("/apis/admin/session/jwt/",{jwt:t}).catch(n=>{throw te.warn(`Invalid token '${t}'`),n})})}authenticateWithKey(t,n){return M(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/api-key/",ln(n),{refreshTokenOn401:!1,headers:{apikey:t}})})}getTextSuggestions(o){return M(this,arguments,function*(t,n={},r){if(yield this.preflight(),r==="sticky-messages")throw new Error("Use getPinnedMessages instead");return(yield this.client.post(`/api/v2/conversations/${t}/recommend/${r}`,ln(n),{abortLatest:!0})).map(s=>A(E({},Ve(s)),{text:s.text||s.url||s.message,source:r,type:r})).filter((s,a,l)=>a===l.findIndex(c=>c.text===s.text))})}isLoggedIn(){return M(this,null,function*(){return yield this.preflight(),this.client.validateToken()})}getAutocompleteSuggestions(t,n){return M(this,null,function*(){return yield this.preflight(),(yield this.client.post(`/api/v2/conversations/${t}/autocomplete`,ln(n),{abortLatest:!0})).map(o=>({score:1,source:o.source,sourceText:o.source_text,text:o.label,trainingJobs:o.training_jobs,searchKeywords:o.search_keywords,type:o.source})).filter((o,i,s)=>i===s.findIndex(a=>a.text===o.text))})}getPinnedMessages(t){return M(this,null,function*(){let n=yield this.client.get(`/api/v2/profiles/${t}/pinned-messages`,{abortLatest:!0});return Ve(n).map(r=>A(E({},r),{text:r.message,source:"sticky-messages",type:"pinned-message"}))})}getStyleSuggestions(t){return M(this,null,function*(){let n=yield this.client.post("/api/v2/style-suggestions",ln(t),{abortLatest:!0,version:"v2"});return Ve(n)})}search(t){return M(this,null,function*(){let n=yield this.client.post(`/api/v2/profiles/${t.profile}/search`,ln(t));return Ve(n)})}loginWithPassword(t,n){return M(this,null,function*(){yield this.preflight();let r=yield this.client.post("/apis/admin/session/login/",{username:t,password:n},{refreshTokenOn401:!1});return Ve(r)})}logout(){return M(this,null,function*(){yield this.preflight(),yield this.client.post("/apis/admin/session/logout/",{},{refreshTokenOn401:!1})})}requestLoginByEmail(t){return M(this,null,function*(){yield this.preflight();let n=yield this.client.post("/apis/admin/session/passwordless/request/",{email:t});return Ve(n)})}requestPasswordlessToken(){return M(this,null,function*(){let t=yield this.client.get("/apis/admin/session/passwordless/request/");return Ve(t.token)})}getCsrfToken(){return M(this,null,function*(){let{token:t}=yield this.client.get("/apis/admin/session/csrf/");return t})}verifyLoginToken(t){return M(this,null,function*(){let n=yield this.client.post("/apis/admin/session/passwordless/login/",{token:t});return Ve(n)})}evaluateAssistant(t,n){return M(this,null,function*(){var s;yield this.preflight();let r=new URLSearchParams;n!=null&&n.externalConversationId&&r.append("external_conversation_id",n.externalConversationId);let o=n!=null&&n.threadId?`/api/v2/assistants/${t}/threads/${n==null?void 0:n.threadId}/evaluate?${r.toString()}`:`/api/v2/assistants/${t}/evaluate?${r.toString()}`,i=yield this.client.post(o,{input:(s=n==null?void 0:n.input)!=null?s:{},conversation:n==null?void 0:n.transcript});return Ve(i)})}createAssistantThread(t){return M(this,null,function*(){yield this.preflight();let{assistantCode:n}=t,r=yield this.client.post(`/apis/admin/assistants/${n}/threads/`,{});return Ve(r)})}postMessageToAssistantThread(t){return M(this,null,function*(){yield this.preflight();let{assistantCode:n,threadId:r,message:o}=t,i=yield this.client.post(`/apis/admin/assistants/${n}/threads/${r}/messages/`,{content:o,role:"user"});return Ve(i)})}translateMessages(t){return M(this,null,function*(){yield this.preflight();let n=yield this.client.post("/api/v2/translate",ln(t));return Ve(n)})}handleDeepdeskVersionHeaders(t){t.headers.forEach((n,r)=>{let o=r.toLowerCase(),i=o.match(tw);if(!n||!i)return;let s=i[1].replace("-","_"),a=this.latestReceivedDeepdeskVersions[s];a&&n&&a!==n&&te.warn(`Overwritten Version header ${o}: ${JSON.stringify(a)} -> ${JSON.stringify(n)}`),this.latestReceivedDeepdeskVersions[s]=n})}};_s.exchangeTokenPromise=null;var Mo=_s;var $m=class{constructor(t){this.options=t;this.socket=null;this.maxReconnectAttempts=5;this.reconnectInterval=25e3;this.cleanupCallbacks=[];var n,r;this.socket,this.eventListeners=new Map,this.url=t.url,this.maxReconnectAttempts=(n=t.maxReconnectAttempts)!=null?n:this.maxReconnectAttempts,this.reconnectInterval=(r=t.reconnectInterval)!=null?r:this.reconnectInterval,this.shouldReconnect=t.shouldReconnect}connect(){let t=()=>this.cleanup();window.addEventListener("beforeunload",t),this.cleanupCallbacks.push(()=>window.removeEventListener("beforeunload",t)),this.reconnect()}setupListeners(){this.socket&&(this.socket.onmessage=t=>{var n;try{let r=Ve(JSON.parse(t.data));r.event&&this.eventListeners.has(r.event)&&((n=this.eventListeners.get(r.event))==null||n.forEach(o=>o(r.data)))}catch(r){console.error("Error parsing WebSocket message:",r)}},this.socket.onclose=t=>{console.log("WebSocket connection closed:",t),setTimeout(()=>{this.reconnect()},this.reconnectInterval)},this.socket.onerror=t=>{console.error("WebSocket error:",t)})}reconnect(){var t,n;if(this.maxReconnectAttempts<=0){console.error("Max reconnect attempts reached, closing WebSocket connection."),(t=this.socket)==null||t.close();return}if(!this.shouldReconnect()){console.error("Should not reconnect, closing WebSocket connection."),(n=this.socket)==null||n.close();return}this.socket&&(this.socket.onmessage=null,this.socket.onclose=null,this.socket.onerror=null,this.socket.close()),this.socket=new WebSocket(this.url),this.setupListeners(),this.maxReconnectAttempts--}send(t,n){if(!this.socket){console.error("WebSocket connection is not open.");return}this.socket.send(JSON.stringify({event:t,data:n}))}on(t,n){this.eventListeners.has(t)||this.eventListeners.set(t,[]);let r=this.eventListeners.get(t);r&&!r.includes(n)&&r.push(n)}close(){var t;(t=this.socket)==null||t.close()}cleanup(){this.close(),this.cleanupCallbacks.forEach(t=>t()),this.cleanupCallbacks=[]}};var LA={startTime:null,stopTime:null},DA=e=>e.handlingTime,FA=Re({name:"handlingTime",initialState:LA,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(lt,()=>LA)}}),{handlingTimeStart:zA,handlingTimeStop:jm,handlingTimeReset:HA}=FA.actions,BA=FA.reducer;var UA=(e={})=>{let t=E({onAuthError:Ws(!1)},e);return n=>r=>o=>("error"in o&&o.error.message==="Unauthorized"&&n.dispatch(t.onAuthError),r(o))};var VA=(e={})=>{let t,n=!0,r=E({getStyleSuggestions:Es,debounce:500},e);return o=>i=>s=>{var p;let a=o.getState().input.text,l=i(s),c=o.getState();if(c.auth.isLoggedIn!==!0)return l;let{showStyleSuggestions:u}=c.settings;if(!((p=c.conversation.current)==null?void 0:p.id)||!u)return l;let{text:d}=c.input;return d===a&&!n||(clearTimeout(t),d==="")||(t=setTimeout(()=>{n=!1,o.dispatch(r.getStyleSuggestions({text:d}))},e.debounce)),l}};function rz(e,t){return e.text===t.text&&e.selection.start===t.selection.start&&e.selection.end===t.selection.end&&e.suggestionTextStart===t.suggestionTextStart}var WA=(e={})=>{let t=E({getTextSuggestions:Sr,getAutocompleteSuggestions:su,debounce:200,check:jr},e),n;return r=>o=>i=>{var g;let{input:s}=r.getState(),a=o(i),l=r.getState();if(l.auth.isLoggedIn!==!0)return a;let{recommendTextSuggestions:c,showTabCompletion:u}=l.settings,f=(g=l.conversation.current)==null?void 0:g.id,d=i.type===gm.toString();if(!f||!c&&!u)return a;let{input:p}=l;return rz(p,s)&&!d||(clearTimeout(n),!t.check(l))||(n=setTimeout(()=>{let v=Ni(l);v===""?r.dispatch(t.getTextSuggestions("default")):r.dispatch(t.getAutocompleteSuggestions(v))},d?0:t.debounce)),a}};var $A=Es.fulfilled.toString();function oz(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 jA=e=>t=>n=>r=>{var c;if(r.type!==$A){n(r);return}let o=t.getState().styleSuggestions.list;n(r);let i=t.getState(),s=i.styleSuggestions.list,a=(c=i.conversation)==null?void 0:c.current;if(o===s)return;let l=oz(o,s);r.type===$A&&l.length>0&&e.sendEvent("style suggested",{conversationId:a==null?void 0:a.id,data:{keywordMatches:l}})};var iz=Yu({assistants:IE,auth:mb,conversation:xb,contentTypes:yP,passwordlessToken:oA,entities:jP,handlingTime:BA,info:Vb,input:Mb,settings:_E,profile:bP,search:qb,styleSuggestions:PI,ui:hI,textSuggestions:tI});function KA(e){return tb({reducer:iz,middleware:t=>{var r;let n=t({thunk:{extraArgument:{dynamicThunkObject:e.dynamicThunkObject,deepdeskAPI:e.deepdeskAPI}},serializableCheck:!1}).concat(UA()).concat(WA({debounce:200})).concat(VA({debounce:500})).concat(jA(e.deepdeskAPI));return((r=e.middleware)!=null?r:[]).reduce((o,i)=>o.concat(i),n)},preloadedState:e.preloadedState})}function GA(e,t,n){if(t==="")return null;let r=new RegExp(`\\b${Im(t)}\\b`,"gi"),o,i=null;for(;(o=r.exec(e))!==null&&!(o.index>n);)i={start:o.index,end:o.index+o[0].length};return i}var sz=e=>{var t,n;return(n=(t=e==null?void 0:e.type)==null?void 0:t.toLowerCase())!=null?n:"unknown"},az=e=>t=>n=>r=>{var l,c,u,f,d,p;let o=t.getState(),i=Ui("inlineSuggestions")(o),s=Ui("autoSelectSuggestion")(o)||i;switch(r.type){case Ws.toString():{!r.payload&&e.emit("logout",void 0);break}case gd.fulfilled.toString():{e.emit("logout",void 0);break}case vr.fulfilled.toString():r.payload.length>0&&e.sendEvent("entities found",{conversationId:(l=o.conversation.current)==null?void 0:l.id,data:{entities:r.payload}});break;case Di.toString():e.logSendMessage(r.payload);break;case Gd.toString():e.emit("call-to-action",{cue:r.payload});break;case mn.fulfilled.toString():if(!r.isBroadcasted){let{externalConversationId:m,currentExternalIdAtRequest:g}=(c=r.payload)!=null?c:{};(!m||!g||m===g)&&e.broadcast(uh,r,!1)}break;case mn.rejected.toString():break;default:break}let a=n(r);switch(r.type){case Di.toString():e.handleAfterSendMessage(r.payload);break;case lu.toString():e.onUpdateShowTabHint(r.payload);break;case jm.toString():e.logHandlingTime();break;case Ks.toString():e.broadcast(Pd,r);break;case Li.toString():e.broadcast(Pd,r);break;case qd.toString():t.dispatch(Li({source:"assistant",assistantCode:r.payload.code}));break;case"analytics/logEvent/fulfilled":{let m=o.assistants.cues.find(g=>g.code===r.meta.arg.data.assistantCode);e.emit("event",A(E({},r.meta.arg),{cue:m}));break}case kn.toString():{let{start:m,end:g}=o.input.selection;e.emit("select-suggestion",A(E({type:sz(r.payload.suggestion)},r.payload),{replace:r.payload.replace==="selection"?{start:m,end:g}:{start:0,end:g}})),i&&t.dispatch(Ho([]));break}case RI.toString():{let{keyword:m,suggestion:g,eventMetrics:v}=r.payload,{text:h,selection:y}=o.input,S=GA(h,m,(u=y==null?void 0:y.end)!=null?u:h.length);if(!S)break;e.emit("select-suggestion",{text:g,type:"style",replace:S,suggestion:{text:g,source:"style"},eventMetrics:v});break}case wd.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 Ho.toString():{s&&r.payload.length>0&&t.dispatch(bd(0));break}case mn.fulfilled.toString():{let{evaluationId:m,output:g,externalConversationId:v}=r.payload,h=r.meta.arg.assistantCode;if(e.emit("event",{name:"Assistant evaluation completed",data:{evaluationId:m,assistantCode:h,assistantOutput:CE(g),externalConversationId:v,evaluationStatus:"success"}}),!r.meta.arg.skipState){let y=t.getState().assistants.cues;e.emit("cues",y)}break}case mn.rejected.toString():{let m=r.meta.arg.assistantCode,g=(p=r.meta.arg.externalConversationId)!=null?p:(d=t.getState().conversation.current)==null?void 0:d.externalId;e.emit("event",{name:"Assistant evaluation completed",data:{evaluationId:"",assistantCode:m,assistantOutput:"",externalConversationId:g,evaluationStatus:"failed"}});break}default:break}return a},qA=az;function jS(e){return e.toISOString().replace("T"," ").replace("Z","")}var lz=(e,t)=>t.version,YA=fn([Gs,Pr,DA,lz],(e,t,n,r)=>{if(!t)return te.warn("No conversationId for handling time metrics"),null;let{startTime:o,stopTime:i}=n;return!o||!i?(te.warn("No startTime and stopTime for handling time metrics"),null):{conversationId:t,clientVersion:r,agentId:e==null?void 0:e.agentId,agentName:e==null?void 0:e.agentName,agentEmail:e==null?void 0:e.agentEmail,timeStart:jS(o),timeStop:jS(i)}});function XA(e,t){let{text:n,metrics:{numPaste:r,pastes:o,textSuggestions:i}}=e.input,s=n.length;return{source:"agent",clientVersion:t.version,pastes:o,lenTextTotal:s,numPastes:r,suggestions:i}}var xu=class extends Error{};function cz(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}var Km=class{constructor(){this.queues={}}push(t,n){let r=()=>{let i=this.queues[t][1];i?(this.queues[t]=[i.promise,null],i.resolve()):delete this.queues[t]};if(!this.queues[t]){let i=n().finally(r);return this.queues[t]=[i,null],i}this.queues[t][1]&&this.queues[t][1].reject(new xu("Queued async function is outdated"));let o=cz();return this.queues[t][1]=o,o.promise.then(()=>n().finally(r))}};function KS(e,t){var i;let n=e.closest(t);if(n)return n;let r=e.getRootNode().host;if(r instanceof HTMLElement)return KS(r,t);let o=(i=e.ownerDocument.defaultView)==null?void 0:i.frameElement;return o?KS(o,t):null}function GS(e,t){return KS(e,t)}var uz={accepted:"onConversationAcceptedAssistants","new-message":"onConversationNewMessageAssistants",ended:"onConversationEndedAssistants"},QA=(e,t)=>{var o,i,s;if(!((s=(i=(o=e.uiConfig)==null?void 0:o.widget)==null?void 0:i.types.find(a=>a.type==="cues"))==null?void 0:s.isActive))return te.warn("Triggered a conversation assistant, but cues are not configured in widget."),[];let r=e[uz[t]];return r&&r.length>0?r.map(a=>a.code):(te.warn(`No assistant set in profile for conversation event "${t}"`),[])};function ZA(e){return typeof e=="object"&&e!==null&&"name"in e&&"message"in e}function dz(e){return typeof e=="object"&&e!==null&&"tagName"in e}function Gm(e){return dz(e)&&(Ts(e)||Rm(e))}var e_,qr=new Map,fz=["bottom","height","left","right","top","width"],JA=(e,t)=>!e&&!t?!1:e&&!t||!e&&t?!0:fz.some(n=>e[n]!==t[n]);function t_(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,...t_(t)]:[]}function n_(e,t){return!e||!t?null:A(E({},e),{top:e.top+t.top,left:e.left+t.left})}var qm=!1,r_=()=>{qm=!0;let e=[];if(qr.forEach((t,n)=>{if(!n.isConnected){t.rect=null,e.push(t),qr.delete(n);return}let r=n.getBoundingClientRect();JA(r,t.rect)&&(t.rect=r,e.push(t))}),e.forEach(t=>{let n=t.parentRects?t.parentRects.reduce(n_,t.rect):t.rect;JA(n,t.totalRect)&&t.callbacks.forEach(r=>r(n)),t.totalRect=n}),qr.size===0){qm=!1;return}e_=window.requestAnimationFrame(r_)};function qS(e,t){let n=t_(e),r=[],o=n.map((i,s)=>qS(i,a=>{r[s]=a;let l=qr.get(e);if(!l)return;let c=r.reduce(n_,l.rect);l.callbacks.forEach(u=>u(c))}));return{observe(i=!0){if(o.forEach(s=>s.observe(!1)),qr.has(e)){let s=qr.get(e);s.callbacks.push(t),s.rect&&t(s.rect)}else qr.set(e,{rect:void 0,callbacks:[t],parentRects:r});i&&!qm&&r_()},unobserve(){o.forEach(s=>s.unobserve());let i=qr.get(e);if(i){let s=i.callbacks.indexOf(t);s>=0&&i.callbacks.splice(s,1),i.callbacks.length||qr.delete(e),qr.size||(cancelAnimationFrame(e_),qm=!1)}}}}var o_,Yr=new Map,i_=()=>{Yr.forEach((e,t)=>{if(!t.isConnected){Yr.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)))}),Yr.size!==0&&(o_=window.requestAnimationFrame(i_))};function s_(e,t){return{observe(){let n=Yr.size===0;Yr.has(e)?Yr.get(e).callbacks.push(t):Yr.set(e,{visible:void 0,callbacks:[t]}),n&&i_()},unobserve(){let n=Yr.get(e);if(n){let r=n.callbacks.indexOf(t);r>=0&&n.callbacks.splice(r,1),n.callbacks.length||Yr.delete(e),Yr.size||cancelAnimationFrame(o_)}}}}var YS=["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 XS(e,t,n){return n.forEach(r=>{t.style[r]=e[r]})}function rl(e){return Number.parseFloat(e)}function Ym(e){return Math.round(e*1e6)}function a_(e){return e/1e6}function QS(e,t,n){if(e.boxSizing==="content-box")return;let{clientWidth:r}=t,o=rl(e.width),i=rl(e.borderLeftWidth),s=rl(e.borderRightWidth),a=rl(e.paddingRight),l=a_(Ym(o)-Ym(i)-Ym(s)),c=a_(Ym(r));if(l-c>2){let u=l-c;n.style.paddingRight=`${a+u}px`}}function wu(e,t={}){var u,f;let n=t.overlayContainer||document.createElement("div");n.style.display="none",n.style.position=(u=t.position)!=null?u:"fixed",n.style.pointerEvents="none",n.style.borderColor="transparent",os(n);let r=window.getComputedStyle(e),o=!0,i=()=>{n.scrollTop=e.scrollTop};XS(r,n,YS),QS(r,e,n),t.mirrorOverflow&&(n.style.overflow="hidden",e.addEventListener("scroll",i));let s=s_(e,()=>{XS(r,n,YS),QS(r,e,n),i(),setTimeout(i,0)}),a,l=!0,c=qS(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(XS(r,n,YS),QS(r,e,n),i(),t.placement==="below"&&n.classList.add("below"),n.style.top=`${d.top}px`,n.style.left=`${d.left}px`,t.closestScrollElement&&t.closestScrollElement!==e){let p=t.closestScrollElement.getBoundingClientRect(),m=window.getComputedStyle(t.closestScrollElement),g=rl(m.borderTopWidth),v=rl(m.borderBottomWidth),h=p.top+g-d.top,y=d.top+d.height+-(p.top+p.height-v);n.style.clipPath=`inset(${h}px 0px ${y}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),c.observe(),s.observe(),[n,()=>{e.removeEventListener("scroll",i),c.unobserve(),s.unobserve(),n.remove()}]}function pz(e){return e.offsetParent!==null}function l_(e){if(!pz(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 Xm(e,t,n=100){let r=l_(e);t({isVisible:r});let o=setInterval(()=>{let i=l_(e);i!==r&&(r=i,t({isVisible:r}))},n);return()=>{clearTimeout(o)}}var c_=(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){te.warn("[Deepdesk] SessionStorage is blocked by browser")}}});var ke=b(I());var u_=c_("showTabHint",!0),ol=class ol{constructor({deepdeskUrl:t,version:n=ol.version||"unknown",locale:r="en-US",token:o,fetch:i,productName:s,createCustomChannel:a,websocketClient:l=$m}){this.inputMediator=null;this.eventListeners={};this.unmountHandlers=[];this.disposeHandlers=[];this.inlineSuggestions=null;this.aboveSuggestions=null;this.belowSuggestions=null;this.floatingMenu=null;this.widgetElement=null;this.widgetRoot=null;this.nicknameDialogUnsubscribe=null;this.nicknameDialogFailed=!1;this.dynamicThunkObject={};this.queues=new Km;this.isMounted=!1;this.shouldRender=!0;this.loadProfileConfigPromise=null;let c=t.replace(/\/api$/,"");this.deepdeskApi=new Mo(c,{token:o,fetch:i}),this.version=n,this.instanceId=ol.count++;let u={deepdeskAPI:this.deepdeskApi,dynamicThunkObject:this.dynamicThunkObject,middleware:[qA({broadcast:(m,g,v)=>{this.broadcastEvents.send(m,g,v)},emit:(m,g)=>this.emit(m,g),handleAfterSendMessage:m=>this.handleAfterSendMessage(m),logHandlingTime:()=>this.logHandlingTime(),logSendMessage:m=>this.logSendMessage(m),onUpdateShowTabHint:m=>u_.update(m),sendEvent:(m,g)=>this.deepdeskApi.sendEvent(m,g)})]};this.store=KA(u),this.broadcastEvents=new NA({debug:!0,deepdeskUrl:c,eventMap:Yb(this.store),createCustomChannel:a}),this.disposeHandlers.push(()=>{this.broadcastEvents.cleanup()}),this.ws=new l({url:`${c}/api/v2/me/realtime`.replace("https","wss"),reconnectInterval:25e3,shouldReconnect:()=>M(this,null,function*(){var m;return(m=Pt(this.state))!=null?m:!1})}),this.whenLoggedIn(()=>this.ws.connect()),this.store.dispatch(lu(u_.value())),this.store.dispatch(Yd({locale:r,adminUrl:c,productName:s}));let f=[],d=m=>{if(!m.conversationId)return;let g=()=>{this.conversationId()===m.conversationId&&this.store.dispatch(PE(m))};this.hasConversation()?g():f.push(g)};this.ws.on("assistants::direct_response",d),this.ws.on("assistants::user_notification",d),this.ws.on("assistants::response_chunk",m=>{if(!m.conversationId)return;let g=()=>{this.conversationId()===m.conversationId&&this.store.dispatch(RE(m))};this.hasConversation()?g():f.push(g)}),this.ws.on("assistants::suggest_as_reply",m=>{if(!m.conversationId)return;let g=()=>{this.conversationId()===m.conversationId&&this.store.dispatch(Ks([{text:m.payload.message,type:"text",source:"assistant",assistantCode:m.code,sourceLabel:m.name}]))};this.hasConversation()?g():f.push(g)});let p=this.whenConversationLoaded(()=>{var m;this.broadcastEvents.setExternalId((m=this.state.conversation.current)==null?void 0:m.externalId),f.forEach(g=>g()),f.length=0});this.disposeHandlers.push(()=>{this.ws.cleanup(),f.length=0,p()})}get state(){return this.store.getState()}get settings(){return this.state.settings}get selectedTextSuggestion(){var t;return(t=Oi(this.state)[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}externalId(){if(!this.hasConversation())throw new Error("No conversation loaded");return this.state.conversation.current.externalId}shouldAbort(){return this.state.conversation.isSupported===!1?(te.warn("Conversation is not supported"),!0):this.hasConversation()?this.state.profile.data?!1:(te.warn("Profile has not been loaded (yet)"),!0):(te.warn("No conversation loaded (yet)"),!0)}whenLoggedIn(t){if(Pt(this.state))t();else{let n=this.subscribe(Pt,r=>{r&&t()});this.disposeHandlers.push(()=>{n()})}}login(){return this.store.dispatch(Ws(null)),this.store.dispatch(Jr()),new Promise(t=>{this.whenLoggedIn(()=>t())})}isLoggedIn(){return M(this,null,function*(){return(yield this.store.dispatch(Jr())).payload})}isConversationSupported(t,n){return M(this,null,function*(){return(yield this.store.dispatch(rh({externalId:t,options:n}))).payload})}createConversation(t){return M(this,null,function*(){var r;return this.hasConversation()&&this.externalId()!==t.externalId&&this.resetConversation(),(yield this.store.dispatch(vd(A(E({},t),{metadata:(r=t.metadata)!=null?r:{}})))).payload})}getConversationByExternalId(t,n){return M(this,null,function*(){return this.hasConversation()&&this.externalId()!==t&&this.resetConversation(),(yield this.store.dispatch(Sd({externalId:t,options:n}))).payload})}upsertConversation(t){return M(this,null,function*(){var r;return this.hasConversation()&&this.externalId()!==t.externalId&&this.resetConversation(),(yield this.store.dispatch(oh(A(E({},t),{metadata:(r=t.metadata)!=null?r:{}})))).payload})}postMessages(t){return M(this,null,function*(){yield this.store.dispatch(ih(t))})}updateConversation(t){return M(this,null,function*(){return(yield this.store.dispatch(xd(t))).payload})}resetConversation(){this.store.dispatch(lt()),this.loadProfileConfigPromise=null,this.dynamicThunkObject.conversationQuery=null}configure(t){this.store.dispatch(Yd(t))}setVisitorInfo(t){this.store.dispatch(zb(t))}setCustomData(t){this.store.dispatch(Hb(t))}setAgentInfo(t,n){return M(this,null,function*(){var o;yield this.store.dispatch(wl(E(E({},t),n))),(o=this.state.info.agentInfo)!=null&&o.agentNickname||this.broadcastEvents.send(Rd,{showNicknameDialog:!0})})}setAgentSettings(t){return M(this,null,function*(){yield this.store.dispatch(ah(t))})}getAgentSettings(){return M(this,null,function*(){return(yield this.store.dispatch(lh())).payload})}refresh(){return M(this,null,function*(){if(this.shouldAbort())return Promise.resolve();let t=[];return t.push(this.refreshTextSuggestions()),t.push(this.refreshWidgetSuggestions()),Promise.all(t).then(()=>{})})}syncInputMediator(){this.inputMediator&&this.store.dispatch(Ed({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),suggestionTextStart:this.inputMediator.getSuggestionTextStart()}))}notifyExternalSuggestion(t){this.store.dispatch(kn(t))}evaluateAssistant(t,n){return M(this,null,function*(){var c;let{input:r={},transcript:o,showCuesInWidget:i=!0,includeMetadata:s,externalConversationId:a}=n||{},l=yield this.store.dispatch(mn({assistantCode:t,transcript:o,includeMetadata:s,input:r,externalConversationId:a,skipState:!i}));if(l.error)throw new Error(`Assistant evaluation failed: ${(c=l.payload)!=null?c:l.error.message}`);return l.payload.output})}evaluateConversationAssistant(t,n){return M(this,null,function*(){var u,f,p;yield this.loadProfileConfig();let r=this.state.profile.data;if(!r&&((u=this.state.conversation.current)!=null&&u.profileCode)&&(yield this.loadProfileConfig(),r=this.state.profile.data),!r){te.warn("Can't evaluate assistant when profile is not loaded yet.");return}let o=QA(r,t),i=(f=n==null?void 0:n.showCuesInWidget)!=null?f:!0,d=n!=null?n:{},{showCuesInWidget:s}=d,a=ie(d,["showCuesInWidget"]),l=(p=n==null?void 0:n.externalConversationId)!=null?p:this.hasConversation()?this.externalId():"",c=yield Promise.all(o.map(m=>this.queues.push(m,()=>M(this,null,function*(){var v,h;let g=yield this.store.dispatch(mn(A(E({assistantCode:m,includeMetadata:!0},a),{skipState:!i})));if(g.error)throw new Error(`Assistant evaluation failed: ${(v=g.payload)!=null?v:g.error.message}`);return{assistantCode:m,evaluationId:g.payload.evaluationId,output:g.payload.output,externalConversationId:(h=g.payload.externalConversationId)!=null?h:l}})).catch(g=>{if(g instanceof xu)return te.warn(`Queued assistant "${m}" was outdated and dropped`),null;throw g})));if(!i)return c.filter(m=>m!==null)})}handleKeyDown(t){let{overlayCollapsed:n,openOverlayWhenTyping:r}=this.state.ui,{textSuggestions:o,selectedSuggestionIndex:i,selection:s}=this.state.input,{inlineSuggestions:a,autoSelectSuggestion:l,showTextSuggestions:c,suggestionsPlacement:u}=this.settings,f=a||l,d=u==="inline"||u==="below"?"below":"above",p=o.length>0;if(this.store.dispatch(Tb(sh(t))),!jr(this.state)||t.key!=="Tab"&&!c)return;let m=()=>{n||!p||s&&(t.shiftKey||(this.store.dispatch(Pb()),t.preventDefault()))},g=()=>{n||!p||f&&i<=0||s&&(t.shiftKey||(this.store.dispatch(Ib()),t.preventDefault()))};switch(t.key){case"ArrowUp":d==="below"?g():m();break;case"ArrowDown":{d==="below"?m():g();break}case"Escape":{n||(this.store.dispatch(bd(-1)),this.store.dispatch(Si({collapse:!0})),this.store.dispatch(mI(!0)),t.preventDefault());break}case"Tab":{t.preventDefault();let v=js(this.state);if(!v)return;this.store.dispatch(lu(!1)),this.store.dispatch(kn({text:v.text,suggestion:v,eventMetrics:{inputType:"tab"},replace:"until-selection-end"}));break}case" ":{if(f||this.state.input.selectedSuggestionIndex===-1)return;let v=js(this.state);if(!v)return;this.store.dispatch(kn({text:v.text,suggestion:v,eventMetrics:{inputType:"space"},replace:"until-selection-end"}));break}case"Enter":{if(f||t.shiftKey||this.state.input.selectedSuggestionIndex===-1)return;let v=js(this.state);if(!v)return;this.store.dispatch(kn({text:v.text,suggestion:v,eventMetrics:{inputType:"enter"},replace:"until-selection-end"})),t.preventDefault();break}default:}n&&r&&this.store.dispatch(Si({collapse:!1}))}handleAfterSendMessage(t){this.emit("send-message",t),this.store.dispatch(Ho([]))}handlingTimeStart(){this.state.handlingTime.startTime||(te.info("Start handling time"),this.store.dispatch(zA()))}handlingTimeStop(){this.state.handlingTime.startTime&&(te.info("Stop handling time"),this.store.dispatch(jm()))}logSendMessage(t){let n=XA(this.state,{version:this.version});n&&(t&&(Object.assign(n,{text:t}),Object.assign(n,{lenTextTotal:t.length})),this.deepdeskApi.sendEvent("Send Message",{conversationId:this.conversationId(),data:n}),this.emit("send-message-event",n))}logHandlingTime(){let t=YA(this.state,{version:this.version});t&&(this.deepdeskApi.sendEvent("Handling Time",{conversationId:this.conversationId(),data:t}),this.store.dispatch(HA()))}notifySubmit(t={}){var n;this.shouldAbort()||(this.store.dispatch(Di((n=t.text)!=null?n:this.state.input.text)),this.store.dispatch(_b()))}emit(t,n){let r=this.eventListeners[t];r&&r.forEach(o=>{try{o(n)}catch(i){te.warn(`The following error occurred in deepdeskSDK.on('${t}', handler)`),te.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(Bb(t))}whenConversationLoaded(t){let n=i=>{var s;return(s=i.conversation.current)==null?void 0:s.id},r=()=>this.loadProfileConfig().then(()=>t());return n(this.state)&&r(),this.subscribe(n,i=>{i&&r()})}overlayContainerFactory(t,n,r,o){let[i,s]=wu(n,r);return i.setAttribute("translate","no"),i.dataset.testid=t,o&&i.classList.add(o),[i,s]}createInlineContainer(t,n){var a;let r=document.createElement("div");r.style.position="absolute",r.style.top="0px",r.style.left="0px",r.style.height="0px",r.style.width="0px";let o=document.createElement("div");o.style.display="none",o.style.position="absolute",o.style.height="0px",o.style.width="0px",o.style.backgroundColor="red",r.appendChild(o);let 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,c]=wu(i,{appendTo:document.body,onMoveStart:()=>{o.style.display="none"}});l.dataset.testid=n,l.style.zIndex="2",l.appendChild(r),this.unmountHandlers.push(()=>{c()})}else document.body.appendChild(r);return o}createContainer(t,n=document.body){let r=window.getComputedStyle(n),o=document.createElement("div");return os(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),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),te.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()?(te.info(`Restored metrics for ${this.conversationId()}`),this.store.dispatch(Ab(r.metrics))):te.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(!Gm(t))throw new Error("[Deepdesk] Only mount on textarea or contentEditable div.");if(!this.shouldRender)return;let d=n,{customStyles:r,closestScrollSelector:o,floatingMenuParent:i,appendOverlayTo:s,inputMediator:a}=d,l=ie(d,["customStyles","closestScrollSelector","floatingMenuParent","appendOverlayTo","inputMediator"]),c={customStyles:r,closestScrollSelector:o,floatingMenuParent:i,appendOverlayTo:s};this.configure(l),this.settings.automaticHandlingTime&&this.setupHandlingTime(t),os(t),this.inputMediator=a||(Ts(t)?new Ps(t):new Rs(t)),this.inputMediator.on("change",({plainText:p,rawHTML:m,suggestionTextStart:g})=>{this.store.dispatch(Ed({text:p,html:m,suggestionTextStart:g}))}),this.inputMediator.on("keyup",p=>{this.store.dispatch(kb(sh(p)))}),this.inputMediator.on("keydown",p=>{this.handleKeyDown(p)}),this.inputMediator.on("paste",({pastedText:p,selectionText:m})=>{this.store.dispatch(Rb({text:p,selectionText:m}))}),this.inputMediator.on("cut",({selectionText:p})=>{this.store.dispatch(Cb(p))});let u;this.inputMediator.on("selection",p=>{clearTimeout(u),p===null?u=setTimeout(()=>{p!==null&&this.store.dispatch(Cd(p))},500):this.store.dispatch(Cd(p))}),this.unmountHandlers.push(()=>{clearTimeout(u)}),this.inputMediator.on("disabled",()=>{var p;(p=this.inputMediator)==null||p.deactivate(),this.configure({visible:!1})}),this.inputMediator.on("enabled",()=>{this.inputMediator&&(this.configure({visible:!0}),this.inputMediator.activate())}),this.inputMediator.on("submit",()=>{this.settings.detectSubmit&&this.notifySubmit()}),this.inputMediator.on("blur",()=>{this.store.dispatch(vm(!1))}),this.inputMediator.on("focus",()=>{this.store.dispatch(vm(!0))}),this.renderSuggestions(t,c),this.subscribe(Ui("inlineSuggestions"),()=>{this.renderSuggestions(t,c)}),this.subscribe(Ui("suggestionsPlacement"),()=>{this.renderSuggestions(t,c)});let f=this.renderOverlays(n);this.unmountHandlers.push(()=>{f.unmount()}),this.store.dispatch(Ed({text:this.inputMediator.getText(),html:this.inputMediator.getHTML(),suggestionTextStart:this.inputMediator.getSuggestionTextStart()})),this.store.dispatch(Cd(this.inputMediator.getSelection())),this.store.dispatch(vm(this.inputMediator.isFocused)),this.unmountHandlers.push(()=>{this.state.input.text!==""&&this.storeMetrics()}),this.whenConversationLoaded(()=>{this.restoreMetrics(),this.syncInputMediator(),this.refreshTextSuggestions(),this.promptForNickname()}),this.isMounted=!0}promptForNickname(t){if(this.nicknameDialogUnsubscribe||this.nicknameDialogFailed)return;let n=this.createContainer("nickname-dialog",document.body);document.body.appendChild(n);let r=(0,No.createRoot)(n),o=null,i=a=>{o=a,s()},s=()=>{r==null||r.render((0,ke.jsx)(ko,{store:this.store,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(_I,{id:"deepdesk-nickname-dialog",error:o,onSave:a=>M(this,null,function*(){try{yield this.store.dispatch(Db({agentNickname:a})).unwrap(),console.log("setAgentNickname",a),this.broadcastEvents.send(Rd,{showNicknameDialog:!1}),this.nicknameDialogUnsubscribe&&this.nicknameDialogUnsubscribe()}catch(l){te.error("Error setting agent nickname",l),i("error"),this.nicknameDialogFailed=!0}})})})}))};s(),this.nicknameDialogUnsubscribe=()=>{r.unmount(),n.remove(),this.nicknameDialogUnsubscribe=null}}subscribe(t,n){let r=t(this.store.getState());return this.store.subscribe(()=>{let o=t(this.store.getState());o!==r&&(r=o,n(r))})}unmount(){var t,n,r,o,i;(t=this.inlineSuggestions)==null||t.unmount(),(n=this.aboveSuggestions)==null||n.unmount(),(r=this.belowSuggestions)==null||r.unmount(),(o=this.floatingMenu)==null||o.unmount(),this.unmountHandlers.forEach(s=>s()),this.unmountHandlers=[],(i=this.inputMediator)==null||i.dispose(),this.nicknameDialogUnsubscribe&&this.nicknameDialogUnsubscribe(),this.isMounted=!1}dispose(){this.unmount(),this.unmountWidget(),this.disposeHandlers.forEach(t=>t()),this.disposeHandlers=[],this.off()}renderSuggestions(t,n){var r,o,i,s;(r=this.floatingMenu)==null||r.unmount(),(o=this.inlineSuggestions)==null||o.unmount(),(i=this.aboveSuggestions)==null||i.unmount(),(s=this.belowSuggestions)==null||s.unmount(),this.settings.floatingMenu&&(this.floatingMenu=this.renderFloatingMenu(t,n)),this.settings.inlineSuggestions||this.settings.suggestionsPlacement==="inline"?this.inlineSuggestions=this.renderInlineSuggestions(t,n):this.settings.suggestionsPlacement==="below"?this.belowSuggestions=this.renderAboveOrBelowSuggestions(t,n,"below"):this.aboveSuggestions=this.renderAboveOrBelowSuggestions(t,n,"above")}renderInlineSuggestions(t,n){let{customStyles:r}=n,o=this.createInlineContainer(t,"deepdesk-caret"),i=(0,No.createRoot)(o);i.render((0,ke.jsx)(ko,{store:this.store,customStyles:r,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(II,{})})}));let s=a=>{a?(o.style.display="block",o.style.top=`${a.top}px`,o.style.left=`${a.left}px`):o.style.display="none"};return this.inputMediator.on("caretposition",s),{unmount:()=>{var a;(a=this.inputMediator)==null||a.off("caretposition",s),i.unmount(),o.remove()}}}renderAboveOrBelowSuggestions(t,n,r){let{customStyles:o,closestScrollSelector:i,appendOverlayTo:s}=n,a=i&&GS(t,i)||void 0,[l,c]=this.overlayContainerFactory("deepdesk-tab-completion",a||t,{appendTo:s,closestScrollElement:a,mirrorOverflow:!0,onRemove:()=>this.unmount()},o==null?void 0:o.rootNode),[u,f]=this.overlayContainerFactory("deepdesk-suggestions-overlay",a||t,{appendTo:s,placement:r},o==null?void 0:o.suggestionsRootNode),d=(0,No.createRoot)(l);d.render((0,ke.jsx)(ko,{store:this.store,customStyles:o,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(tA,{inputElement:t})})}));let p=(0,No.createRoot)(u);return p.render((0,ke.jsx)(ko,{store:this.store,customStyles:o,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(BI,{onLogIn:()=>this.loginViaPopup().catch(m=>te.warn(m.message))})})})),{unmount(){d.unmount(),p.unmount(),c(),f()}}}renderFloatingMenu(t,n){let{customStyles:r,closestScrollSelector:o,appendOverlayTo:i,floatingMenuParent:s}=n,a=o&&GS(t,o)||void 0,[l,c]=this.overlayContainerFactory("floating-menu",a||t,{appendTo:s!=null?s:i},r==null?void 0:r.floatingMenuParent),u=(0,No.createRoot)(l);return u.render((0,ke.jsx)(ko,{store:this.store,customStyles:r,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(fI,{onLogIn:()=>this.loginViaPopup().catch(f=>te.warn(f.message))})})})),{unmount(){u.unmount(),c()}}}renderOverlays(t){let{customStyles:n}=t,r=this.createContainer("deepdesk-overlays"),o=(0,No.createRoot)(r);return o.render((0,ke.jsx)(ko,{store:this.store,customStyles:n,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(aI,{})})})),{unmount(){o.unmount(),r.remove()}}}renderWidget(t,n={}){if(this.widgetElement&&te.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.widgetElement=t,this.configure({showImages:o,isEmbedded:i}),this.widgetRoot=(0,No.createRoot)(t),this.widgetRoot.render((0,ke.jsx)(ko,{store:this.store,customStyles:r,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(RA,{assistantOptions:n.assistantOptions,knowledgeAssistOptions:n.knowledgeAssist,onLogIn:()=>this.loginViaPopup().catch(s=>te.warn(s.message))})})}))}unmountWidget(){var t,n;(n=(t=this.widgetRoot)==null?void 0:t.unmount)==null||n.call(t),this.widgetRoot=null,this.widgetElement=null}renderKnowledgeAssistantWidget(t,n,r={}){let{customStyles:o,initialQuestion:i}=r,s=(0,No.createRoot)(n);return s.render((0,ke.jsx)(ko,{store:this.store,customStyles:o,children:(0,ke.jsx)(to,{broadcastEvents:this.broadcastEvents,children:(0,ke.jsx)(FS,{children:(0,ke.jsxs)(Yp,{assistantCode:t,initialQuestion:i,evaluateKnowledgeAssistFn:Hl,children:[(0,ke.jsx)(Hs,{children:(0,ke.jsx)(Qp,{title:r.title,emptyState:r.emptyState})}),(0,ke.jsx)(DS,{children:(0,ke.jsx)(Xp,{})})]})})})})),{unmount(){s.unmount()}}}setupHandlingTime(t){let n=Xm(t,({isVisible:r})=>{r?this.handlingTimeStart():this.handlingTimeStop()});this.unmountHandlers.push(()=>{this.handlingTimeStop(),n()}),this.whenConversationLoaded(()=>{this.handlingTimeStart()})}handleError(t){ZA(t)&&t.message==="Unauthorized"&&this.login()}loadProfileConfig(){var t;return this.loadProfileConfigPromise?this.loadProfileConfigPromise:(t=this.state.conversation.current)!=null&&t.profileCode?(this.loadProfileConfigPromise=Promise.resolve().then(()=>M(this,null,function*(){yield this.store.dispatch(Kc()).unwrap();let n=mi(this.state);n&&this.store.dispatch(Yd({showSearch:n.search,showImageSearch:n.imageSearch,showEntitiesCommand:n.entitiesCommand,showSummaryCommand:!!n.summarizerAssistantNew,showKnowledgeSearch:!!n.knowledgeAssistantNew||!!n.knowledgeAssistant,recommendTextSuggestions:n.recommendTextSuggestions}))})).finally(()=>{mi(this.state)||(this.loadProfileConfigPromise=null)}),this.loadProfileConfigPromise):Promise.resolve()}loginViaPopup(t){return M(this,null,function*(){return new Promise((n,r)=>{this.store.dispatch(hd());let o=new MessageChannel,i=o.port1,s=this.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,c=()=>{u&&!u.closed&&u.close(),window.removeEventListener("message",f),clearInterval(d)};i.onmessage=p=>M(this,null,function*(){var m,g;if((m=p.data)!=null&&m.jwt)try{yield this.deepdeskApi.exchangeTokenForAccessCookie((g=p.data)==null?void 0:g.jwt),yield this.isLoggedIn(),this.broadcastEvents.send(El),l=!0,o.port1.close(),n()}catch(v){console.error(v),r(v)}finally{l=!0,c()}});let u=window.open(a.toString(),"deepdesk-login","scrollbars=no,left=100,top=150,width=500,height=500");u===null&&r(new Error("Popup blocked by browser"));let f=p=>M(this,null,function*(){var m;if(p.origin===a.origin)switch((m=p.data)==null?void 0:m.type){case"deepdesk-popup-request-origin":{try{let g=JSON.stringify({type:"deepdesk-popup-parent-origin"});u==null||u.postMessage(g,a.origin)}catch(g){te.error("Error posting message to popup",g),r(g)}break}case"deepdesk-popup-loaded":{try{let g=JSON.stringify({type:"deepdesk-popup-create-channel"});u==null||u.postMessage(g,a.origin,[o.port2])}catch(g){te.error("Error posting message to popup",g),r(g)}break}case"deepdesk-popup-error":{if(c(),p.data.message==="Platform account url mismatch"){let g=`Please contact your administrator: The platform account url (${p.data.targetOrigin}) is misconfigured as it differs from the origin of the page that opened the popup (${p.data.openerOrigin}).`;te.warn(g),this.store.dispatch(eh(g)),r(new Error(g))}if(p.data.message==="Timeout"){let g="Please contact your administrator: Popup timed out. Check if the account's platform url is configured correctly.";te.warn(g),this.store.dispatch(eh(g)),r(new Error(g))}r(new Error(p.data.message));break}}});window.addEventListener("message",f);let d=setInterval(()=>{u&&!u.closed||(c(),l||r(new Error("Popup closed by user")))},200);this.disposeHandlers.push(c)})})}translateMessages(t){return this.deepdeskApi.translateMessages(t)}refreshTextSuggestions(){return M(this,null,function*(){this.isMounted&&(yield this.store.dispatch(gm()))})}refreshWidgetSuggestions(){return M(this,null,function*(){if(!this.widgetRoot)return;let{uiConfig:t}=this.state.profile.data;if(!t.widget)return;let n=Gc(this.state);try{n.forEach(({type:r})=>{switch(r){case"entities":this.store.dispatch(vr());break;case"pinned-messages":case"sticky-messages":break;default:ju.includes(r)||this.store.dispatch(Sr(r))}})}catch(r){this.handleError(r)}})}};ol.version="19.3.2-beta.6",ol.count=0;var bu=ol;function mz(e){return M(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 d_(e,t){return M(this,null,function*(){let n=yield mz(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 f_(e,t,n){return M(this,null,function*(){yield new Mo(e).authenticateWithKey(t,n)})}function p_(e){return e.replace(/\[([\w\s\d]+)\]\((https?:\/\/[^\s]+)\)/g,'<a href="$2" target="_blank" rel="noreferrer">$1</a>')}function m_(r,o){return M(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)}`,c=(d=n.selectionAfter)!=null?d:{start:s+t.length,end:s+t.length},u=()=>{if(n.setValue)return n.setValue(l);e.value=l};return Promise.resolve(u()).then(()=>{e.selectionStart=c.start,e.selectionEnd=c.end,e.blur(),e.focus()})})}function g_(r,o){return M(this,arguments,function*(e,t,n={}){let i=n.replace?Ti(e,n.replace.start,n.replace.end):tl(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(`
84
+ `).reverse().forEach((l,c)=>{c>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?Ti(e,n.selectionAfter.start,n.selectionAfter.end):(i.collapse(!1),i),c=window.getSelection();c==null||c.removeAllRanges(),c==null||c.addRange(l)}if(!s)return;s.scrollIntoView&&s.scrollIntoView({block:"nearest",inline:"nearest"})}finally{s&&s.remove()}})})}function gz(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 hz(e){let t=document.createDocumentFragment();return e.split(`
85
+ `).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 h_(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):h_(n,t)}function y_(o,i){return M(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,c=l.getSelection();if((!c||c.rangeCount===0)&&(e.focus(),c=l.getSelection()),!c||c.rangeCount===0)return;let u=c.getRangeAt(0);if(!u)return;s=document.createElement("span"),u.insertNode(s);let f=r?gz(t):hz(t);n?h_(u.startContainer,f):(u.insertNode(f),u.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 B_(yz);})();
86
86
  /*! Bundled license information:
87
87
 
88
88
  classnames/index.js:
@@ -157,11 +157,11 @@ escape-html/index.js:
157
157
  *)
158
158
 
159
159
  dompurify/dist/purify.es.mjs:
160
- (*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE *)
160
+ (*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE *)
161
161
 
162
162
  tabbable/dist/index.esm.js:
163
163
  (*!
164
- * tabbable 6.3.0
164
+ * tabbable 6.5.0
165
165
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
166
166
  *)
167
167
  */