@seamly/web-ui 23.0.5 → 23.0.6-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/index.debug.js +18 -10
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +18 -10
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +18 -10
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +18 -10
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/utils.js +18 -10
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +3 -2
- package/src/javascripts/api/index.ts +14 -10
- package/src/javascripts/lib/external-api/index.js +5 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see standalone.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={2086:function(e){e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,a=i.length=o?i.length:0;a--;)o==i[a][0]&&i.splice(a,1);return e},e.emit=function(r){for(var o,i=t[r]||n,a=i.length>0?i.slice(0,i.length):i,s=0;o=a[s++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},7402:function(e,t,n){"use strict";n.r(t),n.d(t,{Children:function(){return h},Component:function(){return r.uA},Fragment:function(){return r.FK},PureComponent:function(){return s},StrictMode:function(){return ee},Suspense:function(){return g},SuspenseList:function(){return w},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:function(){return $},cloneElement:function(){return G},createContext:function(){return r.q6},createElement:function(){return r.n},createFactory:function(){return K},createPortal:function(){return S},createRef:function(){return r._3},default:function(){return ce},findDOMNode:function(){return Y},flushSync:function(){return Z},forwardRef:function(){return d},hydrate:function(){return L},isElement:function(){return ie},isFragment:function(){return W},isMemo:function(){return q},isValidElement:function(){return J},lazy:function(){return b},memo:function(){return c},render:function(){return R},startTransition:function(){return te},unmountComponentAtNode:function(){return X},unstable_batchedUpdates:function(){return Q},useCallback:function(){return o.hb},useContext:function(){return o.NT},useDebugValue:function(){return o.MN},useDeferredValue:function(){return ne},useEffect:function(){return o.vJ},useErrorBoundary:function(){return o.Md},useId:function(){return o.Bi},useImperativeHandle:function(){return o.Yn},useInsertionEffect:function(){return oe},useLayoutEffect:function(){return o.Nf},useMemo:function(){return o.Kr},useReducer:function(){return o.WO},useRef:function(){return o.li},useState:function(){return o.J0},useSyncExternalStore:function(){return ae},useTransition:function(){return re},version:function(){return V}});var r=n(172),o=n(5994);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){this.props=e,this.context=t}function c(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.n)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(s.prototype=new r.uA).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var l=r.fF.__b;r.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function d(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:(0,r.v2)((0,r.v2)(e).map(t))},h={map:p,forEach:p,count:function(e){return e?(0,r.v2)(e).length:0},only:function(e){var t=(0,r.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.v2},f=r.fF.__e;r.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);f(e,t,n,r)};var m=r.fF.unmount;function v(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function g(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.n)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function w(){this.u=null,this.o=null}r.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),m&&m(e)},(g.prototype=new r.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},g.prototype.componentWillUnmount=function(){this.t=[]},g.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.n)(r.FK,null,e.fallback);return i&&(i.__u&=-33),[(0,r.n)(r.FK,null,t.__a?null:e.children),i]};var C=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function x(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.XX)((0,r.n)(x,{context:t.context},e.__v),t.l)}function S(e,t){var n=(0,r.n)(E,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.uA).__a=function(e){var t=this,n=_(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),C(t,e,r)):o()};n?n(i):i()}},w.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){C(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,N=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,A=/[A-Z0-9]/g,I="undefined"!=typeof document,O=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function R(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function L(e,t,n){return(0,r.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var P=r.fF.event;function M(){}function j(){return this.cancelBubble}function D(){return this.defaultPrevented}r.fF.event=function(e){return P&&(e=P(e)),e.persist=M,e.isPropagationStopped=j,e.isDefaultPrevented=D,e.nativeEvent=e};var U,F={enumerable:!1,configurable:!0,get:function(){return this.class}},B=r.fF.vnode;r.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||I&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var s=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===s&&"no"===a?a=!1:"ondoubleclick"===s?i="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||O(t.type)?"onfocus"===s?i="onfocusin":"onblur"===s?i="onfocusout":k.test(i)?i=s:-1===n.indexOf("-")&&N.test(i)?i=i.replace(A,"-$&").toLowerCase():null===a&&(a=void 0):s=i="oninput","oninput"===s&&o[i=s]&&(i="oninputCapture"),o[i]=a}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",F)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=T,B&&B(e)};var z=r.fF.__r;r.fF.__r=function(e){z&&z(e),U=e.__c};var H=r.fF.diffed;r.fF.diffed=function(e){H&&H(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),U=null};var $={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value},useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,useDeferredValue:ne,useEffect:o.vJ,useId:o.Bi,useImperativeHandle:o.Yn,useInsertionEffect:oe,useLayoutEffect:o.Nf,useMemo:o.Kr,useReducer:o.WO,useRef:o.li,useState:o.J0,useSyncExternalStore:ae,useTransition:re}}},V="17.0.2";function K(e){return r.n.bind(null,e)}function J(e){return!!e&&e.$$typeof===T}function W(e){return J(e)&&e.type===r.FK}function q(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function G(e){return J(e)?r.Ob.apply(null,arguments):e}function X(e){return!!e.__k&&((0,r.XX)(null,e),!0)}function Y(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.FK;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var oe=o.Nf,ie=J;function ae(e,t){var n=t(),r=(0,o.J0)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.Nf)((function(){i.__=n,i.v=t,se(i)&&a({h:i})}),[e,n,t]),(0,o.vJ)((function(){return se(i)&&a({h:i}),e((function(){se(i)&&a({h:i})}))}),[e]),n}function se(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:o.J0,useId:o.Bi,useReducer:o.WO,useEffect:o.vJ,useLayoutEffect:o.Nf,useInsertionEffect:oe,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ae,startTransition:te,useRef:o.li,useImperativeHandle:o.Yn,useMemo:o.Kr,useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,version:"17.0.2",Children:h,render:R,hydrate:L,unmountComponentAtNode:X,createPortal:S,createElement:r.n,createContext:r.q6,createFactory:K,cloneElement:G,createRef:r._3,Fragment:r.FK,isValidElement:J,isElement:ie,isFragment:W,isMemo:q,findDOMNode:Y,Component:r.uA,PureComponent:s,memo:c,forwardRef:d,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:g,SuspenseList:w,lazy:b,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$}},172:function(e,t,n){"use strict";n.d(t,{FK:function(){return x},Ob:function(){return K},Qv:function(){return V},XX:function(){return $},_3:function(){return C},fF:function(){return o},n:function(){return b},q6:function(){return J},uA:function(){return E},v2:function(){return R}});var r,o,i,a,s,c,l,u,d,p,h,f={},m=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return w(e,s,o,i,null)}function w(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function C(){return{current:null}}function x(e){return e.children}function E(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function T(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return T(e)}}function N(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!k.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||c)(k)}function k(){var e,t,n,r,i,s,c,u;for(a.sort(l);e=a.shift();)e.__d&&(t=a.length,r=void 0,s=(i=(n=e).__v).__e,c=[],u=[],n.__P&&((r=g({},i)).__v=i.__v+1,o.vnode&&o.vnode(r),D(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,c,null==s?S(i):s,!!(32&i.__u),u),r.__v=i.__v,r.__.__k[r.__i]=r,U(c,r,u),r.__e!=s&&T(r)),a.length>t&&a.sort(l));k.__r=0}function A(e,t,n,r,o,i,a,s,c,l,u){var d,p,h,v,y,g=r&&r.__k||m,_=t.length;for(n.__d=c,I(n,t,g),c=n.__d,d=0;d<_;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?f:g[h.__i]||f,h.__i=d,D(e,h,p,o,i,a,s,c,l,u),v=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&B(p.ref,null,h),u.push(h.ref,h.__c||v,h)),null==y&&null!=v&&(y=v),65536&h.__u||p.__k===h.__k?(c&&!c.isConnected&&(c=S(p)),c=O(h,c,e)):"function"==typeof h.type&&void 0!==h.__d?c=h.__d:v&&(c=v.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=c,n.__e=y}function I(e,t,n){var r,o,i,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)a=r+d,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?w(null,o,null,null,null):y(o)?w(x,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=L(o,n,a,u),o.__i=s,i=null,-1!==s&&(u--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>c-a?d+=s-a:d--:s<a?s==a-1&&(d=s-a):d=0,s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=S(i)),z(i,i,!1),n[a]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=S(i)),z(i,i))}function O(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=O(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function R(e,t){return t=t||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){R(e,t)})):t.push(e)),t}function L(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function P(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||v.test(t)?n:n+"px"}function M(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||P(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||P(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=u,e.addEventListener(t,i?p:d,i)):e.removeEventListener(t,i?p:d,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function D(e,t,n,r,i,a,s,c,l,u){var d,p,h,f,m,v,_,b,w,C,S,T,N,k,I,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof O)try{if(b=t.props,w=(d=O.contextType)&&r[d.__c],C=d?w?w.props.value:d.__:r,n.__c?_=(p=t.__c=n.__c).__=p.__E:("prototype"in O&&O.prototype.render?t.__c=p=new O(b,C):(t.__c=p=new E(b,C),p.constructor=O,p.render=H),w&&w.sub(p),p.props=b,p.state||(p.state={}),p.context=C,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=g({},p.__s)),g(p.__s,O.getDerivedStateFromProps(b,p.__s))),f=p.props,m=p.state,p.__v=t,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,C)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,C),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,m,v)}))}if(p.context=C,p.props=b,p.__P=e,p.__e=!1,T=o.__r,N=0,"prototype"in O&&O.prototype.render){for(p.state=p.__s,p.__d=!1,T&&T(t),d=p.render(p.props,p.state,p.context),k=0;k<p._sb.length;k++)p.__h.push(p._sb[k]);p._sb=[]}else do{p.__d=!1,T&&T(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++N<25);p.state=p.__s,null!=p.getChildContext&&(r=g(g({},r),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(f,m)),A(e,y(I=null!=d&&d.type===x&&null==d.key?d.props.children:d)?I:[I],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),_&&(p.__E=p.__=null)}catch(e){t.__v=null,l||null!=a?(t.__e=c,t.__u|=l?160:32,a[a.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=F(n.__e,t,n,r,i,a,s,l,u);(d=o.diffed)&&d(t)}function U(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)B(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function F(e,t,n,o,i,a,s,c,l){var u,d,p,h,m,v,g,b=n.props,w=t.props,C=t.type;if("svg"===C?i="http://www.w3.org/2000/svg":"math"===C?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((m=a[u])&&"setAttribute"in m==!!C&&(C?m.localName===C:3===m.nodeType)){e=m,a[u]=null;break}if(null==e){if(null===C)return document.createTextNode(w);e=document.createElementNS(i,C,w.is&&w),a=null,c=!1}if(null===C)b===w||c&&e.data===w||(e.data=w);else{if(a=a&&r.call(e.childNodes),b=n.props||f,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(m=e.attributes[u]).name]=m.value;for(u in b)if(m=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=m;else if("key"!==u&&!(u in w)){if("value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w)continue;M(e,u,null,m,i)}for(u in w)m=w[u],"children"==u?h=m:"dangerouslySetInnerHTML"==u?d=m:"value"==u?v=m:"checked"==u?g=m:"key"===u||c&&"function"!=typeof m||b[u]===m||M(e,u,m,b[u],i);if(d)c||p&&(d.__html===p.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),A(e,y(h)?h:[h],t,n,o,"foreignObject"===C?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&S(n,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&_(a[u]);c||(u="value",void 0!==v&&(v!==e[u]||"progress"===C&&!v||"option"===C&&v!==b[u])&&M(e,u,v,b[u],i),u="checked",void 0!==g&&g!==e[u]&&M(e,u,g,b[u],i))}return e}function B(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function z(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||B(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&z(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||_(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function H(e,t,n){return this.constructor(e,n)}function $(e,t,n){var i,a,s,c;o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],D(t,e=(!i&&n||t).__k=b(x,null,[e]),a||f,f,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,c),U(s,e,c)}function V(e,t){$(e,t,V)}function K(e,t,n){var o,i,a,s,c=g({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),w(e.type,c,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=m.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},E.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,u=0,d=j(!1),p=j(!0),h=0},5994:function(e,t,n){"use strict";n.d(t,{Bi:function(){return I},J0:function(){return _},Kr:function(){return S},MN:function(){return k},Md:function(){return A},NT:function(){return N},Nf:function(){return C},WO:function(){return b},Yn:function(){return E},hb:function(){return T},li:function(){return x},vJ:function(){return w}});var r,o,i,a,s=n(172),c=0,l=[],u=[],d=s.fF,p=d.__b,h=d.__r,f=d.diffed,m=d.__c,v=d.unmount,y=d.__;function g(e,t){d.__h&&d.__h(o,e,c||t),c=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:u}),n.__[e]}function _(e){return c=1,b(D,e)}function b(e,t,n){var i=g(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):D(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};o.u=!0;var s=o.shouldComponentUpdate,c=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}c&&c.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function w(e,t){var n=g(r++,3);!d.__s&&j(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function C(e,t){var n=g(r++,4);!d.__s&&j(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return c=5,S((function(){return{current:e}}),[])}function E(e,t,n){c=6,C((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function S(e,t){var n=g(r++,7);return j(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function T(e,t){return c=8,S((function(){return e}),t)}function N(e){var t=o.context[e.__c],n=g(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function k(e,t){d.useDebugValue&&d.useDebugValue(t?t(e):e)}function A(e){var t=g(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function I(){var e=g(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function O(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(M),e.__H.__h=[]}catch(t){e.__H.__h=[],d.__e(t,e.__v)}}d.__b=function(e){o=null,p&&p(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),y&&y(e,t)},d.__r=function(e){h&&h(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(P),t.__h.forEach(M),t.__h=[],r=0)),i=o},d.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===d.requestAnimationFrame||((a=d.requestAnimationFrame)||L)(O)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),i=o=null},d.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||M(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],d.__e(n,e.__v)}})),m&&m(e,t)},d.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&d.__e(t,n.__v))};var R="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),R&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);R&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function M(e){var t=o;e.__c=e.__(),o=t}function j(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function D(e,t){return"function"==typeof t?t(e):t}},7154:function(e,t,n){"use strict";var r=n(7402),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useSyncExternalStore,a=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,a=n)}var i,a,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var h=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=h}),[h]),l(h),h}},8418:function(e,t,n){"use strict";e.exports=n(7154)},9497:function(e,t,n){"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9306:function(e,t,n){"use strict";var r=n(4901),o=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not a function")}},3506:function(e,t,n){"use strict";var r=n(3925),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},7080:function(e,t,n){"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(8227),o=n(2360),i=n(4913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},679:function(e,t,n){"use strict";var r=n(1625),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new o("Incorrect invocation")}},8551:function(e,t,n){"use strict";var r=n(34),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not an object")}},9617:function(e,t,n){"use strict";var r=n(5397),o=n(5610),i=n(6198),a=function(e){return function(t,n,a){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4527:function(e,t,n){"use strict";var r=n(3724),o=n(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4576:function(e,t,n){"use strict";var r=n(9504),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},6955:function(e,t,n){"use strict";var r=n(2140),o=n(4901),i=n(4576),a=n(8227)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:c?i(t):"Object"===(r=i(t))&&o(t.callee)?"Arguments":r}},7740:function(e,t,n){"use strict";var r=n(9297),o=n(5031),i=n(7347),a=n(4913);e.exports=function(e,t,n){for(var s=o(t),c=a.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:function(e,t,n){"use strict";var r=n(3724),o=n(4913),i=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:function(e,t,n){"use strict";var r=n(4901),o=n(4913),i=n(283),a=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:function(e,t,n){"use strict";var r=n(4475),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:function(e,t,n){"use strict";var r=n(4475),o=n(34),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},5002:function(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},9392:function(e){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7388:function(e,t,n){"use strict";var r,o,i=n(4475),a=n(9392),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},7015:function(e,t,n){"use strict";var r=n(4475),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:function(e,t,n){"use strict";var r=n(9504),o=Error,i=r("".replace),a=String(new o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);e.exports=function(e,t){if(c&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=i(e,s,"");return e}},6518:function(e,t,n){"use strict";var r=n(4475),o=n(7347).f,i=n(6699),a=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,h,f=e.target,m=e.global,v=e.stat;if(n=m?r:v?r[f]||s(f,{}):r[f]&&r[f].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(h=o(n,u))&&h.value:n[u],!l(m?u:f+(v?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(n,u,p,e)}}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:function(e,t,n){"use strict";var r=n(616),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350:function(e,t,n){"use strict";var r=n(3724),o=n(9297),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:function(e,t,n){"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:function(e,t,n){"use strict";var r=n(616),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},7751:function(e,t,n){"use strict";var r=n(4475),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:function(e,t,n){"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},3789:function(e,t,n){"use strict";var r=n(9306),o=n(8551),i=n(9565),a=n(1291),s=n(1767),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(o(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},4475:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:function(e,t,n){"use strict";var r=n(9504),o=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},421:function(e){"use strict";e.exports={}},397:function(e,t,n){"use strict";var r=n(7751);e.exports=r("document","documentElement")},5917:function(e,t,n){"use strict";var r=n(3724),o=n(9039),i=n(4055);e.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4576),a=Object,s=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},3167:function(e,t,n){"use strict";var r=n(4901),o=n(34),i=n(2967);e.exports=function(e,t,n){var a,s;return i&&r(a=t.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(e,s),e}},3706:function(e,t,n){"use strict";var r=n(9504),o=n(4901),i=n(7629),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},1181:function(e,t,n){"use strict";var r,o,i,a=n(8622),s=n(4475),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),h=n(421),f="Object already initialized",m=s.TypeError,v=s.WeakMap;if(a||d.state){var y=d.state||(d.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new m(f);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var g=p("state");h[g]=!0,r=function(e,t){if(u(e,g))throw new m(f);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},i=function(e){return u(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4376:function(e,t,n){"use strict";var r=n(4576);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:function(e,t,n){"use strict";var r=n(9039),o=n(4901),i=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},4117:function(e){"use strict";e.exports=function(e){return null==e}},34:function(e,t,n){"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},3925:function(e,t,n){"use strict";var r=n(34);e.exports=function(e){return r(e)||null===e}},6395:function(e){"use strict";e.exports=!1},757:function(e,t,n){"use strict";var r=n(7751),o=n(4901),i=n(1625),a=n(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,s(e))}},507:function(e,t,n){"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,i,a=n?e:e.iterator,s=e.next;!(o=r(s,a)).done;)if(void 0!==(i=t(o.value)))return i}},9539:function(e,t,n){"use strict";var r=n(9565),o=n(8551),i=n(5966);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return o(a),n}},6198:function(e,t,n){"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4901),a=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,h=String,f=Object.defineProperty,m=r("".slice),v=r("".replace),y=r([].join),g=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),_=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===m(h(t),0,7)&&(t="["+v(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=y(_,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},2603:function(e,t,n){"use strict";var r=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},2360:function(e,t,n){"use strict";var r,o=n(8551),i=n(6801),a=n(8727),s=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",h=u("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?v(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(r);for(var o=a.length;o--;)delete y[d][a[o]];return y()};s[h]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f[d]=o(e),n=new f,f[d]=null,n[h]=e):n=y(),void 0===t?n:i.f(n,t)}},6801:function(e,t,n){"use strict";var r=n(3724),o=n(8686),i=n(4913),a=n(8551),s=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),o=c(t),l=o.length,u=0;l>u;)i.f(e,n=o[u++],r[n]);return e}},4913:function(e,t,n){"use strict";var r=n(3724),o=n(5917),i=n(8686),a=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=r?i?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&h in n&&!n[h]){var r=u(e,t);r&&r[h]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),o)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:function(e,t,n){"use strict";var r=n(3724),o=n(9565),i=n(8773),a=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},8480:function(e,t,n){"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},1625:function(e,t,n){"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:function(e,t,n){"use strict";var r=n(9504),o=n(9297),i=n(5397),a=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},1072:function(e,t,n){"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},8773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2967:function(e,t,n){"use strict";var r=n(6706),o=n(34),i=n(7750),a=n(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return i(n),a(r),o(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},4270:function(e,t,n){"use strict";var r=n(9565),o=n(4901),i=n(34),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&o(n=e.toString)&&!i(s=r(n,e)))return s;if(o(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&o(n=e.toString)&&!i(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},5031:function(e,t,n){"use strict";var r=n(7751),o=n(9504),i=n(8480),a=n(3717),s=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=a.f;return n?c(t,n(e)):t}},7750:function(e,t,n){"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},9286:function(e,t,n){"use strict";var r=n(4402),o=n(8469),i=r.Set,a=r.add;e.exports=function(e){var t=new i;return o(e,(function(e){a(t,e)})),t}},3440:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(5170),s=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=s(e),o=i(t);return a(t)<=n.size?c(t,(function(e){n.includes(e)&&d(o,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(o,e)})),o}},4402:function(e,t,n){"use strict";var r=n(9504),o=Set.prototype;e.exports={Set:Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},8750:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(5170),a=n(3789),s=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(o,e)})):s(t,(function(e){n.includes(e)&&u(o,e)})),o}},4449:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(o(t,e))return l(u,"normal",!1)}))}},3838:function(e,t,n){"use strict";var r=n(7080),o=n(5170),i=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!o(t,e))return c(l,"normal",!1)}))}},8469:function(e,t,n){"use strict";var r=n(9504),o=n(507),i=n(4402),a=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},4916:function(e,t,n){"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](o(0));try{return(new t)[e](o(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:function(e,t,n){"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},3650:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(3789),s=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=i(t);return s(n,(function(e){l(t,e)?u(o,e):c(o,e)})),o}},4204:function(e,t,n){"use strict";var r=n(7080),o=n(4402).add,i=n(9286),a=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=i(t);return s(n,(function(e){o(c,e)})),c}},6119:function(e,t,n){"use strict";var r=n(5745),o=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},7629:function(e,t,n){"use strict";var r=n(6395),o=n(4475),i=n(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.37.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:function(e,t,n){"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:function(e,t,n){"use strict";var r=n(7388),o=n(9039),i=n(4475).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:function(e,t,n){"use strict";var r=n(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},5397:function(e,t,n){"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},1291:function(e,t,n){"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:function(e,t,n){"use strict";var r=n(1291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8981:function(e,t,n){"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},2777:function(e,t,n){"use strict";var r=n(9565),o=n(34),i=n(757),a=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:function(e,t,n){"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},2140:function(e,t,n){"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},655:function(e,t,n){"use strict";var r=n(6955),o=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:function(e,t,n){"use strict";var r=n(9504),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:function(e,t,n){"use strict";var r=n(3724),o=n(9039);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:function(e,t,n){"use strict";var r=n(4475),o=n(4901),i=r.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8227:function(e,t,n){"use strict";var r=n(4475),o=n(5745),i=n(9297),a=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},8107:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(1291),s=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},4114:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=o(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},7642:function(e,t,n){"use strict";var r=n(6518),o=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:o})},8004:function(e,t,n){"use strict";var r=n(6518),o=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||o((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:function(e,t,n){"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:o})},5876:function(e,t,n){"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:o})},2475:function(e,t,n){"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:o})},5024:function(e,t,n){"use strict";var r=n(6518),o=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:o})},1698:function(e,t,n){"use strict";var r=n(6518),o=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:o})},3375:function(e,t,n){"use strict";n(7642)},9225:function(e,t,n){"use strict";n(8004)},3972:function(e,t,n){"use strict";n(3853)},9209:function(e,t,n){"use strict";n(5876)},5714:function(e,t,n){"use strict";n(2475)},7561:function(e,t,n){"use strict";n(5024)},6197:function(e,t,n){"use strict";n(1698)},4979:function(e,t,n){"use strict";var r=n(6518),o=n(4475),i=n(7751),a=n(6980),s=n(4913).f,c=n(9297),l=n(679),u=n(3167),d=n(2603),p=n(5002),h=n(6193),f=n(3724),m=n(6395),v="DOMException",y=i("Error"),g=i(v),_=function(){l(this,b);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=new g(t,n),o=new y(t);return o.name=v,s(r,"stack",a(1,h(o.stack,1))),u(r,this,_),r},b=_.prototype=g.prototype,w="stack"in new y(v),C="stack"in new g(1,2),x=g&&f&&Object.getOwnPropertyDescriptor(o,v),E=!(!x||x.writable&&x.configurable),S=w&&!E&&!C;r({global:!0,constructor:!0,forced:m||S},{DOMException:S?_:g});var T=i(v),N=T.prototype;if(N.constructor!==T)for(var k in m||s(N,"constructor",a(1,T)),p)if(c(p,k)){var A=p[k],I=A.s;c(T,I)||s(T,I,a(6,A.c))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}();var r={};return function(){"use strict";n.r(r),n.d(r,{API:function(){return we},AgentInfo:function(){return kl},Chat:function(){return yc},ChatFrame:function(){return ll},ComponentFilter:function(){return xs},Conversation:function(){return cc},Engine:function(){return xl},EntryContainer:function(){return al},EventParticipant:function(){return ha},ExternalApi:function(){return Tl},Header:function(){return Al},Icon:function(){return ga},Interrupt:function(){return cl},MessageContainer:function(){return fa},SeamlyActivityMonitor:function(){return Es},SeamlyApiContext:function(){return Si},SeamlyEventBusContext:function(){return Ti},SeamlyFileUpload:function(){return Ns},SeamlyGeneralError:function(){return c},SeamlyLiveRegionContext:function(){return Ni},SeamlyOfflineError:function(){return Cr},SeamlyStoreProvider:function(){return Dn},Text:function(){return gs},TextEntry:function(){return Qc},Upload:function(){return ol},View:function(){return wl},calculateVisibility:function(){return _n},className:function(){return Qi},default:function(){return Il},eventTypes:function(){return N},randomId:function(){return m},useChoicePrompt:function(){return Na},useEvents:function(){return Gn},useGeneratedId:function(){return da},useI18n:function(){return wi},useSeamlyActions:function(){return Nl},useSeamlyChat:function(){return Di},useSeamlyCommands:function(){return Ri},useSeamlyConfig:function(){return $n},useSeamlyEventStream:function(){return pa},useSeamlyIdleDetachCountdown:function(){return la},useSeamlyMessageContainerClassNames:function(){return ea},useSeamlyOptions:function(){return ia},useSeamlyVisibility:function(){return Ci},useTranslatedEventData:function(){return qi},useTranslations:function(){return Wi},useTranslationsContainer:function(){return Gi},visibilityStates:function(){return yn}}),n(9497),n(4114);var e=n(2086),t=n.n(e),o=n(172);class i extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class a extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class s extends a{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class c extends a{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class l extends a{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class u extends a{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const d="cvco",p="seamly-client-participant",h=50,f=300;function m(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function v(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const y=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},g=e=>Math.ceil(e/1e3),_=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},b=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},w={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},C={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},x=e=>e.code?C[e.code]:w[e.keyCode],E=e=>{e&&e.focus()},S=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function T(e){return"object"==typeof e}const N={info:"info",message:"message",participant:"participant",system:"system"},k="text",A="text",I="upload",O="received",R="read",L="custom",P="typing",M="read",j="detach_service",D="dismiss",U="set_topic",F="click_cta",B="translation_proposal",z=B,H="window_api",$="assertive",V="polite",K={new_topic:"newTopic",new_translation:"newTranslation"},J="uploads",W="navigate";n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(4979);var q=e=>"function"==typeof e?e:function(){return e},G="undefined"!=typeof self?self:null,X="undefined"!=typeof window?window:null,Y=G||X||Y,Q="closed",Z="errored",ee="joined",te="joining",ne="leaving",re="phx_close",oe="phx_error",ie="phx_reply",ae="phx_leave",se="websocket",ce=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},le=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},ue=class{constructor(e,t,n){this.state=Q,this.topic=e,this.params=q(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ce(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new le((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=ee,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=Z,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Q,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=Z,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new ce(this,ae,q({}),this.timeout).send(),this.state=Z,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ie,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(re,e)}onError(e){return this.on(oe,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new ce(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ne;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(re,"leave")},n=new ce(this,ae,q({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=te,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Q}isErrored(){return this.state===Z}isJoined(){return this.state===ee}isJoining(){return this.state===te}isLeaving(){return this.state===ne}},de=class{static request(e,t,n,r,o,i,a){if(Y.XDomainRequest){let n=new Y.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new Y.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},pe=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout((()=>this.poll()),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+se),"$1/longpoll")}endpointURL(){return de.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET","application/json",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout((()=>{this.batchSend(this.currentBatch),this.currentBatch=null}),0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",e.join("\n"),(()=>this.onerror("timeout")),(e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,o){let i;i=de.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(i),r()}),(e=>{this.reqs.delete(i),this.isActive()&&o(e)})),this.reqs.add(i)}},he={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=this.META_LENGTH+t.length+n.length+o.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(s.byteLength+i.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(i),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let l=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+o));s+=o;let u=n.decode(e.slice(s,s+i));s+=i;let d=n.decode(e.slice(s,s+a));s+=a;let p=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ie,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}},fe=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||Y.WebSocket||pe,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||Y.sessionStorage,this.establishedConnections=0,this.defaultEncoder=he.encode.bind(he),this.defaultDecoder=he.decode.bind(he),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==pe?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;X&&X.addEventListener&&(X.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),X.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=q(t.params||{}),this.endPoint=`${e}/${se}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new le((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return pe}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=de.appendParams(de.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=q(e)),this.conn||(this.longPollFallbackMs&&this.transport!==pe?this.connectWithFallback(pe,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,o=!0,i=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),o=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${e.name}`))return i("memorized");this.fallbackTimer=setTimeout(i,t),n=this.onError((e=>{this.log("transport","error",e),o&&!r&&(clearTimeout(this.fallbackTimer),i(e))})),this.onOpen((()=>{if(r=!0,!o)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(i,t),this.ping((e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)}))})),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(oe)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t!==e))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new ue(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};const me=()=>null,ve=new Set;class ye{#e=[];async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new fe(o,{params:{...i,v:"3"},reconnectAfterMs:e=>{const t=2**e*250;return Math.min(t,1e4)}}),this.socket.onError((e=>{me("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{me("[SOCKET]OPEN")})),this.socket.onClose((()=>{me("[SOCKET]CLOSE"),this.#t({connected:!1,ready:!1,currentState:"socket_closed"})})),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&this.#t({connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{me("[CHANNEL]CLOSE"),this.#t({connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{me("[CHANNEL][ERROR]",e),this.#t({connected:!1,ready:!1,currentState:"channel_erred"})})),this.#n("ack","ui","error","participant","message","service_data","system","info","sync")}start(){this.channel?.join().receive("ok",(()=>{me("[CHANNEL][JOIN] OK"),this.#t({connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{me("[CHANNEL][JOIN] ERROR",e),this.#t({connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{me("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){this.channel?.leave().receive("ok",(()=>{this.socket?.disconnect(),me("[CHANNEL][LEAVE] OK"),this.#e=[]}))}#n(...e){e.forEach((e=>{this.channel?.on(e,(t=>{me("[RECEIVE]",e,t)}))}))}onConnection(e){this.#e.push(e)}#t(e){this.#e=this.#e.filter((t=>!t(e))),ve.forEach((e=>e()))}pushToChannel(e,t,n=1e4){this.channel?.push(e,t,n)}static subscribe(e){return ve.add(e),()=>ve.delete(e)}}const ge=()=>null,_e=async(e,t)=>{const n=new URL(e);n.searchParams.set("v","3");const r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new i(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function be(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class we{#r;#o;#i;#a="window";#s;conversation=new ye;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get(e){return void 0===e?r:r[e]},set(e,t){return r[e]=t,n.set(r),t},delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r?.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||v),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#s={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r?.channelName||"web"}},this.#r=!1,this.connected=!1,this.configReady=!1,this.#o=n.externalId,e&&(this.#a=e),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}#c(){return this.store.get("accessToken")}#l(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}#u(e){this.store.set("conversationUrl",e)}hasConversation(){return!!this.getConversationUrl()}#d(){return this.store.get("channelTopic")||this.store.get("channelName")}#p(e){this.store.set("channelTopic",e)}#h=e=>e||this.locale;clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#f(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}#m({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>(e[t]=n,e)),this.URLS)}async reset(){return await this.disconnect(),this.clearStore(),this.getConfig()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async#v(){if(!this.hasConversation())try{"function"==typeof this.#s?.getConversationAuthToken&&(this.#i=await this.#s.getConversationAuthToken());const e=await _e(`${this.#f("http")}${this.URLS.conversations}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#i?void 0:this.#o,token:this.#i})}),t=await e.json(),{conversation:n}=t,r={...n};return delete r.accessToken,delete r.channelTopic,this.#l(n.accessToken),this.#p(n.channelTopic),this.#m(t),this.URLS.conversation&&this.#u(this.URLS.conversation),this.locale=n.translation?.locale,this.userResponded=n.userResponded,r}catch(e){if(e.status>=500)throw new c(e);if(400===e.status)throw new u(e);if(404===e.status)throw new s(e);throw e}}async getConfig(){try{const e=await _e(`${this.#f("http")}/client/${this.connectionInfo.apiKey}/configs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:{...this.#s.context,environment:!0===this.#s.sendEnvironment?this.getEnvironment():this.#s.sendEnvironment}})}),t=await e.json();return this.#m(t),this.configReady=!0,t.config}catch(e){if(404===e.status)throw new s(e);if(e.status>=500)throw new c(e);throw e}}async getConversation(){if(!this.hasConversation())return null;try{const e=await _e(`${this.#f("http")}${this.URLS.history}`,{method:"GET",headers:{Authorization:`Bearer ${this.#c()}`}}),t=await e.json();this.#m(t);const{messages:n,participants:r,activeServiceSessionId:o,activeServiceSettings:i,serviceData:a,ui:s,translation:c}=t.history;return{events:n.map((([e,t])=>({type:e,payload:{...t,type:"participant"===e?e:t.type}}))),participants:r,activeServiceSessionId:o,activeServiceSettings:i,serviceData:a,resumeConversationPrompt:!!s&&Boolean(s.resumeConversationPrompt),translationProposal:s.translationProposal,translation:c}}catch(e){if(401===e.status)throw new u(e);if(404===e.status)throw new l(e);if(e.status>=500)throw new c(e);throw new i(e)}}async connect(){this.connected=!1;const e=await this.#v();return this.conversation.connect(`${this.#f("ws")}${this.URLS.socket}`,this.#s.context.channelName,this.#d(),this.#c()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#r=t})),e}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#f("http")}${this.URLS.uploads}`),i.setRequestHeader("Authorization",`Bearer ${this.#c()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(o),i}async getConversationIntitialState(){try{const n=await _e(`${this.#f("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.#c()}`}}),r=await n.json();return this.#m(r),this.userResponded=r.conversation.userResponded,e=r.conversation,t=["accessToken","channelTopic"],Object.keys(e).reduce(((n,r)=>(t.includes(r)||(n[r]=e[r]),n)),{})}catch(e){if(401===e.status)throw new u(e);if(404===e.status)throw new l(e);if(e.status>=500)throw new c(e);throw e}var e,t}async getTranslations(e){try{if(!this.URLS.translations)throw new s;const t=this.#h(e);if(!t)throw new c;const n=`${this.#f("http")}${this.URLS.translations}`.replace("{version}",String(4)).replace("{locale}",t),r=await _e(n,{method:"GET"});return(await r.json()).translations}catch(e){if(e.status>=500)throw new c(e);throw new i(e)}}send(e,t=void 0,n=!0){!this.connected||n&&!this.#r?this.conversation?.onConnection((({connected:r,ready:o})=>(this.connected=r,this.#r=o,!!(n?o:r)&&(this.send(e,t,n),!0)))):(ge("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=m()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{contentLocale:t,source:n,userLocale:r,variables:o,environment:i}=e,a={};if(i&&(a.environment=i),t){if("string"!=typeof t)throw new Error("Content locale must be a string");a.contentLocale=t}if(n){if("string"!=typeof n)throw new Error("Source must be a string");a.source=n}if(r){if("string"!=typeof r)throw new Error("User locale must be a string");a.userLocale=r,this.#y(a,r)}if(o){if("object"!=typeof o)throw new Error("Variables must be an object");a.variables=o}0===Object.keys(a).length&&a.constructor===Object||this.send("context",a,!1)}#y(e,t){e.source||t==this.#s.context?.userLocale||(e.source=H)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#a,clientVersion:"23.0.5",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:be(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}var Ce=Symbol.for("immer-nothing"),xe=Symbol.for("immer-draftable"),Ee=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Ee]}function ke(e){return!!e&&(Ie(e)||Array.isArray(e)||!!e[xe]||!!e.constructor?.[xe]||Me(e)||je(e))}var Ae=Object.prototype.constructor.toString();function Ie(e){if(!e||"object"!=typeof e)return!1;const t=Te(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Ae}function Oe(e,t){0===Re(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Re(e){const t=e[Ee];return t?t.type_:Array.isArray(e)?1:Me(e)?2:je(e)?3:0}function Le(e,t){return 2===Re(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pe(e,t,n){const r=Re(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Me(e){return e instanceof Map}function je(e){return e instanceof Set}function De(e){return e.copy_||e.base_}function Ue(e,t){if(Me(e))return new Map(e);if(je(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Ie(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Ee];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Te(e),t)}{const t=Te(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Fe(e,t=!1){return ze(e)||Ne(e)||!ke(e)||(Re(e)>1&&(e.set=e.add=e.clear=e.delete=Be),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Fe(t,!0)))),e}function Be(){Se(2)}function ze(e){return Object.isFrozen(e)}var He,$e={};function Ve(e){const t=$e[e];return t||Se(0),t}function Ke(){return He}function Je(e,t){t&&(Ve("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function We(e){qe(e),e.drafts_.forEach(Xe),e.drafts_=null}function qe(e){e===He&&(He=e.parent_)}function Ge(e){return He={drafts_:[],parent_:He,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xe(e){const t=e[Ee];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ye(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Ee].modified_&&(We(t),Se(4)),ke(e)&&(e=Qe(t,e),t.parent_||et(t,e)),t.patches_&&Ve("Patches").generateReplacementPatches_(n[Ee].base_,e,t.patches_,t.inversePatches_)):e=Qe(t,n,[]),We(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ce?e:void 0}function Qe(e,t,n){if(ze(t))return t;const r=t[Ee];if(!r)return Oe(t,((o,i)=>Ze(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return et(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Oe(o,((o,a)=>Ze(e,r,t,o,a,n,i))),et(e,t,!1),n&&e.patches_&&Ve("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Ze(e,t,n,r,o,i,a){if(Ne(o)){const a=Qe(e,o,i&&t&&3!==t.type_&&!Le(t.assigned_,r)?i.concat(r):void 0);if(Pe(n,r,a),!Ne(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(ke(o)&&!ze(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Qe(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||et(e,o)}}function et(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fe(t,n)}var tt={get(e,t){if(t===Ee)return e;const n=De(e);if(!Le(n,t))return function(e,t,n){const r=ot(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!ke(r)?r:r===rt(e.base_,t)?(at(e),e.copy_[t]=st(r,e)):r},has(e,t){return t in De(e)},ownKeys(e){return Reflect.ownKeys(De(e))},set(e,t,n){const r=ot(De(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=rt(De(e),t),a=r?.[Ee];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Le(e.base_,t)))return!0;at(e),it(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||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 void 0!==rt(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,at(e),it(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=De(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Se(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){Se(12)}},nt={};function rt(e,t){const n=e[Ee];return(n?De(n):e)[t]}function ot(e,t){if(!(t in e))return;let n=Te(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Te(n)}}function it(e){e.modified_||(e.modified_=!0,e.parent_&&it(e.parent_))}function at(e){e.copy_||(e.copy_=Ue(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function st(e,t){const n=Me(e)?Ve("MapSet").proxyMap_(e,t):je(e)?Ve("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=tt;n&&(o=[r],i=nt);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Ke()).drafts_.push(n),n}function ct(e){return Ne(e)||Se(10),lt(e)}function lt(e){if(!ke(e)||ze(e))return e;const t=e[Ee];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ue(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ue(e,!0);return Oe(n,((e,t)=>{Pe(n,e,lt(t))})),t&&(t.finalized_=!1),n}Oe(tt,((e,t)=>{nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),nt.deleteProperty=function(e,t){return nt.set.call(this,e,t,void 0)},nt.set=function(e,t,n){return tt.set.call(this,e[0],t,n,e[0])};var ut=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Se(6),void 0!==n&&"function"!=typeof n&&Se(7),ke(e)){const o=Ge(this),i=st(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?We(o):qe(o)}return Je(o,n),Ye(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Ce&&(r=void 0),this.autoFreeze_&&Fe(r,!0),n){const t=[],o=[];Ve("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Se(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||Se(8),Ne(e)&&(e=ct(e));const t=Ge(this),n=st(e,void 0);return n[Ee].isManual_=!0,qe(t),n}finishDraft(e,t){const n=e&&e[Ee];n&&n.isManual_||Se(9);const{scope_:r}=n;return Je(r,t),Ye(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Ve("Patches").applyPatches_;return Ne(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},dt=ut.produce;ut.produceWithPatches.bind(ut),ut.setAutoFreeze.bind(ut),ut.setUseStrictShallowCopy.bind(ut),ut.applyPatches.bind(ut),ut.createDraft.bind(ut),ut.finishDraft.bind(ut);var pt=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var ht="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},ft=0,mt=1;function vt(){return{s:ft,v:void 0,o:null,p:null}}function yt(e,t={}){let n=vt();const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=vt(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=vt(),e.set(n,t)):t=r}}const s=t;let c;if(t.s===mt)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==i&&i--),o="object"==typeof c&&null!==c||"function"==typeof c?new ht(c):c}return s.s=mt,s.v=c,c}return a.clearCache=()=>{n=vt(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function gt(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=yt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,h=pt(l),f=pt(d),m=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),v=c((function(){return r++,a.apply(null,arguments)}),...h),y=u((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(m,arguments);return t=v.apply(null,e),t}),...f);return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var _t=gt(yt),bt=Object.assign(((e,t=_t)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>bt});function wt(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 Ct=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),xt=()=>Math.random().toString(36).substring(7).split("").join("."),Et={INIT:`@@redux/INIT${xt()}`,REPLACE:`@@redux/REPLACE${xt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${xt()}`};function St(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Tt(e,t,n){if("function"!=typeof e)throw new Error(wt(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(wt(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(wt(1));return n(Tt)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function l(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function u(){if(c)throw new Error(wt(3));return o}function d(e){if("function"!=typeof e)throw new Error(wt(4));if(c)throw new Error(wt(5));let t=!0;l();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error(wt(6));t=!1,l(),a.delete(n),i=null}}}function p(e){if(!St(e))throw new Error(wt(7));if(void 0===e.type)throw new Error(wt(8));if("string"!=typeof e.type)throw new Error(wt(17));if(c)throw new Error(wt(9));try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}return p({type:Et.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(wt(10));r=e,p({type:Et.REPLACE})},[Ct]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(wt(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Ct](){return this}}}}}function Nt(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Et.INIT}))throw new Error(wt(12));if(void 0===n(void 0,{type:Et.PROBE_UNKNOWN_ACTION()}))throw new Error(wt(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(wt(14));a[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?a:e}}function kt(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function At(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var It=At(),Ot=At,Rt=(((...e)=>{const t=gt(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(Ne(e)?ct(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(yt),"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?kt:kt.apply(null,arguments)}),Lt=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Pt(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(dn(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return St(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Mt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function jt(e){return ke(e)?dt(e,(()=>{})):e}function Dt(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(dn(10));const r=n.insert(t,e);return e.set(t,r),r}var Ut=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Mt;return t&&("boolean"==typeof t?i.push(It):i.push(Ot(t.extraArgument))),i},Ft=e=>t=>{setTimeout(t,e)},Bt="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ft(10),zt=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Mt(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?Bt:"callback"===e.type?e.queueNotification:Ft(e.timeout),l=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},Ht=!0;function $t(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(dn(28));if(r in t)throw new Error(dn(29));return t[r]=n,o},addMatcher(e,t){return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){return r=e,o}};return e(o),[t,n,r]}var Vt=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function Kt(...e){return t=>e.some((e=>((e,t)=>Lt(e)?e.match(t):e(t))(e,t)))}var Jt=["name","message","stack","code"],Wt=class{constructor(e,t){this.payload=e,this.meta=t}_type},qt=class{constructor(e,t){this.payload=e,this.meta=t}_type},Gt=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of Jt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},Xt=(()=>{function e(e,t,n){const r=Pt(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=Pt(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Pt(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||Gt)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(a,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):Vt(),u=new AbortController;let d,p;function h(e){p=e,u.abort()}const f=async function(){let f;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=i)&&"object"==typeof m&&"function"==typeof m.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));a(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:a,getState:s,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new Wt(e,t),fulfillWithValue:(e,t)=>new qt(e,t)})).then((t=>{if(t instanceof Wt)throw t;return t instanceof qt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof Wt?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&i.match(f)&&f.meta.condition||a(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap(){return f.then(Yt)}})}}),{pending:o,rejected:i,fulfilled:r,settled:Kt(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Yt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Qt=Symbol.for("rtk-slice-createasyncthunk");function Zt(e,t){return`${e}/${t}`}function en({creators:e}={}){const t=e?.asyncThunk?.[Qt];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(dn(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(dn(12));if(n in a.sliceCaseReducersByType)throw new Error(dn(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return a.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return a.actionCreators[e]=t,s},exposeCaseReducer(e,t){return a.sliceCaseReducersByName[e]=t,s}};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?$t(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e,t){let i,[s,c,l]=$t((e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)i=()=>jt(e());else{const t=jt(e);i=()=>t}function u(e=i(),t){let n=[s[t.type],...c.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[l]),n.reduce(((e,n)=>{if(n){if(Ne(e)){const r=n(e,t);return void 0===r?e:r}if(ke(e))return dt(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(dn(9))}return r}}return e}),e)}return u.getInitialState=i,u}(e.initialState)}i.forEach((r=>{const i=o[r],a={reducerName:r,type:Zt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(dn(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Pt(e,a):Pt(e))}(a,i,s):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(dn(18));const{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:l,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||rn,pending:s||rn,rejected:c||rn,settled:l||rn})}(a,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function h(){return d||(d=c()),d.getInitialState()}function f(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=h()),r}function o(t=l){const r=Dt(u,n,{insert:()=>new WeakMap});return Dt(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=tn(i,t,h,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const m={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...f(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:p},n),{...m,...f(o,!0)}}};return m}}function tn(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var nn=en();function rn(){}var{assign:on}=Object,an="listenerMiddleware",sn=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=Pt(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error(dn(21));return((e,t)=>{if("function"!=typeof e)throw new Error(dn(32))})(i),{predicate:o,type:t,effect:i}},cn=Object.assign((e=>{const{type:t,predicate:n,effect:r}=sn(e);return{id:Vt(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(dn(22))}}}),{withTypes:()=>cn}),ln=Object.assign(Pt(`${an}/add`),{withTypes:()=>ln}),un=(Pt(`${an}/removeAll`),Object.assign(Pt(`${an}/remove`),{withTypes:()=>un}));function dn(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. `}Symbol.for("rtk-state-proxy-original");class pn extends a{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const hn=Xt("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,defaultLocale:r,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:s}=await t.getConfig(),c=n?.context?.userLocale||r,l=n?.context?.contentLocale||r,{connectWhenInView:u}=n;return{features:e,defaultLocale:r,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:s,defaultUserLocale:c,defaultContentLocale:l,connectWhenInView:u}}catch(e){return r(e)}})),fn=Xt("resetConfig",(async(e,{extra:{config:t}})=>t));const mn=_t((({app:e})=>e),(({userHasResponded:e})=>e)),vn="visibility",yn={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},gn=_t((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?yn.open:yn.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),_n=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};if("app"===i&&!t)return yn.open;if("window"===i&&a&&n!==yn.open)return e?n||t||yn.open:yn.hidden;if("inline"===i&&e&&!n)return t||yn.open;const c=yn.minimized;return n||t||s||c};var bn=n(7402),wn=n(8418),Cn=bn.default,xn=Symbol.for("react-redux-context"),En="undefined"!=typeof globalThis?globalThis:{};function Sn(){if(!Cn.createContext)return{};const e=En[xn]??(En[xn]=new Map);let t=e.get(Cn.createContext);return t||(t=Cn.createContext(null),e.set(Cn.createContext,t)),t}var Tn=Sn();function Nn(e=Tn){return function(){return Cn.useContext(e)}}var kn=Nn(),An=()=>{throw new Error("uSES not initialized!")},In=(e,t)=>e===t;function On(e=Tn){const t=e===Tn?kn:Nn(e),n=(e,n={})=>{const{equalityFn:r=In,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Cn.useRef(!0),Cn.useCallback({[e.name](t){return e(t)}}[e.name],[e,c,o.stabilityCheck])),d=An(a.addNestedSub,i.getState,s||i.getState,u,r);return Cn.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var Rn=On();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Ln={notify(){},get:()=>[]};var Pn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Mn="undefined"!=typeof navigator&&"ReactNative"===navigator.product,jn=Pn||Mn?Cn.useLayoutEffect:Cn.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var Dn=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const a=Cn.useMemo((()=>{const t=function(e,t){let n,r=Ln,o=0,i=!1;function a(){l.onStateChange&&l.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Ln)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}}),[e,r,o,i]),s=Cn.useMemo((()=>e.getState()),[e]);jn((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,s]);const c=t||Tn;return Cn.createElement(c.Provider,{value:a},n)};function Un(e=Tn){const t=e===Tn?kn:Nn(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Fn=Un();function Bn(e=Tn){const t=e===Tn?Fn:Un(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var zn,Hn=Bn();zn=wn.useSyncExternalStoreWithSelector,An=zn,bn.useSyncExternalStore;const $n=()=>Rn(gn);function Vn(){const{startChatIcon:e}=$n();return e}const Kn=({state:e})=>e,Jn=()=>Rn(Kn),Wn=_t(Kn,gn,mn,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),qn=_t(Wn,gn,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=o[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=g(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}})):e})),Gn=()=>Rn(qn),Xn=(_t(qn,(e=>e.map((e=>e.payload.id)))),()=>Jn().isLoading),Yn=()=>Jn().unreadEvents,Qn=()=>Jn().skiplinkTargetId,Zn=()=>Jn().serviceInfo,er=_t(qn,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),tr=()=>{const{participants:e,currentAgent:t}=Jn().participantInfo;return t?e[t]:null},nr=()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=Jn(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},rr=()=>{const{layoutMode:e}=$n();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},or=_t((({visibility:e})=>e),(e=>e.visibility)),ir=_t((({visibility:e})=>e),(e=>e.showInlineView)),ar=[yn.open,yn.minimized,yn.hidden],sr=Xt("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=or(o),a=mn(o),s=n.hasConversation(),c=gn(o),{visibilityCallback:l=_n,layoutMode:u}=c,{unreadEvents:d}=Kn(o),p=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(p&&!ar.includes(p))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),null;if(i===p)return null;const h=n.store.get(vn);return n.store.set(vn,{...h||{},[u]:e}),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:d}),p})),cr=Xt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=gn(n()),i=r.store.get(vn)?.[o]||yn.initialize;return t(sr(i)),i})),lr=Xt("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{let o=n?.context?.contentLocale,i=n?.context?.userLocale;const a=!1!==n.api.sendEnvironment?t.getEnvironment():n.api.sendEnvironment;try{if(t.hasConversation()){const e=await t.getConversationIntitialState();return o=e.context?.contentLocale||o,i=e.context?.userLocale||i,t.sendContext({...e.context,environment:a}),{initialState:e,contentLocale:o,userLocale:i,config:n}}return n?.context?.topic&&t.send("action",{type:U,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),t.sendContext({...n.context,environment:a}),{initialState:void 0,contentLocale:o,userLocale:i,config:n}}catch(e){if(e instanceof l){const e=new l;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new pn;return r({name:t.name,message:t.message,langKey:t.langKey})}})),ur=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:i=!1}=n??{};let a,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return Xt(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise((e=>{a=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(fn()),await t(hn()),await t(lr()),t(cr())}),{wait:2e3,leading:!0}),dr=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],pr=(e,t)=>{const{messages:n,...r}=(o=t,dr.reduce(((e,t)=>(t in o&&(e[t]=o[t]),e)),{}));var o;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},hr=nn({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>pr(e,t),updateConfig:(e,{payload:t})=>pr(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(fn.fulfilled,(e=>e)).addCase(hn.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultUserLocale:i,defaultContentLocale:a}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.userLocale=i,e.context.contentLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:fr,updateConfig:mr,setPreChatEvents:vr}=hr.actions;var yr=hr.reducer;const gr={userHasResponded:!1},_r=nn({name:"app",initialState:gr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>gr)).addCase(lr.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:br}=_r.actions;var wr=_r.reducer;class Cr extends a{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const xr={SeamlyGeneralError:c,SeamlyConfigurationError:s,SeamlySessionExpiredError:l,SeamlyOfflineError:Cr,SeamlyUnauthorizedError:u,SeamlyUnavailableError:pn},Er=Pt("catch-error",(e=>({payload:e}))),Sr={controls:{}},Tr={touched:!1},Nr={controls:Tr},kr=nn({name:"forms",initialState:Nr,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Sr,persistData:t}:{...Sr,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:Tr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(ur.pending,(()=>Nr))}}),{registerForm:Ar,deregisterForm:Ir,registerControl:Or,deregisterControl:Rr,updateControlValue:Lr,updateControlTouched:Pr}=kr.actions;var Mr=kr.reducer;const jr=Xt("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),Dr={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},Ur=nn({name:"app",initialState:Dr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Dr)).addCase(hn.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(jr.pending,(e=>{e.isLoading=!0})).addCase(jr.rejected,(e=>{e.isLoading=!1})).addCase(jr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:Fr,setTranslations:Br}=Ur.actions;var zr=Ur.reducer;const Hr=Xt("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return t.getConversation()}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n[n.length-1],o=e?.lastEvent?.id;return r&&o!==r.payload.id}}),$r={error:void 0},Vr=nn({name:"interrupt",initialState:$r,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>$r},extraReducers:e=>{e.addCase(hn.pending,(()=>$r)).addMatcher(Kt(lr.rejected,hn.rejected,jr.rejected,sr.rejected,cr.rejected,Hr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Kr,clearInterrupt:Jr}=Vr.actions;var Wr=Vr.reducer;const qr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],Gr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===N.message&&!t.fromClient||e===N.info&&t.type===k,Xr=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Yr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:a}=t.participant,s=n[r],c={...n,[r]:s?{...s,...o?{avatar:o}:{},...i?{name:i}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Qr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{},{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,optionsOverride:{},actions:o,translatedActions:i};const{type:a,options:s}=n;let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...a?{[a]:s}:{}},actions:o,translatedActions:i}},Zr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:m(),optionsButtonId:m(),headerCollapseButtonId:m(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:A,active:A,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{},actions:{},translatedActions:{}},seamlyContainerElement:null},eo=nn({name:"store",initialState:Zr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=e.options.features.hasOwnProperty(J);let i={...e.options};if(o&&(n===N.message||n===N.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===I}}}}const a=Gr(t.payload);if(e.events.find((e=>e.payload.id===r.id)))return;const s=Qr(e.entryMeta,t.payload);e.entryMeta=o||s.active!==I?s:{...e.entryMeta},e.options=i,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?R:O)),t.payload.payload.key=m(),e.events.push(t.payload),r.fromClient&&(e.isLastEventFromClient=r.fromClient)},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=Xr(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===O&&{messageStatus:R}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:a}})=>{const s=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant?.introduction))).reverse();return Xr([...r,...n])})(e.events,t),c={...e.participantInfo.participants,...n},l=s.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let u=null;l&&("message"===l.type&&(u=l.payload.participant),"participant"===l.type&&(u=l.payload.participant?.id));const{entry:d}=o,p=d?.options?.upload,h=Qr({...e.entryMeta,...d,active:d?.default||k,options:{...d?.options?d.options:{}}},s[s.length-1]);let f={...e.options.features};const m=f.hasOwnProperty(J);if(m&&"message"===l?.type){const{payload:e}=l,t=e?.entry?.type||{};f={...f,uploads:{enabled:!(!p||!p?.enabled),enabledFromEntry:t===I}}}e.unreadEvents=s.filter((e=>"message"===e.type&&e.payload.messageStatus===O)).length,e.events=s.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...u?Yr(e.participantInfo,{participant:c[u]}):{},participants:c},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,activeServiceSessionId:r,proactiveMessages:o?.proactiveMessages?.enabled||!1},e.serviceData={...e.serviceData,...i},e.options={...e.options,features:f},e.entryMeta=m||h.active!==I?h:{...e.entryMeta},e.resumeConversationPrompt=a||!1,u&&(e.headerTitles.subTitle=c[u].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=_(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=Yr(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Zr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={},e.entryMeta.translatedActions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Zr)).addCase(lr.pending,(e=>{e.isLoading=!0})).addCase(hn.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name,t.features&&(e.options.features=t.features)})).addCase(lr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher(Kt(uo,po),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:to,addEvent:no,clearAllUploads:ro,clearEvents:oo,clearFeatures:io,clearIdleDetachCountdown:ao,clearResumeConversationPrompt:so,decrementIdleDetachCountdownCounter:co,hideOption:lo,initIdleDetachCountdown:uo,initResumeConversationPrompt:po,registerUpload:ho,resetHistoryLoadedFlag:fo,setActiveEntryType:mo,setActiveService:vo,setBlockAutoEntrySwitch:yo,setEventsRead:go,setFeatureEnabledState:_o,setFeatures:bo,setHeaderSubTitle:wo,setHeaderTitle:Co,setHistory:xo,setInitialState:Eo,setIsLoading:So,setLoadedImageEventIds:To,setParticipant:No,setSeamlyContainerElement:ko,setServiceDataItem:Ao,setServiceEntryMetadata:Io,clearAbortTransaction:Oo,setUploadComplete:Ro,setUploadError:Lo,setUploadProgress:Po,startProcessingImage:Mo,doneProcessingImage:jo,setUserEntryType:Do,setUserSelectedOption:Uo,setUserSelectedOptions:Fo,showOption:Bo,stopIdleDetachCountdownCounter:zo,setProactiveMessages:Ho}=eo.actions;var $o=eo.reducer;const Vo={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:Vt(),translatedEventGroups:{},translationProposal:null},Ko=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},o,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter((e=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},Jo=nn({name:"translation",initialState:Vo,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=Ko(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=Ko(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Vo)).addCase(hn.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(xo,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(jr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(no,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Wo,disableTranslation:qo,enableEventsTranslation:Go,disableEventsTranslation:Xo,setTranslationProposalPrompt:Yo,disableTranslationProposalPrompt:Qo}=Jo.actions;var Zo=Jo.reducer,ei=({dispatch:e})=>t=>n=>{const r=t(n);if(xo.match(n)&&n.payload?.translation?.enabled)return e(Wo(n.payload.translation.locale)),e(jr(n.payload.translation.locale)),r;if(hn.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(jr(n.payload.defaultUserLocale)),r;if(lr.fulfilled.match(n))return n.payload.userLocale&&e(jr(n.payload.userLocale)),r;if(no.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(jr(t.translationLocale)),r}return r};const ti=nn({name:"visibility",initialState:{visibility:yn.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(sr.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(hn.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:ni}=ti.actions,ri=Nt({state:$o,app:wr,config:yr,i18n:zr,translations:Zo,visibility:ti.reducer,forms:Mr,interrupt:Wr});function oi({initialState:e,api:t,eventBus:n,config:r}){const o=function(e){const t=Ut(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!St(n))throw new Error(dn(1));s=Nt(n)}if(!Ht&&r&&"function"!=typeof r)throw new Error(dn(2));if("function"==typeof r){if(c=r(t),!Ht&&!Array.isArray(c))throw new Error(dn(3))}else c=t();if(!Ht&&c.some((e=>"function"!=typeof e)))throw new Error(dn(4));let l=kt;o&&(l=Rt({trace:!Ht,..."object"==typeof o&&o}));const u=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(wt(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=kt(...s)(o.dispatch),{...o,dispatch:i}}}(...c),d=zt(u);if(!Ht&&a&&"function"!=typeof a)throw new Error(dn(5));let p="function"==typeof a?a(d):d();if(!Ht&&!Array.isArray(p))throw new Error(dn(6));if(!Ht&&p.some((e=>"function"!=typeof e)))throw new Error(dn(7));return Ht||!c.length||p.includes(u)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),Tt(s,i,l(...p))}({reducer:ri,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:s}=gn(t()),{error:c,type:l}=n,u=xr[c?.name]?new xr[c.name](c):new a(c);r?.(u,{namespace:o,api:i,layoutMode:s,conversationUrl:e.getConversationUrl(),action:l?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Kr.type){if(!qr.includes(r.name))throw new c(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Fo.toString():e.store.set("options",n.payload);break;case Uo.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),ei)});return o}const ii=Hn;var ai=n(5994);function si(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,i=null,a=!1,s=0;for(;s<e.length;){if(a&&(t(e[s])||"{"===e[s]))a=!1,i=e.slice(o,s),"{"===e[s]&&s--;else if(!a&&!t(e[s])){const t="{"===e[s];if(i&&t){const t=ci(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,i=null}else i&&(n.push(i),i=null),a=!0,o=s}s++}return a&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function ci(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function li(e){return ui(e.slice(1,-1),",",3)}function ui(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),ui(a,t,n-1,r)}let di,pi=0;const hi="other";function fi(e,t){let n=0,r="",o=0;const i={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+pi++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}const mi="other",vi=_t((({i18n:e})=>e),(({translations:e})=>e)),yi=_t((({i18n:e})=>e),(({initialLocale:e})=>e)),gi=_t((({i18n:e})=>e),(({userLocale:e})=>e)),_i=_t((({i18n:e})=>e),(({isLoading:e})=>e)),bi=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e))).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,r))return t[r];let o=e(...n);return t[r]=o,o}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=ci(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let i=[],a=e.substring(0,n);a&&i.push(a);let[s,c,l]=li(o),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:i,cases:a}=si(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==di&&di.resolvedOptions().locale===n||(di=new Intl.PluralRules(n));const e=di.select(s);e!==hi&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,hi);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=fi(a[t],s);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:i}=si(t);return e in i?o(i[e],r):mi in i?o(i[mi],r):e}});function wi(){const e=Rn(vi),t=Rn(gi),n=Rn(yi),r=Rn(_i),o=(0,ai.hb)(((n,o={})=>{if(!e)return"";const i=e[n];return i?bi.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]);return{t:o,userLocale:t,initialLocale:n}}const Ci=()=>{const e=ii(),t=Rn(or),n=!!t&&t!==yn.hidden,r=t===yn.open,o=t===yn.minimized,i=(0,ai.hb)((t=>e(sr(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(yn.open)},closeChat:()=>{i(yn.minimized)}}},xi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,o._3)()})=>{const[r,i]=(0,ai.J0)(null),a=!!r?.isIntersecting||!t,s=a&&e,c=([e])=>i(e);return(0,ai.vJ)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:a,containerRef:n}},Ei=()=>Rn(mn),Si=(0,o.q6)(null),Ti=(0,o.q6)(null),Ni=(0,o.q6)(null);var ki=()=>{const e=(0,ai.NT)(Ti);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e};const Ai=()=>{const e=(0,ai.NT)(Si);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},Ii=()=>Ai().store,Oi=()=>{const e=Ai();return(0,ai.hb)((()=>e.hasConversation()),[e])};var Ri=()=>{const e=Ai(),t=ii(),n=ki(),r=Ei(),o=Oi(),{visible:i,setVisibility:a}=Ci(),s=Yn(),c=(0,ai.hb)(((...e)=>{n.emit(...e)}),[n]),l=(0,ai.hb)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s}),e.send("start"),c("ui.start",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s})}),[e,c,o,r,s,i]),u=(0,ai.hb)((async()=>{await t(ur())}),[t]),d=(0,ai.hb)((e=>({type:e,id:m(),transactionId:m(),participant:p,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),h=(0,ai.hb)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,ai.hb)((({body:n,config:r={}})=>{if(""===n.trim())return;const o={...h(n),...r};e.send("message",o),c("message",o),t(no({type:"message",payload:{...o,optimisticallyInjected:!0}}))}),[e,t,c,h]),v=(0,ai.hb)(((e,n=m())=>{t(no({type:"message",payload:{...h(e),transactionId:n}}))}),[t,h]),y=(0,ai.hb)(((e,n,r,o,i,a,s)=>{t(no({type:"message",payload:{type:"upload",id:e,transactionId:n,participant:p,fromClient:!0,occurredAt:r,body:{contentType:o,filename:i,filesize:a,url:s}}}))}),[t]),g=(0,ai.hb)(((e,n=m())=>{t(no({type:"info",payload:{body:{subtype:e},fromClient:!1,fromHistory:!0,id:m(),transactionId:n,type:"divider"}}))}),[t]),_=(0,ai.hb)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==P&&n!==M&&c(`action.${n}`,t)}),[e,c]),b=(0,ai.hb)((t=>{e.sendContext(t)}),[e]),w=(0,ai.hb)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(Eo(e)),e.userResponded&&(t(br(e.userResponded)),a(yn.open)))})).catch((e=>{t(Kr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,a]);return{connect:w,start:l,sendMessage:f,sendAction:_,sendContext:b,reset:u,emitEvent:c,addMessageBubble:v,addUploadBubble:y,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};const Li=()=>{const e=(()=>{const e=(0,ai.NT)(Ni);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,ai.hb)((t=>{t&&e({ariaLive:V,messageText:t})}),[e]),sendAssertive:(0,ai.hb)((t=>{t&&e({ariaLive:$,messageText:t})}),[e])}},Pi=_t((({interrupt:e})=>e),(({error:e})=>e)),Mi=_t(Pi,(e=>Boolean(e)));function ji(){const{t:e}=wi(),t=Rn(Pi);return{hasError:Rn(Mi),meta:(0,ai.Kr)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:i,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}var Di=()=>{const{t:e}=wi(),{isInline:t,isWindow:n,isApp:r}=rr(),{isOpen:o,isVisible:i}=Ci(),a=Rn(ir),{start:s,connect:l,apiConfigReady:u,apiConnected:d}=Ri(),p=(0,ai.li)(!1),{sendAssertive:h}=Li();!function(){const{meta:{originalError:e,action:t}}=ji(),n=ii(),{reset:r}=Ri(),o="SeamlySessionExpiredError"===e?.name,i=(0,ai.li)(0),a=(0,ai.li)(null);(0,ai.vJ)((()=>{if(o&&"reset"===t){if(i.current>=10){a.current=setTimeout((()=>{i.current=0}),1e4);const e=new c;return n(Kr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}}),[t,r,o,n])}(),(0,ai.vJ)((()=>{i&&setTimeout((()=>{h(e("window.srTexts.onLoad"))}),500)}),[i,h,e]),(0,ai.vJ)((()=>{i&&h(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[o,i,h,e]),(0,ai.vJ)((()=>{u&&d||(p.current=!1)}),[u,d]);const f=(0,ai.hb)((async()=>{d||(p.current=!0,await l()),(r||o||i&&t)&&s()}),[d,l,r,t,o,i,s]);(0,ai.vJ)((()=>{!u||p.current||n&&!o||!(!t||i&&a)||f()}),[u,f,t,o,i,n,a])},Ui=0;function Fi(e,t,n,r,i,a){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ui,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(c in s)void 0===l[c]&&(l[c]=s[c]);return o.fF.vnode&&o.fF.vnode(u),u}Array.isArray;var Bi=({children:e})=>(Di(),Fi(o.FK,{children:e})),zi=(0,o.q6)(null);const Hi=(e=0)=>new Promise((t=>{setTimeout(t,e)})),$i=()=>{const{seamlyContainerElement:e}=Jn(),t=ii();return[e,(0,ai.hb)((e=>{t(ko(e))}),[t])]},Vi=e=>(0,ai.hb)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Hi(180);const e="string"==typeof t?document.getElementById(t):t;E(e)}))}),[e]),Ki=()=>{const e=Qn();return Vi(e)},Ji=e=>_t((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function Wi(){const{sendContext:e}=Ri(),t=ii(),n=$n(),r=(0,ai.hb)(((t,n)=>{e({userLocale:t,source:n})}),[e]),o=(0,ai.hb)((()=>{e({userLocale:n.context?.contentLocale}),t(qo())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:a,isAvailable:s,currentLocale:c}=Rn((({translations:e})=>e));return{languages:i,isActive:a,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:o}}const qi=e=>{const t=Rn(Ji(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:o}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:o,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function Gi(){const e=Rn((({translations:e})=>e.containerId));return{id:e,focusContainer:Vi(e)}}function Xi(e){const{languages:t}=Wi();return(0,ai.Kr)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const Yi=()=>{const{isActive:e,languages:t}=Wi(),n=ii(),{sendAction:r}=Ri(),{translationProposal:o}=Rn((e=>e.translations)),{enableTranslations:i}=Wi(),{isOpen:a}=Ci(),{userLocale:s}=wi(),c=o?.proposedLocale,l=Xi(c),u=(0,ai.Kr)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{i(o?.proposedLocale,z)},dismissTranslationProposal:()=>{r({type:D,body:{type:B}}),n(Qo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}},Qi=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e?.split(" "))).flat().filter((e=>e&&e.length)).map((e=>e&&e.indexOf(d)>-1?e:[d,e].join("-"))).join(" "),Zi=()=>$n().appContainerClassNames,ea=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n};var ta=()=>{const e=Ai();return(0,bn.useSyncExternalStore)(ye.subscribe,(()=>e.conversation))},na=(0,o.q6)(null);const ra=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=Jn(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},oa=()=>{const{currentUploads:e}=Jn(),t=ii(),n=(()=>{const e=(0,ai.NT)(na);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,ai.hb)((e=>{n(e)}),[n]),clearUploads:(0,ai.hb)((()=>{t(ro())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},ia=()=>{const{t:e}=wi(),{options:t}=Jn(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:a,sendTranscript:s}=i,c={extraMenuItem:a,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),d=a||s,p=ii(),{get:h,set:f}=Ii();return{allowOptionSelection:d,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,ai.hb)((()=>{const e=h("options")||{};p(Fo(e))}),[h,p]),setUserSelectedOptions:(0,ai.hb)((e=>{p(Fo(e)),f("options",e)}),[f,p]),setUserSelectedOption:(0,ai.hb)(((e,t)=>{const n=h("options")||{};"object"==typeof n&&f("options",{...n,[e]:t}),p(Uo({option:e,value:t}))}),[p,h,f]),showOption:e=>{p(Bo(e))},hideOption:()=>{p(lo())},panelActive:n,optionActive:r}},aa=()=>{const{optionsButtonId:e}=Jn();return{id:e,focusButton:Vi(e)}};var sa=(0,o.q6)(null),ca=()=>{const e=(0,ai.NT)(sa);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},la=()=>{const e=ii(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a}}=Jn(),{isOpen:s}=Ci(),{emitEvent:c,sendAction:l}=Ri(),{t:u}=wi(),{sendAssertive:d,sendPolite:p}=Li(),h=(0,ai.hb)((e=>{s&&d(e)}),[s,d]),f=(0,ai.hb)((e=>{s&&p(e)}),[s,p]),m=(0,ai.hb)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=_(n);e(uo({delaySeconds:n,delayTime:r})),c("idleTimer.start"),h(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,h,u]),v=(0,ai.hb)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:j}),h(u("idleDetachWarning.notifyTransferText"))),a||c("idleTimer.stop"),e(ao()))}),[e,c,t,l,h,u,a]),y=(0,ai.hb)((()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",_(t))}`),e(co())}),[e,o,h,u]),g=(0,ai.hb)((()=>{n&&(e(zo()),o&&(c("idleTimer.stop"),f(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,o,f,u]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a,initCountdown:m,endCountdown:v,decrementCountdown:y,stopCountdown:g}},ua=()=>{const e=ii(),t=Jn().resumeConversationPrompt,{sendAction:n}=Ri(),{t:r}=wi(),{sendAssertive:o}=Li();return{continueChat:()=>{n({type:D,body:{type:"resume_conversation_prompt"}}),e(so())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:j}),e(so())}}};const da=()=>{const[e]=(0,ai.J0)((()=>m()));return e},pa=(e,t)=>{const n=ta();(0,ai.vJ)((()=>{if(n.channel){const{channel:r}=n;r.onMessage=(n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)}}),[e,t,n])};var ha=({eventPayload:e})=>{const{t:t}=wi(),{fromClient:n,participant:r}=e,o=(e=>Jn().participantInfo.participants[e])(r)||{},{messages:i}=$n(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push(Fi("span",{className:Qi("message__avatar"),children:Fi("img",{src:o.avatar,className:Qi("avatar"),alt:""})})),c&&a&&l.push(Fi("span",{className:Qi("message__author-name"),children:a})),l.length>0?Fi("div",{className:Qi("message__author"),children:l}):null},fa=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:i,bodyProps:a={},info:s,...c})=>{const l=ea(t),{hasTranslation:u,isTranslated:d,locale:p}=qi(t);return n&&l.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{l.push(`message--${e}`)}))),d&&l.push("message--is-translated"),u&&l.push("message--has-translation"),d&&(a={...a,lang:p}),Fi(o.FK,{children:Fi("div",{className:Qi(l),...c,children:[e&&Fi(ha,{eventPayload:t.payload}),Fi("div",{className:Qi("message__body"),...a,children:i}),s&&Fi("div",{"aria-hidden":"true",className:Qi("message__info"),children:s})]})})},ma=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,ai.li)(null),{sendMessage:l,sendAction:u,emitEvent:d}=Ri(),p=da(),h=(0,ai.li)(!1),f=t?.type===W?"a":"button",m=(0,ai.hb)((()=>d("action.click_card",{type:F,originMessage:e,action:t})),[d,e,t]),v=(0,ai.hb)((()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:U,body:{name:e,fallbackMessage:n}})}}),[l,t,u,m]),y=(0,ai.Kr)((()=>t?.type===W?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:v}),[t,v,m]);return(0,ai.vJ)((()=>{s&&(o&&h.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),h.current=!0}),[o,s]),Fi("div",{className:Qi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?Fi("img",{className:Qi("card__image"),src:i,alt:""}):null,Fi("div",{className:Qi("card__content"),id:e,children:[a&&Fi("h2",{className:Qi("card__title"),children:a}),r&&Fi("div",{className:Qi("card__description"),dangerouslySetInnerHTML:{__html:r}}),Fi(f,{tabIndex:s&&!o?-1:void 0,className:Qi("button","button--primary"),"aria-describedby":p,...y,children:n})]})]})};function va({item:e,items:t,index:n,isActive:r}){const{t:o}=wi();return Fi("div",{className:Qi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:Fi(ma,{...e,isCarouselItem:!0,hasFocus:r})})}const ya={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}};var ga=({name:e,size:t="32",className:n,alt:r})=>Fi(o.FK,{children:[Fi("div",{"aria-hidden":"true",className:n||Qi("icon"),dangerouslySetInnerHTML:{__html:ya[e][t]}}),r&&Fi("span",{className:Qi("visually-hidden"),children:r})]});function _a({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=wi(),i=e.length;return Fi("div",{className:Qi("carousel-controls"),children:[Fi("button",{className:Qi("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:Fi(ga,{name:"arrowLeft",size:"16",alt:""})}),r,Fi("button",{className:Qi("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:Fi(ga,{name:"arrowRight",size:"16",alt:""})})]})}function ba({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,ai.hb)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return Fi("div",{className:Qi("carousel-pagination__wrapper"),role:"group",children:Fi("ul",{className:Qi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return Fi("li",{className:Qi("carousel-pagination__item",i?"is-active":void 0),children:Fi("button",{className:Qi("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const wa=(e,t,n)=>`${n}${t}`,Ca=e=>e.label,xa=({target:e})=>{e.scrollLeft=0};function Ea({currentIndex:e=0,onChange:t=(()=>{}),getItemKey:n=wa,getItemLabel:r=Ca,items:i}){const a=da(),s=i.length,[c,l]=(0,ai.J0)(Number(e||0));(0,ai.vJ)((()=>{l(Number(e||0))}),[l,e]);const u=(0,ai.li)([]);u.current=(0,ai.Kr)((()=>Array(s).fill(1).map((()=>(0,o._3)()))),[s]);const d=(0,ai.li)(!0),p=(0,ai.li)(null);return p.current=t,(0,ai.vJ)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),Fi("div",{className:Qi("carousel"),role:"group","aria-roledescription":"carousel",children:[Fi("div",{className:Qi("carousel__slides-wrapper"),onScroll:xa,children:Fi("div",{id:a,className:Qi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return Fi("div",{ref:u.current[t],className:Qi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:Fi(va,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),Fi("div",{className:Qi("carousel__controls"),children:Fi(_a,{currentIndex:c,items:i,onChange:l,children:Fi("div",{className:Qi("carousel__pagination"),children:Fi(ba,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const Sa=(e,t,n="")=>`${n}${e.title}:${t}`,Ta=e=>e.title;const Na=e=>{const{payload:t}=e,[n,r]=(0,ai.J0)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=Ri(),{activeServiceSessionId:s}=Zn(),c=Rn(er),{body:l}=qi(e),{service:u}=t,d=(0,ai.Kr)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,ai.vJ)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=m();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};const ka=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`;var Aa=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,ai.Kr)((()=>["suggestions__item",...t.map(ka)]),[t]),a=(0,ai.hb)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return Fi("li",{className:Qi(i),children:Fi("button",{type:"button",onClick:a,className:Qi("button","button--primary"),children:[o&&Fi(ga,{name:"chevronRight",size:"8",alt:""}),n]})})},Ia=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>Fi("ul",{className:Qi("suggestions__list",e||""),children:t.map((e=>Fi(Aa,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),Oa=e=>{const{sendAction:t}=Ri();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}},Ra=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:i,iconClassName:a,dividerType:s,title:c,description:l})=>{const u=Boolean(o||n);return Fi("div",{className:Qi("divider",s&&`divider--type-${s}`,t),children:[u&&Fi("span",{className:Qi("divider__graphic"),children:o?Fi(ga,{name:o,size:i,className:a,alt:""}):Fi("img",{src:n,className:Qi({icon:"icon"===r,avatar:"avatar"===r},a)})}),Fi("div",{className:Qi("divider__body"),children:[c?Fi("h2",{className:Qi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?Fi("p",{className:Qi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})};const La={[K.new_topic]:"new-topic"};const Pa={default:({event:e})=>{const{t:t}=wi(),{subtype:n}=e.payload.body;return K[n]?Fi(Ra,{dividerType:La[K[n]],iconName:K[n],title:t(`dividerKeys.${K[n]}`)}):null},[K.new_translation]:({event:e})=>{const{t:t}=wi(),n=Gn(),{body:{translationEnabled:r,text:i,title:a},id:s}=e.payload,c=Rn((e=>e.translations.translatedEventGroups)),l=ii(),u=(0,ai.hb)((()=>{c[s]?l(Go({events:n,id:s})):l(Xo({events:n,id:s}))}),[l,n,s,c]);return Fi(Ra,{iconName:"newTranslation",dividerType:"new-translation",title:a,description:i,children:r?Fi(o.FK,{children:Fi("button",{className:Qi("button","button--secondary"),onClick:u,children:t(c[s]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}};const Ma={month:"long",day:"numeric",year:"numeric"},ja={hour:"numeric",minute:"numeric"};var Da=({event:e})=>{const t=(()=>{const[e,t]=(0,ai.WO)((e=>e+1),0);return(0,ai.hb)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t:t}=wi(),n=$n(),r=n?.context?.userLocale??[],o=new Date(e),i=new Date,a=new Date(i);a.setHours(24,0,0,0);const s=a.valueOf()-i.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ja).format(o);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(o,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Ma).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(g(e.payload.timeIndicator));return(0,ai.vJ)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),Fi(Ra,{dividerType:"time-indicator",children:[Fi("h2",{className:Qi("divider__time"),"aria-hidden":"true",children:[Fi("span",{className:Qi("divider__time--date"),children:n}),Fi("span",{className:Qi("divider__time--time"),children:r})]}),Fi("p",{className:Qi("visually-hidden"),children:i})]})},Ua=["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])"],Fa=Ua.join(","),Ba="undefined"==typeof Element,za=Ba?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ha=!Ba&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$a=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Va=function(e,t,n){if($a(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Fa));return t&&za.call(e,Fa)&&r.unshift(e),r.filter(n)},Ka=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!$a(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{za.call(a,Fa)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!$a(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Ja=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Wa=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ja(e)?0:e.tabIndex},qa=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ga=function(e){return"INPUT"===e.tagName},Xa=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ya=function(e,t){return!(t.disabled||$a(t)||function(e){return Ga(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=za.call(e,"details>summary:first-of-type")?e.parentElement:e;if(za.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Xa(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Ha(e);if(a&&!a.shadowRoot&&!0===r(a))return Xa(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&Ha(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=i=Ha(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!za.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Qa=function(e,t){return!(function(e){return function(e){return Ga(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ha(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Wa(t)<0||!Ya(e,t))},Za=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},es=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Wa(e);return n<0&&t&&!Ja(e)?0:n}(a,i),c=i?e(t.candidates):a;0===s?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(qa).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ts=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==za.call(e,Fa)&&Qa(t,e)},ns=Ua.concat("iframe").join(","),rs=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==za.call(e,ns)&&Ya(t,e)};function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){var r,o,i;r=e,o=t,i=n[t],o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var as=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},ss=function(e){return as(e)&&!e.shiftKey},cs=function(e){return as(e)&&e.shiftKey},ls=function(e){return setTimeout(e,0)},us=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},ds=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},ps=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},hs=[],fs=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||hs,i=is({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ss,isKeyBackward:cs},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find((function(t){return t===e}))}))},l=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!rs(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ka([e],t.includeContainer,{filter:Qa.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Za}):Va(e,t.includeContainer,Qa.bind(null,t)),es(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Ka([e],t.includeContainer,{filter:Ya.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Va(e,t.includeContainer,Ya.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find((function(e){return ts(e)})),s=n.slice().reverse().find((function(e){return ts(e)})),c=!!t.find((function(e){return Wa(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find((function(e){return ts(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return ts(e)})):t[o+(r?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(e){return e.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},h=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},f=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||ps(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var h=us(a.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(h<0&&(p.container===t||rs(t,i.tabbableOptions)&&!ts(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=u),h>=0){var f=0===h?a.tabbableGroups.length-1:h-1,m=a.tabbableGroups[f];s=Wa(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else as(n)||(s=p.nextTabbableNode(t,!1))}else{var v=us(a.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(v<0&&(p.container===t||rs(t,i.tabbableOptions)&&!ts(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(v=u),v>=0){var y=v===a.tabbableGroups.length-1?0:v+1,g=a.tabbableGroups[y];s=Wa(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else as(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},v=function(e){var t=ps(e);c(t,e)>=0||(ds(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):ds(i.allowOutsideClick,e)||e.preventDefault())},y=function(e){var t=ps(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Wa(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===a.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return Wa(e)>0}))}))||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),h(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===ds(i.escapeDeactivates,e)))return e.preventDefault(),void n.deactivate();var t;(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(as(e)&&e.preventDefault(),h(n))}(e,i.isKeyBackward(e))},_=function(e){var t=ps(e);c(t,e)>=0||ds(i.clickOutsideDeactivates,e)||ds(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},b=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?ls((function(){h(u())})):h(u()),r.addEventListener("focusin",y,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",_,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),n},w=function(){if(a.active)return r.removeEventListener("focusin",y,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",_,!0),r.removeEventListener("keydown",g,!0),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===a.mostRecentlyFocusedNode}))}))&&h(u())})):void 0,x=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),b(),x(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=is({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,w(),a.active=!1,a.paused=!1,x(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(o,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ls((function(){u&&h(f(a.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(f(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),w(),x(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),b(),x(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),a.active&&d(),x(),this}},n.updateContainerElements(e),n},ms=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const a=da(),s=(0,ai.li)(null),c=(0,ai.li)(null),[l,u]=(0,ai.J0)(!1);return(0,ai.vJ)((()=>(l&&s.current&&(c.current=fs(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,ai.vJ)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(null!==r&&e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[l]),(0,ai.vJ)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,ai.Nf)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,a]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,o.XX)(e,s.current)}):s.current&&(0,o.XX)((0,o.v2)(e).filter(T).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},vs=({url:e,description:t,onClose:n})=>{const r=$n(),o=ca(),i=Zi(),a=(0,ai.li)(null),{t:s}=wi(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return Fi(ms,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>Fi("div",{className:Qi(c),onClick:u,style:d,children:Fi("div",{className:Qi("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[Fi("div",{className:Qi("modal__inner"),onClick:l,children:Fi("img",{className:Qi("modal__image"),src:e,alt:t})}),Fi("button",{type:"button",className:Qi("modal__close"),onClick:n,children:[Fi(ga,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},ys=({description:e,url:t})=>{const{t:n}=wi(),[r,i]=(0,ai.J0)(!1);return Fi(o.FK,{children:[Fi("button",{type:"button",className:Qi("modal__enlarge"),onClick:()=>{i(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),Fi(ga,{name:"enlarge",size:"32",alt:""})]}),r&&Fi(vs,{url:t,description:e,onClose:()=>{i(!1)}})]})},gs=({event:e,...t})=>{const{body:n}=qi(e),r=Oa(e.payload.id),o=(0,ai.Kr)((()=>e.payload.optimisticallyInjected?{children:Fi("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return Fi(fa,{type:"text",event:e,onClick:r,...t,...o})};const _s="PROCESSING_IMAGE",bs=({img:e,filename:t})=>{const{t:n}=wi(),r=n("fileUpload.srFileUploadedText",{fileName:t});return Fi(o.FK,{children:Fi("span",{className:Qi(["download","download--preview"]),children:[Fi("img",{src:e,alt:r}),Fi("span",{"aria-hidden":"true",className:Qi("file-download"),children:t})]})})},ws=({children:e,url:t,target:n})=>t?Fi("a",{href:t,download:!0,target:n,className:Qi(["download","download-link"]),children:e}):Fi("span",{className:Qi("download"),children:e});const Cs={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=wi(),i=da(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=Na(e);return Fi(o.FK,{children:[(0,o.v2)(t).filter(T).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&Fi("button",{type:"button",className:Qi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),Fi(ga,{name:"chevronDown",size:"8",alt:""})]}),c&&Fi(fa,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:Fi("ul",{className:Qi("choice-prompt","choice-prompt--many"),children:a?.choices?.map((e=>Fi("li",{className:Qi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:gs,image:({event:e,descriptorId:t,...n})=>{const{body:r}=qi(e),[o,i]=(0,ai.J0)(!1),a=ii();return Fi(fa,{event:e,type:"image",...n,children:[Fi("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(To(e.payload.id)),i(!0)}}),r?.isZoomable&&o&&Fi(ys,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=qi(e),o=Oa(n.id);return Fi(fa,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=qi(e);return ea(e).push("message--type-video"),Fi(fa,{event:e,type:"video",...n,children:[Fi("div",{id:t,className:Qi("visually-hidden"),children:r?.description}),Fi("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=wi(),{body:r}=qi(e),{fromClient:o,id:i}=e.payload,{filename:a,url:s}=r,c=(e=>{const{processingFileUploads:t}=Rn((({state:e})=>e));return(0,ai.Kr)((()=>{if(t.some((t=>t===e)))return _s;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),l=(0,ai.Kr)((()=>n(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,n]);return Fi(fa,{event:e,type:"upload",...t,children:c&&c!==_s?Fi(bs,{img:c,filename:a}):Fi(ws,{url:s,target:o?void 0:"_blank",children:[Fi(ga,{name:"download",size:"16",alt:l}),Fi("span",{"aria-hidden":"true",className:Qi("file-download"),children:a})]})})},cta:({event:e})=>{const{body:t}=qi(e),n=Oa(e.payload.id),{emitEvent:r}=Ri(),o=da(),i=(0,ai.hb)((()=>r(`action.${F}`,{type:F,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return Fi(fa,{type:"cta",event:e,children:[Fi("div",{className:Qi("cta__content"),id:o,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),Fi("a",{className:Qi("button","button--primary"),"aria-describedby":o,href:t?.buttonLink,rel:"noreferrer",target:t?.buttonNewTab?"_blank":"_self",onClick:i,children:t?.buttonText})]})},carousel:({event:e})=>{const{body:t}=qi(e),n=t.cards;return Fi(fa,{event:e,modifiers:"type-carousel",children:Fi(Ea,{items:n,getItemKey:Sa,getItemLabel:Ta})})},card:({event:e})=>{const{body:t}=qi(e),n=da();return Fi(fa,{type:"card",event:e,children:Fi(ma,{id:n,...t})})}},info:{text:gs,divider:({event:e,...t})=>Fi(Pa[K[e.payload.body.subtype]]||Pa.default,{event:e,...t}),translation:({event:e,...t})=>{const{t:n}=wi(),{body:r}=qi(e);return Fi(fa,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Da},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},o=!!t,i=Rn(Ji(e));return{body:i&&o?t:r,hasTranslation:o,isTranslated:i&&o,locale:n?.locale}})(e);return n?Fi(Ra,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,ai.J0)(!0),o=ii(),i=Ei(),{sendAction:a,addMessageBubble:s}=Ri(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=qi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=$n(),d=Gn(),{t:p}=wi(),h=p("suggestions.headingText"),f=p("suggestions.footerText"),m=(0,ai.Kr)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),v=(0,ai.hb)((({id:e,question:t})=>{r(!1),o(br(!0)),a({type:L,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),s(t)}),[o,a,l.id,s]);return n&&!i&&m&&u?Fi("div",{className:Qi("suggestions","suggestions--conversation"),children:[h&&Fi("p",{className:Qi("suggestions__heading"),children:h}),Fi(fa,{type:"suggestions",showParticipant:!1,event:e,...t,children:[Fi(Ia,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:c}),f&&Fi("p",{className:Qi("suggestions__footer"),children:f})]})]}):null}}};var xs=({children:e})=>{const{customComponents:t}=$n(),n=(0,ai.Kr)((()=>Object.keys(Cs).reduce(((e,n)=>(e[n]={...Cs[n],...t?t[n]:{}},e)),{fallback:gs})),[t]);return Fi(zi.Provider,{value:n,children:e})},Es=({children:e})=>{const{isMinimized:t}=Ci(),n=(0,ai.li)(0),{sendAction:r}=Ri(),{hasCountdown:o,isActive:i,stopCountdown:a}=la(),s=(0,ai.hb)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(s(),a()),e-n.current>15e3&&s()}),[r,o,i,a,t]);return Fi("div",{className:Qi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:Fi(sa.Provider,{value:s,children:e})})};const Ss=["text","choice_prompt","image","video"];var Ts=()=>{const e=ta(),t=(0,ai.li)(),n=(0,ai.li)(),r=ii(),o=ki(),i=(0,ai.li)(null),{initCountdown:a,endCountdown:s}=la(),{emitEvent:u}=Ri();return(0,ai.vJ)((()=>{if(e.socket){const{socket:t}=e;t.onError((e=>{const t=new Cr(e);r(Kr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(oo())})),t.onOpen((()=>{r(Jr())}))}}),[e,r]),(0,ai.vJ)((()=>{e.socket&&e.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new c;return r(Kr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}))}),[e,r]),(0,ai.vJ)((()=>{const t=e=>{if("participant"!==e.type)return;const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(wo(o.name)),r(No({participant:o,fromClient:n})),"string"!=typeof o&&o.introduction&&r(no(e))};e.onConnection((({connected:n})=>{const{channel:i}=e;return!(!n||!i||(i.onMessage=(e,n)=>{const i={type:e,payload:n};switch(e){case"ui":switch(n.state&&n.state.hasOwnProperty("loading")&&r(So(n.state.loading)),n.type){case"idle_detach_countdown":a(n.body.duration);break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(po());break;case"translation_proposal":r(Yo(n.body));break;case"user_first_response":r(br(!0)),o.emit("system.userFirstResponse",n.body)}break;case"context":n.contentLocale&&n.userLocale&&r(jr(n.userLocale));break;case"message":switch(t(n),n.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":n.service&&n.service.serviceSessionId&&r(vo(n.service.serviceSessionId)),r(no(i))}break;case"participant":t(i);break;case"service_data":n.persist&&r(Ao(n));break;case"ack":r(to(i));break;case"system":if("service_changed"===n.type){const{serviceSettings:e,...t}=n,{entry:o,proactiveMessages:i}=e,{upload:a}=o.options;r(_o({key:J,enabled:!(!a||!a.enabled)})),r(Ho(i.enabled||!1)),r(Io(o)),n.serviceSessionId&&r(vo(n.serviceSessionId)),u("system.serviceChanged",t)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||r(no(i));break;case"error":switch(n.type){case"find_conversation_erred":const e=new l(i);r(Kr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":case"attach_channel_erred":const t=new c(i);r(Kr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return n},1))}))}),[e,r,u,s,o,a]),(0,ai.vJ)((()=>{e.onConnection((({connected:t})=>{const{channel:r}=e;return!(!t||!r||(n.current&&r.off("message",n.current),n.current=r.on("message",(e=>Ss.includes(e.type)?(e.id!==i.current&&o.emit("message",e),i.current=e.id,e):e)),0))}))}),[e,o]),(0,ai.vJ)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.channel?.off("sync",t.current),t.current=e.channel?.on("sync",(async e=>{try{const t=await r(Hr(e)).unwrap();if(!t)return;r(xo(t))}catch(e){}})),!0)))}),[e,r]),null},Ns=({children:e})=>{const{t:t}=wi(),n=ii(),r=Ai(),{addUploadBubble:o}=Ri(),i=(0,ai.hb)((async(e,t)=>{n(Mo(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>"string"==typeof r.result?t(r.result):void 0,r.onerror=e=>n(e)})))(e),o=new Image;o.src=r,await o.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(jo(t))}}),[n]),a=(0,ai.hb)((e=>{const a=m(),s=r.uploadFile(e,(e=>{n(Po({fileId:a,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d,url:p}}=t;n(Ro(a)),o(r,s,c,l,u,d,p),await i(e,r)}),(e=>{let r;switch(e?.error||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Lo({fileId:a,errorText:r}))}));n(ho({fileId:a,fileName:e.name,uploadHandle:s}))}),[i,o,r,n,t]);return Fi(na.Provider,{value:a,children:e})},ks=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=la();return((e,t)=>{const n=(0,ai.li)(e);(0,ai.vJ)((()=>{n.current=e}),[e]),(0,ai.vJ)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},As=()=>{const{initUserSelectedOptions:e}=ia(),t=(0,ai.li)(!1),n=$n();return(0,ai.vJ)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function Is(e,t,n=[]){const r=ki(),o=(0,ai.li)(t);(0,ai.vJ)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}var Os=()=>{const e=$n(),{sendMessage:t,sendContext:n,sendAction:r}=Ri(),o=ii(),{setVisibility:i,visible:a}=Ci(),s=(0,ai.li)(a),c=ki(),l=Ai(),u=Yn(),d=(0,ai.li)(null),h=(0,ai.li)(null),{isInline:f,isResolving:m}=rr(),v=Rn(Mi),y=(()=>{const{get:e}=Ii();return e?e("conversationUrl"):null})(),g=(0,ai.li)(null),_=ca(),{enableTranslations:b,disableTranslations:w}=Wi();return(0,ai.vJ)((()=>{s.current=a}),[a]),Is("askText",(e=>{t({body:e})}),[l.send]),Is("setVariables",(e=>{n({variables:e})}),[l.send]),Is("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),Is("setVisibility",(e=>{Object.values(yn).includes(e)?(_(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),Is("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Is("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(mr({showSuggestions:!1})),e&&t?r({type:U,body:{name:e,fallbackMessage:t,participant:n?p:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Is("setContext",(e=>{n(e)}),[l.send]),Is("setTranslation",(({enabled:e,locale:t})=>{e?b(t,H):w()}),[l.send]),(0,ai.vJ)((()=>{m||v||(g.current&&g.current!==y&&c.emit("unreadMessageCount",u),a===yn.open&&a!==h.current&&0!==d.current&&c.emit("unreadMessageCount",0),a!==yn.open&&u!==d.current&&c.emit("unreadMessageCount",u),h.current=a,d.current=u,"string"==typeof y&&(g.current=y))}),[u,a,c,f,m,v,y]),null},Rs=({children:e})=>{const t=ki(),n=(0,ai.li)(null),[r,o]=(0,ai.J0)(),i=(0,ai.li)(!0),a=(0,ai.hb)((e=>{i.current&&(o(e),t.emit("aria-live",e))}),[o,t]);return(0,ai.vJ)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{a({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,a]),(0,ai.vJ)((()=>()=>{i.current=!1}),[]),Fi(Ni.Provider,{value:a,children:[e,Fi("div",{className:Qi("app__live-container"),children:[Fi("div",{"aria-live":"assertive","aria-atomic":"true",className:Qi("visually-hidden"),children:r?.ariaLive===$?r?.messageText:null}),Fi("div",{"aria-live":"polite","aria-atomic":"true",className:Qi("visually-hidden"),children:r?.ariaLive===V?r?.messageText:null})]})]})},Ls=()=>{const{t:e}=wi(),t=Gn(),n=(0,ai.li)(0),r=(0,ai.li)(0),o=Jn().historyLoaded,{sendPolite:i}=Li(),{isOpen:a}=Ci(),s=(0,ai.li)(null),c=(0,ai.li)(null),l=(0,ai.Kr)((()=>y((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,ai.vJ)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,ai.vJ)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,ai.vJ)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},Ps=()=>{const{t:e}=wi(),{isOpen:t,isVisible:n}=Ci(),r=Yn(),{sendPolite:o}=Li(),i=(0,ai.Kr)((()=>y(o,2e3)),[o]),a=(0,ai.li)(null),s=(0,ai.li)(null);return(0,ai.vJ)((()=>{a.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n}),[r,t,n,i,e]),null},Ms=({store:e,children:t,eventBus:n,api:r})=>((0,ai.Md)((t=>{console.error(t),e.dispatch(Er(t))})),Fi(Dn,{store:e,children:Fi(Ti.Provider,{value:n,children:Fi(Si.Provider,{value:r,children:Fi(Rs,{children:Fi(Bi,{children:Fi(xs,{children:[Fi(As,{}),Fi(Ts,{}),Fi(Ps,{}),Fi(Ls,{}),Fi(ks,{}),Fi(Es,{children:[Fi(Os,{}),Fi(Ns,{children:t})]})]})})})})})}));const js=_t(qn,(e=>e.filter((e=>Gr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===O)))),Ds=_t([js],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),Us=_t(js,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),Fs=_t((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled));var Bs=()=>{const{t:e}=wi(),{showDisclaimer:t}=$n();return t?Fi("div",{className:Qi("disclaimer"),tabIndex:0,children:[Fi("h2",{className:Qi("disclaimer__title"),children:e("disclaimer.title")}),Fi("div",{className:Qi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null};const zs=_t([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),Hs=_t(zs,(e=>e?.controls||{})),$s=_t(Hs,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Vs=_t([Hs,(e,{name:t})=>t],((e,t)=>e[t]?.value)),Ks=_t([Hs,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),Js=(0,o.q6)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Ws,Consumer:qs}=Js;var Gs=Js;function Xs(){return(0,ai.NT)(Gs)}function Ys(e){const t=ii(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Xs(),a=!!Rn((e=>zs(e,{formId:n}))),s=Rn((t=>Vs(t,{formId:n,name:e}))),c=Rn((t=>Ks(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,ai.vJ)((()=>{a&&t(Or({formId:n,name:e}))}),[a,n,e,t]),(0,ai.Nf)((()=>()=>{t(Rr({formId:n,name:e}))}),[a,n,e,t]);const d=(0,ai.hb)((t=>r(e,t.target.value)),[e,r]),p=(0,ai.hb)((()=>{o(e,!0)}),[o,e]);return[(0,ai.Kr)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,ai.Kr)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Qs(e){const{t:t}=wi(),{sendAssertive:n}=Li(),{hasLimit:r,limit:o}=nr(),i=(0,ai.Kr)((()=>y(n,f)),[n]),a=(0,ai.Kr)((()=>y(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),f)),[i,t]),[{value:s}]=Ys(e),c=o&&r&&s?o-s.length:o,l=!(!r||!c)&&c<=h,u=!(!r||!c)&&c<0;return(0,ai.vJ)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const Zs=e=>{const{hasCharacterLimit:t,characterLimit:n}=Qs(e),{entryMeta:{optionsOverride:{text:r}}}=Jn(),{t:o}=wi();return{placeholder:(0,ai.Kr)((()=>o("input.inputPlaceholder",{hasLimit:t,text:r?.placeholder||o("input.inputPlaceholderText"),limit:t?n:null})),[o,t,n,r?.placeholder]),label:(0,ai.Kr)((()=>o("input.inputLabel",{hasLimit:!r?.label&&t,text:r?.label||o("input.inputLabelText"),limit:!r?.label&&t?n:null})),[o,t,n,r?.label]),labelClass:(0,ai.Kr)((()=>r?.label?"label":"visually-hidden"),[r?.label])}};function ec(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=ii(),{entryMeta:{actions:t,translatedActions:n}}=Jn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(Oo())}}})(),n=Ai();return e?Fi("li",{className:Qi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:Fi("button",{className:Qi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:U,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const tc=(0,o.q6)(null),nc=()=>{const e=(0,ai.NT)(tc);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e};var rc=tc,oc=e=>{const t=(()=>{const e=(0,ai.NT)(zi);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,o]},ic=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=nc(),{sendAction:o}=Ri(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:s}=xi({containerRef:i,freezeOnceVisible:!0}),c=ii(),[l,u]=oc(e);if((0,bn.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(go(t)),o({type:M,events:t})}}),[c,e.payload.id,s,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),Fi("li",{className:Qi(d),ref:a,children:[e.payload.timeIndicator&&Fi(Da,{event:e}),Fi(l,{event:e,children:Fi(u,{event:e})})]})},ac=()=>{const{id:e}=tr()||{};return Fi("li",{className:Qi("conversation__item","conversation__item--source-agent"),children:Fi("div",{className:Qi("message","message--source-agent","message--type-loading"),children:[Fi(ha,{eventPayload:{fromClient:!1,participant:e}}),Fi("div",{className:Qi("message__body"),children:Fi("span",{className:Qi("loader"),children:[Fi("span",{className:Qi("loader__part","one")}),Fi("span",{className:Qi("loader__part","two")}),Fi("span",{className:Qi("loader__part","three")}),Fi("span",{className:Qi("loader__part","four")})]})})]})})};const sc=()=>{const e=Gn();let t;return Fi(o.FK,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return Fi(ic,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})};var cc=()=>{const{t:e}=wi(),t=Xn(),n=((e,t=20)=>{const[n,r]=(0,ai.J0)(e),o=(0,ai.li)(null);return(0,ai.vJ)((()=>(o.current=setTimeout((()=>r(e)),t),()=>{o.current&&clearTimeout(o.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=Ci(),i=Qn(),a=Ki();return Fi(o.FK,{children:[r&&Fi("a",{className:Qi("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),Fi("div",{className:Qi("chat__body"),children:Fi("div",{className:Qi("conversation__container"),children:[Fi(Bs,{}),Fi("ol",{className:Qi("conversation"),children:[Fi(xs,{children:Fi(sc,{})}),n?Fi(ac,{}):null,Fi(ec,{})]})]})})]})};function lc(e,t){const n=(0,ai.li)(null),r=(0,ai.li)(e);return(0,ai.vJ)((()=>{r.current=e}),[e]),(0,ai.vJ)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const uc={visible:Qi("transition--visible"),in:Qi("transition--in"),visuallyHidden:Qi("visually-hidden")},dc=Object.values(uc),pc=e=>{const t=(0,ai.li)(null);t.current=e;const n="function"==typeof e;return(0,ai.Kr)((()=>n?(...e)=>t.current(...e):void 0),[n])},hc={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"};var fc=({children:e,isActive:t,timeout:n=300,transitionStartState:r=hc.notRendered,onInTransitionComplete:i=(()=>{}),onOutTransitionComplete:a=(()=>{}),exitAfter:s,enterDelay:c=0})=>{const l=(0,ai.li)(!1),u=(0,ai.li)(null),d=(0,ai.li)(null),p=r===hc.visuallyHidden,[h,f]=(0,ai.J0)((()=>p?[uc.visuallyHidden]:[])),[m,v]=(0,ai.J0)((()=>0===c)),y=(0,ai.Kr)((()=>s?s+c:s),[c,s]);lc((()=>v(!1)),t?y:void 0),lc((()=>v(!0)),t?c:void 0);const g=(0,ai.Kr)((()=>m&&t),[t,m]),_=pc(i),b=pc(a),w="notRendered"!==r||h.length>0;return(0,ai.vJ)((()=>(l.current&&!g&&(f([uc.visible]),u.current=setTimeout((()=>{f([...p?[uc.visuallyHidden]:[]]),b&&(d.current=requestAnimationFrame((()=>{b()})))}),n)),!l.current&&g&&(f([uc.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{f([uc.visible,uc.in]),_&&(u.current=setTimeout((()=>{_()}),n))}))}))),l.current=g,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,_,b,n,g]),Fi(o.FK,{children:w&&(0,o.v2)(e).filter(T).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!dc.includes(e)));return(0,o.Ob)(e,{className:[...n,...h].join(" ")})}))})},mc=({isAside:e=!1})=>{const{isInline:t}=rr(),{t:n}=wi(),{sendAction:r,addMessageBubble:o}=Ri(),{isOpen:i,setVisibility:a}=Ci(),{showSuggestions:s}=$n(),c=da(),l=Ki(),u=(0,ai.li)(null),{sendPolite:d}=Li(),p=Rn(Mi),{hasCountdown:h,endCountdown:f}=la(),{hasPrompt:m,continueChat:v}=ua(),y=Ei(),g=Jn().serviceData.suggestion;const{body:_}=qi({payload:g,type:"service_data"}),b=(0,ai.Kr)((()=>p?[]:Array.isArray(_)?_:_?.data),[_,p]),w=(0,ai.li)(),C=(0,ai.li)(!1),x=(0,ai.li)(),E=!!b?.length,T=t?(y||i)&&!e:y,N=(0,ai.li)(T),k=E&&!T&&s,A=E?b:x.current;x.current=A;const I=(0,ai.Kr)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Qi(t)}),[e]),O=(0,ai.hb)((({id:e,question:t})=>{h&&f(!0),m&&v(),r({type:L,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||a(yn.open),l()}),[o,v,f,l,h,m,g,r,a,i]);(0,ai.vJ)((()=>{if(w.current!==b&&!T){if(E){const e=C.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else C.current&&d(n("suggestions.srUnavailableText"));w.current=b}!N.current&&T?(S(u.current,l),d(n("suggestions.srUnavailableText"))):!E&&C.current&&S(u.current,l),C.current=E,N.current=T}),[b,E,T,l,d,n]);const R=n("suggestions.headingText"),P=n("suggestions.footerText"),M=R?"section":"div";return Fi(fc,{isActive:!!k,transitionStartState:hc.notRendered,children:Fi(M,{className:I,"aria-labelledby":R?c:void 0,ref:u,children:[R&&Fi("p",{id:c,className:Qi("suggestions__heading"),children:R}),!!A&&Fi(Ia,{suggestions:A,onClickSuggestion:O}),P&&!i&&Fi("p",{className:Qi("suggestions__footer"),children:P})]})})};const vc=(0,bn.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=Ci(),{namespace:a,layoutMode:s}=$n(),{isInline:c}=rr(),l=Zi(),u=Ei(),{t:d}=wi(),p=["chat",`chat--layout-${s}`,`namespace--${a}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),o&&Fi("section",{className:Qi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(yn.minimized)},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[Fi("div",{className:Qi("chat-wrapper"),children:e}),"inline"===s&&r&&Fi(mc,{isAside:!0})]})}));var yc=vc,gc=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=da();return Fi("section",{tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:Qi("chat-status",n?void 0:"chat-status--condensed"),children:[Fi("div",{className:Qi("chat-status__body"),children:[n?Fi("h2",{className:Qi("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&Fi("button",{type:"button",onClick:t,className:Qi("button","button--tertiary","chat-status__close"),children:[r||Fi(ga,{name:"close",size:"16",alt:""}),o&&Fi("span",{className:Qi("visually-hidden"),children:o})]})]})},_c=({handleClick:e,icon:t,title:n,srButtonText:r})=>Fi("button",{type:"button",onClick:e,className:Qi("button","button--primary","chat-status__button"),children:[Fi(ga,{name:t,size:"16",alt:""}),n,r&&Fi("span",{className:Qi("visually-hidden"),children:r})]});function bc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=Yi(),{id:o}=Gi();return e&&t?Fi(gc,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:Fi(_c,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function wc(){const e=Rn(Mi),{isActive:t}=Wi();return e||t?null:Fi(bc,{})}var Cc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:i})=>Fi("li",{className:Qi([i||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o,children:[Fi(ga,{name:"check",size:"16",alt:""}),e," ",n&&Fi("span",{children:["(",n,")"]})]}),xc=({onChange:e,describedById:t})=>{const{context:n}=$n(),r=(0,bn.useMemo)((()=>n?.contentLocale),[n?.contentLocale]),{t:o}=wi(),{languages:i,currentLocale:a,enableTranslations:s,disableTranslations:c}=Wi(),l=Ki(),u=t=>()=>{t===a||r===t?c():s(t,"translation_choice"),e(),l()},{primaryLanguages:d,remainingLanguages:p}=(0,bn.useMemo)((()=>i.reduce(((e,t)=>{const n=t.locale===r,o=((e,t,n)=>t===e.locale||!t&&n)(t,a,n);t.locale!==r&&e.remainingLanguages.push({...t,checked:o,isOriginal:n});const i=e.remainingLanguages.findIndex((e=>e.locale===a));return(n||o&&i>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:n}),e}),{primaryLanguages:[],remainingLanguages:[]})),[a,r,i]);return Fi("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Qi("translation-options"),children:[d.map((({locale:e,nativeName:t,checked:n,isOriginal:r},i)=>Fi(Cc,{id:e,label:t,checked:n,description:r?o("translations.settings.original"):void 0,onChange:u(e),itemClassName:Qi({"translation-options__item--original":r,"translation-options__item--selected":n&&0!==i})},e))),p.map((({locale:e,nativeName:t,checked:n,isOriginal:r})=>Fi(Cc,{id:e,label:t,checked:n,description:r?o("translations.settings.original"):void 0,onChange:u(e)},e)))]})},Ec=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:a,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=da(),{hideOption:d}=ia(),{focusButton:p}=aa(),h=(0,ai.hb)((()=>{d(),c||p()}),[c,p,d]),f=(0,ai.hb)((()=>{n&&n(),h()}),[h,n]),m=(e=>{const t=(0,ai.li)(null);return(0,ai.vJ)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(f);return(0,ai.vJ)((()=>{E(m.current)}),[m]),Fi("section",{className:Qi("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e||""),"aria-labelledby":u,tabIndex:-1,ref:m,children:Fi("div",{className:Qi("options__body"),children:[Fi("h2",{id:u,className:Qi("options__title"),children:r}),Fi("button",{type:"button",onClick:f,"aria-describedby":u,className:Qi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[Fi(ga,{name:"close",size:"16",alt:""}),Fi("span",{children:a})]}),o?Fi("p",{className:Qi("options__description"),id:i,children:o}):null,Fi("div",{className:Qi("options__wrapper"),children:t})]})})},Sc=function({onClose:e,position:t}){const{t:n}=wi(),r=da();return Fi(Ec,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:Fi(xc,{describedById:r,onChange:e})})};function Tc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,ai.J0)(!1),i=(0,ai.li)(null),a=da();return Fi("div",{className:Qi("translations__container"),onKeyDown:e=>{r&&x(e)===C.Escape&&(o(!1),E(i.current))},children:[Fi(fc,{transitionStartState:hc.notRendered,isActive:r,children:Fi("div",{className:Qi("options__dialog"),role:"dialog",children:Fi(Sc,{onClose:()=>{o(!1)},position:t})})}),Fi("button",{type:"button",className:Qi(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{x(e)===C.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}var Nc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:i={},...a})=>{const s=ii(),c=Rn((e=>$s(e,{formId:t}))),[l,u]=(0,ai.J0)(!1),[d,p]=(0,ai.J0)({}),{isValid:h,errors:f}=function(e,t){const n=(0,ai.Kr)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o?.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),m=(0,ai.Kr)((()=>({...f,...d})),[f,d]);(0,ai.Nf)((()=>{s(Ar({formId:t,persistData:n}))}),[t,n,s]),(0,ai.vJ)((()=>()=>{s(Ir({formId:t}))}),[t,n,s]);const v=(0,ai.hb)(((e,n)=>{s(Lr({formId:t,name:e,value:n}))}),[t,s]),y=(0,ai.hb)(((e,n)=>{s(Pr({formId:t,name:e,touched:n}))}),[s,t]),g=(0,ai.hb)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),_=(0,ai.hb)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&h&&(s(br(!0)),o(c,{updateControlValue:v,setError:g}))}),[h,s,o,c,v,g]);(0,ai.vJ)((()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})}),[l,m,r]);const b=(0,ai.Kr)((()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:_,validationSchema:i,updateControlValue:v,updateControlTouched:y})),[t,c,m,l,_,i,v,y]);return t?o?Fi(Ws,{...a,value:b,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)};const kc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Ac=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Ic=e=>!!e?.length,Oc=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Rc=e=>!!e;var Lc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Xs();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&i&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),Fi("form",{onSubmit:r,className:Qi([...a,e]),...n})};function Pc({id:e,error:t}){const[n,r]=(0,ai.J0)(!1);return(0,ai.vJ)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),Fi("div",{className:Qi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&Fi("span",{id:e,className:Qi("error__message"),children:[Fi(ga,{name:"error",size:"16",alt:""}),t]})})}var Mc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:i,errorText:a,children:s})=>Fi(o.FK,{children:[e&&Fi("span",{id:`${t}-content-hint`,className:Qi("input__content-hint"),children:e}),Fi(Pc,{id:`${t}-error`,error:!i&&a}),Fi("div",{className:Qi("form-control__wrapper"),children:[Fi("label",{htmlFor:t,className:Qi(r),children:n}),s]})]}),jc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:i=null,"aria-invalid":a,"aria-describedby":s,...c}){const{isSubmitted:l}=Xs(),[u,{error:d}]=Ys(t),p=l&&d,h=[];return s&&h.push(s),i&&h.push(`${e}-content-hint`),p&&h.push(`${e}-error`),Fi(Mc,{id:e,contentHint:i,validity:!p,errorText:d,labelText:r,labelClass:o,children:Fi("input",{...u,...c,id:e,type:n,"aria-invalid":a||p?"true":"false","aria-describedby":h.join(" ")||void 0,name:t})})};function Dc({controlName:e,describedById:t}){const{t:n}=wi();return Fi(Lc,{noValidate:"true",className:Qi("options__form"),children:[Fi(jc,{id:"email-id",name:e,type:"email",className:Qi("transcript__input"),"aria-describedby":t,labelClass:Qi("label"),labelText:n("options.sendTranscript.label")}),Fi("div",{className:Qi("options__actions"),children:Fi("button",{type:"submit",className:Qi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const Uc="email";const Fc={sendTranscript:()=>{const[e,t]=(0,ai.J0)(void 0),{hideOption:n}=ia(),{focusButton:r}=aa(),{t:o}=wi(),i=da(),{sendAction:a}=Ri(),s=(0,ai.Kr)((()=>({[Uc]:[kc(Rc,o("options.sendTranscript.noEmailText")),kc(Oc,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,ai.hb)((e=>{const t=e[Uc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,ai.hb)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return Fi(Ec,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:Fi(Nc,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:Fi(Dc,{controlName:Uc,describedById:i})})})}};var Bc=()=>{const{optionActive:e}=ia(),t=(0,ai.li)(),n=Fc[t.current??e];return e&&(t.current=e),n?Fi(n,{}):null},zc=()=>{const{t:e}=wi(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=ia(),{id:i}=aa(),a=(0,ai.li)(null),[s,c]=(0,ai.J0)(!1),l=(0,ai.li)(null),u=t.length,d=(0,ai.li)([]),p=(0,ai.li)(!1),h=u>1,f=t[0],m=(0,ai.Kr)((()=>f?.name?.trim().replace(/\s+/g,"")),[f]);return(0,ai.vJ)((()=>()=>{a.current&&clearTimeout(a.current)}),[]),(0,ai.vJ)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await Hi(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&E(d.current[n])})),p.current=s}),[s,t]),u?Fi("div",{className:Qi("options__container"),onKeyDown:e=>{s&&(x(e)===C.Escape&&(c(!1),E(l.current)),x(e)===C.Home&&(d.current&&E(d.current[0]),e.preventDefault()),x(e)===C.End&&(d.current&&E(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{h&&(a.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[Fi(fc,{transitionStartState:hc.notRendered,isActive:r,children:Fi("div",{className:Qi("options__dialog"),children:Fi(Bc,{})})}),h&&Fi(fc,{isActive:s,transitionStartState:hc.notRendered,children:Fi("ul",{className:Qi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>Fi("li",{className:Qi("options__menu__item"),role:"menuitem","data-testid":r,children:Fi("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Qi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(x(e)===C.ArrowDown){const n=Math.min(u-1,t+1);d.current&&E(d.current[t===n?0:n]),e.preventDefault()}if(x(e)===C.ArrowUp){const n=Math.max(0,t-1);d.current&&E(d.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&d.current&&E(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[Fi("span",{className:Qi("button__text"),children:[o,!i&&" "]}),i?null:Fi("span",{className:Qi("button__state"),children:e("options.unavailableText")})]})},r)))})}),Fi("button",{type:"button",className:Qi(["button","button--secondary","chat__options__button",...!h&&m?[`chat__options__button--${m}`]:[]]),id:i,onClick:()=>{r&&o(),h?c((e=>!e)):f.available&&!r&&n(f.name)},onKeyDown:h?e=>{x(e)===C.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!h&&"menu","aria-expanded":!!h&&s,"aria-disabled":!h&&!f.available,children:[h?Fi(ga,{name:"options",size:"32",alt:""}):null,Fi("span",{className:Qi("button__text"),children:h?e("options.openButtonText"):`${f.title}${f.available?"":" "}`}),h||f.available?null:Fi("span",{className:Qi("button__state"),children:e("options.unavailableText")})]})]}):null};function Hc(){const{menuOptions:e,allowOptionSelection:t}=ia(),{isAvailable:n}=Wi(),r=Rn(Mi),{t:o,userLocale:i}=wi(),a=Xi(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return Fi("div",{className:Qi("chat__options"),children:[n&&Fi("div",{className:Qi("chat__options-item","chat__options-item--left"),children:Fi(Tc,{classNames:["button--secondary"],children:[Fi(ga,{alt:s,name:"newTranslation",size:"16"}),Fi("span",{className:Qi("button__text"),children:s})]})}),t&&Fi("div",{className:Qi("chat__options-item","chat__options-item--right"),children:Fi(zc,{})})]})}var $c=()=>{const{scrollToRef:e,unreadIds:t}=nc(),{isMinimized:n}=Ci(),{t:r}=wi();return Fi(fc,{isActive:!!t.length&&!n,children:Fi("div",{className:Qi("unread-messages"),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),Fi(ga,{name:"chevronDown",size:"32",alt:""})]})})})},Vc=({children:e})=>{const t=Gn(),n=(0,ai.Kr)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,o._3)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:a,unreadIds:s}=(e=>{const t=(0,ai.li)(null),[n,r]=(0,ai.J0)(!0),o=Rn(Us),i=Gn(),a=Xn(),{isOpen:s}=Ci(),c=Jn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Rn((({state:e})=>e));(0,ai.vJ)((()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,ai.hb)((()=>{requestAnimationFrame((async()=>{await Hi(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,ai.vJ)((()=>{u&&d()}),[u,d]),(0,ai.vJ)((()=>{n&&d()}),[n,o,i,a,s,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return Fi(rc.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:a},children:Fi("div",{className:Qi("chat__container"),children:[Fi("div",{className:Qi("chat__container__scroll-area"),ref:a,children:e}),Fi($c,{})]})})},Kc=({baseClassName:e,children:t,title:n})=>{const r=Qn(),o=da();return Fi("section",{id:r,className:Qi(e),"aria-describedby":o,tabIndex:-1,children:[Fi("h2",{className:Qi(`${e}__title`),id:o,children:n}),t]})},Jc=()=>{const{t:e}=wi(),t=Ki(),n=ca(),{emitEvent:r}=Ri(),{isActive:i,remaining:a,timer:s,endCountdown:c}=la(),l=!!a&&a>0,u=e(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return Fi(Kc,{baseClassName:"idle",title:u,children:l&&Fi(o.FK,{children:[Fi("div",{className:Qi("idle__count-container"),children:i&&Fi(o.FK,{children:[Fi("span",{className:Qi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),Fi("span",{className:Qi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),Fi("div",{className:Qi("idle__options"),children:[Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{n(),c(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{c(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Wc=()=>{const{t:e}=wi(),t=ca(),{name:n}=tr()||{},{continueChat:r,restartChat:o}=ua();return Fi(Kc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:Fi("div",{className:Qi("prompt__options"),children:[Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};const qc=()=>{const{sendAction:e}=Ri(),{features:t}=ia(),{typingPeekahead:n}=t||{},r=(0,ai.li)(null),o=(0,ai.li)(null),i=(0,ai.li)(!1),a=(0,ai.li)(null);(0,ai.vJ)((()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)}),[]);const s=(t,r)=>{e({type:P,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,a.current||(s(!0,e.target.value),a.current=setInterval((()=>{!i.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}},Gc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=Jn().entryMeta,i=ii(),a=n||t||e,s=o[a]||r[a]||{},c=(0,ai.hb)((e=>{i(yo(e))}),[i]),l=(0,ai.hb)((e=>{i(mo(e))}),[i]),u=(0,ai.hb)((e=>{i(Do(e))}),[i]),d=(0,ai.hb)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Xc({controlName:e,skipLinkId:t}){const{t:n}=wi(),{sendAssertive:r}=Li(),{emitEvent:o}=Ri(),i=qc(),{setBlockAutoEntrySwitch:a}=Gc(),{placeholder:s,label:c,labelClass:l}=Zs(e),{hasCharacterLimit:u,reachedCharacterWarning:d,reachedCharacterLimit:p,remainingChars:h}=Qs(e),[{value:f}]=Ys(e),m=!!f,v=(0,ai.hb)((()=>{d&&r(n("input.srCharacterLimitText",{limit:h})),o("ui.inputFocus")}),[n,r,d,h,o]);return(0,ai.Nf)((()=>(a(m),()=>{a(!1)})),[a,m]),Fi(Lc,{className:Qi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[Fi("div",{className:Qi(["input--text__container",...d&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[Fi(jc,{id:t,type:"text",name:e,className:Qi("input__text"),autocomplete:"off",placeholder:s,labelText:c,labelClass:Qi(l),"aria-invalid":!!u&&p,onKeyUp:i,onFocus:v}),Fi("div",{className:Qi("character-count"),children:d&&Fi("span",{children:h})})]}),Fi("button",{className:Qi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!m||p,children:Fi(ga,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Yc="textMessageEntry";function Qc({...e}){const{isOpen:t,setVisibility:n}=Ci(),r=Qn(),o=Ki(),{sendMessage:i}=Ri(),a=(0,ai.hb)(((e,{updateControlValue:r})=>{i({body:e[Yc]}),r(Yc,""),o(),t||n(yn.open)}),[i,o,t,n]);return Fi(Nc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:Fi(Xc,{controlName:Yc,skipLinkId:r})})}var Zc=()=>{const{t:e}=wi(),{currentUploads:t}=oa();return Fi("div",{className:Qi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>Fi("div",{className:Qi("progress_container"),children:[Fi("div",{className:Qi("progress__text"),children:[Fi("span",{className:Qi("progress__text--file-name"),children:n}),Fi("span",{className:Qi("progress__text--percentage"),children:`${r}%`})]}),Fi(Pc,{error:i,id:"progress-error"}),Fi("progress",{className:Qi("progress__bar"),role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function el({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=Xs(),[s,c]=(0,ai.J0)(!1),[{onInput:l,onBlur:u},{error:d}]=Ys(t),p=da(),h=da(),f=da(),m=a&&d,v=[f];r&&v.push(h),m&&v.push(p);const y=(0,ai.hb)((()=>{c(!0)}),[c]),g=(0,ai.hb)((()=>{c(!1),u()}),[c,u]),_=(0,ai.hb)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return Fi("div",{className:Qi("upload__container"),children:[r&&Fi("span",{className:Qi("upload__content-hint"),id:h,children:r}),Fi(Pc,{id:p,error:m&&d}),Fi("div",{className:Qi(["file-upload",...s?["focus-within"]:[]]),children:Fi("label",{htmlFor:e,className:Qi("upload__label"),children:[Fi(ga,{name:"upload",size:"32",alt:""}),Fi("div",{children:[Fi("span",{className:Qi(["upload__label--text"]),children:n}),Fi("input",{id:e,className:Qi("upload__input"),type:"file",name:t,onChange:_,"aria-invalid":m?"true":"false","aria-describedby":v.join(" "),accept:i||null,onFocus:y,onBlur:g}),Fi("span",{className:Qi("upload__output"),"aria-hidden":"true",id:f,children:o})]})]})})]})}var tl=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a})=>{const{t:s}=wi(),[{value:c}]=Ys(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return Fi(Lc,{className:Qi("upload-form"),children:[Fi(el,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),Fi("div",{className:Qi("upload__button-container"),children:[Fi("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:Qi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),Fi("button",{className:Qi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})};const nl="fileListForm",rl="fileList";var ol=()=>{const{t:e}=wi(),{sendPolite:t,sendAssertive:n}=Li(),r=Qn(),i=Ki(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=ra(),l=(0,ai.li)(null),u=(0,ai.li)(a),{cancelEntrySelection:d}=Gc(),{uploadFile:p,clearUploads:h,isUploading:f,isComplete:m}=oa(),{uploadHandle:v,hasServerError:y,progress:g}=((e,t)=>{const n=Rn((n=>Vs(n,{formId:e,name:t}))),{currentUploads:r}=oa(),o=n&&n.length>0;let i=null,a=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,a=!!e.error,s=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:a,progress:s}})(nl,rl),_=da(),w=(0,ai.li)(!0),C=e("fileUpload.contentHint",{size:b(c)}),x=(0,ai.li)(""),E=(0,ai.li)(null);(0,ai.vJ)((()=>{x.current&&E.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(C),x.current=C}),[C,n]),(0,ai.vJ)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,ai.vJ)((()=>{w.current||f||!m||(h(),d(),i(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),w.current=m}),[f,m,h,d,i,t,e]);const S=(0,ai.hb)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),T=(0,ai.hb)((()=>{v&&v.abort(),h(),d(),i()}),[v,h,d,i]),N=(0,ai.Kr)((()=>({[rl]:[kc((()=>a),e("fileUpload.errors.unavailable")),kc(Ic,e("fileUpload.errors.noFile")),kc(Ac,e("fileUpload.errors.tooLarge"),c)]})),[c,a,e]);return Fi("div",{className:Qi(["upload",...y?["upload--error"]:[]]),ref:E,children:Fi(Nc,{formId:nl,persistData:!0,onSubmit:S,validationSchema:N,children:[(f||!m)&&Fi(o.FK,{children:[Fi(Zc,{}),Fi("div",{className:Qi("upload__button-container"),children:Fi("button",{id:f||!m?r:void 0,type:"button",onClick:T,ref:l,className:Qi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&m&&Fi(tl,{controlName:rl,skiplinkId:r,accept:s?.join(", ")||"",contentHint:C,isComplete:m,isUploading:f,onClickCancel:T}),!u.current&&Fi(o.FK,{children:[Fi("span",{className:Qi("notification"),id:_,children:e("fileUpload.unavailableText")}),Fi("div",{className:Qi("upload__button-container"),children:Fi("button",{id:f||!m?r:void 0,type:"button",onClick:T,className:Qi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},il=()=>{const{t:e}=wi(),{showFileUpload:t,serviceAllowsUploads:n}=ra(),[r,o]=(0,ai.J0)(n||!1),i=Ki(),a=(0,ai.li)(null),{setUserEntryType:s,activeEntry:c}=Gc(),l=(0,ai.li)(null),{sendPolite:u}=Li(),d=!!tr();return(0,ai.vJ)((()=>{S(l.current,(()=>{n||i()})),o(n||!1)}),[n,i]),(0,ai.vJ)((()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)}),[n,d,u,e]),t||c===I?null:Fi(fc,{isActive:r,transitionStartState:hc.rendered,children:Fi("div",{className:Qi("upload-toggle-wrapper"),children:Fi(fc,{isActive:r,transitionStartState:hc.visuallyHidden,children:Fi("button",{className:Qi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(I),i()}:void 0,children:Fi(ga,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},al=()=>{const{isOpen:e}=Ci(),t=(0,ai.li)(null),{hasCountdown:n}=la(),[r,o]=(0,ai.J0)(n),{hasPrompt:i}=ua(),[a,s]=(0,ai.J0)(i),c=Ki(),l=(0,ai.li)(!1),{activeEntry:u}=Gc(),[d,p]=(0,ai.J0)({text:Qc,upload:ol}),[h,f]=(0,ai.J0)((()=>u)),m=$n(),{accountAllowsUploads:v}=ra(),y=(0,ai.hb)((()=>{S(t.current,c)}),[c]);(0,ai.vJ)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&p((e=>({...e,...t})))}),[m]),(0,ai.vJ)((()=>{y(),o(n),s(i)}),[n,i,y]),(0,ai.vJ)((()=>{f(u),y()}),[u,y,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return Fi("div",{className:Qi("chat__entry"),ref:t,children:[r&&Fi(Jc,{}),a&&Fi(Wc,{}),Fi("div",{className:Qi(["entry__body",...n||i?["entry__body--hidden"]:[]]),children:[h!==I&&v&&e?Fi(il,{}):null,Fi(g,{})]})]})},sl=()=>{const{t:e}=wi(),{isOpen:t,closeChat:n}=Ci(),{isWindow:r}=rr();return t&&r?Fi("button",{type:"button",className:Qi("button","collapse-button"),onClick:n,children:Fi(ga,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},cl=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:i,srText:a}}=ji(),s=Ri(),c=da(),{sendPolite:l}=Li(),u=Ki(),d="SeamlySessionExpiredError"===e?.name;return(0,ai.vJ)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?Fi(o.FK,{}):Fi("section",{className:Qi("interrupt"),"aria-labelledby":c,children:[Fi(sl,{}),Fi("div",{className:Qi("interrupt__body"),children:[Fi("h2",{id:c,className:Qi("interrupt__title"),children:t}),Fi("p",{className:Qi("interrupt__message"),children:n}),r&&i&&Fi("div",{className:Qi("interrupt__actions"),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{i&&s[i]&&s[i](),u()},children:r})})]})]})},ll=function({children:e}){const t=Rn(Mi),{isOpen:n}=Ci();return t?Fi(cl,{}):Fi(o.FK,{children:[Fi(Vc,{children:[Fi("div",{className:Qi("chat__container__header"),children:[Fi(wc,{}),Fi(sl,{})]}),e]}),Fi(al,{}),n&&Fi(Hc,{})]})};function ul({event:e}){const[t]=oc(e);return Fi("li",{children:Fi(t,{event:e})})}function dl({events:e}){return Fi("ul",{className:Qi("collapsed-chat-messages"),children:e.map((e=>Fi(ul,{event:e},e.payload.id)))})}function pl(){const{preChatEvents:e}=$n(),t=Rn(Mi),{isOpen:n}=Ci();return t||!e?.length||n?null:Fi(dl,{events:e})}function hl(){const{t:e}=wi(),t=e("window.chat.continue");return Fi(dl,{events:[(0,ai.Kr)((()=>({type:"message",payload:{type:"custom",body:{text:t}}})),[t])]})}const fl=()=>{const e=Vn(),t=tr(),n=Rn(Mi),r=t&&!n,o=r?t.avatar:e;return o?Fi("img",{className:Qi(r?"avatar":"icon"),src:o,alt:""}):Fi(ga,{name:"avatar",size:"32",alt:""})};var ml=({onClick:e})=>{const t=Oi(),{t:n}=wi(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=Ki(),{isOpen:i}=Ci(),a=Yn(),s=(0,ai.hb)((()=>{e(),o()}),[o,e]);return Fi(fc,{isActive:!i,transitionStartState:hc.rendered,children:Fi("button",{className:Qi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[Fi(fc,{isActive:!!a,transitionStartState:hc.notRendered,children:Fi("span",{className:Qi("message-count"),"aria-hidden":"true",children:a})}),Fi(fl,{})]})})};const vl=(e,t,n)=>"object"==typeof e?e[t]:n;var yl=n.p+"sounds/beep.mp3";const gl=!!window.Notification;const _l={app:()=>Fi(yc,{children:Fi(ll,{children:Fi(cc,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=ii(),{connectWhenInView:t}=$n(),n=Rn(ir),{containerRef:r,isVisible:o}=xi({enabled:t,freezeOnceVisible:!0});return(0,ai.vJ)((()=>{o&&e(ni())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Ci();return Fi(o.FK,{children:[Fi(fc,{isActive:!n,transitionStartState:hc.rendered,children:Fi("div",{ref:t,className:Qi("unstarted-wrapper","unstarted-wrapper--inline"),children:[Fi(pl,{}),Fi(mc,{})]})}),Fi(fc,{isActive:n,transitionStartState:hc.rendered,children:Fi(yc,{ref:t,children:e&&Fi(ll,{children:n&&Fi(cc,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Ci(),n=Ei(),{continueChat:r,preChat:i}=$n();return Fi(o.FK,{children:[Fi(ml,{onClick:t}),Fi(fc,{isActive:!!i&&!e&&!n,exitAfter:vl(i,"exitAfter"),enterDelay:vl(i,"enterDelay"),transitionStartState:hc.notRendered,children:Fi("div",{className:Qi("unstarted-wrapper","unstarted-wrapper--window"),children:Fi(pl,{})})}),Fi(fc,{isActive:r&&!e&&n,exitAfter:vl(r,"exitAfter"),enterDelay:vl(r,"enterDelay"),transitionStartState:hc.notRendered,children:Fi("div",{className:Qi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:Fi(hl,{})})}),Fi(fc,{isActive:e,transitionStartState:hc.notRendered,children:Fi(yc,{children:Fi(ll,{children:Fi(cc,{})})})})]})}};function bl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}var wl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Zn(),{notificationAudioURL:t}=$n(),[n,r]=(0,ai.J0)(gl?Notification.permission:"default"),[o,i]=(0,ai.J0)(document.visibilityState),a=Rn(Fs),s=(0,ai.hb)((async()=>{if(gl&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,ai.Kr)((()=>"granted"===n),[n]),l=(0,ai.Kr)((()=>"hidden"===o),[o]);(0,ai.vJ)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,ai.hb)((async(e,r)=>{if(a&&gl){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||yl);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${Yc}]`);e&&e.focus()}}}}),[t,n,c,s,a,l]);return(0,ai.vJ)((()=>{if(!a)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[a]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=$i(),r=$n(),o=tr(),{proactiveMessages:i}=Zn(),{isOpen:a,isVisible:s}=Ci(),c=Zi(),l=Ei(),u=Rn(Ds),{body:d}=qi(u),{userLocale:p}=wi(),h=(0,ai.li)(void 0),f=(0,ai.Kr)((()=>d?"string"==typeof d?bl(d):"text"in d?bl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?bl(d.prompt?.text):"":""),[d]);(0,ai.vJ)((()=>{o?.name&&f&&i&&u&&h.current!==u.payload?.id&&(t(o.name,{body:f,icon:o?.avatar}),h.current=u.payload.id)}),[o?.avatar,o?.name,u,f,i,t]);const m=_l[r.layoutMode],v=(0,ai.hb)((e=>{"function"==typeof n&&n(e)}),[n]),y=(0,ai.Kr)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!m)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const g=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?g.push(...c):g.push(...c(r)),a||"app"===r.layoutMode||g.push("app--collapsed"),l&&g.push("app--user-responded"),s?Fi("div",{className:Qi(g),lang:y,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:v,children:e||Fi(m,{})}):null},Cl=e=>Fi(Ms,{...e,children:Fi(wl,{})});class xl{constructor(e,n){const{namespace:r="",parentElement:o,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=o,this.externalApi=n,this.api=new we({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}async render(){const{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=oi({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(fr(n)),await r.dispatch(hn()),await r.dispatch(lr()),r.dispatch(cr()),e?(0,o.XX)(Fi(Ms,{eventBus:this.eventBus,store:r,api:this.api,children:Fi(e,{})}),this.parentElement):(0,o.XX)(Fi(Cl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,o.XX)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),this.functions={}}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const El=e=>"object"==typeof e&&"action"in e,Sl=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]});var Tl=class{constructor(e){this._waitingActions=[],this._instances={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(El).map(Sl)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=H),!0;case"setContext":const{userLocale:o,contentLocale:i}=t;return this.context.userLocale=o,this.context.contentLocale=i,o&&o!=this.appConfig?.userLocale&&(this.context.source=H),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},e.render()}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new xl(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},o={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}};const Nl=()=>{const e=ii();return{addEvent:t=>e(no(t)),clearEvents:()=>e(oo()),setHistory:t=>e(xo(t)),setEventsRead:t=>e(go(t)),setLoadedImageEventIds:t=>e(To(t)),ackEvent:t=>e(to(t)),setIsLoading:t=>e(So(t)),setParticipant:t=>e(No(t)),setHeaderTitle:t=>e(Co(t)),setHeaderSubTitle:t=>e(wo(t)),resetHistoryLoadedFlag:()=>e(fo()),setActiveService:t=>e(vo(t)),initIdleDetachCountdown:t=>e(uo(t)),decrementIdleDetachCountdownCounter:()=>e(co()),stopIdleDetachCountdownCounter:()=>e(zo()),clearIdleDetachCountdown:()=>e(ao()),initResumeConversationPrompt:()=>e(po()),clearResumeConversationPrompt:()=>e(so()),setServiceDataItem:t=>e(Ao(t)),setFeatures:t=>e(bo(t)),setFeatureEnabledState:t=>e(_o(t)),clearFeatures:()=>e(io()),setInitialState:t=>e(Eo(t)),setUserSelectedOptions:t=>e(Fo(t)),setUserSelectedOption:t=>e(Uo(t)),showOption:t=>e(Bo(t)),hideOption:()=>e(lo()),setServiceEntryMetadata:t=>e(Io(t)),setBlockAutoEntrySwitch:t=>e(yo(t)),setActiveEntryType:t=>e(mo(t)),setUserEntryType:t=>e(Do(t)),registerUpload:t=>e(ho(t)),setUploadProgress:t=>e(Po(t)),setUploadComplete:t=>e(Ro(t)),setUploadError:t=>e(Lo(t)),clearAllUploads:()=>e(ro()),setSeamlyContainerElement:t=>e(ko(t))}};var kl=()=>{const{t:e}=wi(),{title:t,subTitle:n}=Jn().headerTitles,r=Yn(),{isOpen:o}=Ci(),i=tr(),a=Rn(Mi),s=Vn(),c=i?.avatar??s,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?Fi("div",{className:Qi("agent-info"),children:[Fi("div",{className:Qi("agent-info__graphic"),children:[c?Fi("img",{className:Qi(i?.avatar?"avatar":"icon"),src:c,alt:""}):Fi(ga,{name:"avatar",size:"32",alt:""}),Fi("span",{className:Qi(u),"aria-hidden":"true",children:r})]}),Fi("div",{className:Qi("agent-info__body"),children:[Fi("p",{className:Qi("agent-info__heading"),children:t??e("header.title")}),Fi("p",{className:Qi("agent-info__text"),children:l})]})]}):null},Al=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=Jn(),r=(0,ai.li)(null),{t:o}=wi();return Fi("header",{className:Qi("chat__header"),children:[e,Fi("div",{className:Qi("header-controls"),children:Fi("button",{type:"button",className:Qi("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:Fi(ga,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},Il=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new Tl(e);window.seamly={push:n.push.bind(n)},n.push(...t)}}(),r}()}));
|
|
2
|
+
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(function(){return function(){var e={2086:function(e){e.exports=function(e){var t={},n=[];(e=e||this).on=function(n,r,o){return(t[n]=t[n]||[]).push([r,o]),e},e.off=function(r,o){r||(t={});for(var i=t[r]||n,a=i.length=o?i.length:0;a--;)o==i[a][0]&&i.splice(a,1);return e},e.emit=function(r){for(var o,i=t[r]||n,a=i.length>0?i.slice(0,i.length):i,s=0;o=a[s++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},7402:function(e,t,n){"use strict";n.r(t),n.d(t,{Children:function(){return h},Component:function(){return r.uA},Fragment:function(){return r.FK},PureComponent:function(){return s},StrictMode:function(){return ee},Suspense:function(){return g},SuspenseList:function(){return w},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:function(){return $},cloneElement:function(){return G},createContext:function(){return r.q6},createElement:function(){return r.n},createFactory:function(){return K},createPortal:function(){return S},createRef:function(){return r._3},default:function(){return ce},findDOMNode:function(){return Y},flushSync:function(){return Z},forwardRef:function(){return d},hydrate:function(){return L},isElement:function(){return ie},isFragment:function(){return W},isMemo:function(){return q},isValidElement:function(){return J},lazy:function(){return b},memo:function(){return c},render:function(){return R},startTransition:function(){return te},unmountComponentAtNode:function(){return X},unstable_batchedUpdates:function(){return Q},useCallback:function(){return o.hb},useContext:function(){return o.NT},useDebugValue:function(){return o.MN},useDeferredValue:function(){return ne},useEffect:function(){return o.vJ},useErrorBoundary:function(){return o.Md},useId:function(){return o.Bi},useImperativeHandle:function(){return o.Yn},useInsertionEffect:function(){return oe},useLayoutEffect:function(){return o.Nf},useMemo:function(){return o.Kr},useReducer:function(){return o.WO},useRef:function(){return o.li},useState:function(){return o.J0},useSyncExternalStore:function(){return ae},useTransition:function(){return re},version:function(){return V}});var r=n(172),o=n(5994);function i(e,t){for(var n in t)e[n]=t[n];return e}function a(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function s(e,t){this.props=e,this.context=t}function c(e,t){function n(e){var n=this.props.ref,r=n==e.ref;return!r&&n&&(n.call?n(null):n.current=null),t?!t(this.props,e)||!r:a(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.n)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(s.prototype=new r.uA).isPureReactComponent=!0,s.prototype.shouldComponentUpdate=function(e,t){return a(this.props,e)||a(this.state,t)};var l=r.fF.__b;r.fF.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),l&&l(e)};var u="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function d(e){function t(t){var n=i({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=u,t.render=t,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var p=function(e,t){return null==e?null:(0,r.v2)((0,r.v2)(e).map(t))},h={map:p,forEach:p,count:function(e){return e?(0,r.v2)(e).length:0},only:function(e){var t=(0,r.v2)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.v2},f=r.fF.__e;r.fF.__e=function(e,t,n,r){if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);f(e,t,n,r)};var m=r.fF.unmount;function v(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=i({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return v(e,t,n)}))),e}function y(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return y(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function g(){this.__u=0,this.t=null,this.__b=null}function _(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function b(e){var t,n,o;function i(i){if(t||(t=e()).then((function(e){n=e.default||e}),(function(e){o=e})),o)throw o;if(!n)throw t;return(0,r.n)(n,i)}return i.displayName="Lazy",i.__f=!0,i}function w(){this.u=null,this.o=null}r.fF.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),m&&m(e)},(g.prototype=new r.uA).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var o=_(r.__v),i=!1,a=function(){i||(i=!0,n.__R=null,o?o(s):s())};n.__R=a;var s=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=y(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},g.prototype.componentWillUnmount=function(){this.t=[]},g.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=v(this.__b,n,o.__O=o.__P)}this.__b=null}var i=t.__a&&(0,r.n)(r.FK,null,e.fallback);return i&&(i.__u&=-33),[(0,r.n)(r.FK,null,t.__a?null:e.children),i]};var C=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};function x(e){return this.getChildContext=function(){return e.context},e.children}function E(e){var t=this,n=e.i;t.componentWillUnmount=function(){(0,r.XX)(null,t.l),t.l=null,t.i=null},t.i&&t.i!==n&&t.componentWillUnmount(),t.l||(t.i=n,t.l={nodeType:1,parentNode:n,childNodes:[],appendChild:function(e){this.childNodes.push(e),t.i.appendChild(e)},insertBefore:function(e,n){this.childNodes.push(e),t.i.appendChild(e)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.i.removeChild(e)}}),(0,r.XX)((0,r.n)(x,{context:t.context},e.__v),t.l)}function S(e,t){var n=(0,r.n)(E,{__v:e,i:t});return n.containerInfo=t,n}(w.prototype=new r.uA).__a=function(e){var t=this,n=_(t.__v),r=t.o.get(e);return r[0]++,function(o){var i=function(){t.props.revealOrder?(r.push(o),C(t,e,r)):o()};n?n(i):i()}},w.prototype.render=function(e){this.u=null,this.o=new Map;var t=(0,r.v2)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},w.prototype.componentDidUpdate=w.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){C(e,n,t)}))};var T="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,N=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,k=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,A=/[A-Z0-9]/g,I="undefined"!=typeof document,O=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function R(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.XX)(e,t),"function"==typeof n&&n(),e?e.__c:null}function L(e,t,n){return(0,r.Qv)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.uA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(r.uA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var P=r.fF.event;function M(){}function j(){return this.cancelBubble}function D(){return this.defaultPrevented}r.fF.event=function(e){return P&&(e=P(e)),e.persist=M,e.isPropagationStopped=j,e.isDefaultPrevented=D,e.nativeEvent=e};var U,F={enumerable:!1,configurable:!0,get:function(){return this.class}},B=r.fF.vnode;r.fF.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={};for(var i in t){var a=t[i];if(!("value"===i&&"defaultValue"in t&&null==a||I&&"children"===i&&"noscript"===n||"class"===i||"className"===i)){var s=i.toLowerCase();"defaultValue"===i&&"value"in t&&null==t.value?i="value":"download"===i&&!0===a?a="":"translate"===s&&"no"===a?a=!1:"ondoubleclick"===s?i="ondblclick":"onchange"!==s||"input"!==n&&"textarea"!==n||O(t.type)?"onfocus"===s?i="onfocusin":"onblur"===s?i="onfocusout":k.test(i)?i=s:-1===n.indexOf("-")&&N.test(i)?i=i.replace(A,"-$&").toLowerCase():null===a&&(a=void 0):s=i="oninput","oninput"===s&&o[i=s]&&(i="oninputCapture"),o[i]=a}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)}))),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.v2)(t.children).forEach((function(e){e.props.selected=o.multiple?-1!=o.defaultValue.indexOf(e.props.value):o.defaultValue==e.props.value}))),t.class&&!t.className?(o.class=t.class,Object.defineProperty(o,"className",F)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=T,B&&B(e)};var z=r.fF.__r;r.fF.__r=function(e){z&&z(e),U=e.__c};var H=r.fF.diffed;r.fF.diffed=function(e){H&&H(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value),U=null};var $={ReactCurrentDispatcher:{current:{readContext:function(e){return U.__n[e.__c].props.value},useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,useDeferredValue:ne,useEffect:o.vJ,useId:o.Bi,useImperativeHandle:o.Yn,useInsertionEffect:oe,useLayoutEffect:o.Nf,useMemo:o.Kr,useReducer:o.WO,useRef:o.li,useState:o.J0,useSyncExternalStore:ae,useTransition:re}}},V="17.0.2";function K(e){return r.n.bind(null,e)}function J(e){return!!e&&e.$$typeof===T}function W(e){return J(e)&&e.type===r.FK}function q(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function G(e){return J(e)?r.Ob.apply(null,arguments):e}function X(e){return!!e.__k&&((0,r.XX)(null,e),!0)}function Y(e){return e&&(e.base||1===e.nodeType&&e)||null}var Q=function(e,t){return e(t)},Z=function(e,t){return e(t)},ee=r.FK;function te(e){e()}function ne(e){return e}function re(){return[!1,te]}var oe=o.Nf,ie=J;function ae(e,t){var n=t(),r=(0,o.J0)({h:{__:n,v:t}}),i=r[0].h,a=r[1];return(0,o.Nf)((function(){i.__=n,i.v=t,se(i)&&a({h:i})}),[e,n,t]),(0,o.vJ)((function(){return se(i)&&a({h:i}),e((function(){se(i)&&a({h:i})}))}),[e]),n}function se(e){var t,n,r=e.v,o=e.__;try{var i=r();return!((t=o)===(n=i)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}var ce={useState:o.J0,useId:o.Bi,useReducer:o.WO,useEffect:o.vJ,useLayoutEffect:o.Nf,useInsertionEffect:oe,useTransition:re,useDeferredValue:ne,useSyncExternalStore:ae,startTransition:te,useRef:o.li,useImperativeHandle:o.Yn,useMemo:o.Kr,useCallback:o.hb,useContext:o.NT,useDebugValue:o.MN,version:"17.0.2",Children:h,render:R,hydrate:L,unmountComponentAtNode:X,createPortal:S,createElement:r.n,createContext:r.q6,createFactory:K,cloneElement:G,createRef:r._3,Fragment:r.FK,isValidElement:J,isElement:ie,isFragment:W,isMemo:q,findDOMNode:Y,Component:r.uA,PureComponent:s,memo:c,forwardRef:d,flushSync:Z,unstable_batchedUpdates:Q,StrictMode:ee,Suspense:g,SuspenseList:w,lazy:b,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:$}},172:function(e,t,n){"use strict";n.d(t,{FK:function(){return x},Ob:function(){return K},Qv:function(){return V},XX:function(){return $},_3:function(){return C},fF:function(){return o},n:function(){return b},q6:function(){return J},uA:function(){return E},v2:function(){return R}});var r,o,i,a,s,c,l,u,d,p,h,f={},m=[],v=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,y=Array.isArray;function g(e,t){for(var n in t)e[n]=t[n];return e}function _(e){var t=e.parentNode;t&&t.removeChild(e)}function b(e,t,n){var o,i,a,s={};for(a in t)"key"==a?o=t[a]:"ref"==a?i=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?r.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return w(e,s,o,i,null)}function w(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++i:a,__i:-1,__u:0};return null==a&&null!=o.vnode&&o.vnode(s),s}function C(){return{current:null}}function x(e){return e.children}function E(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?S(e):null}function T(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return T(e)}}function N(e){(!e.__d&&(e.__d=!0)&&a.push(e)&&!k.__r++||s!==o.debounceRendering)&&((s=o.debounceRendering)||c)(k)}function k(){var e,t,n,r,i,s,c,u;for(a.sort(l);e=a.shift();)e.__d&&(t=a.length,r=void 0,s=(i=(n=e).__v).__e,c=[],u=[],n.__P&&((r=g({},i)).__v=i.__v+1,o.vnode&&o.vnode(r),D(n.__P,r,i,n.__n,n.__P.namespaceURI,32&i.__u?[s]:null,c,null==s?S(i):s,!!(32&i.__u),u),r.__v=i.__v,r.__.__k[r.__i]=r,U(c,r,u),r.__e!=s&&T(r)),a.length>t&&a.sort(l));k.__r=0}function A(e,t,n,r,o,i,a,s,c,l,u){var d,p,h,v,y,g=r&&r.__k||m,_=t.length;for(n.__d=c,I(n,t,g),c=n.__d,d=0;d<_;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(p=-1===h.__i?f:g[h.__i]||f,h.__i=d,D(e,h,p,o,i,a,s,c,l,u),v=h.__e,h.ref&&p.ref!=h.ref&&(p.ref&&B(p.ref,null,h),u.push(h.ref,h.__c||v,h)),null==y&&null!=v&&(y=v),65536&h.__u||p.__k===h.__k?(c&&!c.isConnected&&(c=S(p)),c=O(h,c,e)):"function"==typeof h.type&&void 0!==h.__d?c=h.__d:v&&(c=v.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=c,n.__e=y}function I(e,t,n){var r,o,i,a,s,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)a=r+d,null!=(o=e.__k[r]=null==(o=t[r])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?w(null,o,null,null,null):y(o)?w(x,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?w(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,s=L(o,n,a,u),o.__i=s,i=null,-1!==s&&(u--,(i=n[s])&&(i.__u|=131072)),null==i||null===i.__v?(-1==s&&d--,"function"!=typeof o.type&&(o.__u|=65536)):s!==a&&(s===a+1?d++:s>a?u>c-a?d+=s-a:d--:s<a?s==a-1&&(d=s-a):d=0,s!==r+d&&(o.__u|=65536))):(i=n[a])&&null==i.key&&i.__e&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=S(i)),z(i,i,!1),n[a]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=S(i)),z(i,i))}function O(e,t,n){var r,o;if("function"==typeof e.type){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=O(r[o],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function R(e,t){return t=t||[],null==e||"boolean"==typeof e||(y(e)?e.some((function(e){R(e,t)})):t.push(e)),t}function L(e,t,n,r){var o=e.key,i=e.type,a=n-1,s=n+1,c=t[n];if(null===c||c&&o==c.key&&i===c.type&&!(131072&c.__u))return n;if(r>(null==c||131072&c.__u?0:1))for(;a>=0||s<t.length;){if(a>=0){if((c=t[a])&&!(131072&c.__u)&&o==c.key&&i===c.type)return a;a--}if(s<t.length){if((c=t[s])&&!(131072&c.__u)&&o==c.key&&i===c.type)return s;s++}}return-1}function P(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||v.test(t)?n:n+"px"}function M(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||P(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||P(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||"onFocusOut"===t||"onFocusIn"===t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=u,e.addEventListener(t,i?p:d,i)):e.removeEventListener(t,i?p:d,i);else{if("http://www.w3.org/2000/svg"==o)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function j(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=u++;else if(t.t<n.u)return;return n(o.event?o.event(t):t)}}}function D(e,t,n,r,i,a,s,c,l,u){var d,p,h,f,m,v,_,b,w,C,S,T,N,k,I,O=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),a=[c=t.__e=n.__e]),(d=o.__b)&&d(t);e:if("function"==typeof O)try{if(b=t.props,w=(d=O.contextType)&&r[d.__c],C=d?w?w.props.value:d.__:r,n.__c?_=(p=t.__c=n.__c).__=p.__E:("prototype"in O&&O.prototype.render?t.__c=p=new O(b,C):(t.__c=p=new E(b,C),p.constructor=O,p.render=H),w&&w.sub(p),p.props=b,p.state||(p.state={}),p.context=C,p.__n=r,h=p.__d=!0,p.__h=[],p._sb=[]),null==p.__s&&(p.__s=p.state),null!=O.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=g({},p.__s)),g(p.__s,O.getDerivedStateFromProps(b,p.__s))),f=p.props,m=p.state,p.__v=t,h)null==O.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(null==O.getDerivedStateFromProps&&b!==f&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(b,C),!p.__e&&(null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(b,p.__s,C)||t.__v===n.__v)){for(t.__v!==n.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),S=0;S<p._sb.length;S++)p.__h.push(p._sb[S]);p._sb=[],p.__h.length&&s.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(b,p.__s,C),null!=p.componentDidUpdate&&p.__h.push((function(){p.componentDidUpdate(f,m,v)}))}if(p.context=C,p.props=b,p.__P=e,p.__e=!1,T=o.__r,N=0,"prototype"in O&&O.prototype.render){for(p.state=p.__s,p.__d=!1,T&&T(t),d=p.render(p.props,p.state,p.context),k=0;k<p._sb.length;k++)p.__h.push(p._sb[k]);p._sb=[]}else do{p.__d=!1,T&&T(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++N<25);p.state=p.__s,null!=p.getChildContext&&(r=g(g({},r),p.getChildContext())),h||null==p.getSnapshotBeforeUpdate||(v=p.getSnapshotBeforeUpdate(f,m)),A(e,y(I=null!=d&&d.type===x&&null==d.key?d.props.children:d)?I:[I],t,n,r,i,a,s,c,l,u),p.base=t.__e,t.__u&=-161,p.__h.length&&s.push(p),_&&(p.__E=p.__=null)}catch(e){t.__v=null,l||null!=a?(t.__e=c,t.__u|=l?160:32,a[a.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),o.__e(e,t,n)}else null==a&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=F(n.__e,t,n,r,i,a,s,l,u);(d=o.diffed)&&d(t)}function U(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)B(n[r],n[++r],n[++r]);o.__c&&o.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){o.__e(e,t.__v)}}))}function F(e,t,n,o,i,a,s,c,l){var u,d,p,h,m,v,g,b=n.props,w=t.props,C=t.type;if("svg"===C?i="http://www.w3.org/2000/svg":"math"===C?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=a)for(u=0;u<a.length;u++)if((m=a[u])&&"setAttribute"in m==!!C&&(C?m.localName===C:3===m.nodeType)){e=m,a[u]=null;break}if(null==e){if(null===C)return document.createTextNode(w);e=document.createElementNS(i,C,w.is&&w),a=null,c=!1}if(null===C)b===w||c&&e.data===w||(e.data=w);else{if(a=a&&r.call(e.childNodes),b=n.props||f,!c&&null!=a)for(b={},u=0;u<e.attributes.length;u++)b[(m=e.attributes[u]).name]=m.value;for(u in b)if(m=b[u],"children"==u);else if("dangerouslySetInnerHTML"==u)p=m;else if("key"!==u&&!(u in w)){if("value"==u&&"defaultValue"in w||"checked"==u&&"defaultChecked"in w)continue;M(e,u,null,m,i)}for(u in w)m=w[u],"children"==u?h=m:"dangerouslySetInnerHTML"==u?d=m:"value"==u?v=m:"checked"==u?g=m:"key"===u||c&&"function"!=typeof m||b[u]===m||M(e,u,m,b[u],i);if(d)c||p&&(d.__html===p.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(p&&(e.innerHTML=""),A(e,y(h)?h:[h],t,n,o,"foreignObject"===C?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&S(n,0),c,l),null!=a)for(u=a.length;u--;)null!=a[u]&&_(a[u]);c||(u="value",void 0!==v&&(v!==e[u]||"progress"===C&&!v||"option"===C&&v!==b[u])&&M(e,u,v,b[u],i),u="checked",void 0!==g&&g!==e[u]&&M(e,u,g,b[u],i))}return e}function B(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){o.__e(e,n)}}function z(e,t,n){var r,i;if(o.unmount&&o.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||B(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){o.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&z(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||_(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function H(e,t,n){return this.constructor(e,n)}function $(e,t,n){var i,a,s,c;o.__&&o.__(e,t),a=(i="function"==typeof n)?null:n&&n.__k||t.__k,s=[],c=[],D(t,e=(!i&&n||t).__k=b(x,null,[e]),a||f,f,t.namespaceURI,!i&&n?[n]:a?null:t.firstChild?r.call(t.childNodes):null,s,!i&&n?n:a?a.__e:t.firstChild,i,c),U(s,e,c)}function V(e,t){$(e,t,V)}function K(e,t,n){var o,i,a,s,c=g({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?o=t[a]:"ref"==a?i=t[a]:c[a]=void 0===t[a]&&void 0!==s?s[a]:t[a];return arguments.length>2&&(c.children=arguments.length>3?r.call(arguments,2):n),w(e.type,c,o||e.key,i||e.ref,null)}function J(e,t){var n={__c:t="__cC"+h++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,N(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}r=m.slice,o={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},i=0,E.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=g({},this.state),"function"==typeof e&&(e=e(g({},n),this.props)),e&&g(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),N(this))},E.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),N(this))},E.prototype.render=x,a=[],c="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,l=function(e,t){return e.__v.__b-t.__v.__b},k.__r=0,u=0,d=j(!1),p=j(!0),h=0},5994:function(e,t,n){"use strict";n.d(t,{Bi:function(){return I},J0:function(){return _},Kr:function(){return S},MN:function(){return k},Md:function(){return A},NT:function(){return N},Nf:function(){return C},WO:function(){return b},Yn:function(){return E},hb:function(){return T},li:function(){return x},vJ:function(){return w}});var r,o,i,a,s=n(172),c=0,l=[],u=[],d=s.fF,p=d.__b,h=d.__r,f=d.diffed,m=d.__c,v=d.unmount,y=d.__;function g(e,t){d.__h&&d.__h(o,e,c||t),c=0;var n=o.__H||(o.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:u}),n.__[e]}function _(e){return c=1,b(D,e)}function b(e,t,n){var i=g(r++,2);if(i.t=e,!i.__c&&(i.__=[n?n(t):D(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],n=i.t(t,e);t!==n&&(i.__N=[n,i.__[1]],i.__c.setState({}))}],i.__c=o,!o.u)){var a=function(e,t,n){if(!i.__c.__H)return!0;var r=i.__c.__H.__.filter((function(e){return!!e.__c}));if(r.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var o=!1;return r.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}})),!(!o&&i.__c.props===e)&&(!s||s.call(this,e,t,n))};o.u=!0;var s=o.shouldComponentUpdate,c=o.componentWillUpdate;o.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}c&&c.call(this,e,t,n)},o.shouldComponentUpdate=a}return i.__N||i.__}function w(e,t){var n=g(r++,3);!d.__s&&j(n.__H,t)&&(n.__=e,n.i=t,o.__H.__h.push(n))}function C(e,t){var n=g(r++,4);!d.__s&&j(n.__H,t)&&(n.__=e,n.i=t,o.__h.push(n))}function x(e){return c=5,S((function(){return{current:e}}),[])}function E(e,t,n){c=6,C((function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0}),null==n?n:n.concat(e))}function S(e,t){var n=g(r++,7);return j(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function T(e,t){return c=8,S((function(){return e}),t)}function N(e){var t=o.context[e.__c],n=g(r++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(o)),t.props.value):e.__}function k(e,t){d.useDebugValue&&d.useDebugValue(t?t(e):e)}function A(e){var t=g(r++,10),n=_();return t.__=e,o.componentDidCatch||(o.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]}function I(){var e=g(r++,11);if(!e.__){for(var t=o.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function O(){for(var e;e=l.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(P),e.__H.__h.forEach(M),e.__H.__h=[]}catch(t){e.__H.__h=[],d.__e(t,e.__v)}}d.__b=function(e){o=null,p&&p(e)},d.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),y&&y(e,t)},d.__r=function(e){h&&h(e),r=0;var t=(o=e.__c).__H;t&&(i===o?(t.__h=[],o.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=u,e.__N=e.i=void 0}))):(t.__h.forEach(P),t.__h.forEach(M),t.__h=[],r=0)),i=o},d.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==l.push(t)&&a===d.requestAnimationFrame||((a=d.requestAnimationFrame)||L)(O)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==u&&(e.__=e.__V),e.i=void 0,e.__V=u}))),i=o=null},d.__c=function(e,t){t.some((function(e){try{e.__h.forEach(P),e.__h=e.__h.filter((function(e){return!e.__||M(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],d.__e(n,e.__v)}})),m&&m(e,t)},d.unmount=function(e){v&&v(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{P(e)}catch(e){t=e}})),n.__H=void 0,t&&d.__e(t,n.__v))};var R="function"==typeof requestAnimationFrame;function L(e){var t,n=function(){clearTimeout(r),R&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);R&&(t=requestAnimationFrame(n))}function P(e){var t=o,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),o=t}function M(e){var t=o;e.__c=e.__(),o=t}function j(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function D(e,t){return"function"==typeof t?t(e):t}},7154:function(e,t,n){"use strict";var r=n(7402),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useSyncExternalStore,a=r.useRef,s=r.useEffect,c=r.useMemo,l=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=a(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;d=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==u&&p.hasValue){var t=p.value;if(u(t,e))return a=t}return a=e}if(t=a,o(i,e))return t;var n=r(e);return void 0!==u&&u(t,n)?t:(i=e,a=n)}var i,a,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,u]);var h=i(e,d[0],d[1]);return s((function(){p.hasValue=!0,p.value=h}),[h]),l(h),h}},8418:function(e,t,n){"use strict";e.exports=n(7154)},9497:function(e,t,n){"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9306:function(e,t,n){"use strict";var r=n(4901),o=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not a function")}},3506:function(e,t,n){"use strict";var r=n(3925),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},7080:function(e,t,n){"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},6469:function(e,t,n){"use strict";var r=n(8227),o=n(2360),i=n(4913).f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},679:function(e,t,n){"use strict";var r=n(1625),o=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw new o("Incorrect invocation")}},8551:function(e,t,n){"use strict";var r=n(34),o=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(o(e)+" is not an object")}},9617:function(e,t,n){"use strict";var r=n(5397),o=n(5610),i=n(6198),a=function(e){return function(t,n,a){var s=r(t),c=i(s);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=s[u++])!=l)return!0}else for(;c>u;u++)if((e||u in s)&&s[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},4527:function(e,t,n){"use strict";var r=n(3724),o=n(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4576:function(e,t,n){"use strict";var r=n(9504),o=r({}.toString),i=r("".slice);e.exports=function(e){return i(o(e),8,-1)}},6955:function(e,t,n){"use strict";var r=n(2140),o=n(4901),i=n(4576),a=n(8227)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?n:c?i(t):"Object"===(r=i(t))&&o(t.callee)?"Arguments":r}},7740:function(e,t,n){"use strict";var r=n(9297),o=n(5031),i=n(7347),a=n(4913);e.exports=function(e,t,n){for(var s=o(t),c=a.f,l=i.f,u=0;u<s.length;u++){var d=s[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},6699:function(e,t,n){"use strict";var r=n(3724),o=n(4913),i=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:function(e,t,n){"use strict";var r=n(4901),o=n(4913),i=n(283),a=n(9433);e.exports=function(e,t,n,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(r(n)&&i(n,l,s),s.global)c?e[t]=n:a(t,n);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:function(e,t,n){"use strict";var r=n(4475),o=Object.defineProperty;e.exports=function(e,t){try{o(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:function(e,t,n){"use strict";var r=n(4475),o=n(34),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},5002:function(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},9392:function(e){"use strict";e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},7388:function(e,t,n){"use strict";var r,o,i=n(4475),a=n(9392),s=i.process,c=i.Deno,l=s&&s.versions||c&&c.version,u=l&&l.v8;u&&(o=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(o=+r[1]),e.exports=o},7015:function(e,t,n){"use strict";var r=n(4475),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},6193:function(e,t,n){"use strict";var r=n(9504),o=Error,i=r("".replace),a=String(new o("zxcasd").stack),s=/\n\s*at [^:]*:[^\n]*/,c=s.test(a);e.exports=function(e,t){if(c&&"string"==typeof e&&!o.prepareStackTrace)for(;t--;)e=i(e,s,"");return e}},6518:function(e,t,n){"use strict";var r=n(4475),o=n(7347).f,i=n(6699),a=n(6840),s=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,h,f=e.target,m=e.global,v=e.stat;if(n=m?r:v?r[f]||s(f,{}):r[f]&&r[f].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(h=o(n,u))&&h.value:n[u],!l(m?u:f+(v?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(n,u,p,e)}}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:function(e,t,n){"use strict";var r=n(9039);e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:function(e,t,n){"use strict";var r=n(616),o=Function.prototype.call;e.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},350:function(e,t,n){"use strict";var r=n(3724),o=n(9297),i=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,l=s&&(!r||r&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},6706:function(e,t,n){"use strict";var r=n(9504),o=n(9306);e.exports=function(e,t,n){try{return r(o(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},9504:function(e,t,n){"use strict";var r=n(616),o=Function.prototype,i=o.call,a=r&&o.bind.bind(i,i);e.exports=r?a:function(e){return function(){return i.apply(e,arguments)}}},7751:function(e,t,n){"use strict";var r=n(4475),o=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],o(n)?n:void 0):r[e]&&r[e][t];var n}},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},5966:function(e,t,n){"use strict";var r=n(9306),o=n(4117);e.exports=function(e,t){var n=e[t];return o(n)?void 0:r(n)}},3789:function(e,t,n){"use strict";var r=n(9306),o=n(8551),i=n(9565),a=n(1291),s=n(1767),c="Invalid size",l=RangeError,u=TypeError,d=Math.max,p=function(e,t){this.set=e,this.size=d(t,0),this.has=r(e.has),this.keys=r(e.keys)};p.prototype={getIterator:function(){return s(o(i(this.keys,this.set)))},includes:function(e){return i(this.has,this.set,e)}},e.exports=function(e){o(e);var t=+e.size;if(t!=t)throw new u(c);var n=a(t);if(n<0)throw new l(c);return new p(e,n)}},4475:function(e,t,n){"use strict";var r=function(e){return e&&e.Math===Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||r("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:function(e,t,n){"use strict";var r=n(9504),o=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},421:function(e){"use strict";e.exports={}},397:function(e,t,n){"use strict";var r=n(7751);e.exports=r("document","documentElement")},5917:function(e,t,n){"use strict";var r=n(3724),o=n(9039),i=n(4055);e.exports=!r&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},7055:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4576),a=Object,s=r("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},3167:function(e,t,n){"use strict";var r=n(4901),o=n(34),i=n(2967);e.exports=function(e,t,n){var a,s;return i&&r(a=t.constructor)&&a!==n&&o(s=a.prototype)&&s!==n.prototype&&i(e,s),e}},3706:function(e,t,n){"use strict";var r=n(9504),o=n(4901),i=n(7629),a=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},1181:function(e,t,n){"use strict";var r,o,i,a=n(8622),s=n(4475),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),h=n(421),f="Object already initialized",m=s.TypeError,v=s.WeakMap;if(a||d.state){var y=d.state||(d.state=new v);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new m(f);return t.facade=e,y.set(e,t),t},o=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var g=p("state");h[g]=!0,r=function(e,t){if(u(e,g))throw new m(f);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},i=function(e){return u(e,g)}}e.exports={set:r,get:o,has:i,enforce:function(e){return i(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4376:function(e,t,n){"use strict";var r=n(4576);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:function(e,t,n){"use strict";var r=n(9039),o=n(4901),i=/#|\.prototype\./,a=function(e,t){var n=c[s(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},4117:function(e){"use strict";e.exports=function(e){return null==e}},34:function(e,t,n){"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},3925:function(e,t,n){"use strict";var r=n(34);e.exports=function(e){return r(e)||null===e}},6395:function(e){"use strict";e.exports=!1},757:function(e,t,n){"use strict";var r=n(7751),o=n(4901),i=n(1625),a=n(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&i(t.prototype,s(e))}},507:function(e,t,n){"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,i,a=n?e:e.iterator,s=e.next;!(o=r(s,a)).done;)if(void 0!==(i=t(o.value)))return i}},9539:function(e,t,n){"use strict";var r=n(9565),o=n(8551),i=n(5966);e.exports=function(e,t,n){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw n;if(s)throw a;return o(a),n}},6198:function(e,t,n){"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},283:function(e,t,n){"use strict";var r=n(9504),o=n(9039),i=n(4901),a=n(9297),s=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,h=String,f=Object.defineProperty,m=r("".slice),v=r("".replace),y=r([].join),g=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),_=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===m(h(t),0,7)&&(t="["+v(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=y(_,"string"==typeof t?t:"")),e};Function.prototype.toString=b((function(){return i(this)&&p(this).source||l(this)}),"toString")},741:function(e){"use strict";var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},2603:function(e,t,n){"use strict";var r=n(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},2360:function(e,t,n){"use strict";var r,o=n(8551),i=n(6801),a=n(8727),s=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",h=u("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?v(r):(t=l("iframe"),n="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(r);for(var o=a.length;o--;)delete y[d][a[o]];return y()};s[h]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f[d]=o(e),n=new f,f[d]=null,n[h]=e):n=y(),void 0===t?n:i.f(n,t)}},6801:function(e,t,n){"use strict";var r=n(3724),o=n(8686),i=n(4913),a=n(8551),s=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=s(t),o=c(t),l=o.length,u=0;l>u;)i.f(e,n=o[u++],r[n]);return e}},4913:function(e,t,n){"use strict";var r=n(3724),o=n(5917),i=n(8686),a=n(8551),s=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=r?i?function(e,t,n){if(a(e),t=s(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&h in n&&!n[h]){var r=u(e,t);r&&r[h]&&(e[t]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(a(e),t=s(t),a(n),o)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347:function(e,t,n){"use strict";var r=n(3724),o=n(9565),i=n(8773),a=n(6980),s=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=s(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(i.f,e,t),e[t])}},8480:function(e,t,n){"use strict";var r=n(1828),o=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,o)}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},1625:function(e,t,n){"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1828:function(e,t,n){"use strict";var r=n(9504),o=n(9297),i=n(5397),a=n(9617).indexOf,s=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!o(s,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},1072:function(e,t,n){"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},8773:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,o=r&&!n.call({1:2},1);t.f=o?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2967:function(e,t,n){"use strict";var r=n(6706),o=n(34),i=n(7750),a=n(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return i(n),a(r),o(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},4270:function(e,t,n){"use strict";var r=n(9565),o=n(4901),i=n(34),a=TypeError;e.exports=function(e,t){var n,s;if("string"===t&&o(n=e.toString)&&!i(s=r(n,e)))return s;if(o(n=e.valueOf)&&!i(s=r(n,e)))return s;if("string"!==t&&o(n=e.toString)&&!i(s=r(n,e)))return s;throw new a("Can't convert object to primitive value")}},5031:function(e,t,n){"use strict";var r=n(7751),o=n(9504),i=n(8480),a=n(3717),s=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(s(e)),n=a.f;return n?c(t,n(e)):t}},7750:function(e,t,n){"use strict";var r=n(4117),o=TypeError;e.exports=function(e){if(r(e))throw new o("Can't call method on "+e);return e}},9286:function(e,t,n){"use strict";var r=n(4402),o=n(8469),i=r.Set,a=r.add;e.exports=function(e){var t=new i;return o(e,(function(e){a(t,e)})),t}},3440:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(5170),s=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=s(e),o=i(t);return a(t)<=n.size?c(t,(function(e){n.includes(e)&&d(o,e)})):l(n.getIterator(),(function(e){u(t,e)&&d(o,e)})),o}},4402:function(e,t,n){"use strict";var r=n(9504),o=Set.prototype;e.exports={Set:Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},8750:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(5170),a=n(3789),s=n(8469),c=n(507),l=o.Set,u=o.add,d=o.has;e.exports=function(e){var t=r(this),n=a(e),o=new l;return i(t)>n.size?c(n.getIterator(),(function(e){d(t,e)&&u(o,e)})):s(t,(function(e){n.includes(e)&&u(o,e)})),o}},4449:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<=n.size)return!1!==s(t,(function(e){if(n.includes(e))return!1}),!0);var u=n.getIterator();return!1!==c(u,(function(e){if(o(t,e))return l(u,"normal",!1)}))}},3838:function(e,t,n){"use strict";var r=n(7080),o=n(5170),i=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==i(t,(function(e){if(!n.includes(e))return!1}),!0)}},8527:function(e,t,n){"use strict";var r=n(7080),o=n(4402).has,i=n(5170),a=n(3789),s=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(i(t)<n.size)return!1;var l=n.getIterator();return!1!==s(l,(function(e){if(!o(t,e))return c(l,"normal",!1)}))}},8469:function(e,t,n){"use strict";var r=n(9504),o=n(507),i=n(4402),a=i.Set,s=i.proto,c=r(s.forEach),l=r(s.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},4916:function(e,t,n){"use strict";var r=n(7751),o=function(e){return{size:e,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}};e.exports=function(e){var t=r("Set");try{(new t)[e](o(0));try{return(new t)[e](o(-1)),!1}catch(e){return!0}}catch(e){return!1}}},5170:function(e,t,n){"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},3650:function(e,t,n){"use strict";var r=n(7080),o=n(4402),i=n(9286),a=n(3789),s=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=i(t);return s(n,(function(e){l(t,e)?u(o,e):c(o,e)})),o}},4204:function(e,t,n){"use strict";var r=n(7080),o=n(4402).add,i=n(9286),a=n(3789),s=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=i(t);return s(n,(function(e){o(c,e)})),c}},6119:function(e,t,n){"use strict";var r=n(5745),o=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},7629:function(e,t,n){"use strict";var r=n(6395),o=n(4475),i=n(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.37.1",mode:r?"pure":"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:function(e,t,n){"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495:function(e,t,n){"use strict";var r=n(7388),o=n(9039),i=n(4475).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},5610:function(e,t,n){"use strict";var r=n(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):i(n,t)}},5397:function(e,t,n){"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},1291:function(e,t,n){"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014:function(e,t,n){"use strict";var r=n(1291),o=Math.min;e.exports=function(e){var t=r(e);return t>0?o(t,9007199254740991):0}},8981:function(e,t,n){"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},2777:function(e,t,n){"use strict";var r=n(9565),o=n(34),i=n(757),a=n(5966),s=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:function(e,t,n){"use strict";var r=n(2777),o=n(757);e.exports=function(e){var t=r(e,"string");return o(t)?t:t+""}},2140:function(e,t,n){"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},655:function(e,t,n){"use strict";var r=n(6955),o=String;e.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:function(e,t,n){"use strict";var r=n(9504),o=0,i=Math.random(),a=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},7040:function(e,t,n){"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:function(e,t,n){"use strict";var r=n(3724),o=n(9039);e.exports=r&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:function(e,t,n){"use strict";var r=n(4475),o=n(4901),i=r.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8227:function(e,t,n){"use strict";var r=n(4475),o=n(5745),i=n(9297),a=n(3392),s=n(4495),c=n(7040),l=r.Symbol,u=o("wks"),d=c?l.for||l:l&&l.withoutSetter||a;e.exports=function(e){return i(u,e)||(u[e]=s&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},8107:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(1291),s=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=i(t),r=a(e),s=r>=0?r:n+r;return s<0||s>=n?void 0:t[s]}}),s("at")},4114:function(e,t,n){"use strict";var r=n(6518),o=n(8981),i=n(6198),a=n(4527),s=n(6837);r({target:"Array",proto:!0,arity:1,forced:n(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=o(this),n=i(t),r=arguments.length;s(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},7642:function(e,t,n){"use strict";var r=n(6518),o=n(3440);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference")},{difference:o})},8004:function(e,t,n){"use strict";var r=n(6518),o=n(9039),i=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection")||o((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}))},{intersection:i})},3853:function(e,t,n){"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom")},{isDisjointFrom:o})},5876:function(e,t,n){"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf")},{isSubsetOf:o})},2475:function(e,t,n){"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf")},{isSupersetOf:o})},5024:function(e,t,n){"use strict";var r=n(6518),o=n(3650);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")},{symmetricDifference:o})},1698:function(e,t,n){"use strict";var r=n(6518),o=n(4204);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")},{union:o})},3375:function(e,t,n){"use strict";n(7642)},9225:function(e,t,n){"use strict";n(8004)},3972:function(e,t,n){"use strict";n(3853)},9209:function(e,t,n){"use strict";n(5876)},5714:function(e,t,n){"use strict";n(2475)},7561:function(e,t,n){"use strict";n(5024)},6197:function(e,t,n){"use strict";n(1698)},4979:function(e,t,n){"use strict";var r=n(6518),o=n(4475),i=n(7751),a=n(6980),s=n(4913).f,c=n(9297),l=n(679),u=n(3167),d=n(2603),p=n(5002),h=n(6193),f=n(3724),m=n(6395),v="DOMException",y=i("Error"),g=i(v),_=function(){l(this,b);var e=arguments.length,t=d(e<1?void 0:arguments[0]),n=d(e<2?void 0:arguments[1],"Error"),r=new g(t,n),o=new y(t);return o.name=v,s(r,"stack",a(1,h(o.stack,1))),u(r,this,_),r},b=_.prototype=g.prototype,w="stack"in new y(v),C="stack"in new g(1,2),x=g&&f&&Object.getOwnPropertyDescriptor(o,v),E=!(!x||x.writable&&x.configurable),S=w&&!E&&!C;r({global:!0,constructor:!0,forced:m||S},{DOMException:S?_:g});var T=i(v),N=T.prototype;if(N.constructor!==T)for(var k in m||s(N,"constructor",a(1,T)),p)if(c(p,k)){var A=p[k],I=A.s;c(T,I)||s(T,I,a(6,A.c))}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e}();var r={};return function(){"use strict";n.r(r),n.d(r,{API:function(){return we},AgentInfo:function(){return kl},Chat:function(){return yc},ChatFrame:function(){return ll},ComponentFilter:function(){return xs},Conversation:function(){return cc},Engine:function(){return xl},EntryContainer:function(){return al},EventParticipant:function(){return ha},ExternalApi:function(){return Tl},Header:function(){return Al},Icon:function(){return ga},Interrupt:function(){return cl},MessageContainer:function(){return fa},SeamlyActivityMonitor:function(){return Es},SeamlyApiContext:function(){return Si},SeamlyEventBusContext:function(){return Ti},SeamlyFileUpload:function(){return Ns},SeamlyGeneralError:function(){return c},SeamlyLiveRegionContext:function(){return Ni},SeamlyOfflineError:function(){return Cr},SeamlyStoreProvider:function(){return Dn},Text:function(){return gs},TextEntry:function(){return Qc},Upload:function(){return ol},View:function(){return wl},calculateVisibility:function(){return _n},className:function(){return Qi},default:function(){return Il},eventTypes:function(){return N},randomId:function(){return m},useChoicePrompt:function(){return Na},useEvents:function(){return Gn},useGeneratedId:function(){return da},useI18n:function(){return wi},useSeamlyActions:function(){return Nl},useSeamlyChat:function(){return Di},useSeamlyCommands:function(){return Ri},useSeamlyConfig:function(){return $n},useSeamlyEventStream:function(){return pa},useSeamlyIdleDetachCountdown:function(){return la},useSeamlyMessageContainerClassNames:function(){return ea},useSeamlyOptions:function(){return ia},useSeamlyVisibility:function(){return Ci},useTranslatedEventData:function(){return qi},useTranslations:function(){return Wi},useTranslationsContainer:function(){return Gi},visibilityStates:function(){return yn}}),n(9497),n(4114);var e=n(2086),t=n.n(e),o=n(172);class i extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class a extends Error{action="";langKey="";constructor(e,...t){if(super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Object.getPrototypeOf(this)),this.originalError=e,e?.payload&&(this.originalEvent=e,this.originalError=e.payload.error,this.message=`Event of type ${e.payload.type} encountered`),!this.message&&e?.message){const t=function(e){try{return JSON.parse(e).error}catch(t){return e}}(e.message);this.message=t}e?.error&&(this.originalError=e.error)}}class s extends a{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class c extends a{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class l extends a{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class u extends a{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}const d="cvco",p="seamly-client-participant",h=50,f=300;function m(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}function v(e){const t=`cvco.${e}`;return{get(){const e=[t,t.split(".").slice(0,-1).join(".")];let n;do{n=sessionStorage.getItem(e[0])}while(e.shift()&&!n);return n?JSON.parse(n):{}},set(e){e&&sessionStorage.setItem(t,JSON.stringify(e))}}}const y=(e,t)=>{let n;return function(...r){let o=!1;return clearTimeout(n),n=setTimeout((()=>{n=null,o||e.apply(this,r),o=!1}),t),t=>{o=!0,t&&e.apply(this,r)}}},g=e=>Math.ceil(e/1e3),_=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},b=(e,t=2)=>{if(0===e)return"0 Bytes";const n=t<0?0:t,r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(n))} ${["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`},w={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},C={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},x=e=>e.code?C[e.code]:w[e.keyCode],E=e=>{e&&e.focus()},S=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function T(e){return"object"==typeof e}const N={info:"info",message:"message",participant:"participant",system:"system"},k="text",A="text",I="upload",O="received",R="read",L="custom",P="typing",M="read",j="detach_service",D="dismiss",U="set_topic",F="click_cta",B="translation_proposal",z=B,H="window_api",$="assertive",V="polite",K={new_topic:"newTopic",new_translation:"newTranslation"},J="uploads",W="navigate";n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(4979);var q=e=>"function"==typeof e?e:function(){return e},G="undefined"!=typeof self?self:null,X="undefined"!=typeof window?window:null,Y=G||X||Y,Q="closed",Z="errored",ee="joined",te="joining",ne="leaving",re="phx_close",oe="phx_error",ie="phx_reply",ae="phx_leave",se="websocket",ce=class{constructor(e,t,n,r){this.channel=e,this.event=t,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}resend(e){this.timeout=e,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}matchReceive({status:e,response:t,_ref:n}){this.recHooks.filter((t=>t.status===e)).forEach((e=>e.callback(t)))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(e=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=e,this.matchReceive(e)})),this.timeoutTimer=setTimeout((()=>{this.trigger("timeout",{})}),this.timeout)}hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}trigger(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}},le=class{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=null,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout((()=>{this.tries=this.tries+1,this.callback()}),this.timerCalc(this.tries+1))}},ue=class{constructor(e,t,n){this.state=Q,this.topic=e,this.params=q(t||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new ce(this,"phx_join",this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new le((()=>{this.socket.isConnected()&&this.rejoin()}),this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError((()=>this.rejoinTimer.reset()))),this.stateChangeRefs.push(this.socket.onOpen((()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()}))),this.joinPush.receive("ok",(()=>{this.state=ee,this.rejoinTimer.reset(),this.pushBuffer.forEach((e=>e.send())),this.pushBuffer=[]})),this.joinPush.receive("error",(()=>{this.state=Z,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.onClose((()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic} ${this.joinRef()}`),this.state=Q,this.socket.remove(this)})),this.onError((e=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,e),this.isJoining()&&this.joinPush.reset(),this.state=Z,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.joinPush.receive("timeout",(()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic} (${this.joinRef()})`,this.joinPush.timeout),new ce(this,ae,q({}),this.timeout).send(),this.state=Z,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()})),this.on(ie,((e,t)=>{this.trigger(this.replyEventName(t),e)}))}join(e=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=e,this.joinedOnce=!0,this.rejoin(),this.joinPush}onClose(e){this.on(re,e)}onError(e){return this.on(oe,(t=>e(t)))}on(e,t){let n=this.bindingRef++;return this.bindings.push({event:e,ref:n,callback:t}),n}off(e,t){this.bindings=this.bindings.filter((n=>!(n.event===e&&(void 0===t||t===n.ref))))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(e,t,n=this.timeout){if(t=t||{},!this.joinedOnce)throw new Error(`tried to push '${e}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new ce(this,e,(function(){return t}),n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(e=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=ne;let t=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(re,"leave")},n=new ce(this,ae,q({}),e);return n.receive("ok",(()=>t())).receive("timeout",(()=>t())),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(e,t,n){return t}isMember(e,t,n,r){return!(this.topic!==e||r&&r!==this.joinRef()&&(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:e,event:t,payload:n,joinRef:r}),1))}joinRef(){return this.joinPush.ref}rejoin(e=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=te,this.joinPush.resend(e))}trigger(e,t,n,r){let o=this.onMessage(e,t,n,r);if(t&&!o)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter((t=>t.event===e));for(let e=0;e<i.length;e++)i[e].callback(o,n,r||this.joinRef())}replyEventName(e){return`chan_reply_${e}`}isClosed(){return this.state===Q}isErrored(){return this.state===Z}isJoined(){return this.state===ee}isJoining(){return this.state===te}isLeaving(){return this.state===ne}},de=class{static request(e,t,n,r,o,i,a){if(Y.XDomainRequest){let n=new Y.XDomainRequest;return this.xdomainRequest(n,e,t,r,o,i,a)}{let s=new Y.XMLHttpRequest;return this.xhrRequest(s,e,t,n,r,o,i,a)}}static xdomainRequest(e,t,n,r,o,i,a){return e.timeout=o,e.open(t,n),e.onload=()=>{let t=this.parseJSON(e.responseText);a&&a(t)},i&&(e.ontimeout=i),e.onprogress=()=>{},e.send(r),e}static xhrRequest(e,t,n,r,o,i,a,s){return e.open(t,n,!0),e.timeout=i,e.setRequestHeader("Content-Type",r),e.onerror=()=>s&&s(null),e.onreadystatechange=()=>{if(4===e.readyState&&s){let t=this.parseJSON(e.responseText);s(t)}},a&&(e.ontimeout=a),e.send(o),e}static parseJSON(e){if(!e||""===e)return null;try{return JSON.parse(e)}catch(t){return console&&console.log("failed to parse JSON response",e),null}}static serialize(e,t){let n=[];for(var r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let o=t?`${t}[${r}]`:r,i=e[r];"object"==typeof i?n.push(this.serialize(i,o)):n.push(encodeURIComponent(o)+"="+encodeURIComponent(i))}return n.join("&")}static appendParams(e,t){if(0===Object.keys(t).length)return e;let n=e.match(/\?/)?"&":"?";return`${e}${n}${this.serialize(t)}`}},pe=class{constructor(e){this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(e),this.readyState=0,setTimeout((()=>this.poll()),0)}normalizeEndpoint(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+se),"$1/longpoll")}endpointURL(){return de.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(e,t,n){this.close(e,t,n),this.readyState=0}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return 1===this.readyState||0===this.readyState}poll(){this.ajax("GET","application/json",null,(()=>this.ontimeout()),(e=>{if(e){var{status:t,token:n,messages:r}=e;this.token=n}else t=0;switch(t){case 200:r.forEach((e=>{setTimeout((()=>this.onmessage({data:e})),0)})),this.poll();break;case 204:this.poll();break;case 410:this.readyState=1,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${t}`)}}))}send(e){"string"!=typeof e&&(e=(e=>{let t="",n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)})(e)),this.currentBatch?this.currentBatch.push(e):this.awaitingBatchAck?this.batchBuffer.push(e):(this.currentBatch=[e],this.currentBatchTimer=setTimeout((()=>{this.batchSend(this.currentBatch),this.currentBatch=null}),0))}batchSend(e){this.awaitingBatchAck=!0,this.ajax("POST","application/x-ndjson",e.join("\n"),(()=>this.onerror("timeout")),(e=>{this.awaitingBatchAck=!1,e&&200===e.status?this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[]):(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1))}))}close(e,t,n){for(let e of this.reqs)e.abort();this.readyState=3;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:e,reason:t,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,"undefined"!=typeof CloseEvent?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(e,t,n,r,o){let i;i=de.request(e,this.endpointURL(),t,n,this.timeout,(()=>{this.reqs.delete(i),r()}),(e=>{this.reqs.delete(i),this.isActive()&&o(e)})),this.reqs.add(i)}},he={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(e,t){if(e.payload.constructor===ArrayBuffer)return t(this.binaryEncode(e));{let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return t(JSON.stringify(n))}},decode(e,t){if(e.constructor===ArrayBuffer)return t(this.binaryDecode(e));{let[n,r,o,i,a]=JSON.parse(e);return t({join_ref:n,ref:r,topic:o,event:i,payload:a})}},binaryEncode(e){let{join_ref:t,ref:n,event:r,topic:o,payload:i}=e,a=this.META_LENGTH+t.length+n.length+o.length+r.length,s=new ArrayBuffer(this.HEADER_LENGTH+a),c=new DataView(s),l=0;c.setUint8(l++,this.KINDS.push),c.setUint8(l++,t.length),c.setUint8(l++,n.length),c.setUint8(l++,o.length),c.setUint8(l++,r.length),Array.from(t,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(n,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(o,(e=>c.setUint8(l++,e.charCodeAt(0)))),Array.from(r,(e=>c.setUint8(l++,e.charCodeAt(0))));var u=new Uint8Array(s.byteLength+i.byteLength);return u.set(new Uint8Array(s),0),u.set(new Uint8Array(i),s.byteLength),u.buffer},binaryDecode(e){let t=new DataView(e),n=t.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(e,t,r);case this.KINDS.reply:return this.decodeReply(e,t,r);case this.KINDS.broadcast:return this.decodeBroadcast(e,t,r)}},decodePush(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,s=n.decode(e.slice(a,a+r));a+=r;let c=n.decode(e.slice(a,a+o));a+=o;let l=n.decode(e.slice(a,a+i));return a+=i,{join_ref:s,ref:null,topic:c,event:l,payload:e.slice(a,e.byteLength)}},decodeReply(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=t.getUint8(3),a=t.getUint8(4),s=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(e.slice(s,s+r));s+=r;let l=n.decode(e.slice(s,s+o));s+=o;let u=n.decode(e.slice(s,s+i));s+=i;let d=n.decode(e.slice(s,s+a));s+=a;let p=e.slice(s,e.byteLength);return{join_ref:c,ref:l,topic:u,event:ie,payload:{status:d,response:p}}},decodeBroadcast(e,t,n){let r=t.getUint8(1),o=t.getUint8(2),i=this.HEADER_LENGTH+2,a=n.decode(e.slice(i,i+r));i+=r;let s=n.decode(e.slice(i,i+o));return i+=o,{join_ref:null,ref:null,topic:a,event:s,payload:e.slice(i,e.byteLength)}}},fe=class{constructor(e,t={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=t.timeout||1e4,this.transport=t.transport||Y.WebSocket||pe,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=t.longPollFallbackMs,this.fallbackTimer=null,this.sessionStore=t.sessionStorage||Y.sessionStorage,this.establishedConnections=0,this.defaultEncoder=he.encode.bind(he),this.defaultDecoder=he.decode.bind(he),this.closeWasClean=!1,this.binaryType=t.binaryType||"arraybuffer",this.connectClock=1,this.transport!==pe?(this.encode=t.encode||this.defaultEncoder,this.decode=t.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;X&&X.addEventListener&&(X.addEventListener("pagehide",(e=>{this.conn&&(this.disconnect(),n=this.connectClock)})),X.addEventListener("pageshow",(e=>{n===this.connectClock&&(n=null,this.connect())}))),this.heartbeatIntervalMs=t.heartbeatIntervalMs||3e4,this.rejoinAfterMs=e=>t.rejoinAfterMs?t.rejoinAfterMs(e):[1e3,2e3,5e3][e-1]||1e4,this.reconnectAfterMs=e=>t.reconnectAfterMs?t.reconnectAfterMs(e):[10,50,100,150,200,250,500,1e3,2e3][e-1]||5e3,this.logger=t.logger||null,!this.logger&&t.debug&&(this.logger=(e,t,n)=>{console.log(`${e}: ${t}`,n)}),this.longpollerTimeout=t.longpollerTimeout||2e4,this.params=q(t.params||{}),this.endPoint=`${e}/${se}`,this.vsn=t.vsn||"2.0.0",this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new le((()=>{this.teardown((()=>this.connect()))}),this.reconnectAfterMs)}getLongPollTransport(){return pe}replaceTransport(e){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=e}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let e=de.appendParams(de.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?`${this.protocol()}:${e}`:`${this.protocol()}://${location.host}${e}`}disconnect(e,t,n){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(e,t,n)}connect(e){e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=q(e)),this.conn||(this.longPollFallbackMs&&this.transport!==pe?this.connectWithFallback(pe,this.longPollFallbackMs):this.transportConnect())}log(e,t,n){this.logger&&this.logger(e,t,n)}hasLogger(){return null!==this.logger}onOpen(e){let t=this.makeRef();return this.stateChangeCallbacks.open.push([t,e]),t}onClose(e){let t=this.makeRef();return this.stateChangeCallbacks.close.push([t,e]),t}onError(e){let t=this.makeRef();return this.stateChangeCallbacks.error.push([t,e]),t}onMessage(e){let t=this.makeRef();return this.stateChangeCallbacks.message.push([t,e]),t}ping(e){if(!this.isConnected())return!1;let t=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:t});let r=this.onMessage((o=>{o.ref===t&&(this.off([r]),e(Date.now()-n))}));return!0}transportConnect(){this.connectClock++,this.closeWasClean=!1,this.conn=new this.transport(this.endPointURL()),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(e){return this.sessionStore&&this.sessionStore.getItem(e)}storeSession(e,t){this.sessionStore&&this.sessionStore.setItem(e,t)}connectWithFallback(e,t=2500){clearTimeout(this.fallbackTimer);let n,r=!1,o=!0,i=t=>{this.log("transport",`falling back to ${e.name}...`,t),this.off([void 0,n]),o=!1,this.replaceTransport(e),this.transportConnect()};if(this.getSession(`phx:fallback:${e.name}`))return i("memorized");this.fallbackTimer=setTimeout(i,t),n=this.onError((e=>{this.log("transport","error",e),o&&!r&&(clearTimeout(this.fallbackTimer),i(e))})),this.onOpen((()=>{if(r=!0,!o)return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${e.name}`,"true"),this.log("transport",`established ${e.name} fallback`);clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(i,t),this.ping((e=>{this.log("transport","connected to primary after",e),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)}))})),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`${this.transport.name} connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.resetHeartbeat(),this.stateChangeCallbacks.open.forEach((([,e])=>e()))}heartbeatTimeout(){this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection"),this.triggerChanError(),this.closeWasClean=!1,this.teardown((()=>this.reconnectTimer.scheduleTimeout()),1e3,"heartbeat timeout"))}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs))}teardown(e,t,n){if(!this.conn)return e&&e();this.waitForBufferDone((()=>{this.conn&&(t?this.conn.close(t,n||""):this.conn.close()),this.waitForSocketClosed((()=>{this.conn&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),e&&e()}))}))}waitForBufferDone(e,t=1){5!==t&&this.conn&&this.conn.bufferedAmount?setTimeout((()=>{this.waitForBufferDone(e,t+1)}),150*t):e()}waitForSocketClosed(e,t=1){5!==t&&this.conn&&3!==this.conn.readyState?setTimeout((()=>{this.waitForSocketClosed(e,t+1)}),150*t):e()}onConnClose(e){let t=e&&e.code;this.hasLogger()&&this.log("transport","close",e),this.triggerChanError(),this.clearHeartbeats(),this.closeWasClean||1e3===t||this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((([,t])=>t(e)))}onConnError(e){this.hasLogger()&&this.log("transport",e);let t=this.transport,n=this.establishedConnections;this.stateChangeCallbacks.error.forEach((([,r])=>{r(e,t,n)})),(t===this.transport||n>0)&&this.triggerChanError()}triggerChanError(){this.channels.forEach((e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(oe)}))}connectionState(){switch(this.conn&&this.conn.readyState){case 0:return"connecting";case 1:return"open";case 2:return"closing";default:return"closed"}}isConnected(){return"open"===this.connectionState()}remove(e){this.off(e.stateChangeRefs),this.channels=this.channels.filter((t=>t!==e))}off(e){for(let t in this.stateChangeCallbacks)this.stateChangeCallbacks[t]=this.stateChangeCallbacks[t].filter((([t])=>-1===e.indexOf(t)))}channel(e,t={}){let n=new ue(e,t,this);return this.channels.push(n),n}push(e){if(this.hasLogger()){let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;this.log("push",`${t} ${n} (${i}, ${o})`,r)}this.isConnected()?this.encode(e,(e=>this.conn.send(e))):this.sendBuffer.push((()=>this.encode(e,(e=>this.conn.send(e)))))}makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}sendHeartbeat(){this.pendingHeartbeatRef&&!this.isConnected()||(this.pendingHeartbeatRef=this.makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.heartbeatTimeoutTimer=setTimeout((()=>this.heartbeatTimeout()),this.heartbeatIntervalMs))}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((e=>e())),this.sendBuffer=[])}onConnMessage(e){this.decode(e.data,(e=>{let{topic:t,event:n,payload:r,ref:o,join_ref:i}=e;o&&o===this.pendingHeartbeatRef&&(this.clearHeartbeats(),this.pendingHeartbeatRef=null,this.heartbeatTimer=setTimeout((()=>this.sendHeartbeat()),this.heartbeatIntervalMs)),this.hasLogger()&&this.log("receive",`${r.status||""} ${t} ${n} ${o&&"("+o+")"||""}`,r);for(let e=0;e<this.channels.length;e++){const a=this.channels[e];a.isMember(t,n,r,i)&&a.trigger(n,r,o,i)}for(let t=0;t<this.stateChangeCallbacks.message.length;t++){let[,n]=this.stateChangeCallbacks.message[t];n(e)}}))}leaveOpenTopic(e){let t=this.channels.find((t=>t.topic===e&&(t.isJoined()||t.isJoining())));t&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${e}"`),t.leave())}};const me=()=>null,ve=new Set;class ye{#e=[];async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o,params:i}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((function(e,t){const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}}),{})}})(this.url);this.socket=new fe(o,{params:{...i,v:"3"},reconnectAfterMs:e=>{const t=2**e*250;return Math.min(t,1e4)}}),this.socket.onError((e=>{me("[SOCKET][ERROR]",e)})),this.socket.onOpen((()=>{me("[SOCKET]OPEN")})),this.socket.onClose((()=>{me("[SOCKET]CLOSE"),this.#t({connected:!1,ready:!1,currentState:"socket_closed"})})),this.socket.connect(),this.channel=this.socket.channel(this.channelTopic,{authorization:`Bearer ${this.accessToken}`,channelName:this.channelName}),this.start(),this.channel.on("system",(e=>{"attach_channel_succeeded"===e.type&&this.#t({connected:!0,ready:!0,currentState:"attach_channel_succeeded"})})),this.channel.onClose((()=>{me("[CHANNEL]CLOSE"),this.#t({connected:!1,ready:!1,currentState:"channel_closed"})})),this.channel.onError((e=>{me("[CHANNEL][ERROR]",e),this.#t({connected:!1,ready:!1,currentState:"channel_erred"})})),this.#n("ack","ui","error","participant","message","service_data","system","info","sync")}start(){this.channel?.join().receive("ok",(()=>{me("[CHANNEL][JOIN] OK"),this.#t({connected:!0,ready:!1,currentState:"join_channel_succeeded"})})).receive("error",(e=>{me("[CHANNEL][JOIN] ERROR",e),this.#t({connected:!1,ready:!1,currentState:"join_channel_erred"})})).receive("timeout",(()=>{me("[CHANEL][JOIN] Networking issue. Still waiting...")}))}disconnect(){this.channel?.leave().receive("ok",(()=>{this.socket?.disconnect(),me("[CHANNEL][LEAVE] OK"),this.#e=[]}))}#n(...e){e.forEach((e=>{this.channel?.on(e,(t=>{me("[RECEIVE]",e,t)}))}))}onConnection(e){this.#e.push(e)}#t(e){this.#e=this.#e.filter((t=>!t(e))),ve.forEach((e=>e()))}pushToChannel(e,t,n=1e4){this.channel?.push(e,t,n)}static subscribe(e){return ve.add(e),()=>ve.delete(e)}}const ge=()=>null,_e=async(e,t)=>{const n=new URL(e);n.searchParams.set("v","3");const r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new i(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function be(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:null}class we{#r;#o;#i;#a="window";#s;conversation=new ye;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get(e){return void 0===e?r:r[e]},set(e,t){return r[e]=t,n.set(r),t},delete(e){const t=this.get(e);return delete r[e],n.set(r),t}}}(`${t}.connection${r?.userLocale?`.${r.userLocale}`:""}`,n.storageProvider||v),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#s={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r?.channelName||"web"}},this.#r=!1,this.connected=!1,this.configReady=!1,this.#o=n.externalId,e&&(this.#a=e),this.userResponded=!1,this.URLS={},window.addEventListener("pageshow",(e=>{e.persisted&&this.connected&&this.connect()}))}#c(){return this.store.get("accessToken")}#l(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}#u(e){this.store.set("conversationUrl",e)}hasConversation(){return!!this.getConversationUrl()}#d(){return this.store.get("channelTopic")||this.store.get("channelName")}#p(e){this.store.set("channelTopic",e)}#h=e=>e||this.locale;clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#f(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}#m({_links:e}){this.URLS=Object.entries(e).filter((([e])=>"self"!==e)).reduce(((e,[t,{href:n}])=>(e[t]=n,e)),this.URLS)}async reset(){return await this.disconnect(),this.clearStore(),this.getConfig()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async#v(){if(!this.hasConversation())try{"function"==typeof this.#s?.getConversationAuthToken&&(this.#i=await this.#s.getConversationAuthToken());const e=await _e(`${this.#f("http")}${this.URLS.conversations}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#i?void 0:this.#o,token:this.#i})}),t=await e.json(),{conversation:n}=t,r={...n};return delete r.accessToken,delete r.channelTopic,this.#l(n.accessToken),this.#p(n.channelTopic),this.#m(t),this.URLS.conversation&&this.#u(this.URLS.conversation),this.locale=n.translation?.locale,this.userResponded=n.userResponded,r}catch(e){if(e.status>=500)throw new c(e);if(400===e.status)throw new u(e);if(404===e.status)throw new s(e);throw e}}async getConfig(){try{const e=await _e(`${this.#f("http")}/client/${this.connectionInfo.apiKey}/configs`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:{...this.#s.context,environment:!0===this.#s.sendEnvironment?this.getEnvironment():this.#s.sendEnvironment}})}),t=await e.json();return this.#m(t),delete this.URLS.socket,this.configReady=!0,t.config}catch(e){if(404===e.status)throw new s(e);if(e.status>=500)throw new c(e);throw e}}async getConversation(){if(!this.hasConversation())return null;try{const e=await _e(`${this.#f("http")}${this.URLS.history}`,{method:"GET",headers:{Authorization:`Bearer ${this.#c()}`}}),t=await e.json();this.#m(t);const{messages:n,participants:r,activeServiceSessionId:o,activeServiceSettings:i,serviceData:a,ui:s,translation:c}=t.history;return{events:n.map((([e,t])=>({type:e,payload:{...t,type:"participant"===e?e:t.type}}))),participants:r,activeServiceSessionId:o,activeServiceSettings:i,serviceData:a,resumeConversationPrompt:!!s&&Boolean(s.resumeConversationPrompt),translationProposal:s.translationProposal,translation:c}}catch(e){if(401===e.status)throw new u(e);if(404===e.status)throw new l(e);if(e.status>=500)throw new c(e);throw new i(e)}}async connect(){this.connected=!1;const e=await this.#v();return this.URLS.socket&&(this.conversation.connect(`${this.#f("ws")}${this.URLS.socket}`,this.#s.context.channelName,this.#d(),this.#c()),this.conversation.onConnection((({connected:e,ready:t})=>{this.connected=e,this.#r=t}))),e}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const i=new XMLHttpRequest;return i.open("POST",`${this.#f("http")}${this.URLS.uploads}`),i.setRequestHeader("Authorization",`Bearer ${this.#c()}`),i.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},i.onloadend=()=>{if(0!==i.status)if(200!==i.status&&201!==i.status||!n){if(!r)throw new Error(i.response);try{r(JSON.parse(i.response))}catch(e){r(i.response)}}else try{n(JSON.parse(i.response))}catch(e){n(i.response)}},i.send(o),i}async getConversationIntitialState(){try{const n=await _e(`${this.#f("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.#c()}`}}),r=await n.json();return this.#m(r),this.userResponded=r.conversation.userResponded,e=r.conversation,t=["accessToken","channelTopic"],Object.keys(e).reduce(((n,r)=>(t.includes(r)||(n[r]=e[r]),n)),{})}catch(e){if(401===e.status)throw new u(e);if(404===e.status)throw new l(e);if(e.status>=500)throw new c(e);throw e}var e,t}async getTranslations(e){try{if(!this.URLS.translations)throw new s;const t=this.#h(e);if(!t)throw new c;const n=`${this.#f("http")}${this.URLS.translations}`.replace("{version}",String(4)).replace("{locale}",t),r=await _e(n,{method:"GET"});return(await r.json()).translations}catch(e){if(e.status>=500)throw new c(e);throw new i(e)}}send(e,t=void 0,n=!0){!this.connected||n&&!this.#r?this.conversation?.onConnection((({connected:r,ready:o})=>(this.connected=r,this.#r=o,!!(n?o:r)&&(this.send(e,t,n),!0)))):(ge("[SEND]",e,t),this.conversation.pushToChannel(e,function(e,t){if("message"!==e)return t;const{type:n,body:r}=t;let{transactionId:o}=t;return o||(o=m()),{type:n,body:r,transactionId:o}}(e,t),1e4))}sendContext(e){const{contentLocale:t,source:n,userLocale:r,variables:o,environment:i}=e,a={};if(i&&(a.environment=i),t){if("string"!=typeof t)throw new Error("Content locale must be a string");a.contentLocale=t}if(n){if("string"!=typeof n)throw new Error("Source must be a string");a.source=n}if(r){if("string"!=typeof r)throw new Error("User locale must be a string");a.userLocale=r,this.#y(a,r)}if(o){if("object"!=typeof o)throw new Error("Variables must be an object");a.variables=o}0===Object.keys(a).length&&a.constructor===Object||this.send("context",a,!1)}#y(e,t){e.source||t==this.#s.context?.userLocale||(e.source=H)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#a,clientVersion:"23.0.6-alpha.2",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:be(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}var Ce=Symbol.for("immer-nothing"),xe=Symbol.for("immer-draftable"),Ee=Symbol.for("immer-state");function Se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Ne(e){return!!e&&!!e[Ee]}function ke(e){return!!e&&(Ie(e)||Array.isArray(e)||!!e[xe]||!!e.constructor?.[xe]||Me(e)||je(e))}var Ae=Object.prototype.constructor.toString();function Ie(e){if(!e||"object"!=typeof e)return!1;const t=Te(e);if(null===t)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Ae}function Oe(e,t){0===Re(e)?Reflect.ownKeys(e).forEach((n=>{t(n,e[n],e)})):e.forEach(((n,r)=>t(r,n,e)))}function Re(e){const t=e[Ee];return t?t.type_:Array.isArray(e)?1:Me(e)?2:je(e)?3:0}function Le(e,t){return 2===Re(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Pe(e,t,n){const r=Re(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Me(e){return e instanceof Map}function je(e){return e instanceof Set}function De(e){return e.copy_||e.base_}function Ue(e,t){if(Me(e))return new Map(e);if(je(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Ie(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[Ee];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],i=t[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(t[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:e[o]})}return Object.create(Te(e),t)}{const t=Te(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function Fe(e,t=!1){return ze(e)||Ne(e)||!ke(e)||(Re(e)>1&&(e.set=e.add=e.clear=e.delete=Be),Object.freeze(e),t&&Object.entries(e).forEach((([e,t])=>Fe(t,!0)))),e}function Be(){Se(2)}function ze(e){return Object.isFrozen(e)}var He,$e={};function Ve(e){const t=$e[e];return t||Se(0),t}function Ke(){return He}function Je(e,t){t&&(Ve("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function We(e){qe(e),e.drafts_.forEach(Xe),e.drafts_=null}function qe(e){e===He&&(He=e.parent_)}function Ge(e){return He={drafts_:[],parent_:He,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xe(e){const t=e[Ee];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Ye(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[Ee].modified_&&(We(t),Se(4)),ke(e)&&(e=Qe(t,e),t.parent_||et(t,e)),t.patches_&&Ve("Patches").generateReplacementPatches_(n[Ee].base_,e,t.patches_,t.inversePatches_)):e=Qe(t,n,[]),We(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ce?e:void 0}function Qe(e,t,n){if(ze(t))return t;const r=t[Ee];if(!r)return Oe(t,((o,i)=>Ze(e,r,t,o,i,n))),t;if(r.scope_!==e)return t;if(!r.modified_)return et(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,i=!1;3===r.type_&&(o=new Set(t),t.clear(),i=!0),Oe(o,((o,a)=>Ze(e,r,t,o,a,n,i))),et(e,t,!1),n&&e.patches_&&Ve("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Ze(e,t,n,r,o,i,a){if(Ne(o)){const a=Qe(e,o,i&&t&&3!==t.type_&&!Le(t.assigned_,r)?i.concat(r):void 0);if(Pe(n,r,a),!Ne(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(ke(o)&&!ze(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Qe(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!Object.prototype.propertyIsEnumerable.call(n,r)||et(e,o)}}function et(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Fe(t,n)}var tt={get(e,t){if(t===Ee)return e;const n=De(e);if(!Le(n,t))return function(e,t,n){const r=ot(t,n);return r?"value"in r?r.value:r.get?.call(e.draft_):void 0}(e,n,t);const r=n[t];return e.finalized_||!ke(r)?r:r===rt(e.base_,t)?(at(e),e.copy_[t]=st(r,e)):r},has(e,t){return t in De(e)},ownKeys(e){return Reflect.ownKeys(De(e))},set(e,t,n){const r=ot(De(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=rt(De(e),t),a=r?.[Ee];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(i=r)?0!==o||1/o==1/i:o!=o&&i!=i)&&(void 0!==n||Le(e.base_,t)))return!0;at(e),it(e)}var o,i;return e.copy_[t]===n&&(void 0!==n||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 void 0!==rt(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,at(e),it(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=De(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){Se(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){Se(12)}},nt={};function rt(e,t){const n=e[Ee];return(n?De(n):e)[t]}function ot(e,t){if(!(t in e))return;let n=Te(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=Te(n)}}function it(e){e.modified_||(e.modified_=!0,e.parent_&&it(e.parent_))}function at(e){e.copy_||(e.copy_=Ue(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function st(e,t){const n=Me(e)?Ve("MapSet").proxyMap_(e,t):je(e)?Ve("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ke(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,i=tt;n&&(o=[r],i=nt);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return r.draft_=s,r.revoke_=a,s}(e,t);return(t?t.scope_:Ke()).drafts_.push(n),n}function ct(e){return Ne(e)||Se(10),lt(e)}function lt(e){if(!ke(e)||ze(e))return e;const t=e[Ee];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ue(e,t.scope_.immer_.useStrictShallowCopy_)}else n=Ue(e,!0);return Oe(n,((e,t)=>{Pe(n,e,lt(t))})),t&&(t.finalized_=!1),n}Oe(tt,((e,t)=>{nt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),nt.deleteProperty=function(e,t){return nt.set.call(this,e,t,void 0)},nt.set=function(e,t,n){return tt.set.call(this,e[0],t,n,e[0])};var ut=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,n)=>{if("function"==typeof e&&"function"!=typeof t){const n=t;t=e;const r=this;return function(e=n,...o){return r.produce(e,(e=>t.call(this,e,...o)))}}let r;if("function"!=typeof t&&Se(6),void 0!==n&&"function"!=typeof n&&Se(7),ke(e)){const o=Ge(this),i=st(e,void 0);let a=!0;try{r=t(i),a=!1}finally{a?We(o):qe(o)}return Je(o,n),Ye(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===Ce&&(r=void 0),this.autoFreeze_&&Fe(r,!0),n){const t=[],o=[];Ve("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}Se(1)},this.produceWithPatches=(e,t)=>{if("function"==typeof e)return(t,...n)=>this.produceWithPatches(t,(t=>e(t,...n)));let n,r;return[this.produce(e,t,((e,t)=>{n=e,r=t})),n,r]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||Se(8),Ne(e)&&(e=ct(e));const t=Ge(this),n=st(e,void 0);return n[Ee].isManual_=!0,qe(t),n}finishDraft(e,t){const n=e&&e[Ee];n&&n.isManual_||Se(9);const{scope_:r}=n;return Je(r,t),Ye(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));const r=Ve("Patches").applyPatches_;return Ne(e)?r(e,t):this.produce(e,(e=>r(e,t)))}},dt=ut.produce;ut.produceWithPatches.bind(ut),ut.setAutoFreeze.bind(ut),ut.setUseStrictShallowCopy.bind(ut),ut.applyPatches.bind(ut),ut.createDraft.bind(ut),ut.finishDraft.bind(ut);var pt=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var ht="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}},ft=0,mt=1;function vt(){return{s:ft,v:void 0,o:null,p:null}}function yt(e,t={}){let n=vt();const{resultEqualityCheck:r}=t;let o,i=0;function a(){let t=n;const{length:a}=arguments;for(let e=0,n=a;e<n;e++){const n=arguments[e];if("function"==typeof n||"object"==typeof n&&null!==n){let e=t.o;null===e&&(t.o=e=new WeakMap);const r=e.get(n);void 0===r?(t=vt(),e.set(n,t)):t=r}else{let e=t.p;null===e&&(t.p=e=new Map);const r=e.get(n);void 0===r?(t=vt(),e.set(n,t)):t=r}}const s=t;let c;if(t.s===mt)c=t.v;else if(c=e.apply(null,arguments),i++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==i&&i--),o="object"==typeof c&&null!==c||"function"==typeof c?new ht(c):c}return s.s=mt,s.v=c,c}return a.clearCache=()=>{n=vt(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function gt(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,i={},a=e.pop();"object"==typeof a&&(i=a,a=e.pop()),function(e,t="expected a function, instead received "+typeof e){if("function"!=typeof e)throw new TypeError(t)}(a,`createSelector expects an output function after the inputs, but received: [${typeof a}]`);const s={...n,...i},{memoize:c,memoizeOptions:l=[],argsMemoize:u=yt,argsMemoizeOptions:d=[],devModeChecks:p={}}=s,h=pt(l),f=pt(d),m=function(e){const t=Array.isArray(e[0])?e[0]:e;return function(e,t="expected all items to be functions, instead received the following types: "){if(!e.every((e=>"function"==typeof e))){const n=e.map((e=>"function"==typeof e?`function ${e.name||"unnamed"}()`:typeof e)).join(", ");throw new TypeError(`${t}[${n}]`)}}(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}(e),v=c((function(){return r++,a.apply(null,arguments)}),...h),y=u((function(){o++;const e=function(e,t){const n=[],{length:r}=e;for(let o=0;o<r;o++)n.push(e[o].apply(null,t));return n}(m,arguments);return t=v.apply(null,e),t}),...f);return Object.assign(y,{resultFunc:a,memoizedResultFunc:v,dependencies:m,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>t,recomputations:()=>r,resetRecomputations:()=>{r=0},memoize:c,argsMemoize:u})};return Object.assign(r,{withTypes:()=>r}),r}var _t=gt(yt),bt=Object.assign(((e,t=_t)=>{!function(e,t="expected an object, instead received "+typeof e){if("object"!=typeof e)throw new TypeError(t)}(e,"createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);const n=Object.keys(e);return t(n.map((t=>e[t])),((...e)=>e.reduce(((e,t,r)=>(e[n[r]]=t,e)),{})))}),{withTypes:()=>bt});function wt(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 Ct=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),xt=()=>Math.random().toString(36).substring(7).split("").join("."),Et={INIT:`@@redux/INIT${xt()}`,REPLACE:`@@redux/REPLACE${xt()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${xt()}`};function St(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Tt(e,t,n){if("function"!=typeof e)throw new Error(wt(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(wt(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(wt(1));return n(Tt)(e,t)}let r=e,o=t,i=new Map,a=i,s=0,c=!1;function l(){a===i&&(a=new Map,i.forEach(((e,t)=>{a.set(t,e)})))}function u(){if(c)throw new Error(wt(3));return o}function d(e){if("function"!=typeof e)throw new Error(wt(4));if(c)throw new Error(wt(5));let t=!0;l();const n=s++;return a.set(n,e),function(){if(t){if(c)throw new Error(wt(6));t=!1,l(),a.delete(n),i=null}}}function p(e){if(!St(e))throw new Error(wt(7));if(void 0===e.type)throw new Error(wt(8));if("string"!=typeof e.type)throw new Error(wt(17));if(c)throw new Error(wt(9));try{c=!0,o=r(o,e)}finally{c=!1}return(i=a).forEach((e=>{e()})),e}return p({type:Et.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(wt(10));r=e,p({type:Et.REPLACE})},[Ct]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(wt(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Ct](){return this}}}}}function Nt(e){const t=Object.keys(e),n={};for(let r=0;r<t.length;r++){const o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}const r=Object.keys(n);let o;try{!function(e){Object.keys(e).forEach((t=>{const n=e[t];if(void 0===n(void 0,{type:Et.INIT}))throw new Error(wt(12));if(void 0===n(void 0,{type:Et.PROBE_UNKNOWN_ACTION()}))throw new Error(wt(13))}))}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let i=!1;const a={};for(let o=0;o<r.length;o++){const s=r[o],c=n[s],l=e[s],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(wt(14));a[s]=u,i=i||u!==l}return i=i||r.length!==Object.keys(e).length,i?a:e}}function kt(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...n)=>e(t(...n))))}function At(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var It=At(),Ot=At,Rt=(((...e)=>{const t=gt(...e),n=Object.assign(((...e)=>{const n=t(...e),r=(e,...t)=>n(Ne(e)?ct(e):e,...t);return Object.assign(r,n),r}),{withTypes:()=>n})})(yt),"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?kt:kt.apply(null,arguments)}),Lt=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Pt(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(dn(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=t=>function(e){return St(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Mt=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function jt(e){return ke(e)?dt(e,(()=>{})):e}function Dt(e,t,n){if(e.has(t)){let r=e.get(t);return n.update&&(r=n.update(r,t,e),e.set(t,r)),r}if(!n.insert)throw new Error(dn(10));const r=n.insert(t,e);return e.set(t,r),r}var Ut=()=>function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let i=new Mt;return t&&("boolean"==typeof t?i.push(It):i.push(Ot(t.extraArgument))),i},Ft=e=>t=>{setTimeout(t,e)},Bt="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ft(10),zt=e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Mt(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,i=!1,a=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?Bt:"callback"===e.type?e.queueNotification:Ft(e.timeout),l=()=>{a=!1,i&&(i=!1,s.forEach((e=>e())))};return Object.assign({},r,{subscribe(e){const t=r.subscribe((()=>o&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,i=!o,i&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r},Ht=!0;function $t(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(dn(28));if(r in t)throw new Error(dn(29));return t[r]=n,o},addMatcher(e,t){return n.push({matcher:e,reducer:t}),o},addDefaultCase(e){return r=e,o}};return e(o),[t,n,r]}var Vt=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t};function Kt(...e){return t=>e.some((e=>((e,t)=>Lt(e)?e.match(t):e(t))(e,t)))}var Jt=["name","message","stack","code"],Wt=class{constructor(e,t){this.payload=e,this.meta=t}_type},qt=class{constructor(e,t){this.payload=e,this.meta=t}_type},Gt=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of Jt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},Xt=(()=>{function e(e,t,n){const r=Pt(e+"/fulfilled",((e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}}))),o=Pt(e+"/pending",((e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}}))),i=Pt(e+"/rejected",((e,t,r,o,i)=>({payload:o,error:(n&&n.serializeError||Gt)(e||"Rejected"),meta:{...i||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}})));return Object.assign((function(e){return(a,s,c)=>{const l=n?.idGenerator?n.idGenerator(e):Vt(),u=new AbortController;let d,p;function h(e){p=e,u.abort()}const f=async function(){let f;try{let i=n?.condition?.(e,{getState:s,extra:c});if(null!==(m=i)&&"object"==typeof m&&"function"==typeof m.then&&(i=await i),!1===i||u.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const v=new Promise(((e,t)=>{d=()=>{t({name:"AbortError",message:p||"Aborted"})},u.signal.addEventListener("abort",d)}));a(o(l,e,n?.getPendingMeta?.({requestId:l,arg:e},{getState:s,extra:c}))),f=await Promise.race([v,Promise.resolve(t(e,{dispatch:a,getState:s,extra:c,requestId:l,signal:u.signal,abort:h,rejectWithValue:(e,t)=>new Wt(e,t),fulfillWithValue:(e,t)=>new qt(e,t)})).then((t=>{if(t instanceof Wt)throw t;return t instanceof qt?r(t.payload,l,e,t.meta):r(t,l,e)}))])}catch(t){f=t instanceof Wt?i(null,l,e,t.payload,t.meta):i(t,l,e)}finally{d&&u.signal.removeEventListener("abort",d)}var m;return n&&!n.dispatchConditionRejection&&i.match(f)&&f.meta.condition||a(f),f}();return Object.assign(f,{abort:h,requestId:l,arg:e,unwrap(){return f.then(Yt)}})}}),{pending:o,rejected:i,fulfilled:r,settled:Kt(i,r),typePrefix:e})}return e.withTypes=()=>e,e})();function Yt(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var Qt=Symbol.for("rtk-slice-createasyncthunk");function Zt(e,t){return`${e}/${t}`}function en({creators:e}={}){const t=e?.asyncThunk?.[Qt];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(dn(11));const o=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):e.reducers)||{},i=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},s={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(dn(12));if(n in a.sliceCaseReducersByType)throw new Error(dn(13));return a.sliceCaseReducersByType[n]=t,s},addMatcher(e,t){return a.sliceMatchers.push({matcher:e,reducer:t}),s},exposeAction(e,t){return a.actionCreators[e]=t,s},exposeCaseReducer(e,t){return a.sliceCaseReducersByName[e]=t,s}};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?$t(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e,t){let i,[s,c,l]=$t((e=>{for(let t in o)e.addCase(t,o[t]);for(let t of a.sliceMatchers)e.addMatcher(t.matcher,t.reducer);for(let t of n)e.addMatcher(t.matcher,t.reducer);r&&e.addDefaultCase(r)}));if("function"==typeof e)i=()=>jt(e());else{const t=jt(e);i=()=>t}function u(e=i(),t){let n=[s[t.type],...c.filter((({matcher:e})=>e(t))).map((({reducer:e})=>e))];return 0===n.filter((e=>!!e)).length&&(n=[l]),n.reduce(((e,n)=>{if(n){if(Ne(e)){const r=n(e,t);return void 0===r?e:r}if(ke(e))return dt(e,(e=>n(e,t)));{const r=n(e,t);if(void 0===r){if(null===e)return e;throw new Error(dn(9))}return r}}return e}),e)}return u.getInitialState=i,u}(e.initialState)}i.forEach((r=>{const i=o[r],a={reducerName:r,type:Zt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(i)?function({type:e,reducerName:t,createNotation:n},r,o){let i,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(dn(17));i=r.reducer,a=r.prepare}else i=r;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Pt(e,a):Pt(e))}(a,i,s):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(dn(18));const{payloadCreator:i,fulfilled:a,pending:s,rejected:c,settled:l,options:u}=n,d=o(e,i,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),s&&r.addCase(d.pending,s),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||rn,pending:s||rn,rejected:c||rn,settled:l||rn})}(a,i,s,t)}));const l=e=>e,u=new Map;let d;function p(e,t){return d||(d=c()),d(e,t)}function h(){return d||(d=c()),d.getInitialState()}function f(t,n=!1){function r(e){let r=e[t];return void 0===r&&n&&(r=h()),r}function o(t=l){const r=Dt(u,n,{insert:()=>new WeakMap});return Dt(r,t,{insert:()=>{const r={};for(const[o,i]of Object.entries(e.selectors??{}))r[o]=tn(i,t,h,n);return r}})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const m={name:n,reducer:p,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...f(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:p},n),{...m,...f(o,!0)}}};return m}}function tn(e,t,n,r){function o(o,...i){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...i)}return o.unwrapped=e,o}var nn=en();function rn(){}var{assign:on}=Object,an="listenerMiddleware",sn=e=>{let{type:t,actionCreator:n,matcher:r,predicate:o,effect:i}=e;if(t)o=Pt(t).match;else if(n)t=n.type,o=n.match;else if(r)o=r;else if(!o)throw new Error(dn(21));return((e,t)=>{if("function"!=typeof e)throw new Error(dn(32))})(i),{predicate:o,type:t,effect:i}},cn=Object.assign((e=>{const{type:t,predicate:n,effect:r}=sn(e);return{id:Vt(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(dn(22))}}}),{withTypes:()=>cn}),ln=Object.assign(Pt(`${an}/add`),{withTypes:()=>ln}),un=(Pt(`${an}/removeAll`),Object.assign(Pt(`${an}/remove`),{withTypes:()=>un}));function dn(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. `}Symbol.for("rtk-state-proxy-original");class pn extends a{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const hn=Xt("initializeConfig",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,defaultLocale:r,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:s}=await t.getConfig(),c=n?.context?.userLocale||r,l=n?.context?.contentLocale||r,{connectWhenInView:u}=n;return{features:e,defaultLocale:r,preChat:o,agentParticipant:i,userParticipant:a,startChatIcon:s,defaultUserLocale:c,defaultContentLocale:l,connectWhenInView:u}}catch(e){return r(e)}})),fn=Xt("resetConfig",(async(e,{extra:{config:t}})=>t));const mn=_t((({app:e})=>e),(({userHasResponded:e})=>e)),vn="visibility",yn={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},gn=_t((({config:e})=>e),(e=>{let t={visible:"inline"===e?.layoutMode?yn.open:yn.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t})),_n=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:i,hideOnNoUserResponse:a}=r,{visible:s}=o||{};if("app"===i&&!t)return yn.open;if("window"===i&&a&&n!==yn.open)return e?n||t||yn.open:yn.hidden;if("inline"===i&&e&&!n)return t||yn.open;const c=yn.minimized;return n||t||s||c};var bn=n(7402),wn=n(8418),Cn=bn.default,xn=Symbol.for("react-redux-context"),En="undefined"!=typeof globalThis?globalThis:{};function Sn(){if(!Cn.createContext)return{};const e=En[xn]??(En[xn]=new Map);let t=e.get(Cn.createContext);return t||(t=Cn.createContext(null),e.set(Cn.createContext,t)),t}var Tn=Sn();function Nn(e=Tn){return function(){return Cn.useContext(e)}}var kn=Nn(),An=()=>{throw new Error("uSES not initialized!")},In=(e,t)=>e===t;function On(e=Tn){const t=e===Tn?kn:Nn(e),n=(e,n={})=>{const{equalityFn:r=In,devModeChecks:o={}}="function"==typeof n?{equalityFn:n}:n,{store:i,subscription:a,getServerState:s,stabilityCheck:c,identityFunctionCheck:l}=t(),u=(Cn.useRef(!0),Cn.useCallback({[e.name](t){return e(t)}}[e.name],[e,c,o.stabilityCheck])),d=An(a.addNestedSub,i.getState,s||i.getState,u,r);return Cn.useDebugValue(d),d};return Object.assign(n,{withTypes:()=>n}),n}var Rn=On();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var Ln={notify(){},get:()=>[]};var Pn=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Mn="undefined"!=typeof navigator&&"ReactNative"===navigator.product,jn=Pn||Mn?Cn.useLayoutEffect:Cn.useEffect;Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var Dn=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",identityFunctionCheck:i="once"}){const a=Cn.useMemo((()=>{const t=function(e,t){let n,r=Ln,o=0,i=!1;function a(){l.onStateChange&&l.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(a):e.subscribe(a),r=function(){let e=null,t=null;return{clear(){e=null,t=null},notify(){(()=>{let t=e;for(;t;)t.callback(),t=t.next})()},get(){const t=[];let n=e;for(;n;)t.push(n),n=n.next;return t},subscribe(n){let r=!0;const o=t={callback:n,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}function c(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Ln)}const l={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return i},trySubscribe:function(){i||(i=!0,s())},tryUnsubscribe:function(){i&&(i=!1,c())},getListeners:()=>r};return l}(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,identityFunctionCheck:i}}),[e,r,o,i]),s=Cn.useMemo((()=>e.getState()),[e]);jn((()=>{const{subscription:t}=a;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[a,s]);const c=t||Tn;return Cn.createElement(c.Provider,{value:a},n)};function Un(e=Tn){const t=e===Tn?kn:Nn(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Fn=Un();function Bn(e=Tn){const t=e===Tn?Fn:Un(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var zn,Hn=Bn();zn=wn.useSyncExternalStoreWithSelector,An=zn,bn.useSyncExternalStore;const $n=()=>Rn(gn);function Vn(){const{startChatIcon:e}=$n();return e}const Kn=({state:e})=>e,Jn=()=>Rn(Kn),Wn=_t(Kn,gn,mn,(({events:e,serviceData:t},n,r)=>{if(r||"inline"===n.layoutMode||!t?.suggestion||!t?.suggestion?.body?.length)return e;const o={type:"service_data",payload:t.suggestion};return[...e,o]})),qn=_t(Wn,gn,((e,t)=>{const{enabled:n,threshold:r}=t?.messages?.timeIndicator??{};return n?e.map((({type:e,payload:t},n,o)=>{if(0===n)return{type:e,payload:{...t,timeIndicator:t?.occurredAt}};const i=o[n-1];if(!t?.occurredAt||!i.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=g(t.occurredAt-i.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}})):e})),Gn=()=>Rn(qn),Xn=(_t(qn,(e=>e.map((e=>e.payload.id)))),()=>Jn().isLoading),Yn=()=>Jn().unreadEvents,Qn=()=>Jn().skiplinkTargetId,Zn=()=>Jn().serviceInfo,er=_t(qn,(e=>{const t=e.filter((e=>"message"===e.type));return t[t.length-1]?.payload.id})),tr=()=>{const{participants:e,currentAgent:t}=Jn().participantInfo;return t?e[t]:null},nr=()=>{const{entryMeta:{options:{text:e},optionsOverride:{text:t}}}=Jn(),{limit:n}=t||e||{limit:null};return{hasLimit:null!==n,limit:null!==n?n:null}},rr=()=>{const{layoutMode:e}=$n();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},or=_t((({visibility:e})=>e),(e=>e.visibility)),ir=_t((({visibility:e})=>e),(e=>e.showInlineView)),ar=[yn.open,yn.minimized,yn.hidden],sr=Xt("setVisibility",((e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),i=or(o),a=mn(o),s=n.hasConversation(),c=gn(o),{visibilityCallback:l=_n,layoutMode:u}=c,{unreadEvents:d}=Kn(o),p=l({hasResponded:a,previousVisibility:i,requestedVisibility:e,config:c});if(p&&!ar.includes(p))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),null;if(i===p)return null;const h=n.store.get(vn);return n.store.set(vn,{...h||{},[u]:e}),e&&r.emit("ui.visible",e,{visibility:e,hasConversation:s,hasResponded:a,unreadMessageCount:d}),p})),cr=Xt("initialize",(async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=gn(n()),i=r.store.get(vn)?.[o]||yn.initialize;return t(sr(i)),i})),lr=Xt("initializeApp",(async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{let o=n?.context?.contentLocale,i=n?.context?.userLocale;const a=!1!==n.api.sendEnvironment?t.getEnvironment():n.api.sendEnvironment;try{if(t.hasConversation()){const e=await t.getConversationIntitialState();return o=e.context?.contentLocale||o,i=e.context?.userLocale||i,t.sendContext({...e.context,environment:a}),{initialState:e,contentLocale:o,userLocale:i,config:n}}return n?.context?.topic&&t.send("action",{type:U,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),t.sendContext({...n.context,environment:a}),{initialState:void 0,contentLocale:o,userLocale:i,config:n}}catch(e){if(e instanceof l){const e=new l;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new pn;return r({name:t.name,message:t.message,langKey:t.langKey})}})),ur=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:i=!1}=n??{};let a,s=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return Xt(e,t,{condition:()=>{const e=i&&!s;return s&&clearTimeout(s),s=setTimeout((()=>{l(),s=null}),r),!!e||(a&&(a(!1),a=void 0),o&&!c&&(c=setTimeout(l,o)),new Promise((e=>{a=e})))}})})("resetApp",(async(e,{dispatch:t,extra:{api:n}})=>{await n.disconnect(),n.clearStore(),t(fn()),await t(hn()),await t(lr()),t(cr())}),{wait:2e3,leading:!0}),dr=["hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],pr=(e,t)=>{const{messages:n,...r}=(o=t,dr.reduce(((e,t)=>(t in o&&(e[t]=o[t]),e)),{}));var o;let i=e;return Object.keys(r).length>0&&(i={...i,...r}),n&&(i={...i,messages:{...i.messages,...n}}),i},hr=nn({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},api:{domain:"",key:"",secure:!0,sendEnvironment:!0},context:{},notificationAudioURL:void 0,hideOnNoUserResponse:!1,connectWhenInView:!0,showDisclaimer:!1,showSuggestions:!0,preChat:{enterDelay:1e3,exitAfter:4e3},continueChat:{enterDelay:0,exitAfter:2e3},customComponents:{},defaults:{visible:null},preChatEvents:[],parentElement:void 0,layoutMode:"window"},reducers:{setConfig:(e,{payload:t})=>pr(e,t),updateConfig:(e,{payload:t})=>pr(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(fn.fulfilled,(e=>e)).addCase(hn.fulfilled,((e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultUserLocale:i,defaultContentLocale:a}})=>{e.preChatEvents=t.map((e=>({type:"message",payload:e}))),e.context.userLocale=i,e.context.contentLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o}))}}),{setConfig:fr,updateConfig:mr,setPreChatEvents:vr}=hr.actions;var yr=hr.reducer;const gr={userHasResponded:!1},_r=nn({name:"app",initialState:gr,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>gr)).addCase(lr.fulfilled,((e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)}))}}),{setHasResponded:br}=_r.actions;var wr=_r.reducer;class Cr extends a{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const xr={SeamlyGeneralError:c,SeamlyConfigurationError:s,SeamlySessionExpiredError:l,SeamlyOfflineError:Cr,SeamlyUnauthorizedError:u,SeamlyUnavailableError:pn},Er=Pt("catch-error",(e=>({payload:e}))),Sr={controls:{}},Tr={touched:!1},Nr={controls:Tr},kr=nn({name:"forms",initialState:Nr,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Sr,persistData:t}:{...Sr,persistData:t};e[n]=r},deregisterForm:(e,{payload:{formId:t}})=>(e[t]?.persistData||delete e[t],e),registerControl:(e,{payload:{name:t,formId:n}})=>{e[n].controls={[t]:Tr}},deregisterControl:(e,{payload:{name:t,formId:n}})=>{const r=e[n];if(!r)return e;if(r.persistData)return e;const o={...r.controls};return delete o[t],{...e,[n]:{...r,controls:o}}},updateControlValue:(e,{payload:{formId:t,name:n,value:r}})=>{e[t]?.controls&&(e[t].controls[n].value=r)},updateControlTouched:(e,{payload:{formId:t,name:n,touched:r}})=>{e[t]?.controls[n]&&(e[t].controls[n].touched=r)}},extraReducers:e=>{e.addCase(ur.pending,(()=>Nr))}}),{registerForm:Ar,deregisterForm:Ir,registerControl:Or,deregisterControl:Rr,updateControlValue:Lr,updateControlTouched:Pr}=kr.actions;var Mr=kr.reducer;const jr=Xt("setLocale",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return{translations:await t.getTranslations(e),userLocale:e}}catch(e){return n(e)}}),{condition:(e,{getState:t})=>{const{i18n:{isLoading:n,userLocale:r}}=t();return e!==r&&!n}}),Dr={translations:{"errors.configError.message":"We are sorry this happened, please retry at a later time.","errors.configError.srText":"A chat configuration error occurred. Our apologies, please retry at a later time.","errors.configError.title":"Chat configuration error.","errors.general.buttonText":"Restart chat","errors.general.message":"Do you want to start a new chat session?","errors.general.srText":"Something went wrong with the chat session. You can restart the chat.","errors.general.title":"Something went wrong","errors.seamlyOffline.message":"There might be a problem with your or our network connection. The chat session should resume as soon the connection is available again.","errors.seamlyOffline.srText":"The chat has connection issues. There might be a problem with your or our network connection. The chat session should resume as soon as the connection is available again.","errors.seamlyOffline.title":"Connection issues","errors.seamlyUnavailable.buttonText":"Try again","errors.seamlyUnavailable.message":"The server could not be reached. Try again in a little while.","errors.seamlyUnavailable.srText":"The chat server could not be reached. Try again in a little while.","errors.seamlyUnavailable.title":"Server unavailable"},isLoading:!1,initialLocale:void 0,userLocale:void 0},Ur=nn({name:"app",initialState:Dr,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Dr)).addCase(hn.fulfilled,((e,{payload:t})=>{e.initialLocale=t.defaultUserLocale})).addCase(jr.pending,(e=>{e.isLoading=!0})).addCase(jr.rejected,(e=>{e.isLoading=!1})).addCase(jr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t?.translations&&(e.userLocale=t.userLocale,e.translations=Object.keys(t.translations).sort().reduce(((e,n)=>{if(!t.translations)return e;const r=t.translations[n];return e[n]=r,e}),{}))}))}}),{setInitialLocale:Fr,setTranslations:Br}=Ur.actions;var zr=Ur.reducer;const Hr=Xt("getConversation",(async(e,{extra:{api:t},rejectWithValue:n})=>{try{return t.getConversation()}catch(e){return n({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError})}}),{condition(e,{getState:t}){const{state:{events:n}}=t(),r=n[n.length-1],o=e?.lastEvent?.id;return r&&o!==r.payload.id}}),$r={error:void 0},Vr=nn({name:"interrupt",initialState:$r,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>$r},extraReducers:e=>{e.addCase(hn.pending,(()=>$r)).addMatcher(Kt(lr.rejected,hn.rejected,jr.rejected,sr.rejected,cr.rejected,Hr.rejected),((e,{payload:t})=>{e.error=t}))}}),{setInterrupt:Kr,clearInterrupt:Jr}=Vr.actions;var Wr=Vr.reducer;const qr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"],Gr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===N.message&&!t.fromClient||e===N.info&&t.type===k,Xr=e=>e.sort((({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t)),Yr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:i,introduction:a}=t.participant,s=n[r],c={...n,[r]:s?{...s,...o?{avatar:o}:{},...i?{name:i}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Qr=(e,t)=>{const n="message"===t?.type?t?.payload.translatedEntry||t?.payload.entry:{},{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},i=t?.payload?.translatedActions||{};if(!n)return{...e,optionsOverride:{},actions:o,translatedActions:i};const{type:a,options:s}=n;let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...e.optionsOverride||{},...a?{[a]:s}:{}},actions:o,translatedActions:i}},Zr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1},unreadEvents:0,userHasResponded:!1,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1,remaining:void 0,wasStopped:void 0,count:void 0,timer:void 0},resumeConversationPrompt:!1,serviceInfo:{activeServiceSessionId:"",proactiveMessages:!1},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:null,subTitle:""},historyLoaded:!1,skiplinkTargetId:m(),optionsButtonId:m(),headerCollapseButtonId:m(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:A,active:A,userSelected:null,blockAutoEntrySwitch:!1,options:{},optionsOverride:{},actions:{},translatedActions:{}},seamlyContainerElement:null},eo=nn({name:"store",initialState:Zr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=e.options.features.hasOwnProperty(J);let i={...e.options};if(o&&(n===N.message||n===N.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;i={...i,features:{...i.features,uploads:{enabled:i.features.uploads?.enabled||!1,...i.features?.uploads||{},enabledFromEntry:e===I}}}}const a=Gr(t.payload);if(e.events.find((e=>e.payload.id===r.id)))return;const s=Qr(e.entryMeta,t.payload);e.entryMeta=o||s.active!==I?s:{...e.entryMeta},e.options=i,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?R:O)),t.payload.payload.key=m(),e.events.push(t.payload),r.fromClient&&(e.isLastEventFromClient=r.fromClient)},ackEvent:(e,{payload:{payload:t}})=>{if(!t.transactionId)return void console.warn("ACK received without transaction ID.");const n=e.events.find((e=>e.payload.transactionId===t.transactionId&&(!t.type||e.type===t.type))),{id:r,occurredAt:o}=t;n&&(n.payload.id=r,n.payload.occurredAt=o,e.events=Xr(e.events))},clearEvents:e=>{e.unreadEvents=0,e.loadedImageEventIds=[],e.events=[]},setEventsRead:(e,{payload:t})=>{e.unreadEvents=0,e.events.forEach((e=>(e.payload.id&&-1!==t.indexOf(e.payload.id)&&(e.payload={...e.payload,..."service_data"!==e.type&&e.payload.messageStatus===O&&{messageStatus:R}}),e)))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setHistory:(e,{payload:{events:t,participants:n,activeServiceSessionId:r,activeServiceSettings:o,serviceData:i,resumeConversationPrompt:a}})=>{const s=((e,t)=>{const n=e.filter((e=>"message"===e.type&&!e.payload.optimisticallyInjected&&!t.some((t=>t.payload.id===e.payload.id)))),r=t.filter((e=>!("participant"===e.type&&!e.payload.participant?.introduction))).reverse();return Xr([...r,...n])})(e.events,t),c={...e.participantInfo.participants,...n},l=s.slice().reverse().find((e=>("message"===e.type||"participant"===e.type)&&!e.payload.fromClient));let u=null;l&&("message"===l.type&&(u=l.payload.participant),"participant"===l.type&&(u=l.payload.participant?.id));const{entry:d}=o,p=d?.options?.upload,h=Qr({...e.entryMeta,...d,active:d?.default||k,options:{...d?.options?d.options:{}}},s[s.length-1]);let f={...e.options.features};const m=f.hasOwnProperty(J);if(m&&"message"===l?.type){const{payload:e}=l,t=e?.entry?.type||{};f={...f,uploads:{enabled:!(!p||!p?.enabled),enabledFromEntry:t===I}}}e.unreadEvents=s.filter((e=>"message"===e.type&&e.payload.messageStatus===O)).length,e.events=s.filter((e=>"participant"!==e.type||!!e.payload.participant?.introduction)),e.participantInfo={...e.participantInfo,...u?Yr(e.participantInfo,{participant:c[u]}):{},participants:c},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,activeServiceSessionId:r,proactiveMessages:o?.proactiveMessages?.enabled||!1},e.serviceData={...e.serviceData,...i},e.options={...e.options,features:f},e.entryMeta=m||h.active!==I?h:{...e.entryMeta},e.resumeConversationPrompt=a||!1,u&&(e.headerTitles.subTitle=c[u].name)},resetHistoryLoadedFlag:e=>{e.historyLoaded=!1},setIsLoading:(e,{payload:t})=>{e.isLoading=t},initIdleDetachCountdown:(e,{payload:t})=>{const{delaySeconds:n,delayTime:r}=t;e.idleDetachCountdown={hasCountdown:!0,isActive:!0,wasStopped:!1,count:n,remaining:n,timer:r}},decrementIdleDetachCountdownCounter:e=>{const{idleDetachCountdown:t}=e,{remaining:n=0}=t,r=n-1;e.idleDetachCountdown.remaining=r,e.idleDetachCountdown.timer=_(r)},stopIdleDetachCountdownCounter:e=>{e.idleDetachCountdown.isActive=!1,e.idleDetachCountdown.wasStopped=!0},clearIdleDetachCountdown:e=>{e.idleDetachCountdown.hasCountdown=!1,e.idleDetachCountdown.isActive=!1},initResumeConversationPrompt:e=>{e.resumeConversationPrompt=!0},clearResumeConversationPrompt:e=>{e.resumeConversationPrompt=!1},setParticipant:(e,{payload:t})=>{e.participantInfo=Yr(e.participantInfo,{participant:t.participant,fromClient:t.fromClient})},setActiveService:(e,{payload:t})=>{e.serviceInfo.activeServiceSessionId!==t&&(e.serviceInfo.activeServiceSessionId=t)},setHeaderTitle:(e,{payload:t})=>{e.headerTitles.title=t},setHeaderSubTitle:(e,{payload:t})=>{e.headerTitles.subTitle=t},setInitialState:(e,{payload:t})=>{e.initialState=t,e.unreadEvents=Zr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},setFeatureEnabledState:(e,{payload:t})=>{e.options.features.hasOwnProperty(t.key)&&(e.options.features[t.key].enabled=t.enabled)},clearFeatures:e=>{e.options.features={webNotifications:e.options.features.webNotifications}},showOption:(e,{payload:t})=>{e.options.panelActive=!0,e.options.optionActive=t},hideOption:e=>{e.options.panelActive=!1,e.options.optionActive=""},setUserSelectedOptions:(e,{payload:t})=>{e.options.userSelectedOptions=t},setUserSelectedOption:(e,{payload:t})=>{const{option:n,value:r}=t;e.options.userSelectedOptions[n]=r},setBlockAutoEntrySwitch:(e,{payload:t})=>{e.entryMeta.blockAutoEntrySwitch=t},setServiceEntryMetadata:(e,{payload:t})=>{e.entryMeta.active=t.default,e.entryMeta.options=t.options||{},e.entryMeta.optionsOverride={},e.entryMeta.actions={},e.entryMeta.translatedActions={}},setActiveEntryType:(e,{payload:t})=>{e.entryMeta.active=t},setUserEntryType:(e,{payload:t})=>{e.entryMeta.userSelected=t},clearAbortTransaction:e=>{e.entryMeta.actions={},e.entryMeta.translatedActions={}},registerUpload:(e,{payload:t})=>{e.currentUploads.push({id:t.fileId,name:t.fileName,progress:1,uploading:!0,complete:!1,error:"",uploadHandle:t.uploadHandle})},setUploadProgress:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,progress:t.progress,uploading:100!==t.progress,uploadHandle:100===t.progress?null:e.uploadHandle}:e))},startProcessingImage:(e,{payload:t})=>{e.processingFileUploads.push(t)},doneProcessingImage:(e,{payload:t})=>{e.processingFileUploads=e.processingFileUploads.filter((e=>e!==t))},setUploadError:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t.fileId?{...e,error:t.errorText,progress:0,uploading:!1,uploadHandle:null}:e))},setUploadComplete:(e,{payload:t})=>{e.currentUploads=e.currentUploads.map((e=>e.id===t?{...e,complete:!0}:e))},clearAllUploads:e=>{e.currentUploads=[]},setSeamlyContainerElement:(e,{payload:t})=>{e.seamlyContainerElement=t},setProactiveMessages:(e,{payload:t})=>{e.serviceInfo.proactiveMessages=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Zr)).addCase(lr.pending,(e=>{e.isLoading=!0})).addCase(hn.fulfilled,((e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name,t.features&&(e.options.features=t.features)})).addCase(lr.fulfilled,((e,{payload:t})=>{e.isLoading=!1,t.initialState&&(e.initialState=t.initialState)})).addMatcher(Kt(uo,po),(e=>{e.isLastEventFromClient=!1}))}}),{ackEvent:to,addEvent:no,clearAllUploads:ro,clearEvents:oo,clearFeatures:io,clearIdleDetachCountdown:ao,clearResumeConversationPrompt:so,decrementIdleDetachCountdownCounter:co,hideOption:lo,initIdleDetachCountdown:uo,initResumeConversationPrompt:po,registerUpload:ho,resetHistoryLoadedFlag:fo,setActiveEntryType:mo,setActiveService:vo,setBlockAutoEntrySwitch:yo,setEventsRead:go,setFeatureEnabledState:_o,setFeatures:bo,setHeaderSubTitle:wo,setHeaderTitle:Co,setHistory:xo,setInitialState:Eo,setIsLoading:So,setLoadedImageEventIds:To,setParticipant:No,setSeamlyContainerElement:ko,setServiceDataItem:Ao,setServiceEntryMetadata:Io,clearAbortTransaction:Oo,setUploadComplete:Ro,setUploadError:Lo,setUploadProgress:Po,startProcessingImage:Mo,doneProcessingImage:jo,setUserEntryType:Do,setUserSelectedOption:Uo,setUserSelectedOptions:Fo,showOption:Bo,stopIdleDetachCountdownCounter:zo,setProactiveMessages:Ho}=eo.actions;var $o=eo.reducer;const Vo={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:Vt(),translatedEventGroups:{},translationProposal:null},Ko=(e,t)=>{const n=[...e].reduce(((e,{payload:n,type:r},o,i)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return i.splice(0),e;e[t].push(n.id)}return n.id===t&&(e[t]=[]),e}),{}),[[r,o]]=Object.entries(n);return{lastGroupId:e.filter((e=>"divider"===e.payload?.type)).map((e=>e.payload.id)).at(-1),groupId:r,eventIds:o}},Jo=nn({name:"translation",initialState:Vo,reducers:{enableTranslation:(e,{payload:t})=>{e.isActive=!0,e.currentLocale=t},disableTranslation:e=>{e.isActive=!1,e.currentLocale=void 0},enableEventsTranslation:(e,{payload:{events:t,id:n}})=>{delete e.translatedEventGroups[n];const{lastGroupId:r}=Ko(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:i}=Ko(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=i},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(ur.pending,(()=>Vo)).addCase(hn.fulfilled,((e,{payload:t})=>{const n=t?.features?.translation;n?.languages&&(e.isAvailable=!0===n.enabled,e.languages=[...n.languages].sort(((e,n)=>e.locale===t.defaultUserLocale?-1:n.locale===t.defaultUserLocale?1:e.nativeName?.localeCompare(n.nativeName||"",void 0,{sensitivity:"base"})||0)))})).addCase(xo,((e,{payload:t})=>{e.translationProposal=t.translationProposal})).addCase(jr.fulfilled,((e,{payload:t})=>{e.currentLocale=t.userLocale})).addCase(no,((e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}))}}),{enableTranslation:Wo,disableTranslation:qo,enableEventsTranslation:Go,disableEventsTranslation:Xo,setTranslationProposalPrompt:Yo,disableTranslationProposalPrompt:Qo}=Jo.actions;var Zo=Jo.reducer,ei=({dispatch:e})=>t=>n=>{const r=t(n);if(xo.match(n)&&n.payload?.translation?.enabled)return e(Wo(n.payload.translation.locale)),e(jr(n.payload.translation.locale)),r;if(hn.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(jr(n.payload.defaultUserLocale)),r;if(lr.fulfilled.match(n))return n.payload.userLocale&&e(jr(n.payload.userLocale)),r;if(no.match(n)&&"info"===n.payload.type&&n.payload.payload.body&&"subtype"in n.payload.payload.body&&"new_translation"===n.payload.payload.body.subtype){const{body:t}=n.payload.payload;if(t.translationLocale&&t.translationEnabled)return e(jr(t.translationLocale)),r}return r};const ti=nn({name:"visibility",initialState:{visibility:yn.initialize,showInlineView:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(sr.fulfilled,((e,{payload:t})=>{t&&(e.visibility=t)})).addCase(hn.fulfilled,((e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)}))}}),{setShowInlineView:ni}=ti.actions,ri=Nt({state:$o,app:wr,config:yr,i18n:zr,translations:Zo,visibility:ti.reducer,forms:Mr,interrupt:Wr});function oi({initialState:e,api:t,eventBus:n,config:r}){const o=function(e){const t=Ut(),{reducer:n,middleware:r,devTools:o=!0,preloadedState:i,enhancers:a}=e||{};let s,c;if("function"==typeof n)s=n;else{if(!St(n))throw new Error(dn(1));s=Nt(n)}if(!Ht&&r&&"function"!=typeof r)throw new Error(dn(2));if("function"==typeof r){if(c=r(t),!Ht&&!Array.isArray(c))throw new Error(dn(3))}else c=t();if(!Ht&&c.some((e=>"function"!=typeof e)))throw new Error(dn(4));let l=kt;o&&(l=Rt({trace:!Ht,..."object"==typeof o&&o}));const u=function(...e){return t=>(n,r)=>{const o=t(n,r);let i=()=>{throw new Error(wt(15))};const a={getState:o.getState,dispatch:(e,...t)=>i(e,...t)},s=e.map((e=>e(a)));return i=kt(...s)(o.dispatch),{...o,dispatch:i}}}(...c),d=zt(u);if(!Ht&&a&&"function"!=typeof a)throw new Error(dn(5));let p="function"==typeof a?a(d):d();if(!Ht&&!Array.isArray(p))throw new Error(dn(6));if(!Ht&&p.some((e=>"function"!=typeof e)))throw new Error(dn(7));return Ht||!c.length||p.includes(u)||console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),Tt(s,i,l(...p))}({reducer:ri,preloadedState:e,middleware:e=>e({thunk:{extraArgument:{api:t,eventBus:n,config:r}},serializableCheck:!1}).concat(function({api:e}){return({getState:t})=>{const n=n=>{const{errorCallback:r,namespace:o,api:i,layoutMode:s}=gn(t()),{error:c,type:l}=n,u=xr[c?.name]?new xr[c.name](c):new a(c);r?.(u,{namespace:o,api:i,layoutMode:s,conversationUrl:e.getConversationUrl(),action:l?n:void 0})};return e=>t=>{try{return t.payload?.originalEvent?.payload?n({error:t.payload,type:t.payload?.originalEvent?.payload?.type}):t.payload?.originalError&&n({error:t.payload,type:void 0}),e(t)}catch(e){throw n({error:e}),e}}}}({api:t}),function({api:e}){return()=>t=>n=>{const{payload:r,type:o}=n;if(o===Kr.type){if(!qr.includes(r.name))throw new c(r);"reset"===r.action&&e.disconnect().then((()=>{e.clearStore()}))}return t(n)}}({api:t}),function({api:e}){return()=>t=>n=>{const r=t(n);switch(n.type){case Fo.toString():e.store.set("options",n.payload);break;case Uo.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),ei)});return o}const ii=Hn;var ai=n(5994);function si(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,i=null,a=!1,s=0;for(;s<e.length;){if(a&&(t(e[s])||"{"===e[s]))a=!1,i=e.slice(o,s),"{"===e[s]&&s--;else if(!a&&!t(e[s])){const t="{"===e[s];if(i&&t){const t=ci(e,s);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[i]=e.slice(s+1,t),s=t,i=null}else i&&(n.push(i),i=null),a=!0,o=s}s++}return a&&(i=e.slice(o)),i&&n.push(i),{args:n,cases:r}}function ci(e,t){let n=0;for(let r=t+1;r<e.length;r++){let t=e.charAt(r);if("}"===t){if(0===n)return r;n--}else"{"===t&&n++}return-1}function li(e){return ui(e.slice(1,-1),",",3)}function ui(e,t,n,r=[]){if(!e)return r;if(1===n)return r.push(e),r;let o=e.indexOf(t);if(-1===o)return r.push(e),r;let i=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(i),ui(a,t,n-1,r)}let di,pi=0;const hi="other";function fi(e,t){let n=0,r="",o=0;const i={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+pi++;r+=`{${e}, number}`,i[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:i}}const mi="other",vi=_t((({i18n:e})=>e),(({translations:e})=>e)),yi=_t((({i18n:e})=>e),(({initialLocale:e})=>e)),gi=_t((({i18n:e})=>e),(({userLocale:e})=>e)),_i=_t((({i18n:e})=>e),(({isLoading:e})=>e)),bi=new class{constructor(e,t={}){this.locale=e,this.typeHandlers=t}format=function(e){const t={};return function(...n){let r=n.length?n.map((e=>null===e?"null":void 0===e?"undefined":"function"==typeof e?e.toString():e instanceof Date?e.toISOString():JSON.stringify(e))).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(t,r))return t[r];let o=e(...n);return t[r]=o,o}}(((e,t={})=>this.process(e,t).flat(1/0).join("")));process(e,t={}){if(!e)return[];let n=e.indexOf("{");if(-1!==n){let r=ci(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let i=[],a=e.substring(0,n);a&&i.push(a);let[s,c,l]=li(o),u=t[s];null==u&&(u="");let d=c&&this.typeHandlers[c];i.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&i.push(this.process(p,t)),i}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:i,cases:a}=si(t);let s=parseInt(e);i.forEach((e=>{e.startsWith("offset:")&&(s-=parseInt(e.slice(7)))}));const c=[];if("PluralRules"in Intl){void 0!==di&&di.resolvedOptions().locale===n||(di=new Intl.PluralRules(n));const e=di.select(s);e!==hi&&c.push(e)}1===s&&c.push("one"),c.push(`=${s}`,hi);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=fi(a[t],s);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:i}=si(t);return e in i?o(i[e],r):mi in i?o(i[mi],r):e}});function wi(){const e=Rn(vi),t=Rn(gi),n=Rn(yi),r=Rn(_i),o=(0,ai.hb)(((n,o={})=>{if(!e)return"";const i=e[n];return i?bi.format(i,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")}),[e,t,r]);return{t:o,userLocale:t,initialLocale:n}}const Ci=()=>{const e=ii(),t=Rn(or),n=!!t&&t!==yn.hidden,r=t===yn.open,o=t===yn.minimized,i=(0,ai.hb)((t=>e(sr(t))),[e]);return{isVisible:n,isOpen:r,isMinimized:o,visible:t,setVisibility:i,openChat:()=>{i(yn.open)},closeChat:()=>{i(yn.minimized)}}},xi=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,o._3)()})=>{const[r,i]=(0,ai.J0)(null),a=!!r?.isIntersecting||!t,s=a&&e,c=([e])=>i(e);return(0,ai.vJ)((()=>{const e=n?.current;if(!window.IntersectionObserver||s||!e||!t)return()=>{};const r=new IntersectionObserver(c,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()}),[n,t,s]),{isVisible:a,containerRef:n}},Ei=()=>Rn(mn),Si=(0,o.q6)(null),Ti=(0,o.q6)(null),Ni=(0,o.q6)(null);var ki=()=>{const e=(0,ai.NT)(Ti);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e};const Ai=()=>{const e=(0,ai.NT)(Si);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},Ii=()=>Ai().store,Oi=()=>{const e=Ai();return(0,ai.hb)((()=>e.hasConversation()),[e])};var Ri=()=>{const e=Ai(),t=ii(),n=ki(),r=Ei(),o=Oi(),{visible:i,setVisibility:a}=Ci(),s=Yn(),c=(0,ai.hb)(((...e)=>{n.emit(...e)}),[n]),l=(0,ai.hb)((()=>{c("ui.beforeStart",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s}),e.send("start"),c("ui.start",{visibility:i,hasConversation:o(),hasResponded:r,unreadMessageCount:s})}),[e,c,o,r,s,i]),u=(0,ai.hb)((async()=>{await t(ur())}),[t]),d=(0,ai.hb)((e=>({type:e,id:m(),transactionId:m(),participant:p,fromClient:!0,occurredAt:1e3*Date.now(),meta:{}})),[]),h=(0,ai.hb)((e=>({...d("text"),body:{text:e}})),[d]),f=(0,ai.hb)((({body:n,config:r={}})=>{if(""===n.trim())return;const o={...h(n),...r};e.send("message",o),c("message",o),t(no({type:"message",payload:{...o,optimisticallyInjected:!0}}))}),[e,t,c,h]),v=(0,ai.hb)(((e,n=m())=>{t(no({type:"message",payload:{...h(e),transactionId:n}}))}),[t,h]),y=(0,ai.hb)(((e,n,r,o,i,a,s)=>{t(no({type:"message",payload:{type:"upload",id:e,transactionId:n,participant:p,fromClient:!0,occurredAt:r,body:{contentType:o,filename:i,filesize:a,url:s}}}))}),[t]),g=(0,ai.hb)(((e,n=m())=>{t(no({type:"info",payload:{body:{subtype:e},fromClient:!1,fromHistory:!0,id:m(),transactionId:n,type:"divider"}}))}),[t]),_=(0,ai.hb)((t=>{if(!t)return;e.send("action",t);const{type:n}=t;n!==P&&n!==M&&c(`action.${n}`,t)}),[e,c]),b=(0,ai.hb)((t=>{e.sendContext(t)}),[e]),w=(0,ai.hb)((()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then((e=>{e&&(t(Eo(e)),e.userResponded&&(t(br(e.userResponded)),a(yn.open)))})).catch((e=>{t(Kr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}))),[e,t,a]);return{connect:w,start:l,sendMessage:f,sendAction:_,sendContext:b,reset:u,emitEvent:c,addMessageBubble:v,addUploadBubble:y,addDivider:g,apiConnected:e.connected,apiConfigReady:e.configReady}};const Li=()=>{const e=(()=>{const e=(0,ai.NT)(Ni);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,ai.hb)((t=>{t&&e({ariaLive:V,messageText:t})}),[e]),sendAssertive:(0,ai.hb)((t=>{t&&e({ariaLive:$,messageText:t})}),[e])}},Pi=_t((({interrupt:e})=>e),(({error:e})=>e)),Mi=_t(Pi,(e=>Boolean(e)));function ji(){const{t:e}=wi(),t=Rn(Pi);return{hasError:Rn(Mi),meta:(0,ai.Kr)((()=>{if(!t)return{title:void 0,message:void 0,srText:void 0,buttonText:void 0,originalError:void 0,action:void 0};const{langKey:n,action:r}=t,o=e(`${n}.title`),i=e(`${n}.message`),a=e(`${n}.srText`),s=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:i,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:s}:{},originalError:t}}),[t,e]),error:t}}var Di=()=>{const{t:e}=wi(),{isInline:t,isWindow:n,isApp:r}=rr(),{isOpen:o,isVisible:i}=Ci(),a=Rn(ir),{start:s,connect:l,apiConfigReady:u,apiConnected:d}=Ri(),p=(0,ai.li)(!1),{sendAssertive:h}=Li();!function(){const{meta:{originalError:e,action:t}}=ji(),n=ii(),{reset:r}=Ri(),o="SeamlySessionExpiredError"===e?.name,i=(0,ai.li)(0),a=(0,ai.li)(null);(0,ai.vJ)((()=>{if(o&&"reset"===t){if(i.current>=10){a.current=setTimeout((()=>{i.current=0}),1e4);const e=new c;return n(Kr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}i.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}}),[t,r,o,n])}(),(0,ai.vJ)((()=>{i&&setTimeout((()=>{h(e("window.srTexts.onLoad"))}),500)}),[i,h,e]),(0,ai.vJ)((()=>{i&&h(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))}),[o,i,h,e]),(0,ai.vJ)((()=>{u&&d||(p.current=!1)}),[u,d]);const f=(0,ai.hb)((async()=>{d||(p.current=!0,await l()),(r||o||i&&t)&&s()}),[d,l,r,t,o,i,s]);(0,ai.vJ)((()=>{!u||p.current||n&&!o||!(!t||i&&a)||f()}),[u,f,t,o,i,n,a])},Ui=0;function Fi(e,t,n,r,i,a){t||(t={});var s,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Ui,__i:-1,__u:0,__source:i,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(c in s)void 0===l[c]&&(l[c]=s[c]);return o.fF.vnode&&o.fF.vnode(u),u}Array.isArray;var Bi=({children:e})=>(Di(),Fi(o.FK,{children:e})),zi=(0,o.q6)(null);const Hi=(e=0)=>new Promise((t=>{setTimeout(t,e)})),$i=()=>{const{seamlyContainerElement:e}=Jn(),t=ii();return[e,(0,ai.hb)((e=>{t(ko(e))}),[t])]},Vi=e=>(0,ai.hb)((()=>{var t;t=e,requestAnimationFrame((async()=>{await Hi(180);const e="string"==typeof t?document.getElementById(t):t;E(e)}))}),[e]),Ki=()=>{const e=Qn();return Vi(e)},Ji=e=>_t((e=>e.translations.translatedEventGroups),(t=>Object.values(t).every((t=>e?.payload?.id&&!t.includes(e.payload.id)))));function Wi(){const{sendContext:e}=Ri(),t=ii(),n=$n(),r=(0,ai.hb)(((t,n)=>{e({userLocale:t,source:n})}),[e]),o=(0,ai.hb)((()=>{e({userLocale:n.context?.contentLocale}),t(qo())}),[n.context?.contentLocale,t,e]),{languages:i,isActive:a,isAvailable:s,currentLocale:c}=Rn((({translations:e})=>e));return{languages:i,isActive:a,isAvailable:s,currentLocale:c,enableTranslations:r,disableTranslations:o}}const qi=e=>{const t=Rn(Ji(e));if(!e?.payload)return{body:void 0,hasTranslation:!1,isTranslated:!1,locale:""};const n=e.payload?.translatedBody&&"data"in e.payload.translatedBody?e.payload?.translatedBody.data:e.payload.translatedBody,{translation:r,body:o}={body:e.payload?.body,translation:e.payload?.translation},i=!!n;return{body:t&&i?n:o,hasTranslation:i,isTranslated:t&&i,locale:r?.locale}};function Gi(){const e=Rn((({translations:e})=>e.containerId));return{id:e,focusContainer:Vi(e)}}function Xi(e){const{languages:t}=Wi();return(0,ai.Kr)((()=>t?.find((t=>t.locale===e))?.nativeName),[e,t])}const Yi=()=>{const{isActive:e,languages:t}=Wi(),n=ii(),{sendAction:r}=Ri(),{translationProposal:o}=Rn((e=>e.translations)),{enableTranslations:i}=Wi(),{isOpen:a}=Ci(),{userLocale:s}=wi(),c=o?.proposedLocale,l=Xi(c),u=(0,ai.Kr)((()=>null!==o&&!e&&a&&s!==c&&t.some((e=>e.locale===c))),[o,e,a,s,c,t]);return{activateTranslationProposal:()=>{i(o?.proposedLocale,z)},dismissTranslationProposal:()=>{r({type:D,body:{type:B}}),n(Qo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}},Qi=(...e)=>e.flat().map((e=>"object"==typeof e?Object.entries(e).map((([e,t])=>t?e:"")).join(" "):e)).filter((e=>"string"==typeof e)).map((e=>e?.split(" "))).flat().filter((e=>e&&e.length)).map((e=>e&&e.indexOf(d)>-1?e:[d,e].join("-"))).join(" "),Zi=()=>$n().appContainerClassNames,ea=e=>{const{fromClient:t}=e.payload,n=["message"];return"info"===e.type?n.push("message--source-info"):t?n.push("message--source-user"):n.push("message--source-agent"),n};var ta=()=>{const e=Ai();return(0,bn.useSyncExternalStore)(ye.subscribe,(()=>e.conversation))},na=(0,o.q6)(null);const ra=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=Jn(),{allowedMimeTypes:o,maxSize:i}=n.upload||{},{enabled:a,enabledFromEntry:s}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...i?{maxSize:i}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:s||a,allowedMimeTypes:c,maxSize:l}},oa=()=>{const{currentUploads:e}=Jn(),t=ii(),n=(()=>{const e=(0,ai.NT)(na);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,ai.hb)((e=>{n(e)}),[n]),clearUploads:(0,ai.hb)((()=>{t(ro())}),[t]),currentUploads:e,isUploading:e.some((e=>e.uploading)),isComplete:e.every((e=>e.complete))}},ia=()=>{const{t:e}=wi(),{options:t}=Jn(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:i}=t,{extraMenuItem:a,sendTranscript:s}=i,c={extraMenuItem:a,sendTranscript:s},l=t=>"extraMenuItem"===t?"Extra menu item":e(`options.${t}.menuTitle`),u=Object.keys(c).filter((e=>c[e])).map((e=>({name:e,title:l(e),available:c[e].enabled}))),d=a||s,p=ii(),{get:h,set:f}=Ii();return{allowOptionSelection:d,userSelectedOptions:o,features:i,menuOptions:u,initUserSelectedOptions:(0,ai.hb)((()=>{const e=h("options")||{};p(Fo(e))}),[h,p]),setUserSelectedOptions:(0,ai.hb)((e=>{p(Fo(e)),f("options",e)}),[f,p]),setUserSelectedOption:(0,ai.hb)(((e,t)=>{const n=h("options")||{};"object"==typeof n&&f("options",{...n,[e]:t}),p(Uo({option:e,value:t}))}),[p,h,f]),showOption:e=>{p(Bo(e))},hideOption:()=>{p(lo())},panelActive:n,optionActive:r}},aa=()=>{const{optionsButtonId:e}=Jn();return{id:e,focusButton:Vi(e)}};var sa=(0,o.q6)(null),ca=()=>{const e=(0,ai.NT)(sa);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},la=()=>{const e=ii(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a}}=Jn(),{isOpen:s}=Ci(),{emitEvent:c,sendAction:l}=Ri(),{t:u}=wi(),{sendAssertive:d,sendPolite:p}=Li(),h=(0,ai.hb)((e=>{s&&d(e)}),[s,d]),f=(0,ai.hb)((e=>{s&&p(e)}),[s,p]),m=(0,ai.hb)((t=>{const n=(e=>Math.ceil(e/1e3))(t),r=_(n);e(uo({delaySeconds:n,delayTime:r})),c("idleTimer.start"),h(`${u("idleDetachWarning.countdownTitle")} ${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",r)}`)}),[e,c,h,u]),v=(0,ai.hb)(((n=void 0,r=!1)=>{t&&(n||(r||l({type:j}),h(u("idleDetachWarning.notifyTransferText"))),a||c("idleTimer.stop"),e(ao()))}),[e,c,t,l,h,u,a]),y=(0,ai.hb)((()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${u("idleDetachWarning.countdownText")} ${u("idleDetachWarning.countdownTimer",_(t))}`),e(co())}),[e,o,h,u]),g=(0,ai.hb)((()=>{n&&(e(zo()),o&&(c("idleTimer.stop"),f(u("idleDetachWarning.srCountDownStoppedText"))))}),[e,c,n,o,f,u]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:i,wasStopped:a,initCountdown:m,endCountdown:v,decrementCountdown:y,stopCountdown:g}},ua=()=>{const e=ii(),t=Jn().resumeConversationPrompt,{sendAction:n}=Ri(),{t:r}=wi(),{sendAssertive:o}=Li();return{continueChat:()=>{n({type:D,body:{type:"resume_conversation_prompt"}}),e(so())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:j}),e(so())}}};const da=()=>{const[e]=(0,ai.J0)((()=>m()));return e},pa=(e,t)=>{const n=ta();(0,ai.vJ)((()=>{if(n.channel){const{channel:r}=n;r.onMessage=(n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r)}}),[e,t,n])};var ha=({eventPayload:e})=>{const{t:t}=wi(),{fromClient:n,participant:r}=e,o=(e=>Jn().participantInfo.participants[e])(r)||{},{messages:i}=$n(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:s,showName:c}=i&&i[n?"user":"agent"]||{};if(!s&&!c)return null;const l=[];return s&&a&&o.avatar&&l.push(Fi("span",{className:Qi("message__avatar"),children:Fi("img",{src:o.avatar,className:Qi("avatar"),alt:""})})),c&&a&&l.push(Fi("span",{className:Qi("message__author-name"),children:a})),l.length>0?Fi("div",{className:Qi("message__author"),children:l}):null},fa=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:i,bodyProps:a={},info:s,...c})=>{const l=ea(t),{hasTranslation:u,isTranslated:d,locale:p}=qi(t);return n&&l.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter((e=>e.length))),r.forEach((e=>{l.push(`message--${e}`)}))),d&&l.push("message--is-translated"),u&&l.push("message--has-translation"),d&&(a={...a,lang:p}),Fi(o.FK,{children:Fi("div",{className:Qi(l),...c,children:[e&&Fi(ha,{eventPayload:t.payload}),Fi("div",{className:Qi("message__body"),...a,children:i}),s&&Fi("div",{"aria-hidden":"true",className:Qi("message__info"),children:s})]})})},ma=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:i,title:a,isCarouselItem:s})=>{const c=(0,ai.li)(null),{sendMessage:l,sendAction:u,emitEvent:d}=Ri(),p=da(),h=(0,ai.li)(!1),f=t?.type===W?"a":"button",m=(0,ai.hb)((()=>d("action.click_card",{type:F,originMessage:e,action:t})),[d,e,t]),v=(0,ai.hb)((()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:U,body:{name:e,fallbackMessage:n}})}}),[l,t,u,m]),y=(0,ai.Kr)((()=>t?.type===W?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:v}),[t,v,m]);return(0,ai.vJ)((()=>{s&&(o&&h.current?window.requestAnimationFrame((()=>c.current?.focus())):c.current?.blur()),h.current=!0}),[o,s]),Fi("div",{className:Qi("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[i?Fi("img",{className:Qi("card__image"),src:i,alt:""}):null,Fi("div",{className:Qi("card__content"),id:e,children:[a&&Fi("h2",{className:Qi("card__title"),children:a}),r&&Fi("div",{className:Qi("card__description"),dangerouslySetInnerHTML:{__html:r}}),Fi(f,{tabIndex:s&&!o?-1:void 0,className:Qi("button","button--primary"),"aria-describedby":p,...y,children:n})]})]})};function va({item:e,items:t,index:n,isActive:r}){const{t:o}=wi();return Fi("div",{className:Qi("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:Fi(ma,{...e,isCarouselItem:!0,hasFocus:r})})}const ya={send:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M6.714,14.985l17.837-7.906c0.681-0.302,1.414,0.301,1.25,1.027L22.273,23.59\tc-0.13,0.566-0.751,0.865-1.275,0.613l-3.623-1.752l-2.334,2.287c-0.572,0.562-1.538,0.156-1.538-0.645V21.01\tc0-0.217,0.078-0.43,0.222-0.594l7.676-8.841l-10.414,7.472l-4.351-2.445C5.987,16.236,6.033,15.287,6.714,14.985L6.714,14.985z"/></svg>'},balloon:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,10.824v10.375c0,1.104-0.896,2-2,2h-4.694l-4.931,3.625v-3.625H10c-1.104,0-2-0.896-2-2V10.824\tc0-1.104,0.896-2,2-2h12C23.104,8.824,24,9.719,24,10.824z"/></svg>'},newTopic:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,8.593l2.407,4.573l5.093,0.876l-3.604,3.702l0.74,5.115L16,20.574l-4.634,2.285l0.739-5.115L8.5,14.042\tl5.094-0.876L16,8.593z"/></svg>'},newTranslation:{16:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 16 16"><path fill="#4A48C1" d="M8,0C3.6,0,0,3.6,0,8s3.6,8,8,8s8-3.6,8-8S12.4,0,8,0z M14.1,7.1h-1.4c-0.1-1.5-0.4-2.9-1-4\tC13,4,13.9,5.4,14.1,7.1z M7.1,2.1v5H5C5.2,4.7,6.1,2.9,7.1,2.1z M7.1,8.9v5c-1-0.7-1.9-2.5-2.1-5H7.1z M8.9,13.9v-5H11\tC10.8,11.3,9.9,13.2,8.9,13.9z M8.9,7.1v-5c1,0.7,1.9,2.5,2.1,5H8.9z M4.2,3.1c-0.5,1.1-0.9,2.5-1,4H1.9C2.1,5.4,3,4,4.2,3.1z M1.9,8.9h1.4c0.1,1.5,0.4,2.9,1,4C3,12,2.1,10.5,1.9,8.9z M11.8,12.9c0.5-1.1,0.9-2.5,1-4h1.4C13.9,10.5,13,12,11.8,12.9z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,7c-4.9,0-9,4.1-9,9s4.1,9,9,9s9-4.1,9-9S20.9,7,16,7z M22.9,15h-1.6c-0.1-1.7-0.5-3.3-1.1-4.5\tC21.6,11.5,22.6,13.1,22.9,15z M15,9.4V15h-2.3C12.9,12.3,13.9,10.2,15,9.4z M15,17v5.6c-1.1-0.8-2.1-2.9-2.3-5.6H15z M17,22.6V17\th2.3C19.1,19.8,18.1,21.8,17,22.6z M17,15V9.4c1.1,0.8,2.1,2.9,2.3,5.6H17z M11.8,10.4c-0.6,1.3-1,2.8-1.1,4.5H9.1\tC9.4,13.1,10.4,11.5,11.8,10.4z M9.1,17h1.6c0.1,1.7,0.5,3.3,1.1,4.5C10.4,20.5,9.4,18.9,9.1,17z M20.2,21.5c0.6-1.3,1-2.8,1.1-4.5\th1.6C22.6,18.8,21.6,20.5,20.2,21.5z"/></svg>'},avatar:{32:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">\n<path fill="#4A48C1" d="M10,14.8c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S11.1,14.8,10,14.8z M15.9,14.8c1.1,0,2-0.9,2-2s-0.9-2-2-2\n\ts-2,0.9-2,2S14.8,14.8,15.9,14.8z M21.8,10.8c-1.1,0-2,0.9-2,2s0.9,2,2,2s2-0.9,2-2S22.9,10.8,21.8,10.8z M21.3,18.1H10.7\n\tC11.7,23.9,20.2,23.9,21.3,18.1z"/>\n</svg>\n'},chevronDown:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M-0.001,2.876c0-0.247,0.091-0.494,0.273-0.688c0.38-0.401,1.013-0.418,1.414-0.039l1.938,1.834\tc0.199,0.188,0.547,0.188,0.746,0L6.31,2.15c0.401-0.379,1.034-0.362,1.414,0.04c0.379,0.401,0.361,1.034-0.04,1.414L5.745,5.437\tC4.782,6.35,3.213,6.35,2.249,5.436L0.311,3.603C0.103,3.406-0.001,3.142-0.001,2.876z"/></svg>',32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M16,20.425c-0.782,0-1.563-0.291-2.159-0.874l-6.541-6.408c-0.395-0.387-0.401-1.02-0.015-1.414\tc0.387-0.394,1.021-0.4,1.414-0.015l6.541,6.408c0.42,0.409,1.102,0.409,1.52-0.001l6.541-6.407c0.396-0.386,1.028-0.38,1.414,0.015\tc0.387,0.395,0.381,1.027-0.014,1.414l-6.541,6.407C17.563,20.133,16.782,20.425,16,20.425z"/></svg>'},chevronRight:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M2.875,7.998c-0.247,0-0.494-0.091-0.688-0.273c-0.401-0.38-0.418-1.013-0.039-1.414l1.834-1.938\tc0.188-0.199,0.188-0.547,0-0.746l-1.835-1.94c-0.379-0.401-0.362-1.034,0.04-1.414s1.034-0.361,1.414,0.04l1.834,1.939\tc0.913,0.963,0.913,2.532-0.001,3.496L3.601,7.686C3.405,7.894,3.14,7.998,2.875,7.998z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M6.5,13c-0.247,0-0.494-0.091-0.687-0.273c-0.401-0.38-0.419-1.013-0.04-1.414L8.22,8.727\tc0.373-0.394,0.373-1.06,0-1.454L5.773,4.687c-0.379-0.401-0.362-1.034,0.04-1.414c0.4-0.378,1.034-0.362,1.414,0.04l2.446,2.586\tc1.096,1.159,1.096,3.043,0,4.203l-2.446,2.586C7.03,12.896,6.765,13,6.5,13z"/></svg>'},close:{8:'<svg xmlns="http://www.w3.org/2000/svg" width="8px" height="8px" x="0px" y="0px" viewBox="0 0 8 8"><defs/><path fill="#4A48C1" d="M7.705,7.729C7.511,7.923,7.255,8.02,7,8.02c-0.257,0-0.514-0.099-0.709-0.295L4,5.423L1.709,7.725\tC1.513,7.921,1.257,8.02,1,8.02c-0.255,0-0.51-0.097-0.706-0.291c-0.391-0.39-0.393-1.022-0.003-1.414l2.298-2.309l-2.27-2.28\tC-0.07,1.334-0.068,0.701,0.323,0.311c0.392-0.389,1.024-0.387,1.415,0.003L4,2.587l2.263-2.274C6.653-0.077,7.287-0.079,7.677,0.31\tC8.068,0.7,8.07,1.333,7.681,1.725l-2.27,2.281l2.298,2.309C8.099,6.705,8.097,7.339,7.705,7.729z"/></svg>',16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#4A48C1" d="M12.709,11.295L9.411,7.982l3.262-3.276c0.39-0.392,0.388-1.024-0.004-1.414\tc-0.39-0.39-1.023-0.388-1.414,0.003L8,6.564L4.746,3.295C4.357,2.904,3.724,2.903,3.332,3.292C2.94,3.682,2.939,4.315,3.329,4.707\tl3.261,3.275l-3.298,3.313c-0.39,0.391-0.388,1.024,0.003,1.414C3.49,12.903,3.745,13,4,13c0.257,0,0.513-0.099,0.708-0.295L8,9.399\tl3.291,3.306C11.486,12.901,11.743,13,12,13c0.255,0,0.511-0.097,0.705-0.291C13.097,12.319,13.099,11.686,12.709,11.295z"/></svg>'},enlarge:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M24,9v6.5c0,0.552-0.447,1-1,1s-1-0.448-1-1v-4.086L11.414,22H15.5c0.552,0,1,0.447,1,1s-0.448,1-1,1H9\tc-0.13,0-0.26-0.026-0.382-0.077c-0.245-0.102-0.439-0.296-0.541-0.541C8.026,23.26,8,23.13,8,23v-6.5c0-0.552,0.448-1,1-1\ts1,0.448,1,1v4.085L20.586,10H16.5c-0.552,0-1-0.448-1-1s0.448-1,1-1H23c0.13,0,0.26,0.026,0.382,0.077\tc0.245,0.102,0.439,0.296,0.541,0.541C23.974,8.74,24,8.87,24,9z"/></svg>'},options:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M26.1,21.383c0.334-0.625,0.602-1.279,0.812-1.949L32,18.609V13.51l-5.058-0.846\tc-0.208-0.67-0.468-1.325-0.795-1.956l3.009-4.145l-3.604-3.634L21.38,5.903c-0.626-0.333-1.276-0.602-1.948-0.81L18.609,0\tl-5.098,0.001l-0.847,5.061c-0.669,0.203-1.326,0.465-1.957,0.794L6.562,2.847L2.929,6.449l2.973,4.171\tC5.569,11.247,5.3,11.9,5.091,12.569L0,13.373v5.099l5.06,0.866c0.204,0.669,0.467,1.324,0.796,1.955l-3.009,4.146l3.601,3.635\tl4.171-2.975c0.627,0.335,1.282,0.603,1.951,0.811L13.372,32h5.118l0.849-5.057c0.668-0.207,1.323-0.469,1.953-0.795l4.144,3.01\tl3.639-3.604L26.1,21.383z M19.01,19.035c-1.675,1.663-4.381,1.652-6.041-0.025c-1.662-1.675-1.649-4.381,0.024-6.042\tc1.676-1.661,4.382-1.648,6.043,0.025C20.699,14.67,20.686,17.377,19.01,19.035z"/></svg>'},file:{32:'<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" x="0px" y="0px" version="1.1" viewBox="0 0 32 32"><path fill="#4A48C1" d="M16,28.5c-3.6,0-6.5-3-6.5-6.6V9.6c0-0.6,0.4-1,1-1s1,0.4,1,1v12.3c0,2.5,2,4.6,4.5,4.6\tc2.5,0,4.5-2.1,4.5-4.6V8.3c0-1.5-1.2-2.8-2.7-2.8c-1.5,0-2.7,1.3-2.7,2.8v13.5c0,0.6,0.5,1.1,1,1.1c0.6,0,1-0.5,1-1.1v-10\tc0-0.6,0.4-1,1-1s1,0.4,1,1v10c0,1.7-1.4,3.1-3,3.1s-3-1.4-3-3.1V8.3c0-2.6,2.1-4.8,4.7-4.8c2.6,0,4.7,2.2,4.7,4.8v13.6\tC22.5,25.5,19.6,28.5,16,28.5z"/></svg>'},upload:{32:'<svg xmlns="http://www.w3.org/2000/svg" width="32px" height="32px" x="0px" y="0px" viewBox="0 0 32 32"><defs/><path fill="#4A48C1" d="M9.488,13.481c-0.391-0.391-0.391-1.023,0-1.414l5.805-5.805c0.026-0.026,0.06-0.036,0.088-0.058\tc0.073-0.06,0.146-0.119,0.235-0.156c0.246-0.103,0.522-0.103,0.769,0c0.093,0.039,0.171,0.101,0.249,0.165\tc0.023,0.02,0.053,0.027,0.074,0.049l5.805,5.805c0.391,0.391,0.391,1.023,0,1.414c-0.195,0.195-0.451,0.293-0.707,0.293\ts-0.512-0.098-0.707-0.293L17,9.383V20.33c0,0.553-0.447,1-1,1c-0.552,0-1-0.447-1-1V9.383l-4.098,4.098\tC10.512,13.872,9.879,13.872,9.488,13.481z M22.819,24.031H9.181c-0.552,0-1,0.447-1,1s0.448,1,1,1h13.639c0.553,0,1-0.447,1-1\tS23.372,24.031,22.819,24.031z"/></svg>'},download:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#FFF" d="M3.175,7.726c-0.413-0.367-0.45-0.999-0.083-1.412c0.367-0.413,0.999-0.45,1.412-0.083L7,8.45V1.5\tc0-0.552,0.448-1,1-1c0.553,0,1,0.448,1,1v6.95l2.496-2.219c0.412-0.367,1.044-0.331,1.411,0.083\tc0.367,0.413,0.33,1.045-0.083,1.412l-4.16,3.698c-0.047,0.041-0.103,0.062-0.154,0.094c-0.047,0.028-0.089,0.064-0.141,0.085\tC8.25,11.649,8.125,11.677,8,11.677c-0.126,0-0.25-0.027-0.369-0.074c-0.05-0.021-0.09-0.055-0.136-0.083\tc-0.053-0.031-0.111-0.053-0.159-0.096L3.175,7.726z M12.018,13.5H3.983c-0.552,0-1,0.447-1,1s0.448,1,1,1h8.035\tc0.553,0,1-0.447,1-1S12.57,13.5,12.018,13.5z"/></svg>'},error:{16:'<svg xmlns="http://www.w3.org/2000/svg" width="16px" height="16px" x="0px" y="0px" viewBox="0 0 16 16"><defs/><path fill="#ad001f" d="M15.744,13.104L9.097,1.47c-0.604-1.055-1.59-1.055-2.193,0L0.256,13.104\tc-0.604,1.056-0.102,1.919,1.113,1.919H14.63C15.847,15.022,16.348,14.159,15.744,13.104z M7,5.045c0-0.552,0.448-1,1-1s1,0.448,1,1\tv3.656c0,0.552-0.448,1-1,1s-1-0.448-1-1V5.045z M8,13.212c-0.748,0-1.354-0.607-1.354-1.354c0-0.748,0.606-1.354,1.354-1.354\ts1.354,0.606,1.354,1.354C9.354,12.604,8.748,13.212,8,13.212z"/></svg>'},arrowLeft:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M13.6,8c0,0.6-0.4,1-1,1h-7l2.2,2.5c0.4,0.4,0.3,1-0.1,1.4c-0.2,0.2-0.4,0.2-0.7,0.2c-0.3,0-0.6-0.1-0.8-0.3\n\tL2.6,8.6c0,0-0.1-0.1-0.1-0.2c0,0-0.1-0.1-0.1-0.1c0-0.1-0.1-0.2-0.1-0.3c0,0,0,0,0,0c0,0,0,0,0,0c0-0.1,0-0.3,0.1-0.4\n\tc0,0,0.1-0.1,0.1-0.1c0-0.1,0.1-0.1,0.1-0.2l3.7-4.1c0.4-0.4,1-0.4,1.4-0.1c0.4,0.4,0.4,1,0.1,1.4L5.6,7h7C13.2,7,13.6,7.4,13.6,8z"\n\t/>\n</svg>\n'},arrowRight:{16:'<?xml version="1.0" encoding="utf-8"?>\n\x3c!-- Generator: Adobe Illustrator 25.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --\x3e\n<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"\n\t viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">\n<path fill="#5053A4" d="M2.4,8.1c0-0.6,0.4-1,1-1h7L8.1,4.5c-0.4-0.4-0.3-1,0.1-1.4c0.2-0.2,0.4-0.2,0.7-0.2c0.3,0,0.6,0.1,0.8,0.3\n\tl3.7,4.2c0,0,0.1,0.1,0.1,0.2c0,0,0.1,0.1,0.1,0.1c0,0.1,0.1,0.2,0.1,0.3c0,0,0,0,0,0c0,0,0,0,0,0c0,0.1,0,0.3-0.1,0.4\n\tc0,0-0.1,0.1-0.1,0.1c0,0.1-0.1,0.1-0.1,0.2l-3.7,4.1c-0.4,0.4-1,0.4-1.4,0.1c-0.4-0.4-0.4-1-0.1-1.4l2.2-2.4h-7\n\tC2.8,9.1,2.4,8.6,2.4,8.1z"/>\n</svg>\n'},check:{16:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="16px"\n height="16px"\n x="0px"\n y="0px"\n viewBox="0 0 16 16"\n>\n <path\n fill="currentColor"\n d="M11.6,4.3l-5,5L4.9,7.5C4.4,7,3.7,7,3.2,7.5l0,0C2.8,8,2.8,8.7,3.2,9.2l1.7,1.7l0,0l0.8,0.8\n\tc0.5,0.5,1.2,0.5,1.7,0l0.8-0.8l5-5c0.5-0.5,0.5-1.2,0-1.7l0,0C12.8,3.8,12.1,3.8,11.6,4.3z"\n />\n</svg>\n',32:'<svg\n xmlns="http://www.w3.org/2000/svg"\n width="32px"\n height="32px"\n x="0px"\n y="0px"\n viewBox="0 0 32 32"\n>\n <path\n fill="currentColor"\n d="M22.9,9.3l-9.3,9.3l-3.2-3.2c-0.9-0.9-2.3-0.9-3.2,0l0,0c-0.9,0.9-0.9,2.3,0,3.2l3.2,3.2l0,0l1.6,1.6\n\tc0.9,0.9,2.3,0.9,3.2,0l1.6-1.6l9.3-9.3c0.9-0.9,0.9-2.3,0-3.2l0,0C25.2,8.4,23.7,8.4,22.9,9.3z"\n />\n</svg>\n'}};var ga=({name:e,size:t="32",className:n,alt:r})=>Fi(o.FK,{children:[Fi("div",{"aria-hidden":"true",className:n||Qi("icon"),dangerouslySetInnerHTML:{__html:ya[e][t]}}),r&&Fi("span",{className:Qi("visually-hidden"),children:r})]});function _a({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=wi(),i=e.length;return Fi("div",{className:Qi("carousel-controls"),children:[Fi("button",{className:Qi("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+i)%i)},children:Fi(ga,{name:"arrowLeft",size:"16",alt:""})}),r,Fi("button",{className:Qi("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%i)},children:Fi(ga,{name:"arrowRight",size:"16",alt:""})})]})}function ba({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const i=e.length,a=(0,ai.hb)((e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(i-1,Math.max(0,r));o!==t&&n(o)}),[i,t,n]);return Fi("div",{className:Qi("carousel-pagination__wrapper"),role:"group",children:Fi("ul",{className:Qi("carousel-pagination"),children:e.map(((e,n)=>{const i=t===n;return Fi("li",{className:Qi("carousel-pagination__item",i?"is-active":void 0),children:Fi("button",{className:Qi("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":i?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))}))})})}const wa=(e,t,n)=>`${n}${t}`,Ca=e=>e.label,xa=({target:e})=>{e.scrollLeft=0};function Ea({currentIndex:e=0,onChange:t=(()=>{}),getItemKey:n=wa,getItemLabel:r=Ca,items:i}){const a=da(),s=i.length,[c,l]=(0,ai.J0)(Number(e||0));(0,ai.vJ)((()=>{l(Number(e||0))}),[l,e]);const u=(0,ai.li)([]);u.current=(0,ai.Kr)((()=>Array(s).fill(1).map((()=>(0,o._3)()))),[s]);const d=(0,ai.li)(!0),p=(0,ai.li)(null);return p.current=t,(0,ai.vJ)((()=>{d.current?d.current=!1:p.current&&p.current(c)}),[c]),Fi("div",{className:Qi("carousel"),role:"group","aria-roledescription":"carousel",children:[Fi("div",{className:Qi("carousel__slides-wrapper"),onScroll:xa,children:Fi("div",{id:a,className:Qi("carousel__slides"),style:{width:100*s+"%",left:-100*c+"%"},"aria-live":"polite","aria-atomic":"false",children:i.map(((e,t)=>{const r=c===t;return Fi("div",{ref:u.current[t],className:Qi("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:Fi(va,{item:e,items:i,index:t,isActive:r})},n(e,t,"item-"))}))})}),Fi("div",{className:Qi("carousel__controls"),children:Fi(_a,{currentIndex:c,items:i,onChange:l,children:Fi("div",{className:Qi("carousel__pagination"),children:Fi(ba,{currentIndex:c,items:i,onChange:l,getItemKey:n,getItemLabel:r})})})})]})}const Sa=(e,t,n="")=>`${n}${e.title}:${t}`,Ta=e=>e.title;const Na=e=>{const{payload:t}=e,[n,r]=(0,ai.J0)(!1),{sendAction:o,addMessageBubble:i,addDivider:a}=Ri(),{activeServiceSessionId:s}=Zn(),c=Rn(er),{body:l}=qi(e),{service:u}=t,d=(0,ai.Kr)((()=>{if("choice_prompt"===e.payload.type)return{...e,payload:{...e.payload,body:e.payload.body?.prompt,translatedBody:e.payload.translatedBody&&{...e.payload.translatedBody,data:e.payload.translatedBody?.prompt}}}}),[e]),p=l?.chooseAgain&&s===u?.serviceSessionId&&t.id!==c;return(0,ai.vJ)((()=>{r(t.id===c)}),[t,c]),{body:l,subEvent:d,showOptions:n,chooseAgain:p,onChoiceClickHandler:e=>{const n=m();p&&a("new_topic",n),i(e.text,n),o({type:"pick_choice",originMessage:t.id,choice:{id:e.id,text:e.text,chooseAgain:p},transactionId:n}),r(!1)},onChooseAgainClickHandler:()=>{r((e=>!e))}}};const ka=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`;var Aa=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const i=(0,ai.Kr)((()=>["suggestions__item",...t.map(ka)]),[t]),a=(0,ai.hb)((()=>{r&&r({id:e,question:n})}),[e,n,r]);return Fi("li",{className:Qi(i),children:Fi("button",{type:"button",onClick:a,className:Qi("button","button--primary"),children:[o&&Fi(ga,{name:"chevronRight",size:"8",alt:""}),n]})})},Ia=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>Fi("ul",{className:Qi("suggestions__list",e||""),children:t.map((e=>Fi(Aa,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id)))}),Oa=e=>{const{sendAction:t}=Ri();return n=>{n.target&&n.target.dataset.linkId&&t({type:"navigate",originMessage:e,link:{id:n.target.dataset.linkId,url:n.target.getAttribute("href")}})}},Ra=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:i,iconClassName:a,dividerType:s,title:c,description:l})=>{const u=Boolean(o||n);return Fi("div",{className:Qi("divider",s&&`divider--type-${s}`,t),children:[u&&Fi("span",{className:Qi("divider__graphic"),children:o?Fi(ga,{name:o,size:i,className:a,alt:""}):Fi("img",{src:n,className:Qi({icon:"icon"===r,avatar:"avatar"===r},a)})}),Fi("div",{className:Qi("divider__body"),children:[c?Fi("h2",{className:Qi("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?Fi("p",{className:Qi("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})};const La={[K.new_topic]:"new-topic"};const Pa={default:({event:e})=>{const{t:t}=wi(),{subtype:n}=e.payload.body;return K[n]?Fi(Ra,{dividerType:La[K[n]],iconName:K[n],title:t(`dividerKeys.${K[n]}`)}):null},[K.new_translation]:({event:e})=>{const{t:t}=wi(),n=Gn(),{body:{translationEnabled:r,text:i,title:a},id:s}=e.payload,c=Rn((e=>e.translations.translatedEventGroups)),l=ii(),u=(0,ai.hb)((()=>{c[s]?l(Go({events:n,id:s})):l(Xo({events:n,id:s}))}),[l,n,s,c]);return Fi(Ra,{iconName:"newTranslation",dividerType:"new-translation",title:a,description:i,children:r?Fi(o.FK,{children:Fi("button",{className:Qi("button","button--secondary"),onClick:u,children:t(c[s]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}};const Ma={month:"long",day:"numeric",year:"numeric"},ja={hour:"numeric",minute:"numeric"};var Da=({event:e})=>{const t=(()=>{const[e,t]=(0,ai.WO)((e=>e+1),0);return(0,ai.hb)((()=>{setTimeout((()=>{t()}))}),[])})(),{date:n,time:r,timeUntilMidnight:o,srText:i}=(e=>{const{t:t}=wi(),n=$n(),r=n?.context?.userLocale??[],o=new Date(e),i=new Date,a=new Date(i);a.setHours(24,0,0,0);const s=a.valueOf()-i.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ja).format(o);let u=((e,t)=>{const n=new Date(t).setHours(0,0,0,0),r=e.getTime(),o=864e5;return r>=n+o?e:r>n?"today":r>n-o?"yesterday":e})(o,i);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,Ma).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:s}})(g(e.payload.timeIndicator));return(0,ai.vJ)((()=>{const e=setTimeout((()=>{t()}),o);return()=>{clearTimeout(e)}}),[t,o]),Fi(Ra,{dividerType:"time-indicator",children:[Fi("h2",{className:Qi("divider__time"),"aria-hidden":"true",children:[Fi("span",{className:Qi("divider__time--date"),children:n}),Fi("span",{className:Qi("divider__time--time"),children:r})]}),Fi("p",{className:Qi("visually-hidden"),children:i})]})},Ua=["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])"],Fa=Ua.join(","),Ba="undefined"==typeof Element,za=Ba?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ha=!Ba&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},$a=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Va=function(e,t,n){if($a(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Fa));return t&&za.call(e,Fa)&&r.unshift(e),r.filter(n)},Ka=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var a=i.shift();if(!$a(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{za.call(a,Fa)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!$a(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return o},Ja=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Wa=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Ja(e)?0:e.tabIndex},qa=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ga=function(e){return"INPUT"===e.tagName},Xa=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ya=function(e,t){return!(t.disabled||$a(t)||function(e){return Ga(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=za.call(e,"details>summary:first-of-type")?e.parentElement:e;if(za.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Xa(e)}else{if("function"==typeof r){for(var i=e;e;){var a=e.parentElement,s=Ha(e);if(a&&!a.shadowRoot&&!0===r(a))return Xa(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(e){var t,n,r,o,i=e&&Ha(e),a=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=i=Ha(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!za.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Qa=function(e,t){return!(function(e){return function(e){return Ga(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Ha(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Wa(t)<0||!Ya(e,t))},Za=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},es=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,a=i?t.scopeParent:t,s=function(e,t){var n=Wa(e);return n<0&&t&&!Ja(e)?0:n}(a,i),c=i?e(t.candidates):a;0===s?i?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:s,item:t,isScope:i,content:c})})),r.sort(qa).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ts=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==za.call(e,Fa)&&Qa(t,e)},ns=Ua.concat("iframe").join(","),rs=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==za.call(e,ns)&&Ya(t,e)};function os(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function is(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?os(Object(n),!0).forEach((function(t){var r,o,i;r=e,o=t,i=n[t],o=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[o]=i})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):os(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var as=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},ss=function(e){return as(e)&&!e.shiftKey},cs=function(e){return as(e)&&e.shiftKey},ls=function(e){return setTimeout(e,0)},us=function(e,t){var n=-1;return e.every((function(e,r){return!t(e)||(n=r,!1)})),n},ds=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return"function"==typeof e?e.apply(void 0,n):e},ps=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},hs=[],fs=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||hs,i=is({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:ss,isKeyBackward:cs},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},s=function(e,t,n){return e&&void 0!==e[t]?e[t]:i[n||t]},c=function(e,t){var n="function"==typeof(null==t?void 0:t.composedPath)?t.composedPath():void 0;return a.containerGroups.findIndex((function(t){var r=t.container,o=t.tabbableNodes;return r.contains(e)||(null==n?void 0:n.includes(r))||o.find((function(t){return t===e}))}))},l=function(e){var t=i[e];if("function"==typeof t){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];t=t.apply(void 0,o)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var s=t;if("string"==typeof t&&!(s=r.querySelector(t)))throw new Error("`".concat(e,"` as selector refers to no known node"));return s},u=function(){var e=l("initialFocus");if(!1===e)return!1;if(void 0===e||!rs(e,i.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}if(!e)throw new Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(a.containerGroups=a.containers.map((function(e){var t=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Ka([e],t.includeContainer,{filter:Qa.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Za}):Va(e,t.includeContainer,Qa.bind(null,t)),es(n)}(e,i.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?Ka([e],t.includeContainer,{filter:Ya.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Va(e,t.includeContainer,Ya.bind(null,t))}(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,o=t.length>0?t[t.length-1]:void 0,a=n.find((function(e){return ts(e)})),s=n.slice().reverse().find((function(e){return ts(e)})),c=!!t.find((function(e){return Wa(e)>0}));return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=t.indexOf(e);return o<0?r?n.slice(n.indexOf(e)+1).find((function(e){return ts(e)})):n.slice(0,n.indexOf(e)).reverse().find((function(e){return ts(e)})):t[o+(r?1:-1)]}}})),a.tabbableGroups=a.containerGroups.filter((function(e){return e.tabbableNodes.length>0})),a.tabbableGroups.length<=0&&!l("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(a.containerGroups.find((function(e){return e.posTabIndexesFound}))&&a.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},p=function e(t){var n=t.activeElement;if(n)return n.shadowRoot&&null!==n.shadowRoot.activeElement?e(n.shadowRoot):n},h=function e(t){!1!==t&&t!==p(document)&&(t&&t.focus?(t.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=t,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(t)&&t.select()):e(u()))},f=function(e){var t=l("setReturnFocus",e);return t||!1!==t&&e},m=function(e){var t=e.target,n=e.event,r=e.isBackward,o=void 0!==r&&r;t=t||ps(n),d();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var h=us(a.tabbableGroups,(function(e){var n=e.firstTabbableNode;return t===n}));if(h<0&&(p.container===t||rs(t,i.tabbableOptions)&&!ts(t,i.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=u),h>=0){var f=0===h?a.tabbableGroups.length-1:h-1,m=a.tabbableGroups[f];s=Wa(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else as(n)||(s=p.nextTabbableNode(t,!1))}else{var v=us(a.tabbableGroups,(function(e){var n=e.lastTabbableNode;return t===n}));if(v<0&&(p.container===t||rs(t,i.tabbableOptions)&&!ts(t,i.tabbableOptions)&&!p.nextTabbableNode(t))&&(v=u),v>=0){var y=v===a.tabbableGroups.length-1?0:v+1,g=a.tabbableGroups[y];s=Wa(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else as(n)||(s=p.nextTabbableNode(t))}}else s=l("fallbackFocus");return s},v=function(e){var t=ps(e);c(t,e)>=0||(ds(i.clickOutsideDeactivates,e)?n.deactivate({returnFocus:i.returnFocusOnDeactivate}):ds(i.allowOutsideClick,e)||e.preventDefault())},y=function(e){var t=ps(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{var r;e.stopImmediatePropagation();var o=!0;if(a.mostRecentlyFocusedNode)if(Wa(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var d=l.findIndex((function(e){return e===a.mostRecentlyFocusedNode}));d>=0&&(i.isKeyForward(a.recentNavEvent)?d+1<l.length&&(r=l[d+1],o=!1):d-1>=0&&(r=l[d-1],o=!1))}}else a.containerGroups.some((function(e){return e.tabbableNodes.some((function(e){return Wa(e)>0}))}))||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),h(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){if(!(t=e,"Escape"!==(null==t?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===ds(i.escapeDeactivates,e)))return e.preventDefault(),void n.deactivate();var t;(i.isKeyForward(e)||i.isKeyBackward(e))&&function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];a.recentNavEvent=e;var n=m({event:e,isBackward:t});n&&(as(e)&&e.preventDefault(),h(n))}(e,i.isKeyBackward(e))},_=function(e){var t=ps(e);c(t,e)>=0||ds(i.clickOutsideDeactivates,e)||ds(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},b=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n.pause()}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=i.delayInitialFocus?ls((function(){h(u())})):h(u()),r.addEventListener("focusin",y,!0),r.addEventListener("mousedown",v,{capture:!0,passive:!1}),r.addEventListener("touchstart",v,{capture:!0,passive:!1}),r.addEventListener("click",_,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),n},w=function(){if(a.active)return r.removeEventListener("focusin",y,!0),r.removeEventListener("mousedown",v,!0),r.removeEventListener("touchstart",v,!0),r.removeEventListener("click",_,!0),r.removeEventListener("keydown",g,!0),n},C="undefined"!=typeof window&&"MutationObserver"in window?new MutationObserver((function(e){e.some((function(e){return Array.from(e.removedNodes).some((function(e){return e===a.mostRecentlyFocusedNode}))}))&&h(u())})):void 0,x=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map((function(e){C.observe(e,{subtree:!0,childList:!0})})))};return n={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,"onActivate"),n=s(e,"onPostActivate"),o=s(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=r.activeElement,null==t||t();var i=function(){o&&d(),b(),x(),null==n||n()};return o?(o(a.containers.concat()).then(i,i),this):(i(),this)},deactivate:function(e){if(!a.active)return this;var t=is({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,w(),a.active=!1,a.paused=!1,x(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}(o,n);var r=s(t,"onDeactivate"),c=s(t,"onPostDeactivate"),l=s(t,"checkCanReturnFocus"),u=s(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){ls((function(){u&&h(f(a.nodeFocusedBeforeActivation)),null==c||c()}))};return u&&l?(l(f(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){if(a.paused||!a.active)return this;var t=s(e,"onPause"),n=s(e,"onPostPause");return a.paused=!0,null==t||t(),w(),x(),null==n||n(),this},unpause:function(e){if(!a.paused||!a.active)return this;var t=s(e,"onUnpause"),n=s(e,"onPostUnpause");return a.paused=!1,null==t||t(),d(),b(),x(),null==n||n(),this},updateContainerElements:function(e){var t=[].concat(e).filter(Boolean);return a.containers=t.map((function(e){return"string"==typeof e?r.querySelector(e):e})),a.active&&d(),x(),this}},n.updateContainerElements(e),n},ms=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":i})=>{const a=da(),s=(0,ai.li)(null),c=(0,ai.li)(null),[l,u]=(0,ai.J0)(!1);return(0,ai.vJ)((()=>(l&&s.current&&(c.current=fs(s.current,{initialFocus:n.current||void 0}),c.current.activate()),()=>{c.current&&c.current.deactivate()})),[l,n]),(0,ai.vJ)((()=>{const e=(()=>{const e=[],t=[];return document.querySelectorAll('body > *:not([role="dialog"])').forEach((n=>{const r=n.getAttribute("aria-hidden");null!==r&&"false"!==r||(null!==r&&e.push(r),t.push(n),n.setAttribute("aria-hidden","true"))})),()=>{t.forEach(((t,n)=>{const r=e[n];null===r?t.removeAttribute("aria-hidden"):t.setAttribute("aria-hidden",r)}))}})();return()=>{e()}}),[l]),(0,ai.vJ)((()=>{l&&s.current&&s.current.addEventListener("keydown",(e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()}))}),[l,t]),(0,ai.Nf)((()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",a),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),i&&t.setAttribute("aria-labelledby",i),e.appendChild(t),s.current=t,u(!0),()=>{s.current&&(e.removeChild(s.current),s.current=null)}}),[r,i,a]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>s.current&&(0,o.XX)(e,s.current)}):s.current&&(0,o.XX)((0,o.v2)(e).filter(T).map((e=>(e.props={...e.props,onClose:t},e))),s.current)},vs=({url:e,description:t,onClose:n})=>{const r=$n(),o=ca(),i=Zi(),a=(0,ai.li)(null),{t:s}=wi(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof i?c.push(...i):c.push(...i(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return Fi(ms,{onClose:n,"aria-label":s("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>Fi("div",{className:Qi(c),onClick:u,style:d,children:Fi("div",{className:Qi("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[Fi("div",{className:Qi("modal__inner"),onClick:l,children:Fi("img",{className:Qi("modal__image"),src:e,alt:t})}),Fi("button",{type:"button",className:Qi("modal__close"),onClick:n,children:[Fi(ga,{name:"close",size:"16",alt:""}),s("lightbox.closeLabel")]})]})}))(n))})},ys=({description:e,url:t})=>{const{t:n}=wi(),[r,i]=(0,ai.J0)(!1);return Fi(o.FK,{children:[Fi("button",{type:"button",className:Qi("modal__enlarge"),onClick:()=>{i(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),Fi(ga,{name:"enlarge",size:"32",alt:""})]}),r&&Fi(vs,{url:t,description:e,onClose:()=>{i(!1)}})]})},gs=({event:e,...t})=>{const{body:n}=qi(e),r=Oa(e.payload.id),o=(0,ai.Kr)((()=>e.payload.optimisticallyInjected?{children:Fi("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}}),[n,e]);return Fi(fa,{type:"text",event:e,onClick:r,...t,...o})};const _s="PROCESSING_IMAGE",bs=({img:e,filename:t})=>{const{t:n}=wi(),r=n("fileUpload.srFileUploadedText",{fileName:t});return Fi(o.FK,{children:Fi("span",{className:Qi(["download","download--preview"]),children:[Fi("img",{src:e,alt:r}),Fi("span",{"aria-hidden":"true",className:Qi("file-download"),children:t})]})})},ws=({children:e,url:t,target:n})=>t?Fi("a",{href:t,download:!0,target:n,className:Qi(["download","download-link"]),children:e}):Fi("span",{className:Qi("download"),children:e});const Cs={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=wi(),i=da(),{body:a,subEvent:s,showOptions:c,chooseAgain:l,onChoiceClickHandler:u,onChooseAgainClickHandler:d}=Na(e);return Fi(o.FK,{children:[(0,o.v2)(t).filter(T).map((e=>(e.props={...e.props,event:s,descriptorId:i,showTranslationToggle:!1},e))),l&&Fi("button",{type:"button",className:Qi("button","button--secondary","button--choose-again"),"aria-expanded":c?"true":"false",onClick:d,"aria-describedby":i,children:[r(c?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),Fi(ga,{name:"chevronDown",size:"8",alt:""})]}),c&&Fi(fa,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:Fi("ul",{className:Qi("choice-prompt","choice-prompt--many"),children:a?.choices?.map((e=>Fi("li",{className:Qi("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{u(e)},children:e.text})},e.id)))})})]})},text:gs,image:({event:e,descriptorId:t,...n})=>{const{body:r}=qi(e),[o,i]=(0,ai.J0)(!1),a=ii();return Fi(fa,{event:e,type:"image",...n,children:[Fi("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(To(e.payload.id)),i(!0)}}),r?.isZoomable&&o&&Fi(ys,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=qi(e),o=Oa(n.id);return Fi(fa,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=qi(e);return ea(e).push("message--type-video"),Fi(fa,{event:e,type:"video",...n,children:[Fi("div",{id:t,className:Qi("visually-hidden"),children:r?.description}),Fi("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=wi(),{body:r}=qi(e),{fromClient:o,id:i}=e.payload,{filename:a,url:s}=r,c=(e=>{const{processingFileUploads:t}=Rn((({state:e})=>e));return(0,ai.Kr)((()=>{if(t.some((t=>t===e)))return _s;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}}),[e,t])})(i),l=(0,ai.Kr)((()=>n(s?"fileUpload.srFileDownloadText":"fileUpload.srFileUploadedText",{fileName:a})),[s,a,n]);return Fi(fa,{event:e,type:"upload",...t,children:c&&c!==_s?Fi(bs,{img:c,filename:a}):Fi(ws,{url:s,target:o?void 0:"_blank",children:[Fi(ga,{name:"download",size:"16",alt:l}),Fi("span",{"aria-hidden":"true",className:Qi("file-download"),children:a})]})})},cta:({event:e})=>{const{body:t}=qi(e),n=Oa(e.payload.id),{emitEvent:r}=Ri(),o=da(),i=(0,ai.hb)((()=>r(`action.${F}`,{type:F,originMessage:e.payload.id,link:{url:t?.buttonLink}})),[r,t,e]);return Fi(fa,{type:"cta",event:e,children:[Fi("div",{className:Qi("cta__content"),id:o,dangerouslySetInnerHTML:t?.description?{__html:t.description}:void 0,onClick:n}),Fi("a",{className:Qi("button","button--primary"),"aria-describedby":o,href:t?.buttonLink,rel:"noreferrer",target:t?.buttonNewTab?"_blank":"_self",onClick:i,children:t?.buttonText})]})},carousel:({event:e})=>{const{body:t}=qi(e),n=t.cards;return Fi(fa,{event:e,modifiers:"type-carousel",children:Fi(Ea,{items:n,getItemKey:Sa,getItemLabel:Ta})})},card:({event:e})=>{const{body:t}=qi(e),n=da();return Fi(fa,{type:"card",event:e,children:Fi(ma,{id:n,...t})})}},info:{text:gs,divider:({event:e,...t})=>Fi(Pa[K[e.payload.body.subtype]]||Pa.default,{event:e,...t}),translation:({event:e,...t})=>{const{t:n}=wi(),{body:r}=qi(e);return Fi(fa,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:Da},participant:{participant:({event:e})=>{const{participant:t}=e.payload,{body:n}=(e=>{const{translatedBody:t,translation:n,body:r}={body:e.payload?.participant?.introduction,translatedBody:e.payload?.participant?.translatedIntroduction,translation:e.payload?.participant?.translation},o=!!t,i=Rn(Ji(e));return{body:i&&o?t:r,hasTranslation:o,isTranslated:i&&o,locale:n?.locale}})(e);return n?Fi(Ra,{graphicSrc:t?.avatar,graphicType:t?.avatar?"avatar":void 0,iconName:t?.avatar?void 0:"balloon",dividerType:"participant",title:n}):null}},service_data:{suggestion:({event:e,...t})=>{const[n,r]=(0,ai.J0)(!0),o=ii(),i=Ei(),{sendAction:a,addMessageBubble:s}=Ri(),{suggestions:c,payload:l}=(e=>{const{payload:t}=e,{body:n}=qi(e);return{suggestions:n,payload:t}})(e),{showSuggestions:u}=$n(),d=Gn(),{t:p}=wi(),h=p("suggestions.headingText"),f=p("suggestions.footerText"),m=(0,ai.Kr)((()=>d.some((({payload:e,type:t})=>"message"===t&&e?.transactionLast))),[d]),v=(0,ai.hb)((({id:e,question:t})=>{r(!1),o(br(!0)),a({type:L,originMessage:l.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),s(t)}),[o,a,l.id,s]);return n&&!i&&m&&u?Fi("div",{className:Qi("suggestions","suggestions--conversation"),children:[h&&Fi("p",{className:Qi("suggestions__heading"),children:h}),Fi(fa,{type:"suggestions",showParticipant:!1,event:e,...t,children:[Fi(Ia,{className:"suggestions__list--conversation",onClickSuggestion:v,suggestions:c}),f&&Fi("p",{className:Qi("suggestions__footer"),children:f})]})]}):null}}};var xs=({children:e})=>{const{customComponents:t}=$n(),n=(0,ai.Kr)((()=>Object.keys(Cs).reduce(((e,n)=>(e[n]={...Cs[n],...t?t[n]:{}},e)),{fallback:gs})),[t]);return Fi(zi.Provider,{value:n,children:e})},Es=({children:e})=>{const{isMinimized:t}=Ci(),n=(0,ai.li)(0),{sendAction:r}=Ri(),{hasCountdown:o,isActive:i,stopCountdown:a}=la(),s=(0,ai.hb)((()=>{if(t)return;const e=(new Date).getTime(),s=()=>{r({type:"interactivity_update"}),n.current=e};o&&i&&(s(),a()),e-n.current>15e3&&s()}),[r,o,i,a,t]);return Fi("div",{className:Qi("activity-monitor"),tabIndex:-1,onMouseDown:s,onKeyUp:s,onTouchStart:s,onMouseMove:s,onWheel:s,onPointerDown:s,onPointerMove:s,children:Fi(sa.Provider,{value:s,children:e})})};const Ss=["text","choice_prompt","image","video"];var Ts=()=>{const e=ta(),t=(0,ai.li)(),n=(0,ai.li)(),r=ii(),o=ki(),i=(0,ai.li)(null),{initCountdown:a,endCountdown:s}=la(),{emitEvent:u}=Ri();return(0,ai.vJ)((()=>{if(e.socket){const{socket:t}=e;t.onError((e=>{const t=new Cr(e);r(Kr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(oo())})),t.onOpen((()=>{r(Jr())}))}}),[e,r]),(0,ai.vJ)((()=>{e.socket&&e.onConnection((({currentState:e})=>{if("join_channel_erred"===e){const e=new c;return r(Kr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}))}),[e,r]),(0,ai.vJ)((()=>{const t=e=>{if("participant"!==e.type)return;const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(wo(o.name)),r(No({participant:o,fromClient:n})),"string"!=typeof o&&o.introduction&&r(no(e))};e.onConnection((({connected:n})=>{const{channel:i}=e;return!(!n||!i||(i.onMessage=(e,n)=>{const i={type:e,payload:n};switch(e){case"ui":switch(n.state&&n.state.hasOwnProperty("loading")&&r(So(n.state.loading)),n.type){case"idle_detach_countdown":a(n.body.duration);break;case"idle_detach_countdown_elapsed":s(void 0,!0);break;case"resume_conversation_prompt":r(po());break;case"translation_proposal":r(Yo(n.body));break;case"user_first_response":r(br(!0)),o.emit("system.userFirstResponse",n.body)}break;case"context":n.contentLocale&&n.userLocale&&r(jr(n.userLocale));break;case"message":switch(t(n),n.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"cta":case"custom":case"carousel":case"card":n.service&&n.service.serviceSessionId&&r(vo(n.service.serviceSessionId)),r(no(i))}break;case"participant":t(i);break;case"service_data":n.persist&&r(Ao(n));break;case"ack":r(to(i));break;case"system":if("service_changed"===n.type){const{serviceSettings:e,...t}=n,{entry:o,proactiveMessages:i}=e,{upload:a}=o.options;r(_o({key:J,enabled:!(!a||!a.enabled)})),r(Ho(i.enabled||!1)),r(Io(o)),n.serviceSessionId&&r(vo(n.serviceSessionId)),u("system.serviceChanged",t)}break;case"info":"divider"!==n.type&&"text"!==n.type&&"translation"!==n.type||r(no(i));break;case"error":switch(n.type){case"find_conversation_erred":const e=new l(i);r(Kr({name:e.name,action:e.action,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError}));break;case"conversation_erred":case"attach_channel_erred":const t=new c(i);r(Kr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}))}}return n},1))}))}),[e,r,u,s,o,a]),(0,ai.vJ)((()=>{e.onConnection((({connected:t})=>{const{channel:r}=e;return!(!t||!r||(n.current&&r.off("message",n.current),n.current=r.on("message",(e=>Ss.includes(e.type)?(e.id!==i.current&&o.emit("message",e),i.current=e.id,e):e)),0))}))}),[e,o]),(0,ai.vJ)((()=>{e.onConnection((({connected:n})=>!!n&&(t.current&&e.channel?.off("sync",t.current),t.current=e.channel?.on("sync",(async e=>{try{const t=await r(Hr(e)).unwrap();if(!t)return;r(xo(t))}catch(e){}})),!0)))}),[e,r]),null},Ns=({children:e})=>{const{t:t}=wi(),n=ii(),r=Ai(),{addUploadBubble:o}=Ri(),i=(0,ai.hb)((async(e,t)=>{n(Mo(t));const r=await(e=>new Promise(((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>"string"==typeof r.result?t(r.result):void 0,r.onerror=e=>n(e)})))(e),o=new Image;o.src=r,await o.decode();const i=(e=>{const t=document.createElement("canvas"),n=t.getContext("2d"),[r,o]=(e=>{const{height:t,width:n}=e;return n>t&&n>600?[600,600*t/n]:t>600?[600*n/t,600]:[n,t]})(e);return t.width=r,t.height=o,n?.drawImage(e,0,0,r,o),t.toDataURL()})(o);try{sessionStorage.setItem(`image-${t}`,i)}catch(e){}finally{n(jo(t))}}),[n]),a=(0,ai.hb)((e=>{const a=m(),s=r.uploadFile(e,(e=>{n(Po({fileId:a,progress:Math.ceil(e)}))}),(async t=>{const{id:r,transactionId:s,occurredAt:c,body:{contentType:l,filename:u,filesize:d,url:p}}=t;n(Ro(a)),o(r,s,c,l,u,d,p),await i(e,r)}),(e=>{let r;switch(e?.error||""){case"file_uploads_are_disabled":r=t("fileUpload.errors.unavailable");break;case"request_entity_too_large":r=t("fileUpload.errors.tooLarge");break;case"file_has_invalid_mime_type":r=t("fileUpload.errors.wrongType");break;case"virus_found":r=t("fileUpload.errors.virusFound");break;default:r=t("fileUpload.errors.general")}n(Lo({fileId:a,errorText:r}))}));n(ho({fileId:a,fileName:e.name,uploadHandle:s}))}),[i,o,r,n,t]);return Fi(na.Provider,{value:a,children:e})},ks=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=la();return((e,t)=>{const n=(0,ai.li)(e);(0,ai.vJ)((()=>{n.current=e}),[e]),(0,ai.vJ)((()=>{if(null!==t){const e=setInterval((function(){n.current()}),t);return()=>clearInterval(e)}}),[t])})((()=>{r()}),e&&t&&n&&n>0?1e3:null),null},As=()=>{const{initUserSelectedOptions:e}=ia(),t=(0,ai.li)(!1),n=$n();return(0,ai.vJ)((()=>{n.api&&!t.current&&(t.current=!0,e())}),[e,n]),null};function Is(e,t,n=[]){const r=ki(),o=(0,ai.li)(t);(0,ai.vJ)((()=>{if(!n.every(Boolean))return;const t=(...e)=>o.current?.(...e);return r.emit("function.register",e,t),()=>r.emit("function.unregister",e,t)}),[r,e,...n])}var Os=()=>{const e=$n(),{sendMessage:t,sendContext:n,sendAction:r}=Ri(),o=ii(),{setVisibility:i,visible:a}=Ci(),s=(0,ai.li)(a),c=ki(),l=Ai(),u=Yn(),d=(0,ai.li)(null),h=(0,ai.li)(null),{isInline:f,isResolving:m}=rr(),v=Rn(Mi),y=(()=>{const{get:e}=Ii();return e?e("conversationUrl"):null})(),g=(0,ai.li)(null),_=ca(),{enableTranslations:b,disableTranslations:w}=Wi();return(0,ai.vJ)((()=>{s.current=a}),[a]),Is("askText",(e=>{t({body:e})}),[l.send]),Is("setVariables",(e=>{n({variables:e})}),[l.send]),Is("getVisibility",(e=>{e?e(s.current):console.warn("A callback function is required for the getVisibility action.")})),Is("setVisibility",(e=>{Object.values(yn).includes(e)?(_(),i(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')}),[e.api]),Is("sendCustomAction",((e,t)=>{r({type:"custom",body:{type:e,body:t}})}),[l.send]),Is("setTopic",(({name:e,fallbackMessage:t,userTriggered:n})=>{n&&o(mr({showSuggestions:!1})),e&&t?r({type:U,body:{name:e,fallbackMessage:t,participant:n?p:void 0}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")}),[l.send]),Is("setContext",(e=>{n(e)}),[l.send]),Is("setTranslation",(({enabled:e,locale:t})=>{e?b(t,H):w()}),[l.send]),(0,ai.vJ)((()=>{m||v||(g.current&&g.current!==y&&c.emit("unreadMessageCount",u),a===yn.open&&a!==h.current&&0!==d.current&&c.emit("unreadMessageCount",0),a!==yn.open&&u!==d.current&&c.emit("unreadMessageCount",u),h.current=a,d.current=u,"string"==typeof y&&(g.current=y))}),[u,a,c,f,m,v,y]),null},Rs=({children:e})=>{const t=ki(),n=(0,ai.li)(null),[r,o]=(0,ai.J0)(),i=(0,ai.li)(!0),a=(0,ai.hb)((e=>{i.current&&(o(e),t.emit("aria-live",e))}),[o,t]);return(0,ai.vJ)((()=>(n.current=null,r?.messageText&&(n.current=setTimeout((()=>{a({}),n.current&&clearTimeout(n.current)}),600)),()=>{n.current&&clearTimeout(n.current)})),[r,a]),(0,ai.vJ)((()=>()=>{i.current=!1}),[]),Fi(Ni.Provider,{value:a,children:[e,Fi("div",{className:Qi("app__live-container"),children:[Fi("div",{"aria-live":"assertive","aria-atomic":"true",className:Qi("visually-hidden"),children:r?.ariaLive===$?r?.messageText:null}),Fi("div",{"aria-live":"polite","aria-atomic":"true",className:Qi("visually-hidden"),children:r?.ariaLive===V?r?.messageText:null})]})]})},Ls=()=>{const{t:e}=wi(),t=Gn(),n=(0,ai.li)(0),r=(0,ai.li)(0),o=Jn().historyLoaded,{sendPolite:i}=Li(),{isOpen:a}=Ci(),s=(0,ai.li)(null),c=(0,ai.li)(null),l=(0,ai.Kr)((()=>y((t=>{const n=t.filter((({payload:e})=>!e.fromClient&&!e.fromHistory)).length;n>r.current&&(i(e("message.srNewEventCount",{newCount:n-r.current})),r.current=n)}),1e3)),[i,e]);return(0,ai.vJ)((()=>{t.length>n.current&&(a&&(c.current=l(t)),n.current=t.length)}),[t,l,a]),(0,ai.vJ)((()=>{s.current&&!a&&c.current&&(c.current(!0),c.current=null)}),[a]),(0,ai.vJ)((()=>{o&&setTimeout((()=>{i(e("window.srTexts.onHistoryLoad"))}),500)}),[o,e,i]),null},Ps=()=>{const{t:e}=wi(),{isOpen:t,isVisible:n}=Ci(),r=Yn(),{sendPolite:o}=Li(),i=(0,ai.Kr)((()=>y(o,2e3)),[o]),a=(0,ai.li)(null),s=(0,ai.li)(null);return(0,ai.vJ)((()=>{a.current!==n&&!n&&s.current&&s.current(),0!==r&&!t&&n&&(s.current=i(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n}),[r,t,n,i,e]),null},Ms=({store:e,children:t,eventBus:n,api:r})=>((0,ai.Md)((t=>{console.error(t),e.dispatch(Er(t))})),Fi(Dn,{store:e,children:Fi(Ti.Provider,{value:n,children:Fi(Si.Provider,{value:r,children:Fi(Rs,{children:Fi(Bi,{children:Fi(xs,{children:[Fi(As,{}),Fi(Ts,{}),Fi(Ps,{}),Fi(Ls,{}),Fi(ks,{}),Fi(Es,{children:[Fi(Os,{}),Fi(Ns,{children:t})]})]})})})})})}));const js=_t(qn,(e=>e.filter((e=>Gr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===O)))),Ds=_t([js],(e=>e.filter((e=>"participant"!==e.type)).at(-1))),Us=_t(js,(e=>e.filter((({payload:e})=>e?.id)).map((({payload:e})=>e.id)))),Fs=_t((({state:e})=>e.options.features?.webNotifications),(e=>e?.enabled));var Bs=()=>{const{t:e}=wi(),{showDisclaimer:t}=$n();return t?Fi("div",{className:Qi("disclaimer"),tabIndex:0,children:[Fi("h2",{className:Qi("disclaimer__title"),children:e("disclaimer.title")}),Fi("div",{className:Qi("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null};const zs=_t([({forms:e})=>e,(e,{formId:t})=>t],((e,t)=>e[t])),Hs=_t(zs,(e=>e?.controls||{})),$s=_t(Hs,(e=>{const t={};return Object.entries(e).forEach((([e,{value:n}])=>{t[e]=n})),t})),Vs=_t([Hs,(e,{name:t})=>t],((e,t)=>e[t]?.value)),Ks=_t([Hs,(e,{name:t})=>t],((e,t)=>e[t]?.touched)),Js=(0,o.q6)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Ws,Consumer:qs}=Js;var Gs=Js;function Xs(){return(0,ai.NT)(Gs)}function Ys(e){const t=ii(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:i}=Xs(),a=!!Rn((e=>zs(e,{formId:n}))),s=Rn((t=>Vs(t,{formId:n,name:e}))),c=Rn((t=>Ks(t,{formId:n,name:e}))),l=i?.[e],u=!l;(0,ai.vJ)((()=>{a&&t(Or({formId:n,name:e}))}),[a,n,e,t]),(0,ai.Nf)((()=>()=>{t(Rr({formId:n,name:e}))}),[a,n,e,t]);const d=(0,ai.hb)((t=>r(e,t.target.value)),[e,r]),p=(0,ai.hb)((()=>{o(e,!0)}),[o,e]);return[(0,ai.Kr)((()=>({name:e,onInput:d,onBlur:p,value:s})),[e,d,p,s]),(0,ai.Kr)((()=>({isValid:u,error:l,touched:c})),[u,l,c])]}function Qs(e){const{t:t}=wi(),{sendAssertive:n}=Li(),{hasLimit:r,limit:o}=nr(),i=(0,ai.Kr)((()=>y(n,f)),[n]),a=(0,ai.Kr)((()=>y(((e,n)=>{e&&i(t("input.srCharacterLimitText",{limit:n}))}),f)),[i,t]),[{value:s}]=Ys(e),c=o&&r&&s?o-s.length:o,l=!(!r||!c)&&c<=h,u=!(!r||!c)&&c<0;return(0,ai.vJ)((()=>{a(l,c)}),[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const Zs=e=>{const{hasCharacterLimit:t,characterLimit:n}=Qs(e),{entryMeta:{optionsOverride:{text:r}}}=Jn(),{t:o}=wi();return{placeholder:(0,ai.Kr)((()=>o("input.inputPlaceholder",{hasLimit:t,text:r?.placeholder||o("input.inputPlaceholderText"),limit:t?n:null})),[o,t,n,r?.placeholder]),label:(0,ai.Kr)((()=>o("input.inputLabel",{hasLimit:!r?.label&&t,text:r?.label||o("input.inputLabelText"),limit:!r?.label&&t?n:null})),[o,t,n,r?.label]),labelClass:(0,ai.Kr)((()=>r?.label?"label":"visually-hidden"),[r?.label])}};function ec(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=ii(),{entryMeta:{actions:t,translatedActions:n}}=Jn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(Oo())}}})(),n=Ai();return e?Fi("li",{className:Qi(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:Fi("button",{className:Qi(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:U,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const tc=(0,o.q6)(null),nc=()=>{const e=(0,ai.NT)(tc);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e};var rc=tc,oc=e=>{const t=(()=>{const e=(0,ai.NT)(zi);if(!e)throw new Error("useComponentContext has to be used within <ComponentContext.Provider>");return e})(),n=t[e.type];let r=n[e.payload.type],o=null;return"choice_prompt"===e.payload.type&&(o=n[e.payload.body.prompt.type]),"participant"===e.type&&(r=n[e.type]),r&&"function"!=typeof r&&(r=r[e.payload.body.type]),[r||t?.fallback,o]},ic=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=nc(),{sendAction:o}=Ri(),i=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:s}=xi({containerRef:i,freezeOnceVisible:!0}),c=ii(),[l,u]=oc(e);if((0,bn.useEffect)((()=>{if(s&&r?.includes(e.payload.id)){const t=r.reduce(((t,n)=>e?.payload?.id&&n&&!t.includes(e.payload.id)?t.concat(n):t),[]);c(go(t)),o({type:M,events:t})}}),[c,e.payload.id,s,o,r]),!l)return null;const d=["conversation__item"];return"info"===e.type?d.push("conversation__item--source-info"):e.payload.fromClient?d.push("conversation__item--source-user"):d.push("conversation__item--source-agent"),t&&d.push("conversation__item--new-participant"),Fi("li",{className:Qi(d),ref:a,children:[e.payload.timeIndicator&&Fi(Da,{event:e}),Fi(l,{event:e,children:Fi(u,{event:e})})]})},ac=()=>{const{id:e}=tr()||{};return Fi("li",{className:Qi("conversation__item","conversation__item--source-agent"),children:Fi("div",{className:Qi("message","message--source-agent","message--type-loading"),children:[Fi(ha,{eventPayload:{fromClient:!1,participant:e}}),Fi("div",{className:Qi("message__body"),children:Fi("span",{className:Qi("loader"),children:[Fi("span",{className:Qi("loader__part","one")}),Fi("span",{className:Qi("loader__part","two")}),Fi("span",{className:Qi("loader__part","three")}),Fi("span",{className:Qi("loader__part","four")})]})})]})})};const sc=()=>{const e=Gn();let t;return Fi(o.FK,{children:e.map((e=>{const{type:n,payload:r}=e;let o=!1;if("participant"!==n&&"service_data"!==n){const{participant:n,fromClient:i}=r,a=i?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return Fi(ic,{event:e,newParticipant:o},e.payload.key||e.payload.id)}))})};var cc=()=>{const{t:e}=wi(),t=Xn(),n=((e,t=20)=>{const[n,r]=(0,ai.J0)(e),o=(0,ai.li)(null);return(0,ai.vJ)((()=>(o.current=setTimeout((()=>r(e)),t),()=>{o.current&&clearTimeout(o.current)})),[e,t]),n})(t,t?0:20),{isOpen:r}=Ci(),i=Qn(),a=Ki();return Fi(o.FK,{children:[r&&Fi("a",{className:Qi("skip-link"),href:`#${i}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),Fi("div",{className:Qi("chat__body"),children:Fi("div",{className:Qi("conversation__container"),children:[Fi(Bs,{}),Fi("ol",{className:Qi("conversation"),children:[Fi(xs,{children:Fi(sc,{})}),n?Fi(ac,{}):null,Fi(ec,{})]})]})})]})};function lc(e,t){const n=(0,ai.li)(null),r=(0,ai.li)(e);return(0,ai.vJ)((()=>{r.current=e}),[e]),(0,ai.vJ)((()=>"number"!=typeof t?()=>{}:(n.current=setTimeout((()=>r.current()),t),()=>{n.current&&clearTimeout(n.current)})),[t]),n}const uc={visible:Qi("transition--visible"),in:Qi("transition--in"),visuallyHidden:Qi("visually-hidden")},dc=Object.values(uc),pc=e=>{const t=(0,ai.li)(null);t.current=e;const n="function"==typeof e;return(0,ai.Kr)((()=>n?(...e)=>t.current(...e):void 0),[n])},hc={notRendered:"notRendered",rendered:"rendered",visuallyHidden:"visuallyHidden"};var fc=({children:e,isActive:t,timeout:n=300,transitionStartState:r=hc.notRendered,onInTransitionComplete:i=(()=>{}),onOutTransitionComplete:a=(()=>{}),exitAfter:s,enterDelay:c=0})=>{const l=(0,ai.li)(!1),u=(0,ai.li)(null),d=(0,ai.li)(null),p=r===hc.visuallyHidden,[h,f]=(0,ai.J0)((()=>p?[uc.visuallyHidden]:[])),[m,v]=(0,ai.J0)((()=>0===c)),y=(0,ai.Kr)((()=>s?s+c:s),[c,s]);lc((()=>v(!1)),t?y:void 0),lc((()=>v(!0)),t?c:void 0);const g=(0,ai.Kr)((()=>m&&t),[t,m]),_=pc(i),b=pc(a),w="notRendered"!==r||h.length>0;return(0,ai.vJ)((()=>(l.current&&!g&&(f([uc.visible]),u.current=setTimeout((()=>{f([...p?[uc.visuallyHidden]:[]]),b&&(d.current=requestAnimationFrame((()=>{b()})))}),n)),!l.current&&g&&(f([uc.visible]),d.current=requestAnimationFrame((()=>{d.current=requestAnimationFrame((()=>{f([uc.visible,uc.in]),_&&(u.current=setTimeout((()=>{_()}),n))}))}))),l.current=g,()=>{u.current&&clearTimeout(u.current),d.current&&cancelAnimationFrame(d.current)})),[p,_,b,n,g]),Fi(o.FK,{children:w&&(0,o.v2)(e).filter(T).map((e=>{const{className:t=""}=e.props,n=t.split(" ").filter((e=>!dc.includes(e)));return(0,o.Ob)(e,{className:[...n,...h].join(" ")})}))})},mc=({isAside:e=!1})=>{const{isInline:t}=rr(),{t:n}=wi(),{sendAction:r,addMessageBubble:o}=Ri(),{isOpen:i,setVisibility:a}=Ci(),{showSuggestions:s}=$n(),c=da(),l=Ki(),u=(0,ai.li)(null),{sendPolite:d}=Li(),p=Rn(Mi),{hasCountdown:h,endCountdown:f}=la(),{hasPrompt:m,continueChat:v}=ua(),y=Ei(),g=Jn().serviceData.suggestion;const{body:_}=qi({payload:g,type:"service_data"}),b=(0,ai.Kr)((()=>p?[]:Array.isArray(_)?_:_?.data),[_,p]),w=(0,ai.li)(),C=(0,ai.li)(!1),x=(0,ai.li)(),E=!!b?.length,T=t?(y||i)&&!e:y,N=(0,ai.li)(T),k=E&&!T&&s,A=E?b:x.current;x.current=A;const I=(0,ai.Kr)((()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Qi(t)}),[e]),O=(0,ai.hb)((({id:e,question:t})=>{h&&f(!0),m&&v(),r({type:L,originMessage:g.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}}}),o(t),i||a(yn.open),l()}),[o,v,f,l,h,m,g,r,a,i]);(0,ai.vJ)((()=>{if(w.current!==b&&!T){if(E){const e=C.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout((()=>{d(e)}),30)}else C.current&&d(n("suggestions.srUnavailableText"));w.current=b}!N.current&&T?(S(u.current,l),d(n("suggestions.srUnavailableText"))):!E&&C.current&&S(u.current,l),C.current=E,N.current=T}),[b,E,T,l,d,n]);const R=n("suggestions.headingText"),P=n("suggestions.footerText"),M=R?"section":"div";return Fi(fc,{isActive:!!k,transitionStartState:hc.notRendered,children:Fi(M,{className:I,"aria-labelledby":R?c:void 0,ref:u,children:[R&&Fi("p",{id:c,className:Qi("suggestions__heading"),children:R}),!!A&&Fi(Ia,{suggestions:A,onClickSuggestion:O}),P&&!i&&Fi("p",{className:Qi("suggestions__footer"),children:P})]})})};const vc=(0,bn.forwardRef)((({children:e,className:t=""},n)=>{const{isOpen:r,isVisible:o,setVisibility:i}=Ci(),{namespace:a,layoutMode:s}=$n(),{isInline:c}=rr(),l=Zi(),u=Ei(),{t:d}=wi(),p=["chat",`chat--layout-${s}`,`namespace--${a}`,t];return"function"!=typeof l&&p.push(...l),r||"app"===s||p.push("chat--collapsed"),u&&p.push("chat--user-responded"),o&&Fi("section",{className:Qi(p),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!c&&r&&i(yn.minimized)},tabIndex:-1,ref:n,"aria-label":d("chat.srLabel"),children:[Fi("div",{className:Qi("chat-wrapper"),children:e}),"inline"===s&&r&&Fi(mc,{isAside:!0})]})}));var yc=vc,gc=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:i})=>{const a=da();return Fi("section",{tabIndex:-1,id:i,"aria-labelledby":n?a:void 0,className:Qi("chat-status",n?void 0:"chat-status--condensed"),children:[Fi("div",{className:Qi("chat-status__body"),children:[n?Fi("h2",{className:Qi("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&Fi("button",{type:"button",onClick:t,className:Qi("button","button--tertiary","chat-status__close"),children:[r||Fi(ga,{name:"close",size:"16",alt:""}),o&&Fi("span",{className:Qi("visually-hidden"),children:o})]})]})},_c=({handleClick:e,icon:t,title:n,srButtonText:r})=>Fi("button",{type:"button",onClick:e,className:Qi("button","button--primary","chat-status__button"),children:[Fi(ga,{name:t,size:"16",alt:""}),n,r&&Fi("span",{className:Qi("visually-hidden"),children:r})]});function bc(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=Yi(),{id:o}=Gi();return e&&t?Fi(gc,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:Fi(_c,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function wc(){const e=Rn(Mi),{isActive:t}=Wi();return e||t?null:Fi(bc,{})}var Cc=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:i})=>Fi("li",{className:Qi([i||"","translation-options__item"]),"aria-selected":t,role:"option",tabIndex:0,onClick:r,onKeyDown:e=>{"Space"!==e.code&&"Enter"!==e.code||(e.preventDefault(),r())},id:o,children:[Fi(ga,{name:"check",size:"16",alt:""}),e," ",n&&Fi("span",{children:["(",n,")"]})]}),xc=({onChange:e,describedById:t})=>{const{context:n}=$n(),r=(0,bn.useMemo)((()=>n?.contentLocale),[n?.contentLocale]),{t:o}=wi(),{languages:i,currentLocale:a,enableTranslations:s,disableTranslations:c}=Wi(),l=Ki(),u=t=>()=>{t===a||r===t?c():s(t,"translation_choice"),e(),l()},{primaryLanguages:d,remainingLanguages:p}=(0,bn.useMemo)((()=>i.reduce(((e,t)=>{const n=t.locale===r,o=((e,t,n)=>t===e.locale||!t&&n)(t,a,n);t.locale!==r&&e.remainingLanguages.push({...t,checked:o,isOriginal:n});const i=e.remainingLanguages.findIndex((e=>e.locale===a));return(n||o&&i>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:n}),e}),{primaryLanguages:[],remainingLanguages:[]})),[a,r,i]);return Fi("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Qi("translation-options"),children:[d.map((({locale:e,nativeName:t,checked:n,isOriginal:r},i)=>Fi(Cc,{id:e,label:t,checked:n,description:r?o("translations.settings.original"):void 0,onChange:u(e),itemClassName:Qi({"translation-options__item--original":r,"translation-options__item--selected":n&&0!==i})},e))),p.map((({locale:e,nativeName:t,checked:n,isOriginal:r})=>Fi(Cc,{id:e,label:t,checked:n,description:r?o("translations.settings.original"):void 0,onChange:u(e)},e)))]})},Ec=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:i,cancelButtonText:a,cancelButtonRef:s,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=da(),{hideOption:d}=ia(),{focusButton:p}=aa(),h=(0,ai.hb)((()=>{d(),c||p()}),[c,p,d]),f=(0,ai.hb)((()=>{n&&n(),h()}),[h,n]),m=(e=>{const t=(0,ai.li)(null);return(0,ai.vJ)((()=>{const n=n=>{t.current&&n.target instanceof HTMLElement&&!t.current.contains(n.target)&&(n.preventDefault(),n.stopPropagation(),e())};return document.addEventListener("click",n,!0),document.addEventListener("touchstart",n,!0),()=>{document.removeEventListener("click",n,!0),document.removeEventListener("touchstart",n,!0)}}),[e,t]),t})(f);return(0,ai.vJ)((()=>{E(m.current)}),[m]),Fi("section",{className:Qi("options",{"options--right":"right"===l.horizontal,"options--left":"left"===l.horizontal,"options--top":"top"===l.vertical,"options--bottom":"bottom"===l.vertical},e||""),"aria-labelledby":u,tabIndex:-1,ref:m,children:Fi("div",{className:Qi("options__body"),children:[Fi("h2",{id:u,className:Qi("options__title"),children:r}),Fi("button",{type:"button",onClick:f,"aria-describedby":u,className:Qi("button","options__close"),ref:e=>{s&&(s.current=e)},children:[Fi(ga,{name:"close",size:"16",alt:""}),Fi("span",{children:a})]}),o?Fi("p",{className:Qi("options__description"),id:i,children:o}):null,Fi("div",{className:Qi("options__wrapper"),children:t})]})})},Sc=function({onClose:e,position:t}){const{t:n}=wi(),r=da();return Fi(Ec,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:Fi(xc,{describedById:r,onChange:e})})};function Tc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,ai.J0)(!1),i=(0,ai.li)(null),a=da();return Fi("div",{className:Qi("translations__container"),onKeyDown:e=>{r&&x(e)===C.Escape&&(o(!1),E(i.current))},children:[Fi(fc,{transitionStartState:hc.notRendered,isActive:r,children:Fi("div",{className:Qi("options__dialog"),role:"dialog",children:Fi(Sc,{onClose:()=>{o(!1)},position:t})})}),Fi("button",{type:"button",className:Qi(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{x(e)===C.ArrowDown&&(o(!0),e.preventDefault())},ref:i,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}var Nc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:i={},...a})=>{const s=ii(),c=Rn((e=>$s(e,{formId:t}))),[l,u]=(0,ai.J0)(!1),[d,p]=(0,ai.J0)({}),{isValid:h,errors:f}=function(e,t){const n=(0,ai.Kr)((()=>function(e,t={}){return Object.entries(t).reduce(((t,[n,r])=>{const o=Array.isArray(r)?r:[r];for(let r=0;r<o?.length;r++)if(!o[r].fn(e[n],o[r].compareValue)){t[n]=o[r].errorText;break}return t}),{})}(e,t)),[e,t]);return{isValid:0===Object.keys(n).length,errors:n}}(c,i),m=(0,ai.Kr)((()=>({...f,...d})),[f,d]);(0,ai.Nf)((()=>{s(Ar({formId:t,persistData:n}))}),[t,n,s]),(0,ai.vJ)((()=>()=>{s(Ir({formId:t}))}),[t,n,s]);const v=(0,ai.hb)(((e,n)=>{s(Lr({formId:t,name:e,value:n}))}),[t,s]),y=(0,ai.hb)(((e,n)=>{s(Pr({formId:t,name:e,touched:n}))}),[s,t]),g=(0,ai.hb)(((e,t)=>{p((n=>({...n,[e]:t})))}),[p]),_=(0,ai.hb)((e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&h&&(s(br(!0)),o(c,{updateControlValue:v,setError:g}))}),[h,s,o,c,v,g]);(0,ai.vJ)((()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})}),[l,m,r]);const b=(0,ai.Kr)((()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:_,validationSchema:i,updateControlValue:v,updateControlTouched:y})),[t,c,m,l,_,i,v,y]);return t?o?Fi(Ws,{...a,value:b,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)};const kc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),Ac=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},Ic=e=>!!e?.length,Oc=e=>{const t=e&&e.trim();return!(!t||!t.match(/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i))},Rc=e=>!!e;var Lc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:i}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Xs();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&i&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),Fi("form",{onSubmit:r,className:Qi([...a,e]),...n})};function Pc({id:e,error:t}){const[n,r]=(0,ai.J0)(!1);return(0,ai.vJ)((()=>{const e=setTimeout((()=>r(!0)),300);return()=>clearTimeout(e)}),[]),Fi("div",{className:Qi("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&Fi("span",{id:e,className:Qi("error__message"),children:[Fi(ga,{name:"error",size:"16",alt:""}),t]})})}var Mc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:i,errorText:a,children:s})=>Fi(o.FK,{children:[e&&Fi("span",{id:`${t}-content-hint`,className:Qi("input__content-hint"),children:e}),Fi(Pc,{id:`${t}-error`,error:!i&&a}),Fi("div",{className:Qi("form-control__wrapper"),children:[Fi("label",{htmlFor:t,className:Qi(r),children:n}),s]})]}),jc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:i=null,"aria-invalid":a,"aria-describedby":s,...c}){const{isSubmitted:l}=Xs(),[u,{error:d}]=Ys(t),p=l&&d,h=[];return s&&h.push(s),i&&h.push(`${e}-content-hint`),p&&h.push(`${e}-error`),Fi(Mc,{id:e,contentHint:i,validity:!p,errorText:d,labelText:r,labelClass:o,children:Fi("input",{...u,...c,id:e,type:n,"aria-invalid":a||p?"true":"false","aria-describedby":h.join(" ")||void 0,name:t})})};function Dc({controlName:e,describedById:t}){const{t:n}=wi();return Fi(Lc,{noValidate:"true",className:Qi("options__form"),children:[Fi(jc,{id:"email-id",name:e,type:"email",className:Qi("transcript__input"),"aria-describedby":t,labelClass:Qi("label"),labelText:n("options.sendTranscript.label")}),Fi("div",{className:Qi("options__actions"),children:Fi("button",{type:"submit",className:Qi("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const Uc="email";const Fc={sendTranscript:()=>{const[e,t]=(0,ai.J0)(void 0),{hideOption:n}=ia(),{focusButton:r}=aa(),{t:o}=wi(),i=da(),{sendAction:a}=Ri(),s=(0,ai.Kr)((()=>({[Uc]:[kc(Rc,o("options.sendTranscript.noEmailText")),kc(Oc,o("options.sendTranscript.invalidEmailText"))]})),[o]),c=(0,ai.hb)((e=>{const t=e[Uc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()}),[a,n,r]),l=(0,ai.hb)((({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)}),[t]);return Fi(Ec,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:i,position:{vertical:"top",horizontal:"right"},children:Fi(Nc,{formId:"sendTranscript",onSubmit:c,validationSchema:s,onError:l,children:Fi(Dc,{controlName:Uc,describedById:i})})})}};var Bc=()=>{const{optionActive:e}=ia(),t=(0,ai.li)(),n=Fc[t.current??e];return e&&(t.current=e),n?Fi(n,{}):null},zc=()=>{const{t:e}=wi(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=ia(),{id:i}=aa(),a=(0,ai.li)(null),[s,c]=(0,ai.J0)(!1),l=(0,ai.li)(null),u=t.length,d=(0,ai.li)([]),p=(0,ai.li)(!1),h=u>1,f=t[0],m=(0,ai.Kr)((()=>f?.name?.trim().replace(/\s+/g,"")),[f]);return(0,ai.vJ)((()=>()=>{a.current&&clearTimeout(a.current)}),[]),(0,ai.vJ)((()=>{s&&!p.current&&requestAnimationFrame((async()=>{await Hi(60);const e=t.findIndex((e=>e.available)),n=-1===e?0:e;d.current&&E(d.current[n])})),p.current=s}),[s,t]),u?Fi("div",{className:Qi("options__container"),onKeyDown:e=>{s&&(x(e)===C.Escape&&(c(!1),E(l.current)),x(e)===C.Home&&(d.current&&E(d.current[0]),e.preventDefault()),x(e)===C.End&&(d.current&&E(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{h&&(a.current=setTimeout((()=>{c(!1)}),200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[Fi(fc,{transitionStartState:hc.notRendered,isActive:r,children:Fi("div",{className:Qi("options__dialog"),children:Fi(Bc,{})})}),h&&Fi(fc,{isActive:s,transitionStartState:hc.notRendered,children:Fi("ul",{className:Qi(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":i,children:t.map((({name:r,title:o,available:i},a)=>Fi("li",{className:Qi("options__menu__item"),role:"menuitem","data-testid":r,children:Fi("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Qi(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(x(e)===C.ArrowDown){const n=Math.min(u-1,t+1);d.current&&E(d.current[t===n?0:n]),e.preventDefault()}if(x(e)===C.ArrowUp){const n=Math.max(0,t-1);d.current&&E(d.current[t===n?u-1:n]),e.preventDefault()}})(e,a),onKeyPress:e=>((e,n)=>{const r=String.fromCharCode(e.charCode);if(1!==r.length||!r.match(/\S/))return;let o=-1;t.forEach(((e,t)=>{t>n&&e.title.charAt(0).toLowerCase()===r.toLowerCase()&&-1===o&&(o=t)})),-1!==o&&d.current&&E(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,i),"aria-disabled":!i,children:[Fi("span",{className:Qi("button__text"),children:[o,!i&&" "]}),i?null:Fi("span",{className:Qi("button__state"),children:e("options.unavailableText")})]})},r)))})}),Fi("button",{type:"button",className:Qi(["button","button--secondary","chat__options__button",...!h&&m?[`chat__options__button--${m}`]:[]]),id:i,onClick:()=>{r&&o(),h?c((e=>!e)):f.available&&!r&&n(f.name)},onKeyDown:h?e=>{x(e)===C.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!h&&"menu","aria-expanded":!!h&&s,"aria-disabled":!h&&!f.available,children:[h?Fi(ga,{name:"options",size:"32",alt:""}):null,Fi("span",{className:Qi("button__text"),children:h?e("options.openButtonText"):`${f.title}${f.available?"":" "}`}),h||f.available?null:Fi("span",{className:Qi("button__state"),children:e("options.unavailableText")})]})]}):null};function Hc(){const{menuOptions:e,allowOptionSelection:t}=ia(),{isAvailable:n}=Wi(),r=Rn(Mi),{t:o,userLocale:i}=wi(),a=Xi(i);if(!n&&(!t||!e.length)||r)return null;const s=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return Fi("div",{className:Qi("chat__options"),children:[n&&Fi("div",{className:Qi("chat__options-item","chat__options-item--left"),children:Fi(Tc,{classNames:["button--secondary"],children:[Fi(ga,{alt:s,name:"newTranslation",size:"16"}),Fi("span",{className:Qi("button__text"),children:s})]})}),t&&Fi("div",{className:Qi("chat__options-item","chat__options-item--right"),children:Fi(zc,{})})]})}var $c=()=>{const{scrollToRef:e,unreadIds:t}=nc(),{isMinimized:n}=Ci(),{t:r}=wi();return Fi(fc,{isActive:!!t.length&&!n,children:Fi("div",{className:Qi("unread-messages"),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),Fi(ga,{name:"chevronDown",size:"32",alt:""})]})})})},Vc=({children:e})=>{const t=Gn(),n=(0,ai.Kr)((()=>t.reduce(((e,t)=>t.payload.id?(e[t.payload.id]=(0,o._3)(),e):e),{})),[t]),{scrollToRef:r,scrollToBottom:i,containerRef:a,unreadIds:s}=(e=>{const t=(0,ai.li)(null),[n,r]=(0,ai.J0)(!0),o=Rn(Us),i=Gn(),a=Xn(),{isOpen:s}=Ci(),c=Jn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Rn((({state:e})=>e));(0,ai.vJ)((()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,i=Math.abs(t-n-o)>10;r(!i)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}),[]);const d=(0,ai.hb)((()=>{requestAnimationFrame((async()=>{await Hi(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})}))}),[]);return(0,ai.vJ)((()=>{u&&d()}),[u,d]),(0,ai.vJ)((()=>{n&&d()}),[n,o,i,a,s,c,l,d]),{containerRef:t,unreadIds:o,scrollToRef:()=>{const n=o.at(0);if(void 0!==n){const r=e[n]?.current;t.current?.scrollTo({top:r?.offsetTop,behavior:"auto",left:0})}},scrollToBottom:d}})(n);return Fi(rc.Provider,{value:{eventRefs:n,unreadIds:s,scrollToRef:r,scrollToBottom:i,containerRef:a},children:Fi("div",{className:Qi("chat__container"),children:[Fi("div",{className:Qi("chat__container__scroll-area"),ref:a,children:e}),Fi($c,{})]})})},Kc=({baseClassName:e,children:t,title:n})=>{const r=Qn(),o=da();return Fi("section",{id:r,className:Qi(e),"aria-describedby":o,tabIndex:-1,children:[Fi("h2",{className:Qi(`${e}__title`),id:o,children:n}),t]})},Jc=()=>{const{t:e}=wi(),t=Ki(),n=ca(),{emitEvent:r}=Ri(),{isActive:i,remaining:a,timer:s,endCountdown:c}=la(),l=!!a&&a>0,u=e(l?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return Fi(Kc,{baseClassName:"idle",title:u,children:l&&Fi(o.FK,{children:[Fi("div",{className:Qi("idle__count-container"),children:i&&Fi(o.FK,{children:[Fi("span",{className:Qi("idle__count-text"),children:e("idleDetachWarning.countdownText")}),Fi("span",{className:Qi("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",s)})]})}),Fi("div",{className:Qi("idle__options"),children:[Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{n(),c(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{c(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Wc=()=>{const{t:e}=wi(),t=ca(),{name:n}=tr()||{},{continueChat:r,restartChat:o}=ua();return Fi(Kc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:Fi("div",{className:Qi("prompt__options"),children:[Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})};const qc=()=>{const{sendAction:e}=Ri(),{features:t}=ia(),{typingPeekahead:n}=t||{},r=(0,ai.li)(null),o=(0,ai.li)(null),i=(0,ai.li)(!1),a=(0,ai.li)(null);(0,ai.vJ)((()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)}),[]);const s=(t,r)=>{e({type:P,state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(i.current=!0,a.current||(s(!0,e.target.value),a.current=setInterval((()=>{!i.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&s(!0,e.target.value)}),2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout((()=>{i.current=!1}),300),o.current=setTimeout((()=>{s(!1,e.target.value)}),2e3))}},Gc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=Jn().entryMeta,i=ii(),a=n||t||e,s=o[a]||r[a]||{},c=(0,ai.hb)((e=>{i(yo(e))}),[i]),l=(0,ai.hb)((e=>{i(mo(e))}),[i]),u=(0,ai.hb)((e=>{i(Do(e))}),[i]),d=(0,ai.hb)((()=>{n?u(null):l(e)}),[n,e,u,l]);return{activeEntry:a,activeEntryOptions:s,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Xc({controlName:e,skipLinkId:t}){const{t:n}=wi(),{sendAssertive:r}=Li(),{emitEvent:o}=Ri(),i=qc(),{setBlockAutoEntrySwitch:a}=Gc(),{placeholder:s,label:c,labelClass:l}=Zs(e),{hasCharacterLimit:u,reachedCharacterWarning:d,reachedCharacterLimit:p,remainingChars:h}=Qs(e),[{value:f}]=Ys(e),m=!!f,v=(0,ai.hb)((()=>{d&&r(n("input.srCharacterLimitText",{limit:h})),o("ui.inputFocus")}),[n,r,d,h,o]);return(0,ai.Nf)((()=>(a(m),()=>{a(!1)})),[a,m]),Fi(Lc,{className:Qi("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[Fi("div",{className:Qi(["input--text__container",...d&&!p?["character-warning"]:[],...p?["character-exceeded"]:[]]),children:[Fi(jc,{id:t,type:"text",name:e,className:Qi("input__text"),autocomplete:"off",placeholder:s,labelText:c,labelClass:Qi(l),"aria-invalid":!!u&&p,onKeyUp:i,onFocus:v}),Fi("div",{className:Qi("character-count"),children:d&&Fi("span",{children:h})})]}),Fi("button",{className:Qi("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!m||p,children:Fi(ga,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Yc="textMessageEntry";function Qc({...e}){const{isOpen:t,setVisibility:n}=Ci(),r=Qn(),o=Ki(),{sendMessage:i}=Ri(),a=(0,ai.hb)(((e,{updateControlValue:r})=>{i({body:e[Yc]}),r(Yc,""),o(),t||n(yn.open)}),[i,o,t,n]);return Fi(Nc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:Fi(Xc,{controlName:Yc,skipLinkId:r})})}var Zc=()=>{const{t:e}=wi(),{currentUploads:t}=oa();return Fi("div",{className:Qi("progress"),children:t.map((({id:t,name:n,progress:r,uploading:o,error:i})=>Fi("div",{className:Qi("progress_container"),children:[Fi("div",{className:Qi("progress__text"),children:[Fi("span",{className:Qi("progress__text--file-name"),children:n}),Fi("span",{className:Qi("progress__text--percentage"),children:`${r}%`})]}),Fi(Pc,{error:i,id:"progress-error"}),Fi("progress",{className:Qi("progress__bar"),role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e("fileUpload.srProgressLabel",{fileName:n}),max:"100","aria-valuenow":r,value:r,"aria-busy":o,children:`${r}%`})]},t)))})};function el({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:i}){const{isSubmitted:a}=Xs(),[s,c]=(0,ai.J0)(!1),[{onInput:l,onBlur:u},{error:d}]=Ys(t),p=da(),h=da(),f=da(),m=a&&d,v=[f];r&&v.push(h),m&&v.push(p);const y=(0,ai.hb)((()=>{c(!0)}),[c]),g=(0,ai.hb)((()=>{c(!1),u()}),[c,u]),_=(0,ai.hb)((e=>{const t={target:{value:e.target.files}};l(t)}),[l]);return Fi("div",{className:Qi("upload__container"),children:[r&&Fi("span",{className:Qi("upload__content-hint"),id:h,children:r}),Fi(Pc,{id:p,error:m&&d}),Fi("div",{className:Qi(["file-upload",...s?["focus-within"]:[]]),children:Fi("label",{htmlFor:e,className:Qi("upload__label"),children:[Fi(ga,{name:"upload",size:"32",alt:""}),Fi("div",{children:[Fi("span",{className:Qi(["upload__label--text"]),children:n}),Fi("input",{id:e,className:Qi("upload__input"),type:"file",name:t,onChange:_,"aria-invalid":m?"true":"false","aria-describedby":v.join(" "),accept:i||null,onFocus:y,onBlur:g}),Fi("span",{className:Qi("upload__output"),"aria-hidden":"true",id:f,children:o})]})]})})]})}var tl=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:i,onClickCancel:a})=>{const{t:s}=wi(),[{value:c}]=Ys(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return Fi(Lc,{className:Qi("upload-form"),children:[Fi(el,{name:t,id:e,accept:n,labelText:s("fileUpload.labelText"),outputText:s("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),Fi("div",{className:Qi("upload__button-container"),children:[Fi("button",{id:o||!i?e:void 0,type:"button",onClick:a,className:Qi("button","button--secondary","upload__cancel"),children:s("fileUpload.cancelButtonText")}),Fi("button",{className:Qi("button","button--primary"),type:"submit",children:s("fileUpload.uploadButtonText")})]})]})};const nl="fileListForm",rl="fileList";var ol=()=>{const{t:e}=wi(),{sendPolite:t,sendAssertive:n}=Li(),r=Qn(),i=Ki(),{serviceAllowsUploads:a,allowedMimeTypes:s,maxSize:c}=ra(),l=(0,ai.li)(null),u=(0,ai.li)(a),{cancelEntrySelection:d}=Gc(),{uploadFile:p,clearUploads:h,isUploading:f,isComplete:m}=oa(),{uploadHandle:v,hasServerError:y,progress:g}=((e,t)=>{const n=Rn((n=>Vs(n,{formId:e,name:t}))),{currentUploads:r}=oa(),o=n&&n.length>0;let i=null,a=!1,s=0;if(r&&r.length>0){const e=r[0];i=e.uploadHandle,a=!!e.error,s=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:i,hasServerError:a,progress:s}})(nl,rl),_=da(),w=(0,ai.li)(!0),C=e("fileUpload.contentHint",{size:b(c)}),x=(0,ai.li)(""),E=(0,ai.li)(null);(0,ai.vJ)((()=>{x.current&&E.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(C),x.current=C}),[C,n]),(0,ai.vJ)((()=>{g>0&&t(1===g?e("fileUpload.srStartedText"):`${g}%`)}),[g,t,e]),(0,ai.vJ)((()=>{w.current||f||!m||(h(),d(),i(),setTimeout((()=>{t(e("fileUpload.srCompleteText"))}),300)),w.current=m}),[f,m,h,d,i,t,e]);const S=(0,ai.hb)((({fileList:e})=>{p(e[0]),i()}),[p,!1,i]),T=(0,ai.hb)((()=>{v&&v.abort(),h(),d(),i()}),[v,h,d,i]),N=(0,ai.Kr)((()=>({[rl]:[kc((()=>a),e("fileUpload.errors.unavailable")),kc(Ic,e("fileUpload.errors.noFile")),kc(Ac,e("fileUpload.errors.tooLarge"),c)]})),[c,a,e]);return Fi("div",{className:Qi(["upload",...y?["upload--error"]:[]]),ref:E,children:Fi(Nc,{formId:nl,persistData:!0,onSubmit:S,validationSchema:N,children:[(f||!m)&&Fi(o.FK,{children:[Fi(Zc,{}),Fi("div",{className:Qi("upload__button-container"),children:Fi("button",{id:f||!m?r:void 0,type:"button",onClick:T,ref:l,className:Qi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&m&&Fi(tl,{controlName:rl,skiplinkId:r,accept:s?.join(", ")||"",contentHint:C,isComplete:m,isUploading:f,onClickCancel:T}),!u.current&&Fi(o.FK,{children:[Fi("span",{className:Qi("notification"),id:_,children:e("fileUpload.unavailableText")}),Fi("div",{className:Qi("upload__button-container"),children:Fi("button",{id:f||!m?r:void 0,type:"button",onClick:T,className:Qi("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},il=()=>{const{t:e}=wi(),{showFileUpload:t,serviceAllowsUploads:n}=ra(),[r,o]=(0,ai.J0)(n||!1),i=Ki(),a=(0,ai.li)(null),{setUserEntryType:s,activeEntry:c}=Gc(),l=(0,ai.li)(null),{sendPolite:u}=Li(),d=!!tr();return(0,ai.vJ)((()=>{S(l.current,(()=>{n||i()})),o(n||!1)}),[n,i]),(0,ai.vJ)((()=>{a.current&&!n&&u(e("fileUpload.srUnavailableText")),!1===a.current&&n&&u(e("fileUpload.srAvailableText")),d&&(a.current=n)}),[n,d,u,e]),t||c===I?null:Fi(fc,{isActive:r,transitionStartState:hc.rendered,children:Fi("div",{className:Qi("upload-toggle-wrapper"),children:Fi(fc,{isActive:r,transitionStartState:hc.visuallyHidden,children:Fi("button",{className:Qi(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{s(I),i()}:void 0,children:Fi(ga,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},al=()=>{const{isOpen:e}=Ci(),t=(0,ai.li)(null),{hasCountdown:n}=la(),[r,o]=(0,ai.J0)(n),{hasPrompt:i}=ua(),[a,s]=(0,ai.J0)(i),c=Ki(),l=(0,ai.li)(!1),{activeEntry:u}=Gc(),[d,p]=(0,ai.J0)({text:Qc,upload:ol}),[h,f]=(0,ai.J0)((()=>u)),m=$n(),{accountAllowsUploads:v}=ra(),y=(0,ai.hb)((()=>{S(t.current,c)}),[c]);(0,ai.vJ)((()=>{const{customComponents:e}=m,{entry:t}=e||{};t&&p((e=>({...e,...t})))}),[m]),(0,ai.vJ)((()=>{y(),o(n),s(i)}),[n,i,y]),(0,ai.vJ)((()=>{f(u),y()}),[u,y,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const g=d[h];return Fi("div",{className:Qi("chat__entry"),ref:t,children:[r&&Fi(Jc,{}),a&&Fi(Wc,{}),Fi("div",{className:Qi(["entry__body",...n||i?["entry__body--hidden"]:[]]),children:[h!==I&&v&&e?Fi(il,{}):null,Fi(g,{})]})]})},sl=()=>{const{t:e}=wi(),{isOpen:t,closeChat:n}=Ci(),{isWindow:r}=rr();return t&&r?Fi("button",{type:"button",className:Qi("button","collapse-button"),onClick:n,children:Fi(ga,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},cl=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:i,srText:a}}=ji(),s=Ri(),c=da(),{sendPolite:l}=Li(),u=Ki(),d="SeamlySessionExpiredError"===e?.name;return(0,ai.vJ)((()=>{!d&&a&&setTimeout((()=>{l(a)}),200)}),[l,a,d]),d?Fi(o.FK,{}):Fi("section",{className:Qi("interrupt"),"aria-labelledby":c,children:[Fi(sl,{}),Fi("div",{className:Qi("interrupt__body"),children:[Fi("h2",{id:c,className:Qi("interrupt__title"),children:t}),Fi("p",{className:Qi("interrupt__message"),children:n}),r&&i&&Fi("div",{className:Qi("interrupt__actions"),children:Fi("button",{type:"button",className:Qi("button","button--primary"),onClick:()=>{i&&s[i]&&s[i](),u()},children:r})})]})]})},ll=function({children:e}){const t=Rn(Mi),{isOpen:n}=Ci();return t?Fi(cl,{}):Fi(o.FK,{children:[Fi(Vc,{children:[Fi("div",{className:Qi("chat__container__header"),children:[Fi(wc,{}),Fi(sl,{})]}),e]}),Fi(al,{}),n&&Fi(Hc,{})]})};function ul({event:e}){const[t]=oc(e);return Fi("li",{children:Fi(t,{event:e})})}function dl({events:e}){return Fi("ul",{className:Qi("collapsed-chat-messages"),children:e.map((e=>Fi(ul,{event:e},e.payload.id)))})}function pl(){const{preChatEvents:e}=$n(),t=Rn(Mi),{isOpen:n}=Ci();return t||!e?.length||n?null:Fi(dl,{events:e})}function hl(){const{t:e}=wi(),t=e("window.chat.continue");return Fi(dl,{events:[(0,ai.Kr)((()=>({type:"message",payload:{type:"custom",body:{text:t}}})),[t])]})}const fl=()=>{const e=Vn(),t=tr(),n=Rn(Mi),r=t&&!n,o=r?t.avatar:e;return o?Fi("img",{className:Qi(r?"avatar":"icon"),src:o,alt:""}):Fi(ga,{name:"avatar",size:"32",alt:""})};var ml=({onClick:e})=>{const t=Oi(),{t:n}=wi(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=Ki(),{isOpen:i}=Ci(),a=Yn(),s=(0,ai.hb)((()=>{e(),o()}),[o,e]);return Fi(fc,{isActive:!i,transitionStartState:hc.rendered,children:Fi("button",{className:Qi("window-open-button"),"aria-label":r,"aria-hidden":i,onClick:s,children:[Fi(fc,{isActive:!!a,transitionStartState:hc.notRendered,children:Fi("span",{className:Qi("message-count"),"aria-hidden":"true",children:a})}),Fi(fl,{})]})})};const vl=(e,t,n)=>"object"==typeof e?e[t]:n;var yl=n.p+"sounds/beep.mp3";const gl=!!window.Notification;const _l={app:()=>Fi(yc,{children:Fi(ll,{children:Fi(cc,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=ii(),{connectWhenInView:t}=$n(),n=Rn(ir),{containerRef:r,isVisible:o}=xi({enabled:t,freezeOnceVisible:!0});return(0,ai.vJ)((()=>{o&&e(ni())}),[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Ci();return Fi(o.FK,{children:[Fi(fc,{isActive:!n,transitionStartState:hc.rendered,children:Fi("div",{ref:t,className:Qi("unstarted-wrapper","unstarted-wrapper--inline"),children:[Fi(pl,{}),Fi(mc,{})]})}),Fi(fc,{isActive:n,transitionStartState:hc.rendered,children:Fi(yc,{ref:t,children:e&&Fi(ll,{children:n&&Fi(cc,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Ci(),n=Ei(),{continueChat:r,preChat:i}=$n();return Fi(o.FK,{children:[Fi(ml,{onClick:t}),Fi(fc,{isActive:!!i&&!e&&!n,exitAfter:vl(i,"exitAfter"),enterDelay:vl(i,"enterDelay"),transitionStartState:hc.notRendered,children:Fi("div",{className:Qi("unstarted-wrapper","unstarted-wrapper--window"),children:Fi(pl,{})})}),Fi(fc,{isActive:r&&!e&&n,exitAfter:vl(r,"exitAfter"),enterDelay:vl(r,"enterDelay"),transitionStartState:hc.notRendered,children:Fi("div",{className:Qi("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:Fi(hl,{})})}),Fi(fc,{isActive:e,transitionStartState:hc.notRendered,children:Fi(yc,{children:Fi(ll,{children:Fi(cc,{})})})})]})}};function bl(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}var wl=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=Zn(),{notificationAudioURL:t}=$n(),[n,r]=(0,ai.J0)(gl?Notification.permission:"default"),[o,i]=(0,ai.J0)(document.visibilityState),a=Rn(Fs),s=(0,ai.hb)((async()=>{if(gl&&"granted"!==n){const e=await Notification.requestPermission();r(e)}}),[n]),c=(0,ai.Kr)((()=>"granted"===n),[n]),l=(0,ai.Kr)((()=>"hidden"===o),[o]);(0,ai.vJ)((()=>{"default"===n&&e&&s()}),[n,e,s]);const u=(0,ai.hb)((async(e,r)=>{if(a&&gl){if("default"===n&&s(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||yl);await e.play()}catch(e){console.warn(e)}if(c&&(l||!document.hasFocus())){const t=new Notification(e,r);t.onclick=function(){window.parent.focus(),window.focus(),t.close();const e=document.querySelector(`input[name=${Yc}]`);e&&e.focus()}}}}),[t,n,c,s,a,l]);return(0,ai.vJ)((()=>{if(!a)return()=>{};function e(){i(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}}),[a]),{permission:n,requestPermission:s,sendNotification:u}})(),[,n]=$i(),r=$n(),o=tr(),{proactiveMessages:i}=Zn(),{isOpen:a,isVisible:s}=Ci(),c=Zi(),l=Ei(),u=Rn(Ds),{body:d}=qi(u),{userLocale:p}=wi(),h=(0,ai.li)(void 0),f=(0,ai.Kr)((()=>d?"string"==typeof d?bl(d):"text"in d?bl(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?bl(d.prompt?.text):"":""),[d]);(0,ai.vJ)((()=>{o?.name&&f&&i&&u&&h.current!==u.payload?.id&&(t(o.name,{body:f,icon:o?.avatar}),h.current=u.payload.id)}),[o?.avatar,o?.name,u,f,i,t]);const m=_l[r.layoutMode],v=(0,ai.hb)((e=>{"function"==typeof n&&n(e)}),[n]),y=(0,ai.Kr)((()=>{if(p){const e=document.querySelector("html")?.getAttribute("lang");if(e!==p)return p}}),[p]);if(!m)return console.warn('"layoutMode" should be one of "app", "inline" or "window"'),null;const g=["app",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];return"function"!=typeof c?g.push(...c):g.push(...c(r)),a||"app"===r.layoutMode||g.push("app--collapsed"),l&&g.push("app--user-responded"),s?Fi("div",{className:Qi(g),lang:y,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:v,children:e||Fi(m,{})}):null},Cl=e=>Fi(Ms,{...e,children:Fi(wl,{})});class xl{constructor(e,n){const{namespace:r="",parentElement:o,...i}=e;this.config={...i,namespace:r},this.namespace=r,this.parentElement=o,this.externalApi=n,this.api=new we({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(t()),this.functions={},this.registerFunctions({on:this.eventBus.on,off:this.eventBus.off}),this.eventBus.on("function.register",((e,t)=>this.registerFunction(e,t))),this.eventBus.on("function.unregister",((e,t)=>this.unregisterFunction(e,t)))}async render(){const{view:e,...t}=this.config.customComponents||{},n={...this.config,parentElement:this.parentElement,customComponents:Object.keys(t).length?t:void 0},r=oi({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(fr(n)),await r.dispatch(hn()),await r.dispatch(lr()),r.dispatch(cr()),e?(0,o.XX)(Fi(Ms,{eventBus:this.eventBus,store:r,api:this.api,children:Fi(e,{})}),this.parentElement):(0,o.XX)(Fi(Cl,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,o.XX)(null,this.parentElement),this.eventBus.off(),this.api.disconnect(),this.functions={}}registerFunctions(e){Object.entries(e).forEach((([e,t])=>{this.registerFunction(e,t)}))}registerFunction(e,t){this.functions[e]=this.functions[e]||[],this.functions[e].push(t),this.externalApi.handleActions()}unregisterFunction(e,t){const n=this.functions[e];n&&n.length&&(this.functions[e]=n.filter((e=>e!==t)))}execFunction(e,...t){const n=this.functions[e];return!(!n||!n.length||(n.forEach((n=>{try{n(...t)}catch(t){console.error(`Action(${e}) failed: `,t)}})),0))}}const El=e=>"object"==typeof e&&"action"in e,Sl=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]});var Tl=class{constructor(e){this._waitingActions=[],this._instances={},this.timeoutId=void 0,this.appConfig=e,this.context={}}push(...e){(e=e.filter(El).map(Sl)).length&&(this._waitingActions.push(...e),this.handleActions())}handleActions(){const e=this._waitingActions;this._waitingActions=[],e.forEach((e=>{switch(e.action){case"init":this.handleInit(e);break;case"destroy":this.handleDestroy(e);break;default:this.handleAction(e)||this.setContext(e.action,...e.args)||this._waitingActions.push(e)}}))}instanceInitializing(e){const t=Object.keys(this._instances);return!e&&t.length>0||t.includes(e)}setContext(e,t){const{instance:n}=t;if(this.instanceInitializing(n))return!1;switch(e){case"setTopic":const{name:e}=t;return e&&(this.context.topic=e),!0;case"setTranslation":const{enabled:n,locale:r}=t;return n&&r&&(this.context.userLocale=r,this.context.source=H),!0;case"setContext":const{userLocale:o,contentLocale:i}=t;return this.context.userLocale=o,this.context.contentLocale=i,o&&o!=this.appConfig?.userLocale&&(this.context.source=H),!0;case"setVariables":return Object.keys(t).length>0&&(this.context.variables={...t}),!0;default:return!1}}handleInit(e){const t=this.getUserConfig(...e.args),n=this.getCombinedConfig(t),{parentElement:r,namespace:o}=n||t;if(o?Object.values(this._instances).forEach((e=>{e.parentElement!==r&&e.namespace!==o||this.destroy(e)})):this.destroy(),n){const e=this.createInstance(n);this._instances[n.namespace]=e,this.context={},window.clearTimeout(this.timeoutId),this.timeoutId=window.setTimeout((()=>{e.render()}),60)}}handleDestroy(e){this.destroy(e.instance)}handleAction(e){const{action:t,instance:n,args:r}=e,o=Object.values(this._instances);return!n&&o.length>1&&console.warn(`Multiple instances detected. Due to potential race conditions, it is recommended to target a specific instance with the action: ${t}`),o.map((e=>(!n||e.namespace===n)&&e.execFunction(t,...r))).some(Boolean)}createInstance(e){return new xl(e,this)}destroy(e){e?("string"==typeof e&&(e=this._instances[e]),e&&(e.destroy(),delete this._instances[e.namespace])):Object.entries(this._instances).forEach((([e,t])=>{t.destroy(),delete this._instances[e]}))}getUserConfig(e={}){return e}getCombinedConfig(e){const t={...e.context||this.appConfig.context,...this.context},n=this.getMergedVariables(e);Object.keys(n).length>0&&(t.variables=n);const r={...this.appConfig.defaults,...e.defaults},o={...this.appConfig,...e,api:{...this.appConfig.api,...e.api},context:Object.keys(t).length?t:void 0,defaults:Object.keys(r).length?r:void 0};return"function"==typeof this.appConfig?this.appConfig(o):o}getMergedVariables(e){return{...this.appConfig.context?.variables||{},...e.context?.variables||{},...this.context.variables||{}}}};const Nl=()=>{const e=ii();return{addEvent:t=>e(no(t)),clearEvents:()=>e(oo()),setHistory:t=>e(xo(t)),setEventsRead:t=>e(go(t)),setLoadedImageEventIds:t=>e(To(t)),ackEvent:t=>e(to(t)),setIsLoading:t=>e(So(t)),setParticipant:t=>e(No(t)),setHeaderTitle:t=>e(Co(t)),setHeaderSubTitle:t=>e(wo(t)),resetHistoryLoadedFlag:()=>e(fo()),setActiveService:t=>e(vo(t)),initIdleDetachCountdown:t=>e(uo(t)),decrementIdleDetachCountdownCounter:()=>e(co()),stopIdleDetachCountdownCounter:()=>e(zo()),clearIdleDetachCountdown:()=>e(ao()),initResumeConversationPrompt:()=>e(po()),clearResumeConversationPrompt:()=>e(so()),setServiceDataItem:t=>e(Ao(t)),setFeatures:t=>e(bo(t)),setFeatureEnabledState:t=>e(_o(t)),clearFeatures:()=>e(io()),setInitialState:t=>e(Eo(t)),setUserSelectedOptions:t=>e(Fo(t)),setUserSelectedOption:t=>e(Uo(t)),showOption:t=>e(Bo(t)),hideOption:()=>e(lo()),setServiceEntryMetadata:t=>e(Io(t)),setBlockAutoEntrySwitch:t=>e(yo(t)),setActiveEntryType:t=>e(mo(t)),setUserEntryType:t=>e(Do(t)),registerUpload:t=>e(ho(t)),setUploadProgress:t=>e(Po(t)),setUploadComplete:t=>e(Ro(t)),setUploadError:t=>e(Lo(t)),clearAllUploads:()=>e(ro()),setSeamlyContainerElement:t=>e(ko(t))}};var kl=()=>{const{t:e}=wi(),{title:t,subTitle:n}=Jn().headerTitles,r=Yn(),{isOpen:o}=Ci(),i=tr(),a=Rn(Mi),s=Vn(),c=i?.avatar??s,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?Fi("div",{className:Qi("agent-info"),children:[Fi("div",{className:Qi("agent-info__graphic"),children:[c?Fi("img",{className:Qi(i?.avatar?"avatar":"icon"),src:c,alt:""}):Fi(ga,{name:"avatar",size:"32",alt:""}),Fi("span",{className:Qi(u),"aria-hidden":"true",children:r})]}),Fi("div",{className:Qi("agent-info__body"),children:[Fi("p",{className:Qi("agent-info__heading"),children:t??e("header.title")}),Fi("p",{className:Qi("agent-info__text"),children:l})]})]}):null},Al=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=Jn(),r=(0,ai.li)(null),{t:o}=wi();return Fi("header",{className:Qi("chat__header"),children:[e,Fi("div",{className:Qi("header-controls"),children:Fi("button",{type:"button",className:Qi("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:Fi(ga,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},Il=function(e){if(window.seamly&&!Array.isArray(window.seamly))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const t=Array.isArray(window.seamly)?window.seamly:[],n=new Tl(e);window.seamly={push:n.push.bind(n)},n.push(...t)}}(),r}()}));
|
|
3
3
|
//# sourceMappingURL=~/standalone.min.js.map
|