@kindly/react-chat 2.34.6 → 2.35.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("pusher-redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","pusher-redux","react-dom"],t):"object"==typeof exports?exports.kindlyChat=t(require("react"),require("prop-types"),require("pusher-redux"),require("react-dom")):e.kindlyChat=t(e.react,e["prop-types"],e["pusher-redux"],e["react-dom"])}(window,(function(e,t,n,r){return function(e){function t(t){for(var n,o,a=t[0],i=t[1],s=0,l=[];s<a.length;s++)o=a[s],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&l.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(c&&c(t);l.length;)l.shift()()}var n={},r={0:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var a=new Promise((function(t,o){n=r[e]=[t,o]}));t.push(n[2]=a);var i,s=document.createElement("script");s.charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.src=function(e){return o.p+""+({}[e]||e)+".736d9458bfcda50c41a3."+{1:"0b1c6c3ce0d8ce59fb94"}[e]+".chunk.js"}(e);var c=new Error;i=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var o=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",c.name="ChunkLoadError",c.type=o,c.request=a,n[1](c)}r[e]=void 0}};var l=setTimeout((function(){i({type:"timeout",target:s})}),12e4);s.onerror=s.onload=i,document.head.appendChild(s)}return Promise.all(t)},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpkindlyChat=window.webpackJsonpkindlyChat||[],i=a.push.bind(a);a.push=t,a=a.slice();for(var s=0;s<a.length;s++)t(a[s]);var c=i;return o(o.s=70)}([function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Ie})),n.d(t,"b",(function(){return be})),n.d(t,"d",(function(){return Me})),n.d(t,"e",(function(){return Pe}));var r=n(9),o=n(0),a=n.n(o),i=n(31),s=n.n(i),c=n(32),l=n(33),u=n(13),d=n(10),p=n.n(d);function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var h=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},m=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!Object(r.typeOf)(e)},g=Object.freeze([]),b=Object.freeze({});function v(e){return"function"==typeof e}function y(e){return e.displayName||e.name||"Component"}function w(e){return e&&"string"==typeof e.styledComponentId}var E=void 0!==e&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",x="undefined"!=typeof window&&"HTMLElement"in window,_=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:void 0!==e&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==e&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY));function C(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var T=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&C(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var a=r;a<o;a++)this.groupSizes[a]=0}for(var i=this.indexOfGroup(e+1),s=0,c=t.length;s<c;s++)this.tag.insertRule(i,t[s])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,a=r;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),k=new Map,O=new Map,S=1,I=function(e){if(k.has(e))return k.get(e);for(;O.has(S);)S++;var t=S++;return k.set(e,t),O.set(t,e),t},A=function(e){return O.get(e)},j=function(e,t){t>=S&&(S=t+1),k.set(e,t),O.set(t,e)},N="style["+E+'][data-styled-version="5.3.1"]',M=new RegExp("^"+E+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P=function(e,t,n){for(var r,o=n.split(","),a=0,i=o.length;a<i;a++)(r=o[a])&&e.registerName(t,r)},R=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,a=n.length;o<a;o++){var i=n[o].trim();if(i){var s=i.match(M);if(s){var c=0|parseInt(s[1],10),l=s[2];0!==c&&(j(l,c),P(e,l,s[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(i)}}},L=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},D=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(E))return r}}(n),a=void 0!==o?o.nextSibling:null;r.setAttribute(E,"active"),r.setAttribute("data-styled-version","5.3.1");var i=L();return i&&r.setAttribute("nonce",i),n.insertBefore(r,a),r},B=function(){function e(e){var t=this.element=D(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}C(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),H=function(){function e(e){var t=this.element=D(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),z=x,F={isServer:!x,useCSSOMInjection:!_},$=function(){function e(e,t,n){void 0===e&&(e=b),void 0===t&&(t={}),this.options=f({},F,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&x&&z&&(z=!1,function(e){for(var t=document.querySelectorAll(N),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(E)&&(R(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return I(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(f({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new B(o):new H(o),new T(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(I(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(I(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(I(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var a=A(o);if(void 0!==a){var i=e.names.get(a),s=t.getGroup(o);if(i&&s&&i.size){var c=E+".g"+o+'[id="'+a+'"]',l="";void 0!==i&&i.forEach((function(e){e.length>0&&(l+=e+",")})),r+=""+s+c+'{content:"'+l+'"}/*!sc*/\n'}}}return r}(this)},e}(),G=/(a)(d)/gi,q=function(e){return String.fromCharCode(e+(e>25?39:97))};function Y(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=q(t%52)+n;return(q(t%52)+n).replace(G,"$1-$2")}var K=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},W=function(e){return K(5381,e)};function V(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(v(n)&&!w(n))return!1}return!0}var X=W("5.3.1"),Q=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&V(e),this.componentId=t,this.baseHash=K(X,t),this.baseStyle=n,$.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var a=me(this.rules,e,t,n).join(""),i=Y(K(this.baseHash,a)>>>0);if(!t.hasNameForId(r,i)){var s=n(a,"."+i,void 0,r);t.insertRules(r,i,s)}o.push(i),this.staticRulesId=i}else{for(var c=this.rules.length,l=K(this.baseHash,n.hash),u="",d=0;d<c;d++){var p=this.rules[d];if("string"==typeof p)u+=p;else if(p){var f=me(p,e,t,n),h=Array.isArray(f)?f.join(""):f;l=K(l,h+d),u+=h}}if(u){var m=Y(l>>>0);if(!t.hasNameForId(r,m)){var g=n(u,"."+m,void 0,r);t.insertRules(r,m,g)}o.push(m)}}return o.join(" ")},e}(),J=/^\s*\/\/.*$/gm,Z=[":","[",".","#"];function ee(e){var t,n,r,o,a=void 0===e?b:e,i=a.options,s=void 0===i?b:i,l=a.plugins,u=void 0===l?g:l,d=new c.a(s),p=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,a,i,s,c,l,u,d){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===l)return r+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){p.push(e)})),h=function(e,r,a){return 0===r&&-1!==Z.indexOf(a[n.length])||a.match(o)?e:"."+t};function m(e,a,i,s){void 0===s&&(s="&");var c=e.replace(J,""),l=a&&i?i+" "+a+" { "+c+" }":c;return t=s,n=a,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(i||!a?"":a,l)}return d.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,h))},f,function(e){if(-2===e){var t=p;return p=[],t}}])),m.hash=u.length?u.reduce((function(e,t){return t.name||C(15),K(e,t.name)}),5381).toString():"",m}var te=a.a.createContext(),ne=(te.Consumer,a.a.createContext()),re=(ne.Consumer,new $),oe=ee();function ae(){return Object(o.useContext)(te)||re}function ie(){return Object(o.useContext)(ne)||oe}function se(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],r=t[1],i=ae(),c=Object(o.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),l=Object(o.useMemo)((function(){return ee({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){s()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),a.a.createElement(te.Provider,{value:c},a.a.createElement(ne.Provider,{value:l},e.children))}var ce=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=oe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return C(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=oe),this.name+e.hash},e}(),le=/([A-Z])/,ue=/([A-Z])/g,de=/^ms-/,pe=function(e){return"-"+e.toLowerCase()};function fe(e){return le.test(e)?e.replace(ue,pe).replace(de,"-ms-"):e}var he=function(e){return null==e||!1===e||""===e};function me(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],i=0,s=e.length;i<s;i+=1)""!==(o=me(e[i],t,n,r))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}return he(e)?"":w(e)?"."+e.styledComponentId:v(e)?"function"!=typeof(c=e)||c.prototype&&c.prototype.isReactComponent||!t?e:me(e(t),t,n,r):e instanceof ce?n?(e.inject(n,r),e.getName(r)):e:m(e)?function e(t,n){var r,o,a=[];for(var i in t)t.hasOwnProperty(i)&&!he(t[i])&&(Array.isArray(t[i])&&t[i].isCss||v(t[i])?a.push(fe(i)+":",t[i],";"):m(t[i])?a.push.apply(a,e(t[i],i)):a.push(fe(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in l.a?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(a,["}"]):a}(e):e.toString();var c}var ge=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function be(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 v(e)||m(e)?ge(me(h(g,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:ge(me(h(e,n)))}new Set;var ve=function(e,t,n){return void 0===n&&(n=b),e.theme!==n.theme&&e.theme||t||n.theme},ye=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,we=/(^-|-$)/g;function Ee(e){return e.replace(ye,"-").replace(we,"")}var xe=function(e){return Y(W(e)>>>0)};function _e(e){return"string"==typeof e&&!0}var Ce=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Te=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function ke(e,t,n){var r=e[n];Ce(t)&&Ce(r)?Oe(r,t):e[n]=t}function Oe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,a=n;o<a.length;o++){var i=a[o];if(Ce(i))for(var s in i)Te(s)&&ke(e,i[s],s)}return e}var Se=a.a.createContext();Se.Consumer;function Ie(e){var t=Object(o.useContext)(Se),n=Object(o.useMemo)((function(){return function(e,t){return e?v(e)?e(t):Array.isArray(e)||"object"!=typeof e?C(8):t?f({},t,{},e):e:C(14)}(e.theme,t)}),[e.theme,t]);return e.children?a.a.createElement(Se.Provider,{value:n},e.children):null}var Ae={};function je(e,t,n){var r=w(e),i=!_e(e),s=t.attrs,c=void 0===s?g:s,l=t.componentId,d=void 0===l?function(e,t){var n="string"!=typeof e?"sc":Ee(e);Ae[n]=(Ae[n]||0)+1;var r=n+"-"+xe("5.3.1"+n+Ae[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,h=t.displayName,m=void 0===h?function(e){return _e(e)?"styled."+e:"Styled("+y(e)+")"}(e):h,E=t.displayName&&t.componentId?Ee(t.displayName)+"-"+t.componentId:t.componentId||d,x=r&&e.attrs?Array.prototype.concat(e.attrs,c).filter(Boolean):c,_=t.shouldForwardProp;r&&e.shouldForwardProp&&(_=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var C,T=new Q(n,E,r?e.componentStyle:void 0),k=T.isStatic&&0===c.length,O=function(e,t){return function(e,t,n,r){var a=e.attrs,i=e.componentStyle,s=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,d=e.styledComponentId,p=e.target,h=function(e,t,n){void 0===e&&(e=b);var r=f({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,a,i=e;for(t in v(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],a=i[t],n&&a?n+" "+a:n||a):i[t]})),[r,o]}(ve(t,Object(o.useContext)(Se),s)||b,t,a),m=h[0],g=h[1],y=function(e,t,n,r){var o=ae(),a=ie();return t?e.generateAndInjectStyles(b,o,a):e.generateAndInjectStyles(n,o,a)}(i,r,m),w=n,E=g.$as||t.$as||g.as||t.as||p,x=_e(E),_=g!==t?f({},t,{},g):t,C={};for(var T in _)"$"!==T[0]&&"as"!==T&&("forwardedAs"===T?C.as=_[T]:(l?l(T,u.default,E):!x||Object(u.default)(T))&&(C[T]=_[T]));return t.style&&g.style!==t.style&&(C.style=f({},t.style,{},g.style)),C.className=Array.prototype.concat(c,d,y!==d?y:null,t.className,g.className).filter(Boolean).join(" "),C.ref=w,Object(o.createElement)(E,C)}(C,e,t,k)};return O.displayName=m,(C=a.a.forwardRef(O)).attrs=x,C.componentStyle=T,C.displayName=m,C.shouldForwardProp=_,C.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):g,C.styledComponentId=E,C.target=r?e.target:e,C.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),a=r&&r+"-"+(_e(e)?e:Ee(y(e)));return je(e,f({},o,{attrs:x,componentId:a}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Oe({},e.defaultProps,t):t}}),C.toString=function(){return"."+C.styledComponentId},i&&p()(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C}var Ne=function(e){return function e(t,n,o){if(void 0===o&&(o=b),!Object(r.isValidElementType)(n))return C(1,String(n));var a=function(){return t(n,o,be.apply(void 0,arguments))};return a.withConfig=function(r){return e(t,n,f({},o,{},r))},a.attrs=function(r){return e(t,n,f({},o,{attrs:Array.prototype.concat(o.attrs,r).filter(Boolean)}))},a}(je,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Ne[e]=Ne(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=V(e),$.registerId(this.componentId+1)}var t=e.prototype;t.createStyles=function(e,t,n,r){var o=r(me(this.rules,t,n,r).join(""),""),a=this.componentId+e;n.insertRules(a,a,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&$.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}();function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=be.apply(void 0,[e].concat(n)).join(""),a=xe(o);return new ce(a,o)}!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=L();return"<style "+[n&&'nonce="'+n+'"',E+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?C(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return C(2);var n=((t={})[E]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=L();return r&&(n.nonce=r),[a.a.createElement("style",f({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new $({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?C(2):a.a.createElement(se,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return C(3)}}();var Pe=function(){return Object(o.useContext)(Se)};t.c=Ne}).call(this,n(15))},function(e,n){e.exports=t},function(e,t){e.exports=n},function(e,t,n){"use strict";t.a=(e,t)=>-1!==t.indexOf(e)},function(e,t,n){"use strict";var r=n(19),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function s(e){return null!==e&&"object"==typeof e}function c(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function u(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:s,isPlainObject:c,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:l,isStream:function(e){return s(e)&&l(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:u,merge:function e(){var t={};function n(n,r){c(t[r])&&c(n)?t[r]=e(t[r],n):c(n)?t[r]=e({},n):a(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)u(arguments[r],n);return t},extend:function(e,t,n){return u(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){var r=n(63),o=n(64);e.exports=function(e,t,n){var a=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var s=0;s<16;++s)t[a+s]=i[s];return t||o(i)}},function(e){e.exports=JSON.parse('{"a":"2.34.6"}')},function(e,t,n){e.exports=n(46)},function(e,t,n){"use strict";e.exports=n(44)},function(e,t,n){"use strict";var r=n(9),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?i:s[e.$$typeof]||o}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var l=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=f(n);o&&o!==h&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=c(t),m=c(n),g=0;g<i.length;++g){var b=i[g];if(!(a[b]||r&&r[b]||m&&m[b]||s&&s[b])){var v=p(n,b);try{l(t,b,v)}catch(e){}}}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r="v2",o=Object.freeze(["agent","alerts","bot","chatbubble","feedback","privacy","websocketFallback","lightbox","nudge"])},function(e,t,n){"use strict";var r=n(4);t.a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.entries(e).reduce((e,n)=>{let[o,a]=n;return{...e,...Object(r.a)(o,t)?{[o]:a}:{}}},{})}},function(e,t,n){"use strict";n.r(t);var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=o},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var c,l=[],u=!1,d=-1;function p(){u&&c&&(u=!1,c.length?l=c.concat(l):d=-1,l.length&&f())}function f(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(c=l,l=[];++d<t;)c&&c[d].run();d=-1,t=l.length}c=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),1!==l.length||u||s(f)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){"use strict";(function(e,r){var o,a=n(27);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var i=Object(a.a)(o);t.a=i}).call(this,n(14),n(45)(e))},,function(e,t){e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(5);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var i=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),a=i.join("&")}if(a){var s=e.indexOf("#");-1!==s&&(e=e.slice(0,s)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(5),o=n(51),a={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var s,c={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(s=n(23)),s),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(i(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};c.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){c.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){c.headers[e]=r.merge(a)})),e.exports=c}).call(this,n(15))},function(e,t,n){"use strict";var r=n(5),o=n(52),a=n(54),i=n(20),s=n(55),c=n(58),l=n(59),u=n(24);e.exports=function(e){return new Promise((function(t,n){var d=e.data,p=e.headers;r.isFormData(d)&&delete p["Content-Type"];var f=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";p.Authorization="Basic "+btoa(h+":"+m)}var g=s(e.baseURL,e.url);if(f.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),f.timeout=e.timeout,f.onreadystatechange=function(){if(f&&4===f.readyState&&(0!==f.status||f.responseURL&&0===f.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in f?c(f.getAllResponseHeaders()):null,a={data:e.responseType&&"text"!==e.responseType?f.response:f.responseText,status:f.status,statusText:f.statusText,headers:r,config:e,request:f};o(t,n,a),f=null}},f.onabort=function(){f&&(n(u("Request aborted",e,"ECONNABORTED",f)),f=null)},f.onerror=function(){n(u("Network Error",e,null,f)),f=null},f.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(u(t,e,"ECONNABORTED",f)),f=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||l(g))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;b&&(p[e.xsrfHeaderName]=b)}if("setRequestHeader"in f&&r.forEach(p,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete p[t]:f.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(f.withCredentials=!!e.withCredentials),e.responseType)try{f.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&f.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&f.upload&&f.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){f&&(f.abort(),n(e),f=null)})),d||(d=null),f.send(d)}))}},function(e,t,n){"use strict";var r=n(53);e.exports=function(e,t,n,o,a){var i=new Error(e);return r(i,t,n,o,a)}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],a=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],s=["validateStatus"];function c(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function l(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=c(void 0,t[e]))})),r.forEach(a,l),r.forEach(i,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=c(void 0,e[o])):n[o]=c(void 0,t[o])})),r.forEach(s,(function(r){r in t?n[r]=c(e[r],t[r]):r in e&&(n[r]=c(void 0,e[r]))}));var u=o.concat(a).concat(i).concat(s),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===u.indexOf(e)}));return r.forEach(d,l),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var r=n(11),o=n(12);t.a=t=>{let{level:n="info",error:a,message:i,reduxState:s,extra:c}=t;if(!(i||null!=a&&a.message))return console.error("Attempted to log without message"),null;const l=Object(o.a)(s||{},r.b),u={version:e.env.VERSION,release:e.env.IS_PURE_BUILD?`${e.env.VERSION}-pure`:e.env.VERSION,userAgent:navigator.userAgent,state:s?JSON.stringify(l):void 0,...c},d={message:null==a?void 0:a.message,name:null==a?void 0:a.name,stack:null==a?void 0:a.stack,code:null==a?void 0:a.code,signal:null==a?void 0:a.signal};return{message:null!=i?i:null==a?void 0:a.message,level:n,extra:u,error:d}}}).call(this,n(15))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=0,s=1,c=2,l=3,u="closed",d="errored",p="joined",f="joining",h="leaving",m="phx_close",g="phx_error",b="phx_join",v="phx_reply",y="phx_leave",w="longpoll",E="websocket",x=function(){function e(t,n,r,o){a(this,e),this.channel=t,this.event=n,this.payload=r||{},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return o(e,[{key:"resend",value:function(e){this.timeout=e,this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref}))}},{key:"receive",value:function(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}},{key:"matchReceive",value:function(e){var t=e.status,n=e.response;e.ref;this.recHooks.filter((function(e){return e.status===t})).forEach((function(e){return e.callback(n)}))}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var e=this;this.timeoutTimer||(this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(function(t){e.cancelRefEvent(),e.cancelTimeout(),e.receivedResp=t,e.matchReceive(t)})),this.timeoutTimer=setTimeout((function(){e.trigger("timeout",{})}),this.timeout))}},{key:"hasReceived",value:function(e){return this.receivedResp&&this.receivedResp.status===e}},{key:"trigger",value:function(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}}]),e}(),_=t.Channel=function(){function e(t,n,r){var o=this;a(this,e),this.state=u,this.topic=t,this.params=n||{},this.socket=r,this.bindings=[],this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new x(this,b,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new k((function(){return o.rejoinUntilConnected()}),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(function(){o.state=p,o.rejoinTimer.reset(),o.pushBuffer.forEach((function(e){return e.send()})),o.pushBuffer=[]})),this.onClose((function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=u,o.socket.remove(o)})),this.onError((function(e){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,e),o.state=d,o.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(function(){o.isJoining()&&(o.socket.log("channel","timeout "+o.topic,o.joinPush.timeout),o.state=d,o.rejoinTimer.scheduleTimeout())})),this.on(v,(function(e,t){o.trigger(o.replyEventName(t),e)}))}return o(e,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}},{key:"onClose",value:function(e){this.on(m,e)}},{key:"onError",value:function(e){this.on(g,(function(t){return e(t)}))}},{key:"on",value:function(e,t){this.bindings.push({event:e,callback:t})}},{key:"off",value:function(e){this.bindings=this.bindings.filter((function(t){return t.event!==e}))}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+e+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new x(this,e,t,n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=h;var n=function(){e.socket.log("channel","leave "+e.topic),e.trigger(m,"leave",e.joinRef())},r=new x(this,y,{},t);return r.receive("ok",(function(){return n()})).receive("timeout",(function(){return n()})),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(e,t,n){return t}},{key:"isMember",value:function(e){return this.topic===e}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(e){this.state=f,this.joinPush.resend(e)}},{key:"rejoin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(e)}},{key:"trigger",value:function(e,t,n){if(!(n&&[m,g,y,b].indexOf(e)>=0&&n!==this.joinRef())){var r=this.onMessage(e,t,n);if(t&&!r)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter((function(t){return t.event===e})).map((function(e){return e.callback(r,n)}))}}},{key:"replyEventName",value:function(e){return"chan_reply_"+e}},{key:"isClosed",value:function(){return this.state===u}},{key:"isErrored",value:function(){return this.state===d}},{key:"isJoined",value:function(){return this.state===p}},{key:"isJoining",value:function(){return this.state===f}},{key:"isLeaving",value:function(){return this.state===h}}]),e}(),C=(t.Socket=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=r.timeout||1e4,this.transport=r.transport||window.WebSocket||C,this.heartbeatIntervalMs=r.heartbeatIntervalMs||3e4,this.reconnectAfterMs=r.reconnectAfterMs||function(e){return[1e3,2e3,5e3,1e4][e-1]||1e4},this.logger=r.logger||function(){},this.longpollerTimeout=r.longpollerTimeout||2e4,this.params=r.params||{},this.endPoint=t+"/"+E,this.reconnectTimer=new k((function(){n.disconnect((function(){return n.connect()}))}),this.reconnectAfterMs)}return o(e,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var e=T.appendParams(T.appendParams(this.endPoint,this.params),{vsn:"1.0.0"});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?this.protocol()+":"+e:this.protocol()+"://"+location.host+e}},{key:"disconnect",value:function(e,t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n||""):this.conn.close(),this.conn=null),e&&e()}},{key:"connect",value:function(e){var t=this;e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=e),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return t.onConnOpen()},this.conn.onerror=function(e){return t.onConnError(e)},this.conn.onmessage=function(e){return t.onConnMessage(e)},this.conn.onclose=function(e){return t.onConnClose(e)})}},{key:"log",value:function(e,t,n){this.logger(e,t,n)}},{key:"onOpen",value:function(e){this.stateChangeCallbacks.open.push(e)}},{key:"onClose",value:function(e){this.stateChangeCallbacks.close.push(e)}},{key:"onError",value:function(e){this.stateChangeCallbacks.error.push(e)}},{key:"onMessage",value:function(e){this.stateChangeCallbacks.message.push(e)}},{key:"onConnOpen",value:function(){var e=this;this.log("transport","connected to "+this.endPointURL(),this.transport.prototype),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((function(){return e.sendHeartbeat()}),this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach((function(e){return e()}))}},{key:"onConnClose",value:function(e){this.log("transport","close",e),this.triggerChanError(),clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((function(t){return t(e)}))}},{key:"onConnError",value:function(e){this.log("transport",e),this.triggerChanError(),this.stateChangeCallbacks.error.forEach((function(t){return t(e)}))}},{key:"triggerChanError",value:function(){this.channels.forEach((function(e){return e.trigger(g)}))}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case i:return"connecting";case s:return"open";case c:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(e){this.channels=this.channels.filter((function(t){return t.joinRef()!==e.joinRef()}))}},{key:"channel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new _(e,t,this);return this.channels.push(n),n}},{key:"push",value:function(e){var t=this,n=e.topic,r=e.event,o=e.payload,a=e.ref,i=function(){return t.conn.send(JSON.stringify(e))};this.log("push",n+" "+r+" ("+a+")",o),this.isConnected()?i():this.sendBuffer.push(i)}},{key:"makeRef",value:function(){var e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}},{key:"sendHeartbeat",value:function(){this.isConnected()&&this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.makeRef()})}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((function(e){return e()})),this.sendBuffer=[])}},{key:"onConnMessage",value:function(e){var t=JSON.parse(e.data),n=t.topic,r=t.event,o=t.payload,a=t.ref;this.log("receive",(o.status||"")+" "+n+" "+r+" "+(a&&"("+a+")"||""),o),this.channels.filter((function(e){return e.isMember(n)})).forEach((function(e){return e.trigger(r,o,a)})),this.stateChangeCallbacks.message.forEach((function(e){return e(t)}))}}]),e}(),t.LongPoll=function(){function e(t){a(this,e),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=i,this.poll()}return o(e,[{key:"normalizeEndpoint",value:function(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+E),"$1/"+w)}},{key:"endpointURL",value:function(){return T.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=i}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var e=this;this.readyState!==s&&this.readyState!==i||T.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(function(t){if(t){var n=t.status,r=t.token,o=t.messages;e.token=r}else n=0;switch(n){case 200:o.forEach((function(t){return e.onmessage({data:JSON.stringify(t)})})),e.poll();break;case 204:e.poll();break;case 410:e.readyState=s,e.onopen(),e.poll();break;case 0:case 500:e.onerror(),e.closeAndRetry();break;default:throw"unhandled poll status "+n}}))}},{key:"send",value:function(e){var t=this;T.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(function(e){e&&200===e.status||(t.onerror(status),t.closeAndRetry())}))}},{key:"close",value:function(e,t){this.readyState=l,this.onclose()}}]),e}()),T=t.Ajax=function(){function e(){a(this,e)}return o(e,null,[{key:"request",value:function(e,t,n,r,o,a,i){if(window.XDomainRequest){var s=new XDomainRequest;this.xdomainRequest(s,e,t,r,o,a,i)}else{var c=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(c,e,t,n,r,o,a,i)}}},{key:"xdomainRequest",value:function(e,t,n,r,o,a,i){var s=this;e.timeout=o,e.open(t,n),e.onload=function(){var t=s.parseJSON(e.responseText);i&&i(t)},a&&(e.ontimeout=a),e.onprogress=function(){},e.send(r)}},{key:"xhrRequest",value:function(e,t,n,r,o,a,i,s){var c=this;e.timeout=a,e.open(t,n,!0),e.setRequestHeader("Content-Type",r),e.onerror=function(){s&&s(null)},e.onreadystatechange=function(){if(e.readyState===c.states.complete&&s){var t=c.parseJSON(e.responseText);s(t)}},i&&(e.ontimeout=i),e.send(o)}},{key:"parseJSON",value:function(e){return e&&""!==e?JSON.parse(e):null}},{key:"serialize",value:function(e,t){var n=[];for(var o in e)if(e.hasOwnProperty(o)){var a=t?t+"["+o+"]":o,i=e[o];"object"===(void 0===i?"undefined":r(i))?n.push(this.serialize(i,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(i))}return n.join("&")}},{key:"appendParams",value:function(e,t){if(0===Object.keys(t).length)return e;var n=e.match(/\?/)?"&":"?";return""+e+n+this.serialize(t)}}]),e}();T.states={complete:4};t.Presence={syncState:function(e,t,n,r){var o=this,a=this.clone(e),i={},s={};return this.map(a,(function(e,n){t[e]||(s[e]=n)})),this.map(t,(function(e,t){var n=a[e];if(n){var r=t.metas.map((function(e){return e.phx_ref})),c=n.metas.map((function(e){return e.phx_ref})),l=t.metas.filter((function(e){return c.indexOf(e.phx_ref)<0})),u=n.metas.filter((function(e){return r.indexOf(e.phx_ref)<0}));l.length>0&&(i[e]=t,i[e].metas=l),u.length>0&&(s[e]=o.clone(n),s[e].metas=u)}else i[e]=t})),this.syncDiff(a,{joins:i,leaves:s},n,r)},syncDiff:function(e,t,n,r){var o=t.joins,a=t.leaves,i=this.clone(e);return n||(n=function(){}),r||(r=function(){}),this.map(o,(function(e,t){var r,o=i[e];(i[e]=t,o)&&(r=i[e].metas).unshift.apply(r,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(o.metas));n(e,o,t)})),this.map(a,(function(e,t){var n=i[e];if(n){var o=t.metas.map((function(e){return e.phx_ref}));n.metas=n.metas.filter((function(e){return o.indexOf(e.phx_ref)<0})),r(e,n,t),0===n.metas.length&&delete i[e]}})),i},list:function(e,t){return t||(t=function(e,t){return t}),this.map(e,(function(e,n){return t(e,n)}))},map:function(e,t){return Object.getOwnPropertyNames(e).map((function(n){return t(n,e[n])}))},clone:function(e){return JSON.parse(JSON.stringify(e))}};var k=function(){function e(t,n){a(this,e),this.callback=t,this.timerCalc=n,this.timer=null,this.tries=0}return o(e,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout((function(){e.tries=e.tries+1,e.callback()}),this.timerCalc(this.tries+1))}}]),e}()},function(e,t,n){(function(n){var r,o,a;o=[],void 0===(a="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,i=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(e,n,i){var s=a.URL||a.webkitURL,c=document.createElement("a");n=n||e.name||"download",c.download=n,c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?o(c):r(c.href)?t(e,n,i):o(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(c.href)}),4e4),setTimeout((function(){o(c)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),n);else if(r(e))t(e,n,a);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){o(i)}))}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var i="application/octet-stream"===e.type,s=/constructor/i.test(a.HTMLElement)||a.safari,c=/CriOS\/[\d]+/.test(navigator.userAgent);if((c||i&&s)&&"object"==typeof FileReader){var l=new FileReader;l.onloadend=function(){var e=l.result;e=c?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},l.readAsDataURL(e)}else{var u=a.URL||a.webkitURL,d=u.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){u.revokeObjectURL(d)}),4e4)}});a.saveAs=i.saveAs=i,e.exports=i})?r.apply(t,o):r)||(e.exports=a)}).call(this,n(14))},function(e,t){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c<a.length;c++){var l=a[c];if(!s(l))return!1;var u=e[l],d=t[l];if(!1===(o=n?n.call(r,u,d,l):void 0)||void 0===o&&u!==d)return!1}return!0}},function(e,t,n){"use strict";t.a=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var s=0;for(e=0===i?"":e[0]+" ";s<a;++s)t[s]=n(e,t[s],r).trim();break;default:var c=s=0;for(t=[];s<a;++s)for(var l=0;l<i;++l)t[c++]=n(e[l]+" ",o[s],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,a){var i=e+";",s=2*t+3*n+4*a;if(944===s){e=i.indexOf(":",9)+1;var c=i.substring(e,i.length-1).trim();return c=i.substring(0,e).trim()+c+";",1===I||2===I&&o(c,1)?"-webkit-"+c+c:c}if(0===I||2===I&&!o(i,1))return i;switch(s){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(T,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(c=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+c+i;case 1005:return p.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(c=i.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=i.replace(y,"tb");break;case 232:c=i.replace(y,"tb-rl");break;case 220:c=i.replace(y,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+c+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,s=(c=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:i=i.replace(c,"-webkit-"+c)+";"+i;break;case 207:case 102:i=i.replace(c,"-webkit-"+(102<s?"inline-":"")+"box")+";"+i.replace(c,"-webkit-"+c)+";"+i.replace(c,"-ms-"+c+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return c=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+c+"-ms-flex-"+c+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(x,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(x,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===C.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,a).replace(":fill-available",":stretch"):i.replace(c,"-webkit-"+c)+i.replace(c,"-moz-"+c.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===n+a&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+i}return i}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),M(2!==t?r:r.replace(_,"$1"),n,t)}function a(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(E," or ($1)").substring(4):"("+t+")"}function i(e,t,n,r,o,a,i,s,l,u){for(var d,p=0,f=t;p<N;++p)switch(d=j[p].call(c,e,f,n,r,o,a,i,s,l,u)){case void 0:case!1:case!0:case null:break;default:f=d}if(f!==t)return f}function s(e){return void 0!==(e=e.prefix)&&(M=null,e?"function"!=typeof e?I=1:(I=2,M=e):I=0),s}function c(e,n){var s=e;if(33>s.charCodeAt(0)&&(s=s.trim()),s=[s],0<N){var c=i(-1,n,s,s,O,k,0,0,0,0);void 0!==c&&"string"==typeof c&&(n=c)}var d=function e(n,s,c,d,p){for(var f,h,m,y,E,x=0,_=0,C=0,T=0,j=0,M=0,R=m=f=0,L=0,D=0,B=0,H=0,U=c.length,z=U-1,F="",$="",G="",q="";L<U;){if(h=c.charCodeAt(L),L===z&&0!==_+T+C+x&&(0!==_&&(h=47===_?10:47),T=C=x=0,U++,z++),0===_+T+C+x){if(L===z&&(0<D&&(F=F.replace(u,"")),0<F.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:F+=c.charAt(L)}h=59}switch(h){case 123:for(f=(F=F.trim()).charCodeAt(0),m=1,H=++L;L<U;){switch(h=c.charCodeAt(L)){case 123:m++;break;case 125:m--;break;case 47:switch(h=c.charCodeAt(L+1)){case 42:case 47:e:{for(R=L+1;R<z;++R)switch(c.charCodeAt(R)){case 47:if(42===h&&42===c.charCodeAt(R-1)&&L+2!==R){L=R+1;break e}break;case 10:if(47===h){L=R+1;break e}}L=R}}break;case 91:h++;case 40:h++;case 34:case 39:for(;L++<z&&c.charCodeAt(L)!==h;);}if(0===m)break;L++}switch(m=c.substring(H,L),0===f&&(f=(F=F.replace(l,"").trim()).charCodeAt(0)),f){case 64:switch(0<D&&(F=F.replace(u,"")),h=F.charCodeAt(1)){case 100:case 109:case 115:case 45:D=s;break;default:D=A}if(H=(m=e(s,D,m,h,p+1)).length,0<N&&(E=i(3,m,D=t(A,F,B),s,O,k,H,h,p,d),F=D.join(""),void 0!==E&&0===(H=(m=E.trim()).length)&&(h=0,m="")),0<H)switch(h){case 115:F=F.replace(w,a);case 100:case 109:case 45:m=F+"{"+m+"}";break;case 107:m=(F=F.replace(g,"$1 $2"))+"{"+m+"}",m=1===I||2===I&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=F+m,112===d&&($+=m,m="")}else m="";break;default:m=e(s,t(s,F,B),m,d,p+1)}G+=m,m=B=D=R=f=0,F="",h=c.charCodeAt(++L);break;case 125:case 59:if(1<(H=(F=(0<D?F.replace(u,""):F).trim()).length))switch(0===R&&(f=F.charCodeAt(0),45===f||96<f&&123>f)&&(H=(F=F.replace(" ",":")).length),0<N&&void 0!==(E=i(1,F,s,n,O,k,$.length,d,p,d))&&0===(H=(F=E.trim()).length)&&(F="\0\0"),f=F.charCodeAt(0),h=F.charCodeAt(1),f){case 0:break;case 64:if(105===h||99===h){q+=F+c.charAt(L);break}default:58!==F.charCodeAt(H-1)&&($+=r(F,f,h,F.charCodeAt(2)))}B=D=R=f=0,F="",h=c.charCodeAt(++L)}}switch(h){case 13:case 10:47===_?_=0:0===1+f&&107!==d&&0<F.length&&(D=1,F+="\0"),0<N*P&&i(0,F,s,n,O,k,$.length,d,p,d),k=1,O++;break;case 59:case 125:if(0===_+T+C+x){k++;break}default:switch(k++,y=c.charAt(L),h){case 9:case 32:if(0===T+x+_)switch(j){case 44:case 58:case 9:case 32:y="";break;default:32!==h&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===T+_+x&&(D=B=1,y="\f"+y);break;case 108:if(0===T+_+x+S&&0<R)switch(L-R){case 2:112===j&&58===c.charCodeAt(L-3)&&(S=j);case 8:111===M&&(S=M)}break;case 58:0===T+_+x&&(R=L);break;case 44:0===_+C+T+x&&(D=1,y+="\r");break;case 34:case 39:0===_&&(T=T===h?0:0===T?h:T);break;case 91:0===T+_+C&&x++;break;case 93:0===T+_+C&&x--;break;case 41:0===T+_+x&&C--;break;case 40:if(0===T+_+x){if(0===f)switch(2*j+3*M){case 533:break;default:f=1}C++}break;case 64:0===_+C+T+x+R+m&&(m=1);break;case 42:case 47:if(!(0<T+x+C))switch(_){case 0:switch(2*h+3*c.charCodeAt(L+1)){case 235:_=47;break;case 220:H=L,_=42}break;case 42:47===h&&42===j&&H+2!==L&&(33===c.charCodeAt(H+2)&&($+=c.substring(H,L+1)),y="",_=0)}}0===_&&(F+=y)}M=j,j=h,L++}if(0<(H=$.length)){if(D=s,0<N&&(void 0!==(E=i(2,$,D,n,O,k,H,d,p,d))&&0===($=E).length))return q+$+G;if($=D.join(",")+"{"+$+"}",0!=I*S){switch(2!==I||o($,2)||(S=0),S){case 111:$=$.replace(v,":-moz-$1")+$;break;case 112:$=$.replace(b,"::-webkit-input-$1")+$.replace(b,"::-moz-$1")+$.replace(b,":-ms-input-$1")+$}S=0}}return q+$+G}(A,s,n,0,0);return 0<N&&(void 0!==(c=i(-2,d,s,s,O,k,d.length,0,0,0))&&(d=c)),"",S=0,k=O=1,d}var l=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,p=/zoo|gra/,f=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,b=/::(place)/g,v=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,E=/([\s\S]*?);/g,x=/-self|flex-/g,_=/[^]*?(:[rp][el]a[\w-]+)[^]*/,C=/stretch|:\s*\w+\-(?:conte|avail)/,T=/([^-])(image-set\()/,k=1,O=1,S=0,I=1,A=[],j=[],N=0,M=null,P=0;return c.use=function e(t){switch(t){case void 0:case null:N=j.length=0;break;default:if("function"==typeof t)j[N++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else P=0|!!t}return e},c.set=s,void 0!==e&&s(e),c}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/IBMPlexSans-Medium.ttf"},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/IBMPlexSans-Regular.ttf"},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/KindlySans-Regular.otf"},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-happy.png"},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-neutral.png"},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-sad.png"},function(e,t,n){
|
|
2
|
-
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
|
|
3
|
-
e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,s=Object.create,c="undefined"!=typeof Reflect&&Reflect,l=c.apply,u=c.construct;l||(l=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),i||(i=function(e){return e}),u||(u=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var d,p=x(Array.prototype.forEach),f=x(Array.prototype.pop),h=x(Array.prototype.push),m=x(String.prototype.toLowerCase),g=x(String.prototype.match),b=x(String.prototype.replace),v=x(String.prototype.indexOf),y=x(String.prototype.trim),w=x(RegExp.prototype.test),E=(d=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return u(d,t)});function x(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return l(e,t,r)}}function _(e,r){t&&t(e,null);for(var o=r.length;o--;){var a=r[o];if("string"==typeof a){var i=m(a);i!==a&&(n(r)||(r[o]=i),a=i)}e[a]=!0}return e}function C(t){var n=s(null),r=void 0;for(r in t)l(e,t,[r])&&(n[r]=t[r]);return n}function T(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return x(n.get);if("function"==typeof n.value)return x(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var k=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),O=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),S=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),A=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),j=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=a(["#text"]),M=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),P=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),R=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),L=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),D=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),B=i(/<%[\s\S]*|[\s\S]*%>/gm),H=i(/^data-[\-\w.\u00B7-\uFFFF]/),U=i(/^aria-[\-\w]+$/),z=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),F=i(/^(?:\w+script|data):/i),$=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function q(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Y=function(){return"undefined"==typeof window?null:window},K=function(e,t){if("object"!==(void 0===e?"undefined":G(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y(),n=function(t){return e(t)};if(n.version="2.2.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,s=t.HTMLTemplateElement,c=t.Node,l=t.Element,u=t.NodeFilter,d=t.NamedNodeMap,x=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,W=t.Text,V=t.Comment,X=t.DOMParser,Q=t.trustedTypes,J=l.prototype,Z=T(J,"cloneNode"),ee=T(J,"nextSibling"),te=T(J,"childNodes"),ne=T(J,"parentNode");if("function"==typeof s){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=K(Q,r),ae=oe&&Le?oe.createHTML(""):"",ie=o,se=ie.implementation,ce=ie.createNodeIterator,le=ie.createDocumentFragment,ue=r.importNode,de={};try{de=C(o).documentMode?o.documentMode:{}}catch(e){}var pe={};n.isSupported="function"==typeof ne&&se&&void 0!==se.createHTMLDocument&&9!==de;var fe=D,he=B,me=H,ge=U,be=F,ve=$,ye=z,we=null,Ee=_({},[].concat(q(k),q(O),q(S),q(A),q(N))),xe=null,_e=_({},[].concat(q(M),q(P),q(R),q(L))),Ce=null,Te=null,ke=!0,Oe=!0,Se=!1,Ie=!1,Ae=!1,je=!1,Ne=!1,Me=!1,Pe=!1,Re=!0,Le=!1,De=!0,Be=!0,He=!1,Ue={},ze=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Fe=null,$e=_({},["audio","video","img","source","image","track"]),Ge=null,qe=_({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",Ve=We,Xe=null,Qe=o.createElement("form"),Je=function(e){Xe&&Xe===e||(e&&"object"===(void 0===e?"undefined":G(e))||(e={}),e=C(e),we="ALLOWED_TAGS"in e?_({},e.ALLOWED_TAGS):Ee,xe="ALLOWED_ATTR"in e?_({},e.ALLOWED_ATTR):_e,Ge="ADD_URI_SAFE_ATTR"in e?_(C(qe),e.ADD_URI_SAFE_ATTR):qe,Fe="ADD_DATA_URI_TAGS"in e?_(C($e),e.ADD_DATA_URI_TAGS):$e,Ce="FORBID_TAGS"in e?_({},e.FORBID_TAGS):{},Te="FORBID_ATTR"in e?_({},e.FORBID_ATTR):{},Ue="USE_PROFILES"in e&&e.USE_PROFILES,ke=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,Se=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Ie=e.SAFE_FOR_TEMPLATES||!1,Ae=e.WHOLE_DOCUMENT||!1,Me=e.RETURN_DOM||!1,Pe=e.RETURN_DOM_FRAGMENT||!1,Re=!1!==e.RETURN_DOM_IMPORT,Le=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,De=!1!==e.SANITIZE_DOM,Be=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,Ve=e.NAMESPACE||Ve,Ie&&(Oe=!1),Pe&&(Me=!0),Ue&&(we=_({},[].concat(q(N))),xe=[],!0===Ue.html&&(_(we,k),_(xe,M)),!0===Ue.svg&&(_(we,O),_(xe,P),_(xe,L)),!0===Ue.svgFilters&&(_(we,S),_(xe,P),_(xe,L)),!0===Ue.mathMl&&(_(we,A),_(xe,R),_(xe,L))),e.ADD_TAGS&&(we===Ee&&(we=C(we)),_(we,e.ADD_TAGS)),e.ADD_ATTR&&(xe===_e&&(xe=C(xe)),_(xe,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&_(Ge,e.ADD_URI_SAFE_ATTR),Be&&(we["#text"]=!0),Ae&&_(we,["html","head","body"]),we.table&&(_(we,["tbody"]),delete Ce.tbody),a&&a(e),Xe=e)},Ze=_({},["mi","mo","mn","ms","mtext"]),et=_({},["foreignobject","desc","title","annotation-xml"]),tt=_({},O);_(tt,S),_(tt,I);var nt=_({},A);_(nt,j);var rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:We,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Ke)return t.namespaceURI===We?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===r||Ze[r]):Boolean(tt[n]);if(e.namespaceURI===Ye)return t.namespaceURI===We?"math"===n:t.namespaceURI===Ke?"math"===n&&et[r]:Boolean(nt[n]);if(e.namespaceURI===We){if(t.namespaceURI===Ke&&!et[r])return!1;if(t.namespaceURI===Ye&&!Ze[r])return!1;var o=_({},["title","style","font","a","script"]);return!nt[n]&&(o[n]||!tt[n])}return!1},ot=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},at=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!xe[e])if(Me||Pe)try{ot(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},it=function(e){var t=void 0,n=void 0;if(Ne)e="<remove></remove>"+e;else{var r=g(e,/^[\r\n\t ]+/);n=r&&r[0]}var a=oe?oe.createHTML(e):e;if(Ve===We)try{t=(new X).parseFromString(a,"text/html")}catch(e){}t&&t.documentElement||((t=se.createDocument(Ve,"template",null)).documentElement.innerHTML=a);var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Ae?t.documentElement:i},st=function(e){return ce.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT,(function(){return u.FILTER_ACCEPT}),!1)},ct=function(e){return!(e instanceof W||e instanceof V||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof x&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},lt=function(e){return"object"===(void 0===c?"undefined":G(c))?e instanceof c:e&&"object"===(void 0===e?"undefined":G(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},ut=function(e,t,r){pe[e]&&p(pe[e],(function(e){e.call(n,t,r,Xe)}))},dt=function(e){var t=void 0;if(ut("beforeSanitizeElements",e,null),ct(e))return ot(e),!0;if(g(e.nodeName,/[\u0080-\uFFFF]/))return ot(e),!0;var r=m(e.nodeName);if(ut("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!lt(e.firstElementChild)&&(!lt(e.content)||!lt(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return ot(e),!0;if(!we[r]||Ce[r]){if(Be&&!ze[r]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(Z(a[i],!0),ee(e))}return ot(e),!0}return e instanceof l&&!rt(e)?(ot(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Ie&&3===e.nodeType&&(t=e.textContent,t=b(t,fe," "),t=b(t,he," "),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),ut("afterSanitizeElements",e,null),!1):(ot(e),!0)},pt=function(e,t,n){if(De&&("id"===t||"name"===t)&&(n in o||n in Qe))return!1;if(Oe&&w(me,t));else if(ke&&w(ge,t));else{if(!xe[t]||Te[t])return!1;if(Ge[t]);else if(w(ye,b(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Fe[e])if(Se&&!w(be,b(n,ve,"")));else if(n)return!1}return!0},ft=function(e){var t=void 0,r=void 0,o=void 0,a=void 0;ut("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:xe};for(a=i.length;a--;){var c=t=i[a],l=c.name,u=c.namespaceURI;if(r=y(t.value),o=m(l),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,ut("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(at(l,e),s.keepAttr))if(w(/\/>/i,r))at(l,e);else{Ie&&(r=b(r,fe," "),r=b(r,he," "));var d=e.nodeName.toLowerCase();if(pt(d,o,r))try{u?e.setAttributeNS(u,l,r):e.setAttribute(l,r),f(n.removed)}catch(e){}}}ut("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,r=st(t);for(ut("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)ut("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof i&&e(n.content),ft(n));ut("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,s=void 0,l=void 0,u=void 0,d=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!lt(e)){if("function"!=typeof e.toString)throw E("toString is not a function");if("string"!=typeof(e=e.toString()))throw E("dirty is not a string, aborting")}if(!n.isSupported){if("object"===G(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(lt(e))return t.toStaticHTML(e.outerHTML)}return e}if(je||Je(o),n.removed=[],"string"==typeof e&&(He=!1),He);else if(e instanceof c)1===(s=(a=it("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?a=s:a.appendChild(s);else{if(!Me&&!Ie&&!Ae&&-1===e.indexOf("<"))return oe&&Le?oe.createHTML(e):e;if(!(a=it(e)))return Me?null:ae}a&&Ne&&ot(a.firstChild);for(var p=st(He?e:a);l=p.nextNode();)3===l.nodeType&&l===u||dt(l)||(l.content instanceof i&&ht(l.content),ft(l),u=l);if(u=null,He)return e;if(Me){if(Pe)for(d=le.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return Re&&(d=ue.call(r,d,!0)),d}var f=Ae?a.outerHTML:a.innerHTML;return Ie&&(f=b(f,fe," "),f=b(f,he," ")),oe&&Le?oe.createHTML(f):f},n.setConfig=function(e){Je(e),je=!0},n.clearConfig=function(){Xe=null,je=!1},n.isValidAttribute=function(e,t,n){Xe||Je({});var r=m(e),o=m(t);return pt(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(pe[e]=pe[e]||[],h(pe[e],t))},n.removeHook=function(e){pe[e]&&f(pe[e])},n.removeHooks=function(e){pe[e]&&(pe[e]=[])},n.removeAllHooks=function(){pe={}},n}()}()},function(e,t){e.exports="http://localhost:8081/src/assets/images/santaHat.png"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){var n=r({key:"redux",merge:i.default,slicer:a.default,serialize:JSON.stringify,deserialize:JSON.parse},t),o=n.key,s=n.merge,c=n.slicer,l=n.serialize,u=n.deserialize;return function(t){return function(n,r,a){"function"==typeof r&&void 0===a&&(a=r,r=void 0);var i=void 0,d=void 0;try{i=u(localStorage.getItem(o)),d=s(r,i)}catch(e){console.warn("Failed to retrieve initialize state from localStorage:",e)}var p=t(n,d,a),f=c(e);return p.subscribe((function(){var e=p.getState(),t=f(e);try{localStorage.setItem(o,l(t))}catch(e){console.warn("Unable to persist state to localStorage:",e)}})),p}}};var a=o(n(65)),i=o(n(68));e.exports=t.default},function(e,t,n){(function(e,n){var r=/^\[object .+?Constructor\]$/,o=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var i="object"==typeof e&&e&&e.Object===Object&&e,s="object"==typeof self&&self&&self.Object===Object&&self,c=i||s||Function("return this")(),l=t&&!t.nodeType&&t,u=l&&"object"==typeof n&&n&&!n.nodeType&&n,d=u&&u.exports===l,p=d&&i.process,f=function(){try{var e=u&&u.require&&u.require("util").types;return e||p&&p.binding&&p.binding("util")}catch(e){}}(),h=f&&f.isTypedArray;function m(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var g,b,v,y=Array.prototype,w=Function.prototype,E=Object.prototype,x=c["__core-js_shared__"],_=w.toString,C=E.hasOwnProperty,T=(g=/[^.]+$/.exec(x&&x.keys&&x.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",k=E.toString,O=_.call(Object),S=RegExp("^"+_.call(C).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),I=d?c.Buffer:void 0,A=c.Symbol,j=c.Uint8Array,N=I?I.allocUnsafe:void 0,M=(b=Object.getPrototypeOf,v=Object,function(e){return b(v(e))}),P=Object.create,R=E.propertyIsEnumerable,L=y.splice,D=A?A.toStringTag:void 0,B=function(){try{var e=le(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),H=I?I.isBuffer:void 0,U=Math.max,z=Date.now,F=le(c,"Map"),$=le(Object,"create"),G=function(){function e(){}return function(t){if(!Ee(t))return{};if(P)return P(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function K(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function W(e){var t=this.__data__=new Y(e);this.size=t.size}function V(e,t){var n=ge(e),r=!n&&me(e),o=!n&&!r&&ve(e),a=!n&&!r&&!o&&_e(e),i=n||r||o||a,s=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var l in e)!t&&!C.call(e,l)||i&&("length"==l||o&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ue(l,c))||s.push(l);return s}function X(e,t,n){(void 0!==n&&!he(e[t],n)||void 0===n&&!(t in e))&&Z(e,t,n)}function Q(e,t,n){var r=e[t];C.call(e,t)&&he(r,n)&&(void 0!==n||t in e)||Z(e,t,n)}function J(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1}function Z(e,t,n){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}q.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},q.prototype.get=function(e){var t=this.__data__;if($){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return C.call(t,e)?t[e]:void 0},q.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:C.call(t,e)},q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$&&void 0===t?"__lodash_hash_undefined__":t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=J(t,e);return!(n<0)&&(n==t.length-1?t.pop():L.call(t,n,1),--this.size,!0)},Y.prototype.get=function(e){var t=this.__data__,n=J(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return J(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=J(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},K.prototype.clear=function(){this.size=0,this.__data__={hash:new q,map:new(F||Y),string:new q}},K.prototype.delete=function(e){var t=ce(this,e).delete(e);return this.size-=t?1:0,t},K.prototype.get=function(e){return ce(this,e).get(e)},K.prototype.has=function(e){return ce(this,e).has(e)},K.prototype.set=function(e,t){var n=ce(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},W.prototype.clear=function(){this.__data__=new Y,this.size=0},W.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},W.prototype.get=function(e){return this.__data__.get(e)},W.prototype.has=function(e){return this.__data__.has(e)},W.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!F||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new K(r)}return n.set(e,t),this.size=n.size,this};var ee,te=function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var s=a[ee?i:++r];if(!1===t(o[s],s,o))break}return e};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=C.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var o=k.call(e);r&&(t?e[D]=n:delete e[D]);return o}(e):function(e){return k.call(e)}(e)}function re(e){return xe(e)&&"[object Arguments]"==ne(e)}function oe(e){return!(!Ee(e)||function(e){return!!T&&T in e}(e))&&(ye(e)?S:r).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ae(e){if(!Ee(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=de(e),n=[];for(var r in e)("constructor"!=r||!t&&C.call(e,r))&&n.push(r);return n}function ie(e,t,n,r,o){e!==t&&te(t,(function(a,i){if(o||(o=new W),Ee(a))!function(e,t,n,r,o,a,i){var s=pe(e,n),c=pe(t,n),l=i.get(c);if(l)return void X(e,n,l);var u=a?a(s,c,n+"",e,t,i):void 0,d=void 0===u;if(d){var p=ge(c),f=!p&&ve(c),h=!p&&!f&&_e(c);u=c,p||f||h?ge(s)?u=s:xe(y=s)&&be(y)?u=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(s):f?(d=!1,u=function(e,t){if(t)return e.slice();var n=e.length,r=N?N(n):new e.constructor(n);return e.copy(r),r}(c,!0)):h?(d=!1,m=c,g=!0?(b=m.buffer,v=new b.constructor(b.byteLength),new j(v).set(new j(b)),v):m.buffer,u=new m.constructor(g,m.byteOffset,m.length)):u=[]:function(e){if(!xe(e)||"[object Object]"!=ne(e))return!1;var t=M(e);if(null===t)return!0;var n=C.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==O}(c)||me(c)?(u=s,me(s)?u=function(e){return function(e,t,n,r){var o=!n;n||(n={});var a=-1,i=t.length;for(;++a<i;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;void 0===c&&(c=e[s]),o?Z(n,s,c):Q(n,s,c)}return n}(e,Ce(e))}(s):Ee(s)&&!ye(s)||(u=function(e){return"function"!=typeof e.constructor||de(e)?{}:G(M(e))}(c))):d=!1}var m,g,b,v;var y;d&&(i.set(c,u),o(u,c,r,a,i),i.delete(c));X(e,n,u)}(e,t,i,n,ie,r,o);else{var s=r?r(pe(e,i),a,i+"",e,t,o):void 0;void 0===s&&(s=a),X(e,i,s)}}),Ce)}function se(e,t){return fe(function(e,t,n){return t=U(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=U(r.length-t,0),i=Array(a);++o<a;)i[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(i),m(e,this,s)}}(e,t,Oe),e+"")}function ce(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function le(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(n)?n:void 0}function ue(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||E)}function pe(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=z(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Oe);function he(e,t){return e===t||e!=e&&t!=t}var me=re(function(){return arguments}())?re:function(e){return xe(e)&&C.call(e,"callee")&&!R.call(e,"callee")},ge=Array.isArray;function be(e){return null!=e&&we(e.length)&&!ye(e)}var ve=H||function(){return!1};function ye(e){if(!Ee(e))return!1;var t=ne(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function we(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Ee(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var _e=h?function(e){return function(t){return e(t)}}(h):function(e){return xe(e)&&we(e.length)&&!!a[ne(e)]};function Ce(e){return be(e)?V(e,!0):ae(e)}var Te,ke=(Te=function(e,t,n){ie(e,t,n)},se((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=Te.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!Ee(n))return!1;var r=typeof t;return!!("number"==r?be(n)&&ue(t,n.length):"string"==r&&t in n)&&he(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var i=t[n];i&&Te(e,i,n,o)}return e})));function Oe(e){return e}n.exports=ke}).call(this,n(14),n(69)(e))},function(e,t,n){"use strict";
|
|
4
|
-
/** @license React v16.13.1
|
|
5
|
-
* react-is.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,c=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case p:case i:case c:case s:case h:return e;default:switch(e=e&&e.$$typeof){case u:case f:case b:case g:case l:return e;default:return t}}case a:return t}}}function _(e){return x(e)===p}t.AsyncMode=d,t.ConcurrentMode=p,t.ContextConsumer=u,t.ContextProvider=l,t.Element=o,t.ForwardRef=f,t.Fragment=i,t.Lazy=b,t.Memo=g,t.Portal=a,t.Profiler=c,t.StrictMode=s,t.Suspense=h,t.isAsyncMode=function(e){return _(e)||x(e)===d},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===u},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===i},t.isLazy=function(e){return x(e)===b},t.isMemo=function(e){return x(e)===g},t.isPortal=function(e){return x(e)===a},t.isProfiler=function(e){return x(e)===c},t.isStrictMode=function(e){return x(e)===s},t.isSuspense=function(e){return x(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===p||e===c||e===s||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===l||e.$$typeof===u||e.$$typeof===f||e.$$typeof===y||e.$$typeof===w||e.$$typeof===E||e.$$typeof===v)},t.typeOf=x},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";var r=n(5),o=n(19),a=n(47),i=n(25);function s(e){var t=new a(e),n=o(a.prototype.request,t);return r.extend(n,a.prototype,t),r.extend(n,t),n}var c=s(n(22));c.Axios=a,c.create=function(e){return s(i(c.defaults,e))},c.Cancel=n(26),c.CancelToken=n(60),c.isCancel=n(21),c.all=function(e){return Promise.all(e)},c.spread=n(61),c.isAxiosError=n(62),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";var r=n(5),o=n(20),a=n(48),i=n(49),s=n(25);function c(e){this.defaults=e,this.interceptors={request:new a,response:new a}}c.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=s(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},c.prototype.getUri=function(e){return e=s(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){c.prototype[e]=function(t,n){return this.request(s(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){c.prototype[e]=function(t,n,r){return this.request(s(r||{},{method:e,url:t,data:n}))}})),e.exports=c},function(e,t,n){"use strict";var r=n(5);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";var r=n(5),o=n(50),a=n(21),i=n(22);function s(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return s(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return s(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(s(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(5);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(24);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(5);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,a,i){var s=[];s.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(a)&&s.push("domain="+a),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(56),o=n(57);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(5),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,i={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},function(e,t,n){"use strict";var r=n(5);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(26);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch((0,a.default)(e)){case"void":return function(e){return e};case"string":return function(t){return(0,o.default)(t,[e])};case"array":return function(t){return(0,o.default)(t,e)};default:return console.error("Invalid paths argument, should be of type String, Array or Void")}};var o=r(n(66)),a=r(n(67));e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={};return t.forEach((function(t){var r=e[t];r&&(n[t]=r)})),n},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e)return"void";if(r(e))return e.length?"array":"void";return typeof e};var r=Array.isArray||(Array.isArray=function(e){return""+e!==e&&"[object Array]"==={}.toString.call(e)});e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t){return t?r({},e,t):e},e.exports=t.default},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"reversed",(function(){return Ys})),n.d(r,"mirrored",(function(){return Ks})),n.d(r,"createReversedEasing",(function(){return Ws})),n.d(r,"createMirroredEasing",(function(){return Vs})),n.d(r,"createExpoIn",(function(){return Xs})),n.d(r,"createBackIn",(function(){return Qs})),n.d(r,"createAnticipateEasing",(function(){return Js})),n.d(r,"linear",(function(){return Zs})),n.d(r,"easeIn",(function(){return ec})),n.d(r,"easeOut",(function(){return tc})),n.d(r,"easeInOut",(function(){return nc})),n.d(r,"circIn",(function(){return rc})),n.d(r,"circOut",(function(){return oc})),n.d(r,"circInOut",(function(){return ac})),n.d(r,"backIn",(function(){return ic})),n.d(r,"backOut",(function(){return sc})),n.d(r,"backInOut",(function(){return cc})),n.d(r,"anticipate",(function(){return lc})),n.d(r,"bounceOut",(function(){return uc})),n.d(r,"bounceIn",(function(){return dc})),n.d(r,"bounceInOut",(function(){return pc})),n.d(r,"cubicBezier",(function(){return yc}));var o={};n.r(o),n.d(o,"agent",(function(){return Ix})),n.d(o,"alerts",(function(){return jx})),n.d(o,"announcement",(function(){return Mx})),n.d(o,"auth",(function(){return Rx})),n.d(o,"bot",(function(){return mx})),n.d(o,"chatbubble",(function(){return bx})),n.d(o,"connection",(function(){return Dx})),n.d(o,"inspector",(function(){return Hx})),n.d(o,"environment",(function(){return yx})),n.d(o,"feedback",(function(){return zx})),n.d(o,"local",(function(){return $x})),n.d(o,"maintenanceAlert",(function(){return qx})),n.d(o,"messages",(function(){return e_})),n.d(o,"privacy",(function(){return n_})),n.d(o,"pushMessages",(function(){return o_})),n.d(o,"websocketFallback",(function(){return i_})),n.d(o,"lightBox",(function(){return c_})),n.d(o,"nudge",(function(){return u_}));var a=n(2),i=n.n(a),s=n(0),c=n.n(s),l=n(11);const u=Object.freeze({NONE:"NONE",BINARY:"BINARY",EMOJIS:"EMOJIS",HAPPY_OR_NOT:"HAPPY_OR_NOT",EXTERNAL_LINK:"EXTERNAL_LINK"}),d=Object.freeze({NONE:"NONE",COLOR:"COLOR",PICTURE:"PICTURE"}),p=Object.freeze({USER:"USER",BOT:"BOT",WEBHOOK:"WEBHOOK",AGENT:"AGENT",SYSTEM:"SYSTEM",EXTERNAL:"EXTERNAL"}),f=Object.freeze({REQUEST:"request",START:"start",END:"end",CANCEL:"cancel"}),h=Object.freeze({TAKEOVER_POLL_INTERVAL_MS:1e4,TAKEOVER_REQUEST_POLL_INTERVAL_MS:2e4,REPLY_TIMEOUT_MS:4e3,REPLY_TIMEOUT_MAX_ATTEMPTS:3,REPLY_TIMEOUT_MS_MULTIPLIER:2}),m=Object.freeze({1e3:"250",800:"178",600:"124"}),g=Object.freeze({GREETING:"GREETING",FALLBACK:"FALLBACK",PATTERN_MATCH:"PATTERN_MATCH",KEYWORD_EXACT_MATCH:"KEYWORD_EXACT_MATCH",KEYWORD_MENTION:"KEYWORD_MENTION",SAMPLE_MATCH:"SAMPLE_MATCH",TRIGGER_DIALOGUE:"TRIGGER_DIALOGUE",ZODIAC:"ZODIAC"}),b=Object.freeze({QUICK_REPLY:"QUICK_REPLY",EXTERNAL_LINK:"EXTERNAL_LINK",EMAIL:"EMAIL",PHONE:"PHONE",HANDOVER_REQUEST:"HANDOVER_REQUEST",PRIVACY_EXPORT:"PRIVACY_EXPORT",PRIVACY_DELETE:"PRIVACY_DELETE",DIALOGUE_TRIGGER:"DIALOGUE_TRIGGER",SUGGESTION_DIALOGUE_TRIGGER:"SUGGESTION_DIALOGUE_TRIGGER",CONTACT_DETAILS:"CONTACT_DETAILS",UPLOAD_ATTACHMENT:"UPLOAD_ATTACHMENT",CHECKBOX:"CHECKBOX",SUBMIT:"SUBMIT",edit_contact_details:"edit_contact_details"}),v=Object.freeze({TEMPLATE:"TEMPLATE",CUSTOM:"CUSTOM"}),y=Object.freeze({CLEAN:"CLEAN",ERROR:"ERROR",INFECTED:"INFECTED",PROCESSING:"PROCESSING"}),w=Object.freeze({IMAGE:"image",PDF:"pdf",TEXT:"text"}),E=Object.freeze({DISABLED:"DISABLED",PLATFORM:"PLATFORM",EXTERNAL:"EXTERNAL",PROTOCOL:"HANDOVER_PROTOCOL"}),x=Object.freeze({PRIDE:"PRIDE",EASTER:"EASTER",CHRISTMAS:"CHRISTMAS"}),_=Object.freeze({NO_SPLIT:"X",SPLIT_A:"A",SPLIT_B:"B"}),C=Object.freeze({bottom:"20px",right:"20px"});var T=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce((t,n)=>({...t,...e(n)}),{})};var k=i.a.shape(T(e=>({[e]:i.a.func}),Object.values(b))),O=(i.a.shape({context:i.a.shape({}),language:i.a.string,getAuthToken:i.a.func,bubbleHidden:i.a.bool,buttonHandlers:k,onLoad:i.a.func,environment:i.a.shape({PAT_HOST:i.a.string,PUSHER_KEY:i.a.string,STATUS_PAGE:i.a.string,KINDLY_CHAT_URL:i.a.string,SETTINGS_HOST:i.a.string,SAGE_WS_HOST:i.a.string,SAGE_HOST:i.a.string}),inPlatform:i.a.bool,admin:i.a.bool}),n(4));function S(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".");return new RegExp(t,"i")}var I=function(e,t){if(Object(O.a)(t,"*"))return!0;if(!e)return!1;for(const n of t){if(S(n).test(e))return!0}return!1};function A(e){return(A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function j(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function P(e){return(P=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function L(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];n&&clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o),n=null}),t)}}function D(e,t){var n=0;return function(){var r=(new Date).getTime();if(!(r-n<t))return n=r,e.apply(void 0,arguments)}}var B="object"===("undefined"==typeof window||"undefined"==typeof window?"undefined":A(window)),H=B?document:{},U=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?R(e):t}(this,P(t).call(this,e)),N(R(n),"state",{idle:!1,oldDate:+new Date,lastActive:+new Date,remaining:null,pageX:null,pageY:null}),N(R(n),"tId",null),N(R(n),"_handleEvent",(function(e){var t=n.state,r=t.remaining,o=t.pageX,a=t.pageY,i=t.idle,s=n.props,c=s.timeout,l=s.onAction,u=s.debounce,d=s.throttle,p=s.stopOnIdle;if(u>0?n.debouncedAction(e):d>0?n.throttledAction(e):l(e),!r){if("mousemove"===e.type){if(e.pageX===o&&e.pageY===a)return;if(void 0===e.pageX&&void 0===e.pageY)return;if(n.getElapsedTime()<200)return}clearTimeout(n.tId),n.tId=null;var f=new Date-n.getLastActiveTime();(i&&!p||!i&&f>c)&&n.toggleIdleState(e),n.setState({lastActive:+new Date,pageX:e.pageX,pageY:e.pageY}),i&&p||(n.tId=setTimeout(n.toggleIdleState,c))}})),e.debounce>0&&e.throttle>0)throw new Error("onAction can either be throttled or debounced (not both)");return e.debounce>0&&(n.debouncedAction=L(e.onAction,e.debounce)),e.throttle>0&&(n.throttledAction=D(e.onAction,e.throttle)),e.startOnMount||(n.state.idle=!0),n.toggleIdleState=n._toggleIdleState.bind(R(n)),n.reset=n.reset.bind(R(n)),n.pause=n.pause.bind(R(n)),n.resume=n.resume.bind(R(n)),n.getRemainingTime=n.getRemainingTime.bind(R(n)),n.getElapsedTime=n.getElapsedTime.bind(R(n)),n.getLastActiveTime=n.getLastActiveTime.bind(R(n)),n.isIdle=n._isIdle.bind(R(n)),n}return M(t,e),function(e,t,n){t&&j(e.prototype,t),n&&j(e,n)}(t,[{key:"componentDidMount",value:function(){this._bindEvents(),this.props.startOnMount&&this.reset()}},{key:"componentDidUpdate",value:function(e){e.debounce!==this.props.debounce&&(this.debouncedAction=L(this.props.onAction,this.props.debounce)),e.throttle!==this.props.throttle&&(this.throttledAction=D(this.props.onAction,this.props.throttle))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.tId),this._unbindEvents(!0)}},{key:"render",value:function(){return this.props.children||null}},{key:"_bindEvents",value:function(){var e=this;if(B){var t=this.state.eventsBound,n=this.props,r=n.element,o=n.events,a=n.passive,i=n.capture;t||(o.forEach((function(t){r.addEventListener(t,e._handleEvent,{capture:i,passive:a})})),this.setState({eventsBound:!0}))}}},{key:"_unbindEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(B){var n=this.props,r=n.element,o=n.events,a=n.passive,i=n.capture;(this.state.eventsBound||t)&&(o.forEach((function(t){r.removeEventListener(t,e._handleEvent,{capture:i,passive:a})})),this.setState({eventsBound:!1}))}}},{key:"_toggleIdleState",value:function(e){var t=this;this.setState((function(e){return{idle:!e.idle}}),(function(){var n=t.props,r=n.onActive,o=n.onIdle,a=n.stopOnIdle;t.state.idle?(a&&(clearTimeout(t.tId),t.tId=null,t._unbindEvents()),o(e)):a||(t._bindEvents(),r(e))}))}},{key:"reset",value:function(){clearTimeout(this.tId),this.tId=null,this._bindEvents(),this.setState({idle:!1,oldDate:+new Date,lastActive:+new Date,remaining:null});var e=this.props.timeout;this.tId=setTimeout(this.toggleIdleState,e)}},{key:"pause",value:function(){null===this.state.remaining&&(this._unbindEvents(),clearTimeout(this.tId),this.tId=null,this.setState({remaining:this.getRemainingTime()}))}},{key:"resume",value:function(){var e=this.state,t=e.remaining,n=e.idle;null!==t&&(this._bindEvents(),n||(this.setState({remaining:null,lastActive:+new Date}),this.tId=setTimeout(this.toggleIdleState,t)))}},{key:"getRemainingTime",value:function(){var e=this.state,t=e.remaining,n=e.lastActive,r=this.props.timeout;if(null!==t)return t<0?0:t;var o=r-(+new Date-n);return o<0?0:o}},{key:"getElapsedTime",value:function(){var e=this.state.oldDate;return+new Date-e}},{key:"getLastActiveTime",value:function(){return this.state.lastActive}},{key:"_isIdle",value:function(){return this.state.idle}}]),t}(s.Component);N(U,"propTypes",{timeout:i.a.number,events:i.a.arrayOf(i.a.string),onIdle:i.a.func,onActive:i.a.func,onAction:i.a.func,debounce:i.a.number,throttle:i.a.number,element:i.a.oneOfType([i.a.object,i.a.element]),startOnMount:i.a.bool,stopOnIdle:i.a.bool,passive:i.a.bool,capture:i.a.bool}),N(U,"defaultProps",{timeout:12e5,element:H,events:["mousemove","keydown","wheel","DOMMouseScroll","mouseWheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange"],onIdle:function(){},onActive:function(){},onAction:function(){},debounce:0,throttle:0,startOnMount:!0,stopOnIdle:!1,capture:!0,passive:!0});var z=U,F=c.a.createContext(null);var $=function(e){e()},G={notify:function(){}};function q(){var e=$,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var Y=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=G,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=q())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=G)},e}();var K=function(e){var t=e.store,n=e.context,r=e.children,o=Object(s.useMemo)((function(){var e=new Y(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),a=Object(s.useMemo)((function(){return t.getState()}),[t]);Object(s.useEffect)((function(){var e=o.subscription;return e.trySubscribe(),a!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[o,a]);var i=n||F;return c.a.createElement(i.Provider,{value:o},r)};function W(){return(W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function V(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}var X=n(10),Q=n.n(X),J=n(9),Z="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?s.useLayoutEffect:s.useEffect,ee=[],te=[null,null];function ne(e,t){var n=e[1];return[t.payload,n+1]}function re(e,t,n){Z((function(){return e.apply(void 0,t)}),n)}function oe(e,t,n,r,o,a,i){e.current=r,t.current=o,n.current=!1,a.current&&(a.current=null,i())}function ae(e,t,n,r,o,a,i,s,c,l){if(e){var u=!1,d=null,p=function(){if(!u){var e,n,p=t.getState();try{e=r(p,o.current)}catch(e){n=e,d=e}n||(d=null),e===a.current?i.current||c():(a.current=e,s.current=e,i.current=!0,l({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(u=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var ie=function(){return[null,0]};function se(e,t){void 0===t&&(t={});var n=t,r=n.getDisplayName,o=void 0===r?function(e){return"ConnectAdvanced("+e+")"}:r,a=n.methodName,i=void 0===a?"connectAdvanced":a,l=n.renderCountProp,u=void 0===l?void 0:l,d=n.shouldHandleStateChanges,p=void 0===d||d,f=n.storeKey,h=void 0===f?"store":f,m=(n.withRef,n.forwardRef),g=void 0!==m&&m,b=n.context,v=void 0===b?F:b,y=V(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),w=v;return function(t){var n=t.displayName||t.name||"Component",r=o(n),a=W({},y,{getDisplayName:o,methodName:i,renderCountProp:u,shouldHandleStateChanges:p,storeKey:h,displayName:r,wrappedComponentName:n,WrappedComponent:t}),l=y.pure;var d=l?s.useMemo:function(e){return e()};function f(n){var r=Object(s.useMemo)((function(){var e=n.forwardedRef,t=V(n,["forwardedRef"]);return[n.context,e,t]}),[n]),o=r[0],i=r[1],l=r[2],u=Object(s.useMemo)((function(){return o&&o.Consumer&&Object(J.isContextConsumer)(c.a.createElement(o.Consumer,null))?o:w}),[o,w]),f=Object(s.useContext)(u),h=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(f)&&Boolean(f.store);var m=h?n.store:f.store,g=Object(s.useMemo)((function(){return function(t){return e(t.dispatch,a)}(m)}),[m]),b=Object(s.useMemo)((function(){if(!p)return te;var e=new Y(m,h?null:f.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[m,h,f]),v=b[0],y=b[1],E=Object(s.useMemo)((function(){return h?f:W({},f,{subscription:v})}),[h,f,v]),x=Object(s.useReducer)(ne,ee,ie),_=x[0][0],C=x[1];if(_&&_.error)throw _.error;var T=Object(s.useRef)(),k=Object(s.useRef)(l),O=Object(s.useRef)(),S=Object(s.useRef)(!1),I=d((function(){return O.current&&l===k.current?O.current:g(m.getState(),l)}),[m,_,l]);re(oe,[k,T,S,l,I,O,y]),re(ae,[p,m,v,g,k,T,S,O,y,C],[m,v,g]);var A=Object(s.useMemo)((function(){return c.a.createElement(t,W({},I,{ref:i}))}),[i,t,I]);return Object(s.useMemo)((function(){return p?c.a.createElement(u.Provider,{value:E},A):A}),[u,A,E])}var m=l?c.a.memo(f):f;if(m.WrappedComponent=t,m.displayName=r,g){var b=c.a.forwardRef((function(e,t){return c.a.createElement(m,W({},e,{forwardedRef:t}))}));return b.displayName=r,b.WrappedComponent=t,Q()(b,t)}return Q()(m,t)}}function ce(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function le(e,t){if(ce(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!ce(e[n[o]],t[n[o]]))return!1;return!0}var ue=n(16),de=function(){return Math.random().toString(36).substring(7).split("").join(".")},pe={INIT:"@@redux/INIT"+de(),REPLACE:"@@redux/REPLACE"+de(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+de()}};function fe(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function he(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(he)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var o=e,a=t,i=[],s=i,c=!1;function l(){s===i&&(s=i.slice())}function u(){if(c)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return a}function d(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(c)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return l(),s.push(e),function(){if(t){if(c)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,l();var n=s.indexOf(e);s.splice(n,1),i=null}}}function p(e){if(!fe(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(c)throw new Error("Reducers may not dispatch actions.");try{c=!0,a=o(a,e)}finally{c=!1}for(var t=i=s,n=0;n<t.length;n++){(0,t[n])()}return e}function f(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");o=e,p({type:pe.REPLACE})}function h(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[ue.a]=function(){return this},e}return p({type:pe.INIT}),(r={dispatch:p,subscribe:d,getState:u,replaceReducer:f})[ue.a]=h,r}function me(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function ge(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var a,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:pe.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:pe.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+pe.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){a=e}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var r=!1,o={},s=0;s<i.length;s++){var c=i[s],l=n[c],u=e[c],d=l(u,t);if(void 0===d){var p=me(c,t);throw new Error(p)}o[c]=d,r=r||d!==u}return(r=r||i.length!==Object.keys(e).length)?o:e}}function be(e,t){return function(){return t(e.apply(this,arguments))}}function ve(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function we(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ye(n,!0).forEach((function(t){ve(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ye(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function xe(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function _e(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function Ce(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=_e(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=_e(o),o=r(t,n)),o},r}}var Te=[function(e){return"function"==typeof e?Ce(e):void 0},function(e){return e?void 0:xe((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?xe((function(t){return function(e,t){if("function"==typeof e)return be(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=be(o,t))}return n}(e,t)})):void 0}];var ke=[function(e){return"function"==typeof e?Ce(e):void 0},function(e){return e?void 0:xe((function(){return{}}))}];function Oe(e,t,n){return W({},n,{},e,{},t)}var Se=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,a=n.areMergedPropsEqual,i=!1;return function(t,n,s){var c=e(t,n,s);return i?o&&a(c,r)||(r=c):(i=!0,r=c),r}}}(e):void 0},function(e){return e?void 0:function(){return Oe}}];function Ie(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function Ae(e,t,n,r,o){var a,i,s,c,l,u=o.areStatesEqual,d=o.areOwnPropsEqual,p=o.areStatePropsEqual,f=!1;function h(o,f){var h,m,g=!d(f,i),b=!u(o,a);return a=o,i=f,g&&b?(s=e(a,i),t.dependsOnOwnProps&&(c=t(r,i)),l=n(s,c,i)):g?(e.dependsOnOwnProps&&(s=e(a,i)),t.dependsOnOwnProps&&(c=t(r,i)),l=n(s,c,i)):b?(h=e(a,i),m=!p(h,s),s=h,m&&(l=n(s,c,i)),l):l}return function(o,u){return f?h(o,u):(s=e(a=o,i=u),c=t(r,i),l=n(s,c,i),f=!0,l)}}function je(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=V(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),s=r(e,a),c=o(e,a);return(a.pure?Ae:Ie)(i,s,c,e,a)}function Ne(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Me(e,t){return e===t}function Pe(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?se:n,o=t.mapStateToPropsFactories,a=void 0===o?ke:o,i=t.mapDispatchToPropsFactories,s=void 0===i?Te:i,c=t.mergePropsFactories,l=void 0===c?Se:c,u=t.selectorFactory,d=void 0===u?je:u;return function(e,t,n,o){void 0===o&&(o={});var i=o,c=i.pure,u=void 0===c||c,p=i.areStatesEqual,f=void 0===p?Me:p,h=i.areOwnPropsEqual,m=void 0===h?le:h,g=i.areStatePropsEqual,b=void 0===g?le:g,v=i.areMergedPropsEqual,y=void 0===v?le:v,w=V(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=Ne(e,a,"mapStateToProps"),x=Ne(t,s,"mapDispatchToProps"),_=Ne(n,l,"mergeProps");return r(d,W({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:x,initMergeProps:_,pure:u,areStatesEqual:f,areOwnPropsEqual:m,areStatePropsEqual:b,areMergedPropsEqual:y},w))}}var Re=Pe();function Le(){return Object(s.useContext)(F)}function De(e){void 0===e&&(e=F);var t=e===F?Le:function(){return Object(s.useContext)(e)};return function(){return t().store}}var Be=De();function He(e){void 0===e&&(e=F);var t=e===F?Be:De(e);return function(){return t().dispatch}}var Ue=He(),ze=function(e,t){return e===t};function Fe(e){void 0===e&&(e=F);var t=e===F?Le:function(){return Object(s.useContext)(e)};return function(e,n){void 0===n&&(n=ze);var r=t();return function(e,t,n,r){var o,a=Object(s.useReducer)((function(e){return e+1}),0)[1],i=Object(s.useMemo)((function(){return new Y(n,r)}),[n,r]),c=Object(s.useRef)(),l=Object(s.useRef)(),u=Object(s.useRef)();try{o=e!==l.current||c.current?e(n.getState()):u.current}catch(e){throw c.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+c.current.stack+"\n\n"),e}return Z((function(){l.current=e,u.current=o,c.current=void 0})),Z((function(){function e(){try{var e=l.current(n.getState());if(t(e,u.current))return;u.current=e}catch(e){c.current=e}a({})}return i.onStateChange=e,i.trySubscribe(),e(),function(){return i.tryUnsubscribe()}}),[n,i]),o}(e,n,r.store,r.subscription)}}var $e,Ge=Fe(),qe=n(18);$e=qe.unstable_batchedUpdates,$=$e;var Ye=n(1);const Ke=["load","message"],We="See https://docs.kindly.ai/api/chat#handlers for how to switch.";const Ve=(e,t,n,r)=>{var o,a;if(-1!==Ke.indexOf(e)&&Boolean(r)&&function(e,t,n){const r=`on${t.charAt(0).toUpperCase()+t.slice(1)}`;if("function"!=typeof e)return void console.warn(`Provided setting '${r}' is not a function.`);console.warn(`kindlyOptions.${r} is deprecated in favor of standard event handlers. ${We}`);const o=Object.values(n);try{e(...o)}catch(e){console.error(e)}}(r,e,t),"API"!==n)return;if(null===(o=window)||void 0===o||null===(a=o.kindlyChat)||void 0===a||!a.APIRoot)return void console.warn("No APIRoot when rendered using kindly-chat API");"message"===e&&window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("onMessage",{detail:t}));const i=`kindly:${e}`;window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent(i,{detail:t,bubbles:!0}))};i.a.oneOfType([i.a.node,i.a.arrayOf(i.a.node)]);const Xe="START_OVER";var Qe=n(3);const Je="NEW_MESSAGE";var Ze=n(8),et=n.n(Ze),tt=n(6),nt=n.n(tt);const rt="kindly-chat-browser-id",ot=()=>{const e=localStorage.getItem(rt);if(!e){const e=nt()();return localStorage.setItem(rt,e),e}return e};var at=n(28),it=n(7);const st=function(e){let{token:t,botKey:n,jwt:r}=e,{withCurrentUrl:o,withVersion:a,extra:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{headers:{...t?{"kindly-chatbubble-token":t}:{},...n?{"kindly-bot-key":n}:{},...r?{Authorization:`Bearer ${r}`}:{},...o?{"Current-Url":window.location.href}:{},...a?{"kindly-chat-version":it.a}:{},...i}}},ct=e=>async(t,n)=>{const{connection:{token:r},environment:{PAT_HOST:o}}=n();return r?et.a.patch(`${o}/chatbubble/${l.a}/user_left/`,{},st({token:r,botKey:e})):null},lt=()=>(e,t)=>{const{heartbeatId:n}=t().connection;n&&(clearTimeout(n),e({type:"SET_HEARTBEAT_ID",heartbeatId:void 0}))},ut=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return async(n,r)=>{const{agent:{takenOver:o,requestedTakeover:a}}=r();a?n({type:"TAKEOVER_CANCELLED"}):o&&n({type:"TAKEOVER",data:{taken_over:!1}}),n({type:"RESET_PUSH_MESSAGES"}),n(ct(e)),n(lt());try{Object(Qe.disconnect)(),t||n({type:"CLOSE_CHATBUBBLE"})}catch(e){console.warn(e)}finally{n({type:"RESET_TOKEN"}),n({type:Xe,botKey:e,keepOpen:t}),n({type:"RESET_HAS_HAD_HANDOVER"}),t||setTimeout(()=>n({type:"SET_CHAT_HAS_STARTED",chatHasStarted:!1}),300)}}},dt=Object.freeze({MAX:3,TIMEOUT_MS:2e3,TIMEOUT_MULTIPLIER:2,RESPONSE_STATUSES:[401,403]});let pt=0;const ft=(e,t)=>n=>{if(!e.response||!Object(O.a)(e.response.status,dt.RESPONSE_STATUSES))return console.error(e),null;if(pt+=1,pt>dt.MAX)return console.error(`${t.url} returned ${e.response.status}, max chats restarts exceeded`),null;console.warn(`${t.url} returned ${e.response.status}, starting new chat`);const r=dt.TIMEOUT_MS*dt.TIMEOUT_MULTIPLIER**(pt-1);return setTimeout(()=>n((e,t)=>{const{botKey:n}=t().chatbubble;e(ut(n,!0))}),r),null},ht=()=>(e,t)=>{const{heartbeatTTL:n}=t().bot,r=setTimeout(()=>e((e,t)=>{const{connection:{heartbeatId:n,token:r},environment:{PAT_HOST:o}}=t();clearTimeout(n),e({type:"SET_HEARTBEAT_ID",heartbeatId:void 0}),e(bt({method:"post",url:`${o}/chatbubble/${l.a}/heartbeat/`,data:{version:it.a},...st({token:r})}))}),.75*n*1e3);e({type:"SET_HEARTBEAT_ID",heartbeatId:r})},mt=()=>e=>{e(lt()),e(ht())},gt=e=>{let{chatMessages:t,buttonClicks:n}=e;return(null==n?void 0:n.length)>0||Boolean((null!=t?t:[]).find(e=>{let{from_bot:t}=e;return!t}))},bt=function(e){let{onError:t,restartOnError:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(r,o)=>{if(!e.url)return console.error("Tried to call transport without supplying url"),null;if(!e.method)return console.error("Tried to call transport without supplying method"),null;const{bot:a,messages:i}=o();e.headers={"kindly-chat-version":it.a,[rt]:ot(),...e.headers||{}};try{const t=await et()(e);return a.heartbeatEnabled&>(i)&&r(mt()),t}catch(o){return t?t(o,e):n?r(ft(o,e)):null}}},vt=e=>{const t=`private-chatbubble-${e}`;Object(Qe.subscribe)(t,"message",Je),Object(Qe.subscribe)(t,"takeover","TAKEOVER"),Object(Qe.subscribe)(t,"agent_started_typing","AGENT_STARTED_TYPING"),Object(Qe.subscribe)(t,"agent_stopped_typing","AGENT_STOPPED_TYPING"),Object(Qe.subscribe)(t,"pattern-context-match","PATTERN_CONTEXT_MATCH"),Object(Qe.subscribe)(t,"spell-correction","SPELL_CORRECTION"),Object(Qe.subscribe)(t,"message-attachments-updated","MESSAGE_ATTACHMENTS_UPDATED"),Object(Qe.subscribe)(t,"new-attachments","NEW_ATTACHMENTS")},yt=e=>{let{message:t,error:n,level:r="info",extra:o={}}=e;return(e,a)=>{const i=a(),{connection:{token:s},environment:{PAT_HOST:c}}=i;e(bt({method:"post",url:`${c}/chatbubble/${l.a}/log`,data:Object(at.a)({level:r,error:n,message:t,reduxState:i,extra:o}),...st({token:s,withCurrentUrl:!0})}))}},wt=e=>t=>{t({type:"SET_MESSAGE_SENT_TIME",messageSentTime:e})},Et=e=>{let{buttonId:t,chatMessageId:n}=e;return`button-click-${n}-${t}`};var xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=>!e.find(e=>Et(t)===Et(e))},_t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.reduce((e,n)=>{var r;return{...e,[t(n)]:[...null!==(r=e[t(n)])&&void 0!==r?r:[],n]}},{})},Ct=e=>t=>{let{id:n,chatbubble_temporary_id:r}=t;return!e.find(e=>{let{id:t}=e;return n===t||r===t})};const Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[n.replace(/_\w/g,e=>e[1].toUpperCase())]:r}},{})},kt=e=>async(t,n)=>{if(!(null!=e&&e.length)>0)return;const{attachments:r=[]}=n().messages,{newAttachments:o=[],updated:a=[]}=_t(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(e=>{let{sender:t,status:n}=e;return t===p.USER||n===y.CLEAN})}(e),e=>r.find((e=>{let{id:t,temporaryId:n}=e;return e=>{let{id:r,temporaryId:o}=e;return t&&t===r||n&&n===o}})(e))?"updated":"newAttachments");o.length>0&&t({type:"NEW_ATTACHMENTS",data:{attachments:o}}),a.length>0&&t({type:"MESSAGE_ATTACHMENTS_UPDATED",data:{attachments:a}})},Ot=function(){let{status:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e!==y.PROCESSING},St=()=>async(e,t)=>{const{agent:{takenOver:n,requestedTakeover:r},chatbubble:{active:o,startedAt:a,chatHasStarted:i,botKey:s},connection:{token:c},environment:{PAT_HOST:u},messages:{attachments:d,buttonClicks:p,chatMessages:f,messageSentTime:h}}=t();if(!c||!i)return;const[m]=f.filter(e=>{let{from_bot:t}=e;return t}).slice(-1),[g]=d.filter(Ot).slice(-1),b=((e,t)=>{let{created:n}=e,{created:r}=t;return n&&r?new Date(n)>new Date(r)?n:r:n||r})(null!=m?m:{},null!=g?g:{})||h||a||(new Date).toISOString(),v=await e(bt({method:"get",url:`${u}/chatbubble/${l.a}/latest`,params:{timestamp:b},...st({token:c})},{onError:t=>{403===t.response.status?(console.warn(`/chatbubble/${l.a}/latest returned 403, starting new chat`),e({type:"SET_ERROR",error:403}),e(ut(s,!0))):console.error(t)}}));if(!v||!v.data)return;const{chatMessages:y,buttonClicks:w=[],takenOver:E,requestedTakeover:x,attachments:_}=v.data,C=Ct(f),T=xt(p),k=y.filter(C),O=w.map(Tt).filter(T),S=k.length>0;var I,A;e(kt(_)),e(At(S)),n!==E&&e({type:"TAKEOVER",data:{taken_over:E}}),r!==x&&e({type:"TAKEOVER_REQUESTED",requestedTakeover:x}),(I=k,A="created",(I||[]).slice().sort((e,t)=>e[A]<t[A]?-1:1)).forEach(t=>{e({type:Je,data:t,skipTypingIndicator:!0,force:!0})}),O.forEach(t=>e({type:"BUTTON_CLICK",buttonClick:t,force:!0})),S&&!o&&e({type:"OPEN_CHATBUBBLE"})},It=()=>(e,t)=>{const{replyTimeoutId:n,takeoverPollIntervalId:r}=t().websocketFallback;if(clearTimeout(n),r)return;const o=setTimeout(()=>e(St()),h.REPLY_TIMEOUT_MS);e({type:"SET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT",replyTimeoutId:o,replyTimeoutAttempts:1})},At=e=>(t,n)=>{const{replyTimeoutId:r,replyTimeoutAttempts:o}=n().websocketFallback;if(clearTimeout(r),0===o)return;if(!(!e&&o<h.REPLY_TIMEOUT_MAX_ATTEMPTS))return e||console.error(`Reply timeout failed more than ${h.REPLY_TIMEOUT_MAX_ATTEMPTS} times`),void t({type:"RESET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT"});const a=h.REPLY_TIMEOUT_MS*h.REPLY_TIMEOUT_MS_MULTIPLIER**o,i=setTimeout(()=>t(St()),a);t({type:"SET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT",replyTimeoutId:i,replyTimeoutAttempts:o+1})},jt=e=>async t=>{const n=await e;200===(null==n?void 0:n.status)&&(t({type:"TAKEOVER_REQUESTED",...n.data,requestedTakeover:!0}),t(It()))},Nt=()=>(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:r}}=t();e(bt({method:"post",url:`${r}/chatbubble/${l.a}/takeover_cancel/`,...st({token:n})})),e({type:"TAKEOVER_CANCELLED"})},Mt=()=>(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:r}}=t();e({type:"USER_STOPPED_TYPING"}),e(bt({method:"post",url:`${r}/chatbubble/${l.a}/user_stopped_typing/`,...st({token:n})}))},Pt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n=>{n({type:"ANNOUNCEMENT_SHOW",payload:{text:e}}),t>0&&setTimeout(()=>n({type:"ANNOUNCEMENT_HIDE"}),t)}};function Rt(e){const t=function(e){if(!e)return null;const t=e.match(/^[A-Za-z0-9-_=]+\.([A-Za-z0-9-_=]+)\.?[A-Za-z0-9-_.+/=]*$/);if(!t)return null;try{return JSON.parse(atob(t[1]))}catch(e){return null}}(e);return!t||t.exp-Math.floor((new Date).getTime()/1e3)<30}const Lt=()=>async(e,t)=>{const{chatbubble:{chatId:n},connection:{token:r},auth:{getAuthToken:o},environment:{PAT_HOST:a}}=t();if(!n||!o)return void e({type:"UNAUTHENTICATED"});let i;try{i=await o(n)}catch(e){console.error("Chatbubble auth failed:",e),i=null}if(!i)return void e({type:"UNAUTHENTICATED"});const{headers:s}=st({jwt:i,token:r},{withCurrentUrl:!0}),c=await e(bt({method:"post",url:`${a}/chatbubble/${l.a}/auth/chat`,headers:s},{onError:()=>e({type:"UNAUTHENTICATED"})}));null!=c&&c.data&&e({type:"AUTHENTICATED",token:i,avatarUrl:c.data.avatar_url,fullName:c.data.full_name})},Dt=()=>async(e,t)=>{const{auth:{isAuthenticated:n,isRefreshing:r,token:o,getAuthToken:a}}=t();if(!n)return null;if(r)return await new Promise(e=>setTimeout(e,200)),Dt()(e,t);a&&Rt(o)&&(e({type:"START_REFRESHING"}),await e(Lt()),e({type:"END_REFRESHING"}));const{auth:i}=t();return i.isAuthenticated?{Authorization:`Bearer ${i.token}`}:null},Bt=()=>(e,t)=>{const{isTypingTimeoutId:n}=t().bot;clearTimeout(n),e({type:"BOT_IS_TYPING",isTyping:!1,isTypingTimeoutId:null})},Ht=()=>(e,t)=>{const{isTypingTimeoutId:n,typingDuration:r}=t().bot;clearTimeout(n);const o=setTimeout(()=>e(Bt()),Math.max(r,15e3));e({type:"BOT_IS_TYPING",isTyping:!0,isTypingTimeoutId:o})};var Ut=n(29);let zt,Ft;const $t=e=>(t,n)=>{const{SAGE_WS_HOST:r}=n().environment;if(!zt||!zt.isConnected())try{zt=new Ut.Socket(`${r}/chatbubble/socket`),zt.connect()}catch(e){console.warn("Could not connect to sage socket",e)}try{Ft=zt.channel(`chatbubble_active:${e}`),Ft.join()}catch(e){console.warn("Could not join active channel",e)}},Gt=()=>{if(zt&&Ft)try{Ft.leave()}catch(e){console.warn("Could not leave active channel",e)}if(zt)try{zt.disconnect()}catch(e){console.warn("Could not disconnect from sage socket",e)}},qt=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=JSON.parse(window.localStorage.getItem("pusherTransportEncrypted"));t.indexOf("ws")<0&&n&&"ws"!==n.transport&&window.localStorage.removeItem("pusherTransportEncrypted"),Object(Qe.startConfiguration)({auth:{...st({token:e},{withVersion:!0})},disabledTransports:t}),vt(e)},Yt=function(){let{triggerDialogueSlug:e,languageCode:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(n,r)=>{const{local:{context:o},chatbubble:{botKey:a,currentLanguage:i,disabledTransports:s},environment:{PAT_HOST:c,VERSION:u},bot:{includeDisabledLanguages:d}}=r(),p={context:o,language_code:t||i,trigger_dialogue_slug:e,include_disabled_languages:d,version:u},f=await n(bt({method:"post",url:`${c}/chatbubble/${l.a}/connect`,params:p,...st({botKey:a},{withCurrentUrl:!0})}));if(!f)return;const{pusherConnected:h}=r().connection;if(h)try{Object(Qe.disconnect)()}catch(e){console.warn(e)}const{token:m,chat_id:g,created:b,all_greetings_hide_input:v}=f.data;n({type:"NEW_TOKEN",token:m}),n({type:"NEW_CHAT_ID",chatId:g,allGreetingsHideInput:v}),n({type:"SET_STARTED_AT",startedAt:b}),n(wt((new Date).toISOString())),qt(m,s),n(Lt())}},Kt=e=>t=>t({type:"CONNECT_WITH_TRIGGER",triggerConfig:e}),Wt=(e,t)=>{if(e.feedbackFormType===u.NONE)return!1;if(e.feedbackFormType===u.EXTERNAL_LINK){var n,r,o;const{feedbackForm:a}=e;return(null===(n=a.external_link_url)||void 0===n?void 0:n[t])&&((null===(r=a.external_link_headline)||void 0===r?void 0:r[t])||(null===(o=a.external_link_text)||void 0===o?void 0:o[t]))}return!0},Vt=function(e){let{skipRestart:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n,r)=>{const{botKey:o,chatHasStarted:a}=r().chatbubble;n({type:"SET_LANGUAGE",code:e}),!t&&a&&n(ut(o,!0))}},Xt=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(t,n)=>{const{bot:r,chatbubble:{currentLanguage:o,botKey:a,optionsScreenOpen:i},connection:{token:s},feedback:{feedbackFormOpen:c},messages:{chatMessages:l},agent:{hasHadHandover:u}}=n(),d=r.noFeedbackAfterHandover&&u;i&&t({type:"CLOSE_OPTIONS_SCREEN"}),!e&&Wt(r,o)&&!c&&l&&!d&&l.length>1&&setTimeout(()=>t({type:"OPEN_FEEDBACK_FORM",token:s}),r.fullscreenMode?0:1500),t(ut(a,e));try{Object(Qe.disconnect)()}catch(e){console.error(e)}}},Qt=()=>(e,t)=>{const{pushMessages:n,alerts:r,bot:o,chatbubble:a,nudge:i}=t();n.show&&e({type:"DISMISS_PUSH_MESSAGE"}),i.show&&e({type:"DISMISS_NUDGE"}),(r.showTabNotification||r.showBubbleNotification)&&e({type:"DISMISS_NOTIFICATIONS"}),e({type:"OPEN_CHATBUBBLE"}),a.chatHasStarted||o.welcomePage&&o.welcomePageType!==d.NONE||e({type:"SET_CHAT_HAS_STARTED",chatHasStarted:!0})},Jt=e=>(t,n)=>{var r,o;const{chatbubble:{contactDetailsButton:a}}=n();(null==a||null===(r=a.contact_details)||void 0===r?void 0:r.contact_type)===(null==e||null===(o=e.contact_details)||void 0===o?void 0:o.contact_type)?t({type:"HIDE_CONTACT_DETAILS"}):t({type:"SHOW_CONTACT_DETAILS",button:e})},Zt=e=>t=>{t({type:"ATTACHMENT_BUTTON_CLICKED",button:e})},en=e=>t=>{0===e.length?t({type:"CLEAR_ATTACHMENT_FILES"}):t({type:"SET_ATTACHMENT_FILES",files:e})},tn=e=>({type:"SET_INSPECTED_CHAT_MESSAGE",chatMessageId:e});var nn=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,n)=>{let[r,o]=n;return{...e,...Object(O.a)(r,t)?{}:{[r]:o}}},{})}},rn=function(){let{status:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!(e>=200&&e<=299)},on=e=>{const t=(null!=e?e:"").toUpperCase();return"LINK"===t?b.EXTERNAL_LINK:"TAKEOVER_REQUEST"===t?b.HANDOVER_REQUEST:t},an=n(30),sn=n.n(an);function cn(e){if(!e)return null;const t=e.match(/filename="(.+)"/);return t&&2===t.length?t[1]:null}const ln=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"html";return async(n,r)=>{var o;let a=e?await e:null;if(!a){const{connection:{token:e},environment:{PAT_HOST:o}}=r(),i=`${o}/chatbubble/${l.a}/privacy/export/${t}`,{headers:s}=st({token:e}),c={transformResponse:e=>e,responseType:"text"};a=await n(bt({method:"get",url:i,...c,headers:s}))}if(200!==(null===(o=a)||void 0===o?void 0:o.status))return;const{headers:i,data:s}=a,c=cn(i["content-disposition"])||"export.json",u=new Blob([s],{type:i["content-type"]});sn()(u,c)}},un=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(t,n)=>{const{connection:{token:r},chatbubble:{botKey:o},environment:{PAT_HOST:a}}=n(),i=`${a}/chatbubble/${l.a}/privacy/delete/`,s=e?await e:await t(bt({method:"delete",url:i,...st({token:r})}));200===(null==s?void 0:s.status)&&(setTimeout(()=>t(ut(o)),5e3),t({type:"DELETE_CHAT"}),t({type:"RESET_TOKEN"}))}},dn=e=>{const{PAT_HOST:t}=e().environment,{local:n,chatbubble:{botKey:r},connection:{token:o}}=e();return{token:o,PAT_HOST:t,botKey:r,local:n}},pn=function(e,t,n){let{responsePromise:r,tempId:o}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4?arguments[4]:void 0;return async(i,s)=>{const{PAT_HOST:c,token:u,local:d}=dn(s),p=o||nt()();i({type:Je,data:{id:p,created:(new Date).toISOString(),message:e,buttonType:a}}),i(wt((new Date).toISOString()));const f=await i(Dt()),{headers:h}=st({token:u},{withCurrentUrl:!0,extra:f}),m={message:e,exchange_id:t,temporaryId:p,new_context:{...d.context,...n||{}}},g=r?await r:await i(bt({method:"post",url:`${c}/chatbubble/${l.a}/message/`,data:m,headers:h},{onError:e=>{var t;console.error(`/chatbubble/${l.a}/message returned ${e.response.status}`),i({type:"UPDATE_CHAT_MESSAGE",temporaryId:p,status:null==e||null===(t=e.response)||void 0===t?void 0:t.status}),i({type:"BOT_IS_TYPING",isTyping:!1})}}));rn(g)||(i({type:"UPDATE_CHAT_MESSAGE",...g.data}),i(It()))}},fn=e=>({...e,temporaryId:nt()()}),hn=e=>{let{temporaryId:t}=e;return t},mn=()=>async(e,t)=>{var n;const{bot:{id:r},chatbubble:{chatId:o,attachments:a},connection:{token:i},environment:{PAT_HOST:s}}=t(),c=await e(Dt()),{headers:u}=st({token:i},{extra:c}),d=nt()(),p=a.files.map(fn).map(nn("file"));e({type:"NEW_ATTACHMENTS",data:{attachments:p}}),e({type:"CLEAR_ATTACHMENT_FILES"}),e({type:Je,data:{id:d,created:(new Date).toISOString(),attachment_ids:p.map(hn),message:""}}),e(wt((new Date).toISOString()));const f=(t,n)=>{var r;e({type:"UPDATE_CHAT_MESSAGE",temporaryId:d,status:null==t||null===(r=t.response)||void 0===r?void 0:r.status}),n?e({type:"UPDATE_ATTACHMENT",attachment:{...n,status:y.ERROR}}):p.forEach(t=>e({type:"UPDATE_ATTACHMENT",attachment:{...t,status:y.ERROR}}))},h=p.map(nn("file","url")),m=`${s}/chatbubble/${l.a}/attachment/create`,g={attachments:h,temporaryChatMessageId:d},b=await e(bt({method:"post",url:m,data:g,headers:u},{onError:e=>f(e)}));if(rn(b)||!Array.isArray(null==b||null===(n=b.data)||void 0===n?void 0:n.attachments))return;const[v,w]=b.data.attachments.reduce((t,n)=>{let[r,o]=t,{id:a,temporary_id:i,upload_url:s}=n;return e({type:"UPDATE_ATTACHMENT",attachment:{temporaryId:i,id:a}}),[[...r,a],[...o,s]]},[[],[]]),E={"x-goog-upload-bot-id":r,"x-goog-upload-chat-id":o},x=(_=a.files,C=w,"number"!=typeof(null==_?void 0:_.length)||_.length!==(null==C?void 0:C.length)?(console.error("Trying to zip non-array of arrays of unequal length"),[]):_.map((e,t)=>[e,C[t]])).map(async t=>{let[{file:n,...r},o]=t;const a=await(e=>new Promise((t,n)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=()=>t(r.result),r.onabort=()=>n(new Error(r.error))}))(n),i={...E,"Content-Type":n.type};return await e(bt({method:"put",url:o,data:a,headers:i},{onError:e=>f(e,r)}))});var _,C;if((await Promise.all(x)).some(rn))return;const T=`${s}/chatbubble/${l.a}/attachment/uploads-complete`,k={attachmentIds:v,temporaryChatMessageId:d,exchangeId:a.exchangeId};e(wt((new Date).toISOString())),e(bt({method:"post",url:T,data:k,headers:u},{onError:e=>f(e)}))},gn=function(e){let{openChat:t,languageCode:n,tempId:r,responsePromise:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(a,i)=>{const{connection:{token:s},chatbubble:{currentLanguage:c}}=i(),{PAT_HOST:u}=i().environment;if(!s){return a(Kt({triggerDialogueSlug:e,languageCode:n,openChat:t})),a((e,t)=>{const{token:n,feedbackFormOpen:r}=t().feedback;(n||r)&&e({type:"CLOSE_FEEDBACK_FORM"}),e({type:"SET_CHAT_HAS_STARTED",chatHasStarted:!0})}),void(t&&a(Qt()))}if(n&&n!==c){a(yt({message:"Tried to trigger a dialogue in another language on an existing chat",level:"error",extra:{languageCode:n,currentLanguage:c}}))}const d=r||nt()();a({type:"TRIGGER_DIALOGUE",data:{id:d,created:(new Date).toISOString(),exchangeId:e}}),a(wt((new Date).toISOString()));const p={exchange_id:e,temporaryId:d},{headers:f}=st({token:s},{withCurrentUrl:!0}),h=o?await o:await a(bt({method:"post",url:`${u}/chatbubble/${l.a}/trigger/`,data:p,headers:f}));rn(h)||(t&&a(Qt()),a(It()))}},bn=e=>e===b.PRIVACY_EXPORT?{transformResponse:e=>e,responseType:"text"}:{},vn=(e,t)=>!!t.find(t=>{let{buttons:n=[]}=t;return!!n.find(t=>{let{language_code:n,button_type:r}=t;return n===e&&on(r)===b.HANDOVER_REQUEST})}),yn=((e,t,n)=>{let r,o=[];return function(){for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];n&&o.push(i),clearTimeout(r),r=setTimeout(()=>{n||e(...i);const t=o.slice(1).reduce((e,t)=>n(t,e),o[0]);e(...t),o=[]},t)}})(async(e,t,n)=>{let{id:r,index:o}=e;const{connection:{token:a},environment:{PAT_HOST:i,VERSION:s}}=n(),c=await t(Dt()),{headers:u}=st({token:a},{withCurrentUrl:!0,extra:c}),d={chatMessageId:r,version:s};t({type:"SET_LAST_MESSAGE_SEEN",id:r,index:o}),t(bt({method:"patch",url:`${i}/chatbubble/${l.a}/message-seen`,data:d,headers:u}))},1500,(e,t)=>{const[{index:n}]=e,[{index:r}]=t;return n>r?e:t}),wn="takeover",En="message";var xn=(e,t)=>{const{type:n}=e;let r;return"Form"===n?r=(e=>{let{title:t,body_text:n,input_label:r,input_placeholder:o,languageCode:a}=e;return{sections:[{title:t[a],description:n[a]},{form:{input:{label:r[a],placeholder:o[a],required:!0},button:{title:"Send skjema",icon:"icon",type:"submit"}}}]}})({...e,languageCode:t}):"Product"===n?r=(e=>{var t;let{title:n,body_text:r,button_text:o,button_link:a,carousel_title:i,image_carousel:s,languageCode:c}=e;return{sections:[{title:n[c],description:r[c],buttons:[{label:o[c],value:a[c],button_type:"link",is_active:!0}]},{products:{title:i[c],items:null===(t=s[c])||void 0===t?void 0:t.map(e=>{let{title:t,alt_text:n,description:r,image_url:o,product_url:a,link_text:i,link_url:s,price:c}=e;return{title:t,image:o,linkText:i,linkUrl:s,productUrl:a,altText:n,description:r,price:c}})}}]}})({...e,languageCode:t}):"Text"===n?r=(e=>{let{title:t,body_text:n,link_text:r,link_location:o,languageCode:a}=e;return{sections:[{title:t[a],description:n[a]},{link:{text:r[a],location:o[a]}}]}})({...e,languageCode:t}):"Multiple choice"===n?r=(e=>{let{title:t,body_text:n,button_blocks:r,languageCode:o}=e;return{sections:[{title:t[o],description:n[o]},{choices:{buttons:r.map(e=>{let{button_text:t,dialogue_id:n}=e;return{text:t[o],triggerDialogue:n}})}}]}})({...e,languageCode:t}):"Custom"===n&&(r={}),r};const _n=e=>{var t,n,r,o,a;return[...null!==(t=null==e?void 0:e.form_nudges)&&void 0!==t?t:[],...null!==(n=null==e?void 0:e.custom_nudges)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.product_nudges)&&void 0!==r?r:[],...null!==(o=null==e?void 0:e.text_nudges)&&void 0!==o?o:[],...null!==(a=null==e?void 0:e.multiple_choice_nudges)&&void 0!==a?a:[]]},Cn=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=t.find(e=>{let{active:t}=e;return t}),o=n||r.code;return e.enabled[o]},Tn=e=>{let{slug:t,eventType:n,label:r}=e;return async(e,o)=>{if(!t||!n)return;const{nudges:a,languages:i}=o().bot,{botKey:s,currentLanguage:c}=o().chatbubble,{PAT_HOST:u}=o().environment,{token:d}=o().connection,p=_n(a).find(e=>e.slug===t&&Cn(e,i,c));if(!p)return;const f=await e(Dt());e({type:"COUNT_NUDGE",slug:t}),e(bt({method:"post",url:`${u}/chatbubble/${l.a}/nudge/`,data:{session_id:ot(),nudge_id:p.id,action:n,type:p.type,label:r||null,language_code:c},...st({botKey:s,token:d},{withCurrentUrl:!0,extra:f})}))}},kn=(e,t)=>(n,r)=>{const{show:o,isCustom:a,slug:i,trackEvent:s}=r().nudge;if(o){if(n({type:"DISMISS_NUDGE"}),a){const e=document.getElementById("kindly-custom-nudge");e&&e.parentNode.removeChild(e)}s&&n(Tn({slug:i,eventType:e?"CTA_CLICK":"DISMISS_NUDGE",label:t}))}};var On=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 25",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M14.83 21.67L5.66 12.5l9.17-9.17L12 .5l-12 12 12 12z",fill:"#000",fillRule:"nonzero"}));var Sn=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 25",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M.17 3.33l9.17 9.17-9.17 9.17L3 24.5l12-12L3 .5z",fill:e.fill||"#000",fillRule:"nonzero"}));var In=e=>{let{bubbleOutline:t,seasonalAppearance:n,...r}=e;return c.a.createElement("svg",Object.assign({},r,{viewBox:"0 0 65 67",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M64.557 65.487c-4 .482-7.42 1.138-10.86 1.257-5.824.201-11.693.466-17.483-.018-11.677-.976-22.173-4.749-29.675-14.559C-7.841 33.36 2.774 5.123 25.93.64c18.296-3.542 35.275 7.95 38.513 26.317 1.854 10.52-.945 19.876-8.035 27.882l-1.501 1.699 9.65 8.949z",fill:"#0069ff"}))};var An=e=>c.a.createElement("svg",Object.assign({"data-name":"Layer 1"},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 747 768"}),c.a.createElement("defs",null,c.a.createElement("linearGradient",{id:"a",x1:"373.51",x2:"373.51",y2:"768",gradientUnits:"userSpaceOnUse"},c.a.createElement("stop",{offset:".04",stopColor:"#ff0006"}),c.a.createElement("stop",{offset:".04",stopColor:"#ff0106"}),c.a.createElement("stop",{offset:".08",stopColor:"#ff3204"}),c.a.createElement("stop",{offset:".13",stopColor:"#ff5802"}),c.a.createElement("stop",{offset:".17",stopColor:"#ff7401"}),c.a.createElement("stop",{offset:".2",stopColor:"#ff8500"}),c.a.createElement("stop",{offset:".23",stopColor:"#ff8b00"}),c.a.createElement("stop",{offset:".28",stopColor:"#fda900"}),c.a.createElement("stop",{offset:".42",stopColor:"#faec00"}),c.a.createElement("stop",{offset:".56",stopColor:"#00963e"}),c.a.createElement("stop",{offset:".75",stopColor:"#314ea6"}),c.a.createElement("stop",{offset:".94",stopColor:"#991588"}))),c.a.createElement("path",{d:"M747.2 373.69C747.2 167.31 579.89 0 373.51 0S-.18 167.31-.18 373.69c0 165 107 304.87 255.27 354.41 63.32 25 142.21 39.9 227.77 39.9 89.71 0 172.07-16.36 236.86-43.63l-86.65-82A372.47 372.47 0 00747.2 373.69z",fill:"url(#a)"}));var jn=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 30 30",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M8.618 21.359L21.372 8.605m-12.754-.01l12.754 12.754",stroke:e.stroke||"#FFF",strokeWidth:"4",fill:"none",fillRule:"evenodd"}));var Nn=e=>{let{width:t="16px",height:n="12px",fill:r="rgb(0, 105, 255)"}=e;return c.a.createElement("svg",{width:t,height:n,viewBox:"0 0 16 12"},c.a.createElement("path",{d:"M8 12c3.6 0 6.4-3.1 7.6-4.9.5-.7.5-1.6 0-2.3C14.4 3.1 11.6 0 8 0 4.4 0 1.6 3.1.4 4.9c-.5.7-.5 1.6 0 2.2C1.6 8.9 4.4 12 8 12zm0-9c1.7 0 3 1.3 3 3S9.7 9 8 9 5 7.7 5 6s1.3-3 3-3z",fill:r}))};var Mn=e=>{let{width:t="16px",height:n="16px",fill:r="rgb(0, 105, 255)"}=e;return c.a.createElement("svg",{width:t,height:n},c.a.createElement("g",{fill:r},c.a.createElement("path",{d:"M14.6 5.6l-8.2 8.2c.5.1 1.1.2 1.6.2 3.6 0 6.4-3.1 7.6-4.9.5-.7.5-1.6 0-2.3-.2-.3-.6-.7-1-1.2zM14.3.3L11.6 3C10.5 2.4 9.3 2 8 2 4.4 2 1.6 5.1.4 6.9c-.5.7-.5 1.6 0 2.2.5.8 1.4 1.8 2.4 2.7L.3 14.3c-.4.4-.4 1 0 1.4.2.2.4.3.7.3.3 0 .5-.1.7-.3l14-14c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0zm-9 9C5.1 8.9 5 8.5 5 8c0-1.7 1.3-3 3-3 .5 0 .9.1 1.3.3l-4 4z"})))};var Pn=e=>{let{active:t,...n}=e;return c.a.createElement("svg",Object.assign({},n,{viewBox:"0 0 22 11",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M3 3l7.887 5L19 3",stroke:"#FFF",strokeWidth:"4",fill:"none",fillRule:"evenodd",strokeLinecap:"square"}))};var Rn=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 30 30",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M30 0L0 12.927l11.523 3.782 5.531-5.646 2.75 2.34-5.382 5.728L19.02 30z",fill:"#0069FF",fillRule:"evenodd"}));var Ln=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 25 26",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{fill:"#0069FF",fillRule:"nonzero",d:"M22.05 14.274c.052-.416.09-.832.09-1.274 0-.442-.038-.858-.09-1.274l2.712-2.145a.661.661 0 0 0 .155-.832l-2.57-4.498a.642.642 0 0 0-.784-.286l-3.2 1.3a9.363 9.363 0 0 0-2.172-1.274L15.703.546a.629.629 0 0 0-.63-.546h-5.14a.629.629 0 0 0-.63.546l-.488 3.445a9.846 9.846 0 0 0-2.172 1.274l-3.2-1.3a.624.624 0 0 0-.784.286L.09 8.749a.646.646 0 0 0 .154.832l2.712 2.145c-.052.416-.09.845-.09 1.274 0 .429.038.858.09 1.274L.243 16.419a.661.661 0 0 0-.154.832l2.57 4.498c.154.286.501.39.784.286l3.2-1.3c.668.52 1.388.949 2.172 1.274l.488 3.445a.629.629 0 0 0 .63.546h5.14a.629.629 0 0 0 .63-.546l.488-3.445a9.846 9.846 0 0 0 2.172-1.274l3.2 1.3c.295.117.63 0 .783-.286l2.57-4.498a.661.661 0 0 0-.154-.832l-2.711-2.145zm-9.547 3.276c-2.48 0-4.498-2.041-4.498-4.55s2.018-4.55 4.498-4.55C14.983 8.45 17 10.491 17 13s-2.018 4.55-4.498 4.55z"}));var Dn=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 39 35",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M21.04 22.88l-4.5-4.4.05-.04c3.09-3.4 5.29-7.3 6.58-11.43h5.2V3.5H15.94V0h-3.54v3.5H0v3.48h19.8a27.56 27.56 0 01-5.62 9.38 27.59 27.59 0 01-4.1-5.86H6.55a30.7 30.7 0 005.28 7.98l-9.01 8.8 2.5 2.47L14.19 21l5.52 5.44 1.34-3.56zM31.02 14h-3.54L19.5 35h3.55l1.99-5.25h8.42l2 5.25H39l-7.98-21zm-4.65 12.25l2.88-7.59 2.88 7.59h-5.76z",fill:"#000",fillRule:"nonzero"}));var Bn=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 15",xmlns:"https://www.w3.org/2000/svg"}),c.a.createElement("path",{d:"M8.7.2l.7 6.4 2.1-2.1A5.01 5.01 0 018 13a5.01 5.01 0 01-3.5-8.5c.6-.6 1.4-1.1 2.3-1.3l-.6-1.9C5 1.6 3.9 2.2 3 3.1A7.06 7.06 0 003 13c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L15 .9 8.7.2z",fill:"#0069ff",fillRule:"evenodd"}));var Hn=e=>c.a.createElement("svg",Object.assign({},e,{width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"}),c.a.createElement("title",null,"fullscreen"),c.a.createElement("g",{fill:"#000",fillRule:"nonzero"},c.a.createElement("path",{d:"M2 4H0v6h6V8H2zM4 2h4v4h2V0H4z"})));var Un=()=>c.a.createElement(c.a.Fragment,null,c.a.createElement("title",null,"Easter bunny - Ear back"),c.a.createElement("path",{d:"M3.383832 27.44434c-.5696765 0-1.0926451-.3662715-1.2678229-.9298759C-.097824 19.4159224-.5597867 7.1662958 2.1847886 2.6020193 2.8946153 1.4219446 3.8016913.717756 4.8787494.5088278 5.1006483.4662629 5.3264406.44434 5.5561263.44434c5.5241917 0 12.1254407 13.2736523 13.7098937 21.8811524.127168.686122-.307554 1.3528962-.990127 1.5192729L3.7017511 27.4056447c-.1051093.0270867-.2128098.0386953-.3179191.0386953z",fill:"#D8AB31",fillRule:"nonzero"}));var zn=()=>c.a.createElement(c.a.Fragment,null,c.a.createElement("title",null,"Easter bunny - Ear"),c.a.createElement("g",{fillRule:"nonzero",fill:"none"},c.a.createElement("path",{d:"M.52124097 23.12346c1.1077-2.9952571 2.4707-5.8635571 3.89508572-8.1808C8.23468383 8.72614571 17.4631981.05566 23.8178267.05566c1.0630571 0 2.0228857.23577143 2.8529571.70172857 1.3881143.78125714 2.3381715 2.17075714 2.8236572 4.12945714C31.0973981 11.3502886 27.3599553 22.6421457 23.9768695 27.89326c-1.8024571 2.7943571-4.3457 5.7854286-7.0703142 8.3286857C18.4230124 39.9496314-2.68050189 22.5919314.52124097 23.12346z",fill:"#FFCA3A"}),c.a.createElement("path",{d:"M5.88116954 25.1058886c.97795715-2.6437 2.1861-5.1911286 3.40262857-7.1707572C13.050541 11.8037171 21.1239267 4.75293143 23.788541 5.76996c2.0824285 1.37882857-1.6322572 14.3987143-4.6149572 19.0290143-1.536 2.3800286-3.7834857 5.0223143-6.1663 7.2461-.7651143-1.1467572-1.8275714-2.5236714-3.26729997-3.9141429-1.37687143-1.3297-2.72652857-2.3123285-3.85881429-3.0250428z",fill:"#ED69AB"})));var Fn=()=>c.a.createElement(c.a.Fragment,null,c.a.createElement("title",null,"Easter bunny - eyes and nose"),c.a.createElement("g",{fill:"#444",fillRule:"nonzero"},c.a.createElement("path",{d:"M.90472674 8.99584399c2.74085003.33653407 4.68991811 2.83122741 4.35338405 5.57207751-.14122056 1.1501491-.66582961 2.1538328-1.42827251 2.9096051l.02155026-.033559c-.29718086.4016151-.44174483.6949895-.43369189.8801234.00805293.1851339.06770527.4164406.17895702.69392l.22780297.4902169c.71471582 1.4864853 1.36458452 2.3467141 1.904725 2.5661605.52176099.2119794 1.11876984-.367668 1.73951555-2.002382l.16243825-.4505538c.08961326-.2611974.37400147-.4002938.63519886-.3106806.26119739.0896133.40029381.3740015.31068055.6351989-.84494502 2.4627766-1.8976385 3.5938393-3.22423148 3.0548755-1.04273744-.4236399-2.26408063-2.33244-3.34632177-5.0376669l-.22156463-.7730561C.89682689 14.6373453.55365859 11.8550647.90472674 8.99584399zM22.9999996 10c-2.7571667 0-5-2.24283333-5-5s2.2428333-5 5-5 5 2.24283333 5 5-2.2428333 5-5 5z"}))),$n=()=>{};function Gn(e,t){return(Gn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qn(e){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Yn(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Kn(e,t,n){return(Kn=Yn()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Gn(o,n.prototype),o}).apply(null,arguments)}function Wn(e){var t="function"==typeof Map?new Map:void 0;return(Wn=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Kn(e,arguments,qn(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Gn(r,e)})(e)}var Vn=function(e){var t,n;function r(t){return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/master/src/internalHelpers/errors.md#"+t+" for more information.")||this)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,Gn(t,n),r}(Wn(Error));function Xn(e){return Math.round(255*e)}function Qn(e,t,n){return Xn(e)+","+Xn(t)+","+Xn(n)}function Jn(e,t,n,r){if(void 0===r&&(r=Qn),0===t)return r(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,i=a*(1-Math.abs(o%2-1)),s=0,c=0,l=0;o>=0&&o<1?(s=a,c=i):o>=1&&o<2?(s=i,c=a):o>=2&&o<3?(c=a,l=i):o>=3&&o<4?(c=i,l=a):o>=4&&o<5?(s=i,l=a):o>=5&&o<6&&(s=a,l=i);var u=n-a/2;return r(s+u,c+u,l+u)}var Zn={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var er=/^#[a-fA-F0-9]{6}$/,tr=/^#[a-fA-F0-9]{8}$/,nr=/^#[a-fA-F0-9]{3}$/,rr=/^#[a-fA-F0-9]{4}$/,or=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,ar=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,ir=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,sr=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function cr(e){if("string"!=typeof e)throw new Vn(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return Zn[t]?"#"+Zn[t]:e}(e);if(t.match(er))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(tr)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(nr))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(rr)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var o=or.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=ar.exec(t);if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=ir.exec(t);if(i){var s="rgb("+Jn(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",c=or.exec(s);if(!c)throw new Vn(4,t,s);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=sr.exec(t);if(l){var u="rgb("+Jn(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=or.exec(u);if(!d)throw new Vn(4,t,u);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])}}throw new Vn(5)}function lr(e){return function(e){var t,n=e.red/255,r=e.green/255,o=e.blue/255,a=Math.max(n,r,o),i=Math.min(n,r,o),s=(a+i)/2;if(a===i)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=a-i,l=s>.5?c/(2-a-i):c/(a+i);switch(a){case n:t=(r-o)/c+(r<o?6:0);break;case r:t=(o-n)/c+2;break;default:t=(n-r)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}}(cr(e))}var ur=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function dr(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function pr(e){return dr(Math.round(255*e))}function fr(e,t,n){return ur("#"+pr(e)+pr(t)+pr(n))}function hr(e,t,n){return Jn(e,t,n,fr)}function mr(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return hr(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return hr(e.hue,e.saturation,e.lightness);throw new Vn(1)}function gr(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?hr(e,t,n):"rgba("+Jn(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?hr(e.hue,e.saturation,e.lightness):"rgba("+Jn(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Vn(2)}function br(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return ur("#"+dr(e)+dr(t)+dr(n));if("object"==typeof e&&void 0===t&&void 0===n)return ur("#"+dr(e.red)+dr(e.green)+dr(e.blue));throw new Vn(6)}function vr(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var o=cr(e);return"rgba("+o.red+","+o.green+","+o.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?br(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?br(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Vn(7)}function yr(e){if("object"!=typeof e)throw new Vn(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return vr(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return br(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return gr(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return mr(e);throw new Vn(8)}function wr(e){return function e(t,n,r){return function(){var o=r.concat(Array.prototype.slice.call(arguments));return o.length>=n?t.apply(this,o):e(t,n,o)}}(e,e.length,[])}function Er(e,t,n){return Math.max(e,Math.min(t,n))}function xr(e,t){if("transparent"===t)return t;var n=lr(t);return yr(W({},n,{lightness:Er(0,1,n.lightness-parseFloat(e))}))}var _r=wr(xr);const Cr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return Object(Ye.b)(["animation-timing-function:ease;animation-iteration-count:1;animation-fill-mode:forwards;animation-duration:","ms;"],e)},Tr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return Object(Ye.b)(["height:0;width:0;padding:0;transition:width 0s ease ","ms,padding 0s ease ","ms,height 0s ease ","ms;"],e,e,e)},kr=Object(Ye.d)(["0%{opacity:0;transform:translateY(-10px);}100%{opacity:1;transform:translateY(0);}"]),Or=Object(Ye.d)(["0%{opacity:0;transform:translateY(10px);}100%{opacity:1;transform:translateY(0);}"]),Sr=Object(Ye.d)(["0%{opacity:0;transform:translateX(-15px);}100%{opacity:1;transform:translateX(0);}"]),Ir=Object(Ye.d)(["0%{opacity:0;transform:translateX(-15px);}100%{opacity:0.8;transform:translateX(0);}"]),Ar=Object(Ye.d)(["0%{opacity:0;transform:translateX(15px);}100%{opacity:1;transform:translateX(0);}"]),jr=Object(Ye.d)(["0%{opacity:0;transform:translateY(-100%);}100%{opacity:1;transform:translateY(0);}"]),Nr=Object(Ye.d)(["0%{opacity:0;}100%{opacity:1;}"]),Mr=Object(Ye.d)(["50%{opacity:0.5;}"]),Pr=Object(Ye.d)(["50%{opacity:0.2;}"]),Rr=Object(Ye.d)(["10%{transform:translateY(-5px);}50%{opacity:0.5;transform:translateY(0);}"]),Lr=Object(Ye.b)([""," animation-name:",""],Cr(),Nr),Dr=Object(Ye.b)([""," animation-name:",""],Cr(),kr),Br=Object(Ye.b)([""," animation-name:",""],Cr(),Or),Hr=Object(Ye.b)([""," animation-name:",""],Cr(),Sr),Ur=(Object(Ye.b)([""," animation-name:",""],Cr(),Ir),Object(Ye.b)([""," animation-name:",""],Cr(),Ar)),zr=(Object(Ye.b)([""," animation-name:",""],Cr(),jr),Object(Ye.b)(["animation:1.8s "," infinite 0.3s;"],Pr));Object(Ye.b)(["animation:1.8s "," infinite 0.3s;"],Rr);var Fr=n(34),$r=n.n(Fr),Gr=n(35),qr=n.n(Gr),Yr=n(36);const Kr={default:"'IBMPlex', 'Helvetica Neue', Helvetica, Arial, sans-serif",KindlySans:"KindlySans"},Wr=(n.n(Yr).a,qr.a,$r.a,e=>Object(Ye.b)(["margin-inline-start:",";@supports not (margin-inline-start:","){",";}"],e,e,t=>t.isTextDirectionRtl?`margin-right: ${e}`:`margin-left: ${e}`)),Vr=()=>"\n #chatContainer:not(.using-tab) & {\n outline: none;\n }\n",Xr={darkColor:"#2c2c2c",primaryColor:"#0069ff",grayColor:"#edeeef",errorColor:"#f6665e",warningColor:"#ffca3a",successColor:"#50e39b",shadowColor:"rgba(0, 0, 0, 0.15)",shadowColorDark:"rgba(0, 0, 0, 0.3)"},Qr="#333333",Jr={fontSizeSmall:"11px",fontSizeP:"14px",fontSizeH2:"26px",fontSizeH3:"22px",fontSizeH4:"19px",fontSizeH5:"16px"},Zr={tablet:"768px",phone:"500px"},eo={minTablet:`(min-width: ${Zr.tablet})`,maxTablet:`(max-width: ${Zr.tablet})`,maxPhone:`(max-width: ${Zr.phone})`,maxPhoneHeight:"(max-height: 760px)"},to="15",no="20",ro=Ye.c.a.withConfig({displayName:"utils__Link",componentId:"sc-g08yf6-0"})(["text-decoration:underline;cursor:pointer;",""],Vr),oo=Ye.c.button.withConfig({displayName:"utils__Button",componentId:"sc-g08yf6-1"})(["border:0;text-align:center;border-radius:100px;font-weight:normal;background:none;cursor:pointer;text-transform:none;transition:all 0.2s ease;",""],Vr),ao=Ye.c.div.withConfig({displayName:"utils__InputContainer",componentId:"sc-g08yf6-2"})(["overflow:",";max-height:83px;min-height:41px;height:","px;width:100%;min-width:0;@media ","{height:","px;}"],e=>{let{hasFiles:t}=e;return t?"visible":"hidden"},e=>e.active?e.targetHeight:"41",eo.maxTablet,e=>e.active?e.targetHeight:"44"),io=Object(Ye.b)(["max-height:41px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]),so=Object(Ye.b)(["position:relative;z-index:2;margin-bottom:0;color:",";font-size:",";line-height:1.5;padding:10px 16px;background:",";background-color:",";background-image:none;border:0;resize:none;box-shadow:none;border-radius:21px;max-height:83px;font-family:",";width:100%;min-height:0;transition:transform 0.3s ease;",";",";&:focus{color:",";box-shadow:none;border:none;","}@media ","{font-size:16px;",";}"],e=>e.theme.inputText,Jr.fontSizeP,e=>e.theme.inputBackground,e=>e.theme.inputBackground,Kr.default,e=>e.$hide&&"transform: translateY(-60px)",e=>!e.$active&&io,e=>e.theme.inputText,Vr,eo.maxTablet,e=>!e.$active&&"max-height: 44px;"),co=Object(Ye.b)(["position:relative;&:before{content:'';left:0;right:20px;top:-15px;z-index:1;height:20px;position:absolute;background:linear-gradient( 0deg,"," 0%,"," 25%,rgba(248,248,248,0) 100% );opacity:1;transition:opacity linear 300ms;","}"],e=>e.theme.background,e=>e.theme.background,e=>{let{inspectorOpen:t}=e;return t?"height: 0":""}),lo=Ye.c.div.withConfig({displayName:"styles__LoadingIndicatorContainer",componentId:"sc-xokaop-0"})(["position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-radius:100px;transition:all cubic-bezier(0.61,0.1,0.42,0.9) 150ms;",";",";"],e=>e.loading?"opacity: 1":"opacity: 0;",e=>e.color?`background-color: ${e.theme.buttonBackground}; background: ${e.theme.buttonBackground}`:"background-color: #fff; background: #fff"),uo=Ye.c.span.withConfig({displayName:"styles__LoadingIndicator",componentId:"sc-xokaop-1"})(["width:6px;height:6px;opacity:0;border-radius:50%;background:",";background-color:",";&:nth-of-type(1){animation:1s "," infinite 0.3s;}&:nth-of-type(2){margin:0 5px;animation:1s "," infinite 0.6s;}&:nth-of-type(3){animation:1s "," infinite 0.9s;}"],e=>e.theme.buttonText,e=>e.theme.buttonText,Mr,Mr,Mr),po=Object(Ye.b)(["min-width:190px;min-height:41px;padding:11px 20px;font-size:",";"],Jr.fontSizeP),fo=Object(Ye.b)(["color:",";background:",";background-color:",";border-color:",";"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>_r(.08,e.theme.buttonBackground)),ho=Object(Ye.b)(["color:#000;background:#d8d8d8;background-color:#d8d8d8;border-color:#d8d8d8;"]),mo=Object(Ye.b)(["position:relative;border-radius:100px;font-weight:normal;border:1px solid #dedede;background-color:#fff;background:#fff;color:",";",";display:",";box-shadow:",";justify-content:center;align-items:center;"," "," transition:all 0.2s ease;:hover{",";box-shadow:",";}:active{text-decoration:none;box-shadow:none;}"],Qr,e=>e.loading?"opacity: 0.6":"opacity: 1;",e=>{let{hasChild:t}=e;return t?"flex":"block"},e=>{let{flat:t,disabled:n}=e;return t||n?"none":"0 2px 4px 0 rgba(0, 0, 0, 0.08)"},e=>e.selected&&ho,e=>{let{color:t}=e;return t&&fo},e=>{let{color:t}=e;return t?fo:"background-color: #fff; background: #fff"},e=>{let{disabled:t,flat:n}=e;return t||n?"none":`0 2px 4px 0 ${Xr.shadowColorDark}`}),go=Object(Ye.c)(oo).withConfig({displayName:"styles__ButtonContainer",componentId:"sc-xokaop-2"})(["",";",";font-family:",";"],mo,po,e=>{let{theme:t}=e;return t.customFont?t.customFont:Kr.default}),bo=e=>{let{loading:t,color:n,flat:r}=e;return c.a.createElement(lo,{flat:r,color:n?1:0,loading:t?1:0},c.a.createElement(uo,null),c.a.createElement(uo,null),c.a.createElement(uo,null))},vo=c.a.forwardRef((e,t)=>{let{children:n,loading:r,type:o,color:a,selected:i,onClick:s,text:l,flat:u,shape:d,disabled:p,style:f,cy:h}=e;return c.a.createElement(go,{color:a?1:0,style:f,flat:u,type:o,shape:d,tabIndex:"0",hasChild:n,onClick:s,disabled:p,loading:r?1:0,selected:i,"data-cy":h,ref:t},n||l,c.a.createElement(bo,{flat:u,color:a,loading:r}))});vo.defaultProps={type:"button",color:!1,selected:!1,loading:!1,shape:"oval",flat:!1,disabled:!1,onClick:$n},vo.displayName="Button";var yo=vo;const wo=Ye.c.p.withConfig({displayName:"typography__Paragraph",componentId:"sc-ifap29-0"})(["color:",";font-size:",";font-weight:normal;line-height:170%;font-family:",";"],Xr.darkColor,Jr.fontSizeP,Kr.default),Eo=Object(Ye.c)(wo).withConfig({displayName:"typography__SmallParagraph",componentId:"sc-ifap29-1"})(["font-size:",";opacity:0.6;"],Jr.fontSizeSmall),xo=Ye.c.h2.withConfig({displayName:"typography__H2",componentId:"sc-ifap29-2"})(["color:",";font-size:",";font-weight:normal;margin:0 0 30px;line-height:30px;font-family:",";"],Xr.darkColor,Jr.fontSizeH2,Kr.default),_o=Ye.c.h3.withConfig({displayName:"typography__H3",componentId:"sc-ifap29-3"})(["color:",";font-size:",";font-weight:normal;line-height:30px;margin:0 0 15px;font-family:",";"],Xr.darkColor,Jr.fontSizeH3,Kr.default),Co=Ye.c.h4.withConfig({displayName:"typography__H4",componentId:"sc-ifap29-4"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;font-family:",";"],Xr.darkColor,Jr.fontSizeH4,Kr.default),To=Ye.c.h5.withConfig({displayName:"typography__H5",componentId:"sc-ifap29-5"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;line-height:24px;font-family:",";"],Xr.darkColor,Jr.fontSizeH5,Kr.default),ko=(Ye.c.h6.withConfig({displayName:"typography__H6",componentId:"sc-ifap29-6"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;font-family:",";"],Xr.darkColor,Jr.fontSizeBase,Kr.default),Ye.c.span.withConfig({displayName:"typography__KindlySpan",componentId:"sc-ifap29-7"})(["color:",";font-family:",";opacity:1;a{color:",";text-decoration:none;:hover,:focus,:active,:visited{color:",";}}"],Xr.primaryColor,Kr.KindlySans,Xr.primaryColor,Xr.primaryColor)),Oo=Ye.c.div.withConfig({displayName:"styles__Heading",componentId:"sc-155a8qj-0"})(["display:flex;align-items:center;"]),So=Object(Ye.c)(Oo).withConfig({displayName:"styles__HeaderContainer",componentId:"sc-155a8qj-1"})(["height:55px;min-height:55px;text-align:left;padding:15px;align-items:center;color:#fff;min-width:100%;z-index:",";justify-content:space-between;background:",";background-color:",";box-shadow:0 3px 4px -1px ",";"],to,e=>e.theme.headerBackground,e=>e.theme.headerBackground,Xr.shadowColor),Io=Object(Ye.c)(Oo).withConfig({displayName:"styles__HeadingLeft",componentId:"sc-155a8qj-2"})(["overflow:hidden;"]),Ao=Object(Ye.c)(Oo).withConfig({displayName:"styles__HeadingRight",componentId:"sc-155a8qj-3"})(["align-items:center;"]),jo=Object(Ye.c)(Co).withConfig({displayName:"styles__BotName",componentId:"sc-155a8qj-4"})(["margin:0;",";text-transform:none;letter-spacing:normal;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:1.3;color:",";"],Wr("20px"),e=>e.theme.headerText),No=Object(Ye.c)(oo).withConfig({displayName:"styles__HeaderButton",componentId:"sc-155a8qj-5"})(["min-height:25px;display:flex;align-items:center;font-size:",";padding:0;background:#fff;background-color:#fff;svg{path{stroke:",";}}:hover{opacity:0.8;}~ button{",";}"],Jr.fontSizeH4,e=>e.theme.buttonBackground,Wr("15px")),Mo=Ye.c.div.withConfig({displayName:"styles__StyledAvatar",componentId:"sc-155a8qj-6"})(["border-radius:100px;display:inline-block;width:30px;height:30px;background-image:url(",");background-size:contain;background-repeat:no-repeat;background-position:center;"],e=>e.avatar),Po=Object(Ye.b)(["border-radius:100px;background-color:",";"],Xr.grayColor),Ro=Ye.c.div.withConfig({displayName:"styles__ErrorContent",componentId:"sc-1lhoync-0"})(["height:100%;width:100%;display:grid;background-color:#fff;grid-template-rows:55px 1fr 70px;"]),Lo=Ye.c.div.withConfig({displayName:"styles__ErrorHeader",componentId:"sc-1lhoync-1"})(["padding:10px 20px;display:grid;align-items:center;grid-template-columns:30px 1fr 40px;box-shadow:0px 3px 4px -1px ",";"],Xr.shadowColor),Do=Ye.c.div.withConfig({displayName:"styles__ErrorName",componentId:"sc-1lhoync-2"})(["height:20px;width:110px;margin-left:20px;",""],Po),Bo=Ye.c.div.withConfig({displayName:"styles__ErrorContainer",componentId:"sc-1lhoync-3"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;width:210px;margin:auto;"]),Ho=Ye.c.span.withConfig({displayName:"styles__ErrorText",componentId:"sc-1lhoync-4"})(["font-size:14px;margin:16px 0 24px 0;",";"],e=>e.heading&&"font-size: 19px; font-weight: 400; \n margin: 0"),Uo=Ye.c.div.withConfig({displayName:"styles__ErrorCircle",componentId:"sc-1lhoync-5"})(["height:","px;min-width:","px;",""],e=>e.size,e=>e.size,Po),zo=Ye.c.div.withConfig({displayName:"styles__ErrorComposer",componentId:"sc-1lhoync-6"})(["display:flex;align-items:center;padding:15px 0;margin:0 20px;border-top:1px solid ",";"],Xr.grayColor),Fo=Ye.c.div.withConfig({displayName:"styles__ErrorInput",componentId:"sc-1lhoync-7"})(["height:40px;width:100%;margin-right:20px;",""],Po);var $o=()=>{const e=Ue(),t=Object(s.useCallback)(()=>{e(Xt())},[e]);return c.a.createElement(Ro,null,c.a.createElement(Lo,null,c.a.createElement(Uo,{size:30}),c.a.createElement(Do,null),c.a.createElement(No,{"aria-label":"Close chat",title:"Close chat",type:"button",onClick:t,"data-cy":"close-chat-button"},c.a.createElement(jn,{width:25,height:25}))),c.a.createElement(Bo,null,c.a.createElement(Ho,{heading:!0},"Oh no..."),c.a.createElement(Ho,null,"We were unable to load the chat. Please refresh or try again later."),c.a.createElement(yo,{onClick:t,color:!0},"Refresh chat")),c.a.createElement(zo,null,c.a.createElement(Fo,null),c.a.createElement(Uo,{size:40})))};class Go extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return e?{hasError:!0}:{}}componentDidCatch(e,t){var n;const{dispatch:r,errorPoint:o}=this.props,a=`Component tree crashed ${o}: ${e.message}`,i={errorName:e.name,errorMessage:e.message,errorStack:e.stack,point:o,componentStack:null==t||null===(n=t.componentStack)||void 0===n?void 0:n.trim()};r(yt({message:a,error:e,extra:i,level:"error"}))}render(){const{hasError:e}=this.state,{children:t,displayError:n}=this.props;return e&&n?c.a.createElement($o,null):e?null:t}}Go.defaultProps={displayError:!0};var qo=Re()(Go);const Yo=e=>{let{agent:t}=e;return t},Ko=e=>{let{alerts:t}=e;return t},Wo=e=>{let{announcement:t}=e;return t},Vo=e=>{let{bot:t}=e;return t},Xo=e=>{let{chatbubble:t}=e;return t},Qo=e=>{let{connection:t}=e;return t},Jo=e=>{let{environment:t}=e;return t},Zo=e=>{let{inspector:t}=e;return t},ea=e=>{let{feedback:t}=e;return t},ta=e=>{let{maintenanceAlert:t}=e;return t},na=e=>{let{messages:t}=e;return t},ra=e=>{let{privacy:t}=e;return t},oa=e=>{let{pushMessages:t}=e;return t},aa=e=>{let{lightBox:t}=e;return t},ia=e=>{let{nudge:t}=e;return t},sa=Object(Ye.b)(["display:flex;overflow:hidden;z-index:-1;min-width:125px;height:45px;"]),ca=Ye.c.div.withConfig({displayName:"styles__ToolsContainer",componentId:"sc-vkneg1-0"})(["z-index:0;width:15px;border-radius:7px;min-width:80px;margin-right:-25px;background:#fff;background-color:#fff;position:absolute;right:50px;box-shadow:0px 1px 5px 0px ",";transition:all 0.2s ease;",";",";"],Xr.shadowColorDark,e=>{let{hasInspector:t}=e;return t&&sa},e=>{let{active:t}=e;return!t&&"min-width: 0"}),la=Ye.c.div.withConfig({displayName:"styles__LanguageContainer",componentId:"sc-vkneg1-1"})(["padding:2px;border-radius:7px;background:#fff;background-color:#fff;box-shadow:0px 1px 5px 0px ",";right:110px;display:flex;position:absolute;min-width:max-content;justify-content:center;",";"],Xr.shadowColorDark,Ur),ua=Object(Ye.c)(ro).withConfig({displayName:"styles__LanguageText",componentId:"sc-vkneg1-2"})(["color:#757575;margin:0;cursor:pointer;font-size:12px;font-weight:500;text-decoration:none;:hover{text-decoration:underline;}"]),da=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-vkneg1-3"})(["display:flex;padding:2px;align-items:center;justify-content:space-between;"]),pa=Object(Ye.c)(oo).withConfig({displayName:"styles__ToolButton",componentId:"sc-vkneg1-4"})(["display:flex;position:relative;align-items:center;padding:13px;border-radius:7px;transition:all 0.15s ease;:hover{background:#",";background-color:#",";svg path{fill:#000;}:after{border-left-color:#000;}}"," ",""],Xr.grayColor,Xr.grayColor,e=>e.active&&`\n background: #${Xr.grayColor};\n background-color: #${Xr.grayColor};\n svg path {\n fill: #000;\n }\n `,e=>e.tail&&`\n :after {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n right: 5px;\n bottom: 3px;\n border-top: 3px solid transparent;\n border-bottom: 3px solid transparent;\n border-left: 3px solid ${e.active?"#000":Xr.primaryColor};\n transform: rotate(45deg);\n }`);var fa=(e,t)=>{const n=Object(s.useRef)();return Object(s.useCallback)(r=>{new Date-n.current<t||(e(r),n.current=new Date)},[t,e])};var ha=e=>{let{active:t}=e;const[n,r]=Object(s.useState)(!1),{botKey:o,admin:a}=Ge(Xo),{languages:i}=Ge(Vo),{inspectorOpen:l}=Ge(Zo),u=Ue(),d=Object(s.useCallback)(()=>{u({type:"TOGGLE_INSPECTOR"})},[u]);return function(){var e,t;const n=Ue(),{admin:r}=Ge(Xo),{chatMessages:o}=Ge(na)||[],a=null===(e=o.filter(e=>!(null!=e&&e.from_bot)).slice(-1))||void 0===e||null===(t=e[0])||void 0===t?void 0:t.message,i=fa(e=>{n(pn(e))},1e3),c=Object(s.useCallback)(e=>{e.altKey&&"KeyR"===e.code&&a&&i(a)},[a,i]);Object(s.useEffect)(()=>{if(r)return window.addEventListener("keydown",c,!0),()=>window.removeEventListener("keydown",c,!0)},[c,r])}(),c.a.createElement(c.a.Fragment,null,n&&t&&c.a.createElement(la,null,i.map(e=>c.a.createElement(pa,{key:e.code,title:`Restart ${e.name}`,onClick:()=>{return t=e.code,u(Vt(t)),void r(!1);var t}},c.a.createElement(ua,null,e.code.toUpperCase())))),c.a.createElement(ca,{active:t,hasInspector:a},a&&c.a.createElement(da,null,c.a.createElement(pa,{onClick:d,title:l?"Close chat inspector":"Open chat inspector"},l?c.a.createElement(Mn,null):c.a.createElement(Nn,null))),c.a.createElement(da,null,c.a.createElement(pa,{title:"Restart chat",onClick:()=>{i.length>1?r(!n):u(ut(o,!0))},active:n,tail:i.length>1},c.a.createElement(Bn,{width:15,height:15})))))};function ma(e){const[t,n]=Object(s.useState)(!1);return[t,Object(s.useCallback)(t=>{n(!0),e(t)},[e])]}i.a.shape({chat_deleted_header:i.a.string,chat_deleted_text:i.a.string,back_to_chat_button:i.a.string,delete_text:i.a.string,delete_button:i.a.string,binary_headline:i.a.string,binary_1:i.a.string,binary_0:i.a.string,emoji_guideline:i.a.string,emoji_headline:i.a.string,freeform_description:i.a.string,freeform_placeholder:i.a.string,send:i.a.string});const ga=Ye.c.div.withConfig({displayName:"styles__NudgeContainer",componentId:"sc-1k0o2t4-0"})(["right:20px;bottom:",";z-index:10;position:fixed;border-radius:14px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";",";",";@media ","{",";z-index:16;box-shadow:0 -3px 15px 1px ",";}"],e=>{let{bubbleHidden:t}=e;return t?"30px":"100px"},Xr.shadowColor,Ur,e=>{let{theme:t}=e;return t.customFont&&`font-family: ${t.customFont}`},eo.maxPhone,e=>{let{modal:t}=e;return!t&&"\n left: 0px;\n right: 0px;\n bottom: 0px;\n border-radius: 14px 14px 0 0;"},Xr.shadowColor),ba=Ye.c.div.withConfig({displayName:"styles__NudgeInner",componentId:"sc-1k0o2t4-1"})(["position:relative;padding:0px;max-width:380px;width:100%;max-height:calc(100vh - 150px);overflow-y:auto;",";@media ","{min-width:380px;}@media ","{min-width:100%;}"],e=>{let{modal:t}=e;return t&&"box-sizing: border-box"},eo.minTablet,eo.maxPhone),va=Object(Ye.c)(oo).withConfig({displayName:"styles__NudgeDismiss",componentId:"sc-1k0o2t4-2"})(["top:8px;right:8px;z-index:15;display:flex;padding:0;border-radius:100px;position:absolute;&:hover{opacity:0.8;}svg path{stroke:",";}@media ","{",";}"],e=>{let{theme:t}=e;return t.buttonBackground||t.bubbleButtonBackground},eo.maxPhone,e=>{let{modal:t}=e;return t?"top: 2px; right: 0;":"top: 8px; right: 8px;"}),ya=Ye.c.div.withConfig({displayName:"styles__BorderElement",componentId:"sc-1k0o2t4-3"})(["position:absolute;background:#fff;width:100%;height:100%;left:0;right:0;top:0;bottom:0;border-radius:14px;@media ","{border-radius:",";}&:before{content:'';width:50px;height:calc(100% - 8px);background:",";position:absolute;z-index:-1;top:4px;left:-4px;border-radius:25px;@media ","{width:calc(100% - 8px);height:50px;top:-4px;left:4px;}}"],eo.maxPhone,e=>{let{modal:t}=e;return t?"14px":"14px 14px 0 0"},e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground},eo.maxPhone),wa="cubic-bezier(0.18, 0.58, 0.37, 0.92)",Ea=Object(Ye.c)(va).withConfig({displayName:"styles__NudgeFeedbackDismiss",componentId:"sc-mc1kkw-0"})([""]),xa=Object(Ye.c)(ya).withConfig({displayName:"styles__NudgeFeedbackBorderElement",componentId:"sc-mc1kkw-1"})([""]),_a=Object(Ye.c)(ga).withConfig({displayName:"styles__NudgeFeedbackContainer",componentId:"sc-mc1kkw-2"})(["z-index:20;",";@media ","{z-index:20;}"],e=>{let{modal:t}=e;return t&&"\n right: unset;\n bottom: unset;\n "},eo.maxPhone),Ca=Object(Ye.c)(ba).withConfig({displayName:"styles__NudgeFeedbackInner",componentId:"sc-mc1kkw-3"})(["min-width:380px;padding:0 20px;@media ","{padding:0 24px;}"],eo.maxPhone),Ta=(Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-mc1kkw-4"})(["margin:24px;"]),Ye.c.h2.withConfig({displayName:"styles__Title",componentId:"sc-mc1kkw-5"})(["font-size:16px;font-weight:500;line-height:26px;margin:0 0 16px 0;"])),ka=Ye.c.p.withConfig({displayName:"styles__Description",componentId:"sc-mc1kkw-6"})(["line-height:22px;"]),Oa=(Ye.c.a.withConfig({displayName:"styles__Link",componentId:"sc-mc1kkw-7"})(["line-height:22px;margin:0 0 16px 0;color:#0069ff;"]),Ye.c.div.withConfig({displayName:"styles__FeedbackContainer",componentId:"sc-mc1kkw-8"})(["border-radius:14px;overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:24px 0;opacity:0;",";transition:opacity 0.15s linear 0.2s,transform "," 300ms;"],e=>e.hasEntered&&"opacity: 1",wa)),Sa=Ye.c.div.withConfig({displayName:"styles__FeedbackFormContent",componentId:"sc-mc1kkw-9"})(["text-align:center;width:100%;"," ",""],e=>e.ratingSent&&`transition: all ${wa} 300ms;`,e=>e.finished&&"z-index: 11; position: relative; opacity: 0;"),Ia=Ye.c.div.withConfig({displayName:"styles__FeedbackThanksContainer",componentId:"sc-mc1kkw-10"})(["opacity:0;margin-top:16px;text-align:center;transition:all "," 300ms;",""],wa,e=>{let{finished:t}=e;return t&&"opacity: 1;"}),Aa=Ye.c.div.withConfig({displayName:"styles__FeedbackStepContainer",componentId:"sc-mc1kkw-11"})(["width:100%;opacity:1;transition:all "," 300ms;",""],wa,e=>{let{hasRated:t}=e;return t&&"display: none;"}),ja=Ye.c.div.withConfig({displayName:"styles__FeedbackEmojiContainer",componentId:"sc-mc1kkw-12"})(["height:fit-content;min-height:35px;cursor:pointer;margin:0 0 16px 0;transition:all ease 300ms;",";"],e=>e.hovering&&"\n .emoji.chosen {\n opacity: 1;\n }\n .emoji:not(.chosen) {\n opacity: 0.4;\n }\n "),Na=Ye.c.span.withConfig({displayName:"styles__StyledEmoji",componentId:"sc-mc1kkw-13"})(["display:inline-block;margin:0 10px;transition:opacity 0.1s linear;background:none;border:none;padding:0;cursor:pointer;"]),Ma=Object(Ye.c)(Ta).withConfig({displayName:"styles__Title",componentId:"sc-1qibng2-0"})([""]),Pa=Object(Ye.c)(Aa).withConfig({displayName:"styles__StepContainer",componentId:"sc-1qibng2-1"})([""]),Ra=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1qibng2-2"})(["display:flex;justify-content:center;margin-top:30px;button{width:70px;min-width:auto;margin:0 15px;}"]);var La=e=>{let{submit:t,textContent:n}=e;const[r,o]=ma(t),{binary_headline:a,binary_1:i,binary_0:s}=n;return c.a.createElement(Pa,{hasRated:r},c.a.createElement(Ma,null,a),c.a.createElement(Ra,null,c.a.createElement(yo,{type:"submit",onClick:()=>o(2),color:!0,flat:!0,text:i}),c.a.createElement(yo,{type:"submit",onClick:()=>o(1),color:!0,flat:!0,text:s})))},Da=n(37),Ba=n.n(Da),Ha=n(38),Ua=n.n(Ha),za=n(39),Fa=n.n(za);const $a=Object(Ye.c)(Ta).withConfig({displayName:"styles__Title",componentId:"sc-1krelmc-0"})([""]),Ga=Object(Ye.c)(ka).withConfig({displayName:"styles__Description",componentId:"sc-1krelmc-1"})([""]),qa=Object(Ye.c)(Aa).withConfig({displayName:"styles__StepContainer",componentId:"sc-1krelmc-2"})([""]),Ya=Object(Ye.c)(ja).withConfig({displayName:"styles__EmojiContainer",componentId:"sc-1krelmc-3"})([""]),Ka=Object(Ye.c)(Na).withConfig({displayName:"styles__Emoji",componentId:"sc-1krelmc-4"})([""]),Wa=Ye.c.img.withConfig({displayName:"styles__EmojiImage",componentId:"sc-1krelmc-5"})(["height:35px;width:35px;"]),Va={1:{src:Fa.a,description:"sad face"},2:{src:Ua.a,description:"neutral face"},3:{src:Ba.a,description:"happy face"}},Xa=e=>{let{number:t,selected:n,setTentativeRating:r,setRating:o}=e;const a=n===t,{src:i,description:s}=Va[t];return c.a.createElement(Ka,{className:`emoji ${a?"chosen":""}`,onFocus:()=>r(t),onBlur:()=>r(0),onMouseEnter:()=>r(t),onMouseLeave:()=>r(0),role:"radio",tabIndex:"0","aria-checked":n,"aria-label":s,onKeyPress:e=>{"Enter"===e.key&&(o(t),e.preventDefault(),e.stopPropagation())},onClick:()=>o(t)},c.a.createElement(Wa,{src:i,alt:`${s} emoji`}))};var Qa=e=>{let{submit:t,textContent:n}=e;const[r,o]=Object(s.useState)(!1),[a,i]=Object(s.useState)(0),[l,u]=ma(t),{emoji_guideline:d,emoji_headline:p}=n;return c.a.createElement(qa,{hasRated:l},c.a.createElement($a,null,p),c.a.createElement(Ya,{hovering:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1)},[1,2,3].map(e=>c.a.createElement(Xa,{key:`chat-feedback-emoji-${e}`,number:e,selected:a,setTentativeRating:i,setRating:u}))),c.a.createElement(Ga,null,d))};const Ja=Object(Ye.c)(Ta).withConfig({displayName:"styles__Title",componentId:"sc-r8xh7-0"})([""]),Za=Object(Ye.c)(Aa).withConfig({displayName:"styles__StepContainer",componentId:"sc-r8xh7-1"})([""]),ei=Ye.c.a.withConfig({displayName:"styles__LinkButton",componentId:"sc-r8xh7-2"})([""," text-decoration:none;font-size:15px;width:fit-content;margin:0 auto;padding:11px 20px;font-weight:500;"],mo);var ti=e=>{let{textContent:t}=e;const{external_link_headline:n,external_link_text:r,external_link_url:o}=t,a=Ue(),i=Object(s.useCallback)(()=>a(Xt()),[a]);return c.a.createElement(Za,{hasRated:!1},n&&r&&c.a.createElement(Ja,null,n),c.a.createElement(ei,{href:o,onClick:i,target:"_blank",rel:"noopener noreferrer",color:!0},r||n))};var ni=()=>c.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},c.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#97cd72"}),c.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("path",{d:"M138.82,131.5a8.33,8.33,0,0,0-3.8.33c-8,2.78-20.62,4.58-34.91,4.58s-27-1.81-34.94-4.59c-.81-.2-3.45-.79-4.35-.15-.51.36-.2.8.25,1.16,7.16,4.38,21.93,8.77,39,8.77s31.74-4.36,39-8.71C139.53,132.44,140,131.78,138.82,131.5Z",fill:"#231e20"}));var ri=()=>c.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},c.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#f47d7f"}),c.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("path",{d:"M138.82,141.47a8.33,8.33,0,0,1-3.8-.32c-8-2.78-20.62-4.58-34.91-4.58s-27,1.8-34.94,4.59c-.81.2-3.45.79-4.35.15-.51-.37-.2-.81.25-1.17,7.16-4.37,21.93-8.76,39-8.76s31.74,4.36,39,8.7C139.53,140.54,140,141.2,138.82,141.47Z",fill:"#231e20"}));var oi=()=>c.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},c.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#00a24a"}),c.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("path",{d:"M138.82,119.86c-1.26-1-2.94.14-3.8,1.08-8,9.27-20.62,15.28-34.91,15.28s-27-6-34.94-15.31c-.62-.8-3.05-2.42-4.35-.51-.93,1.38-.26,2.56.25,3.89,7.16,14.6,21.93,29.25,39,29.25s31.74-14.55,39-29C140.23,121.81,140,120.78,138.82,119.86Z",fill:"#231e20"}));var ai=()=>c.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},c.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#ee2324"}),c.a.createElement("path",{d:"M138.78,153.13c-1.25,1-2.94-.13-3.8-1.08-7.95-9.27-20.62-15.28-34.9-15.28s-27,6-34.95,15.32c-.61.79-3,2.42-4.34.5-.94-1.38-.27-2.55.24-3.88C68.2,134.1,83,119.45,100.08,119.45S131.82,134,139,148.5C140.2,151.18,139.92,152.21,138.78,153.13Z",fill:"#231e20"}),c.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),c.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}));const ii=Object(Ye.c)(Ta).withConfig({displayName:"styles__Title",componentId:"sc-1wxcq1r-0"})([""]),si=Object(Ye.c)(ka).withConfig({displayName:"styles__Description",componentId:"sc-1wxcq1r-1"})([""]),ci=Object(Ye.c)(Aa).withConfig({displayName:"styles__StepContainer",componentId:"sc-1wxcq1r-2"})([""]),li=Object(Ye.c)(ja).withConfig({displayName:"styles__EmojiContainer",componentId:"sc-1wxcq1r-3"})([""]),ui=Object(Ye.c)(Na).withConfig({displayName:"styles__Emoji",componentId:"sc-1wxcq1r-4"})(["width:37px;margin:0 4px;"]),di={1:{Component:ai,description:"very unhappy"},2:{Component:ri,description:"unhappy"},3:{Component:ni,description:"happy"},4:{Component:oi,description:"very happy"}},pi=e=>{let{number:t,selected:n,setTentativeRating:r,setRating:o}=e;const a=n===t,{Component:i,description:s}=di[t];return c.a.createElement(ui,{className:`emoji ${a?"chosen":""}`,onFocus:()=>r(t),onBlur:()=>r(0),onMouseEnter:()=>r(t),onMouseLeave:()=>r(0),role:"radio",tabIndex:"0","aria-checked":n,"aria-label":s,onKeyPress:e=>{"Enter"===e.key&&(o(t),e.preventDefault(),e.stopPropagation())},onClick:()=>o(t)},c.a.createElement(i,{alt:`${s} emoji`}))};var fi=e=>{let{submit:t,textContent:n}=e;const[r,o]=Object(s.useState)(!1),[a,i]=Object(s.useState)(0),[l,u]=ma(t),{emoji_guideline:d,emoji_headline:p}=n;return c.a.createElement(ci,{hasRated:l},c.a.createElement(ii,null,p),c.a.createElement(li,{hovering:r,onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1)},[4,3,2,1].map(e=>c.a.createElement(pi,{key:`chat-feedback-happy-or-not-${e}`,number:e,selected:a,setTentativeRating:i,setRating:u}))),c.a.createElement(si,null,d))};Object(Ye.c)(Ta).withConfig({displayName:"styles__Title",componentId:"sc-1jtf9kh-0"})([""]);const hi=Object(Ye.c)(ka).withConfig({displayName:"styles__Description",componentId:"sc-1jtf9kh-1"})([""]),mi=Object(Ye.c)(Aa).withConfig({displayName:"styles__FreeformContainer",componentId:"sc-1jtf9kh-2"})(["z-index:11;opacity:0;visibility:hidden;display:flex;flex-direction:column;justify-content:center;align-items:center;",";",""],e=>{let{hasEntered:t}=e;return t&&"\n opacity: 1;\nvisibility: visible;"},e=>{let{finished:t}=e;return t&&"display: none;"}),gi=Ye.c.textarea.withConfig({displayName:"styles__FreeformTextarea",componentId:"sc-1jtf9kh-3"})(["resize:none;width:100%;min-height:100px;max-width:250px;padding:6px 10px;background:",";font-size:14px;margin-bottom:30px;line-height:22px;color:#2c2c2c;font-family:Open sans,Helvetica Neue,Helvetica,Arial,sans-serif !important;border:1px solid #dedede;border-radius:6px;z-index:10;@media ","{font-size:16px;}"," &:hover,&:focus{color:#2c2c2c;border:1px solid #dedede;}"],Xr.grayColor,eo.maxTablet,Vr);var bi=e=>{let{submit:t,textContent:n,finished:r}=e;const[o,a]=Object(s.useState)(!1),[i,l]=Object(s.useState)(""),{freeform_description:u,freeform_placeholder:d,send:p}=n;Object(s.useEffect)(()=>{a(!0)},[]);const f=Object(s.useCallback)(e=>{"Enter"===e.key&&t(i)},[i,t]),h=Object(s.useCallback)(e=>{l(e.target.value)},[]);return c.a.createElement(mi,{hasEntered:o,finished:r},c.a.createElement(hi,null,u),c.a.createElement(gi,{"data-cy":"feedback-freefrom-textarea",rows:4,value:i,onChange:h,placeholder:d}),c.a.createElement(yo,{color:!0,flat:!0,text:p,type:"submit",onClick:()=>t(i),onKeyDown:f}))},vi=()=>{const{languages:e,includeDisabledLanguages:t}=Ge(Vo),n=e.filter(e=>{let{active:t}=e;return t}),r=n[0];return t?{languages:e,defaultLanguage:r}:{languages:n,defaultLanguage:r}},yi=(e,t,n)=>e?e[t||n]||e.en:null;const wi=Ye.c.div.withConfig({displayName:"styles__Wrapper",componentId:"sc-17jofst-0"})(["background:",";position:",";width:",";height:",";top:58px;left:0;z-index:",";display:flex;justify-content:center;align-items:center;font-family:",";"],e=>{let{modal:t,theme:n}=e;return t?n.background:"none"},e=>{let{modal:t}=e;return t?"fixed":"unset"},e=>{let{modal:t}=e;return t?"100%":0},e=>{let{modal:t}=e;return t?"100%":0},e=>{let{zIndex:t}=e;return`${t+10}`},Kr.default);var Ei=e=>{let{children:t,modal:n,zIndex:r}=e;return c.a.createElement(wi,{modal:n,zIndex:r},t)};const xi=()=>{const[e,t]=Object(s.useState)(!1),[n,r]=Object(s.useState)(!1),[o,a]=Object(s.useState)(!1),{show:i}=Ge(ia),{currentLanguage:d}=Ge(Xo),{fullscreenMode:p,zIndex:f}=Ge(Vo),{feedbackForm:h,feedbackForm:{freeform_enabled:m},feedbackFormType:g}=Ge(Vo),b=Ue(),{defaultLanguage:v}=vi(),y=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"freeform_enabled"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:yi(a,t,n)}},{}))(h,d,v);Object(s.useEffect)(()=>{a(!0)},[]);const w=Object(s.useCallback)(()=>{b((e,t)=>{var n;e({type:"CLOSE_FEEDBACK_FORM"}),null!==(n=t().chatbubble)&&void 0!==n&&n.active&&e({type:"CLOSE_CHATBUBBLE"})})},[b]),E=Object(s.useCallback)(()=>{t(!0),setTimeout(()=>b((e,t)=>{var n;e({type:"CLOSE_FEEDBACK_FORM"}),null!==(n=t().chatbubble)&&void 0!==n&&n.active&&e({type:"CLOSE_CHATBUBBLE"})}),2e3)},[b]),x=Object(s.useCallback)(e=>{b((e=>(t,n)=>{const{bot:{feedbackFormType:r},feedback:{token:o},environment:{PAT_HOST:a}}=n(),i={feedback_type:r,rating:e};t(bt({method:"post",url:`${a}/chatbubble/${l.a}/feedback`,data:{feedback:i},...st({token:o})}))})(e)),m?r(!0):E()},[E,b,m]),_=Object(s.useCallback)(e=>{b((e=>(t,n)=>{const{feedback:{token:r},environment:{PAT_HOST:o}}=n();t(bt({method:"patch",url:`${o}/chatbubble/${l.a}/feedback`,data:{freeform_text:e},...st({token:r})}))})(e)),E()},[E,b]);let C;switch(g){case u.BINARY:C=La;break;case u.EMOJIS:C=Qa;break;case u.HAPPY_OR_NOT:C=fi;break;case u.EXTERNAL_LINK:C=ti;break;default:console.error(`Feedback form type '${g}' not recognized`),C=()=>null}return c.a.createElement(Ei,{modal:p,zIndex:f},c.a.createElement(_a,{"aria-hidden":i&&!p?"false":"true",modal:p,"data-cy":"feedback-nudge-container"},c.a.createElement(xa,{modal:p}),c.a.createElement(Ea,{"aria-label":"Dismiss feedback",title:"Dismiss feedback",onClick:w,type:"button",modal:p},c.a.createElement(jn,{width:25,height:25})),c.a.createElement(Ca,{modal:p},c.a.createElement(Oa,{hasEntered:o,finished:e},c.a.createElement(Sa,{finished:e,ratingSent:n},c.a.createElement(C,{textContent:y,submit:x}),n&&c.a.createElement(bi,{textContent:y,submit:_,finished:e})),e&&c.a.createElement(Ia,{finished:e},c.a.createElement(Ta,null,y.thanks))))))};xi.defaultProps={feedbackFormType:u.EMOJIS,textContent:{},sendFeedback:$n};var _i=xi;const Ci=Ye.c.div.withConfig({displayName:"styles__NudgeBackdropContainer",componentId:"sc-1tcv57c-0"})(["display:block;top:-100vh;left:-100vw;height:200vh;width:200vw;position:fixed;cursor:pointer;transition:all ease 1200ms;background:",";opacity:",";z-index:",";"],e=>{let{backdrop:t}=e;return t.color||"#000"},e=>{let{backdrop:t}=e;return t.opacity||.5},e=>{let{backdrop:t}=e;return t.zIndex||-1});var Ti=e=>{let{backdrop:t,onClick:n}=e;return c.a.createElement(Ci,{onClick:n,backdrop:t})},ki=(e,t,n)=>Object.entries(e).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:"string"==typeof a?a:yi(a,t,n)}},{});function Oi(){const{nudges:e}=Ge(Vo);return Object(s.useMemo)(()=>{var t,n,r,o,a;return[...null!==(t=null==e?void 0:e.form_nudges)&&void 0!==t?t:[],...null!==(n=null==e?void 0:e.custom_nudges)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.product_nudges)&&void 0!==r?r:[],...null!==(o=null==e?void 0:e.text_nudges)&&void 0!==o?o:[],...null!==(a=null==e?void 0:e.multiple_choice_nudges)&&void 0!==a?a:[]]},[e])}var Si=e=>{let{slug:t}=e;const[n,r]=Object(s.useState)({}),[o,a]=Object(s.useState)(!0),{defaultLanguage:i}=vi(),c=Oi(),{currentLanguage:l}=Ge(Xo);return Object(s.useEffect)(()=>{let e={};const n=c.find(e=>e.slug===t);var o;n&&t&&(null!=n&&n.text_blocks?n.text_blocks.map(t=>{const n=ki(t,l,i);e[t.slug]=n.value}):e=ki(n,l,i),a(Boolean(null==n||null===(o=n.text_blocks)||void 0===o?void 0:o.length)),r(e))},[c,l,i,t]),{textContent:n,hasTextContent:o}};var Ii=()=>{const{defaultLanguage:e}=vi(),t=window.kindlyChat.APIRoot,n=Object(s.useRef)(t),{content:r,slug:o,onRendered:a}=Ge(ia),{currentLanguage:i}=Ge(Xo),{textContent:l,hasTextContent:u}=Si({slug:o});return Object(s.useEffect)(()=>{if(document.getElementById("kindly-custom-nudge"))return;const e="function"==typeof r?r(l):r;if(u&&0===Object.keys(l).length)return;const t=document.createElement("div");t.innerHTML=e,n.current.appendChild(t),t.setAttribute("id","kindly-custom-nudge"),"function"==typeof a&&a(t)},[r,i,e,o,l,a,u]),c.a.createElement(c.a.Fragment,null)};const Ai=Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-7kvqgr-0"})(["margin:24px;"]);var ji=e=>{let{html:t,slug:n}=e;const{textContent:r}=Si({slug:n});return c.a.createElement(Ai,null,c.a.createElement("div",{dangerouslySetInnerHTML:{__html:"function"==typeof t?t(r):t}}))},Ni=e=>{const t=(null!=e?e:"").toLowerCase();return"external_link"===t?"link":"handover_request"===t?"takeover_request":t};i.a.shape({button_type:i.a.oneOf([...Object.values(b),...Object.values(b).map(Ni)]).isRequired,is_active:i.a.bool,label:i.a.string.isRequired,value:i.a.string,new_context:i.a.object,index:i.a.number,language_code:i.a.string}),i.a.shape({success:i.a.string,error:i.a.string,input:i.a.shape({label:i.a.string,type:i.a.string,placeholder:i.a.string.isRequired,required:i.a.bool}),button:i.a.shape({title:i.a.string,icon:i.a.string,type:i.a.string})}),i.a.shape({id:i.a.string.isRequired,title:i.a.string,description:i.a.string,image:i.a.string.isRequired,price:i.a.string});const Mi=Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1ywydhs-0"})(["margin:24px;"]),Pi=Ye.c.h2.withConfig({displayName:"styles__Title",componentId:"sc-1ywydhs-1"})(["font-size:16px;font-weight:500;line-height:26px;margin:0 0 16px 0;"]),Ri=Ye.c.p.withConfig({displayName:"styles__Description",componentId:"sc-1ywydhs-2"})(["line-height:22px;margin:0 0 16px 0;"]),Li=Ye.c.a.withConfig({displayName:"styles__Link",componentId:"sc-1ywydhs-3"})(["line-height:22px;margin:0 0 16px 0;color:#0069ff;"]),Di=Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1aq8spp-0"})(["margin:24px;"]),Bi=Ye.c.div.withConfig({displayName:"styles__FormGroup",componentId:"sc-1aq8spp-1"})(["display:grid;grid-template-columns:1fr 44px;align-items:end;grid-gap:16px;"]),Hi=Ye.c.div.withConfig({displayName:"styles__InputContainer",componentId:"sc-1aq8spp-2"})(["display:flex;flex-direction:column;"]),Ui=Ye.c.label.withConfig({displayName:"styles__Label",componentId:"sc-1aq8spp-3"})(["font-size:16px;line-height:19px;margin-left:8px;margin-bottom:8px;"]),zi=Ye.c.input.withConfig({displayName:"styles__Input",componentId:"sc-1aq8spp-4"})(["border:none;padding:14px 16px;border-radius:22px;font-size:14px;background:",";background-color:",";&:focus{color:#2c2c2c;box-shadow:none;border:none;","}"],e=>e.theme.inputBackground,e=>e.theme.inputBackground,Vr),Fi=Ye.c.button.withConfig({displayName:"styles__Button",componentId:"sc-1aq8spp-5"})(["cursor:pointer;box-shadow:none;height:44px;width:44px;padding:0;display:flex;align-items:center;justify-content:center;border:none;border-radius:100px;background:",";background-color:",";transition:opacity 0.1s ease-in;"," &:hover{opacity:0.8;}svg{margin-top:2px;margin-right:2px;transition:all 0.2s ease;path{fill:",";}}"],e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,Vr,e=>e.theme.buttonText);var $i=e=>{let{buttonContent:t}=e;const{title:n}=t;return c.a.createElement(Fi,{role:"button",title:n,type:"submit"},c.a.createElement(Rn,{width:18,height:18}))};var Gi=e=>{let{value:t,setValue:n,inputContent:r}=e;const{label:o,type:a,placeholder:i,required:s}=r;return c.a.createElement(Hi,null,c.a.createElement(Ui,null,o),c.a.createElement(zi,{"aria-label":i,"aria-labelledby":"newsletter-sign-up",name:o,placeholder:i,type:a||"text",value:t,onChange:e=>n(e.target.value),required:s}))};var qi=e=>{let{form:t,onNewsletterSubmit:n,slug:r}=e;const o=Ue(),{dialogue:a,webhook:i}=Ge(ia),{currentLanguage:l}=Ge(Xo),{defaultLanguage:u}=vi(),[d,p]=Object(s.useState)(""),[f,h]=Object(s.useState)(!1),{success:m}=t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(Di,null,f&&m?c.a.createElement(Ri,null,m):c.a.createElement("form",{autoComplete:"off",action:"#",onSubmit:e=>{if(e.preventDefault(),p(""),!d.trim())return!1;if(a&&o(gn(a,{openChat:!0,languageCode:l||u.code})),i){o(bt({method:"post",url:i,data:{event:e,email:d}}))}if("function"==typeof n)try{n(e,d)}catch(e){}return o(Tn({slug:r,eventType:"CTA_CLICK"})),h(!0)}},c.a.createElement(Bi,null,c.a.createElement(Gi,{value:d,setValue:p,inputContent:t.input}),c.a.createElement($i,{buttonContent:t.button})))))};const Yi=Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1cs3brm-0"})(["margin:24px;"]),Ki=Ye.c.div.withConfig({displayName:"styles__SectionSeperator",componentId:"sc-1cs3brm-1"})(["height:1px;width:100%;background:rgba(0,0,0,0.1);"]),Wi=Ye.c.button.withConfig({displayName:"styles__Button",componentId:"sc-1cs3brm-2"})(["cursor:pointer;box-shadow:none;width:max-content;border:none;font-size:14px;font-weight:500;padding:8px 16px;border-radius:100px;margin-right:8px;margin-bottom:8px;color:",";background:",";background-color:",";transition:opacity 0.1s ease-in;"," &:hover{opacity:0.8;}"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,Vr);var Vi=e=>{let{text:t,dialogue:n,choiceSubmit:r}=e;return c.a.createElement(Wi,{role:"button",title:t,type:"submit",onClick:()=>{r(n)}},t)};var Xi=e=>{let{choices:t,slug:n}=e;const r=Ue(),{currentLanguage:o}=Ge(Xo),{defaultLanguage:a}=vi(),{buttons:i}=t,l=Object(s.useCallback)(e=>{r(gn(e,{openChat:!0,languageCode:o||a.code})),r(Tn({slug:n,eventType:"CTA_CLICK",label:e}))},[o,a.code,r]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(Ki,null),c.a.createElement(Yi,null,i.map(e=>{let{text:t,triggerDialogue:n}=e;return c.a.createElement(Vi,{key:`${t}-${n}`,text:t,dialogue:n,choiceSubmit:l})})))},Qi=function(e,t){return(Qi=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)};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("prop-types"),require("pusher-redux"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","prop-types","pusher-redux","react-dom"],t):"object"==typeof exports?exports.kindlyChat=t(require("react"),require("prop-types"),require("pusher-redux"),require("react-dom")):e.kindlyChat=t(e.react,e["prop-types"],e["pusher-redux"],e["react-dom"])}(window,(function(e,t,n,r){return function(e){function t(t){for(var n,o,a=t[0],i=t[1],c=0,u=[];c<a.length;c++)o=a[c],Object.prototype.hasOwnProperty.call(r,o)&&r[o]&&u.push(r[o][0]),r[o]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(s&&s(t);u.length;)u.shift()()}var n={},r={0:0};function o(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.e=function(){return Promise.resolve()},o.m=e,o.c=n,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o.oe=function(e){throw console.error(e),e};var a=window.webpackJsonpkindlyChat=window.webpackJsonpkindlyChat||[],i=a.push.bind(a);a.push=t,a=a.slice();for(var c=0;c<a.length;c++)t(a[c]);var s=i;return o(o.s=225)}([function(t,n){t.exports=e},function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return Se})),n.d(t,"b",(function(){return be})),n.d(t,"d",(function(){return Pe})),n.d(t,"e",(function(){return Me}));var r=n(65),o=n(0),a=n.n(o),i=n(148),c=n.n(i),s=n(149),u=n(150),l=n(98),d=n(72),f=n.n(d);function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var h=function(e,t){for(var n=[e[0]],r=0,o=t.length;r<o;r+=1)n.push(t[r],e[r+1]);return n},m=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!Object(r.typeOf)(e)},g=Object.freeze([]),b=Object.freeze({});function v(e){return"function"==typeof e}function y(e){return e.displayName||e.name||"Component"}function w(e){return e&&"string"==typeof e.styledComponentId}var x=void 0!==e&&(e.env.REACT_APP_SC_ATTR||e.env.SC_ATTR)||"data-styled",O="undefined"!=typeof window&&"HTMLElement"in window,E=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:void 0!==e&&void 0!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==e.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==e.env.REACT_APP_SC_DISABLE_SPEEDY&&e.env.REACT_APP_SC_DISABLE_SPEEDY:void 0!==e&&void 0!==e.env.SC_DISABLE_SPEEDY&&""!==e.env.SC_DISABLE_SPEEDY&&("false"!==e.env.SC_DISABLE_SPEEDY&&e.env.SC_DISABLE_SPEEDY));function k(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var C=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&k(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var a=r;a<o;a++)this.groupSizes[a]=0}for(var i=this.indexOfGroup(e+1),c=0,s=t.length;c<s;c++)this.tag.insertRule(i,t[c])&&(this.groupSizes[e]++,i++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var o=n;o<r;o++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,a=r;a<o;a++)t+=this.tag.getRule(a)+"/*!sc*/\n";return t},e}(),_=new Map,j=new Map,T=1,S=function(e){if(_.has(e))return _.get(e);for(;j.has(T);)T++;var t=T++;return _.set(e,t),j.set(t,e),t},I=function(e){return j.get(e)},A=function(e,t){t>=T&&(T=t+1),_.set(e,t),j.set(t,e)},N="style["+x+'][data-styled-version="5.3.1"]',P=new RegExp("^"+x+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),M=function(e,t,n){for(var r,o=n.split(","),a=0,i=o.length;a<i;a++)(r=o[a])&&e.registerName(t,r)},R=function(e,t){for(var n=(t.innerHTML||"").split("/*!sc*/\n"),r=[],o=0,a=n.length;o<a;o++){var i=n[o].trim();if(i){var c=i.match(P);if(c){var s=0|parseInt(c[1],10),u=c[2];0!==s&&(A(u,s),M(e,u,c[3]),e.getTag().insertRules(s,r)),r.length=0}else r.push(i)}}},L=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},D=function(e){var t=document.head,n=e||t,r=document.createElement("style"),o=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(x))return r}}(n),a=void 0!==o?o.nextSibling:null;r.setAttribute(x,"active"),r.setAttribute("data-styled-version","5.3.1");var i=L();return i&&r.setAttribute("nonce",i),n.insertBefore(r,a),r},B=function(){function e(e){var t=this.element=D(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var o=t[n];if(o.ownerNode===e)return o}k(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),z=function(){function e(e){var t=this.element=D(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),U=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),H=O,F={isServer:!O,useCSSOMInjection:!E},$=function(){function e(e,t,n){void 0===e&&(e=b),void 0===t&&(t={}),this.options=p({},F,{},e),this.gs=t,this.names=new Map(n),this.server=!!e.isServer,!this.server&&O&&H&&(H=!1,function(e){for(var t=document.querySelectorAll(N),n=0,r=t.length;n<r;n++){var o=t[n];o&&"active"!==o.getAttribute(x)&&(R(e,o),o.parentNode&&o.parentNode.removeChild(o))}}(this))}e.registerId=function(e){return S(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(p({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,o=t.target,e=n?new U(o):r?new B(o):new z(o),new C(e)));var e,t,n,r,o},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(S(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(S(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(S(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",o=0;o<n;o++){var a=I(o);if(void 0!==a){var i=e.names.get(a),c=t.getGroup(o);if(i&&c&&i.size){var s=x+".g"+o+'[id="'+a+'"]',u="";void 0!==i&&i.forEach((function(e){e.length>0&&(u+=e+",")})),r+=""+c+s+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),q=/(a)(d)/gi,G=function(e){return String.fromCharCode(e+(e>25?39:97))};function Y(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=G(t%52)+n;return(G(t%52)+n).replace(q,"$1-$2")}var V=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},W=function(e){return V(5381,e)};function K(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(v(n)&&!w(n))return!1}return!0}var X=W("5.3.1"),J=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&K(e),this.componentId=t,this.baseHash=V(X,t),this.baseStyle=n,$.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else{var a=me(this.rules,e,t,n).join(""),i=Y(V(this.baseHash,a)>>>0);if(!t.hasNameForId(r,i)){var c=n(a,"."+i,void 0,r);t.insertRules(r,i,c)}o.push(i),this.staticRulesId=i}else{for(var s=this.rules.length,u=V(this.baseHash,n.hash),l="",d=0;d<s;d++){var f=this.rules[d];if("string"==typeof f)l+=f;else if(f){var p=me(f,e,t,n),h=Array.isArray(p)?p.join(""):p;u=V(u,h+d),l+=h}}if(l){var m=Y(u>>>0);if(!t.hasNameForId(r,m)){var g=n(l,"."+m,void 0,r);t.insertRules(r,m,g)}o.push(m)}}return o.join(" ")},e}(),Q=/^\s*\/\/.*$/gm,Z=[":","[",".","#"];function ee(e){var t,n,r,o,a=void 0===e?b:e,i=a.options,c=void 0===i?b:i,u=a.plugins,l=void 0===u?g:u,d=new s.a(c),f=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,a,i,c,s,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),h=function(e,r,a){return 0===r&&-1!==Z.indexOf(a[n.length])||a.match(o)?e:"."+t};function m(e,a,i,c){void 0===c&&(c="&");var s=e.replace(Q,""),u=a&&i?i+" "+a+" { "+s+" }":s;return t=c,n=a,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),d(i||!a?"":a,u)}return d.use([].concat(l,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,h))},p,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=l.length?l.reduce((function(e,t){return t.name||k(15),V(e,t.name)}),5381).toString():"",m}var te=a.a.createContext(),ne=(te.Consumer,a.a.createContext()),re=(ne.Consumer,new $),oe=ee();function ae(){return Object(o.useContext)(te)||re}function ie(){return Object(o.useContext)(ne)||oe}function ce(e){var t=Object(o.useState)(e.stylisPlugins),n=t[0],r=t[1],i=ae(),s=Object(o.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),u=Object(o.useMemo)((function(){return ee({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return Object(o.useEffect)((function(){c()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),a.a.createElement(te.Provider,{value:s},a.a.createElement(ne.Provider,{value:u},e.children))}var se=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=oe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return k(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=oe),this.name+e.hash},e}(),ue=/([A-Z])/,le=/([A-Z])/g,de=/^ms-/,fe=function(e){return"-"+e.toLowerCase()};function pe(e){return ue.test(e)?e.replace(le,fe).replace(de,"-ms-"):e}var he=function(e){return null==e||!1===e||""===e};function me(e,t,n,r){if(Array.isArray(e)){for(var o,a=[],i=0,c=e.length;i<c;i+=1)""!==(o=me(e[i],t,n,r))&&(Array.isArray(o)?a.push.apply(a,o):a.push(o));return a}return he(e)?"":w(e)?"."+e.styledComponentId:v(e)?"function"!=typeof(s=e)||s.prototype&&s.prototype.isReactComponent||!t?e:me(e(t),t,n,r):e instanceof se?n?(e.inject(n,r),e.getName(r)):e:m(e)?function e(t,n){var r,o,a=[];for(var i in t)t.hasOwnProperty(i)&&!he(t[i])&&(Array.isArray(t[i])&&t[i].isCss||v(t[i])?a.push(pe(i)+":",t[i],";"):m(t[i])?a.push.apply(a,e(t[i],i)):a.push(pe(i)+": "+(r=i,null==(o=t[i])||"boolean"==typeof o||""===o?"":"number"!=typeof o||0===o||r in u.a?String(o).trim():o+"px")+";"));return n?[n+" {"].concat(a,["}"]):a}(e):e.toString();var s}var ge=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function be(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 v(e)||m(e)?ge(me(h(g,[e].concat(n)))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:ge(me(h(e,n)))}new Set;var ve=function(e,t,n){return void 0===n&&(n=b),e.theme!==n.theme&&e.theme||t||n.theme},ye=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,we=/(^-|-$)/g;function xe(e){return e.replace(ye,"-").replace(we,"")}var Oe=function(e){return Y(W(e)>>>0)};function Ee(e){return"string"==typeof e&&!0}var ke=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Ce=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function _e(e,t,n){var r=e[n];ke(t)&&ke(r)?je(r,t):e[n]=t}function je(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var o=0,a=n;o<a.length;o++){var i=a[o];if(ke(i))for(var c in i)Ce(c)&&_e(e,i[c],c)}return e}var Te=a.a.createContext();Te.Consumer;function Se(e){var t=Object(o.useContext)(Te),n=Object(o.useMemo)((function(){return function(e,t){return e?v(e)?e(t):Array.isArray(e)||"object"!=typeof e?k(8):t?p({},t,{},e):e:k(14)}(e.theme,t)}),[e.theme,t]);return e.children?a.a.createElement(Te.Provider,{value:n},e.children):null}var Ie={};function Ae(e,t,n){var r=w(e),i=!Ee(e),c=t.attrs,s=void 0===c?g:c,u=t.componentId,d=void 0===u?function(e,t){var n="string"!=typeof e?"sc":xe(e);Ie[n]=(Ie[n]||0)+1;var r=n+"-"+Oe("5.3.1"+n+Ie[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):u,h=t.displayName,m=void 0===h?function(e){return Ee(e)?"styled."+e:"Styled("+y(e)+")"}(e):h,x=t.displayName&&t.componentId?xe(t.displayName)+"-"+t.componentId:t.componentId||d,O=r&&e.attrs?Array.prototype.concat(e.attrs,s).filter(Boolean):s,E=t.shouldForwardProp;r&&e.shouldForwardProp&&(E=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var k,C=new J(n,x,r?e.componentStyle:void 0),_=C.isStatic&&0===s.length,j=function(e,t){return function(e,t,n,r){var a=e.attrs,i=e.componentStyle,c=e.defaultProps,s=e.foldedComponentIds,u=e.shouldForwardProp,d=e.styledComponentId,f=e.target,h=function(e,t,n){void 0===e&&(e=b);var r=p({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,a,i=e;for(t in v(i)&&(i=i(r)),i)r[t]=o[t]="className"===t?(n=o[t],a=i[t],n&&a?n+" "+a:n||a):i[t]})),[r,o]}(ve(t,Object(o.useContext)(Te),c)||b,t,a),m=h[0],g=h[1],y=function(e,t,n,r){var o=ae(),a=ie();return t?e.generateAndInjectStyles(b,o,a):e.generateAndInjectStyles(n,o,a)}(i,r,m),w=n,x=g.$as||t.$as||g.as||t.as||f,O=Ee(x),E=g!==t?p({},t,{},g):t,k={};for(var C in E)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?k.as=E[C]:(u?u(C,l.default,x):!O||Object(l.default)(C))&&(k[C]=E[C]));return t.style&&g.style!==t.style&&(k.style=p({},t.style,{},g.style)),k.className=Array.prototype.concat(s,d,y!==d?y:null,t.className,g.className).filter(Boolean).join(" "),k.ref=w,Object(o.createElement)(x,k)}(k,e,t,_)};return j.displayName=m,(k=a.a.forwardRef(j)).attrs=O,k.componentStyle=C,k.displayName=m,k.shouldForwardProp=E,k.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):g,k.styledComponentId=x,k.target=r?e.target:e,k.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(t,["componentId"]),a=r&&r+"-"+(Ee(e)?e:xe(y(e)));return Ae(e,p({},o,{attrs:O,componentId:a}),n)},Object.defineProperty(k,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?je({},e.defaultProps,t):t}}),k.toString=function(){return"."+k.styledComponentId},i&&f()(k,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),k}var Ne=function(e){return function e(t,n,o){if(void 0===o&&(o=b),!Object(r.isValidElementType)(n))return k(1,String(n));var a=function(){return t(n,o,be.apply(void 0,arguments))};return a.withConfig=function(r){return e(t,n,p({},o,{},r))},a.attrs=function(r){return e(t,n,p({},o,{attrs:Array.prototype.concat(o.attrs,r).filter(Boolean)}))},a}(Ae,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Ne[e]=Ne(e)}));!function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=K(e),$.registerId(this.componentId+1)}var t=e.prototype;t.createStyles=function(e,t,n,r){var o=r(me(this.rules,t,n,r).join(""),""),a=this.componentId+e;n.insertRules(a,a,o)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&$.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}();function Pe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=be.apply(void 0,[e].concat(n)).join(""),a=Oe(o);return new se(a,o)}!function(){function e(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=L();return"<style "+[n&&'nonce="'+n+'"',x+'="true"','data-styled-version="5.3.1"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?k(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return k(2);var n=((t={})[x]="",t["data-styled-version"]="5.3.1",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=L();return r&&(n.nonce=r),[a.a.createElement("style",p({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new $({isServer:!0}),this.sealed=!1}var t=e.prototype;t.collectStyles=function(e){return this.sealed?k(2):a.a.createElement(ce,{sheet:this.instance},e)},t.interleaveWithNodeStream=function(e){return k(3)}}();var Me=function(){return Object(o.useContext)(Te)};t.c=Ne}).call(this,n(99))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"ub",(function(){return a})),n.d(t,"tb",(function(){return i})),n.d(t,"sb",(function(){return c})),n.d(t,"Bb",(function(){return s})),n.d(t,"Cb",(function(){return u})),n.d(t,"T",(function(){return l})),n.d(t,"xb",(function(){return d})),n.d(t,"E",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"rb",(function(){return h})),n.d(t,"C",(function(){return m})),n.d(t,"ob",(function(){return g})),n.d(t,"ib",(function(){return b})),n.d(t,"z",(function(){return v})),n.d(t,"d",(function(){return y})),n.d(t,"c",(function(){return w})),n.d(t,"i",(function(){return x})),n.d(t,"fb",(function(){return O})),n.d(t,"m",(function(){return E})),n.d(t,"Ab",(function(){return k})),n.d(t,"qb",(function(){return C})),n.d(t,"cb",(function(){return _})),n.d(t,"n",(function(){return j})),n.d(t,"q",(function(){return T})),n.d(t,"K",(function(){return S})),n.d(t,"N",(function(){return I})),n.d(t,"H",(function(){return A})),n.d(t,"Q",(function(){return N})),n.d(t,"gb",(function(){return P})),n.d(t,"hb",(function(){return M})),n.d(t,"Y",(function(){return R})),n.d(t,"D",(function(){return L})),n.d(t,"jb",(function(){return D})),n.d(t,"f",(function(){return B})),n.d(t,"X",(function(){return z})),n.d(t,"k",(function(){return U})),n.d(t,"g",(function(){return H})),n.d(t,"Z",(function(){return F})),n.d(t,"r",(function(){return q})),n.d(t,"w",(function(){return G})),n.d(t,"J",(function(){return Y})),n.d(t,"V",(function(){return V})),n.d(t,"s",(function(){return W})),n.d(t,"ab",(function(){return K})),n.d(t,"R",(function(){return $.CONNECTED})),n.d(t,"S",(function(){return $.DISCONNECTED})),n.d(t,"P",(function(){return X})),n.d(t,"bb",(function(){return J})),n.d(t,"pb",(function(){return Q})),n.d(t,"vb",(function(){return Z})),n.d(t,"O",(function(){return ee})),n.d(t,"L",(function(){return te})),n.d(t,"o",(function(){return ne})),n.d(t,"lb",(function(){return re})),n.d(t,"y",(function(){return oe})),n.d(t,"I",(function(){return ae})),n.d(t,"e",(function(){return ie})),n.d(t,"wb",(function(){return ce})),n.d(t,"db",(function(){return se})),n.d(t,"eb",(function(){return ue})),n.d(t,"zb",(function(){return le})),n.d(t,"j",(function(){return de})),n.d(t,"G",(function(){return fe})),n.d(t,"yb",(function(){return pe})),n.d(t,"F",(function(){return he})),n.d(t,"v",(function(){return me})),n.d(t,"B",(function(){return ge})),n.d(t,"nb",(function(){return be})),n.d(t,"U",(function(){return ve})),n.d(t,"M",(function(){return ye})),n.d(t,"p",(function(){return we})),n.d(t,"A",(function(){return xe})),n.d(t,"mb",(function(){return Oe})),n.d(t,"kb",(function(){return Ee})),n.d(t,"u",(function(){return ke})),n.d(t,"W",(function(){return Ce})),n.d(t,"t",(function(){return _e})),n.d(t,"x",(function(){return je})),n.d(t,"l",(function(){return Te}));const r="AGENT_STARTED_TYPING",o="AGENT_STOPPED_TYPING",a="TAKEOVER_REQUESTED",i="TAKEOVER_CANCELLED",c="TAKEOVER",s="USER_STARTED_TYPING",u="USER_STOPPED_TYPING",l="RESET_HAS_HAD_HANDOVER",d="UNAUTHENTICATED",f="IDENTIFIED",p="AUTHENTICATED",h="START_REFRESHING",m="END_REFRESHING",g="SHOW_TAB_NOTIFICATION",b="SHOW_BUBBLE_NOTIFICATION",v="DISMISS_NOTIFICATIONS",y="ANNOUNCEMENT_SHOW",w="ANNOUNCEMENT_HIDE",x="BOT_IS_TYPING",O="SET_SPLIT_TEST_LABEL",E="CLEAR_SPLIT_TEST_LABEL",k="UPDATE_SPLIT_LABEL_TIMEOUT",C="START_OVER",_="SET_LANGUAGE",j="CLOSE_CHATBUBBLE",T="CLOSE_OPTIONS_SCREEN",S="OPEN_CHATBUBBLE",I="OPEN_OPTIONS_SCREEN",A="NEW_CHAT_ID",N="POPPED_UP",P="SET_STARTED_AT",M="SET_USER_IS_IDLE",R="SET_CHAT_HAS_STARTED",L="HIDE_CONTACT_DETAILS",D="SHOW_CONTACT_DETAILS",B="ATTACHMENT_BUTTON_CLICKED",z="SET_ATTACHMENT_FILES",U="CLEAR_ATTACHMENT_FILES",H="ATTACHMENT_PROMPT_SHOWED",F="SET_ERROR";var $=n(17);const q="CONNECTED",G="DISCONNECTED",Y="NEW_TOKEN",V="RESET_TOKEN",W="CONNECT_WITH_TRIGGER",K="SET_HEARTBEAT_ID",X="PATTERN_CONTEXT_MATCH",J="SET_INSPECTED_CHAT_MESSAGE",Q="SPELL_CORRECTION",Z="TOGGLE_INSPECTOR",ee="ENVIRONMENT_OVERRIDE",te="OPEN_FEEDBACK_FORM",ne="CLOSE_FEEDBACK_FORM",re="SHOW_MAINTENANCE_ALERT",oe="DISMISS_MAINTENANCE_ALERT",ae="NEW_MESSAGE",ie="ANONYMIZED_MESSAGE",ce="TRIGGER_DIALOGUE",se="SET_LAST_MESSAGE_SEEN",ue="SET_MESSAGE_SENT_TIME",le="UPDATE_CHAT_MESSAGE",de="BUTTON_CLICK",fe="NEW_ATTACHMENTS",pe="UPDATE_ATTACHMENT",he="MESSAGE_ATTACHMENTS_UPDATED",me="DELETE_CHAT",ge="DISMISS_PUSH_MESSAGE",be="SHOW_PUSH_MESSAGE",ve="RESET_PUSH_MESSAGES";n(24);const ye="OPEN_LIGHT_BOX",we="CLOSE_LIGHT_BOX",xe="DISMISS_NUDGE",Oe="SHOW_NUDGE",Ee="SHOW_CUSTOM_NUDGE",ke="CTA_CLICK",Ce="SESSION_COMPLETION",_e="COUNT_NUDGE",je="DISCOUNT_NUDGE",Te="CLEAR_NUDGE_INTERACTION"},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return H})),n.d(t,"c",(function(){return Y})),n.d(t,"d",(function(){return X})),n.d(t,"e",(function(){return q}));var r=n(0),o=n.n(r),a=(n(4),o.a.createContext(null));var i=function(e){e()},c={notify:function(){}};function s(){var e=i,t=null,n=null;return{clear:function(){t=null,n=null},notify:function(){e((function(){for(var e=t;e;)e.callback(),e=e.next}))},get:function(){for(var e=[],n=t;n;)e.push(n),n=n.next;return e},subscribe:function(e){var r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}var u=function(){function e(e,t){this.store=e,this.parentSub=t,this.unsubscribe=null,this.listeners=c,this.handleChangeWrapper=this.handleChangeWrapper.bind(this)}var t=e.prototype;return t.addNestedSub=function(e){return this.trySubscribe(),this.listeners.subscribe(e)},t.notifyNestedSubs=function(){this.listeners.notify()},t.handleChangeWrapper=function(){this.onStateChange&&this.onStateChange()},t.isSubscribed=function(){return Boolean(this.unsubscribe)},t.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.handleChangeWrapper):this.store.subscribe(this.handleChangeWrapper),this.listeners=s())},t.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=c)},e}();var l=function(e){var t=e.store,n=e.context,i=e.children,c=Object(r.useMemo)((function(){var e=new u(t);return e.onStateChange=e.notifyNestedSubs,{store:t,subscription:e}}),[t]),s=Object(r.useMemo)((function(){return t.getState()}),[t]);Object(r.useEffect)((function(){var e=c.subscription;return e.trySubscribe(),s!==t.getState()&&e.notifyNestedSubs(),function(){e.tryUnsubscribe(),e.onStateChange=null}}),[c,s]);var l=n||a;return o.a.createElement(l.Provider,{value:c},i)},d=n(16),f=n(42),p=n(72),h=n.n(p),m=n(65),g="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?r.useLayoutEffect:r.useEffect,b=[],v=[null,null];function y(e,t){var n=e[1];return[t.payload,n+1]}function w(e,t,n){g((function(){return e.apply(void 0,t)}),n)}function x(e,t,n,r,o,a,i){e.current=r,t.current=o,n.current=!1,a.current&&(a.current=null,i())}function O(e,t,n,r,o,a,i,c,s,u){if(e){var l=!1,d=null,f=function(){if(!l){var e,n,f=t.getState();try{e=r(f,o.current)}catch(e){n=e,d=e}n||(d=null),e===a.current?i.current||s():(a.current=e,c.current=e,i.current=!0,u({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=f,n.trySubscribe(),f();return function(){if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,d)throw d}}}var E=function(){return[null,0]};function k(e,t){void 0===t&&(t={});var n=t,i=n.getDisplayName,c=void 0===i?function(e){return"ConnectAdvanced("+e+")"}:i,s=n.methodName,l=void 0===s?"connectAdvanced":s,p=n.renderCountProp,g=void 0===p?void 0:p,k=n.shouldHandleStateChanges,C=void 0===k||k,_=n.storeKey,j=void 0===_?"store":_,T=(n.withRef,n.forwardRef),S=void 0!==T&&T,I=n.context,A=void 0===I?a:I,N=Object(f.a)(n,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"]),P=A;return function(t){var n=t.displayName||t.name||"Component",a=c(n),i=Object(d.a)({},N,{getDisplayName:c,methodName:l,renderCountProp:g,shouldHandleStateChanges:C,storeKey:j,displayName:a,wrappedComponentName:n,WrappedComponent:t}),s=N.pure;var p=s?r.useMemo:function(e){return e()};function k(n){var a=Object(r.useMemo)((function(){var e=n.forwardedRef,t=Object(f.a)(n,["forwardedRef"]);return[n.context,e,t]}),[n]),c=a[0],s=a[1],l=a[2],h=Object(r.useMemo)((function(){return c&&c.Consumer&&Object(m.isContextConsumer)(o.a.createElement(c.Consumer,null))?c:P}),[c,P]),g=Object(r.useContext)(h),k=Boolean(n.store)&&Boolean(n.store.getState)&&Boolean(n.store.dispatch);Boolean(g)&&Boolean(g.store);var _=k?n.store:g.store,j=Object(r.useMemo)((function(){return function(t){return e(t.dispatch,i)}(_)}),[_]),T=Object(r.useMemo)((function(){if(!C)return v;var e=new u(_,k?null:g.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[_,k,g]),S=T[0],I=T[1],A=Object(r.useMemo)((function(){return k?g:Object(d.a)({},g,{subscription:S})}),[k,g,S]),N=Object(r.useReducer)(y,b,E),M=N[0][0],R=N[1];if(M&&M.error)throw M.error;var L=Object(r.useRef)(),D=Object(r.useRef)(l),B=Object(r.useRef)(),z=Object(r.useRef)(!1),U=p((function(){return B.current&&l===D.current?B.current:j(_.getState(),l)}),[_,M,l]);w(x,[D,L,z,l,U,B,I]),w(O,[C,_,S,j,D,L,z,B,I,R],[_,S,j]);var H=Object(r.useMemo)((function(){return o.a.createElement(t,Object(d.a)({},U,{ref:s}))}),[s,t,U]);return Object(r.useMemo)((function(){return C?o.a.createElement(h.Provider,{value:A},H):H}),[h,H,A])}var _=s?o.a.memo(k):k;if(_.WrappedComponent=t,_.displayName=a,S){var T=o.a.forwardRef((function(e,t){return o.a.createElement(_,Object(d.a)({},e,{forwardedRef:t}))}));return T.displayName=a,T.WrappedComponent=t,h()(T,t)}return h()(_,t)}}function C(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function _(e,t){if(C(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(t,n[o])||!C(e[n[o]],t[n[o]]))return!1;return!0}var j=n(57);function T(e){return function(t,n){var r=e(t,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function S(e){return null!==e.dependsOnOwnProps&&void 0!==e.dependsOnOwnProps?Boolean(e.dependsOnOwnProps):1!==e.length}function I(e,t){return function(t,n){n.displayName;var r=function(e,t){return r.dependsOnOwnProps?r.mapToProps(e,t):r.mapToProps(e)};return r.dependsOnOwnProps=!0,r.mapToProps=function(t,n){r.mapToProps=e,r.dependsOnOwnProps=S(e);var o=r(t,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=S(o),o=r(t,n)),o},r}}var A=[function(e){return"function"==typeof e?I(e):void 0},function(e){return e?void 0:T((function(e){return{dispatch:e}}))},function(e){return e&&"object"==typeof e?T((function(t){return Object(j.b)(e,t)})):void 0}];var N=[function(e){return"function"==typeof e?I(e):void 0},function(e){return e?void 0:T((function(){return{}}))}];function P(e,t,n){return Object(d.a)({},n,{},e,{},t)}var M=[function(e){return"function"==typeof e?function(e){return function(t,n){n.displayName;var r,o=n.pure,a=n.areMergedPropsEqual,i=!1;return function(t,n,c){var s=e(t,n,c);return i?o&&a(s,r)||(r=s):(i=!0,r=s),r}}}(e):void 0},function(e){return e?void 0:function(){return P}}];function R(e,t,n,r){return function(o,a){return n(e(o,a),t(r,a),a)}}function L(e,t,n,r,o){var a,i,c,s,u,l=o.areStatesEqual,d=o.areOwnPropsEqual,f=o.areStatePropsEqual,p=!1;function h(o,p){var h,m,g=!d(p,i),b=!l(o,a);return a=o,i=p,g&&b?(c=e(a,i),t.dependsOnOwnProps&&(s=t(r,i)),u=n(c,s,i)):g?(e.dependsOnOwnProps&&(c=e(a,i)),t.dependsOnOwnProps&&(s=t(r,i)),u=n(c,s,i)):b?(h=e(a,i),m=!f(h,c),c=h,m&&(u=n(c,s,i)),u):u}return function(o,l){return p?h(o,l):(c=e(a=o,i=l),s=t(r,i),u=n(c,s,i),p=!0,u)}}function D(e,t){var n=t.initMapStateToProps,r=t.initMapDispatchToProps,o=t.initMergeProps,a=Object(f.a)(t,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),i=n(e,a),c=r(e,a),s=o(e,a);return(a.pure?L:R)(i,c,s,e,a)}function B(e,t,n){for(var r=t.length-1;r>=0;r--){var o=t[r](e);if(o)return o}return function(t,r){throw new Error("Invalid value of type "+typeof e+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function z(e,t){return e===t}function U(e){var t=void 0===e?{}:e,n=t.connectHOC,r=void 0===n?k:n,o=t.mapStateToPropsFactories,a=void 0===o?N:o,i=t.mapDispatchToPropsFactories,c=void 0===i?A:i,s=t.mergePropsFactories,u=void 0===s?M:s,l=t.selectorFactory,p=void 0===l?D:l;return function(e,t,n,o){void 0===o&&(o={});var i=o,s=i.pure,l=void 0===s||s,h=i.areStatesEqual,m=void 0===h?z:h,g=i.areOwnPropsEqual,b=void 0===g?_:g,v=i.areStatePropsEqual,y=void 0===v?_:v,w=i.areMergedPropsEqual,x=void 0===w?_:w,O=Object(f.a)(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),E=B(e,a,"mapStateToProps"),k=B(t,c,"mapDispatchToProps"),C=B(n,u,"mergeProps");return r(p,Object(d.a)({methodName:"connect",getDisplayName:function(e){return"Connect("+e+")"},shouldHandleStateChanges:Boolean(e),initMapStateToProps:E,initMapDispatchToProps:k,initMergeProps:C,pure:l,areStatesEqual:m,areOwnPropsEqual:b,areStatePropsEqual:y,areMergedPropsEqual:x},O))}}var H=U();function F(){return Object(r.useContext)(a)}function $(e){void 0===e&&(e=a);var t=e===a?F:function(){return Object(r.useContext)(e)};return function(){return t().store}}var q=$();function G(e){void 0===e&&(e=a);var t=e===a?q:$(e);return function(){return t().dispatch}}var Y=G(),V=function(e,t){return e===t};function W(e){void 0===e&&(e=a);var t=e===a?F:function(){return Object(r.useContext)(e)};return function(e,n){void 0===n&&(n=V);var o=t();return function(e,t,n,o){var a,i=Object(r.useReducer)((function(e){return e+1}),0)[1],c=Object(r.useMemo)((function(){return new u(n,o)}),[n,o]),s=Object(r.useRef)(),l=Object(r.useRef)(),d=Object(r.useRef)();try{a=e!==l.current||s.current?e(n.getState()):d.current}catch(e){throw s.current&&(e.message+="\nThe error may be correlated with this previous error:\n"+s.current.stack+"\n\n"),e}return g((function(){l.current=e,d.current=a,s.current=void 0})),g((function(){function e(){try{var e=l.current(n.getState());if(t(e,d.current))return;d.current=e}catch(e){s.current=e}i({})}return c.onStateChange=e,c.trySubscribe(),e(),function(){return c.tryUnsubscribe()}}),[n,c]),a}(e,n,o.store,o.subscription)}}var K,X=W(),J=n(113);K=J.unstable_batchedUpdates,i=K},function(e,n){e.exports=t},function(e,t,n){"use strict";n.d(t,"q",(function(){return o})),n.d(t,"r",(function(){return a})),n.d(t,"l",(function(){return i})),n.d(t,"o",(function(){return c})),n.d(t,"p",(function(){return s})),n.d(t,"h",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"i",(function(){return f})),n.d(t,"a",(function(){return p})),n.d(t,"e",(function(){return h})),n.d(t,"g",(function(){return m})),n.d(t,"k",(function(){return g})),n.d(t,"n",(function(){return b})),n.d(t,"m",(function(){return v})),n.d(t,"d",(function(){return y})),n.d(t,"c",(function(){return w}));var r=n(84);n.d(t,"j",(function(){return r.a}));const o=Object.freeze({NONE:"NONE",BINARY:"BINARY",EMOJIS:"EMOJIS",HAPPY_OR_NOT:"HAPPY_OR_NOT",EXTERNAL_LINK:"EXTERNAL_LINK"}),a=Object.freeze({NONE:"NONE",COLOR:"COLOR",PICTURE:"PICTURE"}),i=Object.freeze({USER:"USER",BOT:"BOT",WEBHOOK:"WEBHOOK",AGENT:"AGENT",SYSTEM:"SYSTEM",EXTERNAL:"EXTERNAL"}),c=Object.freeze({REQUEST:"request",START:"start",END:"end",CANCEL:"cancel"}),s=Object.freeze({TAKEOVER_POLL_INTERVAL_MS:1e4,TAKEOVER_REQUEST_POLL_INTERVAL_MS:2e4,REPLY_TIMEOUT_MS:4e3,REPLY_TIMEOUT_MAX_ATTEMPTS:3,REPLY_TIMEOUT_MS_MULTIPLIER:2}),u=Object.freeze({1e3:"250",800:"178",600:"124"}),l=Object.freeze({GREETING:"GREETING",FALLBACK:"FALLBACK",PATTERN_MATCH:"PATTERN_MATCH",KEYWORD_EXACT_MATCH:"KEYWORD_EXACT_MATCH",KEYWORD_MENTION:"KEYWORD_MENTION",SAMPLE_MATCH:"SAMPLE_MATCH",TRIGGER_DIALOGUE:"TRIGGER_DIALOGUE",ZODIAC:"ZODIAC"}),d=Object.freeze({QUICK_REPLY:"QUICK_REPLY",EXTERNAL_LINK:"EXTERNAL_LINK",EMAIL:"EMAIL",PHONE:"PHONE",HANDOVER_REQUEST:"HANDOVER_REQUEST",PRIVACY_EXPORT:"PRIVACY_EXPORT",PRIVACY_DELETE:"PRIVACY_DELETE",DIALOGUE_TRIGGER:"DIALOGUE_TRIGGER",SUGGESTION_DIALOGUE_TRIGGER:"SUGGESTION_DIALOGUE_TRIGGER",CONTACT_DETAILS:"CONTACT_DETAILS",UPLOAD_ATTACHMENT:"UPLOAD_ATTACHMENT",CHECKBOX:"CHECKBOX",SUBMIT:"SUBMIT",edit_contact_details:"edit_contact_details"}),f=Object.freeze({TEMPLATE:"TEMPLATE",CUSTOM:"CUSTOM"}),p=Object.freeze({CLEAN:"CLEAN",ERROR:"ERROR",INFECTED:"INFECTED",PROCESSING:"PROCESSING"}),h=Object.freeze({IMAGE:"image",PDF:"pdf",TEXT:"text"}),m=Object.freeze({DISABLED:"DISABLED",PLATFORM:"PLATFORM",EXTERNAL:"EXTERNAL",PROTOCOL:"HANDOVER_PROTOCOL"}),g=Object.freeze({PRIDE:"PRIDE",EASTER:"EASTER",CHRISTMAS:"CHRISTMAS"}),b=Object.freeze({NO_SPLIT:"X",SPLIT_A:"A",SPLIT_B:"B"}),v=18e5,y=5e3,w=Object.freeze({bottom:"20px",right:"20px"})},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return u})),n.d(t,"i",(function(){return l})),n.d(t,"h",(function(){return d})),n.d(t,"k",(function(){return f})),n.d(t,"l",(function(){return p})),n.d(t,"n",(function(){return h})),n.d(t,"o",(function(){return m})),n.d(t,"j",(function(){return g})),n.d(t,"m",(function(){return b}));const r=e=>{let{agent:t}=e;return t},o=e=>{let{alerts:t}=e;return t},a=e=>{let{announcement:t}=e;return t},i=e=>{let{bot:t}=e;return t},c=e=>{let{chatbubble:t}=e;return t},s=e=>{let{connection:t}=e;return t},u=e=>{let{environment:t}=e;return t},l=e=>{let{inspector:t}=e;return t},d=e=>{let{feedback:t}=e;return t},f=e=>{let{maintenanceAlert:t}=e;return t},p=e=>{let{messages:t}=e;return t},h=e=>{let{privacy:t}=e;return t},m=e=>{let{pushMessages:t}=e;return t},g=e=>{let{lightBox:t}=e;return t},b=e=>{let{nudge:t}=e;return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"f",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"e",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return s}));const r={darkColor:"#2c2c2c",primaryColor:"#0069ff",grayColor:"#edeeef",errorColor:"#f6665e",warningColor:"#ffca3a",successColor:"#50e39b",shadowColor:"rgba(0, 0, 0, 0.15)",shadowColorDark:"rgba(0, 0, 0, 0.3)"},o={textColor:"#333333",textColorLight:"#757575"},a={fontSizeSmall:"11px",fontSizeP:"14px",fontSizeH2:"26px",fontSizeH3:"22px",fontSizeH4:"19px",fontSizeH5:"16px"},i={tablet:"768px",phone:"500px"},c={minTablet:`(min-width: ${i.tablet})`,maxTablet:`(max-width: ${i.tablet})`,maxPhone:`(max-width: ${i.phone})`,maxPhoneHeight:"(max-height: 760px)"},s={headerIndex:"15",overlayIndex:"20",contextMenuIndex:"30"}},function(e,t,n){"use strict";n.d(t,"d",(function(){return r.a})),n.d(t,"pb",(function(){return r.c})),n.d(t,"qb",(function(){return r.d})),n.d(t,"s",(function(){return a})),n.d(t,"V",(function(){return i})),n.d(t,"y",(function(){return c.c})),n.d(t,"mb",(function(){return l})),n.d(t,"P",(function(){return d})),n.d(t,"U",(function(){return f})),n.d(t,"nb",(function(){return p})),n.d(t,"f",(function(){return h})),n.d(t,"jb",(function(){return m})),n.d(t,"e",(function(){return g.d})),n.d(t,"Q",(function(){return g.n})),n.d(t,"h",(function(){return g.e})),n.d(t,"v",(function(){return g.h})),n.d(t,"G",(function(){return g.l})),n.d(t,"k",(function(){return g.f})),n.d(t,"l",(function(){return g.g})),n.d(t,"E",(function(){return g.k})),n.d(t,"b",(function(){return g.c})),n.d(t,"D",(function(){return g.j})),n.d(t,"C",(function(){return g.i})),n.d(t,"hb",(function(){return g.o})),n.d(t,"O",(function(){return g.m})),n.d(t,"a",(function(){return g.b})),n.d(t,"z",(function(){return b.d})),n.d(t,"A",(function(){return b.e})),n.d(t,"n",(function(){return b.b})),n.d(t,"m",(function(){return b.a})),n.d(t,"o",(function(){return b.c})),n.d(t,"R",(function(){return v})),n.d(t,"ib",(function(){return y})),n.d(t,"M",(function(){return w})),n.d(t,"N",(function(){return x})),n.d(t,"i",(function(){return O})),n.d(t,"T",(function(){return k})),n.d(t,"X",(function(){return C})),n.d(t,"r",(function(){return _})),n.d(t,"J",(function(){return j.c})),n.d(t,"I",(function(){return j.b})),n.d(t,"cb",(function(){return j.g})),n.d(t,"K",(function(){return j.d})),n.d(t,"lb",(function(){return j.h})),n.d(t,"g",(function(){return j.a})),n.d(t,"L",(function(){return j.e})),n.d(t,"S",(function(){return j.f})),n.d(t,"w",(function(){return T.b})),n.d(t,"q",(function(){return T.a})),n.d(t,"Z",(function(){return S.c})),n.d(t,"u",(function(){return S.b})),n.d(t,"ob",(function(){return u.h})),n.d(t,"bb",(function(){return u.d})),n.d(t,"B",(function(){return u.b})),n.d(t,"x",(function(){return I.c})),n.d(t,"c",(function(){return I.a})),n.d(t,"p",(function(){return I.b})),n.d(t,"gb",(function(){return I.i})),n.d(t,"db",(function(){return I.f})),n.d(t,"fb",(function(){return I.h})),n.d(t,"eb",(function(){return I.g})),n.d(t,"H",(function(){return I.d})),n.d(t,"F",(function(){return A})),n.d(t,"j",(function(){return N})),n.d(t,"kb",(function(){return P.e})),n.d(t,"t",(function(){return P.a})),n.d(t,"Y",(function(){return P.c})),n.d(t,"W",(function(){return P.b})),n.d(t,"ab",(function(){return P.d}));var r=n(85),o=n(2);const a=()=>e=>{e({type:o.z})},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return n=>{n({type:o.d,payload:{text:e}}),t>0&&setTimeout(()=>n({type:o.c}),t)}};var c=n(28),s=n(5),u=n(9);const l=()=>(e,t)=>{const{isTypingTimeoutId:n}=t().bot;clearTimeout(n),e({type:o.i,isTyping:!1,isTypingTimeoutId:null})},d=()=>(e,t)=>{const{isTypingTimeoutId:n,typingDuration:r}=t().bot;clearTimeout(n);const a=setTimeout(()=>e(l()),Math.max(r,15e3));e({type:o.i,isTyping:!0,isTypingTimeoutId:a})},f=e=>t=>{t({type:o.fb,splitTestLabel:e})},p=()=>e=>{e({type:o.Ab})},h=()=>e=>{e({type:o.m})},m=(e,t)=>async(n,r)=>{const{PAT_HOST:o}=r().environment,{botKey:a,currentLanguage:i}=r().chatbubble,{token:l}=r().connection,d=await n(Object(c.b)());n(Object(u.f)({method:"post",url:`${o}/chatbubble/${s.j}/conversion/`,data:{split:e||"X",is_order:t,language_code:i},...Object(u.a)({botKey:a,token:l},{withCurrentUrl:!0,extra:d})}))};var g=n(51),b=n(63);const v=e=>({type:o.bb,chatMessageId:e}),y=()=>({type:o.vb}),w=e=>(t,n)=>{const{bot:{feedbackFormType:r},feedback:{token:o},environment:{PAT_HOST:a}}=n(),i={feedback_type:r,rating:e};t(Object(u.f)({method:"post",url:`${a}/chatbubble/${s.j}/feedback`,data:{feedback:i},...Object(u.a)({token:o})}))},x=e=>(t,n)=>{const{feedback:{token:r},environment:{PAT_HOST:o}}=n();t(Object(u.f)({method:"patch",url:`${o}/chatbubble/${s.j}/feedback`,data:{freeform_text:e},...Object(u.a)({token:r})}))},O=()=>(e,t)=>{var n;e({type:o.o}),null!==(n=t().chatbubble)&&void 0!==n&&n.active&&e({type:o.n})};var E=n(90);const k=e=>t=>{t({type:E.a,context:e})},C=e=>(t,n)=>{const{link_text:r,link_location:a,text_content:i}=e,{dismissed:c}=n().maintenanceAlert;c||setTimeout(()=>t({type:o.lb,linkText:r,linkLocation:a,textContent:i}),2e3)},_=()=>(e,t)=>{const{show:n}=t().maintenanceAlert;n&&e({type:o.y})};var j=n(64),T=n(71),S=n(67),I=n(38);const A=e=>t=>{t({type:o.M,imageUrl:e})},N=()=>e=>{e({type:o.p})};var P=n(31)},function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"d",(function(){return m})),n.d(t,"f",(function(){return O})),n.d(t,"e",(function(){return E})),n.d(t,"g",(function(){return k})),n.d(t,"b",(function(){return C})),n.d(t,"c",(function(){return _}));var r=n(54),o=n.n(r),a=n(17),i=n(5),c=n(49),s=n(145),u=n(19),l=n(50),d=n(2);const f=function(e){let{token:t,botKey:n,jwt:r}=e,{withCurrentUrl:o,withVersion:a,extra:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{headers:{...t?{"kindly-chatbubble-token":t}:{},...n?{"kindly-bot-key":n}:{},...r?{Authorization:`Bearer ${r}`}:{},...o?{"Current-Url":window.location.href}:{},...a?{"kindly-chat-version":l.a}:{},...i}}},p=e=>async(t,n)=>{const{connection:{token:r},environment:{PAT_HOST:a}}=n();return r?o.a.patch(`${a}/chatbubble/${i.j}/user_left/`,{},f({token:r,botKey:e})):null},h=()=>(e,t)=>{const{heartbeatId:n}=t().connection;n&&(clearTimeout(n),e({type:d.ab,heartbeatId:void 0}))},m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return async(n,r)=>{const{agent:{takenOver:o,requestedTakeover:i}}=r();i?n({type:d.tb}):o&&n({type:d.sb,data:{taken_over:!1}}),n({type:d.U}),n(p(e)),n(h());try{Object(a.disconnect)(),t||n({type:d.n})}catch(e){console.warn(e)}finally{n({type:d.V}),n({type:d.qb,botKey:e,keepOpen:t}),n({type:d.T}),t||setTimeout(()=>n({type:d.Y,chatHasStarted:!1}),300)}}},g=Object.freeze({MAX:3,TIMEOUT_MS:2e3,TIMEOUT_MULTIPLIER:2,RESPONSE_STATUSES:[401,403]});let b=0;const v=(e,t)=>n=>{if(!e.response||!Object(u.a)(e.response.status,g.RESPONSE_STATUSES))return console.error(e),null;if(b+=1,b>g.MAX)return console.error(`${t.url} returned ${e.response.status}, max chats restarts exceeded`),null;console.warn(`${t.url} returned ${e.response.status}, starting new chat`);const r=g.TIMEOUT_MS*g.TIMEOUT_MULTIPLIER**(b-1);return setTimeout(()=>n((e,t)=>{const{botKey:n}=t().chatbubble;e(m(n,!0))}),r),null},y=()=>(e,t)=>{const{heartbeatTTL:n}=t().bot,r=setTimeout(()=>e((e,t)=>{const{connection:{heartbeatId:n,token:r},environment:{PAT_HOST:o}}=t();clearTimeout(n),e({type:d.ab,heartbeatId:void 0}),e(O({method:"post",url:`${o}/chatbubble/${i.j}/heartbeat/`,data:{version:l.a},...f({token:r})}))}),.75*n*1e3);e({type:d.ab,heartbeatId:r})},w=()=>e=>{e(h()),e(y())},x=e=>{let{chatMessages:t,buttonClicks:n}=e;return(null==n?void 0:n.length)>0||Boolean((null!=t?t:[]).find(e=>{let{from_bot:t}=e;return!t}))},O=function(e){let{onError:t,restartOnError:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(r,a)=>{if(!e.url)return console.error("Tried to call transport without supplying url"),null;if(!e.method)return console.error("Tried to call transport without supplying method"),null;const{bot:i,messages:s}=a();e.headers={"kindly-chat-version":l.a,[c.a]:Object(c.b)(),...e.headers||{}};try{const t=await o()(e);return i.heartbeatEnabled&&x(s)&&r(w()),t}catch(o){return t?t(o,e):n?r(v(o,e)):null}}},E=e=>{const t=`private-chatbubble-${e}`;Object(a.subscribe)(t,"message",d.I),Object(a.subscribe)(t,"takeover",d.sb),Object(a.subscribe)(t,"agent_started_typing",d.a),Object(a.subscribe)(t,"agent_stopped_typing",d.b),Object(a.subscribe)(t,"pattern-context-match",d.P),Object(a.subscribe)(t,"spell-correction",d.pb),Object(a.subscribe)(t,"message-attachments-updated",d.F),Object(a.subscribe)(t,"new-attachments",d.G)},k=e=>{const t=`private-chatbubble-${e}`;Object(a.unsubscribe)(t,"message",d.I),Object(a.unsubscribe)(t,"takeover",d.sb),Object(a.unsubscribe)(t,"agent_started_typing",d.a),Object(a.unsubscribe)(t,"agent_stopped_typing",d.b),Object(a.unsubscribe)(t,"pattern-context-match",d.P),Object(a.unsubscribe)(t,"spell-correction",d.pb),Object(a.unsubscribe)(t,"message-attachments-updated",d.F),Object(a.unsubscribe)(t,"new-attachments",d.G)},C=e=>{let{message:t,error:n,level:r="info",extra:o={}}=e;return(e,a)=>{const c=a(),{connection:{token:u},environment:{PAT_HOST:l}}=c;e(O({method:"post",url:`${l}/chatbubble/${i.j}/log`,data:Object(s.a)({level:r,error:n,message:t,reduxState:c,extra:o}),...f({token:u,withCurrentUrl:!0})}))}},_=e=>t=>{t({type:d.eb,messageSentTime:e})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"j",(function(){return l})),n.d(t,"i",(function(){return d})),n.d(t,"m",(function(){return f})),n.d(t,"o",(function(){return p})),n.d(t,"p",(function(){return h})),n.d(t,"l",(function(){return m})),n.d(t,"n",(function(){return g})),n.d(t,"h",(function(){return b})),n.d(t,"f",(function(){return v})),n.d(t,"g",(function(){return y})),n.d(t,"k",(function(){return w}));var r=n(0),o=n.n(r);var a=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 25",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M14.83 21.67L5.66 12.5l9.17-9.17L12 .5l-12 12 12 12z",fill:"#000",fillRule:"nonzero"}));var i=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 25",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M.17 3.33l9.17 9.17-9.17 9.17L3 24.5l12-12L3 .5z",fill:e.fill||"#000",fillRule:"nonzero"}));var c=e=>{let{bubbleOutline:t,seasonalAppearance:n,...r}=e;return o.a.createElement("svg",Object.assign({},r,{viewBox:"0 0 65 67",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M64.557 65.487c-4 .482-7.42 1.138-10.86 1.257-5.824.201-11.693.466-17.483-.018-11.677-.976-22.173-4.749-29.675-14.559C-7.841 33.36 2.774 5.123 25.93.64c18.296-3.542 35.275 7.95 38.513 26.317 1.854 10.52-.945 19.876-8.035 27.882l-1.501 1.699 9.65 8.949z",fill:"#0069ff"}))};var s=e=>o.a.createElement("svg",Object.assign({"data-name":"Layer 1"},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 747 768"}),o.a.createElement("defs",null,o.a.createElement("linearGradient",{id:"a",x1:"373.51",x2:"373.51",y2:"768",gradientUnits:"userSpaceOnUse"},o.a.createElement("stop",{offset:".04",stopColor:"#ff0006"}),o.a.createElement("stop",{offset:".04",stopColor:"#ff0106"}),o.a.createElement("stop",{offset:".08",stopColor:"#ff3204"}),o.a.createElement("stop",{offset:".13",stopColor:"#ff5802"}),o.a.createElement("stop",{offset:".17",stopColor:"#ff7401"}),o.a.createElement("stop",{offset:".2",stopColor:"#ff8500"}),o.a.createElement("stop",{offset:".23",stopColor:"#ff8b00"}),o.a.createElement("stop",{offset:".28",stopColor:"#fda900"}),o.a.createElement("stop",{offset:".42",stopColor:"#faec00"}),o.a.createElement("stop",{offset:".56",stopColor:"#00963e"}),o.a.createElement("stop",{offset:".75",stopColor:"#314ea6"}),o.a.createElement("stop",{offset:".94",stopColor:"#991588"}))),o.a.createElement("path",{d:"M747.2 373.69C747.2 167.31 579.89 0 373.51 0S-.18 167.31-.18 373.69c0 165 107 304.87 255.27 354.41 63.32 25 142.21 39.9 227.77 39.9 89.71 0 172.07-16.36 236.86-43.63l-86.65-82A372.47 372.47 0 00747.2 373.69z",fill:"url(#a)"}));var u=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 30 30",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M8.618 21.359L21.372 8.605m-12.754-.01l12.754 12.754",stroke:e.stroke||"#FFF",strokeWidth:"4",fill:"none",fillRule:"evenodd"}));n(4);var l=e=>{let{width:t="16px",height:n="12px",fill:r="rgb(0, 105, 255)"}=e;return o.a.createElement("svg",{width:t,height:n,viewBox:"0 0 16 12"},o.a.createElement("path",{d:"M8 12c3.6 0 6.4-3.1 7.6-4.9.5-.7.5-1.6 0-2.3C14.4 3.1 11.6 0 8 0 4.4 0 1.6 3.1.4 4.9c-.5.7-.5 1.6 0 2.2C1.6 8.9 4.4 12 8 12zm0-9c1.7 0 3 1.3 3 3S9.7 9 8 9 5 7.7 5 6s1.3-3 3-3z",fill:r}))};var d=e=>{let{width:t="16px",height:n="16px",fill:r="rgb(0, 105, 255)"}=e;return o.a.createElement("svg",{width:t,height:n},o.a.createElement("g",{fill:r},o.a.createElement("path",{d:"M14.6 5.6l-8.2 8.2c.5.1 1.1.2 1.6.2 3.6 0 6.4-3.1 7.6-4.9.5-.7.5-1.6 0-2.3-.2-.3-.6-.7-1-1.2zM14.3.3L11.6 3C10.5 2.4 9.3 2 8 2 4.4 2 1.6 5.1.4 6.9c-.5.7-.5 1.6 0 2.2.5.8 1.4 1.8 2.4 2.7L.3 14.3c-.4.4-.4 1 0 1.4.2.2.4.3.7.3.3 0 .5-.1.7-.3l14-14c.4-.4.4-1 0-1.4-.4-.4-1-.4-1.4 0zm-9 9C5.1 8.9 5 8.5 5 8c0-1.7 1.3-3 3-3 .5 0 .9.1 1.3.3l-4 4z"})))};var f=e=>{let{active:t,...n}=e;return o.a.createElement("svg",Object.assign({},n,{viewBox:"0 0 22 11",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M3 3l7.887 5L19 3",stroke:"#FFF",strokeWidth:"4",fill:"none",fillRule:"evenodd",strokeLinecap:"square"}))};var p=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 30 30",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M30 0L0 12.927l11.523 3.782 5.531-5.646 2.75 2.34-5.382 5.728L19.02 30z",fill:"#0069FF",fillRule:"evenodd"}));var h=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 25 26",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{fill:"#0069FF",fillRule:"nonzero",d:"M22.05 14.274c.052-.416.09-.832.09-1.274 0-.442-.038-.858-.09-1.274l2.712-2.145a.661.661 0 0 0 .155-.832l-2.57-4.498a.642.642 0 0 0-.784-.286l-3.2 1.3a9.363 9.363 0 0 0-2.172-1.274L15.703.546a.629.629 0 0 0-.63-.546h-5.14a.629.629 0 0 0-.63.546l-.488 3.445a9.846 9.846 0 0 0-2.172 1.274l-3.2-1.3a.624.624 0 0 0-.784.286L.09 8.749a.646.646 0 0 0 .154.832l2.712 2.145c-.052.416-.09.845-.09 1.274 0 .429.038.858.09 1.274L.243 16.419a.661.661 0 0 0-.154.832l2.57 4.498c.154.286.501.39.784.286l3.2-1.3c.668.52 1.388.949 2.172 1.274l.488 3.445a.629.629 0 0 0 .63.546h5.14a.629.629 0 0 0 .63-.546l.488-3.445a9.846 9.846 0 0 0 2.172-1.274l3.2 1.3c.295.117.63 0 .783-.286l2.57-4.498a.661.661 0 0 0-.154-.832l-2.711-2.145zm-9.547 3.276c-2.48 0-4.498-2.041-4.498-4.55s2.018-4.55 4.498-4.55C14.983 8.45 17 10.491 17 13s-2.018 4.55-4.498 4.55z"}));var m=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 39 35",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M21.04 22.88l-4.5-4.4.05-.04c3.09-3.4 5.29-7.3 6.58-11.43h5.2V3.5H15.94V0h-3.54v3.5H0v3.48h19.8a27.56 27.56 0 01-5.62 9.38 27.59 27.59 0 01-4.1-5.86H6.55a30.7 30.7 0 005.28 7.98l-9.01 8.8 2.5 2.47L14.19 21l5.52 5.44 1.34-3.56zM31.02 14h-3.54L19.5 35h3.55l1.99-5.25h8.42l2 5.25H39l-7.98-21zm-4.65 12.25l2.88-7.59 2.88 7.59h-5.76z",fill:"#000",fillRule:"nonzero"}));var g=e=>o.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 15 15",xmlns:"https://www.w3.org/2000/svg"}),o.a.createElement("path",{d:"M8.7.2l.7 6.4 2.1-2.1A5.01 5.01 0 018 13a5.01 5.01 0 01-3.5-8.5c.6-.6 1.4-1.1 2.3-1.3l-.6-1.9C5 1.6 3.9 2.2 3 3.1A7.06 7.06 0 003 13c1.3 1.3 3.1 2 4.9 2 1.9 0 3.6-.7 4.9-2 2.7-2.7 2.7-7.1 0-9.9L15 .9 8.7.2z",fill:"#0069ff",fillRule:"evenodd"}));var b=e=>o.a.createElement("svg",Object.assign({},e,{width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"}),o.a.createElement("title",null,"fullscreen"),o.a.createElement("g",{fill:"#000",fillRule:"nonzero"},o.a.createElement("path",{d:"M2 4H0v6h6V8H2zM4 2h4v4h2V0H4z"})));var v=()=>o.a.createElement(o.a.Fragment,null,o.a.createElement("title",null,"Easter bunny - Ear back"),o.a.createElement("path",{d:"M3.383832 27.44434c-.5696765 0-1.0926451-.3662715-1.2678229-.9298759C-.097824 19.4159224-.5597867 7.1662958 2.1847886 2.6020193 2.8946153 1.4219446 3.8016913.717756 4.8787494.5088278 5.1006483.4662629 5.3264406.44434 5.5561263.44434c5.5241917 0 12.1254407 13.2736523 13.7098937 21.8811524.127168.686122-.307554 1.3528962-.990127 1.5192729L3.7017511 27.4056447c-.1051093.0270867-.2128098.0386953-.3179191.0386953z",fill:"#D8AB31",fillRule:"nonzero"}));var y=()=>o.a.createElement(o.a.Fragment,null,o.a.createElement("title",null,"Easter bunny - Ear"),o.a.createElement("g",{fillRule:"nonzero",fill:"none"},o.a.createElement("path",{d:"M.52124097 23.12346c1.1077-2.9952571 2.4707-5.8635571 3.89508572-8.1808C8.23468383 8.72614571 17.4631981.05566 23.8178267.05566c1.0630571 0 2.0228857.23577143 2.8529571.70172857 1.3881143.78125714 2.3381715 2.17075714 2.8236572 4.12945714C31.0973981 11.3502886 27.3599553 22.6421457 23.9768695 27.89326c-1.8024571 2.7943571-4.3457 5.7854286-7.0703142 8.3286857C18.4230124 39.9496314-2.68050189 22.5919314.52124097 23.12346z",fill:"#FFCA3A"}),o.a.createElement("path",{d:"M5.88116954 25.1058886c.97795715-2.6437 2.1861-5.1911286 3.40262857-7.1707572C13.050541 11.8037171 21.1239267 4.75293143 23.788541 5.76996c2.0824285 1.37882857-1.6322572 14.3987143-4.6149572 19.0290143-1.536 2.3800286-3.7834857 5.0223143-6.1663 7.2461-.7651143-1.1467572-1.8275714-2.5236714-3.26729997-3.9141429-1.37687143-1.3297-2.72652857-2.3123285-3.85881429-3.0250428z",fill:"#ED69AB"})));var w=()=>o.a.createElement(o.a.Fragment,null,o.a.createElement("title",null,"Easter bunny - eyes and nose"),o.a.createElement("g",{fill:"#444",fillRule:"nonzero"},o.a.createElement("path",{d:"M.90472674 8.99584399c2.74085003.33653407 4.68991811 2.83122741 4.35338405 5.57207751-.14122056 1.1501491-.66582961 2.1538328-1.42827251 2.9096051l.02155026-.033559c-.29718086.4016151-.44174483.6949895-.43369189.8801234.00805293.1851339.06770527.4164406.17895702.69392l.22780297.4902169c.71471582 1.4864853 1.36458452 2.3467141 1.904725 2.5661605.52176099.2119794 1.11876984-.367668 1.73951555-2.002382l.16243825-.4505538c.08961326-.2611974.37400147-.4002938.63519886-.3106806.26119739.0896133.40029381.3740015.31068055.6351989-.84494502 2.4627766-1.8976385 3.5938393-3.22423148 3.0548755-1.04273744-.4236399-2.26408063-2.33244-3.34632177-5.0376669l-.22156463-.7730561C.89682689 14.6373453.55365859 11.8550647.90472674 8.99584399zM22.9999996 10c-2.7571667 0-5-2.24283333-5-5s2.2428333-5 5-5 5 2.24283333 5 5-2.2428333 5-5 5z"})))},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"h",(function(){return a})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return g})),n.d(t,"c",(function(){return b})),n.d(t,"g",(function(){return v})),n.d(t,"d",(function(){return y})),n.d(t,"f",(function(){return w})),n.d(t,"i",(function(){return x}));var r=n(1);const o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return Object(r.b)(["animation-timing-function:ease;animation-iteration-count:1;animation-fill-mode:forwards;animation-duration:","ms;"],e)},a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;return Object(r.b)(["height:0;width:0;padding:0;transition:width 0s ease ","ms,padding 0s ease ","ms,height 0s ease ","ms;"],e,e,e)},i=Object(r.d)(["0%{opacity:0;transform:translateY(-10px);}100%{opacity:1;transform:translateY(0);}"]),c=Object(r.d)(["0%{opacity:0;transform:translateY(10px);}100%{opacity:1;transform:translateY(0);}"]),s=Object(r.d)(["0%{opacity:0;transform:translateX(-15px);}100%{opacity:1;transform:translateX(0);}"]),u=Object(r.d)(["0%{opacity:0;transform:translateX(-15px);}100%{opacity:0.8;transform:translateX(0);}"]),l=Object(r.d)(["0%{opacity:0;transform:translateX(15px);}100%{opacity:1;transform:translateX(0);}"]),d=Object(r.d)(["0%{opacity:0;transform:translateY(-100%);}100%{opacity:1;transform:translateY(0);}"]),f=Object(r.d)(["0%{opacity:0;}100%{opacity:1;}"]),p=Object(r.d)(["50%{opacity:0.5;}"]),h=Object(r.d)(["50%{opacity:0.2;}"]),m=Object(r.d)(["10%{transform:translateY(-5px);}50%{opacity:0.5;transform:translateY(0);}"]),g=Object(r.b)([""," animation-name:",""],o(),f),b=Object(r.b)([""," animation-name:",""],o(),i),v=Object(r.b)([""," animation-name:",""],o(),c),y=Object(r.b)([""," animation-name:",""],o(),s),w=(Object(r.b)([""," animation-name:",""],o(),u),Object(r.b)([""," animation-name:",""],o(),l)),x=(Object(r.b)([""," animation-name:",""],o(),d),Object(r.b)(["animation:1.8s "," infinite 0.3s;"],h));Object(r.b)(["animation:1.8s "," infinite 0.3s;"],m)},function(e,t,n){"use strict";n.d(t,"f",(function(){return i})),n.d(t,"g",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return d})),n.d(t,"e",(function(){return f}));var r=n(1),o=n(22),a=n(7);const i=r.c.p.withConfig({displayName:"typography__Paragraph",componentId:"sc-ifap29-0"})(["color:",";font-size:",";font-weight:normal;line-height:170%;font-family:",";"],a.a.darkColor,a.c.fontSizeP,o.a.default),c=Object(r.c)(i).withConfig({displayName:"typography__SmallParagraph",componentId:"sc-ifap29-1"})(["font-size:",";opacity:0.6;"],a.c.fontSizeSmall),s=r.c.h2.withConfig({displayName:"typography__H2",componentId:"sc-ifap29-2"})(["color:",";font-size:",";font-weight:normal;margin:0 0 30px;line-height:30px;font-family:",";"],a.a.darkColor,a.c.fontSizeH2,o.a.default),u=r.c.h3.withConfig({displayName:"typography__H3",componentId:"sc-ifap29-3"})(["color:",";font-size:",";font-weight:normal;line-height:30px;margin:0 0 15px;font-family:",";"],a.a.darkColor,a.c.fontSizeH3,o.a.default),l=r.c.h4.withConfig({displayName:"typography__H4",componentId:"sc-ifap29-4"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;font-family:",";"],a.a.darkColor,a.c.fontSizeH4,o.a.default),d=r.c.h5.withConfig({displayName:"typography__H5",componentId:"sc-ifap29-5"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;line-height:24px;font-family:",";"],a.a.darkColor,a.c.fontSizeH5,o.a.default),f=(r.c.h6.withConfig({displayName:"typography__H6",componentId:"sc-ifap29-6"})(["color:",";font-size:",";font-weight:normal;margin:0 0 10px;font-family:",";"],a.a.darkColor,a.c.fontSizeBase,o.a.default),r.c.span.withConfig({displayName:"typography__KindlySpan",componentId:"sc-ifap29-7"})(["color:",";font-family:",";opacity:1;a{color:",";text-decoration:none;:hover,:focus,:active,:visited{color:",";}}"],a.a.primaryColor,o.a.KindlySans,a.a.primaryColor,a.a.primaryColor))},function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u})),n.d(t,"e",(function(){return d})),n.d(t,"d",(function(){return f}));var r=n(1),o=n(22),a=n(14),i=n(7);const c=r.c.a.withConfig({displayName:"utils__Link",componentId:"sc-g08yf6-0"})(["text-decoration:underline;cursor:pointer;",""],a.b),s=r.c.button.withConfig({displayName:"utils__Button",componentId:"sc-g08yf6-1"})(["border:0;text-align:center;border-radius:100px;font-weight:normal;background:none;cursor:pointer;text-transform:none;transition:all 0.2s ease;",""],a.b),u=r.c.div.withConfig({displayName:"utils__InputContainer",componentId:"sc-g08yf6-2"})(["overflow:",";max-height:83px;min-height:41px;height:","px;width:100%;min-width:0;@media ","{height:","px;}"],e=>{let{hasFiles:t}=e;return t?"visible":"hidden"},e=>e.active?e.targetHeight:"41",i.b.maxTablet,e=>e.active?e.targetHeight:"44"),l=Object(r.b)(["max-height:41px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]),d=Object(r.b)(["position:relative;z-index:2;margin-bottom:0;color:",";font-size:",";line-height:1.5;padding:10px 16px;background:",";background-color:",";background-image:none;border:0;resize:none;box-shadow:none;border-radius:21px;max-height:83px;font-family:",";width:100%;min-height:0;transition:transform 0.3s ease;",";",";&:focus{color:",";box-shadow:none;border:none;","}@media ","{font-size:16px;",";}"],e=>e.theme.inputText,i.c.fontSizeP,e=>e.theme.inputBackground,e=>e.theme.inputBackground,o.a.default,e=>e.$hide&&"transform: translateY(-60px)",e=>!e.$active&&l,e=>e.theme.inputText,a.b,i.b.maxTablet,e=>!e.$active&&"max-height: 44px;"),f=Object(r.b)(["position:relative;&:before{content:'';left:0;right:20px;top:-15px;z-index:1;height:20px;position:absolute;background:linear-gradient( 0deg,"," 0%,"," 25%,rgba(248,248,248,0) 100% );opacity:1;transition:opacity linear 300ms;","}"],e=>e.theme.background,e=>e.theme.background,e=>{let{inspectorOpen:t}=e;return t?"height: 0":""})},function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return a}));var r=n(1);const o=e=>Object(r.b)(["margin-inline-start:",";@supports not (margin-inline-start:","){",";}"],e,e,t=>t.isTextDirectionRtl?`margin-right: ${e}`:`margin-left: ${e}`),a=()=>"\n #chatContainer:not(.using-tab) & {\n outline: none;\n }\n"},function(e,t,n){"use strict";function r(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}n.d(t,"a",(function(){return r}))},function(e,t){e.exports=n},function(e,t,n){"use strict";var r=n(3),o=n(6);t.a=()=>{const{languages:e,includeDisabledLanguages:t}=Object(r.d)(o.d),n=e.filter(e=>{let{active:t}=e;return t}),a=n[0];return t?{languages:e,defaultLanguage:a}:{languages:n,defaultLanguage:a}}},function(e,t,n){"use strict";t.a=(e,t)=>-1!==t.indexOf(e)},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var r=n(15);function o(e){Object(r.a)(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}},function(e,t,n){"use strict";t.a=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(151),o=n.n(r),a=n(152),i=n.n(a),c=n(153);const s={default:"'IBMPlex', 'Helvetica Neue', Helvetica, Arial, sans-serif",KindlySans:"KindlySans"};n.n(c).a,i.a,o.a},function(e,t,n){"use strict";function r(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return a})),n.d(t,"d",(function(){return i})),n.d(t,"e",(function(){return c})),n.d(t,"f",(function(){return s}));const r="RESET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT",o="RESET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL",a="RESET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL",i="SET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT",c="SET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL",s="SET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL"},function(e,t,n){"use strict";n(4);var r=n(0),o=n.n(r),a=n(55),i=n(39);const c=e=>{let{loading:t,color:n,flat:r}=e;return o.a.createElement(i.c,{flat:r,color:n?1:0,loading:t?1:0},o.a.createElement(i.b,null),o.a.createElement(i.b,null),o.a.createElement(i.b,null))},s=o.a.forwardRef((e,t)=>{let{children:n,loading:r,type:a,color:s,selected:u,onClick:l,text:d,flat:f,shape:p,disabled:h,style:m,cy:g}=e;return o.a.createElement(i.a,{color:s?1:0,style:m,flat:f,type:a,shape:p,tabIndex:"0",hasChild:n,onClick:l,disabled:h,loading:r?1:0,selected:u,"data-cy":g,ref:t},n||d,o.a.createElement(c,{flat:f,color:s,loading:r}))});s.defaultProps={type:"button",color:!1,selected:!1,loading:!1,shape:"oval",flat:!1,disabled:!1,onClick:a.a},s.displayName="Button",t.a=s},function(e,t){e.exports=function(e){return"function"==typeof e}},function(e,t,n){"use strict";var r=n(37);t.a=(e,t,n)=>Object.entries(e).reduce((e,o)=>{let[a,i]=o;return{...e,[a]:"string"==typeof i?i:Object(r.a)(i,t,n)}},{})},function(e,t,n){"use strict";n.d(t,"c",(function(){return s})),n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return l}));var r=n(5);function o(e){const t=function(e){if(!e)return null;const t=e.match(/^[A-Za-z0-9-_=]+\.([A-Za-z0-9-_=]+)\.?[A-Za-z0-9-_.+/=]*$/);if(!t)return null;try{return JSON.parse(atob(t[1]))}catch(e){return null}}(e);return!t||t.exp-Math.floor((new Date).getTime()/1e3)<30}var a=n(2),i=n(9);const c=()=>({type:a.xb}),s=e=>async(t,n)=>{const{connection:{token:o},environment:{PAT_HOST:c}}=n();if(!o)throw new Error("Token missing");const{headers:s}=Object(i.a)({token:o},{withCurrentUrl:!0}),{data:u,status:l}=await t(Object(i.f)({method:"post",url:`${c}/chatbubble/${r.j}/auth/identify`,headers:s,data:{avatar_url:e.avatar_url,full_name:e.full_name,email:e.email,phone_number:e.phone_number}}));200===l&&t({type:a.E,avatarUrl:u.avatar_url,fullName:u.full_name})},u=()=>async(e,t)=>{const{chatbubble:{chatId:n},connection:{token:o},auth:{getAuthToken:s},environment:{PAT_HOST:u}}=t();if(!n||!s)return void e(c());let l;try{l=await s(n)}catch(e){console.error("Chatbubble auth failed:",e),l=null}if(!l)return void e(c());const{headers:d}=Object(i.a)({jwt:l,token:o},{withCurrentUrl:!0}),f=await e(Object(i.f)({method:"post",url:`${u}/chatbubble/${r.j}/auth/chat`,headers:d},{onError:()=>e(c())}));null!=f&&f.data&&e({type:a.h,token:l,avatarUrl:f.data.avatar_url,fullName:f.data.full_name})},l=()=>async(e,t)=>{const{auth:{isAuthenticated:n,isRefreshing:r,token:i,getAuthToken:c}}=t();if(!n)return null;if(r)return await new Promise(e=>setTimeout(e,200)),l()(e,t);c&&o(i)&&(e({type:a.rb}),await e(u()),e({type:a.C}));const{auth:s}=t();return s.isAuthenticated?{Authorization:`Bearer ${s.token}`}:null}},function(e,t,n){"use strict";t.a=function(e,t){var n;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return null!==(n=t.split(".").reduce((e,t)=>e?e[t]:void 0,e))&&void 0!==n?n:r}},function(e,t,n){"use strict";var r=n(114),o=Object.prototype.toString;function a(e){return"[object Array]"===o.call(e)}function i(e){return void 0===e}function c(e){return null!==e&&"object"==typeof e}function s(e){if("[object Object]"!==o.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function u(e){return"[object Function]"===o.call(e)}function l(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),a(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.call(null,e[o],o,e)}e.exports={isArray:a,isArrayBuffer:function(e){return"[object ArrayBuffer]"===o.call(e)},isBuffer:function(e){return null!==e&&!i(e)&&null!==e.constructor&&!i(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:s,isUndefined:i,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:u,isStream:function(e){return c(e)&&u(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:l,merge:function e(){var t={};function n(n,r){s(t[r])&&s(n)?t[r]=e(t[r],n):s(n)?t[r]=e({},n):a(n)?t[r]=n.slice():t[r]=n}for(var r=0,o=arguments.length;r<o;r++)l(arguments[r],n);return t},extend:function(e,t,n){return l(t,(function(t,o){e[o]=n&&"function"==typeof t?r(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},function(e,t,n){"use strict";n.d(t,"e",(function(){return l})),n.d(t,"f",(function(){return d})),n.d(t,"a",(function(){return f})),n.d(t,"c",(function(){return p})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return m}));var r=(e,t)=>{const{type:n}=e;let r;return"Form"===n?r=(e=>{let{title:t,body_text:n,input_label:r,input_placeholder:o,languageCode:a}=e;return{sections:[{title:t[a],description:n[a]},{form:{input:{label:r[a],placeholder:o[a],required:!0},button:{title:"Send skjema",icon:"icon",type:"submit"}}}]}})({...e,languageCode:t}):"Product"===n?r=(e=>{var t;let{title:n,body_text:r,button_text:o,button_link:a,carousel_title:i,image_carousel:c,languageCode:s}=e;return{sections:[{title:n[s],description:r[s],buttons:[{label:o[s],value:a[s],button_type:"link",is_active:!0}]},{products:{title:i[s],items:null===(t=c[s])||void 0===t?void 0:t.map(e=>{let{title:t,alt_text:n,description:r,image_url:o,product_url:a,link_text:i,link_url:c,price:s}=e;return{title:t,image:o,linkText:i,linkUrl:c,productUrl:a,altText:n,description:r,price:s}})}}]}})({...e,languageCode:t}):"Text"===n?r=(e=>{let{title:t,body_text:n,link_text:r,link_location:o,languageCode:a}=e;return{sections:[{title:t[a],description:n[a]},{link:{text:r[a],location:o[a]}}]}})({...e,languageCode:t}):"Multiple choice"===n?r=(e=>{let{title:t,body_text:n,button_blocks:r,languageCode:o}=e;return{sections:[{title:t[o],description:n[o]},{choices:{buttons:r.map(e=>{let{button_text:t,dialogue_id:n}=e;return{text:t[o],triggerDialogue:n}})}}]}})({...e,languageCode:t}):"Custom"===n&&(r={}),r},o=n(5),a=n(49),i=n(2),c=n(28),s=n(9);const u=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=t.find(e=>{let{active:t}=e;return t}),o=n||r.code;return e.enabled[o]},l=e=>{let{slug:t,eventType:n,label:r}=e;return async(e,l)=>{if(!t||!n)return;const{nudges:d,languages:f}=l().bot,{currentLanguage:p}=l().chatbubble,h=(e=>{var t,n,r,o,a;return[...null!==(t=null==e?void 0:e.form_nudges)&&void 0!==t?t:[],...null!==(n=null==e?void 0:e.custom_nudges)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.product_nudges)&&void 0!==r?r:[],...null!==(o=null==e?void 0:e.text_nudges)&&void 0!==o?o:[],...null!==(a=null==e?void 0:e.multiple_choice_nudges)&&void 0!==a?a:[]]})(d).find(e=>e.slug===t&&u(e,f,p));h&&(e({type:i.t,slug:t}),n!==i.u&&n!==i.W||await e((e=>{let{targetNudge:t,eventType:n,label:r,currentLanguage:i}=e;return async(e,u)=>{const{botKey:l}=u().chatbubble,{PAT_HOST:d}=u().environment,{token:f}=u().connection,p=await e(Object(c.b)());e(Object(s.f)({method:"post",url:`${d}/chatbubble/${o.j}/nudge/`,data:{session_id:Object(a.b)(),nudge_id:t.id,action:n,type:t.type,label:r||null,language_code:i},...Object(s.a)({botKey:l,token:f},{withCurrentUrl:!0,extra:p})}))}})({targetNudge:h,eventType:n,label:r,currentLanguage:p})))}},d=e=>(t,n)=>{const{show:r,slug:o}=n().nudge;r&&t(l({slug:o,eventType:i.u,label:e}))},f=(e,t)=>(n,r)=>{const{show:o,isCustom:a,slug:c,trackEvent:s}=r().nudge;if(o){if(n({type:i.A}),a){const e=document.getElementById("kindly-custom-nudge");e&&e.parentNode.removeChild(e)}s&&n(l({slug:c,eventType:e?i.u:i.A,label:t}))}},p=e=>{let{nudgeLayout:t,slug:n,trackEvent:a}=e;return(e,c)=>{var s,d,f,p,h,m,g;const{nudges:b,languages:v}=c().bot,{currentLanguage:y}=c().chatbubble,{show:w}=c().pushMessages,x=null==t?void 0:t.language;let O,E=null!==(s=null==t?void 0:t.webhook)&&void 0!==s?s:null,k=null!==(d=null==t?void 0:t.dialogueId)&&void 0!==d?d:null,C=t;const _=v.filter(e=>{let{active:t}=e;return t})[0],j=[...null!==(f=null==b?void 0:b.form_nudges)&&void 0!==f?f:[],...null!==(p=null==b?void 0:b.custom_nudges)&&void 0!==p?p:[],...null!==(h=null==b?void 0:b.product_nudges)&&void 0!==h?h:[],...null!==(m=null==b?void 0:b.text_nudges)&&void 0!==m?m:[],...null!==(g=null==b?void 0:b.multiple_choice_nudges)&&void 0!==g?g:[]],T=x||y||_.code,S=n||t.slug;if(S){var I,A,N,P,M,R,L;if(O=j.filter(e=>e.slug===S)[0],void 0===O)return;if(k=null!==(I=null===(A=O)||void 0===A?void 0:A.dialogue_id)&&void 0!==I?I:k,E=null!==(N=null===(P=O)||void 0===P?void 0:P.webhook)&&void 0!==N?N:E,C=r(O,T),C.sections=[...null!==(M=null===(R=C)||void 0===R?void 0:R.sections)&&void 0!==M?M:[],...null!==(L=null==t?void 0:t.sections)&&void 0!==L?L:[]],C.backdrop=null==t?void 0:t.backdrop,!u(O,v,T))return}else console.error("Please set up a nudge in the platform to get a slug!");a&&e(l({slug:S,eventType:i.mb})),w&&e({type:i.B}),e({slug:S,type:i.mb,nudgeLayout:C,dialogue:k,webhook:E,nudgeType:o.i.TEMPLATE,trackEvent:a})}},h=e=>{let{content:t,slug:n,onRendered:r,trackEvent:a}=e;return(e,c)=>{const{show:s}=c().pushMessages;a&&e(l({slug:n,eventType:i.kb})),s&&e({type:i.B}),e({type:i.kb,content:t,slug:n,onRendered:r,nudgeType:o.i.CUSTOM})}},m=e=>{let{nudge:t,languageCode:n}=e;return e=>{const{autopopupTime:o}=t,a=r(t,n);o&&0!==o?setTimeout(()=>e({type:i.mb,nudgeLayout:a}),o):e({type:i.mb,nudgeLayout:a})}}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return d})),n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return p})),n.d(t,"f",(function(){return h}));var r=n(1),o=n(14),a=n(12),i=n(13),c=n(7);const s=r.c.div.withConfig({displayName:"styles__Heading",componentId:"sc-155a8qj-0"})(["display:flex;align-items:center;"]),u=Object(r.c)(s).withConfig({displayName:"styles__HeaderContainer",componentId:"sc-155a8qj-1"})(["height:55px;min-height:55px;text-align:left;padding:15px;align-items:center;color:#fff;min-width:100%;z-index:",";justify-content:space-between;background:",";background-color:",";box-shadow:0 3px 4px -1px ",";"],c.d.headerIndex,e=>e.theme.headerBackground,e=>e.theme.headerBackground,c.a.shadowColor),l=Object(r.c)(s).withConfig({displayName:"styles__HeadingLeft",componentId:"sc-155a8qj-2"})(["overflow:hidden;"]),d=Object(r.c)(s).withConfig({displayName:"styles__HeadingRight",componentId:"sc-155a8qj-3"})(["align-items:center;"]),f=Object(r.c)(a.c).withConfig({displayName:"styles__BotName",componentId:"sc-155a8qj-4"})(["margin:0;",";text-transform:none;letter-spacing:normal;max-width:100%;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;line-height:1.3;color:",";"],Object(o.a)("20px"),e=>e.theme.headerText),p=Object(r.c)(i.a).withConfig({displayName:"styles__HeaderButton",componentId:"sc-155a8qj-5"})(["min-height:25px;display:flex;align-items:center;font-size:",";padding:0;background:#fff;background-color:#fff;svg{path{stroke:",";}}:hover{opacity:0.8;}~ button{",";}"],c.c.fontSizeH4,e=>e.theme.buttonBackground,Object(o.a)("15px")),h=r.c.div.withConfig({displayName:"styles__StyledAvatar",componentId:"sc-155a8qj-6"})(["border-radius:100px;display:inline-block;width:30px;height:30px;background-image:url(",");background-size:contain;background-repeat:no-repeat;background-position:center;"],e=>e.avatar)},function(e,t,n){"use strict";function r(e,t,n){return o(e)?n:t}function o(e){let t=e;i(e)&&(t=function(e){const t=e.indexOf(",")>-1?",":" ";let n=(+(e=e.substr(4).split(")")[0].split(t))[0]).toString(16),r=(+e[1]).toString(16),o=(+e[2]).toString(16);1===n.length&&(n=`0${n}`);1===r.length&&(r=`0${r}`);1===o.length&&(o=`0${o}`);return`#${n}${r}${o}`}(e)),c(e)&&(t=e.replace(a,(e,t,n,r)=>`#${t}${t}${n}${n}${r}${r}`));const n="#"===t.charAt(0)?t.substring(1,7):t,r=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return.2126*r[0]+.7152*r[1]+.0722*r[2]>.179}n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const a=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,i=e=>e.match(/^rgb/),c=e=>e.match(a)},function(e,t,n){(function(t){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,n(78))},function(e,t,n){var r=n(34),o=n(133),a=n(41),i=n(135),c=n(131),s=n(130),u=o("wks"),l=r.Symbol,d=s?l:l&&l.withoutSetter||i;e.exports=function(e){return a(u,e)&&(c||"string"==typeof u[e])||(c&&a(l,e)?u[e]=l[e]:u[e]=d("Symbol."+e)),u[e]}},function(e,t,n){"use strict";var r=n(4),o=n.n(r);o.a.shape({chat_deleted_header:o.a.string,chat_deleted_text:o.a.string,back_to_chat_button:o.a.string,delete_text:o.a.string,delete_button:o.a.string,binary_headline:o.a.string,binary_1:o.a.string,binary_0:o.a.string,emoji_guideline:o.a.string,emoji_headline:o.a.string,freeform_description:o.a.string,freeform_placeholder:o.a.string,send:o.a.string})},function(e,t,n){"use strict";t.a=(e,t,n)=>e?e[t||n]||e.en:null},function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"e",(function(){return h})),n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return b})),n.d(t,"i",(function(){return v})),n.d(t,"f",(function(){return y})),n.d(t,"h",(function(){return w})),n.d(t,"g",(function(){return x})),n.d(t,"d",(function(){return O}));var r=n(5),o=n(87),a=n(88),i=n(89),c=n(2),s=n(24),u=n(9);const l=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[n.replace(/_\w/g,e=>e[1].toUpperCase())]:r}},{})},d=e=>async(t,n)=>{if(!(null!=e&&e.length)>0)return;const{attachments:o=[]}=n().messages,{newAttachments:i=[],updated:s=[]}=Object(a.a)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(e=>{let{sender:t,status:n}=e;return t===r.l.USER||n===r.a.CLEAN})}(e),e=>o.find((e=>{let{id:t,temporaryId:n}=e;return e=>{let{id:r,temporaryId:o}=e;return t&&t===r||n&&n===o}})(e))?"updated":"newAttachments");i.length>0&&t({type:c.G,data:{attachments:i}}),s.length>0&&t({type:c.F,data:{attachments:s}})},f=function(){let{status:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e!==r.a.PROCESSING},p=()=>async(e,t)=>{const{agent:{takenOver:n,requestedTakeover:a},chatbubble:{active:s,startedAt:p,chatHasStarted:h,botKey:g},connection:{token:b},environment:{PAT_HOST:v},messages:{attachments:y,buttonClicks:w,chatMessages:x,messageSentTime:O}}=t();if(!b||!h)return;const[E]=x.filter(e=>{let{from_bot:t}=e;return t}).slice(-1),[k]=y.filter(f).slice(-1),C=((e,t)=>{let{created:n}=e,{created:r}=t;return n&&r?new Date(n)>new Date(r)?n:r:n||r})(null!=E?E:{},null!=k?k:{})||O||p||(new Date).toISOString(),_=await e(Object(u.f)({method:"get",url:`${v}/chatbubble/${r.j}/latest`,params:{timestamp:C},...Object(u.a)({token:b})},{onError:t=>{403===t.response.status?(console.warn(`/chatbubble/${r.j}/latest returned 403, starting new chat`),e({type:c.Z,error:403}),e(Object(u.d)(g,!0))):console.error(t)}}));if(!_||!_.data)return;const{chatMessages:j,buttonClicks:T=[],takenOver:S,requestedTakeover:I,attachments:A}=_.data,N=Object(i.a)(x),P=Object(o.a)(w),M=j.filter(N),R=T.map(l).filter(P),L=M.length>0;var D,B;e(d(A)),e(m(L)),n!==S&&e({type:c.sb,data:{taken_over:S}}),a!==I&&e({type:c.ub,requestedTakeover:I}),(D=M,B="created",(D||[]).slice().sort((e,t)=>e[B]<t[B]?-1:1)).forEach(t=>{e({type:c.I,data:t,skipTypingIndicator:!0,force:!0})}),R.forEach(t=>e({type:c.j,buttonClick:t,force:!0})),L&&!s&&e({type:c.K})},h=()=>(e,t)=>{const{replyTimeoutId:n,takeoverPollIntervalId:o}=t().websocketFallback;if(clearTimeout(n),o)return;const a=setTimeout(()=>e(p()),r.p.REPLY_TIMEOUT_MS);e({type:s.d,replyTimeoutId:a,replyTimeoutAttempts:1})},m=e=>(t,n)=>{const{replyTimeoutId:o,replyTimeoutAttempts:a}=n().websocketFallback;if(clearTimeout(o),0===a)return;if(!(!e&&a<r.p.REPLY_TIMEOUT_MAX_ATTEMPTS))return e||console.error(`Reply timeout failed more than ${r.p.REPLY_TIMEOUT_MAX_ATTEMPTS} times`),void t({type:s.a});const i=r.p.REPLY_TIMEOUT_MS*r.p.REPLY_TIMEOUT_MS_MULTIPLIER**a,c=setTimeout(()=>t(p()),i);t({type:s.d,replyTimeoutId:c,replyTimeoutAttempts:a+1})},g=()=>(e,t)=>{const{replyTimeoutId:n}=t().websocketFallback;clearTimeout(n),e({type:s.a})},b=()=>(e,t)=>{const{takeoverPollIntervalId:n,takeoverRequestPollIntervalId:o}=t().websocketFallback;if(clearInterval(n),clearInterval(o),"number"==typeof n){const t=setInterval(()=>e(p()),r.p.TAKEOVER_POLL_INTERVAL_MS);e({type:s.e,takeoverPollIntervalId:t})}if("number"==typeof o){const t=setInterval(()=>e(p()),r.p.TAKEOVER_REQUEST_POLL_INTERVAL_MS);e({type:s.f,takeoverRequestPollIntervalId:t})}},v=()=>(e,t)=>{const{takeoverPollIntervalId:n,takeoverRequestPollIntervalId:o,replyTimeoutId:a}=t().websocketFallback;if(clearTimeout(a),clearTimeout(o),e({type:s.a}),e({type:s.c}),n)return;const i=setInterval(()=>e(p()),r.p.TAKEOVER_POLL_INTERVAL_MS);e({type:s.e,takeoverPollIntervalId:i})},y=()=>(e,t)=>{const{takeoverPollIntervalId:n}=t().websocketFallback;clearInterval(n),e({type:s.b})},w=()=>(e,t)=>{const{takeoverRequestPollIntervalId:n}=t().websocketFallback;if(n)return;const o=setInterval(()=>e(p()),r.p.TAKEOVER_REQUEST_POLL_INTERVAL_MS);e({type:s.f,takeoverRequestPollIntervalId:o})},x=()=>(e,t)=>{const{takeoverRequestPollIntervalId:n}=t().websocketFallback;clearInterval(n),e({type:s.c})},O=()=>(e,t)=>{const{messages:{chatMessages:n}}=t();n.find(e=>e.triggered_chat_start||"greeting"===e.exchange_type)||e(p())}},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return h})),n.d(t,"a",(function(){return m}));var r=n(44),o=n(1),a=n(11),i=n(22),c=n(13),s=n(7);const u=o.c.div.withConfig({displayName:"styles__LoadingIndicatorContainer",componentId:"sc-xokaop-0"})(["position:absolute;width:100%;height:100%;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;border-radius:100px;transition:all cubic-bezier(0.61,0.1,0.42,0.9) 150ms;",";",";"],e=>e.loading?"opacity: 1":"opacity: 0;",e=>e.color?`background-color: ${e.theme.buttonBackground}; background: ${e.theme.buttonBackground}`:"background-color: #fff; background: #fff"),l=o.c.span.withConfig({displayName:"styles__LoadingIndicator",componentId:"sc-xokaop-1"})(["width:6px;height:6px;opacity:0;border-radius:50%;background:",";background-color:",";&:nth-of-type(1){animation:1s "," infinite 0.3s;}&:nth-of-type(2){margin:0 5px;animation:1s "," infinite 0.6s;}&:nth-of-type(3){animation:1s "," infinite 0.9s;}"],e=>e.theme.buttonText,e=>e.theme.buttonText,a.b,a.b,a.b),d=Object(o.b)(["min-width:190px;min-height:41px;padding:11px 20px;font-size:",";"],s.c.fontSizeP),f=Object(o.b)(["color:",";background:",";background-color:",";border-color:",";"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>Object(r.a)(.08,e.theme.buttonBackground)),p=Object(o.b)(["color:#000;background:#d8d8d8;background-color:#d8d8d8;border-color:#d8d8d8;"]),h=Object(o.b)(["position:relative;border-radius:100px;font-weight:normal;border:1px solid #dedede;background-color:#fff;background:#fff;color:",";",";display:",";box-shadow:",";justify-content:center;align-items:center;"," "," transition:all 0.2s ease;:hover{",";box-shadow:",";}:active{text-decoration:none;box-shadow:none;}"],s.f.textColor,e=>e.loading?"opacity: 0.6":"opacity: 1;",e=>{let{hasChild:t}=e;return t?"flex":"block"},e=>{let{flat:t,disabled:n}=e;return t||n?"none":"0 2px 4px 0 rgba(0, 0, 0, 0.08)"},e=>e.selected&&p,e=>{let{color:t}=e;return t&&f},e=>{let{color:t}=e;return t?f:"background-color: #fff; background: #fff"},e=>{let{disabled:t,flat:n}=e;return t||n?"none":`0 2px 4px 0 ${s.a.shadowColorDark}`}),m=Object(o.c)(c.a).withConfig({displayName:"styles__ButtonContainer",componentId:"sc-xokaop-2"})(["",";",";font-family:",";"],h,d,e=>{let{theme:t}=e;return t.customFont?t.customFont:i.a.default})},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"a",(function(){return l}));var r=n(1),o=n(11),a=n(13),i=n(7);const c=r.c.div.withConfig({displayName:"styles__NudgeContainer",componentId:"sc-1k0o2t4-0"})(["right:20px;bottom:",";z-index:10;position:fixed;border-radius:14px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";",";",";@media ","{",";z-index:16;box-shadow:0 -3px 15px 1px ",";}"],e=>{let{bubbleHidden:t}=e;return t?"30px":"100px"},i.a.shadowColor,o.f,e=>{let{theme:t}=e;return t.customFont&&`font-family: ${t.customFont}`},i.b.maxPhone,e=>{let{modal:t}=e;return!t&&"\n left: 0px;\n right: 0px;\n bottom: 0px;\n border-radius: 14px 14px 0 0;"},i.a.shadowColor),s=r.c.div.withConfig({displayName:"styles__NudgeInner",componentId:"sc-1k0o2t4-1"})(["position:relative;padding:0px;max-width:380px;width:100%;max-height:calc(100vh - 150px);overflow-y:auto;",";@media ","{min-width:380px;}@media ","{min-width:100%;}"],e=>{let{modal:t}=e;return t&&"box-sizing: border-box"},i.b.minTablet,i.b.maxPhone),u=Object(r.c)(a.a).withConfig({displayName:"styles__NudgeDismiss",componentId:"sc-1k0o2t4-2"})(["top:8px;right:8px;z-index:15;display:flex;padding:0;border-radius:100px;position:absolute;&:hover{opacity:0.8;}svg path{stroke:",";}@media ","{",";}"],e=>{let{theme:t}=e;return t.buttonBackground||t.bubbleButtonBackground},i.b.maxPhone,e=>{let{modal:t}=e;return t?"top: 2px; right: 0;":"top: 8px; right: 8px;"}),l=r.c.div.withConfig({displayName:"styles__BorderElement",componentId:"sc-1k0o2t4-3"})(["position:absolute;background:#fff;width:100%;height:100%;left:0;right:0;top:0;bottom:0;border-radius:14px;@media ","{border-radius:",";}&:before{content:'';width:50px;height:calc(100% - 8px);background:",";position:absolute;z-index:-1;top:4px;left:-4px;border-radius:25px;@media ","{width:calc(100% - 8px);height:50px;top:-4px;left:4px;}}"],i.b.maxPhone,e=>{let{modal:t}=e;return t?"14px":"14px 14px 0 0"},e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground},i.b.maxPhone)},function(e,t,n){var r=n(134),o={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return o.call(r(e),t)}},function(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=n(5);t.a=e=>{const t=(null!=e?e:"").toUpperCase();return"LINK"===t?r.b.EXTERNAL_LINK:"TAKEOVER_REQUEST"===t?r.b.HANDOVER_REQUEST:t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return D}));var r=n(16);function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function c(e,t,n){return(c=i()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var a=new(Function.bind.apply(e,r));return n&&o(a,n.prototype),a}).apply(null,arguments)}function s(e){var t="function"==typeof Map?new Map:void 0;return(s=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return c(e,arguments,a(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),o(r,e)})(e)}var u=function(e){var t,n;function r(t){return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/master/src/internalHelpers/errors.md#"+t+" for more information.")||this)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,o(t,n),r}(s(Error));function l(e){return Math.round(255*e)}function d(e,t,n){return l(e)+","+l(t)+","+l(n)}function f(e,t,n,r){if(void 0===r&&(r=d),0===t)return r(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,i=a*(1-Math.abs(o%2-1)),c=0,s=0,u=0;o>=0&&o<1?(c=a,s=i):o>=1&&o<2?(c=i,s=a):o>=2&&o<3?(s=a,u=i):o>=3&&o<4?(s=i,u=a):o>=4&&o<5?(c=i,u=a):o>=5&&o<6&&(c=a,u=i);var l=n-a/2;return r(c+l,s+l,u+l)}var p={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var h=/^#[a-fA-F0-9]{6}$/,m=/^#[a-fA-F0-9]{8}$/,g=/^#[a-fA-F0-9]{3}$/,b=/^#[a-fA-F0-9]{4}$/,v=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,y=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,w=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,x=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function O(e){if("string"!=typeof e)throw new u(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return p[t]?"#"+p[t]:e}(e);if(t.match(h))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(m)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(g))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(b)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var o=v.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var a=y.exec(t);if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10),alpha:parseFloat(""+a[4])};var i=w.exec(t);if(i){var c="rgb("+f(parseInt(""+i[1],10),parseInt(""+i[2],10)/100,parseInt(""+i[3],10)/100)+")",s=v.exec(c);if(!s)throw new u(4,t,c);return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10)}}var l=x.exec(t);if(l){var d="rgb("+f(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",O=v.exec(d);if(!O)throw new u(4,t,d);return{red:parseInt(""+O[1],10),green:parseInt(""+O[2],10),blue:parseInt(""+O[3],10),alpha:parseFloat(""+l[4])}}throw new u(5)}function E(e){return function(e){var t,n=e.red/255,r=e.green/255,o=e.blue/255,a=Math.max(n,r,o),i=Math.min(n,r,o),c=(a+i)/2;if(a===i)return void 0!==e.alpha?{hue:0,saturation:0,lightness:c,alpha:e.alpha}:{hue:0,saturation:0,lightness:c};var s=a-i,u=c>.5?s/(2-a-i):s/(a+i);switch(a){case n:t=(r-o)/s+(r<o?6:0);break;case r:t=(o-n)/s+2;break;default:t=(n-r)/s+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:u,lightness:c,alpha:e.alpha}:{hue:t,saturation:u,lightness:c}}(O(e))}var k=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function C(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function _(e){return C(Math.round(255*e))}function j(e,t,n){return k("#"+_(e)+_(t)+_(n))}function T(e,t,n){return f(e,t,n,j)}function S(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return T(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return T(e.hue,e.saturation,e.lightness);throw new u(1)}function I(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?T(e,t,n):"rgba("+f(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?T(e.hue,e.saturation,e.lightness):"rgba("+f(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new u(2)}function A(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return k("#"+C(e)+C(t)+C(n));if("object"==typeof e&&void 0===t&&void 0===n)return k("#"+C(e.red)+C(e.green)+C(e.blue));throw new u(6)}function N(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var o=O(e);return"rgba("+o.red+","+o.green+","+o.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return r>=1?A(e,t,n):"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?A(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new u(7)}function P(e){if("object"!=typeof e)throw new u(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return N(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return A(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return I(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return S(e);throw new u(8)}function M(e){return function e(t,n,r){return function(){var o=r.concat(Array.prototype.slice.call(arguments));return o.length>=n?t.apply(this,o):e(t,n,o)}}(e,e.length,[])}function R(e,t,n){return Math.max(e,Math.min(t,n))}function L(e,t){if("transparent"===t)return t;var n=E(t);return P(Object(r.a)({},n,{lightness:R(0,1,n.lightness-parseFloat(e))}))}var D=M(L)},function(e,t,n){"use strict";n.d(t,"a",(function(){return la})),n.d(t,"b",(function(){return da}));var r={};n.r(r),n.d(r,"reversed",(function(){return ee})),n.d(r,"mirrored",(function(){return te})),n.d(r,"createReversedEasing",(function(){return ne})),n.d(r,"createMirroredEasing",(function(){return re})),n.d(r,"createExpoIn",(function(){return oe})),n.d(r,"createBackIn",(function(){return ae})),n.d(r,"createAnticipateEasing",(function(){return ie})),n.d(r,"linear",(function(){return ce})),n.d(r,"easeIn",(function(){return se})),n.d(r,"easeOut",(function(){return ue})),n.d(r,"easeInOut",(function(){return le})),n.d(r,"circIn",(function(){return de})),n.d(r,"circOut",(function(){return fe})),n.d(r,"circInOut",(function(){return pe})),n.d(r,"backIn",(function(){return he})),n.d(r,"backOut",(function(){return me})),n.d(r,"backInOut",(function(){return ge})),n.d(r,"anticipate",(function(){return be})),n.d(r,"bounceOut",(function(){return ve})),n.d(r,"bounceIn",(function(){return ye})),n.d(r,"bounceInOut",(function(){return we})),n.d(r,"cubicBezier",(function(){return je}));
|
|
12
2
|
/*! *****************************************************************************
|
|
13
3
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
14
4
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -22,4 +12,15 @@ MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
|
22
12
|
|
|
23
13
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
24
14
|
and limitations under the License.
|
|
25
|
-
***************************************************************************** */function Ji(e,t){function n(){this.constructor=e}Qi(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Zi=function(){return(Zi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function es(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function ts(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,s=a.length;i<s;i++,o++)r[o]=a[i];return r}var ns=0,rs="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-ns));ns=t+n,setTimeout((function(){return e(ns)}),n)},os=1/60*1e3,as=!0,is=!1,ss=!1,cs={delta:0,timestamp:0},ls=["read","update","preRender","render","postRender"],us=function(e){return is=e},ds=ls.reduce((function(e,t){var n,r,o,a,i,s,c,l,u;return e[t]=(n=us,r=[],o=[],a=0,i=!1,s=0,c=new WeakSet,l=new WeakSet,u={cancel:function(e){var t=o.indexOf(e);c.add(e),-1!==t&&o.splice(t,1)},process:function(e){var t,d;if(i=!0,r=(t=[o,r])[0],(o=t[1]).length=0,a=r.length)for(s=0;s<a;s++)(d=r[s])(e),!0!==l.has(d)||c.has(d)||(u.schedule(d),n(!0));i=!1},schedule:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var s=n&&i,u=s?r:o;c.delete(e),t&&l.add(e),-1===u.indexOf(e)&&(u.push(e),s&&(a=r.length))}}),e}),{}),ps=ls.reduce((function(e,t){var n=ds[t];return e[t]=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!1),is||gs(),n.schedule(e,t,r),e},e}),{}),fs=ls.reduce((function(e,t){return e[t]=ds[t].cancel,e}),{}),hs=function(e){return ds[e].process(cs)},ms=function(e){is=!1,cs.delta=as?os:Math.max(Math.min(e-cs.timestamp,40),1),as||(os=cs.delta),cs.timestamp=e,ss=!0,ls.forEach(hs),ss=!1,is&&(as=!1,rs(ms))},gs=function(){is=!0,as=!0,ss||rs(ms)},bs=function(){return cs},vs=ps,ys=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},ws=function(e){return e%1?Number(e.toFixed(5)):e},Es=/(-)?(\d[\d\.]*)/g,xs=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,_s=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,Cs={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},Ts=Zi(Zi({},Cs),{transform:ys(0,1)}),ks=Zi(Zi({},Cs),{default:1}),Os=function(e){return{test:function(t){return"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Ss=Os("deg"),Is=Os("%"),As=Os("px"),js=Os("vh"),Ns=Os("vw"),Ms=Zi(Zi({},Is),{parse:function(e){return Is.parse(e)/100},transform:function(e){return Is.transform(100*e)}}),Ps=ys(0,255),Rs=function(e){return void 0!==e.red},Ls=function(e){return void 0!==e.hue};var Ds=function(e){return function(t){if("string"!=typeof t)return t;for(var n={},r=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))}(t).replace(/(,|\/)/g," ").split(/ \s*/),o=0;o<4;o++)n[e[o]]=void 0!==r[o]?parseFloat(r[o]):1;return n}},Bs=Zi(Zi({},Cs),{transform:function(e){return Math.round(Ps(e))}});function Hs(e,t){return e.startsWith(t)&&_s.test(e)}var Us={test:function(e){return"string"==typeof e?Hs(e,"rgb"):Rs(e)},parse:Ds(["red","green","blue","alpha"]),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,a=void 0===o?1:o;return function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha;return"rgba("+t+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({red:Bs.transform(t),green:Bs.transform(n),blue:Bs.transform(r),alpha:ws(Ts.transform(a))})}},zs={test:function(e){return"string"==typeof e?Hs(e,"hsl"):Ls(e)},parse:Ds(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,a=void 0===o?1:o;return function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha;return"hsla("+t+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({hue:Math.round(t),saturation:Is.transform(ws(n)),lightness:Is.transform(ws(r)),alpha:ws(Ts.transform(a))})}},Fs=Zi(Zi({},Us),{test:function(e){return"string"==typeof e&&Hs(e,"#")},parse:function(e){var t="",n="",r="";return e.length>4?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),t+=t,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),$s={test:function(e){return"string"==typeof e&&_s.test(e)||Rs(e)||Ls(e)},parse:function(e){return Us.test(e)?Us.parse(e):zs.test(e)?zs.parse(e):Fs.test(e)?Fs.parse(e):e},transform:function(e){return Rs(e)?Us.transform(e):Ls(e)?zs.transform(e):e}},Gs=function(e){return"number"==typeof e?0:e},qs={test:function(e){if("string"!=typeof e||!isNaN(e))return!1;var t=0,n=e.match(Es),r=e.match(xs);return n&&(t+=n.length),r&&(t+=r.length),t>0},parse:function(e){var t=e,n=[],r=t.match(xs);r&&(t=t.replace(xs,"${c}"),n.push.apply(n,r.map($s.parse)));var o=t.match(Es);return o&&n.push.apply(n,o.map(Cs.parse)),n},createTransformer:function(e){var t=e,n=0,r=e.match(xs),o=r?r.length:0;if(r)for(var a=0;a<o;a++)t=t.replace(r[a],"${c}"),n++;var i=t.match(Es),s=i?i.length:0;if(i)for(a=0;a<s;a++)t=t.replace(i[a],"${n}"),n++;return function(e){for(var r=t,a=0;a<n;a++)r=r.replace(a<o?"${c}":"${n}",a<o?$s.transform(e[a]):ws(e[a]));return r}},getAnimatableNone:function(e){var t=qs.parse(e);return qs.createTransformer(e)(t.map(Gs))}},Ys=function(e){return function(t){return 1-e(1-t)}},Ks=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},Ws=Ys,Vs=Ks,Xs=function(e){return function(t){return Math.pow(t,e)}},Qs=function(e){return function(t){return t*t*((e+1)*t-e)}},Js=function(e){var t=Qs(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}},Zs=function(e){return e},ec=Xs(2),tc=Ys(ec),nc=Ks(ec),rc=function(e){return 1-Math.sin(Math.acos(e))},oc=Ys(rc),ac=Ks(oc),ic=Qs(1.525),sc=Ys(ic),cc=Ks(ic),lc=Js(1.525),uc=function(e){var t=e*e;return e<4/11?7.5625*t:e<8/11?9.075*t-9.9*e+3.4:e<.9?4356/361*t-35442/1805*e+16061/1805:10.8*e*e-20.52*e+10.72},dc=function(e){return 1-uc(1-e)},pc=function(e){return e<.5?.5*(1-uc(1-2*e)):.5*uc(2*e-1)+.5},fc="undefined"!=typeof Float32Array,hc=function(e,t){return 1-3*t+3*e},mc=function(e,t){return 3*t-6*e},gc=function(e){return 3*e},bc=function(e,t,n){return 3*hc(t,n)*e*e+2*mc(t,n)*e+gc(t)},vc=function(e,t,n){return((hc(t,n)*e+mc(t,n))*e+gc(t))*e};function yc(e,t,n,r){var o=fc?new Float32Array(11):new Array(11),a=function(t){for(var r,a,i,s=0,c=1;10!==c&&o[c]<=t;++c)s+=.1;return--c,r=(t-o[c])/(o[c+1]-o[c]),(i=bc(a=s+.1*r,e,n))>=.001?function(t,r){for(var o=0,a=0;o<8;++o){if(0===(a=bc(r,e,n)))return r;r-=(vc(r,e,n)-t)/a}return r}(t,a):0===i?a:function(t,r,o){var a,i,s=0;do{(a=vc(i=r+(o-r)/2,e,n)-t)>0?o=i:r=i}while(Math.abs(a)>1e-7&&++s<10);return i}(t,s,s+.1)};!function(){for(var t=0;t<11;++t)o[t]=vc(.1*t,e,n)}();return function(o){return e===t&&n===r?o:0===o?0:1===o?1:vc(a(o),t,r)}}var wc={x:0,y:0,z:0},Ec=function(e){return"number"==typeof e},xc=function(e){return function(t,n,r){return void 0!==r?e(t,n,r):function(r){return e(t,n,r)}}},_c=xc((function(e,t,n){return Math.min(Math.max(n,e),t)})),Cc=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},Tc=function(e){return Cc(e)&&e.hasOwnProperty("z")},kc=function(e,t){return Math.abs(e-t)},Oc=function(e,t){if(void 0===t&&(t=wc),Ec(e)&&Ec(t))return kc(e,t);if(Cc(e)&&Cc(t)){var n=kc(e.x,t.x),r=kc(e.y,t.y),o=Tc(e)&&Tc(t)?kc(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}return 0},Sc=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},Ic=function(e,t,n){return-n*e+n*t+e},Ac=function(){return(Ac=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},jc=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},Nc=[Fs,Us,zs],Mc=function(e){return Nc.find((function(t){return t.test(e)}))},Pc=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},Rc=function(e,t){var n=Mc(e),r=Mc(t);Pc(e),Pc(t),n.transform,r.transform;var o=n.parse(e),a=r.parse(t),i=Ac({},o),s=n===zs?Ic:jc;return function(e){for(var t in i)"alpha"!==t&&(i[t]=s(o[t],a[t],e));return i.alpha=Ic(o.alpha,a.alpha,e),n.transform(i)}},Lc=function(e,t){return function(n){return t(e(n))}},Dc=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(Lc)};function Bc(e,t){return Ec(e)?function(n){return Ic(e,t,n)}:$s.test(e)?Rc(e,t):zc(e,t)}var Hc=function(e,t){var n=e.slice(),r=n.length,o=e.map((function(e,n){return Bc(e,t[n])}));return function(e){for(var t=0;t<r;t++)n[t]=o[t](e);return n}};function Uc(e){for(var t=qs.parse(e),n=t.length,r=0,o=0,a=0,i=0;i<n;i++)r||"number"==typeof t[i]?r++:void 0!==t[i].hue?a++:o++;return{parsed:t,numNumbers:r,numRGB:o,numHSL:a}}var zc=function(e,t){var n=qs.createTransformer(t),r=Uc(e),o=Uc(t);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&(r.numNumbers,o.numNumbers),Dc(Hc(r.parsed,o.parsed),n)};var Fc,$c=function(e){return e},Gc=function(e){return void 0===e&&(e=$c),xc((function(t,n,r){var o=n-r,a=-(0-t+1)*(0-e(Math.abs(o)));return o<=0?n+a:n-a}))},qc=(Gc(),Gc(Math.sqrt),function(e,t){return t?e*(1e3/t):0}),Yc=(xc((function(e,t,n){var r=t-e;return((n-e)%r+r)%r+e})),_c(0,1),function(e){var t=e.onRead,n=e.onRender,r=e.uncachedValues,o=void 0===r?new Set:r,a=e.useCache,i=void 0===a||a;return function(e){void 0===e&&(e={});var r=es(e,[]),a={},s=[],c=!1;function l(e,t){e.startsWith("--")&&(r.hasCSSVariable=!0);var n=a[e];a[e]=t,a[e]!==n&&(-1===s.indexOf(e)&&s.push(e),c||(c=!0,vs.render(u.render)))}var u={get:function(e,n){return void 0===n&&(n=!1),!n&&i&&!o.has(e)&&void 0!==a[e]?a[e]:t(e,r)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var n in e)l(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(c||!0===e)&&(n(a,r,s),c=!1,s.length=0),this}};return u}}),Kc=/([a-z])([A-Z])/g,Wc=function(e){return e.replace(Kc,"$1-$2").toLowerCase()},Vc=new Map,Xc=new Map,Qc=["Webkit","Moz","O","ms",""],Jc=Qc.length,Zc="undefined"!=typeof document,el=function(e,t){return Xc.set(e,Wc(t))},tl=function(e,t){void 0===t&&(t=!1);var n=t?Xc:Vc;return n.has(e)||(Zc?function(e){Fc=Fc||document.createElement("div");for(var t=0;t<Jc;t++){var n=Qc[t],r=""===n,o=r?e:n+e.charAt(0).toUpperCase()+e.slice(1);if(o in Fc.style||r){if(r&&"clipPath"===e&&Xc.has(e))return;Vc.set(e,o),el(e,(r?"":"-")+Wc(o))}}}(e):function(e){el(e,e)}(e)),n.get(e)||e},nl=["","X","Y","Z"],rl=["translate","scale","rotate","skew","transformPerspective"].reduce((function(e,t){return nl.reduce((function(e,n){return e.push(t+n),e}),e)}),["x","y","z"]),ol=rl.reduce((function(e,t){return e[t]=!0,e}),{});function al(e){return!0===ol[e]}function il(e,t){return rl.indexOf(e)-rl.indexOf(t)}var sl=new Set(["originX","originY","originZ"]);function cl(e){return sl.has(e)}var ll=Zi(Zi({},Cs),{transform:Math.round}),ul={color:$s,backgroundColor:$s,outlineColor:$s,fill:$s,stroke:$s,borderColor:$s,borderTopColor:$s,borderRightColor:$s,borderBottomColor:$s,borderLeftColor:$s,borderWidth:As,borderTopWidth:As,borderRightWidth:As,borderBottomWidth:As,borderLeftWidth:As,borderRadius:As,radius:As,borderTopLeftRadius:As,borderTopRightRadius:As,borderBottomRightRadius:As,borderBottomLeftRadius:As,width:As,maxWidth:As,height:As,maxHeight:As,size:As,top:As,right:As,bottom:As,left:As,padding:As,paddingTop:As,paddingRight:As,paddingBottom:As,paddingLeft:As,margin:As,marginTop:As,marginRight:As,marginBottom:As,marginLeft:As,rotate:Ss,rotateX:Ss,rotateY:Ss,rotateZ:Ss,scale:ks,scaleX:ks,scaleY:ks,scaleZ:ks,skew:Ss,skewX:Ss,skewY:Ss,distance:As,translateX:As,translateY:As,translateZ:As,x:As,y:As,z:As,perspective:As,opacity:Ts,originX:Ms,originY:Ms,originZ:As,zIndex:ll,fillOpacity:Ts,strokeOpacity:Ts,numOctaves:ll},dl=function(e){return ul[e]},pl=function(e,t){return t&&"number"==typeof e?t.transform(e):e},fl=new Set(["scrollLeft","scrollTop"]),hl=new Set(["scrollLeft","scrollTop","transform"]),ml={x:"translateX",y:"translateY",z:"translateZ"};function gl(e){return"function"==typeof e}function bl(e,t,n,r,o,a,i,s){void 0===t&&(t=!0),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),void 0===a&&(a=[]),void 0===i&&(i=!1),void 0===s&&(s=!0);var c=!0,l=!1,u=!1;for(var d in e){var p=e[d],f=dl(d),h=pl(p,f);al(d)?(l=!0,r[d]=h,a.push(d),c&&(f.default&&p!==f.default||!f.default&&0!==p)&&(c=!1)):cl(d)?(o[d]=h,u=!0):hl.has(d)&&gl(h)||(n[tl(d,i)]=h)}return(l||"function"==typeof e.transform)&&(n.transform=function(e,t,n,r,o,a){void 0===a&&(a=!0);var i="",s=!1;n.sort(il);for(var c=n.length,l=0;l<c;l++){var u=n[l];i+=(ml[u]||u)+"("+t[u]+") ",s="z"===u||s}return!s&&o?i+="translateZ(0)":i=i.trim(),gl(e.transform)?i=e.transform(t,r?"":i):a&&r&&(i="none"),i}(e,r,a,c,t,s)),u&&(n.transformOrigin=(o.originX||"50%")+" "+(o.originY||"50%")+" "+(o.originZ||0)),n}function vl(e){var t=void 0===e?{}:e,n=t.enableHardwareAcceleration,r=void 0===n||n,o=t.isDashCase,a=void 0===o||o,i=t.allowTransformNone,s=void 0===i||i,c={},l={},u={},d=[];return function(e){return d.length=0,bl(e,r,c,l,u,d,a,s),c}}var yl=Yc({onRead:function(e,t){var n=t.element,r=t.preparseOutput,o=dl(e);if(al(e))return o&&o.default||0;if(fl.has(e))return n[e];var a=window.getComputedStyle(n,null).getPropertyValue(tl(e,!0))||0;return r&&o&&o.test(a)&&o.parse?o.parse(a):a},onRender:function(e,t,n){var r=t.element,o=t.buildStyles,a=t.hasCSSVariable;if(Object.assign(r.style,o(e)),a)for(var i=n.length,s=0;s<i;s++){var c=n[s];c.startsWith("--")&&r.style.setProperty(c,e[c])}-1!==n.indexOf("scrollLeft")&&(r.scrollLeft=e.scrollLeft),-1!==n.indexOf("scrollTop")&&(r.scrollTop=e.scrollTop)},uncachedValues:fl});var wl=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),El=function(e,t){return As.transform(e*t)},xl={x:0,y:0,width:0,height:0};function _l(e,t,n){return"string"==typeof e?e:As.transform(t+n*e)}var Cl={enableHardwareAcceleration:!1,isDashCase:!1};function Tl(e,t,n,r,o,a){void 0===t&&(t=xl),void 0===r&&(r=vl(Cl)),void 0===o&&(o={style:{}}),void 0===a&&(a=!0);var i=e.attrX,s=e.attrY,c=e.originX,l=e.originY,u=e.pathLength,d=e.pathSpacing,p=void 0===d?1:d,f=e.pathOffset,h=void 0===f?0:f,m=r(es(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var g in m){if("transform"===g)o.style.transform=m[g];else o[a&&!wl.has(g)?Wc(g):g]=m[g]}return(void 0!==c||void 0!==l||m.transform)&&(o.style.transformOrigin=function(e,t,n){return _l(t,e.x,e.width)+" "+_l(n,e.y,e.height)}(t,void 0!==c?c:.5,void 0!==l?l:.5)),void 0!==i&&(o.x=i),void 0!==s&&(o.y=s),void 0!==n&&void 0!==u&&(o[a?"stroke-dashoffset":"strokeDashoffset"]=El(-h,n),o[a?"stroke-dasharray":"strokeDasharray"]=El(u,n)+" "+El(p,n)),o}function kl(e,t,n){void 0===n&&(n=!0);var r={style:{}},o=vl(Cl);return function(a){return Tl(a,e,t,o,r,n)}}var Ol=Yc({onRead:function(e,t){var n=t.element;if(al(e=wl.has(e)?e:Wc(e))){var r=dl(e);return r&&r.default||0}return n.getAttribute(e)},onRender:function(e,t){var n=t.element,r=(0,t.buildAttrs)(e);for(var o in r)"style"===o?Object.assign(n.style,r.style):n.setAttribute(o,r[o])}}),Sl=Yc({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,n=void 0===t?0:t,r=e.scrollLeft,o=void 0===r?0:r;return window.scrollTo(o,n)}}),Il=new WeakMap,Al=function(e,t){var n,r,o,a;return e===window?n=Sl(e):!function(e){return e instanceof HTMLElement||"function"==typeof e.click}(e)?function(e){return e instanceof SVGElement||"ownerSVGElement"in e}(e)&&(o=function(e){try{return function(e){return"function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}(e)}catch(e){return{x:0,y:0,width:0,height:0}}}(r=e),a=function(e){return"path"===e.tagName}(r)&&r.getTotalLength?r.getTotalLength():void 0,n=Ol({element:r,buildAttrs:kl(o,a)})):n=function(e,t){void 0===t&&(t={});var n=t.enableHardwareAcceleration,r=t.allowTransformNone,o=es(t,["enableHardwareAcceleration","allowTransformNone"]);return yl(Zi({element:e,buildStyles:vl({enableHardwareAcceleration:n,allowTransformNone:r}),preparseOutput:!0},o))}(e,t),Il.set(e,n),n};var jl=function(e,t){return function(e,t){return Il.has(e)?Il.get(e):Al(e,t)}("string"==typeof e?document.querySelector(e):e,t)},Nl=function(){return function(e,t){var n=this,r=e.middleware,o=e.onComplete;this.isActive=!0,this.update=function(e){n.observer.update&&n.updateObserver(e)},this.complete=function(){n.observer.complete&&n.isActive&&n.observer.complete(),n.onComplete&&n.onComplete(),n.isActive=!1},this.error=function(e){n.observer.error&&n.isActive&&n.observer.error(e),n.isActive=!1},this.observer=t,this.updateObserver=function(e){return t.update(e)},this.onComplete=o,t.update&&r&&r.length&&r.forEach((function(e){return n.updateObserver=e(n.updateObserver,n.complete)}))}}(),Ml=function(e,t,n){var r=t.middleware;return new Nl({middleware:r,onComplete:n},"function"==typeof e?{update:e}:e)},Pl=function(){function e(e){void 0===e&&(e={}),this.props=e}return e.prototype.create=function(t){return new e(t)},e.prototype.start=function(e){void 0===e&&(e={});var t=!1,n={stop:function(){}},r=this.props,o=r.init,a=es(r,["init"]),i=o(Ml(e,a,(function(){t=!0,n.stop()})));return n=i?Zi({},n,i):n,t&&n.stop(),n},e.prototype.applyMiddleware=function(e){return this.create(Zi({},this.props,{middleware:this.props.middleware?[e].concat(this.props.middleware):[e]}))},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=1===e.length?e[0]:Dc.apply(void 0,e);return this.applyMiddleware((function(e){return function(t){return e(n(t))}}))},e}(),Rl=function(e){return new Pl({init:e})},Ll=[As,Is,Ss,js,Ns],Dl=function(e){return Ll.find((function(t){return t.test(e)}))},Bl=function(e,t){return e(t)},Hl=function(e,t){var n=t.from,r=t.to,o=es(t,["from","to"]),a=Dl(n)||Dl(r),i=a.transform,s=a.parse;return e(Zi({},o,{from:"string"==typeof n?s(n):n,to:"string"==typeof r?s(r):r})).pipe(i)},Ul=function(e){return function(t,n){var r=n.from,o=n.to,a=es(n,["from","to"]);return t(Zi({},a,{from:0,to:1})).pipe(e(r,o))}},zl=Ul(Rc),Fl=Ul(zc),$l=function(e,t){var n=function(e){var t=Object.keys(e),n=function(t,n){return void 0!==t&&!e[n](t)};return{getVectorKeys:function(e){return t.reduce((function(t,r){return n(e[r],r)&&t.push(r),t}),[])},testVectorProps:function(e){return e&&t.some((function(t){return n(e[t],t)}))}}}(t),r=n.testVectorProps,o=n.getVectorKeys;return function(t){if(!r(t))return e(t);var n=o(t),a=t[n[0]];return Gl(a)(e,t,n)}},Gl=function(e){return"number"==typeof e?Bl:function(e){return Boolean(Dl(e))}(e)?Hl:$s.test(e)?zl:qs.test(e)?Fl:Bl},ql=$l((function(e){return void 0===e&&(e={}),Rl((function(t){var n=t.complete,r=t.update,o=e.velocity,a=void 0===o?0:o,i=e.from,s=void 0===i?0:i,c=e.power,l=void 0===c?.8:c,u=e.timeConstant,d=void 0===u?350:u,p=e.restDelta,f=void 0===p?.5:p,h=e.modifyTarget,m=0,g=l*a,b=Math.round(s+g),v=void 0===h?b:h(b),y=vs.update((function(e){var t=e.delta;m+=t;var o=-g*Math.exp(-m/d),a=o>f||o<-f;r(a?v+o:v),a||(fs.update(y),n())}),!0);return{stop:function(){return fs.update(y)}}}))}),{from:Cs.test,modifyTarget:function(e){return"function"==typeof e},velocity:Cs.test}),Yl=$l((function(e){return void 0===e&&(e={}),Rl((function(t){var n=t.update,r=t.complete,o=e.velocity,a=void 0===o?0:o,i=e.from,s=void 0===i?0:i,c=e.to,l=void 0===c?0:c,u=e.stiffness,d=void 0===u?100:u,p=e.damping,f=void 0===p?10:p,h=e.mass,m=void 0===h?1:h,g=e.restSpeed,b=void 0===g?.01:g,v=e.restDelta,y=void 0===v?.01:v,w=a?-a/1e3:0,E=0,x=l-s,_=s,C=_,T=vs.update((function(e){var t=e.delta;E+=t;var o=f/(2*Math.sqrt(d*m)),i=Math.sqrt(d/m)/1e3;if(C=_,o<1){var s=Math.exp(-o*i*E),c=i*Math.sqrt(1-o*o);_=l-s*((w+o*i*x)/c*Math.sin(c*E)+x*Math.cos(c*E))}else{s=Math.exp(-i*E);_=l-s*(x+(w+i*x)*E)}a=qc(_-C,t);var u=Math.abs(a)<=b,p=Math.abs(l-_)<=y;u&&p?(n(_=l),fs.update(T),r()):n(_)}),!0);return{stop:function(){return fs.update(T)}}}))}),{from:Cs.test,to:Cs.test,stiffness:Cs.test,damping:Cs.test,mass:Cs.test,velocity:Cs.test}),Kl=$l((function(e){var t=e.from,n=void 0===t?0:t,r=e.velocity,o=void 0===r?0:r,a=e.min,i=e.max,s=e.power,c=void 0===s?.8:s,l=e.timeConstant,u=void 0===l?700:l,d=e.bounceStiffness,p=void 0===d?500:d,f=e.bounceDamping,h=void 0===f?10:f,m=e.restDelta,g=void 0===m?1:m,b=e.modifyTarget;return Rl((function(e){var t,r=e.update,s=e.complete,l=n,d=n,f=!1,m=function(e){return void 0!==a&&e<=a},v=function(e){return void 0!==i&&e>=i},y=function(e){return m(e)||v(e)},w=function(e){r(e),l=d,o=qc((d=e)-l,bs().delta),t&&!f&&function(e,t){return m(e)&&t<0||v(e)&&t>0}(e,o)&&x({from:e,velocity:o})},E=function(e,n){t&&t.stop(),t=e.start({update:w,complete:function(){n?n():s()}})},x=function(e){f=!0,E(Yl(Zi({},e,{to:m(e.from)?a:i,stiffness:p,damping:h,restDelta:g})))};if(y(n))x({from:n,velocity:o});else if(0!==o){var _=ql({from:n,velocity:o,timeConstant:u,power:c,restDelta:y(n)?20:g,modifyTarget:b});E(_,(function(){y(d)?x({from:d,velocity:o}):s()}))}else s();return{stop:function(){return t&&t.stop()}}}))}),{from:Cs.test,velocity:Cs.test,min:Cs.test,max:Cs.test,damping:Cs.test,stiffness:Cs.test,modifyTarget:function(e){return"function"==typeof e}}),Wl=$l((function(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,a=e.ease,i=void 0===a?Zs:a,s=e.reverseEase;return void 0!==s&&s&&(i=Ws(i)),Rl((function(e){var t=e.update;return{seek:function(e){return t(e)}}})).pipe(i,(function(e){return Ic(n,o,e)}))}),{ease:function(e){return"function"==typeof e},from:Cs.test,to:Cs.test}),Vl=_c(0,1),Xl=function(e){return void 0===e&&(e={}),Rl((function(t){var n,r=t.update,o=t.complete,a=e.duration,i=void 0===a?300:a,s=e.ease,c=void 0===s?tc:s,l=e.flip,u=void 0===l?0:l,d=e.loop,p=void 0===d?0:d,f=e.yoyo,h=void 0===f?0:f,m=e.repeatDelay,g=void 0===m?0:m,b=e.from,v=void 0===b?0:b,y=e.to,w=void 0===y?1:y,E=e.elapsed,x=void 0===E?0:E,_=e.flipCount,C=void 0===_?0:_,T=e.yoyoCount,k=void 0===T?0:T,O=e.loopCount,S=void 0===O?0:O,I=Wl({from:v,to:w,ease:c}).start(r),A=0,j=!1,N=function(e){var t;void 0===e&&(e=!1),I=Wl({from:v=(t=[w,v])[0],to:w=t[1],ease:c,reverseEase:e}).start(r)},M=function(){A=Vl(Sc(0,i,x)),I.seek(A)},P=function(){j=!0,n=vs.update((function(e){var t,r=e.delta;x+=r,M(),!(t=j&&x>i+g)||(!t||p||u||h)&&(x=x-i-g,p&&S<p?(S++,1):u&&C<u?(C++,N(),1):h&&k<h&&(k++,N(k%2!=0),1))||(fs.update(n),o&&vs.update(o,!1,!0))}),!0)},R=function(){j=!1,n&&fs.update(n)};return P(),{isActive:function(){return j},getElapsed:function(){return _c(0,i,x)},getProgress:function(){return A},stop:function(){R()},pause:function(){return R(),this},resume:function(){return j||P(),this},seek:function(e){return x=Ic(0,i,e),vs.update(M,!1,!0),this},reverse:function(){return N(),this}}}))},Ql=_c(0,1),Jl=function(e){var t=e.easings,n=e.ease,r=void 0===n?Zs:n,o=e.times,a=e.values,i=es(e,["easings","ease","times","values"]);t=Array.isArray(t)?t:function(e,t){return e.map((function(){return t||tc})).splice(0,e.length-1)}(a,t),o=o||function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(a);var s=t.map((function(e,t){return Wl({from:a[t],to:a[t+1],ease:e})}));return Xl(Zi({},i,{ease:r})).applyMiddleware((function(e){return function(e,t,n){var r=e.length,o=r-1,a=o-1,i=t.map((function(e){return e.start(n)}));return function(t){t<=e[0]&&i[0].seek(0),t>=e[o]&&i[a].seek(1);for(var n=1;n<r&&!(e[n]>t||n===o);n++);var s=Sc(e[n-1],e[n],t);i[n-1].seek(Ql(s))}}(o,s,e)}))},Zl=function(e,t,n){return Rl((function(r){var o=r.update,a=t.split(" ").map((function(t){return e.addEventListener(t,o,n),t}));return{stop:function(){return a.forEach((function(t){return e.removeEventListener(t,o,n)}))}}}))},eu=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},tu=function(e,t){return void 0===t&&(t={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),t.clientX=t.x=e.clientX,t.clientY=t.y=e.clientY,t.pageX=e.pageX,t.pageY=e.pageY,t},nu=[eu()];if("undefined"!=typeof document){Zl(document,"touchstart touchmove",{passive:!0,capture:!0}).start((function(e){var t=e.touches;!0;var n=t.length;nu.length=0;for(var r=0;r<n;r++){var o=t[r];nu.push(tu(o))}}))}var ru=eu();if("undefined"!=typeof document){Zl(document,"mousedown mousemove",!0).start((function(e){!0,tu(e,ru)}))}var ou=function(e){return Rl((function(t){var n=t.complete,r=setTimeout(n,e);return{stop:function(){return clearTimeout(r)}}}))},au=function(){function e(e,t){var n,r=this,o=void 0===t?{}:t,a=o.transformer,i=o.parent;this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),r.prev=r.current,r.current=r.transformer?r.transformer(e):e,r.updateSubscribers&&r.prev!==r.current&&r.updateSubscribers.forEach(r.notifySubscriber),r.children&&r.children.forEach(r.setChild),t&&r.renderSubscribers&&r.renderSubscribers.forEach(r.notifySubscriber);var n=bs(),o=n.delta,a=n.timestamp;r.lastUpdated!==a&&(r.timeDelta=o,r.lastUpdated=a,vs.postRender(r.scheduleVelocityCheck))},this.notifySubscriber=function(e){e(r.current)},this.scheduleVelocityCheck=function(){return vs.postRender(r.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==r.lastUpdated&&(r.prev=r.current)},this.setChild=function(e){return e.set(r.current)},this.parent=i,this.transformer=a,this.set(e,!1),this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n)))}return e.prototype.addChild=function(t){void 0===t&&(t={});var n=new e(this.current,Zi({parent:this},t));return this.children||(this.children=new Set),this.children.add(n),n},e.prototype.removeChild=function(e){this.children&&this.children.delete(e)},e.prototype.subscribeTo=function(e,t){var n=this,r=function(){return t(n.current)};return e.add(r),function(){return e.delete(r)}},e.prototype.onChange=function(e){return this.updateSubscribers||(this.updateSubscribers=new Set),this.subscribeTo(this.updateSubscribers,e)},e.prototype.onRenderRequest=function(e){return this.renderSubscribers||(this.renderSubscribers=new Set),this.notifySubscriber(e),this.subscribeTo(this.renderSubscribers,e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.canTrackVelocity?qc(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers&&this.updateSubscribers.clear(),this.renderSubscribers&&this.renderSubscribers.clear(),this.parent&&this.parent.removeChild(this),this.stop()},e}();function iu(e,t){return new au(e,t)}function su(e){var t=Object(s.useRef)(null);return null===t.current&&(t.current=e()),t.current}var cu,lu=function(e){return e instanceof au},uu=Yc({onRead:function(){return null},onRender:function(e,t){return(0,t.onUpdate)(e)}}),du=function(){function e(){this.hasMounted=!1,this.values=new Map,this.unsubscribers=new Map}return e.prototype.has=function(e){return this.values.has(e)},e.prototype.set=function(e,t){this.values.set(e,t),this.hasMounted&&this.bindValueToOutput(e,t)},e.prototype.get=function(e,t){var n=this.values.get(e);return void 0===n&&void 0!==t&&(n=new au(t),this.set(e,n)),n},e.prototype.forEach=function(e){return this.values.forEach(e)},e.prototype.bindValueToOutput=function(e,t){var n=this,r=t.onRenderRequest((function(t){return n.output&&n.output(e,t)})),o=t.onChange((function(t){n.onUpdate&&n.onUpdate.set(e,t)}));this.unsubscribers.has(e)&&this.unsubscribers.get(e)(),this.unsubscribers.set(e,(function(){r(),o()}))},e.prototype.setOnUpdate=function(e){this.onUpdate=void 0,e&&(this.onUpdate=uu({onUpdate:e}))},e.prototype.setTransformTemplate=function(e){this.transformTemplate!==e&&(this.transformTemplate=e,this.updateTransformTemplate())},e.prototype.getTransformTemplate=function(){return this.transformTemplate},e.prototype.updateTransformTemplate=function(){this.output&&this.output("transform",this.transformTemplate)},e.prototype.mount=function(e){var t=this;this.hasMounted=!0,e&&(this.output=e),this.values.forEach((function(e,n){return t.bindValueToOutput(n,e)})),this.updateTransformTemplate()},e.prototype.unmount=function(){var e=this;this.values.forEach((function(t,n){var r=e.unsubscribers.get(n);r&&r()}))},e}(),pu=new Set(["dragOriginX","dragOriginY"]),fu=function(e){var t=su((function(){var t=new du;for(var n in e)lu(e[n])&&!pu.has(n)&&t.set(n,e[n]);return t}));return t.setOnUpdate(e.onUpdate),t.setTransformTemplate(e.transformTemplate),t},hu=null,mu=function(){return null!==hu},gu=function(){hu=[]},bu=function(){hu&&hu.forEach((function(e){return e.render()})),hu=null},vu=function(e){hu&&hu.push(e)},yu=Object(s.memo)((function(e){var t=e.innerRef,n=e.values,r=e.isStatic;return Object(s.useEffect)((function(){t.current,Element;var e=jl(t.current,{preparseOutput:!1,enableHardwareAcceleration:!r});return n.mount((function(t,n){e.set(t,n),mu()&&vu(e)})),function(){return n.unmount()}}),[]),null})),wu=(cu=function(e){return e.get()},function(e){var t={};return e.forEach((function(e,n){return t[n]=cu(e)})),t}),Eu=new Set(["originX","originY","originZ"]),xu=function(e){return Eu.has(e)},_u=function(e,t,n){var r=wu(e),o=e.getTransformTemplate();return o&&(r.transform=t.transform?o({},t.transform):o),bl(Zi(Zi({},t),r),!n)},Cu=function(e){return Array.isArray(e)},Tu=function(e){return Cu(e)?e[e.length-1]||0:e},ku=[Cs,As,Is,Ss,Ns,js,{test:function(e){return"auto"===e},parse:function(e){return e}}],Ou=ts(ku,[$s,qs]),Su=function(e){return function(t){return t.test(e)}},Iu=function(e){return ku.find(Su(e))},Au=function(e){return Ou.find(Su(e))},ju=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Nu=function(e){return{type:"spring",stiffness:700,damping:0===e?100:35}},Mu=function(){return{ease:"linear",duration:.3}},Pu=function(e){return{type:"keyframes",duration:.8,values:e}},Ru={x:ju,y:ju,z:ju,rotate:ju,rotateX:ju,rotateY:ju,rotateZ:ju,scaleX:Nu,scaleY:Nu,scale:Nu,opacity:Mu,backgroundColor:Mu,color:Mu,default:Nu},Lu=function(e){var t=e.to,n=e.duration;return Rl((function(e){var r=e.update,o=e.complete;r(t),n?ou(n).start({complete:o}):o()}))},Du=function(e){return Array.isArray(e)?(e.length,yc(e[0],e[1],e[2],e[3])):"string"==typeof e?r[e]:e},Bu=function(e){return Array.isArray(e)&&"number"!=typeof e[0]},Hu=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!qs.test(t)||t.startsWith("url(")))},Uu=function(e){return 1e3*e},zu={tween:Xl,spring:Yl,keyframes:Jl,inertia:Kl,just:Lu},Fu={tween:function(e){if(e.ease){var t=Bu(e.ease)?e.ease[0]:e.ease;e.ease=Du(t)}return e},keyframes:function(e){var t=e.from,n=(e.to,e.velocity,es(e,["from","to","velocity"]));if(n.values&&null===n.values[0]){var r=ts(n.values);r[0]=t,n.values=r}return n.ease&&(n.easings=Bu(n.ease)?n.ease.map(Du):Du(n.ease)),n.ease=Zs,n}},$u=function(e,t,n){var r=n?n.delay:0;if(void 0===n||!function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection;var t=es(e,["when","delay","delayChildren","staggerChildren","staggerDirection"]);return Object.keys(t).length}(n))return Zi({delay:r},function(e,t){var n;return n=Cu(t)?Pu:Ru[e]||Ru.default,Zi({to:t},n(t))}(e,t));var o=n[e]||n.default||n;return!1===o.type?{delay:o.hasOwnProperty("delay")?o.delay:r,to:Cu(t)?t[t.length-1]:t,type:"just"}:Cu(t)?Zi(Zi({values:t,duration:.8,delay:r,ease:"linear"},o),{type:"keyframes"}):Zi({type:"tween",to:t,delay:r},o)},Gu=function(e,t,n,r){var o,a=t.get(),i=Hu(e,a),s=Hu(e,n),c=$u(e,n,r),l=c.type,u=void 0===l?"tween":l,d=es(c,["type"]),p=i&&s?zu[u]:Lu,f=function(e,t){return Fu[e]?Fu[e](t):t}(u,Zi({from:a,velocity:t.getVelocity()},d));return((o=f).hasOwnProperty("duration")||o.hasOwnProperty("repeatDelay"))&&(f.duration&&(f.duration=Uu(f.duration)),f.repeatDelay&&(f.repeatDelay=Uu(f.repeatDelay))),[p,f]};function qu(e,t,n,r){var o=r.delay,a=void 0===o?0:o,i=es(r,["delay"]);return t.start((function(r){var o,s=Gu(e,t,n,i),c=s[0],l=s[1],u=l.delay,d=es(l,["delay"]);void 0!==u&&(a=u);var p=function(){var e=c(d);o=e.start({update:function(e){return t.set(e)},complete:r})};return a?o=ou(Uu(a)).start({complete:p}):p(),function(){o&&o.stop()}}))}var Yu=function(){function e(e){var t=this,n=e.values,r=e.readValueFromSource,o=e.makeTargetAnimatable;this.props={},this.variants={},this.baseTarget={},this.overrides=[],this.resolvedOverrides=[],this.activeOverrides=new Set,this.isAnimating=new Set,this.hasValue=function(e){return!t.values.has(e)},this.values=n,this.readValueFromSource=r,this.makeTargetAnimatable=o,this.values.forEach((function(e,n){return t.baseTarget[n]=e.get()}))}return e.prototype.setProps=function(e){this.props=e},e.prototype.setVariants=function(e){e&&(this.variants=e)},e.prototype.setDefaultTransition=function(e){e&&(this.defaultTransition=e)},e.prototype.setValues=function(e,t){var n=this,r=void 0===t?{}:t,o=r.isActive,a=void 0===o?new Set:o,i=r.priority,s=this.resolveVariant(e),c=s.target,l=s.transitionEnd;return c=this.transformValues(Zi(Zi({},c),l)),Object.keys(c).forEach((function(e){if(!a.has(e)&&(a.add(e),c)){var t=Tu(c[e]);if(n.values.has(e)){var r=n.values.get(e);r&&r.set(t)}else n.values.set(e,iu(t));i||(n.baseTarget[e]=t)}}))},e.prototype.transformValues=function(e){var t=this.props.transformValues;return t?t(e):e},e.prototype.checkForNewValues=function(e){var t=Object.keys(e).filter(this.hasValue),n=t.length;if(n)for(var r=0;r<n;r++){var o=t[r],a=e[o],i=null;Array.isArray(a)&&(i=a[0]),null===i&&(i=this.readValueFromSource(o)),"string"==typeof i&&/^\d*\.?\d+$/.test(i)?i=parseFloat(i):!Au(i)&&qs.test(a)&&(i=qs.getAnimatableNone(a)),this.values.set(o,iu(i)),this.baseTarget[o]=i}},e.prototype.resolveVariant=function(e){if(!e)return{target:void 0,transition:void 0,transitionEnd:void 0};var t,n;"function"==typeof e&&(e=e(this.props.custom,(t=this.values,n={},t.forEach((function(e,t){return n[t]=e.get()})),n),function(e){var t={};return e.forEach((function(e,n){return t[n]=e.getVelocity()})),t}(this.values)));var r=e.transition;return{transition:void 0===r?this.defaultTransition:r,transitionEnd:e.transitionEnd,target:es(e,["transition","transitionEnd"])}},e.prototype.getHighestPriority=function(){return this.activeOverrides.size?Math.max.apply(Math,Array.from(this.activeOverrides)):0},e.prototype.setOverride=function(e,t){this.overrides[t]=e,this.children&&this.children.forEach((function(n){return n.setOverride(e,t)}))},e.prototype.startOverride=function(e){var t=this.overrides[e];if(t)return this.start(t,{priority:e})},e.prototype.clearOverride=function(e){var t=this;if(this.children&&this.children.forEach((function(t){return t.clearOverride(e)})),this.overrides[e]){this.activeOverrides.delete(e);var n=this.getHighestPriority();if(this.resetIsAnimating(),n)this.overrides[n]&&this.startOverride(n);var r=this.resolvedOverrides[e];if(r){var o={};for(var a in this.baseTarget)void 0!==r[a]&&(o[a]=this.baseTarget[a]);this.onStart(),this.animate(o).then((function(){return t.onComplete()}))}}},e.prototype.apply=function(e){return Array.isArray(e)?this.applyVariantLabels(e):"string"==typeof e?this.applyVariantLabels([e]):void this.setValues(e)},e.prototype.applyVariantLabels=function(e){var t=this,n=new Set;ts(e).reverse().forEach((function(r){var o=t.resolveVariant(t.variants[r]),a=o.target,i=o.transitionEnd;i&&t.setValues(i,{isActive:n}),a&&t.setValues(a,{isActive:n}),t.children&&t.children.size&&t.children.forEach((function(t){return t.applyVariantLabels(e)}))}))},e.prototype.start=function(e,t){var n,r,o=this;return void 0===t&&(t={}),t.priority&&this.activeOverrides.add(t.priority),this.resetIsAnimating(t.priority),r=e,n=Array.isArray(r)?this.animateVariantLabels(e,t):"string"==typeof e?this.animateVariant(e,t):this.animate(e,t),this.onStart(),n.then((function(){return o.onComplete()}))},e.prototype.animate=function(e,t){var n=this,r=void 0===t?{}:t,o=r.delay,a=void 0===o?0:o,i=r.priority,s=void 0===i?0:i,c=r.transitionOverride,l=this.resolveVariant(e),u=l.target,d=l.transition,p=l.transitionEnd;if(c&&(d=c),!u)return Promise.resolve();if(u=this.transformValues(u),p&&(p=this.transformValues(p)),this.checkForNewValues(u),this.makeTargetAnimatable){var f=this.makeTargetAnimatable(u,p);u=f.target,p=f.transitionEnd}s&&(this.resolvedOverrides[s]=u),this.checkForNewValues(u);var h=[];for(var m in u){var g=this.values.get(m);if(g&&u&&void 0!==u[m]){var b=u[m];s||(this.baseTarget[m]=Tu(b)),this.isAnimating.has(m)||(this.isAnimating.add(m),h.push(qu(m,g,b,Zi({delay:a},d))))}}var v=Promise.all(h);return p?v.then((function(){n.setValues(p,{priority:s})})):v},e.prototype.animateVariantLabels=function(e,t){var n=this,r=ts(e).reverse().map((function(e){return n.animateVariant(e,t)}));return Promise.all(r)},e.prototype.animateVariant=function(e,t){var n=this,r=!1,o=0,a=0,i=1,s=t&&t.priority||0,c=this.variants[e],l=c?function(){return n.animate(c,t)}:function(){return Promise.resolve()},u=this.children?function(){return n.animateChildren(e,o,a,i,s)}:function(){return Promise.resolve()};if(c&&this.children){var d=this.resolveVariant(c).transition;d&&(r=d.when||r,o=d.delayChildren||o,a=d.staggerChildren||a,i=d.staggerDirection||i)}if(r){var p="beforeChildren"===r?[l,u]:[u,l],f=p[1];return(0,p[0])().then(f)}return Promise.all([l(),u()])},e.prototype.animateChildren=function(e,t,n,r,o){if(void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===o&&(o=0),!this.children)return Promise.resolve();var a=[],i=(this.children.size-1)*n,s=1===r?function(e){return e*n}:function(e){return i-e*n};return Array.from(this.children).forEach((function(n,r){var i=n.animateVariant(e,{priority:o,delay:t+s(r)});a.push(i)})),Promise.all(a)},e.prototype.onStart=function(){var e=this.props.onAnimationStart;e&&e()},e.prototype.onComplete=function(){var e=this.props.onAnimationComplete;e&&e()},e.prototype.checkOverrideIsAnimating=function(e){for(var t=this.overrides.length,n=e+1;n<t;n++){var r=this.resolvedOverrides[n];if(r)for(var o in r)this.isAnimating.add(o)}},e.prototype.resetIsAnimating=function(e){void 0===e&&(e=0),this.isAnimating.clear(),e<this.getHighestPriority()&&this.checkOverrideIsAnimating(e),this.children&&this.children.forEach((function(t){return t.resetIsAnimating(e)}))},e.prototype.stop=function(){this.values.forEach((function(e){return e.stop()}))},e.prototype.addChild=function(e){this.children||(this.children=new Set),this.children.add(e),this.overrides.forEach((function(t,n){t&&e.setOverride(t,n)}))},e.prototype.removeChild=function(e){this.children&&this.children.delete(e)},e.prototype.resetChildren=function(){this.children&&this.children.clear()},e}();var Ku=function(){function e(){this.hasMounted=!1,this.pendingAnimations=[],this.componentControls=new Set}return e.prototype.setVariants=function(e){this.variants=e,this.componentControls.forEach((function(t){return t.setVariants(e)}))},e.prototype.setDefaultTransition=function(e){this.defaultTransition=e,this.componentControls.forEach((function(t){return t.setDefaultTransition(e)}))},e.prototype.subscribe=function(e){var t=this;return this.componentControls.add(e),this.variants&&e.setVariants(this.variants),this.defaultTransition&&e.setDefaultTransition(this.defaultTransition),function(){return t.componentControls.delete(e)}},e.prototype.start=function(e,t){var n=this;if(this.hasMounted){var r=[];return this.componentControls.forEach((function(n){var o=n.start(e,{transitionOverride:t});r.push(o)})),Promise.all(r)}return new Promise((function(r){n.pendingAnimations.push({animation:[e,t],resolve:r})}))},e.prototype.set=function(e){return this.hasMounted,this.componentControls.forEach((function(t){return t.apply(e)}))},e.prototype.stop=function(){this.componentControls.forEach((function(e){return e.stop()}))},e.prototype.mount=function(){var e=this;this.hasMounted=!0,this.pendingAnimations.forEach((function(t){var n=t.animation,r=t.resolve;return e.start.apply(e,n).then(r)}))},e.prototype.unmount=function(){this.hasMounted=!1,this.stop()},e}(),Wu=Object(s.createContext)(null),Vu=Object(s.createContext)({static:!1}),Xu=function(e){return"string"==typeof e||Array.isArray(e)},Qu=function(e){return e instanceof Ku},Ju=function(e,t,n,r,o){void 0===r&&(r=!1);var a,i,c=o.initial,l=o.animate,u=o.variants,d=o.whileTap,p=o.whileHover,f=Object(s.useContext)(Wu);void 0!==(null===(a=f)||void 0===a?void 0:a.initial)&&(c=f.initial),!1!==c||Qu(l)?"boolean"!=typeof c&&(i=c):i=l;var h=Object(s.useRef)(!1),m=u||Xu(l)||Xu(d)||Xu(p)||Qu(l),g=Xu(i)?i:e.initial,b=Xu(l)?l:e.animate,v=r?g:null,y=m&&Xu(b)?b:null,w=Object(s.useMemo)((function(){return{controls:m?t:e.controls,initial:g,animate:b,values:n,hasMounted:h,isReducedMotion:e.isReducedMotion}}),[v,y,e.isReducedMotion]);return w.static=r,function(e,t){void 0===t&&(t=!1);var n=Object(s.useRef)(!0);(!t||t&&n.current)&&e(),n.current=!1}((function(){var n=i||e.initial;n&&t.apply(n)}),!r),Object(s.useEffect)((function(){h.current=!0}),[]),w};function Zu(e,t,n){var r=t.variants,o=t.transition,a=Object(s.useContext)(Vu).controls,i=Object(s.useContext)(Wu),c=su((function(){return new Yu(e)}));return i&&!i.isPresent||(c.resetChildren(),c.setProps(t),c.setVariants(r),c.setDefaultTransition(o)),Object(s.useEffect)((function(){n&&a&&a.addChild(c)})),Object(s.useEffect)((function(){return function(){t.onAnimationComplete;var e=es(t,["onAnimationComplete"]);c.setProps(e),a&&a.removeChild(c)}}),[]),c}var ed=function(e){var t=e.animate,n=e.variants,r=e.inherit;return(void 0===r||r)&&!!n&&(!t||t instanceof Ku)};var td=function(e){var t=e.getValueControlsConfig,n=e.loadFunctionalityComponents,r=e.renderComponent;return Object(s.forwardRef)((function(e,o){var a=function(e){var t=e&&"function"!=typeof e?e:Object(s.useRef)(null);return e&&"function"==typeof e&&Object(s.useEffect)((function(){return e(t.current),function(){return e(null)}}),[]),t}(o),i=Object(s.useContext)(Vu),c=i.static||e.static||!1,l=fu(e),u=function(e,t,n,r){void 0===t&&(t={});var o={},a=Object(s.useRef)({}).current;for(var i in t){var c=t[i];if(lu(c))e.set(i,c);else if(n||!al(i)&&!xu(i))o[i]=c;else{if(e.has(i)){if(c!==a[i])e.get(i).set(c)}else e.set(i,iu(c));a[i]=c}}return r?r(o):o}(l,e.style,c,e.transformValues),d=ed(e),p=Zu(su((function(){return t(a,l)})),e,d),f=Ju(i,p,l,c,e),h=c?null:n(a,l,e,i,p,d),m=r(a,u,l,e,c);return Object(s.createElement)(s.Fragment,null,Object(s.createElement)(Vu.Provider,{value:f},m),Object(s.createElement)(s.Fragment,null,Object(s.createElement)(yu,{innerRef:a,values:l,isStatic:c}),h))}))},nd=["animate","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use","view"],rd=Object(s.createContext)({transformPagePoint:function(e){return e}});function od(e){return Object(s.useEffect)((function(){return function(){return e()}}),[])}function ad(e,t,n,r){if(n)return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n,r)}}function id(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function sd(e){return!!e.touches}var cd={pageX:0,pageY:0};function ld(e){var t=e.pageX,n=void 0===t?0:t,r=e.pageY;return{x:n,y:void 0===r?0:r}}function ud(e){return{point:sd(e)?(t=e,n=t.touches[0]||t.changedTouches[0]||cd,{x:n.pageX,y:n.pageY}):ld(e)};var t,n}var dd,pd=function(e,t){if(void 0===t&&(t=!1),e){var n=function(t){return e(t,ud(t))};return t?function(e){if(e)return function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}}(n):n}},fd="undefined"!=typeof window,hd={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},md={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function gd(e){return fd&&null===window.onpointerdown?e:fd&&null===window.ontouchstart?md[e]:fd&&null===window.onmousedown?hd[e]:e}function bd(e,t,n,r){return ad(e,gd(t),pd(n,"pointerdown"===t),r)}function vd(e,t,n,r){return function(e,t,n,r){Object(s.useEffect)((function(){var o=e.current;if(n&&o)return ad(o,t,n,r)}),[e,t,n,r])}(e,gd(t),pd(n,"pointerdown"===t),r)}!function(e){e.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},e.relativeTo=function(e){var t;return function(n){var r=n.x,o=n.y,a=void 0!==t?t:t="string"==typeof e?document.getElementById(e):e;if(a){var i=a.getBoundingClientRect();return{x:r-i.left-window.scrollX,y:o-i.top-window.scrollY}}}}}(dd||(dd={}));var yd=!1;"undefined"!=typeof window&&document.addEventListener("touchmove",(function(e){yd&&e.preventDefault()}),{passive:!1});var wd=function(){return yd=!1},Ed=function(){function e(e,t,n){var r=this,o=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var e=_d(r.lastMoveEventInfo,r.history),t=null!==r.startEvent,n=Oc(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,a=bs().timestamp;r.history.push(Zi(Zi({},o),{timestamp:a}));var i=r.handlers,s=i.onStart,c=i.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),c&&c(r.lastMoveEvent,e)}}},!(sd(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var a=xd(ud(e),this.transformPagePoint),i=a.point,s=bs().timestamp;this.history=[Zi(Zi({},i),{timestamp:s})];var c=t.onSessionStart;c&&c(e,_d(a,this.history));var l=bd(window,"pointermove",(function(e,t){return r.handlePointerMove(e,t)})),u=bd(window,"pointerup",(function(e,t){return r.handlePointerUp(e,t)}));this.removeListeners=function(){l&&l(),u&&u()}}}return e.prototype.handlePointerMove=function(e,t){this.lastMoveEvent=e,this.lastMoveEventInfo=xd(t,this.transformPagePoint),id(e)&&0===e.buttons?this.handlePointerUp(e,t):vs.update(this.updatePoint,!0)},e.prototype.handlePointerUp=function(e,t){this.end();var n=this.handlers.onEnd;if(n){var r=_d(xd(t,this.transformPagePoint),this.history);n&&n(e,r)}},e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),fs.update(this.updatePoint),wd()},e}();function xd(e,t){return t?{point:t(e.point)}:e}function _d(e,t){var n=e.point;return{point:n,delta:dd.subtract(n,Td(t)),offset:dd.subtract(n,Cd(t)),velocity:kd(t,.1)}}function Cd(e){return e[0]}function Td(e){return e[e.length-1]}function kd(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Td(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Uu(t)));)n--;if(!r)return{x:0,y:0};var a=(o.timestamp-r.timestamp)/1e3;if(0===a)return{x:0,y:0};var i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}var Od=function(e,t){return!!t&&(e===t||Od(e,t.parentElement))},Sd=["whileHover","whileTap","whileDrag"],Id=function(e){return Sd.indexOf(e)+1};function Ad(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var jd=Ad("dragHorizontal"),Nd=Ad("dragVertical");function Md(e){var t=!1;if("y"===e)t=Nd();else if("x"===e)t=jd();else{var n=jd(),r=Nd();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}var Pd=Id("whileTap");var Rd=Id("whileHover"),Ld=function(e){return function(t,n){id(t)&&e(t,n)}};function Dd(e,t){!function(e,t){var n=e.onPan,r=e.onPanStart,o=e.onPanEnd,a=e.onPanSessionStart,i=n||r||o||a,c=Object(s.useRef)(null),l=Object(s.useContext)(rd).transformPagePoint,u={onSessionStart:a,onStart:r,onMove:n,onEnd:function(e,t){c.current=null,o&&o(e,t)}};Object(s.useEffect)((function(){null!==c.current&&c.current.updateHandlers(u)})),vd(t,"pointerdown",i&&function(e){c.current=new Ed(e,u,{transformPagePoint:l})}),od((function(){return c.current&&c.current.end()}))}(e,t),function(e,t){var n=e.onTap,r=e.onTapStart,o=e.onTapCancel,a=e.whileTap,i=e.controls,c=n||r||o||a,l=Object(s.useRef)(!1),u=Object(s.useRef)(null);function d(){u.current&&u.current(),u.current=null}a&&i&&i.setOverride(a,Pd);var p=Object(s.useRef)(null);p.current=function(e,r){var s=t.current;if(d(),l.current&&s){l.current=!1,i&&a&&i.clearOverride(Pd);var c=Md(!0);c&&(c(),Od(s,e.target)?n&&n(e,r):o&&o(e,r))}},vd(t,"pointerdown",c?function(e,n){d(),u.current=bd(window,"pointerup",(function(e,t){return p.current(e,t)})),t.current&&!l.current&&(l.current=!0,r&&r(e,n),i&&a&&i.startOverride(Pd))}:void 0),od(d)}(e,t),function(e,t){var n=e.whileHover,r=e.onHoverStart,o=e.onHoverEnd,a=e.controls;n&&a&&a.setOverride(n,Rd),vd(t,"pointerenter",Ld((function(e,t){r&&r(e,t),n&&a&&a.startOverride(Rd)}))),vd(t,"pointerleave",Ld((function(e,t){o&&o(e,t),n&&a&&a.clearOverride(Rd)})))}(e,t)}var Bd=function(e){return function(t){return e(t),null}},Hd=["onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileTap","whileHover","onHoverStart","onHoverEnd"],Ud={key:"gestures",shouldRender:function(e){return Hd.some((function(t){return e.hasOwnProperty(t)}))},Component:Bd((function(e){var t=e.innerRef;Dd(es(e,["innerRef"]),t)}))},zd=function(e){return"object"==typeof e&&e.hasOwnProperty("current")},Fd=function(e){return e},$d=function(){function e(e){var t=e.ref,n=e.values,r=e.controls;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.props={transformPagePoint:Fd},this.point={},this.origin={x:iu(0),y:iu(0)},this.openGlobalLock=null,this.panSession=null,this.prevConstraintsBox={width:0,height:0,x:0,y:0},this.ref=t,this.values=n,this.controls=r}return e.prototype.start=function(e,t){var n=this,r=(void 0===t?{}:t).snapToCursor;void 0!==r&&r&&this.snapToCursor(e);var o=this.props.transformPagePoint;this.panSession=new Ed(e,{onSessionStart:function(){yd=!0,Gd((function(e){var t=n.point[e];t&&t.stop()}))},onStart:function(e,t){if(n.constraintsNeedResolution){var r=n.props,o=r.dragConstraints,a=r.transformPagePoint;n.constraints=Wd(o,n.ref,n.point,a),n.applyConstraintsToPoint()}Gd((function(e){var t=n.point[e];t&&n.origin[e].set(t.get())}));var i=n.props,s=i.drag,c=i.dragPropagation;if(!s||c||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Md(s),n.openGlobalLock)){n.isDragging=!0,n.currentDirection=null;var l=n.props.onDragStart;l&&l(e,qd(t,n.point))}},onMove:function(e,t){var r=n.props,o=r.dragPropagation,a=r.dragDirectionLock;if(o||n.openGlobalLock){var i=t.offset;if(a&&null===n.currentDirection){if(n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(i),null!==n.currentDirection){var s=n.props.onDirectionLock;s&&s(n.currentDirection)}}else{n.updatePoint("x",i),n.updatePoint("y",i);var c=n.props.onDrag;c&&c(e,qd(t,n.point))}}},onEnd:function(e,t){n.stop(e,t)}},{transformPagePoint:o})},e.prototype.cancelDrag=function(){wd(),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null)},e.prototype.stop=function(e,t){var n;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var o=this.props,a=o.dragMomentum,i=o.dragElastic,s=o.onDragEnd;if(a||i){var c=t.velocity;this.animateDragEnd(c)}else this.recordBoxInfo(this.constraints);s&&s(e,qd(t,this.point))}},e.prototype.recordBoxInfo=function(e){if(e){var t=e.right,n=e.left,r=e.bottom,o=e.top;this.prevConstraintsBox.width=(t||0)-(n||0),this.prevConstraintsBox.height=(r||0)-(o||0)}this.point.x&&(this.prevConstraintsBox.x=this.point.x.get()),this.point.y&&(this.prevConstraintsBox.y=this.point.y.get())},e.prototype.snapToCursor=function(e){var t=this,n=this.props.transformPagePoint,r=ud(e).point,o=Vd(this.ref,n),a=o.width/2+o.left+window.scrollX,i=o.height/2+o.top+window.scrollY,s={x:r.x-a,y:r.y-i};Gd((function(e){var n=t.point[e];n&&t.origin[e].set(n.get())})),this.updatePoint("x",s),this.updatePoint("y",s)},e.prototype.setPoint=function(e,t){this.point[e]=t},e.prototype.updatePoint=function(e,t){var n=this.props,r=n.drag,o=n.dragElastic,a=this.point[e];if(Kd(e,r,this.currentDirection)&&a){var i=Qd(e,this.origin[e].get()+t[e],this.constraints,o);a.set(i)}},e.prototype.updateProps=function(e){var t=this,n=e.drag,r=void 0!==n&&n,o=e.dragDirectionLock,a=void 0!==o&&o,i=e.dragPropagation,s=void 0!==i&&i,c=e.dragConstraints,l=void 0!==c&&c,u=e.dragElastic,d=void 0===u||u,p=e.dragMomentum,f=void 0===p||p,h=es(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Zi({drag:r,dragDirectionLock:a,dragPropagation:s,dragConstraints:l,dragElastic:d,dragMomentum:f},h);var m=h._dragValueX,g=h._dragValueY,b=h.dragOriginX,v=h.dragOriginY;b&&(this.origin.x=b),v&&(this.origin.y=v),Gd((function(e){if(Kd(e,r,t.currentDirection)){var n="x"===e?m:g;t.setPoint(e,n||t.values.get(e,0))}})),this.constraintsNeedResolution=zd(l),this.constraints=this.constraintsNeedResolution?this.constraints||!1:l},e.prototype.applyConstraintsToPoint=function(e){var t=this;return void 0===e&&(e=this.constraints),Gd((function(n){var r=t.point[n];r&&!r.isAnimating()&&Qd(n,r,e,0)}))},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,r=n.drag,o=n.dragMomentum,a=n.dragElastic,i=n.dragTransition,s=n._dragValueX,c=n._dragValueY,l=n._dragTransitionControls,u=Gd((function(n){var u;if(Kd(n,r,t.currentDirection)){var d=t.constraints?Yd(n,t.constraints):{},p=a?200:1e6,f=a?40:1e7,h=l||t.controls,m=Zi(Zi({type:"inertia",velocity:o?e[n]:0,bounceStiffness:p,bounceDamping:f,timeConstant:750,restDelta:1},i),d),g="x"===n?s:c;return g?qu(n,g,0,m):h.start(((u={})[n]=0,u.transition=m,u))}}));return Promise.all(u).then((function(){t.recordBoxInfo(t.constraints),t.scalePoint();var e=t.props.onDragTransitionEnd;e&&e()}))},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.dragConstraints,r=t.transformPagePoint;if(zd(n)){var o=Vd(n,r),a=Vd(this.ref,r),i=function(t,n){var r=e.point[t];if(r){if(r.isAnimating())return r.stop(),void e.recordBoxInfo();var i=e.prevConstraintsBox[n]?(o[n]-a[n])/e.prevConstraintsBox[n]:1;r.set(e.prevConstraintsBox[t]*i)}};i("x","width"),i("y","height")}},e.prototype.mount=function(e){var t=this,n=bd(e,"pointerdown",(function(e){var n=t.props,r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=ad(window,"resize",(function(){return t.scalePoint()}));if(this.constraintsNeedResolution){var o=this.props,a=o.dragConstraints,i=o.transformPagePoint,s=Wd(a,this.ref,this.point,i);this.applyConstraintsToPoint(s),this.recordBoxInfo(s)}else!this.isDragging&&this.constraints&&this.applyConstraintsToPoint();return function(){n&&n(),r&&r(),t.cancelDrag()}},e}();function Gd(e){return[e("x"),e("y")]}function qd(e,t){return Zi(Zi({},e),{point:{x:t.x?t.x.get():0,y:t.y?t.y.get():0}})}function Yd(e,t){var n=t.top,r=t.right,o=t.bottom,a=t.left;return"x"===e?{min:a,max:r}:{min:n,max:o}}function Kd(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}function Wd(e,t,n,r){null!==e.current&&t.current;var o=Vd(e,r),a=Vd(t,r),i=o.left-a.left+Xd(n.x),s=o.top-a.top+Xd(n.y);return{top:s,left:i,right:o.width-a.width+i,bottom:o.height-a.height+s}}function Vd(e,t){var n=e.current.getBoundingClientRect(),r=t({x:n.left,y:n.top}),o=r.x,a=r.y,i=t({x:n.width,y:n.height});return{left:o,top:a,width:i.x,height:i.y}}function Xd(e){return e?e.get():0}function Qd(e,t,n,r){var o=t instanceof au?t.get():t;if(!n)return o;var a=Yd(e,n),i=a.min,s=a.max;return void 0!==i&&o<i?o=r?Jd(i,o,r):Math.max(i,o):void 0!==s&&o>s&&(o=r?Jd(s,o,r):Math.min(s,o)),t instanceof au&&t.set(o),o}function Jd(e,t,n){return Ic(e,t,"number"==typeof n?n:.35)}var Zd={key:"drag",shouldRender:function(e){return!!e.drag},Component:Bd((function(e){var t=e.innerRef,n=e.values,r=e.controls;return function(e,t,n,r){var o=e.dragControls,a=Object(s.useContext)(rd).transformPagePoint,i=su((function(){return new $d({ref:t,values:n,controls:r})}));i.updateProps(Zi(Zi({},e),{transformPagePoint:a})),Object(s.useEffect)((function(){return o&&o.subscribe(i)}),[i]),Object(s.useEffect)((function(){return i.mount(t.current)}),[])}(es(e,["innerRef","values","controls"]),t,n,r)}))};function ep(e){return"string"==typeof e&&e.startsWith("var(--")}var tp=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function np(e,t,n){void 0===n&&(n=1);var r=function(e){var t=tp.exec(e);return t?[t[1],t[2]]:[,]}(e),o=r[0],a=r[1];if(o){var i=window.getComputedStyle(t).getPropertyValue(o);return i||(ep(a)?np(a,t,n+1):a)}}var rp,op=new Set(["width","height","top","left","right","bottom","x","y"]),ap=function(e){return op.has(e)},ip=function(e,t){e.set(t,!1),e.set(t)},sp=function(e){return e===Cs||e===As};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(rp||(rp={}));var cp=function(e,t){return parseFloat(e.split(", ")[t])},lp=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var a=o.match(/^matrix3d\((.+)\)$/);if(a)return cp(a[1],t);var i=o.match(/^matrix\((.+)\)$/);return i?cp(i[1],e):0}},up=new Set(["x","y","z"]),dp=rl.filter((function(e){return!up.has(e)}));var pp={width:function(e){return e.width},height:function(e){return e.height},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.height,r=t.top;return parseFloat(r)+n},right:function(e,t){var n=e.width,r=t.left;return parseFloat(r)+n},x:lp(4,13),y:lp(5,14)},fp=function(e,t,n,r){void 0===r&&(r={}),n=Zi({},n),r=Zi({},r);var o=t.current,a=jl(o),i=Object.keys(n).filter(ap),s=[],c=!1,l=i.reduce((function(t,o){var i=e.get(o);if(!i)return t;var l,u=i.get(),d=n[o],p=Iu(u);if(Cu(d))for(var f=d.length,h=null===d[0]?1:0;h<f;h++)l?Iu(d[h]):(l=Iu(d[h]))===p||sp(p)&&sp(l);else l=Iu(d);if(p!==l)if(sp(p)&&sp(l)){var m=i.get();"string"==typeof m&&i.set(parseFloat(m)),"string"==typeof d?n[o]=parseFloat(d):Array.isArray(d)&&l===As&&(n[o]=d.map(parseFloat))}else c||(s=function(e,t){var n=[];return dp.forEach((function(t){var r=e.get(t);void 0!==r&&(n.push([t,r.get()]),r.set(t.startsWith("scale")?1:0))})),n.length&&t.render(),n}(e,a),c=!0),t.push(o),r[o]=void 0!==r[o]?r[o]:n[o],ip(i,d);return t}),[]);if(l.length){var u=function(e,t,n,r,o){var a=n.getBoundingClientRect(),i=getComputedStyle(n),s=i.display,c={top:i.top,left:i.left,bottom:i.bottom,right:i.right,transform:i.transform};"none"===s&&r.set("display",e.display||"block"),r.render();var l=n.getBoundingClientRect();return o.forEach((function(n){var r=t.get(n);ip(r,pp[n](a,c)),e[n]=pp[n](l,i)})),e}(n,e,o,a,l);return s.length&&s.forEach((function(t){var n=t[0],r=t[1];e.get(n).set(r)})),a.render(),{target:u,transitionEnd:r}}return{target:n,transitionEnd:r}};function hp(e,t,n,r){return function(e){return Object.keys(e).some(ap)}(n)?fp(e,t,n,r):{target:n,transitionEnd:r}}var mp=function(e,t){return function(n,r){var o=function(e,t,n,r){var o=es(n,[]),a=t.current;if(!(a instanceof HTMLElement))return{target:o,transitionEnd:r};for(var i in r&&(r=Zi({},r)),e.forEach((function(e){var t=e.get();if(ep(t)){var n=np(t,a);n&&e.set(n)}})),o){var s=o[i];if(ep(s)){var c=np(s,a);c&&(o[i]=c,r&&void 0===r[i]&&(r[i]=s))}}return{target:o,transitionEnd:r}}(e,t,n,r);return n=o.target,r=o.transitionEnd,hp(e,t,n,r)}};var gp,bp,vp=Object(s.createContext)(null);!function(e){e.Prepare="prepare",e.Read="read",e.Render="render"}(bp||(bp={}));var yp=[bp.Prepare,bp.Read,bp.Render].reduce((function(e,t){return e[t]=[],e}),{}),wp=!1;function Ep(e){for(var t=e.length,n=0;n<t;n++)e[n]();e.length=0}var xp=function(e){return function(t){t&&(wp=!0,yp[e].push(t))}},_p=((gp={})[bp.Prepare]=xp(bp.Prepare),gp[bp.Read]=xp(bp.Read),gp[bp.Render]=xp(bp.Render),gp.flush=function(){wp&&(Ep(yp.prepare),Ep(yp.read),Ep(yp.render),wp=!1)},gp);var Cp={duration:.8,ease:[.45,.05,.19,1]},Tp={type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10};var kp={id:"x",size:"width",min:"left",max:"right",origin:"originX"},Op={id:"y",size:"height",min:"top",max:"bottom",origin:"originY"};function Sp(e,t){return(e+t)/2}function Ip(e,t,n){var r,o=e[n.size]-t[n.size],a=.5;return o&&(e[n.min]===t[n.min]?a=0:e[n.max]===t[n.max]&&(a=1)),(r={})[n.size]=o,r[n.origin]=a,r[n.id]=.5===a?Sp(e[n.min],e[n.max])-Sp(t[n.min],t[n.max]):0,r}var Ap={getLayout:function(e){return e.offset},measure:function(e){var t=e.offsetLeft,n=e.offsetTop,r=e.offsetWidth,o=e.offsetHeight;return{left:t,top:n,right:t+r,bottom:n+o,width:r,height:o}}},jp={getLayout:function(e){return e.boundingBox},measure:function(e){var t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height,right:t.right,bottom:t.bottom}}};function Np(e){return window.getComputedStyle(e).position}function Mp(e){return"width"===e||"height"===e}var Pp,Rp={key:"layout",shouldRender:function(e){var t=e.positionTransition,n=e.layoutTransition;return"undefined"!=typeof window&&!(!t&&!n)},Component:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Ji(t,e),t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.innerRef,n=e.positionTransition,r=e.values,o=e.controls,a=t.current;if(function(e){return e instanceof HTMLElement}(a)){var i,s,c,l=function(e){var t=e.layoutTransition,n=e.positionTransition;return t||n}(this.props),u=!!n,d=Np(a),p={offset:Ap.measure(a),boundingBox:jp.measure(a)};return _p.prepare((function(){i=a.style.transform,a.style.transform=""})),_p.read((function(){s={offset:Ap.measure(a),boundingBox:jp.measure(a)};var e=Np(a);c=function(e,t,n){return n&&e===t?Ap:jp}(d,e,u)})),_p.render((function(){var e=function(e,t){return Zi(Zi({},Ip(e,t,kp)),Ip(e,t,Op))}(c.getLayout(p),c.getLayout(s));if(e.x||e.y||e.width||e.height){jl(a).set({originX:e.originX,originY:e.originY}),gu();var t={},n={},d=function(e){return"function"==typeof e}(l)?l({delta:e}):l;f("left","x",0,e.x),f("top","y",0,e.y),u||(f("width","scaleX",1,p.boundingBox.width/s.boundingBox.width),f("height","scaleY",1,p.boundingBox.height/s.boundingBox.height)),t.transition=n,d&&o.start(t),bu()}else i&&(a.style.transform=i);function f(o,a,i,s){var l=Mp(o)?o:a;if(e[l]){var p="boolean"==typeof d?Zi({},function(e){return e?Tp:Cp}(u)):d,f=r.get(a,i),h=f.getVelocity();n[a]=p[a]?Zi({},p[a]):Zi({},p),void 0===n[a].velocity&&(n[a].velocity=h||0),t[a]=i;var m=Mp(o)||c!==Ap?0:f.get();f.set(s+m)}}})),null}},t.prototype.componentDidUpdate=function(){_p.flush()},t.prototype.render=function(){return null},t.contextType=vp,t}(s.Component)},Lp=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","static","positionTransition","layoutTransition","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragElastic","dragMomentum","dragPropagation","dragTransition","_dragValueX","_dragValueY","_dragTransitionControls","dragOriginX","dragOriginY","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileHover","whileTap","onHoverEnd","onHoverStart"]);function Dp(e){return Lp.has(e)}!function(e){e.Target="Target",e.VariantLabel="VariantLabel",e.AnimationSubscription="AnimationSubscription"}(Pp||(Pp={}));function Bp(e,t){void 0===t&&(t=!1);e.transition;var n=e.transitionEnd,r=es(e,["transition","transitionEnd"]);return t?Zi(Zi({},r),n):r}var Hp,Up,zp=function(e){var t,n=e instanceof au?e.get():e;return Array.from(new Set((t=n)?Array.isArray(t)?t:[t]:[]))};var Fp=((Hp={})[Pp.Target]=Bd((function(e){return function(e,t,n,r){var o=Object(s.useRef)(!0),a=Object(s.useRef)(null);a.current||(a.current=Bp(e,!0)),Object(s.useEffect)((function(){var i,s,c={},l=Bp(e),u=Bp(e,!0);for(var d in l){var p=o.current&&(!n.has(d)||n.get(d).get()!==u[d]),f=null!==u[d],h=(i=a.current[d],void 0!==(s=u[d])&&(Array.isArray(i)&&Array.isArray(s)?!function(e,t){if(null===t)return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}(s,i):i!==s));f&&(h||p)&&(c[d]=l[d])}o.current=!1,a.current=Zi(Zi({},a.current),u),Object.keys(c).length&&t.start(Zi(Zi({},c),{transition:e.transition||r,transitionEnd:e.transitionEnd}))}),[e])}(e.animate,e.controls,e.values,e.transition)})),Hp[Pp.VariantLabel]=Bd((function(e){var t=e.animate,n=e.inherit,r=void 0===n||n,o=e.controls;return function(e,t,n,r){var o=zp(t),a=Object(s.useContext)(Vu),i=a.hasMounted&&a.hasMounted.current,c=Object(s.useRef)(!1);Object(s.useEffect)((function(){var t,s,l=!1;n?(l=!!i,o=zp(a.animate)):l=c.current||(t=zp(e),s=o,t.join(",")!==s.join(",")),l&&r.start(o),c.current=!0}),[o.join(",")])}(e.initial,t,r,o)})),Hp[Pp.AnimationSubscription]=Bd((function(e){return function(e,t){var n=Object(s.useMemo)((function(){return e.subscribe(t)}),[e]);Object(s.useEffect)((function(){return function(){n&&n()}}),[n])}(e.animate,e.controls)})),Hp),$p=function(e){return e.animate instanceof Ku},Gp=["initial","animate","whileTap","whileHover"],qp=((Up={})[Pp.Target]=function(e){return!(void 0===e.animate||(t=e.animate,Array.isArray(t)||"string"==typeof t)||$p(e));var t},Up[Pp.VariantLabel]=function(e){return void 0!==e.variants||Gp.some((function(t){return"string"==typeof e[t]}))},Up[Pp.AnimationSubscription]=$p,Up);var Yp={key:"exit",shouldRender:function(e){return!!e.exit&&!ed(e)},Component:Bd((function(e){var t,n=e.animate,r=e.controls,o=e.exit,a=function(){var e=Object(s.useContext)(Wu);if(null===e)return[!0];var t=e.isPresent,n=e.onExitComplete,r=e.register;return Object(s.useEffect)(r,[]),!t&&n?[!1,n]:[!0]}(),i=a[0],c=a[1],l=Object(s.useContext)(Wu),u=Object(s.useRef)(!1),d=void 0!==(null===(t=l)||void 0===t?void 0:t.custom)?l.custom:e.custom;Object(s.useEffect)((function(){i?!u.current||!n||n instanceof Ku||r.start(n):(!u.current&&o&&(r.setProps(Zi(Zi({},e),{custom:d})),r.start(o).then(c)),u.current=!0),i&&(u.current=!1)}),[i])}))},Kp=function(e){return!Dp(e)};try{var Wp=n(13).default;Kp=function(e){return e.startsWith("on")?!Dp(e):Wp(e)}}catch(e){}var Vp=[Rp,Zd,Ud,Yp],Xp=Vp.length;function Qp(e){var t="string"==typeof e,n=t&&-1!==nd.indexOf(e);return{renderComponent:function(r,o,a,i,c){var l=t?function(e){var t={};for(var n in e)Kp(n)&&(t[n]=e[n]);return t}(i):i,u=n?function(e,t){var n=Tl(wu(e),void 0,void 0,void 0,void 0,!1);return n.style=Zi(Zi({},t),n.style),n}(a,o):function(e,t,n,r){var o={style:_u(e,t,n)};return r&&(o.style.userSelect="none",o.draggable=!1),o}(a,o,c,!!i.drag);return Object(s.createElement)(e,Zi(Zi(Zi({},l),{ref:r}),u))},loadFunctionalityComponents:function(e,t,n,r,o,a){var i=[],c=function(e){var t=void 0;for(var n in Pp)qp[n](e)&&(t=n);return t?Fp[t]:void 0}(n);c&&i.push(Object(s.createElement)(c,{key:"animation",initial:n.initial,animate:n.animate,variants:n.variants,transition:n.transition,controls:o,inherit:a,values:t}));for(var l=0;l<Xp;l++){var u=Vp[l],d=u.shouldRender,p=u.key,f=u.Component;d(n,r)&&i.push(Object(s.createElement)(f,Zi({key:p},n,{parentContext:r,values:t,controls:o,innerRef:e})))}return i},getValueControlsConfig:function(e,t){return{values:t,readValueFromSource:function(t){return jl(e.current).get(t)},makeTargetAnimatable:mp(t,e)}}}}var Jp=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].reduce((function(e,t){var n=Qp(t);return e[t]=td(n),e}),{}),Zp=nd.reduce((function(e,t){return e[t]=td(Qp(t)),e}),{}),ef=Zi(Zi({custom:function(e){return td(Qp(e))}},Jp),Zp);function tf(e){return su((function(){return iu(e)}))}function nf(){return{scrollX:iu(0),scrollY:iu(0),scrollXProgress:iu(0),scrollYProgress:iu(0)}}"undefined"!=typeof window?s.useLayoutEffect:s.useEffect;nf();!function(){function e(){this.componentControls=new Set}e.prototype.subscribe=function(e){var t=this;return this.componentControls.add(e),function(){return t.componentControls.delete(e)}},e.prototype.start=function(e,t){this.componentControls.forEach((function(n){n.start(e.nativeEvent||e,t)}))}}();var rf=iu(null);if("undefined"!=typeof window)if(window.matchMedia){var of=window.matchMedia("(prefers-reduced-motion)"),af=function(){return rf.set(of.matches)};of.addListener(af),af()}else rf.set(!1);function sf(e){return e.touches||e.originalEvent.touches}let cf=null;var lf=e=>{let{setIndex:t,index:n,carousel:r}=e;return{handleTouchStart:Object(s.useCallback)(e=>{const t=sf(e)[0];cf=t.clientX},[]),handleTouchMove:Object(s.useCallback)(e=>{if(!cf)return;const o=sf(e)[0].clientX;t(cf-o>5?n+1:n-1,r),cf=null},[r,n,t]),handleTouchEnd:Object(s.useCallback)(()=>{cf=null},[])}};const uf=Ye.c.a.withConfig({displayName:"stylesProduct__ProductWrapper",componentId:"sc-20xwq1-0"})(["text-decoration:none;color:initial;cursor:pointer;width:100%;"]),df=Ye.c.div.withConfig({displayName:"stylesProduct__Product",componentId:"sc-20xwq1-1"})(["display:flex;padding:2px;flex-direction:column;align-items:flex-start;overflow:hidden;"," @media ","{margin-right:16px;margin-bottom:3px;box-shadow:0px 1px 3px 0px ",";border-radius:8px;overflow:hidden;max-width:201px;&:first-child{margin-left:24px;}}"],Vr,eo.maxPhone,Xr.shadowColor),pf=Ye.c.img.withConfig({displayName:"stylesProduct__ProductImage",componentId:"sc-20xwq1-2"})(["width:155px;height:155px;object-fit:cover;border-radius:8px;margin-bottom:8px;@media ","{width:201px;height:201px;border-radius:0;margin-bottom:0;}"],eo.maxPhone),ff=Ye.c.div.withConfig({displayName:"stylesProduct__Content",componentId:"sc-20xwq1-3"})(["max-width:100%;@media ","{padding:8px 16px;}"],eo.maxPhone),hf=Object(Ye.b)(["font-size:14px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;"]),mf=Ye.c.a.withConfig({displayName:"stylesProduct__ActionLink",componentId:"sc-20xwq1-4"})([""," color:#333;display:block;margin-top:8px;text-decoration:underline;cursor:hover;"],hf),gf=Ye.c.button.withConfig({displayName:"stylesProduct__ActionButton",componentId:"sc-20xwq1-5"})([""," padding:6px 0;border:none;cursor:pointer;margin-top:8px;width:100%;display:flex;align-items:center;justify-content:center;border-radius:100px;color:",";background:",";background-color:",";font-family:",";"],hf,e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,Kr.default),bf=Ye.c.h4.withConfig({displayName:"stylesProduct__ProductTitle",componentId:"sc-20xwq1-6"})([""," font-weight:500;"],hf),vf=Ye.c.p.withConfig({displayName:"stylesProduct__ProductDescription",componentId:"sc-20xwq1-7"})([""," font-weight:400;"],hf),yf=Ye.c.div.withConfig({displayName:"stylesProduct__ProductPrice",componentId:"sc-20xwq1-8"})([""," font-weight:500;"],hf),wf=e=>{let{to:t,text:n,onClick:r}=e;return t?c.a.createElement(mf,{onClick:r,href:t},n):c.a.createElement(gf,{onClick:r},n)};var Ef=e=>{var t,n,r,o,a,i;let{product:s,onProductClick:l}=e;const u=null!==(t=null==s?void 0:s.image)&&void 0!==t&&t,d=null!==(n=null==s?void 0:s.title)&&void 0!==n&&n,p=null!==(r=null==s?void 0:s.productUrl)&&void 0!==r&&r,f=null!==(o=null==s?void 0:s.description)&&void 0!==o&&o,h=(null==s?void 0:s.price)||!1,m=null!==(a=null==s?void 0:s.linkText)&&void 0!==a&&a,g=null!==(i=null==s?void 0:s.linkUrl)&&void 0!==i&&i;return c.a.createElement(df,null,c.a.createElement(uf,{href:p},u&&c.a.createElement(pf,{src:u,alt:d}),c.a.createElement(ff,null,d&&c.a.createElement(bf,null,d),f&&c.a.createElement(vf,null,f),h&&c.a.createElement(yf,null,h))),m&&c.a.createElement(wf,{to:g,text:m,onClick:e=>{if("function"==typeof l)try{l(e,s)}catch(e){}}}))};const xf=Ye.c.div.withConfig({displayName:"stylesProducts__Container",componentId:"sc-vfg4fr-0"})(["margin:24px;@media ","{margin:24px 0;}"],eo.maxPhone),_f=Ye.c.div.withConfig({displayName:"stylesProducts__CarouselContainer",componentId:"sc-vfg4fr-1"})(["position:relative;overflow:hidden;> div{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:auto;grid-gap:14px;transform:translate(0);",";}"],e=>e.active&&"\n position: relative;\n width: 1000%;\n display: flex;\n grid-gap: 0px;\n "),Cf=Ye.c.h2.withConfig({displayName:"stylesProducts__Title",componentId:"sc-vfg4fr-2"})(["font-size:16px;font-weight:500;line-height:26px;margin:16px 0px;@media ","{margin:16px 24px;}"],eo.maxPhone),Tf=e=>{let{children:t,carouselPosition:n,onTouchStart:r,onTouchMove:o,onTouchEnd:a}=e;return c.a.createElement(ef.div,{transition:{ease:"easeInOut",duration:.3},style:{x:n},onTouchStart:r,onTouchMove:o,onTouchEnd:a},t)};var kf=e=>{var t,n;let{section:r,onProductClick:o}=e;const{width:a}=(()=>{const[e,t]=Object(s.useState)({width:void 0,height:void 0});return Object(s.useEffect)(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),e})(),i=parseInt(Zr.phone.replace("px",""),10),l=null!==(t=null==r?void 0:r.items)&&void 0!==t?t:[],u=null!==(n=null==r?void 0:r.title)&&void 0!==n&&n,{setIndex:d,imageIndex:p,carouselPosition:f}=(e=>{let{windowWidth:t,phoneWidth:n,ignoreDesktop:r=!0}=e;const[o,a]=Object(s.useState)(0),i=tf(0);return Object(s.useEffect)(()=>{t>=n&&r&&i.set(0)},[t,n,i,r]),{setIndex:Object(s.useCallback)((e,r)=>{if(t>=n)return;if(e<0||e>=r.length)return;const o=-217*e;a(e),i.set(o)},[t,n,i]),imageIndex:o,carouselPosition:i}})({windowWidth:a,phoneWidth:i}),{handleTouchStart:h,handleTouchMove:m,handleTouchEnd:g}=lf({carousel:l,index:p,setIndex:d});return c.a.createElement(xf,null,u&&c.a.createElement(Cf,null,u),c.a.createElement(_f,{active:a<i},c.a.createElement(Tf,{carouselPosition:f,onTouchStart:h,onTouchMove:m,onTouchEnd:g},l.map((e,t)=>c.a.createElement(Ef,{product:e,key:`product_${t}`,onProductClick:o})))))},Of=e=>{let{styles:t={},...n}=e;return c.a.createElement("svg",Object.assign({viewBox:"0 0 1792 1792",xmlns:"https://www.w3.org/2000/svg"},n),c.a.createElement("path",{d:"M1408 928v320q0 119-84.5 203.5T1120 1536H288q-119 0-203.5-84.5T0 1248V416q0-119 84.5-203.5T288 128h704q14 0 23 9t9 23v64q0 14-9 23t-23 9H288q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113V928q0-14 9-23t23-9h64q14 0 23 9t9 23zm384-864v512q0 26-19 45t-45 19-45-19l-176-176-652 652q-10 10-23 10t-23-10L695 983q-10-10-10-23t10-23l652-652-176-176q-19-19-19-45t19-45 45-19h512q26 0 45 19t19 45z",fill:"#fff"}))},Sf=i.a.arrayOf(i.a.shape({selected:i.a.bool.isRequired,_id:i.a.string.isRequired,score:i.a.number.isRequired,sample:i.a.string.isRequired})),If=(i.a.shape({message:i.a.string,from_bot:i.a.bool,image_carousel:i.a.arrayOf(i.a.object),thon_image_above_text:i.a.bool,exchange_type:i.a.string,exchange_id:i.a.string,avatar:i.a.string,sender:i.a.oneOf(Object.values(p)),skill_subscription_id:i.a.number,bot_id:i.a.number,score:i.a.number,title:i.a.string,reply_candidates:Sf,is_followup:i.a.bool,handler:i.a.oneOf(Object.values(g)),corrected_message:i.a.string,new_context:i.a.objectOf(i.a.string)}),e=>{let{button_type:t,...n}=e;return{...n,button_type:Ni(t),category:on(t)}}),Af=e=>{let{buttons:t=[],...n}=e;return{...n,buttons:t.map(If)}};function jf(e,t,n){return Nf(e)?n:t}function Nf(e){let t=e;Pf(e)&&(t=function(e){const t=e.indexOf(",")>-1?",":" ";let n=(+(e=e.substr(4).split(")")[0].split(t))[0]).toString(16),r=(+e[1]).toString(16),o=(+e[2]).toString(16);1===n.length&&(n=`0${n}`);1===r.length&&(r=`0${r}`);1===o.length&&(o=`0${o}`);return`#${n}${r}${o}`}(e)),Rf(e)&&(t=e.replace(Mf,(e,t,n,r)=>`#${t}${t}${n}${n}${r}${r}`));const n="#"===t.charAt(0)?t.substring(1,7):t,r=[parseInt(n.substring(0,2),16)/255,parseInt(n.substring(2,4),16)/255,parseInt(n.substring(4,6),16)/255].map(e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4);return.2126*r[0]+.7152*r[1]+.0722*r[2]>.179}const Mf=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Pf=e=>e.match(/^rgb/),Rf=e=>e.match(Mf),Lf=Object(Ye.b)(["color:",";background:",";background-color:",";border-color:",";"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>_r(.08,e.theme.buttonBackground)),Df=Object(Ye.b)(["width:100%;max-width:100%;min-width:48px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]),Bf=Object(Ye.b)(["font-family:",";font-size:",";",";transition:all 0.2s ease;:hover{",";box-shadow:",";}:active{text-decoration:none;box-shadow:none;}"],Kr.default,Jr.fontSizeP,e=>e.color?Lf:"background-color: #fff; background: #fff",e=>e.color?Lf:"background-color: #fff; background: #fff",e=>{let{disabled:t}=e;return t?"none":`0 2px 4px 0 ${Xr.shadowColorDark}`}),Hf=Object(Ye.b)(["",""],e=>{let{hasBeenClicked:t,theme:{buttonBackground:n}}=e;return t&&(Nf(n)?"filter: brightness(0.82);":"filter: opacity(0.7);")}),Uf=Object(Ye.b)(["width:80%;max-width:80%;margin:3px 0 2px;text-align:center;border-radius:17px;font-weight:500;border:1px solid #dedede;padding:8px 12px;"," ",";",""],Bf,e=>e.hasSuggestion&&Df,Hf),zf=Object(Ye.b)(["box-sizing:border-box;width:100%;overflow:hidden;white-space:nowrap;text-align:left;font-size:16px;font-weight:500;line-height:22px;border:none;border-radius:22px;padding:11px 41px 11px 24px;margin:0 0 8px 0;",":hover{border:none;}"],Bf),Ff=Object(Ye.c)(oo).withConfig({displayName:"styles__ButtonContainer",componentId:"sc-sn3ww8-0"})(["&&{",";}"],Uf),$f=Ye.c.a.withConfig({displayName:"styles__LinkContainer",componentId:"sc-sn3ww8-1"})(["&&{color:",";cursor:pointer;outline:none;display:block;position:relative;text-decoration:none;"," ",":hover{text-decoration:none;}:hover,:focus,:active,:visited{",";}"," svg{","}}"],Xr.darkColor,e=>!e.isNudge&&"\n display: flex;\n align-items: center;\n justify-content: center;\n max-width: fit-content;\n ",e=>{let{isNudge:t}=e;return t?zf:Uf},Lf,Vr,e=>e.isNudge?"\n position: absolute;\n right: 24px;\n top: 50%;\n transform: translateY(-50%);\n ":`\n min-width: 14px;\n margin-left: 10px;\n path {\n fill: ${e.theme.buttonText};\n }\n `),Gf=Ye.c.label.withConfig({displayName:"styles__CheckboxLabel",componentId:"sc-sn3ww8-2"})(["display:flex;align-items:center;width:80%;max-width:80%;margin:3px 0 2px;text-align:left;border-radius:17px;font-weight:500;border:1px solid ",";padding:8px 12px;color:",";"," background:transparent;&:hover{background:transparent;cursor:pointer;}"],e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements},Bf),qf=Ye.c.div.withConfig({displayName:"styles__CheckboxContainer",componentId:"sc-sn3ww8-3"})(["display:inline-flex;"]),Yf=Ye.c.svg.withConfig({displayName:"styles__CheckboxIcon",componentId:"sc-sn3ww8-4"})(["fill:none;stroke:white;stroke-width:2px;"]),Kf=Ye.c.div.withConfig({displayName:"styles__StyledCheckbox",componentId:"sc-sn3ww8-5"})(["display:inline-block;width:16px;height:16px;border-radius:3px;transition:all 150ms;background:",";",";","{visibility:",";}"],e=>{let{theme:{buttonBackground:t}}=e;return t},e=>{let{checked:t,theme:{buttonBackground:n}}=e;return t?`\n background: ${n};\n `:`\n ${Nf(n)?"filter: brightness(0.7);":"filter: opacity(0.3);"};`},Yf,e=>e.checked?"visible":"hidden"),Wf=Ye.c.input.attrs({type:"checkbox"}).withConfig({displayName:"styles__HiddenCheckbox",componentId:"sc-sn3ww8-6"})(["border:0;height:0px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;&:focus ~ ","{box-shadow:0 0 0 3px ",";}"],Kf,e=>{let{theme:{buttonBackground:t}}=e;return t}),{EXTERNAL_LINK:Vf,EMAIL:Xf,PHONE:Qf,CHECKBOX:Jf}=b,Zf=e=>{let{button:t,setCheckboxValue:n,checked:r,chatMessage:o,color:a="blue",disabled:i=!1,handlers:u=null,hasSuggestion:d=!1,isNudge:p=!1,onClick:f=null,checkboxButtons:h}=e;const m=Ue(),g=on(t.button_type),{chatMessages:v,buttonClicks:y}=Ge(na)||[],w=Ge(Xo)||[],E=Object(O.a)(g,[Vf,Qf,Xf]),x=Object(O.a)(g,[Jf]),_=Boolean(r.find(e=>e.id===t.id));let C="";g===Qf&&(C="tel:"),g===Xf&&(C="mailto:");const T=Object(s.useCallback)(e=>{if(e.preventDefault(),((e,t,n,r,o,a,i)=>{let s=!1;const c=null==e?void 0:e[n];if(c){console.warn(`kindlyOptions.buttonHandlers is deprecated in favor of standard event handlers. ${We}`);try{s=Boolean(c(t,r,o,a,n))}catch(e){console.error(e)}}return"API"===i&&(s=!window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("kindly:buttonclick",{detail:{button:r,lastMessage:o,chatLog:a,buttonType:n},bubbles:!0,cancelable:!0}))),s})(e,u,g,If(t),Af(o||{}),v.map(Af),null==w?void 0:w.renderedBy))return;"function"==typeof f&&f(),m(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return async(o,a)=>{const{connection:{token:i},environment:{PAT_HOST:s,VERSION:c},messages:{chatMessages:u},chatbubble:{currentLanguage:d},local:p}=a(),f=await o(Dt()),{headers:h}=st({token:i},{withCurrentUrl:!0,extra:f}),m=on(e.button_type),g=nt()(),v={};r.length>0&&r.forEach(e=>{if(n.find(t=>t.id===e.id)){v[e.value]=e.value;const n={button:{...e},chatMessage:t,temporaryId:g,version:c},r=bn(b.CHECKBOX);o(bt({method:"post",url:`${s}/chatbubble/${l.a}/button/click/`,data:n,headers:h,...r})),o({type:"BUTTON_CLICK",buttonClick:{chatMessageId:t.id,buttonId:e.id,time:(new Date).toISOString()}})}else v[e.value]=""});const y={button:{...e,new_context:{...p.context,...v||{}}},chatMessage:t,temporaryId:g,version:c},w=bn(m),E=o(bt({method:"post",url:`${s}/chatbubble/${l.a}/button/click/`,data:y,headers:h,...w}));switch(o({type:"BUTTON_CLICK",buttonClick:{chatMessageId:t.id,buttonId:e.id||e._id,time:(new Date).toISOString()}}),m){case b.QUICK_REPLY:{const n={responsePromise:E,tempId:g};o(pn(e.value,t.exchange_id,e.new_context,n,e.button_type));break}case b.HANDOVER_REQUEST:if(!vn(d,u)){o(yt({message:"Requested handover with no button",level:"error",extra:{version:c}}))}o(jt(E));break;case b.DIALOGUE_TRIGGER:case b.SUGGESTION_DIALOGUE_TRIGGER:o(gn(e.value,{tempId:g,responsePromise:E}));break;case b.PRIVACY_EXPORT:o(ln({responsePromise:E}));break;case b.PRIVACY_DELETE:o(un({responsePromise:E}));break;case b.CONTACT_DETAILS:o(Jt(e));break;case b.UPLOAD_ATTACHMENT:o(Zt(e))}}}(t,o,r,h));const{href:n,target:a}=e.target;if(n){const e=Boolean(a);setTimeout(()=>{e?window.open(n,a):window.location.href=n},250)}},[g,o,v,t,m,u,r,h,f,null==w?void 0:w.renderedBy]),k=fa(T,3e3),S=(null!=y?y:[]).find(e=>{let{chatMessageId:n,buttonId:r}=e;return n===(null==o?void 0:o.id)&&r===t.id}),I=Object(s.useCallback)(()=>{n(t)},[t,n]);return Object(s.useEffect)(()=>{S&&x&&!_&&n(t)},[S,x,t,n,_]),E?c.a.createElement($f,{color:a,"data-cy":"message-button",href:`${C}${g===Vf?(A=t.value,A.match(/^https?:\/\//i)?A:`http://${A}`):t.value}`,target:`${g!==Vf||p?"_self":"_blank"}`,onClick:k,isNudge:p,hasBeenClicked:S},t.label,g===Vf&&p&&c.a.createElement(Sn,{fill:"#FFF",width:10,height:16}),g===Vf&&!p&&c.a.createElement(Of,{width:14,height:14})):x?c.a.createElement("div",null,c.a.createElement(Gf,null,c.a.createElement(qf,null,c.a.createElement(Wf,{checked:_,onChange:I}),c.a.createElement(Kf,{checked:_},c.a.createElement(Yf,{viewBox:"0 0 24 24"},c.a.createElement("polyline",{points:"20 6 9 17 4 12"})))),c.a.createElement("span",{style:{marginLeft:8}},t.label))):c.a.createElement(Ff,{hasSuggestion:d,"data-cy":"message-button",color:a,type:"button",tabIndex:"0",disabled:i,onClick:k,hasBeenClicked:S},t.label,g===Vf&&c.a.createElement(Of,{width:14,height:14}));var A};Zf.defaultProps={checked:[]};var eh=Zf;var th=e=>{let{buttons:t,slug:n}=e;const r=Ue(),o=t.length>0,a=Object(s.useCallback)(()=>{r(Tn({slug:n,eventType:"CTA_CLICK"}))},[r]);return c.a.createElement(c.a.Fragment,null,o&&c.a.createElement(Mi,null,t.map((e,t)=>c.a.createElement(eh,{button:e,key:`${e.value}-${t}`,isNudge:!0,onClick:a}))))};var nh=e=>{let{title:t,description:n,link:r,slug:o}=e;const a=Ue(),i=Object(s.useCallback)(e=>{e.preventDefault(),a(Tn({slug:o,eventType:"CTA_CLICK"})),window.location.href=e.target.getAttribute("href")},[o]);return c.a.createElement(Mi,null,t&&c.a.createElement(Pi,null,t),n&&c.a.createElement(Ri,null,n),(null==r?void 0:r.location)&&(null==r?void 0:r.text)&&c.a.createElement(Li,{href:r.location,onClick:i},r.text))};const rh=e=>e||{location:"",text:""},oh=e=>{var t,n,r,o,a,i,s,l;let{section:u,slug:d,onProductClick:p,onNewsletterSubmit:f}=e;const h=Ue(),m=null!==(t=null==u?void 0:u.title)&&void 0!==t&&t,g=null!==(n=null==u?void 0:u.description)&&void 0!==n&&n,b=null!==(r=null==u?void 0:u.buttons)&&void 0!==r&&r,v=null!==(o=null==u?void 0:u.products)&&void 0!==o&&o,y=null!==(a=null==u?void 0:u.choices)&&void 0!==a&&a,w=null!==(i=null==u?void 0:u.form)&&void 0!==i&&i,E=null!==(s=null==u?void 0:u.link)&&void 0!==s&&s,x=null!==(l=null==u?void 0:u.html)&&void 0!==l&&l;return c.a.createElement(c.a.Fragment,null,(m||g||E)&&c.a.createElement(nh,{title:m,description:g,link:rh(E),slug:d}),b&&c.a.createElement(th,{buttons:b,slug:d}),y&&c.a.createElement(Xi,{choices:y,slug:d}),v&&c.a.createElement(kf,{section:v,onProductClick:(e,t)=>{if(null!=t&&t.productUrl&&h(Tn({slug:d,eventType:"CTA_CLICK",label:t.productUrl})),"function"==typeof p)try{p(e,t)}catch(e){}}}),w&&c.a.createElement(qi,{form:w,onNewsletterSubmit:f,slug:d}),x&&c.a.createElement(ji,{html:x,slug:d}))};var ah=e=>{var t;let{layout:n,slug:r,onProductClick:o,onNewsletterSubmit:a}=e;return(null!==(t=null==n?void 0:n.sections)&&void 0!==t?t:[]).map((e,t)=>c.a.createElement(oh,{key:`section-${t}`,section:e,slug:null!=r?r:null,onProductClick:o,onNewsletterSubmit:a}))};const ih=e=>{let{bubbleHidden:t,show:n,slug:r,layout:o,onDismiss:a,onProductClick:i,onNewsletterSubmit:s}=e;return c.a.createElement(ga,{bubbleHidden:t,"aria-hidden":n?"false":"true","data-cy":"nudge-container"},c.a.createElement(ya,null),c.a.createElement(va,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:a,type:"button","data-cy":"close-nudge-button"},c.a.createElement(jn,{width:25,height:25})),c.a.createElement(ba,null,c.a.createElement(ah,{layout:o,slug:r,onProductClick:i,onNewsletterSubmit:s})))};ih.defaultProps={hidden:!1};var sh=ih;var ch=e=>{var t;let{hidden:n,layout:r,onDismiss:o,onProductClick:a,onNewsletterSubmit:i}=e;const{show:l,nudgeType:u,slug:d}=Ge(ia),p=null!==(t=null==r?void 0:r.backdrop)&&void 0!==t&&t,f=Ue(),h=Object(s.useCallback)(e=>{if(e.stopPropagation(),f(kn()),"function"==typeof o)try{o(e)}catch(e){}},[o,f]);return c.a.createElement(c.a.Fragment,null,p&&c.a.createElement(Ti,{backdrop:p,onClick:h}),u===v.TEMPLATE&&c.a.createElement(sh,{show:l,layout:r,slug:d,onDismiss:h,onProductClick:a,onNewsletterSubmit:i,bubbleHidden:n}),u===v.CUSTOM&&c.a.createElement(Ii,null))};const lh=Object(Ye.b)(["bottom:",";right:",";@media ","{right:0;}max-height:730px;"],e=>e.position.bottom,e=>e.position.right,eo.maxPhone),uh=Object(Ye.b)(["bottom:0px;right:0px;top:0px;width:100%;"]),dh=Ye.c.div.withConfig({displayName:"KindlyChatstyles__ChatContainer",componentId:"sc-1y4lzsi-0"})(["position:fixed;font-size:16px;text-align:initial;line-height:18px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;z-index:",";font-family:",";"," *{box-sizing:border-box;",";}@media (max-width:768px){display:flex;width:100%;max-height:unset;align-items:center;justify-content:center;",";}"],e=>e.zIndex+5,e=>{let{theme:t}=e;return t.customFont?t.customFont:Kr.default},e=>e.fullscreen?uh:lh,e=>{let{theme:t}=e;return t.customFont&&`font-family: ${t.customFont}`},e=>{let{active:t}=e;return t&&"height: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0"}),ph=Ye.c.button.withConfig({displayName:"styles__CloseIconButton",componentId:"sc-96uqai-0"})(["position:absolute;z-index:",";top:24px;right:24px;background:none;border:none;cursor:pointer;",""],e=>e.zIndex+10,Vr),fh=Ye.c.div.withConfig({displayName:"styles__LightBox",componentId:"sc-96uqai-1"})(["position:fixed;background:rgba(0,0,0,0.5);top:0;right:0;bottom:0;left:0;z-index:",";display:flex;align-items:center;justify-content:center;"],e=>e.zIndex+9),hh=Ye.c.img.withConfig({displayName:"styles__LightBoxImage",componentId:"sc-96uqai-2"})(["width:auto;max-width:100%;max-height:100%;margin:auto;padding:24px;"]),mh=Object(Ye.d)(["0%{visibility:visible;opacity:0;}1%{opacity:0;transform:translateY(20px);}100%{opacity:1;transform:translateY(0);}"]),gh=Object(Ye.b)(["",";animation-name:",";"],Cr(),mh),bh=Object(Ye.d)(["0%{opacity:1;transform:translateY(0px);}99%{opacity:0;transform:translateY(20px);}100%{opacity:0;visibility:hidden;}"]),vh=Object(Ye.b)(["",";animation-name:",";"],Cr(),bh),yh=Object(Ye.b)(["",";right:unset;bottom:unset;transition:width 300ms ease 0ms,height 300ms ease 0ms;"],e=>e.chatHasStarted?"width: 100%;\n height: 100%;\n ":"width: 90%;\n height: 95%;\n border-radius: 6px;"),wh=Object(Ye.b)(["max-height:",";height:",";width:",";"],e=>e.fullscreen?"100%":"645px",e=>e.fullscreen?"100%":"645px",e=>e.fullscreen?"100%":"360px"),Eh=Object(Ye.b)(["bottom:85px;right:10px;border-radius:6px;@media (max-height:","){min-height:380px;height:calc(100vh - ",");}"],"950px",e=>e.offsetHeight),xh=Object(Ye.b)(["bottom:0px;right:0px;border-radius:0px;"]),_h=Object(Ye.b)([""," "," ",""],e=>e.fullscreen?xh:Eh,e=>e.active?wh:Tr(),e=>!e.fullscreen&&(e=>e.active?gh:vh)(e)),Ch=Object(Ye.b)(["right:369px;display:flex;flex-direction:column;justify-content:flex-start;z-index:19;border-radius:6px 0 0 6px;background:#ffffff;background-color:#ffffff;>:last-child{margin:auto 20px 20px;}"]),Th=Ye.c.div.withConfig({displayName:"styles__ChatBoxContainer",componentId:"sc-1usve4j-0"})(["position:absolute;z-index:20;overflow:hidden;flex-direction:column;box-shadow:0 5px 45px ",";display:",";@media ","{",";","}@media ","{visibility:",";",";}"],Xr.shadowColor,e=>e.hide?"none":"flex",eo.minTablet,_h,e=>{let{inspectorContainer:t}=e;return t&&Ch},eo.maxTablet,e=>e.active?"visible":"hidden",yh),kh=Ye.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1iatydl-0"})(["margin:20px;"]),Oh=Ye.c.hr.withConfig({displayName:"styles__Separator",componentId:"sc-1iatydl-1"})(["border-top:1px solid rgb(243,243,244);width:100%;margin:0;"]),Sh=Ye.c.button.withConfig({displayName:"styles__Navigation",componentId:"sc-1iatydl-2"})(["text-align:center;margin:5px 5px 0 5px;background:rgb(243,243,244);border:1px solid rgb(243,243,244);font-weight:600;padding:7px 16px;border-radius:5px;cursor:pointer;outline:none;&:hover{background:rgb(230,230,230);}&:disabled{background:white;color:rgb(206,206,206);border-color:rgb(206,206,206);cursor:default;}"]),Ih=Ye.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-1iatydl-3"})(["display:flex;align-items:baseline;font-size:13px;",""],e=>{let{spaceBetween:t}=e;return t?"justify-content: space-between;":""}),Ah=Ye.c.div.withConfig({displayName:"styles__Slot",componentId:"sc-1iatydl-4"})(["padding:1px 3px;border-radius:3px;font-size:12px;margin-right:5px;background:rgba(255,74,156,0.25);"]),jh=Ye.c.span.withConfig({displayName:"styles__Dot",componentId:"sc-1iatydl-5"})(["height:7px;width:7px;background:rgb(255,172,74);border-radius:50%;margin-right:5px;bottom:1px;position:relative;"]),Nh=Ye.c.span.withConfig({displayName:"styles__Corrected",componentId:"sc-1iatydl-6"})(["border-bottom:1px dotted red;"]),Mh=Ye.c.span.withConfig({displayName:"styles__Arrow",componentId:"sc-1iatydl-7"})(["margin:0 5px;color:gray;"]),Ph=Ye.c.div.withConfig({displayName:"styles__Label",componentId:"sc-1iatydl-8"})(["padding:1px 6px;border-radius:3px;border:1px solid lightgray;text-transform:uppercase;font-size:12px;margin:0 5px 3px 5px;white-space:nowrap;",""],e=>{let{filled:t}=e;return t?"background: rgb(0, 105, 255); color: white;":""}),Rh=Ye.c.a.withConfig({displayName:"styles__Link",componentId:"sc-1iatydl-9"})(["text-decoration:none;color:initial;cursor:pointer;&:hover{color:rgb(0,105,255);}"]),Lh=()=>{};var Dh=()=>c.a.createElement(c.a.Fragment,null,c.a.createElement(kh,null,c.a.createElement(To,null,"No messages yet!")),c.a.createElement(Ih,{spaceBetween:!0},c.a.createElement(Sh,{disabled:!0,onClick:Lh},"Show previous"),c.a.createElement(Sh,{disabled:!0,onClick:Lh},"Show next")));const{SAMPLE_MATCH:Bh,KEYWORD_EXACT_MATCH:Hh,KEYWORD_MENTION:Uh,PATTERN_MATCH:zh,ZODIAC:Fh}=g,$h=e=>(null!=e?e:"").toLowerCase().replace(/[-_]/g," ");var Gh=e=>{let{handler:t,score:n,exchangeType:r,sender:o,fromWebhook:a,label:i}=e;return"string"==typeof i?c.a.createElement(Ph,null,i):Object(O.a)(t,[Bh,Fh])&&n?c.a.createElement(Ph,{filled:!0,title:"Confidence score"},`${Math.round(100*n)} %`):Object(O.a)(t,Object.values(g))?c.a.createElement(Ph,null,(e=>{switch(e){case Bh:case Fh:return"sample";case zh:return"pattern";case Hh:case Uh:return"keyword";default:return $h(e)}})(t)):a?c.a.createElement(Ph,null,"webhook"):"string"==typeof r?c.a.createElement(Ph,null,$h(r)):Object(O.a)(o,Object.values(p))?c.a.createElement(Ph,null,$h(o)):null};const qh=e=>{let{botId:t,exchangeType:n,exchangeId:r}=e;if(!t||!n||!r)return null;return`/bot/${t}/build/${("usersays"===n?"dialogue":n).replace("_","-")}/${r}`};var Yh=e=>{let{children:t,url:n}=e;return n?c.a.createElement(Rh,{target:"_blank",rel:"noopener noreferrer",href:n},t):t};var Kh=e=>{let{botId:t,exchangeType:n,exchangeId:r,children:o}=e;const a=qh({botId:t,exchangeType:n,exchangeId:r});return c.a.createElement(Yh,{url:a},c.a.createElement(Ih,null,o))};const Wh=(e,t)=>`${(e||"").slice(0,t)}${(null==e?void 0:e.length)>t?"...":""}`;var Vh=e=>{let{fromBot:t,fromWebhook:n,handler:r,score:o,title:a,message:i,exchangeType:s,exchangeId:l,botId:u,isFollowup:d,sender:p}=e;return c.a.createElement(kh,null,c.a.createElement(To,null,"Message info"),t&&c.a.createElement(Ih,{spaceBetween:!0},a&&c.a.createElement(Kh,{botId:u,exchangeType:s,exchangeId:l},c.a.createElement(jh,null),c.a.createElement("span",null,Wh(a,40))),!a&&c.a.createElement("span",null,Wh(i,40)),c.a.createElement(Ih,null,c.a.createElement(Gh,{handler:r,score:o,exchangeType:s,exchangeId:l,sender:p,fromWebhook:n}),d&&c.a.createElement(Gh,{exchangeType:"followup"}))),!t&&c.a.createElement(Ih,{spaceBetween:!0},Wh(i,40),c.a.createElement(Gh,{label:"user"})))};var Xh=e=>{let{patternContextMatch:t}=e;const[n,r]=Object.entries(t)[0];return c.a.createElement(kh,null,c.a.createElement(To,null,"Slot / Pattern context"),c.a.createElement(Ih,null,c.a.createElement(Ah,null,n),c.a.createElement("span",null,r)))};var Qh=e=>{let{replyCandidates:t,botId:n}=e;const r=Object(s.useMemo)(()=>t.filter(e=>{let{selected:t,samle:n,title:r}=e;return!t&&(n||r)}),[t]);return 0===(null==r?void 0:r.length)?null:c.a.createElement(kh,null,c.a.createElement(To,null,"Potential dialogues"),r.map(e=>{let{_id:t,score:r,sample:o,title:a,dialogue_id:i}=e;return c.a.createElement(Yh,{key:`reply-candidate-${t}`,url:qh({botId:n,exchangeType:"usersays",exchangeId:i})},c.a.createElement(Ih,null,c.a.createElement(Gh,{handler:g.SAMPLE_MATCH,score:r}),c.a.createElement(jh,null),c.a.createElement("span",null,o||a)))}))};var Jh=e=>{let{correctedMessage:t,message:n}=e;return c.a.createElement(kh,null,c.a.createElement(To,null,"Spelling correction / Greeting removed"),c.a.createElement(Ih,null,c.a.createElement(Nh,null,n),c.a.createElement(Mh,null,"→"),c.a.createElement("span",null,t)))};var Zh=e=>{let{chatMessage:{message:t,score:n,title:r,handler:o,sender:a,from_bot:i,bot_id:s,from_webhook:l,reply_candidates:u,exchange_type:d,exchange_id:p,is_followup:f,corrected_message:h,pattern_context_match:m}}=e;const{admin:g}=Ge(Xo),b=Object.keys(m||{}).length>0,v=g&&h&&h!==t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(Vh,{handler:o,fromBot:i,fromWebhook:l,score:n,title:r,message:t,exchangeType:d,exchangeId:p,botId:s,isFollowup:f,sender:a}),c.a.createElement(Oh,null),b&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Xh,{patternContextMatch:m}),c.a.createElement(Oh,null)),v&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Jh,{correctedMessage:h,message:t}),c.a.createElement(Oh,null)),(null==u?void 0:u.length)>1&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Qh,{replyCandidates:u,botId:s}),c.a.createElement(Oh,null)))};function em(e){const t=Object(s.useRef)();return Object(s.useEffect)(()=>{t.current=e},[e]),t.current}var tm=()=>{const{active:e,chatHasStarted:t}=Ge(Xo),{currentMessage:n,nextMessage:r,prevMessage:o,isFirstMessage:a,isLastMessage:i}=(()=>{var e,t;const n=Ue(),{chatMessages:r}=Ge(na),{currentMessageId:o}=Ge(Zo),a=o||(null===(e=r.slice(-1)[0])||void 0===e?void 0:e.id),i=r.findIndex(e=>{let{id:t}=e;return t===a}),c=Object(s.useCallback)(()=>{n(tn(r[i+1].id))},[r,i,n]),l=Object(s.useCallback)(()=>{n(tn(r[i-1].id))},[r,i,n]),u=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0,d=em(u),p=0===i,f=i===u-1;return Object(s.useEffect)(()=>{u>d&&n(tn())},[n,u,d]),{currentMessage:r[i],nextMessage:c,prevMessage:l,isFirstMessage:p,isLastMessage:f}})();return c.a.createElement(Th,{chatHasStarted:t,active:e,"aria-hidden":e?"false":"true","data-testid":"chat-box-inspector","data-cy":"chat-box-inspector",fullscreen:0,offsetHeight:"205px",inspectorContainer:!0},n&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Zh,{chatMessage:n}),c.a.createElement(Ih,{spaceBetween:!0},c.a.createElement(Sh,{disabled:a,onClick:o},"Show previous"),c.a.createElement(Sh,{disabled:i,onClick:r},"Show next"))),!n&&c.a.createElement(Dh,null))};const nm=Ye.c.div.withConfig({displayName:"styles__AnnouncementContainer",componentId:"sc-xw79eu-0"})(["border-radius:0;box-shadow:1px 2px 5px 2px ",";line-height:23px;background:",";background-color:",";font-size:",";font-weight:500;transform-origin:top;display:flex;z-index:15;position:absolute;padding:0 10px;transform:",";transition:",";width:100%;top:55px;span{font-size:15px;margin-right:7px;}"],Xr.shadowColor,Xr.warningColor,Xr.warningColor,Jr.fontSizeP,e=>{let{show:t}=e;return t?"scaleY(1)":"scaleY(0)"},e=>{let{show:t}=e;return t?"transform 0.15s ease-in":"transform 0.15s ease-out"}),rm=Object(Ye.c)(To).withConfig({displayName:"styles__AnnouncementText",componentId:"sc-xw79eu-1"})(["margin:5px 0;display:flex;color:#2c2c2c;font-size:inherit;font-weight:inherit;"]),om=Object(Ye.c)(ro).withConfig({displayName:"styles__AnnouncementLink",componentId:"sc-xw79eu-2"})(["color:#0063a2;"]);var am=()=>{const{text:e,url:t,show:n}=Ge(Wo);return c.a.createElement(nm,{show:n},c.a.createElement(rm,null,c.a.createElement("span",null,"!"),e),t&&c.a.createElement(om,{target:"_blank"},"url"))};function im(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function sm(e){im(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function cm(e){im(1,arguments);var t=sm(e);return t.setHours(0,0,0,0),t}function lm(e){im(1,arguments);var t=sm(e);return!isNaN(t)}var um={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function dm(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var pm={date:dm({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:dm({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:dm({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},fm={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function hm(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{var s=e.defaultWidth,c=o.width?String(o.width):e.defaultWidth;r=e.values[c]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function mm(e){return function(t,n){var r=String(t),o=n||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],s=r.match(i);if(!s)return null;var c,l=s[0],u=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return c="[object Array]"===Object.prototype.toString.call(u)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(u,(function(e){return e.test(l)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(u,(function(e){return e.test(l)})),c=e.valueCallback?e.valueCallback(c):c,{value:c=o.valueCallback?o.valueCallback(c):c,rest:r.slice(l.length)}}}var gm,bm={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof um[e]?um[e]:1===t?um[e].one:um[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:pm,formatRelative:function(e,t,n,r){return fm[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:hm({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:hm({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:hm({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:hm({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:hm({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(gm={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(gm.matchPattern);if(!o)return null;var a=o[0],i=n.match(gm.parsePattern);if(!i)return null;var s=gm.valueCallback?gm.valueCallback(i[0]):i[0];return{value:s=r.valueCallback?r.valueCallback(s):s,rest:n.slice(a.length)}}),era:mm({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:mm({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:mm({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:mm({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:mm({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function vm(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function ym(e,t){im(2,arguments);var n=sm(e).getTime(),r=vm(t);return new Date(n+r)}function wm(e,t){im(2,arguments);var n=vm(t);return ym(e,-n)}function Em(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var xm={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return Em("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Em(n+1,2)},d:function(e,t){return Em(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.toUpperCase();case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return Em(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Em(e.getUTCHours(),t.length)},m:function(e,t){return Em(e.getUTCMinutes(),t.length)},s:function(e,t){return Em(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return Em(Math.floor(r*Math.pow(10,n-3)),t.length)}};function _m(e){im(1,arguments);var t=1,n=sm(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Cm(e){im(1,arguments);var t=sm(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=_m(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=_m(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Tm(e){im(1,arguments);var t=Cm(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=_m(n);return r}function km(e,t){im(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:vm(o),i=null==n.weekStartsOn?a:vm(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=sm(e),c=s.getUTCDay(),l=(c<i?7:0)+c-i;return s.setUTCDate(s.getUTCDate()-l),s.setUTCHours(0,0,0,0),s}function Om(e,t){im(1,arguments);var n=sm(e,t),r=n.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,s=null==i?1:vm(i),c=null==o.firstWeekContainsDate?s:vm(o.firstWeekContainsDate);if(!(c>=1&&c<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=new Date(0);l.setUTCFullYear(r+1,0,c),l.setUTCHours(0,0,0,0);var u=km(l,t),d=new Date(0);d.setUTCFullYear(r,0,c),d.setUTCHours(0,0,0,0);var p=km(d,t);return n.getTime()>=u.getTime()?r+1:n.getTime()>=p.getTime()?r:r-1}function Sm(e,t){im(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,a=null==o?1:vm(o),i=null==n.firstWeekContainsDate?a:vm(n.firstWeekContainsDate),s=Om(e,t),c=new Date(0);c.setUTCFullYear(s,0,i),c.setUTCHours(0,0,0,0);var l=km(c,t);return l}var Im="midnight",Am="noon",jm="morning",Nm="afternoon",Mm="evening",Pm="night";function Rm(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+Em(a,2)}function Lm(e,t){return e%60==0?(e>0?"-":"+")+Em(Math.abs(e)/60,2):Dm(e,t)}function Dm(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+Em(Math.floor(o/60),2)+n+Em(o%60,2)}var Bm={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return xm.y(e,t)},Y:function(e,t,n,r){var o=Om(e,r),a=o>0?o:1-o;return"YY"===t?Em(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Em(a,t.length)},R:function(e,t){return Em(Cm(e),t.length)},u:function(e,t){return Em(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Em(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Em(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return xm.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return Em(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){im(1,arguments);var n=sm(e),r=km(n,t).getTime()-Sm(n,t).getTime();return Math.round(r/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Em(o,t.length)},I:function(e,t,n){var r=function(e){im(1,arguments);var t=sm(e),n=_m(t).getTime()-Tm(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Em(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):xm.d(e,t)},D:function(e,t,n){var r=function(e){im(1,arguments);var t=sm(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Em(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Em(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Em(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return Em(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?Am:0===o?Im:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?Mm:o>=12?Nm:o>=4?jm:Pm,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return xm.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):xm.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Em(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Em(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):xm.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):xm.s(e,t)},S:function(e,t){return xm.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Lm(o);case"XXXX":case"XX":return Dm(o);case"XXXXX":case"XXX":default:return Dm(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Lm(o);case"xxxx":case"xx":return Dm(o);case"xxxxx":case"xxx":default:return Dm(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rm(o,":");case"OOOO":default:return"GMT"+Dm(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rm(o,":");case"zzzz":default:return"GMT"+Dm(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return Em(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return Em((r._originalDate||e).getTime(),t.length)}};function Hm(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Um(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var zm={p:Um,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],a=r[2];if(!a)return Hm(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Hm(o,t)).replace("{{time}}",Um(a,t))}};function Fm(e){return e.getTime()%6e4}function $m(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());return t.setSeconds(0,0),6e4*n+(n>0?(6e4+Fm(t))%6e4:Fm(t))}var Gm=["D","DD"],qm=["YY","YYYY"];function Ym(e){return-1!==Gm.indexOf(e)}function Km(e){return-1!==qm.indexOf(e)}function Wm(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var Vm=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Xm=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Qm=/^'([^]*?)'?$/,Jm=/''/g,Zm=/[a-zA-Z]/;function eg(e,t,n){im(2,arguments);var r=String(t),o=n||{},a=o.locale||bm,i=a.options&&a.options.firstWeekContainsDate,s=null==i?1:vm(i),c=null==o.firstWeekContainsDate?s:vm(o.firstWeekContainsDate);if(!(c>=1&&c<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=a.options&&a.options.weekStartsOn,u=null==l?0:vm(l),d=null==o.weekStartsOn?u:vm(o.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var p=sm(e);if(!lm(p))throw new RangeError("Invalid time value");var f=$m(p),h=wm(p,f),m={firstWeekContainsDate:c,weekStartsOn:d,locale:a,_originalDate:p},g=r.match(Xm).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,zm[t])(e,a.formatLong,m):e})).join("").match(Vm).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return tg(n);var i=Bm[r];if(i)return!o.useAdditionalWeekYearTokens&&Km(n)&&Wm(n,t,e),!o.useAdditionalDayOfYearTokens&&Ym(n)&&Wm(n,t,e),i(h,n,a.localize,m);if(r.match(Zm))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return g}function tg(e){return e.match(Qm)[1].replace(Jm,"'")}var ng={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},rg=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,og=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ag=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ig(e,t){im(1,arguments);var n=t||{},r=null==n.additionalDigits?2:vm(n.additionalDigits);if(2!==r&&1!==r&&0!==r)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o,a=sg(e);if(a.date){var i=cg(a.date,r);o=lg(i.restDateString,i.year)}if(isNaN(o)||!o)return new Date(NaN);var s,c=o.getTime(),l=0;if(a.time&&(l=dg(a.time),isNaN(l)||null===l))return new Date(NaN);if(!a.timezone){var u=new Date(c+l),d=new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate(),u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds());return d.setFullYear(u.getUTCFullYear()),d}return s=fg(a.timezone),isNaN(s)?new Date(NaN):new Date(c+l+s)}function sg(e){var t,n={},r=e.split(ng.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],ng.timeZoneDelimiter.test(n.date)&&(n.date=e.split(ng.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=ng.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}function cg(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var o=r[1]&&parseInt(r[1]),a=r[2]&&parseInt(r[2]);return{year:null==a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}function lg(e,t){if(null===t)return null;var n=e.match(rg);if(!n)return null;var r=!!n[4],o=ug(n[1]),a=ug(n[2])-1,i=ug(n[3]),s=ug(n[4]),c=ug(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,c)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,s,c):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(hg[t]||(mg(e)?29:28))}(t,a,i)&&function(e,t){return t>=1&&t<=(mg(e)?366:365)}(t,o)?(l.setUTCFullYear(t,a,Math.max(o,i)),l):new Date(NaN)}function ug(e){return e?parseInt(e):1}function dg(e){var t=e.match(og);if(!t)return null;var n=pg(t[1]),r=pg(t[2]),o=pg(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?36e5*n+6e4*r+1e3*o:NaN}function pg(e){return e&&parseFloat(e.replace(",","."))||0}function fg(e){if("Z"===e)return 0;var t=e.match(ag);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(36e5*r+6e4*o):NaN}var hg=[31,null,31,30,31,30,31,31,30,31,30,31];function mg(e){return e%400==0||e%4==0&&e%100}var gg=e=>"number"==typeof e?new Date(e):ig(e);function bg(e){const t=gg(e);return function(e,t){im(2,arguments);var n=cm(e),r=cm(t);return n.getTime()===r.getTime()}(t,new Date)?eg(t,"HH:mm"):eg(t,"dd LLL")}const vg=Object(Ye.d)(["0%{opacity:0;transform:translateY(2px);}100%{opacity:1;transform:translateY(0);}"]),yg=Object(Ye.b)(["",";animation-name:",";"],Cr(300,150),vg),wg=Object(Ye.b)(["flex-direction:row-reverse;"]),Eg=Object(Ye.b)(["flex-direction:row;"]),xg=Object(Ye.b)(["background:#e3e3e7;padding:0 30px;margin:10px -30px;position:relative;&:before{content:'';position:absolute;background:rgb(153,153,153);width:4px;height:calc(100% + 20px);left:0;z-index:1;}&:after{content:'';position:absolute;display:inline-block;width:100%;height:20px;background:#e3e3e7;top:100%;left:0;}"]),_g=Ye.c.div.withConfig({displayName:"styles__GroupContainer",componentId:"sc-1re4sol-0"})(["display:flex;flex:none;margin-bottom:10px;margin-top:10px;",";",";"],e=>e.fromBot?Eg:wg,e=>{let{inspected:t}=e;return t&&xg}),Cg=Ye.c.div.withConfig({displayName:"styles__MessageHeader",componentId:"sc-1re4sol-1"})(["display:flex;align-items:baseline;flex-wrap:nowrap;justify-content:flex-start;opacity:0;",";",";",";"],yg,e=>!e.fromBot&&"justify-content: flex-end; width: 100%;",e=>e.fromAgent&&"padding-left: 25px"),Tg=Object(Ye.c)(Eo).withConfig({displayName:"styles__MessageDate",componentId:"sc-1re4sol-2"})(["opacity:1;margin-bottom:0;color:",";",";"],e=>{let{theme:t}=e;return t.chatLogElements},e=>e.fromBot?"padding-left: 6px":"padding-right: 6px"),kg=Ye.c.div.withConfig({displayName:"styles__MessageGroup",componentId:"sc-1re4sol-3"})(["display:block;width:100%;"]);var Og=e=>{let{fromAgent:t,fromBot:n,created:r,children:o,inspected:a,setGroupRef:i}=e;return c.a.createElement(_g,{fromBot:n,inspected:a,ref:i},c.a.createElement(kg,null,c.a.createElement(Cg,{fromAgent:t,fromBot:n},c.a.createElement(Tg,{fromBot:n},bg(r))),o))};const Sg=e=>c.a.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"24",viewBox:"0 0 20 24"}),c.a.createElement("title",null,e.title||"File attachment"),c.a.createElement("path",{d:"M19.429 13.272L13.503 19.2c-1.554 1.556-3.821 2.164-5.945 1.595s-3.784-2.227-4.354-4.351.037-4.391 1.591-5.946l6.448-6.444c1.427-1.358 3.668-1.358 5.094 0a3.6 3.6 0 0 1 0 5.094l-5.926 5.924a1.05 1.05 0 0 1-1.486 0c-.407-.412-.407-1.074 0-1.486L13.303 9.2a1.5 1.5 0 0 0-.651-2.551 1.5 1.5 0 0 0-1.469.431l-4.388 4.386c-1.583 1.585-1.583 4.153.002 5.736s4.153 1.583 5.736-.002l5.924-5.93A6.6 6.6 0 0 0 15.498.225a6.6 6.6 0 0 0-6.377 1.709l-6.44 6.442C-.893 11.95-.894 17.744 2.68 21.319s9.369 3.575 12.943.001l5.926-5.92a1.5 1.5 0 0 0-2.12-2.12v-.008z",fill:"#7b7b7b"}));Sg.defaultProps={height:"22",width:"15"};var Ig=Sg;var Ag=e=>c.a.createElement("svg",Object.assign({},e,{version:"1.1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}),c.a.createElement("title",null,"Unsuccessful image upload"),c.a.createElement("g",{fill:"none",fillRule:"evenodd"},c.a.createElement("g",{transform:"translate(-1128 -635)",fill:"#7B7B7B",fillRule:"nonzero"},c.a.createElement("path",{d:"m1152 637.67v8.7867l-4-4.0133-5.3333 5.3467-5.3333-5.3333-5.3333 5.3333-4-4.0133v-6.1067c0-1.4667 1.2-2.6667 2.6667-2.6667h18.667c1.4667 0 2.6667 1.2 2.6667 2.6667zm-4 8.56 4 4.0133v6.0933c0 1.4667-1.2 2.6667-2.6667 2.6667h-18.667c-1.4667 0-2.6667-1.2-2.6667-2.6667v-8.7733l4 3.9867 5.3333-5.3333 5.3333 5.3333 5.3333-5.32z"}))));var jg=e=>c.a.createElement("svg",Object.assign({},e,{version:"1.1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}),c.a.createElement("title",null,"Loading image upload"),c.a.createElement("g",{fill:"none",fillRule:"evenodd"},c.a.createElement("g",{transform:"translate(-685 -659)",fill:"#7B7B7B",fillRule:"nonzero"},c.a.createElement("g",{transform:"translate(685 659)"},c.a.createElement("path",{d:"m15.67 9.414c-0.12139-0.24299-0.36467-0.40135-0.636-0.414-0.27276-0.023426-0.53433 0.11351-0.6705 0.351l-3.2505 5.199-2.3325-2.331c-0.16117-0.15568-0.38102-0.23533-0.6045-0.219-0.22394 0.02231-0.42603 0.144-0.5505 0.3315l-3 4.5c-0.1548 0.23022-0.16988 0.52708-0.039197 0.7718 0.13068 0.24471 0.38578 0.3973 0.6632 0.39671h13.5c0.26005 0 0.50153-0.13472 0.63814-0.35599 0.13661-0.22127 0.14886-0.49752 0.032357-0.73001l-3.75-7.5z"}),c.a.createElement("path",{d:"m21 0h-18c-1.6569 0-3 1.3431-3 3v18c0 1.6569 1.3431 3 3 3h18c1.6569 0 3-1.3431 3-3v-18c0-1.6569-1.3431-3-3-3zm-18 21v-18h18v18h-18z"}),c.a.createElement("circle",{cx:"7.5",cy:"7.5",r:"1.5"})))));var Ng=()=>{const[e,t]=Object(s.useState)(null),[n,r]=Object(s.useState)(!1);return Object(s.useEffect)(()=>{if(!e)return;const t=[],n=e.getElementsByTagName("img")||[],o=[...n].map(e=>e.complete&&e.naturalWidth?null:new Promise(n=>{t.push(n),e.addEventListener("load",n,{once:!0}),e.addEventListener("error",n,{once:!0})}));return o.length>0&&Promise.all(o).then(()=>{r(!0)}),()=>{[...n].forEach((e,n)=>{e.removeEventListener("load",t[n]),e.removeEventListener("error",t[n])})}},[e]),[t,n]};const Mg=Object(Ye.d)(["from{background-position:0%;}to{background-position:-200%;}"]),Pg=Ye.c.div.withConfig({displayName:"styles__LoadingWrapper",componentId:"sc-10p36bl-0"})(["position:absolute;left:0;width:100%;top:0;height:100%;color:black;z-index:1;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:",";transition:opacity "," ease-out;div:first-child{height:100%;width:100%;position:absolute;background:",";background-size:200% 100%;animation:1.3s linear "," infinite 0s;opacity:0.5;}div:nth-child(2){height:100%;width:100%;position:absolute;background:white;opacity:",";}div:nth-child(3){z-index:1;}"],e=>{let{finished:t}=e;return t?0:1},e=>{let{hideTransitionLength:t}=e;return`${t}s`},"\n linear-gradient(\n 90deg,\n rgba(255, 255, 255, 1) 0%,\n rgba(255, 255, 255, 0.738) 9.5%,\n rgba(255, 255, 255, 0.541) 17%,\n rgba(255, 255, 255, 0.382) 23.5%,\n rgba(255, 255, 255, 0.278) 28.3%,\n rgba(255, 255, 255, 0.194) 32.5%,\n rgba(255, 255, 255, 0.126) 36.5%,\n rgba(255, 255, 255, 0.075) 40.1%,\n rgba(255, 255, 255, 0.042) 43.1%,\n rgba(255, 255, 255, 0.021) 45.5%,\n rgba(255, 255, 255, 0.008) 46.3%,\n rgba(255, 255, 255, 0.002) 49.3%,\n rgba(255, 255, 255, 0) 50%,\n rgba(255, 255, 255, 0.002) 50.7%,\n rgba(255, 255, 255, 0.008) 53.7%,\n rgba(255, 255, 255, 0.021) 54.5%,\n rgba(255, 255, 255, 0.042) 59.9%,\n rgba(255, 255, 255, 0.075) 61.7%,\n rgba(255, 255, 255, 0.126) 63.5%,\n rgba(255, 255, 255, 0.194) 67.5%,\n rgba(255, 255, 255, 0.278) 71.7%,\n rgba(255, 255, 255, 0.382) 76.5%,\n rgba(255, 255, 255, 0.541) 83%,\n rgba(255, 255, 255, 0.738) 90.5%,\n rgba(255, 255, 255, 1) 100%\n )\n",Mg,e=>{let{opacity:t}=e;return t});var Rg=e=>{let{loading:t,children:n,opacity:r=.6}=e;const[o,a]=Object(s.useState)(!t);return Object(s.useEffect)(()=>{o||t||setTimeout(()=>a(!0),300)},[o,t]),o?null:c.a.createElement(Pg,{finished:!t,hideTransitionLength:.3,opacity:r},c.a.createElement("div",null),c.a.createElement("div",null),c.a.createElement("div",null,n))},Lg=e=>{let{styles:t={},...n}=e;return c.a.createElement("svg",Object.assign({xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"#fff"},n),c.a.createElement("path",{d:"M0 4v24h32V4zm4 20l6-14 5 8 3-4 6 10zM25 7a4 4 0 010 8 4 4 0 010-8"}))};const Dg=Ye.c.div.withConfig({displayName:"styles__PlaceholderContainer",componentId:"sc-12zmiuw-0"})(["&&{display:block;max-width:80%;border-radius:15px;position:relative;width:250px;height:250px;svg{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);width:40px;opacity:0.5;path{stroke:black;}}","}"],zr),Bg=Ye.c.div.withConfig({displayName:"styles__CarouselContainer",componentId:"sc-12zmiuw-1"})(["position:relative;overflow:hidden;margin-left:-25px;width:calc(100% + 50px);> div{",";}"],e=>e.active&&"\n position: relative;\n width: 100000%;\n display: flex;\n "),Hg=Ye.c.div.withConfig({displayName:"styles__ImageWrapper",componentId:"sc-12zmiuw-2"})(["display:flex;flex-direction:column;width:","px;height:auto;position:relative;margin-right:5px;margin-top:2px;margin-bottom:2px;",";",";",";"],e=>e.imageSize,e=>{let{fromBot:t}=e;return t?"justify-content: flex-start":"justify-content: flex-end"},e=>{let{first:t,isCarousel:n}=e;return t||!n?"margin-left: 25px":""},e=>e.imageHasText&&`\n box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1);\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 15px;\n padding-bottom: 8px;\n overflow: hidden;\n background: #FFF;\n margin-bottom: 6px;\n color: ${Qr};\n `),Ug=Ye.c.button.withConfig({displayName:"styles__LightBoxButton",componentId:"sc-12zmiuw-3"})(["display:",";position:absolute;top:4px;right:4px;z-index:1;width:27px;height:27px;align-items:center;justify-content:center;border-radius:50%;border:none;cursor:pointer;background:#fff;box-shadow:1px 1px 4px 0 rgba(0,0,0,0.2);opacity:0.8;"," &:hover{box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3);opacity:1;}&:active{background-color:#efeeee;}> svg{position:relative;top:-1px;}"],e=>e.inView?"flex":"none",Vr),zg=Ye.c.img.withConfig({displayName:"styles__Image",componentId:"sc-12zmiuw-4"})(["max-width:100%;position:relative;width:auto;max-height:350px;transition:border-width 0.15s ease;border-radius:15px;",";"," "," ",""],e=>e.imageHasText&&"\n border-radius: 0;\n ",e=>e.carousel&&`height: ${e.imageSize}px; object-fit: cover; width: ${e.imageSize}px;`,e=>e.clickable&&`\n cursor: pointer;\n &:active {\n border: 4px solid ${e.theme.background};\n border-radius: 15px;\n }\n `,Vr),Fg=Ye.c.h5.withConfig({displayName:"styles__ImageTitle",componentId:"sc-12zmiuw-5"})(["font-weight:500;margin:8px 16px 4px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""],e=>"124"===e.imageSize&&"\n margin: 4px 8px;\n "),$g=Ye.c.div.withConfig({displayName:"styles__ImageDescription",componentId:"sc-12zmiuw-6"})(["margin:0;margin:4px 16px 8px;font-size:14px;",""],e=>"124"===e.imageSize&&"\n margin: 4px 8px;\n "),Gg=Ye.c.button.withConfig({displayName:"styles__CarouselButton",componentId:"sc-12zmiuw-7"})(["position:absolute;top:50%;transform:translateY(-50%) translateZ(0px);z-index:2;background:#fff;background-color:#fff;border:none;width:30px;height:30px;display:flex;cursor:pointer;padding:4px 10px;border-radius:100px;opacity:0.8;transition:all 0.2s ease;:hover{opacity:1;}:active{background-color:#efeeee;opacity:1;}"," svg{position:relative;height:22px;","}"," ",";"],Vr,e=>{let{next:t}=e;return t?"left: 1px;":"right: 1px;"},e=>{let{next:t}=e;return t?"right: 10px;":"left: 10px;"},e=>{let{disabled:t}=e;return t&&"display: none"});var qg=e=>{let{alt:t}=e;return c.a.createElement(Dg,{title:"Loading image..."},c.a.createElement(Lg,{alt:t}))};const Yg=(e,t,n)=>{""===t||"click"!==e&&13!==e.keyCode||window.open(t,n)};var Kg=e=>{let{image:t,first:n,isCarousel:r,fromBot:o,shouldAnimate:a,shouldAutoScroll:i,scrollToLatestMessage:l,scrollToBottom:u,inView:d,imageSize:p,loading:f}=e;const[h,m]=Ng(),g=Ue();Object(s.useEffect)(()=>{m&&i&&(!o&&u?u():l())},[o,m,i,u,l]);const b=Object(s.useCallback)(e=>{g((e=>t=>{t({type:"OPEN_LIGHT_BOX",imageUrl:e})})(e))},[g]),v=Boolean(t.title||t.description),y=null!=t&&t.newTab?"_blank":"_self",w=t.description&&t.description.length>100?t.description.slice(0,100).concat("..."):t.description;return c.a.createElement(c.a.Fragment,null,c.a.createElement(Hg,{imageHasText:v,first:n,ref:h,imageSize:p,isCarousel:r,fromBot:o},!f&&c.a.createElement(Ug,{onClick:()=>b(t.imageUrl),inView:d},c.a.createElement(Hn,null)),c.a.createElement(Rg,{loading:f},"Uploading"),c.a.createElement(zg,{src:t.imageUrl,alt:t.altText,hidden:!m,tabIndex:""!==t.linkUrl?"0":"-1",clickable:Boolean(t.linkUrl),carousel:r,fromBot:o,shouldAnimate:a,onClick:()=>Yg("click",t.linkUrl,y),onKeyDown:e=>Yg(e,t.linkUrl,y),imageHasText:v,imageSize:p}),!m&&c.a.createElement(qg,{alt:t.altText}),t.title&&c.a.createElement(Fg,{imageSize:p},t.title),w&&c.a.createElement($g,{imageSize:p},w)))},Wg=(i.a.shape({id:i.a.string,temporaryId:i.a.string,url:i.a.string,type:i.a.string.isRequired,name:i.a.string.isRequired,file:i.a.object,sizeKb:i.a.number.isRequired,storagePath:i.a.string,status:i.a.oneOf(Object.values(y)),sender:i.a.oneOf(Object.values(p))}),function(){let{type:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(null!=e?e:"").split("/");return(null==t?void 0:t[0])===w.IMAGE?w.IMAGE:(null==t?void 0:t[1])===w.PDF?w.PDF:t.slice(-1)[0]});const Vg=e=>{let{fromUser:t,hasError:n,theme:r}=e;return n?Xr.grayColor:t?r.userMessageBackground:r.botMessageBackground},Xg=Ye.c.div.withConfig({displayName:"styles__FileAttachment",componentId:"sc-ftn7kp-0"})(["position:relative;text-align:center;cursor:pointer;text-transform:none;width:80%;max-width:calc(80% - 25px);border-radius:17px;font-weight:500;border:none;padding:",";font-family:",";font-size:14px;background:",";background-color:",";transition:all 0.2s ease;margin:8px 0 2px 25px;display:block;a,span{display:block;color:",";text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;z-index:2;}& > svg:first-child{position:absolute;top:-7px;left:-4px;width:15px;path{opacity:",";transition:opacity 0.2 ease-out;}}& > svg:not(:first-child){width:20px;}"],e=>{let{hasError:t}=e;return t?"7px 12px 4px":"8px 12px"},Kr.default,Vg,Vg,e=>{let{fromUser:t,theme:n}=e;return t?n.userMessageText:n.botMessageText},e=>{let{$loading:t}=e;return t?.5:1}),Qg=Ye.c.div.withConfig({displayName:"styles__MessageAgent",componentId:"sc-ftn7kp-1"})(["width:20px;height:20px;left:-10px;bottom:5px;position:absolute;border-radius:100px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Jg=Ye.c.div.withConfig({displayName:"styles__IconBackground",componentId:"sc-ftn7kp-2"})(["width:175px;height:175px;position:relative;display:flex;justify-content:center;margin-bottom:4px;background:",";border-radius:15px;svg{width:24px;z-index:2;}"],Xr.grayColor),Zg=Ye.c.div.withConfig({displayName:"styles__AttachmentWrapper",componentId:"sc-ftn7kp-3"})(["display:flex;justify-content:",";"],e=>{let{fromUser:t}=e;return t?"flex-end":"flex-start"});var eb=e=>{let{avatar:t}=e;const n=Object(s.useMemo)(()=>t?{backgroundImage:`url(${t})`}:{},[t]);return t?c.a.createElement(Qg,{style:n}):null};var tb=e=>{let{attachment:t,shouldAutoScroll:n,scrollToLatestMessage:r,scrollToBottom:o,avatar:a,chatMessageStatus:i}=e;const u=t.sender===p.USER,d=Wg(t)===w.IMAGE,f=i||Object(O.a)(t.status,[y.ERROR,y.INFECTED]),h=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{token:n}=Ge(Qo),{PAT_HOST:r}=Ge(Jo);return e.storagePath&&e.status===y.CLEAN?`${r}/chatbubble/${l.a}/attachment/${e.storagePath}?token=${n}`:t||e.sender!==p.USER?e.url:void 0}(t,d),m=!h;Object(s.useEffect)(()=>{n&&(u?o():r())},[u,n,o,r]);const g=Object(s.useMemo)(()=>{var e;return{imageUrl:h,altText:`Image ${t.name||`from ${null!==(e=null==t?void 0:t.sender)&&void 0!==e?e:"agent"}`}`}},[t,h]);return d?c.a.createElement(Zg,{fromUser:u},c.a.createElement(eb,{avatar:a}),!f&&!m&&c.a.createElement(Kg,{image:g,fromBot:!u,isCarousel:!1,shouldAnimate:!0,shouldAutoScroll:n,scrollToLatestMessage:r,scrollToBottom:o,imageSize:"250",inView:!0,first:!1,loading:t.status===y.PROCESSING}),!f&&m&&c.a.createElement(Jg,{isImage:d},c.a.createElement(jg,null),c.a.createElement(Rg,{loading:!0})),f&&c.a.createElement(Jg,null,c.a.createElement(Ag,null))):c.a.createElement(Zg,{fromUser:u},c.a.createElement(eb,{avatar:a}),c.a.createElement(Xg,{fromUser:u,$loading:m,hasError:f},c.a.createElement(Ig,{height:10}),c.a.createElement(Rg,{loading:!f&&m,opacity:.35}),!f&&!m&&c.a.createElement("a",{src:h,alt:t.name,href:h,target:"_blank",rel:"noreferrer"},t.name),!f&&m&&c.a.createElement("span",null,"Uploading"),f&&c.a.createElement(Ag,null)))};const nb=e=>{let{children:t,carouselPosition:n,onTouchStart:r,onTouchMove:o,onTouchEnd:a}=e;return c.a.createElement(ef.div,{transition:{ease:"easeInOut",duration:.3},animate:{x:n.get()},onTouchStart:r,onTouchMove:o,onTouchEnd:a},t)},rb=e=>{let{chatMessage:t,imageCarousel:n,shouldAutoScroll:r,scrollToLatestMessage:o,shouldAnimate:a}=e;const[i,l]=Object(s.useState)(0),u=tf(0),d=m[t.image_carousel_size||1e3],p=Object(s.useMemo)(()=>d===m[800]?102:d===m[600]?96:30,[d]),f=e=>d===m[600]&&i===e-1||i===e,h=Object(s.useCallback)((e,t)=>{if(e<0||e>=t.length)return;let n=0;n=e>=t.length-1?-(e*d-p):-(e*d+5*e),l(e),u.set(n)},[d,p,u]),{handleTouchStart:g,handleTouchMove:b,handleTouchEnd:v}=lf({carousel:n,index:i,setIndex:h});return c.a.createElement(Bg,{active:n.length>1},c.a.createElement(nb,{carouselPosition:u,onTouchStart:g,onTouchMove:b,onTouchEnd:v},n.map((e,i)=>c.a.createElement(Kg,{key:e.id||i,first:0===i,image:e,fromBot:t.from_bot,isCarousel:n.length>1,shouldAnimate:a,shouldAutoScroll:r,scrollToLatestMessage:o,inView:f(i),imageSize:d}))),c.a.createElement(Gg,{previous:!0,disabled:i<=0,"aria-label":"Go to previous image",onClick:()=>h(i-1,n)},c.a.createElement(On,{width:12,height:22})),c.a.createElement(Gg,{next:!0,disabled:i>=n.length-1,"aria-label":"Go to next image",onClick:()=>h(i+1,n)},c.a.createElement(Sn,{width:12,height:22})))};rb.defaultProps={altText:"No image description",thonAbove:!1};var ob=rb,ab=e=>{let{styles:t={},...n}=e;return c.a.createElement("svg",Object.assign({width:"21",height:"10",xmlns:"http://www.w3.org/2000/svg"},n),c.a.createElement("path",{d:"M20.32 9.78c-3.21-.03-5.3-.07-6.28-.12A264.6 264.6 0 010 8.56L11.9.47l8.42 9.32z",fill:"#0069FF",fillRule:"evenodd"}))};const ib=Ye.c.button.withConfig({displayName:"styles__EditButton",componentId:"sc-mhy5c2-0"})(["display:block;background:none;background-color:none;border:none;text-decoration:underline;font-weight:600;font-size:",";color:",";cursor:pointer;padding:0;",""],Jr.fontSizeP,e=>e.theme.userMessageText,Vr);var sb=e=>{let{button:t}=e;const n=Ue(),r=Object(s.useCallback)(()=>n(Jt(t)),[t,n]);return c.a.createElement(ib,{onClick:r},t.contact_details.edit_text)},cb=n(40),lb=n.n(cb);const ub=["form","input"],db=["target"],pb=["action"];var fb=e=>lb.a.sanitize(e,{ADD_ATTR:db,FORBID_ATTR:pb,FORBID_TAGS:ub,USE_PROFILES:{svg:!1,svgFilters:!1,mathMl:!1,html:!0}});var hb=e=>c.a.createElement("div",{dangerouslySetInnerHTML:{__html:fb(e)}});const mb=Object(Ye.b)(["content:'';z-index:1;position:absolute;border-radius:17px;"]),gb=Object(Ye.b)(["svg{right:-3px;bottom:0px;transform:scaleX(-1);",";path{fill:",";}}"],mb,e=>e.theme.userMessageBackground),bb=Object(Ye.b)(["svg{left:-3px;bottom:0px;",";path{fill:",";}}"],mb,e=>e.theme.botMessageBackground),vb=Object(Ye.b)(["white-space:pre-wrap;color:",";background:",";"],e=>e.theme.userMessageText,e=>e.theme.userMessageBackground),yb=Object(Ye.b)(["color:",";background:",";"],e=>e.theme.botMessageText,e=>e.theme.botMessageBackground),wb=Object(Ye.b)(["margin-left:25px;white-space:pre-wrap;"]),Eb=Object(Ye.b)([":last-child{padding-bottom:34px;}"]),xb=Object(Ye.b)(["position:relative;display:inline-block;max-width:80%;padding:10px 15px;margin:3px 0 2px;border:0;border-radius:17px;font-size:14px;line-height:18px;word-break:break-word;"," ",";",";",";",";",";"," p{margin:0;}"],e=>e.clickable&&"cursor: pointer;",e=>e.fromBot?yb:vb,e=>e.fromAgent&&wb,e=>e.fromBot&&!e.notLast&&bb,e=>!e.fromBot&&!e.notLast&&gb,e=>e.hasSuggestion&&Eb,Vr),_b=Ye.c.div.withConfig({displayName:"styles__MessageContainer",componentId:"sc-lv7lx6-0"})(["",""],xb),Cb=Ye.c.a.withConfig({displayName:"styles__LinkMessageContainer",componentId:"sc-lv7lx6-1"})(["text-decoration:none;",""],xb),Tb=Ye.c.div.withConfig({displayName:"styles__MessageAgent",componentId:"sc-lv7lx6-2"})(["width:20px;height:20px;left:-35px;bottom:0;position:absolute;border-radius:100px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),kb=[p.WEBHOOK,p.AGENT],Ob=e=>{let{messageLine:t,children:n,chatMessage:r,fadeInLeft:o,fadeInRight:a,notFirst:i,notLast:s,shouldAnimate:l=!1,hasSuggestion:u=!1}=e;const{bot_id:d,exchange_id:p}=r,f=`/workspace/${d}/build/${("usersays"===r.exchange_type?"dialogue":r.exchange_type).replace("_","-")}/${p}`;return c.a.createElement(Cb,{fromBot:r.from_bot,hasSuggestion:u,fadeInLeft:o,fadeInRight:a,notFirst:i,notLast:s,shouldAnimate:l,clickable:!0,role:"link",tabIndex:"0",href:f},!s&&c.a.createElement(ab,null),n||hb(t))};var Sb=e=>{let{messageLine:t,chatMessage:n,lineIndex:r,numLines:o,editContactDetailsButton:a,children:i,shouldAnimate:s=!1,hasSuggestion:l=!1}=e;const{inPlatform:u}=Ge(Xo),{isTextDirectionRtl:d}=Ge(Vo),f=d?"rtl":void 0,h=u&&n.from_bot&&n.exchange_type&&!Object(O.a)(n.sender,kb),m=n.sender===p.AGENT,g=n.image_carousel&&n.thon_image_above_text||0!==r,b=r!==o-1||n.sender!==p.AGENT&&n.image_carousel&&!n.thon_image_above_text,v=n.from_bot;return h?c.a.createElement(Ob,{chatMessage:n,notFirst:g,notLast:b,shouldAnimate:s,messageLine:t,hasSuggestion:l},i):c.a.createElement(c.a.Fragment,null,c.a.createElement(_b,{dir:f,fromAgent:m,fromBot:v,hasSuggestion:l,notFirst:g,notLast:b,shouldAnimate:s},!b&&c.a.createElement(ab,null),m&&!b&&c.a.createElement(Tb,{style:{backgroundImage:`url(${n.avatar})`}}),i||(v?hb(t):t),!b&&a&&c.a.createElement(sb,{button:a})))};const Ib=Ye.c.div.withConfig({displayName:"styles__StatusMessage",componentId:"sc-gltcat-0"})(["display:flex;white-space:nowrap;font-size:12px;color:red;justify-content:flex-end;margin-bottom:2px;"]),Ab=Ye.c.div.withConfig({displayName:"styles__StatusMessageButtonWrapper",componentId:"sc-gltcat-1"})(["display:flex;"]),jb=Ye.c.button.withConfig({displayName:"styles__StatusMessageButton",componentId:"sc-gltcat-2"})(["display:block;white-space:nowrap;font-size:12px;color:",";text-decoration:underline;background:none;border:none;padding:0;margin-bottom:2px;margin-left:4px;cursor:pointer;",""],Xr.darkColor,Vr);var Nb=e=>{let{chatMessage:t,attachments:n}=e;const r=Ue(),o=Boolean(t.message),a=(null==n?void 0:n.length)>0,i=Object(s.useCallback)(()=>{var e,n;o&&r((e=t.message,n=t.id,async(t,r)=>{const{PAT_HOST:o,token:a}=dn(r),i=await t(Dt()),{headers:s}=st({token:a},{withCurrentUrl:!0,extra:i}),c={message:e,temporaryId:n},u=await t(bt({method:"post",url:`${o}/chatbubble/${l.a}/message/`,data:c,headers:s},{onError:e=>{var r;t({type:"UPDATE_CHAT_MESSAGE",temporaryId:n,status:null==e||null===(r=e.response)||void 0===r?void 0:r.status})}}));rn(u)||(t({type:"UPDATE_CHAT_MESSAGE",...u.data}),t(It()))}))},[t,r,o]),u=Object(s.useCallback)(()=>{var e,n,i;o?r((e=t.message,n=t.id,(t,r)=>{const{botKey:o}=dn(r);t(ut(o,!0)),localStorage.setItem("kindly-chat-restart-message",JSON.stringify({message:e,exchangeId:n,newContext:i}))})):a&&r(ut())},[t,r,a,o]);return t.status>=500?c.a.createElement(Ib,null,a?"Upload failed":"Message not delivered"," ",c.a.createElement(Ab,null,!a&&c.a.createElement(c.a.Fragment,null,c.a.createElement(jb,{onClick:i},"Try again"),c.a.createElement(jb,{onClick:u},"Restart chat")))):429===t.status?c.a.createElement(Ib,null,"Too many messages, please slow down."," ",c.a.createElement(Ab,null,c.a.createElement(jb,{onClick:i},"Try again"))):c.a.createElement(Ib,null,"An error occurred. ",c.a.createElement(jb,{onClick:u},"Restart chat"))};const Mb=Ye.c.div.withConfig({displayName:"styles__AgentContainer",componentId:"sc-3baawv-0"})(["width:100%;margin:20px 0;",";"],Hr),Pb=Ye.c.div.withConfig({displayName:"styles__AvatarContainer",componentId:"sc-3baawv-1"})(["display:flex;justify-content:center;align-items:center;"]),Rb=Ye.c.span.withConfig({displayName:"styles__AvatarBorder",componentId:"sc-3baawv-2"})(["height:1px;width:100%;background:",";background-color:",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Lb=Ye.c.div.withConfig({displayName:"styles__AgentAvatar",componentId:"sc-3baawv-3"})(["width:29px;height:29px;min-width:29px;border-radius:100px;margin:0 15px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Db=Ye.c.p.withConfig({displayName:"styles__AgentName",componentId:"sc-3baawv-4"})(["font-size:",";margin:0;margin-top:5px;text-align:center;color:",";span{font-weight:500;}"],Jr.fontSizeSmall,e=>jf(e.theme.background,Xr.grayColor,Xr.darkColor));var Bb=e=>{let{chatMessage:t}=e;const n=t.system_dialogue_message_type===f.END,{currentLanguage:r}=Ge(Xo),{text:o}=Ge(Vo),{defaultLanguage:a}=vi(),{names:i,avatars:l}=Ge(Yo),{agent_joined_text:u,agent_left_text:d}=Object(s.useMemo)(()=>ki(o,r,a),[r,a,o]),p=t.avatar||l[l.length-1],h=t.name||i[i.length-1];return c.a.createElement(Mb,null,c.a.createElement(Pb,null,c.a.createElement(Rb,null),c.a.createElement(Lb,{style:{backgroundImage:`url(${p})`}}),c.a.createElement(Rb,null)),c.a.createElement(Db,null,c.a.createElement("span",null,h||"An agent")," ",n?d:u))};const Hb=Object(Ye.d)(["0%{opacity:0;transform:translateY(6px);}60%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),Ub=Object(Ye.b)(["",";animation-name:",";"],Cr(),Hb),zb=Ye.c.div.withConfig({displayName:"styles__MessageBlock",componentId:"sc-zovgvh-0"})(["display:block;width:100%;"]),Fb=(Ye.c.div.withConfig({displayName:"styles__MessageLines",componentId:"sc-zovgvh-1"})([""]),Ye.c.div.withConfig({displayName:"styles__MessageContent",componentId:"sc-zovgvh-2"})(["display:flex;flex-direction:column;",";",";"],Ub,e=>!e.fromBot&&"display: block;")),$b=Ye.c.div.withConfig({displayName:"styles__MessageLineContainer",componentId:"sc-zovgvh-3"})(["display:flex;flex-direction:column;",";"],e=>{let{fromBot:t}=e;return t?"align-items: flex-start":"align-items: flex-end"}),Gb=Object(Ye.b)(["display:grid;grid-template-columns:auto auto;justify-content:flex-start;grid-gap:6px;position:relative;top:-30px;margin-bottom:-20px;margin-left:15px;"]),qb=Ye.c.div.withConfig({displayName:"styles__ButtonWrapper",componentId:"sc-zovgvh-4"})(["",";",""],Ub,e=>e.hasSuggestion&&Gb);var Yb=e=>{let{preface:t,message:n,chatMessage:r,numLines:o,buttonHandlers:a,buttons:i=[]}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement($b,{fromBot:!0},c.a.createElement(Sb,{chatMessage:r,lineIndex:0,numLines:o,hasSuggestion:!0},c.a.createElement("strong",null,t),c.a.createElement("br",null),n)),c.a.createElement(qb,{hasSuggestion:!0},i.map((e,t)=>c.a.createElement(eh,{key:`suggestion-button-${r.id}-${t}`,button:e,chatMessage:r,type:"button",handlers:a,hasSuggestion:!0}))))};const Kb="\n background: black;\n border-radius: 15px;\n",Wb=Ye.c.iframe.withConfig({displayName:"styles__IframeEmbed",componentId:"sc-10j1ec7-0"})(["",""],Kb),Vb=Ye.c.video.withConfig({displayName:"styles__HTML5Video",componentId:"sc-10j1ec7-1"})(["",""],Kb);var Xb=e=>{let{source:t}=e;const n=t.split(".").pop();return c.a.createElement(Vb,{width:"250",controls:!0},c.a.createElement("source",{src:t,type:`video/${n}`}),"Your browser does not support HTML5 video.")};var Qb=e=>{let{source:t}=e;const n=t.match(/^(?:https?:\/\/)?(www\.)?vimeo.com\/(\d+)($|\/)/);return n?c.a.createElement(Wb,{src:`https://player.vimeo.com/video/${n[2]}?title=0&byline=0&portrait=0`,width:"250",height:"auto",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0}):null};const Jb=e=>e.replace("?t=","?start=").replace("&t=","&start=");var Zb=e=>{let{source:t}=e;const n=(e=>{const t=e.toLowerCase();let n=e;return Object(O.a)("youtube.com",t)?(n=e.replace("&","?"),n=Jb(n),n.split("v=")[1]):Object(O.a)("youtu.be",t)?(n=Jb(e),n.split("youtu.be/")[1]):n})(t);return c.a.createElement(Wb,{width:"250",height:"auto",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})};var ev=e=>{let{source:t}=e;return Object(O.a)("youtube.com",t)||Object(O.a)("youtu.be",t)?c.a.createElement(Zb,{source:t}):Object(O.a)("vimeo.com",t)?c.a.createElement(Qb,{source:t}):c.a.createElement(Xb,{source:t})};const tv=e=>e,nv=e=>{let{button_type:t}=e;return t===b.edit_contact_details?"editContactDetails":"regularButtons"};var rv=e=>{var t,n;let{chatMessage:r,scrollToLatestMessage:o,scrollToBottom:a,shouldAutoScroll:i,buttonHandlers:l,messageCounter:u}=e;const d=Ue(),[h,m]=Object(s.useState)([]),{lastMessageSeen:g,attachments:v=[]}=Ge(na),y=r.sender?r.sender===p.USER:!r.from_bot;let w=[];r.message&&(w=r.from_bot?r.message.split(/\n\s*\n/).map(e=>e.trim()):[r.message]);const{regularButtons:E,editContactDetails:x}=Object(s.useMemo)(()=>_t(r.buttons,nv),[r.buttons]),_=Object(s.useMemo)(()=>{var e;return null==r||null===(e=r.buttons)||void 0===e?void 0:e.filter(e=>e.button_type===b.CHECKBOX.toLowerCase())},[r]),C=(e=>{let{root:t=null,threshold:n=1,onChange:r,skip:o=!1}=e;const[a,i]=Object(s.useState)(null),c=Object(s.useRef)(null);return Object(s.useEffect)(()=>{if(o)return;c.current&&c.current.disconnect(),c.current=new IntersectionObserver(r,{root:t,threshold:n});const{current:e}=c;return a&&e.observe(a),()=>e.disconnect()},[a,t,r,o,n]),i})({onChange:Object(s.useCallback)(e=>{let[{isIntersecting:t}]=e;var n,o;!t||(null==g?void 0:g.index)>=u||d((n=r.id,o=u,(e,t)=>yn({id:n,index:o},e,t)))},[r.id,d,g,u]),threshold:.95,skip:y}),T=Object(s.useCallback)(e=>{const t=h.find(t=>t.id===e.id);m(t?h.filter(t=>t.id!==e.id):[...h,e])},[h]),k=Object(s.useMemo)(()=>{var e,t;return[...null!==(e=r.attachments)&&void 0!==e?e:[],...(null!==(t=r.attachment_ids)&&void 0!==t?t:[]).map(e=>{return v.find((t=e,function(){let{id:e,temporaryId:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e===t||n===t}));var t}).filter(tv)]},[v,r.attachments,r.attachment_ids]),O=Boolean(r.message||(null==k?void 0:k.length)||(null===(t=r.buttons)||void 0===t?void 0:t.length)||(null===(n=r.image_carousel)||void 0===n?void 0:n.length));return r.system_dialogue_message_type===f.START||r.system_dialogue_message_type===f.END?c.a.createElement(Fb,{ref:C,fromBot:!0},c.a.createElement(Bb,{chatMessage:r})):c.a.createElement(zb,{ref:C,"data-cy":"message-block"},c.a.createElement(Fb,{fromBot:r.from_bot},r.image_carousel&&r.thon_image_above_text&&c.a.createElement("div",null,c.a.createElement(ob,{imageCarousel:r.image_carousel,chatMessage:r,thonAbove:!0,scrollToLatestMessage:o,shouldAutoScroll:i})),c.a.createElement($b,{fromBot:r.from_bot},w.map((e,t)=>c.a.createElement(Sb,{key:`chatMessage-${t}`,chatMessage:r,messageLine:e,lineIndex:t,numLines:w.length,editContactDetailsButton:null==x?void 0:x[0]}))),r.image_carousel&&!r.thon_image_above_text&&c.a.createElement("div",null,c.a.createElement(ob,{imageCarousel:r.image_carousel,chatMessage:r,scrollToLatestMessage:o,shouldAutoScroll:i})),k.map((e,t)=>c.a.createElement("div",{key:`message-attachment-${t}`},c.a.createElement(tb,{attachment:e,shouldAutoScroll:i,scrollToLatestMessage:o,scrollToBottom:a,avatar:r.avatar,chatMessageStatus:r.status,shouldAnimate:!0}))),r.video_source&&c.a.createElement(ev,{source:r.video_source})),c.a.createElement(qb,null,(null==E?void 0:E.length)>0&&E.map((e,t)=>c.a.createElement(eh,{key:`button-${t}`,button:e,chatMessage:r,type:"button",handlers:l,checked:h,setCheckboxValue:T,checkboxButtons:_}))),((null==r?void 0:r.suggestions)||[]).map((e,t)=>{let{preface:n,message:o,buttons:a}=e;return c.a.createElement(Yb,{key:`suggestion-${r.id}-${t}`,chatMessage:r,numLines:w.length,preface:n,message:o,buttons:a})}),O&&r.status&&c.a.createElement(Nb,{chatMessage:r,attachments:k}))};var ov=e=>c.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 82 82",xmlns:"http://www.w3.org/2000/svg"}),c.a.createElement("title",null,"Bot Avatar"),c.a.createElement("g",{transform:"translate(1 1)",fill:"none",fillRule:"evenodd"},c.a.createElement("circle",{stroke:"#F3F3F4",strokeWidth:"2",fill:"#FFF",cx:"40",cy:"40",r:"40"}),c.a.createElement("path",{d:"M30.64 35.4a4.27 4.27 0 11-8.54 0 4.27 4.27 0 018.54 0M50.17 35.4a4.27 4.27 0 108.54 0 4.27 4.27 0 00-8.54 0",fill:"#000"}),c.a.createElement("path",{d:"M29.42 60.83a17.42 17.42 0 0022.38 0",stroke:"#DA3CFF",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),c.a.createElement("path",{d:"M16 29.03a12.39 12.39 0 0113.15-5.31 12.24 12.24 0 019.45 10.49v15.64h5.47M44.88 23.2H64",stroke:"#0069FF",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"})));const av=Object(Ye.d)(["0%{opacity:0;transform:translateY(8px);}50%{opacity:0;transform:translateY(8px);}80%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),iv=Object(Ye.b)(["",";animation-name:",";"],Cr(600),av),sv=Object(Ye.d)(["0%{opacity:1;transform:translateY(0px);}50%{opacity:1;transform:translateY(-6px);}80%{transform:translateY(2px);}100%{opacity:0;transform:translateY(2px);}"]),cv=Object(Ye.b)(["",";animation-name:",";"],Cr(300),sv),lv=Ye.c.div.withConfig({displayName:"styles__NewMessageContainer",componentId:"sc-1n499zd-0"})(["position:absolute;z-index:3;bottom:90px;left:50%;transform:translateX(-50%);transition:opacity 300ms ease 300ms;opacity:",";"],e=>e.show?"1":"0"),uv=Ye.c.div.withConfig({displayName:"styles__NewMessageInner",componentId:"sc-1n499zd-1"})(["padding:8px;opacity:0;border-radius:100px;color:#2c2c2c;background:#fff;background-color:#fff;border:1px solid ",";box-shadow:0 2px 4px 0 rgba(0,0,0,0.08);cursor:pointer;display:flex;align-items:center;justify-content:",";min-width:35px;max-width:205px;width:","px;height:","px;",";",";svg{",";path{",";}}"],_r(.08,"#fff"),e=>e.hasUnread?"flex-start":"center",e=>e.hasUnread?"unset":"35",e=>e.hasUnread?"42":"35",e=>!e.show&&Tr(800),e=>e.show?iv:cv,e=>e.hasUnread&&"min-width: 24px",e=>!e.hasUnread&&`stroke: ${e.theme.buttonBackground}`),dv=Ye.c.div.withConfig({displayName:"styles__StyledAvatar",componentId:"sc-1n499zd-2"})(["border-radius:100px;min-width:24px;width:24px;height:24px;background-image:url(",");background-size:contain;background-repeat:no-repeat;background-position:center;"],e=>e.avatar),pv=Ye.c.span.withConfig({displayName:"styles__Message",componentId:"sc-1n499zd-3"})(["color:#2c2c2c;font-size:14px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:8px;"]),fv=e=>{let{message:t}=e;const{avatar:n}=Ge(Vo),{takenOver:r,avatars:o}=Ge(Yo),a=r?o[o.length-1]:n,i=t.replace(/(<[^>]*>)| /g,"");return c.a.createElement(c.a.Fragment,null,a?c.a.createElement(dv,{avatar:a}):c.a.createElement(ov,{height:24,width:24}),c.a.createElement(pv,null,i))};var hv=e=>{let{chatMessages:t,hasUnreadMessage:n,shouldAutoScroll:r,scrollToBottom:o}=e;const[a,i]=Object(s.useState)(!1),[l,u]=Object(s.useState)(!1),d=(e=>{const t=(e||[]).length,n=e[t-1];return Object(s.useMemo)(()=>t>1&&n.from_bot?n:e[t-2],[e,n,t])||{}})(t);return Object(s.useEffect)(()=>{l&&r&&u(!1)},[l,r]),Object(s.useEffect)(()=>{const e=setTimeout(()=>{r||i(!0)},600);return r&&i(!1),()=>clearTimeout(e)},[r]),c.a.createElement(lv,{show:a},c.a.createElement(uv,{hasUnread:n&&Boolean(d.message),show:a&&!l,onClick:()=>{u(!0),o()}},n&&Boolean(d.message)?c.a.createElement(fv,{message:d.message}):c.a.createElement(Pn,{width:12})))};const mv=Ye.c.div.withConfig({displayName:"styles__QueueContainer",componentId:"sc-k9za8a-0"})(["left:0;right:0;z-index:15;position:absolute;background:",";background-color:",";box-shadow:0px 3px 4px -1px ",";",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,Xr.shadowColor,Dr),gv=Ye.c.div.withConfig({displayName:"styles__MessageContainer",componentId:"sc-k9za8a-1"})(["display:flex;padding:5px 18px;justify-content:space-between;align-items:center;border-top:1px solid rgba(0,0,0,0.1);"]),bv=Object(Ye.c)(To).withConfig({displayName:"styles__QueueText",componentId:"sc-k9za8a-2"})(["margin:0;color:",";span{font-weight:600;}"],e=>e.theme.headerText),vv=Object(Ye.c)(ro).withConfig({displayName:"styles__QueueLink",componentId:"sc-k9za8a-3"})(["color:",";"],e=>e.theme.headerText),yv=Object(Ye.d)(["from{background-position:-180px;}to{background-position:180px;}"]),wv=Object(Ye.d)(["from{background-position:180px;}to{background-position:-180px;}"]),Ev=Ye.c.div.withConfig({displayName:"styles__LoadingContainer",componentId:"sc-k9za8a-4"})(["position:relative;border:0;"]),xv=Ye.c.span.withConfig({displayName:"styles__Loader",componentId:"sc-k9za8a-5"})(["opacity:1;height:3px;width:100%;top:3;position:absolute;background-image:linear-gradient( 90deg,rgba(255,255,255,0) 25%,"," 45%,"," 55%,rgba(255,255,255,0) 75% );animation:1.3s linear "," infinite 0s;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,e=>{let{hasCancelled:t}=e;return t?wv:yv});var _v=()=>{const[e,t]=Object(s.useState)(null),[n,r]=Object(s.useState)(!1),{SAGE_HOST:o}=Ge(Jo),{currentLanguage:a}=Ge(Xo),{id:i,text:l,showTakeoverQueue:u}=Ge(Vo),{defaultLanguage:d}=vi(),p=Ue(),{takeover_queue_text:f,takeover_queue_link:h,leave_queue_text:m,leave_queue_link:g}=Object(s.useMemo)(()=>ki(l,a,d),[a,d,l]);return Object(s.useEffect)(()=>{u&&et.a.get(`${o}/api/v1/stats/bot/${i}/public/current_wait_time?sources%5B%5D=web`).then(e=>{const{data:{data:{mean:n,n:r}}}=e;if(r<3)return void t(null);const o=Math.round((n/60).toFixed(2));o>1&&t(o)})},[o,i,u]),Object(s.useEffect)(()=>{const e=setTimeout(()=>{n&&p(Nt())},3e3);return n||clearTimeout(e),()=>clearTimeout(e)},[n,p]),u?c.a.createElement(mv,null,c.a.createElement(gv,{"aria-live":"polite","aria-atomic":"true","data-cy":"takeover-queue"},n?c.a.createElement(c.a.Fragment,null,c.a.createElement(bv,null,m),c.a.createElement(vv,{onClick:()=>r(!1),"data-cy":"takeover-queue-link"},g)):c.a.createElement(c.a.Fragment,null,c.a.createElement(bv,null,e?c.a.createElement(c.a.Fragment,null,"Estimated wait time: ",c.a.createElement("span",null,e," min")):c.a.createElement(c.a.Fragment,null,f)),c.a.createElement(vv,{onClick:()=>r(!0),"data-cy":"takeover-queue-link"},h))),c.a.createElement(Ev,null,c.a.createElement(xv,{hasCancelled:n}))):null};const Cv=Object(Ye.d)(["0%{opacity:0;transform:translateY(8px);}50%{opacity:0;transform:translateY(8px);}80%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),Tv=Object(Ye.b)(["",";animation-name:",";"],Cr(600),Cv),kv=Object(Ye.d)(["10%{transform:translateY(-5px);}50%{opacity:0.5;transform:translateY(0);}"]),Ov=Ye.c.div.withConfig({displayName:"styles__TypingIndicatorContainer",componentId:"sc-1lynepx-0"})(["background:none;will-change:transform;width:auto;padding:0px;display:table;margin:8px 0px;position:relative;",""],Tv),Sv=Ye.c.div.withConfig({displayName:"styles__IndicatorContainer",componentId:"sc-1lynepx-1"})(["border-radius:15px;position:relative;display:inline-flex;flex-direction:row;border:0;padding:11px 9px;background:",";background-color:",";"],e=>e.theme.botMessageBackground,e=>e.theme.botMessageBackground),Iv=Ye.c.span.withConfig({displayName:"styles__Indicator",componentId:"sc-1lynepx-2"})(["height:5px;width:5px;margin:0 2px;background:",";background-color:",";display:block;opacity:1;border-radius:100px;&:nth-of-type(1){animation:1s "," infinite 0.3s;}&:nth-of-type(2){animation:1s "," infinite 0.6s;}&:nth-of-type(3){animation:1s "," infinite 0.9s;}"],e=>e.theme.botMessageText,e=>e.theme.botMessageText,kv,kv,kv);var Av=()=>c.a.createElement(Ov,{"data-cy":"typing-indicator"},c.a.createElement(Sv,null,c.a.createElement(Iv,null),c.a.createElement(Iv,null),c.a.createElement(Iv,null)));const jv=Ye.c.div.withConfig({displayName:"styles__BodyContainer",componentId:"sc-1vymaz1-0"})(["width:100%;min-width:100%;overflow-y:auto;padding:0 30px;height:100%;overflow-x:hidden;background:",";background-color:",";"],e=>e.theme.background,e=>e.theme.background),Nv=Ye.c.div.withConfig({displayName:"styles__ChatBoxMessages",componentId:"sc-1vymaz1-1"})(["min-height:100%;display:flex;flex-direction:column;justify-content:flex-end;"]);var Mv=e=>{let{setBodyRef:t,setBottomRef:n,setTopRef:r,scrollToBottom:o,scrollToLatestMessage:a,shouldAutoScroll:i,onUserScroll:l,buttonHandlers:u,hasUnreadMessage:d,setGroupRef:f}=e;const[h,m]=Object(s.useState)(!1),{requestedTakeover:b,takeoverClosed:v,takenOver:y,isTyping:w}=Ge(Yo),{isTyping:E}=Ge(Vo),{active:x}=Ge(Xo),{currentMessageId:_,inspectorOpen:C}=Ge(Zo),{chatMessages:T}=Ge(na)||[],k=(e=>{let t=null,n=null,r=!1;const o=[];return e.forEach(e=>{e.from_bot===t&&e.name===n&&e.from_webhook===r&&e.handler!==g.TRIGGER_DIALOGUE?o[o.length-1].push(e):o.push([e]),t=e.from_bot,n=e.name,r=e.from_webhook}),o})(T);Object(s.useEffect)(()=>{x&&T.length>0?m(!0):m(!1)},[x,T.length]);let O=0;return c.a.createElement(jv,{ref:t,onScroll:l},b&&!v&&!y&&c.a.createElement(_v,null),c.a.createElement(Nv,{role:"log","aria-live":"polite","data-cy":"chat-log"},k.map((e,t)=>{const n=C&&((e,t,n)=>{var r;const o=e||(null===(r=t.slice(-1)[0])||void 0===r?void 0:r.id);return!!n.find(e=>{let{id:t}=e;return o===t})})(_,T,k[t]);return c.a.createElement(c.a.Fragment,{key:`message-group-${t}`},c.a.createElement(Og,{fromAgent:e[0].sender===p.AGENT,fromBot:e[0].from_bot,created:e[0].created,inspected:n,setGroupRef:f},e.map((n,l)=>{const d=t===(null==k?void 0:k.length)-1&&l===(null==e?void 0:e.length)-1;return O+=1,c.a.createElement(s.Fragment,{key:`chat-message-${t}-${l}`},d&&c.a.createElement("div",{ref:r}),c.a.createElement(rv,{chatMessage:n,scrollToBottom:o,scrollToLatestMessage:a,shouldAutoScroll:i,buttonHandlers:u,messageCounter:O}))})))}),(w||E)&&c.a.createElement(Av,null),c.a.createElement("div",{ref:n})),h&&c.a.createElement(hv,{chatMessages:T,hasUnreadMessage:d,shouldAutoScroll:i,scrollToBottom:o}))};var Pv=e=>{let{children:t,animate:n}=e;return c.a.createElement(ef.div,{variants:{normal:{x:0},error:{x:[0,2,-2,0]}},animate:n},t)};const Rv=Ye.c.div.withConfig({displayName:"styles__InputLimitContainer",componentId:"sc-18r5r1u-0"})(["height:20px;display:flex;opacity:0.8;align-items:center;margin-bottom:10px;justify-content:space-between;",""],e=>!e.enabled&&`margin-bottom: 15px; height: 10px; border-bottom: 1px solid ${Xr.grayColor}`),Lv=Ye.c.div.withConfig({displayName:"styles__FillContainer",componentId:"sc-18r5r1u-1"})(["width:",";height:1px;transition:all ease 0.3s;span{height:100%;display:block;}span:first-child{width:100%;opacity:0.3;background:",";background-color:",";}span:last-child{margin-top:-1px;width:","%;background:",";background-color:",";}"],e=>e.active?"calc(100% - 50px)":"100%",e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements},e=>e.width>100?100:e.width,e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements}),Dv=Object(Ye.c)(Eo).withConfig({displayName:"styles__CountContainer",componentId:"sc-18r5r1u-2"})(["margin:0;opacity:1;display:",";color:",";span{font-weight:500;}",";"],e=>e.active?"block":"none",e=>{let{theme:t}=e;return t.chatLogElements},Lr);var Bv=e=>{let{alwaysShow:t,inputMax:n,inputLength:r,shake:o}=e;const a=Math.floor(r/n*100),i=r>0,s=t||r>n;return c.a.createElement(Rv,{enabled:s,active:i},s&&c.a.createElement(c.a.Fragment,null,c.a.createElement(Lv,{active:i,width:a},c.a.createElement("span",null),c.a.createElement("span",null)),c.a.createElement(Pv,{initial:!1,animate:o?"error":"normal"},c.a.createElement(Dv,{active:i},c.a.createElement("span",null,r),"/",n))))},Hv=()=>/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const Uv=Hv(),zv=-1!==navigator.userAgent.indexOf("Version/15.0");var Fv=()=>Uv&&zv;const $v=Ye.c.div.withConfig({displayName:"styles__UploadWrapper",componentId:"sc-1e637pi-0"})(["",";button{padding:0;}&:hover{opacity:0.8;}svg{margin-top:3px;path{fill:",";}}"],Wr(e=>{let{hasFiles:t}=e;return t?"0":"15px"}),e=>{let{theme:t}=e;return t.buttonBackground}),Gv=["Bytes","kB","MB","GB"],qv=e=>new Promise((t,n)=>{const r=e.size/1024;if(r>5120)return void n(new Error(`The file must be less than ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===e)return"0 Bytes";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**n).toFixed(t))} ${Gv[n]}`}(5242880)}`));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t({url:o.result,file:e,sizeKb:r,name:e.name,type:e.type,status:y.PROCESSING,sender:p.USER}),o.onabort=()=>n(new Error(o.error))});var Yv=e=>{let{accept:t="image/*,text/*,.pdf",multiple:n=!0}=e;const{handoverMode:r,isTextDirectionRtl:o}=Ge(Vo),{takenOver:a}=Ge(Yo),{attachments:i}=Ge(Xo),l=Ue(),u=Object(s.useRef)(),d=Hv(),p=a&&r===E.PLATFORM,f=Object(s.useCallback)(async e=>{let{target:t}=e;try{var n;if((null===(n=t.files)||void 0===n?void 0:n.length)>5)return void l(Pt("You can upload up to 5 files at a time",3500));const e=await Promise.all(Array.from(t.files).map(qv));l(en(e))}catch(e){l(Pt(e.message.replace(/^Error: ?/i,""),3500))}},[l]),h=Object(s.useCallback)(()=>{u.current&&(u.current.value="",u.current.click())},[u]);return Object(s.useEffect)(()=>{i.buttonClicked&&(l(e=>{e({type:"ATTACHMENT_PROMPT_SHOWED"})}),h())},[i.buttonClicked,l,h]),c.a.createElement($v,{isTextDirectionRtl:o,hasFiles:i.files.length>0},(p||d&&(null==i?void 0:i.exchangeId))&&c.a.createElement(oo,{onClick:e=>{e.preventDefault(),e.stopPropagation(),h()}},c.a.createElement(Ig,null)),c.a.createElement("input",{ref:u,hidden:!0,type:"file",accept:t,multiple:n,onChange:f,style:{display:"none"}}))};const Kv=Ye.c.div.withConfig({displayName:"styles__Container",componentId:"sc-76oby0-0"})(["display:flex;align-items:center;font-size:15px;> div{position:relative;overflow:visible;}span{border:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px;}button{display:none;position:absolute;top:-9px;left:-8px;border:1px solid white;border-radius:50%;width:20px;height:20px;padding:0px;background:",";}"],Xr.darkColor),Wv=Ye.c.div.withConfig({displayName:"styles__AttachmentWrapper",componentId:"sc-76oby0-1"})(["height:41px;&:not(:first-child){margin-left:4px;}&:hover{button{display:block;}}"]),Vv=Ye.c.div.withConfig({displayName:"styles__ImageWrapper",componentId:"sc-76oby0-2"})(["height:41px;display:flex;img{border-radius:8px;max-height:100%;margin-left:4px;}"]),Xv=Ye.c.div.withConfig({displayName:"styles__IconWrapper",componentId:"sc-76oby0-3"})(["height:100%;padding:8px;border-radius:8px;background:",";"],Xr.grayColor);Ye.c.div.withConfig({displayName:"styles__FileType",componentId:"sc-76oby0-4"})(["font-size:14px;height:41px;padding:0 4px;background:",";border-radius:8px;display:flex;align-items:center;margin-left:4px;"],Xr.grayColor);var Qv=e=>{let{file:t}=e;return Wg(t)===w.IMAGE?c.a.createElement(Vv,null,c.a.createElement("img",{src:t.url,alt:`Uploaded image: ${t.name}`})):c.a.createElement(Xv,null,c.a.createElement(Ig,{height:24}))};var Jv=()=>{const{attachments:{files:e}}=Ge(Xo),t=Ue(),n=Object(s.useCallback)(n=>t(en(((e,t)=>{const n=e.slice();return n.splice(t,1),n})(e,n))),[t,e]);return c.a.createElement(Kv,null,e.map((e,t)=>c.a.createElement(Wv,{key:`uploaded-image-${e.name}-${t}`},c.a.createElement(Qv,{file:e}),c.a.createElement(oo,{onClick:e=>{e.preventDefault(),n(t)}},c.a.createElement(jn,{width:18,height:18,color:"#000"})))),1===(null==e?void 0:e.length)&&c.a.createElement("span",null,e[0].name))},Zv=s.useLayoutEffect,ey=function(e){var t=Object(s.useRef)(e);return Zv((function(){t.current=e})),t},ty=function(e,t){"function"!=typeof e?e.current=t:e(t)},ny=function(e,t){var n=Object(s.useRef)();return Object(s.useCallback)((function(r){e.current=r,n.current&&ty(n.current,null),n.current=t,t&&ty(t,r)}),[t])},ry={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},oy=function(e){Object.keys(ry).forEach((function(t){e.style.setProperty(t,ry[t],"important")}))},ay=null;var iy=function(){},sy=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],cy=!!document.documentElement.currentStyle,ly=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,a=e.onChange,i=void 0===a?iy:a,c=e.onHeightChange,l=void 0===c?iy:c,u=V(e,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]);var d,p=void 0!==u.value,f=Object(s.useRef)(null),h=ny(f,t),m=Object(s.useRef)(0),g=Object(s.useRef)(),b=function(){var e=f.current,t=n&&g.current?g.current:function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,sy.reduce((function(e,t){return e[t]=n[t],e}),{})),o=r.boxSizing;return""===o?null:(cy&&"border-box"===o&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})}(e);if(t){g.current=t;var a=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),ay||((ay=document.createElement("textarea")).setAttribute("tab-index","-1"),ay.setAttribute("aria-hidden","true"),oy(ay)),null===ay.parentNode&&document.body.appendChild(ay);var o=e.paddingSize,a=e.borderSize,i=e.sizingStyle,s=i.boxSizing;Object.keys(i).forEach((function(e){var t=e;ay.style[t]=i[t]})),oy(ay),ay.value=t;var c=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize}(ay,e);ay.value="x";var l=ay.scrollHeight-o,u=l*n;"border-box"===s&&(u=u+o+a),c=Math.max(u,c);var d=l*r;return"border-box"===s&&(d=d+o+a),[c=Math.min(d,c),l]}(t,e.value||e.placeholder||"x",o,r),i=a[0],s=a[1];m.current!==i&&(m.current=i,e.style.setProperty("height",i+"px","important"),l(i,{rowHeight:s}))}};return Object(s.useLayoutEffect)(b),d=ey(b),Object(s.useLayoutEffect)((function(){var e=function(e){d.current(e)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),Object(s.createElement)("textarea",W({},u,{onChange:function(e){p||b(),i(e)},ref:h}))},uy=Object(s.forwardRef)(ly);const dy=Ye.c.div.withConfig({displayName:"styles__ComposerContainer",componentId:"sc-1v8m1u6-0"})(["padding:20px;padding-top:5px;background:none;background:",";background-color:",";",""],e=>e.theme.background,e=>e.theme.background,co),py=Ye.c.div.withConfig({displayName:"styles__FormInner",componentId:"sc-1v8m1u6-1"})(["display:flex;align-items:center;justify-content:space-between;"]),fy=Object(Ye.c)(To).withConfig({displayName:"styles__DisabledText",componentId:"sc-1v8m1u6-2"})(["margin:8px 0 10px 10px;transition:all 0.3s ease;",";"],e=>e.hide&&"transform: translateY(-45px)"),hy=Object(Ye.c)(uy).withConfig({displayName:"styles__ComposerInput",componentId:"sc-1v8m1u6-3"})([""," min-height:","px;"],so,e=>{let{$minHeight:t}=e;return t}),my=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1v8m1u6-4"})(["width:40px;height:40px;display:flex;justify-content:center;align-items:center;",";"],Wr("15px")),gy=Object(Ye.b)(["color:#fff;z-index:10;cursor:pointer;box-shadow:none;height:100%;width:100%;padding:0;text-transform:none;display:flex;align-items:center;justify-content:center;border:none;max-width:36px;max-height:36px;background-color:transparent;"," &:hover{opacity:0.8;}svg{transition:all 0.2s ease;path{fill:",";}}"],Vr,e=>e.theme.buttonBackground),by=Ye.c.button.withConfig({displayName:"styles__SettingsButton",componentId:"sc-1v8m1u6-5"})(["",";transition:all 0.1s ease-in;display:",";svg{transition:all 0.2s ease;:hover{transform:rotate(30deg);}}"],gy,e=>e.active?"flex":"none"),vy=Ye.c.button.withConfig({displayName:"styles__SubmitButton",componentId:"sc-1v8m1u6-6"})(["",";z-index:15;padding:8px;transition:opacity 0.1s ease-in;display:",";border-radius:100px;background:",";background-color:",";svg{margin-top:2px;margin-right:2px;transition:all 0.2s ease;path{fill:#fff;}}",";"],gy,e=>e.active?"flex":"none",e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>{let{disabled:t}=e;return t&&"\n cursor: default;\n opacity: 0.3;\n &:hover {\n opacity: 0.3;\n }\n "}),yy=Hv();let wy;const Ey=e=>{let{active:t,chatHasStarted:n,onManualFocus:r,currentlyPoppedUp:o,autoFocused:a,isScrolledDown:i}=e;const u=Object(s.useRef)(),[d,p]=Object(s.useState)(41),[f,h]=Object(s.useState)(!1),[m,g]=Object(s.useState)(!1),[b,v]=Object(s.useState)(""),[y,w]=Object(s.useState)(0);Object(s.useEffect)(()=>{(t||n)&&!yy&&!o&&u.current&&!a&&u.current.focus()},[t,n,a,u,o]);const{text:E,inputLimitEnabled:x,inputLimit:_,isTextDirectionRtl:C}=Ge(Vo),{defaultLanguage:T}=vi(),{hideInputField:k,currentLanguage:O,allGreetingsHideInput:S,attachments:{files:I}}=Ge(Xo),{takenOver:A,userIsTyping:j}=Ge(Yo),{connected:N}=Ge(Qo),{chatMessages:M}=Ge(na),{inspectorOpen:P}=Ge(Zo),R=Ue(),L=C?"rtl":void 0,D=k&&!A,B=!A&&x?_:1e3,H=!N||D||S&&0===M.length||b.length>B,{placeholder:U,disabled_input_text:z}=Object(s.useMemo)(()=>ki(E,O,T),[O,T,E]),F=e=>{if(e.preventDefault(),e.stopPropagation(),j&&R(Mt()),H)return!1;if(!b.trim()&&0===I.length)return!1;if(I.length>0)R(mn());else{const e=(new Date).getTime();if(!(e-y>1e3))return!1;w(e),R(pn(b.trim()))}return v(""),!0},$=e=>{const t=e.length>0;clearTimeout(wy),!j&&t?R((e,t)=>{const{connection:{token:n},environment:{PAT_HOST:r}}=t();e({type:"USER_STARTED_TYPING"}),e(bt({method:"post",url:`${r}/chatbubble/${l.a}/user_started_typing/`,...st({token:n})}))}):j&&!t&&R(Mt()),wy=setTimeout(()=>{R(Mt())},5e3)};const G=!b&&0===I.length;return c.a.createElement(dy,{dir:L,inspectorOpen:P},c.a.createElement(Bv,{alwaysShow:!A&&x,inputMax:B,inputLength:b.length,shake:f}),c.a.createElement("form",{autoComplete:"off",action:"#",onSubmit:F},c.a.createElement(py,null,c.a.createElement(ao,{targetHeight:d,active:G?0:1,hasFiles:(null==I?void 0:I.length)>0},0===I.length&&c.a.createElement(c.a.Fragment,null,c.a.createElement(hy,{id:"chat-box-composer","data-cy":"chat-box-composer","aria-hidden":!n,"aria-label":U,"aria-labelledby":"chat-bubble-bot-name",name:"message",$hide:D?1:0,disabled:!n||D,$active:G?0:1,ref:u,placeholder:U,type:"text",onChange:e=>{const{value:t}=e.target;A?$(t):t.length>B&&h(!0),v(t)},value:b,onFocus:function(){g(!0),Fv()&&setTimeout(()=>window.scrollTo(0,document.body.scrollHeight-360),150)},onBlur:()=>g(!1),onMouseDown:()=>{m||i()||r()},onHeightChange:p,$minHeight:41,onKeyDown:e=>{h(!1),"Enter"!==e.key||e.shiftKey||F(e)}}),c.a.createElement(fy,{hide:k?1:0},z)),c.a.createElement(Jv,null)),c.a.createElement(Yv,null),c.a.createElement(my,{isTextDirectionRtl:C},c.a.createElement(by,{"data-cy":"composer-settings","aria-hidden":G&&n?"false":"true",active:(D||G)&&n?1:0,role:"button",onClick:e=>{e.preventDefault(),R(e=>{e({type:"OPEN_OPTIONS_SCREEN"})})},title:"Open settings"},c.a.createElement(Ln,{width:25,height:26})),c.a.createElement(vy,{"data-cy":"composer-submit","aria-hidden":G||!n?"true":"false",active:D||G||!n?0:1,disabled:H,role:"button",onClick:F,title:"Send message",onMouseDown:e=>{e.preventDefault()}},c.a.createElement(Rn,{width:18,height:18}))))))};Ey.defaultProps={currentlyPoppedUp:!1};var xy=Ey;var _y=e=>{let{cancelChat:t,setCancelChat:n}=e;const{name:r,avatar:o,fullscreenMode:a,feedbackFormType:i,isTextDirectionRtl:l}=Ge(Vo),{optionsScreenOpen:d,chatHasStarted:p}=Ge(Xo),f=Ue(),h=!(d||a&&i===u.NONE),m=document.documentElement,g=l?"rtl":void 0,b=Object(s.useCallback)(()=>{f(e=>{e({type:"CLOSE_CHATBUBBLE"})}),m.style.overflow="unset"},[f,m]);!function(e){let{onKeydown:t}=e;Object(s.useEffect)(()=>(window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)),[t])}({onKeydown:Object(s.useCallback)(e=>{const{tagName:t}=document.activeElement;"Escape"===e.code&&"BODY"===t&&b(),"Escape"===e.code&&"BODY"!==t&&document.activeElement.blur()},[b])});const v=Object(s.useCallback)(()=>{t?(f(Xt(a)),n(!1),m.style.overflow="unset"):n(!0)},[t,f,a,n,m]);return p?c.a.createElement(So,{dir:g,"data-cy":"chat-box-header"},c.a.createElement(Io,null,o?c.a.createElement(Mo,{avatar:o}):c.a.createElement(ov,{height:30}),c.a.createElement(jo,{isTextDirectionRtl:l,"aria-label":`Chat bot ${r||"Kindly"}`},r||"Kindly")),c.a.createElement(Ao,null,h&&c.a.createElement(c.a.Fragment,null,c.a.createElement(No,{"aria-label":"Minimize chat",title:"Minimize chat",type:"button",onClick:b,"data-cy":"minimize-chat-button"},c.a.createElement(Pn,{width:25,height:9})),c.a.createElement(No,{"aria-label":"End chat",title:"End chat",type:"button",onClick:v,"data-cy":"end-chat-button",isTextDirectionRtl:l},c.a.createElement(jn,{width:25,height:25}))))):null};const Cy=Ye.c.div.withConfig({displayName:"styles__AboutChatContainer",componentId:"sc-pmmp3f-0"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;padding:0 0 20px 0;",";animation-duration:0.2s;animation-timing-function:ease-in;"],Lr),Ty=Ye.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-pmmp3f-1"})(["height:100%;display:flex;text-align:center;flex-direction:column;justify-content:space-between;align-items:center;"]),ky=Ye.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-pmmp3f-2"})(["width:100%;height:100%;display:flex;padding:0 30px;flex-direction:column;justify-content:center;align-items:center;"]),Oy=Object(Ye.c)(wo).withConfig({displayName:"styles__AboutParagraph",componentId:"sc-pmmp3f-3"})(["font-size:16px;a{color:",";}"],Xr.primaryColor),Sy=Ye.c.div.withConfig({displayName:"styles__LinkContainer",componentId:"sc-pmmp3f-4"})(["a{color:",";text-align:center;font-size:",";display:block;margin:60px 0 30px 0;:hover,:focus,:active,:visited{color:",";}}"],Xr.darkColor,Jr.fontSizeP,Xr.darkColor);var Iy=e=>{let{setAboutChat:t}=e;const{text:n}=Ge(Vo),{currentLanguage:r}=Ge(Xo),{defaultLanguage:o}=vi(),a=Object(s.useCallback)(()=>t(!1),[t]),i=Object(s.useCallback)(e=>{"Enter"===e.key&&t(!1)},[t]),l=Object(s.useMemo)(()=>ki(n,r,o),[r,o,n]),{back_to_chat_button:u}=l;return c.a.createElement(Cy,null,c.a.createElement(Ty,null,c.a.createElement(ky,null,c.a.createElement(_o,null,"About Kindly"),c.a.createElement(Oy,null,"This chatbot is powered by Kindly.",c.a.createElement("br",null),"To learn more about Kindly, visit"," ",c.a.createElement("a",{href:"https://www.kindly.ai/nb/products",target:"_blank",rel:"noopener noreferrer"},"this website."))),c.a.createElement(Sy,null,c.a.createElement(ro,{"aria-label":u,title:u,onClick:a,onKeyUp:i,tabIndex:"0",type:"button"},"‹ ",u))))};const Ay=Ye.c.div.withConfig({displayName:"styles__PoweredContainer",componentId:"sc-16vfwd0-0"})(["z-index:2;display:flex;justify-content:center;"]),jy=Ye.c.span.withConfig({displayName:"styles__Blob",componentId:"sc-16vfwd0-1"})(["width:8px;height:8px;opacity:1;border-radius:100%;margin:0 4px 0 8px;background:#1cd300;background-color:#1cd300;"]),Ny=Object(Ye.c)(Eo).withConfig({displayName:"styles__PoweredParagraph",componentId:"sc-16vfwd0-2"})(["display:flex;opacity:1;margin-bottom:0;align-items:baseline;span:first-child{opacity:0.6;}a{cursor:pointer;}"]);var My=e=>{let{hide:t,setAboutChat:n}=e;const r=Object(s.useCallback)(()=>n(!0),[n]),o=Object(s.useCallback)(e=>{"Enter"===e.key&&n(!0)},[n]);return c.a.createElement(Ay,{hide:t},c.a.createElement(Ny,null,c.a.createElement("span",null,"Powered by")," ",c.a.createElement(jy,null),c.a.createElement(ko,null,c.a.createElement(ro,{"aria-label":"Visit Kindly",title:"Visit Kindly",onClick:r,onKeyUp:o,type:"button",tabIndex:"0"},"Kindly"))))},Py=e=>{const[t,n]=Object(s.useState)(!1);return Object(s.useEffect)(()=>{t&&!e&&n(!1)},[e,t]),{showAboutChat:t,setShowAboutChat:n}};const Ry=Ye.c.div.withConfig({displayName:"styles__CancelChatContainer",componentId:"sc-1gy1mo2-0"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;padding:0 0 20px 0;",";animation-duration:0.2s;animation-timing-function:ease-in;"],Lr),Ly=Ye.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-1gy1mo2-1"})(["height:100%;display:flex;text-align:center;flex-direction:column;justify-content:space-between;align-items:center;"]),Dy=Ye.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-1gy1mo2-2"})(["width:100%;height:100%;display:flex;padding:0 30px;justify-content:center;align-items:center;"]),By=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1gy1mo2-3"})(["button{margin:auto;}a{color:",";text-align:center;font-size:",";display:block;margin:60px 0 30px 0;:hover,:focus,:active,:visited{color:",";}}"],Xr.darkColor,Jr.fontSizeP,Xr.darkColor),Hy=Ye.c.div.withConfig({displayName:"styles__CancelChatFooter",componentId:"sc-1gy1mo2-4"})(["div{display:flex;position:unset;align-items:center;}"]);var Uy=e=>{let{setCancelChat:t}=e;const n=Ue(),{text:r}=Ge(Vo),{currentLanguage:o,active:a}=Ge(Xo),{setShowAboutChat:i}=Py(a),{defaultLanguage:l}=vi(),u=document.documentElement,d=Object(s.useMemo)(()=>ki(r,o,l),[o,l,r]),p=Object(s.useCallback)(()=>{n(Xt()),t(!1),u.style.overflow="unset"},[n,t,u]),f=Object(s.useCallback)(()=>t(!1),[t]),h=Object(s.useCallback)(e=>{"Enter"===e.key&&t(!1)},[t]),{back_to_chat_button:m,cancel_chat_button:g,cancel_chat_text:b}=d;return c.a.createElement(Ry,null,c.a.createElement(Ly,null,c.a.createElement(Dy,null,c.a.createElement(xo,null,b)),c.a.createElement(By,null,c.a.createElement(yo,{"aria-label":g,title:g,onClick:p,type:"button",color:!0,text:g,cy:"cancel-chat-button"}),c.a.createElement(ro,{"aria-label":m,title:m,onClick:f,onKeyUp:h,type:"button",tabIndex:"0"},"‹ ",m)),c.a.createElement(Hy,null,c.a.createElement(My,{setAboutChat:i}))))};const zy=Object(Ye.c)(ro).withConfig({displayName:"styles__FooterLink",componentId:"sc-1l968t6-0"})(["display:block;color:",";text-align:center;margin:30px 0;font-size:",";:hover,:focus,:active,:visited{color:",";}"],Xr.darkColor,Jr.fontSizeP,Xr.darkColor),Fy=Ye.c.div.withConfig({displayName:"styles__OptionsContainer",componentId:"sc-1l968t6-1"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;text-align:center;display:grid;grid-template-rows:1fr 40px;@media (max-height:610px){overflow:scroll;}"]),$y=(Ye.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-1l968t6-2"})(["height:100%;text-align:center;display:grid;grid-template-rows:1fr 40px;"]),Ye.c.div.withConfig({displayName:"styles__GenericContainer",componentId:"sc-1l968t6-3"})(["display:grid;grid-gap:15px;grid-template-rows:auto 1fr;@media ","{grid-gap:0;overflow:scroll;grid-template-rows:1fr;}"],eo.maxPhoneHeight)),Gy=Ye.c.div.withConfig({displayName:"styles__DeleteContainer",componentId:"sc-1l968t6-4"})(["display:grid;grid-template-rows:1fr auto;@media ","{grid-template-rows:1fr;}"],eo.maxPhoneHeight),qy=Ye.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-1l968t6-5"})(["width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 30px;h1{margin:0;width:100%;}h3{display:flex;align-items:center;justify-content:center;svg{margin-right:30px;}}h4{margin-top:30px;width:100%;}"]),Yy=(Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1l968t6-6"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;&:last-child{margin-top:10px;}svg{margin-right:15px;}}"]),Object(Ye.c)(go).withConfig({displayName:"styles__OptionsButton",componentId:"sc-1l968t6-7"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"])),Ky=Ye.c.div.withConfig({displayName:"styles__OptionsFooter",componentId:"sc-1l968t6-8"})(["div{position:unset;display:flex;flex-direction:column;align-items:center;}"]);var Wy=e=>{let{textContent:t}=e;const{chat_deleted_header:n,chat_deleted_text:r}=t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(qy,null,c.a.createElement(xo,null,n),c.a.createElement(To,null,r)))};const Vy="GENERIC",Xy="LANGUAGE",Qy="DOWNLOAD",Jy="DELETE_CHAT_CONFIRM",Zy="CHAT_DELETED",ew=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-c6vrbi-0"})(["max-width:100%;padding:0 15px;flex-direction:column;display:flex;align-items:center;margin:unset;button{margin-bottom:10px;&:last-child{margin-top:0;}}"]);var tw=e=>{let{textContent:t,setOptionsView:n}=e;const r=Ue(),{back_to_chat_button:o,delete_text:a,delete_button:i}=t,l=document.documentElement,u=Object(s.useCallback)(()=>{n(Zy),r(un()),l.style.overflow="unset"},[n,r,l]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(qy,null,c.a.createElement(xo,null,a)),c.a.createElement(ew,null,c.a.createElement(yo,{"aria-label":i,title:i,onClick:u,type:"button",text:i,color:!0,cy:"confirm-delete-chat"}),c.a.createElement(zy,{"aria-label":o,title:o,onClick:()=>n(Vy),type:"button"},"‹ ",o)))};const nw=Ye.c.div.withConfig({displayName:"styles__SelectionContainer",componentId:"sc-mbgnew-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;"]),rw=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-mbgnew-1"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;}"]);var ow=e=>{let{textContent:t,setOptionsView:n}=e;const r=Ue(),{back_to_chat_button:o,download_button:a,download_format_text:i}=t,l=Object(s.useCallback)(async()=>{r(await ln({},"html"))},[r]),u=Object(s.useCallback)(async()=>{r(ln({},"json"))},[r]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(qy,null,c.a.createElement(To,null,i)),c.a.createElement(nw,null,c.a.createElement(rw,null,c.a.createElement(Yy,{"aria-label":`${a} (HTML)`,title:`${a} (HTML)`,onClick:l,type:"button","data-cy":"download-chat-html"},`${a} (HTML)`),c.a.createElement(Yy,{"aria-label":`${a} (JSON)`,title:`${a} (JSON)`,onClick:u,type:"button","data-cy":"download-chat-json"},`${a} (JSON)`)),c.a.createElement(zy,{"aria-label":o,title:o,onClick:()=>n(Vy),type:"button"},"‹ ",o)))};const aw=Ye.c.div.withConfig({displayName:"styles__Header",componentId:"sc-crpo3y-0"})(["width:100%;height:",";background:",";background-color:",";@media ","{display:none;}"],e=>e.long?"180px":"210px",e=>e.theme.headerBackground,e=>e.theme.headerBackground,eo.maxPhoneHeight),iw=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-crpo3y-1"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;&:last-child{margin-top:10px;}svg{margin-right:15px;}}"]);var sw=e=>{let{languages:t,textContent:n,setOptionsView:r}=e;const o=Ue(),{back_to_chat_button:a,change_language_button:i,download_button:l,delete_button:u,start_over_button:d}=n,p=Object(s.useCallback)(()=>{o(Xt(!0))},[o]),f=Object(s.useCallback)(()=>{o((e,t)=>{const{optionsScreenOpen:n}=t().chatbubble;n&&e({type:"CLOSE_OPTIONS_SCREEN"})})},[o]);return c.a.createElement(c.a.Fragment,null,c.a.createElement(aw,{long:t.length>1}),c.a.createElement(iw,null,t.length>1&&c.a.createElement(Yy,{"aria-label":i,title:i,onClick:()=>r(Xy),type:"button","data-cy":"change-language-option"},c.a.createElement(Dn,{width:18,height:14}),i),c.a.createElement(Yy,{"aria-label":d,title:d,onClick:p,type:"button","data-cy":"restart-chat-option"},d),c.a.createElement(Yy,{"aria-label":u,title:u,onClick:()=>r(Jy),type:"button","data-cy":"delete-chat-option"},u),c.a.createElement(Yy,{"aria-label":l,title:l,onClick:()=>r(Qy),type:"button","data-cy":"download-chat-option"},l),c.a.createElement(Yy,{"aria-label":a,title:a,onClick:f,type:"button","data-cy":"back-to-chat-option",color:"1",autoFocus:!0},a)))};const cw=Ye.c.div.withConfig({displayName:"styles__SelectionContainer",componentId:"sc-1hbxmch-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;"]),lw=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1hbxmch-1"})(["max-width:100%;padding:0 15px;flex-direction:column;display:flex;align-items:center;margin:unset;button{margin-bottom:10px;&:last-child{margin-top:0;}}"]),uw=Ye.c.div.withConfig({displayName:"styles__ButtonFooter",componentId:"sc-1hbxmch-2"})(["margin-bottom:15px;button{display:block;margin:0 auto 30px;}"]);var dw=e=>{let{languages:t,currentLanguage:n,textContent:r,setOptionsView:o}=e;const[a,i]=Object(s.useState)(n);Object(s.useEffect)(()=>{i(n)},[n,i]);const l=Object(s.useCallback)(()=>o(Vy),[o]),u=Object(s.useCallback)(e=>{"Enter"===e.key&&o(Vy)},[o]),d=Ue(),{confirm_action_button:p,back_to_chat_button:f,change_language_button:h,change_language_text:m}=r;return c.a.createElement(c.a.Fragment,null,c.a.createElement(qy,null,c.a.createElement(Co,null,c.a.createElement(Dn,{width:35,height:39}),h),c.a.createElement(wo,null,m)),c.a.createElement(cw,null,c.a.createElement(lw,null,t.map(e=>c.a.createElement(yo,{key:e.code,"aria-label":e.name,title:e.name,onClick:()=>i(e.code),text:e.name,flat:e.code===a,selected:e.code===a,cy:`${e.code}-button`}))),c.a.createElement(uw,null,a!==n&&c.a.createElement(yo,{"aria-label":p,title:p,onClick:()=>{d(Vt(a))},type:"submit",text:p,color:!0}),c.a.createElement(zy,{"aria-label":f,title:f,onClick:l,onKeyUp:u,tabIndex:"0",type:"button"},"‹ ",f))))};var pw=e=>{let{setAboutChat:t}=e;const{text:n}=Ge(Vo),{languages:r,defaultLanguage:o}=vi(),{currentLanguage:a}=Ge(Xo),{chatDeleted:i}=Ge(ra),[l,u]=Object(s.useState)(i?Zy:Vy),d=Object(s.useMemo)(()=>ki(n,a,o),[a,o,n]);return c.a.createElement(Fy,null,l===Vy||l===Qy||l===Xy?c.a.createElement($y,null,l===Vy&&c.a.createElement(sw,{languages:r,textContent:d,setOptionsView:u}),l===Qy&&c.a.createElement(ow,{languages:r,textContent:d,setOptionsView:u}),l===Xy&&c.a.createElement(dw,{languages:r,textContent:d,currentLanguage:a,setOptionsView:u})):c.a.createElement(Gy,null,l===Zy&&c.a.createElement(Wy,{textContent:d}),l===Jy&&c.a.createElement(tw,{setOptionsView:u,textContent:d})),c.a.createElement(Ky,null,c.a.createElement(My,{setAboutChat:t})))};const fw=Ye.c.div.withConfig({displayName:"styles__SelectContainer",componentId:"sc-1lfni2n-0"})(["position:relative;width:fit-content;&:before{content:'';position:absolute;right:11px;top:50%;transform:translateY(-50%);width:0;height:0;z-index:1;border-top:7px solid #2c2c2c;border-left:4px solid transparent;border-right:4px solid transparent;}"]),hw=Ye.c.div.withConfig({displayName:"styles__IconContainer",componentId:"sc-1lfni2n-1"})(["position:absolute;top:10px;left:8px;svg{path{fill:#333;}}"]),mw=Ye.c.select.withConfig({displayName:"styles__Select",componentId:"sc-1lfni2n-2"})(["cursor:pointer;appearance:none;border-radius:5px;font-size:",";border:1px solid #dedede;padding:8px 30px 8px 11px;position:relative;color:#2c2c2c;background:transparent;background-color:transparent;"," ",""],Jr.fontSizeH5,e=>e.icon&&"padding-left: 30px;",Vr),gw=e=>{let{children:t,onClick:n,onChange:r,value:o,name:a,icon:i,...s}=e;return c.a.createElement(fw,null,i&&c.a.createElement(hw,null,c.a.createElement(Dn,{width:18,height:14})),c.a.createElement(mw,Object.assign({onClick:n,onChange:r,value:o,name:a,icon:i},s),t))};gw.defaultProps={icon:!1,onClick:$n,onChange:$n};var bw=gw;const vw=Ye.c.div.withConfig({displayName:"styles__WelcomePageContainer",componentId:"sc-elyt0g-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;background:#fff;background-color:#fff;"]),yw=Object(Ye.b)(["background-size:cover;background-position:center;background-image:url(",");"],e=>e.welcomePageImage),ww=Ye.c.div.withConfig({displayName:"styles__HeaderContent",componentId:"sc-elyt0g-1"})(["flex:1;height:100%;max-height:250px;padding:18px 18px 0;background:",";background-color:",";",";@media (max-height:610px){display:none;}"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,e=>e.welcomePageImage&&yw),Ew=Ye.c.div.withConfig({displayName:"styles__IntroContent",componentId:"sc-elyt0g-2"})(["flex:1;padding:15px 30px 30px;border-top:5px solid ",";@media ","{padding:30px;}@media (max-height:610px){overflow:scroll;}"],e=>e.theme.headerBackground,eo.maxTablet),xw=Ye.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-elyt0g-3"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;"]),_w=Ye.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-elyt0g-4"})(["padding:20px 0;"]),Cw=Ye.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-elyt0g-5"})(["display:flex;align-items:center;justify-content:space-between;button:first-child{@media ","{min-width:unset;}}"],eo.maxTablet),Tw=Object(Ye.c)(oo).withConfig({displayName:"styles__CloseButton",componentId:"sc-elyt0g-6"})(["display:flex;align-items:center;padding:7px;color:",";background:",";background-color:",";border-color:",";border-radius:100px;"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground),kw=Object(Ye.c)(xo).withConfig({displayName:"styles__TitleText",componentId:"sc-elyt0g-7"})(["color:",";font-weight:500;font-size:",";margin:0 0 15px;"],Xr.textColor,Jr.fontSizeH3),Ow=Ye.c.div.withConfig({displayName:"styles__IntroText",componentId:"sc-elyt0g-8"})(["color:",";max-height:180px;overflow:hidden;font-size:",";margin:30px 0 10px 0;line-height:24px;div{& >:first-child{margin-top:0;}& >:last-child{margin-bottom:0;}a{color:#0000c6;}a:visited{color:#5b096e;}}strong{font-weight:500;}"],Xr.textColor,Jr.fontSizeH5),Sw=Hv();var Iw=()=>{const[e,t]=Object(s.useState)(!1),{active:n,currentLanguage:r,optionsScreenOpen:o,feedbackFormType:a}=Ge(Xo),{welcomePage:i,welcomePageType:l,fullscreenMode:d,isTextDirectionRtl:p}=Ge(Vo),{languages:f,defaultLanguage:h}=vi(),m=Ue(),g=Object(s.useRef)(),b=document.documentElement,v=!(o||d&&a===u.NONE),y=p?"rtl":void 0;Object(s.useEffect)(()=>{n&&g.current.focus()},[n]);const w=i?((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"image"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:yi(a,t,n)}},{}))(i,r,h):{header:"",text:"",start_button:""},E=Object(s.useCallback)(()=>{t(!0),m((e,t)=>{const{token:n,feedbackFormOpen:r}=t().feedback;(n||r)&&e({type:"CLOSE_FEEDBACK_FORM"}),e({type:"SET_CHAT_HAS_STARTED",chatHasStarted:!0})}),m(Vt(r||f[0].code))},[m,r,f]),x=Object(s.useCallback)(()=>{m(e=>{e({type:"CLOSE_CHATBUBBLE"})}),b.style.overflow="unset"},[m,b]),_=Object(s.useCallback)(e=>{m(Vt(e))},[m]);return c.a.createElement(vw,null,c.a.createElement(ww,{welcomePageImage:"PICTURE"===l&&i.image},v&&c.a.createElement(No,{"aria-label":"Close chat",title:"Close chat",type:"button",onClick:x,"data-cy":"close-chat-button"},c.a.createElement(jn,{width:25,height:25}))),c.a.createElement(Ew,null,c.a.createElement(xw,{dir:y},c.a.createElement("div",null,f.length>1&&c.a.createElement(bw,{icon:!0,name:"language-select","data-cy":"language-select",value:r,onChange:e=>_(e.target.value)},f.map(e=>c.a.createElement("option",{key:e.code,label:e.name,value:e.code},e.name))),c.a.createElement(_w,null,c.a.createElement(kw,null,w.header),c.a.createElement(Ow,null,hb(w.text)))),c.a.createElement(Cw,null,c.a.createElement(yo,{cy:"start-chat-button",type:"button",title:w.start_button||"Start chat",onClick:E,size:"small",loading:e,color:!0,ref:g},w.start_button||"Start chat"),Sw&&c.a.createElement(Tw,{type:"button",title:"Close",onClick:x,flat:!0,color:!0},c.a.createElement(jn,{width:30,height:30}))))))};const Aw=Object(Ye.d)(["0%{opacity:0;}100%{opacity:1;}"]),jw=Object(Ye.b)(["",";animation-name:",";"],Cr(100),Aw),Nw=Object(Ye.d)(["0%{opacity:1;}100%{opacity:0;}"]),Mw=Object(Ye.b)(["",";animation-delay:50ms;animation-name:",";"],Cr(500),Nw),Pw=Object(Ye.b)(["",";"],e=>e.fullHeight?"top: 0; height: 100%;":"top: 55px; height: calc(100% - 55px); border-bottom-right-radius: 6px; border-bottom-left-radius: 6px"),Rw=Ye.c.div.withConfig({displayName:"styles__OverlayContainer",componentId:"sc-1xhdwt3-0"})(["width:100%;overflow:hidden;padding-bottom:5px;"," position:absolute;z-index:",";background:#fff;background-color:#fff;"," ",";"],Pw,no,e=>!e.chatViewHidden&&Tr(300),e=>e.chatViewHidden?jw:Mw),Lw=e=>{let{showAboutChat:t,setShowAboutChat:n,showCancelConfirmation:r,setShowCancelConfirmation:o}=e;const{welcomePageType:a,hideHeader:i}=Ge(Vo),{chatHasStarted:s,optionsScreenOpen:l}=Ge(Xo),{chatDeleted:u}=Ge(ra),p=!s&&a!==d.NONE,f=l||p||r||t||u;return c.a.createElement(Rw,{chatViewHidden:f,fullHeight:i||p},t&&!r&&c.a.createElement(Iy,{setAboutChat:n}),r&&c.a.createElement(Uy,{setCancelChat:o}),p&&c.a.createElement(Iw,null),(l||u)&&c.a.createElement(pw,{setAboutChat:n}))};Lw.defaultProps={fullHeight:!1,color:"#ffffff"};var Dw=Lw;const Bw=Ye.c.div.withConfig({displayName:"styles__Container",componentId:"sc-109olta-0"})(["display:flex;flex-direction:column;align-items:center;background:",";background-color:",";padding:1px 0 0;"," span{background:",";background-color:",";width:90%;height:1px;z-index:21;}"],e=>e.theme.background,e=>e.theme.background,co,_r(.1,Xr.grayColor),_r(.1,Xr.grayColor)),Hw=Ye.c.form.withConfig({displayName:"styles__Contents",componentId:"sc-109olta-1"})(["display:flex;flex-direction:column;width:100%;padding:0 24px 20px;input{margin-right:24px;border:1px solid rgba(0,0,0,0);:focus{border:1px solid rgba(0,0,0,0);}:invalid{","}}"],e=>{let{hasSubmitted:t}=e;return t&&"border-color: red;"}),Uw=Object(Ye.c)(oo).withConfig({displayName:"styles__CloseButton",componentId:"sc-109olta-2"})(["min-height:25px;display:flex;align-items:center;font-size:",";padding:0;:hover{opacity:0.8;}"],Jr.fontSizeH4),zw=Ye.c.div.withConfig({displayName:"styles__Header",componentId:"sc-109olta-3"})(["display:flex;margin:4px 0 5px;color:",";font-size:",";align-items:center;"],e=>{let{theme:t}=e;return jf(t.background,"white","black")},Jr.fontSizeP),Fw=Ye.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-109olta-4"})(["display:flex;justify-content:space-between;align-items:center;button:first-child{margin-right:8px;}div + button{margin-left:12px;}"]),$w=Ye.c.input.withConfig({displayName:"styles__Input",componentId:"sc-109olta-5"})(["",""],so),Gw=Object.freeze({EMAIL:"email",PHONE:"phone_number"}),qw=(e,t)=>{const n=Ue(),{contactDetailsButton:r}=Ge(Xo),[o,a]=Object(s.useState)(""),[i,u]=Object(s.useState)(!1),d=Object(s.useRef)(),p=Object(Ye.e)(),f=r.contact_details.contact_type,{label:h,placeholder:m}=r.contact_details,g=Object(s.useMemo)(()=>jf(p.background,Xr.grayColor,Xr.darkColor),[p.background]);function v(){n(Jt())}return c.a.createElement(Bw,{ref:t},c.a.createElement("span",null),c.a.createElement(Hw,{hasSubmitted:i},c.a.createElement(zw,null,f&&c.a.createElement(Uw,{"aria-label":"Cancel entering details",title:"Cancel entering details",type:"button",onClick:v,"data-cy":"minimize-chat-button",mobileOnly:!0},c.a.createElement(jn,{width:25,height:12,stroke:g})),h),c.a.createElement(Fw,null,c.a.createElement(ao,null,c.a.createElement($w,{onChange:function(e){a(e.target.value)},value:o,type:f===Gw.EMAIL?"email":"tel",ref:d,placeholder:m,required:!0})),c.a.createElement(vy,{onClick:function(e){var t,a;return u(!0),!(null==d||null===(t=d.current)||void 0===t||null===(a=t.validity)||void 0===a||!a.valid)&&(e.preventDefault(),n(((e,t)=>async(n,r)=>{const{connection:{token:o},environment:{PAT_HOST:a,VERSION:i}}=r(),s=nt()(),c=e.contact_details.contact_type,u={...e,button_type:b.edit_contact_details};n({type:Je,data:{id:s,created:(new Date).toISOString(),message:t,buttons:[u],isContactDetails:!0}});const d=await n(Dt()),{headers:p}=st({token:o},{withCurrentUrl:!0,extra:d}),f={contactType:c,value:t,version:i,buttons:[u],temporaryId:s},h=await n(bt({method:"post",url:`${a}/chatbubble/${l.a}/button/contact-details/`,data:f,headers:p}));rn(h)||n({type:"UPDATE_CHAT_MESSAGE",...h.data})})(r,o)),v(),!1)},type:"submit",active:!0},c.a.createElement(Rn,{width:18,height:18})))))};var Yw=Object(s.forwardRef)(qw);const Kw=Object(Ye.d)(["0%{opacity:0;transform:translateY(-6px);}60%{transform:translateY(2px);}100%{opacity:1;transform:translateY(0);}"]),Ww=Object(Ye.b)(["",";animation-name:",";"],Cr(),Kw),Vw=Ye.c.div.withConfig({displayName:"styles__AlertContainer",componentId:"sc-efv8qo-0"})(["z-index:25;margin:15px;display:flex;padding:10px 15px;padding-right:10px;justify-content:space-between;border-radius:6px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";position:absolute;left:0;right:0;top:0;transition:top 150ms ease;",";",";"],Xr.shadowColor,e=>!e.isOnTop&&"top: 55px",Ww),Xw=Ye.c.div.withConfig({displayName:"styles__AlertContent",componentId:"sc-efv8qo-1"})(["padding-right:5px;"]),Qw=Object(Ye.c)(wo).withConfig({displayName:"styles__ContentText",componentId:"sc-efv8qo-2"})(["margin:0;"]),Jw=Object(Ye.c)(ro).withConfig({displayName:"styles__ContentLink",componentId:"sc-efv8qo-3"})(["font-size:14px;font-weight:500;margin-top:5px;display:block;color:",";"],Xr.primaryColor),Zw=Object(Ye.c)(oo).withConfig({displayName:"styles__AlertDismiss",componentId:"sc-efv8qo-4"})(["z-index:15;display:flex;padding:0;height:fit-content;align-content:flex-start;flex-direction:column;&:hover{opacity:0.8;}svg path{stroke:",";}"],e=>e.theme.buttonBackground);var eE=()=>{const{welcomePageType:e}=Ge(Vo),{chatHasStarted:t,optionsScreenOpen:n}=Ge(Xo),{linkLocation:r,linkText:o,textContent:a}=Ge(ta),i=Ue(),s=!t&&e!==d.NONE||n;return c.a.createElement(Vw,{isOnTop:s},c.a.createElement(Xw,null,c.a.createElement(Qw,null,a),r&&o&&c.a.createElement(Jw,{href:r,target:"_blank",rel:"noopener noreferrer"},o)),c.a.createElement(Zw,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:e=>{e.stopPropagation(),i((e,t)=>{const{show:n}=t().maintenanceAlert;n&&e({type:"DISMISS_MAINTENANCE_ALERT"})})},type:"button"},c.a.createElement(jn,{width:20,height:20,color:"#000"})))};const tE=Hv();const nE=Hv();var rE=e=>{let{bodyBottomElement:t,bodyElement:n,newMessage:r,bodyTopElement:o,groupRef:a}=e;const{chatMessages:i}=Ge(na),{isTyping:c}=Ge(Vo),{isTyping:l}=Ge(Yo),[u,d]=Object(s.useState)(!1),[p,f]=Object(s.useState)(!0),h=Boolean(r)||c||l,m=h&&Boolean(r&&r.from_bot),v=Object(s.useCallback)(((e,t)=>()=>{var n,r;if(!e.current)return!0;const o=null!==(n=null==t||null===(r=t.current)||void 0===r?void 0:r.clientHeight)&&void 0!==n?n:0,{scrollTop:a,offsetHeight:i,scrollHeight:s}=e.current;return o>0||a+i>=s-1})(n,t),[t,n]),y=Object(s.useCallback)(((e,t)=>()=>{if(!e.current||!t.current)return!0;const{scrollTop:n,scrollHeight:r}=e.current,{offsetHeight:o}=t.current;return!(r-n-30>=o)})(n,a),[t,n]),w=Object(s.useCallback)(((e,t)=>()=>{t.current&&0!==e.current.scrollHeight&&(nE?setTimeout(()=>{t.current.scrollIntoView()},300):t.current.scrollIntoView())})(n,t),[t,n]),E=Object(s.useCallback)(((e,t)=>()=>{t.current&&0!==e.current.scrollHeight&&(nE?setTimeout(()=>{t.current.scrollIntoView()},300):t.current.scrollIntoView())})(n,o),[o,n]);Object(s.useEffect)(()=>{0===i.length&&f(!0)},[i]),Object(s.useEffect)(()=>{var e,t;const n=(null==r||null===(e=r.buttonType)||void 0===e?void 0:e.toUpperCase())===b.QUICK_REPLY,o=(null==r||null===(t=r.handler)||void 0===t?void 0:t.toUpperCase())===g.TRIGGER_DIALOGUE;(n||o)&&E()},[r,E]);const x=((e,t)=>{const n=Object(s.useRef)(),r=Object(s.useRef)(),o=Object(s.useCallback)(()=>{r&&r.current&&clearTimeout(r.current)},[]),a=Object(s.useCallback)((function(){o();for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];n.current=i,r.current=setTimeout(()=>e(...n.current),t)}),[o,t,e]);return Object(s.useEffect)(()=>o,[o]),a})(Object(s.useCallback)(()=>{v()||y()?(f(!0),d(!1)):f(!1)},[v,y]),300);return Object(s.useEffect)(()=>{!v()&&p&&(r&&function(){let{from_bot:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!e}(r)?w():E())},[n,v,h,r,w,E,p]),Object(s.useEffect)(()=>{!m||u||v()||d(!0)},[v,m,u]),{shouldAutoScroll:p,scrollToBottom:w,scrollToLatestMessage:E,onUserScroll:x,hasUnreadMessage:u,isScrolledDown:v}};var oE=e=>{let{buttonHandlers:t,onMessage:n=null}=e;const r=Object(s.useRef)(null),o=Object(s.useRef)(null),a=Object(s.useRef)(null),i=Object(s.useRef)(null),{hideHeader:l,fullscreenMode:u,offsetHeight:d}=Ge(Vo),{show:p,textContent:f}=Ge(ta),{active:h,chatHasStarted:m,currentlyPoppedUp:g,contactDetailsButton:b,renderedBy:v}=Ge(Xo),{chatMessages:y}=Ge(na),w=(e=>{const t=em(e),n=(e||[]).length;return Object(s.useMemo)(()=>n&&n!==(t||[]).length&&e[n-1],[e,n,t])})(y),{scrollToBottom:E,scrollToLatestMessage:x,shouldAutoScroll:_,onUserScroll:C,hasUnreadMessage:T,isScrolledDown:k}=rE({bodyBottomElement:o,bodyTopElement:a,bodyElement:r,newMessage:w,groupRef:i}),O=em(h);Object(s.useEffect)(()=>{h&&!O&&T&&E()},[T,h,E,O]);const[S,I]=Object(s.useState)(!0);Object(s.useEffect)(()=>{S?I(!1):function(e,t,n,r){e&&Ve("message",{newMessage:e,chatLog:t},r,n)}(Af(w||{}),y.map(Af),n,v)},[S,n,w,y,v]);const A=(e=>{const[t,n]=Object(s.useState)(!1),r=em(e);return Object(s.useEffect)(()=>{!e&&r&&n(!0)},[e,r]),t})(h),{showAboutChat:j,setShowAboutChat:N}=Py(h),{showCancelConfirmation:M,setShowCancelConfirmation:P}=(e=>{const[t,n]=Object(s.useState)(!1);return Object(s.useEffect)(()=>{t&&!e&&n(!1)},[e,t]),{showCancelConfirmation:t,setShowCancelConfirmation:n}})(h),{autoFocus:R,autoFocused:L}=(e=>{let{currentlyPoppedUp:t}=e;const[n,r]=Object(s.useState)(!1);return Object(s.useEffect)(()=>{n&&r(!1)},[n]),{autoFocus:Object(s.useCallback)(()=>{n||tE||t||r(!0)},[n,t]),autoFocused:n}})({currentlyPoppedUp:g}),D=Object(s.useCallback)(()=>{E(),R()},[R,E]);return c.a.createElement(Th,{chatHasStarted:m,active:h,"aria-hidden":h?"false":"true","data-testid":"chat-box","data-cy":"chat-box",offsetHeight:d,fullscreen:u?1:0},c.a.createElement(qo,{errorPoint:"inside ChatBoxContainer"},!l&&c.a.createElement(_y,{cancelChat:M,setCancelChat:P}),c.a.createElement(Dw,{showAboutChat:j,setShowAboutChat:N,showCancelConfirmation:M,setShowCancelConfirmation:P}),c.a.createElement(am,null),p&&f&&c.a.createElement(eE,null),c.a.createElement(Mv,{setAboutChat:N,hasUnreadMessage:T,onShowLatest:D,shouldAnimate:A,setBottomRef:o,setGroupRef:i,setTopRef:a,setBodyRef:r,scrollToBottom:E,scrollToLatestMessage:x,shouldAutoScroll:_,onUserScroll:C,buttonHandlers:t}),b?c.a.createElement(Yw,null):c.a.createElement(xy,{active:h,chatHasStarted:m,onManualFocus:E,isScrolledDown:k,autoFocused:L,currentlyPoppedUp:g})))};function aE(){const e=Ue(),{currentLanguage:t,active:n}=Ge(Xo),{maintenanceAlertEnabled:r,maintenanceAlert:o}=Ge(Vo),{defaultLanguage:a}=vi();Object(s.useEffect)(()=>{if(!n||!r)return;const i=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"alert_enabled"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:yi(a,t,n)}},{}))(o,t,a);var s;e((s=i,(e,t)=>{const{link_text:n,link_location:r,text_content:o}=s,{dismissed:a}=t().maintenanceAlert;a||setTimeout(()=>e({type:"SHOW_MAINTENANCE_ALERT",linkText:n,linkLocation:r,textContent:o}),2e3)}))},[n,t,e,o,r,a])}var iE=e=>{let{botKey:t,persistStateLifespan:n}=e;const r=localStorage.getItem(`kindly-chat-${t}`);if(r){var o,a;const e=null===(o=JSON.parse(r))||void 0===o||null===(a=o.messages)||void 0===a?void 0:a.messageSentTime;if(-1===n)return!0;if(0!==n){return function(e,t){im(2,arguments);var n=sm(e),r=sm(t);return n.getTime()>r.getTime()}(function(e,t){im(2,arguments);var n=vm(t);return ym(e,1e3*n)}(ig(e),n),new Date)}}return!1};function sE(){const e=Ue(),{botKey:t}=Ge(Xo),{persistStateLifespan:n}=Ge(Vo),{chatMessages:r}=Ge(na);Object(s.useEffect)(()=>{const o=iE({botKey:t,persistStateLifespan:n});0===n||o||0===r.length||e((e=>(t,n)=>{const{chatHasStarted:r}=n().chatbubble;t({type:Xe,botKey:e}),r&&t(Yt())})(t))},[t,e,n,r])}const cE=Object.freeze({en:e=>`New message from ${e}`,nb:e=>`Ny melding fra ${e}`,sv:e=>`Nytt meddelande från ${e}`}),lE=Object.freeze({en:"An agent joined the conversation",nb:"En agent ble med i samtalen",sv:"En agent gick med i samtalet"});let uE=!1;function dE(e){const t=document.title;let n;n||uE||(uE=!0,n=setInterval(()=>{document.title=document.title===e?t:e},1e3),window.addEventListener("mousemove",(function e(){clearInterval(n),document.title=t,n=null,uE=!1,window.removeEventListener("mousemove",e)})))}var pE=(e,t)=>Boolean((e=>{const t=e.replace(/\./g,"\\.").replace(/\*/g,".").replace(/\//g,"\\/").replace(/\?/g,"\\?");return new RegExp(t,"i")})(t).test(e));function fE(){var e;const t=Ue(),[n,r]=Object(s.useState)("/"),{currentLanguage:o,active:a}=Ge(Xo),{nudges:i}=Ge(Vo),{defaultLanguage:c}=vi(),l=null!==(e=null==i?void 0:i.textNudges)&&void 0!==e?e:[];Object(s.useEffect)(()=>{r(window.location.href),!a&&o&&(null==l?void 0:l.length)>0&&(null!=l?l:[]).forEach(e=>!(!pE(n,e.url_trigger)||!e.enabled[o])&&t((e=>{let{nudge:t,languageCode:n}=e;return e=>{const{autopopupTime:r}=t,o=xn(t,n);r&&0!==r?setTimeout(()=>e({type:"SHOW_NUDGE",nudgeLayout:o}),r):e({type:"SHOW_NUDGE",nudgeLayout:o})}})({nudge:e,languageCode:o})))},[a,o,c,t,n,i,l])}var hE=()=>{const{takenOver:e,requestedTakeover:t}=Ge(Yo),n=em(e),r=em(t),o=Ue();Object(s.useEffect)(()=>{e&&!n?o((e,t)=>{const{takeoverPollIntervalId:n,takeoverRequestPollIntervalId:r,replyTimeoutId:o}=t().websocketFallback;if(clearTimeout(o),clearTimeout(r),e({type:"RESET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT"}),e({type:"RESET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL"}),n)return;const a=setInterval(()=>e(St()),h.TAKEOVER_POLL_INTERVAL_MS);e({type:"SET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL",takeoverPollIntervalId:a})}):!e&&n&&o((e,t)=>{const{takeoverPollIntervalId:n}=t().websocketFallback;clearInterval(n),e({type:"RESET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL"})}),t&&!r?o((e,t)=>{const{takeoverRequestPollIntervalId:n}=t().websocketFallback;if(n)return;const r=setInterval(()=>e(St()),h.TAKEOVER_REQUEST_POLL_INTERVAL_MS);e({type:"SET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL",takeoverRequestPollIntervalId:r})}):!t&&r&&o((e,t)=>{const{takeoverRequestPollIntervalId:n}=t().websocketFallback;clearInterval(n),e({type:"RESET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL"})})},[o,r,n,t,e])},mE=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return t.split(".").reduce((e,t)=>e?e[t]:void 0,e)||n};const gE=e=>({[e]:i.a.func});i.a.shape({...T(gE,Object.values(b)),...T(gE,Object.values(b).map(Ni))});let bE=null;async function vE(){try{if(!bE){const{default:e}=await n.e(1).then(n.t.bind(null,71,7));bE=new Audio(e)}await bE.play()}catch(e){console.error("Could not play notification sound:",e)}}var yE=e=>{let{settings:t}=e;const n=Ue(),r=Object(s.useRef)(null),{active:o}=Ge(Xo),{open:a,imageUrl:i}=Ge(aa),{inspectorOpen:l}=Ge(Zo),{chatMessages:u}=Ge(na),{takenOver:d}=Ge(Yo),p=em(d),f=em(u),h=localStorage.getItem("kindly-chat-restart-message"),m=mE(t,"fullscreenMode",!1),g=mE(t,"zIndex",5e3),b={...C,...mE(t,"position",{})},v=document.documentElement;Object(s.useEffect)(()=>{Hv()&&(v.style.overflow=o?"hidden":"unset")},[o,v]),Object(s.useEffect)(()=>{if(0===(null==f?void 0:f.length)&&1===(null==u?void 0:u.length)&&h){const{message:e,exchangeId:t,newContext:r}=JSON.parse(h);localStorage.removeItem("kindly-chat-restart-message"),n(pn(e,t,r))}},[n,u,f,h]),Object(s.useEffect)(()=>{p!==d&&d&&vE()},[p,d]),function(){const{tabNotification:e,name:t}=Ge(Vo),{showTabNotification:n}=Ge(Ko),{currentLanguage:r}=Ge(Xo),{takenOver:o}=Ge(Yo),{agent:a}=Ge(oa),i=em(o);Object(s.useEffect)(()=>{if(e&&n){var o;dE((null!==(o=null==cE?void 0:cE[r])&&void 0!==o?o:cE.en)(t||"Kindly"))}},[r,e,n,t]),Object(s.useEffect)(()=>{const e=Boolean(null==a?void 0:a.name);if(i!==o&&o&&e){var t;dE(null!==(t=null==lE?void 0:lE[r])&&void 0!==t?t:lE.en)}},[o,a,i,r])}(),sE(),fE(),aE(),hE(),function(e){const t=Object(s.useCallback)(t=>{e&&"Tab"===t.key&&e.current.classList.add("using-tab")},[e]),n=Object(s.useCallback)(()=>{e&&e.current.classList.remove("using-tab")},[e]);Object(s.useEffect)(()=>(document.body.addEventListener("keyup",t),document.body.addEventListener("mousedown",n),()=>{document.body.removeEventListener("keyup",t),document.body.removeEventListener("mousedown",n)}),[t,n])}(r);const y=Object(s.useCallback)(()=>{n(e=>{e({type:"CLOSE_LIGHT_BOX"})})},[n]),w=Object(s.useMemo)(()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[on(n)]:r}},{})}(t.buttonHandlers),[t.buttonHandlers]);return c.a.createElement(dh,{id:"chatContainer",ref:r,className:"chat-container",role:"complementary",active:o,zIndex:g,fullscreen:m?1:0,position:b,"data-cy":"chat-box-container"},a&&c.a.createElement(fh,{zIndex:g,onClick:y,autoFocus:!0},c.a.createElement(ph,{zIndex:g,onClick:y,autoFocus:!0},c.a.createElement(jn,{width:"30",height:"30"})),c.a.createElement(hh,{src:i})),o&&c.a.createElement(oE,{buttonHandlers:w,onMessage:t.onMessage}),l&&c.a.createElement(tm,null))};i.a.shape({name:i.a.string.isRequired,avatar:i.a.string.isRequired});const wE=Ye.c.div.withConfig({displayName:"styles__PushMessageContainer",componentId:"sc-na2ous-0"})(["right:40px;bottom:50px;z-index:",";position:fixed;border-radius:14px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";",";@media ","{margin-left:20px;","}"],e=>e.zIndex,Xr.shadowColor,Ur,eo.maxTablet,e=>{let{bubbleSize:t}=e;return"SMALL"===t?"\n right: 30px;\n bottom: 30px;\n ":"\n bottom: 55px;"}),EE=Ye.c.div.withConfig({displayName:"styles__PushMessageInner",componentId:"sc-na2ous-1"})(["padding:15px 20px;width:max-content;max-width:360px;min-width:130px;padding-right:60px;@media ","{width:unset;max-width:100%;}"],eo.maxPhone),xE=Ye.c.div.withConfig({displayName:"styles__ContentContainer",componentId:"sc-na2ous-2"})(["display:flex;cursor:pointer;align-items:center;"]),_E=Ye.c.div.withConfig({displayName:"styles__AgentAvatar",componentId:"sc-na2ous-3"})(["width:29px;height:29px;min-width:29px;border-radius:100px;margin-right:15px;background:",";background-position:center;background-size:cover;background-color:",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),CE=Ye.c.div.withConfig({displayName:"styles__ContentText",componentId:"sc-na2ous-4"})(["margin:0;color:",";font-size:",";font-weight:normal;line-height:24px;font-family:",";span{font-weight:500;}p{margin:0;}@media ","{font-size:14px;}"],Xr.darkColor,Jr.fontSizeH5,Kr.default,eo.maxTablet),TE=Object(Ye.c)(oo).withConfig({displayName:"styles__PushMessageDismiss",componentId:"sc-na2ous-5"})(["top:-8px;left:-8px;z-index:",";display:flex;padding:0;border-radius:100px;background:",";background-color:",";position:absolute;&:hover{opacity:0.8;}"],e=>e.zIndex,e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground},e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground}),kE=Hv(),OE=e=>{let{agent:t,text:n}=e;return Object(s.useEffect)(()=>{vE()},[]),c.a.createElement(xE,null,c.a.createElement(_E,{style:{backgroundImage:`url(${t.avatar})`}}),c.a.createElement(CE,null,c.a.createElement("span",null,t.name)," ",n))},SE=e=>{let{text:t}=e;return c.a.createElement(xE,null,c.a.createElement(CE,{dangerouslySetInnerHTML:{__html:t}}))};var IE=e=>{let{settings:t}=e;const{bubbleSize:n}=Ge(Vo),{agent:r,show:o,text:a,type:i}=Ge(oa),l=Ue(),u=mE(t,"zIndex",15),d=Object(Ye.e)(),p=Object(s.useMemo)(()=>jf(d.bubbleButtonBackground||d.buttonBackground,"#fff","#000"),[d.bubbleButtonBackground,d.buttonBackground]);return a?c.a.createElement(wE,{bubbleSize:n,"aria-hidden":o?"false":"true","aria-label":"Chat bot push message",onClick:()=>l(Qt()),role:"complementary",zIndex:u},c.a.createElement(TE,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:e=>{e.stopPropagation(),l((e,t)=>{const{show:n}=t().pushMessages;n&&e({type:"DISMISS_PUSH_MESSAGE"})})},type:"button"},c.a.createElement(jn,{stroke:p,width:kE?20:25,height:kE?20:25})),c.a.createElement(EE,null,"message"===i&&c.a.createElement(SE,{text:a}),"takeover"===i&&c.a.createElement(OE,{agent:r,text:a}))):null};const AE=Object(Ye.b)(["#chatContainer.using-tab &{outline-color:rgb(77,144,254);outline-offset:-2px;outline-style:auto;outline-width:5px;}"]),jE=Object(Ye.b)(["z-index:15;transition:all 0.2s ease;",";"],e=>e.active&&"transform: rotate(45deg);"),NE=Object(Ye.c)(In).withConfig({displayName:"styles__BubbleButton",componentId:"sc-1elsepj-0"})(["&&&{",";overflow:visible;path{stroke-width:2px;stroke:",";fill:",";transition:stroke 0.15s ease;}}"],jE,e=>{let{active:t,bubbleOutline:n,theme:r,stroke:o}=e;return o||(!t&&n?r.bubbleButtonOutline:r.bubbleButtonBackground||r.buttonBackground)},e=>{let{theme:t,background:n}=e;return n||(t.bubbleButtonBackground||t.buttonBackground)}),ME=Ye.c.button.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1elsepj-1"})(["z-index:10;overflow:visible;display:flex;justify-content:center;align-items:center;flex-direction:column;cursor:pointer;height:50px;width:50px;padding:9px 8px;text-align:center;border-radius:50%;border:2px solid ",";box-shadow:"," ",";background:",";",";transition:all 0.25s ease;"," @media (max-width:768px){","}:focus{",";}:hover{background:",";}:focus ","{",";}"," path{",";",";}"],e=>{let{bubbleOutline:t,theme:n,background:r}=e;return r||(t?n.bubbleButtonOutline:n.bubbleButtonBackground||n.buttonBackground)},e=>e.active?"0px 1px 5px 1px":"1px 0px 7px 7px",Xr.shadowColorDark,e=>{let{theme:t,background:n}=e;return n||t.bubbleButtonBackground||t.buttonBackground},e=>{let{background:t}=e;return t?`border-color: ${t}`:void 0},Vr,e=>{let{smallBubble:t}=e;return t&&"\n height: 30px;\n width: 30px;\n\n svg {\n width: 45px;\n }\n "},e=>{let{active:t}=e;return!t&&"outline: none;"},e=>{let{background:t,theme:n}=e;return t||n.bubbleButtonBackground||n.buttonBackground},NE,e=>{let{active:t}=e;return!t&&AE},NE,e=>{let{background:t}=e;return t?`stroke: ${t}`:""},e=>{let{background:t}=e;return t?`fill: ${t}`:""}),PE=Object(Ye.b)(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);"]),RE=Ye.c.div.withConfig({displayName:"styles__LogoContainer",componentId:"sc-1elsepj-2"})([""," opacity:1;width:calc(100% - 20px);height:calc(100% - 20px);background-size:contain;background-repeat:no-repeat;background-position:center top;background-image:url(",");transition:all 0.2s ease;",";"],PE,e=>e.bubbleAvatar,e=>e.active&&"opacity: 0;"),LE=Ye.c.div.withConfig({displayName:"styles__IconContainer",componentId:"sc-1elsepj-3"})(["",""],PE),DE=Object(Ye.c)(Pn).withConfig({displayName:"styles__MinimizeButton",componentId:"sc-1elsepj-4"})(["z-index:20;"," opacity:0;transition:all 0.2s ease;",";"],PE,e=>e.active&&"opacity: 1;");var BE=n(41),HE=n.n(BE);const UE=Ye.c.img.withConfig({displayName:"styles__ChristmasBubbleButton",componentId:"sc-11ugteh-0"})(["z-index:15;position:absolute;top:-22px;left:2px;width:84px;opacity:1;transform:rotate(10deg);transition:all 0.2s ease;",";path{fill:",";}"],e=>e.active&&"\n transform: rotate(32deg);\n width: 51px;\n top: -20px;\n left: 9px;\n ",e=>{let{theme:t,active:n}=e;return n?t.bubbleButtonBackground||t.buttonBackground:""});var zE=e=>{let{active:t,bubbleOutline:n}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement(LE,null,c.a.createElement(UE,{src:HE.a,active:t?1:0}),c.a.createElement(NE,{active:t?1:0,bubbleOutline:n?1:0,width:t?33:65,height:t?35:67})))};const FE=Ye.c.svg.withConfig({displayName:"styles__EarFront",componentId:"sc-106df1-0"})(["z-index:15;position:absolute;top:-22px;left:32px;width:31px;height:38px;opacity:1;&:focus{outline:none;}transition:all 0.2s ease;",";"],e=>e.active&&"\n width: 18px;\n height: 23px;\n top: -6px;\n left: 29px;\n "),$E=Ye.c.svg.withConfig({displayName:"styles__EarBack",componentId:"sc-106df1-1"})(["position:absolute;top:-26px;left:24px;width:31px;height:38px;opacity:1;z-index:-1;transition:all 0.2s ease;",";"],e=>e.active&&"\n width: 12px;\n height: 15px;\n top: -8px;\n left: 31px;\n "),GE=Ye.c.svg.withConfig({displayName:"styles__EyesNose",componentId:"sc-106df1-2"})(["z-index:15;position:absolute;top:24px;left:-2px;width:29px;height:24px;opacity:1;transform:rotate(0deg);transition:all 0.2s ease;",";"],e=>e.active&&"\n opacity: 0;\n top: 3px;\n left: -8px;\n width: 19px;\n height: 14px;\n transform: rotate(45deg);\n ");var qE=e=>{let{active:t,bubbleOutline:n}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement($E,{width:"31px",height:"38px",viewBox:"0 0 31 38",active:t?1:0},c.a.createElement(Un,null)),c.a.createElement(FE,{width:"31px",height:"38px",viewBox:"0 0 31 38",active:t?1:0},c.a.createElement(zn,null)),c.a.createElement(LE,null,!t&&c.a.createElement(GE,{width:"29px",height:"24px",viewBox:"0 0 29 24",active:t?1:0},c.a.createElement(Fn,null)),c.a.createElement(NE,{active:t?1:0,bubbleOutline:n?1:0,width:t?33:65,height:t?35:67,background:"#FFCA3A",stroke:"#FFCA3A"})))};const YE=Object(Ye.c)(An).withConfig({displayName:"styles__PrideBubbleButton",componentId:"sc-1a5n29u-0"})(["",";path{fill:",";}",":focus &{",";}"],jE,e=>{let{theme:t,active:n}=e;return n?t.bubbleButtonBackground||t.buttonBackground:""},ME,e=>{let{active:t}=e;return!t&&AE});var KE=e=>{let{active:t}=e;return c.a.createElement(LE,null,c.a.createElement(YE,{active:t?1:0,width:t?35:65,height:t?37:67}))};var WE=e=>{let{active:t,season:n,bubbleOutline:r,children:o}=e;return n===x.PRIDE?c.a.createElement(KE,{active:t}):n===x.EASTER?c.a.createElement(qE,{active:t,bubbleOutline:r}):n===x.CHRISTMAS?c.a.createElement(zE,{active:t,bubbleOutline:r}):c.a.createElement(LE,null,c.a.createElement(NE,{active:t?1:0,bubbleOutline:r?1:0,width:t?33:65,height:t?35:67}),o)};var VE=e=>{let{title:t,active:n,onClick:r}=e;const{seasonalAppearance:o,bubbleOutline:a,bubbleSize:i,bubbleAvatar:s}=Ge(Vo),l=(e=>{if(e===x.EASTER)return"#ffca3a"})(o);return c.a.createElement(ME,{"aria-label":t,"aria-controls":"chat-box","aria-labelledby":"chat-bubble-chat-button",title:t,type:"button",active:n,onClick:r,"data-cy":"chat-bubble-button","data-testid":"chat-button",bubbleOutline:a?1:0,seasonalAppearance:o?1:0,background:l,smallBubble:"SMALL"===i},c.a.createElement(WE,{active:n,season:o,bubbleOutline:a},s?c.a.createElement(RE,{bubbleAvatar:s,active:n,"data-cy":"chat-bubble-logo-container"}):void 0),c.a.createElement(DE,{active:n,width:22,height:11}))};function XE(){const e=Ue(),{currentLanguage:t,active:n,chatHasStarted:r}=Ge(Xo),{pushGreetingsEnabled:o,pushGreetings:a}=Ge(Vo),{defaultLanguage:i}=vi();Object(s.useEffect)(()=>{if(!o||!a||n||!t||r)return;const s=window.location.href;a.forEach(n=>{if(pE(s,n.url)&&n.enabled[t]){const r=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"url"!==t&&"autopopup_time"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:yi(a,t,n)}},{}))(n,t,i);return r.autopopupTime=n.autopopup_time,e((e=>(t,n)=>{const{dismissedMessages:r}=n().pushMessages,{autopopupTime:o,enabled:a,title:i,message:s}=e;if(!a||Object(O.a)(i,r))return;const c={type:"SHOW_PUSH_MESSAGE",pushMessageTitle:i,pushMessageType:En,pushMessageText:s};o&&0!==o?setTimeout(()=>t(c),o):t(c)})(r))}return!1})},[n,t,i,o,a,e,r])}const QE=function(e){let{retries:t=6,interval:n=300,intervalBackoffMultiplier:r=2}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((o,a)=>{e({retriesLeft:t,interval:n,intervalBackoffMultiplier:r}).then(o).catch(i=>{setTimeout(()=>{t<=1?a(i):QE(e,{retries:t-1,interval:n*r,intervalBackoffMultiplier:r}).then(o,a)},n)})})};var JE=QE;function ZE(e){const t=Ue(),{token:n,pusherConnected:r,connectTriggerConfig:o}=Ge(Qo),{takenOver:a}=Ge(Yo),{persistStateLifespan:i}=Ge(Vo),{botKey:c,active:l,disabledTransports:u,chatHasStarted:p,wasActiveOnLoad:f,inPlatform:h,userIsIdle:m,error:g}=Ge(Xo),{chatMessages:b,messageSentTime:v}=Ge(na),[y,w]=Object(s.useState)(!1),[E,x]=Object(s.useState)(!1),_=localStorage.getItem(`kindly-chat-${c}`);Object(s.useEffect)(()=>(window.addEventListener("online",()=>t((e,t)=>{const{connected:n}=t().connection;n||e({type:"CONNECTED"})})),window.addEventListener("offline",()=>t((e,t)=>{const{connected:n}=t().connection;n&&e({type:"DISCONNECTED"})})),()=>{window.removeEventListener("online",()=>t((e,t)=>{const{connected:n}=t().connection;n||e({type:"CONNECTED"})})),window.removeEventListener("offline",()=>t((e,t)=>{const{connected:n}=t().connection;n&&e({type:"DISCONNECTED"})}))}),[t]),Object(s.useEffect)(()=>{const n=e.welcomePage.type!==d.NONE;!p&&f&&!n&&t({type:"SET_CHAT_HAS_STARTED",chatHasStarted:!0})}),Object(s.useEffect)(()=>{l&&p&&!r&&(w(!0),403!==g||n||t(Yt()))},[l,p,t,g,r,n]),Object(s.useEffect)(()=>{o&&t(Yt(o))},[o,t]),Object(s.useEffect)(()=>{r&&o&&t(Kt())},[o,t,r]),Object(s.useEffect)(()=>{if(l&&p&&!r&&!(y||m||o)){const e=iE({botKey:c,persistStateLifespan:i});!n||0===b.length&&!p?t(Yt()):e&&qt(n,u)}},[y,l,o,r,n,u,t,b.length,p,m,g,v,i,_,c]),Object(s.useEffect)(()=>{y&&r&&w(!1)},[y,r]),Object(s.useEffect)(()=>{if(r&&m&&!a){(e=>{const t=`private-chatbubble-${e}`;Object(Qe.unsubscribe)(t,"message",Je),Object(Qe.unsubscribe)(t,"takeover","TAKEOVER"),Object(Qe.unsubscribe)(t,"agent_started_typing","AGENT_STARTED_TYPING"),Object(Qe.unsubscribe)(t,"agent_stopped_typing","AGENT_STOPPED_TYPING"),Object(Qe.unsubscribe)(t,"pattern-context-match","PATTERN_CONTEXT_MATCH"),Object(Qe.unsubscribe)(t,"spell-correction","SPELL_CORRECTION"),Object(Qe.unsubscribe)(t,"message-attachments-updated","MESSAGE_ATTACHMENTS_UPDATED"),Object(Qe.unsubscribe)(t,"new-attachments","NEW_ATTACHMENTS")})(n);try{Object(Qe.disconnect)()}catch{}}},[m,r,a,n]),Object(s.useEffect)(()=>(l&&!h&&e.chatbubble.realtime_analytics&&t($t(e.id)),Gt),[l,t,h,e]),Object(s.useEffect)(()=>{n&&l&&!E&&(t(St()),x(!0))},[l,t,E,n])}const ex=Ye.c.div.withConfig({displayName:"styles__ChatButtonContainer",componentId:"sc-18sln6s-0"})(["position:fixed;bottom:calc(",");right:calc(",");z-index:",";",";"],e=>{var t,n;return`${null!==(t=null===(n=e.position)||void 0===n?void 0:n.bottom)&&void 0!==t?t:C.bottom} + 10px`},e=>{var t,n;return`${null!==(t=null===(n=e.position)||void 0===n?void 0:n.right)&&void 0!==t?t:C.right} + 10px`},e=>e.zIndex,e=>e.inPlatform&&"display:flex; align-items: center"),tx=Ye.c.div.withConfig({displayName:"styles__AlertContainer",componentId:"sc-18sln6s-1"})(["height:15px;width:15px;z-index:50;right:0;top:-10px;position:absolute;border-radius:100px;background:",";background-color:",";",";"],Xr.errorColor,Xr.errorColor,Br);var nx=e=>{let{hidden:t=!1,onNudgeDismiss:n,onNudgeProductClick:r,onNudgeFormSubmit:o,chatSettings:a}=e;const i=Be(),u=Ue(),{active:d,inPlatform:p}=Ge(Xo),{PAT_HOST:f,PUSHER_KEY:h,VERSION:m}=Ge(Jo),{show:g}=Ge(oa),{feedbackFormOpen:b}=Ge(ea),{show:v,nudgeLayout:y}=Ge(ia),{bubbleNotification:w,position:E,fullscreenMode:x}=Ge(Vo),{showBubbleNotification:_}=Ge(Ko),C=Hv(),T=d?"Close chat":"Start chat",k=Object(s.useCallback)(()=>u(d?e=>{e({type:"CLOSE_CHATBUBBLE"})}:Qt()),[d,u]),O=mE(a,"zIndex",15);(d&&_||_&&!C)&&u(e=>{e({type:"DISMISS_NOTIFICATIONS"})}),d&&g&&u((e,t)=>{const{show:n}=t().pushMessages;n&&e({type:"DISMISS_PUSH_MESSAGE"})}),Object(s.useEffect)(()=>{const e=`${f}/chatbubble/${l.a}/auth/pusher?version=${m}`;Object(Qe.delayConfiguration)(i,h,{authEndpoint:e,cluster:"eu",encrypted:!0,disableStats:!0,pongTimeout:7500})},[f,h,m,i]),function(){const e=Ue(),[t,n]=Object(s.useState)("/"),[r,o]=Object(s.useState)(!1),{shownNudges:a}=Ge(Xo),i=Oi();Object(s.useEffect)(()=>{n(window.location.href),null!=a&&a.length&&!r&&Array.from(new Set(a).values()).map(e=>i.find(t=>t.slug===e)).filter(e=>e).filter(e=>e.analytics_completion_page_path).filter(e=>pE(t,e.analytics_completion_page_path)).forEach(t=>{o(!0),e(Tn({slug:t.slug,eventType:"SESSION_COMPLETION"})),e({type:"DISCOUNT_NUDGE",slug:t.slug})})},[e,t,i,a,r])}(),(()=>{const e=Ue(),{languages:t}=vi(),{currentLanguage:n}=Ge(Xo);Object(s.useEffect)(()=>{if(n)return;const r=(()=>{if(1===t.length)return t[0].code;const e=t.find(e=>{let{code:t}=e;return t===document.documentElement.lang});if(e)return e.code;const n=window.navigator.userLanguage||window.navigator.language;return n?n.split("-")[0]:""})();r&&e(Vt(r,{skipRestart:!0}))},[n,t,e])})(),XE(),ZE(a);const S=(!d||x)&&b,I=!d&&g&&!t&&!b;return c.a.createElement(c.a.Fragment,null,d&&c.a.createElement(yE,{settings:a}),I&&c.a.createElement(IE,{settings:a}),S&&c.a.createElement(_i,null),!b&&v&&y&&c.a.createElement(ch,{hidden:t,layout:y,onDismiss:n,onNewsletterSubmit:o,onProductClick:r}),c.a.createElement(ex,{inPlatform:p,position:E,zIndex:O},p&&c.a.createElement(ha,{active:d}),!d&&w&&_&&c.a.createElement(tx,null),!t&&c.a.createElement(VE,{title:T,active:d,onClick:k})))},rx=e=>{if(!e)return!0;return Date.now()-Number(e)>18e5};var ox=n(42),ax=n.n(ox);function ix(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var sx=ix();sx.withExtraArgument=ix;var cx=sx,lx=n(43),ux=n.n(lx),dx=(e,t)=>ux()({},e,t);var px=(e,t,n)=>dx(e,((e,t)=>e.split(".").reverse().reduce((e,n,r)=>0===r?{[n]:t}:{[n]:e},{}))(t,n));var fx=e=>(t,n)=>{const r=dx(t,n);return o=r,e.reduce((e,t)=>{let[n,r]=t;return px(e,n,r)},o);var o};const hx={id:null,name:"",avatar:"",botName:"",botAvatar:"",text:null,languages:[],startOverText:"Start over",placeholder:"",typingIndicator:!1,typingDuration:"",isTyping:!1,isTypingTimeoutId:null,feedbackForm:null,realtimeAnalytics:!1,inputLimitEnabled:!1,inputLimit:140,welcomePage:null,welcomePageType:d.COLOR,pushGreetingsEnabled:!1,pushGreetings:[],tabNotification:!0,bubbleNotification:!0,heartbeatEnabled:!1};var mx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:hx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Xe:return localStorage.removeItem("kindly-chat-has-shown-feedback-form"),{...e,name:e.botName,avatar:e.botAvatar,splitLabelTimestamp:Date.now()};case"BOT_IS_TYPING":{var n;const r=null===(n=null==t?void 0:t.isTyping)||void 0===n||n;return{...e,isTyping:r}}case Je:return{...e,isTyping:t.isTyping,isTypingTimeoutId:t.isTypingTimeoutId,hasInteraction:!0,splitLabelTimestamp:Date.now()};case"SET_SPLIT_TEST_LABEL":return{...e,splitLabelTimestamp:Date.now(),splitTestLabel:t.splitTestLabel};case"UPDATE_SPLIT_LABEL_TIMEOUT":return{...e,splitLabelTimestamp:Date.now()};case"CLEAR_SPLIT_TEST_LABEL":return{...e,splitTestLabel:null,hasInteraction:null,splitLabelTimestamp:null};default:return e}};const gx={botKey:null,inPlatform:!1,chatHasStarted:!1,active:!1,hideInputField:!1,previouslyPoppedUp:!1,currentlyPoppedUp:!1,optionsScreenOpen:!1,currentLanguage:null,startedAt:null,userIsIdle:!1,allGreetingsHideInput:!1,contactDetailsButton:null,uploadButtonWasClicked:null,attachments:{exchangeId:null,buttonClicked:null,files:[]},error:null};var bx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR":return{...e,error:t.error};case"SET_LANGUAGE":return{...e,currentLanguage:t.code};case Xe:return{...e,error:null,botKey:t.botKey||e.botKey,optionsScreenOpen:!1,hideInputField:!1,userIsIdle:!1};case"SET_CHAT_HAS_STARTED":return{...e,chatHasStarted:t.chatHasStarted,userIsIdle:!t.chatHasStarted&&e.userIsIdle};case Je:{const n=e.hideInputField&&"BOT"!==t.data.sender;return{...e,hideInputField:!!n||t.data.chatbubble_hide_input_field}}case"OPEN_CHATBUBBLE":return{...e,active:!0,userIsIdle:!1};case"CLOSE_CHATBUBBLE":return{...e,active:!1,optionsScreenOpen:!1};case"POPPED_UP":return{...e,previouslyPoppedUp:!0,currentlyPoppedUp:!0};case"OPEN_OPTIONS_SCREEN":return{...e,optionsScreenOpen:!0};case"CLOSE_OPTIONS_SCREEN":return{...e,optionsScreenOpen:!1};case"NEW_CHAT_ID":return{...e,chatId:t.chatId,allGreetingsHideInput:t.allGreetingsHideInput};case"TRIGGER_DIALOGUE":return e;case"SET_STARTED_AT":return{...e,startedAt:t.startedAt};case"SET_USER_IS_IDLE":return{...e,userIsIdle:t.userIsIdle};case"SHOW_CONTACT_DETAILS":return{...e,contactDetailsButton:t.button};case"HIDE_CONTACT_DETAILS":return{...e,contactDetailsButton:null};case"COUNT_NUDGE":return{...e,shownNudges:(e.shownNudges||[]).concat(t.slug)};case"ATTACHMENT_BUTTON_CLICKED":return{...e,attachments:{...e.attachments,buttonClicked:+new Date,exchangeId:t.button.value}};case"SET_ATTACHMENT_FILES":return{...e,attachments:{...e.attachments,files:t.files}};case"CLEAR_ATTACHMENT_FILES":return{...e,attachments:{exchangeId:null,buttonClicked:null,files:[]}};case"ATTACHMENT_PROMPT_SHOWED":return{...e,attachments:{...e.attachments,buttonClicked:null}};case"DISCOUNT_NUDGE":return{...e,shownNudges:(e.shownNudges||[]).filter(e=>e!==t.slug)};default:return e}};const vx={PAT_HOST:"https://bot.kindly.ai",PUSHER_KEY:"0d15baa2a7308d71e79d",STATUS_PAGE:"https://status.kindly.ai",KINDLY_CHAT_URL:"http://localhost:8081",SAGE_WS_HOST:"wss://sage.kindly.ai",SAGE_HOST:"https://sage.kindly.ai",SETTINGS_HOST:"https://chat.kindlycdn.com",VERSION:"dev"};var yx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ENVIRONMENT_OVERRIDE":return{...e,...t.env};default:return e}};const wx=(e,t)=>({...hx,id:e.id,name:e.name,avatar:e.avatar,botName:e.name,botAvatar:e.avatar,languages:e.languages,includeDisabledLanguages:e.includeDisabledLanguages,startOverText:e.start_over_text,welcomePage:e.welcomePage,welcomePageType:t?d.NONE:e.welcomePage.type,maintenanceAlert:e.maintenanceAlert,maintenanceAlertEnabled:!t&&e.maintenanceAlert.alert_enabled,pushGreetingsEnabled:!t&&e.use_push_greetings,pushGreetings:e.push_greetings,tabNotification:e.tab_notification,bubbleNotification:e.bubble_notification,typingIndicator:e.typing_indicator,typingDuration:e.typing_duration,disabledTransports:e.disabled_transports,feedbackFormType:t?u.NONE:e.feedbackForm.type,feedbackForm:e.feedbackForm,text:e.text,bubbleSize:e.bubble_size,isTextDirectionRtl:e.text_right_to_left,realtimeAnalytics:e.chatbubble.realtime_analytics,inputLimitEnabled:e.chatbubble.input_limit_enabled,inputLimit:e.chatbubble.input_limit||140,hideHeader:e.hideHeader||!1,bubbleAvatar:e.bubbleAvatar||null,position:{...C,...e.position},offsetHeight:e.offsetHeight||"205px",fullscreenMode:e.fullscreenMode||!1,zIndex:e.zIndex||5e3,persistStateLifespan:t?-1:e.chatbubble.persist_state_lifespan_seconds,showTakeoverQueue:e.show_takeover_queue,bubbleOutline:e.use_bubble_outline,seasonalAppearance:e.seasonal_appearance,noFeedbackAfterHandover:e.no_feedback_after_handover,nudges:e.nudges||[],handoverMode:e.handover_mode,heartbeatEnabled:Boolean(e.chatbubble_heartbeat_enabled),heartbeatTTL:e.chatbubble_heartbeat_ttl_s,splitTestEnabled:e.split_test_enabled,conversionPageUrl:e.conversion_page_url});var Ex=(e,t,n)=>{const{currentLanguage:r}=t;return n[r]||n.en};const xx=Object.freeze({WARNING:"WARNING",CRITICAL:"CRITICAL"}),_x=Object.freeze({OFFLINE:{en:"You seem to be offline, please check your internet connection",nb:"Du ser ut til å være frakoblet internett, vennligst sjekk tilgangen din"},WEBSOCKET_DOWN:{en:"There seems to be an issue with the connection, attempting to reconnect...",nb:"Det ser ut til å være et problem med tilkoblingen. Prøver å koble opp igjen..."}});var Cx=e=>t=>n=>{switch(n.type){case"DISCONNECTED":return((e,t,n,r)=>{const{announcement:o,bot:a,chatbubble:i}=t;return o.show||n({type:"ANNOUNCEMENT_SHOW",payload:{text:Ex(0,i,e),alertType:xx.WARNING}}),n(r)})(_x.OFFLINE,e.getState(),t,n);case"CONNECTED":{const{announcement:r,connection:o}=e.getState();return r.show&&t({type:"ANNOUNCEMENT_HIDE"}),o.connected||t(St()),t(n)}default:return t(n)}};var Tx=e=>t=>n=>{if(n.type!==Je)return t(n);const{chatbubble:{active:r,currentLanguage:o}}=e.getState();if("greeting"===n.data.exchange_type||n.data.triggered_chat_start){const e=n.data.chat_language_code;o!==e&&t({type:"SET_LANGUAGE",code:e})}if(("boolean"==typeof n.displayTypingIndicator?n.displayTypingIndicator:!n.data.from_bot)?Ht()(t,e.getState):Bt()(t,e.getState),!n.data.from_bot&&n.data.was_anonymized)return t({type:"ANONYMIZED_MESSAGE",data:n.data});if(!n.data.from_bot)return t(n);return!r&&"AGENT"!==n.data.sender&&"SYSTEM"!==n.data.sender&&"greeting"!==n.data.exchange_type&&t({type:"OPEN_CHATBUBBLE"}),t(n)},kx=e=>t=>n=>{switch(n.type){case Je:{const{bot:{typingDuration:r,typingIndicator:o},agent:{takenOver:a},chatbubble:{chatHasStarted:i}}=e.getState(),{isContactDetails:s,sender:c,from_bot:l,created:u}=n.data;if(!o||a||!i||c===p.SYSTEM||s)return t({...n,displayTypingIndicator:!1});if(Ht()(t,e.getState),!l)return t(n);const d=r-((new Date).getTime()-gg(u).getTime());return setTimeout(()=>{t(n)},d>0?d:0)}default:return t(n)}};var Ox=e=>t=>n=>{const{bot:{typingDuration:r,typingIndicator:o}}=e.getState(),a=o?Math.max(5e3,r):5e3;return"NEW_CHAT_ID"===n.type&&setTimeout(()=>t((e,t)=>{const{messages:{chatMessages:n}}=t();n.find(e=>e.triggered_chat_start||"greeting"===e.exchange_type)||e(St())}),a),n.type===Je&&n.data.from_bot?(t((e,t)=>{const{takeoverPollIntervalId:n,takeoverRequestPollIntervalId:r}=t().websocketFallback;if(clearInterval(n),clearInterval(r),"number"==typeof n){const t=setInterval(()=>e(St()),h.TAKEOVER_POLL_INTERVAL_MS);e({type:"SET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL",takeoverPollIntervalId:t})}if("number"==typeof r){const t=setInterval(()=>e(St()),h.TAKEOVER_REQUEST_POLL_INTERVAL_MS);e({type:"SET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL",takeoverRequestPollIntervalId:t})}}),t((e,t)=>{const{replyTimeoutId:n}=t().websocketFallback;clearTimeout(n),e({type:"RESET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT"})}),t(n)):t(n)};const Sx={names:[],avatars:[],isTyping:!1,userIsTyping:!1,takenOver:!1,takeoverClosed:!0,requestedTakeover:!1,hasHadHandover:!1};var Ix=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TAKEOVER":{const n=t.data.taken_over&&!e.takenOver,r=!t.data.taken_over&&e.takenOver;return n?{...e,requestedTakeover:!1,takenOver:!0,isTyping:!1,hasHadHandover:!0}:r?{...e,requestedTakeover:!1,takenOver:!1,isTyping:!1}:e}case Je:return{...e,isTyping:!1};case"AGENT_STARTED_TYPING":return{...e,isTyping:!0};case"AGENT_STOPPED_TYPING":return{...e,isTyping:!1};case"USER_STARTED_TYPING":return{...e,userIsTyping:!0};case"USER_STOPPED_TYPING":return{...e,userIsTyping:!1};case"TAKEOVER_REQUESTED":return{...e,requestedTakeover:t.requestedTakeover,takeoverClosed:t.closed||!1};case"TAKEOVER_CANCELLED":return{...e,requestedTakeover:!1};case"RESET_HAS_HAD_HANDOVER":return{...e,hasHadHandover:!1};default:return e}};const Ax={showTabNotification:!1,showBubbleNotification:!1};var jx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ax,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Je:if(!t.data.from_bot||"SYSTEM"===t.data.sender)return e;return"visible"===document.visibilityState?{showBubbleNotification:!0}:{showTabNotification:!0};case"SHOW_TAB_NOTIFICATION":return{showTabNotification:!0};case"SHOW_BUBBLE_NOTIFICATION":return{showBubbleNotification:!0};case"DISMISS_NOTIFICATIONS":return{...Ax};default:return e}};const Nx={show:!1,text:null,url:null,type:null};var Mx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Nx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ANNOUNCEMENT_SHOW":return{text:t.payload.text,type:t.payload.alertType,url:t.payload.url,show:!0};case"ANNOUNCEMENT_HIDE":return Nx;default:return e}};const Px={isAuthenticated:!1,token:null,avatarUrl:null,fullName:null,isRefreshing:!1,getAuthToken:null};var Rx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Px,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"AUTHENTICATED":return{...e,isAuthenticated:!0,token:t.token,avatarUrl:t.avatarUrl,fullName:t.fullName};case"IDENTIFIED":return{...e,avatarUrl:t.avatarUrl,fullName:t.fullName};case"UNAUTHENTICATED":return{...e,...Px};case"START_REFRESHING":return{...e,isRefreshing:!0};case"END_REFRESHING":return{...e,isRefreshing:!1};default:return e}};const Lx={token:null,connected:!0,pusherConnected:!1,connectTriggerConfig:void 0,heartbeatId:void 0};var Dx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"NEW_TOKEN":return{...e,token:t.token};case Xe:case"RESET_TOKEN":return{...e,token:null};case"CONNECTED":return{...e,connected:!0};case"DISCONNECTED":return{...e,connected:!1};case Qe.CONNECTED:return{...e,pusherConnected:!0};case Qe.DISCONNECTED:return{...e,pusherConnected:!1};case"CONNECT_WITH_TRIGGER":return{...e,connectTriggerConfig:t.triggerConfig};case"SET_HEARTBEAT_ID":return{...e,heartbeatId:t.heartbeatId};default:return e}};const Bx={inspectorOpen:!1,currentMessageId:null};var Hx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Bx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_INSPECTED_CHAT_MESSAGE":return{...e,currentMessageId:t.chatMessageId};case"TOGGLE_INSPECTOR":return{...e,inspectorOpen:!e.inspectorOpen};default:return e}};const Ux={token:null,feedbackFormOpen:!1};var zx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ux,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_FEEDBACK_FORM":return{...e,feedbackFormOpen:!0,token:t.token};case"CLOSE_FEEDBACK_FORM":return Ux;default:return e}};const Fx={context:{},language:null};var $x=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Fx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_NEW_CONTEXT":return{...e,context:{...e.context,...t.context}};default:return e}};const Gx={show:!1,textContent:null,linkText:null,linkLocation:null,dismissed:!1};var qx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gx,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_MAINTENANCE_ALERT":return{show:!0,textContent:t.textContent,linkText:t.linkText,linkLocation:t.linkLocation};case"DISMISS_MAINTENANCE_ALERT":return{...Gx,dismissed:!0};default:return e}},Yx=e=>e.replace(/_\w/g,e=>e[1].toUpperCase()),Kx=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[Yx(n)]:r}},{})},Wx=e=>Boolean(e.find(e=>{let{exchange_type:t}=e;return"greeting"===t})),Vx=n(12);const Xx={chatMessages:[],buttonClicks:[],attachments:[],messageSentTime:null,lastMessageSeen:null},Qx=e=>{let{id:t}=e;return t},Jx=e=>{let{temporaryId:t,id:n}=e;return e=>{let{temporaryId:r,id:o}=e;return n===o||t===r}},Zx=(e,t,n)=>e.map(e=>t(e)?n(e):e);var e_=function(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xx,o=arguments.length>1?arguments[1]:void 0;switch(o.type){case Je:{const{chatMessages:e}=r,{data:t,force:n=!1}=o;return"greeting"===mE(t,"exchange_type")&&Wx(e)?r:n||Ct(e)(t)?px(r,"chatMessages",[...e,t]):r}case Xe:return Xx;case"ANONYMIZED_MESSAGE":{const{chatbubble_temporary_id:e,id:t}=o.data,n=n=>{let{id:r}=n;return Object(O.a)(r,[e,t])},a=e=>({...e,message:o.data.message});return{...r,chatMessages:Zx(r.chatMessages,n,a)}}case"SET_MESSAGE_SENT_TIME":return{...r,messageSentTime:o.messageSentTime};case"UPDATE_CHAT_MESSAGE":{var a;const{created:e,id:t,temporaryId:n}=o,{chatMessages:i}=r,s=null!==(a=null==o?void 0:o.status)&&void 0!==a?a:null,c=i.findIndex(e=>{let{id:t}=e;return t===n});if(c<0)return r;const l=i[c],u={...l,created:e||l.created,id:t||l.id,status:s},d=i.map((e,t)=>t!==c?e:u);return{...r,chatMessages:d}}case"PATTERN_CONTEXT_MATCH":{const{chatMessageId:e,chatMessageTempId:t,patternContextMatch:n}=o.data,a=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,pattern_context_match:n});return{...r,chatMessages:Zx(r.chatMessages,a,i)}}case"SPELL_CORRECTION":{const{chatMessageId:e,chatMessageTempId:t,correctedMessage:n}=o.data,a=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,corrected_message:n});return{...r,chatMessages:Zx(r.chatMessages,a,i)}}case"BUTTON_CLICK":var i;return o.force||xt(r.buttonClicks)(o.buttonClick)?{...r,buttonClicks:[...null!==(i=r.buttonClicks)&&void 0!==i?i:[],o.buttonClick]}:r;case"SET_LAST_MESSAGE_SEEN":return{...r,lastMessageSeen:Object(Vx.a)(o,["id","index"])};case"NEW_ATTACHMENTS":return{...r,attachments:[...null!==(e=r.attachments)&&void 0!==e?e:[],...(null===(t=o.data)||void 0===t||null===(n=t.attachments)||void 0===n?void 0:n.map(Kx))||[]]};case"UPDATE_ATTACHMENT":{const e=Kx(o.attachment),t=Jx(e),n=t=>({...t,...e});return{...r,attachments:Zx(r.attachments,t,n)}}case"MESSAGE_ATTACHMENTS_UPDATED":{var s;const{attachments:e=[],temporaryChatMessageId:t,chatMessageId:n}=o.data,a=e.map(Kx),i=(null!==(s=r.attachments)&&void 0!==s?s:[]).map(e=>{const t=a.find(Jx(e));return t?{...e,...t}:e});let c=r.chatMessages;if(t&&n){const e=e=>{let{id:n}=e;return n===t},o=e=>({...e,id:n,attachment_ids:a.map(Qx)});c=Zx(r.chatMessages,e,o)}return{...r,attachments:i,chatMessages:c}}default:return r}};const t_={chatDeleted:!1};var n_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DELETE_CHAT":return{...e,chatDeleted:!0};case"SET_CHAT_HAS_STARTED":return{...e,chatDeleted:!t.chatHasStarted&&e.chatDeleted};case Xe:return{...e,chatDeleted:!1};default:return e}};const r_={show:!1,text:null,agent:null,dismissed:!1,type:En,dismissedMessages:[]};var o_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TAKEOVER":return t.data.taken_over&&!e.taken_over?{...e,show:!0,agent:{name:t.data.name,avatar:t.data.avatar},text:"er her for å hjelpe deg",type:wn}:e;case Je:return Hv()||!t.data.from_bot||"SYSTEM"===t.data.sender||"greeting"===t.data.exchange_type?e:{...e,show:!0,text:t.data.message,type:En};case"SHOW_PUSH_MESSAGE":return{...e,show:!0,text:t.pushMessageText,dismissed:!1,type:t.pushMessageType,dismissedMessages:[...e.dismissedMessages,t.pushMessageTitle]};case"DISMISS_PUSH_MESSAGE":return{...e,show:!1,dismissed:!0};case"RESET_PUSH_MESSAGES":return r_;default:return e}};const a_={takeoverPollIntervalId:null,takeoverRequestPollIntervalId:null,replyTimeoutId:null,replyTimeoutAttempts:0};var i_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL":return{...e,takeoverPollIntervalId:t.takeoverPollIntervalId};case"SET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL":return{...e,takeoverRequestPollIntervalId:t.takeoverRequestPollIntervalId};case"SET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT":return{...e,replyTimeoutId:t.replyTimeoutId,replyTimeoutAttempts:t.replyTimeoutAttempts};case"RESET_WEBSOCKET_FALLBACK_TAKEOVER_INTERVAL":return{...e,takeoverPollIntervalId:null};case"RESET_WEBSOCKET_FALLBACK_TAKEOVER_REQUEST_INTERVAL":return{...e,takeoverRequestPollIntervalId:null};case"RESET_WEBSOCKET_FALLBACK_REPLY_TIMEOUT":return{...e,replyTimeoutId:null,replyTimeoutAttempts:0};default:return e}};const s_={open:!1,imageUrl:""};var c_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"OPEN_LIGHT_BOX":return{...e,open:!0,imageUrl:t.imageUrl};case"CLOSE_LIGHT_BOX":return{...e,open:!1,imageUrl:""};default:return e}};const l_={slug:null,show:!1,isCustom:!1,dialogue:null,webhook:null,content:null,onRendered:null,nudgeLayout:{},nudgeType:v.TEMPLATE,hasInteraction:!1};var u_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"DISMISS_NUDGE":return{...e,show:!1,nudgeLayout:{},hasInteraction:!0};case"SHOW_NUDGE":return{...e,show:!0,slug:t.slug,dialogue:t.dialogue,webhook:t.webhook,nudgeLayout:t.nudgeLayout,nudgeType:v.TEMPLATE,trackEvent:t.trackEvent,hasInteraction:!0};case"SHOW_CUSTOM_NUDGE":return{...e,show:!0,isCustom:!0,slug:t.slug,content:t.content,nudgeLayout:{},onRendered:t.onRendered,nudgeType:v.CUSTOM,trackEvent:t.trackEvent,hasInteraction:!0};case"CLEAR_NUDGE_INTERACTION":return{...e,hasInteraction:!1};default:return e}};const d_=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace:!0,traceLimit:25})||Ee,p_=Hv(),f_=(e,t)=>{const n=Boolean(e.chatbubble.keep_open&&t.chatbubble.active&&!p_)||Boolean(e.chatbubble.keep_open_mobile&&t.chatbubble.active&&p_);return{active:n,wasActiveOnLoad:n}},h_=function(){let{url:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e||"").startsWith("data:")?t:{...t,url:e}},m_=e=>{if(mE(e,"bot.includeDisabledLanguages",!1))return e;const t=mE(e,"chatbubble.currentLanguage"),n=mE(e,"bot.languages",[]).find(e=>{let{code:n}=e;return n===t});return mE(n,"active",!1)?e:dx(e,{chatbubble:{currentLanguage:null}})};var g_=e=>{let{botKey:t,settings:n}=e;const{language:r,inPlatform:a}=n,i=[Ox,Cx,kx,Tx,cx];const s=`kindly-chat-${t}`,c=((e,t)=>t?()=>t=>({bot:{splitTestLabel:t.bot.splitTestLabel,splitLabelTimestamp:t.bot.splitLabelTimestamp,hasInteraction:t.bot.hasInteraction},nudge:{hasInteraction:t.nudge.hasInteraction},chatbubble:{...t.chatbubble,...f_(e,t),admin:void 0,currentlyPoppedUp:gx.currentlyPoppedUp,allGreetingsHideInput:gx.allGreetingsHideInput,contactDetailsButton:gx.contactDetailsButton,attachments:gx.attachments,shownNudges:t.chatbubble.shownNudges},connection:{token:t.connection.token,connected:!0,pusherConnected:!1},pushMessages:{dismissedMessages:t.pushMessages.dismissedMessages},agent:{names:t.agent.names,avatars:t.agent.avatars,requestedTakeover:t.agent.requestedTakeover,takenOver:t.agent.takenOver},messages:{chatMessages:t.messages.chatMessages,buttonClicks:t.messages.buttonClicks,attachments:(t.messages.attachments||[]).map(h_),messageSentTime:t.messages.messageSentTime,lastMessageSeen:t.messages.lastMessageSeen}}):(localStorage.removeItem("kindly-chat-has-shown-feedback-form"),()=>t=>({bot:{splitTestLabel:t.bot.splitTestLabel,splitLabelTimestamp:t.bot.splitLabelTimestamp,hasInteraction:t.bot.hasInteraction},nudge:{hasInteraction:t.nudge.hasInteraction},chatbubble:{...f_(e,t),previouslyPoppedUp:t.chatbubble.previouslyPoppedUp,shownNudges:t.chatbubble.shownNudges},pushMessages:{dismissedMessages:t.pushMessages.dismissedMessages},agent:{names:t.agent.names,avatars:t.agent.avatars}})))(n,n.inPlatform||0!==n.chatbubble.persist_state_lifespan_seconds),l=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return t.reverse().slice(1).reduce((e,t)=>t(e),t[0](...arguments))}}(m_,(e=>t=>{var n,r,o;const a=(null==t||null===(n=t.messages)||void 0===n?void 0:n.chatMessages.filter(e=>e.from_bot).sort((e,t)=>gg(e.created).getTime()-gg(t.created).getTime()).slice(1))||[],i=null!==(r=null==a||null===(o=a[0])||void 0===o?void 0:o.chat_language_code)&&void 0!==r?r:null;return dx(t,{chatbubble:{currentLanguage:i||e}})})(r),(e=>{let{inPlatform:t,botKey:n}=e;const r=[["chatbubble.inPlatform",t],["chatbubble.botKey",n]].filter(e=>{let[,t]=e;return void 0!==t});return fx(r)})({inPlatform:a,botKey:t})),u=d_(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map((function(e){return e(o)}));return we({},n,{dispatch:r=Ee.apply(void 0,a)(n.dispatch)})}}}(...i),ax()(null,{key:s,slicer:c,merge:l})),d=(e=>{let{botKey:t,settings:n,settings:{context:r,language:o,inPlatform:a,admin:i,environment:s,getAuthToken:c}}=e;return{bot:wx(n,a),chatbubble:{...gx,botKey:t,inPlatform:a,admin:i,renderedBy:n.renderedBy||"REACT"},local:{context:r,language:o},environment:{...vx,VERSION:it.a,...s},auth:{getAuthToken:c}}})({botKey:t,settings:n});return he(ge(o),d,u)},b_=()=>{const[e,t]=Object(s.useState)(!1),{conversionPageUrl:n}=Ge(Vo),r=((e,t)=>{let{enable:n=!0}=t;const[r,o]=Object(s.useState)(null);if(!n)return null;const a=setInterval(()=>{const t=document.querySelector(e);t&&(o(t),clearInterval(a))},500);return r})("#klarna-checkout-iframe",{enable:null==n?void 0:n.match(/klarna/gi)}),o=Object(s.useRef)(null),a=Object(s.useCallback)(e=>{var n;const r=e.getAttribute("src")||"",o=(e=>{try{return JSON.parse(e)}catch(e){return null}})((null===(n=decodeURIComponent(r).match(/\{"(.*)/gim))||void 0===n?void 0:n[0])||"");o&&"object"==typeof o&&["created","checkout_complete"].indexOf(o.ORDER_STATUS)>-1&&t(!0)},[]);return Object(s.useEffect)(()=>{r&&!o.current&&(a(r),o.current=setInterval(()=>a(r),500))},[r,o,a]),Object(s.useEffect)(()=>{e&&clearInterval(o.current)},[e]),e};var v_=()=>{const e=Ue(),[t,n]=Object(s.useState)("/"),{conversionPageUrl:r,splitTestLabel:o,hasInteraction:a,splitTestEnabled:i}=Ge(Vo),c=b_(),u=Object(s.useCallback)(()=>{if(!rx(localStorage.getItem("kindly-last-conversion-timestamp")))return;const t=i&&o,n=!a;localStorage.setItem("kindly-last-conversion-timestamp",Number(new Date)),e(((e,t)=>async(n,r)=>{const{PAT_HOST:o}=r().environment,{botKey:a,currentLanguage:i}=r().chatbubble,{token:s}=r().connection,c=await n(Dt());n(bt({method:"post",url:`${o}/chatbubble/${l.a}/conversion/`,data:{split:e||"X",is_order:t,language_code:i},...st({botKey:a,token:s},{withCurrentUrl:!0,extra:c})}))})(t,n)),e(e=>{e({type:"CLEAR_SPLIT_TEST_LABEL"})})},[e,o,a,i]);Object(s.useEffect)(()=>{c&&u()},[u,c]),Object(s.useEffect)(()=>{n(window.location.href),null!=r&&r.trim()&&pE(t,r)&&u()},[u,t,r])};var y_=e=>{var t,n,r,o,a,i,s,c,l,u,d,p,f,h,m,g,b,v,y,w,E,x,_,C,T,k,O,S,I;return{customFont:null!==(t=null==e?void 0:e.customFont)&&void 0!==t?t:null,chatLogElements:null!==(n=null==e||null===(r=e.style)||void 0===r?void 0:r.color_chat_log_elements)&&void 0!==n?n:"#333333",background:null!==(o=null==e||null===(a=e.style)||void 0===a?void 0:a.color_background)&&void 0!==o?o:"#ffffff",bubbleButtonOutline:null!==(i=null==e||null===(s=e.style)||void 0===s?void 0:s.color_button_outline)&&void 0!==i?i:"#0069ff",buttonBackground:null!==(c=null==e||null===(l=e.style)||void 0===l?void 0:l.color_button_background)&&void 0!==c?c:"#0069ff",bubbleButtonBackground:null!==(u=null==e||null===(d=e.style)||void 0===d?void 0:d.color_bubble_button_background)&&void 0!==u?u:"#0069ff",buttonText:null!==(p=null==e||null===(f=e.style)||void 0===f?void 0:f.color_button_text)&&void 0!==p?p:"#ffffff",headerBackground:null!==(h=null==e||null===(m=e.style)||void 0===m?void 0:m.color_header_background)&&void 0!==h?h:"#0069ff",headerText:null!==(g=null==e||null===(b=e.style)||void 0===b?void 0:b.color_header_text)&&void 0!==g?g:"#ffffff",inputBackground:null!==(v=null==e||null===(y=e.style)||void 0===y?void 0:y.color_input_background)&&void 0!==v?v:"#ffffff",inputText:null!==(w=null==e||null===(E=e.style)||void 0===E?void 0:E.color_input_text)&&void 0!==w?w:"#333333",userMessageBackground:null!==(x=null==e||null===(_=e.style)||void 0===_?void 0:_.color_user_message_background)&&void 0!==x?x:"#f5f5f5",userMessageText:null!==(C=null==e||null===(T=e.style)||void 0===T?void 0:T.color_user_message_text_color)&&void 0!==C?C:"#2c2c2c",botMessageBackground:null!==(k=null==e||null===(O=e.style)||void 0===O?void 0:O.color_bot_message_background)&&void 0!==k?k:"#f5f5f5",botMessageText:null!==(S=null==e||null===(I=e.style)||void 0===I?void 0:I.color_bot_message_text_color)&&void 0!==S?S:"#2c2c2c"}};const w_=e=>{let{settings:t}=e;const n=Ue(),{inPlatform:r}=Ge(Xo),{canShow:o}=function(){const{splitTestEnabled:e,splitTestLabel:t,splitLabelTimestamp:n}=Ge(Vo),r=Ue(),o=Object(s.useCallback)(()=>{r(e=>{e({type:"UPDATE_SPLIT_LABEL_TIMEOUT"})})},[r]),a=fa(o,2500);return Object(s.useEffect)(()=>{function t(){a()}return e&&window.addEventListener("mousemove",t),()=>e?window.removeEventListener("mousemove",t):void 0},[e]),Object(s.useEffect)(()=>{n&&rx(n)&&r(e=>{e({type:"CLEAR_SPLIT_TEST_LABEL"})})},[n,r]),Object(s.useEffect)(()=>{let n=t||_.NO_SPLIT_LABEL;e&&!t&&(n=Math.random()>.5?_.SPLIT_A:_.SPLIT_B),t||r((e=>t=>{t({type:"SET_SPLIT_TEST_LABEL",splitTestLabel:e})})(n))},[e,t,r]),{canShow:e&&["A","X"].indexOf(t)>-1||!e,splitTestLabel:t}}();return v_(),Object(s.useEffect)(()=>{o&&t.chatbubble.autopopup&&!Hv()&&!r&&setTimeout(()=>n((e,t)=>{const{active:n,previouslyPoppedUp:r}=t().chatbubble;n||r||(e(Qt()),e({type:"POPPED_UP"}))}),t.chatbubble.autopopup_time)},[n,r,t,o]),o?c.a.createElement(nx,{chatSettings:t,hidden:t.bubbleHidden,onNudgeDismiss:t.onNudgeDismiss,onNudgeFormSubmit:t.onNudgeFormSubmit,onNudgeProductClick:t.onNudgeProductClick}):null},E_=Object(s.forwardRef)((e,t)=>{let{botKey:n,settings:r}=e;const o=g_({botKey:n,settings:r});return Object(s.useImperativeHandle)(t,()=>({openChat(){o.dispatch(Qt())},closeChat(){o.dispatch(e=>{e({type:"CLOSE_CHATBUBBLE"})})},triggerDialogue(e,t){o.dispatch(gn(e,t))},showNudge(e){let{nudgeLayout:t,slug:n,trackEvent:r=!0}=e;o.dispatch((e=>{let{nudgeLayout:t,slug:n,trackEvent:r}=e;return(e,o)=>{var a,i,s,c,l,u,d;const{nudges:p,languages:f}=o().bot,{currentLanguage:h}=o().chatbubble,{show:m}=o().pushMessages,g=null==t?void 0:t.language;let b,y=null!==(a=null==t?void 0:t.webhook)&&void 0!==a?a:null,w=null!==(i=null==t?void 0:t.dialogueId)&&void 0!==i?i:null,E=t;const x=f.filter(e=>{let{active:t}=e;return t})[0],_=[...null!==(s=null==p?void 0:p.form_nudges)&&void 0!==s?s:[],...null!==(c=null==p?void 0:p.custom_nudges)&&void 0!==c?c:[],...null!==(l=null==p?void 0:p.product_nudges)&&void 0!==l?l:[],...null!==(u=null==p?void 0:p.text_nudges)&&void 0!==u?u:[],...null!==(d=null==p?void 0:p.multiple_choice_nudges)&&void 0!==d?d:[]],C=g||h||x.code,T=n||t.slug;if(T){var k,O,S,I,A,j,N;if(b=_.filter(e=>e.slug===T)[0],void 0===b)return;if(w=null!==(k=null===(O=b)||void 0===O?void 0:O.dialogue_id)&&void 0!==k?k:w,y=null!==(S=null===(I=b)||void 0===I?void 0:I.webhook)&&void 0!==S?S:y,E=xn(b,C),E.sections=[...null!==(A=null===(j=E)||void 0===j?void 0:j.sections)&&void 0!==A?A:[],...null!==(N=null==t?void 0:t.sections)&&void 0!==N?N:[]],E.backdrop=null==t?void 0:t.backdrop,!Cn(b,f,C))return}else console.error("Please set up a nudge in the platform to get a slug!");r&&e(Tn({slug:T,eventType:"SHOW_NUDGE"})),m&&e({type:"DISMISS_PUSH_MESSAGE"}),e({slug:T,type:"SHOW_NUDGE",nudgeLayout:E,dialogue:w,webhook:y,nudgeType:v.TEMPLATE,trackEvent:r})}})({nudgeLayout:t,slug:n,trackEvent:r}))},showCustomNudge(e){let{content:t,slug:n,onRendered:r,trackEvent:a=!0}=e;o.dispatch((e=>{let{content:t,slug:n,onRendered:r,trackEvent:o}=e;return(e,a)=>{const{show:i}=a().pushMessages;o&&e(Tn({slug:n,eventType:"SHOW_CUSTOM_NUDGE"})),i&&e({type:"DISMISS_PUSH_MESSAGE"}),e({type:"SHOW_CUSTOM_NUDGE",content:t,slug:n,onRendered:r,nudgeType:v.CUSTOM})}})({content:t,slug:n,onRendered:r,trackEvent:a}))},closeNudge(e,t){!(arguments.length>2&&void 0!==arguments[2])||arguments[2];o.dispatch(kn(e,t))},nudgeCompletion(e){sessionStorage.getItem("kindly-nudge-completion")||(o.dispatch(Tn({slug:e,eventType:"SESSION_COMPLETION"})),o.dispatch({type:"DISCOUNT_NUDGE",slug:e}),sessionStorage.setItem("kindly-nudge-completion",!0))},closeFeedback(){o.dispatch((e,t)=>{var n;e({type:"CLOSE_FEEDBACK_FORM"}),null!==(n=t().chatbubble)&&void 0!==n&&n.active&&e({type:"CLOSE_CHATBUBBLE"})})},triggerCtaEvent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.dispatch((e=>(t,n)=>{const{show:r,slug:o}=n().nudge;r&&t(Tn({slug:o,eventType:"CTA_CLICK",label:e}))})(e))},identifyUser(e){o.dispatch((e=>async(t,n)=>{const{connection:{token:r},environment:{PAT_HOST:o}}=n();if(!r)throw new Error("Token missing");const{headers:a}=st({token:r},{withCurrentUrl:!0}),{data:i,status:s}=await t(bt({method:"post",url:`${o}/chatbubble/${l.a}/auth/identify`,headers:a,data:{avatar_url:e.avatar_url,full_name:e.full_name,email:e.email,phone_number:e.phone_number}}));200===s&&t({type:"IDENTIFIED",avatarUrl:i.avatar_url,fullName:i.full_name})})(e))},setNewContext(e){o.dispatch((e=>t=>{t({type:"SET_NEW_CONTEXT",context:e})})(e))},cancelHandover(){o.dispatch(Nt())}})),Object(s.useEffect)(()=>{!function(e){Ve("load",{settings:e},null==e?void 0:e.renderedBy,null==e?void 0:e.onLoad)}(r)},[r]),Object(s.useEffect)(()=>{const{persistStateLifespan:e,heartbeatEnabled:t}=o.getState().bot;if(t)return;if(-1===e||e>0)return;let r=!1;const a=()=>{r||(r=!0,o.dispatch(ct(n)))};window.onbeforeunload=a,window.onunload=a},[n,r,o]),window.Cypress&&(window.store=o),c.a.createElement(K,{store:o},c.a.createElement(Ye.a,{theme:y_(r)},c.a.createElement(qo,{errorPoint:"inside ChatContainer",displayError:!1},r.user_idle_timeout_seconds>0?c.a.createElement(z,{onIdle:()=>o.dispatch(e=>{e({type:"SET_USER_IS_IDLE",userIsIdle:!0}),Gt()}),onActive:()=>{return o.dispatch((e=r.id,(t,n)=>{const{userIsIdle:r}=n().chatbubble;r&&(t({type:"SET_USER_IS_IDLE",userIsIdle:!1}),$t(e))}));var e},timeout:1e3*r.user_idle_timeout_seconds},c.a.createElement(w_,{settings:r})):c.a.createElement(w_,{settings:r}))))});E_.displayName="ChatContainer";var x_=E_;var __=(e,t)=>{const[n,r]=Object(s.useState)(t||{}),o=Object(s.useCallback)(async()=>{try{var n;const o=await async function(e,t){const n=ot();return JE(()=>et.a.get(`${e}/settings/${t}.json`,{params:{version:it.a,[rt]:n}}),{retries:3,interval:2e3,intervalBackoffMultiplier:1})}((null===(n=t.environment)||void 0===n?void 0:n.SETTINGS_HOST)||"https://chat.kindlycdn.com",e),{welcome_page:a,feedback_form:i,maintenance_alert:s,notifications:c,settings:l,...u}=o.data,d={...u,...l,...c,feedbackForm:i,welcomePage:a,maintenanceAlert:s};r(e=>dx(dx(d,e),t))}catch(e){var o,a;const t=null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.error?e.response.data.error:e;console.error("Kindly chat failed to initialize.",t)}},[e,t]);return Object(s.useEffect)(()=>{o()},[o]),n};var C_=e=>{var t;let{botKey:n,setKindlyChatRef:r,options:o=null}=e;const a=__(n,o);if(!a.id)return null;const i=[((null===(t=o.environment)||void 0===t?void 0:t.KINDLY_CHAT_URL)||"http://localhost:8081").match("^https?://(([^:/?#]*)(?::([0-9]+))?)")[2],"*.kindly.ai","demokind.ly","*.demokind.ly",...a.chatbubble.domains];return a.chatbubble.inPlatform||I(window.location.hostname,i)?c.a.createElement(x_,{ref:r,botKey:n,settings:a}):(console.error(`Domain ${window.location.hostname} is not allowed to load Kindly Chat. Please check your bot settings if you think this is a mistake.`),null)};t.default=e=>{let{botKey:t,setKindlyChatRef:n,options:r}=e;return c.a.createElement(s.Suspense,{fallback:""},c.a.createElement(C_,{botKey:t,setKindlyChatRef:n,options:r}))}}])}));
|
|
15
|
+
***************************************************************************** */
|
|
16
|
+
var o=function(e,t){return(o=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)};function a(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i=function(){return(i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function c(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function s(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var a=arguments[t],i=0,c=a.length;i<c;i++,o++)r[o]=a[i];return r}var u=n(0);var l=0,d="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-l));l=t+n,setTimeout((function(){return e(l)}),n)},f=1/60*1e3,p=!0,h=!1,m=!1,g={delta:0,timestamp:0},b=["read","update","preRender","render","postRender"],v=function(e){return h=e},y=b.reduce((function(e,t){var n,r,o,a,i,c,s,u,l;return e[t]=(n=v,r=[],o=[],a=0,i=!1,c=0,s=new WeakSet,u=new WeakSet,l={cancel:function(e){var t=o.indexOf(e);s.add(e),-1!==t&&o.splice(t,1)},process:function(e){var t,d;if(i=!0,r=(t=[o,r])[0],(o=t[1]).length=0,a=r.length)for(c=0;c<a;c++)(d=r[c])(e),!0!==u.has(d)||s.has(d)||(l.schedule(d),n(!0));i=!1},schedule:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var c=n&&i,l=c?r:o;s.delete(e),t&&u.add(e),-1===l.indexOf(e)&&(l.push(e),c&&(a=r.length))}}),e}),{}),w=b.reduce((function(e,t){var n=y[t];return e[t]=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!1),h||k(),n.schedule(e,t,r),e},e}),{}),x=b.reduce((function(e,t){return e[t]=y[t].cancel,e}),{}),O=function(e){return y[e].process(g)},E=function(e){h=!1,g.delta=p?f:Math.max(Math.min(e-g.timestamp,40),1),p||(f=g.delta),g.timestamp=e,m=!0,b.forEach(O),m=!1,h&&(p=!1,d(E))},k=function(){h=!0,p=!0,m||d(E)},C=function(){return g},_=w,j=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},T=function(e){return e%1?Number(e.toFixed(5)):e},S=/(-)?(\d[\d\.]*)/g,I=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,A=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,N={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},P=i(i({},N),{transform:j(0,1)}),M=i(i({},N),{default:1}),R=function(e){return{test:function(t){return"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},L=R("deg"),D=R("%"),B=R("px"),z=R("vh"),U=R("vw"),H=i(i({},D),{parse:function(e){return D.parse(e)/100},transform:function(e){return D.transform(100*e)}}),F=j(0,255),$=function(e){return void 0!==e.red},q=function(e){return void 0!==e.hue};var G=function(e){return function(t){if("string"!=typeof t)return t;for(var n={},r=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))}(t).replace(/(,|\/)/g," ").split(/ \s*/),o=0;o<4;o++)n[e[o]]=void 0!==r[o]?parseFloat(r[o]):1;return n}},Y=i(i({},N),{transform:function(e){return Math.round(F(e))}});function V(e,t){return e.startsWith(t)&&A.test(e)}var W={test:function(e){return"string"==typeof e?V(e,"rgb"):$(e)},parse:G(["red","green","blue","alpha"]),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,a=void 0===o?1:o;return function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha;return"rgba("+t+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({red:Y.transform(t),green:Y.transform(n),blue:Y.transform(r),alpha:T(P.transform(a))})}},K={test:function(e){return"string"==typeof e?V(e,"hsl"):q(e)},parse:G(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha,a=void 0===o?1:o;return function(e){var t=e.hue,n=e.saturation,r=e.lightness,o=e.alpha;return"hsla("+t+", "+n+", "+r+", "+(void 0===o?1:o)+")"}({hue:Math.round(t),saturation:D.transform(T(n)),lightness:D.transform(T(r)),alpha:T(P.transform(a))})}},X=i(i({},W),{test:function(e){return"string"==typeof e&&V(e,"#")},parse:function(e){var t="",n="",r="";return e.length>4?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),t+=t,n+=n,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:1}}}),J={test:function(e){return"string"==typeof e&&A.test(e)||$(e)||q(e)},parse:function(e){return W.test(e)?W.parse(e):K.test(e)?K.parse(e):X.test(e)?X.parse(e):e},transform:function(e){return $(e)?W.transform(e):q(e)?K.transform(e):e}},Q=function(e){return"number"==typeof e?0:e},Z={test:function(e){if("string"!=typeof e||!isNaN(e))return!1;var t=0,n=e.match(S),r=e.match(I);return n&&(t+=n.length),r&&(t+=r.length),t>0},parse:function(e){var t=e,n=[],r=t.match(I);r&&(t=t.replace(I,"${c}"),n.push.apply(n,r.map(J.parse)));var o=t.match(S);return o&&n.push.apply(n,o.map(N.parse)),n},createTransformer:function(e){var t=e,n=0,r=e.match(I),o=r?r.length:0;if(r)for(var a=0;a<o;a++)t=t.replace(r[a],"${c}"),n++;var i=t.match(S),c=i?i.length:0;if(i)for(a=0;a<c;a++)t=t.replace(i[a],"${n}"),n++;return function(e){for(var r=t,a=0;a<n;a++)r=r.replace(a<o?"${c}":"${n}",a<o?J.transform(e[a]):T(e[a]));return r}},getAnimatableNone:function(e){var t=Z.parse(e);return Z.createTransformer(e)(t.map(Q))}},ee=function(e){return function(t){return 1-e(1-t)}},te=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},ne=ee,re=te,oe=function(e){return function(t){return Math.pow(t,e)}},ae=function(e){return function(t){return t*t*((e+1)*t-e)}},ie=function(e){var t=ae(e);return function(e){return(e*=2)<1?.5*t(e):.5*(2-Math.pow(2,-10*(e-1)))}},ce=function(e){return e},se=oe(2),ue=ee(se),le=te(se),de=function(e){return 1-Math.sin(Math.acos(e))},fe=ee(de),pe=te(fe),he=ae(1.525),me=ee(he),ge=te(he),be=ie(1.525),ve=function(e){var t=e*e;return e<4/11?7.5625*t:e<8/11?9.075*t-9.9*e+3.4:e<.9?4356/361*t-35442/1805*e+16061/1805:10.8*e*e-20.52*e+10.72},ye=function(e){return 1-ve(1-e)},we=function(e){return e<.5?.5*(1-ve(1-2*e)):.5*ve(2*e-1)+.5},xe="undefined"!=typeof Float32Array,Oe=function(e,t){return 1-3*t+3*e},Ee=function(e,t){return 3*t-6*e},ke=function(e){return 3*e},Ce=function(e,t,n){return 3*Oe(t,n)*e*e+2*Ee(t,n)*e+ke(t)},_e=function(e,t,n){return((Oe(t,n)*e+Ee(t,n))*e+ke(t))*e};function je(e,t,n,r){var o=xe?new Float32Array(11):new Array(11),a=function(t){for(var r,a,i,c=0,s=1;10!==s&&o[s]<=t;++s)c+=.1;return--s,r=(t-o[s])/(o[s+1]-o[s]),(i=Ce(a=c+.1*r,e,n))>=.001?function(t,r){for(var o=0,a=0;o<8;++o){if(0===(a=Ce(r,e,n)))return r;r-=(_e(r,e,n)-t)/a}return r}(t,a):0===i?a:function(t,r,o){var a,i,c=0;do{(a=_e(i=r+(o-r)/2,e,n)-t)>0?o=i:r=i}while(Math.abs(a)>1e-7&&++c<10);return i}(t,c,c+.1)};!function(){for(var t=0;t<11;++t)o[t]=_e(.1*t,e,n)}();return function(o){return e===t&&n===r?o:0===o?0:1===o?1:_e(a(o),t,r)}}var Te={x:0,y:0,z:0},Se=function(e){return"number"==typeof e},Ie=function(e){return function(t,n,r){return void 0!==r?e(t,n,r):function(r){return e(t,n,r)}}},Ae=Ie((function(e,t,n){return Math.min(Math.max(n,e),t)})),Ne=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},Pe=function(e){return Ne(e)&&e.hasOwnProperty("z")},Me=function(e,t){return Math.abs(e-t)},Re=function(e,t){if(void 0===t&&(t=Te),Se(e)&&Se(t))return Me(e,t);if(Ne(e)&&Ne(t)){var n=Me(e.x,t.x),r=Me(e.y,t.y),o=Pe(e)&&Pe(t)?Me(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(r,2)+Math.pow(o,2))}return 0},Le=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r},De=function(e,t,n){return-n*e+n*t+e},Be=function(){return(Be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ze=function(e,t,n){var r=e*e,o=t*t;return Math.sqrt(Math.max(0,n*(o-r)+r))},Ue=[X,W,K],He=function(e){return Ue.find((function(t){return t.test(e)}))},Fe=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},$e=function(e,t){var n=He(e),r=He(t);Fe(e),Fe(t),n.transform,r.transform;var o=n.parse(e),a=r.parse(t),i=Be({},o),c=n===K?De:ze;return function(e){for(var t in i)"alpha"!==t&&(i[t]=c(o[t],a[t],e));return i.alpha=De(o.alpha,a.alpha,e),n.transform(i)}},qe=function(e,t){return function(n){return t(e(n))}},Ge=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(qe)};function Ye(e,t){return Se(e)?function(n){return De(e,t,n)}:J.test(e)?$e(e,t):Ke(e,t)}var Ve=function(e,t){var n=e.slice(),r=n.length,o=e.map((function(e,n){return Ye(e,t[n])}));return function(e){for(var t=0;t<r;t++)n[t]=o[t](e);return n}};function We(e){for(var t=Z.parse(e),n=t.length,r=0,o=0,a=0,i=0;i<n;i++)r||"number"==typeof t[i]?r++:void 0!==t[i].hue?a++:o++;return{parsed:t,numNumbers:r,numRGB:o,numHSL:a}}var Ke=function(e,t){var n=Z.createTransformer(t),r=We(e),o=We(t);return r.numHSL===o.numHSL&&r.numRGB===o.numRGB&&(r.numNumbers,o.numNumbers),Ge(Ve(r.parsed,o.parsed),n)};var Xe,Je=function(e){return e},Qe=function(e){return void 0===e&&(e=Je),Ie((function(t,n,r){var o=n-r,a=-(0-t+1)*(0-e(Math.abs(o)));return o<=0?n+a:n-a}))},Ze=(Qe(),Qe(Math.sqrt),function(e,t){return t?e*(1e3/t):0}),et=(Ie((function(e,t,n){var r=t-e;return((n-e)%r+r)%r+e})),Ae(0,1),function(e){var t=e.onRead,n=e.onRender,r=e.uncachedValues,o=void 0===r?new Set:r,a=e.useCache,i=void 0===a||a;return function(e){void 0===e&&(e={});var r=c(e,[]),a={},s=[],u=!1;function l(e,t){e.startsWith("--")&&(r.hasCSSVariable=!0);var n=a[e];a[e]=t,a[e]!==n&&(-1===s.indexOf(e)&&s.push(e),u||(u=!0,_.render(d.render)))}var d={get:function(e,n){return void 0===n&&(n=!1),!n&&i&&!o.has(e)&&void 0!==a[e]?a[e]:t(e,r)},set:function(e,t){if("string"==typeof e)l(e,t);else for(var n in e)l(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(u||!0===e)&&(n(a,r,s),u=!1,s.length=0),this}};return d}}),tt=/([a-z])([A-Z])/g,nt=function(e){return e.replace(tt,"$1-$2").toLowerCase()},rt=new Map,ot=new Map,at=["Webkit","Moz","O","ms",""],it=at.length,ct="undefined"!=typeof document,st=function(e,t){return ot.set(e,nt(t))},ut=function(e,t){void 0===t&&(t=!1);var n=t?ot:rt;return n.has(e)||(ct?function(e){Xe=Xe||document.createElement("div");for(var t=0;t<it;t++){var n=at[t],r=""===n,o=r?e:n+e.charAt(0).toUpperCase()+e.slice(1);if(o in Xe.style||r){if(r&&"clipPath"===e&&ot.has(e))return;rt.set(e,o),st(e,(r?"":"-")+nt(o))}}}(e):function(e){st(e,e)}(e)),n.get(e)||e},lt=["","X","Y","Z"],dt=["translate","scale","rotate","skew","transformPerspective"].reduce((function(e,t){return lt.reduce((function(e,n){return e.push(t+n),e}),e)}),["x","y","z"]),ft=dt.reduce((function(e,t){return e[t]=!0,e}),{});function pt(e){return!0===ft[e]}function ht(e,t){return dt.indexOf(e)-dt.indexOf(t)}var mt=new Set(["originX","originY","originZ"]);function gt(e){return mt.has(e)}var bt=i(i({},N),{transform:Math.round}),vt={color:J,backgroundColor:J,outlineColor:J,fill:J,stroke:J,borderColor:J,borderTopColor:J,borderRightColor:J,borderBottomColor:J,borderLeftColor:J,borderWidth:B,borderTopWidth:B,borderRightWidth:B,borderBottomWidth:B,borderLeftWidth:B,borderRadius:B,radius:B,borderTopLeftRadius:B,borderTopRightRadius:B,borderBottomRightRadius:B,borderBottomLeftRadius:B,width:B,maxWidth:B,height:B,maxHeight:B,size:B,top:B,right:B,bottom:B,left:B,padding:B,paddingTop:B,paddingRight:B,paddingBottom:B,paddingLeft:B,margin:B,marginTop:B,marginRight:B,marginBottom:B,marginLeft:B,rotate:L,rotateX:L,rotateY:L,rotateZ:L,scale:M,scaleX:M,scaleY:M,scaleZ:M,skew:L,skewX:L,skewY:L,distance:B,translateX:B,translateY:B,translateZ:B,x:B,y:B,z:B,perspective:B,opacity:P,originX:H,originY:H,originZ:B,zIndex:bt,fillOpacity:P,strokeOpacity:P,numOctaves:bt},yt=function(e){return vt[e]},wt=function(e,t){return t&&"number"==typeof e?t.transform(e):e},xt=new Set(["scrollLeft","scrollTop"]),Ot=new Set(["scrollLeft","scrollTop","transform"]),Et={x:"translateX",y:"translateY",z:"translateZ"};function kt(e){return"function"==typeof e}function Ct(e,t,n,r,o,a,i,c){void 0===t&&(t=!0),void 0===n&&(n={}),void 0===r&&(r={}),void 0===o&&(o={}),void 0===a&&(a=[]),void 0===i&&(i=!1),void 0===c&&(c=!0);var s=!0,u=!1,l=!1;for(var d in e){var f=e[d],p=yt(d),h=wt(f,p);pt(d)?(u=!0,r[d]=h,a.push(d),s&&(p.default&&f!==p.default||!p.default&&0!==f)&&(s=!1)):gt(d)?(o[d]=h,l=!0):Ot.has(d)&&kt(h)||(n[ut(d,i)]=h)}return(u||"function"==typeof e.transform)&&(n.transform=function(e,t,n,r,o,a){void 0===a&&(a=!0);var i="",c=!1;n.sort(ht);for(var s=n.length,u=0;u<s;u++){var l=n[u];i+=(Et[l]||l)+"("+t[l]+") ",c="z"===l||c}return!c&&o?i+="translateZ(0)":i=i.trim(),kt(e.transform)?i=e.transform(t,r?"":i):a&&r&&(i="none"),i}(e,r,a,s,t,c)),l&&(n.transformOrigin=(o.originX||"50%")+" "+(o.originY||"50%")+" "+(o.originZ||0)),n}function _t(e){var t=void 0===e?{}:e,n=t.enableHardwareAcceleration,r=void 0===n||n,o=t.isDashCase,a=void 0===o||o,i=t.allowTransformNone,c=void 0===i||i,s={},u={},l={},d=[];return function(e){return d.length=0,Ct(e,r,s,u,l,d,a,c),s}}var jt=et({onRead:function(e,t){var n=t.element,r=t.preparseOutput,o=yt(e);if(pt(e))return o&&o.default||0;if(xt.has(e))return n[e];var a=window.getComputedStyle(n,null).getPropertyValue(ut(e,!0))||0;return r&&o&&o.test(a)&&o.parse?o.parse(a):a},onRender:function(e,t,n){var r=t.element,o=t.buildStyles,a=t.hasCSSVariable;if(Object.assign(r.style,o(e)),a)for(var i=n.length,c=0;c<i;c++){var s=n[c];s.startsWith("--")&&r.style.setProperty(s,e[s])}-1!==n.indexOf("scrollLeft")&&(r.scrollLeft=e.scrollLeft),-1!==n.indexOf("scrollTop")&&(r.scrollTop=e.scrollTop)},uncachedValues:xt});var Tt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),St=function(e,t){return B.transform(e*t)},It={x:0,y:0,width:0,height:0};function At(e,t,n){return"string"==typeof e?e:B.transform(t+n*e)}var Nt={enableHardwareAcceleration:!1,isDashCase:!1};function Pt(e,t,n,r,o,a){void 0===t&&(t=It),void 0===r&&(r=_t(Nt)),void 0===o&&(o={style:{}}),void 0===a&&(a=!0);var i=e.attrX,s=e.attrY,u=e.originX,l=e.originY,d=e.pathLength,f=e.pathSpacing,p=void 0===f?1:f,h=e.pathOffset,m=void 0===h?0:h,g=r(c(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var b in g){if("transform"===b)o.style.transform=g[b];else o[a&&!Tt.has(b)?nt(b):b]=g[b]}return(void 0!==u||void 0!==l||g.transform)&&(o.style.transformOrigin=function(e,t,n){return At(t,e.x,e.width)+" "+At(n,e.y,e.height)}(t,void 0!==u?u:.5,void 0!==l?l:.5)),void 0!==i&&(o.x=i),void 0!==s&&(o.y=s),void 0!==n&&void 0!==d&&(o[a?"stroke-dashoffset":"strokeDashoffset"]=St(-m,n),o[a?"stroke-dasharray":"strokeDasharray"]=St(d,n)+" "+St(p,n)),o}function Mt(e,t,n){void 0===n&&(n=!0);var r={style:{}},o=_t(Nt);return function(a){return Pt(a,e,t,o,r,n)}}var Rt=et({onRead:function(e,t){var n=t.element;if(pt(e=Tt.has(e)?e:nt(e))){var r=yt(e);return r&&r.default||0}return n.getAttribute(e)},onRender:function(e,t){var n=t.element,r=(0,t.buildAttrs)(e);for(var o in r)"style"===o?Object.assign(n.style,r.style):n.setAttribute(o,r[o])}}),Lt=et({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,n=void 0===t?0:t,r=e.scrollLeft,o=void 0===r?0:r;return window.scrollTo(o,n)}}),Dt=new WeakMap,Bt=function(e,t){var n,r,o,a;return e===window?n=Lt(e):!function(e){return e instanceof HTMLElement||"function"==typeof e.click}(e)?function(e){return e instanceof SVGElement||"ownerSVGElement"in e}(e)&&(o=function(e){try{return function(e){return"function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}(e)}catch(e){return{x:0,y:0,width:0,height:0}}}(r=e),a=function(e){return"path"===e.tagName}(r)&&r.getTotalLength?r.getTotalLength():void 0,n=Rt({element:r,buildAttrs:Mt(o,a)})):n=function(e,t){void 0===t&&(t={});var n=t.enableHardwareAcceleration,r=t.allowTransformNone,o=c(t,["enableHardwareAcceleration","allowTransformNone"]);return jt(i({element:e,buildStyles:_t({enableHardwareAcceleration:n,allowTransformNone:r}),preparseOutput:!0},o))}(e,t),Dt.set(e,n),n};var zt=function(e,t){return function(e,t){return Dt.has(e)?Dt.get(e):Bt(e,t)}("string"==typeof e?document.querySelector(e):e,t)},Ut=function(){return function(e,t){var n=this,r=e.middleware,o=e.onComplete;this.isActive=!0,this.update=function(e){n.observer.update&&n.updateObserver(e)},this.complete=function(){n.observer.complete&&n.isActive&&n.observer.complete(),n.onComplete&&n.onComplete(),n.isActive=!1},this.error=function(e){n.observer.error&&n.isActive&&n.observer.error(e),n.isActive=!1},this.observer=t,this.updateObserver=function(e){return t.update(e)},this.onComplete=o,t.update&&r&&r.length&&r.forEach((function(e){return n.updateObserver=e(n.updateObserver,n.complete)}))}}(),Ht=function(e,t,n){var r=t.middleware;return new Ut({middleware:r,onComplete:n},"function"==typeof e?{update:e}:e)},Ft=function(){function e(e){void 0===e&&(e={}),this.props=e}return e.prototype.create=function(t){return new e(t)},e.prototype.start=function(e){void 0===e&&(e={});var t=!1,n={stop:function(){}},r=this.props,o=r.init,a=c(r,["init"]),s=o(Ht(e,a,(function(){t=!0,n.stop()})));return n=s?i({},n,s):n,t&&n.stop(),n},e.prototype.applyMiddleware=function(e){return this.create(i({},this.props,{middleware:this.props.middleware?[e].concat(this.props.middleware):[e]}))},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=1===e.length?e[0]:Ge.apply(void 0,e);return this.applyMiddleware((function(e){return function(t){return e(n(t))}}))},e}(),$t=function(e){return new Ft({init:e})},qt=[B,D,L,z,U],Gt=function(e){return qt.find((function(t){return t.test(e)}))},Yt=function(e,t){return e(t)},Vt=function(e,t){var n=t.from,r=t.to,o=c(t,["from","to"]),a=Gt(n)||Gt(r),s=a.transform,u=a.parse;return e(i({},o,{from:"string"==typeof n?u(n):n,to:"string"==typeof r?u(r):r})).pipe(s)},Wt=function(e){return function(t,n){var r=n.from,o=n.to,a=c(n,["from","to"]);return t(i({},a,{from:0,to:1})).pipe(e(r,o))}},Kt=Wt($e),Xt=Wt(Ke),Jt=function(e,t){var n=function(e){var t=Object.keys(e),n=function(t,n){return void 0!==t&&!e[n](t)};return{getVectorKeys:function(e){return t.reduce((function(t,r){return n(e[r],r)&&t.push(r),t}),[])},testVectorProps:function(e){return e&&t.some((function(t){return n(e[t],t)}))}}}(t),r=n.testVectorProps,o=n.getVectorKeys;return function(t){if(!r(t))return e(t);var n=o(t),a=t[n[0]];return Qt(a)(e,t,n)}},Qt=function(e){return"number"==typeof e?Yt:function(e){return Boolean(Gt(e))}(e)?Vt:J.test(e)?Kt:Z.test(e)?Xt:Yt},Zt=Jt((function(e){return void 0===e&&(e={}),$t((function(t){var n=t.complete,r=t.update,o=e.velocity,a=void 0===o?0:o,i=e.from,c=void 0===i?0:i,s=e.power,u=void 0===s?.8:s,l=e.timeConstant,d=void 0===l?350:l,f=e.restDelta,p=void 0===f?.5:f,h=e.modifyTarget,m=0,g=u*a,b=Math.round(c+g),v=void 0===h?b:h(b),y=_.update((function(e){var t=e.delta;m+=t;var o=-g*Math.exp(-m/d),a=o>p||o<-p;r(a?v+o:v),a||(x.update(y),n())}),!0);return{stop:function(){return x.update(y)}}}))}),{from:N.test,modifyTarget:function(e){return"function"==typeof e},velocity:N.test}),en=Jt((function(e){return void 0===e&&(e={}),$t((function(t){var n=t.update,r=t.complete,o=e.velocity,a=void 0===o?0:o,i=e.from,c=void 0===i?0:i,s=e.to,u=void 0===s?0:s,l=e.stiffness,d=void 0===l?100:l,f=e.damping,p=void 0===f?10:f,h=e.mass,m=void 0===h?1:h,g=e.restSpeed,b=void 0===g?.01:g,v=e.restDelta,y=void 0===v?.01:v,w=a?-a/1e3:0,O=0,E=u-c,k=c,C=k,j=_.update((function(e){var t=e.delta;O+=t;var o=p/(2*Math.sqrt(d*m)),i=Math.sqrt(d/m)/1e3;if(C=k,o<1){var c=Math.exp(-o*i*O),s=i*Math.sqrt(1-o*o);k=u-c*((w+o*i*E)/s*Math.sin(s*O)+E*Math.cos(s*O))}else{c=Math.exp(-i*O);k=u-c*(E+(w+i*E)*O)}a=Ze(k-C,t);var l=Math.abs(a)<=b,f=Math.abs(u-k)<=y;l&&f?(n(k=u),x.update(j),r()):n(k)}),!0);return{stop:function(){return x.update(j)}}}))}),{from:N.test,to:N.test,stiffness:N.test,damping:N.test,mass:N.test,velocity:N.test}),tn=Jt((function(e){var t=e.from,n=void 0===t?0:t,r=e.velocity,o=void 0===r?0:r,a=e.min,c=e.max,s=e.power,u=void 0===s?.8:s,l=e.timeConstant,d=void 0===l?700:l,f=e.bounceStiffness,p=void 0===f?500:f,h=e.bounceDamping,m=void 0===h?10:h,g=e.restDelta,b=void 0===g?1:g,v=e.modifyTarget;return $t((function(e){var t,r=e.update,s=e.complete,l=n,f=n,h=!1,g=function(e){return void 0!==a&&e<=a},y=function(e){return void 0!==c&&e>=c},w=function(e){return g(e)||y(e)},x=function(e){r(e),l=f,o=Ze((f=e)-l,C().delta),t&&!h&&function(e,t){return g(e)&&t<0||y(e)&&t>0}(e,o)&&E({from:e,velocity:o})},O=function(e,n){t&&t.stop(),t=e.start({update:x,complete:function(){n?n():s()}})},E=function(e){h=!0,O(en(i({},e,{to:g(e.from)?a:c,stiffness:p,damping:m,restDelta:b})))};if(w(n))E({from:n,velocity:o});else if(0!==o){var k=Zt({from:n,velocity:o,timeConstant:d,power:u,restDelta:w(n)?20:b,modifyTarget:v});O(k,(function(){w(f)?E({from:f,velocity:o}):s()}))}else s();return{stop:function(){return t&&t.stop()}}}))}),{from:N.test,velocity:N.test,min:N.test,max:N.test,damping:N.test,stiffness:N.test,modifyTarget:function(e){return"function"==typeof e}}),nn=Jt((function(e){var t=e.from,n=void 0===t?0:t,r=e.to,o=void 0===r?1:r,a=e.ease,i=void 0===a?ce:a,c=e.reverseEase;return void 0!==c&&c&&(i=ne(i)),$t((function(e){var t=e.update;return{seek:function(e){return t(e)}}})).pipe(i,(function(e){return De(n,o,e)}))}),{ease:function(e){return"function"==typeof e},from:N.test,to:N.test}),rn=Ae(0,1),on=function(e){return void 0===e&&(e={}),$t((function(t){var n,r=t.update,o=t.complete,a=e.duration,i=void 0===a?300:a,c=e.ease,s=void 0===c?ue:c,u=e.flip,l=void 0===u?0:u,d=e.loop,f=void 0===d?0:d,p=e.yoyo,h=void 0===p?0:p,m=e.repeatDelay,g=void 0===m?0:m,b=e.from,v=void 0===b?0:b,y=e.to,w=void 0===y?1:y,O=e.elapsed,E=void 0===O?0:O,k=e.flipCount,C=void 0===k?0:k,j=e.yoyoCount,T=void 0===j?0:j,S=e.loopCount,I=void 0===S?0:S,A=nn({from:v,to:w,ease:s}).start(r),N=0,P=!1,M=function(e){var t;void 0===e&&(e=!1),A=nn({from:v=(t=[w,v])[0],to:w=t[1],ease:s,reverseEase:e}).start(r)},R=function(){N=rn(Le(0,i,E)),A.seek(N)},L=function(){P=!0,n=_.update((function(e){var t,r=e.delta;E+=r,R(),!(t=P&&E>i+g)||(!t||f||l||h)&&(E=E-i-g,f&&I<f?(I++,1):l&&C<l?(C++,M(),1):h&&T<h&&(T++,M(T%2!=0),1))||(x.update(n),o&&_.update(o,!1,!0))}),!0)},D=function(){P=!1,n&&x.update(n)};return L(),{isActive:function(){return P},getElapsed:function(){return Ae(0,i,E)},getProgress:function(){return N},stop:function(){D()},pause:function(){return D(),this},resume:function(){return P||L(),this},seek:function(e){return E=De(0,i,e),_.update(R,!1,!0),this},reverse:function(){return M(),this}}}))},an=Ae(0,1),cn=function(e){var t=e.easings,n=e.ease,r=void 0===n?ce:n,o=e.times,a=e.values,s=c(e,["easings","ease","times","values"]);t=Array.isArray(t)?t:function(e,t){return e.map((function(){return t||ue})).splice(0,e.length-1)}(a,t),o=o||function(e){var t=e.length;return e.map((function(e,n){return 0!==n?n/(t-1):0}))}(a);var u=t.map((function(e,t){return nn({from:a[t],to:a[t+1],ease:e})}));return on(i({},s,{ease:r})).applyMiddleware((function(e){return function(e,t,n){var r=e.length,o=r-1,a=o-1,i=t.map((function(e){return e.start(n)}));return function(t){t<=e[0]&&i[0].seek(0),t>=e[o]&&i[a].seek(1);for(var n=1;n<r&&!(e[n]>t||n===o);n++);var c=Le(e[n-1],e[n],t);i[n-1].seek(an(c))}}(o,u,e)}))},sn=function(e,t,n){return $t((function(r){var o=r.update,a=t.split(" ").map((function(t){return e.addEventListener(t,o,n),t}));return{stop:function(){return a.forEach((function(t){return e.removeEventListener(t,o,n)}))}}}))},un=function(){return{clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}},ln=function(e,t){return void 0===t&&(t={clientX:0,clientY:0,pageX:0,pageY:0,x:0,y:0}),t.clientX=t.x=e.clientX,t.clientY=t.y=e.clientY,t.pageX=e.pageX,t.pageY=e.pageY,t},dn=[un()];if("undefined"!=typeof document){sn(document,"touchstart touchmove",{passive:!0,capture:!0}).start((function(e){var t=e.touches;!0;var n=t.length;dn.length=0;for(var r=0;r<n;r++){var o=t[r];dn.push(ln(o))}}))}var fn=un();if("undefined"!=typeof document){sn(document,"mousedown mousemove",!0).start((function(e){!0,ln(e,fn)}))}var pn=function(e){return $t((function(t){var n=t.complete,r=setTimeout(n,e);return{stop:function(){return clearTimeout(r)}}}))},hn=function(){function e(e,t){var n,r=this,o=void 0===t?{}:t,a=o.transformer,i=o.parent;this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.updateAndNotify=function(e,t){void 0===t&&(t=!0),r.prev=r.current,r.current=r.transformer?r.transformer(e):e,r.updateSubscribers&&r.prev!==r.current&&r.updateSubscribers.forEach(r.notifySubscriber),r.children&&r.children.forEach(r.setChild),t&&r.renderSubscribers&&r.renderSubscribers.forEach(r.notifySubscriber);var n=C(),o=n.delta,a=n.timestamp;r.lastUpdated!==a&&(r.timeDelta=o,r.lastUpdated=a,_.postRender(r.scheduleVelocityCheck))},this.notifySubscriber=function(e){e(r.current)},this.scheduleVelocityCheck=function(){return _.postRender(r.velocityCheck)},this.velocityCheck=function(e){e.timestamp!==r.lastUpdated&&(r.prev=r.current)},this.setChild=function(e){return e.set(r.current)},this.parent=i,this.transformer=a,this.set(e,!1),this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n)))}return e.prototype.addChild=function(t){void 0===t&&(t={});var n=new e(this.current,i({parent:this},t));return this.children||(this.children=new Set),this.children.add(n),n},e.prototype.removeChild=function(e){this.children&&this.children.delete(e)},e.prototype.subscribeTo=function(e,t){var n=this,r=function(){return t(n.current)};return e.add(r),function(){return e.delete(r)}},e.prototype.onChange=function(e){return this.updateSubscribers||(this.updateSubscribers=new Set),this.subscribeTo(this.updateSubscribers,e)},e.prototype.onRenderRequest=function(e){return this.renderSubscribers||(this.renderSubscribers=new Set),this.notifySubscriber(e),this.subscribeTo(this.renderSubscribers,e)},e.prototype.attach=function(e){this.passiveEffect=e},e.prototype.set=function(e,t){void 0===t&&(t=!0),t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)},e.prototype.get=function(){return this.current},e.prototype.getVelocity=function(){return this.canTrackVelocity?Ze(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},e.prototype.start=function(e){var t=this;return this.stop(),new Promise((function(n){t.stopAnimation=e(n)})).then((function(){return t.clearAnimation()}))},e.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},e.prototype.isAnimating=function(){return!!this.stopAnimation},e.prototype.clearAnimation=function(){this.stopAnimation=null},e.prototype.destroy=function(){this.updateSubscribers&&this.updateSubscribers.clear(),this.renderSubscribers&&this.renderSubscribers.clear(),this.parent&&this.parent.removeChild(this),this.stop()},e}();function mn(e,t){return new hn(e,t)}function gn(e){var t=Object(u.useRef)(null);return null===t.current&&(t.current=e()),t.current}var bn,vn=function(e){return e instanceof hn},yn=et({onRead:function(){return null},onRender:function(e,t){return(0,t.onUpdate)(e)}}),wn=function(){function e(){this.hasMounted=!1,this.values=new Map,this.unsubscribers=new Map}return e.prototype.has=function(e){return this.values.has(e)},e.prototype.set=function(e,t){this.values.set(e,t),this.hasMounted&&this.bindValueToOutput(e,t)},e.prototype.get=function(e,t){var n=this.values.get(e);return void 0===n&&void 0!==t&&(n=new hn(t),this.set(e,n)),n},e.prototype.forEach=function(e){return this.values.forEach(e)},e.prototype.bindValueToOutput=function(e,t){var n=this,r=t.onRenderRequest((function(t){return n.output&&n.output(e,t)})),o=t.onChange((function(t){n.onUpdate&&n.onUpdate.set(e,t)}));this.unsubscribers.has(e)&&this.unsubscribers.get(e)(),this.unsubscribers.set(e,(function(){r(),o()}))},e.prototype.setOnUpdate=function(e){this.onUpdate=void 0,e&&(this.onUpdate=yn({onUpdate:e}))},e.prototype.setTransformTemplate=function(e){this.transformTemplate!==e&&(this.transformTemplate=e,this.updateTransformTemplate())},e.prototype.getTransformTemplate=function(){return this.transformTemplate},e.prototype.updateTransformTemplate=function(){this.output&&this.output("transform",this.transformTemplate)},e.prototype.mount=function(e){var t=this;this.hasMounted=!0,e&&(this.output=e),this.values.forEach((function(e,n){return t.bindValueToOutput(n,e)})),this.updateTransformTemplate()},e.prototype.unmount=function(){var e=this;this.values.forEach((function(t,n){var r=e.unsubscribers.get(n);r&&r()}))},e}(),xn=new Set(["dragOriginX","dragOriginY"]),On=function(e){var t=gn((function(){var t=new wn;for(var n in e)vn(e[n])&&!xn.has(n)&&t.set(n,e[n]);return t}));return t.setOnUpdate(e.onUpdate),t.setTransformTemplate(e.transformTemplate),t},En=null,kn=function(){return null!==En},Cn=function(){En=[]},_n=function(){En&&En.forEach((function(e){return e.render()})),En=null},jn=function(e){En&&En.push(e)},Tn=Object(u.memo)((function(e){var t=e.innerRef,n=e.values,r=e.isStatic;return Object(u.useEffect)((function(){t.current,Element;var e=zt(t.current,{preparseOutput:!1,enableHardwareAcceleration:!r});return n.mount((function(t,n){e.set(t,n),kn()&&jn(e)})),function(){return n.unmount()}}),[]),null})),Sn=(bn=function(e){return e.get()},function(e){var t={};return e.forEach((function(e,n){return t[n]=bn(e)})),t}),In=new Set(["originX","originY","originZ"]),An=function(e){return In.has(e)},Nn=function(e,t,n){var r=Sn(e),o=e.getTransformTemplate();return o&&(r.transform=t.transform?o({},t.transform):o),Ct(i(i({},t),r),!n)},Pn=function(e){return Array.isArray(e)},Mn=function(e){return Pn(e)?e[e.length-1]||0:e},Rn=[N,B,D,L,U,z,{test:function(e){return"auto"===e},parse:function(e){return e}}],Ln=s(Rn,[J,Z]),Dn=function(e){return function(t){return t.test(e)}},Bn=function(e){return Rn.find(Dn(e))},zn=function(e){return Ln.find(Dn(e))},Un=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},Hn=function(e){return{type:"spring",stiffness:700,damping:0===e?100:35}},Fn=function(){return{ease:"linear",duration:.3}},$n=function(e){return{type:"keyframes",duration:.8,values:e}},qn={x:Un,y:Un,z:Un,rotate:Un,rotateX:Un,rotateY:Un,rotateZ:Un,scaleX:Hn,scaleY:Hn,scale:Hn,opacity:Fn,backgroundColor:Fn,color:Fn,default:Hn},Gn=function(e){var t=e.to,n=e.duration;return $t((function(e){var r=e.update,o=e.complete;r(t),n?pn(n).start({complete:o}):o()}))},Yn=function(e){return Array.isArray(e)?(e.length,je(e[0],e[1],e[2],e[3])):"string"==typeof e?r[e]:e},Vn=function(e){return Array.isArray(e)&&"number"!=typeof e[0]},Wn=function(e,t){return"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!Z.test(t)||t.startsWith("url(")))},Kn=function(e){return 1e3*e},Xn={tween:on,spring:en,keyframes:cn,inertia:tn,just:Gn},Jn={tween:function(e){if(e.ease){var t=Vn(e.ease)?e.ease[0]:e.ease;e.ease=Yn(t)}return e},keyframes:function(e){var t=e.from,n=(e.to,e.velocity,c(e,["from","to","velocity"]));if(n.values&&null===n.values[0]){var r=s(n.values);r[0]=t,n.values=r}return n.ease&&(n.easings=Vn(n.ease)?n.ease.map(Yn):Yn(n.ease)),n.ease=ce,n}},Qn=function(e,t,n){var r=n?n.delay:0;if(void 0===n||!function(e){e.when,e.delay,e.delayChildren,e.staggerChildren,e.staggerDirection;var t=c(e,["when","delay","delayChildren","staggerChildren","staggerDirection"]);return Object.keys(t).length}(n))return i({delay:r},function(e,t){var n;return n=Pn(t)?$n:qn[e]||qn.default,i({to:t},n(t))}(e,t));var o=n[e]||n.default||n;return!1===o.type?{delay:o.hasOwnProperty("delay")?o.delay:r,to:Pn(t)?t[t.length-1]:t,type:"just"}:Pn(t)?i(i({values:t,duration:.8,delay:r,ease:"linear"},o),{type:"keyframes"}):i({type:"tween",to:t,delay:r},o)},Zn=function(e,t,n,r){var o,a=t.get(),s=Wn(e,a),u=Wn(e,n),l=Qn(e,n,r),d=l.type,f=void 0===d?"tween":d,p=c(l,["type"]),h=s&&u?Xn[f]:Gn,m=function(e,t){return Jn[e]?Jn[e](t):t}(f,i({from:a,velocity:t.getVelocity()},p));return((o=m).hasOwnProperty("duration")||o.hasOwnProperty("repeatDelay"))&&(m.duration&&(m.duration=Kn(m.duration)),m.repeatDelay&&(m.repeatDelay=Kn(m.repeatDelay))),[h,m]};function er(e,t,n,r){var o=r.delay,a=void 0===o?0:o,i=c(r,["delay"]);return t.start((function(r){var o,s=Zn(e,t,n,i),u=s[0],l=s[1],d=l.delay,f=c(l,["delay"]);void 0!==d&&(a=d);var p=function(){var e=u(f);o=e.start({update:function(e){return t.set(e)},complete:r})};return a?o=pn(Kn(a)).start({complete:p}):p(),function(){o&&o.stop()}}))}var tr=function(){function e(e){var t=this,n=e.values,r=e.readValueFromSource,o=e.makeTargetAnimatable;this.props={},this.variants={},this.baseTarget={},this.overrides=[],this.resolvedOverrides=[],this.activeOverrides=new Set,this.isAnimating=new Set,this.hasValue=function(e){return!t.values.has(e)},this.values=n,this.readValueFromSource=r,this.makeTargetAnimatable=o,this.values.forEach((function(e,n){return t.baseTarget[n]=e.get()}))}return e.prototype.setProps=function(e){this.props=e},e.prototype.setVariants=function(e){e&&(this.variants=e)},e.prototype.setDefaultTransition=function(e){e&&(this.defaultTransition=e)},e.prototype.setValues=function(e,t){var n=this,r=void 0===t?{}:t,o=r.isActive,a=void 0===o?new Set:o,c=r.priority,s=this.resolveVariant(e),u=s.target,l=s.transitionEnd;return u=this.transformValues(i(i({},u),l)),Object.keys(u).forEach((function(e){if(!a.has(e)&&(a.add(e),u)){var t=Mn(u[e]);if(n.values.has(e)){var r=n.values.get(e);r&&r.set(t)}else n.values.set(e,mn(t));c||(n.baseTarget[e]=t)}}))},e.prototype.transformValues=function(e){var t=this.props.transformValues;return t?t(e):e},e.prototype.checkForNewValues=function(e){var t=Object.keys(e).filter(this.hasValue),n=t.length;if(n)for(var r=0;r<n;r++){var o=t[r],a=e[o],i=null;Array.isArray(a)&&(i=a[0]),null===i&&(i=this.readValueFromSource(o)),"string"==typeof i&&/^\d*\.?\d+$/.test(i)?i=parseFloat(i):!zn(i)&&Z.test(a)&&(i=Z.getAnimatableNone(a)),this.values.set(o,mn(i)),this.baseTarget[o]=i}},e.prototype.resolveVariant=function(e){if(!e)return{target:void 0,transition:void 0,transitionEnd:void 0};var t,n;"function"==typeof e&&(e=e(this.props.custom,(t=this.values,n={},t.forEach((function(e,t){return n[t]=e.get()})),n),function(e){var t={};return e.forEach((function(e,n){return t[n]=e.getVelocity()})),t}(this.values)));var r=e.transition;return{transition:void 0===r?this.defaultTransition:r,transitionEnd:e.transitionEnd,target:c(e,["transition","transitionEnd"])}},e.prototype.getHighestPriority=function(){return this.activeOverrides.size?Math.max.apply(Math,Array.from(this.activeOverrides)):0},e.prototype.setOverride=function(e,t){this.overrides[t]=e,this.children&&this.children.forEach((function(n){return n.setOverride(e,t)}))},e.prototype.startOverride=function(e){var t=this.overrides[e];if(t)return this.start(t,{priority:e})},e.prototype.clearOverride=function(e){var t=this;if(this.children&&this.children.forEach((function(t){return t.clearOverride(e)})),this.overrides[e]){this.activeOverrides.delete(e);var n=this.getHighestPriority();if(this.resetIsAnimating(),n)this.overrides[n]&&this.startOverride(n);var r=this.resolvedOverrides[e];if(r){var o={};for(var a in this.baseTarget)void 0!==r[a]&&(o[a]=this.baseTarget[a]);this.onStart(),this.animate(o).then((function(){return t.onComplete()}))}}},e.prototype.apply=function(e){return Array.isArray(e)?this.applyVariantLabels(e):"string"==typeof e?this.applyVariantLabels([e]):void this.setValues(e)},e.prototype.applyVariantLabels=function(e){var t=this,n=new Set;s(e).reverse().forEach((function(r){var o=t.resolveVariant(t.variants[r]),a=o.target,i=o.transitionEnd;i&&t.setValues(i,{isActive:n}),a&&t.setValues(a,{isActive:n}),t.children&&t.children.size&&t.children.forEach((function(t){return t.applyVariantLabels(e)}))}))},e.prototype.start=function(e,t){var n,r,o=this;return void 0===t&&(t={}),t.priority&&this.activeOverrides.add(t.priority),this.resetIsAnimating(t.priority),r=e,n=Array.isArray(r)?this.animateVariantLabels(e,t):"string"==typeof e?this.animateVariant(e,t):this.animate(e,t),this.onStart(),n.then((function(){return o.onComplete()}))},e.prototype.animate=function(e,t){var n=this,r=void 0===t?{}:t,o=r.delay,a=void 0===o?0:o,c=r.priority,s=void 0===c?0:c,u=r.transitionOverride,l=this.resolveVariant(e),d=l.target,f=l.transition,p=l.transitionEnd;if(u&&(f=u),!d)return Promise.resolve();if(d=this.transformValues(d),p&&(p=this.transformValues(p)),this.checkForNewValues(d),this.makeTargetAnimatable){var h=this.makeTargetAnimatable(d,p);d=h.target,p=h.transitionEnd}s&&(this.resolvedOverrides[s]=d),this.checkForNewValues(d);var m=[];for(var g in d){var b=this.values.get(g);if(b&&d&&void 0!==d[g]){var v=d[g];s||(this.baseTarget[g]=Mn(v)),this.isAnimating.has(g)||(this.isAnimating.add(g),m.push(er(g,b,v,i({delay:a},f))))}}var y=Promise.all(m);return p?y.then((function(){n.setValues(p,{priority:s})})):y},e.prototype.animateVariantLabels=function(e,t){var n=this,r=s(e).reverse().map((function(e){return n.animateVariant(e,t)}));return Promise.all(r)},e.prototype.animateVariant=function(e,t){var n=this,r=!1,o=0,a=0,i=1,c=t&&t.priority||0,s=this.variants[e],u=s?function(){return n.animate(s,t)}:function(){return Promise.resolve()},l=this.children?function(){return n.animateChildren(e,o,a,i,c)}:function(){return Promise.resolve()};if(s&&this.children){var d=this.resolveVariant(s).transition;d&&(r=d.when||r,o=d.delayChildren||o,a=d.staggerChildren||a,i=d.staggerDirection||i)}if(r){var f="beforeChildren"===r?[u,l]:[l,u],p=f[1];return(0,f[0])().then(p)}return Promise.all([u(),l()])},e.prototype.animateChildren=function(e,t,n,r,o){if(void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===o&&(o=0),!this.children)return Promise.resolve();var a=[],i=(this.children.size-1)*n,c=1===r?function(e){return e*n}:function(e){return i-e*n};return Array.from(this.children).forEach((function(n,r){var i=n.animateVariant(e,{priority:o,delay:t+c(r)});a.push(i)})),Promise.all(a)},e.prototype.onStart=function(){var e=this.props.onAnimationStart;e&&e()},e.prototype.onComplete=function(){var e=this.props.onAnimationComplete;e&&e()},e.prototype.checkOverrideIsAnimating=function(e){for(var t=this.overrides.length,n=e+1;n<t;n++){var r=this.resolvedOverrides[n];if(r)for(var o in r)this.isAnimating.add(o)}},e.prototype.resetIsAnimating=function(e){void 0===e&&(e=0),this.isAnimating.clear(),e<this.getHighestPriority()&&this.checkOverrideIsAnimating(e),this.children&&this.children.forEach((function(t){return t.resetIsAnimating(e)}))},e.prototype.stop=function(){this.values.forEach((function(e){return e.stop()}))},e.prototype.addChild=function(e){this.children||(this.children=new Set),this.children.add(e),this.overrides.forEach((function(t,n){t&&e.setOverride(t,n)}))},e.prototype.removeChild=function(e){this.children&&this.children.delete(e)},e.prototype.resetChildren=function(){this.children&&this.children.clear()},e}();var nr=function(){function e(){this.hasMounted=!1,this.pendingAnimations=[],this.componentControls=new Set}return e.prototype.setVariants=function(e){this.variants=e,this.componentControls.forEach((function(t){return t.setVariants(e)}))},e.prototype.setDefaultTransition=function(e){this.defaultTransition=e,this.componentControls.forEach((function(t){return t.setDefaultTransition(e)}))},e.prototype.subscribe=function(e){var t=this;return this.componentControls.add(e),this.variants&&e.setVariants(this.variants),this.defaultTransition&&e.setDefaultTransition(this.defaultTransition),function(){return t.componentControls.delete(e)}},e.prototype.start=function(e,t){var n=this;if(this.hasMounted){var r=[];return this.componentControls.forEach((function(n){var o=n.start(e,{transitionOverride:t});r.push(o)})),Promise.all(r)}return new Promise((function(r){n.pendingAnimations.push({animation:[e,t],resolve:r})}))},e.prototype.set=function(e){return this.hasMounted,this.componentControls.forEach((function(t){return t.apply(e)}))},e.prototype.stop=function(){this.componentControls.forEach((function(e){return e.stop()}))},e.prototype.mount=function(){var e=this;this.hasMounted=!0,this.pendingAnimations.forEach((function(t){var n=t.animation,r=t.resolve;return e.start.apply(e,n).then(r)}))},e.prototype.unmount=function(){this.hasMounted=!1,this.stop()},e}(),rr=Object(u.createContext)(null),or=Object(u.createContext)({static:!1}),ar=function(e){return"string"==typeof e||Array.isArray(e)},ir=function(e){return e instanceof nr},cr=function(e,t,n,r,o){void 0===r&&(r=!1);var a,i,c=o.initial,s=o.animate,l=o.variants,d=o.whileTap,f=o.whileHover,p=Object(u.useContext)(rr);void 0!==(null===(a=p)||void 0===a?void 0:a.initial)&&(c=p.initial),!1!==c||ir(s)?"boolean"!=typeof c&&(i=c):i=s;var h=Object(u.useRef)(!1),m=l||ar(s)||ar(d)||ar(f)||ir(s),g=ar(i)?i:e.initial,b=ar(s)?s:e.animate,v=r?g:null,y=m&&ar(b)?b:null,w=Object(u.useMemo)((function(){return{controls:m?t:e.controls,initial:g,animate:b,values:n,hasMounted:h,isReducedMotion:e.isReducedMotion}}),[v,y,e.isReducedMotion]);return w.static=r,function(e,t){void 0===t&&(t=!1);var n=Object(u.useRef)(!0);(!t||t&&n.current)&&e(),n.current=!1}((function(){var n=i||e.initial;n&&t.apply(n)}),!r),Object(u.useEffect)((function(){h.current=!0}),[]),w};function sr(e,t,n){var r=t.variants,o=t.transition,a=Object(u.useContext)(or).controls,i=Object(u.useContext)(rr),s=gn((function(){return new tr(e)}));return i&&!i.isPresent||(s.resetChildren(),s.setProps(t),s.setVariants(r),s.setDefaultTransition(o)),Object(u.useEffect)((function(){n&&a&&a.addChild(s)})),Object(u.useEffect)((function(){return function(){t.onAnimationComplete;var e=c(t,["onAnimationComplete"]);s.setProps(e),a&&a.removeChild(s)}}),[]),s}var ur=function(e){var t=e.animate,n=e.variants,r=e.inherit;return(void 0===r||r)&&!!n&&(!t||t instanceof nr)};var lr=function(e){var t=e.getValueControlsConfig,n=e.loadFunctionalityComponents,r=e.renderComponent;return Object(u.forwardRef)((function(e,o){var a=function(e){var t=e&&"function"!=typeof e?e:Object(u.useRef)(null);return e&&"function"==typeof e&&Object(u.useEffect)((function(){return e(t.current),function(){return e(null)}}),[]),t}(o),i=Object(u.useContext)(or),c=i.static||e.static||!1,s=On(e),l=function(e,t,n,r){void 0===t&&(t={});var o={},a=Object(u.useRef)({}).current;for(var i in t){var c=t[i];if(vn(c))e.set(i,c);else if(n||!pt(i)&&!An(i))o[i]=c;else{if(e.has(i)){if(c!==a[i])e.get(i).set(c)}else e.set(i,mn(c));a[i]=c}}return r?r(o):o}(s,e.style,c,e.transformValues),d=ur(e),f=sr(gn((function(){return t(a,s)})),e,d),p=cr(i,f,s,c,e),h=c?null:n(a,s,e,i,f,d),m=r(a,l,s,e,c);return Object(u.createElement)(u.Fragment,null,Object(u.createElement)(or.Provider,{value:p},m),Object(u.createElement)(u.Fragment,null,Object(u.createElement)(Tn,{innerRef:a,values:s,isStatic:c}),h))}))},dr=["animate","circle","clipPath","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","foreignObject","g","image","line","linearGradient","marker","mask","metadata","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","switch","symbol","text","textPath","tspan","use","view"],fr=Object(u.createContext)({transformPagePoint:function(e){return e}});function pr(e){return Object(u.useEffect)((function(){return function(){return e()}}),[])}function hr(e,t,n,r){if(n)return e.addEventListener(t,n,r),function(){return e.removeEventListener(t,n,r)}}function mr(e){return"undefined"!=typeof PointerEvent&&e instanceof PointerEvent?!("mouse"!==e.pointerType):e instanceof MouseEvent}function gr(e){return!!e.touches}var br={pageX:0,pageY:0};function vr(e){var t=e.pageX,n=void 0===t?0:t,r=e.pageY;return{x:n,y:void 0===r?0:r}}function yr(e){return{point:gr(e)?(t=e,n=t.touches[0]||t.changedTouches[0]||br,{x:n.pageX,y:n.pageY}):vr(e)};var t,n}var wr,xr=function(e,t){if(void 0===t&&(t=!1),e){var n=function(t){return e(t,yr(t))};return t?function(e){if(e)return function(t){var n=t instanceof MouseEvent;(!n||n&&0===t.button)&&e(t)}}(n):n}},Or="undefined"!=typeof window,Er={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},kr={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Cr(e){return Or&&null===window.onpointerdown?e:Or&&null===window.ontouchstart?kr[e]:Or&&null===window.onmousedown?Er[e]:e}function _r(e,t,n,r){return hr(e,Cr(t),xr(n,"pointerdown"===t),r)}function jr(e,t,n,r){return function(e,t,n,r){Object(u.useEffect)((function(){var o=e.current;if(n&&o)return hr(o,t,n,r)}),[e,t,n,r])}(e,Cr(t),xr(n,"pointerdown"===t),r)}!function(e){e.subtract=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},e.relativeTo=function(e){var t;return function(n){var r=n.x,o=n.y,a=void 0!==t?t:t="string"==typeof e?document.getElementById(e):e;if(a){var i=a.getBoundingClientRect();return{x:r-i.left-window.scrollX,y:o-i.top-window.scrollY}}}}}(wr||(wr={}));var Tr=!1;"undefined"!=typeof window&&document.addEventListener("touchmove",(function(e){Tr&&e.preventDefault()}),{passive:!1});var Sr=function(){return Tr=!1},Ir=function(){function e(e,t,n){var r=this,o=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(r.lastMoveEvent&&r.lastMoveEventInfo){var e=Nr(r.lastMoveEventInfo,r.history),t=null!==r.startEvent,n=Re(e.offset,{x:0,y:0})>=3;if(t||n){var o=e.point,a=C().timestamp;r.history.push(i(i({},o),{timestamp:a}));var c=r.handlers,s=c.onStart,u=c.onMove;t||(s&&s(r.lastMoveEvent,e),r.startEvent=r.lastMoveEvent),u&&u(r.lastMoveEvent,e)}}},!(gr(e)&&e.touches.length>1)){this.handlers=t,this.transformPagePoint=o;var a=Ar(yr(e),this.transformPagePoint),c=a.point,s=C().timestamp;this.history=[i(i({},c),{timestamp:s})];var u=t.onSessionStart;u&&u(e,Nr(a,this.history));var l=_r(window,"pointermove",(function(e,t){return r.handlePointerMove(e,t)})),d=_r(window,"pointerup",(function(e,t){return r.handlePointerUp(e,t)}));this.removeListeners=function(){l&&l(),d&&d()}}}return e.prototype.handlePointerMove=function(e,t){this.lastMoveEvent=e,this.lastMoveEventInfo=Ar(t,this.transformPagePoint),mr(e)&&0===e.buttons?this.handlePointerUp(e,t):_.update(this.updatePoint,!0)},e.prototype.handlePointerUp=function(e,t){this.end();var n=this.handlers.onEnd;if(n){var r=Nr(Ar(t,this.transformPagePoint),this.history);n&&n(e,r)}},e.prototype.updateHandlers=function(e){this.handlers=e},e.prototype.end=function(){this.removeListeners&&this.removeListeners(),x.update(this.updatePoint),Sr()},e}();function Ar(e,t){return t?{point:t(e.point)}:e}function Nr(e,t){var n=e.point;return{point:n,delta:wr.subtract(n,Mr(t)),offset:wr.subtract(n,Pr(t)),velocity:Rr(t,.1)}}function Pr(e){return e[0]}function Mr(e){return e[e.length-1]}function Rr(e,t){if(e.length<2)return{x:0,y:0};for(var n=e.length-1,r=null,o=Mr(e);n>=0&&(r=e[n],!(o.timestamp-r.timestamp>Kn(t)));)n--;if(!r)return{x:0,y:0};var a=(o.timestamp-r.timestamp)/1e3;if(0===a)return{x:0,y:0};var i={x:(o.x-r.x)/a,y:(o.y-r.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}var Lr=function(e,t){return!!t&&(e===t||Lr(e,t.parentElement))},Dr=["whileHover","whileTap","whileDrag"],Br=function(e){return Dr.indexOf(e)+1};function zr(e){var t=null;return function(){return null===t&&(t=e,function(){t=null})}}var Ur=zr("dragHorizontal"),Hr=zr("dragVertical");function Fr(e){var t=!1;if("y"===e)t=Hr();else if("x"===e)t=Ur();else{var n=Ur(),r=Hr();n&&r?t=function(){n(),r()}:(n&&n(),r&&r())}return t}var $r=Br("whileTap");var qr=Br("whileHover"),Gr=function(e){return function(t,n){mr(t)&&e(t,n)}};function Yr(e,t){!function(e,t){var n=e.onPan,r=e.onPanStart,o=e.onPanEnd,a=e.onPanSessionStart,i=n||r||o||a,c=Object(u.useRef)(null),s=Object(u.useContext)(fr).transformPagePoint,l={onSessionStart:a,onStart:r,onMove:n,onEnd:function(e,t){c.current=null,o&&o(e,t)}};Object(u.useEffect)((function(){null!==c.current&&c.current.updateHandlers(l)})),jr(t,"pointerdown",i&&function(e){c.current=new Ir(e,l,{transformPagePoint:s})}),pr((function(){return c.current&&c.current.end()}))}(e,t),function(e,t){var n=e.onTap,r=e.onTapStart,o=e.onTapCancel,a=e.whileTap,i=e.controls,c=n||r||o||a,s=Object(u.useRef)(!1),l=Object(u.useRef)(null);function d(){l.current&&l.current(),l.current=null}a&&i&&i.setOverride(a,$r);var f=Object(u.useRef)(null);f.current=function(e,r){var c=t.current;if(d(),s.current&&c){s.current=!1,i&&a&&i.clearOverride($r);var u=Fr(!0);u&&(u(),Lr(c,e.target)?n&&n(e,r):o&&o(e,r))}},jr(t,"pointerdown",c?function(e,n){d(),l.current=_r(window,"pointerup",(function(e,t){return f.current(e,t)})),t.current&&!s.current&&(s.current=!0,r&&r(e,n),i&&a&&i.startOverride($r))}:void 0),pr(d)}(e,t),function(e,t){var n=e.whileHover,r=e.onHoverStart,o=e.onHoverEnd,a=e.controls;n&&a&&a.setOverride(n,qr),jr(t,"pointerenter",Gr((function(e,t){r&&r(e,t),n&&a&&a.startOverride(qr)}))),jr(t,"pointerleave",Gr((function(e,t){o&&o(e,t),n&&a&&a.clearOverride(qr)})))}(e,t)}var Vr=function(e){return function(t){return e(t),null}},Wr=["onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileTap","whileHover","onHoverStart","onHoverEnd"],Kr={key:"gestures",shouldRender:function(e){return Wr.some((function(t){return e.hasOwnProperty(t)}))},Component:Vr((function(e){var t=e.innerRef;Yr(c(e,["innerRef"]),t)}))},Xr=function(e){return"object"==typeof e&&e.hasOwnProperty("current")},Jr=function(e){return e},Qr=function(){function e(e){var t=e.ref,n=e.values,r=e.controls;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.props={transformPagePoint:Jr},this.point={},this.origin={x:mn(0),y:mn(0)},this.openGlobalLock=null,this.panSession=null,this.prevConstraintsBox={width:0,height:0,x:0,y:0},this.ref=t,this.values=n,this.controls=r}return e.prototype.start=function(e,t){var n=this,r=(void 0===t?{}:t).snapToCursor;void 0!==r&&r&&this.snapToCursor(e);var o=this.props.transformPagePoint;this.panSession=new Ir(e,{onSessionStart:function(){Tr=!0,Zr((function(e){var t=n.point[e];t&&t.stop()}))},onStart:function(e,t){if(n.constraintsNeedResolution){var r=n.props,o=r.dragConstraints,a=r.transformPagePoint;n.constraints=ro(o,n.ref,n.point,a),n.applyConstraintsToPoint()}Zr((function(e){var t=n.point[e];t&&n.origin[e].set(t.get())}));var i=n.props,c=i.drag,s=i.dragPropagation;if(!c||s||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Fr(c),n.openGlobalLock)){n.isDragging=!0,n.currentDirection=null;var u=n.props.onDragStart;u&&u(e,eo(t,n.point))}},onMove:function(e,t){var r=n.props,o=r.dragPropagation,a=r.dragDirectionLock;if(o||n.openGlobalLock){var i=t.offset;if(a&&null===n.currentDirection){if(n.currentDirection=function(e,t){void 0===t&&(t=10);var n=null;Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x");return n}(i),null!==n.currentDirection){var c=n.props.onDirectionLock;c&&c(n.currentDirection)}}else{n.updatePoint("x",i),n.updatePoint("y",i);var s=n.props.onDrag;s&&s(e,eo(t,n.point))}}},onEnd:function(e,t){n.stop(e,t)}},{transformPagePoint:o})},e.prototype.cancelDrag=function(){Sr(),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null)},e.prototype.stop=function(e,t){var n;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var o=this.props,a=o.dragMomentum,i=o.dragElastic,c=o.onDragEnd;if(a||i){var s=t.velocity;this.animateDragEnd(s)}else this.recordBoxInfo(this.constraints);c&&c(e,eo(t,this.point))}},e.prototype.recordBoxInfo=function(e){if(e){var t=e.right,n=e.left,r=e.bottom,o=e.top;this.prevConstraintsBox.width=(t||0)-(n||0),this.prevConstraintsBox.height=(r||0)-(o||0)}this.point.x&&(this.prevConstraintsBox.x=this.point.x.get()),this.point.y&&(this.prevConstraintsBox.y=this.point.y.get())},e.prototype.snapToCursor=function(e){var t=this,n=this.props.transformPagePoint,r=yr(e).point,o=oo(this.ref,n),a=o.width/2+o.left+window.scrollX,i=o.height/2+o.top+window.scrollY,c={x:r.x-a,y:r.y-i};Zr((function(e){var n=t.point[e];n&&t.origin[e].set(n.get())})),this.updatePoint("x",c),this.updatePoint("y",c)},e.prototype.setPoint=function(e,t){this.point[e]=t},e.prototype.updatePoint=function(e,t){var n=this.props,r=n.drag,o=n.dragElastic,a=this.point[e];if(no(e,r,this.currentDirection)&&a){var i=io(e,this.origin[e].get()+t[e],this.constraints,o);a.set(i)}},e.prototype.updateProps=function(e){var t=this,n=e.drag,r=void 0!==n&&n,o=e.dragDirectionLock,a=void 0!==o&&o,s=e.dragPropagation,u=void 0!==s&&s,l=e.dragConstraints,d=void 0!==l&&l,f=e.dragElastic,p=void 0===f||f,h=e.dragMomentum,m=void 0===h||h,g=c(e,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=i({drag:r,dragDirectionLock:a,dragPropagation:u,dragConstraints:d,dragElastic:p,dragMomentum:m},g);var b=g._dragValueX,v=g._dragValueY,y=g.dragOriginX,w=g.dragOriginY;y&&(this.origin.x=y),w&&(this.origin.y=w),Zr((function(e){if(no(e,r,t.currentDirection)){var n="x"===e?b:v;t.setPoint(e,n||t.values.get(e,0))}})),this.constraintsNeedResolution=Xr(d),this.constraints=this.constraintsNeedResolution?this.constraints||!1:d},e.prototype.applyConstraintsToPoint=function(e){var t=this;return void 0===e&&(e=this.constraints),Zr((function(n){var r=t.point[n];r&&!r.isAnimating()&&io(n,r,e,0)}))},e.prototype.animateDragEnd=function(e){var t=this,n=this.props,r=n.drag,o=n.dragMomentum,a=n.dragElastic,c=n.dragTransition,s=n._dragValueX,u=n._dragValueY,l=n._dragTransitionControls,d=Zr((function(n){var d;if(no(n,r,t.currentDirection)){var f=t.constraints?to(n,t.constraints):{},p=a?200:1e6,h=a?40:1e7,m=l||t.controls,g=i(i({type:"inertia",velocity:o?e[n]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1},c),f),b="x"===n?s:u;return b?er(n,b,0,g):m.start(((d={})[n]=0,d.transition=g,d))}}));return Promise.all(d).then((function(){t.recordBoxInfo(t.constraints),t.scalePoint();var e=t.props.onDragTransitionEnd;e&&e()}))},e.prototype.scalePoint=function(){var e=this,t=this.props,n=t.dragConstraints,r=t.transformPagePoint;if(Xr(n)){var o=oo(n,r),a=oo(this.ref,r),i=function(t,n){var r=e.point[t];if(r){if(r.isAnimating())return r.stop(),void e.recordBoxInfo();var i=e.prevConstraintsBox[n]?(o[n]-a[n])/e.prevConstraintsBox[n]:1;r.set(e.prevConstraintsBox[t]*i)}};i("x","width"),i("y","height")}},e.prototype.mount=function(e){var t=this,n=_r(e,"pointerdown",(function(e){var n=t.props,r=n.drag,o=n.dragListener;r&&(void 0===o||o)&&t.start(e)})),r=hr(window,"resize",(function(){return t.scalePoint()}));if(this.constraintsNeedResolution){var o=this.props,a=o.dragConstraints,i=o.transformPagePoint,c=ro(a,this.ref,this.point,i);this.applyConstraintsToPoint(c),this.recordBoxInfo(c)}else!this.isDragging&&this.constraints&&this.applyConstraintsToPoint();return function(){n&&n(),r&&r(),t.cancelDrag()}},e}();function Zr(e){return[e("x"),e("y")]}function eo(e,t){return i(i({},e),{point:{x:t.x?t.x.get():0,y:t.y?t.y.get():0}})}function to(e,t){var n=t.top,r=t.right,o=t.bottom,a=t.left;return"x"===e?{min:a,max:r}:{min:n,max:o}}function no(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}function ro(e,t,n,r){null!==e.current&&t.current;var o=oo(e,r),a=oo(t,r),i=o.left-a.left+ao(n.x),c=o.top-a.top+ao(n.y);return{top:c,left:i,right:o.width-a.width+i,bottom:o.height-a.height+c}}function oo(e,t){var n=e.current.getBoundingClientRect(),r=t({x:n.left,y:n.top}),o=r.x,a=r.y,i=t({x:n.width,y:n.height});return{left:o,top:a,width:i.x,height:i.y}}function ao(e){return e?e.get():0}function io(e,t,n,r){var o=t instanceof hn?t.get():t;if(!n)return o;var a=to(e,n),i=a.min,c=a.max;return void 0!==i&&o<i?o=r?co(i,o,r):Math.max(i,o):void 0!==c&&o>c&&(o=r?co(c,o,r):Math.min(c,o)),t instanceof hn&&t.set(o),o}function co(e,t,n){return De(e,t,"number"==typeof n?n:.35)}var so={key:"drag",shouldRender:function(e){return!!e.drag},Component:Vr((function(e){var t=e.innerRef,n=e.values,r=e.controls;return function(e,t,n,r){var o=e.dragControls,a=Object(u.useContext)(fr).transformPagePoint,c=gn((function(){return new Qr({ref:t,values:n,controls:r})}));c.updateProps(i(i({},e),{transformPagePoint:a})),Object(u.useEffect)((function(){return o&&o.subscribe(c)}),[c]),Object(u.useEffect)((function(){return c.mount(t.current)}),[])}(c(e,["innerRef","values","controls"]),t,n,r)}))};function uo(e){return"string"==typeof e&&e.startsWith("var(--")}var lo=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function fo(e,t,n){void 0===n&&(n=1);var r=function(e){var t=lo.exec(e);return t?[t[1],t[2]]:[,]}(e),o=r[0],a=r[1];if(o){var i=window.getComputedStyle(t).getPropertyValue(o);return i||(uo(a)?fo(a,t,n+1):a)}}var po,ho=new Set(["width","height","top","left","right","bottom","x","y"]),mo=function(e){return ho.has(e)},go=function(e,t){e.set(t,!1),e.set(t)},bo=function(e){return e===N||e===B};!function(e){e.width="width",e.height="height",e.left="left",e.right="right",e.top="top",e.bottom="bottom"}(po||(po={}));var vo=function(e,t){return parseFloat(e.split(", ")[t])},yo=function(e,t){return function(n,r){var o=r.transform;if("none"===o||!o)return 0;var a=o.match(/^matrix3d\((.+)\)$/);if(a)return vo(a[1],t);var i=o.match(/^matrix\((.+)\)$/);return i?vo(i[1],e):0}},wo=new Set(["x","y","z"]),xo=dt.filter((function(e){return!wo.has(e)}));var Oo={width:function(e){return e.width},height:function(e){return e.height},top:function(e,t){var n=t.top;return parseFloat(n)},left:function(e,t){var n=t.left;return parseFloat(n)},bottom:function(e,t){var n=e.height,r=t.top;return parseFloat(r)+n},right:function(e,t){var n=e.width,r=t.left;return parseFloat(r)+n},x:yo(4,13),y:yo(5,14)},Eo=function(e,t,n,r){void 0===r&&(r={}),n=i({},n),r=i({},r);var o=t.current,a=zt(o),c=Object.keys(n).filter(mo),s=[],u=!1,l=c.reduce((function(t,o){var i=e.get(o);if(!i)return t;var c,l=i.get(),d=n[o],f=Bn(l);if(Pn(d))for(var p=d.length,h=null===d[0]?1:0;h<p;h++)c?Bn(d[h]):(c=Bn(d[h]))===f||bo(f)&&bo(c);else c=Bn(d);if(f!==c)if(bo(f)&&bo(c)){var m=i.get();"string"==typeof m&&i.set(parseFloat(m)),"string"==typeof d?n[o]=parseFloat(d):Array.isArray(d)&&c===B&&(n[o]=d.map(parseFloat))}else u||(s=function(e,t){var n=[];return xo.forEach((function(t){var r=e.get(t);void 0!==r&&(n.push([t,r.get()]),r.set(t.startsWith("scale")?1:0))})),n.length&&t.render(),n}(e,a),u=!0),t.push(o),r[o]=void 0!==r[o]?r[o]:n[o],go(i,d);return t}),[]);if(l.length){var d=function(e,t,n,r,o){var a=n.getBoundingClientRect(),i=getComputedStyle(n),c=i.display,s={top:i.top,left:i.left,bottom:i.bottom,right:i.right,transform:i.transform};"none"===c&&r.set("display",e.display||"block"),r.render();var u=n.getBoundingClientRect();return o.forEach((function(n){var r=t.get(n);go(r,Oo[n](a,s)),e[n]=Oo[n](u,i)})),e}(n,e,o,a,l);return s.length&&s.forEach((function(t){var n=t[0],r=t[1];e.get(n).set(r)})),a.render(),{target:d,transitionEnd:r}}return{target:n,transitionEnd:r}};function ko(e,t,n,r){return function(e){return Object.keys(e).some(mo)}(n)?Eo(e,t,n,r):{target:n,transitionEnd:r}}var Co=function(e,t){return function(n,r){var o=function(e,t,n,r){var o=c(n,[]),a=t.current;if(!(a instanceof HTMLElement))return{target:o,transitionEnd:r};for(var s in r&&(r=i({},r)),e.forEach((function(e){var t=e.get();if(uo(t)){var n=fo(t,a);n&&e.set(n)}})),o){var u=o[s];if(uo(u)){var l=fo(u,a);l&&(o[s]=l,r&&void 0===r[s]&&(r[s]=u))}}return{target:o,transitionEnd:r}}(e,t,n,r);return n=o.target,r=o.transitionEnd,ko(e,t,n,r)}};var _o,jo,To=Object(u.createContext)(null);!function(e){e.Prepare="prepare",e.Read="read",e.Render="render"}(jo||(jo={}));var So=[jo.Prepare,jo.Read,jo.Render].reduce((function(e,t){return e[t]=[],e}),{}),Io=!1;function Ao(e){for(var t=e.length,n=0;n<t;n++)e[n]();e.length=0}var No=function(e){return function(t){t&&(Io=!0,So[e].push(t))}},Po=((_o={})[jo.Prepare]=No(jo.Prepare),_o[jo.Read]=No(jo.Read),_o[jo.Render]=No(jo.Render),_o.flush=function(){Io&&(Ao(So.prepare),Ao(So.read),Ao(So.render),Io=!1)},_o);var Mo={duration:.8,ease:[.45,.05,.19,1]},Ro={type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10};var Lo={id:"x",size:"width",min:"left",max:"right",origin:"originX"},Do={id:"y",size:"height",min:"top",max:"bottom",origin:"originY"};function Bo(e,t){return(e+t)/2}function zo(e,t,n){var r,o=e[n.size]-t[n.size],a=.5;return o&&(e[n.min]===t[n.min]?a=0:e[n.max]===t[n.max]&&(a=1)),(r={})[n.size]=o,r[n.origin]=a,r[n.id]=.5===a?Bo(e[n.min],e[n.max])-Bo(t[n.min],t[n.max]):0,r}var Uo={getLayout:function(e){return e.offset},measure:function(e){var t=e.offsetLeft,n=e.offsetTop,r=e.offsetWidth,o=e.offsetHeight;return{left:t,top:n,right:t+r,bottom:n+o,width:r,height:o}}},Ho={getLayout:function(e){return e.boundingBox},measure:function(e){var t=e.getBoundingClientRect();return{left:t.left,top:t.top,width:t.width,height:t.height,right:t.right,bottom:t.bottom}}};function Fo(e){return window.getComputedStyle(e).position}function $o(e){return"width"===e||"height"===e}var qo,Go={key:"layout",shouldRender:function(e){var t=e.positionTransition,n=e.layoutTransition;return"undefined"!=typeof window&&!(!t&&!n)},Component:function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.getSnapshotBeforeUpdate=function(){var e=this.props,t=e.innerRef,n=e.positionTransition,r=e.values,o=e.controls,a=t.current;if(function(e){return e instanceof HTMLElement}(a)){var c,s,u,l=function(e){var t=e.layoutTransition,n=e.positionTransition;return t||n}(this.props),d=!!n,f=Fo(a),p={offset:Uo.measure(a),boundingBox:Ho.measure(a)};return Po.prepare((function(){c=a.style.transform,a.style.transform=""})),Po.read((function(){s={offset:Uo.measure(a),boundingBox:Ho.measure(a)};var e=Fo(a);u=function(e,t,n){return n&&e===t?Uo:Ho}(f,e,d)})),Po.render((function(){var e=function(e,t){return i(i({},zo(e,t,Lo)),zo(e,t,Do))}(u.getLayout(p),u.getLayout(s));if(e.x||e.y||e.width||e.height){zt(a).set({originX:e.originX,originY:e.originY}),Cn();var t={},n={},f=function(e){return"function"==typeof e}(l)?l({delta:e}):l;h("left","x",0,e.x),h("top","y",0,e.y),d||(h("width","scaleX",1,p.boundingBox.width/s.boundingBox.width),h("height","scaleY",1,p.boundingBox.height/s.boundingBox.height)),t.transition=n,f&&o.start(t),_n()}else c&&(a.style.transform=c);function h(o,a,c,s){var l=$o(o)?o:a;if(e[l]){var p="boolean"==typeof f?i({},function(e){return e?Ro:Mo}(d)):f,h=r.get(a,c),m=h.getVelocity();n[a]=p[a]?i({},p[a]):i({},p),void 0===n[a].velocity&&(n[a].velocity=m||0),t[a]=c;var g=$o(o)||u!==Uo?0:h.get();h.set(s+g)}}})),null}},t.prototype.componentDidUpdate=function(){Po.flush()},t.prototype.render=function(){return null},t.contextType=To,t}(u.Component)},Yo=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","static","positionTransition","layoutTransition","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragElastic","dragMomentum","dragPropagation","dragTransition","_dragValueX","_dragValueY","_dragTransitionControls","dragOriginX","dragOriginY","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","whileHover","whileTap","onHoverEnd","onHoverStart"]);function Vo(e){return Yo.has(e)}!function(e){e.Target="Target",e.VariantLabel="VariantLabel",e.AnimationSubscription="AnimationSubscription"}(qo||(qo={}));function Wo(e,t){void 0===t&&(t=!1);e.transition;var n=e.transitionEnd,r=c(e,["transition","transitionEnd"]);return t?i(i({},r),n):r}var Ko,Xo,Jo=function(e){var t,n=e instanceof hn?e.get():e;return Array.from(new Set((t=n)?Array.isArray(t)?t:[t]:[]))};var Qo=((Ko={})[qo.Target]=Vr((function(e){return function(e,t,n,r){var o=Object(u.useRef)(!0),a=Object(u.useRef)(null);a.current||(a.current=Wo(e,!0)),Object(u.useEffect)((function(){var c,s,u={},l=Wo(e),d=Wo(e,!0);for(var f in l){var p=o.current&&(!n.has(f)||n.get(f).get()!==d[f]),h=null!==d[f],m=(c=a.current[f],void 0!==(s=d[f])&&(Array.isArray(c)&&Array.isArray(s)?!function(e,t){if(null===t)return!1;var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}(s,c):c!==s));h&&(m||p)&&(u[f]=l[f])}o.current=!1,a.current=i(i({},a.current),d),Object.keys(u).length&&t.start(i(i({},u),{transition:e.transition||r,transitionEnd:e.transitionEnd}))}),[e])}(e.animate,e.controls,e.values,e.transition)})),Ko[qo.VariantLabel]=Vr((function(e){var t=e.animate,n=e.inherit,r=void 0===n||n,o=e.controls;return function(e,t,n,r){var o=Jo(t),a=Object(u.useContext)(or),i=a.hasMounted&&a.hasMounted.current,c=Object(u.useRef)(!1);Object(u.useEffect)((function(){var t,s,u=!1;n?(u=!!i,o=Jo(a.animate)):u=c.current||(t=Jo(e),s=o,t.join(",")!==s.join(",")),u&&r.start(o),c.current=!0}),[o.join(",")])}(e.initial,t,r,o)})),Ko[qo.AnimationSubscription]=Vr((function(e){return function(e,t){var n=Object(u.useMemo)((function(){return e.subscribe(t)}),[e]);Object(u.useEffect)((function(){return function(){n&&n()}}),[n])}(e.animate,e.controls)})),Ko),Zo=function(e){return e.animate instanceof nr},ea=["initial","animate","whileTap","whileHover"],ta=((Xo={})[qo.Target]=function(e){return!(void 0===e.animate||(t=e.animate,Array.isArray(t)||"string"==typeof t)||Zo(e));var t},Xo[qo.VariantLabel]=function(e){return void 0!==e.variants||ea.some((function(t){return"string"==typeof e[t]}))},Xo[qo.AnimationSubscription]=Zo,Xo);var na={key:"exit",shouldRender:function(e){return!!e.exit&&!ur(e)},Component:Vr((function(e){var t,n=e.animate,r=e.controls,o=e.exit,a=function(){var e=Object(u.useContext)(rr);if(null===e)return[!0];var t=e.isPresent,n=e.onExitComplete,r=e.register;return Object(u.useEffect)(r,[]),!t&&n?[!1,n]:[!0]}(),c=a[0],s=a[1],l=Object(u.useContext)(rr),d=Object(u.useRef)(!1),f=void 0!==(null===(t=l)||void 0===t?void 0:t.custom)?l.custom:e.custom;Object(u.useEffect)((function(){c?!d.current||!n||n instanceof nr||r.start(n):(!d.current&&o&&(r.setProps(i(i({},e),{custom:f})),r.start(o).then(s)),d.current=!0),c&&(d.current=!1)}),[c])}))},ra=function(e){return!Vo(e)};try{var oa=n(98).default;ra=function(e){return e.startsWith("on")?!Vo(e):oa(e)}}catch(e){}var aa=[Go,so,Kr,na],ia=aa.length;function ca(e){var t="string"==typeof e,n=t&&-1!==dr.indexOf(e);return{renderComponent:function(r,o,a,c,s){var l=t?function(e){var t={};for(var n in e)ra(n)&&(t[n]=e[n]);return t}(c):c,d=n?function(e,t){var n=Pt(Sn(e),void 0,void 0,void 0,void 0,!1);return n.style=i(i({},t),n.style),n}(a,o):function(e,t,n,r){var o={style:Nn(e,t,n)};return r&&(o.style.userSelect="none",o.draggable=!1),o}(a,o,s,!!c.drag);return Object(u.createElement)(e,i(i(i({},l),{ref:r}),d))},loadFunctionalityComponents:function(e,t,n,r,o,a){var c=[],s=function(e){var t=void 0;for(var n in qo)ta[n](e)&&(t=n);return t?Qo[t]:void 0}(n);s&&c.push(Object(u.createElement)(s,{key:"animation",initial:n.initial,animate:n.animate,variants:n.variants,transition:n.transition,controls:o,inherit:a,values:t}));for(var l=0;l<ia;l++){var d=aa[l],f=d.shouldRender,p=d.key,h=d.Component;f(n,r)&&c.push(Object(u.createElement)(h,i({key:p},n,{parentContext:r,values:t,controls:o,innerRef:e})))}return c},getValueControlsConfig:function(e,t){return{values:t,readValueFromSource:function(t){return zt(e.current).get(t)},makeTargetAnimatable:Co(t,e)}}}}var sa=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","webview"].reduce((function(e,t){var n=ca(t);return e[t]=lr(n),e}),{}),ua=dr.reduce((function(e,t){return e[t]=lr(ca(t)),e}),{}),la=i(i({custom:function(e){return lr(ca(e))}},sa),ua);function da(e){return gn((function(){return mn(e)}))}function fa(){return{scrollX:mn(0),scrollY:mn(0),scrollXProgress:mn(0),scrollYProgress:mn(0)}}"undefined"!=typeof window?u.useLayoutEffect:u.useEffect;fa();!function(){function e(){this.componentControls=new Set}e.prototype.subscribe=function(e){var t=this;return this.componentControls.add(e),function(){return t.componentControls.delete(e)}},e.prototype.start=function(e,t){this.componentControls.forEach((function(n){n.start(e.nativeEvent||e,t)}))}}();var pa=mn(null);if("undefined"!=typeof window)if(window.matchMedia){var ha=window.matchMedia("(prefers-reduced-motion)"),ma=function(){return pa.set(ha.matches)};ha.addListener(ma),ma()}else pa.set(!1)},function(e,t,n){var r=n(181),o=n(182);e.exports=function(e,t,n){var a=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||r)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var c=0;c<16;++c)t[a+c]=i[c];return t||o(i)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,n){"use strict";t.a=(e,t)=>Boolean((e=>{const t=e.replace(/\./g,"\\.").replace(/\*/g,".").replace(/\//g,"\\/").replace(/\?/g,"\\?");return new RegExp(t,"i")})(t).test(e))},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i}));var r=n(46),o=n.n(r);const a="kindly-chat-browser-id",i=()=>{const e=localStorage.getItem(a);if(!e){const e=o()();return localStorage.setItem(a,e),e}return e}},function(e){e.exports=JSON.parse('{"a":"2.35.3"}')},function(e,t,n){"use strict";n.d(t,"d",(function(){return l})),n.d(t,"n",(function(){return d})),n.d(t,"e",(function(){return f})),n.d(t,"h",(function(){return p})),n.d(t,"l",(function(){return h})),n.d(t,"f",(function(){return m})),n.d(t,"g",(function(){return g})),n.d(t,"k",(function(){return b})),n.d(t,"c",(function(){return v})),n.d(t,"j",(function(){return y})),n.d(t,"i",(function(){return w})),n.d(t,"o",(function(){return x})),n.d(t,"a",(function(){return O})),n.d(t,"m",(function(){return E})),n.d(t,"b",(function(){return k}));var r=n(17),o=n(5),a=n(73),i=n(2),c=n(63),s=n(9);const u=(e,t)=>{if(e.feedbackFormType===o.q.NONE)return!1;if(e.feedbackFormType===o.q.EXTERNAL_LINK){var n,r,a;const{feedbackForm:o}=e;return(null===(n=o.external_link_url)||void 0===n?void 0:n[t])&&((null===(r=o.external_link_headline)||void 0===r?void 0:r[t])||(null===(a=o.external_link_text)||void 0===a?void 0:a[t]))}return!0},l=e=>(t,n)=>{const{chatHasStarted:r}=n().chatbubble;t({type:i.qb,botKey:e}),r&&t(Object(c.a)())},d=function(e){let{skipRestart:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(n,r)=>{const{botKey:o,chatHasStarted:a}=r().chatbubble;n({type:i.cb,code:e}),!t&&a&&n(Object(s.d)(o,!0))}},f=()=>e=>{e({type:i.n})},p=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return(t,n)=>{const{bot:o,chatbubble:{currentLanguage:a,botKey:c,optionsScreenOpen:l},connection:{token:d},feedback:{feedbackFormOpen:f},messages:{chatMessages:p},agent:{hasHadHandover:h}}=n(),m=o.noFeedbackAfterHandover&&h;l&&t({type:i.q}),!e&&u(o,a)&&!f&&p&&!m&&p.length>1&&setTimeout(()=>t({type:i.L,token:d}),o.fullscreenMode?0:1500),t(Object(s.d)(c,e));try{Object(r.disconnect)()}catch(e){console.error(e)}}},h=()=>e=>{e({type:i.N})},m=()=>(e,t)=>{const{optionsScreenOpen:n}=t().chatbubble;n&&e({type:i.q})},g=()=>(e,t)=>{const{token:n,feedbackFormOpen:r}=t().feedback;(n||r)&&e({type:i.o}),e({type:i.Y,chatHasStarted:!0})},b=()=>(e,t)=>{const{pushMessages:n,alerts:r,bot:a,chatbubble:c,nudge:s}=t();n.show&&e({type:i.B}),s.show&&e({type:i.A}),(r.showTabNotification||r.showBubbleNotification)&&e({type:i.z}),e({type:i.K}),c.chatHasStarted||a.welcomePage&&a.welcomePageType!==o.r.NONE||e({type:i.Y,chatHasStarted:!0})},v=()=>(e,t)=>{const{active:n,previouslyPoppedUp:r}=t().chatbubble;n||r||(e(b()),e({type:i.Q}))},y=()=>e=>{e({type:i.hb,userIsIdle:!0}),Object(a.b)()},w=e=>(t,n)=>{const{userIsIdle:r}=n().chatbubble;r&&(t({type:i.hb,userIsIdle:!1}),Object(a.a)(e))},x=e=>(t,n)=>{var r,o;const{chatbubble:{contactDetailsButton:a}}=n();(null==a||null===(r=a.contact_details)||void 0===r?void 0:r.contact_type)===(null==e||null===(o=e.contact_details)||void 0===o?void 0:o.contact_type)?t({type:i.D}):t({type:i.jb,button:e})},O=e=>t=>{t({type:i.f,button:e})},E=e=>t=>{0===e.length?t({type:i.k}):t({type:i.X,files:e})},k=()=>e=>{e({type:i.g})}},function(e,t,n){"use strict";var r=n(4),o=n.n(r);o.a.oneOfType([o.a.node,o.a.arrayOf(o.a.node)])},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(5),i=n(110);o.a.shape({message:o.a.string,from_bot:o.a.bool,image_carousel:o.a.arrayOf(o.a.object),thon_image_above_text:o.a.bool,exchange_type:o.a.string,exchange_id:o.a.string,avatar:o.a.string,sender:o.a.oneOf(Object.values(a.l)),skill_subscription_id:o.a.number,bot_id:o.a.number,score:o.a.number,title:o.a.string,reply_candidates:i.a,is_followup:o.a.bool,handler:o.a.oneOf(Object.values(a.f)),corrected_message:o.a.string,new_context:o.a.objectOf(o.a.string)})},function(e,t,n){e.exports=n(164)},function(e,t,n){"use strict";t.a=()=>{}},function(e,t,n){"use strict";var r=n(226);t.a=e=>"number"==typeof e?new Date(e):Object(r.a)(e)},function(e,t,n){"use strict";n.d(t,"a",(function(){return g})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return m})),n.d(t,"e",(function(){return c}));var r=n(111),o=function(){return Math.random().toString(36).substring(7).split("").join(".")},a={INIT:"@@redux/INIT"+o(),REPLACE:"@@redux/REPLACE"+o(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+o()}};function i(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function c(e,t,n){var o;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("Expected the enhancer to be a function.");return n(c)(e,t)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var s=e,u=t,l=[],d=l,f=!1;function p(){d===l&&(d=l.slice())}function h(){if(f)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return u}function m(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(f)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribelistener for more details.");var t=!0;return p(),d.push(e),function(){if(t){if(f)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribelistener for more details.");t=!1,p();var n=d.indexOf(e);d.splice(n,1),l=null}}}function g(e){if(!i(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(f)throw new Error("Reducers may not dispatch actions.");try{f=!0,u=s(u,e)}finally{f=!1}for(var t=l=d,n=0;n<t.length;n++){(0,t[n])()}return e}function b(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");s=e,g({type:a.REPLACE})}function v(){var e,t=m;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new TypeError("Expected the observer to be an object.");function n(){e.next&&e.next(h())}return n(),{unsubscribe:t(n)}}})[r.a]=function(){return this},e}return g({type:a.INIT}),(o={dispatch:g,subscribe:m,getState:h,replaceReducer:b})[r.a]=v,o}function s(e,t){var n=t&&t.type;return"Given "+(n&&'action "'+String(n)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function u(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];0,"function"==typeof e[o]&&(n[o]=e[o])}var i,c=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:a.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===n(void 0,{type:a.PROBE_UNKNOWN_ACTION()}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+a.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i;for(var r=!1,o={},a=0;a<c.length;a++){var u=c[a],l=n[u],d=e[u],f=l(d,t);if(void 0===f){var p=s(u,t);throw new Error(p)}o[u]=f,r=r||f!==d}return(r=r||c.length!==Object.keys(e).length)?o:e}}function l(e,t){return function(){return t(e.apply(this,arguments))}}function d(e,t){if("function"==typeof e)return l(e,t);if("object"!=typeof e||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":typeof e)+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=l(o,t))}return n}function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(n,!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function m(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function g(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map((function(e){return e(o)}));return h({},n,{dispatch:r=m.apply(void 0,a)(n.dispatch)})}}}},function(e,t,n){var r=n(26);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},function(e,t,n){var r=n(60),o=n(101),a=n(82);e.exports=r?function(e,t,n){return o.f(e,t,a(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(47);e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(e,t,n){var r=n(58);e.exports=function(e){if(r(e))return e;throw TypeError(String(e)+" is not an object")}},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(5),i=n(77);t.a=o.a.shape(Object(i.a)(e=>({[e]:o.a.func}),Object.values(a.b)))},function(e,t,n){"use strict";n.d(t,"d",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d})),n.d(t,"c",(function(){return f}));var r=n(17),o=n(5),a=n(2),i=n(28),c=n(9);const s=()=>(e,t)=>{const{connected:n}=t().connection;n||e({type:a.r})},u=()=>(e,t)=>{const{connected:n}=t().connection;n&&e({type:a.w})},l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const n=JSON.parse(window.localStorage.getItem("pusherTransportEncrypted"));t.indexOf("ws")<0&&n&&"ws"!==n.transport&&window.localStorage.removeItem("pusherTransportEncrypted"),Object(r.startConfiguration)({auth:{...Object(c.a)({token:e},{withVersion:!0})},disabledTransports:t}),Object(c.e)(e)},d=function(){let{triggerDialogueSlug:e,languageCode:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(n,s)=>{const{local:{context:u},chatbubble:{botKey:d,currentLanguage:f,disabledTransports:p},environment:{PAT_HOST:h,VERSION:m},bot:{includeDisabledLanguages:g}}=s(),b={context:u,language_code:t||f,trigger_dialogue_slug:e,include_disabled_languages:g,version:m},v=await n(Object(c.f)({method:"post",url:`${h}/chatbubble/${o.j}/connect`,params:b,...Object(c.a)({botKey:d},{withCurrentUrl:!0})}));if(!v)return;const{pusherConnected:y}=s().connection;if(y)try{Object(r.disconnect)()}catch(e){console.warn(e)}const{token:w,chat_id:x,created:O,all_greetings_hide_input:E}=v.data;n({type:a.J,token:w}),n({type:a.H,chatId:x,allGreetingsHideInput:E}),n({type:a.gb,startedAt:O}),n(Object(c.c)((new Date).toISOString())),l(w,p),n(Object(i.a)())}},f=e=>t=>t({type:a.s,triggerConfig:e})},function(e,t,n){"use strict";n.d(t,"c",(function(){return y})),n.d(t,"b",(function(){return w})),n.d(t,"g",(function(){return x})),n.d(t,"d",(function(){return k})),n.d(t,"h",(function(){return C})),n.d(t,"a",(function(){return T})),n.d(t,"e",(function(){return S})),n.d(t,"f",(function(){return A}));var r=n(46),o=n.n(r),a=n(5),i=n(19),c=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,n)=>{let[r,o]=n;return{...e,...Object(i.a)(r,t)?{}:{[r]:o}}},{})}},s=function(){let{status:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!(e>=200&&e<=299)},u=n(43),l=n(2),d=n(85),f=n(28),p=n(51),h=n(63),m=n(71),g=n(9),b=n(38);const v=e=>{const{PAT_HOST:t}=e().environment,{local:n,chatbubble:{botKey:r},connection:{token:o}}=e();return{token:o,PAT_HOST:t,botKey:r,local:n}},y=(e,t,n)=>(r,o)=>{const{botKey:a}=v(o);r(Object(g.d)(a,!0)),localStorage.setItem("kindly-chat-restart-message",JSON.stringify({message:e,exchangeId:t,newContext:n}))},w=(e,t)=>async(n,r)=>{const{PAT_HOST:o,token:i}=v(r),c=await n(Object(f.b)()),{headers:u}=Object(g.a)({token:i},{withCurrentUrl:!0,extra:c}),d={message:e,temporaryId:t},p=await n(Object(g.f)({method:"post",url:`${o}/chatbubble/${a.j}/message/`,data:d,headers:u},{onError:e=>{var r;n({type:l.zb,temporaryId:t,status:null==e||null===(r=e.response)||void 0===r?void 0:r.status})}}));s(p)||(n({type:l.zb,...p.data}),n(Object(b.e)()))},x=function(e,t,n){let{responsePromise:r,tempId:i}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},c=arguments.length>4?arguments[4]:void 0;return async(u,d)=>{const{PAT_HOST:p,token:h,local:m}=v(d),y=i||o()();u({type:l.I,data:{id:y,created:(new Date).toISOString(),message:e,buttonType:c}}),u(Object(g.c)((new Date).toISOString()));const w=await u(Object(f.b)()),{headers:x}=Object(g.a)({token:h},{withCurrentUrl:!0,extra:w}),O={message:e,exchange_id:t,temporaryId:y,new_context:{...m.context,...n||{}}},E=r?await r:await u(Object(g.f)({method:"post",url:`${p}/chatbubble/${a.j}/message/`,data:O,headers:x},{onError:e=>{var t;console.error(`/chatbubble/${a.j}/message returned ${e.response.status}`),u({type:l.zb,temporaryId:y,status:null==e||null===(t=e.response)||void 0===t?void 0:t.status}),u({type:l.i,isTyping:!1})}}));s(E)||(u({type:l.zb,...E.data}),u(Object(b.e)()))}},O=e=>({...e,temporaryId:o()()}),E=e=>{let{temporaryId:t}=e;return t},k=()=>async(e,t)=>{var n;const{bot:{id:r},chatbubble:{chatId:i,attachments:u},connection:{token:d},environment:{PAT_HOST:p}}=t(),h=await e(Object(f.b)()),{headers:m}=Object(g.a)({token:d},{extra:h}),b=o()(),v=u.files.map(O).map(c("file"));e({type:l.G,data:{attachments:v}}),e({type:l.k}),e({type:l.I,data:{id:b,created:(new Date).toISOString(),attachment_ids:v.map(E),message:""}}),e(Object(g.c)((new Date).toISOString()));const y=(t,n)=>{var r;e({type:l.zb,temporaryId:b,status:null==t||null===(r=t.response)||void 0===r?void 0:r.status}),n?e({type:l.yb,attachment:{...n,status:a.a.ERROR}}):v.forEach(t=>e({type:l.yb,attachment:{...t,status:a.a.ERROR}}))},w=v.map(c("file","url")),x=`${p}/chatbubble/${a.j}/attachment/create`,k={attachments:w,temporaryChatMessageId:b},C=await e(Object(g.f)({method:"post",url:x,data:k,headers:m},{onError:e=>y(e)}));if(s(C)||!Array.isArray(null==C||null===(n=C.data)||void 0===n?void 0:n.attachments))return;const[_,j]=C.data.attachments.reduce((t,n)=>{let[r,o]=t,{id:a,temporary_id:i,upload_url:c}=n;return e({type:l.yb,attachment:{temporaryId:i,id:a}}),[[...r,a],[...o,c]]},[[],[]]),T={"x-goog-upload-bot-id":r,"x-goog-upload-chat-id":i},S=(I=u.files,A=j,"number"!=typeof(null==I?void 0:I.length)||I.length!==(null==A?void 0:A.length)?(console.error("Trying to zip non-array of arrays of unequal length"),[]):I.map((e,t)=>[e,A[t]])).map(async t=>{let[{file:n,...r},o]=t;const a=await(e=>new Promise((t,n)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=()=>t(r.result),r.onabort=()=>n(new Error(r.error))}))(n),i={...T,"Content-Type":n.type};return await e(Object(g.f)({method:"put",url:o,data:a,headers:i},{onError:e=>y(e,r)}))});var I,A;if((await Promise.all(S)).some(s))return;const N=`${p}/chatbubble/${a.j}/attachment/uploads-complete`,P={attachmentIds:_,temporaryChatMessageId:b,exchangeId:u.exchangeId};e(Object(g.c)((new Date).toISOString())),e(Object(g.f)({method:"post",url:N,data:P,headers:m},{onError:e=>y(e)}))},C=function(e){let{openChat:t,languageCode:n,tempId:r,responsePromise:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return async(c,u)=>{const{connection:{token:d},chatbubble:{currentLanguage:f}}=u(),{PAT_HOST:m}=u().environment;if(!d){const r={triggerDialogueSlug:e,languageCode:n,openChat:t};return c(Object(h.c)(r)),c(Object(p.g)()),void(t&&c(Object(p.k)()))}if(n&&n!==f){const e="Tried to trigger a dialogue in another language on an existing chat";c(Object(g.b)({message:e,level:"error",extra:{languageCode:n,currentLanguage:f}}))}const v=r||o()();c({type:l.wb,data:{id:v,created:(new Date).toISOString(),exchangeId:e}}),c(Object(g.c)((new Date).toISOString()));const y={exchange_id:e,temporaryId:v},{headers:w}=Object(g.a)({token:d},{withCurrentUrl:!0}),x=i?await i:await c(Object(g.f)({method:"post",url:`${m}/chatbubble/${a.j}/trigger/`,data:y,headers:w}));s(x)||(t&&c(Object(p.k)()),c(Object(b.e)()))}},_=e=>e===a.b.PRIVACY_EXPORT?Object(m.c)():{},j=(e,t)=>!!t.find(t=>{let{buttons:n=[]}=t;return!!n.find(t=>{let{language_code:n,button_type:r}=t;return n===e&&Object(u.a)(r)===a.b.HANDOVER_REQUEST})}),T=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return async(i,c)=>{const{connection:{token:s},environment:{PAT_HOST:h,VERSION:b},messages:{chatMessages:v},chatbubble:{currentLanguage:y},local:w}=c(),O=await i(Object(f.b)()),{headers:E}=Object(g.a)({token:s},{withCurrentUrl:!0,extra:O}),k=Object(u.a)(e.button_type),T=o()(),S={};r.length>0&&r.forEach(e=>{if(n.find(t=>t.id===e.id)){S[e.value]=e.value;const n={button:{...e},chatMessage:t,temporaryId:T,version:b},r=_(a.b.CHECKBOX);i(Object(g.f)({method:"post",url:`${h}/chatbubble/${a.j}/button/click/`,data:n,headers:E,...r})),i({type:l.j,buttonClick:{chatMessageId:t.id,buttonId:e.id,time:(new Date).toISOString()}})}else S[e.value]=""});const I={button:{...e,new_context:{...w.context,...S||{}}},chatMessage:t,temporaryId:T,version:b},A=_(k),N=i(Object(g.f)({method:"post",url:`${h}/chatbubble/${a.j}/button/click/`,data:I,headers:E,...A}));switch(i({type:l.j,buttonClick:{chatMessageId:t.id,buttonId:e.id||e._id,time:(new Date).toISOString()}}),k){case a.b.QUICK_REPLY:{const n={responsePromise:N,tempId:T};i(x(e.value,t.exchange_id,e.new_context,n,e.button_type));break}case a.b.HANDOVER_REQUEST:if(!j(y,v)){const e={version:b};i(Object(g.b)({message:"Requested handover with no button",level:"error",extra:e}))}i(Object(d.b)(N));break;case a.b.DIALOGUE_TRIGGER:case a.b.SUGGESTION_DIALOGUE_TRIGGER:i(C(e.value,{tempId:T,responsePromise:N}));break;case a.b.PRIVACY_EXPORT:i(Object(m.b)({responsePromise:N}));break;case a.b.PRIVACY_DELETE:i(Object(m.a)({responsePromise:N}));break;case a.b.CONTACT_DETAILS:i(Object(p.o)(e));break;case a.b.UPLOAD_ATTACHMENT:i(Object(p.a)(e))}}},S=(e,t)=>async(n,r)=>{const{connection:{token:i},environment:{PAT_HOST:c,VERSION:u}}=r(),d=o()(),p=e.contact_details.contact_type,h={...e,button_type:a.b.edit_contact_details};n({type:l.I,data:{id:d,created:(new Date).toISOString(),message:t,buttons:[h],isContactDetails:!0}});const m=await n(Object(f.b)()),{headers:b}=Object(g.a)({token:i},{withCurrentUrl:!0,extra:m}),v={contactType:p,value:t,version:u,buttons:[h],temporaryId:d},y=await n(Object(g.f)({method:"post",url:`${c}/chatbubble/${a.j}/button/contact-details/`,data:v,headers:b}));s(y)||n({type:l.zb,...y.data})},I=((e,t,n)=>{let r,o=[];return function(){for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];n&&o.push(i),clearTimeout(r),r=setTimeout(()=>{n||e(...i);const t=o.slice(1).reduce((e,t)=>n(t,e),o[0]);e(...t),o=[]},t)}})(async(e,t,n)=>{let{id:r,index:o}=e;const{connection:{token:i},environment:{PAT_HOST:c,VERSION:s}}=n(),u=await t(Object(f.b)()),{headers:d}=Object(g.a)({token:i},{withCurrentUrl:!0,extra:u}),p={chatMessageId:r,version:s};t({type:l.db,id:r,index:o}),t(Object(g.f)({method:"patch",url:`${c}/chatbubble/${a.j}/message-seen`,data:p,headers:d}))},1500,(e,t)=>{const[{index:n}]=e,[{index:r}]=t;return n>r?e:t}),A=(e,t)=>(n,r)=>I({id:e,index:t},n,r)},function(e,t,n){"use strict";e.exports=n(162)},function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s}));const r=["load","message"],o="See https://docs.kindly.ai/api/chat#handlers for how to switch.";const a=(e,t,n,a)=>{var i,c;if(-1!==r.indexOf(e)&&Boolean(a)&&function(e,t,n){const r=`on${t.charAt(0).toUpperCase()+t.slice(1)}`;if("function"!=typeof e)return void console.warn(`Provided setting '${r}' is not a function.`);console.warn(`kindlyOptions.${r} is deprecated in favor of standard event handlers. ${o}`);const a=Object.values(n);try{e(...a)}catch(e){console.error(e)}}(a,e,t),"API"!==n)return;if(null===(i=window)||void 0===i||null===(c=i.kindlyChat)||void 0===c||!c.APIRoot)return void console.warn("No APIRoot when rendered using kindly-chat API");"message"===e&&window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("onMessage",{detail:t}));const s=`kindly:${e}`;window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent(s,{detail:t,bubbles:!0}))};function i(e,t,n,r){e&&a("message",{newMessage:e,chatLog:t},r,n)}function c(e){a("load",{settings:e},null==e?void 0:e.renderedBy,null==e?void 0:e.onLoad)}const s=(e,t,n,r,a,i,c)=>{let s=!1;const u=null==e?void 0:e[n];if(u){console.warn(`kindlyOptions.buttonHandlers is deprecated in favor of standard event handlers. ${o}`);try{s=Boolean(u(t,r,a,i,n))}catch(e){console.error(e)}}return"API"===c&&(s=!window.kindlyChat.APIRoot.dispatchEvent(new CustomEvent("kindly:buttonclick",{detail:{button:r,lastMessage:a,chatLog:i,buttonType:n},bubbles:!0,cancelable:!0}))),s}},function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(19),o=n(2);const a={TAKEOVER:"takeover",MESSAGE:"message"},i=e=>(t,n)=>{const{dismissedMessages:i}=n().pushMessages,{autopopupTime:c,enabled:s,title:u,message:l}=e;if(!s||Object(r.a)(u,i))return;const d={type:o.nb,pushMessageTitle:u,pushMessageType:a.MESSAGE,pushMessageText:l};c&&0!==c?setTimeout(()=>t(d),c):t(d)},c=()=>(e,t)=>{const{show:n}=t().pushMessages;n&&e({type:o.B})}},function(e,t,n){"use strict";var r=n(0);t.a=(e,t)=>{const n=Object(r.useRef)();return Object(r.useCallback)(r=>{new Date-n.current<t||(e(r),n.current=new Date)},[t,e])}},function(e,t,n){"use strict";t.a=e=>{const t=(null!=e?e:"").toLowerCase();return"external_link"===t?"link":"handover_request"===t?"takeover_request":t}},function(e,t,n){"use strict";n(4);var r=n(0),o=n.n(r),a=n(3),i=n(66),c=n(10),s=e=>{let{styles:t={},...n}=e;return o.a.createElement("svg",Object.assign({viewBox:"0 0 1792 1792",xmlns:"https://www.w3.org/2000/svg"},n),o.a.createElement("path",{d:"M1408 928v320q0 119-84.5 203.5T1120 1536H288q-119 0-203.5-84.5T0 1248V416q0-119 84.5-203.5T288 128h704q14 0 23 9t9 23v64q0 14-9 23t-23 9H288q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113V928q0-14 9-23t23-9h64q14 0 23 9t9 23zm384-864v512q0 26-19 45t-45 19-45-19l-176-176-652 652q-10 10-23 10t-23-10L695 983q-10-10-10-23t10-23l652-652-176-176q-19-19-19-45t19-45 45-19h512q26 0 45 19t19 45z",fill:"#fff"}))},u=n(5),l=n(68),d=(n(109),n(53),n(8)),f=n(6),p=n(94),h=n(74),m=n(19),g=n(43),b=n(44),v=n(1),y=n(22),w=n(14),x=n(13),O=n(7),E=n(33);const k=Object(v.b)(["color:",";background:",";background-color:",";border-color:",";"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>Object(b.a)(.08,e.theme.buttonBackground)),C=Object(v.b)(["width:100%;max-width:100%;min-width:48px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"]),_=Object(v.b)(["font-family:",";font-size:",";",";transition:all 0.2s ease;:hover{",";box-shadow:",";}:active{text-decoration:none;box-shadow:none;}"],y.a.default,O.c.fontSizeP,e=>e.color?k:"background-color: #fff; background: #fff",e=>e.color?k:"background-color: #fff; background: #fff",e=>{let{disabled:t}=e;return t?"none":`0 2px 4px 0 ${O.a.shadowColorDark}`}),j=Object(v.b)(["",""],e=>{let{hasBeenClicked:t,theme:{buttonBackground:n}}=e;return t&&(Object(E.b)(n)?"filter: brightness(0.82);":"filter: opacity(0.7);")}),T=Object(v.b)(["width:80%;max-width:80%;margin:3px 0 2px;text-align:center;border-radius:17px;font-weight:500;border:1px solid #dedede;padding:8px 12px;"," ",";",""],_,e=>e.hasSuggestion&&C,j),S=Object(v.b)(["box-sizing:border-box;width:100%;overflow:hidden;white-space:nowrap;text-align:left;font-size:16px;font-weight:500;line-height:22px;border:none;border-radius:22px;padding:11px 41px 11px 24px;margin:0 0 8px 0;",":hover{border:none;}"],_),I=Object(v.c)(x.a).withConfig({displayName:"styles__ButtonContainer",componentId:"sc-sn3ww8-0"})(["&&{",";}"],T),A=v.c.a.withConfig({displayName:"styles__LinkContainer",componentId:"sc-sn3ww8-1"})(["&&{color:",";cursor:pointer;outline:none;display:block;position:relative;text-decoration:none;"," ",":hover{text-decoration:none;}:hover,:focus,:active,:visited{",";}"," svg{","}}"],O.a.darkColor,e=>!e.isNudge&&"\n display: flex;\n align-items: center;\n justify-content: center;\n max-width: fit-content;\n ",e=>{let{isNudge:t}=e;return t?S:T},k,w.b,e=>e.isNudge?"\n position: absolute;\n right: 24px;\n top: 50%;\n transform: translateY(-50%);\n ":`\n min-width: 14px;\n margin-left: 10px;\n path {\n fill: ${e.theme.buttonText};\n }\n `),N=v.c.label.withConfig({displayName:"styles__CheckboxLabel",componentId:"sc-sn3ww8-2"})(["display:flex;align-items:center;width:80%;max-width:80%;margin:3px 0 2px;text-align:left;border-radius:17px;font-weight:500;border:1px solid ",";padding:8px 12px;color:",";"," background:transparent;&:hover{background:transparent;cursor:pointer;}"],e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements},_),P=v.c.div.withConfig({displayName:"styles__CheckboxContainer",componentId:"sc-sn3ww8-3"})(["display:inline-flex;"]),M=v.c.svg.withConfig({displayName:"styles__CheckboxIcon",componentId:"sc-sn3ww8-4"})(["fill:none;stroke:white;stroke-width:2px;"]),R=v.c.div.withConfig({displayName:"styles__StyledCheckbox",componentId:"sc-sn3ww8-5"})(["display:inline-block;width:16px;height:16px;border-radius:3px;transition:all 150ms;background:",";",";","{visibility:",";}"],e=>{let{theme:{buttonBackground:t}}=e;return t},e=>{let{checked:t,theme:{buttonBackground:n}}=e;return t?`\n background: ${n};\n `:`\n ${Object(E.b)(n)?"filter: brightness(0.7);":"filter: opacity(0.3);"};`},M,e=>e.checked?"visible":"hidden"),L=v.c.input.attrs({type:"checkbox"}).withConfig({displayName:"styles__HiddenCheckbox",componentId:"sc-sn3ww8-6"})(["border:0;height:0px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;&:focus ~ ","{box-shadow:0 0 0 3px ",";}"],R,e=>{let{theme:{buttonBackground:t}}=e;return t}),{EXTERNAL_LINK:D,EMAIL:B,PHONE:z,CHECKBOX:U}=u.b,H=e=>{let{button:t,setCheckboxValue:n,checked:u,chatMessage:b,color:v="blue",disabled:y=!1,handlers:w=null,hasSuggestion:x=!1,isNudge:O=!1,onClick:E=null,checkboxButtons:k}=e;const C=Object(a.c)(),_=Object(g.a)(t.button_type),{chatMessages:j,buttonClicks:T}=Object(a.d)(f.l)||[],S=Object(a.d)(f.e)||[],H=Object(m.a)(_,[D,z,B]),F=Object(m.a)(_,[U]),$=Boolean(u.find(e=>e.id===t.id));let q="";_===z&&(q="tel:"),_===B&&(q="mailto:");const G=Object(r.useCallback)(e=>{if(e.preventDefault(),Object(i.a)(e,w,_,Object(p.a)(t),Object(h.a)(b||{}),j.map(h.a),null==S?void 0:S.renderedBy))return;"function"==typeof E&&E(),C(Object(d.g)(t,b,u,k));const{href:n,target:r}=e.target;if(n){const e=Boolean(r);setTimeout(()=>{e?window.open(n,r):window.location.href=n},250)}},[_,b,j,t,C,w,u,k,E,null==S?void 0:S.renderedBy]),Y=Object(l.a)(G,3e3),V=(null!=T?T:[]).find(e=>{let{chatMessageId:n,buttonId:r}=e;return n===(null==b?void 0:b.id)&&r===t.id}),W=Object(r.useCallback)(()=>{n(t)},[t,n]);return Object(r.useEffect)(()=>{V&&F&&!$&&n(t)},[V,F,t,n,$]),H?o.a.createElement(A,{color:v,"data-cy":"message-button",href:`${q}${_===D?(K=t.value,K.match(/^https?:\/\//i)?K:`http://${K}`):t.value}`,target:`${_!==D||O?"_self":"_blank"}`,onClick:Y,isNudge:O,hasBeenClicked:V},t.label,_===D&&O&&o.a.createElement(c.b,{fill:"#FFF",width:10,height:16}),_===D&&!O&&o.a.createElement(s,{width:14,height:14})):F?o.a.createElement("div",null,o.a.createElement(N,null,o.a.createElement(P,null,o.a.createElement(L,{checked:$,onChange:W}),o.a.createElement(R,{checked:$},o.a.createElement(M,{viewBox:"0 0 24 24"},o.a.createElement("polyline",{points:"20 6 9 17 4 12"})))),o.a.createElement("span",{style:{marginLeft:8}},t.label))):o.a.createElement(I,{hasSuggestion:x,"data-cy":"message-button",color:v,type:"button",tabIndex:"0",disabled:y,onClick:Y,hasBeenClicked:V},t.label,_===D&&o.a.createElement(s,{width:14,height:14}));var K};H.defaultProps={checked:[]};t.a=H},function(e,t,n){"use strict";n.d(t,"c",(function(){return u})),n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return d}));var r=n(147),o=n.n(r),a=n(5);function i(e){if(!e)return null;const t=e.match(/filename="(.+)"/);return t&&2===t.length?t[1]:null}var c=n(2),s=n(9);const u=()=>({transformResponse:e=>e,responseType:"text"}),l=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"html";return async(n,r)=>{var c;let l=e?await e:null;if(!l){const{connection:{token:e},environment:{PAT_HOST:o}}=r(),i=`${o}/chatbubble/${a.j}/privacy/export/${t}`,{headers:c}=Object(s.a)({token:e}),d=u();l=await n(Object(s.f)({method:"get",url:i,...d,headers:c}))}if(200!==(null===(c=l)||void 0===c?void 0:c.status))return;const{headers:d,data:f}=l,p=i(d["content-disposition"])||"export.json",h=new Blob([f],{type:d["content-type"]});o()(h,p)}},d=function(){let{responsePromise:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return async(t,n)=>{const{connection:{token:r},chatbubble:{botKey:o},environment:{PAT_HOST:i}}=n(),u=`${i}/chatbubble/${a.j}/privacy/delete/`,l=e?await e:await t(Object(s.f)({method:"delete",url:u,...Object(s.a)({token:r})}));200===(null==l?void 0:l.status)&&(setTimeout(()=>t(Object(s.d)(o)),5e3),t({type:c.v}),t({type:c.V}))}}},function(e,t,n){"use strict";var r=n(65),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},c={};function s(e){return r.isMemo(e)?i:c[e.$$typeof]||o}c[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},c[r.Memo]=i;var u=Object.defineProperty,l=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var o=p(n);o&&o!==h&&e(t,o,r)}var i=l(n);d&&(i=i.concat(d(n)));for(var c=s(t),m=s(n),g=0;g<i.length;++g){var b=i[g];if(!(a[b]||r&&r[b]||m&&m[b]||c&&c[b])){var v=f(n,b);try{u(t,b,v)}catch(e){}}}}return t}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return c}));var r=n(146);let o,a;const i=e=>(t,n)=>{const{SAGE_WS_HOST:i}=n().environment;if(!o||!o.isConnected())try{o=new r.Socket(`${i}/chatbubble/socket`),o.connect()}catch(e){console.warn("Could not connect to sage socket",e)}try{a=o.channel(`chatbubble_active:${e}`),a.join()}catch(e){console.warn("Could not join active channel",e)}},c=()=>{if(o&&a)try{a.leave()}catch(e){console.warn("Could not leave active channel",e)}if(o)try{o.disconnect()}catch(e){console.warn("Could not disconnect from sage socket",e)}}},function(e,t,n){"use strict";var r=n(94);t.a=e=>{let{buttons:t=[],...n}=e;return{...n,buttons:t.map(r.a)}}},function(e,t){e.exports={}},function(e,t,n){var r=n(108),o=n(26),a=n(123),i=n(35)("toStringTag"),c="Arguments"==a(function(){return arguments}());e.exports=r?a: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=Object(e),i))?n:c?a(t):"Object"==(r=a(t))&&o(t.callee)?"Arguments":r}},function(e,t,n){"use strict";t.a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce((t,n)=>({...t,...e(n)}),{})}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(191),o=n(124);e.exports=function(e){return r(o(e))}},function(e,t,n){var r=n(102),o=n(34),a=n(26),i=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},function(e,t){e.exports=!0},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(59);e.exports=function(e,t,n,o){o&&o.enumerable?e[t]=n:r(e,t,n)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o}));const r="v2",o=Object.freeze(["agent","alerts","bot","chatbubble","feedback","privacy","websocketFallback","lightbox","nudge"])},function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return l}));var r=n(5),o=n(2),a=n(9),i=n(38);const c=e=>async t=>{const n=await e;200===(null==n?void 0:n.status)&&(t({type:o.ub,...n.data,requestedTakeover:!0}),t(Object(i.e)()))},s=()=>(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:i}}=t();e(Object(a.f)({method:"post",url:`${i}/chatbubble/${r.j}/takeover_cancel/`,...Object(a.a)({token:n})})),e({type:o.tb})},u=()=>(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:i}}=t();e({type:o.Bb}),e(Object(a.f)({method:"post",url:`${i}/chatbubble/${r.j}/user_started_typing/`,...Object(a.a)({token:n})}))},l=()=>(e,t)=>{const{connection:{token:n},environment:{PAT_HOST:i}}=t();e({type:o.Cb}),e(Object(a.f)({method:"post",url:`${i}/chatbubble/${r.j}/user_stopped_typing/`,...Object(a.a)({token:n})}))}},function(e,t,n){"use strict";var r=n(19);t.a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Object.entries(e).reduce((e,n)=>{let[o,a]=n;return{...e,...Object(r.a)(o,t)?{[o]:a}:{}}},{})}},function(e,t,n){"use strict";const r=e=>{let{buttonId:t,chatMessageId:n}=e;return`button-click-${n}-${t}`};t.a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return t=>!e.find(e=>r(t)===r(e))}},function(e,t,n){"use strict";t.a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return e.reduce((e,n)=>{var r;return{...e,[t(n)]:[...null!==(r=e[t(n)])&&void 0!==r?r:[],n]}},{})}},function(e,t,n){"use strict";t.a=e=>t=>{let{id:n,chatbubble_temporary_id:r}=t;return!e.find(e=>{let{id:t}=e;return n===t||r===t})}},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));const r="SET_NEW_CONTEXT"},function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));let r=null;async function o(){try{if(!r){const{default:e}=await Promise.resolve().then(n.t.bind(null,224,7));r=new Audio(e)}await r.play()}catch(e){console.error("Could not play notification sound:",e)}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(23),o=n(20),a=n(15);function i(e,t){Object(a.a)(2,arguments);var n=Object(o.a)(e).getTime(),i=Object(r.a)(t);return new Date(n+i)}},function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var r=n(0),o=n(3),a=n(6);function i(){const{nudges:e}=Object(o.d)(a.d);return Object(r.useMemo)(()=>{var t,n,r,o,a;return[...null!==(t=null==e?void 0:e.form_nudges)&&void 0!==t?t:[],...null!==(n=null==e?void 0:e.custom_nudges)&&void 0!==n?n:[],...null!==(r=null==e?void 0:e.product_nudges)&&void 0!==r?r:[],...null!==(o=null==e?void 0:e.text_nudges)&&void 0!==o?o:[],...null!==(a=null==e?void 0:e.multiple_choice_nudges)&&void 0!==a?a:[]]},[e])}},function(e,t,n){"use strict";var r=n(43),o=n(69);t.a=e=>{let{button_type:t,...n}=e;return{...n,button_type:Object(o.a)(t),category:Object(r.a)(t)}}},function(e,t,n){"use strict";var r=n(0);function o(e){return e.touches||e.originalEvent.touches}let a=null;t.a=e=>{let{setIndex:t,index:n,carousel:i}=e;return{handleTouchStart:Object(r.useCallback)(e=>{const t=o(e)[0];a=t.clientX},[]),handleTouchMove:Object(r.useCallback)(e=>{if(!a)return;const r=o(e)[0].clientX;t(a-r>5?n+1:n-1,i),a=null},[i,n,t]),handleTouchEnd:Object(r.useCallback)(()=>{a=null},[])}}},function(e,t,n){"use strict";n(4);var r=n(0),o=n.n(r),a=n(3),i=(n(52),n(8)),c=n(10),s=n(25),u=n(32),l=n(1),d=n(7);const f=Object(l.b)(["border-radius:100px;background-color:",";"],d.a.grayColor),p=l.c.div.withConfig({displayName:"styles__ErrorContent",componentId:"sc-1lhoync-0"})(["height:100%;width:100%;display:grid;background-color:#fff;grid-template-rows:55px 1fr 70px;"]),h=l.c.div.withConfig({displayName:"styles__ErrorHeader",componentId:"sc-1lhoync-1"})(["padding:10px 20px;display:grid;align-items:center;grid-template-columns:30px 1fr 40px;box-shadow:0px 3px 4px -1px ",";"],d.a.shadowColor),m=l.c.div.withConfig({displayName:"styles__ErrorName",componentId:"sc-1lhoync-2"})(["height:20px;width:110px;margin-left:20px;",""],f),g=l.c.div.withConfig({displayName:"styles__ErrorContainer",componentId:"sc-1lhoync-3"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;width:210px;margin:auto;"]),b=l.c.span.withConfig({displayName:"styles__ErrorText",componentId:"sc-1lhoync-4"})(["font-size:14px;margin:16px 0 24px 0;",";"],e=>e.heading&&"font-size: 19px; font-weight: 400; \n margin: 0"),v=l.c.div.withConfig({displayName:"styles__ErrorCircle",componentId:"sc-1lhoync-5"})(["height:","px;min-width:","px;",""],e=>e.size,e=>e.size,f),y=l.c.div.withConfig({displayName:"styles__ErrorComposer",componentId:"sc-1lhoync-6"})(["display:flex;align-items:center;padding:15px 0;margin:0 20px;border-top:1px solid ",";"],d.a.grayColor),w=l.c.div.withConfig({displayName:"styles__ErrorInput",componentId:"sc-1lhoync-7"})(["height:40px;width:100%;margin-right:20px;",""],f);var x=()=>{const e=Object(a.c)(),t=Object(r.useCallback)(()=>{e(Object(i.v)())},[e]);return o.a.createElement(p,null,o.a.createElement(h,null,o.a.createElement(v,{size:30}),o.a.createElement(m,null),o.a.createElement(u.b,{"aria-label":"Close chat",title:"Close chat",type:"button",onClick:t,"data-cy":"close-chat-button"},o.a.createElement(c.e,{width:25,height:25}))),o.a.createElement(g,null,o.a.createElement(b,{heading:!0},"Oh no..."),o.a.createElement(b,null,"We were unable to load the chat. Please refresh or try again later."),o.a.createElement(s.a,{onClick:t,color:!0},"Refresh chat")),o.a.createElement(y,null,o.a.createElement(w,null),o.a.createElement(v,{size:40})))};class O extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return e?{hasError:!0}:{}}componentDidCatch(e,t){var n;const{dispatch:r,errorPoint:o}=this.props,a=`Component tree crashed ${o}: ${e.message}`,c={errorName:e.name,errorMessage:e.message,errorStack:e.stack,point:o,componentStack:null==t||null===(n=t.componentStack)||void 0===n?void 0:n.trim()};r(Object(i.B)({message:a,error:e,extra:c,level:"error"}))}render(){const{hasError:e}=this.state,{children:t,displayError:n}=this.props;return e&&n?o.a.createElement(x,null):e?null:t}}O.defaultProps={displayError:!0};t.a=Object(a.b)()(O)},function(e,t,n){"use strict";var r=n(23),o=n(92),a=n(15);var i=n(226),c=n(20);t.a=e=>{let{botKey:t,persistStateLifespan:n}=e;const s=localStorage.getItem(`kindly-chat-${t}`);if(s){var u,l;const e=null===(u=JSON.parse(s))||void 0===u||null===(l=u.messages)||void 0===l?void 0:l.messageSentTime;if(-1===n)return!0;if(0!==n){return function(e,t){Object(a.a)(2,arguments);var n=Object(c.a)(e),r=Object(c.a)(t);return n.getTime()>r.getTime()}(function(e,t){Object(a.a)(2,arguments);var n=Object(r.a)(t);return Object(o.a)(e,1e3*n)}(Object(i.a)(e),n),new Date)}}return!1}},function(e,t,n){"use strict";n.r(t);var r=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,o=function(e){var t={};return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}((function(e){return r.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));t.default=o},function(e,t){var n,r,o=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(e){n=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,u=[],l=!1,d=-1;function f(){l&&s&&(l=!1,s.length?u=s.concat(u):d=-1,u.length&&p())}function p(){if(!l){var e=c(f);l=!0;for(var t=u.length;t;){for(s=u,u=[];++d<t;)s&&s[d].run();d=-1,t=u.length}s=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function h(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new h(e,t)),1!==u.length||l||c(p)},h.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t,n){var r=n(34),o=n(195),a=r["__core-js_shared__"]||o("__core-js_shared__",{});e.exports=a},function(e,t,n){var r=n(60),o=n(126),a=n(61),i=n(128),c=Object.defineProperty;t.f=r?c:function(e,t,n){if(a(e),t=i(t),a(n),o)try{return c(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},function(e,t){e.exports={}},function(e,t,n){var r=n(26),o=n(199);e.exports=function(e){if(r(e))return e;throw TypeError(o(e)+" is not a function")}},function(e,t,n){var r=n(133),o=n(135),a=r("keys");e.exports=function(e){return a[e]||(a[e]=o(e))}},function(e,t){e.exports={}},function(e,t,n){var r,o=n(61),a=n(206),i=n(141),c=n(105),s=n(212),u=n(127),l=n(104),d=l("IE_PROTO"),f=function(){},p=function(e){return"<script>"+e+"<\/script>"},h=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},m=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t;m="undefined"!=typeof document?document.domain&&r?h(r):((t=u("iframe")).style.display="none",s.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F):h(r);for(var n=i.length;n--;)delete m.prototype[i[n]];return m()};c[d]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f.prototype=o(e),n=new f,f.prototype=null,n[d]=e):n=m(),void 0===t?n:a(n,t)}},function(e,t,n){var r=n(108),o=n(101).f,a=n(59),i=n(41),c=n(214),s=n(35)("toStringTag");e.exports=function(e,t,n,u){if(e){var l=n?e:e.prototype;i(l,s)||o(l,s,{configurable:!0,value:t}),u&&!r&&a(l,"toString",c)}}},function(e,t,n){var r={};r[n(35)("toStringTag")]="z",e.exports="[object z]"===String(r)},function(e,t,n){"use strict";var r=n(4),o=n.n(r),a=n(5),i=n(69);o.a.shape({button_type:o.a.oneOf([...Object.values(a.b),...Object.values(a.b).map(i.a)]).isRequired,is_active:o.a.bool,label:o.a.string.isRequired,value:o.a.string,new_context:o.a.object,index:o.a.number,language_code:o.a.string})},function(e,t,n){"use strict";var r=n(4),o=n.n(r);t.a=o.a.arrayOf(o.a.shape({selected:o.a.bool.isRequired,_id:o.a.string.isRequired,score:o.a.number.isRequired,sample:o.a.string.isRequired}))},function(e,t,n){"use strict";(function(e,r){var o,a=n(144);o="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:r;var i=Object(a.a)(o);t.a=i}).call(this,n(78),n(163)(e))},,function(e,t){e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}}},function(e,t,n){"use strict";var r=n(30);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,n){if(!t)return e;var a;if(n)a=n(t);else if(r.isURLSearchParams(t))a=t.toString();else{var i=[];r.forEach(t,(function(e,t){null!=e&&(r.isArray(e)?t+="[]":e=[e],r.forEach(e,(function(e){r.isDate(e)?e=e.toISOString():r.isObject(e)&&(e=JSON.stringify(e)),i.push(o(t)+"="+o(e))})))})),a=i.join("&")}if(a){var c=e.indexOf("#");-1!==c&&(e=e.slice(0,c)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}},function(e,t,n){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";(function(t){var r=n(30),o=n(169),a={"Content-Type":"application/x-www-form-urlencoded"};function i(e,t){!r.isUndefined(e)&&r.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var c,s={adapter:(("undefined"!=typeof XMLHttpRequest||void 0!==t&&"[object process]"===Object.prototype.toString.call(t))&&(c=n(118)),c),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),r.isFormData(e)||r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)?e:r.isArrayBufferView(e)?e.buffer:r.isURLSearchParams(e)?(i(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):r.isObject(e)?(i(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};s.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],(function(e){s.headers[e]={}})),r.forEach(["post","put","patch"],(function(e){s.headers[e]=r.merge(a)})),e.exports=s}).call(this,n(99))},function(e,t,n){"use strict";var r=n(30),o=n(170),a=n(172),i=n(115),c=n(173),s=n(176),u=n(177),l=n(119);e.exports=function(e){return new Promise((function(t,n){var d=e.data,f=e.headers;r.isFormData(d)&&delete f["Content-Type"];var p=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(h+":"+m)}var g=c(e.baseURL,e.url);if(p.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),p.timeout=e.timeout,p.onreadystatechange=function(){if(p&&4===p.readyState&&(0!==p.status||p.responseURL&&0===p.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in p?s(p.getAllResponseHeaders()):null,a={data:e.responseType&&"text"!==e.responseType?p.response:p.responseText,status:p.status,statusText:p.statusText,headers:r,config:e,request:p};o(t,n,a),p=null}},p.onabort=function(){p&&(n(l("Request aborted",e,"ECONNABORTED",p)),p=null)},p.onerror=function(){n(l("Network Error",e,null,p)),p=null},p.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(l(t,e,"ECONNABORTED",p)),p=null},r.isStandardBrowserEnv()){var b=(e.withCredentials||u(g))&&e.xsrfCookieName?a.read(e.xsrfCookieName):void 0;b&&(f[e.xsrfHeaderName]=b)}if("setRequestHeader"in p&&r.forEach(f,(function(e,t){void 0===d&&"content-type"===t.toLowerCase()?delete f[t]:p.setRequestHeader(t,e)})),r.isUndefined(e.withCredentials)||(p.withCredentials=!!e.withCredentials),e.responseType)try{p.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&p.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&p.upload&&p.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){p&&(p.abort(),n(e),p=null)})),d||(d=null),p.send(d)}))}},function(e,t,n){"use strict";var r=n(171);e.exports=function(e,t,n,o,a){var i=new Error(e);return r(i,t,n,o,a)}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e,t){t=t||{};var n={},o=["url","method","data"],a=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],c=["validateStatus"];function s(e,t){return r.isPlainObject(e)&&r.isPlainObject(t)?r.merge(e,t):r.isPlainObject(t)?r.merge({},t):r.isArray(t)?t.slice():t}function u(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(e[o],t[o])}r.forEach(o,(function(e){r.isUndefined(t[e])||(n[e]=s(void 0,t[e]))})),r.forEach(a,u),r.forEach(i,(function(o){r.isUndefined(t[o])?r.isUndefined(e[o])||(n[o]=s(void 0,e[o])):n[o]=s(void 0,t[o])})),r.forEach(c,(function(r){r in t?n[r]=s(e[r],t[r]):r in e&&(n[r]=s(void 0,e[r]))}));var l=o.concat(a).concat(i).concat(c),d=Object.keys(e).concat(Object.keys(t)).filter((function(e){return-1===l.indexOf(e)}));return r.forEach(d,u),n}},function(e,t,n){"use strict";function r(e){this.message=e}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,e.exports=r},function(e,t,n){"use strict";var r=n(79),o=n(192),a=n(75),i=n(125),c=n(201),s=i.set,u=i.getterFor("Array Iterator");e.exports=c(Array,"Array",(function(e,t){s(this,{type:"Array Iterator",target:r(e),index:0,kind:t})}),(function(){var e=u(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),a.Arguments=a.Array,o("keys"),o("values"),o("entries")},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r,o,a,i=n(193),c=n(34),s=n(58),u=n(59),l=n(41),d=n(100),f=n(104),p=n(105),h=c.WeakMap;if(i||d.state){var m=d.state||(d.state=new h),g=m.get,b=m.has,v=m.set;r=function(e,t){if(b.call(m,e))throw new TypeError("Object already initialized");return t.facade=e,v.call(m,e,t),t},o=function(e){return g.call(m,e)||{}},a=function(e){return b.call(m,e)}}else{var y=f("state");p[y]=!0,r=function(e,t){if(l(e,y))throw new TypeError("Object already initialized");return t.facade=e,u(e,y,t),t},o=function(e){return l(e,y)?e[y]:{}},a=function(e){return l(e,y)}}e.exports={set:r,get:o,has:a,enforce:function(e){return a(e)?o(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!s(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},function(e,t,n){var r=n(60),o=n(47),a=n(127);e.exports=!r&&!o((function(){return 7!=Object.defineProperty(a("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var r=n(34),o=n(58),a=r.document,i=o(a)&&o(a.createElement);e.exports=function(e){return i?a.createElement(e):{}}},function(e,t,n){var r=n(196),o=n(129);e.exports=function(e){var t=r(e,"string");return o(t)?t:String(t)}},function(e,t,n){var r=n(26),o=n(80),a=n(130);e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=o("Symbol");return r(t)&&Object(e)instanceof t}},function(e,t,n){var r=n(131);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var r=n(197),o=n(47);e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},function(e,t,n){var r=n(103);e.exports=function(e,t){var n=e[t];return null==n?void 0:r(n)}},function(e,t,n){var r=n(81),o=n(100);(e.exports=function(e,t){return o[e]||(o[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.18.0",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},function(e,t,n){var r=n(124);e.exports=function(e){return Object(r(e))}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},function(e,t,n){"use strict";var r=n(34),o=n(26),a=n(202).f,i=n(204),c=n(102),s=n(137),u=n(59),l=n(41),d=function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var n,f,p,h,m,g,b,v,y=e.target,w=e.global,x=e.stat,O=e.proto,E=w?r:x?r[y]:(r[y]||{}).prototype,k=w?c:c[y]||u(c,y,{})[y],C=k.prototype;for(p in t)n=!i(w?p:y+(x?".":"#")+p,e.forced)&&E&&l(E,p),m=k[p],n&&(g=e.noTargetGet?(v=a(E,p))&&v.value:E[p]),h=n&&g?g:t[p],n&&typeof m==typeof h||(b=e.bind&&n?s(h,r):e.wrap&&n?d(h):O&&o(h)?s(Function.call,h):h,(e.sham||h&&h.sham||m&&m.sham)&&u(b,"sham",!0),u(k,p,b),O&&(l(c,f=y+"Prototype")||u(c,f,{}),u(c[f],p,h),e.real&&C&&!C[p]&&u(C,p,h)))}},function(e,t,n){var r=n(103);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(139).IteratorPrototype,o=n(106),a=n(82),i=n(107),c=n(75),s=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=o(r,{next:a(1,n)}),i(e,u,!1,!0),c[u]=s,e}},function(e,t,n){"use strict";var r,o,a,i=n(47),c=n(26),s=n(106),u=n(142),l=n(83),d=n(35),f=n(81),p=d("iterator"),h=!1;[].keys&&("next"in(a=[].keys())?(o=u(u(a)))!==Object.prototype&&(r=o):h=!0),null==r||i((function(){var e={};return r[p].call(e)!==e}))?r={}:f&&(r=s(r)),c(r[p])||l(r,p,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:h}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(e,t,n){var r=n(41),o=n(26),a=n(134),i=n(104),c=n(213),s=i("IE_PROTO"),u=Object.prototype;e.exports=c?Object.getPrototypeOf:function(e){var t=a(e);if(r(t,s))return t[s];var n=t.constructor;return o(n)&&t instanceof n?n.prototype:t instanceof Object?u:null}},function(e,t,n){var r=n(76),o=n(132),a=n(75),i=n(35)("iterator");e.exports=function(e){if(null!=e)return o(e,i)||o(e,"@@iterator")||a[r(e)]}},function(e,t,n){"use strict";function r(e){var t,n=e.Symbol;return"function"==typeof n?n.observable?t=n.observable:(t=n("observable"),n.observable=t):t="@@observable",t}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";(function(e){var r=n(84),o=n(86);t.a=t=>{let{level:n="info",error:a,message:i,reduxState:c,extra:s}=t;if(!(i||null!=a&&a.message))return console.error("Attempted to log without message"),null;const u=Object(o.a)(c||{},r.b),l={version:e.env.VERSION,release:e.env.IS_PURE_BUILD?`${e.env.VERSION}-pure`:e.env.VERSION,userAgent:navigator.userAgent,state:c?JSON.stringify(u):void 0,...s},d={message:null==a?void 0:a.message,name:null==a?void 0:a.name,stack:null==a?void 0:a.stack,code:null==a?void 0:a.code,signal:null==a?void 0:a.signal};return{message:null!=i?i:null==a?void 0:a.message,level:n,extra:l,error:d}}}).call(this,n(99))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=0,c=1,s=2,u=3,l="closed",d="errored",f="joined",p="joining",h="leaving",m="phx_close",g="phx_error",b="phx_join",v="phx_reply",y="phx_leave",w="longpoll",x="websocket",O=function(){function e(t,n,r,o){a(this,e),this.channel=t,this.event=n,this.payload=r||{},this.receivedResp=null,this.timeout=o,this.timeoutTimer=null,this.recHooks=[],this.sent=!1}return o(e,[{key:"resend",value:function(e){this.timeout=e,this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}},{key:"send",value:function(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref}))}},{key:"receive",value:function(e,t){return this.hasReceived(e)&&t(this.receivedResp.response),this.recHooks.push({status:e,callback:t}),this}},{key:"matchReceive",value:function(e){var t=e.status,n=e.response;e.ref;this.recHooks.filter((function(e){return e.status===t})).forEach((function(e){return e.callback(n)}))}},{key:"cancelRefEvent",value:function(){this.refEvent&&this.channel.off(this.refEvent)}},{key:"cancelTimeout",value:function(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}},{key:"startTimeout",value:function(){var e=this;this.timeoutTimer||(this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,(function(t){e.cancelRefEvent(),e.cancelTimeout(),e.receivedResp=t,e.matchReceive(t)})),this.timeoutTimer=setTimeout((function(){e.trigger("timeout",{})}),this.timeout))}},{key:"hasReceived",value:function(e){return this.receivedResp&&this.receivedResp.status===e}},{key:"trigger",value:function(e,t){this.channel.trigger(this.refEvent,{status:e,response:t})}}]),e}(),E=t.Channel=function(){function e(t,n,r){var o=this;a(this,e),this.state=l,this.topic=t,this.params=n||{},this.socket=r,this.bindings=[],this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new O(this,b,this.params,this.timeout),this.pushBuffer=[],this.rejoinTimer=new _((function(){return o.rejoinUntilConnected()}),this.socket.reconnectAfterMs),this.joinPush.receive("ok",(function(){o.state=f,o.rejoinTimer.reset(),o.pushBuffer.forEach((function(e){return e.send()})),o.pushBuffer=[]})),this.onClose((function(){o.rejoinTimer.reset(),o.socket.log("channel","close "+o.topic+" "+o.joinRef()),o.state=l,o.socket.remove(o)})),this.onError((function(e){o.isLeaving()||o.isClosed()||(o.socket.log("channel","error "+o.topic,e),o.state=d,o.rejoinTimer.scheduleTimeout())})),this.joinPush.receive("timeout",(function(){o.isJoining()&&(o.socket.log("channel","timeout "+o.topic,o.joinPush.timeout),o.state=d,o.rejoinTimer.scheduleTimeout())})),this.on(v,(function(e,t){o.trigger(o.replyEventName(t),e)}))}return o(e,[{key:"rejoinUntilConnected",value:function(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this.rejoin()}},{key:"join",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;if(this.joinedOnce)throw"tried to join multiple times. 'join' can only be called a single time per channel instance";return this.joinedOnce=!0,this.rejoin(e),this.joinPush}},{key:"onClose",value:function(e){this.on(m,e)}},{key:"onError",value:function(e){this.on(g,(function(t){return e(t)}))}},{key:"on",value:function(e,t){this.bindings.push({event:e,callback:t})}},{key:"off",value:function(e){this.bindings=this.bindings.filter((function(t){return t.event!==e}))}},{key:"canPush",value:function(){return this.socket.isConnected()&&this.isJoined()}},{key:"push",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.timeout;if(!this.joinedOnce)throw"tried to push '"+e+"' to '"+this.topic+"' before joining. Use channel.join() before pushing events";var r=new O(this,e,t,n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}},{key:"leave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.state=h;var n=function(){e.socket.log("channel","leave "+e.topic),e.trigger(m,"leave",e.joinRef())},r=new O(this,y,{},t);return r.receive("ok",(function(){return n()})).receive("timeout",(function(){return n()})),r.send(),this.canPush()||r.trigger("ok",{}),r}},{key:"onMessage",value:function(e,t,n){return t}},{key:"isMember",value:function(e){return this.topic===e}},{key:"joinRef",value:function(){return this.joinPush.ref}},{key:"sendJoin",value:function(e){this.state=p,this.joinPush.resend(e)}},{key:"rejoin",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.timeout;this.isLeaving()||this.sendJoin(e)}},{key:"trigger",value:function(e,t,n){if(!(n&&[m,g,y,b].indexOf(e)>=0&&n!==this.joinRef())){var r=this.onMessage(e,t,n);if(t&&!r)throw"channel onMessage callbacks must return the payload, modified or unmodified";this.bindings.filter((function(t){return t.event===e})).map((function(e){return e.callback(r,n)}))}}},{key:"replyEventName",value:function(e){return"chan_reply_"+e}},{key:"isClosed",value:function(){return this.state===l}},{key:"isErrored",value:function(){return this.state===d}},{key:"isJoined",value:function(){return this.state===f}},{key:"isJoining",value:function(){return this.state===p}},{key:"isLeaving",value:function(){return this.state===h}}]),e}(),k=(t.Socket=function(){function e(t){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};a(this,e),this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.timeout=r.timeout||1e4,this.transport=r.transport||window.WebSocket||k,this.heartbeatIntervalMs=r.heartbeatIntervalMs||3e4,this.reconnectAfterMs=r.reconnectAfterMs||function(e){return[1e3,2e3,5e3,1e4][e-1]||1e4},this.logger=r.logger||function(){},this.longpollerTimeout=r.longpollerTimeout||2e4,this.params=r.params||{},this.endPoint=t+"/"+x,this.reconnectTimer=new _((function(){n.disconnect((function(){return n.connect()}))}),this.reconnectAfterMs)}return o(e,[{key:"protocol",value:function(){return location.protocol.match(/^https/)?"wss":"ws"}},{key:"endPointURL",value:function(){var e=C.appendParams(C.appendParams(this.endPoint,this.params),{vsn:"1.0.0"});return"/"!==e.charAt(0)?e:"/"===e.charAt(1)?this.protocol()+":"+e:this.protocol()+"://"+location.host+e}},{key:"disconnect",value:function(e,t,n){this.conn&&(this.conn.onclose=function(){},t?this.conn.close(t,n||""):this.conn.close(),this.conn=null),e&&e()}},{key:"connect",value:function(e){var t=this;e&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=e),this.conn||(this.conn=new this.transport(this.endPointURL()),this.conn.timeout=this.longpollerTimeout,this.conn.onopen=function(){return t.onConnOpen()},this.conn.onerror=function(e){return t.onConnError(e)},this.conn.onmessage=function(e){return t.onConnMessage(e)},this.conn.onclose=function(e){return t.onConnClose(e)})}},{key:"log",value:function(e,t,n){this.logger(e,t,n)}},{key:"onOpen",value:function(e){this.stateChangeCallbacks.open.push(e)}},{key:"onClose",value:function(e){this.stateChangeCallbacks.close.push(e)}},{key:"onError",value:function(e){this.stateChangeCallbacks.error.push(e)}},{key:"onMessage",value:function(e){this.stateChangeCallbacks.message.push(e)}},{key:"onConnOpen",value:function(){var e=this;this.log("transport","connected to "+this.endPointURL(),this.transport.prototype),this.flushSendBuffer(),this.reconnectTimer.reset(),this.conn.skipHeartbeat||(clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval((function(){return e.sendHeartbeat()}),this.heartbeatIntervalMs)),this.stateChangeCallbacks.open.forEach((function(e){return e()}))}},{key:"onConnClose",value:function(e){this.log("transport","close",e),this.triggerChanError(),clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach((function(t){return t(e)}))}},{key:"onConnError",value:function(e){this.log("transport",e),this.triggerChanError(),this.stateChangeCallbacks.error.forEach((function(t){return t(e)}))}},{key:"triggerChanError",value:function(){this.channels.forEach((function(e){return e.trigger(g)}))}},{key:"connectionState",value:function(){switch(this.conn&&this.conn.readyState){case i:return"connecting";case c:return"open";case s:return"closing";default:return"closed"}}},{key:"isConnected",value:function(){return"open"===this.connectionState()}},{key:"remove",value:function(e){this.channels=this.channels.filter((function(t){return t.joinRef()!==e.joinRef()}))}},{key:"channel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new E(e,t,this);return this.channels.push(n),n}},{key:"push",value:function(e){var t=this,n=e.topic,r=e.event,o=e.payload,a=e.ref,i=function(){return t.conn.send(JSON.stringify(e))};this.log("push",n+" "+r+" ("+a+")",o),this.isConnected()?i():this.sendBuffer.push(i)}},{key:"makeRef",value:function(){var e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}},{key:"sendHeartbeat",value:function(){this.isConnected()&&this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.makeRef()})}},{key:"flushSendBuffer",value:function(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach((function(e){return e()})),this.sendBuffer=[])}},{key:"onConnMessage",value:function(e){var t=JSON.parse(e.data),n=t.topic,r=t.event,o=t.payload,a=t.ref;this.log("receive",(o.status||"")+" "+n+" "+r+" "+(a&&"("+a+")"||""),o),this.channels.filter((function(e){return e.isMember(n)})).forEach((function(e){return e.trigger(r,o,a)})),this.stateChangeCallbacks.message.forEach((function(e){return e(t)}))}}]),e}(),t.LongPoll=function(){function e(t){a(this,e),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=i,this.poll()}return o(e,[{key:"normalizeEndpoint",value:function(e){return e.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+x),"$1/"+w)}},{key:"endpointURL",value:function(){return C.appendParams(this.pollEndpoint,{token:this.token})}},{key:"closeAndRetry",value:function(){this.close(),this.readyState=i}},{key:"ontimeout",value:function(){this.onerror("timeout"),this.closeAndRetry()}},{key:"poll",value:function(){var e=this;this.readyState!==c&&this.readyState!==i||C.request("GET",this.endpointURL(),"application/json",null,this.timeout,this.ontimeout.bind(this),(function(t){if(t){var n=t.status,r=t.token,o=t.messages;e.token=r}else n=0;switch(n){case 200:o.forEach((function(t){return e.onmessage({data:JSON.stringify(t)})})),e.poll();break;case 204:e.poll();break;case 410:e.readyState=c,e.onopen(),e.poll();break;case 0:case 500:e.onerror(),e.closeAndRetry();break;default:throw"unhandled poll status "+n}}))}},{key:"send",value:function(e){var t=this;C.request("POST",this.endpointURL(),"application/json",e,this.timeout,this.onerror.bind(this,"timeout"),(function(e){e&&200===e.status||(t.onerror(status),t.closeAndRetry())}))}},{key:"close",value:function(e,t){this.readyState=u,this.onclose()}}]),e}()),C=t.Ajax=function(){function e(){a(this,e)}return o(e,null,[{key:"request",value:function(e,t,n,r,o,a,i){if(window.XDomainRequest){var c=new XDomainRequest;this.xdomainRequest(c,e,t,r,o,a,i)}else{var s=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");this.xhrRequest(s,e,t,n,r,o,a,i)}}},{key:"xdomainRequest",value:function(e,t,n,r,o,a,i){var c=this;e.timeout=o,e.open(t,n),e.onload=function(){var t=c.parseJSON(e.responseText);i&&i(t)},a&&(e.ontimeout=a),e.onprogress=function(){},e.send(r)}},{key:"xhrRequest",value:function(e,t,n,r,o,a,i,c){var s=this;e.timeout=a,e.open(t,n,!0),e.setRequestHeader("Content-Type",r),e.onerror=function(){c&&c(null)},e.onreadystatechange=function(){if(e.readyState===s.states.complete&&c){var t=s.parseJSON(e.responseText);c(t)}},i&&(e.ontimeout=i),e.send(o)}},{key:"parseJSON",value:function(e){return e&&""!==e?JSON.parse(e):null}},{key:"serialize",value:function(e,t){var n=[];for(var o in e)if(e.hasOwnProperty(o)){var a=t?t+"["+o+"]":o,i=e[o];"object"===(void 0===i?"undefined":r(i))?n.push(this.serialize(i,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(i))}return n.join("&")}},{key:"appendParams",value:function(e,t){if(0===Object.keys(t).length)return e;var n=e.match(/\?/)?"&":"?";return""+e+n+this.serialize(t)}}]),e}();C.states={complete:4};t.Presence={syncState:function(e,t,n,r){var o=this,a=this.clone(e),i={},c={};return this.map(a,(function(e,n){t[e]||(c[e]=n)})),this.map(t,(function(e,t){var n=a[e];if(n){var r=t.metas.map((function(e){return e.phx_ref})),s=n.metas.map((function(e){return e.phx_ref})),u=t.metas.filter((function(e){return s.indexOf(e.phx_ref)<0})),l=n.metas.filter((function(e){return r.indexOf(e.phx_ref)<0}));u.length>0&&(i[e]=t,i[e].metas=u),l.length>0&&(c[e]=o.clone(n),c[e].metas=l)}else i[e]=t})),this.syncDiff(a,{joins:i,leaves:c},n,r)},syncDiff:function(e,t,n,r){var o=t.joins,a=t.leaves,i=this.clone(e);return n||(n=function(){}),r||(r=function(){}),this.map(o,(function(e,t){var r,o=i[e];(i[e]=t,o)&&(r=i[e].metas).unshift.apply(r,function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(o.metas));n(e,o,t)})),this.map(a,(function(e,t){var n=i[e];if(n){var o=t.metas.map((function(e){return e.phx_ref}));n.metas=n.metas.filter((function(e){return o.indexOf(e.phx_ref)<0})),r(e,n,t),0===n.metas.length&&delete i[e]}})),i},list:function(e,t){return t||(t=function(e,t){return t}),this.map(e,(function(e,n){return t(e,n)}))},map:function(e,t){return Object.getOwnPropertyNames(e).map((function(n){return t(n,e[n])}))},clone:function(e){return JSON.parse(JSON.stringify(e))}};var _=function(){function e(t,n){a(this,e),this.callback=t,this.timerCalc=n,this.timer=null,this.tries=0}return o(e,[{key:"reset",value:function(){this.tries=0,clearTimeout(this.timer)}},{key:"scheduleTimeout",value:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout((function(){e.tries=e.tries+1,e.callback()}),this.timerCalc(this.tries+1))}}]),e}()},function(e,t,n){(function(n){var r,o,a;o=[],void 0===(a="function"==typeof(r=function(){"use strict";function t(e,t,n){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){i(r.response,t,n)},r.onerror=function(){console.error("could not download file")},r.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function o(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,i=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(e,n,i){var c=a.URL||a.webkitURL,s=document.createElement("a");n=n||e.name||"download",s.download=n,s.rel="noopener","string"==typeof e?(s.href=e,s.origin===location.origin?o(s):r(s.href)?t(e,n,i):o(s,s.target="_blank")):(s.href=c.createObjectURL(e),setTimeout((function(){c.revokeObjectURL(s.href)}),4e4),setTimeout((function(){o(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,n,a){if(n=n||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),n);else if(r(e))t(e,n,a);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){o(i)}))}}:function(e,n,r,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof e)return t(e,n,r);var i="application/octet-stream"===e.type,c=/constructor/i.test(a.HTMLElement)||a.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||i&&c)&&"object"==typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},u.readAsDataURL(e)}else{var l=a.URL||a.webkitURL,d=l.createObjectURL(e);o?o.location=d:location.href=d,o=null,setTimeout((function(){l.revokeObjectURL(d)}),4e4)}});a.saveAs=i.saveAs=i,e.exports=i})?r.apply(t,o):r)||(e.exports=a)}).call(this,n(78))},function(e,t){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),s=0;s<a.length;s++){var u=a[s];if(!c(u))return!1;var l=e[u],d=t[u];if(!1===(o=n?n.call(r,l,d,u):void 0)||void 0===o&&l!==d)return!1}return!0}},function(e,t,n){"use strict";t.a=function(e){function t(e,t,r){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var c=0;for(e=0===i?"":e[0]+" ";c<a;++c)t[c]=n(e,t[c],r).trim();break;default:var s=c=0;for(t=[];c<a;++c)for(var u=0;u<i;++u)t[s++]=n(e[u]+" ",o[c],r).trim()}return t}function n(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function r(e,t,n,a){var i=e+";",c=2*t+3*n+4*a;if(944===c){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===S||2===S&&o(s,1)?"-webkit-"+s+s:s}if(0===S||2===S&&!o(i,1))return i;switch(c){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(C,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return f.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(y,"tb");break;case 232:s=i.replace(y,"tb-rl");break;case 220:s=i.replace(y,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,c=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(O,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(O,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===k.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?r(e.replace("stretch","fill-available"),t,n,a).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===n+a&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+i}return i}function o(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),P(2!==t?r:r.replace(E,"$1"),n,t)}function a(e,t){var n=r(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(x," or ($1)").substring(4):"("+t+")"}function i(e,t,n,r,o,a,i,c,u,l){for(var d,f=0,p=t;f<N;++f)switch(d=A[f].call(s,e,p,n,r,o,a,i,c,u,l)){case void 0:case!1:case!0:case null:break;default:p=d}if(p!==t)return p}function c(e){return void 0!==(e=e.prefix)&&(P=null,e?"function"!=typeof e?S=1:(S=2,P=e):S=0),c}function s(e,n){var c=e;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<N){var s=i(-1,n,c,c,j,_,0,0,0,0);void 0!==s&&"string"==typeof s&&(n=s)}var d=function e(n,c,s,d,f){for(var p,h,m,y,x,O=0,E=0,k=0,C=0,A=0,P=0,R=m=p=0,L=0,D=0,B=0,z=0,U=s.length,H=U-1,F="",$="",q="",G="";L<U;){if(h=s.charCodeAt(L),L===H&&0!==E+C+k+O&&(0!==E&&(h=47===E?10:47),C=k=O=0,U++,H++),0===E+C+k+O){if(L===H&&(0<D&&(F=F.replace(l,"")),0<F.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:F+=s.charAt(L)}h=59}switch(h){case 123:for(p=(F=F.trim()).charCodeAt(0),m=1,z=++L;L<U;){switch(h=s.charCodeAt(L)){case 123:m++;break;case 125:m--;break;case 47:switch(h=s.charCodeAt(L+1)){case 42:case 47:e:{for(R=L+1;R<H;++R)switch(s.charCodeAt(R)){case 47:if(42===h&&42===s.charCodeAt(R-1)&&L+2!==R){L=R+1;break e}break;case 10:if(47===h){L=R+1;break e}}L=R}}break;case 91:h++;case 40:h++;case 34:case 39:for(;L++<H&&s.charCodeAt(L)!==h;);}if(0===m)break;L++}switch(m=s.substring(z,L),0===p&&(p=(F=F.replace(u,"").trim()).charCodeAt(0)),p){case 64:switch(0<D&&(F=F.replace(l,"")),h=F.charCodeAt(1)){case 100:case 109:case 115:case 45:D=c;break;default:D=I}if(z=(m=e(c,D,m,h,f+1)).length,0<N&&(x=i(3,m,D=t(I,F,B),c,j,_,z,h,f,d),F=D.join(""),void 0!==x&&0===(z=(m=x.trim()).length)&&(h=0,m="")),0<z)switch(h){case 115:F=F.replace(w,a);case 100:case 109:case 45:m=F+"{"+m+"}";break;case 107:m=(F=F.replace(g,"$1 $2"))+"{"+m+"}",m=1===S||2===S&&o("@"+m,3)?"@-webkit-"+m+"@"+m:"@"+m;break;default:m=F+m,112===d&&($+=m,m="")}else m="";break;default:m=e(c,t(c,F,B),m,d,f+1)}q+=m,m=B=D=R=p=0,F="",h=s.charCodeAt(++L);break;case 125:case 59:if(1<(z=(F=(0<D?F.replace(l,""):F).trim()).length))switch(0===R&&(p=F.charCodeAt(0),45===p||96<p&&123>p)&&(z=(F=F.replace(" ",":")).length),0<N&&void 0!==(x=i(1,F,c,n,j,_,$.length,d,f,d))&&0===(z=(F=x.trim()).length)&&(F="\0\0"),p=F.charCodeAt(0),h=F.charCodeAt(1),p){case 0:break;case 64:if(105===h||99===h){G+=F+s.charAt(L);break}default:58!==F.charCodeAt(z-1)&&($+=r(F,p,h,F.charCodeAt(2)))}B=D=R=p=0,F="",h=s.charCodeAt(++L)}}switch(h){case 13:case 10:47===E?E=0:0===1+p&&107!==d&&0<F.length&&(D=1,F+="\0"),0<N*M&&i(0,F,c,n,j,_,$.length,d,f,d),_=1,j++;break;case 59:case 125:if(0===E+C+k+O){_++;break}default:switch(_++,y=s.charAt(L),h){case 9:case 32:if(0===C+O+E)switch(A){case 44:case 58:case 9:case 32:y="";break;default:32!==h&&(y=" ")}break;case 0:y="\\0";break;case 12:y="\\f";break;case 11:y="\\v";break;case 38:0===C+E+O&&(D=B=1,y="\f"+y);break;case 108:if(0===C+E+O+T&&0<R)switch(L-R){case 2:112===A&&58===s.charCodeAt(L-3)&&(T=A);case 8:111===P&&(T=P)}break;case 58:0===C+E+O&&(R=L);break;case 44:0===E+k+C+O&&(D=1,y+="\r");break;case 34:case 39:0===E&&(C=C===h?0:0===C?h:C);break;case 91:0===C+E+k&&O++;break;case 93:0===C+E+k&&O--;break;case 41:0===C+E+O&&k--;break;case 40:if(0===C+E+O){if(0===p)switch(2*A+3*P){case 533:break;default:p=1}k++}break;case 64:0===E+k+C+O+R+m&&(m=1);break;case 42:case 47:if(!(0<C+O+k))switch(E){case 0:switch(2*h+3*s.charCodeAt(L+1)){case 235:E=47;break;case 220:z=L,E=42}break;case 42:47===h&&42===A&&z+2!==L&&(33===s.charCodeAt(z+2)&&($+=s.substring(z,L+1)),y="",E=0)}}0===E&&(F+=y)}P=A,A=h,L++}if(0<(z=$.length)){if(D=c,0<N&&(void 0!==(x=i(2,$,D,n,j,_,z,d,f,d))&&0===($=x).length))return G+$+q;if($=D.join(",")+"{"+$+"}",0!=S*T){switch(2!==S||o($,2)||(T=0),T){case 111:$=$.replace(v,":-moz-$1")+$;break;case 112:$=$.replace(b,"::-webkit-input-$1")+$.replace(b,"::-moz-$1")+$.replace(b,":-ms-input-$1")+$}T=0}}return G+$+q}(I,c,n,0,0);return 0<N&&(void 0!==(s=i(-2,d,c,c,j,_,d.length,0,0,0))&&(d=s)),"",T=0,_=j=1,d}var u=/^\0+/g,l=/[\0\r\f]/g,d=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,h=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,g=/@(k\w+)\s*(\S*)\s*/,b=/::(place)/g,v=/:(read-only)/g,y=/[svh]\w+-[tblr]{2}/,w=/\(\s*(.*)\s*\)/g,x=/([\s\S]*?);/g,O=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,k=/stretch|:\s*\w+\-(?:conte|avail)/,C=/([^-])(image-set\()/,_=1,j=1,T=0,S=1,I=[],A=[],N=0,P=null,M=0;return s.use=function e(t){switch(t){case void 0:case null:N=A.length=0;break;default:if("function"==typeof t)A[N++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else M=0|!!t}return e},s.set=c,void 0!==e&&c(e),s}},function(e,t,n){"use strict";t.a={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/IBMPlexSans-Medium.ttf"},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/IBMPlexSans-Regular.ttf"},function(e,t){e.exports="http://localhost:8081/src/assets/fonts/KindlySans-Regular.otf"},function(e,t){e.exports="http://localhost:8081/src/assets/images/santaHat.png"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e,t){var n=r({key:"redux",merge:i.default,slicer:a.default,serialize:JSON.stringify,deserialize:JSON.parse},t),o=n.key,c=n.merge,s=n.slicer,u=n.serialize,l=n.deserialize;return function(t){return function(n,r,a){"function"==typeof r&&void 0===a&&(a=r,r=void 0);var i=void 0,d=void 0;try{i=l(localStorage.getItem(o)),d=c(r,i)}catch(e){console.warn("Failed to retrieve initialize state from localStorage:",e)}var f=t(n,d,a),p=s(e);return f.subscribe((function(){var e=f.getState(),t=p(e);try{localStorage.setItem(o,u(t))}catch(e){console.warn("Unable to persist state to localStorage:",e)}})),f}}};var a=o(n(183)),i=o(n(186));e.exports=t.default},function(e,t,n){(function(e,n){var r=/^\[object .+?Constructor\]$/,o=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var i="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,s=i||c||Function("return this")(),u=t&&!t.nodeType&&t,l=u&&"object"==typeof n&&n&&!n.nodeType&&n,d=l&&l.exports===u,f=d&&i.process,p=function(){try{var e=l&&l.require&&l.require("util").types;return e||f&&f.binding&&f.binding("util")}catch(e){}}(),h=p&&p.isTypedArray;function m(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var g,b,v,y=Array.prototype,w=Function.prototype,x=Object.prototype,O=s["__core-js_shared__"],E=w.toString,k=x.hasOwnProperty,C=(g=/[^.]+$/.exec(O&&O.keys&&O.keys.IE_PROTO||""))?"Symbol(src)_1."+g:"",_=x.toString,j=E.call(Object),T=RegExp("^"+E.call(k).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),S=d?s.Buffer:void 0,I=s.Symbol,A=s.Uint8Array,N=S?S.allocUnsafe:void 0,P=(b=Object.getPrototypeOf,v=Object,function(e){return b(v(e))}),M=Object.create,R=x.propertyIsEnumerable,L=y.splice,D=I?I.toStringTag:void 0,B=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=S?S.isBuffer:void 0,U=Math.max,H=Date.now,F=ue(s,"Map"),$=ue(Object,"create"),q=function(){function e(){}return function(t){if(!xe(t))return{};if(M)return M(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function V(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function W(e){var t=this.__data__=new Y(e);this.size=t.size}function K(e,t){var n=ge(e),r=!n&&me(e),o=!n&&!r&&ve(e),a=!n&&!r&&!o&&Ee(e),i=n||r||o||a,c=i?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=c.length;for(var u in e)!t&&!k.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||le(u,s))||c.push(u);return c}function X(e,t,n){(void 0!==n&&!he(e[t],n)||void 0===n&&!(t in e))&&Z(e,t,n)}function J(e,t,n){var r=e[t];k.call(e,t)&&he(r,n)&&(void 0!==n||t in e)||Z(e,t,n)}function Q(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1}function Z(e,t,n){"__proto__"==t&&B?B(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}G.prototype.clear=function(){this.__data__=$?$(null):{},this.size=0},G.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},G.prototype.get=function(e){var t=this.__data__;if($){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return k.call(t,e)?t[e]:void 0},G.prototype.has=function(e){var t=this.__data__;return $?void 0!==t[e]:k.call(t,e)},G.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=$&&void 0===t?"__lodash_hash_undefined__":t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=Q(t,e);return!(n<0)&&(n==t.length-1?t.pop():L.call(t,n,1),--this.size,!0)},Y.prototype.get=function(e){var t=this.__data__,n=Q(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return Q(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=Q(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},V.prototype.clear=function(){this.size=0,this.__data__={hash:new G,map:new(F||Y),string:new G}},V.prototype.delete=function(e){var t=se(this,e).delete(e);return this.size-=t?1:0,t},V.prototype.get=function(e){return se(this,e).get(e)},V.prototype.has=function(e){return se(this,e).has(e)},V.prototype.set=function(e,t){var n=se(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},W.prototype.clear=function(){this.__data__=new Y,this.size=0},W.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},W.prototype.get=function(e){return this.__data__.get(e)},W.prototype.has=function(e){return this.__data__.has(e)},W.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!F||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new V(r)}return n.set(e,t),this.size=n.size,this};var ee,te=function(e,t,n){for(var r=-1,o=Object(e),a=n(e),i=a.length;i--;){var c=a[ee?i:++r];if(!1===t(o[c],c,o))break}return e};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":D&&D in Object(e)?function(e){var t=k.call(e,D),n=e[D];try{e[D]=void 0;var r=!0}catch(e){}var o=_.call(e);r&&(t?e[D]=n:delete e[D]);return o}(e):function(e){return _.call(e)}(e)}function re(e){return Oe(e)&&"[object Arguments]"==ne(e)}function oe(e){return!(!xe(e)||function(e){return!!C&&C in e}(e))&&(ye(e)?T:r).test(function(e){if(null!=e){try{return E.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ae(e){if(!xe(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=de(e),n=[];for(var r in e)("constructor"!=r||!t&&k.call(e,r))&&n.push(r);return n}function ie(e,t,n,r,o){e!==t&&te(t,(function(a,i){if(o||(o=new W),xe(a))!function(e,t,n,r,o,a,i){var c=fe(e,n),s=fe(t,n),u=i.get(s);if(u)return void X(e,n,u);var l=a?a(c,s,n+"",e,t,i):void 0,d=void 0===l;if(d){var f=ge(s),p=!f&&ve(s),h=!f&&!p&&Ee(s);l=s,f||p||h?ge(c)?l=c:Oe(y=c)&&be(y)?l=function(e,t){var n=-1,r=e.length;t||(t=Array(r));for(;++n<r;)t[n]=e[n];return t}(c):p?(d=!1,l=function(e,t){if(t)return e.slice();var n=e.length,r=N?N(n):new e.constructor(n);return e.copy(r),r}(s,!0)):h?(d=!1,m=s,g=!0?(b=m.buffer,v=new b.constructor(b.byteLength),new A(v).set(new A(b)),v):m.buffer,l=new m.constructor(g,m.byteOffset,m.length)):l=[]:function(e){if(!Oe(e)||"[object Object]"!=ne(e))return!1;var t=P(e);if(null===t)return!0;var n=k.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&E.call(n)==j}(s)||me(s)?(l=c,me(c)?l=function(e){return function(e,t,n,r){var o=!n;n||(n={});var a=-1,i=t.length;for(;++a<i;){var c=t[a],s=r?r(n[c],e[c],c,n,e):void 0;void 0===s&&(s=e[c]),o?Z(n,c,s):J(n,c,s)}return n}(e,ke(e))}(c):xe(c)&&!ye(c)||(l=function(e){return"function"!=typeof e.constructor||de(e)?{}:q(P(e))}(s))):d=!1}var m,g,b,v;var y;d&&(i.set(s,l),o(l,s,r,a,i),i.delete(s));X(e,n,l)}(e,t,i,n,ie,r,o);else{var c=r?r(fe(e,i),a,i+"",e,t,o):void 0;void 0===c&&(c=a),X(e,i,c)}}),ke)}function ce(e,t){return pe(function(e,t,n){return t=U(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,a=U(r.length-t,0),i=Array(a);++o<a;)i[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(i),m(e,this,c)}}(e,t,je),e+"")}function se(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return oe(n)?n:void 0}function le(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&o.test(e))&&e>-1&&e%1==0&&e<t}function de(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||x)}function fe(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var pe=function(e){var t=0,n=0;return function(){var r=H(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(B?function(e,t){return B(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:je);function he(e,t){return e===t||e!=e&&t!=t}var me=re(function(){return arguments}())?re:function(e){return Oe(e)&&k.call(e,"callee")&&!R.call(e,"callee")},ge=Array.isArray;function be(e){return null!=e&&we(e.length)&&!ye(e)}var ve=z||function(){return!1};function ye(e){if(!xe(e))return!1;var t=ne(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function we(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Oe(e){return null!=e&&"object"==typeof e}var Ee=h?function(e){return function(t){return e(t)}}(h):function(e){return Oe(e)&&we(e.length)&&!!a[ne(e)]};function ke(e){return be(e)?K(e,!0):ae(e)}var Ce,_e=(Ce=function(e,t,n){ie(e,t,n)},ce((function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,a=r>2?t[2]:void 0;for(o=Ce.length>3&&"function"==typeof o?(r--,o):void 0,a&&function(e,t,n){if(!xe(n))return!1;var r=typeof t;return!!("number"==r?be(n)&&le(t,n.length):"string"==r&&t in n)&&he(n[t],e)}(t[0],t[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var i=t[n];i&&Ce(e,i,n,o)}return e})));function je(e){return e}n.exports=_e}).call(this,n(78),n(187)(e))},function(e,t,n){var r=n(188);e.exports=r},function(e,t,n){
|
|
17
|
+
/*! @license DOMPurify | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/2.2.2/LICENSE */
|
|
18
|
+
e.exports=function(){"use strict";var e=Object.hasOwnProperty,t=Object.setPrototypeOf,n=Object.isFrozen,r=Object.getPrototypeOf,o=Object.getOwnPropertyDescriptor,a=Object.freeze,i=Object.seal,c=Object.create,s="undefined"!=typeof Reflect&&Reflect,u=s.apply,l=s.construct;u||(u=function(e,t,n){return e.apply(t,n)}),a||(a=function(e){return e}),i||(i=function(e){return e}),l||(l=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var d,f=O(Array.prototype.forEach),p=O(Array.prototype.pop),h=O(Array.prototype.push),m=O(String.prototype.toLowerCase),g=O(String.prototype.match),b=O(String.prototype.replace),v=O(String.prototype.indexOf),y=O(String.prototype.trim),w=O(RegExp.prototype.test),x=(d=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return l(d,t)});function O(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return u(e,t,r)}}function E(e,r){t&&t(e,null);for(var o=r.length;o--;){var a=r[o];if("string"==typeof a){var i=m(a);i!==a&&(n(r)||(r[o]=i),a=i)}e[a]=!0}return e}function k(t){var n=c(null),r=void 0;for(r in t)u(e,t,[r])&&(n[r]=t[r]);return n}function C(e,t){for(;null!==e;){var n=o(e,t);if(n){if(n.get)return O(n.get);if("function"==typeof n.value)return O(n.value)}e=r(e)}return function(e){return console.warn("fallback value for",e),null}}var _=a(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),j=a(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),T=a(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),S=a(["animate","color-profile","cursor","discard","fedropshadow","feimage","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),I=a(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),A=a(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),N=a(["#text"]),P=a(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),M=a(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),R=a(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),L=a(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),D=i(/\{\{[\s\S]*|[\s\S]*\}\}/gm),B=i(/<%[\s\S]*|[\s\S]*%>/gm),z=i(/^data-[\-\w.\u00B7-\uFFFF]/),U=i(/^aria-[\-\w]+$/),H=i(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),F=i(/^(?:\w+script|data):/i),$=i(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function G(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Y=function(){return"undefined"==typeof window?null:window},V=function(e,t){if("object"!==(void 0===e?"undefined":q(e))||"function"!=typeof e.createPolicy)return null;var n=null;t.currentScript&&t.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=t.currentScript.getAttribute("data-tt-policy-suffix"));var r="dompurify"+(n?"#"+n:"");try{return e.createPolicy(r,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+r+" could not be created."),null}};return function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Y(),n=function(t){return e(t)};if(n.version="2.2.8",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,i=t.DocumentFragment,c=t.HTMLTemplateElement,s=t.Node,u=t.Element,l=t.NodeFilter,d=t.NamedNodeMap,O=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,W=t.Text,K=t.Comment,X=t.DOMParser,J=t.trustedTypes,Q=u.prototype,Z=C(Q,"cloneNode"),ee=C(Q,"nextSibling"),te=C(Q,"childNodes"),ne=C(Q,"parentNode");if("function"==typeof c){var re=o.createElement("template");re.content&&re.content.ownerDocument&&(o=re.content.ownerDocument)}var oe=V(J,r),ae=oe&&Le?oe.createHTML(""):"",ie=o,ce=ie.implementation,se=ie.createNodeIterator,ue=ie.createDocumentFragment,le=r.importNode,de={};try{de=k(o).documentMode?o.documentMode:{}}catch(e){}var fe={};n.isSupported="function"==typeof ne&&ce&&void 0!==ce.createHTMLDocument&&9!==de;var pe=D,he=B,me=z,ge=U,be=F,ve=$,ye=H,we=null,xe=E({},[].concat(G(_),G(j),G(T),G(I),G(N))),Oe=null,Ee=E({},[].concat(G(P),G(M),G(R),G(L))),ke=null,Ce=null,_e=!0,je=!0,Te=!1,Se=!1,Ie=!1,Ae=!1,Ne=!1,Pe=!1,Me=!1,Re=!0,Le=!1,De=!0,Be=!0,ze=!1,Ue={},He=E({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Fe=null,$e=E({},["audio","video","img","source","image","track"]),qe=null,Ge=E({},["alt","class","for","id","label","name","pattern","placeholder","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",Ve="http://www.w3.org/2000/svg",We="http://www.w3.org/1999/xhtml",Ke=We,Xe=null,Je=o.createElement("form"),Qe=function(e){Xe&&Xe===e||(e&&"object"===(void 0===e?"undefined":q(e))||(e={}),e=k(e),we="ALLOWED_TAGS"in e?E({},e.ALLOWED_TAGS):xe,Oe="ALLOWED_ATTR"in e?E({},e.ALLOWED_ATTR):Ee,qe="ADD_URI_SAFE_ATTR"in e?E(k(Ge),e.ADD_URI_SAFE_ATTR):Ge,Fe="ADD_DATA_URI_TAGS"in e?E(k($e),e.ADD_DATA_URI_TAGS):$e,ke="FORBID_TAGS"in e?E({},e.FORBID_TAGS):{},Ce="FORBID_ATTR"in e?E({},e.FORBID_ATTR):{},Ue="USE_PROFILES"in e&&e.USE_PROFILES,_e=!1!==e.ALLOW_ARIA_ATTR,je=!1!==e.ALLOW_DATA_ATTR,Te=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Se=e.SAFE_FOR_TEMPLATES||!1,Ie=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Me=e.RETURN_DOM_FRAGMENT||!1,Re=!1!==e.RETURN_DOM_IMPORT,Le=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,De=!1!==e.SANITIZE_DOM,Be=!1!==e.KEEP_CONTENT,ze=e.IN_PLACE||!1,ye=e.ALLOWED_URI_REGEXP||ye,Ke=e.NAMESPACE||Ke,Se&&(je=!1),Me&&(Pe=!0),Ue&&(we=E({},[].concat(G(N))),Oe=[],!0===Ue.html&&(E(we,_),E(Oe,P)),!0===Ue.svg&&(E(we,j),E(Oe,M),E(Oe,L)),!0===Ue.svgFilters&&(E(we,T),E(Oe,M),E(Oe,L)),!0===Ue.mathMl&&(E(we,I),E(Oe,R),E(Oe,L))),e.ADD_TAGS&&(we===xe&&(we=k(we)),E(we,e.ADD_TAGS)),e.ADD_ATTR&&(Oe===Ee&&(Oe=k(Oe)),E(Oe,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&E(qe,e.ADD_URI_SAFE_ATTR),Be&&(we["#text"]=!0),Ie&&E(we,["html","head","body"]),we.table&&(E(we,["tbody"]),delete ke.tbody),a&&a(e),Xe=e)},Ze=E({},["mi","mo","mn","ms","mtext"]),et=E({},["foreignobject","desc","title","annotation-xml"]),tt=E({},j);E(tt,T),E(tt,S);var nt=E({},I);E(nt,A);var rt=function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:We,tagName:"template"});var n=m(e.tagName),r=m(t.tagName);if(e.namespaceURI===Ve)return t.namespaceURI===We?"svg"===n:t.namespaceURI===Ye?"svg"===n&&("annotation-xml"===r||Ze[r]):Boolean(tt[n]);if(e.namespaceURI===Ye)return t.namespaceURI===We?"math"===n:t.namespaceURI===Ve?"math"===n&&et[r]:Boolean(nt[n]);if(e.namespaceURI===We){if(t.namespaceURI===Ve&&!et[r])return!1;if(t.namespaceURI===Ye&&!Ze[r])return!1;var o=E({},["title","style","font","a","script"]);return!nt[n]&&(o[n]||!tt[n])}return!1},ot=function(e){h(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ae}catch(t){e.remove()}}},at=function(e,t){try{h(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){h(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Oe[e])if(Pe||Me)try{ot(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},it=function(e){var t=void 0,n=void 0;if(Ne)e="<remove></remove>"+e;else{var r=g(e,/^[\r\n\t ]+/);n=r&&r[0]}var a=oe?oe.createHTML(e):e;if(Ke===We)try{t=(new X).parseFromString(a,"text/html")}catch(e){}t&&t.documentElement||((t=ce.createDocument(Ke,"template",null)).documentElement.innerHTML=a);var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),Ie?t.documentElement:i},ct=function(e){return se.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT,(function(){return l.FILTER_ACCEPT}),!1)},st=function(e){return!(e instanceof W||e instanceof K||"string"==typeof e.nodeName&&"string"==typeof e.textContent&&"function"==typeof e.removeChild&&e.attributes instanceof O&&"function"==typeof e.removeAttribute&&"function"==typeof e.setAttribute&&"string"==typeof e.namespaceURI&&"function"==typeof e.insertBefore)},ut=function(e){return"object"===(void 0===s?"undefined":q(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":q(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},lt=function(e,t,r){fe[e]&&f(fe[e],(function(e){e.call(n,t,r,Xe)}))},dt=function(e){var t=void 0;if(lt("beforeSanitizeElements",e,null),st(e))return ot(e),!0;if(g(e.nodeName,/[\u0080-\uFFFF]/))return ot(e),!0;var r=m(e.nodeName);if(lt("uponSanitizeElement",e,{tagName:r,allowedTags:we}),!ut(e.firstElementChild)&&(!ut(e.content)||!ut(e.content.firstElementChild))&&w(/<[/\w]/g,e.innerHTML)&&w(/<[/\w]/g,e.textContent))return ot(e),!0;if(!we[r]||ke[r]){if(Be&&!He[r]){var o=ne(e)||e.parentNode,a=te(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i)o.insertBefore(Z(a[i],!0),ee(e))}return ot(e),!0}return e instanceof u&&!rt(e)?(ot(e),!0):"noscript"!==r&&"noembed"!==r||!w(/<\/no(script|embed)/i,e.innerHTML)?(Se&&3===e.nodeType&&(t=e.textContent,t=b(t,pe," "),t=b(t,he," "),e.textContent!==t&&(h(n.removed,{element:e.cloneNode()}),e.textContent=t)),lt("afterSanitizeElements",e,null),!1):(ot(e),!0)},ft=function(e,t,n){if(De&&("id"===t||"name"===t)&&(n in o||n in Je))return!1;if(je&&w(me,t));else if(_e&&w(ge,t));else{if(!Oe[t]||Ce[t])return!1;if(qe[t]);else if(w(ye,b(n,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(n,"data:")||!Fe[e])if(Te&&!w(be,b(n,ve,"")));else if(n)return!1}return!0},pt=function(e){var t=void 0,r=void 0,o=void 0,a=void 0;lt("beforeSanitizeAttributes",e,null);var i=e.attributes;if(i){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe};for(a=i.length;a--;){var s=t=i[a],u=s.name,l=s.namespaceURI;if(r=y(t.value),o=m(u),c.attrName=o,c.attrValue=r,c.keepAttr=!0,c.forceKeepAttr=void 0,lt("uponSanitizeAttribute",e,c),r=c.attrValue,!c.forceKeepAttr&&(at(u,e),c.keepAttr))if(w(/\/>/i,r))at(u,e);else{Se&&(r=b(r,pe," "),r=b(r,he," "));var d=e.nodeName.toLowerCase();if(ft(d,o,r))try{l?e.setAttributeNS(l,u,r):e.setAttribute(u,r),p(n.removed)}catch(e){}}}lt("afterSanitizeAttributes",e,null)}},ht=function e(t){var n=void 0,r=ct(t);for(lt("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)lt("uponSanitizeShadowNode",n,null),dt(n)||(n.content instanceof i&&e(n.content),pt(n));lt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,c=void 0,u=void 0,l=void 0,d=void 0;if(e||(e="\x3c!--\x3e"),"string"!=typeof e&&!ut(e)){if("function"!=typeof e.toString)throw x("toString is not a function");if("string"!=typeof(e=e.toString()))throw x("dirty is not a string, aborting")}if(!n.isSupported){if("object"===q(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(ut(e))return t.toStaticHTML(e.outerHTML)}return e}if(Ae||Qe(o),n.removed=[],"string"==typeof e&&(ze=!1),ze);else if(e instanceof s)1===(c=(a=it("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===c.nodeName||"HTML"===c.nodeName?a=c:a.appendChild(c);else{if(!Pe&&!Se&&!Ie&&-1===e.indexOf("<"))return oe&&Le?oe.createHTML(e):e;if(!(a=it(e)))return Pe?null:ae}a&&Ne&&ot(a.firstChild);for(var f=ct(ze?e:a);u=f.nextNode();)3===u.nodeType&&u===l||dt(u)||(u.content instanceof i&&ht(u.content),pt(u),l=u);if(l=null,ze)return e;if(Pe){if(Me)for(d=ue.call(a.ownerDocument);a.firstChild;)d.appendChild(a.firstChild);else d=a;return Re&&(d=le.call(r,d,!0)),d}var p=Ie?a.outerHTML:a.innerHTML;return Se&&(p=b(p,pe," "),p=b(p,he," ")),oe&&Le?oe.createHTML(p):p},n.setConfig=function(e){Qe(e),Ae=!0},n.clearConfig=function(){Xe=null,Ae=!1},n.isValidAttribute=function(e,t,n){Xe||Qe({});var r=m(e),o=m(t);return ft(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(fe[e]=fe[e]||[],h(fe[e],t))},n.removeHook=function(e){fe[e]&&p(fe[e])},n.removeHooks=function(e){fe[e]&&(fe[e]=[])},n.removeAllHooks=function(){fe={}},n}()}()},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-happy.png"},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-neutral.png"},function(e,t){e.exports="http://localhost:8081/src/assets/icons/emoji-sad.png"},function(e,t,n){"use strict";
|
|
19
|
+
/** @license React v16.13.1
|
|
20
|
+
* react-is.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var r="function"==typeof Symbol&&Symbol.for,o=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,i=r?Symbol.for("react.fragment"):60107,c=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,d=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,p=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,b=r?Symbol.for("react.lazy"):60116,v=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,w=r?Symbol.for("react.responder"):60118,x=r?Symbol.for("react.scope"):60119;function O(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case d:case f:case i:case s:case c:case h:return e;default:switch(e=e&&e.$$typeof){case l:case p:case b:case g:case u:return e;default:return t}}case a:return t}}}function E(e){return O(e)===f}t.AsyncMode=d,t.ConcurrentMode=f,t.ContextConsumer=l,t.ContextProvider=u,t.Element=o,t.ForwardRef=p,t.Fragment=i,t.Lazy=b,t.Memo=g,t.Portal=a,t.Profiler=s,t.StrictMode=c,t.Suspense=h,t.isAsyncMode=function(e){return E(e)||O(e)===d},t.isConcurrentMode=E,t.isContextConsumer=function(e){return O(e)===l},t.isContextProvider=function(e){return O(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},t.isForwardRef=function(e){return O(e)===p},t.isFragment=function(e){return O(e)===i},t.isLazy=function(e){return O(e)===b},t.isMemo=function(e){return O(e)===g},t.isPortal=function(e){return O(e)===a},t.isProfiler=function(e){return O(e)===s},t.isStrictMode=function(e){return O(e)===c},t.isSuspense=function(e){return O(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===f||e===s||e===c||e===h||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===b||e.$$typeof===g||e.$$typeof===u||e.$$typeof===l||e.$$typeof===p||e.$$typeof===y||e.$$typeof===w||e.$$typeof===x||e.$$typeof===v)},t.typeOf=O},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){var t=Object.create(e);t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),Object.defineProperty(t,"exports",{enumerable:!0}),t.webpackPolyfill=1}return t}},function(e,t,n){"use strict";var r=n(30),o=n(114),a=n(165),i=n(120);function c(e){var t=new a(e),n=o(a.prototype.request,t);return r.extend(n,a.prototype,t),r.extend(n,t),n}var s=c(n(117));s.Axios=a,s.create=function(e){return c(i(s.defaults,e))},s.Cancel=n(121),s.CancelToken=n(178),s.isCancel=n(116),s.all=function(e){return Promise.all(e)},s.spread=n(179),s.isAxiosError=n(180),e.exports=s,e.exports.default=s},function(e,t,n){"use strict";var r=n(30),o=n(115),a=n(166),i=n(167),c=n(120);function s(e){this.defaults=e,this.interceptors={request:new a,response:new a}}s.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=c(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[i,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},s.prototype.getUri=function(e){return e=c(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(e){s.prototype[e]=function(t,n){return this.request(c(n||{},{method:e,url:t,data:(n||{}).data}))}})),r.forEach(["post","put","patch"],(function(e){s.prototype[e]=function(t,n,r){return this.request(c(r||{},{method:e,url:t,data:n}))}})),e.exports=s},function(e,t,n){"use strict";var r=n(30);function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){r.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},function(e,t,n){"use strict";var r=n(30),o=n(168),a=n(116),i=n(117);function c(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=r.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||i.adapter)(e).then((function(t){return c(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return a(t)||(c(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e,t,n){return r.forEach(n,(function(n){e=n(e,t)})),e}},function(e,t,n){"use strict";var r=n(30);e.exports=function(e,t){r.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))}},function(e,t,n){"use strict";var r=n(119);e.exports=function(e,t,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?t(r("Request failed with status code "+n.status,n.config,null,n.request,n)):e(n)}},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(30);e.exports=r.isStandardBrowserEnv()?{write:function(e,t,n,o,a,i){var c=[];c.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&c.push("expires="+new Date(n).toGMTString()),r.isString(o)&&c.push("path="+o),r.isString(a)&&c.push("domain="+a),!0===i&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(e,t,n){"use strict";var r=n(174),o=n(175);e.exports=function(e,t){return e&&!r(t)?o(e,t):t}},function(e,t,n){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t,n){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(30),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,a,i={};return e?(r.forEach(e.split("\n"),(function(e){if(a=e.indexOf(":"),t=r.trim(e.substr(0,a)).toLowerCase(),n=r.trim(e.substr(a+1)),t){if(i[t]&&o.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}},function(e,t,n){"use strict";var r=n(30);e.exports=r.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=o(window.location.href),function(t){var n=r.isString(t)?o(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0}},function(e,t,n){"use strict";var r=n(121);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new r(e),t(n.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e;return{token:new o((function(t){e=t})),cancel:e}},e.exports=o},function(e,t,n){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},function(e,t,n){"use strict";e.exports=function(e){return"object"==typeof e&&!0===e.isAxiosError}},function(e,t){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);e.exports=function(){return n(r),r}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var n=[],r=0;r<256;++r)n[r]=(r+256).toString(16).substr(1);e.exports=function(e,t){var r=t||0,o=n;return[o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],"-",o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){switch((0,a.default)(e)){case"void":return function(e){return e};case"string":return function(t){return(0,o.default)(t,[e])};case"array":return function(t){return(0,o.default)(t,e)};default:return console.error("Invalid paths argument, should be of type String, Array or Void")}};var o=r(n(184)),a=r(n(185));e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n={};return t.forEach((function(t){var r=e[t];r&&(n[t]=r)})),n},e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if(!e)return"void";if(r(e))return e.length?"array":"void";return typeof e};var r=Array.isArray||(Array.isArray=function(e){return""+e!==e&&"[object Array]"==={}.toString.call(e)});e.exports=t.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};t.default=function(e,t){return t?r({},e,t):e},e.exports=t.default},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var r=n(189);n(222),e.exports=r},function(e,t,n){n(190);var r=n(102);e.exports=r.URLSearchParams},function(e,t,n){"use strict";n(122);var r=n(136),o=n(80),a=n(217),i=n(83),c=n(218),s=n(107),u=n(138),l=n(125),d=n(219),f=n(26),p=n(41),h=n(137),m=n(76),g=n(61),b=n(58),v=n(220),y=n(106),w=n(82),x=n(221),O=n(143),E=n(35),k=o("fetch"),C=o("Request"),_=C&&C.prototype,j=o("Headers"),T=E("iterator"),S=l.set,I=l.getterFor("URLSearchParams"),A=l.getterFor("URLSearchParamsIterator"),N=/\+/g,P=Array(4),M=function(e){return P[e-1]||(P[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},R=function(e){try{return decodeURIComponent(e)}catch(t){return e}},L=function(e){var t=e.replace(N," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(M(n--),R);return t}},D=/[!'()~]|%20/g,B={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},z=function(e){return B[e]},U=function(e){return encodeURIComponent(e).replace(D,z)},H=function(e,t){if(t)for(var n,r,o=t.split("&"),a=0;a<o.length;)(n=o[a++]).length&&(r=n.split("="),e.push({key:L(r.shift()),value:L(r.join("="))}))},F=function(e){this.entries.length=0,H(this.entries,e)},$=function(e,t){if(e<t)throw TypeError("Not enough arguments")},q=u((function(e,t){S(this,{type:"URLSearchParamsIterator",iterator:x(I(e).entries),kind:t})}),"Iterator",(function(){var e=A(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n})),G=function(){d(this,G,"URLSearchParams");var e,t,n,r,o,a,i,c,s,u=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(S(l,{type:"URLSearchParams",entries:f,updateURL:function(){},updateSearchParams:F}),void 0!==u)if(b(u))if(e=O(u))for(n=(t=x(u,e)).next;!(r=n.call(t)).done;){if((i=(a=(o=x(g(r.value))).next).call(o)).done||(c=a.call(o)).done||!a.call(o).done)throw TypeError("Expected sequence with length 2");f.push({key:v(i.value),value:v(c.value)})}else for(s in u)p(u,s)&&f.push({key:s,value:v(u[s])});else H(f,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:v(u))},Y=G.prototype;if(c(Y,{append:function(e,t){$(arguments.length,2);var n=I(this);n.entries.push({key:v(e),value:v(t)}),n.updateURL()},delete:function(e){$(arguments.length,1);for(var t=I(this),n=t.entries,r=v(e),o=0;o<n.length;)n[o].key===r?n.splice(o,1):o++;t.updateURL()},get:function(e){$(arguments.length,1);for(var t=I(this).entries,n=v(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){$(arguments.length,1);for(var t=I(this).entries,n=v(e),r=[],o=0;o<t.length;o++)t[o].key===n&&r.push(t[o].value);return r},has:function(e){$(arguments.length,1);for(var t=I(this).entries,n=v(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){$(arguments.length,1);for(var n,r=I(this),o=r.entries,a=!1,i=v(e),c=v(t),s=0;s<o.length;s++)(n=o[s]).key===i&&(a?o.splice(s--,1):(a=!0,n.value=c));a||o.push({key:i,value:c}),r.updateURL()},sort:function(){var e,t,n,r=I(this),o=r.entries,a=o.slice();for(o.length=0,n=0;n<a.length;n++){for(e=a[n],t=0;t<n;t++)if(o[t].key>e.key){o.splice(t,0,e);break}t===n&&o.push(e)}r.updateURL()},forEach:function(e){for(var t,n=I(this).entries,r=h(e,arguments.length>1?arguments[1]:void 0,3),o=0;o<n.length;)r((t=n[o++]).value,t.key,this)},keys:function(){return new q(this,"keys")},values:function(){return new q(this,"values")},entries:function(){return new q(this,"entries")}},{enumerable:!0}),i(Y,T,Y.entries,{name:"entries"}),i(Y,"toString",(function(){for(var e,t=I(this).entries,n=[],r=0;r<t.length;)e=t[r++],n.push(U(e.key)+"="+U(e.value));return n.join("&")}),{enumerable:!0}),s(G,"URLSearchParams"),r({global:!0,forced:!a},{URLSearchParams:G}),!a&&f(j)){var V=function(e){if(b(e)){var t,n=e.body;if("URLSearchParams"===m(n))return(t=e.headers?new j(e.headers):new j).has("content-type")||t.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),y(e,{body:w(0,String(n)),headers:w(0,t)})}return e};if(f(k)&&r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return k(e,arguments.length>1?V(arguments[1]):{})}}),f(C)){var W=function(e){return d(this,W,"Request"),new C(e,arguments.length>1?V(arguments[1]):{})};_.constructor=W,W.prototype=_,r({global:!0,forced:!0},{Request:W})}}e.exports={URLSearchParams:G,getState:I}},function(e,t,n){var r=n(47),o=n(123),a="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?a.call(e,""):Object(e)}:Object},function(e,t){e.exports=function(){}},function(e,t,n){var r=n(34),o=n(26),a=n(194),i=r.WeakMap;e.exports=o(i)&&/native code/.test(a(i))},function(e,t,n){var r=n(26),o=n(100),a=Function.toString;r(o.inspectSource)||(o.inspectSource=function(e){return a.call(e)}),e.exports=o.inspectSource},function(e,t,n){var r=n(34);e.exports=function(e,t){try{Object.defineProperty(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},function(e,t,n){var r=n(58),o=n(129),a=n(132),i=n(200),c=n(35)("toPrimitive");e.exports=function(e,t){if(!r(e)||o(e))return e;var n,s=a(e,c);if(s){if(void 0===t&&(t="default"),n=s.call(e,t),!r(n)||o(n))return n;throw TypeError("Can't convert object to primitive value")}return void 0===t&&(t="number"),i(e,t)}},function(e,t,n){var r,o,a=n(34),i=n(198),c=a.process,s=a.Deno,u=c&&c.versions||s&&s.version,l=u&&u.v8;l?o=(r=l.split("."))[0]<4?1:r[0]+r[1]:i&&(!(r=i.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=i.match(/Chrome\/(\d+)/))&&(o=r[1]),e.exports=o&&+o},function(e,t,n){var r=n(80);e.exports=r("navigator","userAgent")||""},function(e,t){e.exports=function(e){try{return String(e)}catch(e){return"Object"}}},function(e,t,n){var r=n(26),o=n(58);e.exports=function(e,t){var n,a;if("string"===t&&r(n=e.toString)&&!o(a=n.call(e)))return a;if(r(n=e.valueOf)&&!o(a=n.call(e)))return a;if("string"!==t&&r(n=e.toString)&&!o(a=n.call(e)))return a;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){"use strict";var r=n(136),o=n(81),a=n(205),i=n(26),c=n(138),s=n(142),u=n(215),l=n(107),d=n(59),f=n(83),p=n(35),h=n(75),m=n(139),g=a.PROPER,b=a.CONFIGURABLE,v=m.IteratorPrototype,y=m.BUGGY_SAFARI_ITERATORS,w=p("iterator"),x=function(){return this};e.exports=function(e,t,n,a,p,m,O){c(n,t,a);var E,k,C,_=function(e){if(e===p&&A)return A;if(!y&&e in S)return S[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},j=t+" Iterator",T=!1,S=e.prototype,I=S[w]||S["@@iterator"]||p&&S[p],A=!y&&I||_(p),N="Array"==t&&S.entries||I;if(N&&(E=s(N.call(new e)))!==Object.prototype&&E.next&&(o||s(E)===v||(u?u(E,v):i(E[w])||f(E,w,x)),l(E,j,!0,!0),o&&(h[j]=x)),g&&"values"==p&&I&&"values"!==I.name&&(!o&&b?d(S,"name","values"):(T=!0,A=function(){return I.call(this)})),p)if(k={values:_("values"),keys:m?A:_("keys"),entries:_("entries")},O)for(C in k)(y||T||!(C in S))&&f(S,C,k[C]);else r({target:t,proto:!0,forced:y||T},k);return o&&!O||S[w]===A||f(S,w,A,{name:p}),h[t]=A,k}},function(e,t,n){var r=n(60),o=n(203),a=n(82),i=n(79),c=n(128),s=n(41),u=n(126),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=i(e),t=c(t),u)try{return l(e,t)}catch(e){}if(s(e,t))return a(!o.f.call(e,t),e[t])}},function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,a=o&&!r.call({1:2},1);t.f=a?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},function(e,t,n){var r=n(47),o=n(26),a=/#|\.prototype\./,i=function(e,t){var n=s[c(e)];return n==l||n!=u&&(o(t)?r(t):!!t)},c=i.normalize=function(e){return String(e).replace(a,".").toLowerCase()},s=i.data={},u=i.NATIVE="N",l=i.POLYFILL="P";e.exports=i},function(e,t,n){var r=n(60),o=n(41),a=Function.prototype,i=r&&Object.getOwnPropertyDescriptor,c=o(a,"name"),s=c&&"something"===function(){}.name,u=c&&(!r||r&&i(a,"name").configurable);e.exports={EXISTS:c,PROPER:s,CONFIGURABLE:u}},function(e,t,n){var r=n(60),o=n(101),a=n(61),i=n(207);e.exports=r?Object.defineProperties:function(e,t){a(e);for(var n,r=i(t),c=r.length,s=0;c>s;)o.f(e,n=r[s++],t[n]);return e}},function(e,t,n){var r=n(208),o=n(141);e.exports=Object.keys||function(e){return r(e,o)}},function(e,t,n){var r=n(41),o=n(79),a=n(209).indexOf,i=n(105);e.exports=function(e,t){var n,c=o(e),s=0,u=[];for(n in c)!r(i,n)&&r(c,n)&&u.push(n);for(;t.length>s;)r(c,n=t[s++])&&(~a(u,n)||u.push(n));return u}},function(e,t,n){var r=n(79),o=n(210),a=n(211),i=function(e){return function(t,n,i){var c,s=r(t),u=o(s.length),l=a(i,u);if(e&&n!=n){for(;u>l;)if((c=s[l++])!=c)return!0}else for(;u>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:i(!0),indexOf:i(!1)}},function(e,t,n){var r=n(140),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){var r=n(140),o=Math.max,a=Math.min;e.exports=function(e,t){var n=r(e);return n<0?o(n+t,0):a(n,t)}},function(e,t,n){var r=n(80);e.exports=r("document","documentElement")},function(e,t,n){var r=n(47);e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},function(e,t,n){"use strict";var r=n(108),o=n(76);e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},function(e,t,n){var r=n(61),o=n(216);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,a){return r(n),o(a),t?e.call(n,a):n.__proto__=a,n}}():void 0)},function(e,t,n){var r=n(26);e.exports=function(e){if("object"==typeof e||r(e))return e;throw TypeError("Can't set "+String(e)+" as a prototype")}},function(e,t,n){var r=n(47),o=n(35),a=n(81),i=o("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),a&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[i]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host}))},function(e,t,n){var r=n(83);e.exports=function(e,t,n){for(var o in t)n&&n.unsafe&&e[o]?e[o]=t[o]:r(e,o,t[o],n);return e}},function(e,t){e.exports=function(e,t,n){if(e instanceof t)return e;throw TypeError("Incorrect "+(n?n+" ":"")+"invocation")}},function(e,t,n){var r=n(76);e.exports=function(e){if("Symbol"===r(e))throw TypeError("Cannot convert a Symbol value to a string");return String(e)}},function(e,t,n){var r=n(103),o=n(61),a=n(143);e.exports=function(e,t){var n=arguments.length<2?a(e):t;if(r(n))return o(n.call(e));throw TypeError(String(e)+" is not iterable")}},function(e,t,n){n(122);var r=n(223),o=n(34),a=n(76),i=n(59),c=n(75),s=n(35)("toStringTag");for(var u in r){var l=o[u],d=l&&l.prototype;d&&a(d)!==s&&i(d,s,u),c[u]=c.Array}},function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(e,t){e.exports="http://localhost:8081/src/assets/audio/newagent.mp3"},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"agent",(function(){return pt})),n.d(r,"alerts",(function(){return mt})),n.d(r,"announcement",(function(){return bt})),n.d(r,"auth",(function(){return yt})),n.d(r,"bot",(function(){return Qe})),n.d(r,"chatbubble",(function(){return et})),n.d(r,"connection",(function(){return xt})),n.d(r,"inspector",(function(){return Et})),n.d(r,"environment",(function(){return nt})),n.d(r,"feedback",(function(){return Ct})),n.d(r,"local",(function(){return Tt})),n.d(r,"maintenanceAlert",(function(){return It})),n.d(r,"messages",(function(){return Ht})),n.d(r,"privacy",(function(){return $t})),n.d(r,"pushMessages",(function(){return Yt})),n.d(r,"websocketFallback",(function(){return Kt})),n.d(r,"lightBox",(function(){return Jt})),n.d(r,"nudge",(function(){return Zt}));var o=n(4),a=n.n(o),i=n(0),c=n.n(i),s=n(62),u=(a.a.shape({context:a.a.shape({}),language:a.a.string,getAuthToken:a.a.func,bubbleHidden:a.a.bool,buttonHandlers:s.a,onLoad:a.a.func,environment:a.a.shape({PAT_HOST:a.a.string,PUSHER_KEY:a.a.string,STATUS_PAGE:a.a.string,KINDLY_CHAT_URL:a.a.string,SETTINGS_HOST:a.a.string,SAGE_WS_HOST:a.a.string,SAGE_HOST:a.a.string}),inPlatform:a.a.bool,admin:a.a.bool}),n(19));function l(e){const t=e.replace(/\./g,"\\.").replace(/\*/g,".");return new RegExp(t,"i")}var d=function(e,t){if(Object(u.a)(t,"*"))return!0;if(!e)return!1;for(const n of t){if(l(n).test(e))return!0}return!1};function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&function(e,t){(Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}(e,t)}function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e,t){var n;return function(){for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];n&&clearTimeout(n),n=setTimeout((function(){e.apply(void 0,o),n=null}),t)}}function y(e,t){var n=0;return function(){var r=(new Date).getTime();if(!(r-n<t))return n=r,e.apply(void 0,arguments)}}var w="object"===("undefined"==typeof window||"undefined"==typeof window?"undefined":f(window)),x=w?document:{},O=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?b(e):t}(this,g(t).call(this,e)),h(b(n),"state",{idle:!1,oldDate:+new Date,lastActive:+new Date,remaining:null,pageX:null,pageY:null}),h(b(n),"tId",null),h(b(n),"_handleEvent",(function(e){var t=n.state,r=t.remaining,o=t.pageX,a=t.pageY,i=t.idle,c=n.props,s=c.timeout,u=c.onAction,l=c.debounce,d=c.throttle,f=c.stopOnIdle;if(l>0?n.debouncedAction(e):d>0?n.throttledAction(e):u(e),!r){if("mousemove"===e.type){if(e.pageX===o&&e.pageY===a)return;if(void 0===e.pageX&&void 0===e.pageY)return;if(n.getElapsedTime()<200)return}clearTimeout(n.tId),n.tId=null;var p=new Date-n.getLastActiveTime();(i&&!f||!i&&p>s)&&n.toggleIdleState(e),n.setState({lastActive:+new Date,pageX:e.pageX,pageY:e.pageY}),i&&f||(n.tId=setTimeout(n.toggleIdleState,s))}})),e.debounce>0&&e.throttle>0)throw new Error("onAction can either be throttled or debounced (not both)");return e.debounce>0&&(n.debouncedAction=v(e.onAction,e.debounce)),e.throttle>0&&(n.throttledAction=y(e.onAction,e.throttle)),e.startOnMount||(n.state.idle=!0),n.toggleIdleState=n._toggleIdleState.bind(b(n)),n.reset=n.reset.bind(b(n)),n.pause=n.pause.bind(b(n)),n.resume=n.resume.bind(b(n)),n.getRemainingTime=n.getRemainingTime.bind(b(n)),n.getElapsedTime=n.getElapsedTime.bind(b(n)),n.getLastActiveTime=n.getLastActiveTime.bind(b(n)),n.isIdle=n._isIdle.bind(b(n)),n}return m(t,e),function(e,t,n){t&&p(e.prototype,t),n&&p(e,n)}(t,[{key:"componentDidMount",value:function(){this._bindEvents(),this.props.startOnMount&&this.reset()}},{key:"componentDidUpdate",value:function(e){e.debounce!==this.props.debounce&&(this.debouncedAction=v(this.props.onAction,this.props.debounce)),e.throttle!==this.props.throttle&&(this.throttledAction=y(this.props.onAction,this.props.throttle))}},{key:"componentWillUnmount",value:function(){clearTimeout(this.tId),this._unbindEvents(!0)}},{key:"render",value:function(){return this.props.children||null}},{key:"_bindEvents",value:function(){var e=this;if(w){var t=this.state.eventsBound,n=this.props,r=n.element,o=n.events,a=n.passive,i=n.capture;t||(o.forEach((function(t){r.addEventListener(t,e._handleEvent,{capture:i,passive:a})})),this.setState({eventsBound:!0}))}}},{key:"_unbindEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(w){var n=this.props,r=n.element,o=n.events,a=n.passive,i=n.capture;(this.state.eventsBound||t)&&(o.forEach((function(t){r.removeEventListener(t,e._handleEvent,{capture:i,passive:a})})),this.setState({eventsBound:!1}))}}},{key:"_toggleIdleState",value:function(e){var t=this;this.setState((function(e){return{idle:!e.idle}}),(function(){var n=t.props,r=n.onActive,o=n.onIdle,a=n.stopOnIdle;t.state.idle?(a&&(clearTimeout(t.tId),t.tId=null,t._unbindEvents()),o(e)):a||(t._bindEvents(),r(e))}))}},{key:"reset",value:function(){clearTimeout(this.tId),this.tId=null,this._bindEvents(),this.setState({idle:!1,oldDate:+new Date,lastActive:+new Date,remaining:null});var e=this.props.timeout;this.tId=setTimeout(this.toggleIdleState,e)}},{key:"pause",value:function(){null===this.state.remaining&&(this._unbindEvents(),clearTimeout(this.tId),this.tId=null,this.setState({remaining:this.getRemainingTime()}))}},{key:"resume",value:function(){var e=this.state,t=e.remaining,n=e.idle;null!==t&&(this._bindEvents(),n||(this.setState({remaining:null,lastActive:+new Date}),this.tId=setTimeout(this.toggleIdleState,t)))}},{key:"getRemainingTime",value:function(){var e=this.state,t=e.remaining,n=e.lastActive,r=this.props.timeout;if(null!==t)return t<0?0:t;var o=r-(+new Date-n);return o<0?0:o}},{key:"getElapsedTime",value:function(){var e=this.state.oldDate;return+new Date-e}},{key:"getLastActiveTime",value:function(){return this.state.lastActive}},{key:"_isIdle",value:function(){return this.state.idle}}]),t}(i.Component);h(O,"propTypes",{timeout:a.a.number,events:a.a.arrayOf(a.a.string),onIdle:a.a.func,onActive:a.a.func,onAction:a.a.func,debounce:a.a.number,throttle:a.a.number,element:a.a.oneOfType([a.a.object,a.a.element]),startOnMount:a.a.bool,stopOnIdle:a.a.bool,passive:a.a.bool,capture:a.a.bool}),h(O,"defaultProps",{timeout:12e5,element:x,events:["mousemove","keydown","wheel","DOMMouseScroll","mouseWheel","mousedown","touchstart","touchmove","MSPointerDown","MSPointerMove","visibilitychange"],onIdle:function(){},onActive:function(){},onAction:function(){},debounce:0,throttle:0,startOnMount:!0,stopOnIdle:!1,capture:!0,passive:!0});var E=O,k=n(3),C=n(1),_=n(66),j=n(96),T=n(17),S=n(10),I=(a.a.shape({name:a.a.string.isRequired,avatar:a.a.string.isRequired}),n(8)),A=n(6),N=n(29),P=n(33),M=n(21),R=n(91),L=n(11),D=n(22),B=n(13),z=n(7);const U=C.c.div.withConfig({displayName:"styles__PushMessageContainer",componentId:"sc-na2ous-0"})(["right:40px;bottom:50px;z-index:",";position:fixed;border-radius:14px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";",";@media ","{margin-left:20px;","}"],e=>e.zIndex,z.a.shadowColor,L.f,z.b.maxTablet,e=>{let{bubbleSize:t}=e;return"SMALL"===t?"\n right: 30px;\n bottom: 30px;\n ":"\n bottom: 55px;"}),H=C.c.div.withConfig({displayName:"styles__PushMessageInner",componentId:"sc-na2ous-1"})(["padding:15px 20px;width:max-content;max-width:360px;min-width:130px;padding-right:60px;@media ","{width:unset;max-width:100%;}"],z.b.maxPhone),F=C.c.div.withConfig({displayName:"styles__ContentContainer",componentId:"sc-na2ous-2"})(["display:flex;cursor:pointer;align-items:center;"]),$=C.c.div.withConfig({displayName:"styles__AgentAvatar",componentId:"sc-na2ous-3"})(["width:29px;height:29px;min-width:29px;border-radius:100px;margin-right:15px;background:",";background-position:center;background-size:cover;background-color:",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),q=C.c.div.withConfig({displayName:"styles__ContentText",componentId:"sc-na2ous-4"})(["margin:0;color:",";font-size:",";font-weight:normal;line-height:24px;font-family:",";span{font-weight:500;}p{margin:0;}@media ","{font-size:14px;}"],z.a.darkColor,z.c.fontSizeH5,D.a.default,z.b.maxTablet),G=Object(C.c)(B.a).withConfig({displayName:"styles__PushMessageDismiss",componentId:"sc-na2ous-5"})(["top:-8px;left:-8px;z-index:",";display:flex;padding:0;border-radius:100px;background:",";background-color:",";position:absolute;&:hover{opacity:0.8;}"],e=>e.zIndex,e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground},e=>{let{theme:t}=e;return t.bubbleButtonBackground||t.buttonBackground}),Y=Object(M.a)(),V=e=>{let{agent:t,text:n}=e;return Object(i.useEffect)(()=>{Object(R.a)()},[]),c.a.createElement(F,null,c.a.createElement($,{style:{backgroundImage:`url(${t.avatar})`}}),c.a.createElement(q,null,c.a.createElement("span",null,t.name)," ",n))},W=e=>{let{text:t}=e;return c.a.createElement(F,null,c.a.createElement(q,{dangerouslySetInnerHTML:{__html:t}}))};var K=e=>{let{settings:t}=e;const{bubbleSize:n}=Object(k.d)(A.d),{agent:r,show:o,text:a,type:s}=Object(k.d)(A.o),u=Object(k.c)(),l=Object(N.a)(t,"zIndex",15),d=Object(C.e)(),f=Object(i.useMemo)(()=>Object(P.a)(d.bubbleButtonBackground||d.buttonBackground,"#fff","#000"),[d.bubbleButtonBackground,d.buttonBackground]);return a?c.a.createElement(U,{bubbleSize:n,"aria-hidden":o?"false":"true","aria-label":"Chat bot push message",onClick:()=>u(Object(I.E)()),role:"complementary",zIndex:l},c.a.createElement(G,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:e=>{e.stopPropagation(),u(Object(I.u)())},type:"button"},c.a.createElement(S.e,{stroke:f,width:Y?20:25,height:Y?20:25})),c.a.createElement(H,null,"message"===s&&c.a.createElement(W,{text:a}),"takeover"===s&&c.a.createElement(V,{agent:r,text:a}))):null},X=n(5),J=(n(52),n(14));const Q=Object(C.b)(["#chatContainer.using-tab &{outline-color:rgb(77,144,254);outline-offset:-2px;outline-style:auto;outline-width:5px;}"]),Z=Object(C.b)(["z-index:15;transition:all 0.2s ease;",";"],e=>e.active&&"transform: rotate(45deg);"),ee=Object(C.c)(S.c).withConfig({displayName:"styles__BubbleButton",componentId:"sc-1elsepj-0"})(["&&&{",";overflow:visible;path{stroke-width:2px;stroke:",";fill:",";transition:stroke 0.15s ease;}}"],Z,e=>{let{active:t,bubbleOutline:n,theme:r,stroke:o}=e;return o||(!t&&n?r.bubbleButtonOutline:r.bubbleButtonBackground||r.buttonBackground)},e=>{let{theme:t,background:n}=e;return n||(t.bubbleButtonBackground||t.buttonBackground)}),te=C.c.button.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1elsepj-1"})(["z-index:10;overflow:visible;display:flex;justify-content:center;align-items:center;flex-direction:column;cursor:pointer;height:50px;width:50px;padding:9px 8px;text-align:center;border-radius:50%;border:2px solid ",";box-shadow:"," ",";background:",";",";transition:all 0.25s ease;"," @media (max-width:768px){","}:focus{",";}:hover{background:",";}:focus ","{",";}"," path{",";",";}"],e=>{let{bubbleOutline:t,theme:n,background:r}=e;return r||(t?n.bubbleButtonOutline:n.bubbleButtonBackground||n.buttonBackground)},e=>e.active?"0px 1px 5px 1px":"1px 0px 7px 7px",z.a.shadowColorDark,e=>{let{theme:t,background:n}=e;return n||t.bubbleButtonBackground||t.buttonBackground},e=>{let{background:t}=e;return t?`border-color: ${t}`:void 0},J.b,e=>{let{smallBubble:t}=e;return t&&"\n height: 30px;\n width: 30px;\n\n svg {\n width: 45px;\n }\n "},e=>{let{active:t}=e;return!t&&"outline: none;"},e=>{let{background:t,theme:n}=e;return t||n.bubbleButtonBackground||n.buttonBackground},ee,e=>{let{active:t}=e;return!t&&Q},ee,e=>{let{background:t}=e;return t?`stroke: ${t}`:""},e=>{let{background:t}=e;return t?`fill: ${t}`:""}),ne=Object(C.b)(["position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);"]),re=C.c.div.withConfig({displayName:"styles__LogoContainer",componentId:"sc-1elsepj-2"})([""," opacity:1;width:calc(100% - 20px);height:calc(100% - 20px);background-size:contain;background-repeat:no-repeat;background-position:center top;background-image:url(",");transition:all 0.2s ease;",";"],ne,e=>e.bubbleAvatar,e=>e.active&&"opacity: 0;"),oe=C.c.div.withConfig({displayName:"styles__IconContainer",componentId:"sc-1elsepj-3"})(["",""],ne),ae=Object(C.c)(S.m).withConfig({displayName:"styles__MinimizeButton",componentId:"sc-1elsepj-4"})(["z-index:20;"," opacity:0;transition:all 0.2s ease;",";"],ne,e=>e.active&&"opacity: 1;");var ie=n(154),ce=n.n(ie);const se=C.c.img.withConfig({displayName:"styles__ChristmasBubbleButton",componentId:"sc-11ugteh-0"})(["z-index:15;position:absolute;top:-22px;left:2px;width:84px;opacity:1;transform:rotate(10deg);transition:all 0.2s ease;",";path{fill:",";}"],e=>e.active&&"\n transform: rotate(32deg);\n width: 51px;\n top: -20px;\n left: 9px;\n ",e=>{let{theme:t,active:n}=e;return n?t.bubbleButtonBackground||t.buttonBackground:""});var ue=e=>{let{active:t,bubbleOutline:n}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement(oe,null,c.a.createElement(se,{src:ce.a,active:t?1:0}),c.a.createElement(ee,{active:t?1:0,bubbleOutline:n?1:0,width:t?33:65,height:t?35:67})))};const le=C.c.svg.withConfig({displayName:"styles__EarFront",componentId:"sc-106df1-0"})(["z-index:15;position:absolute;top:-22px;left:32px;width:31px;height:38px;opacity:1;&:focus{outline:none;}transition:all 0.2s ease;",";"],e=>e.active&&"\n width: 18px;\n height: 23px;\n top: -6px;\n left: 29px;\n "),de=C.c.svg.withConfig({displayName:"styles__EarBack",componentId:"sc-106df1-1"})(["position:absolute;top:-26px;left:24px;width:31px;height:38px;opacity:1;z-index:-1;transition:all 0.2s ease;",";"],e=>e.active&&"\n width: 12px;\n height: 15px;\n top: -8px;\n left: 31px;\n "),fe=C.c.svg.withConfig({displayName:"styles__EyesNose",componentId:"sc-106df1-2"})(["z-index:15;position:absolute;top:24px;left:-2px;width:29px;height:24px;opacity:1;transform:rotate(0deg);transition:all 0.2s ease;",";"],e=>e.active&&"\n opacity: 0;\n top: 3px;\n left: -8px;\n width: 19px;\n height: 14px;\n transform: rotate(45deg);\n ");var pe=e=>{let{active:t,bubbleOutline:n}=e;return c.a.createElement(c.a.Fragment,null,c.a.createElement(de,{width:"31px",height:"38px",viewBox:"0 0 31 38",active:t?1:0},c.a.createElement(S.f,null)),c.a.createElement(le,{width:"31px",height:"38px",viewBox:"0 0 31 38",active:t?1:0},c.a.createElement(S.g,null)),c.a.createElement(oe,null,!t&&c.a.createElement(fe,{width:"29px",height:"24px",viewBox:"0 0 29 24",active:t?1:0},c.a.createElement(S.k,null)),c.a.createElement(ee,{active:t?1:0,bubbleOutline:n?1:0,width:t?33:65,height:t?35:67,background:"#FFCA3A",stroke:"#FFCA3A"})))};const he=Object(C.c)(S.d).withConfig({displayName:"styles__PrideBubbleButton",componentId:"sc-1a5n29u-0"})(["",";path{fill:",";}",":focus &{",";}"],Z,e=>{let{theme:t,active:n}=e;return n?t.bubbleButtonBackground||t.buttonBackground:""},te,e=>{let{active:t}=e;return!t&&Q});var me=e=>{let{active:t}=e;return c.a.createElement(oe,null,c.a.createElement(he,{active:t?1:0,width:t?35:65,height:t?37:67}))};var ge=e=>{let{active:t,season:n,bubbleOutline:r,children:o}=e;return n===X.k.PRIDE?c.a.createElement(me,{active:t}):n===X.k.EASTER?c.a.createElement(pe,{active:t,bubbleOutline:r}):n===X.k.CHRISTMAS?c.a.createElement(ue,{active:t,bubbleOutline:r}):c.a.createElement(oe,null,c.a.createElement(ee,{active:t?1:0,bubbleOutline:r?1:0,width:t?33:65,height:t?35:67}),o)};var be=e=>{let{title:t,active:n,onClick:r}=e;const{seasonalAppearance:o,bubbleOutline:a,bubbleSize:i,bubbleAvatar:s}=Object(k.d)(A.d),u=(e=>{if(e===X.k.EASTER)return"#ffca3a"})(o);return c.a.createElement(te,{"aria-label":t,"aria-controls":"chat-box","aria-labelledby":"chat-bubble-chat-button",title:t,type:"button",active:n,onClick:r,"data-cy":"chat-bubble-button","data-testid":"chat-button",bubbleOutline:a?1:0,seasonalAppearance:o?1:0,background:u,smallBubble:"SMALL"===i},c.a.createElement(ge,{active:n,season:o,bubbleOutline:a},s?c.a.createElement(re,{bubbleAvatar:s,active:n,"data-cy":"chat-bubble-logo-container"}):void 0),c.a.createElement(ae,{active:n,width:22,height:11}))},ve=n(18),ye=n(37),we=n(48);function xe(){const e=Object(k.c)(),{currentLanguage:t,active:n,chatHasStarted:r}=Object(k.d)(A.e),{pushGreetingsEnabled:o,pushGreetings:a}=Object(k.d)(A.d),{defaultLanguage:c}=Object(ve.a)();Object(i.useEffect)(()=>{if(!o||!a||n||!t||r)return;const i=window.location.href;a.forEach(n=>{if(Object(we.a)(i,n.url)&&n.enabled[t]){const r=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"url"!==t&&"autopopup_time"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:Object(ye.a)(a,t,n)}},{}))(n,t,c);return r.autopopupTime=n.autopopup_time,e(Object(I.Z)(r))}return!1})},[n,t,c,o,a,e,r])}const Oe=function(e){let{retries:t=6,interval:n=300,intervalBackoffMultiplier:r=2}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((o,a)=>{e({retriesLeft:t,interval:n,intervalBackoffMultiplier:r}).then(o).catch(i=>{setTimeout(()=>{t<=1?a(i):Oe(e,{retries:t-1,interval:n*r,intervalBackoffMultiplier:r}).then(o,a)},n)})})};var Ee=Oe,ke=n(73),Ce=n(2),_e=n(97),je=n(9);var Te=n(93);const Se=C.c.div.withConfig({displayName:"styles__ChatButtonContainer",componentId:"sc-18sln6s-0"})(["position:fixed;bottom:calc(",");right:calc(",");z-index:",";",";"],e=>{var t,n;return`${null!==(t=null===(n=e.position)||void 0===n?void 0:n.bottom)&&void 0!==t?t:X.c.bottom} + 10px`},e=>{var t,n;return`${null!==(t=null===(n=e.position)||void 0===n?void 0:n.right)&&void 0!==t?t:X.c.right} + 10px`},e=>e.zIndex,e=>e.inPlatform&&"display:flex; align-items: center"),Ie=C.c.div.withConfig({displayName:"styles__AlertContainer",componentId:"sc-18sln6s-1"})(["height:15px;width:15px;z-index:50;right:0;top:-10px;position:absolute;border-radius:100px;background:",";background-color:",";",";"],z.a.errorColor,z.a.errorColor,L.g),Ae=Object(i.lazy)(()=>Ee(()=>Promise.resolve().then(n.bind(null,228)))),Ne=Object(i.lazy)(()=>Ee(()=>Promise.resolve().then(n.bind(null,229)))),Pe=Object(i.lazy)(()=>Ee(()=>Promise.resolve().then(n.bind(null,230)))),Me=Object(i.lazy)(()=>Ee(()=>Promise.resolve().then(n.bind(null,231))));var Re=e=>{let{hidden:t=!1,onNudgeDismiss:n,onNudgeProductClick:r,onNudgeFormSubmit:o,chatSettings:a}=e;const s=Object(k.e)(),u=Object(k.c)(),{active:l,inPlatform:d}=Object(k.d)(A.e),{PAT_HOST:f,PUSHER_KEY:p,VERSION:h}=Object(k.d)(A.g),{show:m}=Object(k.d)(A.o),{feedbackFormOpen:g}=Object(k.d)(A.h),{show:b,nudgeLayout:v}=Object(k.d)(A.m),{bubbleNotification:y,position:w,fullscreenMode:x}=Object(k.d)(A.d),{showBubbleNotification:O}=Object(k.d)(A.b),E=Object(M.a)(),C=l?"Close chat":"Start chat",_=Object(i.useCallback)(()=>u(l?Object(I.h)():Object(I.E)()),[l,u]),j=Object(N.a)(a,"zIndex",15);(l&&O||O&&!E)&&u(Object(I.s)()),l&&m&&u(Object(I.u)()),Object(i.useEffect)(()=>{const e=`${f}/chatbubble/${X.j}/auth/pusher?version=${h}`;Object(T.delayConfiguration)(s,p,{authEndpoint:e,cluster:"eu",encrypted:!0,disableStats:!0,pongTimeout:7500})},[f,p,h,s]),function(){const e=Object(k.c)(),[t,n]=Object(i.useState)("/"),[r,o]=Object(i.useState)(!1),{shownNudges:a}=Object(k.d)(A.e),c=Object(Te.a)();Object(i.useEffect)(()=>{n(window.location.href),null!=a&&a.length&&!r&&Array.from(new Set(a).values()).map(e=>c.find(t=>t.slug===e)).filter(e=>e).filter(e=>e.analytics_completion_page_path).filter(e=>Object(we.a)(t,e.analytics_completion_page_path)).forEach(t=>{o(!0),e(Object(I.kb)({slug:t.slug,eventType:Ce.W})),e({type:Ce.x,slug:t.slug})})},[e,t,c,a,r])}(),(()=>{const e=Object(k.c)(),{languages:t}=Object(ve.a)(A.d),{currentLanguage:n}=Object(k.d)(A.e);Object(i.useEffect)(()=>{if(n)return;const r=(()=>{if(1===t.length)return t[0].code;const e=t.find(e=>{let{code:t}=e;return t===document.documentElement.lang});if(e)return e.code;const n=window.navigator.userLanguage||window.navigator.language;return n?n.split("-")[0]:""})();r&&e(Object(I.Q)(r,{skipRestart:!0}))},[n,t,e])})(),xe(),function(e){const t=Object(k.c)(),{token:n,pusherConnected:r,connectTriggerConfig:o}=Object(k.d)(A.f),{takenOver:a}=Object(k.d)(A.a),{persistStateLifespan:c}=Object(k.d)(A.d),{botKey:s,active:u,disabledTransports:l,chatHasStarted:d,wasActiveOnLoad:f,inPlatform:p,userIsIdle:h,error:m}=Object(k.d)(A.e),{chatMessages:g,messageSentTime:b}=Object(k.d)(A.l),[v,y]=Object(i.useState)(!1),[w,x]=Object(i.useState)(!1),O=localStorage.getItem(`kindly-chat-${s}`);Object(i.useEffect)(()=>(window.addEventListener("online",()=>t(Object(I.z)())),window.addEventListener("offline",()=>t(Object(I.A)())),()=>{window.removeEventListener("online",()=>t(Object(I.z)())),window.removeEventListener("offline",()=>t(Object(I.A)()))}),[t]),Object(i.useEffect)(()=>{const n=e.welcomePage.type!==X.r.NONE;!d&&f&&!n&&t({type:Ce.Y,chatHasStarted:!0})}),Object(i.useEffect)(()=>{u&&d&&!r&&(y(!0),403!==m||n||t(Object(I.m)()))},[u,d,t,m,r,n]),Object(i.useEffect)(()=>{o&&t(Object(I.m)(o))},[o,t]),Object(i.useEffect)(()=>{r&&o&&t(Object(I.o)())},[o,t,r]),Object(i.useEffect)(()=>{if(u&&d&&!r&&!(v||h||o)){const e=Object(_e.a)({botKey:s,persistStateLifespan:c});!n||0===g.length&&!d?t(Object(I.m)()):e&&Object(I.n)(n,l)}},[v,u,o,r,n,l,t,g.length,d,h,m,b,c,O,s]),Object(i.useEffect)(()=>{v&&r&&y(!1)},[v,r]),Object(i.useEffect)(()=>{if(r&&h&&!a){Object(je.g)(n);try{Object(T.disconnect)()}catch{}}},[h,r,a,n]),Object(i.useEffect)(()=>(u&&!p&&e.chatbubble.realtime_analytics&&t(Object(ke.a)(e.id)),ke.b),[u,t,p,e]),Object(i.useEffect)(()=>{n&&u&&!w&&(t(Object(I.x)()),x(!0))},[u,t,w,n])}(a);const S=(!l||x)&&g,P=!l&&m&&!t&&!g;return c.a.createElement(c.a.Fragment,null,l&&c.a.createElement(Ae,{settings:a}),P&&c.a.createElement(K,{settings:a}),S&&c.a.createElement(Pe,null),!g&&b&&v&&c.a.createElement(Ne,{hidden:t,layout:v,onDismiss:n,onNewsletterSubmit:o,onProductClick:r}),c.a.createElement(Se,{inPlatform:d,position:w,zIndex:j},d&&c.a.createElement(Me,{active:l}),!l&&y&&O&&c.a.createElement(Ie,null),!t&&c.a.createElement(be,{title:C,active:l,onClick:_})))},Le=e=>{if(!e)return!0;return Date.now()-Number(e)>X.m},De=n(68);var Be=n(57),ze=n(155),Ue=n.n(ze);function He(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Fe=He();Fe.withExtraArgument=He;var $e=Fe,qe=n(156),Ge=n.n(qe),Ye=(e,t)=>Ge()({},e,t);var Ve=(e,t,n)=>Ye(e,((e,t)=>e.split(".").reverse().reduce((e,n,r)=>0===r?{[n]:t}:{[n]:e},{}))(t,n));var We=e=>(t,n)=>{const r=Ye(t,n);return o=r,e.reduce((e,t)=>{let[n,r]=t;return Ve(e,n,r)},o);var o},Ke=n(56),Xe=n(50);const Je={id:null,name:"",avatar:"",botName:"",botAvatar:"",text:null,languages:[],startOverText:"Start over",placeholder:"",typingIndicator:!1,typingDuration:"",isTyping:!1,isTypingTimeoutId:null,feedbackForm:null,realtimeAnalytics:!1,inputLimitEnabled:!1,inputLimit:140,welcomePage:null,welcomePageType:X.r.COLOR,pushGreetingsEnabled:!1,pushGreetings:[],tabNotification:!0,bubbleNotification:!0,heartbeatEnabled:!1};var Qe=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Je,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.qb:return localStorage.removeItem("kindly-chat-has-shown-feedback-form"),{...e,name:e.botName,avatar:e.botAvatar,splitLabelTimestamp:Date.now()};case Ce.i:{var n;const r=null===(n=null==t?void 0:t.isTyping)||void 0===n||n;return{...e,isTyping:r}}case Ce.I:return{...e,isTyping:t.isTyping,isTypingTimeoutId:t.isTypingTimeoutId,hasInteraction:!0,splitLabelTimestamp:Date.now()};case Ce.fb:return{...e,splitLabelTimestamp:Date.now(),splitTestLabel:t.splitTestLabel};case Ce.Ab:return{...e,splitLabelTimestamp:Date.now()};case Ce.m:return{...e,splitTestLabel:null,hasInteraction:null,splitLabelTimestamp:null};default:return e}};const Ze={botKey:null,inPlatform:!1,chatHasStarted:!1,active:!1,hideInputField:!1,previouslyPoppedUp:!1,currentlyPoppedUp:!1,optionsScreenOpen:!1,currentLanguage:null,startedAt:null,userIsIdle:!1,allGreetingsHideInput:!1,contactDetailsButton:null,uploadButtonWasClicked:null,attachments:{exchangeId:null,buttonClicked:null,files:[]},error:null};var et=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ze,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.Z:return{...e,error:t.error};case Ce.cb:return{...e,currentLanguage:t.code};case Ce.qb:return{...e,error:null,botKey:t.botKey||e.botKey,optionsScreenOpen:!1,hideInputField:!1,userIsIdle:!1};case Ce.Y:return{...e,chatHasStarted:t.chatHasStarted,userIsIdle:!t.chatHasStarted&&e.userIsIdle};case Ce.I:{const n=e.hideInputField&&"BOT"!==t.data.sender;return{...e,hideInputField:!!n||t.data.chatbubble_hide_input_field}}case Ce.K:return{...e,active:!0,userIsIdle:!1};case Ce.n:return{...e,active:!1,optionsScreenOpen:!1};case Ce.Q:return{...e,previouslyPoppedUp:!0,currentlyPoppedUp:!0};case Ce.N:return{...e,optionsScreenOpen:!0};case Ce.q:return{...e,optionsScreenOpen:!1};case Ce.H:return{...e,chatId:t.chatId,allGreetingsHideInput:t.allGreetingsHideInput};case Ce.wb:return e;case Ce.gb:return{...e,startedAt:t.startedAt};case Ce.hb:return{...e,userIsIdle:t.userIsIdle};case Ce.jb:return{...e,contactDetailsButton:t.button};case Ce.D:return{...e,contactDetailsButton:null};case Ce.t:return{...e,shownNudges:(e.shownNudges||[]).concat(t.slug)};case Ce.f:return{...e,attachments:{...e.attachments,buttonClicked:+new Date,exchangeId:t.button.value}};case Ce.X:return{...e,attachments:{...e.attachments,files:t.files}};case Ce.k:return{...e,attachments:{exchangeId:null,buttonClicked:null,files:[]}};case Ce.g:return{...e,attachments:{...e.attachments,buttonClicked:null}};case Ce.x:return{...e,shownNudges:(e.shownNudges||[]).filter(e=>e!==t.slug)};default:return e}};const tt={PAT_HOST:"https://bot.kindly.ai",PUSHER_KEY:"0d15baa2a7308d71e79d",STATUS_PAGE:"https://status.kindly.ai",KINDLY_CHAT_URL:"http://localhost:8081",SAGE_WS_HOST:"wss://sage.kindly.ai",SAGE_HOST:"https://sage.kindly.ai",SETTINGS_HOST:"https://chat.kindlycdn.com",VERSION:"dev"};var nt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:tt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.O:return{...e,...t.env};default:return e}};const rt=(e,t)=>({...Je,id:e.id,name:e.name,avatar:e.avatar,botName:e.name,botAvatar:e.avatar,languages:e.languages,includeDisabledLanguages:e.includeDisabledLanguages,startOverText:e.start_over_text,welcomePage:e.welcomePage,welcomePageType:t?X.r.NONE:e.welcomePage.type,maintenanceAlert:e.maintenanceAlert,maintenanceAlertEnabled:!t&&e.maintenanceAlert.alert_enabled,pushGreetingsEnabled:!t&&e.use_push_greetings,pushGreetings:e.push_greetings,tabNotification:e.tab_notification,bubbleNotification:e.bubble_notification,typingIndicator:e.typing_indicator,typingDuration:e.typing_duration,disabledTransports:e.disabled_transports,feedbackFormType:t?X.q.NONE:e.feedbackForm.type,feedbackForm:e.feedbackForm,text:e.text,bubbleSize:e.bubble_size,isTextDirectionRtl:e.text_right_to_left,realtimeAnalytics:e.chatbubble.realtime_analytics,inputLimitEnabled:e.chatbubble.input_limit_enabled,inputLimit:e.chatbubble.input_limit||140,hideHeader:e.hideHeader||!1,bubbleAvatar:e.bubbleAvatar||null,position:{...X.c,...e.position},offsetHeight:e.offsetHeight||"205px",fullscreenMode:e.fullscreenMode||!1,zIndex:e.zIndex||X.d,persistStateLifespan:t?-1:e.chatbubble.persist_state_lifespan_seconds,showTakeoverQueue:e.show_takeover_queue,bubbleOutline:e.use_bubble_outline,seasonalAppearance:e.seasonal_appearance,noFeedbackAfterHandover:e.no_feedback_after_handover,nudges:e.nudges||[],handoverMode:e.handover_mode,heartbeatEnabled:Boolean(e.chatbubble_heartbeat_enabled),heartbeatTTL:e.chatbubble_heartbeat_ttl_s,splitTestEnabled:e.split_test_enabled,conversionPageUrl:e.conversion_page_url});var ot=(e,t,n)=>{const{currentLanguage:r}=t;return n[r]||n.en},at=n(38);const it=Object.freeze({WARNING:"WARNING",CRITICAL:"CRITICAL"}),ct=Object.freeze({OFFLINE:{en:"You seem to be offline, please check your internet connection",nb:"Du ser ut til å være frakoblet internett, vennligst sjekk tilgangen din"},WEBSOCKET_DOWN:{en:"There seems to be an issue with the connection, attempting to reconnect...",nb:"Det ser ut til å være et problem med tilkoblingen. Prøver å koble opp igjen..."}});var st=e=>t=>n=>{switch(n.type){case Ce.w:return((e,t,n,r)=>{const{announcement:o,bot:a,chatbubble:i}=t;if(o.show)return n(r);const c={text:ot(0,i,e),alertType:it.WARNING};return n({type:Ce.d,payload:c}),n(r)})(ct.OFFLINE,e.getState(),t,n);case Ce.r:{const{announcement:r,connection:o}=e.getState();return r.show&&t({type:Ce.c}),o.connected||t(Object(at.c)()),t(n)}default:return t(n)}};var ut=e=>t=>n=>{if(n.type!==Ce.I)return t(n);const{chatbubble:{active:r,currentLanguage:o}}=e.getState();if("greeting"===n.data.exchange_type||n.data.triggered_chat_start){const e=n.data.chat_language_code;o!==e&&t({type:Ce.cb,code:e})}if(("boolean"==typeof n.displayTypingIndicator?n.displayTypingIndicator:!n.data.from_bot)?Object(I.P)()(t,e.getState):Object(I.mb)()(t,e.getState),!n.data.from_bot&&n.data.was_anonymized)return t({type:Ce.e,data:n.data});if(!n.data.from_bot)return t(n);return!r&&"AGENT"!==n.data.sender&&"SYSTEM"!==n.data.sender&&"greeting"!==n.data.exchange_type&&t({type:Ce.K}),t(n)},lt=e=>t=>n=>{switch(n.type){case Ce.I:{const{bot:{typingDuration:r,typingIndicator:o},agent:{takenOver:a},chatbubble:{chatHasStarted:i}}=e.getState(),{isContactDetails:c,sender:s,from_bot:u,created:l}=n.data;if(!o||a||!i||s===X.l.SYSTEM||c)return t({...n,displayTypingIndicator:!1});if(Object(I.P)()(t,e.getState),!u)return t(n);const d=r-((new Date).getTime()-Object(Ke.a)(l).getTime());return setTimeout(()=>{t(n)},d>0?d:0)}default:return t(n)}};var dt=e=>t=>n=>{const{bot:{typingDuration:r,typingIndicator:o}}=e.getState(),a=o?Math.max(5e3,r):5e3;return n.type===Ce.H&&setTimeout(()=>t(Object(I.H)()),a),n.type===Ce.I&&n.data.from_bot?(t(Object(I.p)()),t(Object(I.c)()),t(n)):t(n)};const ft={names:[],avatars:[],isTyping:!1,userIsTyping:!1,takenOver:!1,takeoverClosed:!0,requestedTakeover:!1,hasHadHandover:!1};var pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.sb:{const n=t.data.taken_over&&!e.takenOver,r=!t.data.taken_over&&e.takenOver;return n?{...e,requestedTakeover:!1,takenOver:!0,isTyping:!1,hasHadHandover:!0}:r?{...e,requestedTakeover:!1,takenOver:!1,isTyping:!1}:e}case Ce.I:return{...e,isTyping:!1};case Ce.a:return{...e,isTyping:!0};case Ce.b:return{...e,isTyping:!1};case Ce.Bb:return{...e,userIsTyping:!0};case Ce.Cb:return{...e,userIsTyping:!1};case Ce.ub:return{...e,requestedTakeover:t.requestedTakeover,takeoverClosed:t.closed||!1};case Ce.tb:return{...e,requestedTakeover:!1};case Ce.T:return{...e,hasHadHandover:!1};default:return e}};const ht={showTabNotification:!1,showBubbleNotification:!1};var mt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ht,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.I:if(!t.data.from_bot||"SYSTEM"===t.data.sender)return e;return"visible"===document.visibilityState?{showBubbleNotification:!0}:{showTabNotification:!0};case Ce.ob:return{showTabNotification:!0};case Ce.ib:return{showBubbleNotification:!0};case Ce.z:return{...ht};default:return e}};const gt={show:!1,text:null,url:null,type:null};var bt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.d:return{text:t.payload.text,type:t.payload.alertType,url:t.payload.url,show:!0};case Ce.c:return gt;default:return e}};const vt={isAuthenticated:!1,token:null,avatarUrl:null,fullName:null,isRefreshing:!1,getAuthToken:null};var yt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.h:return{...e,isAuthenticated:!0,token:t.token,avatarUrl:t.avatarUrl,fullName:t.fullName};case Ce.E:return{...e,avatarUrl:t.avatarUrl,fullName:t.fullName};case Ce.xb:return{...e,...vt};case Ce.rb:return{...e,isRefreshing:!0};case Ce.C:return{...e,isRefreshing:!1};default:return e}};const wt={token:null,connected:!0,pusherConnected:!1,connectTriggerConfig:void 0,heartbeatId:void 0};var xt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.J:return{...e,token:t.token};case Ce.qb:case Ce.V:return{...e,token:null};case Ce.r:return{...e,connected:!0};case Ce.w:return{...e,connected:!1};case Ce.R:return{...e,pusherConnected:!0};case Ce.S:return{...e,pusherConnected:!1};case Ce.s:return{...e,connectTriggerConfig:t.triggerConfig};case Ce.ab:return{...e,heartbeatId:t.heartbeatId};default:return e}};const Ot={inspectorOpen:!1,currentMessageId:null};var Et=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ot,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.bb:return{...e,currentMessageId:t.chatMessageId};case Ce.vb:return{...e,inspectorOpen:!e.inspectorOpen};default:return e}};const kt={token:null,feedbackFormOpen:!1};var Ct=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.L:return{...e,feedbackFormOpen:!0,token:t.token};case Ce.o:return kt;default:return e}},_t=n(90);const jt={context:{},language:null};var Tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:jt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case _t.a:return{...e,context:{...e.context,...t.context}};default:return e}};const St={show:!1,textContent:null,linkText:null,linkLocation:null,dismissed:!1};var It=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:St,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.lb:return{show:!0,textContent:t.textContent,linkText:t.linkText,linkLocation:t.linkLocation};case Ce.y:return{...St,dismissed:!0};default:return e}},At=n(87),Nt=e=>e.replace(/_\w/g,e=>e[1].toUpperCase()),Pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[Nt(n)]:r}},{})},Mt=e=>Boolean(e.find(e=>{let{exchange_type:t}=e;return"greeting"===t})),Rt=n(89),Lt=n(86);const Dt={chatMessages:[],buttonClicks:[],attachments:[],messageSentTime:null,lastMessageSeen:null},Bt=e=>{let{id:t}=e;return t},zt=e=>{let{temporaryId:t,id:n}=e;return e=>{let{temporaryId:r,id:o}=e;return n===o||t===r}},Ut=(e,t,n)=>e.map(e=>t(e)?n(e):e);var Ht=function(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Dt,o=arguments.length>1?arguments[1]:void 0;switch(o.type){case Ce.I:{const{chatMessages:e}=r,{data:t,force:n=!1}=o;return"greeting"===Object(N.a)(t,"exchange_type")&&Mt(e)?r:n||Object(Rt.a)(e)(t)?Ve(r,"chatMessages",[...e,t]):r}case Ce.qb:return Dt;case Ce.e:{const{chatbubble_temporary_id:e,id:t}=o.data,n=n=>{let{id:r}=n;return Object(u.a)(r,[e,t])},a=e=>({...e,message:o.data.message});return{...r,chatMessages:Ut(r.chatMessages,n,a)}}case Ce.eb:return{...r,messageSentTime:o.messageSentTime};case Ce.zb:{var a;const{created:e,id:t,temporaryId:n}=o,{chatMessages:i}=r,c=null!==(a=null==o?void 0:o.status)&&void 0!==a?a:null,s=i.findIndex(e=>{let{id:t}=e;return t===n});if(s<0)return r;const u=i[s],l={...u,created:e||u.created,id:t||u.id,status:c},d=i.map((e,t)=>t!==s?e:l);return{...r,chatMessages:d}}case Ce.P:{const{chatMessageId:e,chatMessageTempId:t,patternContextMatch:n}=o.data,a=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,pattern_context_match:n});return{...r,chatMessages:Ut(r.chatMessages,a,i)}}case Ce.pb:{const{chatMessageId:e,chatMessageTempId:t,correctedMessage:n}=o.data,a=n=>{let{id:r}=n;return r===e||r===t},i=e=>({...e,corrected_message:n});return{...r,chatMessages:Ut(r.chatMessages,a,i)}}case Ce.j:var i;return o.force||Object(At.a)(r.buttonClicks)(o.buttonClick)?{...r,buttonClicks:[...null!==(i=r.buttonClicks)&&void 0!==i?i:[],o.buttonClick]}:r;case Ce.db:return{...r,lastMessageSeen:Object(Lt.a)(o,["id","index"])};case Ce.G:return{...r,attachments:[...null!==(e=r.attachments)&&void 0!==e?e:[],...(null===(t=o.data)||void 0===t||null===(n=t.attachments)||void 0===n?void 0:n.map(Pt))||[]]};case Ce.yb:{const e=Pt(o.attachment),t=zt(e),n=t=>({...t,...e});return{...r,attachments:Ut(r.attachments,t,n)}}case Ce.F:{var c;const{attachments:e=[],temporaryChatMessageId:t,chatMessageId:n}=o.data,a=e.map(Pt),i=(null!==(c=r.attachments)&&void 0!==c?c:[]).map(e=>{const t=a.find(zt(e));return t?{...e,...t}:e});let s=r.chatMessages;if(t&&n){const e=e=>{let{id:n}=e;return n===t},o=e=>({...e,id:n,attachment_ids:a.map(Bt)});s=Ut(r.chatMessages,e,o)}return{...r,attachments:i,chatMessages:s}}default:return r}};const Ft={chatDeleted:!1};var $t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ft,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.v:return{...e,chatDeleted:!0};case Ce.Y:return{...e,chatDeleted:!t.chatHasStarted&&e.chatDeleted};case Ce.qb:return{...e,chatDeleted:!1};default:return e}},qt=n(67);const Gt={show:!1,text:null,agent:null,dismissed:!1,type:qt.a.MESSAGE,dismissedMessages:[]};var Yt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Gt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.sb:return t.data.taken_over&&!e.taken_over?{...e,show:!0,agent:{name:t.data.name,avatar:t.data.avatar},text:"er her for å hjelpe deg",type:qt.a.TAKEOVER}:e;case Ce.I:return Object(M.a)()||!t.data.from_bot||"SYSTEM"===t.data.sender||"greeting"===t.data.exchange_type?e:{...e,show:!0,text:t.data.message,type:qt.a.MESSAGE};case Ce.nb:return{...e,show:!0,text:t.pushMessageText,dismissed:!1,type:t.pushMessageType,dismissedMessages:[...e.dismissedMessages,t.pushMessageTitle]};case Ce.B:return{...e,show:!1,dismissed:!0};case Ce.U:return Gt;default:return e}},Vt=n(24);const Wt={takeoverPollIntervalId:null,takeoverRequestPollIntervalId:null,replyTimeoutId:null,replyTimeoutAttempts:0};var Kt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Wt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Vt.e:return{...e,takeoverPollIntervalId:t.takeoverPollIntervalId};case Vt.f:return{...e,takeoverRequestPollIntervalId:t.takeoverRequestPollIntervalId};case Vt.d:return{...e,replyTimeoutId:t.replyTimeoutId,replyTimeoutAttempts:t.replyTimeoutAttempts};case Vt.b:return{...e,takeoverPollIntervalId:null};case Vt.c:return{...e,takeoverRequestPollIntervalId:null};case Vt.a:return{...e,replyTimeoutId:null,replyTimeoutAttempts:0};default:return e}};const Xt={open:!1,imageUrl:""};var Jt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.M:return{...e,open:!0,imageUrl:t.imageUrl};case Ce.p:return{...e,open:!1,imageUrl:""};default:return e}};const Qt={slug:null,show:!1,isCustom:!1,dialogue:null,webhook:null,content:null,onRendered:null,nudgeLayout:{},nudgeType:X.i.TEMPLATE,hasInteraction:!1};var Zt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Qt,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ce.A:return{...e,show:!1,nudgeLayout:{},hasInteraction:!0};case Ce.mb:return{...e,show:!0,slug:t.slug,dialogue:t.dialogue,webhook:t.webhook,nudgeLayout:t.nudgeLayout,nudgeType:X.i.TEMPLATE,trackEvent:t.trackEvent,hasInteraction:!0};case Ce.kb:return{...e,show:!0,isCustom:!0,slug:t.slug,content:t.content,nudgeLayout:{},onRendered:t.onRendered,nudgeType:X.i.CUSTOM,trackEvent:t.trackEvent,hasInteraction:!0};case Ce.l:return{...e,hasInteraction:!1};default:return e}};const en=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({trace:!0,traceLimit:25})||Be.d,tn=Object(M.a)(),nn=(e,t)=>{const n=Boolean(e.chatbubble.keep_open&&t.chatbubble.active&&!tn)||Boolean(e.chatbubble.keep_open_mobile&&t.chatbubble.active&&tn);return{active:n,wasActiveOnLoad:n}},rn=function(){let{url:e,...t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e||"").startsWith("data:")?t:{...t,url:e}},on=e=>{if(Object(N.a)(e,"bot.includeDisabledLanguages",!1))return e;const t=Object(N.a)(e,"chatbubble.currentLanguage"),n=Object(N.a)(e,"bot.languages",[]).find(e=>{let{code:n}=e;return n===t});return Object(N.a)(n,"active",!1)?e:Ye(e,{chatbubble:{currentLanguage:null}})};var an=e=>{let{botKey:t,settings:n}=e;const{language:o,inPlatform:a}=n,i=[dt,st,lt,ut,$e];const c=`kindly-chat-${t}`,s=((e,t)=>t?()=>t=>({bot:{splitTestLabel:t.bot.splitTestLabel,splitLabelTimestamp:t.bot.splitLabelTimestamp,hasInteraction:t.bot.hasInteraction},nudge:{hasInteraction:t.nudge.hasInteraction},chatbubble:{...t.chatbubble,...nn(e,t),admin:void 0,currentlyPoppedUp:Ze.currentlyPoppedUp,allGreetingsHideInput:Ze.allGreetingsHideInput,contactDetailsButton:Ze.contactDetailsButton,attachments:Ze.attachments,shownNudges:t.chatbubble.shownNudges},connection:{token:t.connection.token,connected:!0,pusherConnected:!1},pushMessages:{dismissedMessages:t.pushMessages.dismissedMessages},agent:{names:t.agent.names,avatars:t.agent.avatars,requestedTakeover:t.agent.requestedTakeover,takenOver:t.agent.takenOver},messages:{chatMessages:t.messages.chatMessages,buttonClicks:t.messages.buttonClicks,attachments:(t.messages.attachments||[]).map(rn),messageSentTime:t.messages.messageSentTime,lastMessageSeen:t.messages.lastMessageSeen}}):(localStorage.removeItem("kindly-chat-has-shown-feedback-form"),()=>t=>({bot:{splitTestLabel:t.bot.splitTestLabel,splitLabelTimestamp:t.bot.splitLabelTimestamp,hasInteraction:t.bot.hasInteraction},nudge:{hasInteraction:t.nudge.hasInteraction},chatbubble:{...nn(e,t),previouslyPoppedUp:t.chatbubble.previouslyPoppedUp,shownNudges:t.chatbubble.shownNudges},pushMessages:{dismissedMessages:t.pushMessages.dismissedMessages},agent:{names:t.agent.names,avatars:t.agent.avatars}})))(n,n.inPlatform||0!==n.chatbubble.persist_state_lifespan_seconds),u=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(){return t.reverse().slice(1).reduce((e,t)=>t(e),t[0](...arguments))}}(on,(e=>t=>{var n,r,o;const a=(null==t||null===(n=t.messages)||void 0===n?void 0:n.chatMessages.filter(e=>e.from_bot).sort((e,t)=>Object(Ke.a)(e.created).getTime()-Object(Ke.a)(t.created).getTime()).slice(1))||[],i=null!==(r=null==a||null===(o=a[0])||void 0===o?void 0:o.chat_language_code)&&void 0!==r?r:null;return Ye(t,{chatbubble:{currentLanguage:i||e}})})(o),(e=>{let{inPlatform:t,botKey:n}=e;const r=[["chatbubble.inPlatform",t],["chatbubble.botKey",n]].filter(e=>{let[,t]=e;return void 0!==t});return We(r)})({inPlatform:a,botKey:t})),l=en(Object(Be.a)(...i),Ue()(null,{key:c,slicer:s,merge:u})),d=(e=>{let{botKey:t,settings:n,settings:{context:r,language:o,inPlatform:a,admin:i,environment:c,getAuthToken:s}}=e;return{bot:rt(n,a),chatbubble:{...Ze,botKey:t,inPlatform:a,admin:i,renderedBy:n.renderedBy||"REACT"},local:{context:r,language:o},environment:{...tt,VERSION:Xe.a,...c},auth:{getAuthToken:s}}})({botKey:t,settings:n});return Object(Be.e)(Object(Be.c)(r),d,l)},cn=()=>{const[e,t]=Object(i.useState)(!1),{conversionPageUrl:n}=Object(k.d)(A.d),r=((e,t)=>{let{enable:n=!0}=t;const[r,o]=Object(i.useState)(null);if(!n)return null;const a=setInterval(()=>{const t=document.querySelector(e);t&&(o(t),clearInterval(a))},500);return r})("#klarna-checkout-iframe",{enable:null==n?void 0:n.match(/klarna/gi)}),o=Object(i.useRef)(null),a=Object(i.useCallback)(e=>{var n;const r=e.getAttribute("src")||"",o=(e=>{try{return JSON.parse(e)}catch(e){return null}})((null===(n=decodeURIComponent(r).match(/\{"(.*)/gim))||void 0===n?void 0:n[0])||"");o&&"object"==typeof o&&["created","checkout_complete"].indexOf(o.ORDER_STATUS)>-1&&t(!0)},[]);return Object(i.useEffect)(()=>{r&&!o.current&&(a(r),o.current=setInterval(()=>a(r),500))},[r,o,a]),Object(i.useEffect)(()=>{e&&clearInterval(o.current)},[e]),e};var sn=n(31);var un=e=>{var t,n,r,o,a,i,c,s,u,l,d,f,p,h,m,g,b,v,y,w,x,O,E,k,C,_,j,T,S;return{customFont:null!==(t=null==e?void 0:e.customFont)&&void 0!==t?t:null,chatLogElements:null!==(n=null==e||null===(r=e.style)||void 0===r?void 0:r.color_chat_log_elements)&&void 0!==n?n:"#333333",background:null!==(o=null==e||null===(a=e.style)||void 0===a?void 0:a.color_background)&&void 0!==o?o:"#ffffff",bubbleButtonOutline:null!==(i=null==e||null===(c=e.style)||void 0===c?void 0:c.color_button_outline)&&void 0!==i?i:"#0069ff",buttonBackground:null!==(s=null==e||null===(u=e.style)||void 0===u?void 0:u.color_button_background)&&void 0!==s?s:"#0069ff",bubbleButtonBackground:null!==(l=null==e||null===(d=e.style)||void 0===d?void 0:d.color_bubble_button_background)&&void 0!==l?l:"#0069ff",buttonText:null!==(f=null==e||null===(p=e.style)||void 0===p?void 0:p.color_button_text)&&void 0!==f?f:"#ffffff",headerBackground:null!==(h=null==e||null===(m=e.style)||void 0===m?void 0:m.color_header_background)&&void 0!==h?h:"#0069ff",headerText:null!==(g=null==e||null===(b=e.style)||void 0===b?void 0:b.color_header_text)&&void 0!==g?g:"#ffffff",inputBackground:null!==(v=null==e||null===(y=e.style)||void 0===y?void 0:y.color_input_background)&&void 0!==v?v:"#ffffff",inputText:null!==(w=null==e||null===(x=e.style)||void 0===x?void 0:x.color_input_text)&&void 0!==w?w:"#333333",userMessageBackground:null!==(O=null==e||null===(E=e.style)||void 0===E?void 0:E.color_user_message_background)&&void 0!==O?O:"#f5f5f5",userMessageText:null!==(k=null==e||null===(C=e.style)||void 0===C?void 0:C.color_user_message_text_color)&&void 0!==k?k:"#2c2c2c",botMessageBackground:null!==(_=null==e||null===(j=e.style)||void 0===j?void 0:j.color_bot_message_background)&&void 0!==_?_:"#f5f5f5",botMessageText:null!==(T=null==e||null===(S=e.style)||void 0===S?void 0:S.color_bot_message_text_color)&&void 0!==T?T:"#2c2c2c"}};const ln=e=>{let{settings:t}=e;const n=Object(k.c)(),{inPlatform:r}=Object(k.d)(A.e),{canShow:o}=function(){const{splitTestEnabled:e,splitTestLabel:t,splitLabelTimestamp:n}=Object(k.d)(A.d),r=Object(k.c)(),o=Object(i.useCallback)(()=>{r(Object(I.nb)())},[r]),a=Object(De.a)(o,2500);return Object(i.useEffect)(()=>{function t(){a()}return e&&window.addEventListener("mousemove",t),()=>e?window.removeEventListener("mousemove",t):void 0},[e]),Object(i.useEffect)(()=>{n&&Le(n)&&r(Object(I.f)())},[n,r]),Object(i.useEffect)(()=>{let n=t||X.n.NO_SPLIT_LABEL;e&&!t&&(n=Math.random()>.5?X.n.SPLIT_A:X.n.SPLIT_B),t||r(Object(I.U)(n))},[e,t,r]),{canShow:e&&["A","X"].indexOf(t)>-1||!e,splitTestLabel:t}}();return(()=>{const e=Object(k.c)(),[t,n]=Object(i.useState)("/"),{conversionPageUrl:r,splitTestLabel:o,hasInteraction:a,splitTestEnabled:c}=Object(k.d)(A.d),s=cn(),u=Object(i.useCallback)(()=>{if(!Le(localStorage.getItem("kindly-last-conversion-timestamp")))return;const t=c&&o,n=!a;localStorage.setItem("kindly-last-conversion-timestamp",Number(new Date)),e(Object(I.jb)(t,n)),e(Object(I.f)())},[e,o,a,c]);Object(i.useEffect)(()=>{s&&u()},[u,s]),Object(i.useEffect)(()=>{n(window.location.href),null!=r&&r.trim()&&Object(we.a)(t,r)&&u()},[u,t,r])})(),Object(i.useEffect)(()=>{o&&t.chatbubble.autopopup&&!Object(M.a)()&&!r&&setTimeout(()=>n(Object(I.b)()),t.chatbubble.autopopup_time)},[n,r,t,o]),o?c.a.createElement(Re,{chatSettings:t,hidden:t.bubbleHidden,onNudgeDismiss:t.onNudgeDismiss,onNudgeFormSubmit:t.onNudgeFormSubmit,onNudgeProductClick:t.onNudgeProductClick}):null};let dn=!1;const fn=Object(i.forwardRef)((e,t)=>{let{botKey:r,settings:o}=e;const a=an({botKey:r,settings:o});return Object(i.useImperativeHandle)(t,()=>({openChat(){a.dispatch(Object(I.E)())},closeChat(){a.dispatch(Object(I.h)())},triggerDialogue(e,t){a.dispatch(Object(I.lb)(e,t))},showNudge(e){let{nudgeLayout:t,slug:n,trackEvent:r=!0}=e;a.dispatch(Object(I.Y)({nudgeLayout:t,slug:n,trackEvent:r}))},showCustomNudge(e){let{content:t,slug:n,onRendered:r,trackEvent:o=!0}=e;a.dispatch(Object(I.W)({content:t,slug:n,onRendered:r,trackEvent:o}))},closeNudge(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];a.dispatch(Object(I.t)(e,t,n))},nudgeCompletion(e){sessionStorage.getItem("kindly-nudge-completion")||(a.dispatch(Object(sn.e)({slug:e,eventType:Ce.W})),a.dispatch({type:Ce.x,slug:e}),sessionStorage.setItem("kindly-nudge-completion",!0))},closeFeedback(){a.dispatch(Object(I.i)())},triggerCtaEvent(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a.dispatch(Object(sn.f)(e))},identifyUser(e){a.dispatch(Object(I.y)(e))},setNewContext(e){a.dispatch(Object(I.T)(e))},cancelHandover(){a.dispatch(Object(I.d)())}})),Object(i.useEffect)(()=>{Object(_.b)(o)},[o]),Object(i.useEffect)(()=>{const{persistStateLifespan:e,heartbeatEnabled:t}=a.getState().bot;if(t)return;if(-1===e||e>0)return;let n=!1;const o=()=>{n||(n=!0,a.dispatch(Object(I.ob)(r)))};window.onbeforeunload=o,window.onunload=o},[r,o,a]),Object(i.useEffect)(()=>{!dn&&o.track_utm&&(dn=!0,Promise.resolve().then(n.bind(null,227)).then(e=>{let{default:t}=e;const n=t();n&&a.dispatch(Object(I.T)({...n}))}))},[o,a]),window.Cypress&&(window.store=a),c.a.createElement(k.a,{store:a},c.a.createElement(C.a,{theme:un(o)},c.a.createElement(j.a,{errorPoint:"inside ChatContainer",displayError:!1},o.user_idle_timeout_seconds>0?c.a.createElement(E,{onIdle:()=>a.dispatch(Object(I.D)()),onActive:()=>a.dispatch(Object(I.C)(o.id)),timeout:1e3*o.user_idle_timeout_seconds},c.a.createElement(ln,{settings:o})):c.a.createElement(ln,{settings:o}))))});fn.displayName="ChatContainer";var pn=fn,hn=n(54),mn=n.n(hn),gn=n(49);var bn=(e,t)=>{const[n,r]=Object(i.useState)(t||{}),o=Object(i.useCallback)(async()=>{try{var n;const o=await async function(e,t){const n=Object(gn.b)();return Ee(()=>mn.a.get(`${e}/settings/${t}.json`,{params:{version:Xe.a,[gn.a]:n}}),{retries:3,interval:2e3,intervalBackoffMultiplier:1})}((null===(n=t.environment)||void 0===n?void 0:n.SETTINGS_HOST)||"https://chat.kindlycdn.com",e),{welcome_page:a,feedback_form:i,maintenance_alert:c,notifications:s,settings:u,...l}=o.data,d={...l,...u,...s,feedbackForm:i,welcomePage:a,maintenanceAlert:c};r(e=>Ye(Ye(d,e),t))}catch(e){var o,a;const t=null!==(o=e.response)&&void 0!==o&&null!==(a=o.data)&&void 0!==a&&a.error?e.response.data.error:e;console.error("Kindly chat failed to initialize.",t)}},[e,t]);return Object(i.useEffect)(()=>{o()},[o]),n};var vn=e=>{var t;let{botKey:n,setKindlyChatRef:r,options:o=null}=e;const a=bn(n,o);if(!a.id)return null;const i=[((null===(t=o.environment)||void 0===t?void 0:t.KINDLY_CHAT_URL)||"http://localhost:8081").match("^https?://(([^:/?#]*)(?::([0-9]+))?)")[2],"*.kindly.ai","demokind.ly","*.demokind.ly",...a.chatbubble.domains];return a.chatbubble.inPlatform||d(window.location.hostname,i)?c.a.createElement(pn,{ref:r,botKey:n,settings:a}):(console.error(`Domain ${window.location.hostname} is not allowed to load Kindly Chat. Please check your bot settings if you think this is a mistake.`),null)};t.default=e=>{let{botKey:t,setKindlyChatRef:n,options:r}=e;return c.a.createElement(i.Suspense,{fallback:""},c.a.createElement(vn,{botKey:t,setKindlyChatRef:n,options:r}))}},function(e,t,n){"use strict";n.d(t,"a",(function(){return u}));var r=n(23),o=n(15),a={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},i=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,c=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,s=/^([+-])(\d{2})(?::?(\d{2}))?$/;function u(e,t){Object(o.a)(1,arguments);var n=t||{},a=null==n.additionalDigits?2:Object(r.a)(n.additionalDigits);if(2!==a&&1!==a&&0!==a)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var i,c=l(e);if(c.date){var s=d(c.date,a);i=f(s.restDateString,s.year)}if(isNaN(i)||!i)return new Date(NaN);var u,p=i.getTime(),m=0;if(c.time&&(m=h(c.time),isNaN(m)||null===m))return new Date(NaN);if(!c.timezone){var b=new Date(p+m),v=new Date(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds(),b.getUTCMilliseconds());return v.setFullYear(b.getUTCFullYear()),v}return u=g(c.timezone),isNaN(u)?new Date(NaN):new Date(p+m+u)}function l(e){var t,n={},r=e.split(a.dateTimeDelimiter);if(r.length>2)return n;if(/:/.test(r[0])?(n.date=null,t=r[0]):(n.date=r[0],t=r[1],a.timeZoneDelimiter.test(n.date)&&(n.date=e.split(a.timeZoneDelimiter)[0],t=e.substr(n.date.length,e.length))),t){var o=a.timezone.exec(t);o?(n.time=t.replace(o[1],""),n.timezone=o[1]):n.time=t}return n}function d(e,t){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),r=e.match(n);if(!r)return{year:null};var o=r[1]&&parseInt(r[1]),a=r[2]&&parseInt(r[2]);return{year:null==a?o:100*a,restDateString:e.slice((r[1]||r[2]).length)}}function f(e,t){if(null===t)return null;var n=e.match(i);if(!n)return null;var r=!!n[4],o=p(n[1]),a=p(n[2])-1,c=p(n[3]),s=p(n[4]),u=p(n[5])-1;if(r)return function(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}(0,s,u)?function(e,t,n){var r=new Date(0);r.setUTCFullYear(e,0,4);var o=r.getUTCDay()||7,a=7*(t-1)+n+1-o;return r.setUTCDate(r.getUTCDate()+a),r}(t,s,u):new Date(NaN);var l=new Date(0);return function(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(b[t]||(v(e)?29:28))}(t,a,c)&&function(e,t){return t>=1&&t<=(v(e)?366:365)}(t,o)?(l.setUTCFullYear(t,a,Math.max(o,c)),l):new Date(NaN)}function p(e){return e?parseInt(e):1}function h(e){var t=e.match(c);if(!t)return null;var n=m(t[1]),r=m(t[2]),o=m(t[3]);return function(e,t,n){if(24===e)return 0===t&&0===n;return n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}(n,r,o)?36e5*n+6e4*r+1e3*o:NaN}function m(e){return e&&parseFloat(e.replace(",","."))||0}function g(e){if("Z"===e)return 0;var t=e.match(s);if(!t)return 0;var n="+"===t[1]?-1:1,r=parseInt(t[2]),o=t[3]&&parseInt(t[3])||0;return function(e,t){return t>=0&&t<=59}(0,o)?n*(36e5*r+6e4*o):NaN}var b=[31,null,31,30,31,30,31,31,30,31,30,31];function v(e){return e%400==0||e%4==0&&e%100}},function(e,t,n){"use strict";n.r(t);var r=n(157),o=n.n(r),a=n(19);const i=Object.freeze(["CONTENT","SOURCE","MEDIUM","CAMPAIGN","TERM"]);t.default=()=>{const e=new o.a(window.location.search);let t=Array.from(e.entries()).reduce((e,t)=>{let[n,r]=t;return"UTM_"===n.toUpperCase().substring(0,4)&&Object(a.a)(n.toUpperCase().substring(4),i)?{...e,[n]:r}:e},null);if(t)window.sessionStorage.setItem("kindly-chat-utm",JSON.stringify(t));else{const e=window.sessionStorage.getItem("kindly-chat-utm");t=e?JSON.parse(e):null}return t}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),a=n(0),i=n.n(a),c=n(3),s=n(1),u=n(22),l=n(7);const d=Object(s.b)(["bottom:",";right:",";@media ","{right:0;}max-height:730px;"],e=>e.position.bottom,e=>e.position.right,l.b.maxPhone),f=Object(s.b)(["bottom:0px;right:0px;top:0px;width:100%;"]),p=s.c.div.withConfig({displayName:"KindlyChatstyles__ChatContainer",componentId:"sc-1y4lzsi-0"})(["position:fixed;font-size:16px;text-align:initial;line-height:18px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;z-index:",";font-family:",";"," *{box-sizing:border-box;",";}@media (max-width:768px){display:flex;width:100%;max-height:unset;align-items:center;justify-content:center;",";}"],e=>e.zIndex+5,e=>{let{theme:t}=e;return t.customFont?t.customFont:u.a.default},e=>e.fullscreen?f:d,e=>{let{theme:t}=e;return t.customFont&&`font-family: ${t.customFont}`},e=>{let{active:t}=e;return t&&"height: 100%;\n bottom: 0;\n right: 0;\n left: 0;\n top: 0"});var h=n(10),m=n(14);const g=s.c.button.withConfig({displayName:"styles__CloseIconButton",componentId:"sc-96uqai-0"})(["position:absolute;z-index:",";top:24px;right:24px;background:none;border:none;cursor:pointer;",""],e=>e.zIndex+10,m.b),b=s.c.div.withConfig({displayName:"styles__LightBox",componentId:"sc-96uqai-1"})(["position:fixed;background:rgba(0,0,0,0.5);top:0;right:0;bottom:0;left:0;z-index:",";display:flex;align-items:center;justify-content:center;"],e=>e.zIndex+9),v=s.c.img.withConfig({displayName:"styles__LightBoxImage",componentId:"sc-96uqai-2"})(["width:auto;max-width:100%;max-height:100%;margin:auto;padding:24px;"]);var y=n(5),w=n(6),x=n(11);const O=Object(s.d)(["0%{visibility:visible;opacity:0;}1%{opacity:0;transform:translateY(20px);}100%{opacity:1;transform:translateY(0);}"]),E=Object(s.b)(["",";animation-name:",";"],Object(x.a)(),O),k=Object(s.d)(["0%{opacity:1;transform:translateY(0px);}99%{opacity:0;transform:translateY(20px);}100%{opacity:0;visibility:hidden;}"]),C=Object(s.b)(["",";animation-name:",";"],Object(x.a)(),k),_=Object(s.b)(["",";right:unset;bottom:unset;transition:width 300ms ease 0ms,height 300ms ease 0ms;"],e=>e.chatHasStarted?"width: 100%;\n height: 100%;\n ":"width: 90%;\n height: 95%;\n border-radius: 6px;"),j=Object(s.b)(["max-height:",";height:",";width:",";"],e=>e.fullscreen?"100%":"645px",e=>e.fullscreen?"100%":"645px",e=>e.fullscreen?"100%":"360px"),T=Object(s.b)(["bottom:85px;right:10px;border-radius:6px;@media (max-height:","){min-height:380px;height:calc(100vh - ",");}"],"950px",e=>e.offsetHeight),S=Object(s.b)(["bottom:0px;right:0px;border-radius:0px;"]),I=Object(s.b)([""," "," ",""],e=>e.fullscreen?S:T,e=>e.active?j:Object(x.h)(),e=>!e.fullscreen&&(e=>e.active?E:C)(e)),A=Object(s.b)(["right:369px;display:flex;flex-direction:column;justify-content:flex-start;z-index:19;border-radius:6px 0 0 6px;background:#ffffff;background-color:#ffffff;>:last-child{margin:auto 20px 20px;}"]),N=s.c.div.withConfig({displayName:"styles__ChatBoxContainer",componentId:"sc-1usve4j-0"})(["position:absolute;z-index:20;overflow:hidden;flex-direction:column;box-shadow:0 5px 45px ",";display:",";@media ","{",";","}@media ","{visibility:",";",";}"],l.a.shadowColor,e=>e.hide?"none":"flex",l.b.minTablet,I,e=>{let{inspectorContainer:t}=e;return t&&A},l.b.maxTablet,e=>e.active?"visible":"hidden",_);var P=n(12);const M=s.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1iatydl-0"})(["margin:20px;"]),R=s.c.hr.withConfig({displayName:"styles__Separator",componentId:"sc-1iatydl-1"})(["border-top:1px solid rgb(243,243,244);width:100%;margin:0;"]),L=s.c.button.withConfig({displayName:"styles__Navigation",componentId:"sc-1iatydl-2"})(["text-align:center;margin:5px 5px 0 5px;background:rgb(243,243,244);border:1px solid rgb(243,243,244);font-weight:600;padding:7px 16px;border-radius:5px;cursor:pointer;outline:none;&:hover{background:rgb(230,230,230);}&:disabled{background:white;color:rgb(206,206,206);border-color:rgb(206,206,206);cursor:default;}"]),D=s.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-1iatydl-3"})(["display:flex;align-items:baseline;font-size:13px;",""],e=>{let{spaceBetween:t}=e;return t?"justify-content: space-between;":""}),B=s.c.div.withConfig({displayName:"styles__Slot",componentId:"sc-1iatydl-4"})(["padding:1px 3px;border-radius:3px;font-size:12px;margin-right:5px;background:rgba(255,74,156,0.25);"]),z=s.c.span.withConfig({displayName:"styles__Dot",componentId:"sc-1iatydl-5"})(["height:7px;width:7px;background:rgb(255,172,74);border-radius:50%;margin-right:5px;bottom:1px;position:relative;"]),U=s.c.span.withConfig({displayName:"styles__Corrected",componentId:"sc-1iatydl-6"})(["border-bottom:1px dotted red;"]),H=s.c.span.withConfig({displayName:"styles__Arrow",componentId:"sc-1iatydl-7"})(["margin:0 5px;color:gray;"]),F=s.c.div.withConfig({displayName:"styles__Label",componentId:"sc-1iatydl-8"})(["padding:1px 6px;border-radius:3px;border:1px solid lightgray;text-transform:uppercase;font-size:12px;margin:0 5px 3px 5px;white-space:nowrap;",""],e=>{let{filled:t}=e;return t?"background: rgb(0, 105, 255); color: white;":""}),$=s.c.a.withConfig({displayName:"styles__Link",componentId:"sc-1iatydl-9"})(["text-decoration:none;color:initial;cursor:pointer;&:hover{color:rgb(0,105,255);}"]),q=()=>{};var G=()=>i.a.createElement(i.a.Fragment,null,i.a.createElement(M,null,i.a.createElement(P.d,null,"No messages yet!")),i.a.createElement(D,{spaceBetween:!0},i.a.createElement(L,{disabled:!0,onClick:q},"Show previous"),i.a.createElement(L,{disabled:!0,onClick:q},"Show next"))),Y=(n(53),n(19));const{SAMPLE_MATCH:V,KEYWORD_EXACT_MATCH:W,KEYWORD_MENTION:K,PATTERN_MATCH:X,ZODIAC:J}=y.f,Q=e=>(null!=e?e:"").toLowerCase().replace(/[-_]/g," ");var Z=e=>{let{handler:t,score:n,exchangeType:r,sender:o,fromWebhook:a,label:c}=e;return"string"==typeof c?i.a.createElement(F,null,c):Object(Y.a)(t,[V,J])&&n?i.a.createElement(F,{filled:!0,title:"Confidence score"},`${Math.round(100*n)} %`):Object(Y.a)(t,Object.values(y.f))?i.a.createElement(F,null,(e=>{switch(e){case V:case J:return"sample";case X:return"pattern";case W:case K:return"keyword";default:return Q(e)}})(t)):a?i.a.createElement(F,null,"webhook"):"string"==typeof r?i.a.createElement(F,null,Q(r)):Object(Y.a)(o,Object.values(y.l))?i.a.createElement(F,null,Q(o)):null};n(52);const ee=e=>{let{botId:t,exchangeType:n,exchangeId:r}=e;if(!t||!n||!r)return null;return`/bot/${t}/build/${("usersays"===n?"dialogue":n).replace("_","-")}/${r}`};var te=e=>{let{children:t,url:n}=e;return n?i.a.createElement($,{target:"_blank",rel:"noopener noreferrer",href:n},t):t};var ne=e=>{let{botId:t,exchangeType:n,exchangeId:r,children:o}=e;const a=ee({botId:t,exchangeType:n,exchangeId:r});return i.a.createElement(te,{url:a},i.a.createElement(D,null,o))};const re=(e,t)=>`${(e||"").slice(0,t)}${(null==e?void 0:e.length)>t?"...":""}`;var oe=e=>{let{fromBot:t,fromWebhook:n,handler:r,score:o,title:a,message:c,exchangeType:s,exchangeId:u,botId:l,isFollowup:d,sender:f}=e;return i.a.createElement(M,null,i.a.createElement(P.d,null,"Message info"),t&&i.a.createElement(D,{spaceBetween:!0},a&&i.a.createElement(ne,{botId:l,exchangeType:s,exchangeId:u},i.a.createElement(z,null),i.a.createElement("span",null,re(a,40))),!a&&i.a.createElement("span",null,re(c,40)),i.a.createElement(D,null,i.a.createElement(Z,{handler:r,score:o,exchangeType:s,exchangeId:u,sender:f,fromWebhook:n}),d&&i.a.createElement(Z,{exchangeType:"followup"}))),!t&&i.a.createElement(D,{spaceBetween:!0},re(c,40),i.a.createElement(Z,{label:"user"})))};var ae=e=>{let{patternContextMatch:t}=e;const[n,r]=Object.entries(t)[0];return i.a.createElement(M,null,i.a.createElement(P.d,null,"Slot / Pattern context"),i.a.createElement(D,null,i.a.createElement(B,null,n),i.a.createElement("span",null,r)))};n(110);var ie=e=>{let{replyCandidates:t,botId:n}=e;const r=Object(a.useMemo)(()=>t.filter(e=>{let{selected:t,samle:n,title:r}=e;return!t&&(n||r)}),[t]);return 0===(null==r?void 0:r.length)?null:i.a.createElement(M,null,i.a.createElement(P.d,null,"Potential dialogues"),r.map(e=>{let{_id:t,score:r,sample:o,title:a,dialogue_id:c}=e;return i.a.createElement(te,{key:`reply-candidate-${t}`,url:ee({botId:n,exchangeType:"usersays",exchangeId:c})},i.a.createElement(D,null,i.a.createElement(Z,{handler:y.f.SAMPLE_MATCH,score:r}),i.a.createElement(z,null),i.a.createElement("span",null,o||a)))}))};var ce=e=>{let{correctedMessage:t,message:n}=e;return i.a.createElement(M,null,i.a.createElement(P.d,null,"Spelling correction / Greeting removed"),i.a.createElement(D,null,i.a.createElement(U,null,n),i.a.createElement(H,null,"→"),i.a.createElement("span",null,t)))};var se=e=>{let{chatMessage:{message:t,score:n,title:r,handler:o,sender:a,from_bot:s,bot_id:u,from_webhook:l,reply_candidates:d,exchange_type:f,exchange_id:p,is_followup:h,corrected_message:m,pattern_context_match:g}}=e;const{admin:b}=Object(c.d)(w.e),v=Object.keys(g||{}).length>0,y=b&&m&&m!==t;return i.a.createElement(i.a.Fragment,null,i.a.createElement(oe,{handler:o,fromBot:s,fromWebhook:l,score:n,title:r,message:t,exchangeType:f,exchangeId:p,botId:u,isFollowup:h,sender:a}),i.a.createElement(R,null),v&&i.a.createElement(i.a.Fragment,null,i.a.createElement(ae,{patternContextMatch:g}),i.a.createElement(R,null)),y&&i.a.createElement(i.a.Fragment,null,i.a.createElement(ce,{correctedMessage:m,message:t}),i.a.createElement(R,null)),(null==d?void 0:d.length)>1&&i.a.createElement(i.a.Fragment,null,i.a.createElement(ie,{replyCandidates:d,botId:u}),i.a.createElement(R,null)))};function ue(e){const t=Object(a.useRef)();return Object(a.useEffect)(()=>{t.current=e},[e]),t.current}var le=n(8);var de=()=>{const{active:e,chatHasStarted:t}=Object(c.d)(w.e),{currentMessage:n,nextMessage:r,prevMessage:o,isFirstMessage:s,isLastMessage:u}=(()=>{var e,t;const n=Object(c.c)(),{chatMessages:r}=Object(c.d)(w.l),{currentMessageId:o}=Object(c.d)(w.i),i=o||(null===(e=r.slice(-1)[0])||void 0===e?void 0:e.id),s=r.findIndex(e=>{let{id:t}=e;return t===i}),u=Object(a.useCallback)(()=>{n(Object(le.R)(r[s+1].id))},[r,s,n]),l=Object(a.useCallback)(()=>{n(Object(le.R)(r[s-1].id))},[r,s,n]),d=null!==(t=null==r?void 0:r.length)&&void 0!==t?t:0,f=ue(d),p=0===s,h=s===d-1;return Object(a.useEffect)(()=>{d>f&&n(Object(le.R)())},[n,d,f]),{currentMessage:r[s],nextMessage:u,prevMessage:l,isFirstMessage:p,isLastMessage:h}})();return i.a.createElement(N,{chatHasStarted:t,active:e,"aria-hidden":e?"false":"true","data-testid":"chat-box-inspector","data-cy":"chat-box-inspector",fullscreen:0,offsetHeight:"205px",inspectorContainer:!0},n&&i.a.createElement(i.a.Fragment,null,i.a.createElement(se,{chatMessage:n}),i.a.createElement(D,{spaceBetween:!0},i.a.createElement(L,{disabled:s,onClick:o},"Show previous"),i.a.createElement(L,{disabled:u,onClick:r},"Show next"))),!n&&i.a.createElement(G,null))},fe=n(13);const pe=s.c.div.withConfig({displayName:"styles__AnnouncementContainer",componentId:"sc-xw79eu-0"})(["border-radius:0;box-shadow:1px 2px 5px 2px ",";line-height:23px;background:",";background-color:",";font-size:",";font-weight:500;transform-origin:top;display:flex;z-index:15;position:absolute;padding:0 10px;transform:",";transition:",";width:100%;top:55px;span{font-size:15px;margin-right:7px;}"],l.a.shadowColor,l.a.warningColor,l.a.warningColor,l.c.fontSizeP,e=>{let{show:t}=e;return t?"scaleY(1)":"scaleY(0)"},e=>{let{show:t}=e;return t?"transform 0.15s ease-in":"transform 0.15s ease-out"}),he=Object(s.c)(P.d).withConfig({displayName:"styles__AnnouncementText",componentId:"sc-xw79eu-1"})(["margin:5px 0;display:flex;color:#2c2c2c;font-size:inherit;font-weight:inherit;"]),me=Object(s.c)(fe.c).withConfig({displayName:"styles__AnnouncementLink",componentId:"sc-xw79eu-2"})(["color:#0063a2;"]);var ge=()=>{const{text:e,url:t,show:n}=Object(c.d)(w.c);return i.a.createElement(pe,{show:n},i.a.createElement(he,null,i.a.createElement("span",null,"!"),e),t&&i.a.createElement(me,{target:"_blank"},"url"))},be=n(20),ve=n(15);function ye(e){Object(ve.a)(1,arguments);var t=Object(be.a)(e);return t.setHours(0,0,0,0),t}function we(e){Object(ve.a)(1,arguments);var t=Object(be.a)(e);return!isNaN(t)}var xe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Oe(e){return function(t){var n=t||{},r=n.width?String(n.width):e.defaultWidth;return e.formats[r]||e.formats[e.defaultWidth]}}var Ee={date:Oe({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Oe({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Oe({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ke={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Ce(e){return function(t,n){var r,o=n||{};if("formatting"===(o.context?String(o.context):"standalone")&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,i=o.width?String(o.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{var c=e.defaultWidth,s=o.width?String(o.width):e.defaultWidth;r=e.values[s]||e.values[c]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function _e(e){return function(t,n){var r=String(t),o=n||{},a=o.width,i=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],c=r.match(i);if(!c)return null;var s,u=c[0],l=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth];return s="[object Array]"===Object.prototype.toString.call(l)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n}(l,(function(e){return e.test(u)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n}(l,(function(e){return e.test(u)})),s=e.valueCallback?e.valueCallback(s):s,{value:s=o.valueCallback?o.valueCallback(s):s,rest:r.slice(u.length)}}}var je,Te={code:"en-US",formatDistance:function(e,t,n){var r;return n=n||{},r="string"==typeof xe[e]?xe[e]:1===t?xe[e].one:xe[e].other.replace("{{count}}",t),n.addSuffix?n.comparison>0?"in "+r:r+" ago":r},formatLong:Ee,formatRelative:function(e,t,n,r){return ke[e]},localize:{ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Ce({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Ce({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:Ce({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Ce({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Ce({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(je={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e,t){var n=String(e),r=t||{},o=n.match(je.matchPattern);if(!o)return null;var a=o[0],i=n.match(je.parsePattern);if(!i)return null;var c=je.valueCallback?je.valueCallback(i[0]):i[0];return{value:c=r.valueCallback?r.valueCallback(c):c,rest:n.slice(a.length)}}),era:_e({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:_e({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:_e({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:_e({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:_e({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}},Se=n(23),Ie=n(92);function Ae(e,t){Object(ve.a)(2,arguments);var n=Object(Se.a)(t);return Object(Ie.a)(e,-n)}function Ne(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var Pe={y:function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return Ne("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):Ne(n+1,2)},d:function(e,t){return Ne(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.toUpperCase();case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return Ne(e.getUTCHours()%12||12,t.length)},H:function(e,t){return Ne(e.getUTCHours(),t.length)},m:function(e,t){return Ne(e.getUTCMinutes(),t.length)},s:function(e,t){return Ne(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length,r=e.getUTCMilliseconds();return Ne(Math.floor(r*Math.pow(10,n-3)),t.length)}};function Me(e){Object(ve.a)(1,arguments);var t=1,n=Object(be.a)(e),r=n.getUTCDay(),o=(r<t?7:0)+r-t;return n.setUTCDate(n.getUTCDate()-o),n.setUTCHours(0,0,0,0),n}function Re(e){Object(ve.a)(1,arguments);var t=Object(be.a)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=Me(r),a=new Date(0);a.setUTCFullYear(n,0,4),a.setUTCHours(0,0,0,0);var i=Me(a);return t.getTime()>=o.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Le(e){Object(ve.a)(1,arguments);var t=Re(e),n=new Date(0);n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0);var r=Me(n);return r}function De(e,t){Object(ve.a)(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.weekStartsOn,a=null==o?0:Object(Se.a)(o),i=null==n.weekStartsOn?a:Object(Se.a)(n.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var c=Object(be.a)(e),s=c.getUTCDay(),u=(s<i?7:0)+s-i;return c.setUTCDate(c.getUTCDate()-u),c.setUTCHours(0,0,0,0),c}function Be(e,t){Object(ve.a)(1,arguments);var n=Object(be.a)(e,t),r=n.getUTCFullYear(),o=t||{},a=o.locale,i=a&&a.options&&a.options.firstWeekContainsDate,c=null==i?1:Object(Se.a)(i),s=null==o.firstWeekContainsDate?c:Object(Se.a)(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=new Date(0);u.setUTCFullYear(r+1,0,s),u.setUTCHours(0,0,0,0);var l=De(u,t),d=new Date(0);d.setUTCFullYear(r,0,s),d.setUTCHours(0,0,0,0);var f=De(d,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function ze(e,t){Object(ve.a)(1,arguments);var n=t||{},r=n.locale,o=r&&r.options&&r.options.firstWeekContainsDate,a=null==o?1:Object(Se.a)(o),i=null==n.firstWeekContainsDate?a:Object(Se.a)(n.firstWeekContainsDate),c=Be(e,t),s=new Date(0);s.setUTCFullYear(c,0,i),s.setUTCHours(0,0,0,0);var u=De(s,t);return u}var Ue="midnight",He="noon",Fe="morning",$e="afternoon",qe="evening",Ge="night";function Ye(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),a=r%60;if(0===a)return n+String(o);var i=t||"";return n+String(o)+i+Ne(a,2)}function Ve(e,t){return e%60==0?(e>0?"-":"+")+Ne(Math.abs(e)/60,2):We(e,t)}function We(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+Ne(Math.floor(o/60),2)+n+Ne(o%60,2)}var Ke={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),o=r>0?r:1-r;return n.ordinalNumber(o,{unit:"year"})}return Pe.y(e,t)},Y:function(e,t,n,r){var o=Be(e,r),a=o>0?o:1-o;return"YY"===t?Ne(a%100,2):"Yo"===t?n.ordinalNumber(a,{unit:"year"}):Ne(a,t.length)},R:function(e,t){return Ne(Re(e),t.length)},u:function(e,t){return Ne(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ne(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ne(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return Pe.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return Ne(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=function(e,t){Object(ve.a)(1,arguments);var n=Object(be.a)(e),r=De(n,t).getTime()-ze(n,t).getTime();return Math.round(r/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):Ne(o,t.length)},I:function(e,t,n){var r=function(e){Object(ve.a)(1,arguments);var t=Object(be.a)(e),n=Me(t).getTime()-Le(t).getTime();return Math.round(n/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):Ne(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):Pe.d(e,t)},D:function(e,t,n){var r=function(e){Object(ve.a)(1,arguments);var t=Object(be.a)(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime(),o=n-r;return Math.floor(o/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):Ne(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return Ne(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});case"eeee":default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),a=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return Ne(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});case"cccc":default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return Ne(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?He:0===o?Ue:o/12>=1?"pm":"am",t){case"b":case"bb":case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?qe:o>=12?$e:o>=4?Fe:Ge,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Pe.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):Pe.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ne(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):Ne(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):Pe.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):Pe.s(e,t)},S:function(e,t){return Pe.S(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return Ve(o);case"XXXX":case"XX":return We(o);case"XXXXX":case"XXX":default:return We(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return Ve(o);case"xxxx":case"xx":return We(o);case"xxxxx":case"xxx":default:return We(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Ye(o,":");case"OOOO":default:return"GMT"+We(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Ye(o,":");case"zzzz":default:return"GMT"+We(o,":")}},t:function(e,t,n,r){var o=r._originalDate||e;return Ne(Math.floor(o.getTime()/1e3),t.length)},T:function(e,t,n,r){return Ne((r._originalDate||e).getTime(),t.length)}};function Xe(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}}function Je(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}}var Qe={p:Je,P:function(e,t){var n,r=e.match(/(P+)(p+)?/),o=r[1],a=r[2];if(!a)return Xe(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;case"PPPP":default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",Xe(o,t)).replace("{{time}}",Je(a,t))}};function Ze(e){return e.getTime()%6e4}function et(e){var t=new Date(e.getTime()),n=Math.ceil(t.getTimezoneOffset());return t.setSeconds(0,0),6e4*n+(n>0?(6e4+Ze(t))%6e4:Ze(t))}var tt=["D","DD"],nt=["YY","YYYY"];function rt(e){return-1!==tt.indexOf(e)}function ot(e){return-1!==nt.indexOf(e)}function at(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var it=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ct=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,st=/^'([^]*?)'?$/,ut=/''/g,lt=/[a-zA-Z]/;function dt(e,t,n){Object(ve.a)(2,arguments);var r=String(t),o=n||{},a=o.locale||Te,i=a.options&&a.options.firstWeekContainsDate,c=null==i?1:Object(Se.a)(i),s=null==o.firstWeekContainsDate?c:Object(Se.a)(o.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=a.options&&a.options.weekStartsOn,l=null==u?0:Object(Se.a)(u),d=null==o.weekStartsOn?l:Object(Se.a)(o.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!a.localize)throw new RangeError("locale must contain localize property");if(!a.formatLong)throw new RangeError("locale must contain formatLong property");var f=Object(be.a)(e);if(!we(f))throw new RangeError("Invalid time value");var p=et(f),h=Ae(f,p),m={firstWeekContainsDate:s,weekStartsOn:d,locale:a,_originalDate:f},g=r.match(ct).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,Qe[t])(e,a.formatLong,m):e})).join("").match(it).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return ft(n);var i=Ke[r];if(i)return!o.useAdditionalWeekYearTokens&&ot(n)&&at(n,t,e),!o.useAdditionalDayOfYearTokens&&rt(n)&&at(n,t,e),i(h,n,a.localize,m);if(r.match(lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return g}function ft(e){return e.match(st)[1].replace(ut,"'")}var pt=n(56);function ht(e){const t=Object(pt.a)(e);return function(e,t){Object(ve.a)(2,arguments);var n=ye(e),r=ye(t);return n.getTime()===r.getTime()}(t,new Date)?dt(t,"HH:mm"):dt(t,"dd LLL")}const mt=Object(s.d)(["0%{opacity:0;transform:translateY(2px);}100%{opacity:1;transform:translateY(0);}"]),gt=Object(s.b)(["",";animation-name:",";"],Object(x.a)(300,150),mt),bt=Object(s.b)(["flex-direction:row-reverse;"]),vt=Object(s.b)(["flex-direction:row;"]),yt=Object(s.b)(["background:#e3e3e7;padding:0 30px;margin:10px -30px;position:relative;&:before{content:'';position:absolute;background:rgb(153,153,153);width:4px;height:calc(100% + 20px);left:0;z-index:1;}&:after{content:'';position:absolute;display:inline-block;width:100%;height:20px;background:#e3e3e7;top:100%;left:0;}"]),wt=s.c.div.withConfig({displayName:"styles__GroupContainer",componentId:"sc-1re4sol-0"})(["display:flex;flex:none;margin-bottom:10px;margin-top:10px;",";",";"],e=>e.fromBot?vt:bt,e=>{let{inspected:t}=e;return t&&yt}),xt=s.c.div.withConfig({displayName:"styles__MessageHeader",componentId:"sc-1re4sol-1"})(["display:flex;align-items:baseline;flex-wrap:nowrap;justify-content:flex-start;opacity:0;",";",";",";"],gt,e=>!e.fromBot&&"justify-content: flex-end; width: 100%;",e=>e.fromAgent&&"padding-left: 25px"),Ot=Object(s.c)(P.g).withConfig({displayName:"styles__MessageDate",componentId:"sc-1re4sol-2"})(["opacity:1;margin-bottom:0;color:",";",";"],e=>{let{theme:t}=e;return t.chatLogElements},e=>e.fromBot?"padding-left: 6px":"padding-right: 6px"),Et=s.c.div.withConfig({displayName:"styles__MessageGroup",componentId:"sc-1re4sol-3"})(["display:block;width:100%;"]);var kt=e=>{let{fromAgent:t,fromBot:n,created:r,children:o,inspected:a,setGroupRef:c}=e;return i.a.createElement(wt,{fromBot:n,inspected:a,ref:c},i.a.createElement(Et,null,i.a.createElement(xt,{fromAgent:t,fromBot:n},i.a.createElement(Ot,{fromBot:n},ht(r))),o))};const Ct=e=>i.a.createElement("svg",Object.assign({},e,{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"24",viewBox:"0 0 20 24"}),i.a.createElement("title",null,e.title||"File attachment"),i.a.createElement("path",{d:"M19.429 13.272L13.503 19.2c-1.554 1.556-3.821 2.164-5.945 1.595s-3.784-2.227-4.354-4.351.037-4.391 1.591-5.946l6.448-6.444c1.427-1.358 3.668-1.358 5.094 0a3.6 3.6 0 0 1 0 5.094l-5.926 5.924a1.05 1.05 0 0 1-1.486 0c-.407-.412-.407-1.074 0-1.486L13.303 9.2a1.5 1.5 0 0 0-.651-2.551 1.5 1.5 0 0 0-1.469.431l-4.388 4.386c-1.583 1.585-1.583 4.153.002 5.736s4.153 1.583 5.736-.002l5.924-5.93A6.6 6.6 0 0 0 15.498.225a6.6 6.6 0 0 0-6.377 1.709l-6.44 6.442C-.893 11.95-.894 17.744 2.68 21.319s9.369 3.575 12.943.001l5.926-5.92a1.5 1.5 0 0 0-2.12-2.12v-.008z",fill:"#7b7b7b"}));Ct.defaultProps={height:"22",width:"15"};var _t=Ct;var jt=e=>i.a.createElement("svg",Object.assign({},e,{version:"1.1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}),i.a.createElement("title",null,"Unsuccessful image upload"),i.a.createElement("g",{fill:"none",fillRule:"evenodd"},i.a.createElement("g",{transform:"translate(-1128 -635)",fill:"#7B7B7B",fillRule:"nonzero"},i.a.createElement("path",{d:"m1152 637.67v8.7867l-4-4.0133-5.3333 5.3467-5.3333-5.3333-5.3333 5.3333-4-4.0133v-6.1067c0-1.4667 1.2-2.6667 2.6667-2.6667h18.667c1.4667 0 2.6667 1.2 2.6667 2.6667zm-4 8.56 4 4.0133v6.0933c0 1.4667-1.2 2.6667-2.6667 2.6667h-18.667c-1.4667 0-2.6667-1.2-2.6667-2.6667v-8.7733l4 3.9867 5.3333-5.3333 5.3333 5.3333 5.3333-5.32z"}))));var Tt=e=>i.a.createElement("svg",Object.assign({},e,{version:"1.1",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"}),i.a.createElement("title",null,"Loading image upload"),i.a.createElement("g",{fill:"none",fillRule:"evenodd"},i.a.createElement("g",{transform:"translate(-685 -659)",fill:"#7B7B7B",fillRule:"nonzero"},i.a.createElement("g",{transform:"translate(685 659)"},i.a.createElement("path",{d:"m15.67 9.414c-0.12139-0.24299-0.36467-0.40135-0.636-0.414-0.27276-0.023426-0.53433 0.11351-0.6705 0.351l-3.2505 5.199-2.3325-2.331c-0.16117-0.15568-0.38102-0.23533-0.6045-0.219-0.22394 0.02231-0.42603 0.144-0.5505 0.3315l-3 4.5c-0.1548 0.23022-0.16988 0.52708-0.039197 0.7718 0.13068 0.24471 0.38578 0.3973 0.6632 0.39671h13.5c0.26005 0 0.50153-0.13472 0.63814-0.35599 0.13661-0.22127 0.14886-0.49752 0.032357-0.73001l-3.75-7.5z"}),i.a.createElement("path",{d:"m21 0h-18c-1.6569 0-3 1.3431-3 3v18c0 1.6569 1.3431 3 3 3h18c1.6569 0 3-1.3431 3-3v-18c0-1.6569-1.3431-3-3-3zm-18 21v-18h18v18h-18z"}),i.a.createElement("circle",{cx:"7.5",cy:"7.5",r:"1.5"})))));var St=()=>{const[e,t]=Object(a.useState)(null),[n,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{if(!e)return;const t=[],n=e.getElementsByTagName("img")||[],o=[...n].map(e=>e.complete&&e.naturalWidth?null:new Promise(n=>{t.push(n),e.addEventListener("load",n,{once:!0}),e.addEventListener("error",n,{once:!0})}));return o.length>0&&Promise.all(o).then(()=>{r(!0)}),()=>{[...n].forEach((e,n)=>{e.removeEventListener("load",t[n]),e.removeEventListener("error",t[n])})}},[e]),[t,n]};const It=Object(s.d)(["from{background-position:0%;}to{background-position:-200%;}"]),At=s.c.div.withConfig({displayName:"styles__LoadingWrapper",componentId:"sc-10p36bl-0"})(["position:absolute;left:0;width:100%;top:0;height:100%;color:black;z-index:1;display:flex;justify-content:center;align-items:center;pointer-events:none;opacity:",";transition:opacity "," ease-out;div:first-child{height:100%;width:100%;position:absolute;background:",";background-size:200% 100%;animation:1.3s linear "," infinite 0s;opacity:0.5;}div:nth-child(2){height:100%;width:100%;position:absolute;background:white;opacity:",";}div:nth-child(3){z-index:1;}"],e=>{let{finished:t}=e;return t?0:1},e=>{let{hideTransitionLength:t}=e;return`${t}s`},"\n linear-gradient(\n 90deg,\n rgba(255, 255, 255, 1) 0%,\n rgba(255, 255, 255, 0.738) 9.5%,\n rgba(255, 255, 255, 0.541) 17%,\n rgba(255, 255, 255, 0.382) 23.5%,\n rgba(255, 255, 255, 0.278) 28.3%,\n rgba(255, 255, 255, 0.194) 32.5%,\n rgba(255, 255, 255, 0.126) 36.5%,\n rgba(255, 255, 255, 0.075) 40.1%,\n rgba(255, 255, 255, 0.042) 43.1%,\n rgba(255, 255, 255, 0.021) 45.5%,\n rgba(255, 255, 255, 0.008) 46.3%,\n rgba(255, 255, 255, 0.002) 49.3%,\n rgba(255, 255, 255, 0) 50%,\n rgba(255, 255, 255, 0.002) 50.7%,\n rgba(255, 255, 255, 0.008) 53.7%,\n rgba(255, 255, 255, 0.021) 54.5%,\n rgba(255, 255, 255, 0.042) 59.9%,\n rgba(255, 255, 255, 0.075) 61.7%,\n rgba(255, 255, 255, 0.126) 63.5%,\n rgba(255, 255, 255, 0.194) 67.5%,\n rgba(255, 255, 255, 0.278) 71.7%,\n rgba(255, 255, 255, 0.382) 76.5%,\n rgba(255, 255, 255, 0.541) 83%,\n rgba(255, 255, 255, 0.738) 90.5%,\n rgba(255, 255, 255, 1) 100%\n )\n",It,e=>{let{opacity:t}=e;return t});var Nt=e=>{let{loading:t,children:n,opacity:r=.6}=e;const[o,c]=Object(a.useState)(!t);return Object(a.useEffect)(()=>{o||t||setTimeout(()=>c(!0),300)},[o,t]),o?null:i.a.createElement(At,{finished:!t,hideTransitionLength:.3,opacity:r},i.a.createElement("div",null),i.a.createElement("div",null),i.a.createElement("div",null,n))},Pt=e=>{let{styles:t={},...n}=e;return i.a.createElement("svg",Object.assign({xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"#fff"},n),i.a.createElement("path",{d:"M0 4v24h32V4zm4 20l6-14 5 8 3-4 6 10zM25 7a4 4 0 010 8 4 4 0 010-8"}))};const Mt=s.c.div.withConfig({displayName:"styles__PlaceholderContainer",componentId:"sc-12zmiuw-0"})(["&&{display:block;max-width:80%;border-radius:15px;position:relative;width:250px;height:250px;svg{position:absolute;top:calc(50% - 20px);left:calc(50% - 20px);width:40px;opacity:0.5;path{stroke:black;}}","}"],x.i),Rt=s.c.div.withConfig({displayName:"styles__CarouselContainer",componentId:"sc-12zmiuw-1"})(["position:relative;overflow:hidden;margin-left:-25px;width:calc(100% + 50px);> div{",";}"],e=>e.active&&"\n position: relative;\n width: 100000%;\n display: flex;\n "),Lt=s.c.div.withConfig({displayName:"styles__ImageWrapper",componentId:"sc-12zmiuw-2"})(["display:flex;flex-direction:column;width:","px;height:auto;position:relative;margin-right:5px;margin-top:2px;margin-bottom:2px;",";",";",";"],e=>e.imageSize,e=>{let{fromBot:t}=e;return t?"justify-content: flex-start":"justify-content: flex-end"},e=>{let{first:t,isCarousel:n}=e;return t||!n?"margin-left: 25px":""},e=>e.imageHasText&&`\n box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.1);\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 15px;\n padding-bottom: 8px;\n overflow: hidden;\n background: #FFF;\n margin-bottom: 6px;\n color: ${l.f.textColor};\n `),Dt=s.c.button.withConfig({displayName:"styles__LightBoxButton",componentId:"sc-12zmiuw-3"})(["display:",";position:absolute;top:4px;right:4px;z-index:1;width:27px;height:27px;align-items:center;justify-content:center;border-radius:50%;border:none;cursor:pointer;background:#fff;box-shadow:1px 1px 4px 0 rgba(0,0,0,0.2);opacity:0.8;"," &:hover{box-shadow:1px 1px 4px 0 rgba(0,0,0,0.3);opacity:1;}&:active{background-color:#efeeee;}> svg{position:relative;top:-1px;}"],e=>e.inView?"flex":"none",m.b),Bt=s.c.img.withConfig({displayName:"styles__Image",componentId:"sc-12zmiuw-4"})(["max-width:100%;position:relative;width:auto;max-height:350px;transition:border-width 0.15s ease;border-radius:15px;",";"," "," ",""],e=>e.imageHasText&&"\n border-radius: 0;\n ",e=>e.carousel&&`height: ${e.imageSize}px; object-fit: cover; width: ${e.imageSize}px;`,e=>e.clickable&&`\n cursor: pointer;\n &:active {\n border: 4px solid ${e.theme.background};\n border-radius: 15px;\n }\n `,m.b),zt=s.c.h5.withConfig({displayName:"styles__ImageTitle",componentId:"sc-12zmiuw-5"})(["font-weight:500;margin:8px 16px 4px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;",""],e=>"124"===e.imageSize&&"\n margin: 4px 8px;\n "),Ut=s.c.div.withConfig({displayName:"styles__ImageDescription",componentId:"sc-12zmiuw-6"})(["margin:0;margin:4px 16px 8px;font-size:14px;",""],e=>"124"===e.imageSize&&"\n margin: 4px 8px;\n "),Ht=s.c.button.withConfig({displayName:"styles__CarouselButton",componentId:"sc-12zmiuw-7"})(["position:absolute;top:50%;transform:translateY(-50%) translateZ(0px);z-index:2;background:#fff;background-color:#fff;border:none;width:30px;height:30px;display:flex;cursor:pointer;padding:4px 10px;border-radius:100px;opacity:0.8;transition:all 0.2s ease;:hover{opacity:1;}:active{background-color:#efeeee;opacity:1;}"," svg{position:relative;height:22px;","}"," ",";"],m.b,e=>{let{next:t}=e;return t?"left: 1px;":"right: 1px;"},e=>{let{next:t}=e;return t?"right: 10px;":"left: 10px;"},e=>{let{disabled:t}=e;return t&&"display: none"});var Ft=e=>{let{alt:t}=e;return i.a.createElement(Mt,{title:"Loading image..."},i.a.createElement(Pt,{alt:t}))};const $t=(e,t,n)=>{""===t||"click"!==e&&13!==e.keyCode||window.open(t,n)};var qt=e=>{let{image:t,first:n,isCarousel:r,fromBot:o,shouldAnimate:s,shouldAutoScroll:u,scrollToLatestMessage:l,scrollToBottom:d,inView:f,imageSize:p,loading:m}=e;const[g,b]=St(),v=Object(c.c)();Object(a.useEffect)(()=>{b&&u&&(!o&&d?d():l())},[o,b,u,d,l]);const y=Object(a.useCallback)(e=>{v(Object(le.F)(e))},[v]),w=Boolean(t.title||t.description),x=null!=t&&t.newTab?"_blank":"_self",O=t.description&&t.description.length>100?t.description.slice(0,100).concat("..."):t.description;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Lt,{imageHasText:w,first:n,ref:g,imageSize:p,isCarousel:r,fromBot:o},!m&&i.a.createElement(Dt,{onClick:()=>y(t.imageUrl),inView:f},i.a.createElement(h.h,null)),i.a.createElement(Nt,{loading:m},"Uploading"),i.a.createElement(Bt,{src:t.imageUrl,alt:t.altText,hidden:!b,tabIndex:""!==t.linkUrl?"0":"-1",clickable:Boolean(t.linkUrl),carousel:r,fromBot:o,shouldAnimate:s,onClick:()=>$t("click",t.linkUrl,x),onKeyDown:e=>$t(e,t.linkUrl,x),imageHasText:w,imageSize:p}),!b&&i.a.createElement(Ft,{alt:t.altText}),t.title&&i.a.createElement(zt,{imageSize:p},t.title),O&&i.a.createElement(Ut,{imageSize:p},O)))},Gt=(o.a.shape({id:o.a.string,temporaryId:o.a.string,url:o.a.string,type:o.a.string.isRequired,name:o.a.string.isRequired,file:o.a.object,sizeKb:o.a.number.isRequired,storagePath:o.a.string,status:o.a.oneOf(Object.values(y.a)),sender:o.a.oneOf(Object.values(y.l))}),function(){let{type:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(null!=e?e:"").split("/");return(null==t?void 0:t[0])===y.e.IMAGE?y.e.IMAGE:(null==t?void 0:t[1])===y.e.PDF?y.e.PDF:t.slice(-1)[0]});const Yt=e=>{let{fromUser:t,hasError:n,theme:r}=e;return n?l.a.grayColor:t?r.userMessageBackground:r.botMessageBackground},Vt=s.c.div.withConfig({displayName:"styles__FileAttachment",componentId:"sc-ftn7kp-0"})(["position:relative;text-align:center;cursor:pointer;text-transform:none;width:80%;max-width:calc(80% - 25px);border-radius:17px;font-weight:500;border:none;padding:",";font-family:",";font-size:14px;background:",";background-color:",";transition:all 0.2s ease;margin:8px 0 2px 25px;display:block;a,span{display:block;color:",";text-decoration:none;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;z-index:2;}& > svg:first-child{position:absolute;top:-7px;left:-4px;width:15px;path{opacity:",";transition:opacity 0.2 ease-out;}}& > svg:not(:first-child){width:20px;}"],e=>{let{hasError:t}=e;return t?"7px 12px 4px":"8px 12px"},u.a.default,Yt,Yt,e=>{let{fromUser:t,theme:n}=e;return t?n.userMessageText:n.botMessageText},e=>{let{$loading:t}=e;return t?.5:1}),Wt=s.c.div.withConfig({displayName:"styles__MessageAgent",componentId:"sc-ftn7kp-1"})(["width:20px;height:20px;left:-10px;bottom:5px;position:absolute;border-radius:100px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Kt=s.c.div.withConfig({displayName:"styles__IconBackground",componentId:"sc-ftn7kp-2"})(["width:175px;height:175px;position:relative;display:flex;justify-content:center;margin-bottom:4px;background:",";border-radius:15px;svg{width:24px;z-index:2;}"],l.a.grayColor),Xt=s.c.div.withConfig({displayName:"styles__AttachmentWrapper",componentId:"sc-ftn7kp-3"})(["display:flex;justify-content:",";"],e=>{let{fromUser:t}=e;return t?"flex-end":"flex-start"});var Jt=e=>{let{avatar:t}=e;const n=Object(a.useMemo)(()=>t?{backgroundImage:`url(${t})`}:{},[t]);return t?i.a.createElement(Wt,{style:n}):null};var Qt=e=>{let{attachment:t,shouldAutoScroll:n,scrollToLatestMessage:r,scrollToBottom:o,avatar:s,chatMessageStatus:u}=e;const l=t.sender===y.l.USER,d=Gt(t)===y.e.IMAGE,f=u||Object(Y.a)(t.status,[y.a.ERROR,y.a.INFECTED]),p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;const{token:n}=Object(c.d)(w.f),{PAT_HOST:r}=Object(c.d)(w.g);return e.storagePath&&e.status===y.a.CLEAN?`${r}/chatbubble/${y.j}/attachment/${e.storagePath}?token=${n}`:t||e.sender!==y.l.USER?e.url:void 0}(t,d),h=!p;Object(a.useEffect)(()=>{n&&(l?o():r())},[l,n,o,r]);const m=Object(a.useMemo)(()=>{var e;return{imageUrl:p,altText:`Image ${t.name||`from ${null!==(e=null==t?void 0:t.sender)&&void 0!==e?e:"agent"}`}`}},[t,p]);return d?i.a.createElement(Xt,{fromUser:l},i.a.createElement(Jt,{avatar:s}),!f&&!h&&i.a.createElement(qt,{image:m,fromBot:!l,isCarousel:!1,shouldAnimate:!0,shouldAutoScroll:n,scrollToLatestMessage:r,scrollToBottom:o,imageSize:"250",inView:!0,first:!1,loading:t.status===y.a.PROCESSING}),!f&&h&&i.a.createElement(Kt,{isImage:d},i.a.createElement(Tt,null),i.a.createElement(Nt,{loading:!0})),f&&i.a.createElement(Kt,null,i.a.createElement(jt,null))):i.a.createElement(Xt,{fromUser:l},i.a.createElement(Jt,{avatar:s}),i.a.createElement(Vt,{fromUser:l,$loading:h,hasError:f},i.a.createElement(_t,{height:10}),i.a.createElement(Nt,{loading:!f&&h,opacity:.35}),!f&&!h&&i.a.createElement("a",{src:p,alt:t.name,href:p,target:"_blank",rel:"noreferrer"},t.name),!f&&h&&i.a.createElement("span",null,"Uploading"),f&&i.a.createElement(jt,null)))},Zt=n(70),en=n(45),tn=n(95);const nn=e=>{let{children:t,carouselPosition:n,onTouchStart:r,onTouchMove:o,onTouchEnd:a}=e;return i.a.createElement(en.a.div,{transition:{ease:"easeInOut",duration:.3},animate:{x:n.get()},onTouchStart:r,onTouchMove:o,onTouchEnd:a},t)},rn=e=>{let{chatMessage:t,imageCarousel:n,shouldAutoScroll:r,scrollToLatestMessage:o,shouldAnimate:c}=e;const[s,u]=Object(a.useState)(0),l=Object(en.b)(0),d=y.h[t.image_carousel_size||1e3],f=Object(a.useMemo)(()=>d===y.h[800]?102:d===y.h[600]?96:30,[d]),p=e=>d===y.h[600]&&s===e-1||s===e,m=Object(a.useCallback)((e,t)=>{if(e<0||e>=t.length)return;let n=0;n=e>=t.length-1?-(e*d-f):-(e*d+5*e),u(e),l.set(n)},[d,f,l]),{handleTouchStart:g,handleTouchMove:b,handleTouchEnd:v}=Object(tn.a)({carousel:n,index:s,setIndex:m});return i.a.createElement(Rt,{active:n.length>1},i.a.createElement(nn,{carouselPosition:l,onTouchStart:g,onTouchMove:b,onTouchEnd:v},n.map((e,a)=>i.a.createElement(qt,{key:e.id||a,first:0===a,image:e,fromBot:t.from_bot,isCarousel:n.length>1,shouldAnimate:c,shouldAutoScroll:r,scrollToLatestMessage:o,inView:p(a),imageSize:d}))),i.a.createElement(Ht,{previous:!0,disabled:s<=0,"aria-label":"Go to previous image",onClick:()=>m(s-1,n)},i.a.createElement(h.a,{width:12,height:22})),i.a.createElement(Ht,{next:!0,disabled:s>=n.length-1,"aria-label":"Go to next image",onClick:()=>m(s+1,n)},i.a.createElement(h.b,{width:12,height:22})))};rn.defaultProps={altText:"No image description",thonAbove:!1};var on=rn,an=e=>{let{styles:t={},...n}=e;return i.a.createElement("svg",Object.assign({width:"21",height:"10",xmlns:"http://www.w3.org/2000/svg"},n),i.a.createElement("path",{d:"M20.32 9.78c-3.21-.03-5.3-.07-6.28-.12A264.6 264.6 0 010 8.56L11.9.47l8.42 9.32z",fill:"#0069FF",fillRule:"evenodd"}))};const cn=s.c.button.withConfig({displayName:"styles__EditButton",componentId:"sc-mhy5c2-0"})(["display:block;background:none;background-color:none;border:none;text-decoration:underline;font-weight:600;font-size:",";color:",";cursor:pointer;padding:0;",""],l.c.fontSizeP,e=>e.theme.userMessageText,m.b);var sn=e=>{let{button:t}=e;const n=Object(c.c)(),r=Object(a.useCallback)(()=>n(Object(le.hb)(t)),[t,n]);return i.a.createElement(cn,{onClick:r},t.contact_details.edit_text)},un=n(158),ln=n.n(un);const dn=["form","input"],fn=["target"],pn=["action"];var hn=e=>ln.a.sanitize(e,{ADD_ATTR:fn,FORBID_ATTR:pn,FORBID_TAGS:dn,USE_PROFILES:{svg:!1,svgFilters:!1,mathMl:!1,html:!0}});var mn=e=>i.a.createElement("div",{dangerouslySetInnerHTML:{__html:hn(e)}});const gn=Object(s.b)(["content:'';z-index:1;position:absolute;border-radius:17px;"]),bn=Object(s.b)(["svg{right:-3px;bottom:0px;transform:scaleX(-1);",";path{fill:",";}}"],gn,e=>e.theme.userMessageBackground),vn=Object(s.b)(["svg{left:-3px;bottom:0px;",";path{fill:",";}}"],gn,e=>e.theme.botMessageBackground),yn=Object(s.b)(["white-space:pre-wrap;color:",";background:",";"],e=>e.theme.userMessageText,e=>e.theme.userMessageBackground),wn=Object(s.b)(["color:",";background:",";"],e=>e.theme.botMessageText,e=>e.theme.botMessageBackground),xn=Object(s.b)(["margin-left:25px;white-space:pre-wrap;"]),On=Object(s.b)([":last-child{padding-bottom:34px;}"]),En=Object(s.b)(["position:relative;display:inline-block;max-width:80%;padding:10px 15px;margin:3px 0 2px;border:0;border-radius:17px;font-size:14px;line-height:18px;word-break:break-word;"," ",";",";",";",";",";"," p{margin:0;}"],e=>e.clickable&&"cursor: pointer;",e=>e.fromBot?wn:yn,e=>e.fromAgent&&xn,e=>e.fromBot&&!e.notLast&&vn,e=>!e.fromBot&&!e.notLast&&bn,e=>e.hasSuggestion&&On,m.b),kn=s.c.div.withConfig({displayName:"styles__MessageContainer",componentId:"sc-lv7lx6-0"})(["",""],En),Cn=s.c.a.withConfig({displayName:"styles__LinkMessageContainer",componentId:"sc-lv7lx6-1"})(["text-decoration:none;",""],En),_n=s.c.div.withConfig({displayName:"styles__MessageAgent",componentId:"sc-lv7lx6-2"})(["width:20px;height:20px;left:-35px;bottom:0;position:absolute;border-radius:100px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),jn=[y.l.WEBHOOK,y.l.AGENT],Tn=e=>{let{messageLine:t,children:n,chatMessage:r,fadeInLeft:o,fadeInRight:a,notFirst:c,notLast:s,shouldAnimate:u=!1,hasSuggestion:l=!1}=e;const{bot_id:d,exchange_id:f}=r,p=`/workspace/${d}/build/${("usersays"===r.exchange_type?"dialogue":r.exchange_type).replace("_","-")}/${f}`;return i.a.createElement(Cn,{fromBot:r.from_bot,hasSuggestion:l,fadeInLeft:o,fadeInRight:a,notFirst:c,notLast:s,shouldAnimate:u,clickable:!0,role:"link",tabIndex:"0",href:p},!s&&i.a.createElement(an,null),n||mn(t))};var Sn=e=>{let{messageLine:t,chatMessage:n,lineIndex:r,numLines:o,editContactDetailsButton:a,children:s,shouldAnimate:u=!1,hasSuggestion:l=!1}=e;const{inPlatform:d}=Object(c.d)(w.e),{isTextDirectionRtl:f}=Object(c.d)(w.d),p=f?"rtl":void 0,h=d&&n.from_bot&&n.exchange_type&&!Object(Y.a)(n.sender,jn),m=n.sender===y.l.AGENT,g=n.image_carousel&&n.thon_image_above_text||0!==r,b=r!==o-1||n.sender!==y.l.AGENT&&n.image_carousel&&!n.thon_image_above_text,v=n.from_bot;return h?i.a.createElement(Tn,{chatMessage:n,notFirst:g,notLast:b,shouldAnimate:u,messageLine:t,hasSuggestion:l},s):i.a.createElement(i.a.Fragment,null,i.a.createElement(kn,{dir:p,fromAgent:m,fromBot:v,hasSuggestion:l,notFirst:g,notLast:b,shouldAnimate:u},!b&&i.a.createElement(an,null),m&&!b&&i.a.createElement(_n,{style:{backgroundImage:`url(${n.avatar})`}}),s||(v?mn(t):t),!b&&a&&i.a.createElement(sn,{button:a})))};const In=s.c.div.withConfig({displayName:"styles__StatusMessage",componentId:"sc-gltcat-0"})(["display:flex;white-space:nowrap;font-size:12px;color:red;justify-content:flex-end;margin-bottom:2px;"]),An=s.c.div.withConfig({displayName:"styles__StatusMessageButtonWrapper",componentId:"sc-gltcat-1"})(["display:flex;"]),Nn=s.c.button.withConfig({displayName:"styles__StatusMessageButton",componentId:"sc-gltcat-2"})(["display:block;white-space:nowrap;font-size:12px;color:",";text-decoration:underline;background:none;border:none;padding:0;margin-bottom:2px;margin-left:4px;cursor:pointer;",""],l.a.darkColor,m.b);var Pn=e=>{let{chatMessage:t,attachments:n}=e;const r=Object(c.c)(),o=Boolean(t.message),s=(null==n?void 0:n.length)>0,u=Object(a.useCallback)(()=>{o&&r(Object(le.I)(t.message,t.id))},[t,r,o]),l=Object(a.useCallback)(()=>{o?r(Object(le.J)(t.message,t.id)):s&&r(Object(le.bb)())},[t,r,s,o]);return t.status>=500?i.a.createElement(In,null,s?"Upload failed":"Message not delivered"," ",i.a.createElement(An,null,!s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Nn,{onClick:u},"Try again"),i.a.createElement(Nn,{onClick:l},"Restart chat")))):429===t.status?i.a.createElement(In,null,"Too many messages, please slow down."," ",i.a.createElement(An,null,i.a.createElement(Nn,{onClick:u},"Try again"))):i.a.createElement(In,null,"An error occurred. ",i.a.createElement(Nn,{onClick:l},"Restart chat"))},Mn=n(18),Rn=n(27),Ln=n(33);const Dn=s.c.div.withConfig({displayName:"styles__AgentContainer",componentId:"sc-3baawv-0"})(["width:100%;margin:20px 0;",";"],x.d),Bn=s.c.div.withConfig({displayName:"styles__AvatarContainer",componentId:"sc-3baawv-1"})(["display:flex;justify-content:center;align-items:center;"]),zn=s.c.span.withConfig({displayName:"styles__AvatarBorder",componentId:"sc-3baawv-2"})(["height:1px;width:100%;background:",";background-color:",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Un=s.c.div.withConfig({displayName:"styles__AgentAvatar",componentId:"sc-3baawv-3"})(["width:29px;height:29px;min-width:29px;border-radius:100px;margin:0 15px;background:",";background-color:",";background-position:center center;background-repeat:no-repeat;background-size:cover;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground),Hn=s.c.p.withConfig({displayName:"styles__AgentName",componentId:"sc-3baawv-4"})(["font-size:",";margin:0;margin-top:5px;text-align:center;color:",";span{font-weight:500;}"],l.c.fontSizeSmall,e=>Object(Ln.a)(e.theme.background,l.a.grayColor,l.a.darkColor));var Fn=e=>{let{chatMessage:t}=e;const n=t.system_dialogue_message_type===y.o.END,{currentLanguage:r}=Object(c.d)(w.e),{text:o}=Object(c.d)(w.d),{defaultLanguage:s}=Object(Mn.a)(),{names:u,avatars:l}=Object(c.d)(w.a),{agent_joined_text:d,agent_left_text:f}=Object(a.useMemo)(()=>Object(Rn.a)(o,r,s),[r,s,o]),p=t.avatar||l[l.length-1],h=t.name||u[u.length-1];return i.a.createElement(Dn,null,i.a.createElement(Bn,null,i.a.createElement(zn,null),i.a.createElement(Un,{style:{backgroundImage:`url(${p})`}}),i.a.createElement(zn,null)),i.a.createElement(Hn,null,i.a.createElement("span",null,h||"An agent")," ",n?f:d))};n(62);const $n=Object(s.d)(["0%{opacity:0;transform:translateY(6px);}60%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),qn=Object(s.b)(["",";animation-name:",";"],Object(x.a)(),$n),Gn=s.c.div.withConfig({displayName:"styles__MessageBlock",componentId:"sc-zovgvh-0"})(["display:block;width:100%;"]),Yn=(s.c.div.withConfig({displayName:"styles__MessageLines",componentId:"sc-zovgvh-1"})([""]),s.c.div.withConfig({displayName:"styles__MessageContent",componentId:"sc-zovgvh-2"})(["display:flex;flex-direction:column;",";",";"],qn,e=>!e.fromBot&&"display: block;")),Vn=s.c.div.withConfig({displayName:"styles__MessageLineContainer",componentId:"sc-zovgvh-3"})(["display:flex;flex-direction:column;",";"],e=>{let{fromBot:t}=e;return t?"align-items: flex-start":"align-items: flex-end"}),Wn=Object(s.b)(["display:grid;grid-template-columns:auto auto;justify-content:flex-start;grid-gap:6px;position:relative;top:-30px;margin-bottom:-20px;margin-left:15px;"]),Kn=s.c.div.withConfig({displayName:"styles__ButtonWrapper",componentId:"sc-zovgvh-4"})(["",";",""],qn,e=>e.hasSuggestion&&Wn);var Xn=e=>{let{preface:t,message:n,chatMessage:r,numLines:o,buttonHandlers:a,buttons:c=[]}=e;return i.a.createElement(i.a.Fragment,null,i.a.createElement(Vn,{fromBot:!0},i.a.createElement(Sn,{chatMessage:r,lineIndex:0,numLines:o,hasSuggestion:!0},i.a.createElement("strong",null,t),i.a.createElement("br",null),n)),i.a.createElement(Kn,{hasSuggestion:!0},c.map((e,t)=>i.a.createElement(Zt.a,{key:`suggestion-button-${r.id}-${t}`,button:e,chatMessage:r,type:"button",handlers:a,hasSuggestion:!0}))))};const Jn="\n background: black;\n border-radius: 15px;\n",Qn=s.c.iframe.withConfig({displayName:"styles__IframeEmbed",componentId:"sc-10j1ec7-0"})(["",""],Jn),Zn=s.c.video.withConfig({displayName:"styles__HTML5Video",componentId:"sc-10j1ec7-1"})(["",""],Jn);var er=e=>{let{source:t}=e;const n=t.split(".").pop();return i.a.createElement(Zn,{width:"250",controls:!0},i.a.createElement("source",{src:t,type:`video/${n}`}),"Your browser does not support HTML5 video.")};var tr=e=>{let{source:t}=e;const n=t.match(/^(?:https?:\/\/)?(www\.)?vimeo.com\/(\d+)($|\/)/);return n?i.a.createElement(Qn,{src:`https://player.vimeo.com/video/${n[2]}?title=0&byline=0&portrait=0`,width:"250",height:"auto",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0}):null};const nr=e=>e.replace("?t=","?start=").replace("&t=","&start=");var rr=e=>{let{source:t}=e;const n=(e=>{const t=e.toLowerCase();let n=e;return Object(Y.a)("youtube.com",t)?(n=e.replace("&","?"),n=nr(n),n.split("v=")[1]):Object(Y.a)("youtu.be",t)?(n=nr(e),n.split("youtu.be/")[1]):n})(t);return i.a.createElement(Qn,{width:"250",height:"auto",src:`https://www.youtube.com/embed/${n}`,frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})};var or=e=>{let{source:t}=e;return Object(Y.a)("youtube.com",t)||Object(Y.a)("youtu.be",t)?i.a.createElement(rr,{source:t}):Object(Y.a)("vimeo.com",t)?i.a.createElement(tr,{source:t}):i.a.createElement(er,{source:t})},ar=n(88);const ir=e=>e,cr=e=>{let{button_type:t}=e;return t===y.b.edit_contact_details?"editContactDetails":"regularButtons"};var sr=e=>{var t,n;let{chatMessage:r,scrollToLatestMessage:o,scrollToBottom:s,shouldAutoScroll:u,buttonHandlers:l,messageCounter:d}=e;const f=Object(c.c)(),[p,h]=Object(a.useState)([]),{lastMessageSeen:m,attachments:g=[]}=Object(c.d)(w.l),b=r.sender?r.sender===y.l.USER:!r.from_bot;let v=[];r.message&&(v=r.from_bot?r.message.split(/\n\s*\n/).map(e=>e.trim()):[r.message]);const{regularButtons:x,editContactDetails:O}=Object(a.useMemo)(()=>Object(ar.a)(r.buttons,cr),[r.buttons]),E=Object(a.useMemo)(()=>{var e;return null==r||null===(e=r.buttons)||void 0===e?void 0:e.filter(e=>e.button_type===y.b.CHECKBOX.toLowerCase())},[r]),k=(e=>{let{root:t=null,threshold:n=1,onChange:r,skip:o=!1}=e;const[i,c]=Object(a.useState)(null),s=Object(a.useRef)(null);return Object(a.useEffect)(()=>{if(o)return;s.current&&s.current.disconnect(),s.current=new IntersectionObserver(r,{root:t,threshold:n});const{current:e}=s;return i&&e.observe(i),()=>e.disconnect()},[i,t,r,o,n]),c})({onChange:Object(a.useCallback)(e=>{let[{isIntersecting:t}]=e;!t||(null==m?void 0:m.index)>=d||f(Object(le.S)(r.id,d))},[r.id,f,m,d]),threshold:.95,skip:b}),C=Object(a.useCallback)(e=>{const t=p.find(t=>t.id===e.id);h(t?p.filter(t=>t.id!==e.id):[...p,e])},[p]),_=Object(a.useMemo)(()=>{var e,t;return[...null!==(e=r.attachments)&&void 0!==e?e:[],...(null!==(t=r.attachment_ids)&&void 0!==t?t:[]).map(e=>{return g.find((t=e,function(){let{id:e,temporaryId:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e===t||n===t}));var t}).filter(ir)]},[g,r.attachments,r.attachment_ids]),j=Boolean(r.message||(null==_?void 0:_.length)||(null===(t=r.buttons)||void 0===t?void 0:t.length)||(null===(n=r.image_carousel)||void 0===n?void 0:n.length));return r.system_dialogue_message_type===y.o.START||r.system_dialogue_message_type===y.o.END?i.a.createElement(Yn,{ref:k,fromBot:!0},i.a.createElement(Fn,{chatMessage:r})):i.a.createElement(Gn,{ref:k,"data-cy":"message-block"},i.a.createElement(Yn,{fromBot:r.from_bot},r.image_carousel&&r.thon_image_above_text&&i.a.createElement("div",null,i.a.createElement(on,{imageCarousel:r.image_carousel,chatMessage:r,thonAbove:!0,scrollToLatestMessage:o,shouldAutoScroll:u})),i.a.createElement(Vn,{fromBot:r.from_bot},v.map((e,t)=>i.a.createElement(Sn,{key:`chatMessage-${t}`,chatMessage:r,messageLine:e,lineIndex:t,numLines:v.length,editContactDetailsButton:null==O?void 0:O[0]}))),r.image_carousel&&!r.thon_image_above_text&&i.a.createElement("div",null,i.a.createElement(on,{imageCarousel:r.image_carousel,chatMessage:r,scrollToLatestMessage:o,shouldAutoScroll:u})),_.map((e,t)=>i.a.createElement("div",{key:`message-attachment-${t}`},i.a.createElement(Qt,{attachment:e,shouldAutoScroll:u,scrollToLatestMessage:o,scrollToBottom:s,avatar:r.avatar,chatMessageStatus:r.status,shouldAnimate:!0}))),r.video_source&&i.a.createElement(or,{source:r.video_source})),i.a.createElement(Kn,null,(null==x?void 0:x.length)>0&&x.map((e,t)=>i.a.createElement(Zt.a,{key:`button-${t}`,button:e,chatMessage:r,type:"button",handlers:l,checked:p,setCheckboxValue:C,checkboxButtons:E}))),((null==r?void 0:r.suggestions)||[]).map((e,t)=>{let{preface:n,message:o,buttons:a}=e;return i.a.createElement(Xn,{key:`suggestion-${r.id}-${t}`,chatMessage:r,numLines:v.length,preface:n,message:o,buttons:a})}),j&&r.status&&i.a.createElement(Pn,{chatMessage:r,attachments:_}))};var ur=e=>i.a.createElement("svg",Object.assign({},e,{viewBox:"0 0 82 82",xmlns:"http://www.w3.org/2000/svg"}),i.a.createElement("title",null,"Bot Avatar"),i.a.createElement("g",{transform:"translate(1 1)",fill:"none",fillRule:"evenodd"},i.a.createElement("circle",{stroke:"#F3F3F4",strokeWidth:"2",fill:"#FFF",cx:"40",cy:"40",r:"40"}),i.a.createElement("path",{d:"M30.64 35.4a4.27 4.27 0 11-8.54 0 4.27 4.27 0 018.54 0M50.17 35.4a4.27 4.27 0 108.54 0 4.27 4.27 0 00-8.54 0",fill:"#000"}),i.a.createElement("path",{d:"M29.42 60.83a17.42 17.42 0 0022.38 0",stroke:"#DA3CFF",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}),i.a.createElement("path",{d:"M16 29.03a12.39 12.39 0 0113.15-5.31 12.24 12.24 0 019.45 10.49v15.64h5.47M44.88 23.2H64",stroke:"#0069FF",strokeWidth:"5",strokeLinecap:"round",strokeLinejoin:"round"}))),lr=n(44);const dr=Object(s.d)(["0%{opacity:0;transform:translateY(8px);}50%{opacity:0;transform:translateY(8px);}80%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),fr=Object(s.b)(["",";animation-name:",";"],Object(x.a)(600),dr),pr=Object(s.d)(["0%{opacity:1;transform:translateY(0px);}50%{opacity:1;transform:translateY(-6px);}80%{transform:translateY(2px);}100%{opacity:0;transform:translateY(2px);}"]),hr=Object(s.b)(["",";animation-name:",";"],Object(x.a)(300),pr),mr=s.c.div.withConfig({displayName:"styles__NewMessageContainer",componentId:"sc-1n499zd-0"})(["position:absolute;z-index:3;bottom:90px;left:50%;transform:translateX(-50%);transition:opacity 300ms ease 300ms;opacity:",";"],e=>e.show?"1":"0"),gr=s.c.div.withConfig({displayName:"styles__NewMessageInner",componentId:"sc-1n499zd-1"})(["padding:8px;opacity:0;border-radius:100px;color:#2c2c2c;background:#fff;background-color:#fff;border:1px solid ",";box-shadow:0 2px 4px 0 rgba(0,0,0,0.08);cursor:pointer;display:flex;align-items:center;justify-content:",";min-width:35px;max-width:205px;width:","px;height:","px;",";",";svg{",";path{",";}}"],Object(lr.a)(.08,"#fff"),e=>e.hasUnread?"flex-start":"center",e=>e.hasUnread?"unset":"35",e=>e.hasUnread?"42":"35",e=>!e.show&&Object(x.h)(800),e=>e.show?fr:hr,e=>e.hasUnread&&"min-width: 24px",e=>!e.hasUnread&&`stroke: ${e.theme.buttonBackground}`),br=s.c.div.withConfig({displayName:"styles__StyledAvatar",componentId:"sc-1n499zd-2"})(["border-radius:100px;min-width:24px;width:24px;height:24px;background-image:url(",");background-size:contain;background-repeat:no-repeat;background-position:center;"],e=>e.avatar),vr=s.c.span.withConfig({displayName:"styles__Message",componentId:"sc-1n499zd-3"})(["color:#2c2c2c;font-size:14px;font-weight:500;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:8px;"]),yr=e=>{let{message:t}=e;const{avatar:n}=Object(c.d)(w.d),{takenOver:r,avatars:o}=Object(c.d)(w.a),a=r?o[o.length-1]:n,s=t.replace(/(<[^>]*>)| /g,"");return i.a.createElement(i.a.Fragment,null,a?i.a.createElement(br,{avatar:a}):i.a.createElement(ur,{height:24,width:24}),i.a.createElement(vr,null,s))};var wr=e=>{let{chatMessages:t,hasUnreadMessage:n,shouldAutoScroll:r,scrollToBottom:o}=e;const[c,s]=Object(a.useState)(!1),[u,l]=Object(a.useState)(!1),d=(e=>{const t=(e||[]).length,n=e[t-1];return Object(a.useMemo)(()=>t>1&&n.from_bot?n:e[t-2],[e,n,t])||{}})(t);return Object(a.useEffect)(()=>{u&&r&&l(!1)},[u,r]),Object(a.useEffect)(()=>{const e=setTimeout(()=>{r||s(!0)},600);return r&&s(!1),()=>clearTimeout(e)},[r]),i.a.createElement(mr,{show:c},i.a.createElement(gr,{hasUnread:n&&Boolean(d.message),show:c&&!u,onClick:()=>{l(!0),o()}},n&&Boolean(d.message)?i.a.createElement(yr,{message:d.message}):i.a.createElement(h.m,{width:12})))},xr=n(54),Or=n.n(xr);const Er=s.c.div.withConfig({displayName:"styles__QueueContainer",componentId:"sc-k9za8a-0"})(["left:0;right:0;z-index:15;position:absolute;background:",";background-color:",";box-shadow:0px 3px 4px -1px ",";",";"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,l.a.shadowColor,x.c),kr=s.c.div.withConfig({displayName:"styles__MessageContainer",componentId:"sc-k9za8a-1"})(["display:flex;padding:5px 18px;justify-content:space-between;align-items:center;border-top:1px solid rgba(0,0,0,0.1);"]),Cr=Object(s.c)(P.d).withConfig({displayName:"styles__QueueText",componentId:"sc-k9za8a-2"})(["margin:0;color:",";span{font-weight:600;}"],e=>e.theme.headerText),_r=Object(s.c)(fe.c).withConfig({displayName:"styles__QueueLink",componentId:"sc-k9za8a-3"})(["color:",";"],e=>e.theme.headerText),jr=Object(s.d)(["from{background-position:-180px;}to{background-position:180px;}"]),Tr=Object(s.d)(["from{background-position:180px;}to{background-position:-180px;}"]),Sr=s.c.div.withConfig({displayName:"styles__LoadingContainer",componentId:"sc-k9za8a-4"})(["position:relative;border:0;"]),Ir=s.c.span.withConfig({displayName:"styles__Loader",componentId:"sc-k9za8a-5"})(["opacity:1;height:3px;width:100%;top:3;position:absolute;background-image:linear-gradient( 90deg,rgba(255,255,255,0) 25%,"," 45%,"," 55%,rgba(255,255,255,0) 75% );animation:1.3s linear "," infinite 0s;"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,e=>{let{hasCancelled:t}=e;return t?Tr:jr});var Ar=()=>{const[e,t]=Object(a.useState)(null),[n,r]=Object(a.useState)(!1),{SAGE_HOST:o}=Object(c.d)(w.g),{currentLanguage:s}=Object(c.d)(w.e),{id:u,text:l,showTakeoverQueue:d}=Object(c.d)(w.d),{defaultLanguage:f}=Object(Mn.a)(),p=Object(c.c)(),{takeover_queue_text:h,takeover_queue_link:m,leave_queue_text:g,leave_queue_link:b}=Object(a.useMemo)(()=>Object(Rn.a)(l,s,f),[s,f,l]);return Object(a.useEffect)(()=>{d&&Or.a.get(`${o}/api/v1/stats/bot/${u}/public/current_wait_time?sources%5B%5D=web`).then(e=>{const{data:{data:{mean:n,n:r}}}=e;if(r<3)return void t(null);const o=Math.round((n/60).toFixed(2));o>1&&t(o)})},[o,u,d]),Object(a.useEffect)(()=>{const e=setTimeout(()=>{n&&p(Object(le.d)())},3e3);return n||clearTimeout(e),()=>clearTimeout(e)},[n,p]),d?i.a.createElement(Er,null,i.a.createElement(kr,{"aria-live":"polite","aria-atomic":"true","data-cy":"takeover-queue"},n?i.a.createElement(i.a.Fragment,null,i.a.createElement(Cr,null,g),i.a.createElement(_r,{onClick:()=>r(!1),"data-cy":"takeover-queue-link"},b)):i.a.createElement(i.a.Fragment,null,i.a.createElement(Cr,null,e?i.a.createElement(i.a.Fragment,null,"Estimated wait time: ",i.a.createElement("span",null,e," min")):i.a.createElement(i.a.Fragment,null,h)),i.a.createElement(_r,{onClick:()=>r(!0),"data-cy":"takeover-queue-link"},m))),i.a.createElement(Sr,null,i.a.createElement(Ir,{hasCancelled:n}))):null};const Nr=Object(s.d)(["0%{opacity:0;transform:translateY(8px);}50%{opacity:0;transform:translateY(8px);}80%{transform:translateY(-2px);}100%{opacity:1;transform:translateY(0);}"]),Pr=Object(s.b)(["",";animation-name:",";"],Object(x.a)(600),Nr),Mr=Object(s.d)(["10%{transform:translateY(-5px);}50%{opacity:0.5;transform:translateY(0);}"]),Rr=s.c.div.withConfig({displayName:"styles__TypingIndicatorContainer",componentId:"sc-1lynepx-0"})(["background:none;will-change:transform;width:auto;padding:0px;display:table;margin:8px 0px;position:relative;",""],Pr),Lr=s.c.div.withConfig({displayName:"styles__IndicatorContainer",componentId:"sc-1lynepx-1"})(["border-radius:15px;position:relative;display:inline-flex;flex-direction:row;border:0;padding:11px 9px;background:",";background-color:",";"],e=>e.theme.botMessageBackground,e=>e.theme.botMessageBackground),Dr=s.c.span.withConfig({displayName:"styles__Indicator",componentId:"sc-1lynepx-2"})(["height:5px;width:5px;margin:0 2px;background:",";background-color:",";display:block;opacity:1;border-radius:100px;&:nth-of-type(1){animation:1s "," infinite 0.3s;}&:nth-of-type(2){animation:1s "," infinite 0.6s;}&:nth-of-type(3){animation:1s "," infinite 0.9s;}"],e=>e.theme.botMessageText,e=>e.theme.botMessageText,Mr,Mr,Mr);var Br=()=>i.a.createElement(Rr,{"data-cy":"typing-indicator"},i.a.createElement(Lr,null,i.a.createElement(Dr,null),i.a.createElement(Dr,null),i.a.createElement(Dr,null)));const zr=s.c.div.withConfig({displayName:"styles__BodyContainer",componentId:"sc-1vymaz1-0"})(["width:100%;min-width:100%;overflow-y:auto;padding:0 30px;height:100%;overflow-x:hidden;background:",";background-color:",";"],e=>e.theme.background,e=>e.theme.background),Ur=s.c.div.withConfig({displayName:"styles__ChatBoxMessages",componentId:"sc-1vymaz1-1"})(["min-height:100%;display:flex;flex-direction:column;justify-content:flex-end;"]);var Hr=e=>{let{setBodyRef:t,setBottomRef:n,setTopRef:r,scrollToBottom:o,scrollToLatestMessage:s,shouldAutoScroll:u,onUserScroll:l,buttonHandlers:d,hasUnreadMessage:f,setGroupRef:p}=e;const[h,m]=Object(a.useState)(!1),{requestedTakeover:g,takeoverClosed:b,takenOver:v,isTyping:x}=Object(c.d)(w.a),{isTyping:O}=Object(c.d)(w.d),{active:E}=Object(c.d)(w.e),{currentMessageId:k,inspectorOpen:C}=Object(c.d)(w.i),{chatMessages:_}=Object(c.d)(w.l)||[],j=(e=>{let t=null,n=null,r=!1;const o=[];return e.forEach(e=>{e.from_bot===t&&e.name===n&&e.from_webhook===r&&e.handler!==y.f.TRIGGER_DIALOGUE?o[o.length-1].push(e):o.push([e]),t=e.from_bot,n=e.name,r=e.from_webhook}),o})(_);Object(a.useEffect)(()=>{E&&_.length>0?m(!0):m(!1)},[E,_.length]);let T=0;return i.a.createElement(zr,{ref:t,onScroll:l},g&&!b&&!v&&i.a.createElement(Ar,null),i.a.createElement(Ur,{role:"log","aria-live":"polite","data-cy":"chat-log"},j.map((e,t)=>{const n=C&&((e,t,n)=>{var r;const o=e||(null===(r=t.slice(-1)[0])||void 0===r?void 0:r.id);return!!n.find(e=>{let{id:t}=e;return o===t})})(k,_,j[t]);return i.a.createElement(i.a.Fragment,{key:`message-group-${t}`},i.a.createElement(kt,{fromAgent:e[0].sender===y.l.AGENT,fromBot:e[0].from_bot,created:e[0].created,inspected:n,setGroupRef:p},e.map((n,c)=>{const l=t===(null==j?void 0:j.length)-1&&c===(null==e?void 0:e.length)-1;return T+=1,i.a.createElement(a.Fragment,{key:`chat-message-${t}-${c}`},l&&i.a.createElement("div",{ref:r}),i.a.createElement(sr,{chatMessage:n,scrollToBottom:o,scrollToLatestMessage:s,shouldAutoScroll:u,buttonHandlers:d,messageCounter:T}))})))}),(x||O)&&i.a.createElement(Br,null),i.a.createElement("div",{ref:n})),h&&i.a.createElement(wr,{chatMessages:_,hasUnreadMessage:f,shouldAutoScroll:u,scrollToBottom:o}))};var Fr=e=>{let{children:t,animate:n}=e;return i.a.createElement(en.a.div,{variants:{normal:{x:0},error:{x:[0,2,-2,0]}},animate:n},t)};const $r=s.c.div.withConfig({displayName:"styles__InputLimitContainer",componentId:"sc-18r5r1u-0"})(["height:20px;display:flex;opacity:0.8;align-items:center;margin-bottom:10px;justify-content:space-between;",""],e=>!e.enabled&&`margin-bottom: 15px; height: 10px; border-bottom: 1px solid ${l.a.grayColor}`),qr=s.c.div.withConfig({displayName:"styles__FillContainer",componentId:"sc-18r5r1u-1"})(["width:",";height:1px;transition:all ease 0.3s;span{height:100%;display:block;}span:first-child{width:100%;opacity:0.3;background:",";background-color:",";}span:last-child{margin-top:-1px;width:","%;background:",";background-color:",";}"],e=>e.active?"calc(100% - 50px)":"100%",e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements},e=>e.width>100?100:e.width,e=>{let{theme:t}=e;return t.chatLogElements},e=>{let{theme:t}=e;return t.chatLogElements}),Gr=Object(s.c)(P.g).withConfig({displayName:"styles__CountContainer",componentId:"sc-18r5r1u-2"})(["margin:0;opacity:1;display:",";color:",";span{font-weight:500;}",";"],e=>e.active?"block":"none",e=>{let{theme:t}=e;return t.chatLogElements},x.e);var Yr=e=>{let{alwaysShow:t,inputMax:n,inputLength:r,shake:o}=e;const a=Math.floor(r/n*100),c=r>0,s=t||r>n;return i.a.createElement($r,{enabled:s,active:c},s&&i.a.createElement(i.a.Fragment,null,i.a.createElement(qr,{active:c,width:a},i.a.createElement("span",null),i.a.createElement("span",null)),i.a.createElement(Fr,{initial:!1,animate:o?"error":"normal"},i.a.createElement(Gr,{active:c},i.a.createElement("span",null,r),"/",n))))},Vr=n(21);const Wr=Object(Vr.a)(),Kr=-1!==navigator.userAgent.indexOf("Version/15.0");var Xr=()=>Wr&&Kr;const Jr=s.c.div.withConfig({displayName:"styles__UploadWrapper",componentId:"sc-1e637pi-0"})(["",";button{padding:0;}&:hover{opacity:0.8;}svg{margin-top:3px;path{fill:",";}}"],Object(m.a)(e=>{let{hasFiles:t}=e;return t?"0":"15px"}),e=>{let{theme:t}=e;return t.buttonBackground}),Qr=["Bytes","kB","MB","GB"],Zr=e=>new Promise((t,n)=>{const r=e.size/1024;if(r>5120)return void n(new Error(`The file must be less than ${function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(0===e)return"0 Bytes";const n=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**n).toFixed(t))} ${Qr[n]}`}(5242880)}`));const o=new FileReader;o.readAsDataURL(e),o.onload=()=>t({url:o.result,file:e,sizeKb:r,name:e.name,type:e.type,status:y.a.PROCESSING,sender:y.l.USER}),o.onabort=()=>n(new Error(o.error))});var eo=e=>{let{accept:t="image/*,text/*,.pdf",multiple:n=!0}=e;const{handoverMode:r,isTextDirectionRtl:o}=Object(c.d)(w.d),{takenOver:s}=Object(c.d)(w.a),{attachments:u}=Object(c.d)(w.e),l=Object(c.c)(),d=Object(a.useRef)(),f=Object(Vr.a)(),p=s&&r===y.g.PLATFORM,h=Object(a.useCallback)(async e=>{let{target:t}=e;try{var n;if((null===(n=t.files)||void 0===n?void 0:n.length)>5)return void l(Object(le.V)("You can upload up to 5 files at a time",3500));const e=await Promise.all(Array.from(t.files).map(Zr));l(Object(le.O)(e))}catch(e){l(Object(le.V)(e.message.replace(/^Error: ?/i,""),3500))}},[l]),m=Object(a.useCallback)(()=>{d.current&&(d.current.value="",d.current.click())},[d]);return Object(a.useEffect)(()=>{u.buttonClicked&&(l(Object(le.a)()),m())},[u.buttonClicked,l,m]),i.a.createElement(Jr,{isTextDirectionRtl:o,hasFiles:u.files.length>0},(p||f&&(null==u?void 0:u.exchangeId))&&i.a.createElement(fe.a,{onClick:e=>{e.preventDefault(),e.stopPropagation(),m()}},i.a.createElement(_t,null)),i.a.createElement("input",{ref:d,hidden:!0,type:"file",accept:t,multiple:n,onChange:h,style:{display:"none"}}))};const to=s.c.div.withConfig({displayName:"styles__Container",componentId:"sc-76oby0-0"})(["display:flex;align-items:center;font-size:15px;> div{position:relative;overflow:visible;}span{border:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-left:8px;}button{display:none;position:absolute;top:-9px;left:-8px;border:1px solid white;border-radius:50%;width:20px;height:20px;padding:0px;background:",";}"],l.a.darkColor),no=s.c.div.withConfig({displayName:"styles__AttachmentWrapper",componentId:"sc-76oby0-1"})(["height:41px;&:not(:first-child){margin-left:4px;}&:hover{button{display:block;}}"]),ro=s.c.div.withConfig({displayName:"styles__ImageWrapper",componentId:"sc-76oby0-2"})(["height:41px;display:flex;img{border-radius:8px;max-height:100%;margin-left:4px;}"]),oo=s.c.div.withConfig({displayName:"styles__IconWrapper",componentId:"sc-76oby0-3"})(["height:100%;padding:8px;border-radius:8px;background:",";"],l.a.grayColor);s.c.div.withConfig({displayName:"styles__FileType",componentId:"sc-76oby0-4"})(["font-size:14px;height:41px;padding:0 4px;background:",";border-radius:8px;display:flex;align-items:center;margin-left:4px;"],l.a.grayColor);var ao=e=>{let{file:t}=e;return Gt(t)===y.e.IMAGE?i.a.createElement(ro,null,i.a.createElement("img",{src:t.url,alt:`Uploaded image: ${t.name}`})):i.a.createElement(oo,null,i.a.createElement(_t,{height:24}))};var io=()=>{const{attachments:{files:e}}=Object(c.d)(w.e),t=Object(c.c)(),n=Object(a.useCallback)(n=>t(Object(le.O)(((e,t)=>{const n=e.slice();return n.splice(t,1),n})(e,n))),[t,e]);return i.a.createElement(to,null,e.map((e,t)=>i.a.createElement(no,{key:`uploaded-image-${e.name}-${t}`},i.a.createElement(ao,{file:e}),i.a.createElement(fe.a,{onClick:e=>{e.preventDefault(),n(t)}},i.a.createElement(h.e,{width:18,height:18,color:"#000"})))),1===(null==e?void 0:e.length)&&i.a.createElement("span",null,e[0].name))},co=n(16),so=n(42),uo=a.useLayoutEffect,lo=function(e){var t=Object(a.useRef)(e);return uo((function(){t.current=e})),t},fo=function(e,t){"function"!=typeof e?e.current=t:e(t)},po=function(e,t){var n=Object(a.useRef)();return Object(a.useCallback)((function(r){e.current=r,n.current&&fo(n.current,null),n.current=t,t&&fo(t,r)}),[t])},ho={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},mo=function(e){Object.keys(ho).forEach((function(t){e.style.setProperty(t,ho[t],"important")}))},go=null;var bo=function(){},vo=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width"],yo=!!document.documentElement.currentStyle,wo=function(e,t){var n=e.cacheMeasurements,r=e.maxRows,o=e.minRows,i=e.onChange,c=void 0===i?bo:i,s=e.onHeightChange,u=void 0===s?bo:s,l=Object(so.a)(e,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]);var d,f=void 0!==l.value,p=Object(a.useRef)(null),h=po(p,t),m=Object(a.useRef)(0),g=Object(a.useRef)(),b=function(){var e=p.current,t=n&&g.current?g.current:function(e){var t=window.getComputedStyle(e);if(null===t)return null;var n,r=(n=t,vo.reduce((function(e,t){return e[t]=n[t],e}),{})),o=r.boxSizing;return""===o?null:(yo&&"border-box"===o&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px"),{sizingStyle:r,paddingSize:parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),borderSize:parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth)})}(e);if(t){g.current=t;var a=function(e,t,n,r){void 0===n&&(n=1),void 0===r&&(r=1/0),go||((go=document.createElement("textarea")).setAttribute("tab-index","-1"),go.setAttribute("aria-hidden","true"),mo(go)),null===go.parentNode&&document.body.appendChild(go);var o=e.paddingSize,a=e.borderSize,i=e.sizingStyle,c=i.boxSizing;Object.keys(i).forEach((function(e){var t=e;go.style[t]=i[t]})),mo(go),go.value=t;var s=function(e,t){var n=e.scrollHeight;return"border-box"===t.sizingStyle.boxSizing?n+t.borderSize:n-t.paddingSize}(go,e);go.value="x";var u=go.scrollHeight-o,l=u*n;"border-box"===c&&(l=l+o+a),s=Math.max(l,s);var d=u*r;return"border-box"===c&&(d=d+o+a),[s=Math.min(d,s),u]}(t,e.value||e.placeholder||"x",o,r),i=a[0],c=a[1];m.current!==i&&(m.current=i,e.style.setProperty("height",i+"px","important"),u(i,{rowHeight:c}))}};return Object(a.useLayoutEffect)(b),d=lo(b),Object(a.useLayoutEffect)((function(){var e=function(e){d.current(e)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),Object(a.createElement)("textarea",Object(co.a)({},l,{onChange:function(e){f||b(),c(e)},ref:h}))},xo=Object(a.forwardRef)(wo);const Oo=s.c.div.withConfig({displayName:"styles__ComposerContainer",componentId:"sc-1v8m1u6-0"})(["padding:20px;padding-top:5px;background:none;background:",";background-color:",";",""],e=>e.theme.background,e=>e.theme.background,fe.d),Eo=s.c.div.withConfig({displayName:"styles__FormInner",componentId:"sc-1v8m1u6-1"})(["display:flex;align-items:center;justify-content:space-between;"]),ko=Object(s.c)(P.d).withConfig({displayName:"styles__DisabledText",componentId:"sc-1v8m1u6-2"})(["margin:8px 0 10px 10px;transition:all 0.3s ease;",";"],e=>e.hide&&"transform: translateY(-45px)"),Co=Object(s.c)(xo).withConfig({displayName:"styles__ComposerInput",componentId:"sc-1v8m1u6-3"})([""," min-height:","px;"],fe.e,e=>{let{$minHeight:t}=e;return t}),_o=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1v8m1u6-4"})(["width:40px;height:40px;display:flex;justify-content:center;align-items:center;",";"],Object(m.a)("15px")),jo=Object(s.b)(["color:#fff;z-index:10;cursor:pointer;box-shadow:none;height:100%;width:100%;padding:0;text-transform:none;display:flex;align-items:center;justify-content:center;border:none;max-width:36px;max-height:36px;background-color:transparent;"," &:hover{opacity:0.8;}svg{transition:all 0.2s ease;path{fill:",";}}"],m.b,e=>e.theme.buttonBackground),To=s.c.button.withConfig({displayName:"styles__SettingsButton",componentId:"sc-1v8m1u6-5"})(["",";transition:all 0.1s ease-in;display:",";svg{transition:all 0.2s ease;:hover{transform:rotate(30deg);}}"],jo,e=>e.active?"flex":"none"),So=s.c.button.withConfig({displayName:"styles__SubmitButton",componentId:"sc-1v8m1u6-6"})(["",";z-index:15;padding:8px;transition:opacity 0.1s ease-in;display:",";border-radius:100px;background:",";background-color:",";svg{margin-top:2px;margin-right:2px;transition:all 0.2s ease;path{fill:#fff;}}",";"],jo,e=>e.active?"flex":"none",e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>{let{disabled:t}=e;return t&&"\n cursor: default;\n opacity: 0.3;\n &:hover {\n opacity: 0.3;\n }\n "}),Io=Object(Vr.a)();let Ao;const No=e=>{let{active:t,chatHasStarted:n,onManualFocus:r,currentlyPoppedUp:o,autoFocused:s,isScrolledDown:u}=e;const l=Object(a.useRef)(),[d,f]=Object(a.useState)(41),[p,m]=Object(a.useState)(!1),[g,b]=Object(a.useState)(!1),[v,y]=Object(a.useState)(""),[x,O]=Object(a.useState)(0);Object(a.useEffect)(()=>{(t||n)&&!Io&&!o&&l.current&&!s&&l.current.focus()},[t,n,s,l,o]);const{text:E,inputLimitEnabled:k,inputLimit:C,isTextDirectionRtl:_}=Object(c.d)(w.d),{defaultLanguage:j}=Object(Mn.a)(),{hideInputField:T,currentLanguage:S,allGreetingsHideInput:I,attachments:{files:A}}=Object(c.d)(w.e),{takenOver:N,userIsTyping:P}=Object(c.d)(w.a),{connected:M}=Object(c.d)(w.f),{chatMessages:R}=Object(c.d)(w.l),{inspectorOpen:L}=Object(c.d)(w.i),D=Object(c.c)(),B=_?"rtl":void 0,z=T&&!N,U=!N&&k?C:1e3,H=!M||z||I&&0===R.length||v.length>U,{placeholder:F,disabled_input_text:$}=Object(a.useMemo)(()=>Object(Rn.a)(E,S,j),[S,j,E]),q=e=>{if(e.preventDefault(),e.stopPropagation(),P&&D(Object(le.qb)()),H)return!1;if(!v.trim()&&0===A.length)return!1;if(A.length>0)D(Object(le.K)());else{const e=(new Date).getTime();if(!(e-x>1e3))return!1;O(e),D(Object(le.cb)(v.trim()))}return y(""),!0};const G=!v&&0===A.length;return i.a.createElement(Oo,{dir:B,inspectorOpen:L},i.a.createElement(Yr,{alwaysShow:!N&&k,inputMax:U,inputLength:v.length,shake:p}),i.a.createElement("form",{autoComplete:"off",action:"#",onSubmit:q},i.a.createElement(Eo,null,i.a.createElement(fe.b,{targetHeight:d,active:G?0:1,hasFiles:(null==A?void 0:A.length)>0},0===A.length&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Co,{id:"chat-box-composer","data-cy":"chat-box-composer","aria-hidden":!n,"aria-label":F,"aria-labelledby":"chat-bubble-bot-name",name:"message",$hide:z?1:0,disabled:!n||z,$active:G?0:1,ref:l,placeholder:F,type:"text",onChange:e=>{const{value:t}=e.target;N?(e=>{const t=e.length>0;clearTimeout(Ao),!P&&t?D(Object(le.pb)()):P&&!t&&D(Object(le.qb)()),Ao=setTimeout(()=>{D(Object(le.qb)())},5e3)})(t):t.length>U&&m(!0),y(t)},value:v,onFocus:function(){b(!0),Xr()&&setTimeout(()=>window.scrollTo(0,document.body.scrollHeight-360),150)},onBlur:()=>b(!1),onMouseDown:()=>{g||u()||r()},onHeightChange:f,$minHeight:41,onKeyDown:e=>{m(!1),"Enter"!==e.key||e.shiftKey||q(e)}}),i.a.createElement(ko,{hide:T?1:0},$)),i.a.createElement(io,null)),i.a.createElement(eo,null),i.a.createElement(_o,{isTextDirectionRtl:_},i.a.createElement(To,{"data-cy":"composer-settings","aria-hidden":G&&n?"false":"true",active:(z||G)&&n?1:0,role:"button",onClick:e=>{e.preventDefault(),D(Object(le.G)())},title:"Open settings"},i.a.createElement(h.p,{width:25,height:26})),i.a.createElement(So,{"data-cy":"composer-submit","aria-hidden":G||!n?"true":"false",active:z||G||!n?0:1,disabled:H,role:"button",onClick:q,title:"Send message",onMouseDown:e=>{e.preventDefault()}},i.a.createElement(h.o,{width:18,height:18}))))))};No.defaultProps={currentlyPoppedUp:!1};var Po=No;var Mo=n(32);var Ro=e=>{let{cancelChat:t,setCancelChat:n}=e;const{name:r,avatar:o,fullscreenMode:s,feedbackFormType:u,isTextDirectionRtl:l}=Object(c.d)(w.d),{optionsScreenOpen:d,chatHasStarted:f}=Object(c.d)(w.e),p=Object(c.c)(),m=!(d||s&&u===y.q.NONE),g=document.documentElement,b=l?"rtl":void 0,v=Object(a.useCallback)(()=>{p(Object(le.h)()),g.style.overflow="unset"},[p,g]);!function(e){let{onKeydown:t}=e;Object(a.useEffect)(()=>(window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)),[t])}({onKeydown:Object(a.useCallback)(e=>{const{tagName:t}=document.activeElement;"Escape"===e.code&&"BODY"===t&&v(),"Escape"===e.code&&"BODY"!==t&&document.activeElement.blur()},[v])});const x=Object(a.useCallback)(()=>{t?(p(Object(le.v)(s)),n(!1),g.style.overflow="unset"):n(!0)},[t,p,s,n,g]);return f?i.a.createElement(Mo.c,{dir:b,"data-cy":"chat-box-header"},i.a.createElement(Mo.d,null,o?i.a.createElement(Mo.f,{avatar:o}):i.a.createElement(ur,{height:30}),i.a.createElement(Mo.a,{isTextDirectionRtl:l,"aria-label":`Chat bot ${r||"Kindly"}`},r||"Kindly")),i.a.createElement(Mo.e,null,m&&i.a.createElement(i.a.Fragment,null,i.a.createElement(Mo.b,{"aria-label":"Minimize chat",title:"Minimize chat",type:"button",onClick:v,"data-cy":"minimize-chat-button"},i.a.createElement(h.m,{width:25,height:9})),i.a.createElement(Mo.b,{"aria-label":"End chat",title:"End chat",type:"button",onClick:x,"data-cy":"end-chat-button",isTextDirectionRtl:l},i.a.createElement(h.e,{width:25,height:25}))))):null};const Lo=s.c.div.withConfig({displayName:"styles__AboutChatContainer",componentId:"sc-pmmp3f-0"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;padding:0 0 20px 0;",";animation-duration:0.2s;animation-timing-function:ease-in;"],x.e),Do=s.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-pmmp3f-1"})(["height:100%;display:flex;text-align:center;flex-direction:column;justify-content:space-between;align-items:center;"]),Bo=s.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-pmmp3f-2"})(["width:100%;height:100%;display:flex;padding:0 30px;flex-direction:column;justify-content:center;align-items:center;"]),zo=Object(s.c)(P.f).withConfig({displayName:"styles__AboutParagraph",componentId:"sc-pmmp3f-3"})(["font-size:16px;a{color:",";}"],l.a.primaryColor),Uo=s.c.div.withConfig({displayName:"styles__LinkContainer",componentId:"sc-pmmp3f-4"})(["a{color:",";text-align:center;font-size:",";display:block;margin:60px 0 30px 0;:hover,:focus,:active,:visited{color:",";}}"],l.a.darkColor,l.c.fontSizeP,l.a.darkColor);var Ho=e=>{let{setAboutChat:t}=e;const{text:n}=Object(c.d)(w.d),{currentLanguage:r}=Object(c.d)(w.e),{defaultLanguage:o}=Object(Mn.a)(),s=Object(a.useCallback)(()=>t(!1),[t]),u=Object(a.useCallback)(e=>{"Enter"===e.key&&t(!1)},[t]),l=Object(a.useMemo)(()=>Object(Rn.a)(n,r,o),[r,o,n]),{back_to_chat_button:d}=l;return i.a.createElement(Lo,null,i.a.createElement(Do,null,i.a.createElement(Bo,null,i.a.createElement(P.b,null,"About Kindly"),i.a.createElement(zo,null,"This chatbot is powered by Kindly.",i.a.createElement("br",null),"To learn more about Kindly, visit"," ",i.a.createElement("a",{href:"https://www.kindly.ai/nb/products",target:"_blank",rel:"noopener noreferrer"},"this website."))),i.a.createElement(Uo,null,i.a.createElement(fe.c,{"aria-label":d,title:d,onClick:s,onKeyUp:u,tabIndex:"0",type:"button"},"‹ ",d))))},Fo=n(25);const $o=s.c.div.withConfig({displayName:"styles__PoweredContainer",componentId:"sc-16vfwd0-0"})(["z-index:2;display:flex;justify-content:center;"]),qo=s.c.span.withConfig({displayName:"styles__Blob",componentId:"sc-16vfwd0-1"})(["width:8px;height:8px;opacity:1;border-radius:100%;margin:0 4px 0 8px;background:#1cd300;background-color:#1cd300;"]),Go=Object(s.c)(P.g).withConfig({displayName:"styles__PoweredParagraph",componentId:"sc-16vfwd0-2"})(["display:flex;opacity:1;margin-bottom:0;align-items:baseline;span:first-child{opacity:0.6;}a{cursor:pointer;}"]);var Yo=e=>{let{hide:t,setAboutChat:n}=e;const r=Object(a.useCallback)(()=>n(!0),[n]),o=Object(a.useCallback)(e=>{"Enter"===e.key&&n(!0)},[n]);return i.a.createElement($o,{hide:t},i.a.createElement(Go,null,i.a.createElement("span",null,"Powered by")," ",i.a.createElement(qo,null),i.a.createElement(P.e,null,i.a.createElement(fe.c,{"aria-label":"Visit Kindly",title:"Visit Kindly",onClick:r,onKeyUp:o,type:"button",tabIndex:"0"},"Kindly"))))},Vo=e=>{const[t,n]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{t&&!e&&n(!1)},[e,t]),{showAboutChat:t,setShowAboutChat:n}};const Wo=s.c.div.withConfig({displayName:"styles__CancelChatContainer",componentId:"sc-1gy1mo2-0"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;padding:0 0 20px 0;",";animation-duration:0.2s;animation-timing-function:ease-in;"],x.e),Ko=s.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-1gy1mo2-1"})(["height:100%;display:flex;text-align:center;flex-direction:column;justify-content:space-between;align-items:center;"]),Xo=s.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-1gy1mo2-2"})(["width:100%;height:100%;display:flex;padding:0 30px;justify-content:center;align-items:center;"]),Jo=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1gy1mo2-3"})(["button{margin:auto;}a{color:",";text-align:center;font-size:",";display:block;margin:60px 0 30px 0;:hover,:focus,:active,:visited{color:",";}}"],l.a.darkColor,l.c.fontSizeP,l.a.darkColor),Qo=s.c.div.withConfig({displayName:"styles__CancelChatFooter",componentId:"sc-1gy1mo2-4"})(["div{display:flex;position:unset;align-items:center;}"]);var Zo=e=>{let{setCancelChat:t}=e;const n=Object(c.c)(),{text:r}=Object(c.d)(w.d),{currentLanguage:o,active:s}=Object(c.d)(w.e),{setShowAboutChat:u}=Vo(s),{defaultLanguage:l}=Object(Mn.a)(),d=document.documentElement,f=Object(a.useMemo)(()=>Object(Rn.a)(r,o,l),[o,l,r]),p=Object(a.useCallback)(()=>{n(Object(le.v)()),t(!1),d.style.overflow="unset"},[n,t,d]),h=Object(a.useCallback)(()=>t(!1),[t]),m=Object(a.useCallback)(e=>{"Enter"===e.key&&t(!1)},[t]),{back_to_chat_button:g,cancel_chat_button:b,cancel_chat_text:v}=f;return i.a.createElement(Wo,null,i.a.createElement(Ko,null,i.a.createElement(Xo,null,i.a.createElement(P.a,null,v)),i.a.createElement(Jo,null,i.a.createElement(Fo.a,{"aria-label":b,title:b,onClick:p,type:"button",color:!0,text:b,cy:"cancel-chat-button"}),i.a.createElement(fe.c,{"aria-label":g,title:g,onClick:h,onKeyUp:m,type:"button",tabIndex:"0"},"‹ ",g)),i.a.createElement(Qo,null,i.a.createElement(Yo,{setAboutChat:u}))))},ea=(n(36),n(39));const ta=Object(s.c)(fe.c).withConfig({displayName:"styles__FooterLink",componentId:"sc-1l968t6-0"})(["display:block;color:",";text-align:center;margin:30px 0;font-size:",";:hover,:focus,:active,:visited{color:",";}"],l.a.darkColor,l.c.fontSizeP,l.a.darkColor),na=s.c.div.withConfig({displayName:"styles__OptionsContainer",componentId:"sc-1l968t6-1"})(["overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;text-align:center;display:grid;grid-template-rows:1fr 40px;@media (max-height:610px){overflow:scroll;}"]),ra=(s.c.div.withConfig({displayName:"styles__ContainerInner",componentId:"sc-1l968t6-2"})(["height:100%;text-align:center;display:grid;grid-template-rows:1fr 40px;"]),s.c.div.withConfig({displayName:"styles__GenericContainer",componentId:"sc-1l968t6-3"})(["display:grid;grid-gap:15px;grid-template-rows:auto 1fr;@media ","{grid-gap:0;overflow:scroll;grid-template-rows:1fr;}"],l.b.maxPhoneHeight)),oa=s.c.div.withConfig({displayName:"styles__DeleteContainer",componentId:"sc-1l968t6-4"})(["display:grid;grid-template-rows:1fr auto;@media ","{grid-template-rows:1fr;}"],l.b.maxPhoneHeight),aa=s.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-1l968t6-5"})(["width:100%;height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px 30px;h1{margin:0;width:100%;}h3{display:flex;align-items:center;justify-content:center;svg{margin-right:30px;}}h4{margin-top:30px;width:100%;}"]),ia=(s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1l968t6-6"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;&:last-child{margin-top:10px;}svg{margin-right:15px;}}"]),Object(s.c)(ea.a).withConfig({displayName:"styles__OptionsButton",componentId:"sc-1l968t6-7"})(["overflow:hidden;white-space:nowrap;text-overflow:ellipsis;"])),ca=s.c.div.withConfig({displayName:"styles__OptionsFooter",componentId:"sc-1l968t6-8"})(["div{position:unset;display:flex;flex-direction:column;align-items:center;}"]);var sa=e=>{let{textContent:t}=e;const{chat_deleted_header:n,chat_deleted_text:r}=t;return i.a.createElement(i.a.Fragment,null,i.a.createElement(aa,null,i.a.createElement(P.a,null,n),i.a.createElement(P.d,null,r)))};const ua="GENERIC",la="LANGUAGE",da="DOWNLOAD",fa="DELETE_CHAT_CONFIRM",pa="CHAT_DELETED",ha=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-c6vrbi-0"})(["max-width:100%;padding:0 15px;flex-direction:column;display:flex;align-items:center;margin:unset;button{margin-bottom:10px;&:last-child{margin-top:0;}}"]);var ma=e=>{let{textContent:t,setOptionsView:n}=e;const r=Object(c.c)(),{back_to_chat_button:o,delete_text:s,delete_button:u}=t,l=document.documentElement,d=Object(a.useCallback)(()=>{n(pa),r(Object(le.q)()),l.style.overflow="unset"},[n,r,l]);return i.a.createElement(i.a.Fragment,null,i.a.createElement(aa,null,i.a.createElement(P.a,null,s)),i.a.createElement(ha,null,i.a.createElement(Fo.a,{"aria-label":u,title:u,onClick:d,type:"button",text:u,color:!0,cy:"confirm-delete-chat"}),i.a.createElement(ta,{"aria-label":o,title:o,onClick:()=>n(ua),type:"button"},"‹ ",o)))};const ga=s.c.div.withConfig({displayName:"styles__SelectionContainer",componentId:"sc-mbgnew-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;"]),ba=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-mbgnew-1"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;}"]);var va=e=>{let{textContent:t,setOptionsView:n}=e;const r=Object(c.c)(),{back_to_chat_button:o,download_button:s,download_format_text:u}=t,l=Object(a.useCallback)(async()=>{r(await Object(le.w)({},"html"))},[r]),d=Object(a.useCallback)(async()=>{r(Object(le.w)({},"json"))},[r]);return i.a.createElement(i.a.Fragment,null,i.a.createElement(aa,null,i.a.createElement(P.d,null,u)),i.a.createElement(ga,null,i.a.createElement(ba,null,i.a.createElement(ia,{"aria-label":`${s} (HTML)`,title:`${s} (HTML)`,onClick:l,type:"button","data-cy":"download-chat-html"},`${s} (HTML)`),i.a.createElement(ia,{"aria-label":`${s} (JSON)`,title:`${s} (JSON)`,onClick:d,type:"button","data-cy":"download-chat-json"},`${s} (JSON)`)),i.a.createElement(ta,{"aria-label":o,title:o,onClick:()=>n(ua),type:"button"},"‹ ",o)))};const ya=s.c.div.withConfig({displayName:"styles__Header",componentId:"sc-crpo3y-0"})(["width:100%;height:",";background:",";background-color:",";@media ","{display:none;}"],e=>e.long?"180px":"210px",e=>e.theme.headerBackground,e=>e.theme.headerBackground,l.b.maxPhoneHeight),wa=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-crpo3y-1"})(["max-width:100%;margin:auto;padding:0 15px;display:flex;flex-direction:column;button{margin-bottom:10px;&:last-child{margin-top:10px;}svg{margin-right:15px;}}"]);var xa=e=>{let{languages:t,textContent:n,setOptionsView:r}=e;const o=Object(c.c)(),{back_to_chat_button:s,change_language_button:u,download_button:l,delete_button:d,start_over_button:f}=n,p=Object(a.useCallback)(()=>{o(Object(le.v)(!0))},[o]),m=Object(a.useCallback)(()=>{o(Object(le.k)())},[o]);return i.a.createElement(i.a.Fragment,null,i.a.createElement(ya,{long:t.length>1}),i.a.createElement(wa,null,t.length>1&&i.a.createElement(ia,{"aria-label":u,title:u,onClick:()=>r(la),type:"button","data-cy":"change-language-option"},i.a.createElement(h.l,{width:18,height:14}),u),i.a.createElement(ia,{"aria-label":f,title:f,onClick:p,type:"button","data-cy":"restart-chat-option"},f),i.a.createElement(ia,{"aria-label":d,title:d,onClick:()=>r(fa),type:"button","data-cy":"delete-chat-option"},d),i.a.createElement(ia,{"aria-label":l,title:l,onClick:()=>r(da),type:"button","data-cy":"download-chat-option"},l),i.a.createElement(ia,{"aria-label":s,title:s,onClick:m,type:"button","data-cy":"back-to-chat-option",color:"1",autoFocus:!0},s)))};const Oa=s.c.div.withConfig({displayName:"styles__SelectionContainer",componentId:"sc-1hbxmch-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;"]),Ea=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1hbxmch-1"})(["max-width:100%;padding:0 15px;flex-direction:column;display:flex;align-items:center;margin:unset;button{margin-bottom:10px;&:last-child{margin-top:0;}}"]),ka=s.c.div.withConfig({displayName:"styles__ButtonFooter",componentId:"sc-1hbxmch-2"})(["margin-bottom:15px;button{display:block;margin:0 auto 30px;}"]);var Ca=e=>{let{languages:t,currentLanguage:n,textContent:r,setOptionsView:o}=e;const[s,u]=Object(a.useState)(n);Object(a.useEffect)(()=>{u(n)},[n,u]);const l=Object(a.useCallback)(()=>o(ua),[o]),d=Object(a.useCallback)(e=>{"Enter"===e.key&&o(ua)},[o]),f=Object(c.c)(),{confirm_action_button:p,back_to_chat_button:m,change_language_button:g,change_language_text:b}=r;return i.a.createElement(i.a.Fragment,null,i.a.createElement(aa,null,i.a.createElement(P.c,null,i.a.createElement(h.l,{width:35,height:39}),g),i.a.createElement(P.f,null,b)),i.a.createElement(Oa,null,i.a.createElement(Ea,null,t.map(e=>i.a.createElement(Fo.a,{key:e.code,"aria-label":e.name,title:e.name,onClick:()=>u(e.code),text:e.name,flat:e.code===s,selected:e.code===s,cy:`${e.code}-button`}))),i.a.createElement(ka,null,s!==n&&i.a.createElement(Fo.a,{"aria-label":p,title:p,onClick:()=>{f(Object(le.Q)(s))},type:"submit",text:p,color:!0}),i.a.createElement(ta,{"aria-label":m,title:m,onClick:l,onKeyUp:d,tabIndex:"0",type:"button"},"‹ ",m))))};var _a=e=>{let{setAboutChat:t}=e;const{text:n}=Object(c.d)(w.d),{languages:r,defaultLanguage:o}=Object(Mn.a)(),{currentLanguage:s}=Object(c.d)(w.e),{chatDeleted:u}=Object(c.d)(w.n),[l,d]=Object(a.useState)(u?pa:ua),f=Object(a.useMemo)(()=>Object(Rn.a)(n,s,o),[s,o,n]);return i.a.createElement(na,null,l===ua||l===da||l===la?i.a.createElement(ra,null,l===ua&&i.a.createElement(xa,{languages:r,textContent:f,setOptionsView:d}),l===da&&i.a.createElement(va,{languages:r,textContent:f,setOptionsView:d}),l===la&&i.a.createElement(Ca,{languages:r,textContent:f,currentLanguage:s,setOptionsView:d})):i.a.createElement(oa,null,l===pa&&i.a.createElement(sa,{textContent:f}),l===fa&&i.a.createElement(ma,{setOptionsView:d,textContent:f})),i.a.createElement(ca,null,i.a.createElement(Yo,{setAboutChat:t})))},ja=n(55);const Ta=s.c.div.withConfig({displayName:"styles__SelectContainer",componentId:"sc-1lfni2n-0"})(["position:relative;width:fit-content;&:before{content:'';position:absolute;right:11px;top:50%;transform:translateY(-50%);width:0;height:0;z-index:1;border-top:7px solid #2c2c2c;border-left:4px solid transparent;border-right:4px solid transparent;}"]),Sa=s.c.div.withConfig({displayName:"styles__IconContainer",componentId:"sc-1lfni2n-1"})(["position:absolute;top:10px;left:8px;svg{path{fill:#333;}}"]),Ia=s.c.select.withConfig({displayName:"styles__Select",componentId:"sc-1lfni2n-2"})(["cursor:pointer;appearance:none;border-radius:5px;font-size:",";border:1px solid #dedede;padding:8px 30px 8px 11px;position:relative;color:#2c2c2c;background:transparent;background-color:transparent;"," ",""],l.c.fontSizeH5,e=>e.icon&&"padding-left: 30px;",m.b),Aa=e=>{let{children:t,onClick:n,onChange:r,value:o,name:a,icon:c,...s}=e;return i.a.createElement(Ta,null,c&&i.a.createElement(Sa,null,i.a.createElement(h.l,{width:18,height:14})),i.a.createElement(Ia,Object.assign({onClick:n,onChange:r,value:o,name:a,icon:c},s),t))};Aa.defaultProps={icon:!1,onClick:ja.a,onChange:ja.a};var Na=Aa,Pa=n(37);const Ma=s.c.div.withConfig({displayName:"styles__WelcomePageContainer",componentId:"sc-elyt0g-0"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;background:#fff;background-color:#fff;"]),Ra=Object(s.b)(["background-size:cover;background-position:center;background-image:url(",");"],e=>e.welcomePageImage),La=s.c.div.withConfig({displayName:"styles__HeaderContent",componentId:"sc-elyt0g-1"})(["flex:1;height:100%;max-height:250px;padding:18px 18px 0;background:",";background-color:",";",";@media (max-height:610px){display:none;}"],e=>e.theme.headerBackground,e=>e.theme.headerBackground,e=>e.welcomePageImage&&Ra),Da=s.c.div.withConfig({displayName:"styles__IntroContent",componentId:"sc-elyt0g-2"})(["flex:1;padding:15px 30px 30px;border-top:5px solid ",";@media ","{padding:30px;}@media (max-height:610px){overflow:scroll;}"],e=>e.theme.headerBackground,l.b.maxTablet),Ba=s.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-elyt0g-3"})(["height:100%;display:flex;flex-direction:column;justify-content:space-between;"]),za=s.c.div.withConfig({displayName:"styles__TextContainer",componentId:"sc-elyt0g-4"})(["padding:20px 0;"]),Ua=s.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-elyt0g-5"})(["display:flex;align-items:center;justify-content:space-between;button:first-child{@media ","{min-width:unset;}}"],l.b.maxTablet),Ha=Object(s.c)(fe.a).withConfig({displayName:"styles__CloseButton",componentId:"sc-elyt0g-6"})(["display:flex;align-items:center;padding:7px;color:",";background:",";background-color:",";border-color:",";border-radius:100px;"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground),Fa=Object(s.c)(P.a).withConfig({displayName:"styles__TitleText",componentId:"sc-elyt0g-7"})(["color:",";font-weight:500;font-size:",";margin:0 0 15px;"],l.a.textColor,l.c.fontSizeH3),$a=s.c.div.withConfig({displayName:"styles__IntroText",componentId:"sc-elyt0g-8"})(["color:",";max-height:180px;overflow:hidden;font-size:",";margin:30px 0 10px 0;line-height:24px;div{& >:first-child{margin-top:0;}& >:last-child{margin-bottom:0;}a{color:#0000c6;}a:visited{color:#5b096e;}}strong{font-weight:500;}"],l.a.textColor,l.c.fontSizeH5),qa=Object(Vr.a)();var Ga=()=>{const[e,t]=Object(a.useState)(!1),{active:n,currentLanguage:r,optionsScreenOpen:o,feedbackFormType:s}=Object(c.d)(w.e),{welcomePage:u,welcomePageType:l,fullscreenMode:d,isTextDirectionRtl:f}=Object(c.d)(w.d),{languages:p,defaultLanguage:m}=Object(Mn.a)(),g=Object(c.c)(),b=Object(a.useRef)(),v=document.documentElement,x=!(o||d&&s===y.q.NONE),O=f?"rtl":void 0;Object(a.useEffect)(()=>{n&&b.current.focus()},[n]);const E=u?((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"image"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:Object(Pa.a)(a,t,n)}},{}))(u,r,m):{header:"",text:"",start_button:""},k=Object(a.useCallback)(()=>{t(!0),g(Object(le.l)()),g(Object(le.Q)(r||p[0].code))},[g,r,p]),C=Object(a.useCallback)(()=>{g(Object(le.h)()),v.style.overflow="unset"},[g,v]),_=Object(a.useCallback)(e=>{g(Object(le.Q)(e))},[g]);return i.a.createElement(Ma,null,i.a.createElement(La,{welcomePageImage:"PICTURE"===l&&u.image},x&&i.a.createElement(Mo.b,{"aria-label":"Close chat",title:"Close chat",type:"button",onClick:C,"data-cy":"close-chat-button"},i.a.createElement(h.e,{width:25,height:25}))),i.a.createElement(Da,null,i.a.createElement(Ba,{dir:O},i.a.createElement("div",null,p.length>1&&i.a.createElement(Na,{icon:!0,name:"language-select","data-cy":"language-select",value:r,onChange:e=>_(e.target.value)},p.map(e=>i.a.createElement("option",{key:e.code,label:e.name,value:e.code},e.name))),i.a.createElement(za,null,i.a.createElement(Fa,null,E.header),i.a.createElement($a,null,mn(E.text)))),i.a.createElement(Ua,null,i.a.createElement(Fo.a,{cy:"start-chat-button",type:"button",title:E.start_button||"Start chat",onClick:k,size:"small",loading:e,color:!0,ref:b},E.start_button||"Start chat"),qa&&i.a.createElement(Ha,{type:"button",title:"Close",onClick:C,flat:!0,color:!0},i.a.createElement(h.e,{width:30,height:30}))))))};const Ya=Object(s.d)(["0%{opacity:0;}100%{opacity:1;}"]),Va=Object(s.b)(["",";animation-name:",";"],Object(x.a)(100),Ya),Wa=Object(s.d)(["0%{opacity:1;}100%{opacity:0;}"]),Ka=Object(s.b)(["",";animation-delay:50ms;animation-name:",";"],Object(x.a)(500),Wa),Xa=Object(s.b)(["",";"],e=>e.fullHeight?"top: 0; height: 100%;":"top: 55px; height: calc(100% - 55px); border-bottom-right-radius: 6px; border-bottom-left-radius: 6px"),Ja=s.c.div.withConfig({displayName:"styles__OverlayContainer",componentId:"sc-1xhdwt3-0"})(["width:100%;overflow:hidden;padding-bottom:5px;"," position:absolute;z-index:",";background:#fff;background-color:#fff;"," ",";"],Xa,l.d.overlayIndex,e=>!e.chatViewHidden&&Object(x.h)(300),e=>e.chatViewHidden?Va:Ka),Qa=e=>{let{showAboutChat:t,setShowAboutChat:n,showCancelConfirmation:r,setShowCancelConfirmation:o}=e;const{welcomePageType:a,hideHeader:s}=Object(c.d)(w.d),{chatHasStarted:u,optionsScreenOpen:l}=Object(c.d)(w.e),{chatDeleted:d}=Object(c.d)(w.n),f=!u&&a!==y.r.NONE,p=l||f||r||t||d;return i.a.createElement(Ja,{chatViewHidden:p,fullHeight:s||f},t&&!r&&i.a.createElement(Ho,{setAboutChat:n}),r&&i.a.createElement(Zo,{setCancelChat:o}),f&&i.a.createElement(Ga,null),(l||d)&&i.a.createElement(_a,{setAboutChat:n}))};Qa.defaultProps={fullHeight:!1,color:"#ffffff"};var Za=Qa;const ei=s.c.div.withConfig({displayName:"styles__Container",componentId:"sc-109olta-0"})(["display:flex;flex-direction:column;align-items:center;background:",";background-color:",";padding:1px 0 0;"," span{background:",";background-color:",";width:90%;height:1px;z-index:21;}"],e=>e.theme.background,e=>e.theme.background,fe.d,Object(lr.a)(.1,l.a.grayColor),Object(lr.a)(.1,l.a.grayColor)),ti=s.c.form.withConfig({displayName:"styles__Contents",componentId:"sc-109olta-1"})(["display:flex;flex-direction:column;width:100%;padding:0 24px 20px;input{margin-right:24px;border:1px solid rgba(0,0,0,0);:focus{border:1px solid rgba(0,0,0,0);}:invalid{","}}"],e=>{let{hasSubmitted:t}=e;return t&&"border-color: red;"}),ni=Object(s.c)(fe.a).withConfig({displayName:"styles__CloseButton",componentId:"sc-109olta-2"})(["min-height:25px;display:flex;align-items:center;font-size:",";padding:0;:hover{opacity:0.8;}"],l.c.fontSizeH4),ri=s.c.div.withConfig({displayName:"styles__Header",componentId:"sc-109olta-3"})(["display:flex;margin:4px 0 5px;color:",";font-size:",";align-items:center;"],e=>{let{theme:t}=e;return Object(Ln.a)(t.background,"white","black")},l.c.fontSizeP),oi=s.c.div.withConfig({displayName:"styles__FlexContainer",componentId:"sc-109olta-4"})(["display:flex;justify-content:space-between;align-items:center;button:first-child{margin-right:8px;}div + button{margin-left:12px;}"]),ai=s.c.input.withConfig({displayName:"styles__Input",componentId:"sc-109olta-5"})(["",""],fe.e),ii=Object.freeze({EMAIL:"email",PHONE:"phone_number"}),ci=(e,t)=>{const n=Object(c.c)(),{contactDetailsButton:r}=Object(c.d)(w.e),[o,u]=Object(a.useState)(""),[d,f]=Object(a.useState)(!1),p=Object(a.useRef)(),m=Object(s.e)(),g=r.contact_details.contact_type,{label:b,placeholder:v}=r.contact_details,y=Object(a.useMemo)(()=>Object(Ln.a)(m.background,l.a.grayColor,l.a.darkColor),[m.background]);function x(){n(Object(le.hb)())}return i.a.createElement(ei,{ref:t},i.a.createElement("span",null),i.a.createElement(ti,{hasSubmitted:d},i.a.createElement(ri,null,g&&i.a.createElement(ni,{"aria-label":"Cancel entering details",title:"Cancel entering details",type:"button",onClick:x,"data-cy":"minimize-chat-button",mobileOnly:!0},i.a.createElement(h.e,{width:25,height:12,stroke:y})),b),i.a.createElement(oi,null,i.a.createElement(fe.b,null,i.a.createElement(ai,{onChange:function(e){u(e.target.value)},value:o,type:g===ii.EMAIL?"email":"tel",ref:p,placeholder:v,required:!0})),i.a.createElement(So,{onClick:function(e){var t,a;return f(!0),!(null==p||null===(t=p.current)||void 0===t||null===(a=t.validity)||void 0===a||!a.valid)&&(e.preventDefault(),n(Object(le.L)(r,o)),x(),!1)},type:"submit",active:!0},i.a.createElement(h.o,{width:18,height:18})))))};var si=Object(a.forwardRef)(ci),ui=n(96);const li=Object(s.d)(["0%{opacity:0;transform:translateY(-6px);}60%{transform:translateY(2px);}100%{opacity:1;transform:translateY(0);}"]),di=Object(s.b)(["",";animation-name:",";"],Object(x.a)(),li),fi=s.c.div.withConfig({displayName:"styles__AlertContainer",componentId:"sc-efv8qo-0"})(["z-index:25;margin:15px;display:flex;padding:10px 15px;padding-right:10px;justify-content:space-between;border-radius:6px;background:#fff;background-color:#fff;box-shadow:0 3px 15px 1px ",";position:absolute;left:0;right:0;top:0;transition:top 150ms ease;",";",";"],l.a.shadowColor,e=>!e.isOnTop&&"top: 55px",di),pi=s.c.div.withConfig({displayName:"styles__AlertContent",componentId:"sc-efv8qo-1"})(["padding-right:5px;"]),hi=Object(s.c)(P.f).withConfig({displayName:"styles__ContentText",componentId:"sc-efv8qo-2"})(["margin:0;"]),mi=Object(s.c)(fe.c).withConfig({displayName:"styles__ContentLink",componentId:"sc-efv8qo-3"})(["font-size:14px;font-weight:500;margin-top:5px;display:block;color:",";"],l.a.primaryColor),gi=Object(s.c)(fe.a).withConfig({displayName:"styles__AlertDismiss",componentId:"sc-efv8qo-4"})(["z-index:15;display:flex;padding:0;height:fit-content;align-content:flex-start;flex-direction:column;&:hover{opacity:0.8;}svg path{stroke:",";}"],e=>e.theme.buttonBackground);var bi=()=>{const{welcomePageType:e}=Object(c.d)(w.d),{chatHasStarted:t,optionsScreenOpen:n}=Object(c.d)(w.e),{linkLocation:r,linkText:o,textContent:a}=Object(c.d)(w.k),s=Object(c.c)(),u=!t&&e!==y.r.NONE||n;return i.a.createElement(fi,{isOnTop:u},i.a.createElement(pi,null,i.a.createElement(hi,null,a),r&&o&&i.a.createElement(mi,{href:r,target:"_blank",rel:"noopener noreferrer"},o)),i.a.createElement(gi,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:e=>{e.stopPropagation(),s(Object(le.r)())},type:"button"},i.a.createElement(h.e,{width:20,height:20,color:"#000"})))},vi=n(74),yi=n(66);const wi=Object(Vr.a)();const xi=Object(Vr.a)();var Oi=e=>{let{bodyBottomElement:t,bodyElement:n,newMessage:r,bodyTopElement:o,groupRef:i}=e;const{chatMessages:s}=Object(c.d)(w.l),{isTyping:u}=Object(c.d)(w.d),{isTyping:l}=Object(c.d)(w.a),[d,f]=Object(a.useState)(!1),[p,h]=Object(a.useState)(!0),m=Boolean(r)||u||l,g=m&&Boolean(r&&r.from_bot),b=Object(a.useCallback)(((e,t)=>()=>{var n,r;if(!e.current)return!0;const o=null!==(n=null==t||null===(r=t.current)||void 0===r?void 0:r.clientHeight)&&void 0!==n?n:0,{scrollTop:a,offsetHeight:i,scrollHeight:c}=e.current;return o>0||a+i>=c-1})(n,t),[t,n]),v=Object(a.useCallback)(((e,t)=>()=>{if(!e.current||!t.current)return!0;const{scrollTop:n,scrollHeight:r}=e.current,{offsetHeight:o}=t.current;return!(r-n-30>=o)})(n,i),[t,n]),x=Object(a.useCallback)(((e,t)=>()=>{t.current&&0!==e.current.scrollHeight&&(xi?setTimeout(()=>{t.current.scrollIntoView()},300):t.current.scrollIntoView())})(n,t),[t,n]),O=Object(a.useCallback)(((e,t)=>()=>{t.current&&0!==e.current.scrollHeight&&(xi?setTimeout(()=>{t.current.scrollIntoView()},300):t.current.scrollIntoView())})(n,o),[o,n]);Object(a.useEffect)(()=>{0===s.length&&h(!0)},[s]),Object(a.useEffect)(()=>{var e,t;const n=(null==r||null===(e=r.buttonType)||void 0===e?void 0:e.toUpperCase())===y.b.QUICK_REPLY,o=(null==r||null===(t=r.handler)||void 0===t?void 0:t.toUpperCase())===y.f.TRIGGER_DIALOGUE;(n||o)&&O()},[r,O]);const E=((e,t)=>{const n=Object(a.useRef)(),r=Object(a.useRef)(),o=Object(a.useCallback)(()=>{r&&r.current&&clearTimeout(r.current)},[]),i=Object(a.useCallback)((function(){o();for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];n.current=i,r.current=setTimeout(()=>e(...n.current),t)}),[o,t,e]);return Object(a.useEffect)(()=>o,[o]),i})(Object(a.useCallback)(()=>{b()||v()?(h(!0),f(!1)):h(!1)},[b,v]),300);return Object(a.useEffect)(()=>{!b()&&p&&(r&&function(){let{from_bot:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!e}(r)?x():O())},[n,b,m,r,x,O,p]),Object(a.useEffect)(()=>{!g||d||b()||f(!0)},[b,g,d]),{shouldAutoScroll:p,scrollToBottom:x,scrollToLatestMessage:O,onUserScroll:E,hasUnreadMessage:d,isScrolledDown:b}};var Ei=e=>{let{buttonHandlers:t,onMessage:n=null}=e;const r=Object(a.useRef)(null),o=Object(a.useRef)(null),s=Object(a.useRef)(null),u=Object(a.useRef)(null),{hideHeader:l,fullscreenMode:d,offsetHeight:f}=Object(c.d)(w.d),{show:p,textContent:h}=Object(c.d)(w.k),{active:m,chatHasStarted:g,currentlyPoppedUp:b,contactDetailsButton:v,renderedBy:y}=Object(c.d)(w.e),{chatMessages:x}=Object(c.d)(w.l),O=(e=>{const t=ue(e),n=(e||[]).length;return Object(a.useMemo)(()=>n&&n!==(t||[]).length&&e[n-1],[e,n,t])})(x),{scrollToBottom:E,scrollToLatestMessage:k,shouldAutoScroll:C,onUserScroll:_,hasUnreadMessage:j,isScrolledDown:T}=Oi({bodyBottomElement:o,bodyTopElement:s,bodyElement:r,newMessage:O,groupRef:u}),S=ue(m);Object(a.useEffect)(()=>{m&&!S&&j&&E()},[j,m,E,S]);const[I,A]=Object(a.useState)(!0);Object(a.useEffect)(()=>{I?A(!1):Object(yi.c)(Object(vi.a)(O||{}),x.map(vi.a),n,y)},[I,n,O,x,y]);const P=(e=>{const[t,n]=Object(a.useState)(!1),r=ue(e);return Object(a.useEffect)(()=>{!e&&r&&n(!0)},[e,r]),t})(m),{showAboutChat:M,setShowAboutChat:R}=Vo(m),{showCancelConfirmation:L,setShowCancelConfirmation:D}=(e=>{const[t,n]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{t&&!e&&n(!1)},[e,t]),{showCancelConfirmation:t,setShowCancelConfirmation:n}})(m),{autoFocus:B,autoFocused:z}=(e=>{let{currentlyPoppedUp:t}=e;const[n,r]=Object(a.useState)(!1);return Object(a.useEffect)(()=>{n&&r(!1)},[n]),{autoFocus:Object(a.useCallback)(()=>{n||wi||t||r(!0)},[n,t]),autoFocused:n}})({currentlyPoppedUp:b}),U=Object(a.useCallback)(()=>{E(),B()},[B,E]);return i.a.createElement(N,{chatHasStarted:g,active:m,"aria-hidden":m?"false":"true","data-testid":"chat-box","data-cy":"chat-box",offsetHeight:f,fullscreen:d?1:0},i.a.createElement(ui.a,{errorPoint:"inside ChatBoxContainer"},!l&&i.a.createElement(Ro,{cancelChat:L,setCancelChat:D}),i.a.createElement(Za,{showAboutChat:M,setShowAboutChat:R,showCancelConfirmation:L,setShowCancelConfirmation:D}),i.a.createElement(ge,null),p&&h&&i.a.createElement(bi,null),i.a.createElement(Hr,{setAboutChat:R,hasUnreadMessage:j,onShowLatest:U,shouldAnimate:P,setBottomRef:o,setGroupRef:u,setTopRef:s,setBodyRef:r,scrollToBottom:E,scrollToLatestMessage:k,shouldAutoScroll:C,onUserScroll:_,buttonHandlers:t}),v?i.a.createElement(si,null):i.a.createElement(Po,{active:m,chatHasStarted:g,onManualFocus:E,isScrolledDown:T,autoFocused:z,currentlyPoppedUp:b})))};function ki(){const e=Object(c.c)(),{currentLanguage:t,active:n}=Object(c.d)(w.e),{maintenanceAlertEnabled:r,maintenanceAlert:o}=Object(c.d)(w.d),{defaultLanguage:i}=Object(Mn.a)();Object(a.useEffect)(()=>{if(!n||!r)return;const a=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"alert_enabled"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:Object(Pa.a)(a,t,n)}},{}))(o,t,i);e(Object(le.X)(a))},[n,t,e,o,r,i])}var Ci=n(97);const _i=Object.freeze({en:e=>`New message from ${e}`,nb:e=>`Ny melding fra ${e}`,sv:e=>`Nytt meddelande från ${e}`}),ji=Object.freeze({en:"An agent joined the conversation",nb:"En agent ble med i samtalen",sv:"En agent gick med i samtalet"});let Ti=!1;function Si(e){const t=document.title;let n;n||Ti||(Ti=!0,n=setInterval(()=>{document.title=document.title===e?t:e},1e3),window.addEventListener("mousemove",(function e(){clearInterval(n),document.title=t,n=null,Ti=!1,window.removeEventListener("mousemove",e)})))}var Ii=n(48);var Ai=n(64),Ni=n(29),Pi=n(77),Mi=n(69);const Ri=e=>({[e]:o.a.func});o.a.shape({...Object(Pi.a)(Ri,Object.values(y.b)),...Object(Pi.a)(Ri,Object.values(y.b).map(Mi.a))});var Li=n(43),Di=n(91);t.default=e=>{let{settings:t}=e;const n=Object(c.c)(),r=Object(a.useRef)(null),{active:o}=Object(c.d)(w.e),{open:s,imageUrl:u}=Object(c.d)(w.j),{inspectorOpen:l}=Object(c.d)(w.i),{chatMessages:d}=Object(c.d)(w.l),{takenOver:f}=Object(c.d)(w.a),m=ue(f),x=ue(d),O=localStorage.getItem("kindly-chat-restart-message"),E=Object(Ni.a)(t,"fullscreenMode",!1),k=Object(Ni.a)(t,"zIndex",y.d),C={...y.c,...Object(Ni.a)(t,"position",{})},_=document.documentElement;Object(a.useEffect)(()=>{Object(Vr.a)()&&(_.style.overflow=o?"hidden":"unset")},[o,_]),Object(a.useEffect)(()=>{if(0===(null==x?void 0:x.length)&&1===(null==d?void 0:d.length)&&O){const{message:e,exchangeId:t,newContext:r}=JSON.parse(O);localStorage.removeItem("kindly-chat-restart-message"),n(Object(Ai.g)(e,t,r))}},[n,d,x,O]),Object(a.useEffect)(()=>{m!==f&&f&&Object(Di.a)()},[m,f]),function(){const{tabNotification:e,name:t}=Object(c.d)(w.d),{showTabNotification:n}=Object(c.d)(w.b),{currentLanguage:r}=Object(c.d)(w.e),{takenOver:o}=Object(c.d)(w.a),{agent:i}=Object(c.d)(w.o),s=ue(o);Object(a.useEffect)(()=>{if(e&&n){var o;Si((null!==(o=null==_i?void 0:_i[r])&&void 0!==o?o:_i.en)(t||"Kindly"))}},[r,e,n,t]),Object(a.useEffect)(()=>{const e=Boolean(null==i?void 0:i.name);if(s!==o&&o&&e){var t;Si(null!==(t=null==ji?void 0:ji[r])&&void 0!==t?t:ji.en)}},[o,i,s,r])}(),function(){const e=Object(c.c)(),{botKey:t}=Object(c.d)(w.e),{persistStateLifespan:n}=Object(c.d)(w.d),{chatMessages:r}=Object(c.d)(w.l);Object(a.useEffect)(()=>{const o=Object(Ci.a)({botKey:t,persistStateLifespan:n});0===n||o||0===r.length||e(Object(le.e)(t))},[t,e,n,r])}(),function(){var e;const t=Object(c.c)(),[n,r]=Object(a.useState)("/"),{currentLanguage:o,active:i}=Object(c.d)(w.e),{nudges:s}=Object(c.d)(w.d),{defaultLanguage:u}=Object(Mn.a)(),l=null!==(e=null==s?void 0:s.textNudges)&&void 0!==e?e:[];Object(a.useEffect)(()=>{r(window.location.href),!i&&o&&(null==l?void 0:l.length)>0&&(null!=l?l:[]).forEach(e=>!(!Object(Ii.a)(n,e.url_trigger)||!e.enabled[o])&&t(Object(le.ab)({nudge:e,languageCode:o})))},[i,o,u,t,n,s,l])}(),ki(),(()=>{const{takenOver:e,requestedTakeover:t}=Object(c.d)(w.a),n=ue(e),r=ue(t),o=Object(c.c)();Object(a.useEffect)(()=>{e&&!n?o(Object(le.gb)()):!e&&n&&o(Object(le.db)()),t&&!r?o(Object(le.fb)()):!t&&r&&o(Object(le.eb)())},[o,r,n,t,e])})(),function(e){const t=Object(a.useCallback)(t=>{e&&"Tab"===t.key&&e.current.classList.add("using-tab")},[e]),n=Object(a.useCallback)(()=>{e&&e.current.classList.remove("using-tab")},[e]);Object(a.useEffect)(()=>(document.body.addEventListener("keyup",t),document.body.addEventListener("mousedown",n),()=>{document.body.removeEventListener("keyup",t),document.body.removeEventListener("mousedown",n)}),[t,n])}(r);const j=Object(a.useCallback)(()=>{n(Object(le.j)())},[n]),T=Object(a.useMemo)(()=>function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.entries(e).reduce((e,t)=>{let[n,r]=t;return{...e,[Object(Li.a)(n)]:r}},{})}(t.buttonHandlers),[t.buttonHandlers]);return i.a.createElement(p,{id:"chatContainer",ref:r,className:"chat-container",role:"complementary",active:o,zIndex:k,fullscreen:E?1:0,position:C,"data-cy":"chat-box-container"},s&&i.a.createElement(b,{zIndex:k,onClick:j,autoFocus:!0},i.a.createElement(g,{zIndex:k,onClick:j,autoFocus:!0},i.a.createElement(h.e,{width:"30",height:"30"})),i.a.createElement(v,{src:u})),o&&i.a.createElement(Ei,{buttonHandlers:T,onMessage:t.onMessage}),l&&i.a.createElement(de,null))}},function(e,t,n){"use strict";n.r(t);var r=n(4),o=n.n(r),a=n(0),i=n.n(a),c=n(3),s=n(1);const u=s.c.div.withConfig({displayName:"styles__NudgeBackdropContainer",componentId:"sc-1tcv57c-0"})(["display:block;top:-100vh;left:-100vw;height:200vh;width:200vw;position:fixed;cursor:pointer;transition:all ease 1200ms;background:",";opacity:",";z-index:",";"],e=>{let{backdrop:t}=e;return t.color||"#000"},e=>{let{backdrop:t}=e;return t.opacity||.5},e=>{let{backdrop:t}=e;return t.zIndex||-1});var l=e=>{let{backdrop:t,onClick:n}=e;return i.a.createElement(u,{onClick:n,backdrop:t})},d=n(5),f=n(8),p=n(6),h=n(18),m=n(27),g=n(93),b=e=>{let{slug:t}=e;const[n,r]=Object(a.useState)({}),[o,i]=Object(a.useState)(!0),{defaultLanguage:s}=Object(h.a)(),u=Object(g.a)(),{currentLanguage:l}=Object(c.d)(p.e);return Object(a.useEffect)(()=>{let e={};const n=u.find(e=>e.slug===t);var o;n&&t&&(null!=n&&n.text_blocks?n.text_blocks.map(t=>{const n=Object(m.a)(t,l,s);e[t.slug]=n.value}):e=Object(m.a)(n,l,s),i(Boolean(null==n||null===(o=n.text_blocks)||void 0===o?void 0:o.length)),r(e))},[u,l,s,t]),{textContent:n,hasTextContent:o}};var v=()=>{const{defaultLanguage:e}=Object(h.a)(),t=window.kindlyChat.APIRoot,n=Object(a.useRef)(t),{content:r,slug:o,onRendered:s}=Object(c.d)(p.m),{currentLanguage:u}=Object(c.d)(p.e),{textContent:l,hasTextContent:d}=b({slug:o});return Object(a.useEffect)(()=>{if(document.getElementById("kindly-custom-nudge"))return;const e="function"==typeof r?r(l):r;if(d&&0===Object.keys(l).length)return;const t=document.createElement("div");t.innerHTML=e,n.current.appendChild(t),t.setAttribute("id","kindly-custom-nudge"),"function"==typeof s&&s(t)},[r,u,e,o,l,s,d]),i.a.createElement(i.a.Fragment,null)},y=n(10);const w=s.c.div.withConfig({displayName:"styles__Section",componentId:"sc-7kvqgr-0"})(["margin:24px;"]);var x=e=>{let{html:t,slug:n}=e;const{textContent:r}=b({slug:n});return i.a.createElement(w,null,i.a.createElement("div",{dangerouslySetInnerHTML:{__html:"function"==typeof t?t(r):t}}))},O=(n(109),o.a.shape({success:o.a.string,error:o.a.string,input:o.a.shape({label:o.a.string,type:o.a.string,placeholder:o.a.string.isRequired,required:o.a.bool}),button:o.a.shape({title:o.a.string,icon:o.a.string,type:o.a.string})}),o.a.shape({id:o.a.string.isRequired,title:o.a.string,description:o.a.string,image:o.a.string.isRequired,price:o.a.string}),n(2)),E=n(31),k=n(9);const C=s.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1ywydhs-0"})(["margin:24px;"]),_=s.c.h2.withConfig({displayName:"styles__Title",componentId:"sc-1ywydhs-1"})(["font-size:16px;font-weight:500;line-height:26px;margin:0 0 16px 0;"]),j=s.c.p.withConfig({displayName:"styles__Description",componentId:"sc-1ywydhs-2"})(["line-height:22px;margin:0 0 16px 0;"]),T=s.c.a.withConfig({displayName:"styles__Link",componentId:"sc-1ywydhs-3"})(["line-height:22px;margin:0 0 16px 0;color:#0069ff;"]);var S=n(14);const I=s.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1aq8spp-0"})(["margin:24px;"]),A=s.c.div.withConfig({displayName:"styles__FormGroup",componentId:"sc-1aq8spp-1"})(["display:grid;grid-template-columns:1fr 44px;align-items:end;grid-gap:16px;"]),N=s.c.div.withConfig({displayName:"styles__InputContainer",componentId:"sc-1aq8spp-2"})(["display:flex;flex-direction:column;"]),P=s.c.label.withConfig({displayName:"styles__Label",componentId:"sc-1aq8spp-3"})(["font-size:16px;line-height:19px;margin-left:8px;margin-bottom:8px;"]),M=s.c.input.withConfig({displayName:"styles__Input",componentId:"sc-1aq8spp-4"})(["border:none;padding:14px 16px;border-radius:22px;font-size:14px;background:",";background-color:",";&:focus{color:#2c2c2c;box-shadow:none;border:none;","}"],e=>e.theme.inputBackground,e=>e.theme.inputBackground,S.b),R=s.c.button.withConfig({displayName:"styles__Button",componentId:"sc-1aq8spp-5"})(["cursor:pointer;box-shadow:none;height:44px;width:44px;padding:0;display:flex;align-items:center;justify-content:center;border:none;border-radius:100px;background:",";background-color:",";transition:opacity 0.1s ease-in;"," &:hover{opacity:0.8;}svg{margin-top:2px;margin-right:2px;transition:all 0.2s ease;path{fill:",";}}"],e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,S.b,e=>e.theme.buttonText);var L=e=>{let{buttonContent:t}=e;const{title:n}=t;return i.a.createElement(R,{role:"button",title:n,type:"submit"},i.a.createElement(y.o,{width:18,height:18}))};var D=e=>{let{value:t,setValue:n,inputContent:r}=e;const{label:o,type:a,placeholder:c,required:s}=r;return i.a.createElement(N,null,i.a.createElement(P,null,o),i.a.createElement(M,{"aria-label":c,"aria-labelledby":"newsletter-sign-up",name:o,placeholder:c,type:a||"text",value:t,onChange:e=>n(e.target.value),required:s}))};var B=e=>{let{form:t,onNewsletterSubmit:n,slug:r}=e;const o=Object(c.c)(),{dialogue:s,webhook:u}=Object(c.d)(p.m),{currentLanguage:l}=Object(c.d)(p.e),{defaultLanguage:d}=Object(h.a)(),[m,g]=Object(a.useState)(""),[b,v]=Object(a.useState)(!1),{success:y}=t;return i.a.createElement(i.a.Fragment,null,i.a.createElement(I,null,b&&y?i.a.createElement(j,null,y):i.a.createElement("form",{autoComplete:"off",action:"#",onSubmit:e=>{if(e.preventDefault(),g(""),!m.trim())return!1;if(s&&o(Object(f.lb)(s,{openChat:!0,languageCode:l||d.code})),u){const t={event:e,email:m};o(Object(k.f)({method:"post",url:u,data:t}))}if("function"==typeof n)try{n(e,m)}catch(e){}return o(Object(f.kb)({slug:r,eventType:O.u})),v(!0)}},i.a.createElement(A,null,i.a.createElement(D,{value:m,setValue:g,inputContent:t.input}),i.a.createElement(L,{buttonContent:t.button})))))};const z=s.c.div.withConfig({displayName:"styles__Section",componentId:"sc-1cs3brm-0"})(["margin:24px;"]),U=s.c.div.withConfig({displayName:"styles__SectionSeperator",componentId:"sc-1cs3brm-1"})(["height:1px;width:100%;background:rgba(0,0,0,0.1);"]),H=s.c.button.withConfig({displayName:"styles__Button",componentId:"sc-1cs3brm-2"})(["cursor:pointer;box-shadow:none;width:max-content;border:none;font-size:14px;font-weight:500;padding:8px 16px;border-radius:100px;margin-right:8px;margin-bottom:8px;color:",";background:",";background-color:",";transition:opacity 0.1s ease-in;"," &:hover{opacity:0.8;}"],e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,S.b);var F=e=>{let{text:t,dialogue:n,choiceSubmit:r}=e;return i.a.createElement(H,{role:"button",title:t,type:"submit",onClick:()=>{r(n)}},t)};var $=e=>{let{choices:t,slug:n}=e;const r=Object(c.c)(),{currentLanguage:o}=Object(c.d)(p.e),{defaultLanguage:s}=Object(h.a)(),{buttons:u}=t,l=Object(a.useCallback)(e=>{r(Object(f.lb)(e,{openChat:!0,languageCode:o||s.code})),r(Object(E.e)({slug:n,eventType:O.u,label:e}))},[o,s.code,r]);return i.a.createElement(i.a.Fragment,null,i.a.createElement(U,null),i.a.createElement(z,null,u.map(e=>{let{text:t,triggerDialogue:n}=e;return i.a.createElement(F,{key:`${t}-${n}`,text:t,dialogue:n,choiceSubmit:l})})))},q=n(45),G=n(95),Y=n(7),V=n(22);const W=s.c.a.withConfig({displayName:"stylesProduct__ProductWrapper",componentId:"sc-20xwq1-0"})(["text-decoration:none;color:initial;cursor:pointer;width:100%;"]),K=s.c.div.withConfig({displayName:"stylesProduct__Product",componentId:"sc-20xwq1-1"})(["display:flex;padding:2px;flex-direction:column;align-items:flex-start;overflow:hidden;"," @media ","{margin-right:16px;margin-bottom:3px;box-shadow:0px 1px 3px 0px ",";border-radius:8px;overflow:hidden;max-width:201px;&:first-child{margin-left:24px;}}"],S.b,Y.b.maxPhone,Y.a.shadowColor),X=s.c.img.withConfig({displayName:"stylesProduct__ProductImage",componentId:"sc-20xwq1-2"})(["width:155px;height:155px;object-fit:cover;border-radius:8px;margin-bottom:8px;@media ","{width:201px;height:201px;border-radius:0;margin-bottom:0;}"],Y.b.maxPhone),J=s.c.div.withConfig({displayName:"stylesProduct__Content",componentId:"sc-20xwq1-3"})(["max-width:100%;@media ","{padding:8px 16px;}"],Y.b.maxPhone),Q=Object(s.b)(["font-size:14px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;"]),Z=s.c.a.withConfig({displayName:"stylesProduct__ActionLink",componentId:"sc-20xwq1-4"})([""," color:#333;display:block;margin-top:8px;text-decoration:underline;cursor:hover;"],Q),ee=s.c.button.withConfig({displayName:"stylesProduct__ActionButton",componentId:"sc-20xwq1-5"})([""," padding:6px 0;border:none;cursor:pointer;margin-top:8px;width:100%;display:flex;align-items:center;justify-content:center;border-radius:100px;color:",";background:",";background-color:",";font-family:",";"],Q,e=>e.theme.buttonText,e=>e.theme.buttonBackground,e=>e.theme.buttonBackground,V.a.default),te=s.c.h4.withConfig({displayName:"stylesProduct__ProductTitle",componentId:"sc-20xwq1-6"})([""," font-weight:500;"],Q),ne=s.c.p.withConfig({displayName:"stylesProduct__ProductDescription",componentId:"sc-20xwq1-7"})([""," font-weight:400;"],Q),re=s.c.div.withConfig({displayName:"stylesProduct__ProductPrice",componentId:"sc-20xwq1-8"})([""," font-weight:500;"],Q),oe=e=>{let{to:t,text:n,onClick:r}=e;return t?i.a.createElement(Z,{onClick:r,href:t},n):i.a.createElement(ee,{onClick:r},n)};var ae=e=>{var t,n,r,o,a,c;let{product:s,onProductClick:u}=e;const l=null!==(t=null==s?void 0:s.image)&&void 0!==t&&t,d=null!==(n=null==s?void 0:s.title)&&void 0!==n&&n,f=null!==(r=null==s?void 0:s.productUrl)&&void 0!==r&&r,p=null!==(o=null==s?void 0:s.description)&&void 0!==o&&o,h=(null==s?void 0:s.price)||!1,m=null!==(a=null==s?void 0:s.linkText)&&void 0!==a&&a,g=null!==(c=null==s?void 0:s.linkUrl)&&void 0!==c&&c;return i.a.createElement(K,null,i.a.createElement(W,{href:f},l&&i.a.createElement(X,{src:l,alt:d}),i.a.createElement(J,null,d&&i.a.createElement(te,null,d),p&&i.a.createElement(ne,null,p),h&&i.a.createElement(re,null,h))),m&&i.a.createElement(oe,{to:g,text:m,onClick:e=>{if("function"==typeof u)try{u(e,s)}catch(e){}}}))};const ie=s.c.div.withConfig({displayName:"stylesProducts__Container",componentId:"sc-vfg4fr-0"})(["margin:24px;@media ","{margin:24px 0;}"],Y.b.maxPhone),ce=s.c.div.withConfig({displayName:"stylesProducts__CarouselContainer",componentId:"sc-vfg4fr-1"})(["position:relative;overflow:hidden;> div{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:auto;grid-gap:14px;transform:translate(0);",";}"],e=>e.active&&"\n position: relative;\n width: 1000%;\n display: flex;\n grid-gap: 0px;\n "),se=s.c.h2.withConfig({displayName:"stylesProducts__Title",componentId:"sc-vfg4fr-2"})(["font-size:16px;font-weight:500;line-height:26px;margin:16px 0px;@media ","{margin:16px 24px;}"],Y.b.maxPhone),ue=e=>{let{children:t,carouselPosition:n,onTouchStart:r,onTouchMove:o,onTouchEnd:a}=e;return i.a.createElement(q.a.div,{transition:{ease:"easeInOut",duration:.3},style:{x:n},onTouchStart:r,onTouchMove:o,onTouchEnd:a},t)};var le=e=>{var t,n;let{section:r,onProductClick:o}=e;const{width:c}=(()=>{const[e,t]=Object(a.useState)({width:void 0,height:void 0});return Object(a.useEffect)(()=>{function e(){t({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",e),e(),()=>window.removeEventListener("resize",e)},[]),e})(),s=parseInt(Y.e.phone.replace("px",""),10),u=null!==(t=null==r?void 0:r.items)&&void 0!==t?t:[],l=null!==(n=null==r?void 0:r.title)&&void 0!==n&&n,{setIndex:d,imageIndex:f,carouselPosition:p}=(e=>{let{windowWidth:t,phoneWidth:n,ignoreDesktop:r=!0}=e;const[o,i]=Object(a.useState)(0),c=Object(q.b)(0);return Object(a.useEffect)(()=>{t>=n&&r&&c.set(0)},[t,n,c,r]),{setIndex:Object(a.useCallback)((e,r)=>{if(t>=n)return;if(e<0||e>=r.length)return;const o=-217*e;i(e),c.set(o)},[t,n,c]),imageIndex:o,carouselPosition:c}})({windowWidth:c,phoneWidth:s}),{handleTouchStart:h,handleTouchMove:m,handleTouchEnd:g}=Object(G.a)({carousel:u,index:f,setIndex:d});return i.a.createElement(ie,null,l&&i.a.createElement(se,null,l),i.a.createElement(ce,{active:c<s},i.a.createElement(ue,{carouselPosition:p,onTouchStart:h,onTouchMove:m,onTouchEnd:g},u.map((e,t)=>i.a.createElement(ae,{product:e,key:`product_${t}`,onProductClick:o})))))},de=n(70);var fe=e=>{let{buttons:t,slug:n}=e;const r=Object(c.c)(),o=t.length>0,s=Object(a.useCallback)(()=>{r(Object(E.e)({slug:n,eventType:O.u}))},[r]);return i.a.createElement(i.a.Fragment,null,o&&i.a.createElement(C,null,t.map((e,t)=>i.a.createElement(de.a,{button:e,key:`${e.value}-${t}`,isNudge:!0,onClick:s}))))};var pe=e=>{let{title:t,description:n,link:r,slug:o}=e;const s=Object(c.c)(),u=Object(a.useCallback)(e=>{e.preventDefault(),s(Object(E.e)({slug:o,eventType:O.u})),window.location.href=e.target.getAttribute("href")},[o]);return i.a.createElement(C,null,t&&i.a.createElement(_,null,t),n&&i.a.createElement(j,null,n),(null==r?void 0:r.location)&&(null==r?void 0:r.text)&&i.a.createElement(T,{href:r.location,onClick:u},r.text))};const he=e=>e||{location:"",text:""},me=e=>{var t,n,r,o,a,s,u,l;let{section:d,slug:f,onProductClick:p,onNewsletterSubmit:h}=e;const m=Object(c.c)(),g=null!==(t=null==d?void 0:d.title)&&void 0!==t&&t,b=null!==(n=null==d?void 0:d.description)&&void 0!==n&&n,v=null!==(r=null==d?void 0:d.buttons)&&void 0!==r&&r,y=null!==(o=null==d?void 0:d.products)&&void 0!==o&&o,w=null!==(a=null==d?void 0:d.choices)&&void 0!==a&&a,k=null!==(s=null==d?void 0:d.form)&&void 0!==s&&s,C=null!==(u=null==d?void 0:d.link)&&void 0!==u&&u,_=null!==(l=null==d?void 0:d.html)&&void 0!==l&&l;return i.a.createElement(i.a.Fragment,null,(g||b||C)&&i.a.createElement(pe,{title:g,description:b,link:he(C),slug:f}),v&&i.a.createElement(fe,{buttons:v,slug:f}),w&&i.a.createElement($,{choices:w,slug:f}),y&&i.a.createElement(le,{section:y,onProductClick:(e,t)=>{if(null!=t&&t.productUrl&&m(Object(E.e)({slug:f,eventType:O.u,label:t.productUrl})),"function"==typeof p)try{p(e,t)}catch(e){}}}),k&&i.a.createElement(B,{form:k,onNewsletterSubmit:h,slug:f}),_&&i.a.createElement(x,{html:_,slug:f}))};var ge=e=>{var t;let{layout:n,slug:r,onProductClick:o,onNewsletterSubmit:a}=e;return(null!==(t=null==n?void 0:n.sections)&&void 0!==t?t:[]).map((e,t)=>i.a.createElement(me,{key:`section-${t}`,section:e,slug:null!=r?r:null,onProductClick:o,onNewsletterSubmit:a}))},be=n(40);const ve=e=>{let{bubbleHidden:t,show:n,slug:r,layout:o,onDismiss:a,onProductClick:c,onNewsletterSubmit:s}=e;return i.a.createElement(be.b,{bubbleHidden:t,"aria-hidden":n?"false":"true","data-cy":"nudge-container"},i.a.createElement(be.a,null),i.a.createElement(be.c,{"aria-label":"Dismiss pushMessage",title:"Dismiss pushMessage",onClick:a,type:"button","data-cy":"close-nudge-button"},i.a.createElement(y.e,{width:25,height:25})),i.a.createElement(be.d,null,i.a.createElement(ge,{layout:o,slug:r,onProductClick:c,onNewsletterSubmit:s})))};ve.defaultProps={hidden:!1};var ye=ve;t.default=e=>{var t;let{hidden:n,layout:r,onDismiss:o,onProductClick:s,onNewsletterSubmit:u}=e;const{show:h,nudgeType:m,slug:g}=Object(c.d)(p.m),b=null!==(t=null==r?void 0:r.backdrop)&&void 0!==t&&t,y=Object(c.c)(),w=Object(a.useCallback)(e=>{if(e.stopPropagation(),y(Object(f.t)()),"function"==typeof o)try{o(e)}catch(e){}},[o,y]);return i.a.createElement(i.a.Fragment,null,b&&i.a.createElement(l,{backdrop:b,onClick:w}),m===d.i.TEMPLATE&&i.a.createElement(ye,{show:h,layout:r,slug:g,onDismiss:w,onProductClick:s,onNewsletterSubmit:u,bubbleHidden:n}),m===d.i.CUSTOM&&i.a.createElement(v,null))}},function(e,t,n){"use strict";n.r(t);n(4);var r=n(0),o=n.n(r),a=n(3),i=n(10),c=n(25);function s(e){const[t,n]=Object(r.useState)(!1);return[t,Object(r.useCallback)(t=>{n(!0),e(t)},[e])]}n(36);var u=n(1),l=n(7),d=n(40);const f="cubic-bezier(0.18, 0.58, 0.37, 0.92)",p=Object(u.c)(d.c).withConfig({displayName:"styles__NudgeFeedbackDismiss",componentId:"sc-mc1kkw-0"})([""]),h=Object(u.c)(d.a).withConfig({displayName:"styles__NudgeFeedbackBorderElement",componentId:"sc-mc1kkw-1"})([""]),m=Object(u.c)(d.b).withConfig({displayName:"styles__NudgeFeedbackContainer",componentId:"sc-mc1kkw-2"})(["z-index:20;",";@media ","{z-index:20;}"],e=>{let{modal:t}=e;return t&&"\n right: unset;\n bottom: unset;\n "},l.b.maxPhone),g=Object(u.c)(d.d).withConfig({displayName:"styles__NudgeFeedbackInner",componentId:"sc-mc1kkw-3"})(["min-width:380px;padding:0 20px;@media ","{padding:0 12px;max-width:",";width:auto;min-width:auto;}"],l.b.maxPhone,l.e.phone),b=(u.c.div.withConfig({displayName:"styles__Section",componentId:"sc-mc1kkw-4"})(["margin:24px;"]),u.c.h2.withConfig({displayName:"styles__Title",componentId:"sc-mc1kkw-5"})(["font-size:16px;font-weight:500;line-height:26px;margin:0 0 16px 0;"])),v=u.c.p.withConfig({displayName:"styles__Description",componentId:"sc-mc1kkw-6"})(["line-height:22px;"]),y=(u.c.a.withConfig({displayName:"styles__Link",componentId:"sc-mc1kkw-7"})(["line-height:22px;margin:0 0 16px 0;color:#0069ff;"]),u.c.div.withConfig({displayName:"styles__FeedbackContainer",componentId:"sc-mc1kkw-8"})(["border-radius:14px;overflow:hidden;position:relative;background:#fff;background-color:#fff;height:100%;width:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:24px 0;opacity:0;",";transition:opacity 0.15s linear 0.2s,transform "," 300ms;"],e=>e.hasEntered&&"opacity: 1",f)),w=u.c.div.withConfig({displayName:"styles__FeedbackFormContent",componentId:"sc-mc1kkw-9"})(["text-align:center;width:100%;"," ",""],e=>e.ratingSent&&`transition: all ${f} 300ms;`,e=>e.finished&&"z-index: 11; position: relative; opacity: 0;"),x=u.c.div.withConfig({displayName:"styles__FeedbackThanksContainer",componentId:"sc-mc1kkw-10"})(["opacity:0;margin-top:16px;text-align:center;transition:all "," 300ms;",""],f,e=>{let{finished:t}=e;return t&&"opacity: 1;"}),O=u.c.div.withConfig({displayName:"styles__FeedbackStepContainer",componentId:"sc-mc1kkw-11"})(["width:100%;opacity:1;transition:all "," 300ms;",""],f,e=>{let{hasRated:t}=e;return t&&"display: none;"}),E=u.c.div.withConfig({displayName:"styles__FeedbackEmojiContainer",componentId:"sc-mc1kkw-12"})(["height:fit-content;min-height:35px;cursor:pointer;margin:0 0 16px 0;transition:all ease 300ms;",";"],e=>e.hovering&&"\n .emoji.chosen {\n opacity: 1;\n }\n .emoji:not(.chosen) {\n opacity: 0.4;\n }\n "),k=u.c.span.withConfig({displayName:"styles__StyledEmoji",componentId:"sc-mc1kkw-13"})(["display:inline-block;margin:0 10px;transition:opacity 0.1s linear;background:none;border:none;padding:0;cursor:pointer;"]),C=Object(u.c)(b).withConfig({displayName:"styles__Title",componentId:"sc-1qibng2-0"})([""]),_=Object(u.c)(O).withConfig({displayName:"styles__StepContainer",componentId:"sc-1qibng2-1"})([""]),j=u.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-1qibng2-2"})(["display:flex;justify-content:center;margin-top:30px;button{width:70px;min-width:auto;margin:0 15px;}"]);var T=e=>{let{submit:t,textContent:n}=e;const[r,a]=s(t),{binary_headline:i,binary_1:u,binary_0:l}=n;return o.a.createElement(_,{hasRated:r},o.a.createElement(C,null,i),o.a.createElement(j,null,o.a.createElement(c.a,{type:"submit",onClick:()=>a(2),color:!0,flat:!0,text:u}),o.a.createElement(c.a,{type:"submit",onClick:()=>a(1),color:!0,flat:!0,text:l})))},S=n(159),I=n.n(S),A=n(160),N=n.n(A),P=n(161),M=n.n(P);const R=Object(u.c)(b).withConfig({displayName:"styles__Title",componentId:"sc-1krelmc-0"})([""]),L=Object(u.c)(v).withConfig({displayName:"styles__Description",componentId:"sc-1krelmc-1"})([""]),D=Object(u.c)(O).withConfig({displayName:"styles__StepContainer",componentId:"sc-1krelmc-2"})([""]),B=Object(u.c)(E).withConfig({displayName:"styles__EmojiContainer",componentId:"sc-1krelmc-3"})([""]),z=Object(u.c)(k).withConfig({displayName:"styles__Emoji",componentId:"sc-1krelmc-4"})([""]),U=u.c.img.withConfig({displayName:"styles__EmojiImage",componentId:"sc-1krelmc-5"})(["height:35px;width:35px;"]),H={1:{src:M.a,description:"sad face"},2:{src:N.a,description:"neutral face"},3:{src:I.a,description:"happy face"}},F=e=>{let{number:t,selected:n,setTentativeRating:r,setRating:a}=e;const i=n===t,{src:c,description:s}=H[t];return o.a.createElement(z,{className:`emoji ${i?"chosen":""}`,onFocus:()=>r(t),onBlur:()=>r(0),onMouseEnter:()=>r(t),onMouseLeave:()=>r(0),role:"radio",tabIndex:"0","aria-checked":n,"aria-label":s,onKeyPress:e=>{"Enter"===e.key&&(a(t),e.preventDefault(),e.stopPropagation())},onClick:()=>a(t)},o.a.createElement(U,{src:c,alt:`${s} emoji`}))};var $=e=>{let{submit:t,textContent:n}=e;const[a,i]=Object(r.useState)(!1),[c,u]=Object(r.useState)(0),[l,d]=s(t),{emoji_guideline:f,emoji_headline:p}=n;return o.a.createElement(D,{hasRated:l},o.a.createElement(R,null,p),o.a.createElement(B,{hovering:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)},[1,2,3].map(e=>o.a.createElement(F,{key:`chat-feedback-emoji-${e}`,number:e,selected:c,setTentativeRating:u,setRating:d}))),o.a.createElement(L,null,f))},q=n(8),G=n(39);const Y=Object(u.c)(b).withConfig({displayName:"styles__Title",componentId:"sc-r8xh7-0"})([""]),V=Object(u.c)(O).withConfig({displayName:"styles__StepContainer",componentId:"sc-r8xh7-1"})([""]),W=u.c.a.withConfig({displayName:"styles__LinkButton",componentId:"sc-r8xh7-2"})([""," text-decoration:none;font-size:15px;width:fit-content;margin:0 auto;padding:11px 20px;font-weight:500;"],G.d);var K=e=>{let{textContent:t}=e;const{external_link_headline:n,external_link_text:i,external_link_url:c}=t,s=Object(a.c)(),u=Object(r.useCallback)(()=>s(Object(q.v)()),[s]);return o.a.createElement(V,{hasRated:!1},n&&i&&o.a.createElement(Y,null,n),o.a.createElement(W,{href:c,onClick:u,target:"_blank",rel:"noopener noreferrer",color:!0},i||n))};var X=()=>o.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},o.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#97cd72"}),o.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("path",{d:"M138.82,131.5a8.33,8.33,0,0,0-3.8.33c-8,2.78-20.62,4.58-34.91,4.58s-27-1.81-34.94-4.59c-.81-.2-3.45-.79-4.35-.15-.51.36-.2.8.25,1.16,7.16,4.38,21.93,8.77,39,8.77s31.74-4.36,39-8.71C139.53,132.44,140,131.78,138.82,131.5Z",fill:"#231e20"}));var J=()=>o.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},o.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#f47d7f"}),o.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("path",{d:"M138.82,141.47a8.33,8.33,0,0,1-3.8-.32c-8-2.78-20.62-4.58-34.91-4.58s-27,1.8-34.94,4.59c-.81.2-3.45.79-4.35.15-.51-.37-.2-.81.25-1.17,7.16-4.37,21.93-8.76,39-8.76s31.74,4.36,39,8.7C139.53,140.54,140,141.2,138.82,141.47Z",fill:"#231e20"}));var Q=()=>o.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},o.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#00a24a"}),o.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("path",{d:"M138.82,119.86c-1.26-1-2.94.14-3.8,1.08-8,9.27-20.62,15.28-34.91,15.28s-27-6-34.94-15.31c-.62-.8-3.05-2.42-4.35-.51-.93,1.38-.26,2.56.25,3.89,7.16,14.6,21.93,29.25,39,29.25s31.74-14.55,39-29C140.23,121.81,140,120.78,138.82,119.86Z",fill:"#231e20"}));var Z=()=>o.a.createElement("svg",{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 200 200"},o.a.createElement("circle",{cx:"100",cy:"100",r:"100",fill:"#ee2324"}),o.a.createElement("path",{d:"M138.78,153.13c-1.25,1-2.94-.13-3.8-1.08-7.95-9.27-20.62-15.28-34.9-15.28s-27,6-34.95,15.32c-.61.79-3,2.42-4.34.5-.94-1.38-.27-2.55.24-3.88C68.2,134.1,83,119.45,100.08,119.45S131.82,134,139,148.5C140.2,151.18,139.92,152.21,138.78,153.13Z",fill:"#231e20"}),o.a.createElement("circle",{cx:"73.1",cy:"70.11",r:"12.64",fill:"#231e20"}),o.a.createElement("circle",{cx:"125.97",cy:"70.11",r:"12.64",fill:"#231e20"}));const ee=Object(u.c)(b).withConfig({displayName:"styles__Title",componentId:"sc-1wxcq1r-0"})([""]),te=Object(u.c)(v).withConfig({displayName:"styles__Description",componentId:"sc-1wxcq1r-1"})([""]),ne=Object(u.c)(O).withConfig({displayName:"styles__StepContainer",componentId:"sc-1wxcq1r-2"})([""]),re=Object(u.c)(E).withConfig({displayName:"styles__EmojiContainer",componentId:"sc-1wxcq1r-3"})([""]),oe=Object(u.c)(k).withConfig({displayName:"styles__Emoji",componentId:"sc-1wxcq1r-4"})(["width:37px;margin:0 4px;"]),ae={1:{Component:Z,description:"very unhappy"},2:{Component:J,description:"unhappy"},3:{Component:X,description:"happy"},4:{Component:Q,description:"very happy"}},ie=e=>{let{number:t,selected:n,setTentativeRating:r,setRating:a}=e;const i=n===t,{Component:c,description:s}=ae[t];return o.a.createElement(oe,{className:`emoji ${i?"chosen":""}`,onFocus:()=>r(t),onBlur:()=>r(0),onMouseEnter:()=>r(t),onMouseLeave:()=>r(0),role:"radio",tabIndex:"0","aria-checked":n,"aria-label":s,onKeyPress:e=>{"Enter"===e.key&&(a(t),e.preventDefault(),e.stopPropagation())},onClick:()=>a(t)},o.a.createElement(c,{alt:`${s} emoji`}))};var ce=e=>{let{submit:t,textContent:n}=e;const[a,i]=Object(r.useState)(!1),[c,u]=Object(r.useState)(0),[l,d]=s(t),{emoji_guideline:f,emoji_headline:p}=n;return o.a.createElement(ne,{hasRated:l},o.a.createElement(ee,null,p),o.a.createElement(re,{hovering:a,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1)},[4,3,2,1].map(e=>o.a.createElement(ie,{key:`chat-feedback-happy-or-not-${e}`,number:e,selected:c,setTentativeRating:u,setRating:d}))),o.a.createElement(te,null,f))},se=n(14);Object(u.c)(b).withConfig({displayName:"styles__Title",componentId:"sc-1jtf9kh-0"})([""]);const ue=Object(u.c)(v).withConfig({displayName:"styles__Description",componentId:"sc-1jtf9kh-1"})([""]),le=Object(u.c)(O).withConfig({displayName:"styles__FreeformContainer",componentId:"sc-1jtf9kh-2"})(["z-index:11;opacity:0;visibility:hidden;display:flex;flex-direction:column;justify-content:center;align-items:center;",";",""],e=>{let{hasEntered:t}=e;return t&&"\n opacity: 1;\nvisibility: visible;"},e=>{let{finished:t}=e;return t&&"display: none;"}),de=u.c.textarea.withConfig({displayName:"styles__FreeformTextarea",componentId:"sc-1jtf9kh-3"})(["resize:none;width:100%;min-height:100px;max-width:250px;padding:6px 10px;background:",";font-size:14px;margin-bottom:30px;line-height:22px;color:#2c2c2c;font-family:Open sans,Helvetica Neue,Helvetica,Arial,sans-serif !important;border:1px solid #dedede;border-radius:6px;z-index:10;@media ","{font-size:16px;}"," &:hover,&:focus{color:#2c2c2c;border:1px solid #dedede;}"],l.a.grayColor,l.b.maxTablet,se.b);var fe=e=>{let{submit:t,textContent:n,finished:a}=e;const[i,s]=Object(r.useState)(!1),[u,l]=Object(r.useState)(""),{freeform_description:d,freeform_placeholder:f,send:p}=n;Object(r.useEffect)(()=>{s(!0)},[]);const h=Object(r.useCallback)(e=>{"Enter"===e.key&&t(u)},[u,t]),m=Object(r.useCallback)(e=>{l(e.target.value)},[]);return o.a.createElement(le,{hasEntered:i,finished:a},o.a.createElement(ue,null,d),o.a.createElement(de,{"data-cy":"feedback-freefrom-textarea",rows:4,value:u,onChange:m,placeholder:f}),o.a.createElement(c.a,{color:!0,flat:!0,text:p,type:"submit",onClick:()=>t(u),onKeyDown:h}))},pe=n(5),he=n(18),me=n(6),ge=n(37),be=n(55),ve=(n(52),n(22));const ye=u.c.div.withConfig({displayName:"styles__Wrapper",componentId:"sc-17jofst-0"})(["background:",";position:",";width:",";height:",";top:58px;left:0;z-index:",";display:flex;justify-content:center;align-items:center;font-family:",";"],e=>{let{modal:t,theme:n}=e;return t?n.background:"none"},e=>{let{modal:t}=e;return t?"fixed":"unset"},e=>{let{modal:t}=e;return t?"100%":0},e=>{let{modal:t}=e;return t?"100%":0},e=>{let{zIndex:t}=e;return`${t+10}`},ve.a.default);var we=e=>{let{children:t,modal:n,zIndex:r}=e;return o.a.createElement(ye,{modal:n,zIndex:r},t)};const xe=()=>{const[e,t]=Object(r.useState)(!1),[n,c]=Object(r.useState)(!1),[s,u]=Object(r.useState)(!1),{show:l}=Object(a.d)(me.m),{currentLanguage:d}=Object(a.d)(me.e),{fullscreenMode:f,zIndex:v}=Object(a.d)(me.d),{feedbackForm:O,feedbackForm:{freeform_enabled:E},feedbackFormType:k}=Object(a.d)(me.d),C=Object(a.c)(),{defaultLanguage:_}=Object(he.a)(),j=((e,t,n)=>Object.entries(e).filter(e=>{let[t]=e;return"freeform_enabled"!==t}).reduce((e,r)=>{let[o,a]=r;return{...e,[o]:Object(ge.a)(a,t,n)}},{}))(O,d,_);Object(r.useEffect)(()=>{u(!0)},[]);const S=Object(r.useCallback)(()=>{C(Object(q.i)())},[C]),I=Object(r.useCallback)(()=>{t(!0),setTimeout(()=>C(Object(q.i)()),2e3)},[C]),A=Object(r.useCallback)(e=>{C(Object(q.M)(e)),E?c(!0):I()},[I,C,E]),N=Object(r.useCallback)(e=>{C(Object(q.N)(e)),I()},[I,C]);let P;switch(k){case pe.q.BINARY:P=T;break;case pe.q.EMOJIS:P=$;break;case pe.q.HAPPY_OR_NOT:P=ce;break;case pe.q.EXTERNAL_LINK:P=K;break;default:console.error(`Feedback form type '${k}' not recognized`),P=()=>null}return o.a.createElement(we,{modal:f,zIndex:v},o.a.createElement(m,{"aria-hidden":l&&!f?"false":"true",modal:f,"data-cy":"feedback-nudge-container"},o.a.createElement(h,{modal:f}),o.a.createElement(p,{"aria-label":"Dismiss feedback",title:"Dismiss feedback",onClick:S,type:"button",modal:f},o.a.createElement(i.e,{width:25,height:25})),o.a.createElement(g,{modal:f},o.a.createElement(y,{hasEntered:s,finished:e},o.a.createElement(w,{finished:e,ratingSent:n},o.a.createElement(P,{textContent:j,submit:A}),n&&o.a.createElement(fe,{textContent:j,submit:N,finished:e})),e&&o.a.createElement(x,{finished:e},o.a.createElement(b,null,j.thanks))))))};xe.defaultProps={feedbackFormType:pe.q.EMOJIS,textContent:{},sendFeedback:be.a};t.default=xe},function(e,t,n){"use strict";n.r(t);n(4);var r=n(0),o=n.n(r),a=n(3),i=n(10),c=n(8),s=n(6),u=n(1),l=n(11),d=n(13),f=n(7);const p=Object(u.b)(["display:flex;overflow:hidden;z-index:-1;min-width:125px;height:45px;"]),h=u.c.div.withConfig({displayName:"styles__ToolsContainer",componentId:"sc-vkneg1-0"})(["z-index:0;width:15px;border-radius:7px;min-width:80px;margin-right:-25px;background:#fff;background-color:#fff;position:absolute;right:50px;box-shadow:0px 1px 5px 0px ",";transition:all 0.2s ease;",";",";"],f.a.shadowColorDark,e=>{let{hasInspector:t}=e;return t&&p},e=>{let{active:t}=e;return!t&&"min-width: 0"}),m=u.c.div.withConfig({displayName:"styles__LanguageContainer",componentId:"sc-vkneg1-1"})(["padding:2px;border-radius:7px;background:#fff;background-color:#fff;box-shadow:0px 1px 5px 0px ",";right:110px;display:flex;position:absolute;min-width:max-content;justify-content:center;",";"],f.a.shadowColorDark,l.f),g=Object(u.c)(d.c).withConfig({displayName:"styles__LanguageText",componentId:"sc-vkneg1-2"})(["color:#757575;margin:0;cursor:pointer;font-size:12px;font-weight:500;text-decoration:none;:hover{text-decoration:underline;}"]),b=u.c.div.withConfig({displayName:"styles__ButtonContainer",componentId:"sc-vkneg1-3"})(["display:flex;padding:2px;align-items:center;justify-content:space-between;"]),v=Object(u.c)(d.a).withConfig({displayName:"styles__ToolButton",componentId:"sc-vkneg1-4"})(["display:flex;position:relative;align-items:center;padding:13px;border-radius:7px;transition:all 0.15s ease;:hover{background:#",";background-color:#",";svg path{fill:#000;}:after{border-left-color:#000;}}"," ",""],f.a.grayColor,f.a.grayColor,e=>e.active&&`\n background: #${f.a.grayColor};\n background-color: #${f.a.grayColor};\n svg path {\n fill: #000;\n }\n `,e=>e.tail&&`\n :after {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n right: 5px;\n bottom: 3px;\n border-top: 3px solid transparent;\n border-bottom: 3px solid transparent;\n border-left: 3px solid ${e.active?"#000":f.a.primaryColor};\n transform: rotate(45deg);\n }`);var y=n(68),w=n(64);t.default=e=>{let{active:t}=e;const[n,u]=Object(r.useState)(!1),{botKey:l,admin:d}=Object(a.d)(s.e),{languages:f}=Object(a.d)(s.d),{inspectorOpen:p}=Object(a.d)(s.i),x=Object(a.c)(),O=Object(r.useCallback)(()=>{x(Object(c.ib)())},[x]);return function(){var e,t;const n=Object(a.c)(),{admin:o}=Object(a.d)(s.e),{chatMessages:i}=Object(a.d)(s.l)||[],c=null===(e=i.filter(e=>!(null!=e&&e.from_bot)).slice(-1))||void 0===e||null===(t=e[0])||void 0===t?void 0:t.message,u=Object(y.a)(e=>{n(Object(w.g)(e))},1e3),l=Object(r.useCallback)(e=>{e.altKey&&"KeyR"===e.code&&c&&u(c)},[c,u]);Object(r.useEffect)(()=>{if(o)return window.addEventListener("keydown",l,!0),()=>window.removeEventListener("keydown",l,!0)},[l,o])}(),o.a.createElement(o.a.Fragment,null,n&&t&&o.a.createElement(m,null,f.map(e=>o.a.createElement(v,{key:e.code,title:`Restart ${e.name}`,onClick:()=>{return t=e.code,x(Object(c.Q)(t)),void u(!1);var t}},o.a.createElement(g,null,e.code.toUpperCase())))),o.a.createElement(h,{active:t,hasInspector:d},d&&o.a.createElement(b,null,o.a.createElement(v,{onClick:O,title:p?"Close chat inspector":"Open chat inspector"},p?o.a.createElement(i.i,null):o.a.createElement(i.j,null))),o.a.createElement(b,null,o.a.createElement(v,{title:"Restart chat",onClick:()=>{f.length>1?u(!n):x(Object(c.bb)(l,!0))},active:n,tail:f.length>1},o.a.createElement(i.n,{width:15,height:15})))))}}])}));
|