@seamly/web-ui 25.1.0 → 25.2.0-beta.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 +279 -116
- 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.LICENSE.txt +2 -2
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +846 -691
- 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.LICENSE.txt +2 -2
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +1300 -41
- 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/styles.css +1 -1
- package/package.json +16 -16
- package/src/javascripts/core/domains/store/slice.ts +1 -0
- package/src/javascripts/core/domains/store/store.types.ts +1 -0
- package/src/javascripts/core/ui/components/conversation/conversation.tsx +5 -2
- package/src/javascripts/core/ui/components/conversation/loader.tsx +12 -2
- package/src/javascripts/core/ui/components/entry/text-entry/index.tsx +2 -2
- package/src/javascripts/core/ui/components/entry/upload/index.tsx +2 -2
- package/src/javascripts/core/ui/components/layout/chat.tsx +21 -1
- package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +20 -5
- package/src/javascripts/core/ui/components/warnings/prompt.tsx +2 -2
- package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +11 -2
- package/src/javascripts/core/ui/hooks/seamly-hooks.ts +2 -1
- package/src/javascripts/core/ui/hooks/seamly-state-hooks.ts +4 -1
- package/src/stylesheets/5-components/_conversation.scss +6 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see index.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var e={34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},81:(e,t,n)=>{"use strict";var r=n(9565),o=n(9306),s=n(8551),a=n(6823),i=n(851),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?i(e):t;if(o(n))return s(r(n,e));throw new c(a(e)+" is not iterable")}},116:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},283:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(4901),a=n(9297),i=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,m=r("".slice),y=r("".replace),v=r([].join),g=i&&!o(function(){return 8!==h(function(){},"length",{value:8}).length}),b=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+y(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(i?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?i&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=v(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return s(this)&&p(this).source||l(this)},"toString")},350:(e,t,n)=>{"use strict";var r=n(3724),o=n(9297),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,i=o(s,"name"),c=i&&"something"===function(){}.name,l=i&&(!r||r&&a(s,"name").configurable);e.exports={EXISTS:i,PROPER:c,CONFIGURABLE:l}},397:(e,t,n)=>{"use strict";var r=n(7751);e.exports=r("document","documentElement")},421:e=>{"use strict";e.exports={}},507:(e,t,n)=>{"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,s,a=n?e:e.iterator,i=e.next;!(o=r(i,a)).done;)if(void 0!==(s=t(o.value)))return s}},616:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},655:(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)}},679:(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")}},684:e=>{"use strict";e.exports=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}}},741: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)}},757:(e,t,n)=>{"use strict";var r=n(7751),o=n(4901),s=n(1625),a=n(7040),i=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,i(e))}},851:(e,t,n)=>{"use strict";var r=n(6955),o=n(5966),s=n(4117),a=n(6269),i=n(8227)("iterator");e.exports=function(e){if(!s(e))return o(e,i)||o(e,"@@iterator")||a[r(e)]}},1072:(e,t,n)=>{"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},1148:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return!s(t,function(t,r){if(!e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1162:e=>{"use strict";e.exports=require("preact/hooks")},1181:(e,t,n)=>{"use strict";var r,o,s,a=n(8622),i=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",m=i.TypeError,y=i.WeakMap;if(a||d.state){var v=d.state||(d.state=new y);v.get=v.get,v.has=v.has,v.set=v.set,r=function(e,t){if(v.has(e))throw new m(h);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var g=p("state");f[g]=!0,r=function(e,t){if(u(e,g))throw new m(h);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},s=function(e){return u(e,g)}}e.exports={set:r,get:o,has:s,enforce:function(e){return s(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}}}},1291:(e,t,n)=>{"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},1385:(e,t,n)=>{"use strict";var r=n(9539);e.exports=function(e,t,n){for(var o=e.length-1;o>=0;o--)if(void 0!==e[o])try{n=r(e[o].iterator,t,n)}catch(e){t="throw",n=e}if("throw"===t)throw n;return n}},1454:(e,t,n)=>{"use strict";n(1701)},1625:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1698:(e,t,n)=>{"use strict";var r=n(6518),o=n(4204),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")||!s("union")},{union:o})},1701:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(9539),d=n(684),p=n(4549),f=n(6395),h=!f&&!d("map",function(){}),m=!f&&!h&&p("map",TypeError),y=f||h||m,v=c(function(){var e=this.iterator,t=a(o(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:y},{map:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}return m?o(m,this,e):new v(i(this),{mapper:e})}})},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:(e,t,n)=>{"use strict";var r=n(9504),o=n(9297),s=n(5397),a=n(9617).indexOf,i=n(421),c=r([].push);e.exports=function(e,t){var n,r=s(e),l=0,u=[];for(n in r)!o(i,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},2086: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 s=t[r]||n,a=s.length=o?s.length:0;a--;)o==s[a][0]&&s.splice(a,1);return e},e.emit=function(r){for(var o,s=t[r]||n,a=s.length>0?s.slice(0,s.length):s,i=0;o=a[i++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},2106:(e,t,n)=>{"use strict";var r=n(283),o=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},2140:(e,t,n)=>{"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},2195:(e,t,n)=>{"use strict";var r=n(9504),o=r({}.toString),s=r("".slice);e.exports=function(e){return s(o(e),8,-1)}},2211:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2360:(e,t,n)=>{"use strict";var r,o=n(8551),s=n(6801),a=n(8727),i=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;v="undefined"!=typeof document?document.domain&&r?y(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):y(r);for(var o=a.length;o--;)delete v[d][a[o]];return v()};i[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=v(),void 0===t?n:s.f(n,t)}},2475:(e,t,n)=>{"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf",function(e){return!e})},{isSupersetOf:o})},2489:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(6395),d=n(9539),p=n(684),f=n(4549),h=!u&&!p("filter",function(){}),m=!u&&!h&&f("filter",TypeError),y=u||h||m,v=c(function(){for(var e,t,n=this.iterator,r=this.predicate,s=this.next;;){if(e=a(o(s,n)),this.done=!!e.done)return;if(t=e.value,l(n,r,[t,this.counter++],!0))return t}});r({target:"Iterator",proto:!0,real:!0,forced:y},{filter:function(e){a(this);try{s(e)}catch(e){d(this,"throw",e)}return m?o(m,this,e):new v(i(this),{predicate:e})}})},2529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},2577:(e,t,n)=>{"use strict";n(116)},2652:(e,t,n)=>{"use strict";var r=n(6080),o=n(9565),s=n(8551),a=n(6823),i=n(4209),c=n(6198),l=n(1625),u=n(81),d=n(851),p=n(9539),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},m=h.prototype;e.exports=function(e,t,n){var y,v,g,b,x,w,_,C=n&&n.that,S=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),j=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),N=r(t,C),I=function(e){return y&&p(y,"normal"),new h(!0,e)},O=function(e){return S?(s(e),T?N(e[0],e[1],I):N(e[0],e[1])):T?N(e,I):N(e)};if(E)y=e.iterator;else if(j)y=e;else{if(!(v=d(e)))throw new f(a(e)+" is not iterable");if(i(v)){for(g=0,b=c(e);b>g;g++)if((x=O(e[g]))&&l(m,x))return x;return new h(!1)}y=u(e,v)}for(w=E?e.next:y.next;!(_=o(w,y)).done;){try{x=O(_.value)}catch(e){p(y,"throw",e)}if("object"==typeof x&&x&&l(m,x))return x}return new h(!1)}},2777:(e,t,n)=>{"use strict";var r=n(9565),o=n(34),s=n(757),a=n(5966),i=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||s(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},2787:(e,t,n)=>{"use strict";var r=n(9297),o=n(4901),s=n(8981),a=n(6119),i=n(2211),c=a("IE_PROTO"),l=Object,u=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t=s(e);if(r(t,c))return t[c];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},2796:(e,t,n)=>{"use strict";var r=n(9039),o=n(4901),s=/#|\.prototype\./,a=function(e,t){var n=c[i(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},2839:(e,t,n)=>{"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},3215:(e,t,n)=>{"use strict";n(1148)},3375:(e,t,n)=>{"use strict";n(7642)},3392:(e,t,n)=>{"use strict";var r=n(9504),o=0,s=Math.random(),a=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+s,36)}},3440:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(5170),i=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=i(e),o=s(t);return a(t)<=n.size?c(t,function(e){n.includes(e)&&d(o,e)}):l(n.getIterator(),function(e){u(o,e)&&d(o,e)}),o}},3579:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(3789),i=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=s(t);return i(n,function(e){l(t,e)?u(o,e):c(o,e)}),o}},3706:(e,t,n)=>{"use strict";var r=n(9504),o=n(4901),s=n(7629),a=r(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3789:(e,t,n)=>{"use strict";var r=n(9306),o=n(8551),s=n(9565),a=n(1291),i=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 i(o(s(this.keys,this.set)))},includes:function(e){return s(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)}},3838:(e,t,n)=>{"use strict";var r=n(7080),o=n(5170),s=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==s(t,function(e){if(!n.includes(e))return!1},!0)}},3853:(e,t,n)=>{"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom",function(e){return!e})},{isDisjointFrom:o})},3949:(e,t,n)=>{"use strict";n(7588)},3972:(e,t,n)=>{"use strict";n(3853)},4055:(e,t,n)=>{"use strict";var r=n(4576),o=n(34),s=r.document,a=o(s)&&o(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},4114:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(4527),i=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=s(t),r=arguments.length;i(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},4117:e=>{"use strict";e.exports=function(e){return null==e}},4204:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).add,s=n(9286),a=n(3789),i=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=s(t);return i(n,function(e){o(c,e)}),c}},4209:(e,t,n)=>{"use strict";var r=n(8227),o=n(6269),s=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[s]===e)}},4270:(e,t,n)=>{"use strict";var r=n(9565),o=n(4901),s=n(34),a=TypeError;e.exports=function(e,t){var n,i;if("string"===t&&o(n=e.toString)&&!s(i=r(n,e)))return i;if(o(n=e.valueOf)&&!s(i=r(n,e)))return i;if("string"!==t&&o(n=e.toString)&&!s(i=r(n,e)))return i;throw new a("Can't convert object to primitive value")}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4402:(e,t,n)=>{"use strict";var r=n(9504),o=Set.prototype;e.exports={Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},4449:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<=n.size)return!1!==i(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)})}},4495:(e,t,n)=>{"use strict";var r=n(9519),o=n(9039),s=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4520:(e,t,n)=>{"use strict";n(2489)},4527:(e,t,n)=>{"use strict";var r=n(3724),o=n(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,i=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(o(e)&&!a(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4549:(e,t,n)=>{"use strict";var r=n(4576);e.exports=function(e,t){var n=r.Iterator,o=n&&n.prototype,s=o&&o[e],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return s}},4576: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")()},4603:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.append),u=o(c.delete),d=o(c.forEach),p=o([].push),f=new i("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&r(c,"delete",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=[];d(this,function(e,t){p(r,{key:t,value:e})}),a(t,1);for(var o,i=s(e),c=s(n),f=0,h=0,m=!1,y=r.length;f<y;)o=r[f++],m||o.key===i?(m=!0,u(this,o.key)):h++;for(;h<y;)(o=r[h++]).key===i&&o.value===c||l(this,o.key,o.value)},{enumerable:!0,unsafe:!0})},4659:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=function(e,t,n){r?o.f(e,t,s(0,n)):e[t]=n}},4901: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}},4913:(e,t,n)=>{"use strict";var r=n(3724),o=n(5917),s=n(8686),a=n(8551),i=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?s?function(e,t,n){if(a(e),t=i(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(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=i(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}},4916:(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}}}}}},s=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};e.exports=function(e,t){var n=r("Set");try{(new n)[e](o(0));try{return(new n)[e](o(-1)),!1}catch(r){if(!t)return!0;try{return(new n)[e](s(-1/0)),!1}catch(r){var a=new n;return a.add(1),a.add(2),t(a[e](s(1/0)))}}}catch(e){return!1}}},5024:(e,t,n)=>{"use strict";var r=n(6518),o=n(3650),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:o})},5031:(e,t,n)=>{"use strict";var r=n(7751),o=n(9504),s=n(8480),a=n(3717),i=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=s.f(i(e)),n=a.f;return n?c(t,n(e)):t}},5160:(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},s=r.useSyncExternalStore,a=r.useRef,i=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(!i){if(i=!0,s=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(s,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(s=e,t):(s=e,a=n)}var s,a,i=!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 f=s(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),l(f),f}},5170:(e,t,n)=>{"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},5397:(e,t,n)=>{"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},5610:(e,t,n)=>{"use strict";var r=n(1291),o=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):s(n,t)}},5714:(e,t,n)=>{"use strict";n(2475)},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},5876:(e,t,n)=>{"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf",function(e){return e})},{isSubsetOf:o})},5917:(e,t,n)=>{"use strict";var r=n(3724),o=n(9039),s=n(4055);e.exports=!r&&!o(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},5966:(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)}},6080:(e,t,n)=>{"use strict";var r=n(7476),o=n(9306),s=n(616),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},6119:(e,t,n)=>{"use strict";var r=n(5745),o=n(3392),s=r("keys");e.exports=function(e){return s[e]||(s[e]=o(e))}},6197:(e,t,n)=>{"use strict";n(1698)},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},6269:e=>{"use strict";e.exports={}},6279:(e,t,n)=>{"use strict";var r=n(6840);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},6319:(e,t,n)=>{"use strict";var r=n(8551),o=n(9539);e.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){o(e,"throw",t)}}},6395:e=>{"use strict";e.exports=!1},6469:(e,t,n)=>{"use strict";var r=n(8227),o=n(2360),s=n(4913).f,a=r("unscopables"),i=Array.prototype;void 0===i[a]&&s(i,a,{configurable:!0,value:o(null)}),e.exports=function(e){i[a][e]=!0}},6518:(e,t,n)=>{"use strict";var r=n(4576),o=n(7347).f,s=n(6699),a=n(6840),i=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||i(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(n,u))&&f.value:n[u],!l(m?u:h+(y?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&s(p,"sham",!0),a(n,u,p,e)}}},6699:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},6706:(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){}}},6801:(e,t,n)=>{"use strict";var r=n(3724),o=n(8686),s=n(4913),a=n(8551),i=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),o=c(t),l=o.length,u=0;l>u;)s.f(e,n=o[u++],r[n]);return e}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:(e,t,n)=>{"use strict";var r=n(4901),o=n(4913),s=n(283),a=n(9433);e.exports=function(e,t,n,i){i||(i={});var c=i.enumerable,l=void 0!==i.name?i.name:t;if(r(n)&&s(n,l,i),i.global)c?e[t]=n:a(t,n);else{try{i.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e}},6955:(e,t,n)=>{"use strict";var r=n(2140),o=n(4901),s=n(2195),a=n(8227)("toStringTag"),i=Object,c="Arguments"===s(function(){return arguments}());e.exports=r?s: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=i(e),a))?n:c?s(t):"Object"===(r=s(t))&&o(t.callee)?"Arguments":r}},6969:(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+""}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7015:(e,t,n)=>{"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(2195),a=Object,i=r("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?i(e,""):a(e)}:a},7080:(e,t,n)=>{"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},7347:(e,t,n)=>{"use strict";var r=n(3724),o=n(9565),s=n(8773),a=n(6980),i=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=i(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(s.f,e,t),e[t])}},7402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>x,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>h,StrictMode:()=>ie,Suspense:()=>E,SuspenseList:()=>N,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>X,cloneElement:()=>ne,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Q,createPortal:()=>L,createRef:()=>r.createRef,default:()=>le,findDOMNode:()=>oe,flushSync:()=>ae,forwardRef:()=>g,hydrate:()=>z,isElement:()=>ce,isFragment:()=>ee,isMemo:()=>te,isValidElement:()=>Z,lazy:()=>T,memo:()=>m,render:()=>F,startTransition:()=>u,unmountComponentAtNode:()=>re,unstable_batchedUpdates:()=>se,useDeferredValue:()=>d,useInsertionEffect:()=>f,useSyncExternalStore:()=>c,useTransition:()=>p,version:()=>Y});var r=n(8785),o=n(1162),s={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(s[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function i(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 c(e,t){var n=t(),r=(0,o.useState)({t:{__:n,u:t}}),s=r[0].t,a=r[1];return(0,o.useLayoutEffect)(function(){s.__=n,s.u=t,l(s)&&a({t:s})},[e,n,t]),(0,o.useEffect)(function(){return l(s)&&a({t:s}),e(function(){l(s)&&a({t:s})})},[e]),n}function l(e){var t,n,r=e.u,o=e.__;try{var s=r();return!((t=o)===(n=s)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function u(e){e()}function d(e){return e}function p(){return[!1,u]}n.d(t,s);var f=o.useLayoutEffect;function h(e,t){this.props=e,this.context=t}function m(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:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o.type=e,o}(h.prototype=new r.Component).isPureReactComponent=!0,h.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var y=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){var n=a({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=v,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var b=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},x={map:b,forEach:b,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},w=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,s=t;s=s.__;)if((o=s.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);w(e,t,n,r)};var _=r.options.unmount;function C(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=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return C(e,t,n)})),e}function S(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return S(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 E(){this.__u=0,this.o=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function T(e){var t,n,o;function s(s){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.createElement)(n,s)}return s.displayName="Lazy",s.__f=!0,s}function N(){this.i=null,this.l=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),_&&_(e)},(E.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=j(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(i):i())};n.__R=a;var i=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=S(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},E.prototype.componentWillUnmount=function(){this.o=[]},E.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]=C(this.__b,n,o.__O=o.__P)}this.__b=null}var s=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return s&&(s.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),s]};var I=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function O(e){return this.getChildContext=function(){return e.context},e.children}function k(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,r.render)((0,r.createElement)(O,{context:t.context},e.__v),t.v)}function L(e,t){var n=(0,r.createElement)(k,{__v:e,h:t});return n.containerInfo=t,n}(N.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.l.get(e);return r[0]++,function(o){var s=function(){t.props.revealOrder?(r.push(o),I(t,e,r)):o()};n?n(s):s()}},N.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},N.prototype.componentDidUpdate=N.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){I(e,n,t)})};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,A=/^(?: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]/,P=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,M=/[A-Z0-9]/g,D="undefined"!=typeof document,U=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function F(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function z(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var B=r.options.event;function V(){}function $(){return this.cancelBubble}function H(){return this.defaultPrevented}r.options.event=function(e){return B&&(e=B(e)),e.persist=V,e.isPropagationStopped=$,e.isDefaultPrevented=H,e.nativeEvent=e};var W,G={enumerable:!1,configurable:!0,get:function(){return this.class}},q=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},s=-1===n.indexOf("-");for(var a in t){var i=t[a];if(!("value"===a&&"defaultValue"in t&&null==i||D&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===i?i="":"translate"===c&&"no"===i?i=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||U(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":P.test(a)&&(a=c):c=a="oninput":s&&A.test(a)?a=a.replace(M,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(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",G)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=R,q&&q(e)};var K=r.options.__r;r.options.__r=function(e){K&&K(e),W=e.__c};var J=r.options.diffed;r.options.diffed=function(e){J&&J(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),W=null};var X={ReactCurrentDispatcher:{current:{readContext:function(e){return W.__n[e.__c].props.value},useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,useDeferredValue:d,useEffect:o.useEffect,useId:o.useId,useImperativeHandle:o.useImperativeHandle,useInsertionEffect:f,useLayoutEffect:o.useLayoutEffect,useMemo:o.useMemo,useReducer:o.useReducer,useRef:o.useRef,useState:o.useState,useSyncExternalStore:c,useTransition:p}}},Y="18.3.1";function Q(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===R}function ee(e){return Z(e)&&e.type===r.Fragment}function te(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function ne(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function re(e){return!!e.__k&&((0,r.render)(null,e),!0)}function oe(e){return e&&(e.base||1===e.nodeType&&e)||null}var se=function(e,t){return e(t)},ae=function(e,t){return e(t)},ie=r.Fragment,ce=Z,le={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:f,useTransition:p,useDeferredValue:d,useSyncExternalStore:c,startTransition:u,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"18.3.1",Children:x,render:F,hydrate:z,unmountComponentAtNode:re,createPortal:L,createElement:r.createElement,createContext:r.createContext,createFactory:Q,cloneElement:ne,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:ce,isFragment:ee,isMemo:te,findDOMNode:oe,Component:r.Component,PureComponent:h,memo:m,forwardRef:g,flushSync:ae,unstable_batchedUpdates:se,StrictMode:ie,Suspense:E,SuspenseList:N,lazy:T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:X}},7476:(e,t,n)=>{"use strict";var r=n(2195),o=n(9504);e.exports=function(e){if("Function"===r(e))return o(e)}},7550:(e,t,n)=>{"use strict";n(3579)},7561:(e,t,n)=>{"use strict";n(5024)},7566:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.getAll),u=o(c.has),d=new i("a=1");!d.has("a",2)&&d.has("a",void 0)||r(c,"has",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=l(this,e);a(t,1);for(var o=s(n),i=0;i<r.length;)if(r[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})},7588:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;s(t,function(t){e(t,n++)},{IS_RECORD:!0})}})},7629:(e,t,n)=>{"use strict";var r=n(6395),o=n(4576),s=n(9433),a="__core-js_shared__",i=e.exports=o[a]||s(a,{});(i.versions||(i.versions=[])).push({version:"3.45.1",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(e,t,n)=>{"use strict";var r=n(6518),o=n(3440),s=n(9039);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference",function(e){return 0===e.size})||s(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size})},{difference:o})},7657:(e,t,n)=>{"use strict";var r,o,s,a=n(9039),i=n(4901),c=n(34),l=n(2360),u=n(2787),d=n(6840),p=n(8227),f=n(6395),h=p("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(o=u(u(s)))!==Object.prototype&&(r=o):m=!0),!c(r)||a(function(){var e={};return r[h].call(e)!==e})?r={}:f&&(r=l(r)),i(r[h])||d(r,h,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},7740:(e,t,n)=>{"use strict";var r=n(9297),o=n(5031),s=n(7347),a=n(4913);e.exports=function(e,t,n){for(var i=o(t),c=a.f,l=s.f,u=0;u<i.length;u++){var d=i[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},7750:(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}},7751:(e,t,n)=>{"use strict";var r=n(4576),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}},8004:(e,t,n)=>{"use strict";var r=n(6518),o=n(9039),s=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection",function(e){return 2===e.size&&e.has(1)&&e.has(2)})||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},8014:(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}},8107:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(1291),i=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=s(t),r=a(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:t[i]}}),i("at")},8111:(e,t,n)=>{"use strict";var r=n(6518),o=n(4576),s=n(679),a=n(8551),i=n(4901),c=n(2787),l=n(2106),u=n(4659),d=n(9039),p=n(9297),f=n(8227),h=n(7657).IteratorPrototype,m=n(3724),y=n(6395),v="constructor",g="Iterator",b=f("toStringTag"),x=TypeError,w=o[g],_=y||!i(w)||w.prototype!==h||!d(function(){w({})}),C=function(){if(s(this,h),c(this)===h)throw new x("Abstract class Iterator not directly constructable")},S=function(e,t){m?l(h,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===h)throw new x("You can't redefine this property");p(this,e)?this[e]=t:u(this,e,t)}}):h[e]=t};p(h,b)||S(b,g),!_&&p(h,v)&&h[v]!==Object||S(v,C),C.prototype=h,r({global:!0,constructor:!0,forced:_},{Iterator:C})},8227:(e,t,n)=>{"use strict";var r=n(4576),o=n(5745),s=n(9297),a=n(3392),i=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 s(u,e)||(u[e]=i&&s(l,e)?l[e]:d("Symbol."+e)),u[e]}},8237:(e,t,n)=>{"use strict";var r=n(6518),o=n(2652),s=n(9306),a=n(8551),i=n(1767),c=n(9539),l=n(4549),u=n(8745),d=n(9039),p=TypeError,f=d(function(){[].keys().reduce(function(){},void 0)}),h=!f&&l("reduce",p);r({target:"Iterator",proto:!0,real:!0,forced:f||h},{reduce:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(h)return u(h,this,t?[e]:[e,n]);var r=i(this),l=0;if(o(r,function(r){t?(t=!1,n=r):n=e(n,r,l),l++},{IS_RECORD:!0}),t)throw new p("Reduce of empty iterator with no initial value");return n}})},8418:(e,t,n)=>{"use strict";e.exports=n(5160)},8469:(e,t,n)=>{"use strict";var r=n(9504),o=n(507),s=n(4402),a=s.Set,i=s.proto,c=r(i.forEach),l=r(i.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},8480:(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)}},8527:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<n.size)return!1;var l=n.getIterator();return!1!==i(l,function(e){if(!o(t,e))return c(l,"normal",!1)})}},8551:(e,t,n)=>{"use strict";var r=n(34),o=String,s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not an object")}},8622:(e,t,n)=>{"use strict";var r=n(4576),o=n(4901),s=r.WeakMap;e.exports=o(s)&&/native code/.test(String(s))},8686:(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})},8721:(e,t,n)=>{"use strict";var r=n(3724),o=n(9504),s=n(2106),a=URLSearchParams.prototype,i=o(a.forEach);r&&!("size"in a)&&s(a,"size",{get:function(){var e=0;return i(this,function(){e++}),e},configurable:!0,enumerable:!0})},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},8750:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(5170),a=n(3789),i=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 s(t)>n.size?c(n.getIterator(),function(e){d(t,e)&&u(o,e)}):i(t,function(e){n.includes(e)&&u(o,e)}),o}},8773:(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},8785:e=>{"use strict";e.exports=require("preact")},8872:(e,t,n)=>{"use strict";n(8237)},8981:(e,t,n)=>{"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},8992:(e,t,n)=>{"use strict";n(8111)},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9209:(e,t,n)=>{"use strict";n(5876)},9225:(e,t,n)=>{"use strict";n(8004)},9286:(e,t,n)=>{"use strict";var r=n(4402),o=n(8469),s=r.Set,a=r.add;e.exports=function(e){var t=new s;return o(e,function(e){a(t,e)}),t}},9297:(e,t,n)=>{"use strict";var r=n(9504),o=n(8981),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(o(e),t)}},9306:(e,t,n)=>{"use strict";var r=n(4901),o=n(6823),s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not a function")}},9433:(e,t,n)=>{"use strict";var r=n(4576),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}},9462:(e,t,n)=>{"use strict";var r=n(9565),o=n(2360),s=n(6699),a=n(6279),i=n(8227),c=n(1181),l=n(5966),u=n(7657).IteratorPrototype,d=n(2529),p=n(9539),f=n(1385),h=i("toStringTag"),m="IteratorHelper",y="WrapForValidIterator",v="normal",g="throw",b=c.set,x=function(e){var t=c.getterFor(e?y:m);return a(o(u),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return d(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:d(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),o=n.iterator;if(n.done=!0,e){var s=l(o,"return");return s?r(s,o):d(void 0,!0)}if(n.inner)try{p(n.inner.iterator,v)}catch(e){return p(o,g,e)}if(n.openIters)try{f(n.openIters,v)}catch(e){return p(o,g,e)}return o&&p(o,v),d(void 0,!0)}})},w=x(!0),_=x(!1);s(_,h,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?y:m,o.returnHandlerResult=!!n,o.nextHandler=e,o.counter=0,o.done=!1,b(this,o)};return r.prototype=t?w:_,r}},9497:(e,t,n)=>{"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9504:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.call,a=r&&o.bind.bind(s,s);e.exports=r?a:function(e){return function(){return s.apply(e,arguments)}}},9519:(e,t,n)=>{"use strict";var r,o,s=n(4576),a=n(2839),i=s.process,c=s.Deno,l=i&&i.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},9539:(e,t,n)=>{"use strict";var r=n(9565),o=n(8551),s=n(5966);e.exports=function(e,t,n){var a,i;o(e);try{if(!(a=s(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){i=!0,a=e}if("throw"===t)throw n;if(i)throw a;return o(a),n}},9565:(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)}},9617:(e,t,n)=>{"use strict";var r=n(5397),o=n(5610),s=n(6198),a=function(e){return function(t,n,a){var i=r(t),c=s(i);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=i[u++])!=l)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},9835:e=>{"use strict";e.exports=function(e){try{var t=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](n);return 1===r.size&&4===r.values().next().value}catch(e){return!1}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(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(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{API:()=>H,AgentInfo:()=>al,Chat:()=>Wi,ChatFrame:()=>Dc,ComponentFilter:()=>Xa,Conversation:()=>Pi,Engine:()=>Yc,EntryContainer:()=>Ac,EventParticipant:()=>Fs,ExternalApi:()=>el,Header:()=>il,Icon:()=>Hs,Interrupt:()=>Mc,MessageContainer:()=>zs,SeamlyActivityEventContext:()=>Rs,SeamlyActivityMonitor:()=>Ya,SeamlyApiContext:()=>Yo,SeamlyEventBusContext:()=>Qo,SeamlyFileUpload:()=>ei,SeamlyGeneralError:()=>v,SeamlyLiveRegionContext:()=>os,SeamlyOfflineError:()=>Wn,SeamlyStoreProvider:()=>Bt,Text:()=>Wa,TextEntry:()=>jc,Upload:()=>Lc,View:()=>Jc,appReducer:()=>Hn,appStorageProvider:()=>nl,calculateVisibility:()=>Ot,className:()=>Ss,configReducer:()=>zn,cookieStorageProvider:()=>sl,default:()=>fl,eventTypes:()=>w,formsReducer:()=>or,getSearchParamsByKeys:()=>ul,getUrlSearchParams:()=>cl,getUrlSearchString:()=>ll,i18nReducer:()=>ur,initResetSearchParams:()=>pl,interruptReducer:()=>yr,randomId:()=>z,replaceSearchParams:()=>dl,sessionStorageProvider:()=>x,setConfig:()=>Dn,setInitialLocale:()=>cr,setParticipant:()=>Jr,setPreChatEvents:()=>Fn,setTranslations:()=>lr,stateReducer:()=>po,timeout:()=>hs,translationReducer:()=>Co,useChoicePrompt:()=>Zs,useEvents:()=>hn,useGeneratedId:()=>Ds,useI18n:()=>qo,useSeamlyActions:()=>tl,useSeamlyChat:()=>ls,useSeamlyCommands:()=>rs,useSeamlyConfig:()=>Yt,useSeamlyEventStream:()=>Us,useSeamlyIdleDetachCountdown:()=>Ps,useSeamlyMessageContainerClassNames:()=>js,useSeamlyOptions:()=>ks,useSeamlyVisibility:()=>Ko,useTranslatedEventData:()=>ws,useTranslations:()=>xs,useTranslationsContainer:()=>_s,visibilityReducer:()=>jo,visibilityStates:()=>Nt}),n(9497),n(4114),n(8992),n(4520),n(3949),n(1454),n(7550),n(4603),n(7566),n(8721),n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(8872);var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var s=function(e,t){this.target=t,this.type=e},a=function(e){function n(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return t(n,e),n}(s),i=function(e){function n(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return t(n,e),n}(s),c=function(){if("undefined"!=typeof WebSocket)return WebSocket},l={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},u=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?l.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout(function(){return r._acceptOpen()},n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach(function(e){return r._ws.send(e)}),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach(function(t){return r._callEventListener(e,t)})},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach(function(t){return r._callEventListener(e,t)})},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach(function(t){return r._callEventListener(e,t)}),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach(function(t){return r._callEventListener(e,t)})},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce(function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e},0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?l.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),s=o.next();!s.done;s=o.next()){var a=s.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(function(e){return e!==t}))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?l.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?l.minReconnectionDelay:r,s=e.maxReconnectionDelay,a=void 0===s?l.maxReconnectionDelay:s,i=0;return this._retryCount>0&&(i=o*Math.pow(n,this._retryCount-1))>a&&(i=a),this._debug("next delay",i),i},e.prototype._wait=function(){var e=this;return new Promise(function(t){setTimeout(t,e._getNextDelay())})},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?l.maxRetries:n,o=t.connectionTimeout,s=void 0===o?l.connectionTimeout:o,a=t.WebSocket,i=void 0===a?c():a;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(u=i)||!u||2!==u.CLOSING)throw Error("No valid WebSocket class provided");var u;this._wait().then(function(){return e._getNextUrl(e._url)}).then(function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new i(t,e._protocols):new i(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},s))})}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new a(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new i(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}();const d=u,p=new Set;class f{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval(()=>{this.socket?.readyState===d.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))},3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#s=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((e,t)=>{const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}},{})}})(this.url);this.socket=new d(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const s={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(s)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#s),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#s),this.socket?.removeEventListener("error",this.#a),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,e=>t(JSON.parse(e.data)))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#o(e){this.#e=this.#e.filter(t=>!t(e)),p.forEach(e=>e())}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return p.add(e),()=>p.delete(e)}}class h extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class m 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 y extends m{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class v extends m{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class g extends m{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class b extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function x(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 w={info:"info",message:"message",participant:"participant",system:"system"},_="text",C="text",S="upload",E="received",j="read",T="custom",N="detach_service",I="dismiss",O="set_topic",k="click_card",L="translation_proposal",R=L,A="window_api",P="assertive",M="polite",D={new_topic:"newTopic",new_translation:"newTranslation"},U="uploads",F="navigate";function z(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const B=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new h(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function V(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const $=()=>null;class H{#i;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new f;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(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||x),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#i=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v3/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v3/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",e=>{e.persisted&&this.connected&&this.connect()})}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new y;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await B(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new v(e);throw new h(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#m(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const o=this.#d.context?.userLocale;return{...o?{userLocale:o}:{},...e}}async downloadFile(e,t){try{const n=await B(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),o=URL.createObjectURL(await n.blob());r.href=o,void 0!==r.download&&(r.download=t),r.click(),setTimeout(()=>{URL.revokeObjectURL(o)},6e4)}catch(e){}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const s=new XMLHttpRequest;return s.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),s.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),s.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},s.onloadend=()=>{if(0!==s.status)if(200!==s.status&&201!==s.status||!n){if(!r)throw new Error(s.response);try{r(JSON.parse(s.response))}catch(e){r(s.response)}}else try{n(JSON.parse(s.response))}catch(e){n(s.response)}},s.send(o),s}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await B(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new v(e);if(400===e.status)throw new b(e);if(404===e.status)throw new y(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await B(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new y(e);if(e.status>=500)throw new v(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await B(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new b(e);if(404===e.status)throw new g(e);if(e.status>=500)throw new v(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection(({connected:e,ready:t})=>{this.connected=e,this.#i=t}),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#i?($("[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=z()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection(({connected:n,ready:r})=>(this.connected=n,this.#i=r,!!r&&(this.send(e,t),!0)))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#y(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#m(e,t){e.source||t==this.#d.context?.userLocale||(e.source=A)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"25.1.0",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:V(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}function W(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 G=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),q=()=>Math.random().toString(36).substring(7).split("").join("."),K={INIT:`@@redux/INIT${q()}`,REPLACE:`@@redux/REPLACE${q()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${q()}`};function J(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 X(e,t,n){if("function"!=typeof e)throw new Error(W(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(W(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(W(1));return n(X)(e,t)}let r=e,o=t,s=new Map,a=s,i=0,c=!1;function l(){a===s&&(a=new Map,s.forEach((e,t)=>{a.set(t,e)}))}function u(){if(c)throw new Error(W(3));return o}function d(e){if("function"!=typeof e)throw new Error(W(4));if(c)throw new Error(W(5));let t=!0;l();const n=i++;return a.set(n,e),function(){if(t){if(c)throw new Error(W(6));t=!1,l(),a.delete(n),s=null}}}function p(e){if(!J(e))throw new Error(W(7));if(void 0===e.type)throw new Error(W(8));if("string"!=typeof e.type)throw new Error(W(17));if(c)throw new Error(W(9));try{c=!0,o=r(o,e)}finally{c=!1}return(s=a).forEach(e=>{e()}),e}return p({type:K.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(W(10));r=e,p({type:K.REPLACE})},[G]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(W(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[G](){return this}}}}}function Y(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:K.INIT}))throw new Error(W(12));if(void 0===n(void 0,{type:K.PROBE_UNKNOWN_ACTION()}))throw new Error(W(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],l=e[i],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(W(14));a[i]=u,s=s||u!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function Q(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function Z(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var ee=Z(),te=Z,ne=Symbol.for("immer-nothing"),re=Symbol.for("immer-draftable"),oe=Symbol.for("immer-state");function se(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ae=Object.getPrototypeOf;function ie(e){return!!e&&!!e[oe]}function ce(e){return!!e&&(ue(e)||Array.isArray(e)||!!e[re]||!!e.constructor?.[re]||me(e)||ye(e))}var le=Object.prototype.constructor.toString();function ue(e){if(!e||"object"!=typeof e)return!1;const t=ae(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)===le}function de(e,t){0===pe(e)?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function pe(e){const t=e[oe];return t?t.type_:Array.isArray(e)?1:me(e)?2:ye(e)?3:0}function fe(e,t){return 2===pe(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function he(e,t,n){const r=pe(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function me(e){return e instanceof Map}function ye(e){return e instanceof Set}function ve(e){return e.copy_||e.base_}function ge(e,t){if(me(e))return new Map(e);if(ye(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ue(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[oe];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(ae(e),t)}{const t=ae(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function be(e,t=!1){return we(e)||ie(e)||!ce(e)||(pe(e)>1&&Object.defineProperties(e,{set:{value:xe},add:{value:xe},clear:{value:xe},delete:{value:xe}}),Object.freeze(e),t&&Object.values(e).forEach(e=>be(e,!0))),e}function xe(){se(2)}function we(e){return Object.isFrozen(e)}var _e,Ce={};function Se(e){const t=Ce[e];return t||se(0),t}function Ee(){return _e}function je(e,t){t&&(Se("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Te(e){Ne(e),e.drafts_.forEach(Oe),e.drafts_=null}function Ne(e){e===_e&&(_e=e.parent_)}function Ie(e){return _e={drafts_:[],parent_:_e,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Oe(e){const t=e[oe];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function ke(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[oe].modified_&&(Te(t),se(4)),ce(e)&&(e=Le(t,e),t.parent_||Ae(t,e)),t.patches_&&Se("Patches").generateReplacementPatches_(n[oe].base_,e,t.patches_,t.inversePatches_)):e=Le(t,n,[]),Te(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ne?e:void 0}function Le(e,t,n){if(we(t))return t;const r=t[oe];if(!r)return de(t,(o,s)=>Re(e,r,t,o,s,n)),t;if(r.scope_!==e)return t;if(!r.modified_)return Ae(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;const t=r.copy_;let o=t,s=!1;3===r.type_&&(o=new Set(t),t.clear(),s=!0),de(o,(o,a)=>Re(e,r,t,o,a,n,s)),Ae(e,t,!1),n&&e.patches_&&Se("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function Re(e,t,n,r,o,s,a){if(ie(o)){const a=Le(e,o,s&&t&&3!==t.type_&&!fe(t.assigned_,r)?s.concat(r):void 0);if(he(n,r,a),!ie(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(ce(o)&&!we(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Le(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(me(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||Ae(e,o)}}function Ae(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&be(t,n)}var Pe={get(e,t){if(t===oe)return e;const n=ve(e);if(!fe(n,t))return function(e,t,n){const r=Ue(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_||!ce(r)?r:r===De(e.base_,t)?(ze(e),e.copy_[t]=Be(r,e)):r},has:(e,t)=>t in ve(e),ownKeys:e=>Reflect.ownKeys(ve(e)),set(e,t,n){const r=Ue(ve(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=De(ve(e),t),a=r?.[oe];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||fe(e.base_,t)))return!0;ze(e),Fe(e)}var o,s;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)=>(void 0!==De(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ze(e),Fe(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=ve(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=>ae(e.base_),setPrototypeOf(){se(12)}},Me={};function De(e,t){const n=e[oe];return(n?ve(n):e)[t]}function Ue(e,t){if(!(t in e))return;let n=ae(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=ae(n)}}function Fe(e){e.modified_||(e.modified_=!0,e.parent_&&Fe(e.parent_))}function ze(e){e.copy_||(e.copy_=ge(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Be(e,t){const n=me(e)?Se("MapSet").proxyMap_(e,t):ye(e)?Se("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Ee(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Pe;n&&(o=[r],s=Me);const{revoke:a,proxy:i}=Proxy.revocable(o,s);return r.draft_=i,r.revoke_=a,i}(e,t);return(t?t.scope_:Ee()).drafts_.push(n),n}function Ve(e){if(!ce(e)||we(e))return e;const t=e[oe];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ge(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ge(e,!0);return de(n,(e,t)=>{he(n,e,Ve(t))}),t&&(t.finalized_=!1),n}de(Pe,(e,t)=>{Me[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Me.deleteProperty=function(e,t){return Me.set.call(this,e,t,void 0)},Me.set=function(e,t,n){return Pe.set.call(this,e[0],t,n,e[0])};var $e=(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),ce(e)){const o=Ie(this),s=Be(e,void 0);let a=!0;try{r=t(s),a=!1}finally{a?Te(o):Ne(o)}return je(o,n),ke(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===ne&&(r=void 0),this.autoFreeze_&&be(r,!0),n){const t=[],o=[];Se("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){var t;ce(e)||se(8),ie(e)&&(ie(t=e)||se(10),e=Ve(t));const n=Ie(this),r=Be(e,void 0);return r[oe].isManual_=!0,Ne(n),r}finishDraft(e,t){const n=e&&e[oe];n&&n.isManual_||se(9);const{scope_:r}=n;return je(r,t),ke(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=Se("Patches").applyPatches_;return ie(e)?r(e,t):this.produce(e,e=>r(e,t))}}).produce,He="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Q:Q.apply(null,arguments)},We=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Ge(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(mt(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 J(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var qe=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 Ke(e){return ce(e)?$e(e,()=>{}):e}function Je(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Xe=e=>t=>{setTimeout(t,e)};function Ye(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let s=new qe;return t&&("boolean"==typeof t?s.push(ee):s.push(te(t.extraArgument))),s},{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:a,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!J(n))throw new Error(mt(1));c=Y(n)}l="function"==typeof r?r(t):t();let u=Q;o&&(u=He({trace:!1,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(W(15))};const a={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map(e=>e(a));return s=Q(...i)(o.dispatch),{...o,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new qe(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,a=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Xe(10):"callback"===e.type?e.queueNotification:Xe(e.timeout),l=()=>{a=!1,s&&(s=!1,i.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,s=!o,s&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r})(d);return X(c,a,u(..."function"==typeof i?i(p):p()))}function Qe(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(mt(28));if(r in t)throw new Error(mt(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}function Ze(...e){return t=>e.some(e=>((e,t)=>We(e)?e.match(t):e(t))(e,t))}var et=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},tt=["name","message","stack","code"],nt=class{constructor(e,t){this.payload=e,this.meta=t}_type},rt=class{constructor(e,t){this.payload=e,this.meta=t}_type},ot=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of tt)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},st="External signal was aborted",at=(()=>{function e(e,t,n){const r=Ge(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=Ge(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),s=Ge(e+"/rejected",(e,t,r,o,s)=>({payload:o,error:(n&&n.serializeError||ot)(e||"Rejected"),meta:{...s||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:a}={}){return(i,c,l)=>{const u=n?.idGenerator?n.idGenerator(e):et(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}a&&(a.aborted?h(st):a.addEventListener("abort",()=>h(st),{once:!0}));const m=async function(){let a;try{let s=n?.condition?.(e,{getState:c,extra:l});if(null!==(m=s)&&"object"==typeof m&&"function"==typeof m.then&&(s=await s),!1===s||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p)});i(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:c,extra:l}))),a=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:c,extra:l,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new nt(e,t),fulfillWithValue:(e,t)=>new rt(e,t)})).then(t=>{if(t instanceof nt)throw t;return t instanceof rt?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){a=t instanceof nt?s(null,u,e,t.payload,t.meta):s(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&s.match(a)&&a.meta.condition||i(a),a}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(it)})}},{pending:o,rejected:s,fulfilled:r,settled:Ze(s,r),typePrefix:e})}return e.withTypes=()=>e,e})();function it(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var ct=Symbol.for("rtk-slice-createasyncthunk");function lt(e,t){return`${e}/${t}`}function ut({creators:e}={}){const t=e?.asyncThunk?.[ct];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(mt(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=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},s=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},i={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(mt(12));if(n in a.sliceCaseReducersByType)throw new Error(mt(13));return a.sliceCaseReducersByType[n]=t,i},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),i),exposeAction:(e,t)=>(a.actionCreators[e]=t,i),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,i)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?Qe(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[s,i,c]=Qe(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)t=()=>Ke(e());else{const n=Ke(e);t=()=>n}function l(e=t(),n){let r=[s[n.type],...i.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[c]),r.reduce((e,t)=>{if(t){if(ie(e)){const r=t(e,n);return void 0===r?e:r}if(ce(e))return $e(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return l.getInitialState=t,l}(e.initialState)}s.forEach(r=>{const s=o[r],a={reducerName:r,type:lt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(s)?function({type:e,reducerName:t,createNotation:n},r,o){let s,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(mt(17));s=r.reducer,a=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,a?Ge(e,a):Ge(e))}(a,s,i):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(mt(18));const{payloadCreator:s,fulfilled:a,pending:i,rejected:c,settled:l,options:u}=n,d=o(e,s,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),i&&r.addCase(d.pending,i),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||ft,pending:i||ft,rejected:c||ft,settled:l||ft})}(a,s,i,t)});const l=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=c()),p(e,t)}function h(){return p||(p=c()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=Je(d,r,h)),o}function o(t=l){const r=Je(u,n,()=>new WeakMap);return Je(r,t,()=>{const r={};for(const[o,s]of Object.entries(e.selectors??{}))r[o]=dt(s,t,()=>Je(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const y={name:n,reducer:f,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...y,...m(o,!0)}}};return y}}function dt(e,t,n,r){function o(o,...s){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...s)}return o.unwrapped=e,o}var pt=ut();function ft(){}var{assign:ht}=Object;function mt(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 yt extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const vt=at("initializeConfig",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:s,defaultUserLocale:a,userParticipant:i,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:i,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||s,connectWhenInView:l}}catch(e){return r(e)}}),gt=at("resetConfig",async(e,{extra:{config:t}})=>t);var bt=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var xt="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function wt(){return{s:0,v:void 0,o:null,p:null}}function _t(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=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=wt(),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=wt(),e.set(n,t)):t=r}}const i=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new xt(c):c}return i.s=1,i.v=c,c}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function Ct(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=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 i={...n,...s},{memoize:c,memoizeOptions:l=[],argsMemoize:u=_t,argsMemoizeOptions:d=[],devModeChecks:p={}}=i,f=bt(l),h=bt(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),y=c(function(){return r++,a.apply(null,arguments)},...f),v=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=y.apply(null,e),t},...h);return Object.assign(v,{resultFunc:a,memoizedResultFunc:y,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 St=Ct(_t),Et=Object.assign((e,t=St)=>{!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:()=>Et});const jt=St(({app:e})=>e,({userHasResponded:e})=>e),Tt="visibility",Nt={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},It=St(({config:e})=>e,e=>{let t={visible:"inline"===e?.layoutMode?Nt.open:Nt.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t}),Ot=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=r,{visible:i}=o||{};if("app"===s&&!t)return Nt.open;if("window"===s&&a&&n!==Nt.open)return e?n||t||Nt.open:Nt.hidden;if("inline"===s&&e&&!n)return t||Nt.open;const c=Nt.minimized;return n||t||i||c};var kt=n(7402),Lt=n(8418);var Rt={notify(){},get:()=>[]};var At=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),Pt=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),Mt=(()=>At||Pt?kt.useLayoutEffect:kt.useEffect)();Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var Dt=Symbol.for("react-redux-context"),Ut="undefined"!=typeof globalThis?globalThis:{};function Ft(){if(!kt.createContext)return{};const e=Ut[Dt]??=new Map;let t=e.get(kt.createContext);return t||(t=kt.createContext(null),e.set(kt.createContext,t)),t}var zt=Ft(),Bt=function(e){const{children:t,context:n,serverState:r,store:o}=e,s=kt.useMemo(()=>{const e=function(e,t){let n,r=Rt,o=0,s=!1;function a(){l.onStateChange&&l.onStateChange()}function i(){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=Rt)}const l={addNestedSub:function(e){i();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,i())},tryUnsubscribe:function(){s&&(s=!1,c())},getListeners:()=>r};return l}(o);return{store:o,subscription:e,getServerState:r?()=>r:void 0}},[o,r]),a=kt.useMemo(()=>o.getState(),[o]);Mt(()=>{const{subscription:e}=s;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[s,a]);const i=n||zt;return kt.createElement(i.Provider,{value:s},t)};function Vt(e=zt){return function(){return kt.useContext(e)}}var $t=Vt();function Ht(e=zt){const t=e===zt?$t:Vt(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Wt=Ht();function Gt(e=zt){const t=e===zt?Wt:Ht(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var qt=Gt(),Kt=(e,t)=>e===t;function Jt(e=zt){const t=e===zt?$t:Vt(e),n=(e,n={})=>{const{equalityFn:r=Kt}="function"==typeof n?{equalityFn:n}:n,o=t(),{store:s,subscription:a,getServerState:i}=o,c=(kt.useRef(!0),kt.useCallback({[e.name]:t=>e(t)}[e.name],[e])),l=(0,Lt.useSyncExternalStoreWithSelector)(a.addNestedSub,s.getState,i||s.getState,c,r);return kt.useDebugValue(l),l};return Object.assign(n,{withTypes:()=>n}),n}var Xt=Jt();const Yt=()=>Xt(It);function Qt(){const{startChatIcon:e}=Yt();return e}const Zt=(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)}}},en=e=>Math.ceil(e/1e3),tn=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},nn=(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]}`},rn={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},on={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},sn=e=>e.code?on[e.code]:rn[e.keyCode],an=e=>{e&&e.focus()},cn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function ln(e){return"object"==typeof e}const un=({state:e})=>e,dn=()=>Xt(un),pn=St(un,It,jt,({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]}),fn=St(pn,It,(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 s=o[n-1];if(!t?.occurredAt||!s.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=en(t.occurredAt-s.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}}):e}),hn=()=>Xt(fn),mn=(St(fn,e=>e.map(e=>e.payload.id)),()=>dn().isLoading),yn=()=>dn().unreadEvents,vn=()=>dn().skiplinkTargetId,gn=()=>dn().serviceInfo,bn=St(fn,e=>{const t=e.filter(e=>"message"===e.type);return t[t.length-1]?.payload.id}),xn=()=>{const{participants:e,currentAgent:t}=dn().participantInfo;return t?e[t]:null},wn=()=>{const{entryMeta:{active:e,options:t,optionsOverride:n}}=dn();let r=null;return e&&"number"==typeof n[e]?.limit?r=n[e].limit:e&&"number"==typeof t[e]?.limit&&(r=t[e].limit),{hasLimit:null!==r,limit:null!==r?r:null}},_n=()=>{const{layoutMode:e}=Yt();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Cn=St(({visibility:e})=>e,e=>e.visibility),Sn=St(({visibility:e})=>e,e=>e.showInlineView),En=St(({visibility:e})=>e,e=>e.setInputFocus),jn=[Nt.open,Nt.minimized,Nt.hidden],Tn=at("setVisibility",(e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),s=e.visibility,a=Cn(o),i=jt(o),c=n.hasConversation(),l=It(o),{visibilityCallback:u=Ot,layoutMode:d}=l,{unreadEvents:p}=un(o),f=u({hasResponded:i,previousVisibility:a,requestedVisibility:s,config:l});if(f&&!jn.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(a===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(Tt);return n.store.set(Tt,{...h||{},[d]:s}),s&&r.emit("ui.visible",s,{visibility:s,hasConversation:c,hasResponded:i,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}}),Nn=at("initialize",async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=It(n()),s=r.store.get(Tt)?.[o]||Nt.initialize;return t(Tn({visibility:s})),s}),In=at("initializeApp",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,s=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:s,config:n}:(n?.context?.topic&&t.send("action",{type:O,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:s,config:n})}catch(e){if(e instanceof g){const e=new g;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new yt;return r({name:t.name,message:t.message,langKey:t.langKey})}}),On=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:s=!1}=n??{};let a,i=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return at(e,t,{condition:()=>{const e=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{l(),i=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(gt()),await t(vt()),await t(In()),t(Nn())},{wait:2e3,leading:!0}),kn="cvco",Ln=50,Rn=300,An=["alwaysShowEntryLabel","hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],Pn=(e,t)=>{const{messages:n,...r}=(o=t,An.reduce((e,t)=>(t in o&&(e[t]=o[t]),e),{}));var o;let s=e;return Object.keys(r).length>0&&(s={...s,...r}),n&&(s={...s,messages:{...s.messages,...n}}),s},Mn=pt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},alwaysShowEntryLabel:!1,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})=>Pn(e,t),updateConfig:(e,{payload:t})=>Pn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(gt.fulfilled,e=>e).addCase(vt.fulfilled,(e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:s,defaultUserLocale:a}})=>{e.preChatEvents=t.map(e=>({type:"message",payload:e})),e.context.contentLocale=s,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""})}}),{setConfig:Dn,updateConfig:Un,setPreChatEvents:Fn}=Mn.actions,zn=Mn.reducer,Bn={userHasResponded:!1},Vn=pt({name:"app",initialState:Bn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(On.pending,()=>Bn).addCase(In.fulfilled,(e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)})}}),{setHasResponded:$n}=Vn.actions,Hn=Vn.reducer;class Wn extends m{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Gn={SeamlyGeneralError:v,SeamlyConfigurationError:y,SeamlySessionExpiredError:g,SeamlyOfflineError:Wn,SeamlyUnauthorizedError:b,SeamlyUnavailableError:yt},qn=Ge("catch-error",e=>({payload:e})),Kn={controls:{}},Jn={touched:!1},Xn={controls:Jn},Yn=pt({name:"forms",initialState:Xn,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Kn,persistData:t}:{...Kn,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]:Jn}},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(On.pending,()=>Xn)}}),{registerForm:Qn,deregisterForm:Zn,registerControl:er,deregisterControl:tr,updateControlValue:nr,updateControlTouched:rr}=Yn.actions,or=Yn.reducer,sr=at("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}}),ar={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},ir=pt({name:"app",initialState:ar,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(On.pending,()=>ar).addCase(vt.fulfilled,(e,{payload:t})=>{e.initialLocale=t.defaultUserLocale}).addCase(sr.pending,e=>{e.isLoading=!0}).addCase(sr.rejected,e=>{e.isLoading=!1}).addCase(sr.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:cr,setTranslations:lr}=ir.actions,ur=ir.reducer,dr=at("getConversation",async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}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.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),pr={error:void 0},fr=pt({name:"interrupt",initialState:pr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>pr},extraReducers:e=>{e.addCase(vt.pending,()=>pr).addMatcher(Ze(In.rejected,vt.rejected,sr.rejected,Tn.rejected,Nn.rejected,dr.rejected),(e,{payload:t})=>{e.error=t})}}),{setInterrupt:hr,clearInterrupt:mr}=fr.actions,yr=fr.reducer,vr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];n(2577);const gr=({type:e,payload:t})=>"hidden"===document.visibilityState||e===w.message&&!t.fromClient||e===w.info&&t.type===_,br=e=>e.sort(({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t),xr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:s,introduction:a}=t.participant,i=n[r],c={...n,[r]:i?{...i,...o?{avatar:o}:{},...s?{name:s}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},wr=(e,t)=>{if(!0===t?.payload?.fromClient||"message"!==t?.type)return e;const n=t?.payload?.translatedEntry||t?.payload?.entry,{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},s=t?.payload?.translatedActions||{},{type:a,options:i}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...a?{[a]:i}:{}},actions:o,translatedActions:s}},_r={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},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:z(),optionsButtonId:z(),headerCollapseButtonId:z(),windowOpenButtonId:z(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:C,optionsOverride:{},defaultEntry:C,active:C,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Cr=pt({name:"store",initialState:_r,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=Object.prototype.hasOwnProperty.call(e.options.features,U);let s={...e.options};if(o&&(n===w.message||n===w.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;s={...s,features:{...s.features,uploads:{enabled:s.features.uploads?.enabled||!1,...s.features?.uploads||{},enabledFromEntry:e===S}}}}const a=gr(t.payload);if(!e.events.find(e=>e.payload.id===r.id)){if(!e.events.find(e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient)){const i=wr(e.entryMeta,t.payload);e.entryMeta=o||i.active!==S?i:{...e.entryMeta},e.options=s,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?j:E)),t.payload.payload.key=z(),e.events.push(t.payload),e.events=br(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find(e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId);n?(n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt):e.events.push(t),e.events=br(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===E&&{messageStatus:j}}),e))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:s,serviceData:a,ui:i}})=>{const c=((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(({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction)).reverse();return br([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map(([e,t])=>[t.id,t])),u=t.find(e=>"participant"===e.type),d=u?.payload?.participant?.id,{entry:p}=s?.settings||{},f=wr({...e.entryMeta,...p,active:_,options:{...p?.options}},c.findLast(e=>"message"===e.type));let h={...e.options.features};const m=t.find(e=>!e.payload.fromClient&&["message","participant"].includes(e.type)),y=Object.prototype.hasOwnProperty.call(h,U);if(y&&"message"===m?.type){const e=m.payload.entry?.type||"";h={...h,uploads:{enabled:h.uploads?.enabled||!1,enabledFromEntry:e===S}}}e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter(e=>"participant"!==e.type||!!e.payload.participant?.introduction),e.participantInfo={...e.participantInfo,...d?xr(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:s?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:s?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=y||f.active!==S?f:{...e.entryMeta},e.resumeConversationPrompt=i.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},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=tn(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=xr(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=_r.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach(([t,n])=>{e.options.features[t]=n})},setFeatureEnabledState:(e,{payload:t})=>{Object.prototype.hasOwnProperty.call(e.options.features,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.options={...e.entryMeta.options,upload:{...t.options.upload}},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={}},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(On.pending,()=>_r).addCase(In.pending,e=>{e.isLoading=!0}).addCase(vt.fulfilled,(e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)}).addCase(In.fulfilled,(e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&Cr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&Cr.caseReducers.setFeatureEnabledState(e,{payload:{key:U,enabled:r.settings.entry.options.upload.enabled||!1},type:n})}).addMatcher(Ze(Rr,Ar),e=>{e.isLastEventFromClient=!1})}}),{addEvent:Sr,updateEvent:Er,clearAllUploads:jr,clearEvents:Tr,clearFeatures:Nr,clearIdleDetachCountdown:Ir,clearResumeConversationPrompt:Or,decrementIdleDetachCountdownCounter:kr,hideOption:Lr,initIdleDetachCountdown:Rr,initResumeConversationPrompt:Ar,registerUpload:Pr,setActiveEntryType:Mr,setActiveService:Dr,setBlockAutoEntrySwitch:Ur,setEventsRead:Fr,setFeatureEnabledState:zr,updateFeatures:Br,setFeatures:Vr,setHeaderSubTitle:$r,setHeaderTitle:Hr,setEvents:Wr,setInitialState:Gr,setIsLoading:qr,setLoadedImageEventIds:Kr,setParticipant:Jr,setSeamlyContainerElement:Xr,setServiceDataItem:Yr,setServiceEntryMetadata:Qr,clearAbortTransaction:Zr,setUploadComplete:eo,setUploadError:to,setUploadProgress:no,startProcessingImage:ro,doneProcessingImage:oo,setUserEntryType:so,setUserSelectedOption:ao,setUserSelectedOptions:io,showOption:co,stopIdleDetachCountdownCounter:lo,setProactiveMessages:uo}=Cr.actions,po=Cr.reducer,fo=({dispatch:e})=>t=>n=>{const r=t(n);if(vt.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(sr(n.payload.defaultUserLocale)),r;if(In.fulfilled.match(n))return n.payload.userLocale&&e(sr(n.payload.userLocale)),r;if(Sr.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(sr(t.translationLocale)),r}return r},ho={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:et(),translatedEventGroups:{},translationProposal:null},mo=(e,t)=>{const n=[...e].reduce((e,{payload:n,type:r},o,s)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return s.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}},yo=pt({name:"translation",initialState:ho,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}=mo(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:s}=mo(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=s},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(On.pending,()=>ho).addCase(vt.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(sr.fulfilled,(e,{payload:t})=>{e.currentLocale=t.userLocale}).addCase(Sr,(e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}).addCase(Wr,(e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal}).addCase(In.fulfilled,(e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal})}}),{enableTranslation:vo,disableTranslation:go,enableEventsTranslation:bo,disableEventsTranslation:xo,setTranslationProposalPrompt:wo,disableTranslationProposalPrompt:_o}=yo.actions,Co=yo.reducer,So=pt({name:"visibility",initialState:{visibility:Nt.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(Tn.fulfilled,(e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))}).addCase(vt.fulfilled,(e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)})}}),{setShowInlineView:Eo}=So.actions,jo=So.reducer,To=Y({state:po,app:Hn,config:zn,i18n:ur,translations:Co,visibility:jo,forms:or,interrupt:yr});const No=qt;var Io=n(2086),Oo=n.n(Io),ko=n(8785),Lo=n(1162);function Ro(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,s=null,a=!1,i=0;for(;i<e.length;){if(a&&(t(e[i])||"{"===e[i]))a=!1,s=e.slice(o,i),"{"===e[i]&&i--;else if(!a&&!t(e[i])){const t="{"===e[i];if(s&&t){const t=Ao(e,i);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[s]=e.slice(i+1,t),i=t,s=null}else s&&(n.push(s),s=null),a=!0,o=i}i++}return a&&(s=e.slice(o)),s&&n.push(s),{args:n,cases:r}}function Ao(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 Po(e){return Mo(e.slice(1,-1),",",3)}function Mo(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 s=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(s),Mo(a,t,n-1,r)}let Do,Uo=0;const Fo="other";function zo(e,t){let n=0,r="",o=0;const s={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+Uo++;r+=`{${e}, number}`,s[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:s}}const Bo="other",Vo=St(({i18n:e})=>e,({translations:e})=>e),$o=St(({i18n:e})=>e,({initialLocale:e})=>e),Ho=St(({i18n:e})=>e,({userLocale:e})=>e),Wo=St(({i18n:e})=>e,({isLoading:e})=>e),Go=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=Ao(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let s=[],a=e.substring(0,n);a&&s.push(a);let[i,c,l]=Po(o),u=t[i],d=c&&this.typeHandlers[c];s.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&s.push(this.process(p,t)),s}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:s,cases:a}=Ro(t);let i=parseInt(e);s.forEach(e=>{e.startsWith("offset:")&&(i-=parseInt(e.slice(7)))});const c=[];if("PluralRules"in Intl){void 0!==Do&&Do.resolvedOptions().locale===n||(Do=new Intl.PluralRules(n));const e=Do.select(i);e!==Fo&&c.push(e)}1===i&&c.push("one"),c.push(`=${i}`,Fo);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=zo(a[t],i);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:s}=Ro(t);return e in s?o(s[e],r):Bo in s?o(s[Bo],r):e}});function qo(){const e=Xt(Vo),t=Xt(Ho),n=Xt($o),r=Xt(Wo);return{t:(0,Lo.useCallback)((n,o={})=>{if(!e)return"";const s=e[n];return s?Go.format(s,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")},[e,t,r]),userLocale:t,initialLocale:n}}const Ko=()=>{const e=No(),t=Xt(Cn),n=Xt(En),r=!!t&&t!==Nt.hidden,o=t===Nt.open,s=t===Nt.minimized,a=(0,Lo.useCallback)(t=>{e(Tn("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))},[e]);return{isVisible:r,isOpen:o,isMinimized:s,visible:t,setVisibility:a,openChat:()=>{a({visibility:Nt.open})},closeChat:()=>{a({visibility:Nt.minimized})},setInputFocus:n}},Jo=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,ko.createRef)()})=>{const[r,o]=(0,Lo.useState)(null),s=!!r?.isIntersecting||!t,a=s&&e,i=([e])=>o(e);return(0,Lo.useEffect)(()=>{const e=n?.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(i,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()},[n,t,a]),{isVisible:s,containerRef:n}},Xo=()=>Xt(jt),Yo=(0,ko.createContext)(null),Qo=(0,ko.createContext)(null),Zo=()=>{const e=(0,Lo.useContext)(Qo);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},es=()=>{const e=(0,Lo.useContext)(Yo);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},ts=()=>es().store,ns=()=>{const e=es();return(0,Lo.useCallback)(()=>e.hasConversation(),[e])},rs=()=>{const e=es(),t=No(),n=Zo(),r=Xo(),o=ns(),{visible:s,setVisibility:a}=Ko(),i=yn(),c=(0,Lo.useCallback)((...e)=>{n.emit(...e)},[n]),l=(0,Lo.useCallback)(()=>{c("ui.beforeStart",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i}),e.send("start_conversation"),c("ui.start",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i})},[e,c,o,r,i,s]),u=(0,Lo.useCallback)(async()=>{await t(On())},[t]),d=(0,Lo.useCallback)(e=>({type:e,id:z(),transactionId:z(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()}),[]),p=(0,Lo.useCallback)(e=>({...d("text"),body:{text:e}}),[d]),f=(0,Lo.useCallback)(({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(Sr({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))},[e,t,c,p]),h=(0,Lo.useCallback)((e,n=z())=>{t(Sr({type:"message",payload:{...p(e),transactionId:n}}))},[t,p]),m=(0,Lo.useCallback)((e,n,r,o,s,a)=>{t(Sr({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:s,filesize:a,id:e||"",isDeleted:!1}}}))},[t]),y=(0,Lo.useCallback)(t=>{t&&e.send("action",t)},[e]),v=(0,Lo.useCallback)(t=>{e.sendContext(t)},[e]),g=(0,Lo.useCallback)(()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then(e=>{e&&(t(Gr(e)),e.messages&&e.messages.length&&t(Wr(e)),e.userResponded&&(t($n(e.userResponded)),a({visibility:Nt.open})))}).catch(e=>{t(hr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,apiConnected:e.connected,apiConfigReady:e.configReady}},os=(0,ko.createContext)(null),ss=()=>{const e=(()=>{const e=(0,Lo.useContext)(os);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,Lo.useCallback)(t=>{t&&e({ariaLive:M,messageText:t})},[e]),sendAssertive:(0,Lo.useCallback)(t=>{t&&e({ariaLive:P,messageText:t})},[e])}},as=St(({interrupt:e})=>e,({error:e})=>e),is=St(as,e=>Boolean(e));function cs(){const{t:e}=qo(),t=Xt(as);return{hasError:Xt(is),meta:(0,Lo.useMemo)(()=>{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`),s=e(`${n}.message`),a=e(`${n}.srText`),i=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:s,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:i}:{},originalError:t}},[t,e]),error:t}}const ls=()=>{const{t:e}=qo(),{isInline:t,isWindow:n,isApp:r}=_n(),{isOpen:o,isVisible:s}=Ko(),a=Xt(Sn),{start:i,connect:c,apiConfigReady:l,apiConnected:u}=rs(),d=(0,Lo.useRef)(!1),{sendAssertive:p}=ss();!function(){const{meta:{originalError:e,action:t}}=cs(),n=No(),{reset:r}=rs(),o="SeamlySessionExpiredError"===e?.name,s=(0,Lo.useRef)(0),a=(0,Lo.useRef)(null);(0,Lo.useEffect)(()=>{if(o&&"reset"===t){if(s.current>=10){a.current=setTimeout(()=>{s.current=0},1e4);const e=new v;return n(hr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}s.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}},[t,r,o,n])}(),(0,Lo.useEffect)(()=>{s&&setTimeout(()=>{p(e("window.srTexts.onLoad"))},500)},[s,p,e]),(0,Lo.useEffect)(()=>{s&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))},[o,s,p,e]),(0,Lo.useEffect)(()=>{l||u||(d.current=!1)},[l,u]);const f=(0,Lo.useCallback)(async()=>{u||(d.current=!0,await c()),(r||o||s&&t)&&i()},[u,c,r,t,o,s,i]);(0,Lo.useEffect)(()=>{!l||d.current||n&&!o||!(!t||s&&a)||f()},[l,f,t,o,s,n,a])},us=require("preact/compat"),ds=require("preact/jsx-runtime"),ps=({children:e})=>(ls(),(0,ds.jsx)(ds.Fragment,{children:e})),fs=(0,ko.createContext)(null),hs=(e=0)=>new Promise(t=>{setTimeout(t,e)}),ms=()=>{const{seamlyContainerElement:e}=dn(),t=No();return[e,(0,Lo.useCallback)(e=>{t(Xr(e))},[t])]},ys=e=>(0,Lo.useCallback)(()=>{var t;t=e,requestAnimationFrame(async()=>{await hs(180);const e="string"==typeof t?document.getElementById(t):t;an(e)})},[e]),vs=()=>{const e=vn();return ys(e)},gs=()=>{const{windowOpenButtonId:e}=dn();return ys(e)};n(3215);const bs=e=>St(e=>e.translations.translatedEventGroups,t=>Object.values(t).every(t=>e?.payload?.id&&!t.includes(e.payload.id)));function xs(){const{sendContext:e}=rs(),t=No(),n=Yt(),r=(0,Lo.useCallback)((t,n)=>{e({userLocale:t,source:n})},[e]),o=(0,Lo.useCallback)(()=>{e({userLocale:n.context?.contentLocale}),t(go())},[n.context?.contentLocale,t,e]),{languages:s,isActive:a,isAvailable:i,currentLocale:c}=Xt(({translations:e})=>e);return{languages:s,isActive:a,isAvailable:i,currentLocale:c,enableTranslations:r,disableTranslations:o}}const ws=e=>{const t=Xt(bs(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},s=!!n;return{body:t&&s?n:o,hasTranslation:s,isTranslated:t&&s,locale:r?.locale}};function _s(){const e=Xt(({translations:e})=>e.containerId);return{id:e,focusContainer:ys(e)}}function Cs(e){const{languages:t}=xs();return(0,Lo.useMemo)(()=>t?.find(t=>t.locale===e)?.nativeName,[e,t])}const Ss=(...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(kn)>-1?e:[kn,e].join("-")).join(" "),Es=()=>Yt().appContainerClassNames,js=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},Ts=()=>{const e=es();return(0,us.useSyncExternalStore)(f.subscribe,()=>e.conversation)},Ns=(0,ko.createContext)(null),Is=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=dn(),{allowedMimeTypes:o,maxSize:s}=n?.upload||{},{enabled:a,enabledFromEntry:i}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...s?{maxSize:s}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:i||a,allowedMimeTypes:c,maxSize:l}},Os=()=>{const{currentUploads:e}=dn(),t=No(),n=(()=>{const e=(0,Lo.useContext)(Ns);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,Lo.useCallback)(e=>{n(e)},[n]),clearUploads:(0,Lo.useCallback)(()=>{t(jr())},[t]),currentUploads:e,isUploading:e.some(e=>e.uploading),isComplete:e.every(e=>e.complete)}},ks=()=>{const{t:e}=qo(),{options:t}=dn(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{extraMenuItem:a,sendTranscript:i}=s,c={extraMenuItem:a,sendTranscript:i},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||i,p=No(),{get:f,set:h}=ts();return{allowOptionSelection:d,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,Lo.useCallback)(()=>{const e=f("options")||{};p(io(e))},[f,p]),setUserSelectedOptions:(0,Lo.useCallback)(e=>{p(io(e)),h("options",e)},[h,p]),setUserSelectedOption:(0,Lo.useCallback)((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(ao({option:e,value:t}))},[p,f,h]),showOption:e=>{p(co(e))},hideOption:()=>{p(Lr())},panelActive:n,optionActive:r}},Ls=()=>{const{optionsButtonId:e}=dn();return{id:e,focusButton:ys(e)}},Rs=(0,ko.createContext)(null),As=()=>{const e=(0,Lo.useContext)(Rs);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Ps=()=>{const e=No(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a}}=dn(),{isOpen:i}=Ko(),c=(0,Lo.useRef)({hasCountdown:!1,wasStopped:!1});c.current={hasCountdown:t,wasStopped:a||!1};const{emitEvent:l,sendAction:u}=rs(),{t:d}=qo(),{sendAssertive:p,sendPolite:f}=ss(),h=(0,Lo.useCallback)(e=>{i&&p(e)},[i,p]),m=(0,Lo.useCallback)(e=>{i&&f(e)},[i,f]),y=(0,Lo.useCallback)(t=>{const n=(e=>Math.ceil(e/1e3))(t),r=tn(n);e(Rr({delaySeconds:n,delayTime:r})),l("idleTimer.start"),h(`${d("idleDetachWarning.countdownTitle")} ${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",r)}`)},[e,l,h,d]),v=(0,Lo.useCallback)((t=void 0,n=!1)=>{const{hasCountdown:r,wasStopped:o}=c.current;r&&(t||(n||u({type:N}),h(d("idleDetachWarning.notifyTransferText"))),o||l("idleTimer.stop"),e(Ir()))},[e,l,u,h,d]),g=(0,Lo.useCallback)(()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",tn(t))}`),e(kr())},[e,o,h,d]),b=(0,Lo.useCallback)(()=>{n&&(e(lo()),o&&(l("idleTimer.stop"),m(d("idleDetachWarning.srCountDownStoppedText"))))},[e,l,n,o,m,d]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a,initCountdown:y,endCountdown:v,decrementCountdown:g,stopCountdown:b}},Ms=()=>{const e=No(),t=dn().resumeConversationPrompt,{sendAction:n}=rs(),{t:r}=qo(),{sendAssertive:o}=ss();return{continueChat:()=>{n({type:I,body:{type:"resume_conversation_prompt"}}),e(Or())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:N}),e(Or())}}},Ds=()=>{const[e]=(0,Lo.useState)(()=>z());return e},Us=(e,t)=>{const n=Ts();(0,Lo.useEffect)(()=>{n.onMessage((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r))},[e,t,n])},Fs=({eventPayload:e})=>{const{t}=qo(),{fromClient:n,participant:r}=e,o=(e=>dn().participantInfo.participants[e])(r)||{},{messages:s}=Yt(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:i,showName:c}=s&&s[n?"user":"agent"]||{};if(!i&&!c)return null;const l=[];return i&&a&&o.avatar&&l.push((0,ds.jsx)("span",{className:Ss("message__avatar"),children:(0,ds.jsx)("img",{src:o.avatar,className:Ss("avatar"),alt:""})})),c&&a&&l.push((0,ds.jsx)("span",{className:Ss("message__author-name"),children:a})),l.length>0?(0,ds.jsx)("div",{className:Ss("message__author"),children:l}):null},zs=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:o,bodyProps:s={},info:a,...i})=>{const c=js(t),{hasTranslation:l,isTranslated:u,locale:d}=ws(t);return n&&c.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter(e=>e.length)),r.forEach(e=>{c.push(`message--${e}`)})),u&&c.push("message--is-translated"),l&&c.push("message--has-translation"),u&&(s={...s,lang:d}),(0,ds.jsx)(ds.Fragment,{children:(0,ds.jsxs)("div",{className:Ss(c),...i,children:[e&&(0,ds.jsx)(Fs,{eventPayload:t.payload}),(0,ds.jsx)("div",{className:Ss("message__body"),...s,children:o}),a&&(0,ds.jsx)("div",{"aria-hidden":"true",className:Ss("message__info"),children:a})]})})},Bs=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:i})=>{const c=(0,Lo.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=rs(),p=Ds(),f=(0,Lo.useRef)(!1),h=t?.type===F?"a":"button",m=(0,Lo.useCallback)(()=>d(`action.${k}`,{type:k,originMessage:e,action:t}),[d,e,t]),y=(0,Lo.useCallback)(()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:O,body:{name:e,fallbackMessage:n}})}},[l,t,u,m]),v=(0,Lo.useMemo)(()=>t?.type===F?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y},[t,y,m]);return(0,Lo.useEffect)(()=>{i&&(o&&f.current?window.requestAnimationFrame(()=>c.current?.focus()):c.current?.blur()),f.current=!0},[o,i]),(0,ds.jsxs)("div",{className:Ss("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[s?(0,ds.jsx)("img",{className:Ss("card__image"),src:s,alt:""}):null,(0,ds.jsxs)("div",{className:Ss("card__content"),id:e,children:[a&&(0,ds.jsx)("h2",{className:Ss("card__title"),children:a}),r&&(0,ds.jsx)("div",{className:Ss("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,ds.jsx)(h,{tabIndex:i&&!o?-1:void 0,className:Ss("button","button--primary"),"aria-describedby":p,...v,children:n})]})]})};function Vs({item:e,items:t,index:n,isActive:r}){const{t:o}=qo();return(0,ds.jsx)("div",{className:Ss("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,ds.jsx)(Bs,{...e,isCarouselItem:!0,hasFocus:r})})}const $s={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'}},Hs=({name:e,size:t="32",className:n,alt:r})=>(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)("div",{"aria-hidden":"true",className:n||Ss("icon"),dangerouslySetInnerHTML:{__html:$s[e][t]}}),r&&(0,ds.jsx)("span",{className:Ss("visually-hidden"),children:r})]});function Ws({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=qo(),s=e.length;return(0,ds.jsxs)("div",{className:Ss("carousel-controls"),children:[(0,ds.jsx)("button",{className:Ss("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+s)%s)},children:(0,ds.jsx)(Hs,{name:"arrowLeft",size:"16",alt:""})}),r,(0,ds.jsx)("button",{className:Ss("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%s)},children:(0,ds.jsx)(Hs,{name:"arrowRight",size:"16",alt:""})})]})}function Gs({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,Lo.useCallback)(e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)},[s,t,n]);return(0,ds.jsx)("div",{className:Ss("carousel-pagination__wrapper"),role:"group",children:(0,ds.jsx)("ul",{className:Ss("carousel-pagination"),children:e.map((e,n)=>{const s=t===n;return(0,ds.jsx)("li",{className:Ss("carousel-pagination__item",s?"is-active":void 0),children:(0,ds.jsx)("button",{className:Ss("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":s?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))})})})}const qs=(e,t,n)=>`${n}${t}`,Ks=e=>e.label,Js=({target:e})=>{e.scrollLeft=0};function Xs({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=qs,getItemLabel:r=Ks,items:o}){const s=Ds(),a=o.length,[i,c]=(0,Lo.useState)(Number(e||0));(0,Lo.useEffect)(()=>{c(Number(e||0))},[c,e]);const l=(0,Lo.useRef)([]);l.current=(0,Lo.useMemo)(()=>Array(a).fill(1).map(()=>(0,ko.createRef)()),[a]);const u=(0,Lo.useRef)(!0),d=(0,Lo.useRef)(null);return d.current=t,(0,Lo.useEffect)(()=>{u.current?u.current=!1:d.current&&d.current(i)},[i]),(0,ds.jsxs)("div",{className:Ss("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,ds.jsx)("div",{className:Ss("carousel__slides-wrapper"),onScroll:Js,children:(0,ds.jsx)("div",{id:s,className:Ss("carousel__slides"),style:{width:100*a+"%",left:-100*i+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map((e,t)=>{const r=i===t;return(0,ds.jsx)("div",{ref:l.current[t],className:Ss("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,ds.jsx)(Vs,{item:e,items:o,index:t,isActive:r})},n(e,t,"item-"))})})}),(0,ds.jsx)("div",{className:Ss("carousel__controls"),children:(0,ds.jsx)(Ws,{currentIndex:i,items:o,onChange:c,children:(0,ds.jsx)("div",{className:Ss("carousel__pagination"),children:(0,ds.jsx)(Gs,{currentIndex:i,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const Ys=(e,t,n="")=>`${n}${e.title}:${t}`,Qs=e=>e.title,Zs=e=>{const{payload:t}=e,[n,r]=(0,Lo.useState)(!1),{addMessageBubble:o,emitEvent:s,sendAction:a}=rs(),i=ns(),{activeServiceSessionId:c}=gn(),l=Xt(bn),{body:u}=ws(e),{service:d}=t,p=(0,Lo.useMemo)(()=>{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]),f=u?.chooseAgain&&c===d?.serviceSessionId&&t.id!==l;return(0,Lo.useEffect)(()=>{r(t.id===l)},[t,l]),{body:u,subEvent:p,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{if(!i())return;const n=z(),c={type:"pick_choice",originMessage:t.id,choice:{chooseAgain:f,id:e.id},transactionId:n};o(e.text,n),a(c),r(!1),s(`action.${c.type}`,{...c,choice:{...c.choice,text:e.text}})},onChooseAgainClickHandler:()=>{r(e=>!e)}}},ea=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,ta=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,Lo.useMemo)(()=>["suggestions__item",...t.map(ea)],[t]),a=(0,Lo.useCallback)(()=>{r&&r({id:e,question:n})},[e,n,r]);return(0,ds.jsx)("li",{className:Ss(s),children:(0,ds.jsxs)("button",{type:"button",onClick:a,className:Ss("button","button--primary"),children:[o&&(0,ds.jsx)(Hs,{name:"chevronRight",size:"8",alt:""}),n]})})},na=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,ds.jsx)("ul",{className:Ss("suggestions__list",e||""),children:t.map(e=>(0,ds.jsx)(ta,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id))}),ra=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:s,iconClassName:a,dividerType:i,title:c,description:l})=>{const u=Boolean(o||n);return(0,ds.jsxs)("div",{className:Ss("divider",i&&`divider--type-${i}`,t),children:[u&&(0,ds.jsx)("span",{className:Ss("divider__graphic"),children:o?(0,ds.jsx)(Hs,{name:o,size:s,className:a,alt:""}):(0,ds.jsx)("img",{src:n||void 0,className:Ss({icon:"icon"===r,avatar:"avatar"===r},a)})}),(0,ds.jsxs)("div",{className:Ss("divider__body"),children:[c?(0,ds.jsx)("h2",{className:Ss("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,ds.jsx)("p",{className:Ss("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},oa={[D.new_topic]:"new-topic"},sa={default:({event:e})=>{const{t}=qo(),{subtype:n}=e.payload.body,r=oa[D[n]];return D[n]?(0,ds.jsx)(ra,{dividerType:r,iconName:D[n],title:t(`dividerKeys.${D[n]}`)}):null},[D.new_translation]:({event:e})=>{const{t}=qo(),n=hn(),{body:{translationEnabled:r,text:o,title:s},id:a}=e.payload,i=Xt(e=>e.translations.translatedEventGroups),c=No(),l=(0,Lo.useCallback)(()=>{i[a]?c(bo({events:n,id:a})):c(xo({events:n,id:a}))},[c,n,a,i]);return(0,ds.jsx)(ra,{iconName:"newTranslation",dividerType:"new-translation",title:s,description:o,children:r?(0,ds.jsx)(ds.Fragment,{children:(0,ds.jsx)("button",{className:Ss("button","button--secondary"),onClick:l,children:t(i[a]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},aa={month:"long",day:"numeric",year:"numeric"},ia={hour:"numeric",minute:"numeric"},ca=({event:e})=>{const t=(()=>{const[e,t]=(0,Lo.useReducer)(e=>e+1,0);return(0,Lo.useCallback)(()=>{setTimeout(()=>{t()})},[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{const{t}=qo(),n=Yt(),r=n?.context?.userLocale??[],o=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const i=a.valueOf()-s.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,ia).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,s);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,aa).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:i}})(en(e.payload.timeIndicator));return(0,Lo.useEffect)(()=>{const e=setTimeout(()=>{t()},o);return()=>{clearTimeout(e)}},[t,o]),(0,ds.jsxs)(ra,{dividerType:"time-indicator",children:[(0,ds.jsxs)("h2",{className:Ss("divider__time"),"aria-hidden":"true",children:[(0,ds.jsx)("span",{className:Ss("divider__time--date"),children:n}),(0,ds.jsx)("span",{className:Ss("divider__time--time"),children:r})]}),(0,ds.jsx)("p",{className:Ss("visually-hidden"),children:s})]})};var la=["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])"],ua=la.join(","),da="undefined"==typeof Element,pa=da?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,fa=!da&&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},ha=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)},ma=function(e,t,n){if(ha(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ua));return t&&pa.call(e,ua)&&r.unshift(e),r.filter(n)},ya=function e(t,n,r){for(var o=[],s=Array.from(t);s.length;){var a=s.shift();if(!ha(a,!1))if("SLOT"===a.tagName){var i=a.assignedElements(),c=e(i.length?i:a.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c})}else{pa.call(a,ua)&&r.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),u=!ha(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 s.unshift.apply(s,a.children)}}return o},va=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ga=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))&&!va(e)?0:e.tabIndex},ba=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xa=function(e){return"INPUT"===e.tagName},wa=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},_a=function(e,t){return!(t.disabled||ha(t)||function(e){return xa(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=pa.call(e,"details>summary:first-of-type")?e.parentElement:e;if(pa.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return wa(e)}else{if("function"==typeof r){for(var s=e;e;){var a=e.parentElement,i=fa(e);if(a&&!a.shadowRoot&&!0===r(a))return wa(e);e=e.assignedSlot?e.assignedSlot:a||i===e.ownerDocument?a:i.host}e=s}if(function(e){var t,n,r,o,s=e&&fa(e),a=null===(t=s)||void 0===t?void 0:t.host,i=!1;if(s&&s!==e)for(i=!!(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));!i&&a;){var c,l,u;i=!(null===(l=a=null===(c=s=fa(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return i}(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!!pa.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ca=function(e,t){return!(function(e){return function(e){return xa(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||fa(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)||ga(t)<0||!_a(e,t))},Sa=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ea=function e(t){var n=[],r=[];return t.forEach(function(t,o){var s=!!t.scopeParent,a=s?t.scopeParent:t,i=function(e,t){var n=ga(e);return n<0&&t&&!va(e)?0:n}(a,s),c=s?e(t.candidates):a;0===i?s?n.push.apply(n,c):n.push(a):r.push({documentOrder:o,tabIndex:i,item:t,isScope:s,content:c})}),r.sort(ba).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},ja=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==pa.call(e,ua)&&Ca(t,e)},Ta=la.concat("iframe").join(","),Na=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==pa.call(e,Ta)&&_a(t,e)};function Ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oa(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ka(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 La(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(n),!0).forEach(function(t){Oa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ka(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ra=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},Aa=function(e){return Ra(e)&&!e.shiftKey},Pa=function(e){return Ra(e)&&e.shiftKey},Ma=function(e){return setTimeout(e,0)},Da=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},Ua=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},Fa=[],za=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||Fa,s=La({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Aa,isKeyBackward:Pa},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i=function(e,t,n){return e&&void 0!==e[t]?e[t]:s[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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.hasFallback,a=void 0!==o&&o,i=n.params,c=void 0===i?[]:i,l=s[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return Ia(e)}(t=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Ia(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ia(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var u=l;if("string"==typeof l){try{u=r.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!u&&!a)throw new Error("`".concat(e,"` as selector refers to no known node"))}return u},u=function(){var e=l("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!Na(e,s.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}else null===e&&(e=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?ya([e],t.includeContainer,{filter:Ca.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Sa}):ma(e,t.includeContainer,Ca.bind(null,t)),Ea(n)}(e,s.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?ya([e],t.includeContainer,{filter:_a.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ma(e,t.includeContainer,_a.bind(null,t))}(e,s.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 ja(e)}),i=n.slice().reverse().find(function(e){return ja(e)}),c=!!t.find(function(e){return ga(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:i,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 ja(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return ja(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){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?p(t.shadowRoot):t},f=function(e){!1!==e&&e!==p(document)&&(e&&e.focus?(e.focus({preventScroll:!!s.preventScroll}),a.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):f(u()))},h=function(e){var t=l("setReturnFocus",{params:[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||Ua(n),d();var i=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)i=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||Na(t,s.tabbableOptions)&&!ja(t,s.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,m=a.tabbableGroups[h];i=ga(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else Ra(n)||(i=p.nextTabbableNode(t,!1))}else{var y=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(y<0&&(p.container===t||Na(t,s.tabbableOptions)&&!ja(t,s.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var v=y===a.tabbableGroups.length-1?0:y+1,g=a.tabbableGroups[v];i=ga(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else Ra(n)||(i=p.nextTabbableNode(t))}}else i=l("fallbackFocus");return i},y=function(e){var t=Ua(e);c(t,e)>=0||(Da(s.clickOutsideDeactivates,e)?n.deactivate({returnFocus:s.returnFocusOnDeactivate}):Da(s.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=Ua(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(ga(a.mostRecentlyFocusedNode)>0){var i=c(a.mostRecentlyFocusedNode),l=a.containerGroups[i].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(s.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 ga(e)>0})})||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){(s.isKeyForward(e)||s.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&&(Ra(e)&&e.preventDefault(),f(n))}(e,s.isKeyBackward(e))},b=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Da(s.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=Ua(e);c(t,e)>=0||Da(s.clickOutsideDeactivates,e)||Da(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=s.delayInitialFocus?Ma(function(){f(u())}):f(u()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!0),r.removeEventListener("keydown",b),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})})&&f(u())}):void 0,S=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=i(e,"onActivate"),n=i(e,"onPostActivate"),o=i(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=p(r),null==t||t();var s=function(){o&&d(),w(),S(),null==n||n()};return o?(o(a.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!a.active)return this;var t=La({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,_(),a.active=!1,a.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}(o,n);var r=i(t,"onDeactivate"),c=i(t,"onPostDeactivate"),l=i(t,"checkCanReturnFocus"),u=i(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){Ma(function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()})};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):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(),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=i(t,"onPause"),r=i(t,"onPostPause");null==n||n(),_(),S(),null==r||r()}else{var o=i(t,"onUnpause"),s=i(t,"onPostUnpause");null==o||o(),d(),w(),S(),null==s||s()}return this}}}),n.updateContainerElements(e),n};const Ba=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":o})=>{const s=Ds(),a=(0,Lo.useRef)(null),i=(0,Lo.useRef)(null),[c,l]=(0,Lo.useState)(!1);return(0,Lo.useEffect)(()=>(c&&a.current&&(i.current=za(a.current,{initialFocus:n.current||void 0}),i.current.activate()),()=>{i.current&&i.current.deactivate()}),[c,n]),(0,Lo.useEffect)(()=>{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()}},[c]),(0,Lo.useEffect)(()=>{c&&a.current&&a.current.addEventListener("keydown",e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()})},[c,t]),(0,Lo.useLayoutEffect)(()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",s),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}},[r,o,s]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,ko.render)(e,a.current)}):a.current&&(0,ko.render)((0,ko.toChildArray)(e).filter(ln).map(e=>(e.props={...e.props,onClose:t},e)),a.current)},Va=({url:e,description:t,onClose:n})=>{const r=Yt(),o=As(),s=Es(),a=(0,Lo.useRef)(null),{t:i}=qo(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof s?c.push(...s):c.push(...s(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,ds.jsx)(Ba,{onClose:n,"aria-label":i("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,ds.jsx)("div",{className:Ss(c),onClick:u,style:d,children:(0,ds.jsxs)("div",{className:Ss("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[(0,ds.jsx)("div",{className:Ss("modal__inner"),onClick:l,children:(0,ds.jsx)("img",{className:Ss("modal__image"),src:e,alt:t})}),(0,ds.jsxs)("button",{type:"button",className:Ss("modal__close"),onClick:n,children:[(0,ds.jsx)(Hs,{name:"close",size:"16",alt:""}),i("lightbox.closeLabel")]})]})}))(n))})},$a=({description:e,url:t})=>{const{t:n}=qo(),[r,o]=(0,Lo.useState)(!1);return(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsxs)("button",{type:"button",className:Ss("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,ds.jsx)(Hs,{name:"enlarge",size:"32",alt:""})]}),r&&(0,ds.jsx)(Va,{url:t,description:e,onClose:()=>{o(!1)}})]})},Ha=({originMessage:e,transactionId:t})=>{const{emitEvent:n,sendAction:r}=rs();return o=>{if(o.target&&o.target.dataset.linkId){const s={type:"navigate",originMessage:e,transactionId:t,link:{id:o.target.dataset.linkId,url:o.target.getAttribute("href")}};r(s),n(`action.${s.type}`,s)}}},Wa=({event:e,...t})=>{const{body:n}=ws(e),r=Ha({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,Lo.useMemo)(()=>e.payload.optimisticallyInjected?{children:(0,ds.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}},[n,e]);return(0,ds.jsx)(zs,{type:"text",event:e,onClick:r,...t,...o})},Ga="PROCESSING_IMAGE",qa=({img:e,filename:t})=>{const{t:n}=qo(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,ds.jsx)(ds.Fragment,{children:(0,ds.jsxs)("span",{className:Ss(["download","download--preview"]),children:[(0,ds.jsx)("img",{src:e,alt:r}),(0,ds.jsx)("span",{"aria-hidden":"true",className:Ss("file-download"),children:t})]})})},Ka=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:o,target:s})=>t&&!n?(0,ds.jsx)("button",{type:"button",onClick:r,className:Ss(["download","download-link"]),children:e}):o?(0,ds.jsx)("a",{href:o,download:!0,target:s,className:Ss(["download","download-link"]),children:e}):(0,ds.jsx)("span",{className:Ss("download"),children:e}),Ja={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=qo(),o=Ds(),{body:s,subEvent:a,showOptions:i,chooseAgain:c,onChoiceClickHandler:l,onChooseAgainClickHandler:u}=Zs(e);return(0,ds.jsxs)(ds.Fragment,{children:[(0,ko.toChildArray)(t).filter(ln).map(e=>(e.props={...e.props,event:a,id:o,showTranslationToggle:!1},e)),c&&(0,ds.jsxs)("button",{type:"button",className:Ss("button","button--secondary","button--choose-again"),"aria-expanded":i?"true":"false",onClick:u,"aria-describedby":o,children:[r(i?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,ds.jsx)(Hs,{name:"chevronDown",size:"8",alt:""})]}),i&&(0,ds.jsx)(zs,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,ds.jsx)("ul",{className:Ss("choice-prompt","choice-prompt--many"),children:s?.choices?.map(e=>(0,ds.jsx)("li",{className:Ss("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:()=>{l(e)},children:e.text})},e.id))})})]})},text:Wa,image:({event:e,descriptorId:t,...n})=>{const{body:r}=ws(e),[o,s]=(0,Lo.useState)(!1),a=No();return(0,ds.jsxs)(zs,{event:e,type:"image",...n,children:[(0,ds.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(Kr(e.payload.id)),s(!0)}}),r?.isZoomable&&o&&(0,ds.jsx)($a,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=ws(e),o=Ha({originMessage:n.id,transactionId:n.transactionId});return(0,ds.jsx)(zs,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=ws(e);return js(e).push("message--type-video"),(0,ds.jsxs)(zs,{event:e,type:"video",...n,children:[(0,ds.jsx)("div",{id:t,className:Ss("visually-hidden"),children:r?.description}),(0,ds.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=qo(),{body:r}=ws(e),{fromClient:o,id:s}=e.payload,{filename:a,id:i,isDeleted:c,url:l}=r,u=es(),d=(e=>{const{processingFileUploads:t}=Xt(({state:e})=>e);return(0,Lo.useMemo)(()=>{if(t.some(t=>t===e))return Ga;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}},[e,t])})(s),p=(0,Lo.useMemo)(()=>n(c||!l&&!i?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:a}),[l,i,a,c,n]);return(0,ds.jsx)(zs,{event:e,type:"upload",...t,children:d&&d!==Ga?(0,ds.jsx)(qa,{img:d,filename:a}):(0,ds.jsxs)(Ka,{fileId:i,isDeleted:c,onClickHandler:()=>{i&&a&&u.downloadFile(i,a)},url:l,target:o?void 0:"_blank",children:[(0,ds.jsx)(Hs,{name:"download",size:"16",alt:p}),(0,ds.jsx)("span",{"aria-hidden":"true",className:Ss("file-download"),children:a})]})})},carousel:({event:e})=>{const{body:t}=ws(e),n=t.cards;return(0,ds.jsx)(zs,{event:e,modifiers:"type-carousel",children:(0,ds.jsx)(Xs,{items:n,getItemKey:Ys,getItemLabel:Qs})})},card:({event:e})=>{const{body:t}=ws(e),n=Ds();return(0,ds.jsx)(zs,{type:"card",event:e,children:(0,ds.jsx)(Bs,{id:n,...t})})}},info:{text:Wa,divider:({event:e,...t})=>{const n=sa[D[e.payload.body.subtype]]||sa.default;return(0,ds.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=qo(),{body:r}=ws(e);return(0,ds.jsx)(zs,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:ca},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,s=Xt(bs(e));return{body:s&&o?t:r,hasTranslation:o,isTranslated:s&&o,userLocale:n?.locale}})(e);return n?(0,ds.jsx)(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,Lo.useState)(!0),o=No(),s=Xo(),{addMessageBubble:a,emitEvent:i,sendAction:c}=rs(),l=ns(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=ws(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=Yt(),f=hn(),{t:h}=qo(),m=h("suggestions.headingText"),y=h("suggestions.footerText"),v=(0,Lo.useMemo)(()=>f.some(({payload:e,type:t})=>"message"===t&&e?.transactionLast),[f]),g=(0,Lo.useCallback)(({id:e,question:t})=>{if(!l())return;r(!1),o($n(!0));const n=z(),s={type:T,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};c(s),a(t,n),i(`action.${s.type}`,s)},[a,o,i,l,d.id,c]);return n&&!s&&v&&p?(0,ds.jsxs)("div",{className:Ss("suggestions","suggestions--conversation"),children:[m&&(0,ds.jsx)("p",{className:Ss("suggestions__heading"),children:m}),(0,ds.jsxs)(zs,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,ds.jsx)(na,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),y&&(0,ds.jsx)("p",{className:Ss("suggestions__footer"),children:y})]})]}):null}}},Xa=({children:e})=>{const{customComponents:t}=Yt(),n=(0,Lo.useMemo)(()=>Object.keys(Ja).reduce((e,n)=>(e[n]={...Ja[n],...t?t[n]:{}},e),{fallback:Wa}),[t]);return(0,ds.jsx)(fs.Provider,{value:n,children:e})},Ya=({children:e})=>{const{isMinimized:t}=Ko(),n=(0,Lo.useRef)(0),{sendAction:r}=rs(),{hasCountdown:o,isActive:s,stopCountdown:a}=Ps(),i=(0,Lo.useCallback)(()=>{if(t)return;const e=(new Date).getTime(),i=()=>{r({type:"interactivity_update"}),n.current=e};o&&s&&(i(),a()),e-n.current>15e3&&i()},[r,o,s,a,t]);return(0,ds.jsx)("div",{className:Ss("activity-monitor"),tabIndex:-1,onMouseDown:i,onKeyUp:i,onTouchStart:i,onMouseMove:i,onWheel:i,onPointerDown:i,onPointerMove:i,children:(0,ds.jsx)(Rs.Provider,{value:i,children:e})})},Qa=["text","choice_prompt","image","video"],Za=()=>{const e=Ts(),t=(0,Lo.useRef)(),n=(0,Lo.useRef)(),r=No(),o=Zo(),s=(0,Lo.useRef)(null),{initCountdown:a,endCountdown:i}=Ps(),{emitEvent:c}=rs(),{hasPrompt:l,continueChat:u}=Ms(),d=(0,Lo.useRef)(l);return(0,Lo.useEffect)(()=>{d.current=l},[l]),(0,Lo.useEffect)(()=>{e.socket&&(e.onConnection(({currentState:e})=>{if("attach_channel_erred"===e){const e=new v;return r(hr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}),e.onError(e=>{const t=new Wn(e);r(hr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Tr())}),e.onOpen(()=>{r(mr())}))},[e,e.socket,r]),(0,Lo.useEffect)(()=>{e.onConnection(({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&a(e.payload.body.duration);break;case"loading":r(qr(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":i(void 0,!0);break;case"resume_conversation_prompt":r(Ar());break;case"user_first_response":r($n(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(wo(e.payload.body))}break;case"service_attach":{const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:s}}=e.payload;r(uo(n||!1)),t&&c("system.serviceChanged",t),s&&r(Dr(s)),r(Qr(o)),r(Br({uploads:{enabled:o.options?.upload?.enabled||!1}}));break}case"context":e.payload.contentLocale&&e.payload.userLocale&&r(sr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Dr(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Er(e));break}d.current&&u(),r(Sr(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r($r(o.name)),r(Jr(t)),"string"!=typeof o&&o.introduction&&r(Sr({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(Yr(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Sr({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":{const t=new g(e);r(hr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break}case"conversation":{const t=new v(e);r(hr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}));break}}}return e},e.onMessage(n.current),!0))},[u,e,r,c,i,o,a]),(0,Lo.useEffect)(()=>{e.onConnection(({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(dr(e)).unwrap();t&&"service"in t&&r(Wr(t))}catch(e){}return Qa.includes(e?.type)?(e.id!==s.current&&o.emit("message",e),s.current=e.id,e):e},e.addListener("message",t.current),!0))},[e,r,o]),null},ei=({children:e})=>{const{t}=qo(),n=No(),r=es(),{addUploadBubble:o}=rs(),s=(0,Lo.useCallback)(async(e,t)=>{n(ro(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)},r.onerror=e=>n(e)}))(e),o=new Image;o.src=r,await o.decode();const s=(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}`,s)}catch(e){}finally{n(oo(t))}},[n]),a=(0,Lo.useCallback)(e=>{const a=z(),i=r.uploadFile(e,e=>{n(no({fileId:a,progress:Math.ceil(e)}))},async t=>{const{id:r,transactionId:i,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(eo(a)),o(r,i,c,l,u,d),l.includes("image/")&&await s(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(to({fileId:a,errorText:r}))});n(Pr({fileId:a,fileName:e.name,uploadHandle:i}))},[s,o,r,n,t]);return(0,ds.jsx)(Ns.Provider,{value:a,children:e})},ti=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Ps();return((e,t)=>{const n=(0,Lo.useRef)(e);(0,Lo.useEffect)(()=>{n.current=e},[e]),(0,Lo.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])})(()=>{r()},e&&t&&n&&n>0?1e3:null),null},ni=()=>{const{initUserSelectedOptions:e}=ks(),t=(0,Lo.useRef)(!1),n=Yt();return(0,Lo.useEffect)(()=>{n.api&&!t.current&&(t.current=!0,e())},[e,n]),null};function ri(e,t,n=[]){const r=Zo(),o=(0,Lo.useRef)(t);(0,Lo.useEffect)(()=>{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])}const oi=()=>{const e=Yt(),{emitEvent:t,sendAction:n,sendContext:r,sendMessage:o}=rs(),s=No(),{setVisibility:a,visible:i}=Ko(),c=(0,Lo.useRef)(i),l=Zo(),u=es(),d=yn(),p=(0,Lo.useRef)(null),f=(0,Lo.useRef)(null),{isInline:h,isResolving:m}=_n(),y=Xt(is),v=(()=>{const{get:e}=ts();return e?e("conversationUrl"):null})(),g=(0,Lo.useRef)(null),b=As(),{enableTranslations:x,disableTranslations:w}=xs();return(0,Lo.useEffect)(()=>{c.current=i},[i]),ri("askText",e=>{o({body:e})},[u.send]),ri("setVariables",e=>{r({variables:e})},[u.send]),ri("getVisibility",e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")}),ri("setVisibility",e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Nt).includes(t)?(b(),a(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')},[e.api]),ri("sendCustomAction",(e,r)=>{const o={type:"custom",body:{type:e,body:r}};n(o),t(`action.${o.type}`,o)},[u.send]),ri("setTopic",({name:e,fallbackMessage:t,message:r,userTriggered:o})=>{o&&s(Un({showSuggestions:!1})),e&&t?n({type:O,body:{name:e,fallbackMessage:t,message:r}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")},[u.send]),ri("setContext",e=>{r(e)},[u.send]),ri("setTranslation",({enabled:e,locale:t})=>{e?x(t,A):w()},[u.send]),(0,Lo.useEffect)(()=>{m||y||(g.current&&g.current!==v&&l.emit("unreadMessageCount",d),i===Nt.open&&i!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),i!==Nt.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=i,p.current=d,"string"==typeof v&&(g.current=v))},[d,i,l,h,m,y,v]),null},si=({children:e})=>{const t=Zo(),n=(0,Lo.useRef)(null),[r,o]=(0,Lo.useState)(),s=(0,Lo.useRef)(!0),a=(0,Lo.useCallback)(e=>{s.current&&(o(e),t.emit("aria-live",e))},[o,t]);return(0,Lo.useEffect)(()=>(n.current=null,r?.messageText&&(n.current=setTimeout(()=>{a({}),n.current&&clearTimeout(n.current)},600)),()=>{n.current&&clearTimeout(n.current)}),[r,a]),(0,Lo.useEffect)(()=>()=>{s.current=!1},[]),(0,ds.jsxs)(os.Provider,{value:a,children:[e,(0,ds.jsxs)("div",{className:Ss("app__live-container"),children:[(0,ds.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:Ss("visually-hidden"),children:r?.ariaLive===P?r?.messageText:null}),(0,ds.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:Ss("visually-hidden"),children:r?.ariaLive===M?r?.messageText:null})]})]})},ai=()=>{const{t:e}=qo(),t=dn().historyLoaded,{sendPolite:n}=ss();return(0,Lo.useEffect)(()=>{t&&setTimeout(()=>{n(e("window.srTexts.onHistoryLoad"))},500)},[t,e,n]),null},ii=()=>{const{t:e}=qo(),{isOpen:t,isVisible:n}=Ko(),r=yn(),{sendPolite:o}=ss(),s=(0,Lo.useMemo)(()=>Zt(o,2e3),[o]),a=(0,Lo.useRef)(null),i=(0,Lo.useRef)(null);return(0,Lo.useEffect)(()=>{a.current!==n&&!n&&i.current&&i.current(),0!==r&&!t&&n&&(i.current=s(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n},[r,t,n,s,e]),null},ci=({store:e,children:t,eventBus:n,api:r})=>((0,Lo.useErrorBoundary)(t=>{console.error(t),e.dispatch(qn(t))}),(0,ds.jsx)(Bt,{store:e,children:(0,ds.jsx)(Qo.Provider,{value:n,children:(0,ds.jsx)(Yo.Provider,{value:r,children:(0,ds.jsx)(si,{children:(0,ds.jsx)(ps,{children:(0,ds.jsxs)(Xa,{children:[(0,ds.jsx)(ni,{}),(0,ds.jsx)(Za,{}),(0,ds.jsx)(ii,{}),(0,ds.jsx)(ai,{}),(0,ds.jsx)(ti,{}),(0,ds.jsxs)(Ya,{children:[(0,ds.jsx)(oi,{}),(0,ds.jsx)(ei,{children:t})]})]})})})})})})),li=St(fn,e=>e.filter(e=>gr(e)&&"service_data"!==e.type&&e.payload?.messageStatus===E)),ui=St([li],e=>e.filter(e=>"participant"!==e.type).at(-1)),di=St(li,e=>e.filter(({payload:e})=>e?.id).map(({payload:e})=>e.id)),pi=St(({state:e})=>e.options.features?.webNotifications,e=>e?.enabled),fi=()=>{const{t:e}=qo(),{showDisclaimer:t}=Yt();return t?(0,ds.jsxs)("div",{className:Ss("disclaimer"),tabIndex:0,children:[(0,ds.jsx)("h2",{className:Ss("disclaimer__title"),children:e("disclaimer.title")}),(0,ds.jsx)("div",{className:Ss("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},hi=St([({forms:e})=>e,(e,{formId:t})=>t],(e,t)=>e[t]),mi=St(hi,e=>e?.controls||{}),yi=St(mi,e=>{const t={};return Object.entries(e).forEach(([e,{value:n}])=>{t[e]=n}),t}),vi=St([mi,(e,{name:t})=>t],(e,t)=>e[t]?.value),gi=St([mi,(e,{name:t})=>t],(e,t)=>e[t]?.touched),bi=(0,ko.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:xi,Consumer:wi}=bi,_i=bi;function Ci(){return(0,Lo.useContext)(_i)}function Si(e){const t=No(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=Ci(),a=!!Xt(e=>hi(e,{formId:n})),i=Xt(t=>vi(t,{formId:n,name:e})),c=Xt(t=>gi(t,{formId:n,name:e})),l=s?.[e],u=!l;(0,Lo.useEffect)(()=>{a&&t(er({formId:n,name:e}))},[a,n,e,t]),(0,Lo.useLayoutEffect)(()=>()=>{t(tr({formId:n,name:e}))},[a,n,e,t]);const d=(0,Lo.useCallback)(t=>r(e,t.target.value),[e,r]),p=(0,Lo.useCallback)(()=>{o(e,!0)},[o,e]);return[(0,Lo.useMemo)(()=>({name:e,onInput:d,onBlur:p,value:i}),[e,d,p,i]),(0,Lo.useMemo)(()=>({isValid:u,error:l,touched:c}),[u,l,c])]}function Ei(e){const{t}=qo(),{sendAssertive:n}=ss(),{hasLimit:r,limit:o}=wn(),s=(0,Lo.useMemo)(()=>Zt(n,Rn),[n]),a=(0,Lo.useMemo)(()=>Zt((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))},Rn),[s,t]),[{value:i}]=Si(e),c="number"==typeof o&&r&&i?o-i.length:o,l=!(!r||"number"!=typeof c)&&c<=Ln,u=!(!r||"number"!=typeof c)&&c<0;return(0,Lo.useEffect)(()=>{a(l,c)},[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const ji=e=>{const{hasCharacterLimit:t,characterLimit:n}=Ei(e),{entryMeta:{active:r,optionsOverride:o}}=dn();let s=null,a=null;r&&o&&"object"==typeof o[r]&&(s=o[r].label,a=o[r].placeholder);const{alwaysShowEntryLabel:i}=Yt(),{t:c}=qo();return{placeholder:(0,Lo.useMemo)(()=>c("input.inputPlaceholder",{hasLimit:t,text:a||c("input.inputPlaceholderText"),limit:t?n:null}),[c,t,n,a]),label:(0,Lo.useMemo)(()=>c("input.inputLabel",{hasLimit:!s&&t,text:s||c("input.inputLabelText"),limit:!s&&t?n:null}),[c,t,n,s]),labelClass:(0,Lo.useMemo)(()=>!0===i||s?"label":"visually-hidden",[i,s])}};function Ti(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=No(),{entryMeta:{actions:t,translatedActions:n}}=dn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(Zr())}}})(),n=es();return e?(0,ds.jsx)("li",{className:Ss(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,ds.jsx)("button",{className:Ss(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:O,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Ni=(0,ko.createContext)(null),Ii=()=>{const e=(0,Lo.useContext)(Ni);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Oi=Ni,ki=e=>{const t=(()=>{const e=(0,Lo.useContext)(fs);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]},Li=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Ii(),{sendAction:o}=rs(),s=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:i}=Jo({containerRef:s,freezeOnceVisible:!0}),c=No(),[l,u]=ki(e);if((0,us.useEffect)(()=>{if(i&&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(Fr(t)),o({type:"read",events:t})}},[c,e.payload.id,i,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"),(0,ds.jsxs)("li",{className:Ss(d),ref:a,children:[e.payload.timeIndicator&&(0,ds.jsx)(ca,{event:e}),(0,ds.jsx)(l,{event:e,children:(0,ds.jsx)(u,{event:e})})]})},Ri=()=>{const{id:e}=xn()||{};return(0,ds.jsx)("li",{className:Ss("conversation__item","conversation__item--source-agent"),children:(0,ds.jsxs)("div",{className:Ss("message","message--source-agent","message--type-loading"),children:[(0,ds.jsx)(Fs,{eventPayload:{fromClient:!1,participant:e}}),(0,ds.jsx)("div",{className:Ss("message__body"),children:(0,ds.jsxs)("span",{className:Ss("loader"),children:[(0,ds.jsx)("span",{className:Ss("loader__part","one")}),(0,ds.jsx)("span",{className:Ss("loader__part","two")}),(0,ds.jsx)("span",{className:Ss("loader__part","three")}),(0,ds.jsx)("span",{className:Ss("loader__part","four")})]})})]})})},Ai=()=>{const e=hn();let t;return(0,ds.jsx)(ds.Fragment,{children:e.map(e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:s}=r,a=s?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,ds.jsx)(Li,{event:e,newParticipant:o},e.payload.key||e.payload.id)})})},Pi=()=>{const{t:e}=qo(),t=mn(),n=((e,t=20)=>{const[n,r]=(0,Lo.useState)(e),o=(0,Lo.useRef)(null);return(0,Lo.useEffect)(()=>(o.current=setTimeout(()=>r(e),t),()=>{o.current&&clearTimeout(o.current)}),[e,t]),n})(t,t?0:20),{isOpen:r}=Ko(),o=vn(),s=vs();return(0,ds.jsxs)(ds.Fragment,{children:[r&&(0,ds.jsx)("a",{className:Ss("skip-link"),href:`#${o}`,onClick:e=>{e.preventDefault(),s()},children:e("skiplinkText")}),(0,ds.jsx)("div",{className:Ss("chat__body"),children:(0,ds.jsxs)("div",{className:Ss("conversation__container"),children:[(0,ds.jsx)(fi,{}),(0,ds.jsx)("div",{role:"log","aria-label":e("chat.srLabel"),children:(0,ds.jsxs)("ol",{className:Ss("conversation"),children:[(0,ds.jsx)(Xa,{children:(0,ds.jsx)(Ai,{})}),n?(0,ds.jsx)(Ri,{}):null,(0,ds.jsx)(Ti,{})]})})]})})]})};function Mi(e,t){const n=(0,Lo.useRef)(null),r=(0,Lo.useRef)(e);return(0,Lo.useEffect)(()=>{r.current=e},[e]),(0,Lo.useEffect)(()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(()=>r.current(),t),()=>{n.current&&clearTimeout(n.current)}),[t]),n}const Di={visible:Ss("transition--visible"),in:Ss("transition--in"),visuallyHidden:Ss("visually-hidden")},Ui=Object.values(Di),Fi=e=>{const t=(0,Lo.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Lo.useMemo)(()=>n?(...e)=>t.current(...e):void 0,[n])},zi="notRendered",Bi="rendered",Vi="visuallyHidden",$i=({children:e,isActive:t,timeout:n=300,transitionStartState:r=zi,onInTransitionComplete:o=()=>{},onOutTransitionComplete:s=()=>{},exitAfter:a,enterDelay:i=0})=>{const c=(0,Lo.useRef)(!1),l=(0,Lo.useRef)(null),u=(0,Lo.useRef)(null),d=r===Vi,[p,f]=(0,Lo.useState)(()=>d?[Di.visuallyHidden]:[]),[h,m]=(0,Lo.useState)(()=>0===i),y=(0,Lo.useMemo)(()=>a?a+i:a,[i,a]);Mi(()=>m(!1),t?y:void 0),Mi(()=>m(!0),t?i:void 0);const v=(0,Lo.useMemo)(()=>h&&t,[t,h]),g=Fi(o),b=Fi(s),x="notRendered"!==r||p.length>0;return(0,Lo.useEffect)(()=>(c.current&&!v&&(f([Di.visible]),l.current=setTimeout(()=>{f([...d?[Di.visuallyHidden]:[]]),b&&(u.current=requestAnimationFrame(()=>{b()}))},n)),!c.current&&v&&(f([Di.visible]),u.current=requestAnimationFrame(()=>{u.current=requestAnimationFrame(()=>{f([Di.visible,Di.in]),g&&(l.current=setTimeout(()=>{g()},n))})})),c.current=v,()=>{l.current&&clearTimeout(l.current),u.current&&cancelAnimationFrame(u.current)}),[d,g,b,n,v]),(0,ds.jsx)(ds.Fragment,{children:x&&(0,ko.toChildArray)(e).filter(ln).map(e=>{const{className:t=""}=e.props,n=t.split(" ").filter(e=>!Ui.includes(e));return(0,ko.cloneElement)(e,{className:[...n,...p].join(" ")})})})},Hi=({isAside:e=!1})=>{const{isInline:t}=_n(),{t:n}=qo(),{addMessageBubble:r,emitEvent:o,sendAction:s}=rs(),a=ns(),{isOpen:i,setVisibility:c}=Ko(),{showSuggestions:l}=Yt(),u=Ds(),d=vs(),p=(0,Lo.useRef)(null),{sendPolite:f}=ss(),h=Xt(is),{hasCountdown:m,endCountdown:y}=Ps(),{hasPrompt:v,continueChat:g}=Ms(),b=Xo(),x=dn().serviceData.suggestion;const{body:w}=ws({payload:x,type:"service_data"}),_=(0,Lo.useMemo)(()=>h?[]:Array.isArray(w)?w:[],[w,h]),C=(0,Lo.useRef)(),S=(0,Lo.useRef)(!1),E=(0,Lo.useRef)(),j=!!_?.length,N=t?(b||i)&&!e:b,I=(0,Lo.useRef)(N),O=j&&!N&&l,k=j?_:E.current;E.current=k;const L=(0,Lo.useMemo)(()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Ss(t)},[e]),R=(0,Lo.useCallback)(({id:e,question:t})=>{if(!a())return;m&&y(!0),v&&g();const n=z(),l={type:T,originMessage:x.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};s(l),r(t,n),o(`action.${l.type}`,l),i||c({visibility:Nt.open}),d()},[r,g,y,o,d,a,m,v,i,x,s,c]);(0,Lo.useEffect)(()=>{if(C.current!==_&&!N){if(j){const e=S.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout(()=>{f(e)},30)}else S.current&&f(n("suggestions.srUnavailableText"));C.current=_}!I.current&&N?(cn(p.current,d),f(n("suggestions.srUnavailableText"))):!j&&S.current&&cn(p.current,d),S.current=j,I.current=N},[_,j,N,d,f,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return(0,ds.jsx)($i,{isActive:!!O,transitionStartState:zi,children:(0,ds.jsxs)(M,{className:L,"aria-labelledby":A?u:void 0,ref:p,children:[A&&(0,ds.jsx)("p",{id:u,className:Ss("suggestions__heading"),children:A}),!!k&&(0,ds.jsx)(na,{suggestions:k,onClickSuggestion:R}),P&&!i&&(0,ds.jsx)("p",{className:Ss("suggestions__footer"),children:P})]})})},Wi=(0,us.forwardRef)(({children:e,className:t=""},n)=>{const{closeChat:r,isOpen:o,isVisible:s}=Ko(),a=gs(),{namespace:i,layoutMode:c}=Yt(),{isInline:l}=_n(),u=Es(),d=Ds(),p=Xo(),{t:f}=qo(),h=["chat",`chat--layout-${c}`,`namespace--${i}`,t];return"function"!=typeof u&&h.push(...u),o||"app"===c||h.push("chat--collapsed"),p&&h.push("chat--user-responded"),s&&(0,ds.jsxs)("section",{className:Ss(h),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!l&&o&&(r(),a())},tabIndex:-1,ref:n,role:"window"===c?"dialog":void 0,"aria-labelledby":d,children:[(0,ds.jsx)("h2",{className:Ss("chat__title","visually-hidden"),id:d,children:f("window.srModalLayoutLabel")}),(0,ds.jsx)("div",{className:Ss("chat-wrapper"),children:e}),"inline"===c&&o&&(0,ds.jsx)(Hi,{isAside:!0})]})}),Gi=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:s})=>{const a=Ds();return(0,ds.jsxs)("section",{tabIndex:-1,id:s,"aria-labelledby":n?a:void 0,className:Ss("chat-status",n?void 0:"chat-status--condensed"),children:[(0,ds.jsxs)("div",{className:Ss("chat-status__body"),children:[n?(0,ds.jsx)("h2",{className:Ss("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&(0,ds.jsxs)("button",{type:"button",onClick:t,className:Ss("button","button--tertiary","chat-status__close"),children:[r||(0,ds.jsx)(Hs,{name:"close",size:"16",alt:""}),o&&(0,ds.jsx)("span",{className:Ss("visually-hidden"),children:o})]})]})},qi=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,ds.jsxs)("button",{type:"button",onClick:e,className:Ss("button","button--primary","chat-status__button"),children:[(0,ds.jsx)(Hs,{name:t,size:"16",alt:""}),n,r&&(0,ds.jsx)("span",{className:Ss("visually-hidden"),children:r})]});function Ki(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=xs(),n=No(),{sendAction:r}=rs(),{translationProposal:o}=Xt(e=>e.translations),{enableTranslations:s}=xs(),{isOpen:a}=Ko(),{userLocale:i}=qo(),c=o?.proposedLocale,l=Cs(c),u=(0,Lo.useMemo)(()=>null!==o&&!e&&a&&i!==c&&t.some(e=>e.locale===c),[o,e,a,i,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&s(o.proposedLocale,R)},dismissTranslationProposal:()=>{r({type:I,body:{type:L}}),n(_o())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=_s();return e&&t?(0,ds.jsx)(Gi,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,ds.jsx)(qi,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function Ji(){const e=Xt(is),{isActive:t}=xs();return e||t?null:(0,ds.jsx)(Ki,{})}const Xi=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:s})=>(0,ds.jsxs)("li",{className:Ss([s||"","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:[(0,ds.jsx)(Hs,{name:"check",size:"16",alt:""}),e," ",n&&(0,ds.jsxs)("span",{children:["(",n,")"]})]}),Yi=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=Yt(),{t:r}=qo(),{languages:o,currentLocale:s,enableTranslations:a,disableTranslations:i}=xs(),c=vs(),l=t=>()=>{t&&(t===s||n===t?i():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,us.useMemo)(()=>o.reduce((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,s,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex(e=>e.locale===s);return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e},{primaryLanguages:[],remainingLanguages:[]}),[s,n,o]);return(0,ds.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Ss("translation-options"),children:[u.map(({locale:e,nativeName:t,checked:n,isOriginal:o},s)=>(0,ds.jsx)(Xi,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:Ss({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==s})},e)),d.map(({locale:e,nativeName:t,checked:n,isOriginal:o})=>(0,ds.jsx)(Xi,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e))]})},Qi=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:s,cancelButtonText:a,cancelButtonRef:i,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Ds(),{hideOption:d}=ks(),{focusButton:p}=Ls(),f=(0,Lo.useCallback)(()=>{d(),c||p()},[c,p,d]),h=(0,Lo.useCallback)(()=>{n&&n(),f()},[f,n]),m=(e=>{const t=(0,Lo.useRef)(null);return(0,Lo.useEffect)(()=>{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})(h);return(0,Lo.useEffect)(()=>{an(m.current)},[m]),(0,ds.jsx)("section",{className:Ss("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:(0,ds.jsxs)("div",{className:Ss("options__body"),children:[(0,ds.jsx)("h2",{id:u,className:Ss("options__title"),children:r}),(0,ds.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:Ss("button","options__close"),ref:e=>{i&&(i.current=e)},children:[(0,ds.jsx)(Hs,{name:"close",size:"16",alt:""}),(0,ds.jsx)("span",{children:a})]}),o?(0,ds.jsx)("p",{className:Ss("options__description"),id:s,children:o}):null,(0,ds.jsx)("div",{className:Ss("options__wrapper"),children:t})]})})},Zi=function({onClose:e,position:t}){const{t:n}=qo(),r=Ds();return(0,ds.jsx)(Qi,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,ds.jsx)(Yi,{describedById:r,onChange:e})})};function ec({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,Lo.useState)(!1),s=(0,Lo.useRef)(null),a=Ds();return(0,ds.jsxs)("div",{className:Ss("translations__container"),onKeyDown:e=>{r&&sn(e)===on.Escape&&(o(!1),an(s.current))},children:[(0,ds.jsx)($i,{transitionStartState:zi,isActive:r,children:(0,ds.jsx)("div",{className:Ss("options__dialog"),role:"dialog",children:(0,ds.jsx)(Zi,{onClose:()=>{o(!1)},position:t})})}),(0,ds.jsx)("button",{type:"button",className:Ss(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{sn(e)===on.ArrowDown&&(o(!0),e.preventDefault())},ref:s,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const tc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:s={},...a})=>{const i=No(),c=Xt(e=>yi(e,{formId:t})),[l,u]=(0,Lo.useState)(!1),[d,p]=(0,Lo.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,Lo.useMemo)(()=>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,s),m=(0,Lo.useMemo)(()=>({...h,...d}),[h,d]);(0,Lo.useLayoutEffect)(()=>{i(Qn({formId:t,persistData:n}))},[t,n,i]),(0,Lo.useEffect)(()=>()=>{i(Zn({formId:t}))},[t,n,i]);const y=(0,Lo.useCallback)((e,n)=>{i(nr({formId:t,name:e,value:n}))},[t,i]),v=(0,Lo.useCallback)((e,n)=>{i(rr({formId:t,name:e,touched:n}))},[i,t]),g=(0,Lo.useCallback)((e,t)=>{p(n=>({...n,[e]:t}))},[p]),b=(0,Lo.useCallback)(e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(i($n(!0)),o(c,{updateControlValue:y,setError:g}))},[f,i,o,c,y,g]);(0,Lo.useEffect)(()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})},[l,m,r]);const x=(0,Lo.useMemo)(()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:s,updateControlValue:y,updateControlTouched:v}),[t,c,m,l,b,s,y,v]);return t?o?(0,ds.jsx)(xi,{...a,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},nc=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),rc=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},oc=e=>!!e?.length,sc=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))},ac=e=>!!e,ic=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Ci();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&s&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),(0,ds.jsx)("form",{onSubmit:r,className:Ss([...a,e]),...n})};function cc({id:e,error:t}){const[n,r]=(0,Lo.useState)(!1);return(0,Lo.useEffect)(()=>{const e=setTimeout(()=>r(!0),300);return()=>clearTimeout(e)},[]),(0,ds.jsx)("div",{className:Ss("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,ds.jsxs)("span",{id:e,className:Ss("error__message"),children:[(0,ds.jsx)(Hs,{name:"error",size:"16",alt:""}),t]})})}const lc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:o,errorText:s,children:a})=>(0,ds.jsxs)(ds.Fragment,{children:[e&&(0,ds.jsx)("span",{id:`${t}-content-hint`,className:Ss("input__content-hint"),children:e}),(0,ds.jsx)(cc,{id:`${t}-error`,error:!o&&s}),(0,ds.jsxs)("div",{className:Ss("form-control__wrapper"),children:[(0,ds.jsx)("label",{htmlFor:t,className:Ss(r),children:n}),a]})]}),uc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:s=null,focus:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,Lo.useRef)(null),{isSubmitted:d}=Ci(),[p,{error:f}]=Si(t),h=d&&f,m=[];return c&&m.push(c),s&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,Lo.useLayoutEffect)(()=>{u.current&&a&&u.current.focus()},[a]),(0,ds.jsx)(lc,{id:e,contentHint:s,validity:!h,errorText:f,labelText:r,labelClass:o,children:(0,ds.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":i||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function dc({controlName:e,describedById:t}){const{t:n}=qo();return(0,ds.jsxs)(ic,{noValidate:"true",className:Ss("options__form"),children:[(0,ds.jsx)(uc,{id:"email-id",name:e,type:"email",autocomplete:"email",className:Ss("transcript__input"),"aria-describedby":t,labelClass:Ss("label"),labelText:n("options.sendTranscript.label")}),(0,ds.jsx)("div",{className:Ss("options__actions"),children:(0,ds.jsx)("button",{type:"submit",className:Ss("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const pc="email",fc={sendTranscript:()=>{const[e,t]=(0,Lo.useState)(void 0),{hideOption:n}=ks(),{focusButton:r}=Ls(),{t:o}=qo(),s=Ds(),{sendAction:a}=rs(),i=(0,Lo.useMemo)(()=>({[pc]:[nc(ac,o("options.sendTranscript.noEmailText")),nc(sc,o("options.sendTranscript.invalidEmailText"))]}),[o]),c=(0,Lo.useCallback)(e=>{const t=e[pc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()},[a,n,r]),l=(0,Lo.useCallback)(({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)},[t]);return(0,ds.jsx)(Qi,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:s,position:{vertical:"top",horizontal:"right"},children:(0,ds.jsx)(tc,{formId:"sendTranscript",onSubmit:c,validationSchema:i,onError:l,children:(0,ds.jsx)(dc,{controlName:pc,describedById:s})})})}},hc=()=>{const{optionActive:e}=ks(),t=(0,Lo.useRef)(),n=fc[t.current??e];return e&&(t.current=e),n?(0,ds.jsx)(n,{}):null},mc=()=>{const{t:e}=qo(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=ks(),{id:s}=Ls(),a=(0,Lo.useRef)(null),[i,c]=(0,Lo.useState)(!1),l=(0,Lo.useRef)(null),u=t.length,d=(0,Lo.useRef)([]),p=(0,Lo.useRef)(!1),f=u>1,h=t[0],m=(0,Lo.useMemo)(()=>h?.name?.trim().replace(/\s+/g,""),[h]);return(0,Lo.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),(0,Lo.useEffect)(()=>{i&&!p.current&&requestAnimationFrame(async()=>{await hs(60);const e=t.findIndex(e=>e.available),n=-1===e?0:e;d.current&&an(d.current[n])}),p.current=i},[i,t]),u?(0,ds.jsxs)("div",{className:Ss("options__container"),onKeyDown:e=>{i&&(sn(e)===on.Escape&&(c(!1),an(l.current)),sn(e)===on.Home&&(d.current&&an(d.current[0]),e.preventDefault()),sn(e)===on.End&&(d.current&&an(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout(()=>{c(!1)},200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[(0,ds.jsx)($i,{transitionStartState:zi,isActive:r,children:(0,ds.jsx)("div",{className:Ss("options__dialog"),children:(0,ds.jsx)(hc,{})})}),f&&(0,ds.jsx)($i,{isActive:i,transitionStartState:zi,children:(0,ds.jsx)("ul",{className:Ss(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":s,children:t.map(({name:r,title:o,available:s},a)=>(0,ds.jsx)("li",{className:Ss("options__menu__item"),role:"menuitem","data-testid":r,children:(0,ds.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Ss(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(sn(e)===on.ArrowDown){const n=Math.min(u-1,t+1);d.current&&an(d.current[t===n?0:n]),e.preventDefault()}if(sn(e)===on.ArrowUp){const n=Math.max(0,t-1);d.current&&an(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&&an(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,s),"aria-disabled":!s,children:[(0,ds.jsxs)("span",{className:Ss("button__text"),children:[o,!s&&" "]}),s?null:(0,ds.jsx)("span",{className:Ss("button__state"),children:e("options.unavailableText")})]})},r))})}),(0,ds.jsxs)("button",{type:"button",className:Ss(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:s,onClick:()=>{r&&o(),f?c(e=>!e):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{sn(e)===on.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&i,"aria-disabled":!f&&!h.available,children:[f?(0,ds.jsx)(Hs,{name:"options",size:"32",alt:""}):null,(0,ds.jsx)("span",{className:Ss("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,ds.jsx)("span",{className:Ss("button__state"),children:e("options.unavailableText")})]})]}):null};function yc(){const{menuOptions:e,allowOptionSelection:t}=ks(),{isAvailable:n}=xs(),r=Xt(is),{t:o,userLocale:s}=qo(),a=Cs(s);if(!n&&(!t||!e.length)||r)return null;const i=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,ds.jsxs)("div",{className:Ss("chat__options"),children:[n&&(0,ds.jsx)("div",{className:Ss("chat__options-item","chat__options-item--left"),children:(0,ds.jsxs)(ec,{classNames:["button--secondary"],children:[(0,ds.jsx)(Hs,{alt:i,name:"newTranslation",size:"16"}),(0,ds.jsx)("span",{className:Ss("button__text"),children:i})]})}),t&&(0,ds.jsx)("div",{className:Ss("chat__options-item","chat__options-item--right"),children:(0,ds.jsx)(mc,{})})]})}const vc=()=>{const{scrollToRef:e,unreadIds:t}=Ii(),{isMinimized:n}=Ko(),{t:r}=qo();return(0,ds.jsx)($i,{isActive:!!t.length&&!n,children:(0,ds.jsx)("div",{className:Ss("unread-messages"),children:(0,ds.jsxs)("button",{type:"button",className:Ss("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,ds.jsx)(Hs,{name:"chevronDown",size:"32",alt:""})]})})})},gc=({children:e})=>{const t=hn(),n=(0,Lo.useMemo)(()=>t.reduce((e,t)=>t.payload.id?(e[t.payload.id]=(0,ko.createRef)(),e):e,{}),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:s,unreadIds:a}=(e=>{const t=(0,Lo.useRef)(null),[n,r]=(0,Lo.useState)(!0),o=Xt(di),s=hn(),a=mn(),{isOpen:i}=Ko(),c=dn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Xt(({state:e})=>e);(0,Lo.useEffect)(()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,s=Math.abs(t-n-o)>10;r(!s)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)},[]);const d=(0,Lo.useCallback)(()=>{requestAnimationFrame(async()=>{await hs(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})})},[]);return(0,Lo.useEffect)(()=>{u&&d()},[u,d]),(0,Lo.useEffect)(()=>{n&&d()},[n,o,s,a,i,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(0,ds.jsx)(Oi.Provider,{value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:s},children:(0,ds.jsxs)("div",{className:Ss("chat__container"),children:[(0,ds.jsx)("div",{className:Ss("chat__container__scroll-area"),ref:s,children:e}),(0,ds.jsx)(vc,{})]})})},bc=({baseClassName:e,children:t,title:n})=>{const r=vn(),o=Ds();return(0,ds.jsxs)("section",{id:r,className:Ss(e),"aria-describedby":o,tabIndex:-1,children:[(0,ds.jsx)("h2",{className:Ss(`${e}__title`),id:o,children:n}),t]})},xc=()=>{const{t:e}=qo(),t=vs(),n=As(),{emitEvent:r}=rs(),{isActive:o,remaining:s,timer:a,endCountdown:i}=Ps(),c=!!s&&s>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,ds.jsx)(bc,{baseClassName:"idle",title:l,children:c&&(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)("div",{className:Ss("idle__count-container"),children:o&&(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)("span",{className:Ss("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,ds.jsx)("span",{className:Ss("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,ds.jsxs)("div",{className:Ss("idle__options"),children:[(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:()=>{n(),i(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:()=>{i(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},wc=()=>{const{t:e}=qo(),t=As(),{name:n}=xn()||{},{continueChat:r,restartChat:o}=Ms();return(0,ds.jsx)(bc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,ds.jsxs)("div",{className:Ss("prompt__options"),children:[(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},_c=()=>{const{sendAction:e}=rs(),{features:t}=ks(),{typingPeekahead:n}=t||{},r=(0,Lo.useRef)(null),o=(0,Lo.useRef)(null),s=(0,Lo.useRef)(!1),a=(0,Lo.useRef)(null);(0,Lo.useEffect)(()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)},[]);const i=(t,r)=>{e({type:"typing",state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(i(!0,e.target.value),a.current=setInterval(()=>{!s.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&i(!0,e.target.value)},2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout(()=>{s.current=!1},300),o.current=setTimeout(()=>{i(!1,e.target.value)},2e3))}},Cc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=dn().entryMeta,s=No(),a=n||t||e,i=o&&o[a]||r&&r[a]||{},c=(0,Lo.useCallback)(e=>{s(Ur(e))},[s]),l=(0,Lo.useCallback)(e=>{s(Mr(e))},[s]),u=(0,Lo.useCallback)(e=>{s(so(e))},[s]),d=(0,Lo.useCallback)(()=>{n?u(null):l(e)},[l,u,e,n]);return{activeEntry:a,activeEntryOptions:i,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Sc({controlName:e,skipLinkId:t}){const{t:n}=qo(),{setInputFocus:r}=Ko(),{sendAssertive:o}=ss(),{emitEvent:s}=rs(),a=_c(),{setBlockAutoEntrySwitch:i}=Cc(),{placeholder:c,label:l,labelClass:u}=ji(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Ei(e),[{value:m}]=Si(e),y=!!m,v=(0,Lo.useCallback)(()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),s("ui.inputFocus")},[n,o,p,h,s]);return(0,Lo.useLayoutEffect)(()=>(i(y),()=>{i(!1)}),[i,y]),(0,ds.jsxs)(ic,{className:Ss("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,ds.jsxs)("div",{className:Ss(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,ds.jsx)(uc,{id:t,type:"text",name:e,className:Ss("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:Ss(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:v,focus:r}),(0,ds.jsx)("div",{className:Ss("character-count"),children:p&&(0,ds.jsx)("span",{children:h})})]}),(0,ds.jsx)("button",{className:Ss("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,children:(0,ds.jsx)(Hs,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Ec="textMessageEntry";function jc({...e}){const{isOpen:t,setVisibility:n}=Ko(),r=vn(),o=vs(),{sendMessage:s}=rs(),a=(0,Lo.useCallback)((e,{updateControlValue:r})=>{s({body:e[Ec]}),r(Ec,""),o(),t||n({visibility:Nt.open})},[s,o,t,n]);return(0,ds.jsx)(tc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,ds.jsx)(Sc,{controlName:Ec,skipLinkId:r})})}const Tc=()=>{const{t:e}=qo(),{currentUploads:t}=Os();return(0,ds.jsx)("div",{className:Ss("progress"),children:t.map(({id:t,name:n,progress:r,uploading:o,error:s})=>(0,ds.jsxs)("div",{className:Ss("progress_container"),children:[(0,ds.jsxs)("div",{className:Ss("progress__text"),children:[(0,ds.jsx)("span",{className:Ss("progress__text--file-name"),children:n}),(0,ds.jsx)("span",{className:Ss("progress__text--percentage"),children:`${r}%`})]}),(0,ds.jsx)(cc,{error:s,id:"progress-error"}),(0,ds.jsx)("progress",{className:Ss("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 Nc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=Ci(),[i,c]=(0,Lo.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=Si(t),p=Ds(),f=Ds(),h=Ds(),m=a&&d,y=[h];r&&y.push(f),m&&y.push(p);const v=(0,Lo.useCallback)(()=>{c(!0)},[c]),g=(0,Lo.useCallback)(()=>{c(!1),u()},[c,u]),b=(0,Lo.useCallback)(e=>{const t={target:{value:e.target.files}};l(t)},[l]);return(0,ds.jsxs)("div",{className:Ss("upload__container"),children:[r&&(0,ds.jsx)("span",{className:Ss("upload__content-hint"),id:f,children:r}),(0,ds.jsx)(cc,{id:p,error:m&&d}),(0,ds.jsx)("div",{className:Ss(["file-upload",...i?["focus-within"]:[]]),children:(0,ds.jsxs)("label",{htmlFor:e,className:Ss("upload__label"),children:[(0,ds.jsx)(Hs,{name:"upload",size:"32",alt:""}),(0,ds.jsxs)("div",{children:[(0,ds.jsx)("span",{className:Ss(["upload__label--text"]),children:n}),(0,ds.jsx)("input",{id:e,className:Ss("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:s||null,onFocus:v,onBlur:g}),(0,ds.jsx)("span",{className:Ss("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}const Ic=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:s,onClickCancel:a})=>{const{t:i}=qo(),[{value:c}]=Si(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,ds.jsxs)(ic,{className:Ss("upload-form"),children:[(0,ds.jsx)(Nc,{name:t,id:e,accept:n,labelText:i("fileUpload.labelText"),outputText:i("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,ds.jsxs)("div",{className:Ss("upload__button-container"),children:[(0,ds.jsx)("button",{id:o||!s?e:void 0,type:"button",onClick:a,className:Ss("button","button--secondary","upload__cancel"),children:i("fileUpload.cancelButtonText")}),(0,ds.jsx)("button",{className:Ss("button","button--primary"),type:"submit",children:i("fileUpload.uploadButtonText")})]})]})},Oc="fileListForm",kc="fileList",Lc=()=>{const{t:e}=qo(),{sendPolite:t,sendAssertive:n}=ss(),r=vn(),o=vs(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:i}=Is(),c=(0,Lo.useRef)(null),l=(0,Lo.useRef)(s),{cancelEntrySelection:u}=Cc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=Os(),{uploadHandle:m,hasServerError:y,progress:v}=((e,t)=>{const n=Xt(n=>vi(n,{formId:e,name:t})),{currentUploads:r}=Os(),o=n&&n.length>0;let s=null,a=!1,i=0;if(r&&r.length>0){const e=r[0];s=e.uploadHandle,a=!!e.error,i=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:s,hasServerError:a,progress:i}})(Oc,kc),g=Ds(),b=(0,Lo.useRef)(!0),x=e("fileUpload.contentHint",{size:nn(i)}),w=(0,Lo.useRef)(""),_=(0,Lo.useRef)(null);(0,Lo.useEffect)(()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x},[x,n]),(0,Lo.useEffect)(()=>{v>0&&t(1===v?e("fileUpload.srStartedText"):`${v}%`)},[v,t,e]),(0,Lo.useEffect)(()=>{b.current||f||!h||(p(),u(),o(),setTimeout(()=>{t(e("fileUpload.srCompleteText"))},300)),b.current=h},[f,h,p,u,o,t,e]),(0,Lo.useEffect)(()=>{s||f||(p(),u(),o())},[s,f,p,u,o]);const C=(0,Lo.useCallback)(({fileList:e})=>{d(e[0]),o()},[d,!1,o]),S=(0,Lo.useCallback)(()=>{m&&m.abort(),p(),u(),o()},[m,p,u,o]),E=(0,Lo.useMemo)(()=>({[kc]:[nc(()=>s,e("fileUpload.errors.unavailable")),nc(oc,e("fileUpload.errors.noFile")),nc(rc,e("fileUpload.errors.tooLarge"),i)]}),[i,s,e]);return(0,ds.jsx)("div",{className:Ss(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,ds.jsxs)(tc,{formId:Oc,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)(Tc,{}),(0,ds.jsx)("div",{className:Ss("upload__button-container"),children:(0,ds.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:Ss("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,ds.jsx)(Ic,{controlName:kc,skiplinkId:r,accept:a?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)("span",{className:Ss("notification"),id:g,children:e("fileUpload.unavailableText")}),(0,ds.jsx)("div",{className:Ss("upload__button-container"),children:(0,ds.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:Ss("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Rc=()=>{const{t:e}=qo(),{showFileUpload:t,serviceAllowsUploads:n}=Is(),[r,o]=(0,Lo.useState)(n||!1),s=vs(),a=(0,Lo.useRef)(null),{setUserEntryType:i,activeEntry:c}=Cc(),l=(0,Lo.useRef)(null),{sendPolite:u}=ss(),d=!!xn();return(0,Lo.useEffect)(()=>{cn(l.current,()=>{n||s()}),o(n||!1)},[n,s]),(0,Lo.useEffect)(()=>{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===S?null:(0,ds.jsx)($i,{isActive:r,transitionStartState:Bi,children:(0,ds.jsx)("div",{className:Ss("upload-toggle-wrapper"),children:(0,ds.jsx)($i,{isActive:r,transitionStartState:Vi,children:(0,ds.jsx)("button",{className:Ss(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{i(S),s()}:void 0,tabIndex:r?void 0:-1,children:(0,ds.jsx)(Hs,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Ac=()=>{const{isOpen:e}=Ko(),t=(0,Lo.useRef)(null),{hasCountdown:n}=Ps(),[r,o]=(0,Lo.useState)(n),{hasPrompt:s}=Ms(),[a,i]=(0,Lo.useState)(s),c=vs(),l=(0,Lo.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=Cc(),[p,f]=(0,Lo.useState)({text:jc,upload:Lc}),[h,m]=(0,Lo.useState)(()=>u),y=Yt(),{accountAllowsUploads:v}=Is(),g=(0,Lo.useCallback)(()=>{cn(t.current,c)},[c]);(0,Lo.useEffect)(()=>{const{customComponents:e}=y,{entry:t}=e||{};t&&f(e=>({...e,...t}))},[y]),(0,Lo.useEffect)(()=>{g(),o(n),i(s)},[n,s,g]),(0,Lo.useEffect)(()=>{m(u),g()},[u,g,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const b=p[h]||jc,{allowManualInput:x=!0}=d;return(0,ds.jsxs)("div",{className:Ss("chat__entry"),ref:t,children:[r&&(0,ds.jsx)(xc,{}),a&&(0,ds.jsx)(wc,{}),(0,ds.jsxs)("div",{className:Ss(["entry__body",...n||s||!1===x?["entry__body--hidden"]:[]]),children:[h!==S&&v&&e?(0,ds.jsx)(Rc,{}):null,(0,ds.jsx)(b,{})]})]})},Pc=()=>{const{t:e}=qo(),{isOpen:t,closeChat:n}=Ko(),{isWindow:r}=_n(),o=gs(),s=(0,Lo.useCallback)(()=>{n(),o()},[n,o]);return t&&r?(0,ds.jsx)("button",{type:"button",className:Ss("button","collapse-button"),onClick:s,children:(0,ds.jsx)(Hs,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},Mc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:o,srText:s}}=cs(),a=rs(),i=Ds(),{sendPolite:c}=ss(),l=vs(),u="SeamlySessionExpiredError"===e?.name;return(0,Lo.useEffect)(()=>{!u&&s&&setTimeout(()=>{c(s)},200)},[c,s,u]),u?(0,ds.jsx)(ds.Fragment,{}):(0,ds.jsxs)("section",{className:Ss("interrupt"),"aria-labelledby":i,children:[(0,ds.jsx)(Pc,{}),(0,ds.jsxs)("div",{className:Ss("interrupt__body"),children:[(0,ds.jsx)("h2",{id:i,className:Ss("interrupt__title"),children:t}),(0,ds.jsx)("p",{className:Ss("interrupt__message"),children:n}),r&&o&&(0,ds.jsx)("div",{className:Ss("interrupt__actions"),children:(0,ds.jsx)("button",{type:"button",className:Ss("button","button--primary"),onClick:()=>{o&&a[o]&&a[o](),l()},children:r})})]})]})},Dc=function({children:e}){const t=Xt(is),{isOpen:n}=Ko();return t?(0,ds.jsx)(Mc,{}):(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsxs)(gc,{children:[(0,ds.jsxs)("div",{className:Ss("chat__container__header"),children:[(0,ds.jsx)(Ji,{}),(0,ds.jsx)(Pc,{})]}),e]}),(0,ds.jsx)(Ac,{}),n&&(0,ds.jsx)(yc,{})]})};function Uc({event:e}){const[t]=ki(e);return(0,ds.jsx)("li",{children:(0,ds.jsx)(t,{event:e})})}function Fc({events:e}){return(0,ds.jsx)("ul",{className:Ss("collapsed-chat-messages"),children:e.map(e=>(0,ds.jsx)(Uc,{event:e},e.payload.id))})}function zc(){const{preChatEvents:e}=Yt(),t=Xt(is),{isOpen:n}=Ko();return t||!e?.length||n?null:(0,ds.jsx)(Fc,{events:e})}function Bc(){const{t:e}=qo(),t=e("window.chat.continue"),n=(0,Lo.useMemo)(()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}}),[t]);return(0,ds.jsx)(Fc,{events:[n]})}const Vc=()=>{const e=Qt(),t=xn(),n=Xt(is),r=t&&!n,o=r?t.avatar:e;return o?(0,ds.jsx)("img",{className:Ss(r?"avatar":"icon"),src:o,alt:""}):(0,ds.jsx)(Hs,{name:"avatar",size:"32",alt:""})},$c=({onClick:e})=>{const t=ns(),{t:n}=qo(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=vs(),{isOpen:s}=Ko(),{windowOpenButtonId:a}=dn(),i=yn(),c=(0,Lo.useCallback)(()=>{e(),o()},[o,e]);return(0,ds.jsx)($i,{isActive:!s,transitionStartState:Bi,children:(0,ds.jsxs)("button",{type:"button",className:Ss("window-open-button"),"aria-label":r,onClick:c,inert:s||void 0,id:a,children:[(0,ds.jsx)($i,{isActive:!!i,transitionStartState:zi,children:(0,ds.jsx)("span",{className:Ss("message-count"),"aria-hidden":"true",children:i})}),(0,ds.jsx)(Vc,{})]})})},Hc=(e,t,n)=>"object"==typeof e?e[t]:n,Wc=n.p+"sounds/beep.mp3",Gc=!!window.Notification,qc={app:()=>(0,ds.jsx)(Wi,{children:(0,ds.jsx)(Dc,{children:(0,ds.jsx)(Pi,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=No(),{connectWhenInView:t}=Yt(),n=Xt(Sn),{containerRef:r,isVisible:o}=Jo({enabled:t,freezeOnceVisible:!0});return(0,Lo.useEffect)(()=>{o&&e(Eo())},[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Ko();return(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)($i,{isActive:!n,transitionStartState:Bi,children:(0,ds.jsxs)("div",{ref:t,className:Ss("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,ds.jsx)(zc,{}),(0,ds.jsx)(Hi,{})]})}),(0,ds.jsx)($i,{isActive:n,transitionStartState:Bi,children:(0,ds.jsx)(Wi,{ref:t,children:e&&(0,ds.jsx)(Dc,{children:n&&(0,ds.jsx)(Pi,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Ko(),n=Xo(),{continueChat:r,preChat:o}=Yt();return(0,ds.jsxs)(ds.Fragment,{children:[(0,ds.jsx)($c,{onClick:t}),(0,ds.jsx)($i,{isActive:!!o&&!e&&!n,exitAfter:Hc(o,"exitAfter"),enterDelay:Hc(o,"enterDelay"),transitionStartState:zi,children:(0,ds.jsx)("div",{className:Ss("unstarted-wrapper","unstarted-wrapper--window"),children:(0,ds.jsx)(zc,{})})}),(0,ds.jsx)($i,{isActive:r&&!e&&n,exitAfter:Hc(r,"exitAfter"),enterDelay:Hc(r,"enterDelay"),transitionStartState:zi,children:(0,ds.jsx)("div",{className:Ss("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,ds.jsx)(Bc,{})})}),(0,ds.jsx)($i,{isActive:e,transitionStartState:zi,children:(0,ds.jsx)(Wi,{children:(0,ds.jsx)(Dc,{children:(0,ds.jsx)(Pi,{})})})})]})}};function Kc(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const Jc=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=gn(),{notificationAudioURL:t}=Yt(),[n,r]=(0,Lo.useState)(Gc?Notification.permission:"default"),[o,s]=(0,Lo.useState)(document.visibilityState),a=Xt(pi),i=(0,Lo.useCallback)(async()=>{if(Gc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}},[n]),c=(0,Lo.useMemo)(()=>"granted"===n,[n]),l=(0,Lo.useMemo)(()=>"hidden"===o,[o]);(0,Lo.useEffect)(()=>{"default"===n&&e&&i()},[n,e,i]);const u=(0,Lo.useCallback)(async(e,r)=>{if(a&&Gc){if("default"===n&&i(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Wc);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=${Ec}]`);e&&e.focus()}}}},[t,n,c,i,a,l]);return(0,Lo.useEffect)(()=>{if(!a)return()=>{};function e(){s(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}},[a]),{permission:n,requestPermission:i,sendNotification:u}})(),[,n]=ms(),r=Yt(),o=xn(),{proactiveMessages:s}=gn(),{isOpen:a,isVisible:i}=Ko(),c=Es(),l=Xo(),u=Xt(ui),{body:d}=ws(u),{userLocale:p}=qo(),f=(0,Lo.useRef)(void 0),h=(0,Lo.useMemo)(()=>d?"string"==typeof d?Kc(d):"text"in d?Kc(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?Kc(d.prompt?.text):"":"",[d]);(0,Lo.useEffect)(()=>{o?.name&&h&&s&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)},[o?.avatar,o?.name,u,h,s,t]);const m=qc[r.layoutMode],y=(0,Lo.useCallback)(e=>{"function"==typeof n&&n(e)},[n]),v=(0,Lo.useMemo)(()=>{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"),i?(0,ds.jsx)("div",{className:Ss(g),lang:v,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,ds.jsx)(m,{})}):null},Xc=e=>(0,ds.jsx)(ci,{...e,children:(0,ds.jsx)(Jc,{})});class Yc{constructor(e,t){const{namespace:n="",parentElement:r,...o}=e;this.config={...o,namespace:n},this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new H({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Oo()),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=function({initialState:e,api:t,eventBus:n,config:r}){const o=Ye({reducer:To,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:s,layoutMode:a}=It(t()),{error:i,type:c}=n,l=Gn[i?.name]?new Gn[i.name](i):new m(i);r?.(l,{namespace:o,api:s,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?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===hr.type){if(!vr.includes(r.name))throw new v(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 io.toString():e.store.set("options",n.payload);break;case ao.toString():e.store.set("options",{...e.store.get("options")||{},[n.payload.option]:n.payload.value})}return r}}({api:t}),fo)});return o}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Dn(n)),await r.dispatch(vt()),await r.dispatch(In()),r.dispatch(Nn()),e?(0,ko.render)((0,ds.jsx)(ci,{eventBus:this.eventBus,store:r,api:this.api,children:(0,ds.jsx)(e,{})}),this.parentElement):(0,ko.render)((0,ds.jsx)(Xc,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,ko.render)(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 Qc=e=>"object"==typeof e&&"action"in e,Zc=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),el=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(Qc).map(Zc)).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:e,locale:n}=t;return e&&n&&(this.context.userLocale=n,this.context.source=A),!0}case"setContext":{const{userLocale:e,contentLocale:n}=t;return this.context.userLocale=e,this.context.contentLocale=n,e&&e!=this.appConfig?.userLocale&&(this.context.source=A),!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={},this.debouncedRender(e,n.namespace)}}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 Yc(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout(()=>{e.render()},100)}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||{}}}},tl=()=>{const e=No();return{addEvent:t=>e(Sr(t)),clearEvents:()=>e(Tr()),setEventsRead:t=>e(Fr(t)),setLoadedImageEventIds:t=>e(Kr(t)),setIsLoading:t=>e(qr(t)),setParticipant:t=>e(Jr(t)),setHeaderTitle:t=>e(Hr(t)),setHeaderSubTitle:t=>e($r(t)),setActiveService:t=>e(Dr(t)),initIdleDetachCountdown:t=>e(Rr(t)),decrementIdleDetachCountdownCounter:()=>e(kr()),stopIdleDetachCountdownCounter:()=>e(lo()),clearIdleDetachCountdown:()=>e(Ir()),initResumeConversationPrompt:()=>e(Ar()),clearResumeConversationPrompt:()=>e(Or()),setServiceDataItem:t=>e(Yr(t)),setFeatures:t=>e(Vr(t)),setFeatureEnabledState:t=>e(zr(t)),clearFeatures:()=>e(Nr()),setInitialState:t=>e(Gr(t)),setUserSelectedOptions:t=>e(io(t)),setUserSelectedOption:t=>e(ao(t)),showOption:t=>e(co(t)),hideOption:()=>e(Lr()),setServiceEntryMetadata:t=>e(Qr(t)),setBlockAutoEntrySwitch:t=>e(Ur(t)),setActiveEntryType:t=>e(Mr(t)),setUserEntryType:t=>e(so(t)),registerUpload:t=>e(Pr(t)),setUploadProgress:t=>e(no(t)),setUploadComplete:t=>e(eo(t)),setUploadError:t=>e(to(t)),clearAllUploads:()=>e(jr()),setSeamlyContainerElement:t=>e(Xr(t))}};function nl(){return{get:()=>{if(Object.prototype.hasOwnProperty.call(window,"SeamlyBridge"))try{return JSON.parse(window.SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),Object.prototype.hasOwnProperty.call(window,"SeamlyBridge")&&window.SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function rl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var ol=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=rl({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),a=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(r[i]=t.read(a,i),e===i)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",rl({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,rl({},this.attributes,t))},withConverter:function(t){return e(rl({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function sl(e={}){return function(t){const n=`cvco.${t}`;return{get(){const e=ol.get(n);return e?JSON.parse(e):null},set(t){t&&ol.set(n,JSON.stringify(t),e)}}}}const al=()=>{const{t:e}=qo(),{title:t,subTitle:n}=dn().headerTitles,r=yn(),{isOpen:o}=Ko(),s=xn(),a=Xt(is),i=Qt(),c=s?.avatar??i,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?(0,ds.jsxs)("div",{className:Ss("agent-info"),children:[(0,ds.jsxs)("div",{className:Ss("agent-info__graphic"),children:[c?(0,ds.jsx)("img",{className:Ss(s?.avatar?"avatar":"icon"),src:c,alt:""}):(0,ds.jsx)(Hs,{name:"avatar",size:"32",alt:""}),(0,ds.jsx)("span",{className:Ss(u),"aria-hidden":"true",children:r})]}),(0,ds.jsxs)("div",{className:Ss("agent-info__body"),children:[(0,ds.jsx)("p",{className:Ss("agent-info__heading"),children:t??e("header.title")}),(0,ds.jsx)("p",{className:Ss("agent-info__text"),children:l})]})]}):null},il=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=dn(),r=(0,Lo.useRef)(null),{t:o}=qo();return(0,ds.jsxs)("header",{className:Ss("chat__header"),children:[e,(0,ds.jsx)("div",{className:Ss("header-controls"),children:(0,ds.jsx)("button",{type:"button",className:Ss("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,ds.jsx)(Hs,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},cl=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce((e,[t,n])=>({...e,[t]:n}),{})},ll=e=>new URLSearchParams(e).toString(),ul=(...e)=>{const t=new URL(window.location.href);return e.reduce((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e},{})},dl=(...e)=>{const t=new URL(window.location.href),n=e.reduce((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e},new URLSearchParams),r=new URLSearchParams({...Object.fromEntries(t.searchParams),...Object.fromEntries(n)});return r.toString()&&window.history.replaceState(null,"",`?${r}`),ul(...n.keys())},pl=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach(e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)}),window.location.href=n.toString()})},fl=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 el(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),module.exports=r})();
|
|
2
|
+
(()=>{var e={34:(e,t,n)=>{"use strict";var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},81:(e,t,n)=>{"use strict";var r=n(9565),o=n(9306),s=n(8551),a=n(6823),i=n(851),c=TypeError;e.exports=function(e,t){var n=arguments.length<2?i(e):t;if(o(n))return s(r(n,e));throw new c(a(e)+" is not iterable")}},116:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("find",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{find:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r(t)},{IS_RECORD:!0,INTERRUPTED:!0}).result}})},283:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(4901),a=n(9297),i=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,p=u.get,f=String,h=Object.defineProperty,m=r("".slice),y=r("".replace),v=r([].join),g=i&&!o(function(){return 8!==h(function(){},"length",{value:8}).length}),b=String(String).split("String"),x=e.exports=function(e,t,n){"Symbol("===m(f(t),0,7)&&(t="["+y(f(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(i?h(e,"name",{value:t,configurable:!0}):e.name=t),g&&n&&a(n,"arity")&&e.length!==n.arity&&h(e,"length",{value:n.arity});try{n&&a(n,"constructor")&&n.constructor?i&&h(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return a(r,"source")||(r.source=v(b,"string"==typeof t?t:"")),e};Function.prototype.toString=x(function(){return s(this)&&p(this).source||l(this)},"toString")},350:(e,t,n)=>{"use strict";var r=n(3724),o=n(9297),s=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,i=o(s,"name"),c=i&&"something"===function(){}.name,l=i&&(!r||r&&a(s,"name").configurable);e.exports={EXISTS:i,PROPER:c,CONFIGURABLE:l}},397:(e,t,n)=>{"use strict";var r=n(7751);e.exports=r("document","documentElement")},421:e=>{"use strict";e.exports={}},507:(e,t,n)=>{"use strict";var r=n(9565);e.exports=function(e,t,n){for(var o,s,a=n?e:e.iterator,i=e.next;!(o=r(i,a)).done;)if(void 0!==(s=t(o.value)))return s}},616:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},655:(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)}},679:(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")}},684:e=>{"use strict";e.exports=function(e,t){var n="function"==typeof Iterator&&Iterator.prototype[e];if(n)try{n.call({next:null},t).next()}catch(e){return!0}}},741: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)}},757:(e,t,n)=>{"use strict";var r=n(7751),o=n(4901),s=n(1625),a=n(7040),i=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return o(t)&&s(t.prototype,i(e))}},851:(e,t,n)=>{"use strict";var r=n(6955),o=n(5966),s=n(4117),a=n(6269),i=n(8227)("iterator");e.exports=function(e){if(!s(e))return o(e,i)||o(e,"@@iterator")||a[r(e)]}},1072:(e,t,n)=>{"use strict";var r=n(1828),o=n(8727);e.exports=Object.keys||function(e){return r(e,o)}},1148:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("every",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{every:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return!s(t,function(t,r){if(!e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},1162:e=>{"use strict";e.exports=require("preact/hooks")},1181:(e,t,n)=>{"use strict";var r,o,s,a=n(8622),i=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),p=n(6119),f=n(421),h="Object already initialized",m=i.TypeError,y=i.WeakMap;if(a||d.state){var v=d.state||(d.state=new y);v.get=v.get,v.has=v.has,v.set=v.set,r=function(e,t){if(v.has(e))throw new m(h);return t.facade=e,v.set(e,t),t},o=function(e){return v.get(e)||{}},s=function(e){return v.has(e)}}else{var g=p("state");f[g]=!0,r=function(e,t){if(u(e,g))throw new m(h);return t.facade=e,l(e,g,t),t},o=function(e){return u(e,g)?e[g]:{}},s=function(e){return u(e,g)}}e.exports={set:r,get:o,has:s,enforce:function(e){return s(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}}}},1291:(e,t,n)=>{"use strict";var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},1385:(e,t,n)=>{"use strict";var r=n(9539);e.exports=function(e,t,n){for(var o=e.length-1;o>=0;o--)if(void 0!==e[o])try{n=r(e[o].iterator,t,n)}catch(e){t="throw",n=e}if("throw"===t)throw n;return n}},1454:(e,t,n)=>{"use strict";n(1701)},1625:(e,t,n)=>{"use strict";var r=n(9504);e.exports=r({}.isPrototypeOf)},1698:(e,t,n)=>{"use strict";var r=n(6518),o=n(4204),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("union")||!s("union")},{union:o})},1701:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(9539),d=n(684),p=n(4549),f=n(6395),h=!f&&!d("map",function(){}),m=!f&&!h&&p("map",TypeError),y=f||h||m,v=c(function(){var e=this.iterator,t=a(o(this.next,e));if(!(this.done=!!t.done))return l(e,this.mapper,[t.value,this.counter++],!0)});r({target:"Iterator",proto:!0,real:!0,forced:y},{map:function(e){a(this);try{s(e)}catch(e){u(this,"throw",e)}return m?o(m,this,e):new v(i(this),{mapper:e})}})},1767:e=>{"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:(e,t,n)=>{"use strict";var r=n(9504),o=n(9297),s=n(5397),a=n(9617).indexOf,i=n(421),c=r([].push);e.exports=function(e,t){var n,r=s(e),l=0,u=[];for(n in r)!o(i,n)&&o(r,n)&&c(u,n);for(;t.length>l;)o(r,n=t[l++])&&(~a(u,n)||c(u,n));return u}},2086: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 s=t[r]||n,a=s.length=o?s.length:0;a--;)o==s[a][0]&&s.splice(a,1);return e},e.emit=function(r){for(var o,s=t[r]||n,a=s.length>0?s.slice(0,s.length):s,i=0;o=a[i++];)o[0].apply(o[1],n.slice.call(arguments,1));return e}}},2106:(e,t,n)=>{"use strict";var r=n(283),o=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),o.f(e,t,n)}},2140:(e,t,n)=>{"use strict";var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},2195:(e,t,n)=>{"use strict";var r=n(9504),o=r({}.toString),s=r("".slice);e.exports=function(e){return s(o(e),8,-1)}},2211:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},2360:(e,t,n)=>{"use strict";var r,o=n(8551),s=n(6801),a=n(8727),i=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",p="script",f=u("IE_PROTO"),h=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},y=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},v=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;v="undefined"!=typeof document?document.domain&&r?y(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):y(r);for(var o=a.length;o--;)delete v[d][a[o]];return v()};i[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(h[d]=o(e),n=new h,h[d]=null,n[f]=e):n=v(),void 0===t?n:s.f(n,t)}},2475:(e,t,n)=>{"use strict";var r=n(6518),o=n(8527);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSupersetOf",function(e){return!e})},{isSupersetOf:o})},2489:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(9306),a=n(8551),i=n(1767),c=n(9462),l=n(6319),u=n(6395),d=n(9539),p=n(684),f=n(4549),h=!u&&!p("filter",function(){}),m=!u&&!h&&f("filter",TypeError),y=u||h||m,v=c(function(){for(var e,t,n=this.iterator,r=this.predicate,s=this.next;;){if(e=a(o(s,n)),this.done=!!e.done)return;if(t=e.value,l(n,r,[t,this.counter++],!0))return t}});r({target:"Iterator",proto:!0,real:!0,forced:y},{filter:function(e){a(this);try{s(e)}catch(e){d(this,"throw",e)}return m?o(m,this,e):new v(i(this),{predicate:e})}})},2529:e=>{"use strict";e.exports=function(e,t){return{value:e,done:t}}},2577:(e,t,n)=>{"use strict";n(116)},2652:(e,t,n)=>{"use strict";var r=n(6080),o=n(9565),s=n(8551),a=n(6823),i=n(4209),c=n(6198),l=n(1625),u=n(81),d=n(851),p=n(9539),f=TypeError,h=function(e,t){this.stopped=e,this.result=t},m=h.prototype;e.exports=function(e,t,n){var y,v,g,b,x,w,_,C=n&&n.that,S=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_RECORD),j=!(!n||!n.IS_ITERATOR),T=!(!n||!n.INTERRUPTED),I=r(t,C),N=function(e){return y&&p(y,"normal"),new h(!0,e)},k=function(e){return S?(s(e),T?I(e[0],e[1],N):I(e[0],e[1])):T?I(e,N):I(e)};if(E)y=e.iterator;else if(j)y=e;else{if(!(v=d(e)))throw new f(a(e)+" is not iterable");if(i(v)){for(g=0,b=c(e);b>g;g++)if((x=k(e[g]))&&l(m,x))return x;return new h(!1)}y=u(e,v)}for(w=E?e.next:y.next;!(_=o(w,y)).done;){try{x=k(_.value)}catch(e){p(y,"throw",e)}if("object"==typeof x&&x&&l(m,x))return x}return new h(!1)}},2777:(e,t,n)=>{"use strict";var r=n(9565),o=n(34),s=n(757),a=n(5966),i=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!o(e)||s(e))return e;var n,c=a(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!o(n)||s(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},2787:(e,t,n)=>{"use strict";var r=n(9297),o=n(4901),s=n(8981),a=n(6119),i=n(2211),c=a("IE_PROTO"),l=Object,u=l.prototype;e.exports=i?l.getPrototypeOf:function(e){var t=s(e);if(r(t,c))return t[c];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},2796:(e,t,n)=>{"use strict";var r=n(9039),o=n(4901),s=/#|\.prototype\./,a=function(e,t){var n=c[i(e)];return n===u||n!==l&&(o(t)?r(t):!!t)},i=a.normalize=function(e){return String(e).replace(s,".").toLowerCase()},c=a.data={},l=a.NATIVE="N",u=a.POLYFILL="P";e.exports=a},2812:e=>{"use strict";var t=TypeError;e.exports=function(e,n){if(e<n)throw new t("Not enough arguments");return e}},2839:(e,t,n)=>{"use strict";var r=n(4576).navigator,o=r&&r.userAgent;e.exports=o?String(o):""},3215:(e,t,n)=>{"use strict";n(1148)},3375:(e,t,n)=>{"use strict";n(7642)},3392:(e,t,n)=>{"use strict";var r=n(9504),o=0,s=Math.random(),a=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+s,36)}},3440:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(5170),i=n(3789),c=n(8469),l=n(507),u=o.has,d=o.remove;e.exports=function(e){var t=r(this),n=i(e),o=s(t);return a(t)<=n.size?c(t,function(e){n.includes(e)&&d(o,e)}):l(n.getIterator(),function(e){u(o,e)&&d(o,e)}),o}},3579:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("some",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{some:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;return s(t,function(t,r){if(e(t,n++))return r()},{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},3650:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(9286),a=n(3789),i=n(507),c=o.add,l=o.has,u=o.remove;e.exports=function(e){var t=r(this),n=a(e).getIterator(),o=s(t);return i(n,function(e){l(t,e)?u(o,e):c(o,e)}),o}},3706:(e,t,n)=>{"use strict";var r=n(9504),o=n(4901),s=n(7629),a=r(Function.toString);o(s.inspectSource)||(s.inspectSource=function(e){return a(e)}),e.exports=s.inspectSource},3717:(e,t)=>{"use strict";t.f=Object.getOwnPropertySymbols},3724:(e,t,n)=>{"use strict";var r=n(9039);e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},3789:(e,t,n)=>{"use strict";var r=n(9306),o=n(8551),s=n(9565),a=n(1291),i=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 i(o(s(this.keys,this.set)))},includes:function(e){return s(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)}},3838:(e,t,n)=>{"use strict";var r=n(7080),o=n(5170),s=n(8469),a=n(3789);e.exports=function(e){var t=r(this),n=a(e);return!(o(t)>n.size)&&!1!==s(t,function(e){if(!n.includes(e))return!1},!0)}},3853:(e,t,n)=>{"use strict";var r=n(6518),o=n(4449);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isDisjointFrom",function(e){return!e})},{isDisjointFrom:o})},3949:(e,t,n)=>{"use strict";n(7588)},3972:(e,t,n)=>{"use strict";n(3853)},4055:(e,t,n)=>{"use strict";var r=n(4576),o=n(34),s=r.document,a=o(s)&&o(s.createElement);e.exports=function(e){return a?s.createElement(e):{}}},4114:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(4527),i=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=s(t),r=arguments.length;i(n+r);for(var c=0;c<r;c++)t[n]=arguments[c],n++;return a(t,n),n}})},4117:e=>{"use strict";e.exports=function(e){return null==e}},4204:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).add,s=n(9286),a=n(3789),i=n(507);e.exports=function(e){var t=r(this),n=a(e).getIterator(),c=s(t);return i(n,function(e){o(c,e)}),c}},4209:(e,t,n)=>{"use strict";var r=n(8227),o=n(6269),s=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[s]===e)}},4270:(e,t,n)=>{"use strict";var r=n(9565),o=n(4901),s=n(34),a=TypeError;e.exports=function(e,t){var n,i;if("string"===t&&o(n=e.toString)&&!s(i=r(n,e)))return i;if(o(n=e.valueOf)&&!s(i=r(n,e)))return i;if("string"!==t&&o(n=e.toString)&&!s(i=r(n,e)))return i;throw new a("Can't convert object to primitive value")}},4376:(e,t,n)=>{"use strict";var r=n(2195);e.exports=Array.isArray||function(e){return"Array"===r(e)}},4402:(e,t,n)=>{"use strict";var r=n(9504),o=Set.prototype;e.exports={Set,add:r(o.add),has:r(o.has),remove:r(o.delete),proto:o}},4449:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(8469),c=n(507),l=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<=n.size)return!1!==i(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)})}},4495:(e,t,n)=>{"use strict";var r=n(9519),o=n(9039),s=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o(function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},4520:(e,t,n)=>{"use strict";n(2489)},4527:(e,t,n)=>{"use strict";var r=n(3724),o=n(4376),s=TypeError,a=Object.getOwnPropertyDescriptor,i=r&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=i?function(e,t){if(o(e)&&!a(e,"length").writable)throw new s("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4549:(e,t,n)=>{"use strict";var r=n(4576);e.exports=function(e,t){var n=r.Iterator,o=n&&n.prototype,s=o&&o[e],a=!1;if(s)try{s.call({next:function(){return{done:!0}},return:function(){a=!0}},-1)}catch(e){e instanceof t||(a=!1)}if(!a)return s}},4576: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")()},4603:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.append),u=o(c.delete),d=o(c.forEach),p=o([].push),f=new i("a=1&a=2&b=3");f.delete("a",1),f.delete("b",void 0),f+""!="a=2"&&r(c,"delete",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=[];d(this,function(e,t){p(r,{key:t,value:e})}),a(t,1);for(var o,i=s(e),c=s(n),f=0,h=0,m=!1,y=r.length;f<y;)o=r[f++],m||o.key===i?(m=!0,u(this,o.key)):h++;for(;h<y;)(o=r[h++]).key===i&&o.value===c||l(this,o.key,o.value)},{enumerable:!0,unsafe:!0})},4659:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=function(e,t,n){r?o.f(e,t,s(0,n)):e[t]=n}},4901: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}},4913:(e,t,n)=>{"use strict";var r=n(3724),o=n(5917),s=n(8686),a=n(8551),i=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",f="writable";t.f=r?s?function(e,t,n){if(a(e),t=i(t),a(n),"function"==typeof e&&"prototype"===t&&"value"in n&&f in n&&!n[f]){var r=u(e,t);r&&r[f]&&(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=i(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}},4916:(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}}}}}},s=function(e){return{size:e,has:function(){return!0},keys:function(){throw new Error("e")}}};e.exports=function(e,t){var n=r("Set");try{(new n)[e](o(0));try{return(new n)[e](o(-1)),!1}catch(r){if(!t)return!0;try{return(new n)[e](s(-1/0)),!1}catch(r){var a=new n;return a.add(1),a.add(2),t(a[e](s(1/0)))}}}catch(e){return!1}}},5024:(e,t,n)=>{"use strict";var r=n(6518),o=n(3650),s=n(9835);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("symmetricDifference")||!s("symmetricDifference")},{symmetricDifference:o})},5031:(e,t,n)=>{"use strict";var r=n(7751),o=n(9504),s=n(8480),a=n(3717),i=n(8551),c=o([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=s.f(i(e)),n=a.f;return n?c(t,n(e)):t}},5160:(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},s=r.useSyncExternalStore,a=r.useRef,i=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(!i){if(i=!0,s=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(s,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(s=e,t):(s=e,a=n)}var s,a,i=!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 f=s(e,d[0],d[1]);return i(function(){p.hasValue=!0,p.value=f},[f]),l(f),f}},5170:(e,t,n)=>{"use strict";var r=n(6706),o=n(4402);e.exports=r(o.proto,"size","get")||function(e){return e.size}},5397:(e,t,n)=>{"use strict";var r=n(7055),o=n(7750);e.exports=function(e){return r(o(e))}},5610:(e,t,n)=>{"use strict";var r=n(1291),o=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):s(n,t)}},5714:(e,t,n)=>{"use strict";n(2475)},5745:(e,t,n)=>{"use strict";var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},5876:(e,t,n)=>{"use strict";var r=n(6518),o=n(3838);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("isSubsetOf",function(e){return e})},{isSubsetOf:o})},5917:(e,t,n)=>{"use strict";var r=n(3724),o=n(9039),s=n(4055);e.exports=!r&&!o(function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},5966:(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)}},6080:(e,t,n)=>{"use strict";var r=n(7476),o=n(9306),s=n(616),a=r(r.bind);e.exports=function(e,t){return o(e),void 0===t?e:s?a(e,t):function(){return e.apply(t,arguments)}}},6119:(e,t,n)=>{"use strict";var r=n(5745),o=n(3392),s=r("keys");e.exports=function(e){return s[e]||(s[e]=o(e))}},6197:(e,t,n)=>{"use strict";n(1698)},6198:(e,t,n)=>{"use strict";var r=n(8014);e.exports=function(e){return r(e.length)}},6269:e=>{"use strict";e.exports={}},6279:(e,t,n)=>{"use strict";var r=n(6840);e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},6319:(e,t,n)=>{"use strict";var r=n(8551),o=n(9539);e.exports=function(e,t,n,s){try{return s?t(r(n)[0],n[1]):t(n)}catch(t){o(e,"throw",t)}}},6395:e=>{"use strict";e.exports=!1},6469:(e,t,n)=>{"use strict";var r=n(8227),o=n(2360),s=n(4913).f,a=r("unscopables"),i=Array.prototype;void 0===i[a]&&s(i,a,{configurable:!0,value:o(null)}),e.exports=function(e){i[a][e]=!0}},6518:(e,t,n)=>{"use strict";var r=n(4576),o=n(7347).f,s=n(6699),a=n(6840),i=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,p,f,h=e.target,m=e.global,y=e.stat;if(n=m?r:y?r[h]||i(h,{}):r[h]&&r[h].prototype)for(u in t){if(p=t[u],d=e.dontCallGetSet?(f=o(n,u))&&f.value:n[u],!l(m?u:h+(y?".":"#")+u,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&s(p,"sham",!0),a(n,u,p,e)}}},6699:(e,t,n)=>{"use strict";var r=n(3724),o=n(4913),s=n(6980);e.exports=r?function(e,t,n){return o.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},6706:(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){}}},6801:(e,t,n)=>{"use strict";var r=n(3724),o=n(8686),s=n(4913),a=n(8551),i=n(5397),c=n(1072);t.f=r&&!o?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),o=c(t),l=o.length,u=0;l>u;)s.f(e,n=o[u++],r[n]);return e}},6823:e=>{"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:e=>{"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:(e,t,n)=>{"use strict";var r=n(4901),o=n(4913),s=n(283),a=n(9433);e.exports=function(e,t,n,i){i||(i={});var c=i.enumerable,l=void 0!==i.name?i.name:t;if(r(n)&&s(n,l,i),i.global)c?e[t]=n:a(t,n);else{try{i.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:o.f(e,t,{value:n,enumerable:!1,configurable:!i.nonConfigurable,writable:!i.nonWritable})}return e}},6955:(e,t,n)=>{"use strict";var r=n(2140),o=n(4901),s=n(2195),a=n(8227)("toStringTag"),i=Object,c="Arguments"===s(function(){return arguments}());e.exports=r?s: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=i(e),a))?n:c?s(t):"Object"===(r=s(t))&&o(t.callee)?"Arguments":r}},6969:(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+""}},6980:e=>{"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7015:(e,t,n)=>{"use strict";var r=n(4576),o=n(9504);e.exports=function(e,t){return o(r[e].prototype[t])}},7040:(e,t,n)=>{"use strict";var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(e,t,n)=>{"use strict";var r=n(9504),o=n(9039),s=n(2195),a=Object,i=r("".split);e.exports=o(function(){return!a("z").propertyIsEnumerable(0)})?function(e){return"String"===s(e)?i(e,""):a(e)}:a},7080:(e,t,n)=>{"use strict";var r=n(4402).has;e.exports=function(e){return r(e),e}},7347:(e,t,n)=>{"use strict";var r=n(3724),o=n(9565),s=n(8773),a=n(6980),i=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=i(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return a(!o(s.f,e,t),e[t])}},7402:(e,t,n)=>{"use strict";n.r(t),n.d(t,{Children:()=>x,Component:()=>r.Component,Fragment:()=>r.Fragment,PureComponent:()=>h,StrictMode:()=>ie,Suspense:()=>E,SuspenseList:()=>I,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:()=>X,cloneElement:()=>ne,createContext:()=>r.createContext,createElement:()=>r.createElement,createFactory:()=>Q,createPortal:()=>L,createRef:()=>r.createRef,default:()=>le,findDOMNode:()=>oe,flushSync:()=>ae,forwardRef:()=>g,hydrate:()=>z,isElement:()=>ce,isFragment:()=>ee,isMemo:()=>te,isValidElement:()=>Z,lazy:()=>T,memo:()=>m,render:()=>F,startTransition:()=>u,unmountComponentAtNode:()=>re,unstable_batchedUpdates:()=>se,useDeferredValue:()=>d,useInsertionEffect:()=>f,useSyncExternalStore:()=>c,useTransition:()=>p,version:()=>Y});var r=n(8785),o=n(1162),s={};for(const e in o)["default","Component","Fragment","createContext","createElement","createRef","Children","PureComponent","StrictMode","Suspense","SuspenseList","__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED","cloneElement","createFactory","createPortal","findDOMNode","flushSync","forwardRef","hydrate","isElement","isFragment","isMemo","isValidElement","lazy","memo","render","startTransition","unmountComponentAtNode","unstable_batchedUpdates","useDeferredValue","useInsertionEffect","useSyncExternalStore","useTransition","version"].indexOf(e)<0&&(s[e]=()=>o[e]);function a(e,t){for(var n in t)e[n]=t[n];return e}function i(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 c(e,t){var n=t(),r=(0,o.useState)({t:{__:n,u:t}}),s=r[0].t,a=r[1];return(0,o.useLayoutEffect)(function(){s.__=n,s.u=t,l(s)&&a({t:s})},[e,n,t]),(0,o.useEffect)(function(){return l(s)&&a({t:s}),e(function(){l(s)&&a({t:s})})},[e]),n}function l(e){var t,n,r=e.u,o=e.__;try{var s=r();return!((t=o)===(n=s)&&(0!==t||1/t==1/n)||t!=t&&n!=n)}catch(e){return!0}}function u(e){e()}function d(e){return e}function p(){return[!1,u]}n.d(t,s);var f=o.useLayoutEffect;function h(e,t){this.props=e,this.context=t}function m(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:i(this.props,e)}function o(t){return this.shouldComponentUpdate=n,(0,r.createElement)(e,t)}return o.displayName="Memo("+(e.displayName||e.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o.type=e,o}(h.prototype=new r.Component).isPureReactComponent=!0,h.prototype.shouldComponentUpdate=function(e,t){return i(this.props,e)||i(this.state,t)};var y=r.options.__b;r.options.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),y&&y(e)};var v="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function g(e){function t(t){var n=a({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=v,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t}var b=function(e,t){return null==e?null:(0,r.toChildArray)((0,r.toChildArray)(e).map(t))},x={map:b,forEach:b,count:function(e){return e?(0,r.toChildArray)(e).length:0},only:function(e){var t=(0,r.toChildArray)(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:r.toChildArray},w=r.options.__e;r.options.__e=function(e,t,n,r){if(e.then)for(var o,s=t;s=s.__;)if((o=s.__c)&&o.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t);w(e,t,n,r)};var _=r.options.unmount;function C(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=a({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return C(e,t,n)})),e}function S(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return S(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 E(){this.__u=0,this.o=null,this.__b=null}function j(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function T(e){var t,n,o;function s(s){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.createElement)(n,s)}return s.displayName="Lazy",s.__f=!0,s}function I(){this.i=null,this.l=null}r.options.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),_&&_(e)},(E.prototype=new r.Component).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var o=j(r.__v),s=!1,a=function(){s||(s=!0,n.__R=null,o?o(i):i())};n.__R=a;var i=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=S(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(a,a)},E.prototype.componentWillUnmount=function(){this.o=[]},E.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]=C(this.__b,n,o.__O=o.__P)}this.__b=null}var s=t.__a&&(0,r.createElement)(r.Fragment,null,e.fallback);return s&&(s.__u&=-33),[(0,r.createElement)(r.Fragment,null,t.__a?null:e.children),s]};var N=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function k(e){return this.getChildContext=function(){return e.context},e.children}function O(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){(0,r.render)(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var o=t.__v;null!==o&&!o.__m&&null!==o.__;)o=o.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}(0,r.render)((0,r.createElement)(k,{context:t.context},e.__v),t.v)}function L(e,t){var n=(0,r.createElement)(O,{__v:e,h:t});return n.containerInfo=t,n}(I.prototype=new r.Component).__a=function(e){var t=this,n=j(t.__v),r=t.l.get(e);return r[0]++,function(o){var s=function(){t.props.revealOrder?(r.push(o),N(t,e,r)):o()};n?n(s):s()}},I.prototype.render=function(e){this.i=null,this.l=new Map;var t=(0,r.toChildArray)(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},I.prototype.componentDidUpdate=I.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){N(e,n,t)})};var R="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,A=/^(?: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]/,P=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,M=/[A-Z0-9]/g,U="undefined"!=typeof document,D=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};function F(e,t,n){return null==t.__k&&(t.textContent=""),(0,r.render)(e,t),"function"==typeof n&&n(),e?e.__c:null}function z(e,t,n){return(0,r.hydrate)(e,t),"function"==typeof n&&n(),e?e.__c:null}r.Component.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(r.Component.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var B=r.options.event;function V(){}function $(){return this.cancelBubble}function H(){return this.defaultPrevented}r.options.event=function(e){return B&&(e=B(e)),e.persist=V,e.isPropagationStopped=$,e.isDefaultPrevented=H,e.nativeEvent=e};var W,G={enumerable:!1,configurable:!0,get:function(){return this.class}},q=r.options.vnode;r.options.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,o={},s=-1===n.indexOf("-");for(var a in t){var i=t[a];if(!("value"===a&&"defaultValue"in t&&null==i||U&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var c=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===i?i="":"translate"===c&&"no"===i?i=!1:"o"===c[0]&&"n"===c[1]?"ondoubleclick"===c?a="ondblclick":"onchange"!==c||"input"!==n&&"textarea"!==n||D(t.type)?"onfocus"===c?a="onfocusin":"onblur"===c?a="onfocusout":P.test(a)&&(a=c):c=a="oninput":s&&A.test(a)?a=a.replace(M,"-$&").toLowerCase():null===i&&(i=void 0),"oninput"===c&&o[a=c]&&(a="oninputCapture"),o[a]=i}}"select"==n&&o.multiple&&Array.isArray(o.value)&&(o.value=(0,r.toChildArray)(t.children).forEach(function(e){e.props.selected=-1!=o.value.indexOf(e.props.value)})),"select"==n&&null!=o.defaultValue&&(o.value=(0,r.toChildArray)(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",G)):(t.className&&!t.class||t.class&&t.className)&&(o.class=o.className=t.className),e.props=o}(e),e.$$typeof=R,q&&q(e)};var K=r.options.__r;r.options.__r=function(e){K&&K(e),W=e.__c};var J=r.options.diffed;r.options.diffed=function(e){J&&J(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),W=null};var X={ReactCurrentDispatcher:{current:{readContext:function(e){return W.__n[e.__c].props.value},useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,useDeferredValue:d,useEffect:o.useEffect,useId:o.useId,useImperativeHandle:o.useImperativeHandle,useInsertionEffect:f,useLayoutEffect:o.useLayoutEffect,useMemo:o.useMemo,useReducer:o.useReducer,useRef:o.useRef,useState:o.useState,useSyncExternalStore:c,useTransition:p}}},Y="18.3.1";function Q(e){return r.createElement.bind(null,e)}function Z(e){return!!e&&e.$$typeof===R}function ee(e){return Z(e)&&e.type===r.Fragment}function te(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")}function ne(e){return Z(e)?r.cloneElement.apply(null,arguments):e}function re(e){return!!e.__k&&((0,r.render)(null,e),!0)}function oe(e){return e&&(e.base||1===e.nodeType&&e)||null}var se=function(e,t){return e(t)},ae=function(e,t){return e(t)},ie=r.Fragment,ce=Z,le={useState:o.useState,useId:o.useId,useReducer:o.useReducer,useEffect:o.useEffect,useLayoutEffect:o.useLayoutEffect,useInsertionEffect:f,useTransition:p,useDeferredValue:d,useSyncExternalStore:c,startTransition:u,useRef:o.useRef,useImperativeHandle:o.useImperativeHandle,useMemo:o.useMemo,useCallback:o.useCallback,useContext:o.useContext,useDebugValue:o.useDebugValue,version:"18.3.1",Children:x,render:F,hydrate:z,unmountComponentAtNode:re,createPortal:L,createElement:r.createElement,createContext:r.createContext,createFactory:Q,cloneElement:ne,createRef:r.createRef,Fragment:r.Fragment,isValidElement:Z,isElement:ce,isFragment:ee,isMemo:te,findDOMNode:oe,Component:r.Component,PureComponent:h,memo:m,forwardRef:g,flushSync:ae,unstable_batchedUpdates:se,StrictMode:ie,Suspense:E,SuspenseList:I,lazy:T,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:X}},7476:(e,t,n)=>{"use strict";var r=n(2195),o=n(9504);e.exports=function(e){if("Function"===r(e))return o(e)}},7550:(e,t,n)=>{"use strict";n(3579)},7561:(e,t,n)=>{"use strict";n(5024)},7566:(e,t,n)=>{"use strict";var r=n(6840),o=n(9504),s=n(655),a=n(2812),i=URLSearchParams,c=i.prototype,l=o(c.getAll),u=o(c.has),d=new i("a=1");!d.has("a",2)&&d.has("a",void 0)||r(c,"has",function(e){var t=arguments.length,n=t<2?void 0:arguments[1];if(t&&void 0===n)return u(this,e);var r=l(this,e);a(t,1);for(var o=s(n),i=0;i<r.length;)if(r[i++]===o)return!0;return!1},{enumerable:!0,unsafe:!0})},7588:(e,t,n)=>{"use strict";var r=n(6518),o=n(9565),s=n(2652),a=n(9306),i=n(8551),c=n(1767),l=n(9539),u=n(4549)("forEach",TypeError);r({target:"Iterator",proto:!0,real:!0,forced:u},{forEach:function(e){i(this);try{a(e)}catch(e){l(this,"throw",e)}if(u)return o(u,this,e);var t=c(this),n=0;s(t,function(t){e(t,n++)},{IS_RECORD:!0})}})},7629:(e,t,n)=>{"use strict";var r=n(6395),o=n(4576),s=n(9433),a="__core-js_shared__",i=e.exports=o[a]||s(a,{});(i.versions||(i.versions=[])).push({version:"3.46.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.46.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7642:(e,t,n)=>{"use strict";var r=n(6518),o=n(3440),s=n(9039);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("difference",function(e){return 0===e.size})||s(function(){var e={size:1,has:function(){return!0},keys:function(){var e=0;return{next:function(){var n=e++>1;return t.has(1)&&t.clear(),{done:n,value:2}}}}},t=new Set([1,2,3,4]);return 3!==t.difference(e).size})},{difference:o})},7657:(e,t,n)=>{"use strict";var r,o,s,a=n(9039),i=n(4901),c=n(34),l=n(2360),u=n(2787),d=n(6840),p=n(8227),f=n(6395),h=p("iterator"),m=!1;[].keys&&("next"in(s=[].keys())?(o=u(u(s)))!==Object.prototype&&(r=o):m=!0),!c(r)||a(function(){var e={};return r[h].call(e)!==e})?r={}:f&&(r=l(r)),i(r[h])||d(r,h,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:m}},7740:(e,t,n)=>{"use strict";var r=n(9297),o=n(5031),s=n(7347),a=n(4913);e.exports=function(e,t,n){for(var i=o(t),c=a.f,l=s.f,u=0;u<i.length;u++){var d=i[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},7750:(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}},7751:(e,t,n)=>{"use strict";var r=n(4576),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}},8004:(e,t,n)=>{"use strict";var r=n(6518),o=n(9039),s=n(8750);r({target:"Set",proto:!0,real:!0,forced:!n(4916)("intersection",function(e){return 2===e.size&&e.has(1)&&e.has(2)})||o(function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))})},{intersection:s})},8014:(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}},8107:(e,t,n)=>{"use strict";var r=n(6518),o=n(8981),s=n(6198),a=n(1291),i=n(6469);r({target:"Array",proto:!0},{at:function(e){var t=o(this),n=s(t),r=a(e),i=r>=0?r:n+r;return i<0||i>=n?void 0:t[i]}}),i("at")},8111:(e,t,n)=>{"use strict";var r=n(6518),o=n(4576),s=n(679),a=n(8551),i=n(4901),c=n(2787),l=n(2106),u=n(4659),d=n(9039),p=n(9297),f=n(8227),h=n(7657).IteratorPrototype,m=n(3724),y=n(6395),v="constructor",g="Iterator",b=f("toStringTag"),x=TypeError,w=o[g],_=y||!i(w)||w.prototype!==h||!d(function(){w({})}),C=function(){if(s(this,h),c(this)===h)throw new x("Abstract class Iterator not directly constructable")},S=function(e,t){m?l(h,e,{configurable:!0,get:function(){return t},set:function(t){if(a(this),this===h)throw new x("You can't redefine this property");p(this,e)?this[e]=t:u(this,e,t)}}):h[e]=t};p(h,b)||S(b,g),!_&&p(h,v)&&h[v]!==Object||S(v,C),C.prototype=h,r({global:!0,constructor:!0,forced:_},{Iterator:C})},8227:(e,t,n)=>{"use strict";var r=n(4576),o=n(5745),s=n(9297),a=n(3392),i=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 s(u,e)||(u[e]=i&&s(l,e)?l[e]:d("Symbol."+e)),u[e]}},8237:(e,t,n)=>{"use strict";var r=n(6518),o=n(2652),s=n(9306),a=n(8551),i=n(1767),c=n(9539),l=n(4549),u=n(8745),d=n(9039),p=TypeError,f=d(function(){[].keys().reduce(function(){},void 0)}),h=!f&&l("reduce",p);r({target:"Iterator",proto:!0,real:!0,forced:f||h},{reduce:function(e){a(this);try{s(e)}catch(e){c(this,"throw",e)}var t=arguments.length<2,n=t?void 0:arguments[1];if(h)return u(h,this,t?[e]:[e,n]);var r=i(this),l=0;if(o(r,function(r){t?(t=!1,n=r):n=e(n,r,l),l++},{IS_RECORD:!0}),t)throw new p("Reduce of empty iterator with no initial value");return n}})},8418:(e,t,n)=>{"use strict";e.exports=n(5160)},8469:(e,t,n)=>{"use strict";var r=n(9504),o=n(507),s=n(4402),a=s.Set,i=s.proto,c=r(i.forEach),l=r(i.keys),u=l(new a).next;e.exports=function(e,t,n){return n?o({iterator:l(e),next:u},t):c(e,t)}},8480:(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)}},8527:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402).has,s=n(5170),a=n(3789),i=n(507),c=n(9539);e.exports=function(e){var t=r(this),n=a(e);if(s(t)<n.size)return!1;var l=n.getIterator();return!1!==i(l,function(e){if(!o(t,e))return c(l,"normal",!1)})}},8551:(e,t,n)=>{"use strict";var r=n(34),o=String,s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not an object")}},8622:(e,t,n)=>{"use strict";var r=n(4576),o=n(4901),s=r.WeakMap;e.exports=o(s)&&/native code/.test(String(s))},8686:(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})},8721:(e,t,n)=>{"use strict";var r=n(3724),o=n(9504),s=n(2106),a=URLSearchParams.prototype,i=o(a.forEach);r&&!("size"in a)&&s(a,"size",{get:function(){var e=0;return i(this,function(){e++}),e},configurable:!0,enumerable:!0})},8727:e=>{"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(s):function(){return a.apply(s,arguments)})},8750:(e,t,n)=>{"use strict";var r=n(7080),o=n(4402),s=n(5170),a=n(3789),i=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 s(t)>n.size?c(n.getIterator(),function(e){d(t,e)&&u(o,e)}):i(t,function(e){n.includes(e)&&u(o,e)}),o}},8773:(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},8785:e=>{"use strict";e.exports=require("preact")},8872:(e,t,n)=>{"use strict";n(8237)},8981:(e,t,n)=>{"use strict";var r=n(7750),o=Object;e.exports=function(e){return o(r(e))}},8992:(e,t,n)=>{"use strict";n(8111)},9039:e=>{"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9209:(e,t,n)=>{"use strict";n(5876)},9225:(e,t,n)=>{"use strict";n(8004)},9286:(e,t,n)=>{"use strict";var r=n(4402),o=n(8469),s=r.Set,a=r.add;e.exports=function(e){var t=new s;return o(e,function(e){a(t,e)}),t}},9297:(e,t,n)=>{"use strict";var r=n(9504),o=n(8981),s=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(o(e),t)}},9306:(e,t,n)=>{"use strict";var r=n(4901),o=n(6823),s=TypeError;e.exports=function(e){if(r(e))return e;throw new s(o(e)+" is not a function")}},9433:(e,t,n)=>{"use strict";var r=n(4576),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}},9462:(e,t,n)=>{"use strict";var r=n(9565),o=n(2360),s=n(6699),a=n(6279),i=n(8227),c=n(1181),l=n(5966),u=n(7657).IteratorPrototype,d=n(2529),p=n(9539),f=n(1385),h=i("toStringTag"),m="IteratorHelper",y="WrapForValidIterator",v="normal",g="throw",b=c.set,x=function(e){var t=c.getterFor(e?y:m);return a(o(u),{next:function(){var n=t(this);if(e)return n.nextHandler();if(n.done)return d(void 0,!0);try{var r=n.nextHandler();return n.returnHandlerResult?r:d(r,n.done)}catch(e){throw n.done=!0,e}},return:function(){var n=t(this),o=n.iterator;if(n.done=!0,e){var s=l(o,"return");return s?r(s,o):d(void 0,!0)}if(n.inner)try{p(n.inner.iterator,v)}catch(e){return p(o,g,e)}if(n.openIters)try{f(n.openIters,v)}catch(e){return p(o,g,e)}return o&&p(o,v),d(void 0,!0)}})},w=x(!0),_=x(!1);s(_,h,"Iterator Helper"),e.exports=function(e,t,n){var r=function(r,o){o?(o.iterator=r.iterator,o.next=r.next):o=r,o.type=t?y:m,o.returnHandlerResult=!!n,o.nextHandler=e,o.counter=0,o.done=!1,b(this,o)};return r.prototype=t?w:_,r}},9497:(e,t,n)=>{"use strict";n(8107);var r=n(7015);e.exports=r("Array","at")},9504:(e,t,n)=>{"use strict";var r=n(616),o=Function.prototype,s=o.call,a=r&&o.bind.bind(s,s);e.exports=r?a:function(e){return function(){return s.apply(e,arguments)}}},9519:(e,t,n)=>{"use strict";var r,o,s=n(4576),a=n(2839),i=s.process,c=s.Deno,l=i&&i.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},9539:(e,t,n)=>{"use strict";var r=n(9565),o=n(8551),s=n(5966);e.exports=function(e,t,n){var a,i;o(e);try{if(!(a=s(e,"return"))){if("throw"===t)throw n;return n}a=r(a,e)}catch(e){i=!0,a=e}if("throw"===t)throw n;if(i)throw a;return o(a),n}},9565:(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)}},9617:(e,t,n)=>{"use strict";var r=n(5397),o=n(5610),s=n(6198),a=function(e){return function(t,n,a){var i=r(t),c=s(i);if(0===c)return!e&&-1;var l,u=o(a,c);if(e&&n!=n){for(;c>u;)if((l=i[u++])!=l)return!0}else for(;c>u;u++)if((e||u in i)&&i[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},9835:e=>{"use strict";e.exports=function(e){try{var t=new Set,n={size:0,has:function(){return!0},keys:function(){return Object.defineProperty({},"next",{get:function(){return t.clear(),t.add(4),function(){return{done:!0}}}})}},r=t[e](n);return 1===r.size&&4===r.values().next().value}catch(e){return!1}}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(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=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(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(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})();var r={};(()=>{"use strict";n.r(r),n.d(r,{API:()=>H,AgentInfo:()=>ul,Chat:()=>Ji,ChatFrame:()=>Bc,ComponentFilter:()=>ei,Conversation:()=>Fi,Engine:()=>tl,EntryContainer:()=>Dc,EventParticipant:()=>$s,ExternalApi:()=>ol,Header:()=>dl,Icon:()=>Ks,Interrupt:()=>zc,MessageContainer:()=>Hs,SeamlyActivityEventContext:()=>Us,SeamlyActivityMonitor:()=>ti,SeamlyApiContext:()=>ts,SeamlyEventBusContext:()=>ns,SeamlyFileUpload:()=>oi,SeamlyGeneralError:()=>v,SeamlyLiveRegionContext:()=>cs,SeamlyOfflineError:()=>Jn,SeamlyStoreProvider:()=>Ht,Text:()=>Ja,TextEntry:()=>kc,Upload:()=>Mc,View:()=>Zc,appReducer:()=>Kn,appStorageProvider:()=>al,calculateVisibility:()=>Rt,className:()=>Is,configReducer:()=>Hn,cookieStorageProvider:()=>ll,default:()=>vl,eventTypes:()=>w,formsReducer:()=>cr,getSearchParamsByKeys:()=>hl,getUrlSearchParams:()=>pl,getUrlSearchString:()=>fl,i18nReducer:()=>hr,initResetSearchParams:()=>yl,interruptReducer:()=>xr,randomId:()=>z,replaceSearchParams:()=>ml,sessionStorageProvider:()=>x,setConfig:()=>Bn,setInitialLocale:()=>pr,setParticipant:()=>Zr,setPreChatEvents:()=>$n,setTranslations:()=>fr,stateReducer:()=>yo,timeout:()=>gs,translationReducer:()=>To,useChoicePrompt:()=>ra,useEvents:()=>vn,useGeneratedId:()=>Bs,useI18n:()=>Yo,useSeamlyActions:()=>sl,useSeamlyChat:()=>fs,useSeamlyCommands:()=>is,useSeamlyConfig:()=>en,useSeamlyEventStream:()=>Vs,useSeamlyIdleDetachCountdown:()=>Fs,useSeamlyMessageContainerClassNames:()=>ks,useSeamlyOptions:()=>Ps,useSeamlyVisibility:()=>Qo,useTranslatedEventData:()=>Es,useTranslations:()=>Ss,useTranslationsContainer:()=>js,visibilityReducer:()=>ko,visibilityStates:()=>Ot}),n(9497),n(4114),n(8992),n(4520),n(3949),n(1454),n(7550),n(4603),n(7566),n(8721),n(3375),n(9225),n(3972),n(9209),n(5714),n(7561),n(6197),n(8872);var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};function t(t,n){function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,s=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(o)throw o.error}}return a}var s=function(e,t){this.target=t,this.type=e},a=function(e){function n(t,n){var r=e.call(this,"error",n)||this;return r.message=t.message,r.error=t,r}return t(n,e),n}(s),i=function(e){function n(t,n,r){void 0===t&&(t=1e3),void 0===n&&(n="");var o=e.call(this,"close",r)||this;return o.wasClean=!0,o.code=t,o.reason=n,o}return t(n,e),n}(s),c=function(){if("undefined"!=typeof WebSocket)return WebSocket},l={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+4e3*Math.random(),minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1},u=function(){function e(e,t,n){var r=this;void 0===n&&(n={}),this._listeners={error:[],message:[],open:[],close:[]},this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=function(e){r._debug("open event");var t=r._options.minUptime,n=void 0===t?l.minUptime:t;clearTimeout(r._connectTimeout),r._uptimeTimeout=setTimeout(function(){return r._acceptOpen()},n),r._ws.binaryType=r._binaryType,r._messageQueue.forEach(function(e){return r._ws.send(e)}),r._messageQueue=[],r.onopen&&r.onopen(e),r._listeners.open.forEach(function(t){return r._callEventListener(e,t)})},this._handleMessage=function(e){r._debug("message event"),r.onmessage&&r.onmessage(e),r._listeners.message.forEach(function(t){return r._callEventListener(e,t)})},this._handleError=function(e){r._debug("error event",e.message),r._disconnect(void 0,"TIMEOUT"===e.message?"timeout":void 0),r.onerror&&r.onerror(e),r._debug("exec error listeners"),r._listeners.error.forEach(function(t){return r._callEventListener(e,t)}),r._connect()},this._handleClose=function(e){r._debug("close event"),r._clearTimeouts(),r._shouldReconnect&&r._connect(),r.onclose&&r.onclose(e),r._listeners.close.forEach(function(t){return r._callEventListener(e,t)})},this._url=e,this._protocols=t,this._options=n,this._options.startClosed&&(this._shouldReconnect=!1),this._connect()}return Object.defineProperty(e,"CONNECTING",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(e,"OPEN",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSING",{get:function(){return 2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"CLOSED",{get:function(){return 3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CONNECTING",{get:function(){return e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"OPEN",{get:function(){return e.OPEN},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSING",{get:function(){return e.CLOSING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"CLOSED",{get:function(){return e.CLOSED},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"retryCount",{get:function(){return Math.max(this._retryCount,0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bufferedAmount",{get:function(){return this._messageQueue.reduce(function(e,t){return"string"==typeof t?e+=t.length:t instanceof Blob?e+=t.size:e+=t.byteLength,e},0)+(this._ws?this._ws.bufferedAmount:0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"extensions",{get:function(){return this._ws?this._ws.extensions:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"protocol",{get:function(){return this._ws?this._ws.protocol:""},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:this._options.startClosed?e.CLOSED:e.CONNECTING},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!0,configurable:!0}),e.prototype.close=function(e,t){void 0===e&&(e=1e3),this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),this._ws?this._ws.readyState!==this.CLOSED?this._ws.close(e,t):this._debug("close: already closed"):this._debug("close enqueued: no ws instance")},e.prototype.reconnect=function(e,t){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,this._ws&&this._ws.readyState!==this.CLOSED?(this._disconnect(e,t),this._connect()):this._connect()},e.prototype.send=function(e){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",e),this._ws.send(e);else{var t=this._options.maxEnqueuedMessages,n=void 0===t?l.maxEnqueuedMessages:t;this._messageQueue.length<n&&(this._debug("enqueue",e),this._messageQueue.push(e))}},e.prototype.addEventListener=function(e,t){this._listeners[e]&&this._listeners[e].push(t)},e.prototype.dispatchEvent=function(e){var t,n,r=this._listeners[e.type];if(r)try{for(var o=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(r),s=o.next();!s.done;s=o.next()){var a=s.value;this._callEventListener(e,a)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return!0},e.prototype.removeEventListener=function(e,t){this._listeners[e]&&(this._listeners[e]=this._listeners[e].filter(function(e){return e!==t}))},e.prototype._debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._options.debug&&console.log.apply(console,function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(o(arguments[t]));return e}(["RWS>"],e))},e.prototype._getNextDelay=function(){var e=this._options,t=e.reconnectionDelayGrowFactor,n=void 0===t?l.reconnectionDelayGrowFactor:t,r=e.minReconnectionDelay,o=void 0===r?l.minReconnectionDelay:r,s=e.maxReconnectionDelay,a=void 0===s?l.maxReconnectionDelay:s,i=0;return this._retryCount>0&&(i=o*Math.pow(n,this._retryCount-1))>a&&(i=a),this._debug("next delay",i),i},e.prototype._wait=function(){var e=this;return new Promise(function(t){setTimeout(t,e._getNextDelay())})},e.prototype._getNextUrl=function(e){if("string"==typeof e)return Promise.resolve(e);if("function"==typeof e){var t=e();if("string"==typeof t)return Promise.resolve(t);if(t.then)return t}throw Error("Invalid URL")},e.prototype._connect=function(){var e=this;if(!this._connectLock&&this._shouldReconnect){this._connectLock=!0;var t=this._options,n=t.maxRetries,r=void 0===n?l.maxRetries:n,o=t.connectionTimeout,s=void 0===o?l.connectionTimeout:o,a=t.WebSocket,i=void 0===a?c():a;if(this._retryCount>=r)this._debug("max retries reached",this._retryCount,">=",r);else{if(this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),void 0===(u=i)||!u||2!==u.CLOSING)throw Error("No valid WebSocket class provided");var u;this._wait().then(function(){return e._getNextUrl(e._url)}).then(function(t){e._closeCalled||(e._debug("connect",{url:t,protocols:e._protocols}),e._ws=e._protocols?new i(t,e._protocols):new i(t),e._ws.binaryType=e._binaryType,e._connectLock=!1,e._addListeners(),e._connectTimeout=setTimeout(function(){return e._handleTimeout()},s))})}}},e.prototype._handleTimeout=function(){this._debug("timeout event"),this._handleError(new a(Error("TIMEOUT"),this))},e.prototype._disconnect=function(e,t){if(void 0===e&&(e=1e3),this._clearTimeouts(),this._ws){this._removeListeners();try{this._ws.close(e,t),this._handleClose(new i(e,t,this))}catch(e){}}},e.prototype._acceptOpen=function(){this._debug("accept open"),this._retryCount=0},e.prototype._callEventListener=function(e,t){"handleEvent"in t?t.handleEvent(e):t(e)},e.prototype._removeListeners=function(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))},e.prototype._addListeners=function(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))},e.prototype._clearTimeouts=function(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)},e}();const d=u,p=new Set;class f{#e=[];#t=null;#n=null;#r=e=>{const t=JSON.parse(e.data);this.#t&&clearInterval(this.#t),this.#t=setInterval(()=>{this.socket?.readyState===d.OPEN&&this.socket?.send(JSON.stringify({type:"ping"}))},3e4);try{if("attach_channel_response"===t.type){if(!t.payload.success)return void this.#o({connected:!0,ready:!1,currentState:"attach_channel_erred"});this.#o({connected:!0,ready:!0,currentState:"attach_channel_response"})}}catch(e){console.warn(e)}};#s=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_closed"})};#a=()=>{this.#o({connected:!1,ready:!1,currentState:"socket_join_error"})};accessToken="";channelName="";channelTopic="";url="";async connect(e,t,n,r){this.url=e,this.accessToken=r,this.channelName=t,this.channelTopic=n;const{url:o}=(e=>{const t=e.indexOf("?");return t<0?{url:e,params:{}}:{url:e.slice(0,t),params:e.slice(t+1).split("&").reduce((e,t)=>{const[n,r]=t.split("=");return{...e,[n]:decodeURIComponent(r)}},{})}})(this.url);this.socket=new d(o,[],{maxReconnectionDelay:1e4,minReconnectionDelay:500,reconnectionDelayGrowFactor:2});const s={type:"attach_channel",payload:{accessToken:this.accessToken,channelName:this.channelName}};this.#n=()=>{this.socket?.send(JSON.stringify(s)),this.#o({connected:!0,ready:!1,currentState:"socket_connected"})},this.socket?.addEventListener("open",this.#n),this.socket?.addEventListener("message",this.#r),this.socket?.addEventListener("close",this.#s),this.socket?.addEventListener("error",this.#a)}disconnect(){this.socket?.close(),this.#n&&this.socket?.removeEventListener("open",this.#n),this.socket?.removeEventListener("message",this.#r),this.socket?.removeEventListener("close",this.#s),this.socket?.removeEventListener("error",this.#a),this.#e=[]}onOpen=e=>{this?.socket?.addEventListener("open",e)};onError=e=>{this?.socket?.addEventListener("error",e)};addListener=(e,t)=>{this?.socket?.addEventListener(e,e=>t(JSON.parse(e.data)))};onMessage=e=>{this?.socket&&(this.socket.onmessage=t=>e(JSON.parse(t.data)))};removeListener=(e,t)=>{this.socket?.removeEventListener(e,t)};onConnection(e){this.#e.push(e)}#o(e){this.#e=this.#e.filter(t=>!t(e)),p.forEach(e=>e())}pushToChannel(e,t){this.socket?.send(JSON.stringify({type:e,payload:t}))}static subscribe(e){return p.add(e),()=>p.delete(e)}}class h extends Error{constructor(e,t){super(e,{cause:t?.cause}),this.status=t?.status}}class m 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 y extends m{constructor(e,...t){super(e,...t),this.name="SeamlyConfigurationError",this.langKey="errors.configError"}}class v extends m{constructor(e,...t){super(e,...t),this.name="SeamlyGeneralError",this.langKey="errors.general",this.action="reset"}}class g extends m{constructor(e,...t){super(e,...t),this.name="SeamlySessionExpiredError",this.action="reset"}}class b extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnauthorizedError",this.langKey="errors.general",this.action="reset"}}function x(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 w={info:"info",message:"message",participant:"participant",system:"system"},_="text",C="text",S="upload",E="received",j="read",T="custom",I="detach_service",N="dismiss",k="set_topic",O="click_card",L="translation_proposal",R=L,A="window_api",P="assertive",M="polite",U={new_topic:"newTopic",new_translation:"newTranslation"},D="uploads",F="navigate";function z(){return`_${(Number(String(Math.random()).slice(2))+Date.now()+Math.round(performance.now())).toString(36)}`}const B=async(e,t)=>{const n=new URL(e),r=await fetch(n.href,{mode:"cors",...t});if(!r.ok)throw new h(r.statusText||`Request failed with status: ${r.status}`,{status:r.status});return r};function V(){if(!Intl||"undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return;const e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return;const t=e.resolvedOptions().timeZone;return t&&(t.indexOf("/")>-1||"UTC"===t)?t:void 0}const $=()=>null;class H{#i;#c;#l;#u="window";#d;#p="new";URLS={};locale="";conversation=new f;constructor({layoutMode:e,namespace:t,config:n,context:r}){this.store=function(e,t){const n=t(e),r=n.get()||{};return{get:e=>void 0===e?r:r[e],set:(e,t)=>(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||x),this.connectionInfo={apiKey:n.key,domain:n.domain||"api.seamly-app.com",secure:!1!==n.secure&&(n.secure||!0)},this.#d={...n,sendEnvironment:n.sendEnvironment??!0,context:{...r,channelName:r.channelName||"web"}},this.#i=!1,this.connected=!1,this.configReady=!1,n.externalId&&(this.#c=n.externalId),this.#u=e,this.userResponded=!1,this.URLS={translations:{href:`/channels/api/v3/client/${this.connectionInfo.apiKey}/translations/{version}/{locale}.json`,templated:!0},config:{href:`/channels/api/v3/client/${this.connectionInfo.apiKey}/configs`,templated:!0}},window.addEventListener("pageshow",e=>{e.persisted&&this.connected&&this.connect()})}getAccessToken(){return this.store.get("accessToken")}setAccessToken(e){this.store.set("accessToken",e)}getConversationUrl(){return this.store.get("conversationUrl")}setConversationUrl(e){this.store.set("conversationUrl",e?.href)}hasConversation(){return!!this.getConversationUrl()}getChannelTopic(){return this.store.get("channelTopic")||this.store.get("channelName")}getLocale=e=>e||this.locale;#f({_links:{self:e,...t}}){this.URLS={...this.URLS,...t}}clearStore(){this.store.delete("accessToken"),this.store.delete("conversationUrl"),this.store.delete("channelName"),this.store.delete("channelTopic")}#h(e){return`${this.connectionInfo.secure?`${e}s`:e}://${this.connectionInfo.domain}`}async getTranslations(e){try{if(!this.URLS.translations?.href)throw new y;const t=`${this.#h("http")}${this.URLS.translations.href}`.replace("{version}",String(4)).replace("{locale}",this.getLocale(e)),n=await B(t,{method:"GET"});return(await n.json()).translations}catch(e){if(e.status>=500)throw new v(e);throw new h(e)}}getContext(e){const{source:t,userLocale:n,variables:r}=e;if(t&&"string"!=typeof t)throw new Error("Source must be a string");if(n){if("string"!=typeof n)throw new Error("Locale must be a string");this.#m(e,n)}if(r&&"object"!=typeof r)throw new Error("Variables must be an object");if(0===Object.keys(e).length&&e.constructor===Object)return;const o=this.#d.context?.userLocale;return{...o?{userLocale:o}:{},...e}}async downloadFile(e,t){try{const n=await B(`${this.#h("http")}${this.URLS.uploads.href}/${e}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),r=document.createElement("a"),o=URL.createObjectURL(await n.blob());r.href=o,void 0!==r.download&&(r.download=t),r.click(),setTimeout(()=>{URL.revokeObjectURL(o)},6e4)}catch(e){}}uploadFile(e,t,n,r){const o=new FormData;o.append("upload",e);const s=new XMLHttpRequest;return s.open("POST",`${this.#h("http")}${this.URLS.uploads.href}`),s.setRequestHeader("Authorization",`Bearer ${this.getAccessToken()}`),s.upload.onprogress=e=>{if("function"==typeof t){const n=Math.ceil(e.loaded/e.total*100);t(n)}},s.onloadend=()=>{if(0!==s.status)if(200!==s.status&&201!==s.status||!n){if(!r)throw new Error(s.response);try{r(JSON.parse(s.response))}catch(e){r(s.response)}}else try{n(JSON.parse(s.response))}catch(e){n(s.response)}},s.send(o),s}async createConversation(){try{"function"==typeof this.#d?.getConversationAuthToken&&(this.#l=await this.#d.getConversationAuthToken());const e=await B(`${this.#h("http")}${this.URLS.conversations?.href}`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({externalId:this.#l?void 0:this.#c,token:this.#l})}),t=await e.json(),{conversation:n}=t,r={...n};return this.setAccessToken(n.accessToken),this.#f(t),this.URLS.conversation&&this.setConversationUrl(this.URLS.conversation),this.locale=n.context.userLocale,this.userResponded=n.userResponded,this.#p=n.status,r}catch(e){if(e.status>=500)throw new v(e);if(400===e.status)throw new b(e);if(404===e.status)throw new y(e);throw e}}async getConfig(){try{const e={channelName:this.#d.context.channelName,contentLocale:this.#d.context.contentLocale,environment:!0===this.#d.sendEnvironment?this.getEnvironment():this.#d.sendEnvironment,userLocale:this.#d.context.userLocale,variables:this.#d.context.variables},t=await B(`${this.#h("http")}${this.URLS.config?.href}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e})}),n=await t.json();return this.#f(n),this.configReady=!0,n.config}catch(e){if(404===e.status)throw new y(e);if(e.status>=500)throw new v(e);throw e}}async fetchConversation(){if(!this.hasConversation())return null;try{const e=await B(`${this.#h("http")}${this.getConversationUrl()}`,{method:"GET",headers:{Authorization:`Bearer ${this.getAccessToken()}`}}),t=await e.json();return this.#p=t.conversation.status,this.#f(t),t.conversation}catch(e){if(401===e.status)throw new b(e);if(404===e.status)throw new g(e);if(e.status>=500)throw new v(e);throw e}}async getConversation(){return this.hasConversation()?this.fetchConversation():null}async getConversationIntitialState(){return this.fetchConversation()}async disconnect(){this.conversation?.disconnect&&this.conversation.disconnect(),this.connected=!1,this.configReady=!1}async connect(){this.connected=!1;const e=this.hasConversation()?void 0:await this.createConversation();return this.URLS.socket&&(this.conversation.connect(`${this.#h("ws")}${this.URLS.socket.href}`,this.#d.context.channelName||"",this.getChannelTopic(),this.getAccessToken()),this.conversation.onConnection(({connected:e,ready:t})=>{this.connected=e,this.#i=t}),this.send("context",this.#y())),e}send(e,t=void 0){this.connected&&this.#i?($("[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=z()),{type:n,body:r,transactionId:o}}(e,t))):this.conversation?.onConnection(({connected:n,ready:r})=>(this.connected=n,this.#i=r,!!r&&(this.send(e,t),!0)))}sendContext(e){const t=this.getContext(e);t&&this.send("context",t)}#y(){const e=!0===this.#d.sendEnvironment?this.getEnvironment():void 0,t="string"==typeof this.#d.context?.source?this.#d.context?.source:void 0,n=this.#d.context?.variables;return{contentLocale:"started"!==this.#p?this.#d.context?.contentLocale:void 0,environment:e,source:t,userLocale:"started"!==this.#p?this.#d.context?.userLocale:void 0,variables:n}}#m(e,t){e.source||t==this.#d.context?.userLocale||(e.source=A)}getEnvironment(){return{clientName:"@seamly/web-ui",clientVariant:this.#u,clientVersion:"25.2.0-beta.2",currentUrl:window.location.toString(),screenResolution:`${window.screen.width}x${window.screen.height}`,timezone:V(),userAgent:navigator.userAgent,preferredLocale:navigator.language}}}var W=Symbol.for("immer-nothing"),G=Symbol.for("immer-draftable"),q=Symbol.for("immer-state");function K(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var J=Object.getPrototypeOf;function X(e){return!!e&&!!e[q]}function Y(e){return!!e&&(ee(e)||Array.isArray(e)||!!e[G]||!!e.constructor?.[G]||se(e)||ae(e))}var Q=Object.prototype.constructor.toString(),Z=new WeakMap;function ee(e){if(!e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);if(null===t||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if("function"!=typeof n)return!1;let r=Z.get(n);return void 0===r&&(r=Function.toString.call(n),Z.set(n,r)),r===Q}function te(e,t,n=!0){0===ne(e)?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(n=>{t(n,e[n],e)}):e.forEach((n,r)=>t(r,n,e))}function ne(e){const t=e[q];return t?t.type_:Array.isArray(e)?1:se(e)?2:ae(e)?3:0}function re(e,t){return 2===ne(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function oe(e,t,n){const r=ne(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function se(e){return e instanceof Map}function ae(e){return e instanceof Set}function ie(e){return e.copy_||e.base_}function ce(e,t){if(se(e))return new Map(e);if(ae(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=ee(e);if(!0===t||"class_only"===t&&!n){const t=Object.getOwnPropertyDescriptors(e);delete t[q];let n=Reflect.ownKeys(t);for(let r=0;r<n.length;r++){const o=n[r],s=t[o];!1===s.writable&&(s.writable=!0,s.configurable=!0),(s.get||s.set)&&(t[o]={configurable:!0,writable:!0,enumerable:s.enumerable,value:e[o]})}return Object.create(J(e),t)}{const t=J(e);if(null!==t&&n)return{...e};const r=Object.create(t);return Object.assign(r,e)}}function le(e,t=!1){return de(e)||X(e)||!Y(e)||(ne(e)>1&&Object.defineProperties(e,{set:ue,add:ue,clear:ue,delete:ue}),Object.freeze(e),t&&Object.values(e).forEach(e=>le(e,!0))),e}var ue={value:function(){K(2)}};function de(e){return null===e||"object"!=typeof e||Object.isFrozen(e)}var pe,fe={};function he(e){const t=fe[e];return t||K(0),t}function me(){return pe}function ye(e,t){t&&(he("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ve(e){ge(e),e.drafts_.forEach(xe),e.drafts_=null}function ge(e){e===pe&&(pe=e.parent_)}function be(e){return pe={drafts_:[],parent_:pe,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function xe(e){const t=e[q];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function we(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return void 0!==e&&e!==n?(n[q].modified_&&(ve(t),K(4)),Y(e)&&(e=_e(t,e),t.parent_||Se(t,e)),t.patches_&&he("Patches").generateReplacementPatches_(n[q].base_,e,t.patches_,t.inversePatches_)):e=_e(t,n,[]),ve(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==W?e:void 0}function _e(e,t,n){if(de(t))return t;const r=e.immer_.shouldUseStrictIteration(),o=t[q];if(!o)return te(t,(r,s)=>Ce(e,o,t,r,s,n),r),t;if(o.scope_!==e)return t;if(!o.modified_)return Se(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const t=o.copy_;let s=t,a=!1;3===o.type_&&(s=new Set(t),t.clear(),a=!0),te(s,(r,s)=>Ce(e,o,t,r,s,n,a),r),Se(e,t,!1),n&&e.patches_&&he("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Ce(e,t,n,r,o,s,a){if(null==o)return;if("object"!=typeof o&&!a)return;const i=de(o);if(!i||a){if(X(o)){const a=_e(e,o,s&&t&&3!==t.type_&&!re(t.assigned_,r)?s.concat(r):void 0);if(oe(n,r,a),!X(a))return;e.canAutoFreeze_=!1}else a&&n.add(o);if(Y(o)&&!i){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;if(t&&t.base_&&t.base_[r]===o&&i)return;_e(e,o),t&&t.scope_.parent_||"symbol"==typeof r||!(se(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))||Se(e,o)}}}function Se(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&le(t,n)}var Ee={get(e,t){if(t===q)return e;const n=ie(e);if(!re(n,t))return function(e,t,n){const r=Ie(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_||!Y(r)?r:r===Te(e.base_,t)?(ke(e),e.copy_[t]=Oe(r,e)):r},has:(e,t)=>t in ie(e),ownKeys:e=>Reflect.ownKeys(ie(e)),set(e,t,n){const r=Ie(ie(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const r=Te(ie(e),t),a=r?.[q];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(((o=n)===(s=r)?0!==o||1/o==1/s:o!=o&&s!=s)&&(void 0!==n||re(e.base_,t)))return!0;ke(e),Ne(e)}var o,s;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)=>(void 0!==Te(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,ke(e),Ne(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){const n=ie(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty(){K(11)},getPrototypeOf:e=>J(e.base_),setPrototypeOf(){K(12)}},je={};function Te(e,t){const n=e[q];return(n?ie(n):e)[t]}function Ie(e,t){if(!(t in e))return;let n=J(e);for(;n;){const e=Object.getOwnPropertyDescriptor(n,t);if(e)return e;n=J(n)}}function Ne(e){e.modified_||(e.modified_=!0,e.parent_&&Ne(e.parent_))}function ke(e){e.copy_||(e.copy_=ce(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Oe(e,t){const n=se(e)?he("MapSet").proxyMap_(e,t):ae(e)?he("MapSet").proxySet_(e,t):function(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:me(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=r,s=Ee;n&&(o=[r],s=je);const{revoke:a,proxy:i}=Proxy.revocable(o,s);return r.draft_=i,r.revoke_=a,i}(e,t);return(t?t.scope_:me()).drafts_.push(n),n}function Le(e){if(!Y(e)||de(e))return e;const t=e[q];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ce(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ce(e,!0);return te(n,(e,t)=>{oe(n,e,Le(t))},r),t&&(t.finalized_=!1),n}te(Ee,(e,t)=>{je[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),je.deleteProperty=function(e,t){return je.set.call(this,e,t,void 0)},je.set=function(e,t,n){return Ee.set.call(this,e[0],t,n,e[0])};var Re=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,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&&K(6),void 0!==n&&"function"!=typeof n&&K(7),Y(e)){const o=be(this),s=Oe(e,void 0);let a=!0;try{r=t(s),a=!1}finally{a?ve(o):ge(o)}return ye(o,n),we(r,o)}if(!e||"object"!=typeof e){if(r=t(e),void 0===r&&(r=e),r===W&&(r=void 0),this.autoFreeze_&&le(r,!0),n){const t=[],o=[];he("Patches").generateReplacementPatches_(e,r,t,o),n(t,o)}return r}K(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),"boolean"==typeof e?.useStrictIteration&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){var t;Y(e)||K(8),X(e)&&(X(t=e)||K(10),e=Le(t));const n=be(this),r=Oe(e,void 0);return r[q].isManual_=!0,ge(n),r}finishDraft(e,t){const n=e&&e[q];n&&n.isManual_||K(9);const{scope_:r}=n;return ye(r,t),we(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){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=he("Patches").applyPatches_;return X(e)?r(e,t):this.produce(e,e=>r(e,t))}},Ae=Re.produce,Pe=Re.setUseStrictIteration.bind(Re);function Me(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Ue=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),De=()=>Math.random().toString(36).substring(7).split("").join("."),Fe={INIT:`@@redux/INIT${De()}`,REPLACE:`@@redux/REPLACE${De()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${De()}`};function ze(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 Be(e,t,n){if("function"!=typeof e)throw new Error(Me(2));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Me(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Me(1));return n(Be)(e,t)}let r=e,o=t,s=new Map,a=s,i=0,c=!1;function l(){a===s&&(a=new Map,s.forEach((e,t)=>{a.set(t,e)}))}function u(){if(c)throw new Error(Me(3));return o}function d(e){if("function"!=typeof e)throw new Error(Me(4));if(c)throw new Error(Me(5));let t=!0;l();const n=i++;return a.set(n,e),function(){if(t){if(c)throw new Error(Me(6));t=!1,l(),a.delete(n),s=null}}}function p(e){if(!ze(e))throw new Error(Me(7));if(void 0===e.type)throw new Error(Me(8));if("string"!=typeof e.type)throw new Error(Me(17));if(c)throw new Error(Me(9));try{c=!0,o=r(o,e)}finally{c=!1}return(s=a).forEach(e=>{e()}),e}return p({type:Fe.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(Me(10));r=e,p({type:Fe.REPLACE})},[Ue]:function(){const e=d;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(Me(11));function n(){const e=t;e.next&&e.next(u())}return n(),{unsubscribe:e(n)}},[Ue](){return this}}}}}function Ve(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:Fe.INIT}))throw new Error(Me(12));if(void 0===n(void 0,{type:Fe.PROBE_UNKNOWN_ACTION()}))throw new Error(Me(13))})}(n)}catch(e){o=e}return function(e={},t){if(o)throw o;let s=!1;const a={};for(let o=0;o<r.length;o++){const i=r[o],c=n[i],l=e[i],u=c(l,t);if(void 0===u)throw t&&t.type,new Error(Me(14));a[i]=u,s=s||u!==l}return s=s||r.length!==Object.keys(e).length,s?a:e}}function $e(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...n)=>e(t(...n)))}function He(e){return({dispatch:t,getState:n})=>r=>o=>"function"==typeof o?o(t,n,e):r(o)}var We=He(),Ge=He,qe="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?$e:$e.apply(null,arguments)},Ke=("undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__,e=>e&&"function"==typeof e.match);function Je(e,t){function n(...n){if(t){let r=t(...n);if(!r)throw new Error(gt(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 ze(e)&&"type"in e&&"string"==typeof e.type}(t)&&t.type===e,n}var Xe=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 Ye(e){return Y(e)?Ae(e,()=>{}):e}function Qe(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var Ze=e=>t=>{setTimeout(t,e)};function et(e){const t=function(e){const{thunk:t=!0,immutableCheck:n=!0,serializableCheck:r=!0,actionCreatorCheck:o=!0}=e??{};let s=new Xe;return t&&("boolean"==typeof t?s.push(We):s.push(Ge(t.extraArgument))),s},{reducer:n,middleware:r,devTools:o=!0,duplicateMiddlewareCheck:s=!0,preloadedState:a,enhancers:i}=e||{};let c,l;if("function"==typeof n)c=n;else{if(!ze(n))throw new Error(gt(1));c=Ve(n)}l="function"==typeof r?r(t):t();let u=$e;o&&(u=qe({trace:!1,..."object"==typeof o&&o}));const d=function(...e){return t=>(n,r)=>{const o=t(n,r);let s=()=>{throw new Error(Me(15))};const a={getState:o.getState,dispatch:(e,...t)=>s(e,...t)},i=e.map(e=>e(a));return s=$e(...i)(o.dispatch),{...o,dispatch:s}}}(...l),p=(e=>function(t){const{autoBatch:n=!0}=t??{};let r=new Xe(e);return n&&r.push(((e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let o=!0,s=!1,a=!1;const i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ze(10):"callback"===e.type?e.queueNotification:Ze(e.timeout),l=()=>{a=!1,s&&(s=!1,i.forEach(e=>e()))};return Object.assign({},r,{subscribe(e){const t=r.subscribe(()=>o&&e());return i.add(e),()=>{t(),i.delete(e)}},dispatch(e){try{return o=!e?.meta?.RTK_autoBatch,s=!o,s&&(a||(a=!0,c(l))),r.dispatch(e)}finally{o=!0}}})})("object"==typeof n?n:void 0)),r})(d);return Be(c,a,u(..."function"==typeof i?i(p):p()))}function tt(e){const t={},n=[];let r;const o={addCase(e,n){const r="string"==typeof e?e:e.type;if(!r)throw new Error(gt(28));if(r in t)throw new Error(gt(29));return t[r]=n,o},addAsyncThunk:(e,r)=>(r.pending&&(t[e.pending.type]=r.pending),r.rejected&&(t[e.rejected.type]=r.rejected),r.fulfilled&&(t[e.fulfilled.type]=r.fulfilled),r.settled&&n.push({matcher:e.settled,reducer:r.settled}),o),addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),o),addDefaultCase:e=>(r=e,o)};return e(o),[t,n,r]}Pe(!1);function nt(...e){return t=>e.some(e=>((e,t)=>Ke(e)?e.match(t):e(t))(e,t))}var rt=(e=21)=>{let t="",n=e;for(;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},ot=["name","message","stack","code"],st=class{constructor(e,t){this.payload=e,this.meta=t}_type},at=class{constructor(e,t){this.payload=e,this.meta=t}_type},it=e=>{if("object"==typeof e&&null!==e){const t={};for(const n of ot)"string"==typeof e[n]&&(t[n]=e[n]);return t}return{message:String(e)}},ct="External signal was aborted",lt=(()=>{function e(e,t,n){const r=Je(e+"/fulfilled",(e,t,n,r)=>({payload:e,meta:{...r||{},arg:n,requestId:t,requestStatus:"fulfilled"}})),o=Je(e+"/pending",(e,t,n)=>({payload:void 0,meta:{...n||{},arg:t,requestId:e,requestStatus:"pending"}})),s=Je(e+"/rejected",(e,t,r,o,s)=>({payload:o,error:(n&&n.serializeError||it)(e||"Rejected"),meta:{...s||{},arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===e?.name,condition:"ConditionError"===e?.name}}));return Object.assign(function(e,{signal:a}={}){return(i,c,l)=>{const u=n?.idGenerator?n.idGenerator(e):rt(),d=new AbortController;let p,f;function h(e){f=e,d.abort()}a&&(a.aborted?h(ct):a.addEventListener("abort",()=>h(ct),{once:!0}));const m=async function(){let a;try{let s=n?.condition?.(e,{getState:c,extra:l});if(null!==(m=s)&&"object"==typeof m&&"function"==typeof m.then&&(s=await s),!1===s||d.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const y=new Promise((e,t)=>{p=()=>{t({name:"AbortError",message:f||"Aborted"})},d.signal.addEventListener("abort",p)});i(o(u,e,n?.getPendingMeta?.({requestId:u,arg:e},{getState:c,extra:l}))),a=await Promise.race([y,Promise.resolve(t(e,{dispatch:i,getState:c,extra:l,requestId:u,signal:d.signal,abort:h,rejectWithValue:(e,t)=>new st(e,t),fulfillWithValue:(e,t)=>new at(e,t)})).then(t=>{if(t instanceof st)throw t;return t instanceof at?r(t.payload,u,e,t.meta):r(t,u,e)})])}catch(t){a=t instanceof st?s(null,u,e,t.payload,t.meta):s(t,u,e)}finally{p&&d.signal.removeEventListener("abort",p)}var m;return n&&!n.dispatchConditionRejection&&s.match(a)&&a.meta.condition||i(a),a}();return Object.assign(m,{abort:h,requestId:u,arg:e,unwrap:()=>m.then(ut)})}},{pending:o,rejected:s,fulfilled:r,settled:nt(s,r),typePrefix:e})}return e.withTypes=()=>e,e})();function ut(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}var dt=Symbol.for("rtk-slice-createasyncthunk");function pt(e,t){return`${e}/${t}`}function ft({creators:e}={}){const t=e?.asyncThunk?.[dt];return function(e){const{name:n,reducerPath:r=n}=e;if(!n)throw new Error(gt(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=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},s=Object.keys(o),a={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},i={addCase(e,t){const n="string"==typeof e?e:e.type;if(!n)throw new Error(gt(12));if(n in a.sliceCaseReducersByType)throw new Error(gt(13));return a.sliceCaseReducersByType[n]=t,i},addMatcher:(e,t)=>(a.sliceMatchers.push({matcher:e,reducer:t}),i),exposeAction:(e,t)=>(a.actionCreators[e]=t,i),exposeCaseReducer:(e,t)=>(a.sliceCaseReducersByName[e]=t,i)};function c(){const[t={},n=[],r]="function"==typeof e.extraReducers?tt(e.extraReducers):[e.extraReducers],o={...t,...a.sliceCaseReducersByType};return function(e){let t,[s,i,c]=tt(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)t=()=>Ye(e());else{const n=Ye(e);t=()=>n}function l(e=t(),n){let r=[s[n.type],...i.filter(({matcher:e})=>e(n)).map(({reducer:e})=>e)];return 0===r.filter(e=>!!e).length&&(r=[c]),r.reduce((e,t)=>{if(t){if(X(e)){const r=t(e,n);return void 0===r?e:r}if(Y(e))return Ae(e,e=>t(e,n));{const r=t(e,n);if(void 0===r){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}}return e},e)}return l.getInitialState=t,l}(e.initialState)}s.forEach(r=>{const s=o[r],a={reducerName:r,type:pt(n,r),createNotation:"function"==typeof e.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(s)?function({type:e,reducerName:t,createNotation:n},r,o){let s,a;if("reducer"in r){if(n&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(r))throw new Error(gt(17));s=r.reducer,a=r.prepare}else s=r;o.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,a?Je(e,a):Je(e))}(a,s,i):function({type:e,reducerName:t},n,r,o){if(!o)throw new Error(gt(18));const{payloadCreator:s,fulfilled:a,pending:i,rejected:c,settled:l,options:u}=n,d=o(e,s,u);r.exposeAction(t,d),a&&r.addCase(d.fulfilled,a),i&&r.addCase(d.pending,i),c&&r.addCase(d.rejected,c),l&&r.addMatcher(d.settled,l),r.exposeCaseReducer(t,{fulfilled:a||yt,pending:i||yt,rejected:c||yt,settled:l||yt})}(a,s,i,t)});const l=e=>e,u=new Map,d=new WeakMap;let p;function f(e,t){return p||(p=c()),p(e,t)}function h(){return p||(p=c()),p.getInitialState()}function m(t,n=!1){function r(e){let o=e[t];return void 0===o&&n&&(o=Qe(d,r,h)),o}function o(t=l){const r=Qe(u,n,()=>new WeakMap);return Qe(r,t,()=>{const r={};for(const[o,s]of Object.entries(e.selectors??{}))r[o]=ht(s,t,()=>Qe(d,t,h),n);return r})}return{reducerPath:t,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}const y={name:n,reducer:f,actions:a.actionCreators,caseReducers:a.sliceCaseReducersByName,getInitialState:h,...m(r),injectInto(e,{reducerPath:t,...n}={}){const o=t??r;return e.inject({reducerPath:o,reducer:f},n),{...y,...m(o,!0)}}};return y}}function ht(e,t,n,r){function o(o,...s){let a=t(o);return void 0===a&&r&&(a=n()),e(a,...s)}return o.unwrapped=e,o}var mt=ft();function yt(){}var{assign:vt}=Object;function gt(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 bt extends m{constructor(e,...t){super(e,...t),this.name="SeamlyUnavailableError",this.langKey="errors.seamlyUnavailable"}}const xt=lt("initializeConfig",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{try{const{features:e,preChat:r,agentParticipant:o,defaultContentLocale:s,defaultUserLocale:a,userParticipant:i,startChatIcon:c}=await t.getConfig(),{connectWhenInView:l}=n;return{features:e,preChat:r,agentParticipant:o,userParticipant:i,startChatIcon:c,defaultUserLocale:n?.context?.userLocale||a,defaultContentLocale:n?.context?.contentLocale||s,connectWhenInView:l}}catch(e){return r(e)}}),wt=lt("resetConfig",async(e,{extra:{config:t}})=>t);var _t=e=>Array.isArray(e)?e:[e];Symbol(),Object.getPrototypeOf({});var Ct="undefined"!=typeof WeakRef?WeakRef:class{constructor(e){this.value=e}deref(){return this.value}};function St(){return{s:0,v:void 0,o:null,p:null}}function Et(e,t={}){let n={s:0,v:void 0,o:null,p:null};const{resultEqualityCheck:r}=t;let o,s=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=St(),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=St(),e.set(n,t)):t=r}}const i=t;let c;if(1===t.s)c=t.v;else if(c=e.apply(null,arguments),s++,r){const e=o?.deref?.()??o;null!=e&&r(e,c)&&(c=e,0!==s&&s--),o="object"==typeof c&&null!==c||"function"==typeof c?new Ct(c):c}return i.s=1,i.v=c,c}return a.clearCache=()=>{n={s:0,v:void 0,o:null,p:null},a.resetResultsCount()},a.resultsCount=()=>s,a.resetResultsCount=()=>{s=0},a}function jt(e,...t){const n="function"==typeof e?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t,r=0,o=0,s={},a=e.pop();"object"==typeof a&&(s=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 i={...n,...s},{memoize:c,memoizeOptions:l=[],argsMemoize:u=Et,argsMemoizeOptions:d=[],devModeChecks:p={}}=i,f=_t(l),h=_t(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),y=c(function(){return r++,a.apply(null,arguments)},...f),v=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=y.apply(null,e),t},...h);return Object.assign(v,{resultFunc:a,memoizedResultFunc:y,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 Tt=jt(Et),It=Object.assign((e,t=Tt)=>{!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:()=>It});const Nt=Tt(({app:e})=>e,({userHasResponded:e})=>e),kt="visibility",Ot={hidden:"hidden",minimized:"minimized",open:"open",initialize:null},Lt=Tt(({config:e})=>e,e=>{let t={visible:"inline"===e?.layoutMode?Ot.open:Ot.minimized,appContainerClassNames:e?.appContainerClassNames||[],...e};return"function"==typeof t.appContainerClassNames&&(t={...t,appContainerClassNames:t.appContainerClassNames(t)}),t}),Rt=({hasResponded:e,previousVisibility:t,requestedVisibility:n,config:r})=>{const{defaults:o,layoutMode:s,hideOnNoUserResponse:a}=r,{visible:i}=o||{};if("app"===s&&!t)return Ot.open;if("window"===s&&a&&n!==Ot.open)return e?n||t||Ot.open:Ot.hidden;if("inline"===s&&e&&!n)return t||Ot.open;const c=Ot.minimized;return n||t||i||c};var At=n(7402),Pt=n(8418);var Mt={notify(){},get:()=>[]};var Ut=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),Dt=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),Ft=(()=>Ut||Dt?At.useLayoutEffect:At.useEffect)();Object.defineProperty,Object.getOwnPropertyNames,Object.getOwnPropertySymbols,Object.getOwnPropertyDescriptor,Object.getPrototypeOf,Object.prototype;var zt=Symbol.for("react-redux-context"),Bt="undefined"!=typeof globalThis?globalThis:{};function Vt(){if(!At.createContext)return{};const e=Bt[zt]??=new Map;let t=e.get(At.createContext);return t||(t=At.createContext(null),e.set(At.createContext,t)),t}var $t=Vt(),Ht=function(e){const{children:t,context:n,serverState:r,store:o}=e,s=At.useMemo(()=>{const e=function(e,t){let n,r=Mt,o=0,s=!1;function a(){l.onStateChange&&l.onStateChange()}function i(){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=Mt)}const l={addNestedSub:function(e){i();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),c())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:a,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,i())},tryUnsubscribe:function(){s&&(s=!1,c())},getListeners:()=>r};return l}(o);return{store:o,subscription:e,getServerState:r?()=>r:void 0}},[o,r]),a=At.useMemo(()=>o.getState(),[o]);Ft(()=>{const{subscription:e}=s;return e.onStateChange=e.notifyNestedSubs,e.trySubscribe(),a!==o.getState()&&e.notifyNestedSubs(),()=>{e.tryUnsubscribe(),e.onStateChange=void 0}},[s,a]);const i=n||$t;return At.createElement(i.Provider,{value:s},t)};function Wt(e=$t){return function(){return At.useContext(e)}}var Gt=Wt();function qt(e=$t){const t=e===$t?Gt:Wt(e),n=()=>{const{store:e}=t();return e};return Object.assign(n,{withTypes:()=>n}),n}var Kt=qt();function Jt(e=$t){const t=e===$t?Kt:qt(e),n=()=>t().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var Xt=Jt(),Yt=(e,t)=>e===t;function Qt(e=$t){const t=e===$t?Gt:Wt(e),n=(e,n={})=>{const{equalityFn:r=Yt}="function"==typeof n?{equalityFn:n}:n,o=t(),{store:s,subscription:a,getServerState:i}=o,c=(At.useRef(!0),At.useCallback({[e.name]:t=>e(t)}[e.name],[e])),l=(0,Pt.useSyncExternalStoreWithSelector)(a.addNestedSub,s.getState,i||s.getState,c,r);return At.useDebugValue(l),l};return Object.assign(n,{withTypes:()=>n}),n}var Zt=Qt();const en=()=>Zt(Lt);function tn(){const{startChatIcon:e}=en();return e}const nn=(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)}}},rn=e=>Math.ceil(e/1e3),on=e=>{const t=Math.floor(e/60);return{minutes:t,seconds:e-60*t}},sn=(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]}`},an={27:"Escape",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown"},cn={Escape:"Escape",End:"End",Home:"Home",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown"},ln=e=>e.code?cn[e.code]:an[e.keyCode],un=e=>{e&&e.focus()},dn=(e,t)=>{e&&(e.contains(document.activeElement)||e===document.activeElement)&&t()};function pn(e){return"object"==typeof e}const fn=({state:e})=>e,hn=()=>Zt(fn),mn=Tt(fn,Lt,Nt,({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]}),yn=Tt(mn,Lt,(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 s=o[n-1];if(!t?.occurredAt||!s.payload?.occurredAt||!r)return{type:e,payload:{...t,timeIndicator:void 0}};const a=rn(t.occurredAt-s.payload.occurredAt)>=r?t.occurredAt:void 0;return{type:e,payload:{...t,timeIndicator:a}}}):e}),vn=()=>Zt(yn),gn=(Tt(yn,e=>e.map(e=>e.payload.id)),()=>hn().isLoading),bn=()=>hn().unreadEvents,xn=()=>hn().skiplinkElementId,wn=()=>hn().skiplinkTargetId,_n=()=>hn().serviceInfo,Cn=Tt(yn,e=>{const t=e.filter(e=>"message"===e.type);return t[t.length-1]?.payload.id}),Sn=()=>{const{participants:e,currentAgent:t}=hn().participantInfo;return t?e[t]:null},En=()=>{const{entryMeta:{active:e,options:t,optionsOverride:n}}=hn();let r=null;return e&&"number"==typeof n[e]?.limit?r=n[e].limit:e&&"number"==typeof t[e]?.limit&&(r=t[e].limit),{hasLimit:null!==r,limit:null!==r?r:null}},jn=()=>{const{layoutMode:e}=en();return{isInline:"inline"===e,isWindow:"window"===e,isApp:"app"===e,isResolving:!e}},Tn=Tt(({visibility:e})=>e,e=>e.visibility),In=Tt(({visibility:e})=>e,e=>e.showInlineView),Nn=Tt(({visibility:e})=>e,e=>e.setInputFocus),kn=[Ot.open,Ot.minimized,Ot.hidden],On=lt("setVisibility",(e,{getState:t,extra:{api:n,eventBus:r}})=>{const o=t(),s=e.visibility,a=Tn(o),i=Nt(o),c=n.hasConversation(),l=Lt(o),{visibilityCallback:u=Rt,layoutMode:d}=l,{unreadEvents:p}=fn(o),f=u({hasResponded:i,previousVisibility:a,requestedVisibility:s,config:l});if(f&&!kn.includes(f))return console.error('The visibilityCallback function should return "open", "minimized" or "hidden".'),{visibility:null,setInputFocus:e.setInputFocus};if(a===f)return{visibility:null,setInputFocus:e.setInputFocus};const h=n.store.get(kt);return n.store.set(kt,{...h||{},[d]:s}),s&&r.emit("ui.visible",s,{visibility:s,hasConversation:c,hasResponded:i,unreadMessageCount:p}),{visibility:f,setInputFocus:e.setInputFocus}}),Ln=lt("initialize",async(e,{dispatch:t,getState:n,extra:{api:r}})=>{const{layoutMode:o}=Lt(n()),s=r.store.get(kt)?.[o]||Ot.initialize;return t(On({visibility:s})),s}),Rn=lt("initializeApp",async(e,{extra:{api:t,config:n},rejectWithValue:r})=>{const o=n?.context?.contentLocale,s=n?.context?.userLocale;try{return t.hasConversation()?{initialState:await t.getConversationIntitialState(),contentLocale:o,userLocale:s,config:n}:(n?.context?.topic&&t.send("action",{type:k,body:{name:n.context.topic,fallbackMessage:n.context.topic}}),{initialState:void 0,contentLocale:o,userLocale:s,config:n})}catch(e){if(e instanceof g){const e=new g;return r({name:e.name,message:e.message,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})}const t=new bt;return r({name:t.name,message:t.message,langKey:t.langKey})}}),An=((e,t,n)=>{const{wait:r=300,maxWait:o=0,leading:s=!1}=n??{};let a,i=null,c=null;const l=()=>{c&&clearTimeout(c),c=void 0,a&&(a(!0),a=void 0)};return lt(e,t,{condition:()=>{const e=s&&!i;return i&&clearTimeout(i),i=setTimeout(()=>{l(),i=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(wt()),await t(xt()),await t(Rn()),t(Ln())},{wait:2e3,leading:!0}),Pn="cvco",Mn=50,Un=300,Dn=["alwaysShowEntryLabel","hideOnNoUserResponse","connectWhenInView","showDisclaimer","showSuggestions","continueChat","preChat","namespace","customComponents","defaults","layoutMode","api","zIndex","context","appContainerClassNames","messages","visible","visibilityCallback","errorCallback","agentParticipant","userParticipant","startChatIcon","notificationAudioURL"],Fn=(e,t)=>{const{messages:n,...r}=(o=t,Dn.reduce((e,t)=>(t in o&&(e[t]=o[t]),e),{}));var o;let s=e;return Object.keys(r).length>0&&(s={...s,...r}),n&&(s={...s,messages:{...s.messages,...n}}),s},zn=mt({name:"config",initialState:{namespace:"default",layoutMode:"window",messages:{agent:{showAvatar:!1,showName:!1},user:{showAvatar:!1,showName:!1},timeIndicator:{enabled:!1,threshold:36e5}},alwaysShowEntryLabel:!1,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})=>Fn(e,t),updateConfig:(e,{payload:t})=>Fn(e,t),setPreChatEvents:(e,{payload:t})=>{e.preChatEvents=t}},extraReducers:e=>{e.addCase(wt.fulfilled,e=>e).addCase(xt.fulfilled,(e,{payload:{preChat:t,agentParticipant:n,userParticipant:r,startChatIcon:o,defaultContentLocale:s,defaultUserLocale:a}})=>{e.preChatEvents=t.map(e=>({type:"message",payload:e})),e.context.contentLocale=s,e.context.userLocale=a,e.agentParticipant=n,e.userParticipant=r,e.startChatIcon=o||""})}}),{setConfig:Bn,updateConfig:Vn,setPreChatEvents:$n}=zn.actions,Hn=zn.reducer,Wn={userHasResponded:!1},Gn=mt({name:"app",initialState:Wn,reducers:{setHasResponded:(e,{payload:t})=>{e.userHasResponded=t}},extraReducers:e=>{e.addCase(An.pending,()=>Wn).addCase(Rn.fulfilled,(e,{payload:t})=>{t.initialState&&"userResponded"in t.initialState&&(e.userHasResponded=t.initialState.userResponded||!1)})}}),{setHasResponded:qn}=Gn.actions,Kn=Gn.reducer;class Jn extends m{constructor(e,...t){super(e,...t),this.name="SeamlyOfflineError",this.langKey="errors.seamlyOffline"}}const Xn={SeamlyGeneralError:v,SeamlyConfigurationError:y,SeamlySessionExpiredError:g,SeamlyOfflineError:Jn,SeamlyUnauthorizedError:b,SeamlyUnavailableError:bt},Yn=Je("catch-error",e=>({payload:e})),Qn={controls:{}},Zn={touched:!1},er={controls:Zn},tr=mt({name:"forms",initialState:er,reducers:{registerForm:(e,{payload:{persistData:t,formId:n}})=>{const r=t?e[n]??{...Qn,persistData:t}:{...Qn,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]:Zn}},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(An.pending,()=>er)}}),{registerForm:nr,deregisterForm:rr,registerControl:or,deregisterControl:sr,updateControlValue:ar,updateControlTouched:ir}=tr.actions,cr=tr.reducer,lr=lt("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}}),ur={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},dr=mt({name:"app",initialState:ur,reducers:{setInitialLocale:(e,t)=>{e.initialLocale=t.payload},setTranslations:(e,{payload:t})=>{e.translations=t}},extraReducers:e=>{e.addCase(An.pending,()=>ur).addCase(xt.fulfilled,(e,{payload:t})=>{e.initialLocale=t.defaultUserLocale}).addCase(lr.pending,e=>{e.isLoading=!0}).addCase(lr.rejected,e=>{e.isLoading=!1}).addCase(lr.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:pr,setTranslations:fr}=dr.actions,hr=dr.reducer,mr=lt("getConversation",async(e,{extra:{api:t},rejectWithValue:n})=>{try{const e=await t.getConversation();if(!e)throw new Error("No conversation found");return e}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.at(-1);return r&&("lastEvent"in e?e?.lastEvent?.id:e?.body?.lastEvent?.id)!==r.payload.id}}),yr={error:void 0},vr=mt({name:"interrupt",initialState:yr,reducers:{setInterrupt:(e,t)=>{e.error=t.payload},clearInterrupt:()=>yr},extraReducers:e=>{e.addCase(xt.pending,()=>yr).addMatcher(nt(Rn.rejected,xt.rejected,lr.rejected,On.rejected,Ln.rejected,mr.rejected),(e,{payload:t})=>{e.error=t})}}),{setInterrupt:gr,clearInterrupt:br}=vr.actions,xr=vr.reducer,wr=["SeamlyGeneralError","SeamlyConfigurationError","SeamlySessionExpiredError","SeamlyOfflineError","SeamlyUnauthorizedError","SeamlyUnavailableError"];n(2577);const _r=({type:e,payload:t})=>"hidden"===document.visibilityState||e===w.message&&!t.fromClient||e===w.info&&t.type===_,Cr=e=>e.sort(({payload:{occurredAt:e=0}},{payload:{occurredAt:t=0}})=>e-t),Sr=(e,t)=>{if(!e)return{participants:{},currentAgent:""};const{participants:n}=e||{participants:{}},{id:r,avatar:o,name:s,introduction:a}=t.participant,i=n[r],c={...n,[r]:i?{...i,...o?{avatar:o}:{},...s?{name:s}:{},...a?{introduction:a}:{}}:t.participant};return{...e,participants:c,currentAgent:e.currentAgent===r||t.fromClient?e.currentAgent:r}},Er=(e,t)=>{if(!0===t?.payload?.fromClient||"message"!==t?.type)return e;const n=t?.payload?.translatedEntry||t?.payload?.entry,{blockAutoEntrySwitch:r}=e,o=t?.payload?.actions||{},s=t?.payload?.translatedActions||{},{type:a,options:i}=n||{};let c=e.active;return r||a===e.userSelected||(c=a),{...e,active:c,optionsOverride:{...a?{[a]:i}:{}},actions:o,translatedActions:s}},jr={events:[],isLastEventFromClient:!1,initialState:{userResponded:!1,context:{contentLocale:"",translationActive:!1,userLocale:""}},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,skiplinkElementId:z(),skiplinkTargetId:z(),optionsButtonId:z(),headerCollapseButtonId:z(),windowOpenButtonId:z(),serviceData:{},options:{features:{webNotifications:{enabled:!1}},panelActive:!1,optionActive:"",userSelectedOptions:{}},showFileUpload:!1,currentUploads:[],processingFileUploads:[],entryMeta:{default:C,optionsOverride:{},defaultEntry:C,active:C,userSelected:null,blockAutoEntrySwitch:!1,options:{},actions:{},translatedActions:{}},seamlyContainerElement:null},Tr=mt({name:"store",initialState:jr,reducers:{addEvent:(e,t)=>{const{type:n,payload:r}=t.payload,o=Object.prototype.hasOwnProperty.call(e.options.features,D);let s={...e.options};if(o&&(n===w.message||n===w.participant)&&!r.fromClient){const e="message"===n?r.entry?.type:void 0;s={...s,features:{...s.features,uploads:{enabled:s.features.uploads?.enabled||!1,...s.features?.uploads||{},enabledFromEntry:e===S}}}}const a=_r(t.payload);if(!e.events.find(e=>e.payload.id===r.id)){if(!e.events.find(e=>"transactionId"in e.payload&&"transactionId"in r&&e.payload.transactionId===r.transactionId&&(!t.payload.type||e.type===t.payload.type)&&r.fromClient)){const i=Er(e.entryMeta,t.payload);e.entryMeta=o||i.active!==S?i:{...e.entryMeta},e.options=s,a&&(e.unreadEvents+=1,"service_data"!==n&&(t.payload.payload.messageStatus=r.fromClient?j:E)),t.payload.payload.key=z(),e.events.push(t.payload),e.events=Cr(e.events)}r.fromClient&&(e.isLastEventFromClient=r.fromClient)}},updateEvent:(e,{payload:t})=>{const n=e.events.find(e=>"service_data"!==e.type&&"service_data"!==t.type&&e.payload.transactionId===t.payload.transactionId);n?(n.payload.id=t.payload.id,n.payload.occurredAt=t.payload.occurredAt):e.events.push(t),e.events=Cr(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===E&&{messageStatus:j}}),e))},setLoadedImageEventIds:(e,{payload:t})=>{e.loadedImageEventIds.push(t)},setEvents:(e,{payload:{messages:t,unreadMessageCount:n,userResponded:r,participants:o,service:s,serviceData:a,ui:i}})=>{const c=((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(({type:e,payload:t})=>!("participant"===e&&!t?.participant?.introduction)).reverse();return Cr([...r,...n])})(e.events,t),l=Object.fromEntries(Object.entries(o).map(([e,t])=>[t.id,t])),u=t.find(e=>"participant"===e.type),d=u?.payload?.participant?.id,{entry:p}=s?.settings||{},f=Er({...e.entryMeta,...p,active:_,options:{...p?.options}},c.findLast(e=>"message"===e.type));let h={...e.options.features};const m=t.find(e=>!e.payload.fromClient&&["message","participant"].includes(e.type)),y=Object.prototype.hasOwnProperty.call(h,D);if(y&&"message"===m?.type){const e=m.payload.entry?.type||"";h={...h,uploads:{enabled:h.uploads?.enabled||!1,enabledFromEntry:e===S}}}e.unreadEvents=n,e.userHasResponded=r,e.events=c.filter(e=>"participant"!==e.type||!!e.payload.participant?.introduction),e.participantInfo={...e.participantInfo,...d?Sr(e.participantInfo,{participant:l[d]}):{},participants:l},e.historyLoaded=!0,e.serviceInfo={...e.serviceInfo,proactiveMessages:s?.settings?.proactiveMessages?.enabled||!1,activeServiceSessionId:s?.sessionId},e.serviceData={...e.serviceData,...a},e.options={...e.options,features:h},e.entryMeta=y||f.active!==S?f:{...e.entryMeta},e.resumeConversationPrompt=i.resumeConversationPrompt||!1,d&&(e.headerTitles.subTitle=l[d]?.name)},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=on(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=Sr(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=jr.unreadEvents},setServiceDataItem:(e,{payload:t})=>{e.serviceData[t.type]=t},setFeatures:(e,{payload:t})=>{t.features&&(e.options.features=t.features)},updateFeatures:(e,{payload:t})=>{Object.entries(t).forEach(([t,n])=>{e.options.features[t]=n})},setFeatureEnabledState:(e,{payload:t})=>{Object.prototype.hasOwnProperty.call(e.options.features,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.options={...e.entryMeta.options,upload:{...t.options.upload}},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={}},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(An.pending,()=>jr).addCase(Rn.pending,e=>{e.isLoading=!0}).addCase(xt.fulfilled,(e,{payload:t})=>{e.headerTitles.subTitle=t.agentParticipant?.name||"",t.features&&(e.options.features=t.features)}).addCase(Rn.fulfilled,(e,{payload:t,type:n})=>{if(e.isLoading=!1,!t.initialState)return;e.initialState=t.initialState,"messages"in t.initialState&&Tr.caseReducers.setEvents(e,{payload:t.initialState,type:n});const{initialState:{service:r}}=t;r?.settings?.entry?.options?.upload&&Tr.caseReducers.setFeatureEnabledState(e,{payload:{key:D,enabled:r.settings.entry.options.upload.enabled||!1},type:n})}).addMatcher(nt(Ur,Dr),e=>{e.isLastEventFromClient=!1})}}),{addEvent:Ir,updateEvent:Nr,clearAllUploads:kr,clearEvents:Or,clearFeatures:Lr,clearIdleDetachCountdown:Rr,clearResumeConversationPrompt:Ar,decrementIdleDetachCountdownCounter:Pr,hideOption:Mr,initIdleDetachCountdown:Ur,initResumeConversationPrompt:Dr,registerUpload:Fr,setActiveEntryType:zr,setActiveService:Br,setBlockAutoEntrySwitch:Vr,setEventsRead:$r,setFeatureEnabledState:Hr,updateFeatures:Wr,setFeatures:Gr,setHeaderSubTitle:qr,setHeaderTitle:Kr,setEvents:Jr,setInitialState:Xr,setIsLoading:Yr,setLoadedImageEventIds:Qr,setParticipant:Zr,setSeamlyContainerElement:eo,setServiceDataItem:to,setServiceEntryMetadata:no,clearAbortTransaction:ro,setUploadComplete:oo,setUploadError:so,setUploadProgress:ao,startProcessingImage:io,doneProcessingImage:co,setUserEntryType:lo,setUserSelectedOption:uo,setUserSelectedOptions:po,showOption:fo,stopIdleDetachCountdownCounter:ho,setProactiveMessages:mo}=Tr.actions,yo=Tr.reducer,vo=({dispatch:e})=>t=>n=>{const r=t(n);if(xt.fulfilled.match(n)&&n.payload.defaultUserLocale)return e(lr(n.payload.defaultUserLocale)),r;if(Rn.fulfilled.match(n))return n.payload.userLocale&&e(lr(n.payload.userLocale)),r;if(Ir.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(lr(t.translationLocale)),r}return r},go={isActive:!1,currentLocale:void 0,isAvailable:!1,languages:[],containerId:rt(),translatedEventGroups:{},translationProposal:null},bo=(e,t)=>{const n=[...e].reduce((e,{payload:n,type:r},o,s)=>{if(e[t]&&n.id){if("info"===r&&"divider"===n?.type&&n?.body?.translationEnabled)return s.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}},xo=mt({name:"translation",initialState:go,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}=bo(t,n);e.lastGroupId=r},disableEventsTranslation:(e,{payload:{events:t,id:n}})=>{const{lastGroupId:r,groupId:o,eventIds:s}=bo(t,n);e.lastGroupId=r,e.translatedEventGroups[o]=s},disableTranslationProposalPrompt:e=>{e.translationProposal=null},setTranslationProposalPrompt:(e,{payload:t})=>{e.translationProposal=t}},extraReducers:e=>{e.addCase(An.pending,()=>go).addCase(xt.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(lr.fulfilled,(e,{payload:t})=>{e.currentLocale=t.userLocale}).addCase(Ir,(e,{payload:t})=>{t.payload.id&&e.lastGroupId&&e.translatedEventGroups[e.lastGroupId]&&e.translatedEventGroups[e.lastGroupId].push(t.payload.id)}).addCase(Jr,(e,{payload:t})=>{e.translationProposal=t?.ui?.translationProposal}).addCase(Rn.fulfilled,(e,{payload:t})=>{e.translationProposal=t.initialState?.ui?.translationProposal})}}),{enableTranslation:wo,disableTranslation:_o,enableEventsTranslation:Co,disableEventsTranslation:So,setTranslationProposalPrompt:Eo,disableTranslationProposalPrompt:jo}=xo.actions,To=xo.reducer,Io=mt({name:"visibility",initialState:{visibility:Ot.initialize,showInlineView:!1,setInputFocus:!1},reducers:{setShowInlineView:e=>{e.showInlineView=!0}},extraReducers:e=>{e.addCase(On.fulfilled,(e,{payload:{visibility:t,setInputFocus:n}})=>{t&&(e.visibility=t,e.setInputFocus=Boolean(n))}).addCase(xt.fulfilled,(e,{payload:t})=>{t.connectWhenInView||(e.showInlineView=!t.connectWhenInView)})}}),{setShowInlineView:No}=Io.actions,ko=Io.reducer,Oo=Ve({state:yo,app:Kn,config:Hn,i18n:hr,translations:To,visibility:ko,forms:cr,interrupt:xr});const Lo=Xt;var Ro=n(2086),Ao=n.n(Ro),Po=n(8785),Mo=n(1162);function Uo(e=""){const t=e=>/\s/.test(e),n=[],r={};let o=0,s=null,a=!1,i=0;for(;i<e.length;){if(a&&(t(e[i])||"{"===e[i]))a=!1,s=e.slice(o,i),"{"===e[i]&&i--;else if(!a&&!t(e[i])){const t="{"===e[i];if(s&&t){const t=Do(e,i);if(-1===t)throw new Error(`Unbalanced curly braces in string: "${e}"`);r[s]=e.slice(i+1,t),i=t,s=null}else s&&(n.push(s),s=null),a=!0,o=i}i++}return a&&(s=e.slice(o)),s&&n.push(s),{args:n,cases:r}}function Do(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 Fo(e){return zo(e.slice(1,-1),",",3)}function zo(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 s=e.substring(0,o).trim(),a=e.substring(o+t.length+1).trim();return r.push(s),zo(a,t,n-1,r)}let Bo,Vo=0;const $o="other";function Ho(e,t){let n=0,r="",o=0;const s={};for(;n<e.length;){if("#"!==e[n]||o)r+=e[n];else{let e="__hashToken"+Vo++;r+=`{${e}, number}`,s[e]=t}"{"===e[n]?o++:"}"===e[n]&&o--,n++}return{caseBody:r,numberValues:s}}const Wo="other",Go=Tt(({i18n:e})=>e,({translations:e})=>e),qo=Tt(({i18n:e})=>e,({initialLocale:e})=>e),Ko=Tt(({i18n:e})=>e,({userLocale:e})=>e),Jo=Tt(({i18n:e})=>e,({isLoading:e})=>e),Xo=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=Do(e,n);if(-1===r)throw new Error(`Unbalanced curly braces in string: "${e}"`);{let o=e.substring(n,r+1);if(o){let s=[],a=e.substring(0,n);a&&s.push(a);let[i,c,l]=Fo(o),u=t[i],d=c&&this.typeHandlers[c];s.push(d?d(u,l,this.locale,t,this.process.bind(this)):u);let p=e.substring(r+1);return p&&s.push(this.process(p,t)),s}}}return[e]}}("en-GB",{plural:function(e,t,n,r,o){const{args:s,cases:a}=Uo(t);let i=parseInt(e);s.forEach(e=>{e.startsWith("offset:")&&(i-=parseInt(e.slice(7)))});const c=[];if("PluralRules"in Intl){void 0!==Bo&&Bo.resolvedOptions().locale===n||(Bo=new Intl.PluralRules(n));const e=Bo.select(i);e!==$o&&c.push(e)}1===i&&c.push("one"),c.push(`=${i}`,$o);for(let e=0;e<c.length;e++){const t=c[e];if(t in a){const{caseBody:e,numberValues:n}=Ho(a[t],i);return o(e,{...r,...n})}}return e},select:function(e,t,n,r,o){const{cases:s}=Uo(t);return e in s?o(s[e],r):Wo in s?o(s[Wo],r):e}});function Yo(){const e=Zt(Go),t=Zt(Ko),n=Zt(qo),r=Zt(Jo);return{t:(0,Mo.useCallback)((n,o={})=>{if(!e)return"";const s=e[n];return s?Xo.format(s,o):(r||console.warn(`Translation key: ${n} is missing in locale: ${t}`),"")},[e,t,r]),userLocale:t,initialLocale:n}}const Qo=()=>{const e=Lo(),t=Zt(Tn),n=Zt(Nn),r=!!t&&t!==Ot.hidden,o=t===Ot.open,s=t===Ot.minimized,a=(0,Mo.useCallback)(t=>{e(On("string"==typeof t||null===t?{visibility:t,setInputFocus:!1}:t))},[e]);return{isVisible:r,isOpen:o,isMinimized:s,visible:t,setVisibility:a,openChat:()=>{a({visibility:Ot.open})},closeChat:()=>{a({visibility:Ot.minimized})},setInputFocus:n}},Zo=({freezeOnceVisible:e=!1,enabled:t=!0,containerRef:n=(0,Po.createRef)()})=>{const[r,o]=(0,Mo.useState)(null),s=!!r?.isIntersecting||!t,a=s&&e,i=([e])=>o(e);return(0,Mo.useEffect)(()=>{const e=n?.current;if(!window.IntersectionObserver||a||!e||!t)return()=>{};const r=new IntersectionObserver(i,{threshold:0,root:null,rootMargin:"0%"});return r.observe(e),()=>r.disconnect()},[n,t,a]),{isVisible:s,containerRef:n}},es=()=>Zt(Nt),ts=(0,Po.createContext)(null),ns=(0,Po.createContext)(null),rs=()=>{const e=(0,Mo.useContext)(ns);if(!e)throw new Error("useSeamlyEventBusContext has to be used within <SeamlyEventBusContext.Provider>");return e},os=()=>{const e=(0,Mo.useContext)(ts);if(!e)throw new Error("useSeamlyApiContext has to be used within <SeamlyApiContext.Provider>");return e},ss=()=>os().store,as=()=>{const e=os();return(0,Mo.useCallback)(()=>e.hasConversation(),[e])},is=()=>{const e=os(),t=Lo(),n=rs(),r=es(),o=as(),{visible:s,setVisibility:a}=Qo(),i=bn(),c=(0,Mo.useCallback)((...e)=>{n.emit(...e)},[n]),l=(0,Mo.useCallback)(()=>{c("ui.beforeStart",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i}),e.send("start_conversation"),c("ui.start",{visibility:s,hasConversation:o(),hasResponded:r,unreadMessageCount:i})},[e,c,o,r,i,s]),u=(0,Mo.useCallback)(async()=>{await t(An())},[t]),d=(0,Mo.useCallback)(e=>({type:e,id:z(),transactionId:z(),fromClient:!0,participant:"seamly-client-participant",occurredAt:1e3*Date.now()}),[]),p=(0,Mo.useCallback)(e=>({...d("text"),body:{text:e}}),[d]),f=(0,Mo.useCallback)(({body:n,config:r={}})=>{if(""===n.trim())return;const o={...p(n),...r};e.send("message",o),c("message",o),t(Ir({type:"message",payload:{...o,body:o.body,type:o.type,optimisticallyInjected:!0}}))},[e,t,c,p]),h=(0,Mo.useCallback)((e,n=z())=>{t(Ir({type:"message",payload:{...p(e),transactionId:n}}))},[t,p]),m=(0,Mo.useCallback)((e,n,r,o,s,a)=>{t(Ir({type:"message",payload:{type:"upload",id:e,transactionId:n,fromClient:!0,participant:"seamly-client-participant",occurredAt:r,body:{contentType:o,filename:s,filesize:a,id:e||"",isDeleted:!1}}}))},[t]),y=(0,Mo.useCallback)(t=>{t&&e.send("action",t)},[e]),v=(0,Mo.useCallback)(t=>{e.sendContext(t)},[e]),g=(0,Mo.useCallback)(()=>e.connected?Promise.reject(new Error("The API is already connected")):e.connect().then(e=>{e&&(t(Xr(e)),e.messages&&e.messages.length&&t(Jr(e)),e.userResponded&&(t(qn(e.userResponded)),a({visibility:Ot.open})))}).catch(e=>{t(gr({name:e?.name,message:e?.message,langKey:e?.langKey,action:e?.action,originalEvent:e?.originalEvent,originalError:e?.originalError}))}),[e,t,a]);return{connect:g,start:l,sendMessage:f,sendAction:y,sendContext:v,reset:u,emitEvent:c,addMessageBubble:h,addUploadBubble:m,apiConnected:e.connected,apiConfigReady:e.configReady}},cs=(0,Po.createContext)(null),ls=()=>{const e=(()=>{const e=(0,Mo.useContext)(cs);if(!e)throw new Error("useSeamlyLiveRegionContext has to be used within <SeamlyLiveRegionContext.Provider>");return e})();return{sendPolite:(0,Mo.useCallback)(t=>{t&&e({ariaLive:M,messageText:t})},[e]),sendAssertive:(0,Mo.useCallback)(t=>{t&&e({ariaLive:P,messageText:t})},[e])}},us=Tt(({interrupt:e})=>e,({error:e})=>e),ds=Tt(us,e=>Boolean(e));function ps(){const{t:e}=Yo(),t=Zt(us);return{hasError:Zt(ds),meta:(0,Mo.useMemo)(()=>{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`),s=e(`${n}.message`),a=e(`${n}.srText`),i=r?e(`${n}.buttonText`):null;return{...n?{title:o,message:s,srText:a}:{},...r?{action:r}:{},...r&&n?{buttonText:i}:{},originalError:t}},[t,e]),error:t}}const fs=()=>{const{t:e}=Yo(),{isInline:t,isWindow:n,isApp:r}=jn(),{isOpen:o,isVisible:s}=Qo(),a=Zt(In),{start:i,connect:c,apiConfigReady:l,apiConnected:u}=is(),d=(0,Mo.useRef)(!1),{sendAssertive:p}=ls();!function(){const{meta:{originalError:e,action:t}}=ps(),n=Lo(),{reset:r}=is(),o="SeamlySessionExpiredError"===e?.name,s=(0,Mo.useRef)(0),a=(0,Mo.useRef)(null);(0,Mo.useEffect)(()=>{if(o&&"reset"===t){if(s.current>=10){a.current=setTimeout(()=>{s.current=0},1e4);const e=new v;return n(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),()=>{}}s.current+=1,r()}return()=>{a.current&&clearTimeout(a.current)}},[t,r,o,n])}(),(0,Mo.useEffect)(()=>{s&&setTimeout(()=>{p(e("window.srTexts.onLoad"))},500)},[s,p,e]),(0,Mo.useEffect)(()=>{s&&p(e(o?"window.srTexts.onOpen":"window.srTexts.onClose"))},[o,s,p,e]),(0,Mo.useEffect)(()=>{l||u||(d.current=!1)},[l,u]);const f=(0,Mo.useCallback)(async()=>{u||(d.current=!0,await c()),(r||o||s&&t)&&i()},[u,c,r,t,o,s,i]);(0,Mo.useEffect)(()=>{!l||d.current||n&&!o||!(!t||s&&a)||f()},[l,f,t,o,s,n,a])},hs=require("preact/compat"),ms=require("preact/jsx-runtime"),ys=({children:e})=>(fs(),(0,ms.jsx)(ms.Fragment,{children:e})),vs=(0,Po.createContext)(null),gs=(e=0)=>new Promise(t=>{setTimeout(t,e)}),bs=()=>{const{seamlyContainerElement:e}=hn(),t=Lo();return[e,(0,Mo.useCallback)(e=>{t(eo(e))},[t])]},xs=e=>(0,Mo.useCallback)(()=>{var t;t=e,requestAnimationFrame(async()=>{await gs(180);const e="string"==typeof t?document.getElementById(t):t;un(e)})},[e]),ws=()=>{const e=wn();return xs(e)},_s=()=>{const{windowOpenButtonId:e}=hn();return xs(e)};n(3215);const Cs=e=>Tt(e=>e.translations.translatedEventGroups,t=>Object.values(t).every(t=>e?.payload?.id&&!t.includes(e.payload.id)));function Ss(){const{sendContext:e}=is(),t=Lo(),n=en(),r=(0,Mo.useCallback)((t,n)=>{e({userLocale:t,source:n})},[e]),o=(0,Mo.useCallback)(()=>{e({userLocale:n.context?.contentLocale}),t(_o())},[n.context?.contentLocale,t,e]),{languages:s,isActive:a,isAvailable:i,currentLocale:c}=Zt(({translations:e})=>e);return{languages:s,isActive:a,isAvailable:i,currentLocale:c,enableTranslations:r,disableTranslations:o}}const Es=e=>{const t=Zt(Cs(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},s=!!n;return{body:t&&s?n:o,hasTranslation:s,isTranslated:t&&s,locale:r?.locale}};function js(){const e=Zt(({translations:e})=>e.containerId);return{id:e,focusContainer:xs(e)}}function Ts(e){const{languages:t}=Ss();return(0,Mo.useMemo)(()=>t?.find(t=>t.locale===e)?.nativeName,[e,t])}const Is=(...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(Pn)>-1?e:[Pn,e].join("-")).join(" "),Ns=()=>en().appContainerClassNames,ks=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},Os=()=>{const e=os();return(0,hs.useSyncExternalStore)(f.subscribe,()=>e.conversation)},Ls=(0,Po.createContext)(null),Rs=()=>{const{showFileUpload:e,entryMeta:{options:t,optionsOverride:n},options:{features:{uploads:r}}}=hn(),{allowedMimeTypes:o,maxSize:s}=n?.upload||{},{enabled:a,enabledFromEntry:i}=r||{},{allowedMimeTypes:c,maxSize:l}={...t.upload||{allowedMimeTypes:[],maxSize:0},...o?{allowedMimeTypes:o}:{},...s?{maxSize:s}:{}};return{showFileUpload:e,accountAllowsUploads:!!r,serviceAllowsUploads:i||a,allowedMimeTypes:c,maxSize:l}},As=()=>{const{currentUploads:e}=hn(),t=Lo(),n=(()=>{const e=(0,Mo.useContext)(Ls);if(!e)throw new Error("useSeamlyFileUploadContext has to be used within <SeamlyFileUploadContext.Provider>");return e})();return{uploadFile:(0,Mo.useCallback)(e=>{n(e)},[n]),clearUploads:(0,Mo.useCallback)(()=>{t(kr())},[t]),currentUploads:e,isUploading:e.some(e=>e.uploading),isComplete:e.every(e=>e.complete)}},Ps=()=>{const{t:e}=Yo(),{options:t}=hn(),{panelActive:n,optionActive:r,userSelectedOptions:o,features:s}=t,{extraMenuItem:a,sendTranscript:i}=s,c={extraMenuItem:a,sendTranscript:i},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||i,p=Lo(),{get:f,set:h}=ss();return{allowOptionSelection:d,userSelectedOptions:o,features:s,menuOptions:u,initUserSelectedOptions:(0,Mo.useCallback)(()=>{const e=f("options")||{};p(po(e))},[f,p]),setUserSelectedOptions:(0,Mo.useCallback)(e=>{p(po(e)),h("options",e)},[h,p]),setUserSelectedOption:(0,Mo.useCallback)((e,t)=>{const n=f("options")||{};"object"==typeof n&&h("options",{...n,[e]:t}),p(uo({option:e,value:t}))},[p,f,h]),showOption:e=>{p(fo(e))},hideOption:()=>{p(Mr())},panelActive:n,optionActive:r}},Ms=()=>{const{optionsButtonId:e}=hn();return{id:e,focusButton:xs(e)}},Us=(0,Po.createContext)(null),Ds=()=>{const e=(0,Mo.useContext)(Us);if(!e)throw new Error("useSeamlyActivityEventHandler has to be used within <SeamlyActivityEventContext.Provider>");return e},Fs=()=>{const e=Lo(),{idleDetachCountdown:{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a}}=hn(),{isOpen:i}=Qo(),c=(0,Mo.useRef)({hasCountdown:!1,wasStopped:!1});c.current={hasCountdown:t,wasStopped:a||!1};const{emitEvent:l,sendAction:u}=is(),{t:d}=Yo(),{sendAssertive:p,sendPolite:f}=ls(),h=(0,Mo.useCallback)(e=>{i&&p(e)},[i,p]),m=(0,Mo.useCallback)(e=>{i&&f(e)},[i,f]),y=(0,Mo.useCallback)(t=>{const n=(e=>Math.ceil(e/1e3))(t),r=on(n);e(Ur({delaySeconds:n,delayTime:r})),l("idleTimer.start"),h(`${d("idleDetachWarning.countdownTitle")} ${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",r)}`)},[e,l,h,d]),v=(0,Mo.useCallback)((t=void 0,n=!1)=>{const{hasCountdown:r,wasStopped:o}=c.current;r&&(t||(n||u({type:I}),h(d("idleDetachWarning.notifyTransferText"))),o||l("idleTimer.stop"),e(Rr()))},[e,l,u,h,d]),g=(0,Mo.useCallback)(()=>{if(!o||o<=0)return;const t=o-1;t%10==0&&h(`${d("idleDetachWarning.countdownText")} ${d("idleDetachWarning.countdownTimer",on(t))}`),e(Pr())},[e,o,h,d]),b=(0,Mo.useCallback)(()=>{n&&(e(ho()),o&&(l("idleTimer.stop"),m(d("idleDetachWarning.srCountDownStoppedText"))))},[e,l,n,o,m,d]);return{hasCountdown:t,isActive:n,count:r,remaining:o,timer:s,wasStopped:a,initCountdown:y,endCountdown:v,decrementCountdown:g,stopCountdown:b}},zs=()=>{const e=Lo(),t=hn().resumeConversationPrompt,{sendAction:n}=is(),{t:r}=Yo(),{sendAssertive:o}=ls();return{continueChat:()=>{n({type:N,body:{type:"resume_conversation_prompt"}}),e(Ar())},hasPrompt:t,restartChat:()=>{o(r("resumeConversationPrompt.srNotifyRestartText")),n({type:I}),e(Ar())}}},Bs=()=>{const[e]=(0,Mo.useState)(()=>z());return e},Vs=(e,t)=>{const n=Os();(0,Mo.useEffect)(()=>{n.onMessage((n,r)=>(t&&!t({type:n,payload:r})||e({type:n,payload:r}),r))},[e,t,n])},$s=({eventPayload:e})=>{const{t}=Yo(),{fromClient:n,participant:r}=e,o=(e=>hn().participantInfo.participants[e])(r)||{},{messages:s}=en(),a=n?t("participants.user.name"):o&&o.name,{showAvatar:i,showName:c}=s&&s[n?"user":"agent"]||{};if(!i&&!c)return null;const l=[];return i&&a&&o.avatar&&l.push((0,ms.jsx)("span",{className:Is("message__avatar"),children:(0,ms.jsx)("img",{src:o.avatar,className:Is("avatar"),alt:""})})),c&&a&&l.push((0,ms.jsx)("span",{className:Is("message__author-name"),children:a})),l.length>0?(0,ms.jsx)("div",{className:Is("message__author"),children:l}):null},Hs=({showParticipant:e=!0,event:t,type:n,modifiers:r,children:o,bodyProps:s={},info:a,...i})=>{const c=ks(t),{hasTranslation:l,isTranslated:u,locale:d}=Es(t);return n&&c.push(`message--type-${n}`),r&&("string"==typeof r&&(r=r.split(" ").filter(e=>e.length)),r.forEach(e=>{c.push(`message--${e}`)})),u&&c.push("message--is-translated"),l&&c.push("message--has-translation"),u&&(s={...s,lang:d}),(0,ms.jsx)(ms.Fragment,{children:(0,ms.jsxs)("div",{className:Is(c),...i,children:[e&&(0,ms.jsx)($s,{eventPayload:t.payload}),(0,ms.jsx)("div",{className:Is("message__body"),...s,children:o}),a&&(0,ms.jsx)("div",{"aria-hidden":"true",className:Is("message__info"),children:a})]})})},Ws=({id:e,action:t,buttonText:n,description:r,hasFocus:o,image:s,title:a,isCarouselItem:i})=>{const c=(0,Mo.useRef)(null),{sendMessage:l,sendAction:u,emitEvent:d}=is(),p=Bs(),f=(0,Mo.useRef)(!1),h=t?.type===F?"a":"button",m=(0,Mo.useCallback)(()=>d(`action.${O}`,{type:O,originMessage:e,action:t}),[d,e,t]),y=(0,Mo.useCallback)(()=>{if(m(),"ask"===t?.type)l({body:t?.ask});else if("topic"===t?.type){const{topic:e,fallbackMessage:n}=t;u({type:k,body:{name:e,fallbackMessage:n}})}},[l,t,u,m]),v=(0,Mo.useMemo)(()=>t?.type===F?{href:t?.link,rel:"noopener noreferrer",target:t?.newTab?"_blank":"_self",onClick:m}:{onClick:y},[t,y,m]);return(0,Mo.useEffect)(()=>{i&&(o&&f.current?window.requestAnimationFrame(()=>c.current?.focus()):c.current?.blur()),f.current=!0},[o,i]),(0,ms.jsxs)("div",{className:Is("card__wrapper"),id:e,tabIndex:-1,ref:c,children:[s?(0,ms.jsx)("img",{className:Is("card__image"),src:s,alt:""}):null,(0,ms.jsxs)("div",{className:Is("card__content"),id:e,children:[a&&(0,ms.jsx)("h2",{className:Is("card__title"),children:a}),r&&(0,ms.jsx)("div",{className:Is("card__description"),dangerouslySetInnerHTML:{__html:r}}),(0,ms.jsx)(h,{tabIndex:i&&!o?-1:void 0,className:Is("button","button--primary"),"aria-describedby":p,...v,children:n})]})]})};function Gs({item:e,items:t,index:n,isActive:r}){const{t:o}=Yo();return(0,ms.jsx)("div",{className:Is("carousel-item",`carousel-item--${e.type}`),role:"group","aria-roledescription":"slide","aria-label":o("carousel.slide.label",{index:n+1,total:t.length}),children:(0,ms.jsx)(Ws,{...e,isCarouselItem:!0,hasFocus:r})})}const qs={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'}},Ks=({name:e,size:t="32",className:n,alt:r})=>(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)("div",{"aria-hidden":"true",className:n||Is("icon"),dangerouslySetInnerHTML:{__html:qs[e][t]}}),r&&(0,ms.jsx)("span",{className:Is("visually-hidden"),children:r})]});function Js({items:e,currentIndex:t,onChange:n,children:r}){const{t:o}=Yo(),s=e.length;return(0,ms.jsxs)("div",{className:Is("carousel-controls"),children:[(0,ms.jsx)("button",{className:Is("button","button--previous"),"aria-label":o("carousel.controls.previous"),onClick:()=>{n((t-1+s)%s)},children:(0,ms.jsx)(Ks,{name:"arrowLeft",size:"16",alt:""})}),r,(0,ms.jsx)("button",{className:Is("button","button--next"),"aria-label":o("carousel.controls.next"),onClick:()=>{n((t+1)%s)},children:(0,ms.jsx)(Ks,{name:"arrowRight",size:"16",alt:""})})]})}function Xs({items:e,currentIndex:t,onChange:n,getItemKey:r,getItemLabel:o}){const s=e.length,a=(0,Mo.useCallback)(e=>{const r=Number(e.target.dataset.item||"0"),o=Math.min(s-1,Math.max(0,r));o!==t&&n(o)},[s,t,n]);return(0,ms.jsx)("div",{className:Is("carousel-pagination__wrapper"),role:"group",children:(0,ms.jsx)("ul",{className:Is("carousel-pagination"),children:e.map((e,n)=>{const s=t===n;return(0,ms.jsx)("li",{className:Is("carousel-pagination__item",s?"is-active":void 0),children:(0,ms.jsx)("button",{className:Is("carousel-pagination__button"),type:"button",onClick:a,"data-item":n,"aria-disabled":s?"true":void 0,"aria-label":o(e,n)})},r(e,n,"pagination-item-"))})})})}const Ys=(e,t,n)=>`${n}${t}`,Qs=e=>e.label,Zs=({target:e})=>{e.scrollLeft=0};function ea({currentIndex:e=0,onChange:t=()=>{},getItemKey:n=Ys,getItemLabel:r=Qs,items:o}){const s=Bs(),a=o.length,[i,c]=(0,Mo.useState)(Number(e||0));(0,Mo.useEffect)(()=>{c(Number(e||0))},[c,e]);const l=(0,Mo.useRef)([]);l.current=(0,Mo.useMemo)(()=>Array(a).fill(1).map(()=>(0,Po.createRef)()),[a]);const u=(0,Mo.useRef)(!0),d=(0,Mo.useRef)(null);return d.current=t,(0,Mo.useEffect)(()=>{u.current?u.current=!1:d.current&&d.current(i)},[i]),(0,ms.jsxs)("div",{className:Is("carousel"),role:"group","aria-roledescription":"carousel",children:[(0,ms.jsx)("div",{className:Is("carousel__slides-wrapper"),onScroll:Zs,children:(0,ms.jsx)("div",{id:s,className:Is("carousel__slides"),style:{width:100*a+"%",left:-100*i+"%"},"aria-live":"polite","aria-atomic":"false",children:o.map((e,t)=>{const r=i===t;return(0,ms.jsx)("div",{ref:l.current[t],className:Is("carousel__slide",r?"is-active":void 0),"aria-hidden":r?void 0:"true",children:(0,ms.jsx)(Gs,{item:e,items:o,index:t,isActive:r})},n(e,t,"item-"))})})}),(0,ms.jsx)("div",{className:Is("carousel__controls"),children:(0,ms.jsx)(Js,{currentIndex:i,items:o,onChange:c,children:(0,ms.jsx)("div",{className:Is("carousel__pagination"),children:(0,ms.jsx)(Xs,{currentIndex:i,items:o,onChange:c,getItemKey:n,getItemLabel:r})})})})]})}const ta=(e,t,n="")=>`${n}${e.title}:${t}`,na=e=>e.title,ra=e=>{const{payload:t}=e,[n,r]=(0,Mo.useState)(!1),{addMessageBubble:o,emitEvent:s,sendAction:a}=is(),i=as(),{activeServiceSessionId:c}=_n(),l=Zt(Cn),{body:u}=Es(e),{service:d}=t,p=(0,Mo.useMemo)(()=>{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]),f=u?.chooseAgain&&c===d?.serviceSessionId&&t.id!==l;return(0,Mo.useEffect)(()=>{r(t.id===l)},[t,l]),{body:u,subEvent:p,showOptions:n,chooseAgain:f,onChoiceClickHandler:e=>{if(!i())return;const n=z(),c={type:"pick_choice",originMessage:t.id,choice:{chooseAgain:f,id:e.id},transactionId:n};o(e.text,n),a(c),r(!1),s(`action.${c.type}`,{...c,choice:{...c.choice,text:e.text}})},onChooseAgainClickHandler:()=>{r(e=>!e)}}},oa=e=>`suggestions__item--${String(e).toLowerCase().replace(/[^a-z0-9_\\-]/,"")}`,sa=({id:e,categories:t=[],question:n,onClick:r,hasIcon:o})=>{const s=(0,Mo.useMemo)(()=>["suggestions__item",...t.map(oa)],[t]),a=(0,Mo.useCallback)(()=>{r&&r({id:e,question:n})},[e,n,r]);return(0,ms.jsx)("li",{className:Is(s),children:(0,ms.jsxs)("button",{type:"button",onClick:a,className:Is("button","button--primary"),children:[o&&(0,ms.jsx)(Ks,{name:"chevronRight",size:"8",alt:""}),n]})})},aa=({className:e,suggestions:t=[],onClickSuggestion:n,hasIcon:r=!0})=>(0,ms.jsx)("ul",{className:Is("suggestions__list",e||""),children:t.map(e=>(0,ms.jsx)(sa,{hasIcon:r,onClick:n,categories:e.categories,id:e.id,question:e.question},e.id))}),ia=({children:e,className:t,graphicSrc:n,graphicType:r="icon",iconName:o,iconSize:s,iconClassName:a,dividerType:i,title:c,description:l})=>{const u=Boolean(o||n);return(0,ms.jsxs)("div",{className:Is("divider",i&&`divider--type-${i}`,t),children:[u&&(0,ms.jsx)("span",{className:Is("divider__graphic"),children:o?(0,ms.jsx)(Ks,{name:o,size:s,className:a,alt:""}):(0,ms.jsx)("img",{src:n||void 0,className:Is({icon:"icon"===r,avatar:"avatar"===r},a)})}),(0,ms.jsxs)("div",{className:Is("divider__body"),children:[c?(0,ms.jsx)("h2",{className:Is("divider__title"),dangerouslySetInnerHTML:{__html:c}}):null,l?(0,ms.jsx)("p",{className:Is("divider__description"),dangerouslySetInnerHTML:{__html:l}}):null,e]})]})},ca={[U.new_topic]:"new-topic"},la={default:({event:e})=>{const{t}=Yo(),{subtype:n}=e.payload.body,r=ca[U[n]];return U[n]?(0,ms.jsx)(ia,{dividerType:r,iconName:U[n],title:t(`dividerKeys.${U[n]}`)}):null},[U.new_translation]:({event:e})=>{const{t}=Yo(),n=vn(),{body:{translationEnabled:r,text:o,title:s},id:a}=e.payload,i=Zt(e=>e.translations.translatedEventGroups),c=Lo(),l=(0,Mo.useCallback)(()=>{i[a]?c(Co({events:n,id:a})):c(So({events:n,id:a}))},[c,n,a,i]);return(0,ms.jsx)(ia,{iconName:"newTranslation",dividerType:"new-translation",title:s,description:o,children:r?(0,ms.jsx)(ms.Fragment,{children:(0,ms.jsx)("button",{className:Is("button","button--secondary"),onClick:l,children:t(i[a]?"translations.toggle.showTranslationsButtonText":"translations.toggle.hideTranslationsButtonText")})}):null})}},ua={month:"long",day:"numeric",year:"numeric"},da={hour:"numeric",minute:"numeric"},pa=({event:e})=>{const t=(()=>{const[e,t]=(0,Mo.useReducer)(e=>e+1,0);return(0,Mo.useCallback)(()=>{setTimeout(()=>{t()})},[])})(),{date:n,time:r,timeUntilMidnight:o,srText:s}=(e=>{const{t}=Yo(),n=en(),r=n?.context?.userLocale??[],o=new Date(e),s=new Date,a=new Date(s);a.setHours(24,0,0,0);const i=a.valueOf()-s.valueOf(),c=o.toString(),l=new Intl.DateTimeFormat(r,da).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,s);switch(u){case"today":u=t("dateTime.today");break;case"yesterday":u=t("dateTime.yesterday");break;default:u=new Intl.DateTimeFormat(r,ua).format(o)}return{date:u,srText:t("dateTime.srText",{date:u,time:l}),time:l,fullDateTime:c,timeUntilMidnight:i}})(rn(e.payload.timeIndicator));return(0,Mo.useEffect)(()=>{const e=setTimeout(()=>{t()},o);return()=>{clearTimeout(e)}},[t,o]),(0,ms.jsxs)(ia,{dividerType:"time-indicator",children:[(0,ms.jsxs)("h2",{className:Is("divider__time"),"aria-hidden":"true",children:[(0,ms.jsx)("span",{className:Is("divider__time--date"),children:n}),(0,ms.jsx)("span",{className:Is("divider__time--time"),children:r})]}),(0,ms.jsx)("p",{className:Is("visually-hidden"),children:s})]})};var fa=["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])"],ha=fa.join(","),ma="undefined"==typeof Element,ya=ma?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,va=!ma&&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},ga=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&ga(e.parentNode)},ba=function(e,t,n){if(ga(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ha));return t&&ya.call(e,ha)&&r.unshift(e),r.filter(n)},xa=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var s=o.shift();if(!ga(s,!1))if("SLOT"===s.tagName){var a=s.assignedElements(),i=a.length?a:s.children,c=xa(i,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:s,candidates:c})}else{ya.call(s,ha)&&n.filter(s)&&(t||!e.includes(s))&&r.push(s);var l=s.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(s),u=!ga(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(s));if(l&&u){var d=xa(!0===l?s.children:l.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:s,candidates:d})}else o.unshift.apply(o,s.children)}}return r},wa=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},_a=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))&&!wa(e)?0:e.tabIndex},Ca=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Sa=function(e){return"INPUT"===e.tagName},Ea=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ja=function(e,t){return!(t.disabled||ga(t)||function(e){return Sa(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=ya.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ya.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ea(e)}else{if("function"==typeof r){for(var s=e;e;){var a=e.parentElement,i=va(e);if(a&&!a.shadowRoot&&!0===r(a))return Ea(e);e=e.assignedSlot?e.assignedSlot:a||i===e.ownerDocument?a:i.host}e=s}if(function(e){var t,n,r,o,s=e&&va(e),a=null===(t=s)||void 0===t?void 0:t.host,i=!1;if(s&&s!==e)for(i=!!(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));!i&&a;){var c,l,u;i=!(null===(l=a=null===(c=s=va(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a))}return i}(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!!ya.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Ta=function(e,t){return!(function(e){return function(e){return Sa(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||va(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)||_a(t)<0||!ja(e,t))},Ia=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Na=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,s=o?e.scopeParent:e,a=function(e,t){var n=_a(e);return n<0&&t&&!wa(e)?0:n}(s,o),i=o?Na(e.candidates):s;0===a?o?t.push.apply(t,i):t.push(s):n.push({documentOrder:r,tabIndex:a,item:e,isScope:o,content:i})}),n.sort(Ca).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ka=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ya.call(e,ha)&&Ta(t,e)},Oa=fa.concat("iframe").join(","),La=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ya.call(e,Oa)&&ja(t,e)};function Ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Aa(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pa(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 Ma(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pa(Object(n),!0).forEach(function(t){Aa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Ua=function(e){return"Tab"===(null==e?void 0:e.key)||9===(null==e?void 0:e.keyCode)},Da=function(e){return Ua(e)&&!e.shiftKey},Fa=function(e){return Ua(e)&&e.shiftKey},za=function(e){return setTimeout(e,0)},Ba=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},Va=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},$a=[],Ha=function(e,t){var n,r=(null==t?void 0:t.document)||document,o=(null==t?void 0:t.trapStack)||$a,s=Ma({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:Da,isKeyBackward:Fa},t),a={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},i=function(e,t,n){return e&&void 0!==e[t]?e[t]:s[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,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.hasFallback,a=void 0!==o&&o,i=n.params,c=void 0===i?[]:i,l=s[e];if("function"==typeof l&&(l=l.apply(void 0,function(e){if(Array.isArray(e))return Ra(e)}(t=c)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return Ra(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ra(e,t):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())),!0===l&&(l=void 0),!l){if(void 0===l||!1===l)return l;throw new Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var u=l;if("string"==typeof l){try{u=r.querySelector(l)}catch(t){throw new Error("`".concat(e,'` appears to be an invalid selector; error="').concat(t.message,'"'))}if(!u&&!a)throw new Error("`".concat(e,"` as selector refers to no known node"))}return u},u=function(){var e=l("initialFocus",{hasFallback:!0});if(!1===e)return!1;if(void 0===e||e&&!La(e,s.tabbableOptions))if(c(r.activeElement)>=0)e=r.activeElement;else{var t=a.tabbableGroups[0];e=t&&t.firstTabbableNode||l("fallbackFocus")}else null===e&&(e=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?xa([e],t.includeContainer,{filter:Ta.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ia}):ba(e,t.includeContainer,Ta.bind(null,t)),Na(n)}(e,s.tabbableOptions),n=function(e,t){return(t=t||{}).getShadowRoot?xa([e],t.includeContainer,{filter:ja.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ba(e,t.includeContainer,ja.bind(null,t))}(e,s.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 ka(e)}),i=n.slice().reverse().find(function(e){return ka(e)}),c=!!t.find(function(e){return _a(e)>0});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:c,firstTabbableNode:r,lastTabbableNode:o,firstDomTabbableNode:a,lastDomTabbableNode:i,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 ka(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return ka(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){var t=e.activeElement;if(t)return t.shadowRoot&&null!==t.shadowRoot.activeElement?p(t.shadowRoot):t},f=function(e){!1!==e&&e!==p(document)&&(e&&e.focus?(e.focus({preventScroll:!!s.preventScroll}),a.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):f(u()))},h=function(e){var t=l("setReturnFocus",{params:[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||Va(n),d();var i=null;if(a.tabbableGroups.length>0){var u=c(t,n),p=u>=0?a.containerGroups[u]:void 0;if(u<0)i=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var f=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(f<0&&(p.container===t||La(t,s.tabbableOptions)&&!ka(t,s.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(f=u),f>=0){var h=0===f?a.tabbableGroups.length-1:f-1,m=a.tabbableGroups[h];i=_a(t)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else Ua(n)||(i=p.nextTabbableNode(t,!1))}else{var y=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(y<0&&(p.container===t||La(t,s.tabbableOptions)&&!ka(t,s.tabbableOptions)&&!p.nextTabbableNode(t))&&(y=u),y>=0){var v=y===a.tabbableGroups.length-1?0:y+1,g=a.tabbableGroups[v];i=_a(t)>=0?g.firstTabbableNode:g.firstDomTabbableNode}else Ua(n)||(i=p.nextTabbableNode(t))}}else i=l("fallbackFocus");return i},y=function(e){var t=Va(e);c(t,e)>=0||(Ba(s.clickOutsideDeactivates,e)?n.deactivate({returnFocus:s.returnFocusOnDeactivate}):Ba(s.allowOutsideClick,e)||e.preventDefault())},v=function(e){var t=Va(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(_a(a.mostRecentlyFocusedNode)>0){var i=c(a.mostRecentlyFocusedNode),l=a.containerGroups[i].tabbableNodes;if(l.length>0){var d=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});d>=0&&(s.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 _a(e)>0})})||(o=!1);else o=!1;o&&(r=m({target:a.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(a.recentNavEvent)})),f(r||a.mostRecentlyFocusedNode||u())}a.recentNavEvent=void 0},g=function(e){(s.isKeyForward(e)||s.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&&(Ua(e)&&e.preventDefault(),f(n))}(e,s.isKeyBackward(e))},b=function(e){var t;"Escape"!==(null==(t=e)?void 0:t.key)&&"Esc"!==(null==t?void 0:t.key)&&27!==(null==t?void 0:t.keyCode)||!1===Ba(s.escapeDeactivates,e)||(e.preventDefault(),n.deactivate())},x=function(e){var t=Va(e);c(t,e)>=0||Ba(s.clickOutsideDeactivates,e)||Ba(s.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},w=function(){if(a.active)return function(e,t){if(e.length>0){var n=e[e.length-1];n!==t&&n._setPausedState(!0)}var r=e.indexOf(t);-1===r||e.splice(r,1),e.push(t)}(o,n),a.delayInitialFocusTimer=s.delayInitialFocus?za(function(){f(u())}):f(u()),r.addEventListener("focusin",v,!0),r.addEventListener("mousedown",y,{capture:!0,passive:!1}),r.addEventListener("touchstart",y,{capture:!0,passive:!1}),r.addEventListener("click",x,{capture:!0,passive:!1}),r.addEventListener("keydown",g,{capture:!0,passive:!1}),r.addEventListener("keydown",b),n},_=function(){if(a.active)return r.removeEventListener("focusin",v,!0),r.removeEventListener("mousedown",y,!0),r.removeEventListener("touchstart",y,!0),r.removeEventListener("click",x,!0),r.removeEventListener("keydown",g,!0),r.removeEventListener("keydown",b),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})})&&f(u())}):void 0,S=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=i(e,"onActivate"),n=i(e,"onPostActivate"),o=i(e,"checkCanFocusTrap");o||d(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=p(r),null==t||t();var s=function(){o&&d(),w(),S(),null==n||n()};return o?(o(a.containers.concat()).then(s,s),this):(s(),this)},deactivate:function(e){if(!a.active)return this;var t=Ma({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,_(),a.active=!1,a.paused=!1,S(),function(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1),e.length>0&&!e[e.length-1]._isManuallyPaused()&&e[e.length-1]._setPausedState(!1)}(o,n);var r=i(t,"onDeactivate"),c=i(t,"onPostDeactivate"),l=i(t,"checkCanReturnFocus"),u=i(t,"returnFocus","returnFocusOnDeactivate");null==r||r();var d=function(){za(function(){u&&f(h(a.nodeFocusedBeforeActivation)),null==c||c()})};return u&&l?(l(h(a.nodeFocusedBeforeActivation)).then(d,d),this):(d(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return a.active?(a.manuallyPaused=!1,o[o.length-1]!==this?this:this._setPausedState(!1,e)):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(),S(),this}},Object.defineProperties(n,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=i(t,"onPause"),r=i(t,"onPostPause");null==n||n(),_(),S(),null==r||r()}else{var o=i(t,"onUnpause"),s=i(t,"onPostUnpause");null==o||o(),d(),w(),S(),null==s||s()}return this}}}),n.updateContainerElements(e),n};const Wa=({children:e,onClose:t,fallBackFocusRef:n,"aria-label":r,"aria-labelledby":o})=>{const s=Bs(),a=(0,Mo.useRef)(null),i=(0,Mo.useRef)(null),[c,l]=(0,Mo.useState)(!1);return(0,Mo.useEffect)(()=>(c&&a.current&&(i.current=Ha(a.current,{initialFocus:n.current||void 0}),i.current.activate()),()=>{i.current&&i.current.deactivate()}),[c,n]),(0,Mo.useEffect)(()=>{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()}},[c]),(0,Mo.useEffect)(()=>{c&&a.current&&a.current.addEventListener("keydown",e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&t()})},[c,t]),(0,Mo.useLayoutEffect)(()=>{const e=document.getElementsByTagName("body")[0],t=document.createElement("div");return t.setAttribute("id",s),t.setAttribute("role","dialog"),t.setAttribute("data-nosnippet","true"),t.setAttribute("aria-modal","true"),r&&t.setAttribute("aria-label",r),o&&t.setAttribute("aria-labelledby",o),e.appendChild(t),a.current=t,l(!0),()=>{a.current&&(e.removeChild(a.current),a.current=null)}},[r,o,s]),"function"==typeof e?e({onClose:t,modalRenderFn:e=>a.current&&(0,Po.render)(e,a.current)}):a.current&&(0,Po.render)((0,Po.toChildArray)(e).filter(pn).map(e=>(e.props={...e.props,onClose:t},e)),a.current)},Ga=({url:e,description:t,onClose:n})=>{const r=en(),o=Ds(),s=Ns(),a=(0,Mo.useRef)(null),{t:i}=Yo(),c=["modal",`app--layout-${r.layoutMode}`,`namespace--${r.namespace}`];"function"!=typeof s?c.push(...s):c.push(...s(r));const l=e=>{e.stopPropagation()},u=()=>{n()},d=r?.zIndex?{zIndex:r.zIndex+1}:void 0;return(0,ms.jsx)(Wa,{onClose:n,"aria-label":i("lightbox.heading"),fallBackFocusRef:a,children:({onClose:n,modalRenderFn:r})=>r((n=>(0,ms.jsx)("div",{className:Is(c),onClick:u,style:d,children:(0,ms.jsxs)("div",{className:Is("modal__float"),tabIndex:-1,onMouseDown:o,onKeyDown:o,onTouchStart:o,onMouseMove:o,onWheel:o,onPointerDown:o,onPointerMove:o,ref:a,children:[(0,ms.jsx)("div",{className:Is("modal__inner"),onClick:l,children:(0,ms.jsx)("img",{className:Is("modal__image"),src:e,alt:t})}),(0,ms.jsxs)("button",{type:"button",className:Is("modal__close"),onClick:n,children:[(0,ms.jsx)(Ks,{name:"close",size:"16",alt:""}),i("lightbox.closeLabel")]})]})}))(n))})},qa=({description:e,url:t})=>{const{t:n}=Yo(),[r,o]=(0,Mo.useState)(!1);return(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsxs)("button",{type:"button",className:Is("modal__enlarge"),onClick:()=>{o(!0)},children:[n("message.image.srTextEnlargeButtonLabel",{description:e}),(0,ms.jsx)(Ks,{name:"enlarge",size:"32",alt:""})]}),r&&(0,ms.jsx)(Ga,{url:t,description:e,onClose:()=>{o(!1)}})]})},Ka=({originMessage:e,transactionId:t})=>{const{emitEvent:n,sendAction:r}=is();return o=>{if(o.target&&o.target.dataset.linkId){const s={type:"navigate",originMessage:e,transactionId:t,link:{id:o.target.dataset.linkId,url:o.target.getAttribute("href")}};r(s),n(`action.${s.type}`,s)}}},Ja=({event:e,...t})=>{const{body:n}=Es(e),r=Ka({originMessage:e.payload.id,transactionId:e.payload.transactionId}),o=(0,Mo.useMemo)(()=>e.payload.optimisticallyInjected?{children:(0,ms.jsx)("p",{children:n?.text})}:{bodyProps:{dangerouslySetInnerHTML:{__html:n?.text||""}}},[n,e]);return(0,ms.jsx)(Hs,{type:"text",event:e,onClick:r,...t,...o})},Xa="PROCESSING_IMAGE",Ya=({img:e,filename:t})=>{const{t:n}=Yo(),r=n("fileUpload.srFileUploadedText",{fileName:t});return(0,ms.jsx)(ms.Fragment,{children:(0,ms.jsxs)("span",{className:Is(["download","download--preview"]),children:[(0,ms.jsx)("img",{src:e,alt:r}),(0,ms.jsx)("span",{"aria-hidden":"true",className:Is("file-download"),children:t})]})})},Qa=({children:e,fileId:t,isDeleted:n,onClickHandler:r,url:o,target:s})=>t&&!n?(0,ms.jsx)("button",{type:"button",onClick:r,className:Is(["download","download-link"]),children:e}):o?(0,ms.jsx)("a",{href:o,download:!0,target:s,className:Is(["download","download-link"]),children:e}):(0,ms.jsx)("span",{className:Is("download"),children:e}),Za={message:{choice_prompt:({event:e,children:t,...n})=>{const{t:r}=Yo(),o=Bs(),{body:s,subEvent:a,showOptions:i,chooseAgain:c,onChoiceClickHandler:l,onChooseAgainClickHandler:u}=ra(e);return(0,ms.jsxs)(ms.Fragment,{children:[(0,Po.toChildArray)(t).filter(pn).map(e=>(e.props={...e.props,event:a,id:o,showTranslationToggle:!1},e)),c&&(0,ms.jsxs)("button",{type:"button",className:Is("button","button--secondary","button--choose-again"),"aria-expanded":i?"true":"false",onClick:u,"aria-describedby":o,children:[r(i?"message.choicePrompts.cancelChooseAgain":"message.choicePrompts.chooseAgain"),(0,ms.jsx)(Ks,{name:"chevronDown",size:"8",alt:""})]}),i&&(0,ms.jsx)(Hs,{type:"choice-prompt",showParticipant:!1,event:e,...n,children:(0,ms.jsx)("ul",{className:Is("choice-prompt","choice-prompt--many"),children:s?.choices?.map(e=>(0,ms.jsx)("li",{className:Is("choice-prompt__item",{[`choice-prompt__item--${e?.category}`]:!!e.category}),children:(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:()=>{l(e)},children:e.text})},e.id))})})]})},text:Ja,image:({event:e,descriptorId:t,...n})=>{const{body:r}=Es(e),[o,s]=(0,Mo.useState)(!1),a=Lo();return(0,ms.jsxs)(Hs,{event:e,type:"image",...n,children:[(0,ms.jsx)("img",{src:r?.url,id:t,alt:r?.description||void 0,onLoad:()=>{a(Qr(e.payload.id)),s(!0)}}),r?.isZoomable&&o&&(0,ms.jsx)(qa,{description:r?.description,url:r?.url})]})},splash:({event:e,...t})=>{const{payload:n}=e,{body:r}=Es(e),o=Ka({originMessage:n.id,transactionId:n.transactionId});return(0,ms.jsx)(Hs,{type:"splash",event:e,onClick:o,...t,bodyProps:{dangerouslySetInnerHTML:{__html:r?.text||""}}})},video:({event:e,descriptorId:t,...n})=>{const{body:r}=Es(e);return ks(e).push("message--type-video"),(0,ms.jsxs)(Hs,{event:e,type:"video",...n,children:[(0,ms.jsx)("div",{id:t,className:Is("visually-hidden"),children:r?.description}),(0,ms.jsx)("iframe",{title:r?.description||"",src:r?.url,allow:"autoplay; encrypted-media",allowFullScreen:!0})]})},upload:({event:e,...t})=>{const{t:n}=Yo(),{body:r}=Es(e),{fromClient:o,id:s}=e.payload,{filename:a,id:i,isDeleted:c,url:l}=r,u=os(),d=(e=>{const{processingFileUploads:t}=Zt(({state:e})=>e);return(0,Mo.useMemo)(()=>{if(t.some(t=>t===e))return Xa;try{return sessionStorage.getItem(`image-${e}`)}catch(e){return}},[e,t])})(s),p=(0,Mo.useMemo)(()=>n(c||!l&&!i?"fileUpload.srFileUploadedText":"fileUpload.srFileDownloadText",{fileName:a}),[l,i,a,c,n]);return(0,ms.jsx)(Hs,{event:e,type:"upload",...t,children:d&&d!==Xa?(0,ms.jsx)(Ya,{img:d,filename:a}):(0,ms.jsxs)(Qa,{fileId:i,isDeleted:c,onClickHandler:()=>{i&&a&&u.downloadFile(i,a)},url:l,target:o?void 0:"_blank",children:[(0,ms.jsx)(Ks,{name:"download",size:"16",alt:p}),(0,ms.jsx)("span",{"aria-hidden":"true",className:Is("file-download"),children:a})]})})},carousel:({event:e})=>{const{body:t}=Es(e),n=t.cards;return(0,ms.jsx)(Hs,{event:e,modifiers:"type-carousel",children:(0,ms.jsx)(ea,{items:n,getItemKey:ta,getItemLabel:na})})},card:({event:e})=>{const{body:t}=Es(e),n=Bs();return(0,ms.jsx)(Hs,{type:"card",event:e,children:(0,ms.jsx)(Ws,{id:n,...t})})}},info:{text:Ja,divider:({event:e,...t})=>{const n=la[U[e.payload.body.subtype]]||la.default;return(0,ms.jsx)(n,{event:e,...t})},translation:({event:e,...t})=>{const{t:n}=Yo(),{body:r}=Es(e);return(0,ms.jsx)(Hs,{type:"text",event:e,...t,children:n(r.key.join("."),r.variables)})},timeIndicator:pa},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,s=Zt(Cs(e));return{body:s&&o?t:r,hasTranslation:o,isTranslated:s&&o,userLocale:n?.locale}})(e);return n?(0,ms.jsx)(ia,{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,Mo.useState)(!0),o=Lo(),s=es(),{addMessageBubble:a,emitEvent:i,sendAction:c}=is(),l=as(),{suggestions:u,payload:d}=(e=>{const{payload:t}=e,{body:n}=Es(e);return{suggestions:n,payload:t}})(e),{showSuggestions:p}=en(),f=vn(),{t:h}=Yo(),m=h("suggestions.headingText"),y=h("suggestions.footerText"),v=(0,Mo.useMemo)(()=>f.some(({payload:e,type:t})=>"message"===t&&e?.transactionLast),[f]),g=(0,Mo.useCallback)(({id:e,question:t})=>{if(!l())return;r(!1),o(qn(!0));const n=z(),s={type:T,originMessage:d.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};c(s),a(t,n),i(`action.${s.type}`,s)},[a,o,i,l,d.id,c]);return n&&!s&&v&&p?(0,ms.jsxs)("div",{className:Is("suggestions","suggestions--conversation"),children:[m&&(0,ms.jsx)("p",{className:Is("suggestions__heading"),children:m}),(0,ms.jsxs)(Hs,{type:"suggestions",showParticipant:!1,event:e,...t,children:[(0,ms.jsx)(aa,{className:"suggestions__list--conversation",onClickSuggestion:g,suggestions:u}),y&&(0,ms.jsx)("p",{className:Is("suggestions__footer"),children:y})]})]}):null}}},ei=({children:e})=>{const{customComponents:t}=en(),n=(0,Mo.useMemo)(()=>Object.keys(Za).reduce((e,n)=>(e[n]={...Za[n],...t?t[n]:{}},e),{fallback:Ja}),[t]);return(0,ms.jsx)(vs.Provider,{value:n,children:e})},ti=({children:e})=>{const{isMinimized:t}=Qo(),n=(0,Mo.useRef)(0),{sendAction:r}=is(),{hasCountdown:o,isActive:s,stopCountdown:a}=Fs(),i=(0,Mo.useCallback)(()=>{if(t)return;const e=(new Date).getTime(),i=()=>{r({type:"interactivity_update"}),n.current=e};o&&s&&(i(),a()),e-n.current>15e3&&i()},[r,o,s,a,t]);return(0,ms.jsx)("div",{className:Is("activity-monitor"),tabIndex:-1,onMouseDown:i,onKeyUp:i,onTouchStart:i,onMouseMove:i,onWheel:i,onPointerDown:i,onPointerMove:i,children:(0,ms.jsx)(Us.Provider,{value:i,children:e})})},ni=["text","choice_prompt","image","video"],ri=()=>{const e=Os(),t=(0,Mo.useRef)(),n=(0,Mo.useRef)(),r=Lo(),o=rs(),s=(0,Mo.useRef)(null),{initCountdown:a,endCountdown:i}=Fs(),{emitEvent:c}=is(),{hasPrompt:l,continueChat:u}=zs(),d=(0,Mo.useRef)(l);return(0,Mo.useEffect)(()=>{d.current=l},[l]),(0,Mo.useEffect)(()=>{e.socket&&(e.onConnection(({currentState:e})=>{if("attach_channel_erred"===e){const e=new v;return r(gr({name:e.name,message:e.message,langKey:e.langKey,originalEvent:e.originalEvent,originalError:e.originalError,action:e.action})),!0}return!1}),e.onError(e=>{const t=new Jn(e);r(gr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError})),r(Or())}),e.onOpen(()=>{r(br())}))},[e,e.socket,r]),(0,Mo.useEffect)(()=>{e.onConnection(({connected:t})=>!!t&&(n.current&&e?.removeListener("message",n.current),n.current=e=>{switch(e.type){case"ui":switch(e.payload.type){case"idle_detach_countdown":"idle_detach_countdown"===e.payload.body.type&&a(e.payload.body.duration);break;case"loading":r(Yr(e.payload.body.loading));break;case"idle_detach_countdown_elapsed":i(void 0,!0);break;case"resume_conversation_prompt":r(Dr());break;case"user_first_response":r(qn(!0)),c("system.userFirstResponse",e.payload.body);break;case"translation_proposal":r(Eo(e.payload.body))}break;case"service_attach":{const{service:{name:t,settings:{proactiveMessages:{enabled:n},entry:o},sessionId:s}}=e.payload;r(mo(n||!1)),t&&c("system.serviceChanged",t),s&&r(Br(s)),r(no(o)),r(Wr({uploads:{enabled:o.options?.upload?.enabled||!1}}));break}case"context":e.payload.contentLocale&&e.payload.userLocale&&r(lr(e.payload.userLocale));break;case"message":switch(e.payload.type){case"text":case"choice_prompt":case"splash":case"image":case"upload":case"video":case"custom":case"carousel":case"card":if(e.payload.service&&e.payload.service.serviceSessionId&&r(Br(e.payload.service.serviceSessionId)),e.payload.fromClient){r(Nr(e));break}d.current&&u(),r(Ir(e))}break;case"participant":(e=>{const{payload:t}=e;if(!t||!t.participant)return;const{fromClient:n,participant:o}=t;!n&&"string"!=typeof o&&o?.name&&r(qr(o.name)),r(Zr(t)),"string"!=typeof o&&o.introduction&&r(Ir({...e,payload:{...t,type:"participant"}}))})(e);break;case"service_data":e.payload.persist&&r(to(e.payload));break;case"info":"divider"!==e.payload.type&&"text"!==e.payload.type&&"translation"!==e.payload.type||r(Ir({type:"info",payload:{...e.payload,participant:null}}));break;case"error":switch(e.payload.type){case"find_conversation":{const t=new g(e);r(gr({name:t.name,action:t.action,message:t.message,originalEvent:t.originalEvent,originalError:t.originalError}));break}case"conversation":{const t=new v(e);r(gr({name:t.name,message:t.message,langKey:t.langKey,originalEvent:t.originalEvent,originalError:t.originalError,action:t.action}));break}}}return e},e.onMessage(n.current),!0))},[u,e,r,c,i,o,a]),(0,Mo.useEffect)(()=>{e.onConnection(({connected:n})=>!!n&&(t.current&&e.removeListener("message",t.current),t.current=async({payload:e})=>{if("history_changed"===e?.type)try{const t=await r(mr(e)).unwrap();t&&"service"in t&&r(Jr(t))}catch(e){}return ni.includes(e?.type)?(e.id!==s.current&&o.emit("message",e),s.current=e.id,e):e},e.addListener("message",t.current),!0))},[e,r,o]),null},oi=({children:e})=>{const{t}=Yo(),n=Lo(),r=os(),{addUploadBubble:o}=is(),s=(0,Mo.useCallback)(async(e,t)=>{n(io(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)},r.onerror=e=>n(e)}))(e),o=new Image;o.src=r,await o.decode();const s=(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}`,s)}catch(e){}finally{n(co(t))}},[n]),a=(0,Mo.useCallback)(e=>{const a=z(),i=r.uploadFile(e,e=>{n(ao({fileId:a,progress:Math.ceil(e)}))},async t=>{const{id:r,transactionId:i,occurredAt:c,body:{contentType:l,filename:u,filesize:d}}=t;n(oo(a)),o(r,i,c,l,u,d),l.includes("image/")&&await s(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(so({fileId:a,errorText:r}))});n(Fr({fileId:a,fileName:e.name,uploadHandle:i}))},[s,o,r,n,t]);return(0,ms.jsx)(Ls.Provider,{value:a,children:e})},si=()=>{const{hasCountdown:e,isActive:t,remaining:n,decrementCountdown:r}=Fs();return((e,t)=>{const n=(0,Mo.useRef)(e);(0,Mo.useEffect)(()=>{n.current=e},[e]),(0,Mo.useEffect)(()=>{if(null!==t){const e=setInterval(function(){n.current()},t);return()=>clearInterval(e)}},[t])})(()=>{r()},e&&t&&n&&n>0?1e3:null),null},ai=()=>{const{initUserSelectedOptions:e}=Ps(),t=(0,Mo.useRef)(!1),n=en();return(0,Mo.useEffect)(()=>{n.api&&!t.current&&(t.current=!0,e())},[e,n]),null};function ii(e,t,n=[]){const r=rs(),o=(0,Mo.useRef)(t);(0,Mo.useEffect)(()=>{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])}const ci=()=>{const e=en(),{emitEvent:t,sendAction:n,sendContext:r,sendMessage:o}=is(),s=Lo(),{setVisibility:a,visible:i}=Qo(),c=(0,Mo.useRef)(i),l=rs(),u=os(),d=bn(),p=(0,Mo.useRef)(null),f=(0,Mo.useRef)(null),{isInline:h,isResolving:m}=jn(),y=Zt(ds),v=(()=>{const{get:e}=ss();return e?e("conversationUrl"):null})(),g=(0,Mo.useRef)(null),b=Ds(),{enableTranslations:x,disableTranslations:w}=Ss();return(0,Mo.useEffect)(()=>{c.current=i},[i]),ii("askText",e=>{o({body:e})},[u.send]),ii("setVariables",e=>{r({variables:e})},[u.send]),ii("getVisibility",e=>{e?e(c.current):console.warn("A callback function is required for the getVisibility action.")}),ii("setVisibility",e=>{const t="string"==typeof e||null===e?e:e.visibility;Object.values(Ot).includes(t)?(b(),a(e)):console.error('Requested visibility states should be "open", "minimized" ,"hidden" or null.')},[e.api]),ii("sendCustomAction",(e,r)=>{const o={type:"custom",body:{type:e,body:r}};n(o),t(`action.${o.type}`,o)},[u.send]),ii("setTopic",({name:e,fallbackMessage:t,message:r,userTriggered:o})=>{o&&s(Vn({showSuggestions:!1})),e&&t?n({type:k,body:{name:e,fallbackMessage:t,message:r}}):console.warn("A name and a fallbackMessage are required for the setTopic action.")},[u.send]),ii("setContext",e=>{r(e)},[u.send]),ii("setTranslation",({enabled:e,locale:t})=>{e?x(t,A):w()},[u.send]),(0,Mo.useEffect)(()=>{m||y||(g.current&&g.current!==v&&l.emit("unreadMessageCount",d),i===Ot.open&&i!==f.current&&0!==p.current&&l.emit("unreadMessageCount",0),i!==Ot.open&&d!==p.current&&l.emit("unreadMessageCount",d),f.current=i,p.current=d,"string"==typeof v&&(g.current=v))},[d,i,l,h,m,y,v]),null},li=({children:e})=>{const t=rs(),n=(0,Mo.useRef)(null),[r,o]=(0,Mo.useState)(),s=(0,Mo.useRef)(!0),a=(0,Mo.useCallback)(e=>{s.current&&(o(e),t.emit("aria-live",e))},[o,t]);return(0,Mo.useEffect)(()=>(n.current=null,r?.messageText&&(n.current=setTimeout(()=>{a({}),n.current&&clearTimeout(n.current)},600)),()=>{n.current&&clearTimeout(n.current)}),[r,a]),(0,Mo.useEffect)(()=>()=>{s.current=!1},[]),(0,ms.jsxs)(cs.Provider,{value:a,children:[e,(0,ms.jsxs)("div",{className:Is("app__live-container"),children:[(0,ms.jsx)("div",{"aria-live":"assertive","aria-atomic":"true",className:Is("visually-hidden"),children:r?.ariaLive===P?r?.messageText:null}),(0,ms.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:Is("visually-hidden"),children:r?.ariaLive===M?r?.messageText:null})]})]})},ui=()=>{const{t:e}=Yo(),t=hn().historyLoaded,{sendPolite:n}=ls();return(0,Mo.useEffect)(()=>{t&&setTimeout(()=>{n(e("window.srTexts.onHistoryLoad"))},500)},[t,e,n]),null},di=()=>{const{t:e}=Yo(),{isOpen:t,isVisible:n}=Qo(),r=bn(),{sendPolite:o}=ls(),s=(0,Mo.useMemo)(()=>nn(o,2e3),[o]),a=(0,Mo.useRef)(null),i=(0,Mo.useRef)(null);return(0,Mo.useEffect)(()=>{a.current!==n&&!n&&i.current&&i.current(),0!==r&&!t&&n&&(i.current=s(e("message.srTextUnreadCount",{unreadCount:r}))),a.current=n},[r,t,n,s,e]),null},pi=({store:e,children:t,eventBus:n,api:r})=>((0,Mo.useErrorBoundary)(t=>{console.error(t),e.dispatch(Yn(t))}),(0,ms.jsx)(Ht,{store:e,children:(0,ms.jsx)(ns.Provider,{value:n,children:(0,ms.jsx)(ts.Provider,{value:r,children:(0,ms.jsx)(li,{children:(0,ms.jsx)(ys,{children:(0,ms.jsxs)(ei,{children:[(0,ms.jsx)(ai,{}),(0,ms.jsx)(ri,{}),(0,ms.jsx)(di,{}),(0,ms.jsx)(ui,{}),(0,ms.jsx)(si,{}),(0,ms.jsxs)(ti,{children:[(0,ms.jsx)(ci,{}),(0,ms.jsx)(oi,{children:t})]})]})})})})})})),fi=Tt(yn,e=>e.filter(e=>_r(e)&&"service_data"!==e.type&&e.payload?.messageStatus===E)),hi=Tt([fi],e=>e.filter(e=>"participant"!==e.type).at(-1)),mi=Tt(fi,e=>e.filter(({payload:e})=>e?.id).map(({payload:e})=>e.id)),yi=Tt(({state:e})=>e.options.features?.webNotifications,e=>e?.enabled),vi=()=>{const{t:e}=Yo(),{showDisclaimer:t}=en();return t?(0,ms.jsxs)("div",{className:Is("disclaimer"),tabIndex:0,children:[(0,ms.jsx)("h2",{className:Is("disclaimer__title"),children:e("disclaimer.title")}),(0,ms.jsx)("div",{className:Is("disclaimer__message"),dangerouslySetInnerHTML:{__html:e("disclaimer.content")}})]}):null},gi=Tt([({forms:e})=>e,(e,{formId:t})=>t],(e,t)=>e[t]),bi=Tt(gi,e=>e?.controls||{}),xi=Tt(bi,e=>{const t={};return Object.entries(e).forEach(([e,{value:n}])=>{t[e]=n}),t}),wi=Tt([bi,(e,{name:t})=>t],(e,t)=>e[t]?.value),_i=Tt([bi,(e,{name:t})=>t],(e,t)=>e[t]?.touched),Ci=(0,Po.createContext)({handleSubmit:()=>{},isSubmitted:!1,isValid:!1,updateControlValue:()=>{},updateControlTouched:()=>{},errors:void 0}),{Provider:Si,Consumer:Ei}=Ci,ji=Ci;function Ti(){return(0,Mo.useContext)(ji)}function Ii(e){const t=Lo(),{formId:n,updateControlValue:r,updateControlTouched:o,errors:s}=Ti(),a=!!Zt(e=>gi(e,{formId:n})),i=Zt(t=>wi(t,{formId:n,name:e})),c=Zt(t=>_i(t,{formId:n,name:e})),l=s?.[e],u=!l;(0,Mo.useEffect)(()=>{a&&t(or({formId:n,name:e}))},[a,n,e,t]),(0,Mo.useLayoutEffect)(()=>()=>{t(sr({formId:n,name:e}))},[a,n,e,t]);const d=(0,Mo.useCallback)(t=>r(e,t.target.value),[e,r]),p=(0,Mo.useCallback)(()=>{o(e,!0)},[o,e]);return[(0,Mo.useMemo)(()=>({name:e,onInput:d,onBlur:p,value:i}),[e,d,p,i]),(0,Mo.useMemo)(()=>({isValid:u,error:l,touched:c}),[u,l,c])]}function Ni(e){const{t}=Yo(),{sendAssertive:n}=ls(),{hasLimit:r,limit:o}=En(),s=(0,Mo.useMemo)(()=>nn(n,Un),[n]),a=(0,Mo.useMemo)(()=>nn((e,n)=>{e&&s(t("input.srCharacterLimitText",{limit:n}))},Un),[s,t]),[{value:i}]=Ii(e),c="number"==typeof o&&r&&i?o-i.length:o,l=!(!r||"number"!=typeof c)&&c<=Mn,u=!(!r||"number"!=typeof c)&&c<0;return(0,Mo.useEffect)(()=>{a(l,c)},[l,c,a]),{hasCharacterLimit:r,characterLimit:o,reachedCharacterWarning:l,reachedCharacterLimit:u,remainingChars:c}}const ki=e=>{const{hasCharacterLimit:t,characterLimit:n}=Ni(e),{entryMeta:{active:r,optionsOverride:o}}=hn();let s=null,a=null;r&&o&&"object"==typeof o[r]&&(s=o[r].label,a=o[r].placeholder);const{alwaysShowEntryLabel:i}=en(),{t:c}=Yo();return{placeholder:(0,Mo.useMemo)(()=>c("input.inputPlaceholder",{hasLimit:t,text:a||c("input.inputPlaceholderText"),limit:t?n:null}),[c,t,n,a]),label:(0,Mo.useMemo)(()=>c("input.inputLabel",{hasLimit:!s&&t,text:s||c("input.inputLabelText"),limit:!s&&t?n:null}),[c,t,n,s]),labelClass:(0,Mo.useMemo)(()=>!0===i||s?"label":"visually-hidden",[i,s])}};function Oi(){const{abortTransaction:e,clearEntryAbortTransaction:t}=(()=>{const e=Lo(),{entryMeta:{actions:t,translatedActions:n}}=hn();return{abortTransaction:n?.abortTransaction||t?.abortTransaction,clearEntryAbortTransaction:()=>{e(ro())}}})(),n=os();return e?(0,ms.jsx)("li",{className:Is(["cvco-conversation__item","cvco-conversation__item--abort-transaction"]),children:(0,ms.jsx)("button",{className:Is(["button","button--secondary","abort-transaction__button"]),type:"button",onClick:()=>{n.send("action",{type:k,body:{name:e.topicName,fallbackMessage:e.topicFallbackMessage}}),t()},children:e.label})}):null}const Li=(0,Po.createContext)(null),Ri=()=>{const e=(0,Mo.useContext)(Li);if(!e)throw new Error("useChatScrollContext has to be used within <ChatScrollContext.Provider>");return e},Ai=Li,Pi=e=>{const t=(()=>{const e=(0,Mo.useContext)(vs);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]},Mi=({event:e,newParticipant:t})=>{const{eventRefs:n,unreadIds:r}=Ri(),{sendAction:o}=is(),s=e.payload.id?n[e.payload.id]:void 0,{containerRef:a,isVisible:i}=Zo({containerRef:s,freezeOnceVisible:!0}),c=Lo(),[l,u]=Pi(e);if((0,hs.useEffect)(()=>{if(i&&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($r(t)),o({type:"read",events:t})}},[c,e.payload.id,i,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"),(0,ms.jsxs)("li",{className:Is(d),ref:a,children:[e.payload.timeIndicator&&(0,ms.jsx)(pa,{event:e}),(0,ms.jsx)(l,{event:e,children:(0,ms.jsx)(u,{event:e})})]})},Ui=()=>{const{t:e}=Yo(),{sendPolite:t}=ls(),{id:n,name:r}=Sn()||{};return(0,Mo.useEffect)(()=>{r&&t(e("typing.srText",{name:r}))},[r,t,e]),(0,ms.jsx)("li",{className:Is("conversation__item","conversation__item--source-agent"),children:(0,ms.jsxs)("div",{className:Is("message","message--source-agent","message--type-loading"),children:[(0,ms.jsx)($s,{eventPayload:{fromClient:!1,participant:n}}),(0,ms.jsx)("div",{className:Is("message__body"),children:(0,ms.jsxs)("span",{className:Is("loader"),children:[(0,ms.jsx)("span",{className:Is("loader__part","one")}),(0,ms.jsx)("span",{className:Is("loader__part","two")}),(0,ms.jsx)("span",{className:Is("loader__part","three")}),(0,ms.jsx)("span",{className:Is("loader__part","four")})]})})]})})},Di=()=>{const e=vn();let t;return(0,ms.jsx)(ms.Fragment,{children:e.map(e=>{const{type:n,payload:r}=e;let o=!1;if("info"===n||"message"===n){const{participant:n,fromClient:s}=r,a=s?"seamly-client-participant":n;"info"!==e.type&&t!==a&&(o=!0),t=a}return(0,ms.jsx)(Mi,{event:e,newParticipant:o},e.payload.key||e.payload.id)})})},Fi=()=>{const{t:e}=Yo(),t=gn(),n=((e,t=20)=>{const[n,r]=(0,Mo.useState)(e),o=(0,Mo.useRef)(null);return(0,Mo.useEffect)(()=>(o.current=setTimeout(()=>r(e),t),()=>{o.current&&clearTimeout(o.current)}),[e,t]),n})(t,t?0:20),{isOpen:r}=Qo(),o=xn(),s=wn(),a=ws();return(0,ms.jsxs)(ms.Fragment,{children:[r&&(0,ms.jsx)("a",{id:o,className:Is("skip-link"),href:`#${s}`,onClick:e=>{e.preventDefault(),a()},children:e("skiplinkText")}),(0,ms.jsx)("div",{className:Is("chat__body"),children:(0,ms.jsxs)("div",{className:Is("conversation__container"),children:[(0,ms.jsx)(vi,{}),(0,ms.jsx)("div",{role:"log","aria-label":e("chat.srLabel"),children:(0,ms.jsxs)("ol",{className:Is("conversation"),children:[(0,ms.jsx)(ei,{children:(0,ms.jsx)(Di,{})}),n?(0,ms.jsx)(Ui,{}):null,(0,ms.jsx)(Oi,{})]})})]})})]})};function zi(e,t){const n=(0,Mo.useRef)(null),r=(0,Mo.useRef)(e);return(0,Mo.useEffect)(()=>{r.current=e},[e]),(0,Mo.useEffect)(()=>"number"!=typeof t?()=>{}:(n.current=setTimeout(()=>r.current(),t),()=>{n.current&&clearTimeout(n.current)}),[t]),n}const Bi={visible:Is("transition--visible"),in:Is("transition--in"),visuallyHidden:Is("visually-hidden")},Vi=Object.values(Bi),$i=e=>{const t=(0,Mo.useRef)(null);t.current=e;const n="function"==typeof e;return(0,Mo.useMemo)(()=>n?(...e)=>t.current(...e):void 0,[n])},Hi="notRendered",Wi="rendered",Gi="visuallyHidden",qi=({children:e,isActive:t,timeout:n=300,transitionStartState:r=Hi,onInTransitionComplete:o=()=>{},onOutTransitionComplete:s=()=>{},exitAfter:a,enterDelay:i=0})=>{const c=(0,Mo.useRef)(!1),l=(0,Mo.useRef)(null),u=(0,Mo.useRef)(null),d=r===Gi,[p,f]=(0,Mo.useState)(()=>d?[Bi.visuallyHidden]:[]),[h,m]=(0,Mo.useState)(()=>0===i),y=(0,Mo.useMemo)(()=>a?a+i:a,[i,a]);zi(()=>m(!1),t?y:void 0),zi(()=>m(!0),t?i:void 0);const v=(0,Mo.useMemo)(()=>h&&t,[t,h]),g=$i(o),b=$i(s),x="notRendered"!==r||p.length>0;return(0,Mo.useEffect)(()=>(c.current&&!v&&(f([Bi.visible]),l.current=setTimeout(()=>{f([...d?[Bi.visuallyHidden]:[]]),b&&(u.current=requestAnimationFrame(()=>{b()}))},n)),!c.current&&v&&(f([Bi.visible]),u.current=requestAnimationFrame(()=>{u.current=requestAnimationFrame(()=>{f([Bi.visible,Bi.in]),g&&(l.current=setTimeout(()=>{g()},n))})})),c.current=v,()=>{l.current&&clearTimeout(l.current),u.current&&cancelAnimationFrame(u.current)}),[d,g,b,n,v]),(0,ms.jsx)(ms.Fragment,{children:x&&(0,Po.toChildArray)(e).filter(pn).map(e=>{const{className:t=""}=e.props,n=t.split(" ").filter(e=>!Vi.includes(e));return(0,Po.cloneElement)(e,{className:[...n,...p].join(" ")})})})},Ki=({isAside:e=!1})=>{const{isInline:t}=jn(),{t:n}=Yo(),{addMessageBubble:r,emitEvent:o,sendAction:s}=is(),a=as(),{isOpen:i,setVisibility:c}=Qo(),{showSuggestions:l}=en(),u=Bs(),d=ws(),p=(0,Mo.useRef)(null),{sendPolite:f}=ls(),h=Zt(ds),{hasCountdown:m,endCountdown:y}=Fs(),{hasPrompt:v,continueChat:g}=zs(),b=es(),x=hn().serviceData.suggestion;const{body:w}=Es({payload:x,type:"service_data"}),_=(0,Mo.useMemo)(()=>h?[]:Array.isArray(w)?w:[],[w,h]),C=(0,Mo.useRef)(),S=(0,Mo.useRef)(!1),E=(0,Mo.useRef)(),j=!!_?.length,I=t?(b||i)&&!e:b,N=(0,Mo.useRef)(I),k=j&&!I&&l,O=j?_:E.current;E.current=O;const L=(0,Mo.useMemo)(()=>{const t=["suggestions"];return e&&t.push("suggestions--aside"),Is(t)},[e]),R=(0,Mo.useCallback)(({id:e,question:t})=>{if(!a())return;m&&y(!0),v&&g();const n=z(),l={type:T,originMessage:x.id,body:{type:"faqclick",body:{faqId:e,faqQuestion:t}},transactionId:n};s(l),r(t,n),o(`action.${l.type}`,l),i||c({visibility:Ot.open}),d()},[r,g,y,o,d,a,m,v,i,x,s,c]);(0,Mo.useEffect)(()=>{if(C.current!==_&&!I){if(j){const e=S.current?n("suggestions.srUpdatedText"):n("suggestions.srAvailableText");setTimeout(()=>{f(e)},30)}else S.current&&f(n("suggestions.srUnavailableText"));C.current=_}!N.current&&I?(dn(p.current,d),f(n("suggestions.srUnavailableText"))):!j&&S.current&&dn(p.current,d),S.current=j,N.current=I},[_,j,I,d,f,n]);const A=n("suggestions.headingText"),P=n("suggestions.footerText"),M=A?"section":"div";return(0,ms.jsx)(qi,{isActive:!!k,transitionStartState:Hi,children:(0,ms.jsxs)(M,{className:L,"aria-labelledby":A?u:void 0,ref:p,children:[A&&(0,ms.jsx)("p",{id:u,className:Is("suggestions__heading"),children:A}),!!O&&(0,ms.jsx)(aa,{suggestions:O,onClickSuggestion:R}),P&&!i&&(0,ms.jsx)("p",{className:Is("suggestions__footer"),children:P})]})})},Ji=(0,hs.forwardRef)(({children:e,className:t=""},n)=>{const r=(0,hs.useRef)(null),{closeChat:o,isOpen:s,isVisible:a}=Qo(),i=_s(),{namespace:c,layoutMode:l}=en(),{isInline:u}=jn(),d=Ns(),p=Bs(),f=Bs(),h=es(),{t:m}=Yo(),y=["chat",`chat--layout-${l}`,`namespace--${c}`,t];return"function"!=typeof d&&y.push(...d),s||"app"===l||y.push("chat--collapsed"),h&&y.push("chat--user-responded"),(0,hs.useEffect)(()=>(a&&"window"===l&&(r.current=Ha(`#${p}`,{initialFocus:!1}),r.current.activate()),()=>{r.current&&r.current.deactivate()}),[p,a,l]),a&&(0,ms.jsxs)("section",{id:p,className:Is(y),onKeyDown:e=>{(e.code&&"Escape"===e.code||27===e.keyCode)&&!u&&s&&(o(),i())},tabIndex:-1,ref:n,role:"window"===l?"dialog":void 0,"aria-labelledby":f,children:[(0,ms.jsx)("h2",{className:Is("chat__title","visually-hidden"),id:f,children:m("window.srModalLayoutLabel")}),(0,ms.jsx)("div",{className:Is("chat-wrapper"),children:e}),"inline"===l&&s&&(0,ms.jsx)(Ki,{isAside:!0})]})}),Xi=({children:e,handleClose:t,title:n,closeButtonText:r,srCloseButtonText:o,id:s})=>{const a=Bs();return(0,ms.jsxs)("section",{tabIndex:-1,id:s,"aria-labelledby":n?a:void 0,className:Is("chat-status",n?void 0:"chat-status--condensed"),children:[(0,ms.jsxs)("div",{className:Is("chat-status__body"),children:[n?(0,ms.jsx)("h2",{className:Is("chat-status__title"),id:a,children:n}):null,e]}),"function"==typeof t&&(0,ms.jsxs)("button",{type:"button",onClick:t,className:Is("button","button--tertiary","chat-status__close"),children:[r||(0,ms.jsx)(Ks,{name:"close",size:"16",alt:""}),o&&(0,ms.jsx)("span",{className:Is("visually-hidden"),children:o})]})]})},Yi=({handleClick:e,icon:t,title:n,srButtonText:r})=>(0,ms.jsxs)("button",{type:"button",onClick:e,className:Is("button","button--primary","chat-status__button"),children:[(0,ms.jsx)(Ks,{name:t,size:"16",alt:""}),n,r&&(0,ms.jsx)("span",{className:Is("visually-hidden"),children:r})]});function Qi(){const{showProposal:e,translationProposal:t,dismissTranslationProposal:n,activateTranslationProposal:r}=(()=>{const{isActive:e,languages:t}=Ss(),n=Lo(),{sendAction:r}=is(),{translationProposal:o}=Zt(e=>e.translations),{enableTranslations:s}=Ss(),{isOpen:a}=Qo(),{userLocale:i}=Yo(),c=o?.proposedLocale,l=Ts(c),u=(0,Mo.useMemo)(()=>null!==o&&!e&&a&&i!==c&&t.some(e=>e.locale===c),[o,e,a,i,c,t]);return{activateTranslationProposal:()=>{o?.proposedLocale&&s(o.proposedLocale,R)},dismissTranslationProposal:()=>{r({type:N,body:{type:L}}),n(jo())},proposedLocale:c,proposedLocaleNativeName:l,showProposal:u,translationProposal:o}})(),{id:o}=js();return e&&t?(0,ms.jsx)(Xi,{handleClose:n,srCloseButtonText:t.srDismissButtonText,id:o,title:t.titleLabel,children:(0,ms.jsx)(Yi,{handleClick:r,icon:"newTranslation",title:t.buttonLabel})}):null}function Zi(){const e=Zt(ds),{isActive:t}=Ss();return e||t?null:(0,ms.jsx)(Qi,{})}const ec=({label:e,checked:t,description:n,onChange:r,id:o,itemClassName:s})=>(0,ms.jsxs)("li",{className:Is([s||"","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:[(0,ms.jsx)(Ks,{name:"check",size:"16",alt:""}),e," ",n&&(0,ms.jsxs)("span",{children:["(",n,")"]})]}),tc=({onChange:e,describedById:t})=>{const{context:{contentLocale:n}}=en(),{t:r}=Yo(),{languages:o,currentLocale:s,enableTranslations:a,disableTranslations:i}=Ss(),c=ws(),l=t=>()=>{t&&(t===s||n===t?i():a(t,"translation_choice"),e(),c())},{primaryLanguages:u,remainingLanguages:d}=(0,hs.useMemo)(()=>o.reduce((e,t)=>{const r=t.locale===n,o=((e,t,n)=>t===e.locale||!t&&n)(t,s,r);t.locale!==n&&e.remainingLanguages.push({...t,checked:o,isOriginal:r});const a=e.remainingLanguages.findIndex(e=>e.locale===s);return(r||o&&a>4)&&e.primaryLanguages.push({...t,checked:o,isOriginal:r}),e},{primaryLanguages:[],remainingLanguages:[]}),[s,n,o]);return(0,ms.jsxs)("ul",{"aria-describedby":t,role:"listbox",tabIndex:-1,className:Is("translation-options"),children:[u.map(({locale:e,nativeName:t,checked:n,isOriginal:o},s)=>(0,ms.jsx)(ec,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e),itemClassName:Is({"translation-options__item--original":o,"translation-options__item--selected":n&&0!==s})},e)),d.map(({locale:e,nativeName:t,checked:n,isOriginal:o})=>(0,ms.jsx)(ec,{id:e,label:t,checked:n,description:o?r("translations.settings.original"):void 0,onChange:l(e)},e))]})},nc=({className:e,children:t,onCancel:n,headingText:r,description:o,descriptionId:s,cancelButtonText:a,cancelButtonRef:i,disableButtonFocusing:c,position:l={horizontal:"left",vertical:"top"}})=>{const u=Bs(),{hideOption:d}=Ps(),{focusButton:p}=Ms(),f=(0,Mo.useCallback)(()=>{d(),c||p()},[c,p,d]),h=(0,Mo.useCallback)(()=>{n&&n(),f()},[f,n]),m=(e=>{const t=(0,Mo.useRef)(null);return(0,Mo.useEffect)(()=>{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})(h);return(0,Mo.useEffect)(()=>{un(m.current)},[m]),(0,ms.jsx)("section",{className:Is("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:(0,ms.jsxs)("div",{className:Is("options__body"),children:[(0,ms.jsx)("h2",{id:u,className:Is("options__title"),children:r}),(0,ms.jsxs)("button",{type:"button",onClick:h,"aria-describedby":u,className:Is("button","options__close"),ref:e=>{i&&(i.current=e)},children:[(0,ms.jsx)(Ks,{name:"close",size:"16",alt:""}),(0,ms.jsx)("span",{children:a})]}),o?(0,ms.jsx)("p",{className:Is("options__description"),id:s,children:o}):null,(0,ms.jsx)("div",{className:Is("options__wrapper"),children:t})]})})},rc=function({onClose:e,position:t}){const{t:n}=Yo(),r=Bs();return(0,ms.jsx)(nc,{onCancel:e,headingText:n("translations.menu.title"),cancelButtonText:n("translations.settings.cancelButtonText"),description:n("translations.menu.description"),descriptionId:r,position:t,disableButtonFocusing:!0,children:(0,ms.jsx)(tc,{describedById:r,onChange:e})})};function oc({children:e,position:t={horizontal:"left",vertical:"top"},classNames:n=[]}){const[r,o]=(0,Mo.useState)(!1),s=(0,Mo.useRef)(null),a=Bs();return(0,ms.jsxs)("div",{className:Is("translations__container"),onKeyDown:e=>{r&&ln(e)===cn.Escape&&(o(!1),un(s.current))},children:[(0,ms.jsx)(qi,{transitionStartState:Hi,isActive:r,children:(0,ms.jsx)("div",{className:Is("options__dialog"),role:"dialog",children:(0,ms.jsx)(rc,{onClose:()=>{o(!1)},position:t})})}),(0,ms.jsx)("button",{type:"button",className:Is(["button","chat__options__button",...n]),id:a,onClick:()=>{o(!r)},onKeyDown:e=>{ln(e)===cn.ArrowDown&&(o(!0),e.preventDefault())},ref:s,"aria-haspopup":"dialog","aria-expanded":r,children:e})]})}const sc=({children:e,formId:t,persistData:n=!1,onError:r,onSubmit:o,validationSchema:s={},...a})=>{const i=Lo(),c=Zt(e=>xi(e,{formId:t})),[l,u]=(0,Mo.useState)(!1),[d,p]=(0,Mo.useState)({}),{isValid:f,errors:h}=function(e,t){const n=(0,Mo.useMemo)(()=>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,s),m=(0,Mo.useMemo)(()=>({...h,...d}),[h,d]);(0,Mo.useLayoutEffect)(()=>{i(nr({formId:t,persistData:n}))},[t,n,i]),(0,Mo.useEffect)(()=>()=>{i(rr({formId:t}))},[t,n,i]);const y=(0,Mo.useCallback)((e,n)=>{i(ar({formId:t,name:e,value:n}))},[t,i]),v=(0,Mo.useCallback)((e,n)=>{i(ir({formId:t,name:e,touched:n}))},[i,t]),g=(0,Mo.useCallback)((e,t)=>{p(n=>({...n,[e]:t}))},[p]),b=(0,Mo.useCallback)(e=>{e.preventDefault();const t="true"===e.submitter.getAttribute("aria-disabled");u(!t),!t&&f&&(i(qn(!0)),o(c,{updateControlValue:y,setError:g}))},[f,i,o,c,y,g]);(0,Mo.useEffect)(()=>{r&&r({errors:m,isSubmitted:l,isValid:0===Object.keys(m).length})},[l,m,r]);const x=(0,Mo.useMemo)(()=>({formId:t,values:c,errors:m,isValid:0===Object.keys(m).length,isSubmitted:l,handleSubmit:b,validationSchema:s,updateControlValue:y,updateControlTouched:v}),[t,c,m,l,b,s,y,v]);return t?o?(0,ms.jsx)(Si,{...a,value:x,children:e}):(console.error('"onSubmit" is required.'),null):(console.error('"formId" is required.'),null)},ac=(e,t,n=null)=>({fn:e,errorText:t,compareValue:n}),ic=(e,t)=>{let n=!0;for(let r=0;r<e.length;r++)e[r].size>t&&(n=!1);return n},cc=e=>!!e?.length,lc=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))},uc=e=>!!e,dc=function({className:e,disableValidationClasses:t=!1,...n}){const{handleSubmit:r,isValid:o,isSubmitted:s}=function(){const{handleSubmit:e,isSubmitted:t,isValid:n}=Ti();return{handleSubmit:e,isSubmitted:t,isValid:n}}(),a=["form"];return!t&&s&&(a.push("form--submitted"),o?a.push("form--valid"):a.push("form--invalid")),(0,ms.jsx)("form",{onSubmit:r,className:Is([...a,e]),...n})};function pc({id:e,error:t}){const[n,r]=(0,Mo.useState)(!1);return(0,Mo.useEffect)(()=>{const e=setTimeout(()=>r(!0),300);return()=>clearTimeout(e)},[]),(0,ms.jsx)("div",{className:Is("error"),"aria-live":"assertive","aria-atomic":"true",children:n&&t&&(0,ms.jsxs)("span",{id:e,className:Is("error__message"),children:[(0,ms.jsx)(Ks,{name:"error",size:"16",alt:""}),t]})})}const fc=({contentHint:e,id:t,labelText:n,labelClass:r,validity:o,errorText:s,children:a})=>(0,ms.jsxs)(ms.Fragment,{children:[e&&(0,ms.jsx)("span",{id:`${t}-content-hint`,className:Is("input__content-hint"),children:e}),(0,ms.jsx)(pc,{id:`${t}-error`,error:!o&&s}),(0,ms.jsxs)("div",{className:Is("form-control__wrapper"),children:[(0,ms.jsx)("label",{htmlFor:t,className:Is(r),children:n}),a]})]}),hc=function({id:e,name:t,type:n,labelText:r,labelClass:o,contentHint:s=null,focus:a,"aria-invalid":i,"aria-describedby":c,...l}){const u=(0,Mo.useRef)(null),{isSubmitted:d}=Ti(),[p,{error:f}]=Ii(t),h=d&&f,m=[];return c&&m.push(c),s&&m.push(`${e}-content-hint`),h&&m.push(`${e}-error`),(0,Mo.useLayoutEffect)(()=>{u.current&&a&&u.current.focus()},[a]),(0,ms.jsx)(fc,{id:e,contentHint:s,validity:!h,errorText:f,labelText:r,labelClass:o,children:(0,ms.jsx)("input",{...p,...l,ref:u,id:e,type:n,"aria-invalid":i||h?"true":"false","aria-describedby":m.join(" ")||void 0,name:t})})};function mc({controlName:e,describedById:t}){const{t:n}=Yo();return(0,ms.jsxs)(dc,{noValidate:"true",className:Is("options__form"),children:[(0,ms.jsx)(hc,{id:"email-id",name:e,type:"email",autocomplete:"email",className:Is("transcript__input"),"aria-describedby":t,labelClass:Is("label"),labelText:n("options.sendTranscript.label")}),(0,ms.jsx)("div",{className:Is("options__actions"),children:(0,ms.jsx)("button",{type:"submit",className:Is("button","button--primary","options__submit"),children:n("options.sendTranscript.sendButtonText")})})]})}const yc="email",vc={sendTranscript:()=>{const[e,t]=(0,Mo.useState)(void 0),{hideOption:n}=Ps(),{focusButton:r}=Ms(),{t:o}=Yo(),s=Bs(),{sendAction:a}=is(),i=(0,Mo.useMemo)(()=>({[yc]:[ac(uc,o("options.sendTranscript.noEmailText")),ac(lc,o("options.sendTranscript.invalidEmailText"))]}),[o]),c=(0,Mo.useCallback)(e=>{const t=e[yc].trim();a({type:"send_transcript",body:{emailAddress:t}}),n(),r()},[a,n,r]),l=(0,Mo.useCallback)(({isValid:e,isSubmitted:n})=>{t(n&&!e?"options--error":void 0)},[t]);return(0,ms.jsx)(nc,{className:e,headingText:o("options.sendTranscript.title"),cancelButtonText:o("options.cancelButtonText"),description:o("options.sendTranscript.description"),descriptionId:s,position:{vertical:"top",horizontal:"right"},children:(0,ms.jsx)(sc,{formId:"sendTranscript",onSubmit:c,validationSchema:i,onError:l,children:(0,ms.jsx)(mc,{controlName:yc,describedById:s})})})}},gc=()=>{const{optionActive:e}=Ps(),t=(0,Mo.useRef)(),n=vc[t.current??e];return e&&(t.current=e),n?(0,ms.jsx)(n,{}):null},bc=()=>{const{t:e}=Yo(),{menuOptions:t,showOption:n,panelActive:r,hideOption:o}=Ps(),{id:s}=Ms(),a=(0,Mo.useRef)(null),[i,c]=(0,Mo.useState)(!1),l=(0,Mo.useRef)(null),u=t.length,d=(0,Mo.useRef)([]),p=(0,Mo.useRef)(!1),f=u>1,h=t[0],m=(0,Mo.useMemo)(()=>h?.name?.trim().replace(/\s+/g,""),[h]);return(0,Mo.useEffect)(()=>()=>{a.current&&clearTimeout(a.current)},[]),(0,Mo.useEffect)(()=>{i&&!p.current&&requestAnimationFrame(async()=>{await gs(60);const e=t.findIndex(e=>e.available),n=-1===e?0:e;d.current&&un(d.current[n])}),p.current=i},[i,t]),u?(0,ms.jsxs)("div",{className:Is("options__container"),onKeyDown:e=>{i&&(ln(e)===cn.Escape&&(c(!1),un(l.current)),ln(e)===cn.Home&&(d.current&&un(d.current[0]),e.preventDefault()),ln(e)===cn.End&&(d.current&&un(d.current[u-1]),e.preventDefault()))},onFocusOut:()=>{f&&(a.current=setTimeout(()=>{c(!1)},200))},onFocusIn:()=>{a.current&&clearTimeout(a.current)},children:[(0,ms.jsx)(qi,{transitionStartState:Hi,isActive:r,children:(0,ms.jsx)("div",{className:Is("options__dialog"),children:(0,ms.jsx)(gc,{})})}),f&&(0,ms.jsx)(qi,{isActive:i,transitionStartState:Hi,children:(0,ms.jsx)("ul",{className:Is(["options__menu"]),role:"menu",tabIndex:-1,"aria-labelledby":s,children:t.map(({name:r,title:o,available:s},a)=>(0,ms.jsx)("li",{className:Is("options__menu__item"),role:"menuitem","data-testid":r,children:(0,ms.jsxs)("button",{type:"button",ref:e=>{e&&(d.current[a]=e)},className:Is(["button","button--secondary"]),onKeyDown:e=>((e,t)=>{if(ln(e)===cn.ArrowDown){const n=Math.min(u-1,t+1);d.current&&un(d.current[t===n?0:n]),e.preventDefault()}if(ln(e)===cn.ArrowUp){const n=Math.max(0,t-1);d.current&&un(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&&un(d.current[o])})(e,a),onClick:()=>((e,t)=>{t&&(c(!1),n(e))})(r,s),"aria-disabled":!s,children:[(0,ms.jsxs)("span",{className:Is("button__text"),children:[o,!s&&" "]}),s?null:(0,ms.jsx)("span",{className:Is("button__state"),children:e("options.unavailableText")})]})},r))})}),(0,ms.jsxs)("button",{type:"button",className:Is(["button","button--secondary","chat__options__button",...!f&&m?[`chat__options__button--${m}`]:[]]),id:s,onClick:()=>{r&&o(),f?c(e=>!e):h.available&&!r&&n(h.name)},onKeyDown:f?e=>{ln(e)===cn.ArrowDown&&(c(!0),e.preventDefault())}:void 0,ref:l,"aria-haspopup":!!f&&"menu","aria-expanded":!!f&&i,"aria-disabled":!f&&!h.available,children:[f?(0,ms.jsx)(Ks,{name:"options",size:"32",alt:""}):null,(0,ms.jsx)("span",{className:Is("button__text"),children:f?e("options.openButtonText"):`${h.title}${h.available?"":" "}`}),f||h.available?null:(0,ms.jsx)("span",{className:Is("button__state"),children:e("options.unavailableText")})]})]}):null};function xc(){const{menuOptions:e,allowOptionSelection:t}=Ps(),{isAvailable:n}=Ss(),r=Zt(ds),{t:o,userLocale:s}=Yo(),a=Ts(s);if(!n&&(!t||!e.length)||r)return null;const i=o("translations.settings.openButtonText",{hasLanguage:!!a,language:a});return(0,ms.jsxs)("div",{className:Is("chat__options"),children:[n&&(0,ms.jsx)("div",{className:Is("chat__options-item","chat__options-item--left"),children:(0,ms.jsxs)(oc,{classNames:["button--secondary"],children:[(0,ms.jsx)(Ks,{alt:i,name:"newTranslation",size:"16"}),(0,ms.jsx)("span",{className:Is("button__text"),children:i})]})}),t&&(0,ms.jsx)("div",{className:Is("chat__options-item","chat__options-item--right"),children:(0,ms.jsx)(bc,{})})]})}const wc=()=>{const{scrollToRef:e,unreadIds:t}=Ri(),{isMinimized:n}=Qo(),{t:r}=Yo();return(0,ms.jsx)(qi,{isActive:!!t.length&&!n,children:(0,ms.jsx)("div",{className:Is("unread-messages"),children:(0,ms.jsxs)("button",{type:"button",className:Is("button","button--primary"),onClick:e,children:[r("message.unreadMessagesCount",{unreadCount:t.length}),(0,ms.jsx)(Ks,{name:"chevronDown",size:"32",alt:""})]})})})},_c=({children:e})=>{const t=vn(),n=(0,Mo.useMemo)(()=>t.reduce((e,t)=>t.payload.id?(e[t.payload.id]=(0,Po.createRef)(),e):e,{}),[t]),{scrollToRef:r,scrollToBottom:o,containerRef:s,unreadIds:a}=(e=>{const t=(0,Mo.useRef)(null),[n,r]=(0,Mo.useState)(!0),o=Zt(mi),s=vn(),a=gn(),{isOpen:i}=Qo(),c=hn().loadedImageEventIds,{processingFileUploads:l,isLastEventFromClient:u}=Zt(({state:e})=>e);(0,Mo.useEffect)(()=>{const e=t.current;if(!e)return()=>{};const n=()=>{const{scrollHeight:t,scrollTop:n,clientHeight:o}=e,s=Math.abs(t-n-o)>10;r(!s)};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)},[]);const d=(0,Mo.useCallback)(()=>{requestAnimationFrame(async()=>{await gs(30),t.current?.scrollTo({top:t.current?.scrollHeight,left:0,behavior:"auto"})})},[]);return(0,Mo.useEffect)(()=>{u&&d()},[u,d]),(0,Mo.useEffect)(()=>{n&&d()},[n,o,s,a,i,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(0,ms.jsx)(Ai.Provider,{value:{eventRefs:n,unreadIds:a,scrollToRef:r,scrollToBottom:o,containerRef:s},children:(0,ms.jsxs)("div",{className:Is("chat__container"),children:[(0,ms.jsx)("div",{className:Is("chat__container__scroll-area"),ref:s,children:e}),(0,ms.jsx)(wc,{})]})})},Cc=({baseClassName:e,children:t,title:n})=>{const r=wn(),o=Bs();return(0,ms.jsxs)("section",{id:r,className:Is(e),"aria-describedby":o,tabIndex:-1,children:[(0,ms.jsx)("h2",{className:Is(`${e}__title`),id:o,children:n}),t]})},Sc=()=>{const{t:e}=Yo(),t=ws(),n=Ds(),{emitEvent:r}=is(),{isActive:o,remaining:s,timer:a,endCountdown:i}=Fs(),c=!!s&&s>0,l=e(c?"idleDetachWarning.countdownTitle":"idleDetachWarning.notifyTransferText");return(0,ms.jsx)(Cc,{baseClassName:"idle",title:l,children:c&&(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)("div",{className:Is("idle__count-container"),children:o&&(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)("span",{className:Is("idle__count-text"),children:e("idleDetachWarning.countdownText")}),(0,ms.jsx)("span",{className:Is("idle__count-timer"),children:e("idleDetachWarning.countdownTimer",a)})]})}),(0,ms.jsxs)("div",{className:Is("idle__options"),children:[(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:()=>{n(),i(!0),t(),r("idleTimer.selectContinue")},children:e("idleDetachWarning.continueButton")}),(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:()=>{i(),t(),r("idleTimer.selectEnd")},children:e("idleDetachWarning.detachButton")})]})]})})},Ec=()=>{const{t:e}=Yo(),t=Ds(),{name:n}=Sn()||{},{continueChat:r,restartChat:o}=zs();return(0,ms.jsx)(Cc,{baseClassName:"prompt",title:e("resumeConversationPrompt.title",{name:n}),children:(0,ms.jsxs)("div",{className:Is("prompt__options"),children:[(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:()=>{t(),r()},children:e("resumeConversationPrompt.continueButton")}),(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:o,children:e("resumeConversationPrompt.detachButton")})]})})},jc=()=>{const{sendAction:e}=is(),{features:t}=Ps(),{typingPeekahead:n}=t||{},r=(0,Mo.useRef)(null),o=(0,Mo.useRef)(null),s=(0,Mo.useRef)(!1),a=(0,Mo.useRef)(null);(0,Mo.useEffect)(()=>()=>{a.current&&clearInterval(a.current),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current)},[]);const i=(t,r)=>{e({type:"typing",state:t,...n&&n.enabled?{body:{currentMessage:r}}:{}})};return e=>{e.code&&"Enter"===e.code||13===e.keyCode||(s.current=!0,a.current||(i(!0,e.target.value),a.current=setInterval(()=>{!s.current&&a.current?(clearInterval(a.current),a.current=null):n&&n.enabled&&i(!0,e.target.value)},2e3)),r.current&&clearTimeout(r.current),o.current&&clearTimeout(o.current),r.current=setTimeout(()=>{s.current=!1},300),o.current=setTimeout(()=>{i(!1,e.target.value)},2e3))}},Tc=()=>{const{default:e,active:t,userSelected:n,options:r,optionsOverride:o}=hn().entryMeta,s=Lo(),a=n||t||e,i=o&&o[a]||r&&r[a]||{},c=(0,Mo.useCallback)(e=>{s(Vr(e))},[s]),l=(0,Mo.useCallback)(e=>{s(zr(e))},[s]),u=(0,Mo.useCallback)(e=>{s(lo(e))},[s]),d=(0,Mo.useCallback)(()=>{n?u(null):l(e)},[l,u,e,n]);return{activeEntry:a,activeEntryOptions:i,setActiveEntryType:l,setUserEntryType:u,cancelEntrySelection:d,setBlockAutoEntrySwitch:c}};function Ic({controlName:e,skipLinkId:t}){const{t:n}=Yo(),{setInputFocus:r}=Qo(),{sendAssertive:o}=ls(),{emitEvent:s}=is(),a=jc(),{setBlockAutoEntrySwitch:i}=Tc(),{placeholder:c,label:l,labelClass:u}=ki(e),{hasCharacterLimit:d,reachedCharacterWarning:p,reachedCharacterLimit:f,remainingChars:h}=Ni(e),[{value:m}]=Ii(e),y=!!m,v=(0,Mo.useCallback)(()=>{p&&o(n("input.srCharacterLimitText",{limit:h})),s("ui.inputFocus")},[n,o,p,h,s]);return(0,Mo.useLayoutEffect)(()=>(i(y),()=>{i(!1)}),[i,y]),(0,ms.jsxs)(dc,{className:Is("entry-form"),disableValidationClasses:!0,noValidate:"true",children:[(0,ms.jsxs)("div",{className:Is(["input--text__container",...p&&!f?["character-warning"]:[],...f?["character-exceeded"]:[]]),children:[(0,ms.jsx)(hc,{id:t,type:"text",name:e,className:Is("input__text"),autocomplete:"off",placeholder:c,labelText:l,labelClass:Is(u),"aria-invalid":!!d&&f,onKeyUp:a,onFocus:v,focus:r}),(0,ms.jsx)("div",{className:Is("character-count"),children:p&&(0,ms.jsx)("span",{children:h})})]}),(0,ms.jsx)("button",{className:Is("button","input__submit"),onPointerDown:e=>{e.preventDefault()},"aria-disabled":!y||f,children:(0,ms.jsx)(Ks,{name:"send",size:"32",alt:n("input.sendMessage")})})]})}const Nc="textMessageEntry";function kc({...e}){const{isOpen:t,setVisibility:n}=Qo(),r=wn(),o=ws(),{sendMessage:s}=is(),a=(0,Mo.useCallback)((e,{updateControlValue:r})=>{s({body:e[Nc]}),r(Nc,""),o(),t||n({visibility:Ot.open})},[s,o,t,n]);return(0,ms.jsx)(sc,{...e,formId:"textEntry",persistData:!0,onSubmit:a,children:(0,ms.jsx)(Ic,{controlName:Nc,skipLinkId:r})})}const Oc=()=>{const{t:e}=Yo(),{currentUploads:t}=As();return(0,ms.jsx)("div",{className:Is("progress"),children:t.map(({id:t,name:n,progress:r,uploading:o,error:s})=>(0,ms.jsxs)("div",{className:Is("progress_container"),children:[(0,ms.jsxs)("div",{className:Is("progress__text"),children:[(0,ms.jsx)("span",{className:Is("progress__text--file-name"),children:n}),(0,ms.jsx)("span",{className:Is("progress__text--percentage"),children:`${r}%`})]}),(0,ms.jsx)(pc,{error:s,id:"progress-error"}),(0,ms.jsx)("progress",{className:Is("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 Lc({id:e,name:t,labelText:n,contentHint:r,outputText:o,accept:s}){const{isSubmitted:a}=Ti(),[i,c]=(0,Mo.useState)(!1),[{onInput:l,onBlur:u},{error:d}]=Ii(t),p=Bs(),f=Bs(),h=Bs(),m=a&&d,y=[h];r&&y.push(f),m&&y.push(p);const v=(0,Mo.useCallback)(()=>{c(!0)},[c]),g=(0,Mo.useCallback)(()=>{c(!1),u()},[c,u]),b=(0,Mo.useCallback)(e=>{const t={target:{value:e.target.files}};l(t)},[l]);return(0,ms.jsxs)("div",{className:Is("upload__container"),children:[r&&(0,ms.jsx)("span",{className:Is("upload__content-hint"),id:f,children:r}),(0,ms.jsx)(pc,{id:p,error:m&&d}),(0,ms.jsx)("div",{className:Is(["file-upload",...i?["focus-within"]:[]]),children:(0,ms.jsxs)("label",{htmlFor:e,className:Is("upload__label"),children:[(0,ms.jsx)(Ks,{name:"upload",size:"32",alt:""}),(0,ms.jsxs)("div",{children:[(0,ms.jsx)("span",{className:Is(["upload__label--text"]),children:n}),(0,ms.jsx)("input",{id:e,className:Is("upload__input"),type:"file",name:t,onChange:b,"aria-invalid":m?"true":"false","aria-describedby":y.join(" "),accept:s||null,onFocus:v,onBlur:g}),(0,ms.jsx)("span",{className:Is("upload__output"),"aria-hidden":"true",id:h,children:o})]})]})})]})}const Rc=({skiplinkId:e,controlName:t,accept:n,contentHint:r,isUploading:o,isComplete:s,onClickCancel:a})=>{const{t:i}=Yo(),[{value:c}]=Ii(t),l=c&&c.length>0,u=l&&"string"!=typeof c?c[0].name:"";return(0,ms.jsxs)(dc,{className:Is("upload-form"),children:[(0,ms.jsx)(Lc,{name:t,id:e,accept:n,labelText:i("fileUpload.labelText"),outputText:i("fileUpload.selectedText",{hasFile:l,filename:u}),contentHint:r}),(0,ms.jsxs)("div",{className:Is("upload__button-container"),children:[(0,ms.jsx)("button",{id:o||!s?e:void 0,type:"button",onClick:a,className:Is("button","button--secondary","upload__cancel"),children:i("fileUpload.cancelButtonText")}),(0,ms.jsx)("button",{className:Is("button","button--primary"),type:"submit",children:i("fileUpload.uploadButtonText")})]})]})},Ac="fileListForm",Pc="fileList",Mc=()=>{const{t:e}=Yo(),{sendPolite:t,sendAssertive:n}=ls(),r=wn(),o=ws(),{serviceAllowsUploads:s,allowedMimeTypes:a,maxSize:i}=Rs(),c=(0,Mo.useRef)(null),l=(0,Mo.useRef)(s),{cancelEntrySelection:u}=Tc(),{uploadFile:d,clearUploads:p,isUploading:f,isComplete:h}=As(),{uploadHandle:m,hasServerError:y,progress:v}=((e,t)=>{const n=Zt(n=>wi(n,{formId:e,name:t})),{currentUploads:r}=As(),o=n&&n.length>0;let s=null,a=!1,i=0;if(r&&r.length>0){const e=r[0];s=e.uploadHandle,a=!!e.error,i=e.progress}return{hasFile:o,selectedFileName:o?n[0].name:"",uploadHandle:s,hasServerError:a,progress:i}})(Ac,Pc),g=Bs(),b=(0,Mo.useRef)(!0),x=e("fileUpload.contentHint",{size:sn(i)}),w=(0,Mo.useRef)(""),_=(0,Mo.useRef)(null);(0,Mo.useEffect)(()=>{w.current&&_.current?.contains(document.activeElement)&&"INPUT"===document.activeElement?.tagName&&n(x),w.current=x},[x,n]),(0,Mo.useEffect)(()=>{v>0&&t(1===v?e("fileUpload.srStartedText"):`${v}%`)},[v,t,e]),(0,Mo.useEffect)(()=>{b.current||f||!h||(p(),u(),o(),setTimeout(()=>{t(e("fileUpload.srCompleteText"))},300)),b.current=h},[f,h,p,u,o,t,e]),(0,Mo.useEffect)(()=>{s||f||(p(),u(),o())},[s,f,p,u,o]);const C=(0,Mo.useCallback)(({fileList:e})=>{d(e[0]),o()},[d,!1,o]),S=(0,Mo.useCallback)(()=>{m&&m.abort(),p(),u(),o()},[m,p,u,o]),E=(0,Mo.useMemo)(()=>({[Pc]:[ac(()=>s,e("fileUpload.errors.unavailable")),ac(cc,e("fileUpload.errors.noFile")),ac(ic,e("fileUpload.errors.tooLarge"),i)]}),[i,s,e]);return(0,ms.jsx)("div",{className:Is(["upload",...y?["upload--error"]:[]]),ref:_,children:(0,ms.jsxs)(sc,{formId:Ac,persistData:!0,onSubmit:C,validationSchema:E,children:[(f||!h)&&(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)(Oc,{}),(0,ms.jsx)("div",{className:Is("upload__button-container"),children:(0,ms.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,ref:c,className:Is("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]}),!f&&h&&(0,ms.jsx)(Rc,{controlName:Pc,skiplinkId:r,accept:a?.join(", ")||"",contentHint:x,isComplete:h,isUploading:f,onClickCancel:S}),!l.current&&(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)("span",{className:Is("notification"),id:g,children:e("fileUpload.unavailableText")}),(0,ms.jsx)("div",{className:Is("upload__button-container"),children:(0,ms.jsx)("button",{id:f||!h?r:void 0,type:"button",onClick:S,className:Is("button","button--secondary","upload__cancel"),children:e("fileUpload.cancelButtonText")})})]})]})})},Uc=()=>{const{t:e}=Yo(),{showFileUpload:t,serviceAllowsUploads:n}=Rs(),[r,o]=(0,Mo.useState)(n||!1),s=ws(),a=(0,Mo.useRef)(null),{setUserEntryType:i,activeEntry:c}=Tc(),l=(0,Mo.useRef)(null),{sendPolite:u}=ls(),d=!!Sn();return(0,Mo.useEffect)(()=>{dn(l.current,()=>{n||s()}),o(n||!1)},[n,s]),(0,Mo.useEffect)(()=>{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===S?null:(0,ms.jsx)(qi,{isActive:r,transitionStartState:Wi,children:(0,ms.jsx)("div",{className:Is("upload-toggle-wrapper"),children:(0,ms.jsx)(qi,{isActive:r,transitionStartState:Gi,children:(0,ms.jsx)("button",{className:Is(["button","button--secondary","upload-toggle"]),ref:l,"aria-disabled":!r,type:"button",onClick:r?()=>{i(S),s()}:void 0,tabIndex:r?void 0:-1,children:(0,ms.jsx)(Ks,{name:"file",size:"32",alt:e("fileUpload.toggleButtonText")})})})})})},Dc=()=>{const{isOpen:e}=Qo(),t=(0,Mo.useRef)(null),{hasCountdown:n}=Fs(),[r,o]=(0,Mo.useState)(n),{hasPrompt:s}=zs(),[a,i]=(0,Mo.useState)(s),c=ws(),l=(0,Mo.useRef)(!1),{activeEntry:u,activeEntryOptions:d}=Tc(),[p,f]=(0,Mo.useState)({text:kc,upload:Mc}),[h,m]=(0,Mo.useState)(()=>u),y=en(),{accountAllowsUploads:v}=Rs(),g=(0,Mo.useCallback)(()=>{dn(t.current,c)},[c]);(0,Mo.useEffect)(()=>{const{customComponents:e}=y,{entry:t}=e||{};t&&f(e=>({...e,...t}))},[y]),(0,Mo.useEffect)(()=>{g(),o(n),i(s)},[n,s,g]),(0,Mo.useEffect)(()=>{m(u),g()},[u,g,t]),l.current=!(!t.current||!t.current.contains(document.activeElement));const b=p[h]||kc,{allowManualInput:x=!0}=d;return(0,ms.jsxs)("div",{className:Is("chat__entry"),ref:t,children:[r&&(0,ms.jsx)(Sc,{}),a&&(0,ms.jsx)(Ec,{}),(0,ms.jsxs)("div",{className:Is(["entry__body",...n||s||!1===x?["entry__body--hidden"]:[]]),children:[h!==S&&v&&e?(0,ms.jsx)(Uc,{}):null,(0,ms.jsx)(b,{})]})]})},Fc=()=>{const{t:e}=Yo(),{isOpen:t,closeChat:n}=Qo(),{isWindow:r}=jn(),o=_s(),s=(0,Mo.useCallback)(()=>{n(),o()},[n,o]);return t&&r?(0,ms.jsx)("button",{type:"button",className:Is("button","collapse-button"),onClick:s,children:(0,ms.jsx)(Ks,{name:"chevronDown",size:"32",alt:e("window.srCollapseButton")})}):null},zc=()=>{const{meta:{originalError:e,title:t,message:n,buttonText:r,action:o,srText:s}}=ps(),a=is(),i=Bs(),{sendPolite:c}=ls(),l=ws(),u="SeamlySessionExpiredError"===e?.name;return(0,Mo.useEffect)(()=>{!u&&s&&setTimeout(()=>{c(s)},200)},[c,s,u]),u?(0,ms.jsx)(ms.Fragment,{}):(0,ms.jsxs)("section",{className:Is("interrupt"),"aria-labelledby":i,children:[(0,ms.jsx)(Fc,{}),(0,ms.jsxs)("div",{className:Is("interrupt__body"),children:[(0,ms.jsx)("h2",{id:i,className:Is("interrupt__title"),children:t}),(0,ms.jsx)("p",{className:Is("interrupt__message"),children:n}),r&&o&&(0,ms.jsx)("div",{className:Is("interrupt__actions"),children:(0,ms.jsx)("button",{type:"button",className:Is("button","button--primary"),onClick:()=>{o&&a[o]&&a[o](),l()},children:r})})]})]})},Bc=function({children:e}){const t=Zt(ds),{isOpen:n}=Qo();return t?(0,ms.jsx)(zc,{}):(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsxs)(_c,{children:[(0,ms.jsxs)("div",{className:Is("chat__container__header"),children:[(0,ms.jsx)(Zi,{}),(0,ms.jsx)(Fc,{})]}),e]}),(0,ms.jsx)(Dc,{}),n&&(0,ms.jsx)(xc,{})]})};function Vc({event:e}){const[t]=Pi(e);return(0,ms.jsx)("li",{children:(0,ms.jsx)(t,{event:e})})}function $c({events:e}){return(0,ms.jsx)("ul",{className:Is("collapsed-chat-messages"),children:e.map(e=>(0,ms.jsx)(Vc,{event:e},e.payload.id))})}function Hc(){const{preChatEvents:e}=en(),t=Zt(ds),{isOpen:n}=Qo();return t||!e?.length||n?null:(0,ms.jsx)($c,{events:e})}function Wc(){const{t:e}=Yo(),t=e("window.chat.continue"),n=(0,Mo.useMemo)(()=>({type:"message",payload:{type:"custom",body:{text:t,type:"",data:{}},participant:"seamly-client-participant"}}),[t]);return(0,ms.jsx)($c,{events:[n]})}const Gc=()=>{const e=tn(),t=Sn(),n=Zt(ds),r=t&&!n,o=r?t.avatar:e;return o?(0,ms.jsx)("img",{className:Is(r?"avatar":"icon"),src:o,alt:""}):(0,ms.jsx)(Ks,{name:"avatar",size:"32",alt:""})},qc=({onClick:e})=>{const t=as(),{t:n}=Yo(),r=t()?n("window.openButton.srContinue"):n("window.openButton.srStart"),o=(()=>{const e=xn();return xs(e)})(),s=ws(),{isOpen:a}=Qo(),{windowOpenButtonId:i}=hn(),c=bn(),l=(0,Mo.useCallback)(t=>{e(),t.detail>0?s():o()},[o,s,e]);return(0,ms.jsx)(qi,{isActive:!a,transitionStartState:Wi,children:(0,ms.jsxs)("button",{type:"button",className:Is("window-open-button"),"aria-label":r,onClick:l,inert:a||void 0,id:i,children:[(0,ms.jsx)(qi,{isActive:!!c,transitionStartState:Hi,children:(0,ms.jsx)("span",{className:Is("message-count"),"aria-hidden":"true",children:c})}),(0,ms.jsx)(Gc,{})]})})},Kc=(e,t,n)=>"object"==typeof e?e[t]:n,Jc=n.p+"sounds/beep.mp3",Xc=!!window.Notification,Yc={app:()=>(0,ms.jsx)(Ji,{children:(0,ms.jsx)(Bc,{children:(0,ms.jsx)(Fi,{})})}),inline:()=>{const{showInlineView:e,containerRef:t}=(()=>{const e=Lo(),{connectWhenInView:t}=en(),n=Zt(In),{containerRef:r,isVisible:o}=Zo({enabled:t,freezeOnceVisible:!0});return(0,Mo.useEffect)(()=>{o&&e(No())},[e,o]),{containerRef:r,showInlineView:n}})(),{isOpen:n}=Qo();return(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)(qi,{isActive:!n,transitionStartState:Wi,children:(0,ms.jsxs)("div",{ref:t,className:Is("unstarted-wrapper","unstarted-wrapper--inline"),children:[(0,ms.jsx)(Hc,{}),(0,ms.jsx)(Ki,{})]})}),(0,ms.jsx)(qi,{isActive:n,transitionStartState:Wi,children:(0,ms.jsx)(Ji,{ref:t,children:e&&(0,ms.jsx)(Bc,{children:n&&(0,ms.jsx)(Fi,{})})})})]})},window:()=>{const{isOpen:e,openChat:t}=Qo(),n=es(),{continueChat:r,preChat:o}=en();return(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)(qc,{onClick:t}),(0,ms.jsx)(qi,{isActive:!!o&&!e&&!n,exitAfter:Kc(o,"exitAfter"),enterDelay:Kc(o,"enterDelay"),transitionStartState:Hi,children:(0,ms.jsx)("div",{className:Is("unstarted-wrapper","unstarted-wrapper--window"),children:(0,ms.jsx)(Hc,{})})}),(0,ms.jsx)(qi,{isActive:r&&!e&&n,exitAfter:Kc(r,"exitAfter"),enterDelay:Kc(r,"enterDelay"),transitionStartState:Hi,children:(0,ms.jsx)("div",{className:Is("unstarted-wrapper","unstarted-wrapper--window","unstarted-wrapper--continue"),children:(0,ms.jsx)(Wc,{})})}),(0,ms.jsx)(qi,{isActive:e,transitionStartState:Hi,children:(0,ms.jsx)(Ji,{children:(0,ms.jsx)(Bc,{children:(0,ms.jsx)(Fi,{})})})})]})}};function Qc(e){const t=document.createElement("div");return t.innerHTML=e||"",t.textContent||t.innerText||""}const Zc=({children:e})=>{const{sendNotification:t}=(()=>{const{proactiveMessages:e}=_n(),{notificationAudioURL:t}=en(),[n,r]=(0,Mo.useState)(Xc?Notification.permission:"default"),[o,s]=(0,Mo.useState)(document.visibilityState),a=Zt(yi),i=(0,Mo.useCallback)(async()=>{if(Xc&&"granted"!==n){const e=await Notification.requestPermission();r(e)}},[n]),c=(0,Mo.useMemo)(()=>"granted"===n,[n]),l=(0,Mo.useMemo)(()=>"hidden"===o,[o]);(0,Mo.useEffect)(()=>{"default"===n&&e&&i()},[n,e,i]);const u=(0,Mo.useCallback)(async(e,r)=>{if(a&&Xc){if("default"===n&&i(),!1!==t&&!c&&(l||!document.hasFocus()))try{const e=new Audio(t||Jc);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=${Nc}]`);e&&e.focus()}}}},[t,n,c,i,a,l]);return(0,Mo.useEffect)(()=>{if(!a)return()=>{};function e(){s(document.visibilityState)}return document.addEventListener("visibilitychange",e,!1),()=>{document.removeEventListener("visibilitychange",e)}},[a]),{permission:n,requestPermission:i,sendNotification:u}})(),[,n]=bs(),r=en(),o=Sn(),{proactiveMessages:s}=_n(),{isOpen:a,isVisible:i}=Qo(),c=Ns(),l=es(),u=Zt(hi),{body:d}=Es(u),{userLocale:p}=Yo(),f=(0,Mo.useRef)(void 0),h=(0,Mo.useMemo)(()=>d?"string"==typeof d?Qc(d):"text"in d?Qc(d.text):"prompt"in d&&d.prompt&&"text"in d.prompt?Qc(d.prompt?.text):"":"",[d]);(0,Mo.useEffect)(()=>{o?.name&&h&&s&&u&&f.current!==u.payload?.id&&(t(o.name,{body:h,icon:o?.avatar||void 0}),f.current=u.payload.id)},[o?.avatar,o?.name,u,h,s,t]);const m=Yc[r.layoutMode],y=(0,Mo.useCallback)(e=>{"function"==typeof n&&n(e)},[n]),v=(0,Mo.useMemo)(()=>{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"),i?(0,ms.jsx)("div",{className:Is(g),lang:v,tabIndex:-1,"data-nosnippet":!0,style:{zIndex:r?.zIndex},ref:y,children:e||(0,ms.jsx)(m,{})}):null},el=e=>(0,ms.jsx)(pi,{...e,children:(0,ms.jsx)(Zc,{})});class tl{constructor(e,t){const{namespace:n="",parentElement:r,...o}=e;this.config={...o,namespace:n},this.namespace=n,this.parentElement=r,this.externalApi=t,this.api=new H({layoutMode:e.layoutMode,namespace:e.namespace,config:e.api,context:e.context}),this.eventBus=new(Ao()),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=function({initialState:e,api:t,eventBus:n,config:r}){const o=et({reducer:Oo,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:s,layoutMode:a}=Lt(t()),{error:i,type:c}=n,l=Xn[i?.name]?new Xn[i.name](i):new m(i);r?.(l,{namespace:o,api:s,layoutMode:a,conversationUrl:e.getConversationUrl(),action:c?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===gr.type){if(!wr.includes(r.name))throw new v(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 po.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}),vo)});return o}({api:this.api,eventBus:this.eventBus,config:n,initialState:void 0});r.dispatch(Bn(n)),await r.dispatch(xt()),await r.dispatch(Rn()),r.dispatch(Ln()),e?(0,Po.render)((0,ms.jsx)(pi,{eventBus:this.eventBus,store:r,api:this.api,children:(0,ms.jsx)(e,{})}),this.parentElement):(0,Po.render)((0,ms.jsx)(el,{config:n,eventBus:this.eventBus,store:r,api:this.api}),this.parentElement)}destroy(){(0,Po.render)(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 nl=e=>"object"==typeof e&&"action"in e,rl=e=>({...e,args:Array.isArray(e.args)?e.args:[e.args]}),ol=class{constructor(e){this._waitingActions=[],this._instances={},this.timeouts={},this.appConfig=e,this.context={}}push(...e){(e=e.filter(nl).map(rl)).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:e,locale:n}=t;return e&&n&&(this.context.userLocale=n,this.context.source=A),!0}case"setContext":{const{userLocale:e,contentLocale:n}=t;return this.context.userLocale=e,this.context.contentLocale=n,e&&e!=this.appConfig?.userLocale&&(this.context.source=A),!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={},this.debouncedRender(e,n.namespace)}}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 tl(e,this)}debouncedRender(e,t){window.clearTimeout(this.timeouts[t]),this.timeouts[t]=window.setTimeout(()=>{e.render()},100)}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||{}}}},sl=()=>{const e=Lo();return{addEvent:t=>e(Ir(t)),clearEvents:()=>e(Or()),setEventsRead:t=>e($r(t)),setLoadedImageEventIds:t=>e(Qr(t)),setIsLoading:t=>e(Yr(t)),setParticipant:t=>e(Zr(t)),setHeaderTitle:t=>e(Kr(t)),setHeaderSubTitle:t=>e(qr(t)),setActiveService:t=>e(Br(t)),initIdleDetachCountdown:t=>e(Ur(t)),decrementIdleDetachCountdownCounter:()=>e(Pr()),stopIdleDetachCountdownCounter:()=>e(ho()),clearIdleDetachCountdown:()=>e(Rr()),initResumeConversationPrompt:()=>e(Dr()),clearResumeConversationPrompt:()=>e(Ar()),setServiceDataItem:t=>e(to(t)),setFeatures:t=>e(Gr(t)),setFeatureEnabledState:t=>e(Hr(t)),clearFeatures:()=>e(Lr()),setInitialState:t=>e(Xr(t)),setUserSelectedOptions:t=>e(po(t)),setUserSelectedOption:t=>e(uo(t)),showOption:t=>e(fo(t)),hideOption:()=>e(Mr()),setServiceEntryMetadata:t=>e(no(t)),setBlockAutoEntrySwitch:t=>e(Vr(t)),setActiveEntryType:t=>e(zr(t)),setUserEntryType:t=>e(lo(t)),registerUpload:t=>e(Fr(t)),setUploadProgress:t=>e(ao(t)),setUploadComplete:t=>e(oo(t)),setUploadError:t=>e(so(t)),clearAllUploads:()=>e(kr()),setSeamlyContainerElement:t=>e(eo(t))}};function al(){return{get:()=>{if(Object.prototype.hasOwnProperty.call(window,"SeamlyBridge"))try{return JSON.parse(window.SeamlyBridge.getData())}catch(e){return console.error("Unexpected or malformed data retrieved from bridge",e),{}}return window.seamlyBridgeData},set:e=>{window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.seamlyBridge&&window.webkit.messageHandlers.seamlyBridge.postMessage(JSON.stringify(e)),Object.prototype.hasOwnProperty.call(window,"SeamlyBridge")&&window.SeamlyBridge.setData(JSON.stringify(e)),window.ReactNativeWebView&&window.ReactNativeWebView.postMessage(JSON.stringify(e))}}}function il(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var cl=function e(t,n){function r(e,r,o){if("undefined"!=typeof document){"number"==typeof(o=il({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(r,e)+s}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},o=0;o<n.length;o++){var s=n[o].split("="),a=s.slice(1).join("=");try{var i=decodeURIComponent(s[0]);if(r[i]=t.read(a,i),e===i)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){r(e,"",il({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,il({},this.attributes,t))},withConverter:function(t){return e(il({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});function ll(e={}){return function(t){const n=`cvco.${t}`;return{get(){const e=cl.get(n);return e?JSON.parse(e):null},set(t){t&&cl.set(n,JSON.stringify(t),e)}}}}const ul=()=>{const{t:e}=Yo(),{title:t,subTitle:n}=hn().headerTitles,r=bn(),{isOpen:o}=Qo(),s=Sn(),a=Zt(ds),i=tn(),c=s?.avatar??i,l=a?"":n,u=["message-count"];return o&&u.push("message-count__hide"),0===r&&u.push("message-count__empty"),l||!o?(0,ms.jsxs)("div",{className:Is("agent-info"),children:[(0,ms.jsxs)("div",{className:Is("agent-info__graphic"),children:[c?(0,ms.jsx)("img",{className:Is(s?.avatar?"avatar":"icon"),src:c,alt:""}):(0,ms.jsx)(Ks,{name:"avatar",size:"32",alt:""}),(0,ms.jsx)("span",{className:Is(u),"aria-hidden":"true",children:r})]}),(0,ms.jsxs)("div",{className:Is("agent-info__body"),children:[(0,ms.jsx)("p",{className:Is("agent-info__heading"),children:t??e("header.title")}),(0,ms.jsx)("p",{className:Is("agent-info__text"),children:l})]})]}):null},dl=({children:e,onCloseChat:t})=>{const{headerCollapseButtonId:n}=hn(),r=(0,Mo.useRef)(null),{t:o}=Yo();return(0,ms.jsxs)("header",{className:Is("chat__header"),children:[e,(0,ms.jsx)("div",{className:Is("header-controls"),children:(0,ms.jsx)("button",{type:"button",className:Is("button","header-controls__collapse"),onClick:t,ref:r,id:n,children:(0,ms.jsx)(Ks,{name:"chevronDown",size:"32",alt:o("header.collapseApp")})})})]})},pl=()=>{const e=new URLSearchParams(window.location.search);return Array.from(e.entries()).reduce((e,[t,n])=>({...e,[t]:n}),{})},fl=e=>new URLSearchParams(e).toString(),hl=(...e)=>{const t=new URL(window.location.href);return e.reduce((e,n)=>{const r=t.searchParams.get(n)||sessionStorage.getItem(n);return r&&(e[n]=r),e},{})},ml=(...e)=>{const t=new URL(window.location.href),n=e.reduce((e,n)=>{const r=t.searchParams.get(n),o=r||sessionStorage.getItem(n);return r&&sessionStorage.setItem(n,r),o?(e.set(n,o),e):e},new URLSearchParams),r=new URLSearchParams({...Object.fromEntries(t.searchParams),...Object.fromEntries(n)});return r.toString()&&window.history.replaceState(null,"",`?${r}`),hl(...n.keys())},yl=(...e)=>{const t=document.querySelector("[data-reset-search-params]");t&&t.addEventListener("click",t=>{t.preventDefault();const n=new URL(window.location.href);e.forEach(e=>{sessionStorage.removeItem(e),n.searchParams.delete(e)}),window.location.href=n.toString()})},vl=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 ol(e);window.seamly={push:n.push.bind(n)},n.push(...t)}})(),module.exports=r})();
|
|
3
3
|
//# sourceMappingURL=~/index.min.js.map
|